OLD | NEW |
1 // DO NOT EDIT: auto-generated with `pub run custom_element_apigen:update` | 1 // DO NOT EDIT: auto-generated with `pub run custom_element_apigen:update` |
2 | 2 |
3 /// Dart API for the polymer element `paper_input_behavior`. | 3 /// Dart API for the polymer element `paper_input_behavior`. |
4 @HtmlImport('paper_input_behavior_nodart.html') | 4 @HtmlImport('paper_input_behavior_nodart.html') |
5 library polymer_elements.lib.src.paper_input.paper_input_behavior; | 5 library polymer_elements.lib.src.paper_input.paper_input_behavior; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:js' show JsArray, JsObject; | 8 import 'dart:js' show JsArray, JsObject; |
9 import 'package:web_components/web_components.dart'; | 9 import 'package:web_components/web_components.dart'; |
10 import 'package:polymer_interop/polymer_interop.dart'; | 10 import 'package:polymer_interop/polymer_interop.dart'; |
11 import 'iron_control_state.dart'; | 11 import 'iron_control_state.dart'; |
12 | 12 |
13 /// Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-cont
ainer>`. This | 13 /// Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-cont
ainer>`. This |
14 /// behavior is implemented by `<paper-input>`. It exposes a number of propertie
s from | 14 /// behavior is implemented by `<paper-input>`. It exposes a number of propertie
s from |
15 /// `<paper-input-container>` and `<input is="iron-input">` and they should be b
ound in your | 15 /// `<paper-input-container>` and `<input is="iron-input">` and they should be b
ound in your |
16 /// template. | 16 /// template. |
17 /// | 17 /// |
18 /// The input element can be accessed by the `inputElement` property if you need
to access | 18 /// The input element can be accessed by the `inputElement` property if you need
to access |
19 /// properties or methods that are not exposed. | 19 /// properties or methods that are not exposed. |
20 @BehaviorProxy(const ['Polymer', 'PaperInputBehavior']) | 20 @BehaviorProxy(const ['Polymer', 'PaperInputBehavior']) |
21 abstract class PaperInputBehavior implements CustomElementProxyMixin, IronContro
lState { | 21 abstract class PaperInputBehavior implements CustomElementProxyMixin, IronContro
lState { |
22 | 22 |
| 23 /// Bind this to the `<input is="iron-input">`'s `accept` property, , used wit
h type=file. |
| 24 String get accept => jsElement[r'accept']; |
| 25 set accept(String value) { jsElement[r'accept'] = value; } |
| 26 |
23 /// Set this to specify the pattern allowed by `preventInvalidInput`. Bind thi
s to the | 27 /// Set this to specify the pattern allowed by `preventInvalidInput`. Bind thi
s to the |
24 /// `<input is="iron-input">`'s `allowedPattern` property. | 28 /// `<input is="iron-input">`'s `allowedPattern` property. |
25 String get allowedPattern => jsElement[r'allowedPattern']; | 29 String get allowedPattern => jsElement[r'allowedPattern']; |
26 set allowedPattern(String value) { jsElement[r'allowedPattern'] = value; } | 30 set allowedPattern(String value) { jsElement[r'allowedPattern'] = value; } |
27 | 31 |
28 /// Set to true to always float the label. Bind this to the `<paper-input-cont
ainer>`'s | 32 /// Set to true to always float the label. Bind this to the `<paper-input-cont
ainer>`'s |
29 /// `alwaysFloatLabel` property. | 33 /// `alwaysFloatLabel` property. |
30 bool get alwaysFloatLabel => jsElement[r'alwaysFloatLabel']; | 34 bool get alwaysFloatLabel => jsElement[r'alwaysFloatLabel']; |
31 set alwaysFloatLabel(bool value) { jsElement[r'alwaysFloatLabel'] = value; } | 35 set alwaysFloatLabel(bool value) { jsElement[r'alwaysFloatLabel'] = value; } |
32 | 36 |
33 /// Bind this to the `<input is="iron-input">`'s `autocapitalize` property. | 37 /// Bind this to the `<input is="iron-input">`'s `autocapitalize` property. |
34 String get autocapitalize => jsElement[r'autocapitalize']; | 38 String get autocapitalize => jsElement[r'autocapitalize']; |
35 set autocapitalize(String value) { jsElement[r'autocapitalize'] = value; } | 39 set autocapitalize(String value) { jsElement[r'autocapitalize'] = value; } |
36 | 40 |
37 /// Bind this to the `<input is="iron-input">`'s `autocomplete` property. | 41 /// Bind this to the `<input is="iron-input">`'s `autocomplete` property. |
38 String get autocomplete => jsElement[r'autocomplete']; | 42 String get autocomplete => jsElement[r'autocomplete']; |
39 set autocomplete(String value) { jsElement[r'autocomplete'] = value; } | 43 set autocomplete(String value) { jsElement[r'autocomplete'] = value; } |
40 | 44 |
41 /// Bind this to the `<input is="iron-input">`'s `autocorrect` property. | 45 /// Bind this to the `<input is="iron-input">`'s `autocorrect` property. |
42 String get autocorrect => jsElement[r'autocorrect']; | 46 String get autocorrect => jsElement[r'autocorrect']; |
43 set autocorrect(String value) { jsElement[r'autocorrect'] = value; } | 47 set autocorrect(String value) { jsElement[r'autocorrect'] = value; } |
44 | 48 |
45 /// Bind this to the `<input is="iron-input">`'s `autofocus` property. | 49 /// Bind this to the `<input is="iron-input">`'s `autofocus` property. |
46 bool get autofocus => jsElement[r'autofocus']; | 50 bool get autofocus => jsElement[r'autofocus']; |
47 set autofocus(bool value) { jsElement[r'autofocus'] = value; } | 51 set autofocus(bool value) { jsElement[r'autofocus'] = value; } |
48 | 52 |
| 53 /// Bind this to the `<input is="iron-input">`'s `autosave` property, used wit
h type=search. |
| 54 String get autosave => jsElement[r'autosave']; |
| 55 set autosave(String value) { jsElement[r'autosave'] = value; } |
| 56 |
49 /// Set to true to auto-validate the input value. Bind this to the `<paper-inp
ut-container>`'s | 57 /// Set to true to auto-validate the input value. Bind this to the `<paper-inp
ut-container>`'s |
50 /// `autoValidate` property. | 58 /// `autoValidate` property. |
51 bool get autoValidate => jsElement[r'autoValidate']; | 59 bool get autoValidate => jsElement[r'autoValidate']; |
52 set autoValidate(bool value) { jsElement[r'autoValidate'] = value; } | 60 set autoValidate(bool value) { jsElement[r'autoValidate'] = value; } |
53 | 61 |
54 /// Set to true to show a character counter. | 62 /// Set to true to show a character counter. |
55 bool get charCounter => jsElement[r'charCounter']; | 63 bool get charCounter => jsElement[r'charCounter']; |
56 set charCounter(bool value) { jsElement[r'charCounter'] = value; } | 64 set charCounter(bool value) { jsElement[r'charCounter'] = value; } |
57 | 65 |
58 /// Set to true to disable this input. Bind this to both the `<paper-input-con
tainer>`'s | 66 /// Set to true to disable this input. Bind this to both the `<paper-input-con
tainer>`'s |
(...skipping 15 matching lines...) Expand all Loading... |
74 | 82 |
75 /// Returns true if the value is invalid. Bind this to both the `<paper-input-
container>`'s | 83 /// Returns true if the value is invalid. Bind this to both the `<paper-input-
container>`'s |
76 /// and the input's `invalid` property. | 84 /// and the input's `invalid` property. |
77 bool get invalid => jsElement[r'invalid']; | 85 bool get invalid => jsElement[r'invalid']; |
78 set invalid(bool value) { jsElement[r'invalid'] = value; } | 86 set invalid(bool value) { jsElement[r'invalid'] = value; } |
79 | 87 |
80 /// The label for this input. Bind this to `<paper-input-container>`'s `label`
property. | 88 /// The label for this input. Bind this to `<paper-input-container>`'s `label`
property. |
81 String get label => jsElement[r'label']; | 89 String get label => jsElement[r'label']; |
82 set label(String value) { jsElement[r'label'] = value; } | 90 set label(String value) { jsElement[r'label'] = value; } |
83 | 91 |
84 /// The datalist of the input (if any). This should match the id of an existin
g <datalist>. Bind this | 92 /// The datalist of the input (if any). This should match the id of an existin
g `<datalist>`. Bind this |
85 /// to the `<input is="iron-input">`'s `list` property. | 93 /// to the `<input is="iron-input">`'s `list` property. |
86 String get list => jsElement[r'list']; | 94 String get list => jsElement[r'list']; |
87 set list(String value) { jsElement[r'list'] = value; } | 95 set list(String value) { jsElement[r'list'] = value; } |
88 | 96 |
89 /// The maximum (numeric or date-time) input value. | 97 /// The maximum (numeric or date-time) input value. |
90 /// Can be a String (e.g. `"2000-1-1"`) or a Number (e.g. `2`). | 98 /// Can be a String (e.g. `"2000-1-1"`) or a Number (e.g. `2`). |
91 /// Bind this to the `<input is="iron-input">`'s `max` property. | 99 /// Bind this to the `<input is="iron-input">`'s `max` property. |
92 String get max => jsElement[r'max']; | 100 String get max => jsElement[r'max']; |
93 set max(String value) { jsElement[r'max'] = value; } | 101 set max(String value) { jsElement[r'max'] = value; } |
94 | 102 |
95 /// The maximum length of the input value. Bind this to the `<input is="iron-i
nput">`'s | 103 /// The maximum length of the input value. Bind this to the `<input is="iron-i
nput">`'s |
96 /// `maxlength` property. | 104 /// `maxlength` property. |
97 num get maxlength => jsElement[r'maxlength']; | 105 num get maxlength => jsElement[r'maxlength']; |
98 set maxlength(num value) { jsElement[r'maxlength'] = value; } | 106 set maxlength(num value) { jsElement[r'maxlength'] = value; } |
99 | 107 |
100 /// The minimum (numeric or date-time) input value. | 108 /// The minimum (numeric or date-time) input value. |
101 /// Bind this to the `<input is="iron-input">`'s `min` property. | 109 /// Bind this to the `<input is="iron-input">`'s `min` property. |
102 String get min => jsElement[r'min']; | 110 String get min => jsElement[r'min']; |
103 set min(String value) { jsElement[r'min'] = value; } | 111 set min(String value) { jsElement[r'min'] = value; } |
104 | 112 |
105 /// Bind this to the `<input is="iron-input">`'s `minlength` property. | 113 /// Bind this to the `<input is="iron-input">`'s `minlength` property. |
106 num get minlength => jsElement[r'minlength']; | 114 num get minlength => jsElement[r'minlength']; |
107 set minlength(num value) { jsElement[r'minlength'] = value; } | 115 set minlength(num value) { jsElement[r'minlength'] = value; } |
108 | 116 |
| 117 /// Bind this to the `<input is="iron-input">`'s `multiple` property, , used w
ith type=file. |
| 118 bool get multiple => jsElement[r'multiple']; |
| 119 set multiple(bool value) { jsElement[r'multiple'] = value; } |
| 120 |
109 /// Bind this to the `<input is="iron-input">`'s `name` property. | 121 /// Bind this to the `<input is="iron-input">`'s `name` property. |
110 String get name => jsElement[r'name']; | 122 String get name => jsElement[r'name']; |
111 set name(String value) { jsElement[r'name'] = value; } | 123 set name(String value) { jsElement[r'name'] = value; } |
112 | 124 |
113 /// Set to true to disable the floating label. Bind this to the `<paper-input-
container>`'s | 125 /// Set to true to disable the floating label. Bind this to the `<paper-input-
container>`'s |
114 /// `noLabelFloat` property. | 126 /// `noLabelFloat` property. |
115 bool get noLabelFloat => jsElement[r'noLabelFloat']; | 127 bool get noLabelFloat => jsElement[r'noLabelFloat']; |
116 set noLabelFloat(bool value) { jsElement[r'noLabelFloat'] = value; } | 128 set noLabelFloat(bool value) { jsElement[r'noLabelFloat'] = value; } |
117 | 129 |
118 /// A pattern to validate the `input` with. Bind this to the `<input is="iron-
input">`'s | 130 /// A pattern to validate the `input` with. Bind this to the `<input is="iron-
input">`'s |
(...skipping 12 matching lines...) Expand all Loading... |
131 | 143 |
132 /// Bind this to the `<input is="iron-input">`'s `readonly` property. | 144 /// Bind this to the `<input is="iron-input">`'s `readonly` property. |
133 bool get readonly => jsElement[r'readonly']; | 145 bool get readonly => jsElement[r'readonly']; |
134 set readonly(bool value) { jsElement[r'readonly'] = value; } | 146 set readonly(bool value) { jsElement[r'readonly'] = value; } |
135 | 147 |
136 /// Set to true to mark the input as required. Bind this to the `<input is="ir
on-input">`'s | 148 /// Set to true to mark the input as required. Bind this to the `<input is="ir
on-input">`'s |
137 /// `required` property. | 149 /// `required` property. |
138 bool get required => jsElement[r'required']; | 150 bool get required => jsElement[r'required']; |
139 set required(bool value) { jsElement[r'required'] = value; } | 151 set required(bool value) { jsElement[r'required'] = value; } |
140 | 152 |
| 153 /// Bind this to the `<input is="iron-input">`'s `results` property, , used wi
th type=search. |
| 154 num get results => jsElement[r'results']; |
| 155 set results(num value) { jsElement[r'results'] = value; } |
| 156 |
141 /// Bind this to the `<input is="iron-input">`'s `size` property. | 157 /// Bind this to the `<input is="iron-input">`'s `size` property. |
142 num get size => jsElement[r'size']; | 158 num get size => jsElement[r'size']; |
143 set size(num value) { jsElement[r'size'] = value; } | 159 set size(num value) { jsElement[r'size'] = value; } |
144 | 160 |
145 /// Limits the numeric or date-time increments. | 161 /// Limits the numeric or date-time increments. |
146 /// Bind this to the `<input is="iron-input">`'s `step` property. | 162 /// Bind this to the `<input is="iron-input">`'s `step` property. |
147 String get step => jsElement[r'step']; | 163 String get step => jsElement[r'step']; |
148 set step(String value) { jsElement[r'step'] = value; } | 164 set step(String value) { jsElement[r'step'] = value; } |
149 | 165 |
150 /// The type of the input. The supported types are `text`, `number` and `passw
ord`. Bind this | 166 /// The type of the input. The supported types are `text`, `number` and `passw
ord`. Bind this |
151 /// to the `<input is="iron-input">`'s `type` property. | 167 /// to the `<input is="iron-input">`'s `type` property. |
152 String get type => jsElement[r'type']; | 168 String get type => jsElement[r'type']; |
153 set type(String value) { jsElement[r'type'] = value; } | 169 set type(String value) { jsElement[r'type'] = value; } |
154 | 170 |
155 /// Name of the validator to use. Bind this to the `<input is="iron-input">`'s
`validator` | 171 /// Name of the validator to use. Bind this to the `<input is="iron-input">`'s
`validator` |
156 /// property. | 172 /// property. |
157 String get validator => jsElement[r'validator']; | 173 String get validator => jsElement[r'validator']; |
158 set validator(String value) { jsElement[r'validator'] = value; } | 174 set validator(String value) { jsElement[r'validator'] = value; } |
159 | 175 |
160 /// The value for this input. Bind this to the `<input is="iron-input">`'s `bi
ndValue` | 176 /// The value for this input. Bind this to the `<input is="iron-input">`'s `bi
ndValue` |
161 /// property, or the value property of your input that is `notify:true`. | 177 /// property, or the value property of your input that is `notify:true`. |
162 String get value => jsElement[r'value']; | 178 get value => jsElement[r'value']; |
163 set value(String value) { jsElement[r'value'] = value; } | 179 set value(value) { jsElement[r'value'] = (value is Map || (value is Iterable &
& value is! JsArray)) ? new JsObject.jsify(value) : value;} |
164 | 180 |
165 /// Restores the cursor to its original position after updating the value. | 181 /// Restores the cursor to its original position after updating the value. |
166 /// [newValue]: The value that should be saved. | 182 /// [newValue]: The value that should be saved. |
167 updateValueAndPreserveCaret(String newValue) => | 183 updateValueAndPreserveCaret(String newValue) => |
168 jsElement.callMethod('updateValueAndPreserveCaret', [newValue]); | 184 jsElement.callMethod('updateValueAndPreserveCaret', [newValue]); |
169 | 185 |
170 /// Validates the input element and sets an error style if needed. | 186 /// Validates the input element and sets an error style if needed. |
171 bool validate() => | 187 bool validate() => |
172 jsElement.callMethod('validate', []); | 188 jsElement.callMethod('validate', []); |
173 } | 189 } |
OLD | NEW |