@vaadin/icon 23.2.16 → 23.2.17
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 +6 -8
- package/src/vaadin-icon-svg.d.ts +1 -1
- package/src/vaadin-icon-svg.js +1 -1
- package/src/vaadin-icon.d.ts +2 -3
- package/src/vaadin-icon.js +52 -29
- package/src/vaadin-iconset.d.ts +8 -19
- package/src/vaadin-iconset.js +39 -103
- 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/master/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.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,19 +35,17 @@
|
|
|
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.17",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "~23.2.17",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "~23.2.17",
|
|
41
41
|
"lit": "^2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@vaadin/testing-helpers": "^0.4.0",
|
|
46
|
-
"sinon": "^13.0.2"
|
|
44
|
+
"@vaadin/testing-helpers": "^0.3.2"
|
|
47
45
|
},
|
|
48
46
|
"web-types": [
|
|
49
47
|
"web-types.json",
|
|
50
48
|
"web-types.lit.json"
|
|
51
49
|
],
|
|
52
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "60bf51d55e8b93a30536ebb4966248ba256c9b5d"
|
|
53
51
|
}
|
package/src/vaadin-icon-svg.d.ts
CHANGED
package/src/vaadin-icon-svg.js
CHANGED
package/src/vaadin-icon.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2022 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';
|
|
7
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
8
|
import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
@@ -47,7 +46,7 @@ import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
|
47
46
|
* }
|
|
48
47
|
* ```
|
|
49
48
|
*/
|
|
50
|
-
declare class Icon extends ThemableMixin(ElementMixin(
|
|
49
|
+
declare class Icon extends ThemableMixin(ElementMixin(HTMLElement)) {
|
|
51
50
|
/**
|
|
52
51
|
* The name of the icon to use. The name should be of the form:
|
|
53
52
|
* `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 - 2022 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';
|
|
8
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
-
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
10
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
9
|
import { ensureSvgLiteral, renderSvg } from './vaadin-icon-svg.js';
|
|
12
10
|
import { Iconset } from './vaadin-iconset.js';
|
|
13
11
|
|
|
12
|
+
const DEFAULT_ICONSET = 'vaadin';
|
|
13
|
+
|
|
14
14
|
/**
|
|
15
15
|
* `<vaadin-icon>` is a Web Component for displaying SVG icons.
|
|
16
16
|
*
|
|
@@ -51,11 +51,10 @@ import { Iconset } from './vaadin-iconset.js';
|
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* @extends HTMLElement
|
|
54
|
-
* @mixes ControllerMixin
|
|
55
54
|
* @mixes ThemableMixin
|
|
56
55
|
* @mixes ElementMixin
|
|
57
56
|
*/
|
|
58
|
-
class Icon extends ThemableMixin(ElementMixin(
|
|
57
|
+
class Icon extends ThemableMixin(ElementMixin(PolymerElement)) {
|
|
59
58
|
static get template() {
|
|
60
59
|
return html`
|
|
61
60
|
<style>
|
|
@@ -88,8 +87,6 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(PolymerElement)))
|
|
|
88
87
|
preserveAspectRatio="xMidYMid meet"
|
|
89
88
|
aria-hidden="true"
|
|
90
89
|
></svg>
|
|
91
|
-
|
|
92
|
-
<slot name="tooltip"></slot>
|
|
93
90
|
`;
|
|
94
91
|
}
|
|
95
92
|
|
|
@@ -141,53 +138,79 @@ class Icon extends ThemableMixin(ElementMixin(ControllerMixin(PolymerElement)))
|
|
|
141
138
|
return ['__svgChanged(svg, __svgElement)'];
|
|
142
139
|
}
|
|
143
140
|
|
|
141
|
+
constructor() {
|
|
142
|
+
super();
|
|
143
|
+
this.__onIconsetRegistered = this.__onIconsetRegistered.bind(this);
|
|
144
|
+
}
|
|
145
|
+
|
|
144
146
|
/** @protected */
|
|
145
147
|
ready() {
|
|
146
148
|
super.ready();
|
|
147
149
|
this.__svgElement = this.shadowRoot.querySelector('svg');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** @private */
|
|
153
|
+
__getIconsetName(icon) {
|
|
154
|
+
if (!icon) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
148
157
|
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
const parts = icon.split(':');
|
|
159
|
+
return parts[0] || DEFAULT_ICONSET;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** @private */
|
|
163
|
+
__onIconsetRegistered(e) {
|
|
164
|
+
if (e.detail === this.__getIconsetName(this.icon)) {
|
|
165
|
+
this.__iconChanged(this.icon);
|
|
166
|
+
}
|
|
151
167
|
}
|
|
152
168
|
|
|
153
169
|
/** @protected */
|
|
154
170
|
connectedCallback() {
|
|
155
171
|
super.connectedCallback();
|
|
156
|
-
|
|
157
|
-
Iconset.attachedIcons.add(this);
|
|
172
|
+
document.addEventListener('vaadin-iconset-registered', this.__onIconsetRegistered);
|
|
158
173
|
}
|
|
159
174
|
|
|
160
175
|
/** @protected */
|
|
161
176
|
disconnectedCallback() {
|
|
162
177
|
super.disconnectedCallback();
|
|
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;
|
|
178
|
+
document.removeEventListener('vaadin-iconset-registered', this.__onIconsetRegistered);
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
/** @private */
|
|
183
182
|
__iconChanged(icon) {
|
|
184
183
|
if (icon) {
|
|
185
|
-
this.
|
|
184
|
+
this.__checkDeprecatedIcon(icon);
|
|
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;
|
|
186
195
|
} else {
|
|
187
196
|
this.svg = ensureSvgLiteral(null);
|
|
188
197
|
}
|
|
189
198
|
}
|
|
190
199
|
|
|
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
|
+
|
|
191
214
|
/** @private */
|
|
192
215
|
__svgChanged(svg, svgElement) {
|
|
193
216
|
if (!svgElement) {
|
package/src/vaadin-iconset.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2022 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';
|
|
8
7
|
import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -12,26 +11,10 @@ import type { IconSvgLiteral } from './vaadin-icon-svg.js';
|
|
|
12
11
|
*/
|
|
13
12
|
declare class Iconset extends ElementMixin(HTMLElement) {
|
|
14
13
|
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
static attachedIcons(): Set<Icon>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Returns an instance of the iconset by its name.
|
|
14
|
+
* Create an instance of the iconset.
|
|
21
15
|
*/
|
|
22
16
|
static getIconset(name: string): Iconset;
|
|
23
17
|
|
|
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
|
-
|
|
35
18
|
/**
|
|
36
19
|
* The name of the iconset. Every iconset is required to have its own unique name.
|
|
37
20
|
* All the SVG icons in the iconset must have IDs conforming to its name.
|
|
@@ -47,6 +30,12 @@ declare class Iconset extends ElementMixin(HTMLElement) {
|
|
|
47
30
|
* over the size defined by the user to ensure correct appearance.
|
|
48
31
|
*/
|
|
49
32
|
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 };
|
|
50
39
|
}
|
|
51
40
|
|
|
52
41
|
declare global {
|
package/src/vaadin-iconset.js
CHANGED
|
@@ -1,38 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2022 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
|
|
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
|
-
}
|
|
10
|
+
const iconRegistry = {};
|
|
36
11
|
|
|
37
12
|
/**
|
|
38
13
|
* `<vaadin-iconset>` is a Web Component for creating SVG icon collections.
|
|
@@ -76,72 +51,18 @@ class Iconset extends ElementMixin(PolymerElement) {
|
|
|
76
51
|
}
|
|
77
52
|
|
|
78
53
|
/**
|
|
79
|
-
*
|
|
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.
|
|
54
|
+
* Create an instance of the iconset.
|
|
89
55
|
*
|
|
90
56
|
* @param {string} name
|
|
91
|
-
* @return {Iconset}
|
|
92
57
|
*/
|
|
93
58
|
static getIconset(name) {
|
|
94
|
-
|
|
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;
|
|
59
|
+
let iconset = iconRegistry[name];
|
|
60
|
+
if (!iconset) {
|
|
61
|
+
iconset = document.createElement('vaadin-iconset');
|
|
139
62
|
iconset.name = name;
|
|
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);
|
|
63
|
+
iconRegistry[name] = iconset;
|
|
144
64
|
}
|
|
65
|
+
return iconset;
|
|
145
66
|
}
|
|
146
67
|
|
|
147
68
|
/** @protected */
|
|
@@ -149,36 +70,51 @@ class Iconset extends ElementMixin(PolymerElement) {
|
|
|
149
70
|
super.connectedCallback();
|
|
150
71
|
|
|
151
72
|
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);
|
|
158
73
|
}
|
|
159
74
|
|
|
160
75
|
/**
|
|
161
|
-
*
|
|
76
|
+
* Produce SVGTemplateResult for the element matching `name` in this
|
|
77
|
+
* iconset, or `undefined` if there is no matching element.
|
|
162
78
|
*
|
|
163
79
|
* @param {string} name
|
|
164
|
-
* @private
|
|
165
80
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
81
|
+
applyIcon(name) {
|
|
82
|
+
// Create the icon map on-demand, since the iconset itself has no discrete
|
|
83
|
+
// signal to know when it's children are fully parsed
|
|
84
|
+
this._icons = this._icons || this.__createIconMap();
|
|
85
|
+
const icon = this._icons[this.__getIconId(name)];
|
|
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;
|
|
171
100
|
});
|
|
101
|
+
return icons;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** @private */
|
|
105
|
+
__getIconId(id) {
|
|
106
|
+
return (id || '').replace(`${this.name}:`, '');
|
|
172
107
|
}
|
|
173
108
|
|
|
174
109
|
/** @private */
|
|
175
110
|
__nameChanged(name, oldName) {
|
|
176
111
|
if (oldName) {
|
|
177
|
-
|
|
178
|
-
delete
|
|
112
|
+
iconRegistry[name] = Iconset.getIconset(oldName);
|
|
113
|
+
delete iconRegistry[oldName];
|
|
179
114
|
}
|
|
180
115
|
if (name) {
|
|
181
|
-
this
|
|
116
|
+
iconRegistry[name] = this;
|
|
117
|
+
document.dispatchEvent(new CustomEvent('vaadin-iconset-registered', { detail: name }));
|
|
182
118
|
}
|
|
183
119
|
}
|
|
184
120
|
}
|
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.17",
|
|
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.17/#/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.17/#/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.17/#/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.17/#/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.17/#/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.17/#/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.17",
|
|
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.17/#/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.17/#/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.17/#/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.17/#/elements/vaadin-iconset#property-name) property of `vaadin-iconset`.",
|
|
46
46
|
"value": {
|
|
47
47
|
"kind": "expression"
|
|
48
48
|
}
|