aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/token-field/token-field.reel/token-field.html
blob: 2a2d98d49b6b6699b2c3759f244d0442309824f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>TokenField Template</title>
    <link rel="stylesheet" type="text/css" href="token-field.css">

    <script type="text/montage-serialization">
{

    "owner": {
        "prototype": "ui/token-field/token-field.reel",
        "properties": {
            "element": {"#": "token-field"},
            "_autocomplete": {"@": "autocomplete"},
            "_tokenList": {"@": "tokenList"},
            "_tokensController": {"@": "tokensController"}
        },
        "bindings": {
            "_suggestedValue": {"<-": "@autocomplete.suggestedValue"},
            "_autocompleteValue": {"<-": "@autocomplete.value"}
        }
    },
    "tokensController": {
        "prototype": "ui/controller/array-controller",
        "properties": {
            "selectObjectsOnAddition": true,
            "automaticallyOrganizeObjects": true
        },
        "bindings": {
            "content": {"<->": "@owner.values"}
        }
    },

    "tokenList": {
        "prototype": "ui/repetition.reel",
        "properties": {
            "element": {
                "#": "token-list"
            },
            "isSelectionEnabled": true,
            "contentController": {"@": "tokensController"},
            "orientation": "horizontal"
        }
    },

    "token": {
        "prototype": "ui/token-field/token.reel",
        "properties": {
            "element": {"#": "token"}
        },
        "bindings": {
            "value": {"<-": "@tokenList.objectAtCurrentIteration"},
            "tokensController": {"<-": "@tokenList.contentController"},
            "textPropertyPath": {"<-": "@owner.textPropertyPath"},
            "allowAdHocValues": {"<-": "@owner.allowAdHocValues"}
        }
    },
    "autocomplete": {
        "prototype": "ui/autocomplete/autocomplete.reel",
        "properties": {
            "element": {"#": "autocomplete"},
            "identifier": "autocomplete",
            "delay": "500",
            "value": ""
        },
        "bindings": {
            "textPropertyPath": {"<-": "@owner.textPropertyPath"},
            "placeholder": {"<-": "@owner.placeholder"}
        }
    }
}
    </script>

</head>
<body>
    <div data-montage-id="token-field" class="montage-token-field">
        <div data-montage-id="token-list" class="montage-token-list">
            <span data-montage-id="token"></span>
        </div>
        <span class="montage-autocomplete-wrapper">
            <input type="text" data-montage-id="autocomplete" class="montage-token-autocomplete" tabindex="0" />
        </span>
    </div>

</body>
</html>