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_iconset_svg`. | 3 /// Dart API for the polymer element `iron_iconset_svg`. |
4 @HtmlImport('iron_iconset_svg_nodart.html') | 4 @HtmlImport('iron_iconset_svg_nodart.html') |
5 library polymer_elements.lib.src.iron_iconset_svg.iron_iconset_svg; | 5 library polymer_elements.lib.src.iron_iconset_svg.iron_iconset_svg; |
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_meta.dart'; | 11 import 'iron_meta.dart'; |
12 | 12 |
13 /// The `iron-iconset-svg` element allows users to define their own icon sets | 13 /// The `iron-iconset-svg` element allows users to define their own icon sets |
14 /// that contain svg icons. The svg icon elements should be children of the | 14 /// that contain svg icons. The svg icon elements should be children of the |
15 /// `iron-iconset-svg` element. Multiple icons should be given distinct id's. | 15 /// `iron-iconset-svg` element. Multiple icons should be given distinct id's. |
16 /// | 16 /// |
17 /// Using svg elements to create icons has a few advantages over traditional | 17 /// Using svg elements to create icons has a few advantages over traditional |
18 /// bitmap graphics like jpg or png. Icons that use svg are vector based so they | 18 /// bitmap graphics like jpg or png. Icons that use svg are vector based so |
19 /// are resolution independent and should look good on any device. They are | 19 /// they are resolution independent and should look good on any device. They |
20 /// stylable via css. Icons can be themed, colorized, and even animated. | 20 /// are stylable via css. Icons can be themed, colorized, and even animated. |
21 /// | 21 /// |
22 /// Example: | 22 /// Example: |
23 /// | 23 /// |
24 /// <iron-iconset-svg name="my-svg-icons" size="24"> | 24 /// <iron-iconset-svg name="my-svg-icons" size="24"> |
25 /// <svg> | 25 /// <svg> |
26 /// <defs> | 26 /// <defs> |
27 /// <g id="shape"> | 27 /// <g id="shape"> |
28 /// <rect x="50" y="50" width="50" height="50" /> | 28 /// <rect x="50" y="50" width="50" height="50" /> |
29 /// <circle cx="50" cy="50" r="50" /> | 29 /// <circle cx="50" cy="50" r="50" /> |
30 /// </g> | 30 /// </g> |
(...skipping 20 matching lines...) Expand all Loading... |
51 /// The size of an individual icon. Note that icons must be square. | 51 /// The size of an individual icon. Note that icons must be square. |
52 num get size => jsElement[r'size']; | 52 num get size => jsElement[r'size']; |
53 set size(num value) { jsElement[r'size'] = value; } | 53 set size(num value) { jsElement[r'size'] = value; } |
54 | 54 |
55 /// Applies an icon to the given element. | 55 /// Applies an icon to the given element. |
56 /// | 56 /// |
57 /// An svg icon is prepended to the element's shadowRoot if it exists, | 57 /// An svg icon is prepended to the element's shadowRoot if it exists, |
58 /// otherwise to the element itself. | 58 /// otherwise to the element itself. |
59 /// [element]: Element to which the icon is applied. | 59 /// [element]: Element to which the icon is applied. |
60 /// [iconName]: Name of the icon to apply. | 60 /// [iconName]: Name of the icon to apply. |
61 Element applyIcon(Element element, String iconName) => | 61 applyIcon(Element element, String iconName) => |
62 jsElement.callMethod('applyIcon', [element, iconName]); | 62 jsElement.callMethod('applyIcon', [element, iconName]); |
63 | 63 |
64 /// Construct an array of all icon names in this iconset. | 64 /// Construct an array of all icon names in this iconset. |
65 getIconNames() => | 65 getIconNames() => |
66 jsElement.callMethod('getIconNames', []); | 66 jsElement.callMethod('getIconNames', []); |
67 | 67 |
68 /// Remove an icon from the given element by undoing the changes effected | 68 /// Remove an icon from the given element by undoing the changes effected |
69 /// by `applyIcon`. | 69 /// by `applyIcon`. |
70 /// [element]: The element from which the icon is removed. | 70 /// [element]: The element from which the icon is removed. |
71 removeIcon(Element element) => | 71 removeIcon(Element element) => |
72 jsElement.callMethod('removeIcon', [element]); | 72 jsElement.callMethod('removeIcon', [element]); |
73 } | 73 } |
OLD | NEW |