@vaadin/icon 23.2.14 → 23.2.16
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/README.md +1 -1
- package/package.json +8 -6
- package/src/vaadin-icon-svg.d.ts +1 -1
- package/src/vaadin-icon-svg.js +1 -1
- package/src/vaadin-icon.d.ts +3 -2
- package/src/vaadin-icon.js +29 -52
- package/src/vaadin-iconset.d.ts +19 -8
- package/src/vaadin-iconset.js +103 -39
- package/web-types.json +6 -6
- package/web-types.lit.json +4 -4
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ import '@vaadin/icon';
|
|
|
28
28
|
## Themes
|
|
29
29
|
|
|
30
30
|
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
31
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/
|
|
31
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/icon/vaadin-icon.js) of the package uses the Lumo theme.
|
|
32
32
|
|
|
33
33
|
To use the Material theme, import the component from the `theme/material` folder:
|
|
34
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/icon",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,17 +35,19 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "~23.2.
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "~23.2.
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "~23.2.
|
|
38
|
+
"@vaadin/component-base": "~23.2.16",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "~23.2.16",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "~23.2.16",
|
|
41
41
|
"lit": "^2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
44
|
+
"@esm-bundle/chai": "^4.3.4",
|
|
45
|
+
"@vaadin/testing-helpers": "^0.4.0",
|
|
46
|
+
"sinon": "^13.0.2"
|
|
45
47
|
},
|
|
46
48
|
"web-types": [
|
|
47
49
|
"web-types.json",
|
|
48
50
|
"web-types.lit.json"
|
|
49
51
|
],
|
|
50
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "57010013e59a3ecdc70ceef4377dbc3b1ac03fb3"
|
|
51
53
|
}
|
package/src/vaadin-icon-svg.d.ts
CHANGED
package/src/vaadin-icon-svg.js
CHANGED
package/src/vaadin-icon.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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
|
+
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
6
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
@@ -46,7 +47,7 @@ import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
|
46
47
|
* }
|
|
47
48
|
* ```
|
|
48
49
|
*/
|
|
49
|
-
declare class Icon extends ThemableMixin(ElementMixin(HTMLElement)) {
|
|
50
|
+
declare class Icon extends ThemableMixin(ElementMixin(ControllerMixin(HTMLElement))) {
|
|
50
51
|
/**
|
|
51
52
|
* The name of the icon to use. The name should be of the form:
|
|
52
53
|
* `iconset_name:icon_name`. When using `vaadin-icons` it is possible
|
package/src/vaadin-icon.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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';
|
|
7
|
+
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
+
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
8
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
11
|
import { ensureSvgLiteral, renderSvg } from './vaadin-icon-svg.js';
|
|
10
12
|
import { Iconset } from './vaadin-iconset.js';
|
|
11
13
|
|
|
12
|
-
const DEFAULT_ICONSET = 'vaadin';
|
|
13
|
-
|
|
14
14
|
/**
|
|
15
15
|
* `<vaadin-icon>` is a Web Component for displaying SVG icons.
|
|
16
16
|
*
|
|
@@ -51,10 +51,11 @@ const DEFAULT_ICONSET = 'vaadin';
|
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* @extends HTMLElement
|
|
54
|
+
* @mixes ControllerMixin
|
|
54
55
|
* @mixes ThemableMixin
|
|
55
56
|
* @mixes ElementMixin
|
|
56
57
|
*/
|
|
57
|
-
class Icon extends ThemableMixin(ElementMixin(PolymerElement)) {
|
|
58
|
+
class Icon extends ThemableMixin(ElementMixin(ControllerMixin(PolymerElement))) {
|
|
58
59
|
static get template() {
|
|
59
60
|
return html`
|
|
60
61
|
<style>
|
|
@@ -87,6 +88,8 @@ class Icon extends ThemableMixin(ElementMixin(PolymerElement)) {
|
|
|
87
88
|
preserveAspectRatio="xMidYMid meet"
|
|
88
89
|
aria-hidden="true"
|
|
89
90
|
></svg>
|
|
91
|
+
|
|
92
|
+
<slot name="tooltip"></slot>
|
|
90
93
|
`;
|
|
91
94
|
}
|
|
92
95
|
|
|
@@ -138,79 +141,53 @@ class Icon extends ThemableMixin(ElementMixin(PolymerElement)) {
|
|
|
138
141
|
return ['__svgChanged(svg, __svgElement)'];
|
|
139
142
|
}
|
|
140
143
|
|
|
141
|
-
constructor() {
|
|
142
|
-
super();
|
|
143
|
-
this.__onIconsetRegistered = this.__onIconsetRegistered.bind(this);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
144
|
/** @protected */
|
|
147
145
|
ready() {
|
|
148
146
|
super.ready();
|
|
149
147
|
this.__svgElement = this.shadowRoot.querySelector('svg');
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/** @private */
|
|
153
|
-
__getIconsetName(icon) {
|
|
154
|
-
if (!icon) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
148
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/** @private */
|
|
163
|
-
__onIconsetRegistered(e) {
|
|
164
|
-
if (e.detail === this.__getIconsetName(this.icon)) {
|
|
165
|
-
this.__iconChanged(this.icon);
|
|
166
|
-
}
|
|
149
|
+
this._tooltipController = new TooltipController(this);
|
|
150
|
+
this.addController(this._tooltipController);
|
|
167
151
|
}
|
|
168
152
|
|
|
169
153
|
/** @protected */
|
|
170
154
|
connectedCallback() {
|
|
171
155
|
super.connectedCallback();
|
|
172
|
-
|
|
156
|
+
|
|
157
|
+
Iconset.attachedIcons.add(this);
|
|
173
158
|
}
|
|
174
159
|
|
|
175
160
|
/** @protected */
|
|
176
161
|
disconnectedCallback() {
|
|
177
162
|
super.disconnectedCallback();
|
|
178
|
-
|
|
163
|
+
|
|
164
|
+
Iconset.attachedIcons.delete(this);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** @protected */
|
|
168
|
+
_applyIcon() {
|
|
169
|
+
const { svg, size, viewBox } = Iconset.getIconSvg(this.icon);
|
|
170
|
+
|
|
171
|
+
if (viewBox) {
|
|
172
|
+
this.__viewBox = viewBox;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (size && size !== this.size) {
|
|
176
|
+
this.size = size;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this.svg = svg;
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
/** @private */
|
|
182
183
|
__iconChanged(icon) {
|
|
183
184
|
if (icon) {
|
|
184
|
-
this.
|
|
185
|
-
const iconsetName = this.__getIconsetName(icon);
|
|
186
|
-
const iconset = Iconset.getIconset(iconsetName);
|
|
187
|
-
const { svg, size, viewBox } = iconset.applyIcon(icon);
|
|
188
|
-
if (viewBox) {
|
|
189
|
-
this.__viewBox = viewBox;
|
|
190
|
-
}
|
|
191
|
-
if (size !== this.size) {
|
|
192
|
-
this.size = size;
|
|
193
|
-
}
|
|
194
|
-
this.svg = svg;
|
|
185
|
+
this._applyIcon();
|
|
195
186
|
} else {
|
|
196
187
|
this.svg = ensureSvgLiteral(null);
|
|
197
188
|
}
|
|
198
189
|
}
|
|
199
190
|
|
|
200
|
-
/** @private */
|
|
201
|
-
__checkDeprecatedIcon(icon) {
|
|
202
|
-
const deprecatedIcons = {
|
|
203
|
-
'vaadin:buss': 'vaadin:bus',
|
|
204
|
-
'vaadin:funcion': 'vaadin:function',
|
|
205
|
-
'vaadin:megafone': 'vaadin:megaphone',
|
|
206
|
-
'vaadin:palete': 'vaadin:palette',
|
|
207
|
-
'vaadin:trendind-down': 'vaadin:trending-down',
|
|
208
|
-
};
|
|
209
|
-
if (icon in deprecatedIcons) {
|
|
210
|
-
console.warn(`WARNING: The icon "${icon}" is deprecated. Use "${deprecatedIcons[icon]}" instead`);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
191
|
/** @private */
|
|
215
192
|
__svgChanged(svg, svgElement) {
|
|
216
193
|
if (!svgElement) {
|
package/src/vaadin-iconset.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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';
|
|
7
|
+
import type { Icon } from './vaadin-icon.js';
|
|
7
8
|
import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -11,10 +12,26 @@ import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
|
11
12
|
*/
|
|
12
13
|
declare class Iconset extends ElementMixin(HTMLElement) {
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Set of the `vaadin-icon` instances in the DOM.
|
|
16
|
+
*/
|
|
17
|
+
static attachedIcons(): Set<Icon>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns an instance of the iconset by its name.
|
|
15
21
|
*/
|
|
16
22
|
static getIconset(name: string): Iconset;
|
|
17
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Register an iconset without adding to the DOM.
|
|
26
|
+
*/
|
|
27
|
+
static register(name: string, size: number, template: HTMLTemplateElement): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns SVGTemplateResult for the `icon` ID matching `name` of the
|
|
31
|
+
* iconset, or `nothing` literal if there is no matching icon found.
|
|
32
|
+
*/
|
|
33
|
+
static getIconSvg(icon: string, name?: string): { svg: IconSvgLiteral; size?: number; viewBox?: string | null };
|
|
34
|
+
|
|
18
35
|
/**
|
|
19
36
|
* The name of the iconset. Every iconset is required to have its own unique name.
|
|
20
37
|
* All the SVG icons in the iconset must have IDs conforming to its name.
|
|
@@ -30,12 +47,6 @@ declare class Iconset extends ElementMixin(HTMLElement) {
|
|
|
30
47
|
* over the size defined by the user to ensure correct appearance.
|
|
31
48
|
*/
|
|
32
49
|
size: number;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Produce SVGTemplateResult for the element matching `name` in this
|
|
36
|
-
* iconset, or `undefined` if there is no matching element.
|
|
37
|
-
*/
|
|
38
|
-
applyIcon(name: string): { svg: IconSvgLiteral; size: number; viewBox: string | null };
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
declare global {
|
package/src/vaadin-iconset.js
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
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';
|
|
7
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
8
|
import { cloneSvgNode } from './vaadin-icon-svg.js';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const iconsetRegistry = {};
|
|
11
|
+
|
|
12
|
+
const attachedIcons = new Set();
|
|
13
|
+
|
|
14
|
+
function getIconId(id, name) {
|
|
15
|
+
return (id || '').replace(`${name}:`, '');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getIconsetName(icon) {
|
|
19
|
+
if (!icon) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const parts = icon.split(':');
|
|
24
|
+
|
|
25
|
+
// Use "vaadin" as a fallback
|
|
26
|
+
return parts[0] || 'vaadin';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function initIconsMap(iconset, name) {
|
|
30
|
+
iconset._icons = [...iconset.querySelectorAll('[id]')].reduce((map, svg) => {
|
|
31
|
+
const key = getIconId(svg.id, name);
|
|
32
|
+
map[key] = svg;
|
|
33
|
+
return map;
|
|
34
|
+
}, {});
|
|
35
|
+
}
|
|
11
36
|
|
|
12
37
|
/**
|
|
13
38
|
* `<vaadin-iconset>` is a Web Component for creating SVG icon collections.
|
|
@@ -51,18 +76,72 @@ class Iconset extends ElementMixin(PolymerElement) {
|
|
|
51
76
|
}
|
|
52
77
|
|
|
53
78
|
/**
|
|
54
|
-
*
|
|
79
|
+
* Set of the `vaadin-icon` instances in the DOM.
|
|
80
|
+
*
|
|
81
|
+
* @return {Set<Icon>}
|
|
82
|
+
*/
|
|
83
|
+
static get attachedIcons() {
|
|
84
|
+
return attachedIcons;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Returns an instance of the iconset by its name.
|
|
55
89
|
*
|
|
56
90
|
* @param {string} name
|
|
91
|
+
* @return {Iconset}
|
|
57
92
|
*/
|
|
58
93
|
static getIconset(name) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
94
|
+
return iconsetRegistry[name];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns SVGTemplateResult for the `icon` ID matching `name` of the
|
|
99
|
+
* iconset, or `nothing` literal if there is no matching icon found.
|
|
100
|
+
*
|
|
101
|
+
* @param {string} icon
|
|
102
|
+
* @param {?string} name
|
|
103
|
+
*/
|
|
104
|
+
static getIconSvg(icon, name) {
|
|
105
|
+
const iconsetName = name || getIconsetName(icon);
|
|
106
|
+
const iconset = this.getIconset(iconsetName);
|
|
107
|
+
|
|
108
|
+
if (!icon || !iconset) {
|
|
109
|
+
// Missing icon, return `nothing` literal.
|
|
110
|
+
return { svg: cloneSvgNode(null) };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const iconId = getIconId(icon, iconsetName);
|
|
114
|
+
const iconSvg = iconset._icons[iconId];
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
svg: cloneSvgNode(iconSvg),
|
|
118
|
+
size: iconset.size,
|
|
119
|
+
viewBox: iconSvg ? iconSvg.getAttribute('viewBox') : null,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Register an iconset without adding to the DOM.
|
|
125
|
+
*
|
|
126
|
+
* @param {string} name
|
|
127
|
+
* @param {number} size
|
|
128
|
+
* @param {?HTMLTemplateElement} template
|
|
129
|
+
*/
|
|
130
|
+
static register(name, size, template) {
|
|
131
|
+
if (!iconsetRegistry[name]) {
|
|
132
|
+
const iconset = document.createElement('vaadin-iconset');
|
|
133
|
+
iconset.appendChild(template.content.cloneNode(true));
|
|
134
|
+
iconsetRegistry[name] = iconset;
|
|
135
|
+
|
|
136
|
+
initIconsMap(iconset, name);
|
|
137
|
+
|
|
138
|
+
iconset.size = size;
|
|
62
139
|
iconset.name = name;
|
|
63
|
-
|
|
140
|
+
|
|
141
|
+
// Call this function manually instead of using observer
|
|
142
|
+
// to make it work without appending element to the DOM.
|
|
143
|
+
iconset.__nameChanged(name);
|
|
64
144
|
}
|
|
65
|
-
return iconset;
|
|
66
145
|
}
|
|
67
146
|
|
|
68
147
|
/** @protected */
|
|
@@ -70,51 +149,36 @@ class Iconset extends ElementMixin(PolymerElement) {
|
|
|
70
149
|
super.connectedCallback();
|
|
71
150
|
|
|
72
151
|
this.style.display = 'none';
|
|
152
|
+
|
|
153
|
+
// Store reference and init icons.
|
|
154
|
+
const { name } = this;
|
|
155
|
+
iconsetRegistry[name] = this;
|
|
156
|
+
initIconsMap(this, name);
|
|
157
|
+
this.__updateIcons(name);
|
|
73
158
|
}
|
|
74
159
|
|
|
75
160
|
/**
|
|
76
|
-
*
|
|
77
|
-
* iconset, or `undefined` if there is no matching element.
|
|
161
|
+
* Update all the icons instances in the DOM.
|
|
78
162
|
*
|
|
79
163
|
* @param {string} name
|
|
164
|
+
* @private
|
|
80
165
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
svg: cloneSvgNode(icon),
|
|
88
|
-
size: this.size,
|
|
89
|
-
viewBox: icon ? icon.getAttribute('viewBox') : null,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Create a map of child SVG elements by id.
|
|
95
|
-
*/
|
|
96
|
-
__createIconMap() {
|
|
97
|
-
const icons = {};
|
|
98
|
-
this.querySelectorAll('[id]').forEach((icon) => {
|
|
99
|
-
icons[this.__getIconId(icon.id)] = icon;
|
|
166
|
+
__updateIcons(name) {
|
|
167
|
+
attachedIcons.forEach((element) => {
|
|
168
|
+
if (name === getIconsetName(element.icon)) {
|
|
169
|
+
element._applyIcon();
|
|
170
|
+
}
|
|
100
171
|
});
|
|
101
|
-
return icons;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** @private */
|
|
105
|
-
__getIconId(id) {
|
|
106
|
-
return (id || '').replace(`${this.name}:`, '');
|
|
107
172
|
}
|
|
108
173
|
|
|
109
174
|
/** @private */
|
|
110
175
|
__nameChanged(name, oldName) {
|
|
111
176
|
if (oldName) {
|
|
112
|
-
|
|
113
|
-
delete
|
|
177
|
+
iconsetRegistry[name] = iconsetRegistry[oldName];
|
|
178
|
+
delete iconsetRegistry[oldName];
|
|
114
179
|
}
|
|
115
180
|
if (name) {
|
|
116
|
-
|
|
117
|
-
document.dispatchEvent(new CustomEvent('vaadin-iconset-registered', { detail: name }));
|
|
181
|
+
this.__updateIcons(name);
|
|
118
182
|
}
|
|
119
183
|
}
|
|
120
184
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/icon",
|
|
4
|
-
"version": "23.2.
|
|
4
|
+
"version": "23.2.16",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
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/23.2.
|
|
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/23.2.16/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
16
16
|
"value": {
|
|
17
17
|
"type": [
|
|
18
18
|
"string",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"properties": [
|
|
49
49
|
{
|
|
50
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/23.2.
|
|
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/23.2.16/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
52
52
|
"value": {
|
|
53
53
|
"type": [
|
|
54
54
|
"string",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
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/23.2.
|
|
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/23.2.16/#/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/23.2.16/#/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
78
|
"attributes": [
|
|
79
79
|
{
|
|
80
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/23.2.
|
|
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/23.2.16/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
82
82
|
"value": {
|
|
83
83
|
"type": [
|
|
84
84
|
"string",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"properties": [
|
|
115
115
|
{
|
|
116
116
|
"name": "icon",
|
|
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/23.2.
|
|
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/23.2.16/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
118
118
|
"value": {
|
|
119
119
|
"type": [
|
|
120
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": "23.2.
|
|
4
|
+
"version": "23.2.16",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
23
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/23.2.
|
|
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/23.2.16/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
25
25
|
"value": {
|
|
26
26
|
"kind": "expression"
|
|
27
27
|
}
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
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/23.2.
|
|
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/23.2.16/#/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/23.2.16/#/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
41
|
"extension": true,
|
|
42
42
|
"attributes": [
|
|
43
43
|
{
|
|
44
44
|
"name": ".icon",
|
|
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/23.2.
|
|
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/23.2.16/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
46
46
|
"value": {
|
|
47
47
|
"kind": "expression"
|
|
48
48
|
}
|