@vaadin/icon 24.2.0-alpha15 → 24.2.0-alpha16
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-font-size-mixin.js +5 -5
- package/src/vaadin-icon.d.ts +10 -2
- package/src/vaadin-icon.js +58 -23
- package/web-types.json +17 -10
- package/web-types.lit.json +13 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/icon",
|
|
3
|
-
"version": "24.2.0-
|
|
3
|
+
"version": "24.2.0-alpha16",
|
|
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.2.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0-
|
|
38
|
+
"@vaadin/component-base": "24.2.0-alpha16",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "24.2.0-alpha16",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "24.2.0-alpha16",
|
|
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": "133d3aeb00dedc8be975affa81c7af4b4d22acf6"
|
|
53
53
|
}
|
|
@@ -34,7 +34,7 @@ export const IconFontSizeMixin = dedupingMixin((superclass) =>
|
|
|
34
34
|
? superclass
|
|
35
35
|
: class extends ResizeMixin(superclass) {
|
|
36
36
|
static get observers() {
|
|
37
|
-
return ['__iconFontSizeMixinfontChanged(
|
|
37
|
+
return ['__iconFontSizeMixinfontChanged(iconClass, char, ligature)'];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** @protected */
|
|
@@ -46,8 +46,8 @@ export const IconFontSizeMixin = dedupingMixin((superclass) =>
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/** @private */
|
|
49
|
-
__iconFontSizeMixinfontChanged(
|
|
50
|
-
// Update when
|
|
49
|
+
__iconFontSizeMixinfontChanged(_iconClass, _char, _ligature) {
|
|
50
|
+
// Update when iconClass, char or ligature changes
|
|
51
51
|
this.__updateFontIconSize();
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -61,12 +61,12 @@ export const IconFontSizeMixin = dedupingMixin((superclass) =>
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Updates the --_vaadin-font-icon-size CSS variable value if
|
|
64
|
+
* Updates the --_vaadin-font-icon-size CSS variable value if font icons are used.
|
|
65
65
|
*
|
|
66
66
|
* @private
|
|
67
67
|
*/
|
|
68
68
|
__updateFontIconSize() {
|
|
69
|
-
if (this.char || this.
|
|
69
|
+
if (this.char || this.iconClass || this.ligature) {
|
|
70
70
|
const { paddingTop, paddingBottom, height } = getComputedStyle(this);
|
|
71
71
|
const fontIconSize = parseFloat(height) - parseFloat(paddingTop) - parseFloat(paddingBottom);
|
|
72
72
|
this.style.setProperty('--_vaadin-font-icon-size', `${fontIconSize}px`);
|
package/src/vaadin-icon.d.ts
CHANGED
|
@@ -81,12 +81,20 @@ declare class Icon extends ThemableMixin(
|
|
|
81
81
|
*/
|
|
82
82
|
src: string | null;
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* The symbol identifier that references an ID of an element contained in the SVG element assigned to the
|
|
86
|
+
* `src` property
|
|
87
|
+
*/
|
|
88
|
+
symbol: string | null;
|
|
89
|
+
|
|
84
90
|
/**
|
|
85
91
|
* Class names defining an icon font and/or a specific glyph inside an icon font.
|
|
86
92
|
*
|
|
87
|
-
*
|
|
93
|
+
* Example: "fa-solid fa-user"
|
|
94
|
+
*
|
|
95
|
+
* @attr {string} icon-class
|
|
88
96
|
*/
|
|
89
|
-
|
|
97
|
+
iconClass: string | null;
|
|
90
98
|
|
|
91
99
|
/**
|
|
92
100
|
* A hexadecimal code point that specifies a glyph from an icon font.
|
package/src/vaadin-icon.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
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 { svg } from 'lit';
|
|
8
7
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
9
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
9
|
import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
@@ -80,6 +79,9 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
80
79
|
:host::before {
|
|
81
80
|
line-height: 1;
|
|
82
81
|
font-size: 100cqh;
|
|
82
|
+
-webkit-font-smoothing: antialiased;
|
|
83
|
+
text-rendering: optimizeLegibility;
|
|
84
|
+
-moz-osx-font-smoothing: grayscale;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
:host([hidden]) {
|
|
@@ -92,7 +94,7 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
92
94
|
height: 100%;
|
|
93
95
|
}
|
|
94
96
|
|
|
95
|
-
:host(:is([
|
|
97
|
+
:host(:is([icon-class], [font-icon-content])) svg {
|
|
96
98
|
display: none;
|
|
97
99
|
}
|
|
98
100
|
|
|
@@ -107,7 +109,12 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
107
109
|
viewBox="[[__computeViewBox(size, __viewBox)]]"
|
|
108
110
|
preserveAspectRatio="[[__computePAR(__defaultPAR, __preserveAspectRatio)]]"
|
|
109
111
|
aria-hidden="true"
|
|
110
|
-
|
|
112
|
+
>
|
|
113
|
+
<g id="svg-group"></g>
|
|
114
|
+
<g id="use-group" visibility$="[[__computeVisibility(__useRef, svg)]]">
|
|
115
|
+
<use href$="[[__useRef]]" />
|
|
116
|
+
</g>
|
|
117
|
+
</svg>
|
|
111
118
|
|
|
112
119
|
<slot name="tooltip"></slot>
|
|
113
120
|
`;
|
|
@@ -152,18 +159,32 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
152
159
|
* inside the SVG referenced by the path. Note that the file needs to follow the same-origin policy.
|
|
153
160
|
* - a string in the format "data:image/svg+xml,<svg>...</svg>". You may need to use the "encodeURIComponent"
|
|
154
161
|
* function for the SVG content passed
|
|
162
|
+
*
|
|
163
|
+
* @type {string}
|
|
155
164
|
*/
|
|
156
165
|
src: {
|
|
157
166
|
type: String,
|
|
158
167
|
},
|
|
159
168
|
|
|
169
|
+
/**
|
|
170
|
+
* The symbol identifier that references an ID of an element contained in the SVG element assigned to the
|
|
171
|
+
* `src` property
|
|
172
|
+
*
|
|
173
|
+
* @type {string}
|
|
174
|
+
*/
|
|
175
|
+
symbol: {
|
|
176
|
+
type: String,
|
|
177
|
+
},
|
|
178
|
+
|
|
160
179
|
/**
|
|
161
180
|
* Class names defining an icon font and/or a specific glyph inside an icon font.
|
|
162
181
|
*
|
|
163
|
-
*
|
|
182
|
+
* Example: "fa-solid fa-user"
|
|
183
|
+
*
|
|
184
|
+
* @attr {string} icon-class
|
|
164
185
|
* @type {string}
|
|
165
186
|
*/
|
|
166
|
-
|
|
187
|
+
iconClass: {
|
|
167
188
|
type: String,
|
|
168
189
|
reflectToAttribute: true,
|
|
169
190
|
},
|
|
@@ -218,7 +239,10 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
218
239
|
__preserveAspectRatio: String,
|
|
219
240
|
|
|
220
241
|
/** @private */
|
|
221
|
-
|
|
242
|
+
__useRef: Object,
|
|
243
|
+
|
|
244
|
+
/** @private */
|
|
245
|
+
__svgElement: String,
|
|
222
246
|
|
|
223
247
|
/** @private */
|
|
224
248
|
__viewBox: String,
|
|
@@ -226,7 +250,7 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
226
250
|
}
|
|
227
251
|
|
|
228
252
|
static get observers() {
|
|
229
|
-
return ['__svgChanged(svg, __svgElement)', '__fontChanged(
|
|
253
|
+
return ['__svgChanged(svg, __svgElement)', '__fontChanged(iconClass, char, ligature)', '__srcChanged(src, symbol)'];
|
|
230
254
|
}
|
|
231
255
|
|
|
232
256
|
static get observedAttributes() {
|
|
@@ -244,7 +268,7 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
244
268
|
const tag = this.localName;
|
|
245
269
|
return [
|
|
246
270
|
`
|
|
247
|
-
${tag}[
|
|
271
|
+
${tag}[icon-class] {
|
|
248
272
|
display: inline-flex;
|
|
249
273
|
vertical-align: middle;
|
|
250
274
|
font-size: inherit;
|
|
@@ -254,14 +278,14 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
254
278
|
}
|
|
255
279
|
|
|
256
280
|
/** @private */
|
|
257
|
-
get
|
|
258
|
-
return this.
|
|
281
|
+
get __iconClasses() {
|
|
282
|
+
return this.iconClass ? this.iconClass.split(' ') : [];
|
|
259
283
|
}
|
|
260
284
|
|
|
261
285
|
/** @protected */
|
|
262
286
|
ready() {
|
|
263
287
|
super.ready();
|
|
264
|
-
this.__svgElement = this.shadowRoot.querySelector('svg');
|
|
288
|
+
this.__svgElement = this.shadowRoot.querySelector('#svg-group');
|
|
265
289
|
|
|
266
290
|
this._tooltipController = new TooltipController(this);
|
|
267
291
|
this.addController(this._tooltipController);
|
|
@@ -310,7 +334,7 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
310
334
|
}
|
|
311
335
|
|
|
312
336
|
/** @private */
|
|
313
|
-
async __srcChanged(src) {
|
|
337
|
+
async __srcChanged(src, symbol) {
|
|
314
338
|
if (!src) {
|
|
315
339
|
this.svg = null;
|
|
316
340
|
return;
|
|
@@ -320,8 +344,9 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
320
344
|
// https://github.com/vaadin/web-components/issues/6301
|
|
321
345
|
this.icon = '';
|
|
322
346
|
|
|
323
|
-
if (src.includes('#')) {
|
|
324
|
-
|
|
347
|
+
if (!src.startsWith('data:') && (symbol || src.includes('#'))) {
|
|
348
|
+
const [path, iconId] = src.split('#');
|
|
349
|
+
this.__useRef = `${path}#${symbol || iconId}`;
|
|
325
350
|
} else {
|
|
326
351
|
try {
|
|
327
352
|
const data = await this.__fetch(src, { mode: 'cors' });
|
|
@@ -341,8 +366,13 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
341
366
|
throw new Error(`SVG element not found on path: ${src}`);
|
|
342
367
|
}
|
|
343
368
|
|
|
344
|
-
this.__viewBox = svgElement.getAttribute('viewBox');
|
|
345
369
|
this.svg = unsafeSvgLiteral(svgElement.innerHTML);
|
|
370
|
+
|
|
371
|
+
if (symbol) {
|
|
372
|
+
this.__useRef = `#${symbol}`;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
this.__viewBox = svgElement.getAttribute('viewBox');
|
|
346
376
|
} catch (e) {
|
|
347
377
|
console.error(e);
|
|
348
378
|
this.svg = null;
|
|
@@ -364,17 +394,22 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
364
394
|
return preserveAspectRatio || defaultPAR;
|
|
365
395
|
}
|
|
366
396
|
|
|
397
|
+
/** @private */
|
|
398
|
+
__computeVisibility(__useRef) {
|
|
399
|
+
return __useRef ? 'visible' : 'hidden';
|
|
400
|
+
}
|
|
401
|
+
|
|
367
402
|
/** @private */
|
|
368
403
|
__computeViewBox(size, viewBox) {
|
|
369
404
|
return viewBox || `0 0 ${size} ${size}`;
|
|
370
405
|
}
|
|
371
406
|
|
|
372
407
|
/** @private */
|
|
373
|
-
__fontChanged(
|
|
374
|
-
this.classList.remove(...(this.
|
|
375
|
-
if (
|
|
376
|
-
this.
|
|
377
|
-
this.classList.add(...this.
|
|
408
|
+
__fontChanged(iconClass, char, ligature) {
|
|
409
|
+
this.classList.remove(...(this.__addedIconClasses || []));
|
|
410
|
+
if (iconClass) {
|
|
411
|
+
this.__addedIconClasses = [...this.__iconClasses];
|
|
412
|
+
this.classList.add(...this.__addedIconClasses);
|
|
378
413
|
}
|
|
379
414
|
|
|
380
415
|
if (char) {
|
|
@@ -385,7 +420,7 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
385
420
|
this.removeAttribute('font-icon-content');
|
|
386
421
|
}
|
|
387
422
|
|
|
388
|
-
if ((
|
|
423
|
+
if ((iconClass || char || ligature) && !this.icon) {
|
|
389
424
|
// The "icon" attribute needs to be set on the host also when using font icons
|
|
390
425
|
// to avoid issues such as https://github.com/vaadin/web-components/issues/6301
|
|
391
426
|
this.icon = '';
|
|
@@ -397,8 +432,8 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(SlotStylesMixin(Ic
|
|
|
397
432
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
398
433
|
|
|
399
434
|
// Make sure class list always contains all the font class names
|
|
400
|
-
if (name === 'class' && this.
|
|
401
|
-
this.classList.add(...this.
|
|
435
|
+
if (name === 'class' && this.__iconClasses.some((className) => !this.classList.contains(className))) {
|
|
436
|
+
this.classList.add(...this.__iconClasses);
|
|
402
437
|
}
|
|
403
438
|
}
|
|
404
439
|
|
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": "24.2.0-
|
|
4
|
+
"version": "24.2.0-alpha16",
|
|
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/24.2.0-
|
|
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.2.0-alpha16/#/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/24.2.0-
|
|
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.2.0-alpha16/#/elements/vaadin-icon#property-name) property of `vaadin-icon`.",
|
|
52
52
|
"value": {
|
|
53
53
|
"type": [
|
|
54
54
|
"string",
|
|
@@ -74,7 +74,7 @@
|
|
|
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/24.2.0-
|
|
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.2.0-alpha16/#/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.2.0-alpha16/#/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": "class",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"properties": [
|
|
102
102
|
{
|
|
103
103
|
"name": "icon",
|
|
104
|
-
"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.2.0-
|
|
104
|
+
"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.2.0-alpha16/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
105
105
|
"value": {
|
|
106
106
|
"type": [
|
|
107
107
|
"string"
|
|
@@ -124,15 +124,22 @@
|
|
|
124
124
|
"description": "The SVG source to be loaded as the icon. It can be:\n- an URL to a file containing the icon\n- an URL in the format \"/path/to/file.svg#objectID\", where the \"objectID\" refers to an ID attribute contained\n inside the SVG referenced by the path. Note that the file needs to follow the same-origin policy.\n- a string in the format \"data:image/svg+xml,<svg>...</svg>\". You may need to use the \"encodeURIComponent\"\n function for the SVG content passed",
|
|
125
125
|
"value": {
|
|
126
126
|
"type": [
|
|
127
|
-
"string"
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
"string"
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "symbol",
|
|
133
|
+
"description": "The symbol identifier that references an ID of an element contained in the SVG element assigned to the\n`src` property",
|
|
134
|
+
"value": {
|
|
135
|
+
"type": [
|
|
136
|
+
"string"
|
|
130
137
|
]
|
|
131
138
|
}
|
|
132
139
|
},
|
|
133
140
|
{
|
|
134
|
-
"name": "
|
|
135
|
-
"description": "Class names defining an icon font and/or a specific glyph inside an icon font
|
|
141
|
+
"name": "iconClass",
|
|
142
|
+
"description": "Class names defining an icon font and/or a specific glyph inside an icon font.\n\nExample: \"fa-solid fa-user\"",
|
|
136
143
|
"value": {
|
|
137
144
|
"type": [
|
|
138
145
|
"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.2.0-
|
|
4
|
+
"version": "24.2.0-alpha16",
|
|
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/24.2.0-
|
|
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.2.0-alpha16/#/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/24.2.0-
|
|
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.2.0-alpha16/#/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.2.0-alpha16/#/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/24.2.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.2.0-alpha16/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
46
46
|
"value": {
|
|
47
47
|
"kind": "expression"
|
|
48
48
|
}
|
|
@@ -62,8 +62,15 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
"name": ".
|
|
66
|
-
"description": "
|
|
65
|
+
"name": ".symbol",
|
|
66
|
+
"description": "The symbol identifier that references an ID of an element contained in the SVG element assigned to the\n`src` property",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": ".iconClass",
|
|
73
|
+
"description": "Class names defining an icon font and/or a specific glyph inside an icon font.\n\nExample: \"fa-solid fa-user\"",
|
|
67
74
|
"value": {
|
|
68
75
|
"kind": "expression"
|
|
69
76
|
}
|