| 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_dropdown_menu`. | 3 /// Dart API for the polymer element `paper_dropdown_menu`. |
| 4 @HtmlImport('paper_dropdown_menu_nodart.html') | 4 @HtmlImport('paper_dropdown_menu_nodart.html') |
| 5 library polymer_elements.lib.src.paper_dropdown_menu.paper_dropdown_menu; | 5 library polymer_elements.lib.src.paper_dropdown_menu.paper_dropdown_menu; |
| 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 import 'iron_button_state.dart'; | 12 import 'iron_button_state.dart'; |
| 13 import 'iron_a11y_keys_behavior.dart'; | 13 import 'iron_a11y_keys_behavior.dart'; |
| 14 import 'iron_form_element_behavior.dart'; |
| 15 import 'iron_validatable_behavior.dart'; |
| 14 import 'default_theme.dart'; | 16 import 'default_theme.dart'; |
| 15 import 'paper_input.dart'; | 17 import 'paper_input.dart'; |
| 16 import 'paper_menu_button.dart'; | 18 import 'paper_menu_button.dart'; |
| 17 import 'paper_ripple.dart'; | 19 import 'paper_ripple.dart'; |
| 18 import 'iron_icons.dart'; | 20 import 'iron_icons.dart'; |
| 19 import 'iron_icon.dart'; | 21 import 'iron_icon.dart'; |
| 20 import 'iron_selectable.dart'; | 22 import 'iron_selectable.dart'; |
| 21 | 23 |
| 24 /// Material design: [Dropdown menus](https://www.google.com/design/spec/compone
nts/buttons.html#buttons-dropdown-buttons) |
| 25 /// |
| 22 /// `paper-dropdown-menu` is similar to a native browser select element. | 26 /// `paper-dropdown-menu` is similar to a native browser select element. |
| 23 /// `paper-dropdown-menu` works with selectable content. The currently selected | 27 /// `paper-dropdown-menu` works with selectable content. The currently selected |
| 24 /// item is displayed in the control. If no item is selected, the `label` is | 28 /// item is displayed in the control. If no item is selected, the `label` is |
| 25 /// displayed instead. | 29 /// displayed instead. |
| 26 /// | 30 /// |
| 27 /// The child element with the class `dropdown-content` will be used as the drop
down | 31 /// The child element with the class `dropdown-content` will be used as the drop
down |
| 28 /// menu. It could be a `paper-menu` or element that triggers `iron-select` when | 32 /// menu. It could be a `paper-menu` or element that triggers `iron-select` when |
| 29 /// selecting its children. | 33 /// selecting its children. |
| 30 /// | 34 /// |
| 31 /// Example: | 35 /// Example: |
| 32 /// | 36 /// |
| 33 /// <paper-dropdown-menu label="Your favourite pastry"> | 37 /// <paper-dropdown-menu label="Your favourite pastry"> |
| 34 /// <paper-menu class="dropdown-content"> | 38 /// <paper-menu class="dropdown-content"> |
| 35 /// <paper-item>Croissant</paper-item> | 39 /// <paper-item>Croissant</paper-item> |
| 36 /// <paper-item>Donut</paper-item> | 40 /// <paper-item>Donut</paper-item> |
| 37 /// <paper-item>Financier</paper-item> | 41 /// <paper-item>Financier</paper-item> |
| 38 /// <paper-item>Madeleine</paper-item> | 42 /// <paper-item>Madeleine</paper-item> |
| 39 /// </paper-menu> | 43 /// </paper-menu> |
| 40 /// </paper-dropdown-menu> | 44 /// </paper-dropdown-menu> |
| 41 /// | 45 /// |
| 42 /// This example renders a dropdown menu with 4 options. | 46 /// This example renders a dropdown menu with 4 options. |
| 43 /// | 47 /// |
| 48 /// Similarly to using `iron-select`, `iron-deselect` events will cause the |
| 49 /// current selection of the `paper-dropdown-menu` to be cleared. |
| 50 /// |
| 44 /// ### Styling | 51 /// ### Styling |
| 45 /// | 52 /// |
| 46 /// The following custom properties and mixins are also available for styling: | 53 /// The following custom properties and mixins are also available for styling: |
| 47 /// | 54 /// |
| 48 /// Custom property | Description | Default | 55 /// Custom property | Description | Default |
| 49 /// ----------------|-------------|---------- | 56 /// ----------------|-------------|---------- |
| 50 /// `--paper-dropdown-menu` | A mixin that is applied to the element host | `{}` | 57 /// `--paper-dropdown-menu` | A mixin that is applied to the element host | `{}` |
| 51 /// `--paper-dropdown-menu-disabled` | A mixin that is applied to the element ho
st when disabled | `{}` | 58 /// `--paper-dropdown-menu-disabled` | A mixin that is applied to the element ho
st when disabled | `{}` |
| 52 /// `--paper-dropdown-menu-ripple` | A mixin that is applied to the internal rip
ple | `{}` | 59 /// `--paper-dropdown-menu-ripple` | A mixin that is applied to the internal rip
ple | `{}` |
| 53 /// `--paper-dropdown-menu-button` | A mixin that is applied to the internal men
u button | `{}` | 60 /// `--paper-dropdown-menu-button` | A mixin that is applied to the internal men
u button | `{}` |
| 54 /// `--paper-dropdown-menu-input` | A mixin that is applied to the internal pape
r input | `{}` | 61 /// `--paper-dropdown-menu-input` | A mixin that is applied to the internal pape
r input | `{}` |
| 55 /// `--paper-dropdown-menu-icon` | A mixin that is applied to the internal icon
| `{}` | 62 /// `--paper-dropdown-menu-icon` | A mixin that is applied to the internal icon
| `{}` |
| 56 /// | 63 /// |
| 57 /// You can also use any of the `paper-input-container` and `paper-menu-button` | 64 /// You can also use any of the `paper-input-container` and `paper-menu-button` |
| 58 /// style mixins and custom properties to style the internal input and menu butt
on | 65 /// style mixins and custom properties to style the internal input and menu butt
on |
| 59 /// respectively. | 66 /// respectively. |
| 60 @CustomElementProxy('paper-dropdown-menu') | 67 @CustomElementProxy('paper-dropdown-menu') |
| 61 class PaperDropdownMenu extends HtmlElement with CustomElementProxyMixin, Polyme
rBase, IronControlState, IronA11yKeysBehavior, IronButtonState { | 68 class PaperDropdownMenu extends HtmlElement with CustomElementProxyMixin, Polyme
rBase, IronControlState, IronA11yKeysBehavior, IronButtonState, IronFormElementB
ehavior, IronValidatableBehavior { |
| 62 PaperDropdownMenu.created() : super.created(); | 69 PaperDropdownMenu.created() : super.created(); |
| 63 factory PaperDropdownMenu() => new Element.tag('paper-dropdown-menu'); | 70 factory PaperDropdownMenu() => new Element.tag('paper-dropdown-menu'); |
| 64 | 71 |
| 65 /// Set to true to always float the label. Bind this to the | 72 /// Set to true to always float the label. Bind this to the |
| 66 /// `<paper-input-container>`'s `alwaysFloatLabel` property. | 73 /// `<paper-input-container>`'s `alwaysFloatLabel` property. |
| 67 bool get alwaysFloatLabel => jsElement[r'alwaysFloatLabel']; | 74 bool get alwaysFloatLabel => jsElement[r'alwaysFloatLabel']; |
| 68 set alwaysFloatLabel(bool value) { jsElement[r'alwaysFloatLabel'] = value; } | 75 set alwaysFloatLabel(bool value) { jsElement[r'alwaysFloatLabel'] = value; } |
| 69 | 76 |
| 70 /// The content element that is contained by the dropdown menu, if any. | 77 /// The content element that is contained by the dropdown menu, if any. |
| 71 get contentElement => jsElement[r'contentElement']; | 78 get contentElement => jsElement[r'contentElement']; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 100 /// `iron-select` event with the selected `item` in the `detail`. | 107 /// `iron-select` event with the selected `item` in the `detail`. |
| 101 get selectedItem => jsElement[r'selectedItem']; | 108 get selectedItem => jsElement[r'selectedItem']; |
| 102 set selectedItem(value) { jsElement[r'selectedItem'] = (value is Map || (value
is Iterable && value is! JsArray)) ? new JsObject.jsify(value) : value;} | 109 set selectedItem(value) { jsElement[r'selectedItem'] = (value is Map || (value
is Iterable && value is! JsArray)) ? new JsObject.jsify(value) : value;} |
| 103 | 110 |
| 104 /// The derived "label" of the currently selected item. This value | 111 /// The derived "label" of the currently selected item. This value |
| 105 /// is the `label` property on the selected item if set, or else the | 112 /// is the `label` property on the selected item if set, or else the |
| 106 /// trimmed text content of the selected item. | 113 /// trimmed text content of the selected item. |
| 107 String get selectedItemLabel => jsElement[r'selectedItemLabel']; | 114 String get selectedItemLabel => jsElement[r'selectedItemLabel']; |
| 108 set selectedItemLabel(String value) { jsElement[r'selectedItemLabel'] = value;
} | 115 set selectedItemLabel(String value) { jsElement[r'selectedItemLabel'] = value;
} |
| 109 | 116 |
| 117 /// The value for this element that will be used when submitting in |
| 118 /// a form. It is read only, and will always have the same value |
| 119 /// as `selectedItemLabel`. |
| 120 String get value => jsElement[r'value']; |
| 121 set value(String value) { jsElement[r'value'] = value; } |
| 122 |
| 110 /// Hide the dropdown content. | 123 /// Hide the dropdown content. |
| 111 close() => | 124 close() => |
| 112 jsElement.callMethod('close', []); | 125 jsElement.callMethod('close', []); |
| 113 | 126 |
| 114 /// Show the dropdown content. | 127 /// Show the dropdown content. |
| 115 open() => | 128 open() => |
| 116 jsElement.callMethod('open', []); | 129 jsElement.callMethod('open', []); |
| 117 } | 130 } |
| OLD | NEW |