aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/token-field/token-field.reel/token-field.html
blob: 1db5402587efab0fc993b06138d181819f765b3f (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
<!DOCTYPE html>
<!-- <copyright>
 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
 (c) Copyright 2011 Motorola Mobility, Inc.  All Rights Reserved.
 </copyright> -->
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" 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"}
        }
    },

    "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-tokenField">
        <div data-montage-id="token-list" class="montage-tokenField-list">
            <span data-montage-id="token"></span>
        </div>
        <input type="text" data-montage-id="autocomplete" class="montage-tokenField-autocomplete" tabindex="0">
    </div>
</body>
</html>