| 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 `iron_list`. | 3 /// Dart API for the polymer element `iron_list`. |
| 4 @HtmlImport('iron_list_nodart.html') | 4 @HtmlImport('iron_list_nodart.html') |
| 5 library polymer_elements.lib.src.iron_list.iron_list; | 5 library polymer_elements.lib.src.iron_list.iron_list; |
| 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'; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 /// <iron-ajax url="data.json" last-response="{{data}}" auto></iron-ajax> | 59 /// <iron-ajax url="data.json" last-response="{{data}}" auto></iron-ajax> |
| 60 /// <iron-list items="[[data]]" as="item"> | 60 /// <iron-list items="[[data]]" as="item"> |
| 61 /// <template> | 61 /// <template> |
| 62 /// <div> | 62 /// <div> |
| 63 /// Name: <span>[[item.name]]</span> | 63 /// Name: <span>[[item.name]]</span> |
| 64 /// </div> | 64 /// </div> |
| 65 /// </template> | 65 /// </template> |
| 66 /// </iron-list> | 66 /// </iron-list> |
| 67 /// </template> | 67 /// </template> |
| 68 /// | 68 /// |
| 69 /// ### Styling |
| 70 /// |
| 71 /// Use the `--iron-list-items-container` mixin to style the container of items,
e.g. |
| 72 /// |
| 73 /// iron-list { |
| 74 /// --iron-list-items-container: { |
| 75 /// margin: auto; |
| 76 /// }; |
| 77 /// } |
| 78 /// |
| 69 /// ### Resizing | 79 /// ### Resizing |
| 70 /// | 80 /// |
| 71 /// `iron-list` lays out the items when it recives a notification via the `resiz
e` event. | 81 /// `iron-list` lays out the items when it recives a notification via the `iron-
resize` event. |
| 72 /// This event is fired by any element that implements `IronResizableBehavior`. | 82 /// This event is fired by any element that implements `IronResizableBehavior`. |
| 73 /// | 83 /// |
| 74 /// By default, elements such as `iron-pages`, `paper-tabs` or `paper-dialog` wi
ll trigger | 84 /// By default, elements such as `iron-pages`, `paper-tabs` or `paper-dialog` wi
ll trigger |
| 75 /// this event automatically. If you hide the list manually (e.g. you use `displ
ay: none`) | 85 /// this event automatically. If you hide the list manually (e.g. you use `displ
ay: none`) |
| 76 /// you might want to implement `IronResizableBehavior` or fire this event manua
lly right | 86 /// you might want to implement `IronResizableBehavior` or fire this event manua
lly right |
| 77 /// after the list became visible again. e.g. | 87 /// after the list became visible again. e.g. |
| 78 /// | 88 /// |
| 79 /// document.querySelector('iron-list').fire('resize'); | 89 /// document.querySelector('iron-list').fire('iron-resize'); |
| 80 @CustomElementProxy('iron-list') | 90 @CustomElementProxy('iron-list') |
| 81 class IronList extends HtmlElement with CustomElementProxyMixin, PolymerBase, Te
mplatizer, IronResizableBehavior { | 91 class IronList extends HtmlElement with CustomElementProxyMixin, PolymerBase, Te
mplatizer, IronResizableBehavior { |
| 82 IronList.created() : super.created(); | 92 IronList.created() : super.created(); |
| 83 factory IronList() => new Element.tag('iron-list'); | 93 factory IronList() => new Element.tag('iron-list'); |
| 84 | 94 |
| 85 /// The name of the variable to add to the binding scope for the array | 95 /// The name of the variable to add to the binding scope for the array |
| 86 /// element associated with a given template instance. | 96 /// element associated with a given template instance. |
| 87 String get as => jsElement[r'as']; | 97 String get as => jsElement[r'as']; |
| 88 set as(String value) { jsElement[r'as'] = value; } | 98 set as(String value) { jsElement[r'as'] = value; } |
| 89 | 99 |
| 90 /// Gets the first visible item in the viewport. | 100 /// Gets the index of the first visible item in the viewport. |
| 91 get firstVisibleIndex => jsElement[r'firstVisibleIndex']; | 101 num get firstVisibleIndex => jsElement[r'firstVisibleIndex']; |
| 102 set firstVisibleIndex(num value) { jsElement[r'firstVisibleIndex'] = value; } |
| 92 | 103 |
| 93 /// The name of the variable to add to the binding scope with the index | 104 /// The name of the variable to add to the binding scope with the index |
| 94 /// for the row. If `sort` is provided, the index will reflect the | 105 /// for the row. |
| 95 /// sorted order (rather than the original array order). | |
| 96 String get indexAs => jsElement[r'indexAs']; | 106 String get indexAs => jsElement[r'indexAs']; |
| 97 set indexAs(String value) { jsElement[r'indexAs'] = value; } | 107 set indexAs(String value) { jsElement[r'indexAs'] = value; } |
| 98 | 108 |
| 99 /// An array containing items determining how many instances of the template | 109 /// An array containing items determining how many instances of the template |
| 100 /// to stamp and that that each template instance should bind to. | 110 /// to stamp and that that each template instance should bind to. |
| 101 List get items => jsElement[r'items']; | 111 List get items => jsElement[r'items']; |
| 102 set items(List value) { jsElement[r'items'] = (value != null && value is! JsAr
ray) ? new JsObject.jsify(value) : value;} | 112 set items(List value) { jsElement[r'items'] = (value != null && value is! JsAr
ray) ? new JsObject.jsify(value) : value;} |
| 103 | 113 |
| 104 /// When `true`, multiple items may be selected at once (in this case, | 114 /// When `true`, multiple items may be selected at once (in this case, |
| 105 /// `selected` is an array of currently selected items). When `false`, | 115 /// `selected` is an array of currently selected items). When `false`, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 127 /// Note that tapping focusable elements within the list item will not | 137 /// Note that tapping focusable elements within the list item will not |
| 128 /// result in selection, since they are presumed to have their * own action. | 138 /// result in selection, since they are presumed to have their * own action. |
| 129 bool get selectionEnabled => jsElement[r'selectionEnabled']; | 139 bool get selectionEnabled => jsElement[r'selectionEnabled']; |
| 130 set selectionEnabled(bool value) { jsElement[r'selectionEnabled'] = value; } | 140 set selectionEnabled(bool value) { jsElement[r'selectionEnabled'] = value; } |
| 131 | 141 |
| 132 /// Clears the current selection state of the list. | 142 /// Clears the current selection state of the list. |
| 133 clearSelection() => | 143 clearSelection() => |
| 134 jsElement.callMethod('clearSelection', []); | 144 jsElement.callMethod('clearSelection', []); |
| 135 | 145 |
| 136 /// Deselects the given item list if it is already selected. | 146 /// Deselects the given item list if it is already selected. |
| 137 /// [item]: the item object or its index | 147 /// [item]: The item object or its index |
| 138 deselectItem(item) => | 148 deselectItem(item) => |
| 139 jsElement.callMethod('deselectItem', [item]); | 149 jsElement.callMethod('deselectItem', [item]); |
| 140 | 150 |
| 141 /// Scroll to a specific item in the virtual list regardless | 151 /// Scroll to a specific item in the virtual list regardless |
| 142 /// of the physical items in the DOM tree. | 152 /// of the physical items in the DOM tree. |
| 143 /// [idx]: The index of the item | 153 /// [idx]: The index of the item |
| 144 scrollToIndex(num idx) => | 154 scrollToIndex(num idx) => |
| 145 jsElement.callMethod('scrollToIndex', [idx]); | 155 jsElement.callMethod('scrollToIndex', [idx]); |
| 146 | 156 |
| 147 /// Select the list item at the given index. | 157 /// Select the list item at the given index. |
| 148 /// [item]: the item object or its index | 158 /// [item]: The item object or its index |
| 149 selectItem(item) => | 159 selectItem(item) => |
| 150 jsElement.callMethod('selectItem', [item]); | 160 jsElement.callMethod('selectItem', [item]); |
| 151 | 161 |
| 152 /// Select or deselect a given item depending on whether the item | 162 /// Select or deselect a given item depending on whether the item |
| 153 /// has already been selected. | 163 /// has already been selected. |
| 154 /// [item]: the item object or its index | 164 /// [item]: The item object or its index |
| 155 toggleSelectionForItem(item) => | 165 toggleSelectionForItem(item) => |
| 156 jsElement.callMethod('toggleSelectionForItem', [item]); | 166 jsElement.callMethod('toggleSelectionForItem', [item]); |
| 157 | 167 |
| 168 /// Updates the size of an item. |
| 169 /// [item]: The item object or its index |
| 170 updateSizeForItem(item) => |
| 171 jsElement.callMethod('updateSizeForItem', [item]); |
| 172 |
| 158 /// Invoke this method if you dynamically update the viewport's | 173 /// Invoke this method if you dynamically update the viewport's |
| 159 /// size or CSS padding. | 174 /// size or CSS padding. |
| 160 updateViewportBoundaries() => | 175 updateViewportBoundaries() => |
| 161 jsElement.callMethod('updateViewportBoundaries', []); | 176 jsElement.callMethod('updateViewportBoundaries', []); |
| 162 } | 177 } |
| OLD | NEW |