| OLD | NEW |
| 1 /** | 1 |
| 2 |
| 3 /** |
| 2 * Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-con
tainer>`. This | 4 * Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-con
tainer>`. This |
| 3 * behavior is implemented by `<paper-input>`. It exposes a number of properti
es from | 5 * behavior is implemented by `<paper-input>`. It exposes a number of properti
es from |
| 4 * `<paper-input-container>` and `<input is="iron-input">` and they should be
bound in your | 6 * `<paper-input-container>` and `<input is="iron-input">` and they should be
bound in your |
| 5 * template. | 7 * template. |
| 6 * | 8 * |
| 7 * The input element can be accessed by the `inputElement` property if you nee
d to access | 9 * The input element can be accessed by the `inputElement` property if you nee
d to access |
| 8 * properties or methods that are not exposed. | 10 * properties or methods that are not exposed. |
| 9 * @polymerBehavior Polymer.PaperInputBehavior | 11 * @polymerBehavior Polymer.PaperInputBehavior |
| 10 */ | 12 */ |
| 11 Polymer.PaperInputBehaviorImpl = { | 13 Polymer.PaperInputBehaviorImpl = { |
| 12 | 14 |
| 13 properties: { | 15 properties: { |
| 16 /** |
| 17 * Fired when the input changes due to user interaction. |
| 18 * |
| 19 * @event change |
| 20 */ |
| 14 | 21 |
| 15 /** | 22 /** |
| 16 * The label for this input. Bind this to `<paper-input-container>`'s `lab
el` property. | 23 * The label for this input. Bind this to `<paper-input-container>`'s `lab
el` property. |
| 17 */ | 24 */ |
| 18 label: { | 25 label: { |
| 19 type: String | 26 type: String |
| 20 }, | 27 }, |
| 21 | 28 |
| 22 /** | 29 /** |
| 23 * The value for this input. Bind this to the `<input is="iron-input">`'s
`bindValue` | 30 * The value for this input. Bind this to the `<input is="iron-input">`'s
`bindValue` |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 return; | 381 return; |
| 375 } | 382 } |
| 376 var labelledBy; | 383 var labelledBy; |
| 377 if (label.id) { | 384 if (label.id) { |
| 378 labelledBy = label.id; | 385 labelledBy = label.id; |
| 379 } else { | 386 } else { |
| 380 labelledBy = 'paper-input-label-' + new Date().getUTCMilliseconds(); | 387 labelledBy = 'paper-input-label-' + new Date().getUTCMilliseconds(); |
| 381 label.id = labelledBy; | 388 label.id = labelledBy; |
| 382 } | 389 } |
| 383 this._ariaLabelledBy = labelledBy; | 390 this._ariaLabelledBy = labelledBy; |
| 391 }, |
| 392 |
| 393 _onChange:function(event) { |
| 394 // In the Shadow DOM, the `change` event is not leaked into the |
| 395 // ancestor tree, so we must do this manually. |
| 396 // See https://w3c.github.io/webcomponents/spec/shadow/#events-that-are-no
t-leaked-into-ancestor-trees. |
| 397 if (this.shadowRoot) { |
| 398 this.fire(event.type, {sourceEvent: event}, { |
| 399 node: this, |
| 400 bubbles: event.bubbles, |
| 401 cancelable: event.cancelable |
| 402 }); |
| 403 } |
| 384 } | 404 } |
| 385 | 405 |
| 386 }; | 406 }; |
| 387 | 407 |
| 388 /** @polymerBehavior */ | 408 /** @polymerBehavior */ |
| 389 Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBeha
viorImpl]; | 409 Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBeha
viorImpl]; |
| 410 |
| OLD | NEW |