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_radio_button`. | 3 /// Dart API for the polymer element `paper_radio_button`. |
4 @HtmlImport('paper_radio_button_nodart.html') | 4 @HtmlImport('paper_radio_button_nodart.html') |
5 library polymer_elements.lib.src.paper_radio_button.paper_radio_button; | 5 library polymer_elements.lib.src.paper_radio_button.paper_radio_button; |
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 'paper_checked_element_behavior.dart'; |
11 import 'paper_inky_focus_behavior.dart'; | 12 import 'paper_inky_focus_behavior.dart'; |
12 import 'iron_button_state.dart'; | 13 import 'iron_button_state.dart'; |
13 import 'iron_a11y_keys_behavior.dart'; | 14 import 'iron_a11y_keys_behavior.dart'; |
14 import 'iron_control_state.dart'; | 15 import 'iron_control_state.dart'; |
| 16 import 'paper_ripple_behavior.dart'; |
15 import 'iron_checked_element_behavior.dart'; | 17 import 'iron_checked_element_behavior.dart'; |
16 import 'iron_form_element_behavior.dart'; | 18 import 'iron_form_element_behavior.dart'; |
17 import 'iron_validatable_behavior.dart'; | 19 import 'iron_validatable_behavior.dart'; |
18 import 'paper_ripple.dart'; | 20 import 'paper_ripple.dart'; |
19 import 'default_theme.dart'; | 21 import 'default_theme.dart'; |
20 | 22 |
| 23 /// Material design: [Radio button](https://www.google.com/design/spec/component
s/selection-controls.html#selection-controls-radio-button) |
| 24 /// |
21 /// `paper-radio-button` is a button that can be either checked or unchecked. | 25 /// `paper-radio-button` is a button that can be either checked or unchecked. |
22 /// User can tap the radio button to check or uncheck it. | 26 /// User can tap the radio button to check or uncheck it. |
23 /// | 27 /// |
24 /// Use a `<paper-radio-group>` to group a set of radio buttons. When radio but
tons | 28 /// Use a `<paper-radio-group>` to group a set of radio buttons. When radio but
tons |
25 /// are inside a radio group, exactly one radio button in the group can be check
ed | 29 /// are inside a radio group, exactly one radio button in the group can be check
ed |
26 /// at any time. | 30 /// at any time. |
27 /// | 31 /// |
28 /// Example: | 32 /// Example: |
29 /// | 33 /// |
30 /// <paper-radio-button></paper-radio-button> | 34 /// <paper-radio-button></paper-radio-button> |
31 /// <paper-radio-button>Item label</paper-radio-button> | 35 /// <paper-radio-button>Item label</paper-radio-button> |
32 /// | 36 /// |
33 /// ### Styling | 37 /// ### Styling |
34 /// | 38 /// |
35 /// The following custom properties and mixins are available for styling: | 39 /// The following custom properties and mixins are available for styling: |
36 /// | 40 /// |
37 /// Custom property | Description | Default | 41 /// Custom property | Description | Default |
38 /// ----------------|-------------|---------- | 42 /// ----------------|-------------|---------- |
39 /// `--paper-radio-button-unchecked-background-color` | Radio button background
color when the input is not checked | `transparent` | 43 /// `--paper-radio-button-unchecked-background-color` | Radio button background
color when the input is not checked | `transparent` |
40 /// `--paper-radio-button-unchecked-color` | Radio button color when the input i
s not checked | `--primary-text-color` | 44 /// `--paper-radio-button-unchecked-color` | Radio button color when the input i
s not checked | `--primary-text-color` |
41 /// `--paper-radio-button-unchecked-ink-color` | Selected/focus ripple color whe
n the input is not checked | `--primary-text-color` | 45 /// `--paper-radio-button-unchecked-ink-color` | Selected/focus ripple color whe
n the input is not checked | `--primary-text-color` |
42 /// `--paper-radio-button-checked-color` | Radio button color when the input is
checked | `--default-primary-color` | 46 /// `--paper-radio-button-checked-color` | Radio button color when the input is
checked | `--default-primary-color` |
43 /// `--paper-radio-button-checked-ink-color` | Selected/focus ripple color when
the input is checked | `--default-primary-color` | 47 /// `--paper-radio-button-checked-ink-color` | Selected/focus ripple color when
the input is checked | `--default-primary-color` |
44 /// `--paper-radio-button-label-color` | Label color | `--primary-text-color` | 48 /// `--paper-radio-button-label-color` | Label color | `--primary-text-color` |
| 49 /// `--paper-radio-button-label-spacing` | Spacing between the label and the but
ton | `10px` |
45 @CustomElementProxy('paper-radio-button') | 50 @CustomElementProxy('paper-radio-button') |
46 class PaperRadioButton extends HtmlElement with CustomElementProxyMixin, Polymer
Base, IronA11yKeysBehavior, IronButtonState, IronControlState, PaperInkyFocusBeh
avior, IronFormElementBehavior, IronValidatableBehavior, IronCheckedElementBehav
ior { | 51 class PaperRadioButton extends HtmlElement with CustomElementProxyMixin, Polymer
Base, IronA11yKeysBehavior, IronButtonState, IronControlState, PaperRippleBehavi
or, PaperInkyFocusBehavior, IronFormElementBehavior, IronValidatableBehavior, Ir
onCheckedElementBehavior, PaperCheckedElementBehavior { |
47 PaperRadioButton.created() : super.created(); | 52 PaperRadioButton.created() : super.created(); |
48 factory PaperRadioButton() => new Element.tag('paper-radio-button'); | 53 factory PaperRadioButton() => new Element.tag('paper-radio-button'); |
49 | 54 |
50 /// Fired when the checked state changes. | 55 /// Fired when the checked state changes. |
51 get ariaActiveAttribute => jsElement[r'ariaActiveAttribute']; | 56 String get ariaActiveAttribute => jsElement[r'ariaActiveAttribute']; |
52 set ariaActiveAttribute(value) { jsElement[r'ariaActiveAttribute'] = (value is
Map || (value is Iterable && value is! JsArray)) ? new JsObject.jsify(value) :
value;} | 57 set ariaActiveAttribute(String value) { jsElement[r'ariaActiveAttribute'] = va
lue; } |
53 | |
54 /// Update the checkbox aria-label. This is a temporary workaround not | |
55 /// being able to observe changes in <content> | |
56 /// (see: https://github.com/Polymer/polymer/issues/1773) | |
57 /// | |
58 /// Call this if you manually change the contents of the checkbox | |
59 /// and want the aria-label to match the new contents. | |
60 updateAriaLabel() => | |
61 jsElement.callMethod('updateAriaLabel', []); | |
62 } | 58 } |
OLD | NEW |