@cargosense/cargo-design-system 1.0.1 → 1.0.4
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 +18 -0
- package/dist/assets/Counter.cjs.js +24 -24
- package/dist/assets/Counter.cjs.js.map +1 -1
- package/dist/assets/Counter.es.js +297 -337
- package/dist/assets/Counter.es.js.map +1 -1
- package/dist/atoms/index.cjs.js +131 -131
- package/dist/atoms/index.cjs.js.map +1 -1
- package/dist/atoms/index.es.js +659 -645
- package/dist/atoms/index.es.js.map +1 -1
- package/dist/molecules/index.cjs.js +120 -120
- package/dist/molecules/index.cjs.js.map +1 -1
- package/dist/molecules/index.es.js +1054 -1040
- package/dist/molecules/index.es.js.map +1 -1
- package/package.json +4 -3
- package/src/components/index.js +0 -7
package/dist/atoms/index.es.js
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var t = (o, e, i) => z(o, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
-
import { i as a, c as n, f as l, d as s, x as r, o as p } from "../assets/Counter.es.js";
|
|
5
|
-
import { C as H, I as J, N as K, b as M, r as P, a as Q } from "../assets/Counter.es.js";
|
|
1
|
+
import { i as r, c as o, f as n, d as i, x as t, o as l } from "../assets/Counter.es.js";
|
|
2
|
+
import { C as K, I as N, N as U, b as W, r as M, a as Y } from "../assets/Counter.es.js";
|
|
6
3
|
import "../fonts/index.es.js";
|
|
7
|
-
class
|
|
8
|
-
|
|
9
|
-
super(), this.status = "none";
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return r`
|
|
13
|
-
<span class="badge ${this.status}">
|
|
14
|
-
<slot></slot>
|
|
15
|
-
</span>
|
|
16
|
-
`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
t(h, "styles", s`
|
|
4
|
+
class d extends r {
|
|
5
|
+
static styles = i`
|
|
20
6
|
@font-face {
|
|
21
7
|
font-family: 'Geist';
|
|
22
|
-
src: url(${n
|
|
8
|
+
src: url(${o(n)}) format('woff');
|
|
23
9
|
font-weight: 100 900;
|
|
24
10
|
font-style: normal;
|
|
25
11
|
}
|
|
@@ -67,35 +53,34 @@ t(h, "styles", s`
|
|
|
67
53
|
.none::before {
|
|
68
54
|
content: none;
|
|
69
55
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
typeof window < "u" && !customElements.get("cd-badge") && customElements.define("cd-badge", h);
|
|
80
|
-
}
|
|
81
|
-
class b extends a {
|
|
56
|
+
`;
|
|
57
|
+
static properties = {
|
|
58
|
+
status: {
|
|
59
|
+
type: String,
|
|
60
|
+
reflect: !0,
|
|
61
|
+
attribute: "status",
|
|
62
|
+
defaultValue: "none"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
82
65
|
constructor() {
|
|
83
|
-
super(), this.
|
|
66
|
+
super(), this.status = "none";
|
|
84
67
|
}
|
|
85
68
|
render() {
|
|
86
|
-
return
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
69
|
+
return t`
|
|
70
|
+
<span class="badge ${this.status}">
|
|
71
|
+
<slot></slot>
|
|
72
|
+
</span>
|
|
92
73
|
`;
|
|
93
74
|
}
|
|
94
75
|
}
|
|
95
|
-
|
|
76
|
+
function F() {
|
|
77
|
+
typeof window < "u" && !customElements.get("cd-badge") && customElements.define("cd-badge", d);
|
|
78
|
+
}
|
|
79
|
+
class u extends r {
|
|
80
|
+
static styles = i`
|
|
96
81
|
@font-face {
|
|
97
82
|
font-family: 'Geist';
|
|
98
|
-
src: url(${n
|
|
83
|
+
src: url(${o(n)}) format('woff');
|
|
99
84
|
font-weight: 100 900;
|
|
100
85
|
font-style: normal;
|
|
101
86
|
}
|
|
@@ -135,34 +120,35 @@ t(b, "styles", s`
|
|
|
135
120
|
max-width: 100%;
|
|
136
121
|
max-height: 100%;
|
|
137
122
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
typeof window < "u" && !customElements.get("cd-body") && customElements.define("cd-body", b);
|
|
147
|
-
}
|
|
148
|
-
class v extends a {
|
|
123
|
+
`;
|
|
124
|
+
static properties = {
|
|
125
|
+
fitContent: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
reflect: !0,
|
|
128
|
+
attribute: "fit-content"
|
|
129
|
+
}
|
|
130
|
+
};
|
|
149
131
|
constructor() {
|
|
150
|
-
super(), this.
|
|
132
|
+
super(), this.fitContent = !1;
|
|
151
133
|
}
|
|
152
134
|
render() {
|
|
153
|
-
return
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
</
|
|
135
|
+
return t`
|
|
136
|
+
<div class="body${this.fitContent ? " fit-content" : ""}">
|
|
137
|
+
<div class="content">
|
|
138
|
+
<slot><slot>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
159
141
|
`;
|
|
160
142
|
}
|
|
161
143
|
}
|
|
162
|
-
|
|
144
|
+
function S() {
|
|
145
|
+
typeof window < "u" && !customElements.get("cd-body") && customElements.define("cd-body", u);
|
|
146
|
+
}
|
|
147
|
+
class p extends r {
|
|
148
|
+
static styles = i`
|
|
163
149
|
@font-face {
|
|
164
150
|
font-family: 'Geist';
|
|
165
|
-
src: url(${n
|
|
151
|
+
src: url(${o(n)}) format('woff');
|
|
166
152
|
font-weight: 100 900;
|
|
167
153
|
font-style: normal;
|
|
168
154
|
}
|
|
@@ -198,32 +184,34 @@ t(v, "styles", s`
|
|
|
198
184
|
text-decoration: none;
|
|
199
185
|
color: inherit;
|
|
200
186
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
typeof window < "u" && !customElements.get("cd-data-object") && customElements.define("cd-data-object", v);
|
|
209
|
-
}
|
|
210
|
-
class g extends a {
|
|
187
|
+
`;
|
|
188
|
+
static properties = {
|
|
189
|
+
link: {
|
|
190
|
+
type: String,
|
|
191
|
+
reflect: !0
|
|
192
|
+
}
|
|
193
|
+
};
|
|
211
194
|
constructor() {
|
|
212
|
-
super(), this.
|
|
195
|
+
super(), this.variant = "", this.link = void 0;
|
|
213
196
|
}
|
|
214
197
|
render() {
|
|
215
|
-
return
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
198
|
+
return t`
|
|
199
|
+
<a href="${l(this.link)}" class="default ${this.variant}" tabindex="0">
|
|
200
|
+
<slot name="start"></slot>
|
|
201
|
+
<slot></slot>
|
|
202
|
+
<slot name="end"></slot>
|
|
203
|
+
</a>
|
|
220
204
|
`;
|
|
221
205
|
}
|
|
222
206
|
}
|
|
223
|
-
|
|
207
|
+
function B() {
|
|
208
|
+
typeof window < "u" && !customElements.get("cd-data-object") && customElements.define("cd-data-object", p);
|
|
209
|
+
}
|
|
210
|
+
class f extends r {
|
|
211
|
+
static styles = i`
|
|
224
212
|
@font-face {
|
|
225
213
|
font-family: 'Geist';
|
|
226
|
-
src: url(${n
|
|
214
|
+
src: url(${o(n)}) format('woff');
|
|
227
215
|
font-weight: 100 900;
|
|
228
216
|
font-style: normal;
|
|
229
217
|
}
|
|
@@ -248,33 +236,37 @@ t(g, "styles", s`
|
|
|
248
236
|
font-weight: var(--key-value-value-font-weight);
|
|
249
237
|
}
|
|
250
238
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
typeof window < "u" && !customElements.get("cd-key-value") && customElements.define("cd-key-value", g);
|
|
263
|
-
}
|
|
264
|
-
class m extends a {
|
|
239
|
+
`;
|
|
240
|
+
static properties = {
|
|
241
|
+
key: {
|
|
242
|
+
type: String,
|
|
243
|
+
reflect: !0
|
|
244
|
+
},
|
|
245
|
+
value: {
|
|
246
|
+
type: String,
|
|
247
|
+
reflect: !0
|
|
248
|
+
}
|
|
249
|
+
};
|
|
265
250
|
constructor() {
|
|
266
|
-
super(), this.key = "";
|
|
251
|
+
super(), this.key = "", this.value = "";
|
|
267
252
|
}
|
|
268
253
|
render() {
|
|
269
|
-
return
|
|
270
|
-
<
|
|
254
|
+
return t`
|
|
255
|
+
<div class="key-value">
|
|
256
|
+
<span class="key">${this.key}</span>
|
|
257
|
+
${this.value === "" ? t`<slot class="value"></slot>` : t`<span class="value">${this.value}</span>`}
|
|
258
|
+
</div>
|
|
271
259
|
`;
|
|
272
260
|
}
|
|
273
261
|
}
|
|
274
|
-
|
|
262
|
+
function A() {
|
|
263
|
+
typeof window < "u" && !customElements.get("cd-key-value") && customElements.define("cd-key-value", f);
|
|
264
|
+
}
|
|
265
|
+
class h extends r {
|
|
266
|
+
static styles = i`
|
|
275
267
|
@font-face {
|
|
276
268
|
font-family: 'Geist';
|
|
277
|
-
src: url(${n
|
|
269
|
+
src: url(${o(n)}) format('woff');
|
|
278
270
|
font-weight: 100 900;
|
|
279
271
|
font-style: normal;
|
|
280
272
|
}
|
|
@@ -284,42 +276,30 @@ t(m, "styles", s`
|
|
|
284
276
|
font-weight: var(--key-value-label-font-weight);
|
|
285
277
|
font-size: var(--key-value-font-size, 14px);
|
|
286
278
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
typeof window < "u" && !customElements.get("cd-key") && customElements.define("cd-key", m);
|
|
295
|
-
}
|
|
296
|
-
class y extends a {
|
|
279
|
+
`;
|
|
280
|
+
static properties = {
|
|
281
|
+
key: {
|
|
282
|
+
type: String,
|
|
283
|
+
reflect: !0
|
|
284
|
+
}
|
|
285
|
+
};
|
|
297
286
|
constructor() {
|
|
298
|
-
super(), this.
|
|
287
|
+
super(), this.key = "";
|
|
299
288
|
}
|
|
300
289
|
render() {
|
|
301
|
-
return
|
|
302
|
-
<
|
|
303
|
-
<svg class="spinner" viewBox="0 0 50 50" width="40" height="40">
|
|
304
|
-
<circle
|
|
305
|
-
class="path"
|
|
306
|
-
cx="25"
|
|
307
|
-
cy="25"
|
|
308
|
-
r="20"
|
|
309
|
-
fill="none"
|
|
310
|
-
stroke="var(--spinner-stroke)"
|
|
311
|
-
stroke-width="4"
|
|
312
|
-
stroke-linecap="round"
|
|
313
|
-
/>
|
|
314
|
-
</svg>
|
|
315
|
-
</div>
|
|
290
|
+
return t`
|
|
291
|
+
<span class="key"><slot></slot></span>
|
|
316
292
|
`;
|
|
317
293
|
}
|
|
318
294
|
}
|
|
319
|
-
|
|
295
|
+
function q() {
|
|
296
|
+
typeof window < "u" && !customElements.get("cd-key") && customElements.define("cd-key", h);
|
|
297
|
+
}
|
|
298
|
+
class b extends r {
|
|
299
|
+
static styles = i`
|
|
320
300
|
@font-face {
|
|
321
301
|
font-family: 'Geist';
|
|
322
|
-
src: url(${
|
|
302
|
+
src: url(${o("fonts/Geist-Regular.woff")}) format('woff');
|
|
323
303
|
font-weight: 100 900;
|
|
324
304
|
font-style: normal;
|
|
325
305
|
}
|
|
@@ -366,47 +346,59 @@ t(y, "styles", s`
|
|
|
366
346
|
transform: rotate(360deg);
|
|
367
347
|
}
|
|
368
348
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
typeof window < "u" && !customElements.get("cd-spinner") && customElements.define("cd-spinner", y);
|
|
393
|
-
}
|
|
394
|
-
class k extends a {
|
|
349
|
+
`;
|
|
350
|
+
static properties = {
|
|
351
|
+
size: {
|
|
352
|
+
type: String,
|
|
353
|
+
reflect: !0,
|
|
354
|
+
attribute: "size",
|
|
355
|
+
converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md",
|
|
356
|
+
defaultValue: "md"
|
|
357
|
+
},
|
|
358
|
+
color: {
|
|
359
|
+
type: String,
|
|
360
|
+
reflect: !0,
|
|
361
|
+
attribute: "color",
|
|
362
|
+
converter: (e) => ["default", "classic", "secondary"].includes(e) ? e : "default",
|
|
363
|
+
defaultValue: "default"
|
|
364
|
+
},
|
|
365
|
+
ariaLabel: {
|
|
366
|
+
type: String,
|
|
367
|
+
reflect: !0,
|
|
368
|
+
attribute: "aria-label",
|
|
369
|
+
defaultValue: "Loading"
|
|
370
|
+
}
|
|
371
|
+
};
|
|
395
372
|
constructor() {
|
|
396
|
-
super();
|
|
373
|
+
super(), this.size = "md", this.color = "default";
|
|
397
374
|
}
|
|
398
375
|
render() {
|
|
399
|
-
return
|
|
400
|
-
<div class="
|
|
401
|
-
<
|
|
376
|
+
return t`
|
|
377
|
+
<div class="${this.size} ${this.color}" aria-label=${this.ariaLabel}>
|
|
378
|
+
<svg class="spinner" viewBox="0 0 50 50" width="40" height="40">
|
|
379
|
+
<circle
|
|
380
|
+
class="path"
|
|
381
|
+
cx="25"
|
|
382
|
+
cy="25"
|
|
383
|
+
r="20"
|
|
384
|
+
fill="none"
|
|
385
|
+
stroke="var(--spinner-stroke)"
|
|
386
|
+
stroke-width="4"
|
|
387
|
+
stroke-linecap="round"
|
|
388
|
+
/>
|
|
389
|
+
</svg>
|
|
402
390
|
</div>
|
|
403
391
|
`;
|
|
404
392
|
}
|
|
405
393
|
}
|
|
406
|
-
|
|
394
|
+
function _() {
|
|
395
|
+
typeof window < "u" && !customElements.get("cd-spinner") && customElements.define("cd-spinner", b);
|
|
396
|
+
}
|
|
397
|
+
class v extends r {
|
|
398
|
+
static styles = i`
|
|
407
399
|
@font-face {
|
|
408
400
|
font-family: 'Geist';
|
|
409
|
-
src: url(${n
|
|
401
|
+
src: url(${o(n)}) format('woff');
|
|
410
402
|
font-weight: 100 900;
|
|
411
403
|
font-style: normal;
|
|
412
404
|
}
|
|
@@ -417,133 +409,81 @@ t(k, "styles", s`
|
|
|
417
409
|
width: 100%;
|
|
418
410
|
height: 100%;
|
|
419
411
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
412
|
+
`;
|
|
413
|
+
static properties = {
|
|
414
|
+
direction: {
|
|
415
|
+
type: String,
|
|
416
|
+
reflect: !0,
|
|
417
|
+
attribute: "direction",
|
|
418
|
+
converter: {
|
|
419
|
+
fromAttribute(e) {
|
|
420
|
+
return e || "column";
|
|
421
|
+
},
|
|
422
|
+
toAttribute(e) {
|
|
423
|
+
return e;
|
|
424
|
+
}
|
|
431
425
|
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
426
|
+
},
|
|
427
|
+
align: {
|
|
428
|
+
type: String,
|
|
429
|
+
reflect: !0,
|
|
430
|
+
attribute: "align",
|
|
431
|
+
converter: {
|
|
432
|
+
fromAttribute(e) {
|
|
433
|
+
return e || "stretch";
|
|
434
|
+
},
|
|
435
|
+
toAttribute(e) {
|
|
436
|
+
return e;
|
|
437
|
+
}
|
|
444
438
|
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
439
|
+
},
|
|
440
|
+
gap: {
|
|
441
|
+
type: String,
|
|
442
|
+
reflect: !0,
|
|
443
|
+
attribute: "gap",
|
|
444
|
+
converter: {
|
|
445
|
+
fromAttribute(e) {
|
|
446
|
+
return e || "0px";
|
|
447
|
+
},
|
|
448
|
+
toAttribute(e) {
|
|
449
|
+
return e;
|
|
450
|
+
}
|
|
457
451
|
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
452
|
+
},
|
|
453
|
+
justify: {
|
|
454
|
+
type: String,
|
|
455
|
+
reflect: !0,
|
|
456
|
+
attribute: "justify",
|
|
457
|
+
converter: {
|
|
458
|
+
fromAttribute(e) {
|
|
459
|
+
return e || "flex-start";
|
|
460
|
+
},
|
|
461
|
+
toAttribute(e) {
|
|
462
|
+
return e;
|
|
463
|
+
}
|
|
470
464
|
}
|
|
471
465
|
}
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
function R() {
|
|
475
|
-
typeof window < "u" && !customElements.get("cd-flex-container") && customElements.define("cd-flex-container", k);
|
|
476
|
-
}
|
|
477
|
-
class c extends a {
|
|
466
|
+
};
|
|
478
467
|
constructor() {
|
|
479
|
-
super()
|
|
468
|
+
super();
|
|
480
469
|
}
|
|
481
470
|
render() {
|
|
482
|
-
return
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
<div class='label-text'>
|
|
471
|
+
return t`
|
|
472
|
+
<div class="container" style="flex-direction: ${this.direction}; align-items: ${this.align}; gap: ${this.gap}; justify-content: ${this.justify};">
|
|
486
473
|
<slot></slot>
|
|
487
|
-
${this.description ? r`<span class='description'>${this.description}</span>` : ""}
|
|
488
|
-
</div>
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
<input type="checkbox" id='${this.name | "checkbox"}' name='${this.name | "checkbox"}' aria-describedby='${this.description | this.name | "checkbox"}' value='${p(this.value)}' ?checked="${this.checked}" ?disabled="${this.disabled}" @change="${this._onChange}" tabindex="-1">
|
|
492
|
-
|
|
493
|
-
<div class='checkmark ${this.checked ? "active" : ""} ${this.error ? "error" : ""}' id='check' aria-describedby='${this.description | this.name | "checkbox"}' tabindex="${this.disabled ? "-1" : "0"}">
|
|
494
|
-
<cd-icon name='check' size='xs' color='white'></cd-icon>
|
|
495
474
|
</div>
|
|
496
|
-
</label>
|
|
497
|
-
|
|
498
|
-
|
|
499
475
|
`;
|
|
500
476
|
}
|
|
501
|
-
_onChange(e) {
|
|
502
|
-
if (!this.disabled)
|
|
503
|
-
return this.checked = e.target.checked, this._internals.setValidity({
|
|
504
|
-
valid: !0
|
|
505
|
-
}), this._internals.setFormValue(this.checked), this.dispatchEvent(new CustomEvent("change", {
|
|
506
|
-
detail: {
|
|
507
|
-
checked: this.checked,
|
|
508
|
-
value: this.value
|
|
509
|
-
},
|
|
510
|
-
bubbles: !0,
|
|
511
|
-
composed: !0
|
|
512
|
-
})), this.checked;
|
|
513
|
-
}
|
|
514
|
-
setChecked(e) {
|
|
515
|
-
if (typeof e != "boolean")
|
|
516
|
-
throw new TypeError("The checked parameter must be a boolean");
|
|
517
|
-
this.checked = e, this._internals.setValidity({
|
|
518
|
-
valid: e
|
|
519
|
-
}), this._internals.setFormValue(e), this.dispatchEvent(new CustomEvent("change", {
|
|
520
|
-
detail: {
|
|
521
|
-
checked: e,
|
|
522
|
-
value: this.value
|
|
523
|
-
},
|
|
524
|
-
bubbles: !0,
|
|
525
|
-
composed: !0
|
|
526
|
-
}));
|
|
527
|
-
}
|
|
528
|
-
firstUpdated() {
|
|
529
|
-
this.disabled ? this.shadowRoot.querySelector("cd-icon").color = "#A9B2BC" : this.shadowRoot.querySelector("#check").addEventListener("keydown", (e) => {
|
|
530
|
-
console.log("keydown event", e), (e.key === "Enter" || e.key === " ") && (this.checked = !this.checked, this._internals.setValidity({
|
|
531
|
-
valid: !this.checked
|
|
532
|
-
}), this._internals.setFormValue(!this.checked), this.dispatchEvent(new CustomEvent("change", {
|
|
533
|
-
detail: {
|
|
534
|
-
checked: !this.checked,
|
|
535
|
-
value: this.value
|
|
536
|
-
},
|
|
537
|
-
bubbles: !0,
|
|
538
|
-
composed: !0
|
|
539
|
-
})), this.requestUpdate());
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
477
|
}
|
|
543
|
-
|
|
478
|
+
function G() {
|
|
479
|
+
typeof window < "u" && !customElements.get("cd-flex-container") && customElements.define("cd-flex-container", v);
|
|
480
|
+
}
|
|
481
|
+
class g extends r {
|
|
482
|
+
static formAssociated = !0;
|
|
483
|
+
static styles = i`
|
|
544
484
|
@font-face {
|
|
545
485
|
font-family: 'Geist';
|
|
546
|
-
src: url(${n
|
|
486
|
+
src: url(${o(n)}) format('woff');
|
|
547
487
|
font-weight: 100 900;
|
|
548
488
|
font-style: normal;
|
|
549
489
|
}
|
|
@@ -692,56 +632,110 @@ t(c, "formAssociated", !0), t(c, "styles", s`
|
|
|
692
632
|
outline-offset: 2px;
|
|
693
633
|
border-radius: var(--input-checkbox-border-radius-md, 4px);
|
|
694
634
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
typeof window < "u" && !customElements.get("cd-checkbox") && customElements.define("cd-checkbox", c);
|
|
727
|
-
}
|
|
728
|
-
class x extends a {
|
|
635
|
+
`;
|
|
636
|
+
static properties = {
|
|
637
|
+
checked: {
|
|
638
|
+
type: Boolean,
|
|
639
|
+
reflect: !0
|
|
640
|
+
},
|
|
641
|
+
disabled: {
|
|
642
|
+
type: Boolean,
|
|
643
|
+
reflect: !0
|
|
644
|
+
},
|
|
645
|
+
description: {
|
|
646
|
+
type: String,
|
|
647
|
+
reflect: !0
|
|
648
|
+
},
|
|
649
|
+
name: {
|
|
650
|
+
type: String,
|
|
651
|
+
reflect: !0
|
|
652
|
+
},
|
|
653
|
+
required: {
|
|
654
|
+
type: Boolean,
|
|
655
|
+
reflect: !0
|
|
656
|
+
},
|
|
657
|
+
value: {
|
|
658
|
+
type: String,
|
|
659
|
+
reflect: !0
|
|
660
|
+
},
|
|
661
|
+
error: {
|
|
662
|
+
type: Boolean,
|
|
663
|
+
reflect: !0
|
|
664
|
+
}
|
|
665
|
+
};
|
|
729
666
|
constructor() {
|
|
730
|
-
super(), this.
|
|
667
|
+
super(), this.checked = !1, this.disabled = !1, this.description = void 0, this.name = void 0, this.required = !1, this.value = void 0, this._internals = this.attachInternals();
|
|
731
668
|
}
|
|
732
669
|
render() {
|
|
733
|
-
return
|
|
734
|
-
|
|
735
|
-
|
|
670
|
+
return t`
|
|
671
|
+
<label ?disabled="${this.disabled}" for='${this.name | "checkbox"}' class='container ${this.disabled ? "disabled" : ""} ${this.error ? "error" : ""}' >
|
|
672
|
+
|
|
673
|
+
<div class='label-text'>
|
|
736
674
|
<slot></slot>
|
|
675
|
+
${this.description ? t`<span class='description'>${this.description}</span>` : ""}
|
|
676
|
+
</div>
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
<input type="checkbox" id='${this.name | "checkbox"}' name='${this.name | "checkbox"}' aria-describedby='${this.description | this.name | "checkbox"}' value='${l(this.value)}' ?checked="${this.checked}" ?disabled="${this.disabled}" @change="${this._onChange}" tabindex="-1">
|
|
680
|
+
|
|
681
|
+
<div class='checkmark ${this.checked ? "active" : ""} ${this.error ? "error" : ""}' id='check' aria-describedby='${this.description | this.name | "checkbox"}' tabindex="${this.disabled ? "-1" : "0"}">
|
|
682
|
+
<cd-icon name='check' size='xs' color='white'></cd-icon>
|
|
737
683
|
</div>
|
|
684
|
+
</label>
|
|
685
|
+
|
|
686
|
+
|
|
738
687
|
`;
|
|
739
688
|
}
|
|
689
|
+
_onChange(e) {
|
|
690
|
+
if (!this.disabled)
|
|
691
|
+
return this.checked = e.target.checked, this._internals.setValidity({
|
|
692
|
+
valid: !0
|
|
693
|
+
}), this._internals.setFormValue(this.checked), this.dispatchEvent(new CustomEvent("change", {
|
|
694
|
+
detail: {
|
|
695
|
+
checked: this.checked,
|
|
696
|
+
value: this.value
|
|
697
|
+
},
|
|
698
|
+
bubbles: !0,
|
|
699
|
+
composed: !0
|
|
700
|
+
})), this.checked;
|
|
701
|
+
}
|
|
702
|
+
setChecked(e) {
|
|
703
|
+
if (typeof e != "boolean")
|
|
704
|
+
throw new TypeError("The checked parameter must be a boolean");
|
|
705
|
+
this.checked = e, this._internals.setValidity({
|
|
706
|
+
valid: e
|
|
707
|
+
}), this._internals.setFormValue(e), this.dispatchEvent(new CustomEvent("change", {
|
|
708
|
+
detail: {
|
|
709
|
+
checked: e,
|
|
710
|
+
value: this.value
|
|
711
|
+
},
|
|
712
|
+
bubbles: !0,
|
|
713
|
+
composed: !0
|
|
714
|
+
}));
|
|
715
|
+
}
|
|
716
|
+
firstUpdated() {
|
|
717
|
+
this.disabled ? this.shadowRoot.querySelector("cd-icon").color = "#A9B2BC" : this.shadowRoot.querySelector("#check").addEventListener("keydown", (e) => {
|
|
718
|
+
console.log("keydown event", e), (e.key === "Enter" || e.key === " ") && (this.checked = !this.checked, this._internals.setValidity({
|
|
719
|
+
valid: !this.checked
|
|
720
|
+
}), this._internals.setFormValue(!this.checked), this.dispatchEvent(new CustomEvent("change", {
|
|
721
|
+
detail: {
|
|
722
|
+
checked: !this.checked,
|
|
723
|
+
value: this.value
|
|
724
|
+
},
|
|
725
|
+
bubbles: !0,
|
|
726
|
+
composed: !0
|
|
727
|
+
})), this.requestUpdate());
|
|
728
|
+
});
|
|
729
|
+
}
|
|
740
730
|
}
|
|
741
|
-
|
|
731
|
+
function j() {
|
|
732
|
+
typeof window < "u" && !customElements.get("cd-checkbox") && customElements.define("cd-checkbox", g);
|
|
733
|
+
}
|
|
734
|
+
class m extends r {
|
|
735
|
+
static styles = i`
|
|
742
736
|
@font-face {
|
|
743
737
|
font-family: 'Geist';
|
|
744
|
-
src: url(${n
|
|
738
|
+
src: url(${o(n)}) format('woff');
|
|
745
739
|
font-weight: 100 900;
|
|
746
740
|
font-style: normal;
|
|
747
741
|
}
|
|
@@ -752,40 +746,37 @@ t(x, "styles", s`
|
|
|
752
746
|
display:block;
|
|
753
747
|
|
|
754
748
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
type:
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
typeof window < "u" && !customElements.get("cd-information") && customElements.define("cd-information", x);
|
|
767
|
-
}
|
|
768
|
-
class w extends a {
|
|
749
|
+
`;
|
|
750
|
+
static properties = {
|
|
751
|
+
text: {
|
|
752
|
+
type: String,
|
|
753
|
+
reflect: !0
|
|
754
|
+
},
|
|
755
|
+
type: {
|
|
756
|
+
type: String,
|
|
757
|
+
reflect: !0
|
|
758
|
+
}
|
|
759
|
+
};
|
|
769
760
|
constructor() {
|
|
770
|
-
super(), this.text =
|
|
761
|
+
super(), this.text = "", this.type = "info";
|
|
771
762
|
}
|
|
772
763
|
render() {
|
|
773
|
-
return
|
|
774
|
-
<
|
|
775
|
-
class="${this.disabled ? "disabled" : ""}"
|
|
776
|
-
for="${p(this.for)}"
|
|
777
|
-
>
|
|
764
|
+
return t`
|
|
765
|
+
<div class="informational ${this.type}">
|
|
778
766
|
${this.text}
|
|
779
767
|
<slot></slot>
|
|
780
|
-
|
|
781
|
-
</label>
|
|
768
|
+
</div>
|
|
782
769
|
`;
|
|
783
770
|
}
|
|
784
771
|
}
|
|
785
|
-
|
|
772
|
+
function y() {
|
|
773
|
+
typeof window < "u" && !customElements.get("cd-information") && customElements.define("cd-information", m);
|
|
774
|
+
}
|
|
775
|
+
class x extends r {
|
|
776
|
+
static styles = i`
|
|
786
777
|
@font-face {
|
|
787
778
|
font-family: 'Geist';
|
|
788
|
-
src: url(${n
|
|
779
|
+
src: url(${o(n)}) format('woff');
|
|
789
780
|
font-weight: 100 900;
|
|
790
781
|
font-style: normal;
|
|
791
782
|
}
|
|
@@ -804,45 +795,50 @@ t(w, "styles", s`
|
|
|
804
795
|
.required {
|
|
805
796
|
color: var(--input-required-color, #FF5630);
|
|
806
797
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
typeof window < "u" && !customElements.get("cd-label") && customElements.define("cd-label", w);
|
|
828
|
-
}
|
|
829
|
-
class $ extends a {
|
|
798
|
+
`;
|
|
799
|
+
static properties = {
|
|
800
|
+
text: {
|
|
801
|
+
type: String,
|
|
802
|
+
reflect: !0
|
|
803
|
+
},
|
|
804
|
+
for: {
|
|
805
|
+
type: String,
|
|
806
|
+
reflect: !0,
|
|
807
|
+
attribute: "for"
|
|
808
|
+
},
|
|
809
|
+
required: {
|
|
810
|
+
type: Boolean,
|
|
811
|
+
reflect: !0
|
|
812
|
+
},
|
|
813
|
+
disabled: {
|
|
814
|
+
type: Boolean,
|
|
815
|
+
reflect: !0
|
|
816
|
+
}
|
|
817
|
+
};
|
|
830
818
|
constructor() {
|
|
831
|
-
super(), this.text = void 0, this.
|
|
819
|
+
super(), this.text = void 0, this.for = void 0, this.required = !1, this.disabled = !1;
|
|
832
820
|
}
|
|
833
821
|
render() {
|
|
834
|
-
return
|
|
835
|
-
<
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
822
|
+
return t`
|
|
823
|
+
<label
|
|
824
|
+
class="${this.disabled ? "disabled" : ""}"
|
|
825
|
+
for="${l(this.for)}"
|
|
826
|
+
>
|
|
827
|
+
${this.text}
|
|
828
|
+
<slot></slot>
|
|
829
|
+
${this.required ? t`<span class="required">*</span>` : ""}
|
|
830
|
+
</label>
|
|
839
831
|
`;
|
|
840
832
|
}
|
|
841
833
|
}
|
|
842
|
-
|
|
834
|
+
function D() {
|
|
835
|
+
typeof window < "u" && !customElements.get("cd-label") && customElements.define("cd-label", x);
|
|
836
|
+
}
|
|
837
|
+
class k extends r {
|
|
838
|
+
static styles = i`
|
|
843
839
|
@font-face {
|
|
844
840
|
font-family: 'Geist';
|
|
845
|
-
src: url(${n
|
|
841
|
+
src: url(${o(n)}) format('woff');
|
|
846
842
|
font-weight: 100 900;
|
|
847
843
|
font-style: normal;
|
|
848
844
|
}
|
|
@@ -872,71 +868,37 @@ t($, "styles", s`
|
|
|
872
868
|
color: var(--input-success-color, green);
|
|
873
869
|
}
|
|
874
870
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
type:
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
typeof window < "u" && !customElements.get("cd-error") && customElements.define("cd-error", $);
|
|
887
|
-
}
|
|
888
|
-
class E extends a {
|
|
871
|
+
`;
|
|
872
|
+
static properties = {
|
|
873
|
+
text: {
|
|
874
|
+
type: String,
|
|
875
|
+
reflect: !0
|
|
876
|
+
},
|
|
877
|
+
type: {
|
|
878
|
+
type: String,
|
|
879
|
+
reflect: !0
|
|
880
|
+
}
|
|
881
|
+
};
|
|
889
882
|
constructor() {
|
|
890
|
-
super(), this.
|
|
883
|
+
super(), this.text = void 0, this.type = "error";
|
|
891
884
|
}
|
|
892
885
|
render() {
|
|
893
|
-
return
|
|
894
|
-
<
|
|
895
|
-
<slot name=
|
|
896
|
-
</slot
|
|
897
|
-
|
|
898
|
-
${this.removable ? r`<span class="remove-icon" @click="${this._handleRemove}"><cd-icon name='exit' size='xs' color='${this.variant === "secondary" || this.variant === "info" ? "black" : "white"}'></cd-icon></span>` : ""}
|
|
899
|
-
</span>
|
|
886
|
+
return t`
|
|
887
|
+
<div class="error-message ${this.type}">
|
|
888
|
+
<slot name='icon'></slot>
|
|
889
|
+
${this.text ? t`<span class="error-text">${this.text}</span>` : t`<slot></slot>`}
|
|
890
|
+
</div>
|
|
900
891
|
`;
|
|
901
892
|
}
|
|
902
|
-
_handleRemove() {
|
|
903
|
-
this.disabled || (this.dispatchEvent(new CustomEvent("remove", {
|
|
904
|
-
detail: {
|
|
905
|
-
label: this.label
|
|
906
|
-
},
|
|
907
|
-
bubbles: !0,
|
|
908
|
-
composed: !0
|
|
909
|
-
})), this.remove());
|
|
910
|
-
}
|
|
911
|
-
setRemovable(e) {
|
|
912
|
-
this.removable = e;
|
|
913
|
-
}
|
|
914
|
-
setDisabled(e) {
|
|
915
|
-
this.disabled = e;
|
|
916
|
-
}
|
|
917
|
-
removeTag() {
|
|
918
|
-
this.dispatchEvent(new CustomEvent("remove", {
|
|
919
|
-
detail: {
|
|
920
|
-
label: this.label
|
|
921
|
-
},
|
|
922
|
-
bubbles: !0,
|
|
923
|
-
composed: !0
|
|
924
|
-
})), this.remove();
|
|
925
|
-
}
|
|
926
|
-
_handleClick() {
|
|
927
|
-
this.disabled || this.dispatchEvent(new CustomEvent("click", {
|
|
928
|
-
detail: {
|
|
929
|
-
label: this.label
|
|
930
|
-
},
|
|
931
|
-
bubbles: !0,
|
|
932
|
-
composed: !0
|
|
933
|
-
}));
|
|
934
|
-
}
|
|
935
893
|
}
|
|
936
|
-
|
|
894
|
+
function V() {
|
|
895
|
+
typeof window < "u" && !customElements.get("cd-error") && customElements.define("cd-error", k);
|
|
896
|
+
}
|
|
897
|
+
class w extends r {
|
|
898
|
+
static styles = i`
|
|
937
899
|
@font-face {
|
|
938
900
|
font-family: 'Geist';
|
|
939
|
-
src: url(${n
|
|
901
|
+
src: url(${o(n)}) format('woff');
|
|
940
902
|
font-weight: 100 900;
|
|
941
903
|
font-style: normal;
|
|
942
904
|
}
|
|
@@ -1010,103 +972,88 @@ t(E, "styles", s`
|
|
|
1010
972
|
min-height: var(--tag-large, 32px);
|
|
1011
973
|
gap: var(--tag-gap-lg, 8px);
|
|
1012
974
|
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
typeof window < "u" && !customElements.get("cd-tag") && customElements.define("cd-tag", E);
|
|
1039
|
-
}
|
|
1040
|
-
F();
|
|
1041
|
-
class d extends a {
|
|
975
|
+
`;
|
|
976
|
+
static properties = {
|
|
977
|
+
label: {
|
|
978
|
+
type: String,
|
|
979
|
+
reflect: !0
|
|
980
|
+
},
|
|
981
|
+
variant: {
|
|
982
|
+
type: String,
|
|
983
|
+
reflect: !0,
|
|
984
|
+
converter: (e) => ["primary", "secondary", "default", "link", "info", "success", "warning", "danger"].includes(e) ? e : "default"
|
|
985
|
+
},
|
|
986
|
+
removable: {
|
|
987
|
+
type: Boolean,
|
|
988
|
+
reflect: !0
|
|
989
|
+
},
|
|
990
|
+
disabled: {
|
|
991
|
+
type: Boolean,
|
|
992
|
+
reflect: !0
|
|
993
|
+
},
|
|
994
|
+
size: {
|
|
995
|
+
type: String,
|
|
996
|
+
reflect: !0,
|
|
997
|
+
converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md"
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1042
1000
|
constructor() {
|
|
1043
|
-
super(), this.
|
|
1001
|
+
super(), this.label = "", this.variant = "primary", this.removable = !1, this.disabled = !1, this.size = "md";
|
|
1044
1002
|
}
|
|
1045
1003
|
render() {
|
|
1046
|
-
return
|
|
1047
|
-
<
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
.checked="${this.checked}"
|
|
1054
|
-
?disabled="${this.disabled}"
|
|
1055
|
-
@change="${this._handleChange}"
|
|
1056
|
-
@click="${this._select}"
|
|
1057
|
-
required="${this.required}"
|
|
1058
|
-
tabindex="0"
|
|
1059
|
-
>
|
|
1060
|
-
<div class='radio-text' @click="${this._handleLabelClick}">
|
|
1061
|
-
|
|
1062
|
-
<slot></slot>
|
|
1063
|
-
<cd-information>${this.description}</cd-information>
|
|
1064
|
-
</div>
|
|
1065
|
-
</label>
|
|
1066
|
-
|
|
1004
|
+
return t`
|
|
1005
|
+
<span class="tag ${this.variant} ${this.size} ${this.disabled ? "disabled" : ""}" @click='${this._handleClick}'>
|
|
1006
|
+
<slot name="icon">
|
|
1007
|
+
</slot>
|
|
1008
|
+
<span class="label">${this.label} <slot></slot></span>
|
|
1009
|
+
${this.removable ? t`<span class="remove-icon" @click="${this._handleRemove}"><cd-icon name='exit' size='xs' color='${this.variant === "secondary" || this.variant === "info" ? "black" : "white"}'></cd-icon></span>` : ""}
|
|
1010
|
+
</span>
|
|
1067
1011
|
`;
|
|
1068
1012
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
i.checked = !1, i.dispatchEvent(new CustomEvent("change", {
|
|
1072
|
-
detail: {
|
|
1073
|
-
checked: !1
|
|
1074
|
-
},
|
|
1075
|
-
bubbles: !0,
|
|
1076
|
-
composed: !0
|
|
1077
|
-
}));
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
_select() {
|
|
1081
|
-
document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach((i) => {
|
|
1082
|
-
i !== this && (i.checked = !1);
|
|
1083
|
-
}), this.checked = !0, this.dispatchEvent(new CustomEvent("change", {
|
|
1013
|
+
_handleRemove() {
|
|
1014
|
+
this.disabled || (this.dispatchEvent(new CustomEvent("remove", {
|
|
1084
1015
|
detail: {
|
|
1085
|
-
|
|
1016
|
+
label: this.label
|
|
1086
1017
|
},
|
|
1087
1018
|
bubbles: !0,
|
|
1088
1019
|
composed: !0
|
|
1089
|
-
}));
|
|
1020
|
+
})), this.remove());
|
|
1090
1021
|
}
|
|
1091
|
-
|
|
1092
|
-
this.
|
|
1022
|
+
setRemovable(e) {
|
|
1023
|
+
this.removable = e;
|
|
1093
1024
|
}
|
|
1094
|
-
|
|
1095
|
-
this.
|
|
1025
|
+
setDisabled(e) {
|
|
1026
|
+
this.disabled = e;
|
|
1027
|
+
}
|
|
1028
|
+
removeTag() {
|
|
1029
|
+
this.dispatchEvent(new CustomEvent("remove", {
|
|
1096
1030
|
detail: {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1031
|
+
label: this.label
|
|
1032
|
+
},
|
|
1033
|
+
bubbles: !0,
|
|
1034
|
+
composed: !0
|
|
1035
|
+
})), this.remove();
|
|
1036
|
+
}
|
|
1037
|
+
_handleClick() {
|
|
1038
|
+
this.disabled || this.dispatchEvent(new CustomEvent("click", {
|
|
1039
|
+
detail: {
|
|
1040
|
+
label: this.label
|
|
1100
1041
|
},
|
|
1101
1042
|
bubbles: !0,
|
|
1102
1043
|
composed: !0
|
|
1103
1044
|
}));
|
|
1104
1045
|
}
|
|
1105
1046
|
}
|
|
1106
|
-
|
|
1047
|
+
function R() {
|
|
1048
|
+
typeof window < "u" && !customElements.get("cd-tag") && customElements.define("cd-tag", w);
|
|
1049
|
+
}
|
|
1050
|
+
y();
|
|
1051
|
+
class $ extends r {
|
|
1052
|
+
static formAssociated = !0;
|
|
1053
|
+
static styles = i`
|
|
1107
1054
|
@font-face {
|
|
1108
1055
|
font-family: 'Geist';
|
|
1109
|
-
src: url(${n
|
|
1056
|
+
src: url(${o(n)}) format('woff');
|
|
1110
1057
|
font-weight: 100 900;
|
|
1111
1058
|
font-style: normal;
|
|
1112
1059
|
}
|
|
@@ -1128,9 +1075,9 @@ t(d, "formAssociated", !0), t(d, "styles", s`
|
|
|
1128
1075
|
input[type="radio"] {
|
|
1129
1076
|
appearance: none;
|
|
1130
1077
|
-webkit-appearance: none;
|
|
1131
|
-
width: var(--input-
|
|
1132
|
-
height: var(--input-
|
|
1133
|
-
border-radius: var(--input-border-radius, 50%);
|
|
1078
|
+
width: var(--input-radio-size, 20px);
|
|
1079
|
+
height: var(--input-radio-size, 20px);
|
|
1080
|
+
border-radius: var(--input-radio-border-radius, 50%);
|
|
1134
1081
|
margin: 0;
|
|
1135
1082
|
padding: 0;
|
|
1136
1083
|
border: 1px solid var(--input-border-color, #8E98A4);
|
|
@@ -1213,93 +1160,111 @@ t(d, "formAssociated", !0), t(d, "styles", s`
|
|
|
1213
1160
|
cursor: pointer;
|
|
1214
1161
|
|
|
1215
1162
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
customElements.get("cd-radio") || customElements.define("cd-radio", d);
|
|
1249
|
-
};
|
|
1250
|
-
class u extends a {
|
|
1163
|
+
`;
|
|
1164
|
+
static properties = {
|
|
1165
|
+
name: {
|
|
1166
|
+
type: String
|
|
1167
|
+
},
|
|
1168
|
+
value: {
|
|
1169
|
+
type: String
|
|
1170
|
+
},
|
|
1171
|
+
checked: {
|
|
1172
|
+
type: Boolean,
|
|
1173
|
+
reflect: !0
|
|
1174
|
+
},
|
|
1175
|
+
disabled: {
|
|
1176
|
+
type: Boolean,
|
|
1177
|
+
reflect: !0
|
|
1178
|
+
},
|
|
1179
|
+
description: {
|
|
1180
|
+
type: String
|
|
1181
|
+
},
|
|
1182
|
+
error: {
|
|
1183
|
+
type: Boolean,
|
|
1184
|
+
reflect: !0
|
|
1185
|
+
},
|
|
1186
|
+
size: {
|
|
1187
|
+
type: String,
|
|
1188
|
+
reflect: !0
|
|
1189
|
+
},
|
|
1190
|
+
required: {
|
|
1191
|
+
type: Boolean,
|
|
1192
|
+
reflect: !0
|
|
1193
|
+
}
|
|
1194
|
+
};
|
|
1251
1195
|
constructor() {
|
|
1252
|
-
super(), this.name = void 0, this.value = void 0, this.
|
|
1196
|
+
super(), this.name = void 0, this.value = void 0, this.checked = !1, this.disabled = !1, this.description = void 0, this.error = !1, this.size = "md", this.required = !1, this._internals = this.attachInternals();
|
|
1253
1197
|
}
|
|
1254
1198
|
render() {
|
|
1255
|
-
return
|
|
1256
|
-
|
|
1257
|
-
<
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1199
|
+
return t`
|
|
1200
|
+
<label class="container ${this.size} ${this.disabled ? "disabled" : ""} ${this.error ? "input-error" : ""}" for="${this.name}">
|
|
1201
|
+
<input
|
|
1202
|
+
type="radio"
|
|
1203
|
+
class="${this.error ? "input-error" : ""}"
|
|
1204
|
+
name=${this.name}
|
|
1205
|
+
.value="${this.value}"
|
|
1206
|
+
.checked="${this.checked}"
|
|
1207
|
+
?disabled="${this.disabled}"
|
|
1208
|
+
@change="${this._handleChange}"
|
|
1209
|
+
@click="${this._select}"
|
|
1210
|
+
required="${this.required}"
|
|
1211
|
+
tabindex="0"
|
|
1212
|
+
>
|
|
1213
|
+
<div class='radio-text' @click="${this._handleLabelClick}">
|
|
1214
|
+
|
|
1215
|
+
<slot></slot>
|
|
1216
|
+
<cd-information>${this.description}</cd-information>
|
|
1217
|
+
</div>
|
|
1218
|
+
</label>
|
|
1219
|
+
|
|
1269
1220
|
`;
|
|
1270
1221
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1222
|
+
deselectAll() {
|
|
1223
|
+
document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach((s) => {
|
|
1224
|
+
s.checked = !1, s.dispatchEvent(new CustomEvent("change", {
|
|
1225
|
+
detail: {
|
|
1226
|
+
checked: !1
|
|
1227
|
+
},
|
|
1228
|
+
bubbles: !0,
|
|
1229
|
+
composed: !0
|
|
1230
|
+
}));
|
|
1231
|
+
});
|
|
1274
1232
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1233
|
+
_select() {
|
|
1234
|
+
document.querySelectorAll(`cd-radio[name="${this.name}"]`).forEach((s) => {
|
|
1235
|
+
s !== this && (s.checked = !1);
|
|
1236
|
+
}), this.checked = !0, this.dispatchEvent(new CustomEvent("change", {
|
|
1278
1237
|
detail: {
|
|
1279
|
-
|
|
1280
|
-
}
|
|
1238
|
+
checked: !0
|
|
1239
|
+
},
|
|
1240
|
+
bubbles: !0,
|
|
1241
|
+
composed: !0
|
|
1281
1242
|
}));
|
|
1282
1243
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
e.value = "", this.value = "", this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1286
|
-
detail: {
|
|
1287
|
-
value: this.value
|
|
1288
|
-
}
|
|
1289
|
-
}));
|
|
1244
|
+
_handleLabelClick() {
|
|
1245
|
+
this.disabled || this._select();
|
|
1290
1246
|
}
|
|
1291
|
-
|
|
1292
|
-
this.
|
|
1247
|
+
_handleChange(e) {
|
|
1248
|
+
this.checked = e.target.checked, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1293
1249
|
detail: {
|
|
1294
|
-
|
|
1295
|
-
|
|
1250
|
+
name: this.name,
|
|
1251
|
+
value: this.value,
|
|
1252
|
+
checked: this.checked
|
|
1253
|
+
},
|
|
1254
|
+
bubbles: !0,
|
|
1255
|
+
composed: !0
|
|
1296
1256
|
}));
|
|
1297
1257
|
}
|
|
1298
1258
|
}
|
|
1299
|
-
|
|
1259
|
+
const I = () => {
|
|
1260
|
+
customElements.get("cd-radio") || customElements.define("cd-radio", $);
|
|
1261
|
+
};
|
|
1262
|
+
class E extends r {
|
|
1263
|
+
static formAssociated = !0;
|
|
1264
|
+
static styles = i`
|
|
1300
1265
|
@font-face {
|
|
1301
1266
|
font-family: 'Geist';
|
|
1302
|
-
src: url(${n
|
|
1267
|
+
src: url(${o(n)}) format('woff');
|
|
1303
1268
|
font-weight: 100 900;
|
|
1304
1269
|
font-style: normal;
|
|
1305
1270
|
}
|
|
@@ -1390,81 +1355,130 @@ t(u, "formAssociated", !0), t(u, "styles", s`
|
|
|
1390
1355
|
height: 36px;
|
|
1391
1356
|
padding: 0 var(--input-horizontal-inline-padding-sm, 12px);
|
|
1392
1357
|
}
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1358
|
+
`;
|
|
1359
|
+
static properties = {
|
|
1360
|
+
name: {
|
|
1361
|
+
type: String
|
|
1362
|
+
},
|
|
1363
|
+
value: {
|
|
1364
|
+
type: String
|
|
1365
|
+
},
|
|
1366
|
+
disabled: {
|
|
1367
|
+
type: Boolean,
|
|
1368
|
+
reflect: !0
|
|
1369
|
+
},
|
|
1370
|
+
required: {
|
|
1371
|
+
type: Boolean,
|
|
1372
|
+
reflect: !0
|
|
1373
|
+
},
|
|
1374
|
+
error: {
|
|
1375
|
+
type: Boolean,
|
|
1376
|
+
reflect: !0
|
|
1377
|
+
},
|
|
1378
|
+
placeholder: {
|
|
1379
|
+
type: String
|
|
1380
|
+
},
|
|
1381
|
+
fullWidth: {
|
|
1382
|
+
type: Boolean,
|
|
1383
|
+
attribute: "full-width",
|
|
1384
|
+
reflect: !0
|
|
1385
|
+
},
|
|
1386
|
+
size: {
|
|
1387
|
+
type: String,
|
|
1388
|
+
reflect: !0,
|
|
1389
|
+
attribute: "size",
|
|
1390
|
+
converter: (e) => ["sm", "md", "lg"].includes(e) ? e : "md"
|
|
1391
|
+
},
|
|
1392
|
+
_internals: {
|
|
1393
|
+
type: Object,
|
|
1394
|
+
attribute: !1
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
constructor() {
|
|
1398
|
+
super(), this.name = void 0, this.value = void 0, this.disabled = !1, this.required = !1, this.error = !1, this.placeholder = void 0, this.fullWidth = !1, this._internals = this.attachInternals();
|
|
1429
1399
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1400
|
+
render() {
|
|
1401
|
+
return t`
|
|
1402
|
+
<div class='container ${this.fullWidth ? "full-width" : ""}'>
|
|
1403
|
+
<select
|
|
1404
|
+
name="${l(this.name)}"
|
|
1405
|
+
?disabled="${this.disabled}"
|
|
1406
|
+
?required="${this.required}"
|
|
1407
|
+
class="${this.error ? "input-error" : ""} ${this.size} ${this.fullWidth ? "full-width" : ""}"
|
|
1408
|
+
@change="${this.handleChange}"
|
|
1409
|
+
>
|
|
1410
|
+
${this.placeholder ? t`<option value="" disabled selected>${this.placeholder}</option>` : ""}
|
|
1411
|
+
<slot></slot>
|
|
1412
|
+
</select>
|
|
1413
|
+
<cd-icon name="caret-down" class="select-icon" size='xxs'></cd-icon>
|
|
1414
|
+
</div>
|
|
1415
|
+
`;
|
|
1416
|
+
}
|
|
1417
|
+
firstUpdated() {
|
|
1418
|
+
const e = this.querySelectorAll("option"), s = this.shadowRoot.querySelector("select");
|
|
1419
|
+
e.forEach((c) => s.appendChild(c.cloneNode(!0))), e.forEach((c) => c.remove()), this.disabled && (this.shadowRoot.querySelector("cd-icon").color = "var(--input-text-color-disabled)"), this.error && (this.shadowRoot.querySelector("cd-icon").color = "var(--input-error-border-color)");
|
|
1420
|
+
}
|
|
1421
|
+
selectOption(e) {
|
|
1422
|
+
const s = this.shadowRoot.querySelector("select");
|
|
1423
|
+
s.value = e, this.value = e, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1424
|
+
detail: {
|
|
1425
|
+
value: this.value
|
|
1426
|
+
}
|
|
1427
|
+
}));
|
|
1428
|
+
}
|
|
1429
|
+
reset() {
|
|
1430
|
+
const e = this.shadowRoot.querySelector("select");
|
|
1431
|
+
e.value = "", this.value = "", this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1432
|
+
detail: {
|
|
1433
|
+
value: this.value
|
|
1434
|
+
}
|
|
1435
|
+
}));
|
|
1436
|
+
}
|
|
1437
|
+
handleChange(e) {
|
|
1438
|
+
this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1439
|
+
detail: {
|
|
1440
|
+
value: this.value
|
|
1441
|
+
}
|
|
1442
|
+
}));
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
function L() {
|
|
1446
|
+
typeof window < "u" && !customElements.get("cd-select") && customElements.define("cd-select", E);
|
|
1433
1447
|
}
|
|
1434
1448
|
export {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1449
|
+
d as Badge,
|
|
1450
|
+
u as Body,
|
|
1451
|
+
g as Checkbox,
|
|
1452
|
+
K as Counter,
|
|
1453
|
+
p as DataObject,
|
|
1454
|
+
k as ErrorMessage,
|
|
1455
|
+
v as FlexContainer,
|
|
1456
|
+
N as Icon,
|
|
1457
|
+
m as Informational,
|
|
1458
|
+
h as Key,
|
|
1459
|
+
f as KeyValue,
|
|
1460
|
+
x as Label,
|
|
1461
|
+
U as NavImage,
|
|
1462
|
+
$ as Radio,
|
|
1463
|
+
E as Select,
|
|
1464
|
+
b as Spinner,
|
|
1465
|
+
w as Tag,
|
|
1466
|
+
F as registerBadge,
|
|
1467
|
+
S as registerBody,
|
|
1468
|
+
j as registerCheckbox,
|
|
1469
|
+
W as registerCounter,
|
|
1470
|
+
B as registerDataObject,
|
|
1471
|
+
V as registerErrorMessage,
|
|
1472
|
+
G as registerFlexContainer,
|
|
1473
|
+
M as registerIcon,
|
|
1474
|
+
y as registerInformational,
|
|
1475
|
+
q as registerKey,
|
|
1476
|
+
A as registerKeyValue,
|
|
1477
|
+
D as registerLabel,
|
|
1478
|
+
Y as registerNavImage,
|
|
1479
|
+
I as registerRadio,
|
|
1480
|
+
L as registerSelect,
|
|
1481
|
+
_ as registerSpinner,
|
|
1482
|
+
R as registerTag
|
|
1469
1483
|
};
|
|
1470
1484
|
//# sourceMappingURL=index.es.js.map
|