@spectrum-web-components/icon 1.0.0-rc.9 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/custom-elements.json +336 -0
- package/package.json +4 -4
- package/src/IconBase.d.ts +0 -1
- package/src/IconBase.dev.js +0 -15
- package/src/IconBase.dev.js.map +2 -2
- package/src/IconBase.js +2 -2
- package/src/IconBase.js.map +3 -3
@@ -0,0 +1,336 @@
|
|
1
|
+
{
|
2
|
+
"schemaVersion": "1.0.0",
|
3
|
+
"readme": "",
|
4
|
+
"modules": [
|
5
|
+
{
|
6
|
+
"kind": "javascript-module",
|
7
|
+
"path": "sp-icon.js",
|
8
|
+
"declarations": [],
|
9
|
+
"exports": [
|
10
|
+
{
|
11
|
+
"kind": "custom-element-definition",
|
12
|
+
"name": "sp-icon",
|
13
|
+
"declaration": {
|
14
|
+
"name": "Icon",
|
15
|
+
"module": "/src/Icon.js"
|
16
|
+
}
|
17
|
+
}
|
18
|
+
]
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"kind": "javascript-module",
|
22
|
+
"path": "src/Icon.js",
|
23
|
+
"declarations": [
|
24
|
+
{
|
25
|
+
"kind": "class",
|
26
|
+
"description": "",
|
27
|
+
"name": "Icon",
|
28
|
+
"members": [
|
29
|
+
{
|
30
|
+
"kind": "field",
|
31
|
+
"name": "src",
|
32
|
+
"type": {
|
33
|
+
"text": "string | undefined"
|
34
|
+
},
|
35
|
+
"privacy": "public",
|
36
|
+
"attribute": "src"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"kind": "field",
|
40
|
+
"name": "name",
|
41
|
+
"type": {
|
42
|
+
"text": "string | undefined"
|
43
|
+
},
|
44
|
+
"privacy": "public",
|
45
|
+
"attribute": "name"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"kind": "field",
|
49
|
+
"name": "iconContainer",
|
50
|
+
"type": {
|
51
|
+
"text": "HTMLElement | undefined"
|
52
|
+
},
|
53
|
+
"privacy": "private"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"kind": "field",
|
57
|
+
"name": "updateIconPromise",
|
58
|
+
"type": {
|
59
|
+
"text": "Promise<void> | undefined"
|
60
|
+
},
|
61
|
+
"privacy": "private"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"kind": "field",
|
65
|
+
"name": "iconsetListener",
|
66
|
+
"privacy": "private"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"kind": "method",
|
70
|
+
"name": "announceIconImageSrcError",
|
71
|
+
"privacy": "private",
|
72
|
+
"return": {
|
73
|
+
"type": {
|
74
|
+
"text": "void"
|
75
|
+
}
|
76
|
+
}
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"kind": "method",
|
80
|
+
"name": "updateIcon",
|
81
|
+
"privacy": "private",
|
82
|
+
"return": {
|
83
|
+
"type": {
|
84
|
+
"text": "Promise<void>"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"kind": "method",
|
90
|
+
"name": "parseIcon",
|
91
|
+
"privacy": "private",
|
92
|
+
"return": {
|
93
|
+
"type": {
|
94
|
+
"text": "{ iconset: string; icon: string }"
|
95
|
+
}
|
96
|
+
},
|
97
|
+
"parameters": [
|
98
|
+
{
|
99
|
+
"name": "icon",
|
100
|
+
"type": {
|
101
|
+
"text": "string"
|
102
|
+
}
|
103
|
+
}
|
104
|
+
]
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"kind": "method",
|
108
|
+
"name": "getUpdateComplete",
|
109
|
+
"privacy": "protected",
|
110
|
+
"return": {
|
111
|
+
"type": {
|
112
|
+
"text": "Promise<boolean>"
|
113
|
+
}
|
114
|
+
}
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"kind": "field",
|
118
|
+
"name": "unsubscribeSystemContext",
|
119
|
+
"type": {
|
120
|
+
"text": "(() => void) | null"
|
121
|
+
},
|
122
|
+
"privacy": "private",
|
123
|
+
"default": "null",
|
124
|
+
"inheritedFrom": {
|
125
|
+
"name": "IconBase",
|
126
|
+
"module": "src/IconBase.js"
|
127
|
+
}
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"kind": "field",
|
131
|
+
"name": "spectrumVersion",
|
132
|
+
"type": {
|
133
|
+
"text": "number"
|
134
|
+
},
|
135
|
+
"privacy": "public",
|
136
|
+
"default": "1",
|
137
|
+
"inheritedFrom": {
|
138
|
+
"name": "IconBase",
|
139
|
+
"module": "src/IconBase.js"
|
140
|
+
}
|
141
|
+
},
|
142
|
+
{
|
143
|
+
"kind": "field",
|
144
|
+
"name": "label",
|
145
|
+
"type": {
|
146
|
+
"text": "string"
|
147
|
+
},
|
148
|
+
"privacy": "public",
|
149
|
+
"default": "''",
|
150
|
+
"attribute": "label",
|
151
|
+
"inheritedFrom": {
|
152
|
+
"name": "IconBase",
|
153
|
+
"module": "src/IconBase.js"
|
154
|
+
}
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"kind": "field",
|
158
|
+
"name": "size",
|
159
|
+
"type": {
|
160
|
+
"text": "'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | undefined"
|
161
|
+
},
|
162
|
+
"privacy": "public",
|
163
|
+
"attribute": "size",
|
164
|
+
"reflects": true,
|
165
|
+
"inheritedFrom": {
|
166
|
+
"name": "IconBase",
|
167
|
+
"module": "src/IconBase.js"
|
168
|
+
}
|
169
|
+
},
|
170
|
+
{
|
171
|
+
"kind": "field",
|
172
|
+
"name": "systemResolver",
|
173
|
+
"privacy": "private",
|
174
|
+
"default": "new SystemResolutionController(this)",
|
175
|
+
"inheritedFrom": {
|
176
|
+
"name": "IconBase",
|
177
|
+
"module": "src/IconBase.js"
|
178
|
+
}
|
179
|
+
}
|
180
|
+
],
|
181
|
+
"events": [
|
182
|
+
{
|
183
|
+
"name": "error",
|
184
|
+
"type": {
|
185
|
+
"text": "Event"
|
186
|
+
}
|
187
|
+
}
|
188
|
+
],
|
189
|
+
"attributes": [
|
190
|
+
{
|
191
|
+
"name": "src",
|
192
|
+
"type": {
|
193
|
+
"text": "string | undefined"
|
194
|
+
},
|
195
|
+
"fieldName": "src"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"name": "name",
|
199
|
+
"type": {
|
200
|
+
"text": "string | undefined"
|
201
|
+
},
|
202
|
+
"fieldName": "name"
|
203
|
+
},
|
204
|
+
{
|
205
|
+
"name": "label",
|
206
|
+
"type": {
|
207
|
+
"text": "string"
|
208
|
+
},
|
209
|
+
"default": "''",
|
210
|
+
"fieldName": "label",
|
211
|
+
"inheritedFrom": {
|
212
|
+
"name": "IconBase",
|
213
|
+
"module": "src/IconBase.ts"
|
214
|
+
}
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"name": "size",
|
218
|
+
"type": {
|
219
|
+
"text": "'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | undefined"
|
220
|
+
},
|
221
|
+
"fieldName": "size",
|
222
|
+
"inheritedFrom": {
|
223
|
+
"name": "IconBase",
|
224
|
+
"module": "src/IconBase.ts"
|
225
|
+
}
|
226
|
+
}
|
227
|
+
],
|
228
|
+
"superclass": {
|
229
|
+
"name": "IconBase",
|
230
|
+
"module": "/src/IconBase.js"
|
231
|
+
},
|
232
|
+
"tagName": "sp-icon",
|
233
|
+
"customElement": true
|
234
|
+
}
|
235
|
+
],
|
236
|
+
"exports": [
|
237
|
+
{
|
238
|
+
"kind": "js",
|
239
|
+
"name": "Icon",
|
240
|
+
"declaration": {
|
241
|
+
"name": "Icon",
|
242
|
+
"module": "src/Icon.js"
|
243
|
+
}
|
244
|
+
}
|
245
|
+
]
|
246
|
+
},
|
247
|
+
{
|
248
|
+
"kind": "javascript-module",
|
249
|
+
"path": "src/IconBase.js",
|
250
|
+
"declarations": [
|
251
|
+
{
|
252
|
+
"kind": "class",
|
253
|
+
"description": "",
|
254
|
+
"name": "IconBase",
|
255
|
+
"members": [
|
256
|
+
{
|
257
|
+
"kind": "field",
|
258
|
+
"name": "unsubscribeSystemContext",
|
259
|
+
"type": {
|
260
|
+
"text": "(() => void) | null"
|
261
|
+
},
|
262
|
+
"privacy": "private",
|
263
|
+
"default": "null"
|
264
|
+
},
|
265
|
+
{
|
266
|
+
"kind": "field",
|
267
|
+
"name": "spectrumVersion",
|
268
|
+
"type": {
|
269
|
+
"text": "number"
|
270
|
+
},
|
271
|
+
"privacy": "public",
|
272
|
+
"default": "1"
|
273
|
+
},
|
274
|
+
{
|
275
|
+
"kind": "field",
|
276
|
+
"name": "label",
|
277
|
+
"type": {
|
278
|
+
"text": "string"
|
279
|
+
},
|
280
|
+
"privacy": "public",
|
281
|
+
"default": "''",
|
282
|
+
"attribute": "label"
|
283
|
+
},
|
284
|
+
{
|
285
|
+
"kind": "field",
|
286
|
+
"name": "size",
|
287
|
+
"type": {
|
288
|
+
"text": "'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | undefined"
|
289
|
+
},
|
290
|
+
"privacy": "public",
|
291
|
+
"attribute": "size",
|
292
|
+
"reflects": true
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"kind": "field",
|
296
|
+
"name": "systemResolver",
|
297
|
+
"privacy": "private",
|
298
|
+
"default": "new SystemResolutionController(this)"
|
299
|
+
}
|
300
|
+
],
|
301
|
+
"attributes": [
|
302
|
+
{
|
303
|
+
"name": "label",
|
304
|
+
"type": {
|
305
|
+
"text": "string"
|
306
|
+
},
|
307
|
+
"default": "''",
|
308
|
+
"fieldName": "label"
|
309
|
+
},
|
310
|
+
{
|
311
|
+
"name": "size",
|
312
|
+
"type": {
|
313
|
+
"text": "'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | undefined"
|
314
|
+
},
|
315
|
+
"fieldName": "size"
|
316
|
+
}
|
317
|
+
],
|
318
|
+
"superclass": {
|
319
|
+
"name": "SpectrumElement",
|
320
|
+
"package": "@spectrum-web-components/base"
|
321
|
+
}
|
322
|
+
}
|
323
|
+
],
|
324
|
+
"exports": [
|
325
|
+
{
|
326
|
+
"kind": "js",
|
327
|
+
"name": "IconBase",
|
328
|
+
"declaration": {
|
329
|
+
"name": "IconBase",
|
330
|
+
"module": "src/IconBase.js"
|
331
|
+
}
|
332
|
+
}
|
333
|
+
]
|
334
|
+
}
|
335
|
+
]
|
336
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/icon",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.1",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -81,8 +81,8 @@
|
|
81
81
|
"lit-html"
|
82
82
|
],
|
83
83
|
"dependencies": {
|
84
|
-
"@spectrum-web-components/base": "^1.0.
|
85
|
-
"@spectrum-web-components/iconset": "^1.0.
|
84
|
+
"@spectrum-web-components/base": "^1.0.1",
|
85
|
+
"@spectrum-web-components/iconset": "^1.0.1"
|
86
86
|
},
|
87
87
|
"devDependencies": {
|
88
88
|
"@spectrum-css/icon": "^8.0.0-s2-foundations.17"
|
@@ -93,5 +93,5 @@
|
|
93
93
|
"./sp-*.js",
|
94
94
|
"./**/*.dev.js"
|
95
95
|
],
|
96
|
-
"gitHead": "
|
96
|
+
"gitHead": "b359bc0242712be118c5e3e2cc05f88707d3eeb1"
|
97
97
|
}
|
package/src/IconBase.d.ts
CHANGED
@@ -7,7 +7,6 @@ export declare class IconBase extends SpectrumElement {
|
|
7
7
|
size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
8
8
|
connectedCallback(): void;
|
9
9
|
disconnectedCallback(): void;
|
10
|
-
private requestSystemContext;
|
11
10
|
private systemResolver;
|
12
11
|
protected update(changes: PropertyValues): void;
|
13
12
|
protected render(): TemplateResult;
|
package/src/IconBase.dev.js
CHANGED
@@ -35,7 +35,6 @@ export class IconBase extends SpectrumElement {
|
|
35
35
|
}
|
36
36
|
connectedCallback() {
|
37
37
|
super.connectedCallback();
|
38
|
-
this.requestSystemContext();
|
39
38
|
}
|
40
39
|
disconnectedCallback() {
|
41
40
|
super.disconnectedCallback();
|
@@ -44,20 +43,6 @@ export class IconBase extends SpectrumElement {
|
|
44
43
|
this.unsubscribeSystemContext = null;
|
45
44
|
}
|
46
45
|
}
|
47
|
-
requestSystemContext() {
|
48
|
-
this.dispatchEvent(
|
49
|
-
new CustomEvent("sp-system-context", {
|
50
|
-
detail: {
|
51
|
-
callback: (system, unsubscribe) => {
|
52
|
-
this.spectrumVersion = system === "spectrum-two" ? 2 : 1;
|
53
|
-
this.unsubscribeSystemContext = unsubscribe;
|
54
|
-
}
|
55
|
-
},
|
56
|
-
bubbles: true,
|
57
|
-
composed: true
|
58
|
-
})
|
59
|
-
);
|
60
|
-
}
|
61
46
|
update(changes) {
|
62
47
|
if (changes.has("label")) {
|
63
48
|
if (this.label) {
|
package/src/IconBase.dev.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["IconBase.ts"],
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO,gBAAgB;
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\nexport class IconBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [iconStyles];\n }\n\n private unsubscribeSystemContext: (() => void) | null = null;\n\n @state()\n public spectrumVersion = 1;\n\n @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n public override connectedCallback(): void {\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.unsubscribeSystemContext) {\n this.unsubscribeSystemContext();\n this.unsubscribeSystemContext = null;\n }\n }\n\n private systemResolver = new SystemResolutionController(this);\n\n protected override update(changes: PropertyValues): void {\n if (changes.has('label')) {\n if (this.label) {\n this.removeAttribute('aria-hidden');\n } else {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n if (changes.has(systemResolverUpdatedSymbol)) {\n this.spectrumVersion =\n this.systemResolver.system === 'spectrum-two' ? 2 : 1;\n }\n\n super.update(changes);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO,gBAAgB;AAEhB,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAKH,SAAQ,2BAAgD;AAGxD,SAAO,kBAAkB;AAGzB,SAAO,QAAQ;AAiBf,SAAQ,iBAAiB,IAAI,2BAA2B,IAAI;AAAA;AAAA,EA3B5D,WAA2B,SAAyB;AAChD,WAAO,CAAC,UAAU;AAAA,EACtB;AAAA,EAagB,oBAA0B;AACtC,UAAM,kBAAkB;AAAA,EAC5B;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAC3B,QAAI,KAAK,0BAA0B;AAC/B,WAAK,yBAAyB;AAC9B,WAAK,2BAA2B;AAAA,IACpC;AAAA,EACJ;AAAA,EAImB,OAAO,SAA+B;AACrD,QAAI,QAAQ,IAAI,OAAO,GAAG;AACtB,UAAI,KAAK,OAAO;AACZ,aAAK,gBAAgB,aAAa;AAAA,MACtC,OAAO;AACH,aAAK,aAAa,eAAe,MAAM;AAAA,MAC3C;AAAA,IACJ;AAEA,QAAI,QAAQ,IAAI,2BAA2B,GAAG;AAC1C,WAAK,kBACD,KAAK,eAAe,WAAW,iBAAiB,IAAI;AAAA,IAC5D;AAEA,UAAM,OAAO,OAAO;AAAA,EACxB;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AACJ;AA5CW;AAAA,EADN,MAAM;AAAA,GAPE,SAQF;AAGA;AAAA,EADN,SAAS;AAAA,GAVD,SAWF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAblB,SAcF;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/IconBase.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=(i,r,e,s)=>{for(var t=s>1?void 0:s?m(r,e):r,o=i.length-1,u;o>=0;o--)(u=i[o])&&(t=(s?u(r,e,t):u(t))||t);return s&&t&&c(r,e,t),t};import{html as n,SpectrumElement as a}from"@spectrum-web-components/base";import{SystemResolutionController as d,systemResolverUpdatedSymbol as b}from"@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js";import{property as p,state as y}from"@spectrum-web-components/base/src/decorators.js";import v from"./icon.css.js";export class IconBase extends a{constructor(){super(...arguments);this.unsubscribeSystemContext=null;this.spectrumVersion=1;this.label="";this.systemResolver=new d(this)}static get styles(){return[v]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeSystemContext&&(this.unsubscribeSystemContext(),this.unsubscribeSystemContext=null)}update(e){e.has("label")&&(this.label?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")),e.has(b)&&(this.spectrumVersion=this.systemResolver.system==="spectrum-two"?2:1),super.update(e)}render(){return n`
|
2
2
|
<slot></slot>
|
3
|
-
`}}
|
3
|
+
`}}l([y()],IconBase.prototype,"spectrumVersion",2),l([p()],IconBase.prototype,"label",2),l([p({reflect:!0})],IconBase.prototype,"size",2);
|
4
4
|
//# sourceMappingURL=IconBase.js.map
|
package/src/IconBase.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["IconBase.ts"],
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OACI,8BAAAC,EACA,+BAAAC,MACG,+EAEP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,OAAOC,MAAgB,
|
6
|
-
"names": ["html", "SpectrumElement", "SystemResolutionController", "systemResolverUpdatedSymbol", "property", "state", "iconStyles", "
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\nexport class IconBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [iconStyles];\n }\n\n private unsubscribeSystemContext: (() => void) | null = null;\n\n @state()\n public spectrumVersion = 1;\n\n @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n public override connectedCallback(): void {\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.unsubscribeSystemContext) {\n this.unsubscribeSystemContext();\n this.unsubscribeSystemContext = null;\n }\n }\n\n private systemResolver = new SystemResolutionController(this);\n\n protected override update(changes: PropertyValues): void {\n if (changes.has('label')) {\n if (this.label) {\n this.removeAttribute('aria-hidden');\n } else {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n if (changes.has(systemResolverUpdatedSymbol)) {\n this.spectrumVersion =\n this.systemResolver.system === 'spectrum-two' ? 2 : 1;\n }\n\n super.update(changes);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OACI,8BAAAC,EACA,+BAAAC,MACG,+EAEP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,OAAOC,MAAgB,gBAEhB,aAAM,iBAAiBL,CAAgB,CAAvC,kCAKH,KAAQ,yBAAgD,KAGxD,KAAO,gBAAkB,EAGzB,KAAO,MAAQ,GAiBf,KAAQ,eAAiB,IAAIC,EAA2B,IAAI,EA3B5D,WAA2B,QAAyB,CAChD,MAAO,CAACI,CAAU,CACtB,CAagB,mBAA0B,CACtC,MAAM,kBAAkB,CAC5B,CAEgB,sBAA6B,CACzC,MAAM,qBAAqB,EACvB,KAAK,2BACL,KAAK,yBAAyB,EAC9B,KAAK,yBAA2B,KAExC,CAImB,OAAOC,EAA+B,CACjDA,EAAQ,IAAI,OAAO,IACf,KAAK,MACL,KAAK,gBAAgB,aAAa,EAElC,KAAK,aAAa,cAAe,MAAM,GAI3CA,EAAQ,IAAIJ,CAA2B,IACvC,KAAK,gBACD,KAAK,eAAe,SAAW,eAAiB,EAAI,GAG5D,MAAM,OAAOI,CAAO,CACxB,CAEmB,QAAyB,CACxC,OAAOP;AAAA;AAAA,SAGX,CACJ,CA5CWQ,EAAA,CADNH,EAAM,GAPE,SAQF,+BAGAG,EAAA,CADNJ,EAAS,GAVD,SAWF,qBAGAI,EAAA,CADNJ,EAAS,CAAE,QAAS,EAAK,CAAC,GAblB,SAcF",
|
6
|
+
"names": ["html", "SpectrumElement", "SystemResolutionController", "systemResolverUpdatedSymbol", "property", "state", "iconStyles", "changes", "__decorateClass"]
|
7
7
|
}
|