@vaadin/icon 24.0.0-alpha7 → 24.0.0-alpha8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/vaadin-icon-svg.d.ts +1 -1
- package/src/vaadin-icon-svg.js +1 -1
- package/src/vaadin-icon.d.ts +1 -1
- package/src/vaadin-icon.js +1 -1
- package/src/vaadin-iconset.d.ts +1 -1
- package/src/vaadin-iconset.js +4 -2
- package/web-types.json +62 -34
- package/web-types.lit.json +16 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/icon",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "24.0.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "24.0.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "24.0.0-
|
|
38
|
+
"@vaadin/component-base": "24.0.0-alpha8",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "24.0.0-alpha8",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "24.0.0-alpha8",
|
|
41
41
|
"lit": "^2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"web-types.json",
|
|
50
50
|
"web-types.lit.json"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "476752249bb12295c500980d98a3256ad3b22b73"
|
|
53
53
|
}
|
package/src/vaadin-icon-svg.d.ts
CHANGED
package/src/vaadin-icon-svg.js
CHANGED
package/src/vaadin-icon.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
package/src/vaadin-icon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
package/src/vaadin-iconset.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
package/src/vaadin-iconset.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -81,7 +81,9 @@ class Iconset extends ElementMixin(PolymerElement) {
|
|
|
81
81
|
applyIcon(name) {
|
|
82
82
|
// Create the icon map on-demand, since the iconset itself has no discrete
|
|
83
83
|
// signal to know when it's children are fully parsed
|
|
84
|
-
this._icons
|
|
84
|
+
if (!this._icons) {
|
|
85
|
+
this._icons = this.__createIconMap();
|
|
86
|
+
}
|
|
85
87
|
const icon = this._icons[this.__getIconId(name)];
|
|
86
88
|
return {
|
|
87
89
|
svg: cloneSvgNode(icon),
|
package/web-types.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/icon",
|
|
4
|
-
"version": "24.0.0-
|
|
4
|
+
"version": "24.0.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
|
-
"name": "vaadin-
|
|
11
|
-
"description": "`<vaadin-
|
|
10
|
+
"name": "vaadin-iconset",
|
|
11
|
+
"description": "`<vaadin-iconset>` is a Web Component for creating SVG icon collections.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
|
-
"name": "
|
|
15
|
-
"description": "The name of the
|
|
14
|
+
"name": "name",
|
|
15
|
+
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
16
16
|
"value": {
|
|
17
17
|
"type": [
|
|
18
18
|
"string",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "size",
|
|
26
|
-
"description": "The size of an icon
|
|
26
|
+
"description": "The size of an individual icon. Note that icons must be square.\n\nWhen using `vaadin-icon`, the size of the iconset will take precedence\nover the size defined by the user to ensure correct appearance.",
|
|
27
27
|
"value": {
|
|
28
28
|
"type": [
|
|
29
29
|
"number",
|
|
@@ -47,46 +47,74 @@
|
|
|
47
47
|
"js": {
|
|
48
48
|
"properties": [
|
|
49
49
|
{
|
|
50
|
-
"name": "
|
|
51
|
-
"description": "",
|
|
52
|
-
"value": {
|
|
53
|
-
"type": [
|
|
54
|
-
"string"
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "importPath",
|
|
60
|
-
"description": "",
|
|
50
|
+
"name": "name",
|
|
51
|
+
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
61
52
|
"value": {
|
|
62
53
|
"type": [
|
|
63
|
-
"string"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "root",
|
|
69
|
-
"description": "",
|
|
70
|
-
"value": {
|
|
71
|
-
"type": [
|
|
72
|
-
"StampedTemplate",
|
|
73
|
-
"HTMLElement",
|
|
74
|
-
"ShadowRoot"
|
|
54
|
+
"string",
|
|
55
|
+
"null",
|
|
56
|
+
"undefined"
|
|
75
57
|
]
|
|
76
58
|
}
|
|
77
59
|
},
|
|
78
60
|
{
|
|
79
|
-
"name": "
|
|
80
|
-
"description": "",
|
|
61
|
+
"name": "size",
|
|
62
|
+
"description": "The size of an individual icon. Note that icons must be square.\n\nWhen using `vaadin-icon`, the size of the iconset will take precedence\nover the size defined by the user to ensure correct appearance.",
|
|
81
63
|
"value": {
|
|
82
64
|
"type": [
|
|
83
|
-
"
|
|
65
|
+
"number",
|
|
66
|
+
"null",
|
|
67
|
+
"undefined"
|
|
84
68
|
]
|
|
85
69
|
}
|
|
86
|
-
}
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"events": []
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "vaadin-icon",
|
|
77
|
+
"description": "`<vaadin-icon>` is a Web Component for displaying SVG icons.\n\n### Icon property\n\nThe `<vaadin-icon>` component is designed to be used as a drop-in replacement for `<iron-icon>`.\nFor example, you can use it with `vaadin-icons` like this:\n\n```html\n<vaadin-icon icon=\"vaadin:angle-down\"></vaadin-icon>\n```\n\nAlternatively, you can also pick one of the Lumo icons:\n\n```html\n<vaadin-icon icon=\"lumo:user\"></vaadin-icon>\n```\n\n### Custom SVG icon\n\nAlternatively, instead of selecting an icon from an iconset by name, you can pass any custom `svg`\nliteral using the [`svg`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-svg) property. In this case you can also\ndefine the size of the SVG `viewBox` using the [`size`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-size) property:\n\n```js\nimport { html, svg } from 'lit';\n\n// in your component\nrender() {\n const svgIcon = svg`<path d=\"M13 4v2l-5 5-5-5v-2l5 5z\"></path>`;\n return html`\n <vaadin-icon\n .svg=\"${svgIcon}\"\n size=\"16\"\n ></vaadin-icon>\n `;\n}\n```",
|
|
78
|
+
"attributes": [
|
|
79
|
+
{
|
|
80
|
+
"name": "icon",
|
|
81
|
+
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
82
|
+
"value": {
|
|
83
|
+
"type": [
|
|
84
|
+
"string",
|
|
85
|
+
"null",
|
|
86
|
+
"undefined"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "size",
|
|
92
|
+
"description": "The size of an icon, used to set the `viewBox` attribute.",
|
|
93
|
+
"value": {
|
|
94
|
+
"type": [
|
|
95
|
+
"number",
|
|
96
|
+
"null",
|
|
97
|
+
"undefined"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "theme",
|
|
103
|
+
"description": "The theme variants to apply to the component.",
|
|
104
|
+
"value": {
|
|
105
|
+
"type": [
|
|
106
|
+
"string",
|
|
107
|
+
"null",
|
|
108
|
+
"undefined"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"js": {
|
|
114
|
+
"properties": [
|
|
87
115
|
{
|
|
88
116
|
"name": "icon",
|
|
89
|
-
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-
|
|
117
|
+
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
90
118
|
"value": {
|
|
91
119
|
"type": [
|
|
92
120
|
"string",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/icon",
|
|
4
|
-
"version": "24.0.0-
|
|
4
|
+
"version": "24.0.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -15,41 +15,34 @@
|
|
|
15
15
|
"html": {
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
|
-
"name": "vaadin-
|
|
19
|
-
"description": "`<vaadin-
|
|
18
|
+
"name": "vaadin-iconset",
|
|
19
|
+
"description": "`<vaadin-iconset>` is a Web Component for creating SVG icon collections.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
23
|
-
"name": ".
|
|
24
|
-
"description": "",
|
|
25
|
-
"value": {
|
|
26
|
-
"kind": "expression"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": ".importPath",
|
|
31
|
-
"description": "",
|
|
23
|
+
"name": ".name",
|
|
24
|
+
"description": "The name of the iconset. Every iconset is required to have its own unique name.\nAll the SVG icons in the iconset must have IDs conforming to its name.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
32
25
|
"value": {
|
|
33
26
|
"kind": "expression"
|
|
34
27
|
}
|
|
35
28
|
},
|
|
36
29
|
{
|
|
37
|
-
"name": ".
|
|
38
|
-
"description": "",
|
|
39
|
-
"value": {
|
|
40
|
-
"kind": "expression"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": ".$",
|
|
45
|
-
"description": "",
|
|
30
|
+
"name": ".size",
|
|
31
|
+
"description": "The size of an individual icon. Note that icons must be square.\n\nWhen using `vaadin-icon`, the size of the iconset will take precedence\nover the size defined by the user to ensure correct appearance.",
|
|
46
32
|
"value": {
|
|
47
33
|
"kind": "expression"
|
|
48
34
|
}
|
|
49
|
-
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "vaadin-icon",
|
|
40
|
+
"description": "`<vaadin-icon>` is a Web Component for displaying SVG icons.\n\n### Icon property\n\nThe `<vaadin-icon>` component is designed to be used as a drop-in replacement for `<iron-icon>`.\nFor example, you can use it with `vaadin-icons` like this:\n\n```html\n<vaadin-icon icon=\"vaadin:angle-down\"></vaadin-icon>\n```\n\nAlternatively, you can also pick one of the Lumo icons:\n\n```html\n<vaadin-icon icon=\"lumo:user\"></vaadin-icon>\n```\n\n### Custom SVG icon\n\nAlternatively, instead of selecting an icon from an iconset by name, you can pass any custom `svg`\nliteral using the [`svg`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-svg) property. In this case you can also\ndefine the size of the SVG `viewBox` using the [`size`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-icon#property-size) property:\n\n```js\nimport { html, svg } from 'lit';\n\n// in your component\nrender() {\n const svgIcon = svg`<path d=\"M13 4v2l-5 5-5-5v-2l5 5z\"></path>`;\n return html`\n <vaadin-icon\n .svg=\"${svgIcon}\"\n size=\"16\"\n ></vaadin-icon>\n `;\n}\n```",
|
|
41
|
+
"extension": true,
|
|
42
|
+
"attributes": [
|
|
50
43
|
{
|
|
51
44
|
"name": ".icon",
|
|
52
|
-
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-
|
|
45
|
+
"description": "The name of the icon to use. The name should be of the form:\n`iconset_name:icon_name`. When using `vaadin-icons` it is possible\nto omit the first part and only use `icon_name` as a value.\n\nSetting the `icon` property updates the `svg` and `size` based on the\nvalues provided by the corresponding `vaadin-iconset` element.\n\nSee also [`name`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha8/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
53
46
|
"value": {
|
|
54
47
|
"kind": "expression"
|
|
55
48
|
}
|