Index: third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
diff --git a/third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js b/third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e066ed5ee57215828c9d48c6270d16cb32c0d17 |
--- /dev/null |
+++ b/third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
@@ -0,0 +1,75 @@ |
+ |
+ |
+ Polymer('paper-radio-button', { |
+ |
+ /** |
+ * Fired when the checked state changes. |
+ * |
+ * @event change |
+ */ |
+ |
+ publish: { |
+ /** |
+ * Gets or sets the state, `true` is checked and `false` is unchecked. |
+ * |
+ * @attribute checked |
+ * @type boolean |
+ * @default false |
+ */ |
+ checked: {value: false, reflect: true}, |
+ |
+ /** |
+ * The label for the radio button. |
+ * |
+ * @attribute label |
+ * @type string |
+ * @default '' |
+ */ |
+ label: '', |
+ |
+ /** |
+ * Normally the user cannot uncheck the radio button by tapping once |
+ * checked. Setting this property to `true` makes the radio button |
+ * toggleable from checked to unchecked. |
+ * |
+ * @attribute toggles |
+ * @type boolean |
+ * @default false |
+ */ |
+ toggles: false, |
+ |
+ /** |
+ * If true, the user cannot interact with this element. |
+ * |
+ * @attribute disabled |
+ * @type boolean |
+ * @default false |
+ */ |
+ disabled: {value: false, reflect: true} |
+ }, |
+ |
+ eventDelegates: { |
+ tap: 'tap' |
+ }, |
+ |
+ tap: function() { |
+ this.toggle(); |
+ this.fire('paper-radio-button-activate'); |
+ }, |
+ |
+ toggle: function() { |
+ this.checked = !this.toggles || !this.checked; |
+ }, |
+ |
+ checkedChanged: function() { |
+ this.$.onRadio.classList.toggle('fill', this.checked); |
+ this.setAttribute('aria-checked', this.checked ? 'true': 'false'); |
+ this.fire('change'); |
+ }, |
+ |
+ labelChanged: function() { |
+ this.setAttribute('aria-label', this.label); |
+ } |
+ |
+ }); |
+ |