@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
|
@@ -1,46 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
var _ = (i, t, e) => t in i ? C(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
-
var r = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { r as c, i as a, c as n, f as s, d as l, o as h, x as o, a as q, b as B } from "../assets/Counter.es.js";
|
|
1
|
+
import { r as s, i as r, c as o, f as i, d as a, o as c, x as e, a as p, b as h } from "../assets/Counter.es.js";
|
|
5
2
|
import "../fonts/index.es.js";
|
|
6
|
-
|
|
7
|
-
class
|
|
8
|
-
|
|
9
|
-
const t = document.getElementById(this.form);
|
|
10
|
-
this.shadowRoot.querySelector("button").addEventListener("click", () => {
|
|
11
|
-
t instanceof HTMLFormElement && (console.log("Form found, submitting..."), t.requestSubmit());
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
constructor() {
|
|
15
|
-
super(), this.link = void 0, this.target = void 0, this.disabled = !1, this.size = "md", this.expand = "", this._variant = "primary", this.name = void 0, this.button = "button", this.form = void 0, this.square = "";
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return o`
|
|
19
|
-
<a href='${h(this.link)}' target="${h(this.target)}" tabindex="-1" class="${this.expand}">
|
|
20
|
-
<button form="${this.form}" type="${this.button}" class="button ${this.square} ${this.variant} ${this.size} ${this.expand} ${this.disabled ? "disabled" : ""}" .name="${this.name}" tabindex="${this.disabled ? "-1" : 0}" @click='${this.handleClick}'>
|
|
21
|
-
<slot name='start'></slot> <slot></slot> <slot name='end'></slot>
|
|
22
|
-
</button>
|
|
23
|
-
</a> `;
|
|
24
|
-
}
|
|
25
|
-
handleClick(t) {
|
|
26
|
-
if (this.disabled) {
|
|
27
|
-
t.preventDefault(), t.stopPropagation();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
this.dispatchEvent(new CustomEvent("button-click", {
|
|
31
|
-
detail: {
|
|
32
|
-
value: this.value,
|
|
33
|
-
name: this.name
|
|
34
|
-
},
|
|
35
|
-
bubbles: !0,
|
|
36
|
-
composed: !0
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
r(b, "styles", l`
|
|
3
|
+
s();
|
|
4
|
+
class v extends r {
|
|
5
|
+
static styles = a`
|
|
41
6
|
@font-face {
|
|
42
7
|
font-family: 'Geist';
|
|
43
|
-
src: url(${
|
|
8
|
+
src: url(${o(i)}) format('woff');
|
|
44
9
|
font-weight: 100 900;
|
|
45
10
|
font-style: normal;
|
|
46
11
|
}
|
|
@@ -153,90 +118,106 @@ r(b, "styles", l`
|
|
|
153
118
|
outline: none;
|
|
154
119
|
}
|
|
155
120
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
type:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
121
|
+
`;
|
|
122
|
+
static properties = {
|
|
123
|
+
variant: {
|
|
124
|
+
type: String,
|
|
125
|
+
reflect: !0,
|
|
126
|
+
converter: (t) => ["classic", "secondary", "primary"].includes(t) ? t : "classic"
|
|
127
|
+
},
|
|
128
|
+
size: {
|
|
129
|
+
type: String,
|
|
130
|
+
reflect: !0,
|
|
131
|
+
attribute: "size",
|
|
132
|
+
converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
|
|
133
|
+
},
|
|
134
|
+
disabled: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
reflect: !0,
|
|
137
|
+
attribute: "disabled"
|
|
138
|
+
},
|
|
139
|
+
link: {
|
|
140
|
+
type: String,
|
|
141
|
+
reflect: !0,
|
|
142
|
+
attribute: "link"
|
|
143
|
+
},
|
|
144
|
+
target: {
|
|
145
|
+
type: String,
|
|
146
|
+
reflect: !0,
|
|
147
|
+
attribute: "target",
|
|
148
|
+
converter: (t) => ["_blank", "_self", "_parent", "_top"].includes(t) ? t : "_self"
|
|
149
|
+
},
|
|
150
|
+
expand: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
reflect: !0,
|
|
153
|
+
attribute: "full-width",
|
|
154
|
+
converter: (t) => t == "" ? "expand" : ""
|
|
155
|
+
},
|
|
156
|
+
value: {
|
|
157
|
+
type: String,
|
|
158
|
+
reflect: !0,
|
|
159
|
+
attribute: "value",
|
|
160
|
+
defaultValue: ""
|
|
161
|
+
},
|
|
162
|
+
type: {
|
|
163
|
+
type: String,
|
|
164
|
+
reflect: !0,
|
|
165
|
+
attribute: "type",
|
|
166
|
+
converter: (t) => ["button", "submit", "reset"].includes(t) ? t : "button"
|
|
167
|
+
},
|
|
168
|
+
square: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
reflect: !0,
|
|
171
|
+
attribute: "square",
|
|
172
|
+
converter: (t) => t === "" ? "square" : ""
|
|
173
|
+
},
|
|
174
|
+
form: {
|
|
175
|
+
type: String,
|
|
176
|
+
reflect: !0,
|
|
177
|
+
attribute: "form"
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
firstUpdated() {
|
|
181
|
+
const t = document.getElementById(this.form);
|
|
182
|
+
this.shadowRoot.querySelector("button").addEventListener("click", () => {
|
|
183
|
+
t instanceof HTMLFormElement && (console.log("Form found, submitting..."), t.requestSubmit());
|
|
184
|
+
});
|
|
212
185
|
}
|
|
213
|
-
});
|
|
214
|
-
function A() {
|
|
215
|
-
typeof window < "u" && !customElements.get("cd-button") && customElements.define("cd-button", b);
|
|
216
|
-
}
|
|
217
|
-
c();
|
|
218
|
-
class f extends a {
|
|
219
186
|
constructor() {
|
|
220
|
-
super(), this.
|
|
187
|
+
super(), this.link = void 0, this.target = void 0, this.disabled = !1, this.size = "md", this.expand = "", this._variant = "primary", this.name = void 0, this.button = "button", this.form = void 0, this.square = "";
|
|
221
188
|
}
|
|
222
189
|
render() {
|
|
223
|
-
return
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
190
|
+
return e`
|
|
191
|
+
<a href='${c(this.link)}' target="${c(this.target)}" tabindex="-1" class="${this.expand}">
|
|
192
|
+
<button form="${this.form}" type="${this.button}" class="button ${this.square} ${this.variant} ${this.size} ${this.expand} ${this.disabled ? "disabled" : ""}" .name="${this.name}" tabindex="${this.disabled ? "-1" : 0}" @click='${this.handleClick}'>
|
|
193
|
+
<slot name='start'></slot> <slot></slot> <slot name='end'></slot>
|
|
194
|
+
</button>
|
|
195
|
+
</a> `;
|
|
196
|
+
}
|
|
197
|
+
handleClick(t) {
|
|
198
|
+
if (this.disabled) {
|
|
199
|
+
t.preventDefault(), t.stopPropagation();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
this.dispatchEvent(new CustomEvent("button-click", {
|
|
203
|
+
detail: {
|
|
204
|
+
value: this.value,
|
|
205
|
+
name: this.name
|
|
206
|
+
},
|
|
207
|
+
bubbles: !0,
|
|
208
|
+
composed: !0
|
|
209
|
+
}));
|
|
234
210
|
}
|
|
235
211
|
}
|
|
236
|
-
|
|
212
|
+
function d() {
|
|
213
|
+
typeof window < "u" && !customElements.get("cd-button") && customElements.define("cd-button", v);
|
|
214
|
+
}
|
|
215
|
+
s();
|
|
216
|
+
class b extends r {
|
|
217
|
+
static styles = a`
|
|
237
218
|
@font-face {
|
|
238
219
|
font-family: 'Geist';
|
|
239
|
-
src: url(${
|
|
220
|
+
src: url(${o(i)}) format('woff');
|
|
240
221
|
font-weight: 100 900;
|
|
241
222
|
font-style: normal;
|
|
242
223
|
}
|
|
@@ -273,87 +254,46 @@ r(f, "styles", l`
|
|
|
273
254
|
padding: 0 16px;
|
|
274
255
|
|
|
275
256
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
!customElements.get("cd-header") && typeof window < "u" && customElements.define("cd-header", f);
|
|
290
|
-
}
|
|
291
|
-
c();
|
|
292
|
-
class v extends a {
|
|
293
|
-
handleKeyPress(t) {
|
|
294
|
-
return this.dispatchEvent(new CustomEvent("keypress", {
|
|
295
|
-
detail: {
|
|
296
|
-
value: t.target.value,
|
|
297
|
-
key: t.keyCode
|
|
298
|
-
}
|
|
299
|
-
})), t.key === "Enter" && this.dispatchEvent(new CustomEvent("onenter", {
|
|
300
|
-
detail: {
|
|
301
|
-
value: t.target.value
|
|
302
|
-
}
|
|
303
|
-
})), this.dispatchEvent(new CustomEvent("onkeyup", {
|
|
304
|
-
detail: {
|
|
305
|
-
value: t.target.value,
|
|
306
|
-
key: t.keyCode
|
|
307
|
-
}
|
|
308
|
-
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
|
|
309
|
-
}
|
|
310
|
-
handleInput(t) {
|
|
311
|
-
return this.dispatchEvent(new CustomEvent("input", {
|
|
312
|
-
detail: {
|
|
313
|
-
value: t.target.value
|
|
314
|
-
}
|
|
315
|
-
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
|
|
316
|
-
}
|
|
317
|
-
handleChange(t) {
|
|
318
|
-
return this.dispatchEvent(new CustomEvent("onchange", {
|
|
319
|
-
detail: {
|
|
320
|
-
value: t.target.value
|
|
321
|
-
}
|
|
322
|
-
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
|
|
323
|
-
}
|
|
324
|
-
handleFocus(t) {
|
|
325
|
-
return this.dispatchEvent(new CustomEvent("onblur", {
|
|
326
|
-
detail: {
|
|
327
|
-
value: t.target.value
|
|
328
|
-
}
|
|
329
|
-
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target;
|
|
330
|
-
}
|
|
257
|
+
`;
|
|
258
|
+
static properties = {
|
|
259
|
+
icon: {
|
|
260
|
+
type: String,
|
|
261
|
+
reflect: !0,
|
|
262
|
+
attribute: "icon"
|
|
263
|
+
},
|
|
264
|
+
title: {
|
|
265
|
+
type: String,
|
|
266
|
+
reflect: !0,
|
|
267
|
+
attribute: "title"
|
|
268
|
+
}
|
|
269
|
+
};
|
|
331
270
|
constructor() {
|
|
332
|
-
super(), this.
|
|
271
|
+
super(), this.icon = "", this.title = "";
|
|
333
272
|
}
|
|
334
273
|
render() {
|
|
335
|
-
return
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
if (!this.shadowRoot.querySelector("input")) {
|
|
347
|
-
console.warn("Input element is not found in the shadow DOM.");
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
this.shadowRoot.querySelector("input").focus();
|
|
274
|
+
return e`
|
|
275
|
+
<header class="header">
|
|
276
|
+
<div class='left'>
|
|
277
|
+
<cd-icon name="${this.icon}" size="md"></cd-icon>
|
|
278
|
+
<span class="title">${this.title}</span>
|
|
279
|
+
</div>
|
|
280
|
+
<div class='right'>
|
|
281
|
+
<slot></slot>
|
|
282
|
+
</div>
|
|
283
|
+
</header>
|
|
284
|
+
`;
|
|
351
285
|
}
|
|
352
286
|
}
|
|
353
|
-
|
|
287
|
+
function T() {
|
|
288
|
+
!customElements.get("cd-header") && typeof window < "u" && customElements.define("cd-header", b);
|
|
289
|
+
}
|
|
290
|
+
s();
|
|
291
|
+
class f extends r {
|
|
292
|
+
static formAssociated = !0;
|
|
293
|
+
static styles = a`
|
|
354
294
|
@font-face {
|
|
355
295
|
font-family: 'Geist';
|
|
356
|
-
src: url(${
|
|
296
|
+
src: url(${o(i)}) format('woff');
|
|
357
297
|
font-weight: 100 900;
|
|
358
298
|
font-style: normal;
|
|
359
299
|
}
|
|
@@ -472,97 +412,139 @@ r(v, "formAssociated", !0), r(v, "styles", l`
|
|
|
472
412
|
|
|
473
413
|
|
|
474
414
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
type:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
415
|
+
`;
|
|
416
|
+
static properties = {
|
|
417
|
+
name: {
|
|
418
|
+
type: String,
|
|
419
|
+
reflect: !0
|
|
420
|
+
},
|
|
421
|
+
type: {
|
|
422
|
+
type: String,
|
|
423
|
+
reflect: !0,
|
|
424
|
+
converter: (t) => ["text", "date", "time", "number", "tel", "url", "phone", "email", "password"].includes(t) ? t : "text"
|
|
425
|
+
},
|
|
426
|
+
disabled: {
|
|
427
|
+
type: Boolean,
|
|
428
|
+
reflect: !0
|
|
429
|
+
},
|
|
430
|
+
placeholder: {
|
|
431
|
+
type: String,
|
|
432
|
+
reflect: !0
|
|
433
|
+
},
|
|
434
|
+
readOnly: {
|
|
435
|
+
type: Boolean,
|
|
436
|
+
reflect: !0,
|
|
437
|
+
attribute: "read-only"
|
|
438
|
+
},
|
|
439
|
+
required: {
|
|
440
|
+
type: Boolean,
|
|
441
|
+
reflect: !0
|
|
442
|
+
},
|
|
443
|
+
pattern: {
|
|
444
|
+
type: String
|
|
445
|
+
},
|
|
446
|
+
error: {
|
|
447
|
+
type: Boolean,
|
|
448
|
+
reflect: !0
|
|
449
|
+
},
|
|
450
|
+
value: {
|
|
451
|
+
type: String,
|
|
452
|
+
reflect: !0
|
|
453
|
+
},
|
|
454
|
+
fullWidth: {
|
|
455
|
+
type: Boolean,
|
|
456
|
+
reflect: !0,
|
|
457
|
+
attribute: "full-width"
|
|
458
|
+
},
|
|
459
|
+
variant: {
|
|
460
|
+
type: String,
|
|
461
|
+
reflect: !0
|
|
462
|
+
},
|
|
463
|
+
size: {
|
|
464
|
+
type: String,
|
|
465
|
+
reflect: !0,
|
|
466
|
+
converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
|
|
467
|
+
},
|
|
468
|
+
iconLeft: {
|
|
469
|
+
type: String,
|
|
470
|
+
reflect: !0,
|
|
471
|
+
attribute: "icon-left"
|
|
472
|
+
},
|
|
473
|
+
iconRight: {
|
|
474
|
+
type: String,
|
|
475
|
+
reflect: !0,
|
|
476
|
+
attribute: "icon-right"
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
handleKeyPress(t) {
|
|
480
|
+
return this.dispatchEvent(new CustomEvent("keypress", {
|
|
481
|
+
detail: {
|
|
482
|
+
value: t.target.value,
|
|
483
|
+
key: t.keyCode
|
|
484
|
+
}
|
|
485
|
+
})), t.key === "Enter" && this.dispatchEvent(new CustomEvent("onenter", {
|
|
486
|
+
detail: {
|
|
487
|
+
value: t.target.value
|
|
488
|
+
}
|
|
489
|
+
})), this.dispatchEvent(new CustomEvent("onkeyup", {
|
|
490
|
+
detail: {
|
|
491
|
+
value: t.target.value,
|
|
492
|
+
key: t.keyCode
|
|
493
|
+
}
|
|
494
|
+
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
|
|
495
|
+
}
|
|
496
|
+
handleInput(t) {
|
|
497
|
+
return this.dispatchEvent(new CustomEvent("input", {
|
|
498
|
+
detail: {
|
|
499
|
+
value: t.target.value
|
|
500
|
+
}
|
|
501
|
+
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
|
|
502
|
+
}
|
|
503
|
+
handleChange(t) {
|
|
504
|
+
return this.dispatchEvent(new CustomEvent("onchange", {
|
|
505
|
+
detail: {
|
|
506
|
+
value: t.target.value
|
|
507
|
+
}
|
|
508
|
+
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target.value;
|
|
509
|
+
}
|
|
510
|
+
handleFocus(t) {
|
|
511
|
+
return this.dispatchEvent(new CustomEvent("onblur", {
|
|
512
|
+
detail: {
|
|
513
|
+
value: t.target.value
|
|
514
|
+
}
|
|
515
|
+
})), this._internals.setFormValue(t.target.value), this.value = t.target.value, t.target;
|
|
536
516
|
}
|
|
537
|
-
});
|
|
538
|
-
function T() {
|
|
539
|
-
typeof window < "u" && !customElements.get("cd-input") && customElements.define("cd-input", v);
|
|
540
|
-
}
|
|
541
|
-
q();
|
|
542
|
-
class g extends a {
|
|
543
517
|
constructor() {
|
|
544
|
-
super(), this.
|
|
518
|
+
super(), this.value = "", this.placeholder = "", this.pattern = "", this.variant = "solid", this.size = "md", this._internals = this.attachInternals();
|
|
545
519
|
}
|
|
546
520
|
render() {
|
|
547
|
-
return
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
<div class="items">
|
|
554
|
-
<slot name="start"></slot>
|
|
555
|
-
<slot></slot>
|
|
556
|
-
<slot name="end"></slot>
|
|
557
|
-
</div>
|
|
558
|
-
</nav>
|
|
559
|
-
`;
|
|
521
|
+
return e`
|
|
522
|
+
${this.iconLeft ? e`<span class="icon-left-container"><cd-icon name="${this.iconLeft}" size="sm" class="icon-left"></cd-icon></span>` : ""}
|
|
523
|
+
<input id='${this.name}' class="${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? " icon-spacing-right" : ""} ${this.disabled ? " disabled" : ""} ${this.error ? " input-error" : ""} ${this.fullWidth ? " full-width" : ""} ${this.variant === "dashed" ? " dashed" : this.variant == "dotted" ? " dotted" : ""} ${this.size}" type="${this.type}" placeholder="${this.placeholder}" ?required=${this.required} .value="${this.value}" ?readonly=${this.readOnly} ?disabled=${this.disabled} .pattern="${this.pattern}" @input="${this.handleInput}" @change="${this.handleChange}" @blur="${this.handleFocus}" @keypress=${this.handleKeyPress}/>
|
|
524
|
+
${this.iconRight ? e`<span class="icon-right-container"><cd-icon name="${this.iconRight}" size="sm" class="icon-right"></cd-icon></span>` : ""}
|
|
525
|
+
`;
|
|
560
526
|
}
|
|
527
|
+
focus() {
|
|
528
|
+
if (!this.shadowRoot) {
|
|
529
|
+
console.warn("Input element is not yet connected to the DOM.");
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
if (!this.shadowRoot.querySelector("input")) {
|
|
533
|
+
console.warn("Input element is not found in the shadow DOM.");
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
this.shadowRoot.querySelector("input").focus();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function q() {
|
|
540
|
+
typeof window < "u" && !customElements.get("cd-input") && customElements.define("cd-input", f);
|
|
561
541
|
}
|
|
562
|
-
|
|
542
|
+
p();
|
|
543
|
+
class g extends r {
|
|
544
|
+
static styles = a`
|
|
563
545
|
@font-face {
|
|
564
546
|
font-family: 'Geist';
|
|
565
|
-
src: url(${
|
|
547
|
+
src: url(${o(i)}) format('woff');
|
|
566
548
|
font-weight: 100 900;
|
|
567
549
|
font-style: normal;
|
|
568
550
|
}
|
|
@@ -616,70 +598,56 @@ r(g, "styles", l`
|
|
|
616
598
|
flex-direction: column;
|
|
617
599
|
gap: 8px;
|
|
618
600
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
typeof window < "u" && !customElements.get("cd-nav-bar") && customElements.define("cd-nav-bar", g);
|
|
641
|
-
}
|
|
642
|
-
B();
|
|
643
|
-
c();
|
|
644
|
-
class m extends a {
|
|
601
|
+
`;
|
|
602
|
+
static properties = {
|
|
603
|
+
image: {
|
|
604
|
+
type: String,
|
|
605
|
+
reflect: !0,
|
|
606
|
+
attribute: "image",
|
|
607
|
+
defaultValue: ""
|
|
608
|
+
},
|
|
609
|
+
name: {
|
|
610
|
+
type: String,
|
|
611
|
+
reflect: !0,
|
|
612
|
+
attribute: "name",
|
|
613
|
+
defaultValue: ""
|
|
614
|
+
},
|
|
615
|
+
small: {
|
|
616
|
+
type: Boolean,
|
|
617
|
+
reflect: !0,
|
|
618
|
+
attribute: "sidebar",
|
|
619
|
+
defaultValue: !1
|
|
620
|
+
}
|
|
621
|
+
};
|
|
645
622
|
constructor() {
|
|
646
|
-
super(), this.
|
|
623
|
+
super(), this.image = "", this.name = "";
|
|
647
624
|
}
|
|
648
625
|
render() {
|
|
649
|
-
return
|
|
650
|
-
<
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
626
|
+
return e`
|
|
627
|
+
<nav class="navbar ${this.small ? "small" : ""}">
|
|
628
|
+
${this.image != "" && this.name != "" ? e` <div class="image">
|
|
629
|
+
<cd-nav-image src="${this.image}" alt="Logo" name="${this.name}"></cd-nav-image>
|
|
630
|
+
</div>` : ""}
|
|
631
|
+
|
|
632
|
+
<div class="items">
|
|
633
|
+
<slot name="start"></slot>
|
|
634
|
+
<slot></slot>
|
|
635
|
+
<slot name="end"></slot>
|
|
636
|
+
</div>
|
|
637
|
+
</nav>
|
|
660
638
|
`;
|
|
661
639
|
}
|
|
662
|
-
setSelectState(t) {
|
|
663
|
-
if (typeof t != "boolean")
|
|
664
|
-
throw new Error("Select must be a boolean value");
|
|
665
|
-
this.select !== t && (this.select = t, this.requestUpdate());
|
|
666
|
-
}
|
|
667
|
-
setActiveState(t) {
|
|
668
|
-
if (typeof t != "boolean")
|
|
669
|
-
throw new Error("Active must be a boolean value");
|
|
670
|
-
this.active !== t && (this.active = t, this.requestUpdate());
|
|
671
|
-
}
|
|
672
|
-
toggleSelect() {
|
|
673
|
-
this.select = !this.select, this.requestUpdate();
|
|
674
|
-
}
|
|
675
|
-
toggleActive() {
|
|
676
|
-
this.active = !this.active, this.requestUpdate();
|
|
677
|
-
}
|
|
678
640
|
}
|
|
679
|
-
|
|
641
|
+
function V() {
|
|
642
|
+
typeof window < "u" && !customElements.get("cd-nav-bar") && customElements.define("cd-nav-bar", g);
|
|
643
|
+
}
|
|
644
|
+
h();
|
|
645
|
+
s();
|
|
646
|
+
class m extends r {
|
|
647
|
+
static styles = a`
|
|
680
648
|
@font-face {
|
|
681
649
|
font-family: 'Geist';
|
|
682
|
-
src: url('${
|
|
650
|
+
src: url('${o(i)}') format('woff');
|
|
683
651
|
font-weight: 100 900;
|
|
684
652
|
font-style: normal;
|
|
685
653
|
}
|
|
@@ -770,73 +738,99 @@ r(m, "styles", l`
|
|
|
770
738
|
--icon-stroke: var(--base-color-teal-900);
|
|
771
739
|
--icon-background-primary: var(--base-color-teal-300);
|
|
772
740
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
typeof window < "u" && !customElements.get("cd-nav-item") && customElements.define("cd-nav-item", m);
|
|
825
|
-
}
|
|
826
|
-
class y extends a {
|
|
741
|
+
`;
|
|
742
|
+
static properties = {
|
|
743
|
+
name: {
|
|
744
|
+
type: String,
|
|
745
|
+
reflect: !0,
|
|
746
|
+
attribute: "name"
|
|
747
|
+
},
|
|
748
|
+
variant: {
|
|
749
|
+
type: String,
|
|
750
|
+
reflect: !0,
|
|
751
|
+
attribute: "variant",
|
|
752
|
+
converter: (t) => ["dropdown", "link", "number"].includes(t) ? t : "none"
|
|
753
|
+
},
|
|
754
|
+
amount: {
|
|
755
|
+
type: Number,
|
|
756
|
+
reflect: !0,
|
|
757
|
+
attribute: "amount",
|
|
758
|
+
converter: (t) => isNaN(t) ? 0 : t
|
|
759
|
+
},
|
|
760
|
+
maxCount: {
|
|
761
|
+
type: Number,
|
|
762
|
+
reflect: !0,
|
|
763
|
+
attribute: "max-count",
|
|
764
|
+
converter: (t) => isNaN(t) ? 99 : t
|
|
765
|
+
},
|
|
766
|
+
important: {
|
|
767
|
+
type: Boolean,
|
|
768
|
+
reflect: !0,
|
|
769
|
+
attribute: "important"
|
|
770
|
+
},
|
|
771
|
+
link: {
|
|
772
|
+
type: String,
|
|
773
|
+
reflect: !0,
|
|
774
|
+
attribute: "link"
|
|
775
|
+
},
|
|
776
|
+
icon: {
|
|
777
|
+
type: String,
|
|
778
|
+
reflect: !0,
|
|
779
|
+
attribute: "icon"
|
|
780
|
+
},
|
|
781
|
+
active: {
|
|
782
|
+
type: Boolean,
|
|
783
|
+
reflect: !0,
|
|
784
|
+
attribute: "active"
|
|
785
|
+
},
|
|
786
|
+
select: {
|
|
787
|
+
type: Boolean,
|
|
788
|
+
reflect: !0,
|
|
789
|
+
attribute: "selected"
|
|
790
|
+
}
|
|
791
|
+
};
|
|
827
792
|
constructor() {
|
|
828
|
-
super();
|
|
793
|
+
super(), this.icon = "", this.name = "", this.variant = "none", this.amount = 0, this.maxCount = 99, this.important = !1, this.dropdown = !1, this.active = !1, this.selected = !1, this.link = void 0;
|
|
829
794
|
}
|
|
830
795
|
render() {
|
|
831
|
-
return
|
|
796
|
+
return e`
|
|
797
|
+
<a href="${c(this.link)}" class="nav-item ${this.active ? "active" : ""} ${this.select ? "selected" : ""}" tabindex="0">
|
|
798
|
+
<slot name="before" class="${this.amount > 0 && !this.select ? "standout" : ""} ${this.select ? "selected" : ""}"></slot>
|
|
799
|
+
<p>${this.name}</p>
|
|
800
|
+
${this.variant == "dropdown" ? e`<cd-icon class='caret' name='caret-down' size='sm'></cd-icon>` : ""}
|
|
801
|
+
${this.variant == "link" ? e`<cd-icon name='external' size='sm'></cd-icon>` : ""}
|
|
802
|
+
${this.variant == "number" ? e`<cd-counter count='${this.amount}' max-count='${this.maxCount}' important='${this.important}'></cd-notification-counter>` : ""}
|
|
803
|
+
</a>
|
|
804
|
+
<div class="children ${this.active ? "children-active" : ""}">
|
|
832
805
|
<slot></slot>
|
|
806
|
+
</div>
|
|
833
807
|
`;
|
|
834
808
|
}
|
|
809
|
+
setSelectState(t) {
|
|
810
|
+
if (typeof t != "boolean")
|
|
811
|
+
throw new Error("Select must be a boolean value");
|
|
812
|
+
this.select !== t && (this.select = t, this.requestUpdate());
|
|
813
|
+
}
|
|
814
|
+
setActiveState(t) {
|
|
815
|
+
if (typeof t != "boolean")
|
|
816
|
+
throw new Error("Active must be a boolean value");
|
|
817
|
+
this.active !== t && (this.active = t, this.requestUpdate());
|
|
818
|
+
}
|
|
819
|
+
toggleSelect() {
|
|
820
|
+
this.select = !this.select, this.requestUpdate();
|
|
821
|
+
}
|
|
822
|
+
toggleActive() {
|
|
823
|
+
this.active = !this.active, this.requestUpdate();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
function I() {
|
|
827
|
+
typeof window < "u" && !customElements.get("cd-nav-item") && customElements.define("cd-nav-item", m);
|
|
835
828
|
}
|
|
836
|
-
|
|
829
|
+
class y extends r {
|
|
830
|
+
static styles = a`
|
|
837
831
|
@font-face {
|
|
838
832
|
font-family: 'Geist';
|
|
839
|
-
src: url(${
|
|
833
|
+
src: url(${o(i)}) format('woff');
|
|
840
834
|
font-weight: 100 900;
|
|
841
835
|
font-style: normal;
|
|
842
836
|
}
|
|
@@ -845,33 +839,25 @@ r(y, "styles", l`
|
|
|
845
839
|
width: 100%;
|
|
846
840
|
}
|
|
847
841
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
typeof window < "u" && !customElements.get("cd-table") && customElements.define("cd-table", y);
|
|
851
|
-
}
|
|
852
|
-
class x extends a {
|
|
842
|
+
`;
|
|
843
|
+
static properties = {};
|
|
853
844
|
constructor() {
|
|
854
|
-
super()
|
|
845
|
+
super();
|
|
855
846
|
}
|
|
856
847
|
render() {
|
|
857
|
-
return
|
|
858
|
-
|
|
859
|
-
<div class="tooltip ${this.position}">
|
|
860
|
-
<div class="${this.content ? "tooltip-content" : "none"} ${this.text ? "" : "no-border"}">
|
|
861
|
-
<slot></slot>
|
|
862
|
-
</div>
|
|
863
|
-
<div class="${this.text ? "tooltip-text" : "none"}">
|
|
864
|
-
${this.text}
|
|
865
|
-
</div>
|
|
866
|
-
</div>
|
|
867
|
-
</div>
|
|
848
|
+
return e`
|
|
849
|
+
<slot></slot>
|
|
868
850
|
`;
|
|
869
851
|
}
|
|
870
852
|
}
|
|
871
|
-
|
|
853
|
+
function D() {
|
|
854
|
+
typeof window < "u" && !customElements.get("cd-table") && customElements.define("cd-table", y);
|
|
855
|
+
}
|
|
856
|
+
class x extends r {
|
|
857
|
+
static styles = a`
|
|
872
858
|
@font-face {
|
|
873
859
|
font-family: 'Geist';
|
|
874
|
-
src: url(${
|
|
860
|
+
src: url(${o(i)}) format('woff');
|
|
875
861
|
font-weight: 100 900;
|
|
876
862
|
font-style: normal;
|
|
877
863
|
}
|
|
@@ -933,47 +919,50 @@ r(x, "styles", l`
|
|
|
933
919
|
.no-border {
|
|
934
920
|
border-bottom: none;
|
|
935
921
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
typeof window < "u" && !customElements.get("cd-tool-tip") && customElements.define("cd-tool-tip", x);
|
|
954
|
-
}
|
|
955
|
-
c();
|
|
956
|
-
class w extends a {
|
|
922
|
+
`;
|
|
923
|
+
static properties = {
|
|
924
|
+
text: {
|
|
925
|
+
type: String,
|
|
926
|
+
reflect: !0
|
|
927
|
+
},
|
|
928
|
+
position: {
|
|
929
|
+
type: String,
|
|
930
|
+
reflect: !0,
|
|
931
|
+
attribute: "position",
|
|
932
|
+
converter: (t) => ["top", "right", "bottom", "left"].includes(t) ? t : "top"
|
|
933
|
+
},
|
|
934
|
+
content: {
|
|
935
|
+
type: Boolean,
|
|
936
|
+
reflect: !0
|
|
937
|
+
}
|
|
938
|
+
};
|
|
957
939
|
constructor() {
|
|
958
|
-
super(), this.
|
|
940
|
+
super(), this.text = "", this.content = !1, this.position = "top";
|
|
959
941
|
}
|
|
960
942
|
render() {
|
|
961
|
-
return
|
|
962
|
-
<div class="
|
|
963
|
-
<div class="
|
|
964
|
-
<
|
|
965
|
-
|
|
943
|
+
return e`
|
|
944
|
+
<div class="tooltip-container">
|
|
945
|
+
<div class="tooltip ${this.position}">
|
|
946
|
+
<div class="${this.content ? "tooltip-content" : "none"} ${this.text ? "" : "no-border"}">
|
|
947
|
+
<slot></slot>
|
|
948
|
+
</div>
|
|
949
|
+
<div class="${this.text ? "tooltip-text" : "none"}">
|
|
950
|
+
${this.text}
|
|
951
|
+
</div>
|
|
966
952
|
</div>
|
|
967
|
-
<cd-icon name="caret-down" size="sm"></cd-icon>
|
|
968
953
|
</div>
|
|
969
|
-
|
|
970
954
|
`;
|
|
971
955
|
}
|
|
972
956
|
}
|
|
973
|
-
|
|
957
|
+
function R() {
|
|
958
|
+
typeof window < "u" && !customElements.get("cd-tool-tip") && customElements.define("cd-tool-tip", x);
|
|
959
|
+
}
|
|
960
|
+
s();
|
|
961
|
+
class w extends r {
|
|
962
|
+
static styles = a`
|
|
974
963
|
@font-face {
|
|
975
964
|
font-family: 'Geist';
|
|
976
|
-
src: url(${
|
|
965
|
+
src: url(${o(i)}) format('woff');
|
|
977
966
|
font-weight: 100 900;
|
|
978
967
|
font-style: normal;
|
|
979
968
|
}
|
|
@@ -1012,46 +1001,52 @@ r(w, "styles", l`
|
|
|
1012
1001
|
gap: 6px;
|
|
1013
1002
|
align-items: center;
|
|
1014
1003
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
typeof window < "u" && !customElements.get("cd-nav-profile") && customElements.define("cd-nav-profile", w);
|
|
1037
|
-
}
|
|
1038
|
-
c();
|
|
1039
|
-
class k extends a {
|
|
1004
|
+
`;
|
|
1005
|
+
static properties = {
|
|
1006
|
+
primaryText: {
|
|
1007
|
+
type: String,
|
|
1008
|
+
reflect: !0,
|
|
1009
|
+
attribute: "name",
|
|
1010
|
+
defaultValue: ""
|
|
1011
|
+
},
|
|
1012
|
+
secondaryText: {
|
|
1013
|
+
type: String,
|
|
1014
|
+
reflect: !0,
|
|
1015
|
+
attribute: "org",
|
|
1016
|
+
defaultValue: ""
|
|
1017
|
+
},
|
|
1018
|
+
icon: {
|
|
1019
|
+
type: String,
|
|
1020
|
+
reflect: !0,
|
|
1021
|
+
attribute: "icon",
|
|
1022
|
+
defaultValue: ""
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1040
1025
|
constructor() {
|
|
1041
|
-
super(), this.
|
|
1026
|
+
super(), this.primaryText = "", this.secondaryText = "", this.icon = "hart";
|
|
1042
1027
|
}
|
|
1043
1028
|
render() {
|
|
1044
|
-
return
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1029
|
+
return e`
|
|
1030
|
+
<div class="profile-stack">
|
|
1031
|
+
<div class="text-stack">
|
|
1032
|
+
<span class="name">${this.primaryText}</span>
|
|
1033
|
+
${this.secondaryText != "" ? e`<span class="org"><cd-icon name="${this.icon}" size="sm"></cd-icon>${this.secondaryText}</span>` : ""}
|
|
1034
|
+
</div>
|
|
1035
|
+
<cd-icon name="caret-down" size="sm"></cd-icon>
|
|
1036
|
+
</div>
|
|
1037
|
+
|
|
1048
1038
|
`;
|
|
1049
1039
|
}
|
|
1050
1040
|
}
|
|
1051
|
-
|
|
1041
|
+
function L() {
|
|
1042
|
+
typeof window < "u" && !customElements.get("cd-nav-profile") && customElements.define("cd-nav-profile", w);
|
|
1043
|
+
}
|
|
1044
|
+
s();
|
|
1045
|
+
class k extends r {
|
|
1046
|
+
static styles = a`
|
|
1052
1047
|
@font-face {
|
|
1053
1048
|
font-family: 'Geist';
|
|
1054
|
-
src: url(${
|
|
1049
|
+
src: url(${o(i)}) format('woff');
|
|
1055
1050
|
font-weight: 100 900;
|
|
1056
1051
|
font-style: normal;
|
|
1057
1052
|
}
|
|
@@ -1125,128 +1120,40 @@ r(k, "styles", l`
|
|
|
1125
1120
|
outline: 2px solid var(--input-border-color-focus);
|
|
1126
1121
|
border-radius: 4px;
|
|
1127
1122
|
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
typeof window < "u" && !customElements.get("cd-value") && customElements.define("cd-value", k);
|
|
1143
|
-
}
|
|
1144
|
-
c();
|
|
1145
|
-
class $ extends a {
|
|
1146
|
-
handleBlur(t) {
|
|
1147
|
-
return this.dispatchEvent(new CustomEvent("blur", {
|
|
1148
|
-
detail: {
|
|
1149
|
-
value: t.target.value
|
|
1150
|
-
},
|
|
1151
|
-
bubbles: !0,
|
|
1152
|
-
composed: !0
|
|
1153
|
-
})), this.value = t.target.value, t.target.value;
|
|
1154
|
-
}
|
|
1155
|
-
handleFocus(t) {
|
|
1156
|
-
return this.expandInput(), this.dispatchEvent(new CustomEvent("focus", {
|
|
1157
|
-
detail: {
|
|
1158
|
-
value: t.target.value
|
|
1159
|
-
},
|
|
1160
|
-
bubbles: !0,
|
|
1161
|
-
composed: !0
|
|
1162
|
-
})), this.value = t.target.value, t.target.value;
|
|
1163
|
-
}
|
|
1164
|
-
handleKeyPress(t) {
|
|
1165
|
-
return this.dispatchEvent(new CustomEvent("keypress", {
|
|
1166
|
-
detail: {
|
|
1167
|
-
value: t.target.value,
|
|
1168
|
-
key: t.target.keyCode
|
|
1169
|
-
},
|
|
1170
|
-
bubbles: !0,
|
|
1171
|
-
composed: !0
|
|
1172
|
-
})), this.value = t.target.value, t.target.value;
|
|
1173
|
-
}
|
|
1174
|
-
handleInput(t) {
|
|
1175
|
-
return this.dispatchEvent(new CustomEvent("input", {
|
|
1176
|
-
detail: {
|
|
1177
|
-
value: t.target.value
|
|
1178
|
-
},
|
|
1179
|
-
bubbles: !0,
|
|
1180
|
-
composed: !0
|
|
1181
|
-
})), this.value = t.target.value, t.target.value;
|
|
1182
|
-
}
|
|
1123
|
+
`;
|
|
1124
|
+
static properties = {
|
|
1125
|
+
variant: {
|
|
1126
|
+
type: String,
|
|
1127
|
+
reflect: !0,
|
|
1128
|
+
attribute: "variant",
|
|
1129
|
+
converter: (t) => ["default", "dropdown", "arrow"].includes(t) ? t : "default"
|
|
1130
|
+
},
|
|
1131
|
+
link: {
|
|
1132
|
+
type: String,
|
|
1133
|
+
reflect: !0,
|
|
1134
|
+
attribute: "link"
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1183
1137
|
constructor() {
|
|
1184
|
-
super(), this.
|
|
1138
|
+
super(), this.variant = "default", this.link = void 0;
|
|
1185
1139
|
}
|
|
1186
1140
|
render() {
|
|
1187
|
-
return
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
<input
|
|
1193
|
-
id="search-input"
|
|
1194
|
-
type="text"
|
|
1195
|
-
class="search-input ${this.collapsed ? "collapsed" : "expanded"} ${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? "icon-spacing-right" : ""} ${this.size} ${this.fullWidth && !this.collapsed ? "full-width" : ""}"
|
|
1196
|
-
placeholder="${this.placeholder}"
|
|
1197
|
-
.value="${this.value}"
|
|
1198
|
-
?disabled="${this.disabled}"
|
|
1199
|
-
@input="${this.handleInput}"
|
|
1200
|
-
@focus="${this.handleFocus}"
|
|
1201
|
-
@blur="${this.handleBlur}"
|
|
1202
|
-
@keypress="${this.handleKeyPress}"
|
|
1203
|
-
@click="${this.expandInput}"
|
|
1204
|
-
name="${this.name}"
|
|
1205
|
-
>
|
|
1206
|
-
${this.iconRight || this.collapsed ? o`<span @click="${this.expandInput}" class="${this.collapsed ? "icon-collapsed-container" : "icon-right-container"}"><cd-icon name="search" class="${this.collapsed ? "icon-collapsed " + this.size : "icon-right"}" variant="light-slate"></cd-icon></span>` : ""}
|
|
1207
|
-
${this.closeIcon ? o`<span class="${this.collapsed ? "hidden" : "active"}" id='closeIcon' tabindex='0'><cd-icon name="exit" id="close-icon" class="icon close ${this.collapsed ? "hidden-icon" : "active-icon"}" @click="${this.collapseInput}"></cd-icon></span>` : ""}
|
|
1208
|
-
</div>
|
|
1141
|
+
return e`
|
|
1142
|
+
${this.variant === "default" ? e`<a href="${c(this.link)}" class="value"><slot></slot></a>` : ""}
|
|
1143
|
+
${this.variant === "dropdown" ? e`<span class="dropdown-value"><slot></slot></span>` : ""}
|
|
1144
|
+
${this.variant === "arrow" ? e`<a href="${c(this.link)}" class="arrow-value"><slot></slot><cd-icon name="arrow" size="sm"></cd-icon></a>` : ""}
|
|
1209
1145
|
`;
|
|
1210
1146
|
}
|
|
1211
|
-
firstUpdated() {
|
|
1212
|
-
if (!this.shadowRoot) {
|
|
1213
|
-
console.warn("Shadow DOM is not available.");
|
|
1214
|
-
return;
|
|
1215
|
-
}
|
|
1216
|
-
this.shadowRoot.querySelector(".active") && (console.log("Adding event listener to active element"), this.shadowRoot.querySelector(".active").addEventListener("keydown", (t) => {
|
|
1217
|
-
console.log("test"), t.keyCode === 13 && this.collapseInput();
|
|
1218
|
-
}));
|
|
1219
|
-
}
|
|
1220
|
-
focus() {
|
|
1221
|
-
if (!this.shadowRoot) {
|
|
1222
|
-
console.warn("Input element is not yet connected to the DOM.");
|
|
1223
|
-
return;
|
|
1224
|
-
}
|
|
1225
|
-
if (!this.shadowRoot.querySelector("input")) {
|
|
1226
|
-
console.warn("Input element is not found in the shadow DOM.");
|
|
1227
|
-
return;
|
|
1228
|
-
}
|
|
1229
|
-
this.shadowRoot.querySelector("#search-input").focus();
|
|
1230
|
-
}
|
|
1231
|
-
expandInput() {
|
|
1232
|
-
this.collapsed && (this.collapsed = !1, this.shadowRoot.querySelector("#search-input").focus(), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden"), this.shadowRoot.querySelector("#close-icon").classList.add("active-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("active"), this.requestUpdate(), this.shadowRoot.querySelector("#closeIcon").addEventListener("keydown", (t) => {
|
|
1233
|
-
t.key === "Enter" && this.collapseInput();
|
|
1234
|
-
}));
|
|
1235
|
-
}
|
|
1236
|
-
collapseInput() {
|
|
1237
|
-
this.collapsed || (this.collapsed = !0, this.value = "", this.shadowRoot.querySelector("#close-icon").classList.add("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("hidden"), this.shadowRoot.querySelector("#close-icon").classList.remove("active"), this.shadowRoot.querySelector("#close-icon").classList.remove("active-icon"), this.dispatchEvent(new CustomEvent("collapsed", {
|
|
1238
|
-
detail: {
|
|
1239
|
-
closed: !0
|
|
1240
|
-
},
|
|
1241
|
-
bubbles: !0,
|
|
1242
|
-
composed: !0
|
|
1243
|
-
})), this.requestUpdate());
|
|
1244
|
-
}
|
|
1245
1147
|
}
|
|
1246
|
-
|
|
1148
|
+
function P() {
|
|
1149
|
+
typeof window < "u" && !customElements.get("cd-value") && customElements.define("cd-value", k);
|
|
1150
|
+
}
|
|
1151
|
+
s();
|
|
1152
|
+
class $ extends r {
|
|
1153
|
+
static styles = a`
|
|
1247
1154
|
@font-face {
|
|
1248
1155
|
font-family: 'Geist';
|
|
1249
|
-
src: url(${
|
|
1156
|
+
src: url(${o(i)}) format('woff');
|
|
1250
1157
|
font-weight: 100 900;
|
|
1251
1158
|
font-style: normal;
|
|
1252
1159
|
}
|
|
@@ -1427,102 +1334,171 @@ r($, "styles", l`
|
|
|
1427
1334
|
opacity: 0;
|
|
1428
1335
|
transition: opacity 0.5s ease-in-out;
|
|
1429
1336
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
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
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1337
|
+
`;
|
|
1338
|
+
static properties = {
|
|
1339
|
+
placeholder: {
|
|
1340
|
+
type: String,
|
|
1341
|
+
reflect: !0
|
|
1342
|
+
},
|
|
1343
|
+
value: {
|
|
1344
|
+
type: String,
|
|
1345
|
+
reflect: !0
|
|
1346
|
+
},
|
|
1347
|
+
disabled: {
|
|
1348
|
+
type: Boolean,
|
|
1349
|
+
reflect: !0
|
|
1350
|
+
},
|
|
1351
|
+
collapsed: {
|
|
1352
|
+
type: Boolean,
|
|
1353
|
+
reflect: !0
|
|
1354
|
+
},
|
|
1355
|
+
iconLeft: {
|
|
1356
|
+
type: Boolean,
|
|
1357
|
+
reflect: !0,
|
|
1358
|
+
attribute: "icon-left"
|
|
1359
|
+
},
|
|
1360
|
+
iconRight: {
|
|
1361
|
+
type: Boolean,
|
|
1362
|
+
reflect: !0,
|
|
1363
|
+
attribute: "icon-right"
|
|
1364
|
+
},
|
|
1365
|
+
size: {
|
|
1366
|
+
type: String,
|
|
1367
|
+
reflect: !0
|
|
1368
|
+
},
|
|
1369
|
+
closeIcon: {
|
|
1370
|
+
type: Boolean,
|
|
1371
|
+
reflect: !0,
|
|
1372
|
+
attribute: "close-icon"
|
|
1373
|
+
},
|
|
1374
|
+
label: {
|
|
1375
|
+
type: String,
|
|
1376
|
+
reflect: !0
|
|
1377
|
+
},
|
|
1378
|
+
labelPosition: {
|
|
1379
|
+
type: String,
|
|
1380
|
+
reflect: !0,
|
|
1381
|
+
attribute: "label-position"
|
|
1382
|
+
},
|
|
1383
|
+
name: {
|
|
1384
|
+
type: String,
|
|
1385
|
+
reflect: !0
|
|
1386
|
+
},
|
|
1387
|
+
fullWidth: {
|
|
1388
|
+
type: Boolean,
|
|
1389
|
+
reflect: !0,
|
|
1390
|
+
attribute: "full-width"
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
handleBlur(t) {
|
|
1394
|
+
return this.dispatchEvent(new CustomEvent("blur", {
|
|
1395
|
+
detail: {
|
|
1396
|
+
value: t.target.value
|
|
1397
|
+
},
|
|
1398
|
+
bubbles: !0,
|
|
1399
|
+
composed: !0
|
|
1400
|
+
})), this.value = t.target.value, t.target.value;
|
|
1401
|
+
}
|
|
1402
|
+
handleFocus(t) {
|
|
1403
|
+
return this.expandInput(), this.dispatchEvent(new CustomEvent("focus", {
|
|
1404
|
+
detail: {
|
|
1405
|
+
value: t.target.value
|
|
1406
|
+
},
|
|
1407
|
+
bubbles: !0,
|
|
1408
|
+
composed: !0
|
|
1409
|
+
})), this.value = t.target.value, t.target.value;
|
|
1410
|
+
}
|
|
1411
|
+
handleKeyPress(t) {
|
|
1412
|
+
return this.dispatchEvent(new CustomEvent("keypress", {
|
|
1413
|
+
detail: {
|
|
1414
|
+
value: t.target.value,
|
|
1415
|
+
key: t.target.keyCode
|
|
1416
|
+
},
|
|
1417
|
+
bubbles: !0,
|
|
1418
|
+
composed: !0
|
|
1419
|
+
})), this.value = t.target.value, t.target.value;
|
|
1420
|
+
}
|
|
1421
|
+
handleInput(t) {
|
|
1422
|
+
return this.dispatchEvent(new CustomEvent("input", {
|
|
1423
|
+
detail: {
|
|
1424
|
+
value: t.target.value
|
|
1425
|
+
},
|
|
1426
|
+
bubbles: !0,
|
|
1427
|
+
composed: !0
|
|
1428
|
+
})), this.value = t.target.value, t.target.value;
|
|
1483
1429
|
}
|
|
1484
|
-
});
|
|
1485
|
-
function M() {
|
|
1486
|
-
typeof window < "u" && !customElements.get("cd-search") && customElements.define("cd-search", $);
|
|
1487
|
-
}
|
|
1488
|
-
c();
|
|
1489
|
-
class E extends a {
|
|
1490
1430
|
constructor() {
|
|
1491
|
-
super(), this.
|
|
1431
|
+
super(), this.placeholder = "Search", this.value = "", this.disabled = !1, this.collapsed = !1, this.iconLeft = !1, this.iconRight = !1, this.size = "md", this.closeIcon = !1, this.label = "", this.labelPosition = "left", this.name = "", this.fullWidth = !1, this._internals = this.attachInternals();
|
|
1492
1432
|
}
|
|
1493
1433
|
render() {
|
|
1494
|
-
return
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
<
|
|
1434
|
+
return e`
|
|
1435
|
+
<div class="search-container ${this.labelPosition}">
|
|
1436
|
+
${this.label ? e`<label for="search-input">${this.label}</label>` : ""}
|
|
1437
|
+
${this.iconLeft && !this.collapsed ? e`<span class="icon-left-container"><cd-icon name="search" class="icon-left" variant="light-slate"></cd-icon></span>` : ""}
|
|
1438
|
+
|
|
1439
|
+
<input
|
|
1440
|
+
id="search-input"
|
|
1441
|
+
type="text"
|
|
1442
|
+
class="search-input ${this.collapsed ? "collapsed" : "expanded"} ${this.iconLeft ? "icon-spacing-left" : ""} ${this.iconRight ? "icon-spacing-right" : ""} ${this.size} ${this.fullWidth && !this.collapsed ? "full-width" : ""}"
|
|
1443
|
+
placeholder="${this.placeholder}"
|
|
1444
|
+
.value="${this.value}"
|
|
1445
|
+
?disabled="${this.disabled}"
|
|
1446
|
+
@input="${this.handleInput}"
|
|
1447
|
+
@focus="${this.handleFocus}"
|
|
1448
|
+
@blur="${this.handleBlur}"
|
|
1449
|
+
@keypress="${this.handleKeyPress}"
|
|
1450
|
+
@click="${this.expandInput}"
|
|
1451
|
+
name="${this.name}"
|
|
1452
|
+
>
|
|
1453
|
+
${this.iconRight || this.collapsed ? e`<span @click="${this.expandInput}" class="${this.collapsed ? "icon-collapsed-container" : "icon-right-container"}"><cd-icon name="search" class="${this.collapsed ? "icon-collapsed " + this.size : "icon-right"}" variant="light-slate"></cd-icon></span>` : ""}
|
|
1454
|
+
${this.closeIcon ? e`<span class="${this.collapsed ? "hidden" : "active"}" id='closeIcon' tabindex='0'><cd-icon name="exit" id="close-icon" class="icon close ${this.collapsed ? "hidden-icon" : "active-icon"}" @click="${this.collapseInput}"></cd-icon></span>` : ""}
|
|
1500
1455
|
</div>
|
|
1501
|
-
</div>
|
|
1502
1456
|
`;
|
|
1503
1457
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1458
|
+
firstUpdated() {
|
|
1459
|
+
if (!this.shadowRoot) {
|
|
1460
|
+
console.warn("Shadow DOM is not available.");
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
this.shadowRoot.querySelector(".active") && (console.log("Adding event listener to active element"), this.shadowRoot.querySelector(".active").addEventListener("keydown", (t) => {
|
|
1464
|
+
console.log("test"), t.keyCode === 13 && this.collapseInput();
|
|
1465
|
+
}));
|
|
1506
1466
|
}
|
|
1507
|
-
|
|
1508
|
-
if (
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
this.
|
|
1467
|
+
focus() {
|
|
1468
|
+
if (!this.shadowRoot) {
|
|
1469
|
+
console.warn("Input element is not yet connected to the DOM.");
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
if (!this.shadowRoot.querySelector("input")) {
|
|
1473
|
+
console.warn("Input element is not found in the shadow DOM.");
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1476
|
+
this.shadowRoot.querySelector("#search-input").focus();
|
|
1513
1477
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1478
|
+
expandInput() {
|
|
1479
|
+
this.collapsed && (this.collapsed = !1, this.shadowRoot.querySelector("#search-input").focus(), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.remove("hidden"), this.shadowRoot.querySelector("#close-icon").classList.add("active-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("active"), this.requestUpdate(), this.shadowRoot.querySelector("#closeIcon").addEventListener("keydown", (t) => {
|
|
1480
|
+
t.key === "Enter" && this.collapseInput();
|
|
1481
|
+
}));
|
|
1482
|
+
}
|
|
1483
|
+
collapseInput() {
|
|
1484
|
+
this.collapsed || (this.collapsed = !0, this.value = "", this.shadowRoot.querySelector("#close-icon").classList.add("hidden-icon"), this.shadowRoot.querySelector("#close-icon").classList.add("hidden"), this.shadowRoot.querySelector("#close-icon").classList.remove("active"), this.shadowRoot.querySelector("#close-icon").classList.remove("active-icon"), this.dispatchEvent(new CustomEvent("collapsed", {
|
|
1485
|
+
detail: {
|
|
1486
|
+
closed: !0
|
|
1487
|
+
},
|
|
1488
|
+
bubbles: !0,
|
|
1489
|
+
composed: !0
|
|
1490
|
+
})), this.requestUpdate());
|
|
1520
1491
|
}
|
|
1521
1492
|
}
|
|
1522
|
-
|
|
1493
|
+
function N() {
|
|
1494
|
+
typeof window < "u" && !customElements.get("cd-search") && customElements.define("cd-search", $);
|
|
1495
|
+
}
|
|
1496
|
+
s();
|
|
1497
|
+
class E extends r {
|
|
1498
|
+
static styles = a`
|
|
1523
1499
|
@font-face {
|
|
1524
1500
|
font-family: 'Geist';
|
|
1525
|
-
src: url(${
|
|
1501
|
+
src: url(${o(i)}) format('woff');
|
|
1526
1502
|
font-weight: 100 900;
|
|
1527
1503
|
font-style: normal;
|
|
1528
1504
|
}
|
|
@@ -1624,46 +1600,71 @@ r(E, "styles", l`
|
|
|
1624
1600
|
.tab:focus {
|
|
1625
1601
|
outline: 2px solid var(--input-border-color-focus);
|
|
1626
1602
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1603
|
+
`;
|
|
1604
|
+
static properties = {
|
|
1605
|
+
label: {
|
|
1606
|
+
type: String,
|
|
1607
|
+
reflect: !0
|
|
1608
|
+
},
|
|
1609
|
+
active: {
|
|
1610
|
+
type: Boolean,
|
|
1611
|
+
reflect: !0
|
|
1612
|
+
},
|
|
1613
|
+
disabled: {
|
|
1614
|
+
type: Boolean,
|
|
1615
|
+
reflect: !0
|
|
1616
|
+
},
|
|
1617
|
+
variant: {
|
|
1618
|
+
type: String,
|
|
1619
|
+
reflect: !0,
|
|
1620
|
+
attribute: "variant",
|
|
1621
|
+
converter: (t) => ["default", "pill", "outline"].includes(t) ? t : "default"
|
|
1622
|
+
},
|
|
1623
|
+
size: {
|
|
1624
|
+
type: String,
|
|
1625
|
+
reflect: !0
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
constructor() {
|
|
1629
|
+
super(), this.label = "", this.active = !1, this.disabled = !1, this.variant = "default", this.size = "md";
|
|
1649
1630
|
}
|
|
1650
|
-
});
|
|
1651
|
-
function W() {
|
|
1652
|
-
typeof window < "u" && !customElements.get("cd-tab") && customElements.define("cd-tab", E);
|
|
1653
|
-
}
|
|
1654
|
-
class z extends a {
|
|
1655
1631
|
render() {
|
|
1656
|
-
return
|
|
1657
|
-
<div class=
|
|
1658
|
-
<
|
|
1632
|
+
return e`
|
|
1633
|
+
<div class="tab-outer ${this.variant} ${this.active ? "active" : ""}" >
|
|
1634
|
+
<div class='tab ${this.variant} ${this.size} ${this.disabled ? "disabled" : ""} ${this.active ? "active" : ""}' tabindex="${this.disabled ? -1 : 0}">
|
|
1635
|
+
<slot name="start"></slot>
|
|
1636
|
+
<span class="label">${this.label}</span>
|
|
1637
|
+
<slot name="end"></slot>
|
|
1638
|
+
</div>
|
|
1659
1639
|
</div>
|
|
1660
1640
|
`;
|
|
1661
1641
|
}
|
|
1642
|
+
toggleActive() {
|
|
1643
|
+
this.active = !this.active;
|
|
1644
|
+
}
|
|
1645
|
+
setActive(t) {
|
|
1646
|
+
if (typeof t != "boolean")
|
|
1647
|
+
throw new TypeError("Active must be a boolean");
|
|
1648
|
+
if (this.disabled)
|
|
1649
|
+
throw new Error("Cannot set active state when the tab is disabled");
|
|
1650
|
+
this.active = t;
|
|
1651
|
+
}
|
|
1652
|
+
setDisabled(t) {
|
|
1653
|
+
if (typeof t != "boolean")
|
|
1654
|
+
throw new TypeError("Disabled must be a boolean");
|
|
1655
|
+
if (this.active && t)
|
|
1656
|
+
throw new Error("Cannot disable an active tab");
|
|
1657
|
+
this.disabled = t;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
function G() {
|
|
1661
|
+
typeof window < "u" && !customElements.get("cd-tab") && customElements.define("cd-tab", E);
|
|
1662
1662
|
}
|
|
1663
|
-
|
|
1663
|
+
class z extends r {
|
|
1664
|
+
static styles = a`
|
|
1664
1665
|
@font-face {
|
|
1665
1666
|
font-family: 'Geist';
|
|
1666
|
-
src: url(${
|
|
1667
|
+
src: url(${o(i)}) format('woff');
|
|
1667
1668
|
font-weight: normal;
|
|
1668
1669
|
font-style: normal;
|
|
1669
1670
|
}
|
|
@@ -1683,143 +1684,72 @@ r(z, "styles", l`
|
|
|
1683
1684
|
|
|
1684
1685
|
|
|
1685
1686
|
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
typeof window < "u" && !customElements.get("cd-tab-container") && customElements.define("cd-tab-container", z);
|
|
1697
|
-
}
|
|
1698
|
-
A();
|
|
1699
|
-
class u extends a {
|
|
1700
|
-
constructor() {
|
|
1701
|
-
super();
|
|
1702
|
-
r(this, "handleChange", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1703
|
-
detail: {
|
|
1704
|
-
value: this.value
|
|
1705
|
-
},
|
|
1706
|
-
bubbles: !0,
|
|
1707
|
-
composed: !0
|
|
1708
|
-
})), this.value));
|
|
1709
|
-
r(this, "handleInput", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
|
|
1710
|
-
detail: {
|
|
1711
|
-
value: this.value
|
|
1712
|
-
},
|
|
1713
|
-
bubbles: !0,
|
|
1714
|
-
composed: !0
|
|
1715
|
-
})), this.value));
|
|
1716
|
-
r(this, "handleFocus", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
|
|
1717
|
-
detail: {
|
|
1718
|
-
value: this.value
|
|
1719
|
-
},
|
|
1720
|
-
bubbles: !0,
|
|
1721
|
-
composed: !0
|
|
1722
|
-
})), this.value));
|
|
1723
|
-
r(this, "handleBlur", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
|
|
1724
|
-
detail: {
|
|
1725
|
-
value: this.value
|
|
1726
|
-
},
|
|
1727
|
-
bubbles: !0,
|
|
1728
|
-
composed: !0
|
|
1729
|
-
})), this.value));
|
|
1730
|
-
this.value = "", this.shortcut = void 0, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
|
|
1731
|
-
customError: this.errorText && this.errorText.length > 0 || !1
|
|
1732
|
-
});
|
|
1733
|
-
}
|
|
1687
|
+
`;
|
|
1688
|
+
static properties = {
|
|
1689
|
+
variant: {
|
|
1690
|
+
type: String,
|
|
1691
|
+
reflect: !0,
|
|
1692
|
+
attribute: "variant",
|
|
1693
|
+
converter: (t) => ["default", "pill", "outline"].includes(t) ? t : "default",
|
|
1694
|
+
defaultValue: "default"
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1734
1697
|
render() {
|
|
1735
|
-
return
|
|
1736
|
-
<div class='container'>
|
|
1737
|
-
<
|
|
1738
|
-
${this.shortcut ? o`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
|
|
1698
|
+
return e`
|
|
1699
|
+
<div class='container ${this.variant}'>
|
|
1700
|
+
<slot></slot>
|
|
1739
1701
|
</div>
|
|
1740
|
-
|
|
1741
1702
|
`;
|
|
1742
1703
|
}
|
|
1743
|
-
firstUpdated() {
|
|
1744
|
-
if (!this.shadowRoot) {
|
|
1745
|
-
console.warn("Shadow DOM not available, DateComponent may not render correctly.");
|
|
1746
|
-
return;
|
|
1747
|
-
}
|
|
1748
|
-
this.shadowRoot.querySelector("cd-button") && this.shadowRoot.querySelector("cd-button").addEventListener("button-click", () => {
|
|
1749
|
-
this.setValue(this.dateNow()), this.dispatchEvent(new CustomEvent("change", {
|
|
1750
|
-
detail: {
|
|
1751
|
-
value: this.value
|
|
1752
|
-
},
|
|
1753
|
-
bubbles: !0,
|
|
1754
|
-
composed: !0
|
|
1755
|
-
}));
|
|
1756
|
-
});
|
|
1757
|
-
}
|
|
1758
|
-
dateNow() {
|
|
1759
|
-
let e = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
1760
|
-
timeZone: this.timezone
|
|
1761
|
-
});
|
|
1762
|
-
return new Date(e).toISOString().slice(0, 10);
|
|
1763
|
-
}
|
|
1764
|
-
setValue(e) {
|
|
1765
|
-
this.value = e, this._internals.setFormValue(e), this.requestUpdate();
|
|
1766
|
-
}
|
|
1767
|
-
setError(e) {
|
|
1768
|
-
if (typeof e != "error") {
|
|
1769
|
-
console.warn("Error text must be a string");
|
|
1770
|
-
return;
|
|
1771
|
-
}
|
|
1772
|
-
this.error = e, this._internals.setValidity({
|
|
1773
|
-
customError: e
|
|
1774
|
-
}), this.requestUpdate();
|
|
1775
|
-
}
|
|
1776
|
-
setDisabled(e) {
|
|
1777
|
-
this.disabled = e, this._internals.setValidity({
|
|
1778
|
-
customError: e
|
|
1779
|
-
}), this.requestUpdate();
|
|
1780
|
-
}
|
|
1781
1704
|
}
|
|
1782
|
-
|
|
1783
|
-
"
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1705
|
+
function F() {
|
|
1706
|
+
typeof window < "u" && !customElements.get("cd-tab-container") && customElements.define("cd-tab-container", z);
|
|
1707
|
+
}
|
|
1708
|
+
d();
|
|
1709
|
+
class S extends r {
|
|
1710
|
+
static formAssociated = !0;
|
|
1711
|
+
static distinctTimezones = [
|
|
1712
|
+
"Etc/GMT+12",
|
|
1713
|
+
"Pacific/Pago_Pago",
|
|
1714
|
+
"Pacific/Honolulu",
|
|
1715
|
+
"America/Anchorage",
|
|
1716
|
+
"America/Los_Angeles",
|
|
1717
|
+
"America/Denver",
|
|
1718
|
+
"America/Chicago",
|
|
1719
|
+
"America/New_York",
|
|
1720
|
+
"America/Halifax",
|
|
1721
|
+
"America/Argentina/Buenos_Aires",
|
|
1722
|
+
"America/Noronha",
|
|
1723
|
+
"Atlantic/Azores",
|
|
1724
|
+
"Europe/London",
|
|
1725
|
+
"Europe/Paris",
|
|
1726
|
+
"Europe/Bucharest",
|
|
1727
|
+
"Europe/Moscow",
|
|
1728
|
+
"Asia/Tehran",
|
|
1729
|
+
"Asia/Dubai",
|
|
1730
|
+
"Asia/Kabul",
|
|
1731
|
+
"Asia/Karachi",
|
|
1732
|
+
"Asia/Kolkata",
|
|
1733
|
+
"Asia/Kathmandu",
|
|
1734
|
+
"Asia/Dhaka",
|
|
1735
|
+
"Asia/Yangon",
|
|
1736
|
+
"Asia/Bangkok",
|
|
1737
|
+
"Asia/Shanghai",
|
|
1738
|
+
"Australia/Eucla",
|
|
1739
|
+
"Asia/Tokyo",
|
|
1740
|
+
"Australia/Darwin",
|
|
1741
|
+
"Australia/Sydney",
|
|
1742
|
+
"Australia/Lord_Howe",
|
|
1743
|
+
"Pacific/Noumea",
|
|
1744
|
+
"Pacific/Auckland",
|
|
1745
|
+
"Pacific/Chatham",
|
|
1746
|
+
"Pacific/Tongatapu",
|
|
1747
|
+
"Pacific/Kiritimati"
|
|
1748
|
+
];
|
|
1749
|
+
static styles = a`
|
|
1820
1750
|
@font-face {
|
|
1821
1751
|
font-family: 'Geist';
|
|
1822
|
-
src: url(${
|
|
1752
|
+
src: url(${o(i)}) format('woff');
|
|
1823
1753
|
font-weight: 100 900;
|
|
1824
1754
|
font-style: normal;
|
|
1825
1755
|
}
|
|
@@ -1908,105 +1838,103 @@ r(u, "formAssociated", !0), r(u, "distinctTimezones", [
|
|
|
1908
1838
|
flex-direction: row;
|
|
1909
1839
|
align-items: center;
|
|
1910
1840
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
typeof window < "u" && !customElements.get("cd-date") && customElements.define("cd-date", u);
|
|
1960
|
-
}
|
|
1961
|
-
A();
|
|
1962
|
-
class p extends a {
|
|
1841
|
+
`;
|
|
1842
|
+
static properties = {
|
|
1843
|
+
value: {
|
|
1844
|
+
type: String,
|
|
1845
|
+
reflect: !0
|
|
1846
|
+
},
|
|
1847
|
+
shortcut: {
|
|
1848
|
+
type: String,
|
|
1849
|
+
reflect: !0
|
|
1850
|
+
},
|
|
1851
|
+
error: {
|
|
1852
|
+
type: Boolean,
|
|
1853
|
+
reflect: !0,
|
|
1854
|
+
attribute: "error"
|
|
1855
|
+
},
|
|
1856
|
+
disabled: {
|
|
1857
|
+
type: Boolean,
|
|
1858
|
+
reflect: !0
|
|
1859
|
+
},
|
|
1860
|
+
form: {
|
|
1861
|
+
type: String,
|
|
1862
|
+
reflect: !0,
|
|
1863
|
+
attribute: "form"
|
|
1864
|
+
},
|
|
1865
|
+
size: {
|
|
1866
|
+
type: String,
|
|
1867
|
+
reflect: !0,
|
|
1868
|
+
attribute: "size",
|
|
1869
|
+
converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
|
|
1870
|
+
},
|
|
1871
|
+
fullWidth: {
|
|
1872
|
+
type: Boolean,
|
|
1873
|
+
reflect: !0,
|
|
1874
|
+
attribute: "full-width"
|
|
1875
|
+
},
|
|
1876
|
+
variant: {
|
|
1877
|
+
type: String,
|
|
1878
|
+
reflect: !0,
|
|
1879
|
+
attribute: "variant",
|
|
1880
|
+
converter: (t) => ["dashed", "dotted"].includes(t) ? t : "default"
|
|
1881
|
+
},
|
|
1882
|
+
timezone: {
|
|
1883
|
+
type: String,
|
|
1884
|
+
reflect: !0,
|
|
1885
|
+
attribute: "timezone",
|
|
1886
|
+
converter: (t) => distinctTimezones.includes(t) ? t : "America/New_York"
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1963
1889
|
constructor() {
|
|
1964
|
-
super()
|
|
1965
|
-
r(this, "handleChange", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1966
|
-
detail: {
|
|
1967
|
-
value: this.value
|
|
1968
|
-
},
|
|
1969
|
-
bubbles: !0,
|
|
1970
|
-
composed: !0
|
|
1971
|
-
})), this.value));
|
|
1972
|
-
r(this, "handleInput", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
|
|
1973
|
-
detail: {
|
|
1974
|
-
value: this.value
|
|
1975
|
-
},
|
|
1976
|
-
bubbles: !0,
|
|
1977
|
-
composed: !0
|
|
1978
|
-
})), this.value));
|
|
1979
|
-
r(this, "handleFocus", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
|
|
1980
|
-
detail: {
|
|
1981
|
-
value: this.value
|
|
1982
|
-
},
|
|
1983
|
-
bubbles: !0,
|
|
1984
|
-
composed: !0
|
|
1985
|
-
})), this.value));
|
|
1986
|
-
r(this, "handleBlur", (e) => (this.value = e.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
|
|
1987
|
-
detail: {
|
|
1988
|
-
value: this.value
|
|
1989
|
-
},
|
|
1990
|
-
bubbles: !0,
|
|
1991
|
-
composed: !0
|
|
1992
|
-
})), this.value));
|
|
1993
|
-
this.value = "", this.shortcut = void 0, this.error = !1, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
|
|
1890
|
+
super(), this.value = "", this.shortcut = void 0, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
|
|
1994
1891
|
customError: this.errorText && this.errorText.length > 0 || !1
|
|
1995
1892
|
});
|
|
1996
1893
|
}
|
|
1894
|
+
handleChange = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
1895
|
+
detail: {
|
|
1896
|
+
value: this.value
|
|
1897
|
+
},
|
|
1898
|
+
bubbles: !0,
|
|
1899
|
+
composed: !0
|
|
1900
|
+
})), this.value);
|
|
1901
|
+
handleInput = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
|
|
1902
|
+
detail: {
|
|
1903
|
+
value: this.value
|
|
1904
|
+
},
|
|
1905
|
+
bubbles: !0,
|
|
1906
|
+
composed: !0
|
|
1907
|
+
})), this.value);
|
|
1908
|
+
handleFocus = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
|
|
1909
|
+
detail: {
|
|
1910
|
+
value: this.value
|
|
1911
|
+
},
|
|
1912
|
+
bubbles: !0,
|
|
1913
|
+
composed: !0
|
|
1914
|
+
})), this.value);
|
|
1915
|
+
handleBlur = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
|
|
1916
|
+
detail: {
|
|
1917
|
+
value: this.value
|
|
1918
|
+
},
|
|
1919
|
+
bubbles: !0,
|
|
1920
|
+
composed: !0
|
|
1921
|
+
})), this.value);
|
|
1997
1922
|
render() {
|
|
1998
|
-
return
|
|
1999
|
-
<
|
|
2000
|
-
|
|
1923
|
+
return e`
|
|
1924
|
+
<div class='container'>
|
|
1925
|
+
<input class='${this.error ? "input-error" : ""} ${this.disabled ? "disabled" : ""} ${this.fullWidth ? "full-width" : ""} ${this.variant} ${this.size}' type='date' id='${this.name | "date"}' name='${this.name | "date"}' .value='${this.value}' @change='${this.handleChange}' @focus='${this.handleFocus}' @blur='${this.handleBlur}' @input='${this.handleInput}' ?disabled='${this.disabled}' />
|
|
1926
|
+
${this.shortcut ? e`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
|
|
1927
|
+
</div>
|
|
1928
|
+
|
|
2001
1929
|
`;
|
|
2002
1930
|
}
|
|
2003
1931
|
firstUpdated() {
|
|
2004
1932
|
if (!this.shadowRoot) {
|
|
2005
|
-
console.warn("Shadow DOM not available,
|
|
1933
|
+
console.warn("Shadow DOM not available, DateComponent may not render correctly.");
|
|
2006
1934
|
return;
|
|
2007
1935
|
}
|
|
2008
1936
|
this.shadowRoot.querySelector("cd-button") && this.shadowRoot.querySelector("cd-button").addEventListener("button-click", () => {
|
|
2009
|
-
this.setValue(this.
|
|
1937
|
+
this.setValue(this.dateNow()), this.dispatchEvent(new CustomEvent("change", {
|
|
2010
1938
|
detail: {
|
|
2011
1939
|
value: this.value
|
|
2012
1940
|
},
|
|
@@ -2015,77 +1943,78 @@ class p extends a {
|
|
|
2015
1943
|
}));
|
|
2016
1944
|
});
|
|
2017
1945
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
timeZone: this.timezone || "America/New_York"
|
|
1946
|
+
dateNow() {
|
|
1947
|
+
let t = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
1948
|
+
timeZone: this.timezone
|
|
2022
1949
|
});
|
|
2023
|
-
|
|
2024
|
-
let d = e.split(" ");
|
|
2025
|
-
console.log(d), e = Number(d[1].split(":")[0]) + 12 + ":" + d[1].split(":")[1] + ":" + d[1].split(":")[2];
|
|
2026
|
-
} else
|
|
2027
|
-
e = e.split(" ")[1];
|
|
2028
|
-
return e;
|
|
1950
|
+
return new Date(t).toISOString().slice(0, 10);
|
|
2029
1951
|
}
|
|
2030
|
-
setValue(
|
|
2031
|
-
this.value =
|
|
1952
|
+
setValue(t) {
|
|
1953
|
+
this.value = t, this._internals.setFormValue(t), this.requestUpdate();
|
|
2032
1954
|
}
|
|
2033
|
-
setError(
|
|
2034
|
-
if (typeof
|
|
1955
|
+
setError(t) {
|
|
1956
|
+
if (typeof t != "error") {
|
|
2035
1957
|
console.warn("Error text must be a string");
|
|
2036
1958
|
return;
|
|
2037
1959
|
}
|
|
2038
|
-
this.error =
|
|
2039
|
-
customError:
|
|
1960
|
+
this.error = t, this._internals.setValidity({
|
|
1961
|
+
customError: t
|
|
2040
1962
|
}), this.requestUpdate();
|
|
2041
1963
|
}
|
|
2042
|
-
setDisabled(
|
|
2043
|
-
this.disabled =
|
|
2044
|
-
customError:
|
|
1964
|
+
setDisabled(t) {
|
|
1965
|
+
this.disabled = t, this._internals.setValidity({
|
|
1966
|
+
customError: t
|
|
2045
1967
|
}), this.requestUpdate();
|
|
2046
1968
|
}
|
|
2047
1969
|
}
|
|
2048
|
-
|
|
2049
|
-
"
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
1970
|
+
function U() {
|
|
1971
|
+
typeof window < "u" && !customElements.get("cd-date") && customElements.define("cd-date", S);
|
|
1972
|
+
}
|
|
1973
|
+
d();
|
|
1974
|
+
class A extends r {
|
|
1975
|
+
static formAssociated = !0;
|
|
1976
|
+
static distinctTimezones = [
|
|
1977
|
+
"Etc/GMT+12",
|
|
1978
|
+
"Pacific/Pago_Pago",
|
|
1979
|
+
"Pacific/Honolulu",
|
|
1980
|
+
"America/Anchorage",
|
|
1981
|
+
"America/Los_Angeles",
|
|
1982
|
+
"America/Denver",
|
|
1983
|
+
"America/Chicago",
|
|
1984
|
+
"America/New_York",
|
|
1985
|
+
"America/Halifax",
|
|
1986
|
+
"America/Argentina/Buenos_Aires",
|
|
1987
|
+
"America/Noronha",
|
|
1988
|
+
"Atlantic/Azores",
|
|
1989
|
+
"Europe/London",
|
|
1990
|
+
"Europe/Paris",
|
|
1991
|
+
"Europe/Bucharest",
|
|
1992
|
+
"Europe/Moscow",
|
|
1993
|
+
"Asia/Tehran",
|
|
1994
|
+
"Asia/Dubai",
|
|
1995
|
+
"Asia/Kabul",
|
|
1996
|
+
"Asia/Karachi",
|
|
1997
|
+
"Asia/Kolkata",
|
|
1998
|
+
"Asia/Kathmandu",
|
|
1999
|
+
"Asia/Dhaka",
|
|
2000
|
+
"Asia/Yangon",
|
|
2001
|
+
"Asia/Bangkok",
|
|
2002
|
+
"Asia/Shanghai",
|
|
2003
|
+
"Australia/Eucla",
|
|
2004
|
+
"Asia/Tokyo",
|
|
2005
|
+
"Australia/Darwin",
|
|
2006
|
+
"Australia/Sydney",
|
|
2007
|
+
"Australia/Lord_Howe",
|
|
2008
|
+
"Pacific/Noumea",
|
|
2009
|
+
"Pacific/Auckland",
|
|
2010
|
+
"Pacific/Chatham",
|
|
2011
|
+
"Pacific/Tongatapu",
|
|
2012
|
+
"Pacific/Kiritimati"
|
|
2013
|
+
];
|
|
2014
|
+
static styles = a`
|
|
2086
2015
|
@font-face {
|
|
2087
2016
|
font-family: 'Geist';
|
|
2088
|
-
src: url(${
|
|
2017
|
+
src: url(${o(i)}) format('woff');
|
|
2089
2018
|
font-weight: 100 900;
|
|
2090
2019
|
font-style: normal;
|
|
2091
2020
|
}
|
|
@@ -2167,61 +2096,146 @@ r(p, "formAssociated", !0), r(p, "distinctTimezones", [
|
|
|
2167
2096
|
height: 36px;
|
|
2168
2097
|
padding: 0 var(--input-horizontal-inline-padding-sm, 12px);
|
|
2169
2098
|
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2099
|
+
`;
|
|
2100
|
+
static properties = {
|
|
2101
|
+
value: {
|
|
2102
|
+
type: String,
|
|
2103
|
+
reflect: !0
|
|
2104
|
+
},
|
|
2105
|
+
shortcut: {
|
|
2106
|
+
type: String,
|
|
2107
|
+
reflect: !0
|
|
2108
|
+
},
|
|
2109
|
+
error: {
|
|
2110
|
+
type: Boolean,
|
|
2111
|
+
reflect: !0,
|
|
2112
|
+
attribute: "error"
|
|
2113
|
+
},
|
|
2114
|
+
disabled: {
|
|
2115
|
+
type: Boolean,
|
|
2116
|
+
reflect: !0
|
|
2117
|
+
},
|
|
2118
|
+
form: {
|
|
2119
|
+
type: String,
|
|
2120
|
+
reflect: !0,
|
|
2121
|
+
attribute: "form"
|
|
2122
|
+
},
|
|
2123
|
+
size: {
|
|
2124
|
+
type: String,
|
|
2125
|
+
reflect: !0,
|
|
2126
|
+
attribute: "size",
|
|
2127
|
+
converter: (t) => ["sm", "md", "lg"].includes(t) ? t : "md"
|
|
2128
|
+
},
|
|
2129
|
+
fullWidth: {
|
|
2130
|
+
type: Boolean,
|
|
2131
|
+
reflect: !0,
|
|
2132
|
+
attribute: "full-width"
|
|
2133
|
+
},
|
|
2134
|
+
variant: {
|
|
2135
|
+
type: String,
|
|
2136
|
+
reflect: !0,
|
|
2137
|
+
attribute: "variant",
|
|
2138
|
+
converter: (t) => ["dashed", "dotted"].includes(t) ? t : "default"
|
|
2139
|
+
},
|
|
2140
|
+
timezone: {
|
|
2141
|
+
type: String,
|
|
2142
|
+
reflect: !0,
|
|
2143
|
+
attribute: "timezone",
|
|
2144
|
+
converter: (t) => distinctTimezones.includes(t) ? t : "America/New_York"
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
constructor() {
|
|
2148
|
+
super(), this.value = "", this.shortcut = void 0, this.error = !1, this.disabled = void 0, this.form = void 0, this.size = "md", this.fullWidth = !1, this.variant = "default", this.timezone = "America/New_York", this._internals = this.attachInternals(), this._internals.setValidity({
|
|
2149
|
+
customError: this.errorText && this.errorText.length > 0 || !1
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
handleChange = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("change", {
|
|
2153
|
+
detail: {
|
|
2154
|
+
value: this.value
|
|
2155
|
+
},
|
|
2156
|
+
bubbles: !0,
|
|
2157
|
+
composed: !0
|
|
2158
|
+
})), this.value);
|
|
2159
|
+
handleInput = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("input", {
|
|
2160
|
+
detail: {
|
|
2161
|
+
value: this.value
|
|
2162
|
+
},
|
|
2163
|
+
bubbles: !0,
|
|
2164
|
+
composed: !0
|
|
2165
|
+
})), this.value);
|
|
2166
|
+
handleFocus = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("focus", {
|
|
2167
|
+
detail: {
|
|
2168
|
+
value: this.value
|
|
2169
|
+
},
|
|
2170
|
+
bubbles: !0,
|
|
2171
|
+
composed: !0
|
|
2172
|
+
})), this.value);
|
|
2173
|
+
handleBlur = (t) => (this.value = t.target.value, this._internals.setFormValue(this.value), this.dispatchEvent(new CustomEvent("blur", {
|
|
2174
|
+
detail: {
|
|
2175
|
+
value: this.value
|
|
2176
|
+
},
|
|
2177
|
+
bubbles: !0,
|
|
2178
|
+
composed: !0
|
|
2179
|
+
})), this.value);
|
|
2180
|
+
render() {
|
|
2181
|
+
return e`
|
|
2182
|
+
<input class='${this.error ? "input-error" : ""} ${this.disabled ? "disabled" : ""} ${this.fullWidth ? "full-width" : ""} ${this.variant} ${this.size}' type='time' id='${this.name | "time"}' name='${this.name | "time"}' .value='${this.value}' @change='${this.handleChange}' @focus='${this.handleFocus}' @blur='${this.handleBlur}' @input='${this.handleInput}' ?disabled='${this.disabled}' />
|
|
2183
|
+
${this.shortcut ? e`<cd-button variant='primary' ?disabled='${this.disabled}'>${this.shortcut}</cd-button>` : ""}
|
|
2184
|
+
`;
|
|
2185
|
+
}
|
|
2186
|
+
firstUpdated() {
|
|
2187
|
+
if (!this.shadowRoot) {
|
|
2188
|
+
console.warn("Shadow DOM not available, TimeComponent may not render correctly.");
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
this.shadowRoot.querySelector("cd-button") && this.shadowRoot.querySelector("cd-button").addEventListener("button-click", () => {
|
|
2192
|
+
this.setValue(this.timeNow()), this.dispatchEvent(new CustomEvent("change", {
|
|
2193
|
+
detail: {
|
|
2194
|
+
value: this.value
|
|
2195
|
+
},
|
|
2196
|
+
bubbles: !0,
|
|
2197
|
+
composed: !0
|
|
2198
|
+
}));
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
timeNow() {
|
|
2202
|
+
console.log(this.timezone);
|
|
2203
|
+
let t = (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
2204
|
+
timeZone: this.timezone || "America/New_York"
|
|
2205
|
+
});
|
|
2206
|
+
if (console.log(t), console.log(t.split(" ")[2]), t.split(" ")[2] === "PM") {
|
|
2207
|
+
let l = t.split(" ");
|
|
2208
|
+
console.log(l), t = Number(l[1].split(":")[0]) + 12 + ":" + l[1].split(":")[1] + ":" + l[1].split(":")[2];
|
|
2209
|
+
} else
|
|
2210
|
+
t = t.split(" ")[1];
|
|
2211
|
+
return t;
|
|
2212
|
+
}
|
|
2213
|
+
setValue(t) {
|
|
2214
|
+
this.value = t, this._internals.setFormValue(t), this.requestUpdate();
|
|
2215
|
+
}
|
|
2216
|
+
setError(t) {
|
|
2217
|
+
if (typeof t != "error") {
|
|
2218
|
+
console.warn("Error text must be a string");
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
this.error = t, this._internals.setValidity({
|
|
2222
|
+
customError: t
|
|
2223
|
+
}), this.requestUpdate();
|
|
2215
2224
|
}
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2225
|
+
setDisabled(t) {
|
|
2226
|
+
this.disabled = t, this._internals.setValidity({
|
|
2227
|
+
customError: t
|
|
2228
|
+
}), this.requestUpdate();
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
function K() {
|
|
2232
|
+
typeof window < "u" && !customElements.get("cd-time") && customElements.define("cd-time", A);
|
|
2219
2233
|
}
|
|
2220
2234
|
export {
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2235
|
+
v as Button,
|
|
2236
|
+
S as DateComponent,
|
|
2237
|
+
b as Header,
|
|
2238
|
+
f as Input,
|
|
2225
2239
|
g as NavBar,
|
|
2226
2240
|
m as NavItem,
|
|
2227
2241
|
w as NavProfile,
|
|
@@ -2229,22 +2243,22 @@ export {
|
|
|
2229
2243
|
E as Tab,
|
|
2230
2244
|
z as TabContainer,
|
|
2231
2245
|
y as Table,
|
|
2232
|
-
|
|
2246
|
+
A as TimeComponent,
|
|
2233
2247
|
x as ToolTip,
|
|
2234
2248
|
k as Value,
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
+
d as registerButton,
|
|
2250
|
+
U as registerDate,
|
|
2251
|
+
T as registerHeader,
|
|
2252
|
+
q as registerInput,
|
|
2253
|
+
V as registerNavBar,
|
|
2254
|
+
I as registerNavItem,
|
|
2255
|
+
L as registerNavProfile,
|
|
2256
|
+
N as registerSearch,
|
|
2257
|
+
G as registerTab,
|
|
2258
|
+
F as registerTabContainer,
|
|
2259
|
+
D as registerTable,
|
|
2260
|
+
K as registerTime,
|
|
2261
|
+
R as registerToolTip,
|
|
2262
|
+
P as registerValue
|
|
2249
2263
|
};
|
|
2250
2264
|
//# sourceMappingURL=index.es.js.map
|