@voidable/ui 0.3.0 → 0.4.0
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/dist/index.d.ts +251 -0
- package/dist/ui.js +1109 -201
- package/package.json +1 -1
package/dist/ui.js
CHANGED
|
@@ -347,7 +347,7 @@ s([r({
|
|
|
347
347
|
})], h.prototype, "indeterminate", void 0), customElements.get("void-progress") || customElements.define("void-progress", h);
|
|
348
348
|
//#endregion
|
|
349
349
|
//#region src/components/panel.ts
|
|
350
|
-
var
|
|
350
|
+
var re = class extends o {
|
|
351
351
|
constructor(...e) {
|
|
352
352
|
super(...e), this.label = "", this.variant = "default", this._userContent = [], this._didSetup = !1;
|
|
353
353
|
}
|
|
@@ -367,13 +367,13 @@ var g = class extends o {
|
|
|
367
367
|
s([r({
|
|
368
368
|
type: String,
|
|
369
369
|
reflect: !0
|
|
370
|
-
})],
|
|
370
|
+
})], re.prototype, "label", void 0), s([r({
|
|
371
371
|
type: String,
|
|
372
372
|
reflect: !0
|
|
373
|
-
})],
|
|
373
|
+
})], re.prototype, "variant", void 0), customElements.get("void-panel") || customElements.define("void-panel", re);
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region src/components/input.ts
|
|
376
|
-
var
|
|
376
|
+
var g = class extends o {
|
|
377
377
|
constructor(...e) {
|
|
378
378
|
super(...e), this.type = "text", this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.size = "md", this.error = "";
|
|
379
379
|
}
|
|
@@ -417,31 +417,31 @@ var _ = class extends o {
|
|
|
417
417
|
s([r({
|
|
418
418
|
type: String,
|
|
419
419
|
reflect: !0
|
|
420
|
-
})],
|
|
420
|
+
})], g.prototype, "type", void 0), s([r({ type: String })], g.prototype, "value", void 0), s([r({
|
|
421
421
|
type: String,
|
|
422
422
|
reflect: !0
|
|
423
|
-
})],
|
|
423
|
+
})], g.prototype, "placeholder", void 0), s([r({
|
|
424
424
|
type: Boolean,
|
|
425
425
|
reflect: !0
|
|
426
|
-
})],
|
|
426
|
+
})], g.prototype, "disabled", void 0), s([r({
|
|
427
427
|
type: Boolean,
|
|
428
428
|
reflect: !0
|
|
429
|
-
})],
|
|
429
|
+
})], g.prototype, "readonly", void 0), s([r({
|
|
430
430
|
type: Boolean,
|
|
431
431
|
reflect: !0
|
|
432
|
-
})],
|
|
432
|
+
})], g.prototype, "required", void 0), s([r({
|
|
433
433
|
type: String,
|
|
434
434
|
reflect: !0
|
|
435
|
-
})],
|
|
435
|
+
})], g.prototype, "name", void 0), s([r({
|
|
436
436
|
type: String,
|
|
437
437
|
reflect: !0
|
|
438
|
-
})],
|
|
438
|
+
})], g.prototype, "size", void 0), s([r({
|
|
439
439
|
type: String,
|
|
440
440
|
reflect: !0
|
|
441
|
-
})],
|
|
441
|
+
})], g.prototype, "error", void 0), customElements.get("void-input") || customElements.define("void-input", g);
|
|
442
442
|
//#endregion
|
|
443
443
|
//#region src/components/textarea.ts
|
|
444
|
-
var
|
|
444
|
+
var _ = class extends o {
|
|
445
445
|
constructor(...e) {
|
|
446
446
|
super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.rows = 3, this.resize = "vertical", this.size = "md", this.error = "";
|
|
447
447
|
}
|
|
@@ -483,37 +483,37 @@ var v = class extends o {
|
|
|
483
483
|
}));
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
|
-
s([r({ type: String })],
|
|
486
|
+
s([r({ type: String })], _.prototype, "value", void 0), s([r({
|
|
487
487
|
type: String,
|
|
488
488
|
reflect: !0
|
|
489
|
-
})],
|
|
489
|
+
})], _.prototype, "placeholder", void 0), s([r({
|
|
490
490
|
type: Boolean,
|
|
491
491
|
reflect: !0
|
|
492
|
-
})],
|
|
492
|
+
})], _.prototype, "disabled", void 0), s([r({
|
|
493
493
|
type: Boolean,
|
|
494
494
|
reflect: !0
|
|
495
|
-
})],
|
|
495
|
+
})], _.prototype, "readonly", void 0), s([r({
|
|
496
496
|
type: Boolean,
|
|
497
497
|
reflect: !0
|
|
498
|
-
})],
|
|
498
|
+
})], _.prototype, "required", void 0), s([r({
|
|
499
499
|
type: String,
|
|
500
500
|
reflect: !0
|
|
501
|
-
})],
|
|
501
|
+
})], _.prototype, "name", void 0), s([r({
|
|
502
502
|
type: Number,
|
|
503
503
|
reflect: !0
|
|
504
|
-
})],
|
|
504
|
+
})], _.prototype, "rows", void 0), s([r({
|
|
505
505
|
type: String,
|
|
506
506
|
reflect: !0
|
|
507
|
-
})],
|
|
507
|
+
})], _.prototype, "resize", void 0), s([r({
|
|
508
508
|
type: String,
|
|
509
509
|
reflect: !0
|
|
510
|
-
})],
|
|
510
|
+
})], _.prototype, "size", void 0), s([r({
|
|
511
511
|
type: String,
|
|
512
512
|
reflect: !0
|
|
513
|
-
})],
|
|
513
|
+
})], _.prototype, "error", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", _);
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region src/components/select.ts
|
|
516
|
-
var
|
|
516
|
+
var v = class extends o {
|
|
517
517
|
constructor(...e) {
|
|
518
518
|
super(...e), this.value = "", this.disabled = !1, this.required = !1, this.name = "", this.size = "md", this.error = "", this.placeholder = "", this._options = [], this._didSetup = !1;
|
|
519
519
|
}
|
|
@@ -551,28 +551,28 @@ var y = class extends o {
|
|
|
551
551
|
}));
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
|
-
s([r({ type: String })],
|
|
554
|
+
s([r({ type: String })], v.prototype, "value", void 0), s([r({
|
|
555
555
|
type: Boolean,
|
|
556
556
|
reflect: !0
|
|
557
|
-
})],
|
|
557
|
+
})], v.prototype, "disabled", void 0), s([r({
|
|
558
558
|
type: Boolean,
|
|
559
559
|
reflect: !0
|
|
560
|
-
})],
|
|
560
|
+
})], v.prototype, "required", void 0), s([r({
|
|
561
561
|
type: String,
|
|
562
562
|
reflect: !0
|
|
563
|
-
})],
|
|
563
|
+
})], v.prototype, "name", void 0), s([r({
|
|
564
564
|
type: String,
|
|
565
565
|
reflect: !0
|
|
566
|
-
})],
|
|
566
|
+
})], v.prototype, "size", void 0), s([r({
|
|
567
567
|
type: String,
|
|
568
568
|
reflect: !0
|
|
569
|
-
})],
|
|
569
|
+
})], v.prototype, "error", void 0), s([r({
|
|
570
570
|
type: String,
|
|
571
571
|
reflect: !0
|
|
572
|
-
})],
|
|
572
|
+
})], v.prototype, "placeholder", void 0), customElements.get("void-select") || customElements.define("void-select", v);
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region src/components/checkbox.ts
|
|
575
|
-
var
|
|
575
|
+
var y = class extends o {
|
|
576
576
|
constructor(...e) {
|
|
577
577
|
super(...e), this.checked = !1, this.disabled = !1, this.indeterminate = !1, this.name = "", this.value = "", this.color = "default", this.size = "md", this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
|
|
578
578
|
if (this.disabled) {
|
|
@@ -615,28 +615,28 @@ var b = class extends o {
|
|
|
615
615
|
s([r({
|
|
616
616
|
type: Boolean,
|
|
617
617
|
reflect: !0
|
|
618
|
-
})],
|
|
618
|
+
})], y.prototype, "checked", void 0), s([r({
|
|
619
619
|
type: Boolean,
|
|
620
620
|
reflect: !0
|
|
621
|
-
})],
|
|
621
|
+
})], y.prototype, "disabled", void 0), s([r({
|
|
622
622
|
type: Boolean,
|
|
623
623
|
reflect: !0
|
|
624
|
-
})],
|
|
624
|
+
})], y.prototype, "indeterminate", void 0), s([r({
|
|
625
625
|
type: String,
|
|
626
626
|
reflect: !0
|
|
627
|
-
})],
|
|
627
|
+
})], y.prototype, "name", void 0), s([r({
|
|
628
628
|
type: String,
|
|
629
629
|
reflect: !0
|
|
630
|
-
})],
|
|
630
|
+
})], y.prototype, "value", void 0), s([r({
|
|
631
631
|
type: String,
|
|
632
632
|
reflect: !0
|
|
633
|
-
})],
|
|
633
|
+
})], y.prototype, "color", void 0), s([r({
|
|
634
634
|
type: String,
|
|
635
635
|
reflect: !0
|
|
636
|
-
})],
|
|
636
|
+
})], y.prototype, "size", void 0), customElements.get("void-checkbox") || customElements.define("void-checkbox", y);
|
|
637
637
|
//#endregion
|
|
638
638
|
//#region src/components/radio.ts
|
|
639
|
-
var
|
|
639
|
+
var b = class extends o {
|
|
640
640
|
constructor(...e) {
|
|
641
641
|
super(...e), this.checked = !1, this.disabled = !1, this.name = "", this.value = "", this.color = "default", this.size = "md", this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
|
|
642
642
|
if (this.disabled || this.checked) {
|
|
@@ -681,25 +681,25 @@ var x = class extends o {
|
|
|
681
681
|
s([r({
|
|
682
682
|
type: Boolean,
|
|
683
683
|
reflect: !0
|
|
684
|
-
})],
|
|
684
|
+
})], b.prototype, "checked", void 0), s([r({
|
|
685
685
|
type: Boolean,
|
|
686
686
|
reflect: !0
|
|
687
|
-
})],
|
|
687
|
+
})], b.prototype, "disabled", void 0), s([r({
|
|
688
688
|
type: String,
|
|
689
689
|
reflect: !0
|
|
690
|
-
})],
|
|
690
|
+
})], b.prototype, "name", void 0), s([r({
|
|
691
691
|
type: String,
|
|
692
692
|
reflect: !0
|
|
693
|
-
})],
|
|
693
|
+
})], b.prototype, "value", void 0), s([r({
|
|
694
694
|
type: String,
|
|
695
695
|
reflect: !0
|
|
696
|
-
})],
|
|
696
|
+
})], b.prototype, "color", void 0), s([r({
|
|
697
697
|
type: String,
|
|
698
698
|
reflect: !0
|
|
699
|
-
})],
|
|
699
|
+
})], b.prototype, "size", void 0), customElements.get("void-radio") || customElements.define("void-radio", b);
|
|
700
700
|
//#endregion
|
|
701
701
|
//#region src/components/radio-group.ts
|
|
702
|
-
var
|
|
702
|
+
var x = class extends o {
|
|
703
703
|
constructor(...e) {
|
|
704
704
|
super(...e), this.label = "", this.value = "", this.name = "", this.orientation = "vertical", this._userContent = [], this._didSetup = !1, this._handleChildChange = (e) => {
|
|
705
705
|
let t = e.target;
|
|
@@ -744,13 +744,13 @@ var S = class extends o {
|
|
|
744
744
|
`;
|
|
745
745
|
}
|
|
746
746
|
};
|
|
747
|
-
s([r({ type: String })],
|
|
747
|
+
s([r({ type: String })], x.prototype, "label", void 0), s([r({ type: String })], x.prototype, "value", void 0), s([r({ type: String })], x.prototype, "name", void 0), s([r({
|
|
748
748
|
type: String,
|
|
749
749
|
reflect: !0
|
|
750
|
-
})],
|
|
750
|
+
})], x.prototype, "orientation", void 0), customElements.get("void-radio-group") || customElements.define("void-radio-group", x);
|
|
751
751
|
//#endregion
|
|
752
752
|
//#region src/components/field.ts
|
|
753
|
-
var
|
|
753
|
+
var S = class extends o {
|
|
754
754
|
constructor(...e) {
|
|
755
755
|
super(...e), this.label = "", this.error = "", this.helper = "", this.required = !1, this._userContent = [], this._didSetup = !1;
|
|
756
756
|
}
|
|
@@ -775,19 +775,19 @@ var C = class extends o {
|
|
|
775
775
|
s([r({
|
|
776
776
|
type: String,
|
|
777
777
|
reflect: !0
|
|
778
|
-
})],
|
|
778
|
+
})], S.prototype, "label", void 0), s([r({
|
|
779
779
|
type: String,
|
|
780
780
|
reflect: !0
|
|
781
|
-
})],
|
|
781
|
+
})], S.prototype, "error", void 0), s([r({
|
|
782
782
|
type: String,
|
|
783
783
|
reflect: !0
|
|
784
|
-
})],
|
|
784
|
+
})], S.prototype, "helper", void 0), s([r({
|
|
785
785
|
type: Boolean,
|
|
786
786
|
reflect: !0
|
|
787
|
-
})],
|
|
787
|
+
})], S.prototype, "required", void 0), customElements.get("void-field") || customElements.define("void-field", S);
|
|
788
788
|
//#endregion
|
|
789
789
|
//#region src/components/multiselect.ts
|
|
790
|
-
var
|
|
790
|
+
var ie = class extends o {
|
|
791
791
|
constructor(...e) {
|
|
792
792
|
super(...e), this.value = "", this.selected = !1;
|
|
793
793
|
}
|
|
@@ -795,11 +795,11 @@ var w = class extends o {
|
|
|
795
795
|
s([r({
|
|
796
796
|
type: String,
|
|
797
797
|
reflect: !0
|
|
798
|
-
})],
|
|
798
|
+
})], ie.prototype, "value", void 0), s([r({
|
|
799
799
|
type: Boolean,
|
|
800
800
|
reflect: !0
|
|
801
|
-
})],
|
|
802
|
-
var
|
|
801
|
+
})], ie.prototype, "selected", void 0), customElements.get("void-option") || customElements.define("void-option", ie);
|
|
802
|
+
var C = class extends o {
|
|
803
803
|
constructor(...e) {
|
|
804
804
|
super(...e), this.placeholder = "Select...", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this._open = !1, this._options = [], this._didSetup = !1, this._onTriggerClick = (e) => {
|
|
805
805
|
this.disabled || (e.stopPropagation(), this._open = !this._open, this.requestUpdate());
|
|
@@ -884,22 +884,22 @@ var T = class extends o {
|
|
|
884
884
|
}));
|
|
885
885
|
}
|
|
886
886
|
};
|
|
887
|
-
s([r({ type: String })],
|
|
887
|
+
s([r({ type: String })], C.prototype, "placeholder", void 0), s([r({
|
|
888
888
|
type: Boolean,
|
|
889
889
|
reflect: !0
|
|
890
|
-
})],
|
|
890
|
+
})], C.prototype, "disabled", void 0), s([r({
|
|
891
891
|
type: String,
|
|
892
892
|
reflect: !0
|
|
893
|
-
})],
|
|
893
|
+
})], C.prototype, "size", void 0), s([r({
|
|
894
894
|
type: String,
|
|
895
895
|
reflect: !0
|
|
896
|
-
})],
|
|
896
|
+
})], C.prototype, "error", void 0), s([r({
|
|
897
897
|
type: String,
|
|
898
898
|
reflect: !0
|
|
899
|
-
})],
|
|
899
|
+
})], C.prototype, "name", void 0), customElements.get("void-multiselect") || customElements.define("void-multiselect", C);
|
|
900
900
|
//#endregion
|
|
901
901
|
//#region src/components/dialog.ts
|
|
902
|
-
var
|
|
902
|
+
var w = class extends o {
|
|
903
903
|
constructor(...e) {
|
|
904
904
|
super(...e), this.open = !1, this.heading = "", this.size = "md", this.closable = !0, this._userContent = [], this._didSetup = !1, this._handleKeydown = (e) => {
|
|
905
905
|
e.key === "Escape" && this.closable && this._close();
|
|
@@ -950,13 +950,13 @@ var E = class extends o {
|
|
|
950
950
|
s([r({
|
|
951
951
|
type: Boolean,
|
|
952
952
|
reflect: !0
|
|
953
|
-
})],
|
|
953
|
+
})], w.prototype, "open", void 0), s([r({ type: String })], w.prototype, "heading", void 0), s([r({
|
|
954
954
|
type: String,
|
|
955
955
|
reflect: !0
|
|
956
|
-
})],
|
|
956
|
+
})], w.prototype, "size", void 0), s([r({ type: Boolean })], w.prototype, "closable", void 0), customElements.get("void-dialog") || customElements.define("void-dialog", w);
|
|
957
957
|
//#endregion
|
|
958
958
|
//#region src/components/tabs.ts
|
|
959
|
-
var
|
|
959
|
+
var ae = class extends o {
|
|
960
960
|
constructor(...e) {
|
|
961
961
|
super(...e), this.tab = "", this.label = "", this.active = !1;
|
|
962
962
|
}
|
|
@@ -970,14 +970,14 @@ var D = class extends o {
|
|
|
970
970
|
s([r({
|
|
971
971
|
type: String,
|
|
972
972
|
reflect: !0
|
|
973
|
-
})],
|
|
973
|
+
})], ae.prototype, "tab", void 0), s([r({
|
|
974
974
|
type: String,
|
|
975
975
|
reflect: !0
|
|
976
|
-
})],
|
|
976
|
+
})], ae.prototype, "label", void 0), s([r({
|
|
977
977
|
type: Boolean,
|
|
978
978
|
reflect: !0
|
|
979
|
-
})],
|
|
980
|
-
var
|
|
979
|
+
})], ae.prototype, "active", void 0), customElements.get("void-tab-panel") || customElements.define("void-tab-panel", ae);
|
|
980
|
+
var oe = class extends o {
|
|
981
981
|
constructor(...e) {
|
|
982
982
|
super(...e), this.value = "", this.size = "md", this._panels = [];
|
|
983
983
|
}
|
|
@@ -1020,13 +1020,13 @@ var O = class extends o {
|
|
|
1020
1020
|
e.key === "ArrowRight" ? (e.preventDefault(), n[(t + 1) % n.length].focus()) : e.key === "ArrowLeft" && (e.preventDefault(), n[(t - 1 + n.length) % n.length].focus());
|
|
1021
1021
|
}
|
|
1022
1022
|
};
|
|
1023
|
-
s([r({ type: String })],
|
|
1023
|
+
s([r({ type: String })], oe.prototype, "value", void 0), s([r({
|
|
1024
1024
|
type: String,
|
|
1025
1025
|
reflect: !0
|
|
1026
|
-
})],
|
|
1026
|
+
})], oe.prototype, "size", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", oe);
|
|
1027
1027
|
//#endregion
|
|
1028
1028
|
//#region src/components/accordion.ts
|
|
1029
|
-
var
|
|
1029
|
+
var se = class extends o {
|
|
1030
1030
|
constructor(...e) {
|
|
1031
1031
|
super(...e), this.multiple = !1;
|
|
1032
1032
|
}
|
|
@@ -1034,13 +1034,13 @@ var k = class extends o {
|
|
|
1034
1034
|
s([r({
|
|
1035
1035
|
type: Boolean,
|
|
1036
1036
|
reflect: !0
|
|
1037
|
-
})],
|
|
1038
|
-
var
|
|
1037
|
+
})], se.prototype, "multiple", void 0), customElements.get("void-accordion") || customElements.define("void-accordion", se);
|
|
1038
|
+
var ce = class extends o {
|
|
1039
1039
|
constructor(...e) {
|
|
1040
1040
|
super(...e), this.heading = "", this.open = !1, this._id = Math.random().toString(36).slice(2), this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
|
|
1041
1041
|
e.preventDefault(), this.open = !this.open;
|
|
1042
1042
|
let t = this.parentElement;
|
|
1043
|
-
if (t instanceof
|
|
1043
|
+
if (t instanceof se && !t.multiple) {
|
|
1044
1044
|
let e = Array.from(t.querySelectorAll("void-accordion-item"));
|
|
1045
1045
|
for (let t of e) t !== this && (t.open = !1);
|
|
1046
1046
|
}
|
|
@@ -1087,13 +1087,13 @@ var A = class extends o {
|
|
|
1087
1087
|
`;
|
|
1088
1088
|
}
|
|
1089
1089
|
};
|
|
1090
|
-
s([r({ type: String })],
|
|
1090
|
+
s([r({ type: String })], ce.prototype, "heading", void 0), s([r({
|
|
1091
1091
|
type: Boolean,
|
|
1092
1092
|
reflect: !0
|
|
1093
|
-
})],
|
|
1093
|
+
})], ce.prototype, "open", void 0), customElements.get("void-accordion-item") || customElements.define("void-accordion-item", ce);
|
|
1094
1094
|
//#endregion
|
|
1095
1095
|
//#region src/components/breadcrumbs.ts
|
|
1096
|
-
var
|
|
1096
|
+
var le = class extends o {
|
|
1097
1097
|
constructor(...e) {
|
|
1098
1098
|
super(...e), this.separator = "/", this._items = [], this._didSetup = !1;
|
|
1099
1099
|
}
|
|
@@ -1118,10 +1118,10 @@ var re = class extends o {
|
|
|
1118
1118
|
return t`<ol class="void-breadcrumbs-list"></ol>`;
|
|
1119
1119
|
}
|
|
1120
1120
|
};
|
|
1121
|
-
s([r({ type: String })],
|
|
1121
|
+
s([r({ type: String })], le.prototype, "separator", void 0), customElements.get("void-breadcrumbs") || customElements.define("void-breadcrumbs", le);
|
|
1122
1122
|
//#endregion
|
|
1123
1123
|
//#region src/components/list.ts
|
|
1124
|
-
var
|
|
1124
|
+
var ue = class extends o {
|
|
1125
1125
|
constructor(...e) {
|
|
1126
1126
|
super(...e), this.dividers = !1;
|
|
1127
1127
|
}
|
|
@@ -1132,8 +1132,8 @@ var ie = class extends o {
|
|
|
1132
1132
|
s([r({
|
|
1133
1133
|
type: Boolean,
|
|
1134
1134
|
reflect: !0
|
|
1135
|
-
})],
|
|
1136
|
-
var
|
|
1135
|
+
})], ue.prototype, "dividers", void 0), customElements.get("void-list") || customElements.define("void-list", ue);
|
|
1136
|
+
var T = class extends o {
|
|
1137
1137
|
constructor(...e) {
|
|
1138
1138
|
super(...e), this.selected = !1, this.disabled = !1, this.interactive = !1, this._handleClick = () => {
|
|
1139
1139
|
this.disabled || this.dispatchEvent(new CustomEvent("void-click", {
|
|
@@ -1153,16 +1153,16 @@ var j = class extends o {
|
|
|
1153
1153
|
s([r({
|
|
1154
1154
|
type: Boolean,
|
|
1155
1155
|
reflect: !0
|
|
1156
|
-
})],
|
|
1156
|
+
})], T.prototype, "selected", void 0), s([r({
|
|
1157
1157
|
type: Boolean,
|
|
1158
1158
|
reflect: !0
|
|
1159
|
-
})],
|
|
1159
|
+
})], T.prototype, "disabled", void 0), s([r({
|
|
1160
1160
|
type: Boolean,
|
|
1161
1161
|
reflect: !0
|
|
1162
|
-
})],
|
|
1162
|
+
})], T.prototype, "interactive", void 0), customElements.get("void-list-item") || customElements.define("void-list-item", T);
|
|
1163
1163
|
//#endregion
|
|
1164
1164
|
//#region src/components/toast.ts
|
|
1165
|
-
var
|
|
1165
|
+
var E = class extends o {
|
|
1166
1166
|
constructor(...e) {
|
|
1167
1167
|
super(...e), this.color = "default", this.duration = 5e3, this.dismissable = !0, this.heading = "";
|
|
1168
1168
|
}
|
|
@@ -1188,11 +1188,11 @@ var M = class extends o {
|
|
|
1188
1188
|
s([r({
|
|
1189
1189
|
type: String,
|
|
1190
1190
|
reflect: !0
|
|
1191
|
-
})],
|
|
1191
|
+
})], E.prototype, "color", void 0), s([r({ type: Number })], E.prototype, "duration", void 0), s([r({
|
|
1192
1192
|
type: Boolean,
|
|
1193
1193
|
reflect: !0
|
|
1194
|
-
})],
|
|
1195
|
-
var
|
|
1194
|
+
})], E.prototype, "dismissable", void 0), s([r({ type: String })], E.prototype, "heading", void 0), customElements.get("void-toast") || customElements.define("void-toast", E);
|
|
1195
|
+
var de = class extends o {
|
|
1196
1196
|
constructor(...e) {
|
|
1197
1197
|
super(...e), this.position = "bottom-right";
|
|
1198
1198
|
}
|
|
@@ -1209,10 +1209,10 @@ var ae = class extends o {
|
|
|
1209
1209
|
s([r({
|
|
1210
1210
|
type: String,
|
|
1211
1211
|
reflect: !0
|
|
1212
|
-
})],
|
|
1212
|
+
})], de.prototype, "position", void 0), customElements.get("void-toast-container") || customElements.define("void-toast-container", de);
|
|
1213
1213
|
//#endregion
|
|
1214
1214
|
//#region src/components/stepper.ts
|
|
1215
|
-
var
|
|
1215
|
+
var fe = class extends o {
|
|
1216
1216
|
constructor(...e) {
|
|
1217
1217
|
super(...e), this.value = 0, this.steps = "";
|
|
1218
1218
|
}
|
|
@@ -1249,10 +1249,10 @@ var N = class extends o {
|
|
|
1249
1249
|
s([r({
|
|
1250
1250
|
type: Number,
|
|
1251
1251
|
reflect: !0
|
|
1252
|
-
})],
|
|
1252
|
+
})], fe.prototype, "value", void 0), s([r({ reflect: !0 })], fe.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", fe);
|
|
1253
1253
|
//#endregion
|
|
1254
1254
|
//#region src/components/drawer.ts
|
|
1255
|
-
var
|
|
1255
|
+
var D = class extends o {
|
|
1256
1256
|
constructor(...e) {
|
|
1257
1257
|
super(...e), this.open = !1, this.side = "right", this.size = "md", this.heading = "", this.closable = !0, this._userContent = [], this._didSetup = !1, this._handleKeydown = (e) => {
|
|
1258
1258
|
e.key === "Escape" && this.open && this.closable && this._close();
|
|
@@ -1297,19 +1297,19 @@ var P = class extends o {
|
|
|
1297
1297
|
s([r({
|
|
1298
1298
|
type: Boolean,
|
|
1299
1299
|
reflect: !0
|
|
1300
|
-
})],
|
|
1300
|
+
})], D.prototype, "open", void 0), s([r({
|
|
1301
1301
|
type: String,
|
|
1302
1302
|
reflect: !0
|
|
1303
|
-
})],
|
|
1303
|
+
})], D.prototype, "side", void 0), s([r({
|
|
1304
1304
|
type: String,
|
|
1305
1305
|
reflect: !0
|
|
1306
|
-
})],
|
|
1306
|
+
})], D.prototype, "size", void 0), s([r({ type: String })], D.prototype, "heading", void 0), s([r({
|
|
1307
1307
|
type: Boolean,
|
|
1308
1308
|
reflect: !0
|
|
1309
|
-
})],
|
|
1309
|
+
})], D.prototype, "closable", void 0), customElements.get("void-drawer") || customElements.define("void-drawer", D);
|
|
1310
1310
|
//#endregion
|
|
1311
1311
|
//#region src/components/card.ts
|
|
1312
|
-
var
|
|
1312
|
+
var O = class extends o {
|
|
1313
1313
|
constructor(...e) {
|
|
1314
1314
|
super(...e), this.heading = "", this.variant = "default", this.padding = "md", this._userContent = [], this._didSetup = !1;
|
|
1315
1315
|
}
|
|
@@ -1327,16 +1327,16 @@ var F = class extends o {
|
|
|
1327
1327
|
return t`${this.heading ? t`<div class="void-card-header"><span class="void-card-heading">${this.heading}</span></div>` : n}<div class="void-card-body"></div>`;
|
|
1328
1328
|
}
|
|
1329
1329
|
};
|
|
1330
|
-
s([r({ type: String })],
|
|
1330
|
+
s([r({ type: String })], O.prototype, "heading", void 0), s([r({
|
|
1331
1331
|
type: String,
|
|
1332
1332
|
reflect: !0
|
|
1333
|
-
})],
|
|
1333
|
+
})], O.prototype, "variant", void 0), s([r({
|
|
1334
1334
|
type: String,
|
|
1335
1335
|
reflect: !0
|
|
1336
|
-
})],
|
|
1336
|
+
})], O.prototype, "padding", void 0), customElements.get("void-card") || customElements.define("void-card", O);
|
|
1337
1337
|
//#endregion
|
|
1338
1338
|
//#region src/components/popover.ts
|
|
1339
|
-
var
|
|
1339
|
+
var k = class extends o {
|
|
1340
1340
|
constructor(...e) {
|
|
1341
1341
|
super(...e), this.open = !1, this.position = "bottom", this.trigger = "click", this._triggerEl = null, this._contentNodes = [], this._didSetup = !1, this._handleTriggerClick = () => {
|
|
1342
1342
|
this.open = !this.open, this.open || this._dispatchClose();
|
|
@@ -1375,16 +1375,16 @@ var I = class extends o {
|
|
|
1375
1375
|
s([r({
|
|
1376
1376
|
type: Boolean,
|
|
1377
1377
|
reflect: !0
|
|
1378
|
-
})],
|
|
1378
|
+
})], k.prototype, "open", void 0), s([r({
|
|
1379
1379
|
type: String,
|
|
1380
1380
|
reflect: !0
|
|
1381
|
-
})],
|
|
1381
|
+
})], k.prototype, "position", void 0), s([r({
|
|
1382
1382
|
type: String,
|
|
1383
1383
|
reflect: !0
|
|
1384
|
-
})],
|
|
1384
|
+
})], k.prototype, "trigger", void 0), customElements.get("void-popover") || customElements.define("void-popover", k);
|
|
1385
1385
|
//#endregion
|
|
1386
1386
|
//#region src/components/tooltip.ts
|
|
1387
|
-
var
|
|
1387
|
+
var A = class extends o {
|
|
1388
1388
|
constructor(...e) {
|
|
1389
1389
|
super(...e), this.text = "", this.position = "top", this.delay = 200, this._visible = !1, this._tooltipId = "void-tooltip-" + Math.random().toString(36).slice(2), this._userContent = [], this._didSetup = !1, this._onMouseEnter = () => {
|
|
1390
1390
|
clearTimeout(this._timerId), this._timerId = setTimeout(() => {
|
|
@@ -1418,13 +1418,13 @@ var L = class extends o {
|
|
|
1418
1418
|
return t`<span id="${this._tooltipId}" class="void-tooltip-bubble" role="tooltip" aria-label=${this.text}>${this.text}</span>`;
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
|
-
s([r({ type: String })],
|
|
1421
|
+
s([r({ type: String })], A.prototype, "text", void 0), s([r({
|
|
1422
1422
|
type: String,
|
|
1423
1423
|
reflect: !0
|
|
1424
|
-
})],
|
|
1424
|
+
})], A.prototype, "position", void 0), s([r({ type: Number })], A.prototype, "delay", void 0), s([a()], A.prototype, "_visible", void 0), customElements.get("void-tooltip") || customElements.define("void-tooltip", A);
|
|
1425
1425
|
//#endregion
|
|
1426
1426
|
//#region src/components/banner.ts
|
|
1427
|
-
var
|
|
1427
|
+
var j = class extends o {
|
|
1428
1428
|
constructor(...e) {
|
|
1429
1429
|
super(...e), this.color = "default", this.dismissable = !1, this.variant = "subtle", this._userContent = [], this._didSetup = !1;
|
|
1430
1430
|
}
|
|
@@ -1450,16 +1450,16 @@ var R = class extends o {
|
|
|
1450
1450
|
s([r({
|
|
1451
1451
|
type: String,
|
|
1452
1452
|
reflect: !0
|
|
1453
|
-
})],
|
|
1453
|
+
})], j.prototype, "color", void 0), s([r({
|
|
1454
1454
|
type: Boolean,
|
|
1455
1455
|
reflect: !0
|
|
1456
|
-
})],
|
|
1456
|
+
})], j.prototype, "dismissable", void 0), s([r({
|
|
1457
1457
|
type: String,
|
|
1458
1458
|
reflect: !0
|
|
1459
|
-
})],
|
|
1459
|
+
})], j.prototype, "variant", void 0), customElements.get("void-banner") || customElements.define("void-banner", j);
|
|
1460
1460
|
//#endregion
|
|
1461
1461
|
//#region src/components/scroll-area.ts
|
|
1462
|
-
var
|
|
1462
|
+
var pe = class extends o {
|
|
1463
1463
|
constructor(...e) {
|
|
1464
1464
|
super(...e), this.maxHeight = "", this.direction = "vertical", this._userContent = [], this._didSetup = !1;
|
|
1465
1465
|
}
|
|
@@ -1478,13 +1478,13 @@ var z = class extends o {
|
|
|
1478
1478
|
return t`<div class="void-scroll-area-viewport"></div>`;
|
|
1479
1479
|
}
|
|
1480
1480
|
};
|
|
1481
|
-
s([r({ type: String })],
|
|
1481
|
+
s([r({ type: String })], pe.prototype, "maxHeight", void 0), s([r({
|
|
1482
1482
|
type: String,
|
|
1483
1483
|
reflect: !0
|
|
1484
|
-
})],
|
|
1484
|
+
})], pe.prototype, "direction", void 0), customElements.get("void-scroll-area") || customElements.define("void-scroll-area", pe);
|
|
1485
1485
|
//#endregion
|
|
1486
1486
|
//#region src/components/table.ts
|
|
1487
|
-
var
|
|
1487
|
+
var M = class extends o {
|
|
1488
1488
|
constructor(...e) {
|
|
1489
1489
|
super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1;
|
|
1490
1490
|
}
|
|
@@ -1492,19 +1492,19 @@ var B = class extends o {
|
|
|
1492
1492
|
s([r({
|
|
1493
1493
|
type: Boolean,
|
|
1494
1494
|
reflect: !0
|
|
1495
|
-
})],
|
|
1495
|
+
})], M.prototype, "striped", void 0), s([r({
|
|
1496
1496
|
type: Boolean,
|
|
1497
1497
|
reflect: !0
|
|
1498
|
-
})],
|
|
1498
|
+
})], M.prototype, "hoverable", void 0), s([r({
|
|
1499
1499
|
type: Boolean,
|
|
1500
1500
|
reflect: !0
|
|
1501
|
-
})],
|
|
1501
|
+
})], M.prototype, "compact", void 0), s([r({
|
|
1502
1502
|
type: Boolean,
|
|
1503
1503
|
reflect: !0
|
|
1504
|
-
})],
|
|
1504
|
+
})], M.prototype, "bordered", void 0), customElements.get("void-table") || customElements.define("void-table", M);
|
|
1505
1505
|
//#endregion
|
|
1506
1506
|
//#region src/components/pagination.ts
|
|
1507
|
-
var
|
|
1507
|
+
var N = class extends o {
|
|
1508
1508
|
constructor(...e) {
|
|
1509
1509
|
super(...e), this.total = 1, this.value = 1, this.siblings = 1, this.size = "md";
|
|
1510
1510
|
}
|
|
@@ -1549,16 +1549,16 @@ var V = class extends o {
|
|
|
1549
1549
|
`;
|
|
1550
1550
|
}
|
|
1551
1551
|
};
|
|
1552
|
-
s([r({ type: Number })],
|
|
1552
|
+
s([r({ type: Number })], N.prototype, "total", void 0), s([r({
|
|
1553
1553
|
type: Number,
|
|
1554
1554
|
reflect: !0
|
|
1555
|
-
})],
|
|
1555
|
+
})], N.prototype, "value", void 0), s([r({ type: Number })], N.prototype, "siblings", void 0), s([r({
|
|
1556
1556
|
type: String,
|
|
1557
1557
|
reflect: !0
|
|
1558
|
-
})],
|
|
1558
|
+
})], N.prototype, "size", void 0), customElements.get("void-pagination") || customElements.define("void-pagination", N);
|
|
1559
1559
|
//#endregion
|
|
1560
1560
|
//#region src/components/error-fallback.ts
|
|
1561
|
-
var
|
|
1561
|
+
var P = class extends o {
|
|
1562
1562
|
constructor(...e) {
|
|
1563
1563
|
super(...e), this.heading = "Something went wrong", this.message = "", this.retryable = !1, this.retryLabel = "Try again", this.icon = !0;
|
|
1564
1564
|
}
|
|
@@ -1582,13 +1582,13 @@ var H = class extends o {
|
|
|
1582
1582
|
`;
|
|
1583
1583
|
}
|
|
1584
1584
|
};
|
|
1585
|
-
s([r({ type: String })],
|
|
1585
|
+
s([r({ type: String })], P.prototype, "heading", void 0), s([r({ type: String })], P.prototype, "message", void 0), s([r({
|
|
1586
1586
|
type: Boolean,
|
|
1587
1587
|
reflect: !0
|
|
1588
|
-
})],
|
|
1588
|
+
})], P.prototype, "retryable", void 0), s([r({ type: String })], P.prototype, "retryLabel", void 0), s([r({ type: Boolean })], P.prototype, "icon", void 0), customElements.get("void-error-fallback") || customElements.define("void-error-fallback", P);
|
|
1589
1589
|
//#endregion
|
|
1590
1590
|
//#region src/components/checkbox-group.ts
|
|
1591
|
-
var
|
|
1591
|
+
var me = class extends o {
|
|
1592
1592
|
constructor(...e) {
|
|
1593
1593
|
super(...e), this.label = "", this.orientation = "vertical", this._userContent = [], this._didSetup = !1, this._handleChildChange = (e) => {
|
|
1594
1594
|
let t = e.target;
|
|
@@ -1625,13 +1625,13 @@ var U = class extends o {
|
|
|
1625
1625
|
s([r({
|
|
1626
1626
|
type: String,
|
|
1627
1627
|
reflect: !0
|
|
1628
|
-
})],
|
|
1628
|
+
})], me.prototype, "label", void 0), s([r({
|
|
1629
1629
|
type: String,
|
|
1630
1630
|
reflect: !0
|
|
1631
|
-
})],
|
|
1631
|
+
})], me.prototype, "orientation", void 0), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", me);
|
|
1632
1632
|
//#endregion
|
|
1633
1633
|
//#region src/components/combobox.ts
|
|
1634
|
-
var
|
|
1634
|
+
var F = class extends o {
|
|
1635
1635
|
constructor(...e) {
|
|
1636
1636
|
super(...e), this.value = "", this.placeholder = "Search...", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this._open = !1, this._query = "", this._options = [], this._onInputFocus = () => {
|
|
1637
1637
|
this.disabled || (this._open = !0, this._query = "", this.requestUpdate());
|
|
@@ -1700,22 +1700,22 @@ var W = class extends o {
|
|
|
1700
1700
|
}));
|
|
1701
1701
|
}
|
|
1702
1702
|
};
|
|
1703
|
-
s([r({ type: String })],
|
|
1703
|
+
s([r({ type: String })], F.prototype, "value", void 0), s([r({ type: String })], F.prototype, "placeholder", void 0), s([r({
|
|
1704
1704
|
type: Boolean,
|
|
1705
1705
|
reflect: !0
|
|
1706
|
-
})],
|
|
1706
|
+
})], F.prototype, "disabled", void 0), s([r({
|
|
1707
1707
|
type: String,
|
|
1708
1708
|
reflect: !0
|
|
1709
|
-
})],
|
|
1709
|
+
})], F.prototype, "size", void 0), s([r({
|
|
1710
1710
|
type: String,
|
|
1711
1711
|
reflect: !0
|
|
1712
|
-
})],
|
|
1712
|
+
})], F.prototype, "error", void 0), s([r({
|
|
1713
1713
|
type: String,
|
|
1714
1714
|
reflect: !0
|
|
1715
|
-
})],
|
|
1715
|
+
})], F.prototype, "name", void 0), customElements.get("void-combobox") || customElements.define("void-combobox", F);
|
|
1716
1716
|
//#endregion
|
|
1717
1717
|
//#region src/components/slider.ts
|
|
1718
|
-
var
|
|
1718
|
+
var I = class extends o {
|
|
1719
1719
|
constructor(...e) {
|
|
1720
1720
|
super(...e), this.value = 50, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.name = "", this.showValue = !1, this.size = "md";
|
|
1721
1721
|
}
|
|
@@ -1755,7 +1755,7 @@ var G = class extends o {
|
|
|
1755
1755
|
step=${this.step}
|
|
1756
1756
|
?disabled=${this.disabled}
|
|
1757
1757
|
name=${this.name}
|
|
1758
|
-
style="--fill: ${e}%"
|
|
1758
|
+
style="--void-slider-fill: ${e}%"
|
|
1759
1759
|
@input=${this._onInput}
|
|
1760
1760
|
@change=${this._onChange}
|
|
1761
1761
|
/>
|
|
@@ -1763,22 +1763,22 @@ var G = class extends o {
|
|
|
1763
1763
|
`;
|
|
1764
1764
|
}
|
|
1765
1765
|
};
|
|
1766
|
-
s([r({ type: Number })],
|
|
1766
|
+
s([r({ type: Number })], I.prototype, "value", void 0), s([r({ type: Number })], I.prototype, "min", void 0), s([r({ type: Number })], I.prototype, "max", void 0), s([r({ type: Number })], I.prototype, "step", void 0), s([r({
|
|
1767
1767
|
type: Boolean,
|
|
1768
1768
|
reflect: !0
|
|
1769
|
-
})],
|
|
1769
|
+
})], I.prototype, "disabled", void 0), s([r({
|
|
1770
1770
|
type: String,
|
|
1771
1771
|
reflect: !0
|
|
1772
|
-
})],
|
|
1772
|
+
})], I.prototype, "name", void 0), s([r({
|
|
1773
1773
|
type: Boolean,
|
|
1774
1774
|
reflect: !0
|
|
1775
|
-
})],
|
|
1775
|
+
})], I.prototype, "showValue", void 0), s([r({
|
|
1776
1776
|
type: String,
|
|
1777
1777
|
reflect: !0
|
|
1778
|
-
})],
|
|
1778
|
+
})], I.prototype, "size", void 0), customElements.get("void-slider") || customElements.define("void-slider", I);
|
|
1779
1779
|
//#endregion
|
|
1780
1780
|
//#region src/components/file-upload.ts
|
|
1781
|
-
var
|
|
1781
|
+
var L = class extends o {
|
|
1782
1782
|
constructor(...e) {
|
|
1783
1783
|
super(...e), this.accept = "", this.multiple = !1, this.disabled = !1, this.maxSize = 0, this.error = "", this._files = [], this._onDropzoneClick = () => {
|
|
1784
1784
|
this.disabled || this._input?.click();
|
|
@@ -1804,7 +1804,7 @@ var K = class extends o {
|
|
|
1804
1804
|
return t`
|
|
1805
1805
|
<input
|
|
1806
1806
|
type="file"
|
|
1807
|
-
|
|
1807
|
+
class="void-file-upload-input"
|
|
1808
1808
|
accept=${this.accept || n}
|
|
1809
1809
|
?multiple=${this.multiple}
|
|
1810
1810
|
?disabled=${this.disabled}
|
|
@@ -1859,19 +1859,19 @@ var K = class extends o {
|
|
|
1859
1859
|
}));
|
|
1860
1860
|
}
|
|
1861
1861
|
};
|
|
1862
|
-
s([r({ type: String })],
|
|
1862
|
+
s([r({ type: String })], L.prototype, "accept", void 0), s([r({
|
|
1863
1863
|
type: Boolean,
|
|
1864
1864
|
reflect: !0
|
|
1865
|
-
})],
|
|
1865
|
+
})], L.prototype, "multiple", void 0), s([r({
|
|
1866
1866
|
type: Boolean,
|
|
1867
1867
|
reflect: !0
|
|
1868
|
-
})],
|
|
1868
|
+
})], L.prototype, "disabled", void 0), s([r({ type: Number })], L.prototype, "maxSize", void 0), s([r({
|
|
1869
1869
|
type: String,
|
|
1870
1870
|
reflect: !0
|
|
1871
|
-
})],
|
|
1871
|
+
})], L.prototype, "error", void 0), customElements.get("void-file-upload") || customElements.define("void-file-upload", L);
|
|
1872
1872
|
//#endregion
|
|
1873
1873
|
//#region src/components/nav-bar.ts
|
|
1874
|
-
var
|
|
1874
|
+
var R = class extends o {
|
|
1875
1875
|
constructor(...e) {
|
|
1876
1876
|
super(...e), this.sticky = !1, this.bordered = !0, this.variant = "default", this._userContent = [], this._didSetup = !1;
|
|
1877
1877
|
}
|
|
@@ -1892,16 +1892,16 @@ var q = class extends o {
|
|
|
1892
1892
|
s([r({
|
|
1893
1893
|
type: Boolean,
|
|
1894
1894
|
reflect: !0
|
|
1895
|
-
})],
|
|
1895
|
+
})], R.prototype, "sticky", void 0), s([r({
|
|
1896
1896
|
type: Boolean,
|
|
1897
1897
|
reflect: !0
|
|
1898
|
-
})],
|
|
1898
|
+
})], R.prototype, "bordered", void 0), s([r({
|
|
1899
1899
|
type: String,
|
|
1900
1900
|
reflect: !0
|
|
1901
|
-
})],
|
|
1901
|
+
})], R.prototype, "variant", void 0), customElements.get("void-nav-bar") || customElements.define("void-nav-bar", R);
|
|
1902
1902
|
//#endregion
|
|
1903
1903
|
//#region src/components/hamburger.ts
|
|
1904
|
-
var
|
|
1904
|
+
var he = class extends o {
|
|
1905
1905
|
constructor(...e) {
|
|
1906
1906
|
super(...e), this.active = !1, this.size = "md", this._handleClick = () => {
|
|
1907
1907
|
this.active = !this.active, this.dispatchEvent(new CustomEvent("void-toggle", {
|
|
@@ -1935,13 +1935,13 @@ var oe = class extends o {
|
|
|
1935
1935
|
s([r({
|
|
1936
1936
|
type: Boolean,
|
|
1937
1937
|
reflect: !0
|
|
1938
|
-
})],
|
|
1938
|
+
})], he.prototype, "active", void 0), s([r({
|
|
1939
1939
|
type: String,
|
|
1940
1940
|
reflect: !0
|
|
1941
|
-
})],
|
|
1941
|
+
})], he.prototype, "size", void 0), customElements.get("void-hamburger") || customElements.define("void-hamburger", he);
|
|
1942
1942
|
//#endregion
|
|
1943
1943
|
//#region src/components/compose-input.ts
|
|
1944
|
-
var
|
|
1944
|
+
var z = class extends o {
|
|
1945
1945
|
constructor(...e) {
|
|
1946
1946
|
super(...e), this.value = "", this.placeholder = "Type a message...", this.disabled = !1, this.maxlength = 0;
|
|
1947
1947
|
}
|
|
@@ -1995,19 +1995,19 @@ var J = class extends o {
|
|
|
1995
1995
|
}));
|
|
1996
1996
|
}
|
|
1997
1997
|
};
|
|
1998
|
-
s([r({ type: String })],
|
|
1998
|
+
s([r({ type: String })], z.prototype, "value", void 0), s([r({
|
|
1999
1999
|
type: String,
|
|
2000
2000
|
reflect: !0
|
|
2001
|
-
})],
|
|
2001
|
+
})], z.prototype, "placeholder", void 0), s([r({
|
|
2002
2002
|
type: Boolean,
|
|
2003
2003
|
reflect: !0
|
|
2004
|
-
})],
|
|
2004
|
+
})], z.prototype, "disabled", void 0), s([r({
|
|
2005
2005
|
type: Number,
|
|
2006
2006
|
reflect: !0
|
|
2007
|
-
})],
|
|
2007
|
+
})], z.prototype, "maxlength", void 0), s([i(".void-compose-input-textarea")], z.prototype, "_textarea", void 0), customElements.get("void-compose-input") || customElements.define("void-compose-input", z);
|
|
2008
2008
|
//#endregion
|
|
2009
2009
|
//#region src/components/sidebar.ts
|
|
2010
|
-
var
|
|
2010
|
+
var B = class extends o {
|
|
2011
2011
|
constructor(...e) {
|
|
2012
2012
|
super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.position = "left";
|
|
2013
2013
|
}
|
|
@@ -2031,19 +2031,19 @@ var Y = class extends o {
|
|
|
2031
2031
|
s([r({
|
|
2032
2032
|
type: Boolean,
|
|
2033
2033
|
reflect: !0
|
|
2034
|
-
})],
|
|
2034
|
+
})], B.prototype, "collapsed", void 0), s([r({
|
|
2035
2035
|
type: String,
|
|
2036
2036
|
reflect: !0
|
|
2037
|
-
})],
|
|
2037
|
+
})], B.prototype, "width", void 0), s([r({
|
|
2038
2038
|
type: String,
|
|
2039
2039
|
reflect: !0
|
|
2040
|
-
})],
|
|
2040
|
+
})], B.prototype, "collapsedWidth", void 0), s([r({
|
|
2041
2041
|
type: String,
|
|
2042
2042
|
reflect: !0
|
|
2043
|
-
})],
|
|
2043
|
+
})], B.prototype, "position", void 0), customElements.get("void-sidebar") || customElements.define("void-sidebar", B);
|
|
2044
2044
|
//#endregion
|
|
2045
2045
|
//#region src/components/toggle.ts
|
|
2046
|
-
var
|
|
2046
|
+
var V = class extends o {
|
|
2047
2047
|
constructor(...e) {
|
|
2048
2048
|
super(...e), this.pressed = !1, this.disabled = !1, this.color = "default", this.size = "md", this.variant = "outline", this._handleClick = () => {
|
|
2049
2049
|
this.disabled || (this.pressed = !this.pressed, this.dispatchEvent(new CustomEvent("void-change", {
|
|
@@ -2068,22 +2068,98 @@ var X = class extends o {
|
|
|
2068
2068
|
s([r({
|
|
2069
2069
|
type: Boolean,
|
|
2070
2070
|
reflect: !0
|
|
2071
|
-
})],
|
|
2071
|
+
})], V.prototype, "pressed", void 0), s([r({
|
|
2072
2072
|
type: Boolean,
|
|
2073
2073
|
reflect: !0
|
|
2074
|
-
})],
|
|
2074
|
+
})], V.prototype, "disabled", void 0), s([r({
|
|
2075
2075
|
type: String,
|
|
2076
2076
|
reflect: !0
|
|
2077
|
-
})],
|
|
2077
|
+
})], V.prototype, "color", void 0), s([r({
|
|
2078
|
+
type: String,
|
|
2079
|
+
reflect: !0
|
|
2080
|
+
})], V.prototype, "size", void 0), s([r({
|
|
2081
|
+
type: String,
|
|
2082
|
+
reflect: !0
|
|
2083
|
+
})], V.prototype, "variant", void 0), customElements.get("void-toggle") || customElements.define("void-toggle", V);
|
|
2084
|
+
//#endregion
|
|
2085
|
+
//#region src/components/toggle-group.ts
|
|
2086
|
+
var H = class extends o {
|
|
2087
|
+
constructor(...e) {
|
|
2088
|
+
super(...e), this.value = "", this.multiple = !1, this.disabled = !1, this.size = "md", this.color = "default", this.orientation = "horizontal", this._handleChildChange = (e) => {
|
|
2089
|
+
let t = e.target.closest("void-toggle");
|
|
2090
|
+
if (!t || t.closest("void-toggle-group") !== this) return;
|
|
2091
|
+
e.stopImmediatePropagation();
|
|
2092
|
+
let n = t.getAttribute("value") || "";
|
|
2093
|
+
if (n) if (this.multiple) {
|
|
2094
|
+
let e = this._selectedValues(), t = e.indexOf(n);
|
|
2095
|
+
t >= 0 ? e.splice(t, 1) : e.push(n), this.value = e.join(","), this._syncToggles(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
2096
|
+
bubbles: !0,
|
|
2097
|
+
composed: !0,
|
|
2098
|
+
detail: { value: e }
|
|
2099
|
+
}));
|
|
2100
|
+
} else {
|
|
2101
|
+
let e = this.value === n ? "" : n;
|
|
2102
|
+
this.value = e, this._syncToggles(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
2103
|
+
bubbles: !0,
|
|
2104
|
+
composed: !0,
|
|
2105
|
+
detail: { value: e }
|
|
2106
|
+
}));
|
|
2107
|
+
}
|
|
2108
|
+
}, this._handleKeydown = (e) => {
|
|
2109
|
+
let t = this._toggles().filter((e) => !e.disabled);
|
|
2110
|
+
if (!t.length) return;
|
|
2111
|
+
let n = this.orientation === "horizontal", r = n ? "ArrowRight" : "ArrowDown", i = n ? "ArrowLeft" : "ArrowUp";
|
|
2112
|
+
if (e.key !== r && e.key !== i) return;
|
|
2113
|
+
e.preventDefault();
|
|
2114
|
+
let a = t.indexOf(e.target), o;
|
|
2115
|
+
o = e.key === r ? a < 0 ? 0 : (a + 1) % t.length : a < 0 ? t.length - 1 : (a - 1 + t.length) % t.length, t[o].focus();
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
connectedCallback() {
|
|
2119
|
+
super.connectedCallback(), this.setAttribute("role", "group"), this.addEventListener("void-change", this._handleChildChange), this.addEventListener("keydown", this._handleKeydown), this._syncToggles();
|
|
2120
|
+
}
|
|
2121
|
+
disconnectedCallback() {
|
|
2122
|
+
super.disconnectedCallback(), this.removeEventListener("void-change", this._handleChildChange), this.removeEventListener("keydown", this._handleKeydown);
|
|
2123
|
+
}
|
|
2124
|
+
updated(e) {
|
|
2125
|
+
(e.has("value") || e.has("disabled") || e.has("size") || e.has("color")) && this._syncToggles();
|
|
2126
|
+
}
|
|
2127
|
+
_toggles() {
|
|
2128
|
+
return Array.from(this.querySelectorAll("void-toggle"));
|
|
2129
|
+
}
|
|
2130
|
+
_selectedValues() {
|
|
2131
|
+
return this.value ? this.value.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
2132
|
+
}
|
|
2133
|
+
_syncToggles() {
|
|
2134
|
+
let e = this._selectedValues();
|
|
2135
|
+
for (let t of this._toggles()) {
|
|
2136
|
+
let n = t.getAttribute("value") || "";
|
|
2137
|
+
t.pressed = e.includes(n), this.disabled && (t.disabled = !0), t.size = this.size, this.color !== "default" && (t.color = this.color);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
};
|
|
2141
|
+
s([r({
|
|
2078
2142
|
type: String,
|
|
2079
2143
|
reflect: !0
|
|
2080
|
-
})],
|
|
2144
|
+
})], H.prototype, "value", void 0), s([r({
|
|
2145
|
+
type: Boolean,
|
|
2146
|
+
reflect: !0
|
|
2147
|
+
})], H.prototype, "multiple", void 0), s([r({
|
|
2148
|
+
type: Boolean,
|
|
2149
|
+
reflect: !0
|
|
2150
|
+
})], H.prototype, "disabled", void 0), s([r({
|
|
2151
|
+
type: String,
|
|
2152
|
+
reflect: !0
|
|
2153
|
+
})], H.prototype, "size", void 0), s([r({
|
|
2154
|
+
type: String,
|
|
2155
|
+
reflect: !0
|
|
2156
|
+
})], H.prototype, "color", void 0), s([r({
|
|
2081
2157
|
type: String,
|
|
2082
2158
|
reflect: !0
|
|
2083
|
-
})],
|
|
2159
|
+
})], H.prototype, "orientation", void 0), customElements.get("void-toggle-group") || customElements.define("void-toggle-group", H);
|
|
2084
2160
|
//#endregion
|
|
2085
2161
|
//#region src/components/segmented-control.ts
|
|
2086
|
-
var
|
|
2162
|
+
var ge = class extends o {
|
|
2087
2163
|
constructor(...e) {
|
|
2088
2164
|
super(...e), this.value = "", this.disabled = !1;
|
|
2089
2165
|
}
|
|
@@ -2097,11 +2173,11 @@ var se = class extends o {
|
|
|
2097
2173
|
s([r({
|
|
2098
2174
|
type: String,
|
|
2099
2175
|
reflect: !0
|
|
2100
|
-
})],
|
|
2176
|
+
})], ge.prototype, "value", void 0), s([r({
|
|
2101
2177
|
type: Boolean,
|
|
2102
2178
|
reflect: !0
|
|
2103
|
-
})],
|
|
2104
|
-
var
|
|
2179
|
+
})], ge.prototype, "disabled", void 0), customElements.get("void-segmented-control-item") || customElements.define("void-segmented-control-item", ge);
|
|
2180
|
+
var U = class extends o {
|
|
2105
2181
|
constructor(...e) {
|
|
2106
2182
|
super(...e), this.value = "", this.size = "md", this.color = "default", this._handleClick = (e) => {
|
|
2107
2183
|
let t = e.target.closest("void-segmented-control-item");
|
|
@@ -2140,16 +2216,16 @@ var Z = class extends o {
|
|
|
2140
2216
|
s([r({
|
|
2141
2217
|
type: String,
|
|
2142
2218
|
reflect: !0
|
|
2143
|
-
})],
|
|
2219
|
+
})], U.prototype, "value", void 0), s([r({
|
|
2144
2220
|
type: String,
|
|
2145
2221
|
reflect: !0
|
|
2146
|
-
})],
|
|
2222
|
+
})], U.prototype, "size", void 0), s([r({
|
|
2147
2223
|
type: String,
|
|
2148
2224
|
reflect: !0
|
|
2149
|
-
})],
|
|
2225
|
+
})], U.prototype, "color", void 0), customElements.get("void-segmented-control") || customElements.define("void-segmented-control", U);
|
|
2150
2226
|
//#endregion
|
|
2151
2227
|
//#region src/components/stat.ts
|
|
2152
|
-
var
|
|
2228
|
+
var W = class extends o {
|
|
2153
2229
|
constructor(...e) {
|
|
2154
2230
|
super(...e), this.label = "", this.value = "", this.delta = "", this.trend = null, this.color = "default", this.size = "md";
|
|
2155
2231
|
}
|
|
@@ -2167,25 +2243,562 @@ var Q = class extends o {
|
|
|
2167
2243
|
s([r({
|
|
2168
2244
|
type: String,
|
|
2169
2245
|
reflect: !0
|
|
2170
|
-
})],
|
|
2246
|
+
})], W.prototype, "label", void 0), s([r({
|
|
2247
|
+
type: String,
|
|
2248
|
+
reflect: !0
|
|
2249
|
+
})], W.prototype, "value", void 0), s([r({
|
|
2250
|
+
type: String,
|
|
2251
|
+
reflect: !0
|
|
2252
|
+
})], W.prototype, "delta", void 0), s([r({
|
|
2253
|
+
type: String,
|
|
2254
|
+
reflect: !0
|
|
2255
|
+
})], W.prototype, "trend", void 0), s([r({
|
|
2256
|
+
type: String,
|
|
2257
|
+
reflect: !0
|
|
2258
|
+
})], W.prototype, "color", void 0), s([r({
|
|
2259
|
+
type: String,
|
|
2260
|
+
reflect: !0
|
|
2261
|
+
})], W.prototype, "size", void 0), customElements.get("void-stat") || customElements.define("void-stat", W);
|
|
2262
|
+
//#endregion
|
|
2263
|
+
//#region src/components/calendar.ts
|
|
2264
|
+
function G(e) {
|
|
2265
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
2266
|
+
return t ? [
|
|
2267
|
+
Number(t[1]),
|
|
2268
|
+
Number(t[2]) - 1,
|
|
2269
|
+
Number(t[3])
|
|
2270
|
+
] : null;
|
|
2271
|
+
}
|
|
2272
|
+
function K(e, t, n) {
|
|
2273
|
+
return `${String(e).padStart(4, "0")}-${String(t + 1).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
|
|
2274
|
+
}
|
|
2275
|
+
function _e() {
|
|
2276
|
+
let e = /* @__PURE__ */ new Date();
|
|
2277
|
+
return K(e.getFullYear(), e.getMonth(), e.getDate());
|
|
2278
|
+
}
|
|
2279
|
+
function ve(e, t) {
|
|
2280
|
+
return new Date(e, t + 1, 0).getDate();
|
|
2281
|
+
}
|
|
2282
|
+
function ye(e, t, n) {
|
|
2283
|
+
return t && e < t ? t : n && e > n ? n : e;
|
|
2284
|
+
}
|
|
2285
|
+
function be(e, t) {
|
|
2286
|
+
let n = G(e);
|
|
2287
|
+
if (!n) return e;
|
|
2288
|
+
let [r, i, a] = n;
|
|
2289
|
+
return t.replace("YYYY", String(r).padStart(4, "0")).replace("MM", String(i + 1).padStart(2, "0")).replace("DD", String(a).padStart(2, "0"));
|
|
2290
|
+
}
|
|
2291
|
+
var q = class extends o {
|
|
2292
|
+
constructor(...e) {
|
|
2293
|
+
super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this._viewYear = 0, this._viewMonth = 0, this._view = "days", this._focusDate = "", this._yearsPageStart = 0, this._didInit = !1, this._prevMonth = () => {
|
|
2294
|
+
this._viewMonth === 0 ? (this._viewMonth = 11, this._viewYear--) : this._viewMonth--, this.requestUpdate();
|
|
2295
|
+
}, this._nextMonth = () => {
|
|
2296
|
+
this._viewMonth === 11 ? (this._viewMonth = 0, this._viewYear++) : this._viewMonth++, this.requestUpdate();
|
|
2297
|
+
}, this._prevYear = () => {
|
|
2298
|
+
this._viewYear--, this.requestUpdate();
|
|
2299
|
+
}, this._nextYear = () => {
|
|
2300
|
+
this._viewYear++, this.requestUpdate();
|
|
2301
|
+
}, this._prevYearsPage = () => {
|
|
2302
|
+
this._yearsPageStart -= 12, this.requestUpdate();
|
|
2303
|
+
}, this._nextYearsPage = () => {
|
|
2304
|
+
this._yearsPageStart += 12, this.requestUpdate();
|
|
2305
|
+
}, this._showMonths = () => {
|
|
2306
|
+
this._view = "months", this.requestUpdate();
|
|
2307
|
+
}, this._showYears = () => {
|
|
2308
|
+
this._yearsPageStart = this._viewYear - this._viewYear % 12, this._view = "years", this.requestUpdate();
|
|
2309
|
+
}, this._onDayKeydown = (e) => {
|
|
2310
|
+
if (this.disabled) return;
|
|
2311
|
+
let t = e.target.getAttribute("data-date");
|
|
2312
|
+
if (!t) return;
|
|
2313
|
+
let n = G(t);
|
|
2314
|
+
if (!n) return;
|
|
2315
|
+
let [r, i] = n, a = n[2], o = !0;
|
|
2316
|
+
switch (e.key) {
|
|
2317
|
+
case "ArrowLeft":
|
|
2318
|
+
a--;
|
|
2319
|
+
break;
|
|
2320
|
+
case "ArrowRight":
|
|
2321
|
+
a++;
|
|
2322
|
+
break;
|
|
2323
|
+
case "ArrowUp":
|
|
2324
|
+
a -= 7;
|
|
2325
|
+
break;
|
|
2326
|
+
case "ArrowDown":
|
|
2327
|
+
a += 7;
|
|
2328
|
+
break;
|
|
2329
|
+
case "Enter":
|
|
2330
|
+
case " ":
|
|
2331
|
+
this._selectDate(t), e.preventDefault();
|
|
2332
|
+
return;
|
|
2333
|
+
default: o = !1;
|
|
2334
|
+
}
|
|
2335
|
+
if (!o) return;
|
|
2336
|
+
e.preventDefault();
|
|
2337
|
+
let s = new Date(r, i, a), c = ye(K(s.getFullYear(), s.getMonth(), s.getDate()), this.min || void 0, this.max || void 0);
|
|
2338
|
+
this._focusDate = c;
|
|
2339
|
+
let l = G(c);
|
|
2340
|
+
l && (this._viewYear = l[0], this._viewMonth = l[1]), this.requestUpdate(), this.updateComplete.then(() => {
|
|
2341
|
+
this.querySelector(`[data-date="${c}"]`)?.focus();
|
|
2342
|
+
});
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
connectedCallback() {
|
|
2346
|
+
super.connectedCallback(), this.setAttribute("role", "group"), this.setAttribute("aria-label", "Calendar"), this._didInit || (this._didInit = !0, this._initView());
|
|
2347
|
+
}
|
|
2348
|
+
updated(e) {
|
|
2349
|
+
super.updated(e), e.has("value") && this._syncViewToValue();
|
|
2350
|
+
}
|
|
2351
|
+
_initView() {
|
|
2352
|
+
let e = G(this.value);
|
|
2353
|
+
if (e) this._viewYear = e[0], this._viewMonth = e[1], this._focusDate = this.value;
|
|
2354
|
+
else {
|
|
2355
|
+
let e = /* @__PURE__ */ new Date();
|
|
2356
|
+
this._viewYear = e.getFullYear(), this._viewMonth = e.getMonth(), this._focusDate = _e();
|
|
2357
|
+
}
|
|
2358
|
+
this._yearsPageStart = this._viewYear - this._viewYear % 12;
|
|
2359
|
+
}
|
|
2360
|
+
_syncViewToValue() {
|
|
2361
|
+
let e = G(this.value);
|
|
2362
|
+
e && (this._viewYear = e[0], this._viewMonth = e[1], this._focusDate = this.value, this._yearsPageStart = this._viewYear - this._viewYear % 12, this.requestUpdate());
|
|
2363
|
+
}
|
|
2364
|
+
render() {
|
|
2365
|
+
return this._view === "years" ? this._renderYears() : this._view === "months" ? this._renderMonths() : this._renderDays();
|
|
2366
|
+
}
|
|
2367
|
+
_renderDays() {
|
|
2368
|
+
let e = this._getDayNames(), n = this._buildDayCells(), r = this._getMonthName(this._viewMonth);
|
|
2369
|
+
return t`
|
|
2370
|
+
<div class="void-calendar-header">
|
|
2371
|
+
<button
|
|
2372
|
+
class="void-calendar-nav"
|
|
2373
|
+
aria-label="Previous month"
|
|
2374
|
+
?disabled=${this.disabled}
|
|
2375
|
+
@click=${this._prevMonth}
|
|
2376
|
+
>
|
|
2377
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
|
|
2378
|
+
</button>
|
|
2379
|
+
<button
|
|
2380
|
+
class="void-calendar-title"
|
|
2381
|
+
aria-label="Switch to month picker"
|
|
2382
|
+
?disabled=${this.disabled}
|
|
2383
|
+
@click=${this._showMonths}
|
|
2384
|
+
>${r} ${this._viewYear}</button>
|
|
2385
|
+
<button
|
|
2386
|
+
class="void-calendar-nav"
|
|
2387
|
+
aria-label="Next month"
|
|
2388
|
+
?disabled=${this.disabled}
|
|
2389
|
+
@click=${this._nextMonth}
|
|
2390
|
+
>
|
|
2391
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
|
2392
|
+
</button>
|
|
2393
|
+
</div>
|
|
2394
|
+
<div class="void-calendar-grid" role="grid" @keydown=${this._onDayKeydown}>
|
|
2395
|
+
<div class="void-calendar-weekdays">
|
|
2396
|
+
${e.map((e) => t`<div class="void-calendar-weekday">${e}</div>`)}
|
|
2397
|
+
</div>
|
|
2398
|
+
<div class="void-calendar-days">
|
|
2399
|
+
${n.map((e) => {
|
|
2400
|
+
let n = e.iso === this.value, r = e.iso === _e(), i = e.outside, a = this.disabled || e.disabled;
|
|
2401
|
+
return t`
|
|
2402
|
+
<button
|
|
2403
|
+
class="void-calendar-day${n ? " selected" : ""}${r ? " today" : ""}${i ? " outside" : ""}"
|
|
2404
|
+
?disabled=${a}
|
|
2405
|
+
aria-selected=${n ? "true" : "false"}
|
|
2406
|
+
aria-label=${e.iso}
|
|
2407
|
+
tabindex=${e.iso === this._focusDate ? "0" : "-1"}
|
|
2408
|
+
data-date=${e.iso}
|
|
2409
|
+
@click=${() => this._selectDate(e.iso)}
|
|
2410
|
+
>${e.day}</button>
|
|
2411
|
+
`;
|
|
2412
|
+
})}
|
|
2413
|
+
</div>
|
|
2414
|
+
</div>
|
|
2415
|
+
`;
|
|
2416
|
+
}
|
|
2417
|
+
_getDayNames() {
|
|
2418
|
+
let e = new Intl.DateTimeFormat(this.locale, { weekday: "short" }), t = [];
|
|
2419
|
+
for (let n = 0; n < 7; n++) {
|
|
2420
|
+
let r = new Date(2024, 0, 7 + (this.firstDay + n) % 7);
|
|
2421
|
+
t.push(e.format(r));
|
|
2422
|
+
}
|
|
2423
|
+
return t;
|
|
2424
|
+
}
|
|
2425
|
+
_getMonthName(e) {
|
|
2426
|
+
return new Intl.DateTimeFormat(this.locale, { month: "long" }).format(new Date(2024, e, 1));
|
|
2427
|
+
}
|
|
2428
|
+
_buildDayCells() {
|
|
2429
|
+
let e = this._viewYear, t = this._viewMonth, n = ve(e, t), r = (new Date(e, t, 1).getDay() - this.firstDay + 7) % 7, i = [], a = t === 0 ? 11 : t - 1, o = t === 0 ? e - 1 : e, s = ve(o, a);
|
|
2430
|
+
for (let e = r - 1; e >= 0; e--) {
|
|
2431
|
+
let t = s - e, n = K(o, a, t);
|
|
2432
|
+
i.push({
|
|
2433
|
+
day: t,
|
|
2434
|
+
iso: n,
|
|
2435
|
+
outside: !0,
|
|
2436
|
+
disabled: this._isOutOfRange(n)
|
|
2437
|
+
});
|
|
2438
|
+
}
|
|
2439
|
+
for (let r = 1; r <= n; r++) {
|
|
2440
|
+
let n = K(e, t, r);
|
|
2441
|
+
i.push({
|
|
2442
|
+
day: r,
|
|
2443
|
+
iso: n,
|
|
2444
|
+
outside: !1,
|
|
2445
|
+
disabled: this._isOutOfRange(n)
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
let c = t === 11 ? 0 : t + 1, l = t === 11 ? e + 1 : e, u = 42 - i.length;
|
|
2449
|
+
for (let e = 1; e <= u; e++) {
|
|
2450
|
+
let t = K(l, c, e);
|
|
2451
|
+
i.push({
|
|
2452
|
+
day: e,
|
|
2453
|
+
iso: t,
|
|
2454
|
+
outside: !0,
|
|
2455
|
+
disabled: this._isOutOfRange(t)
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
return i;
|
|
2459
|
+
}
|
|
2460
|
+
_isOutOfRange(e) {
|
|
2461
|
+
return !!(this.min && e < this.min || this.max && e > this.max);
|
|
2462
|
+
}
|
|
2463
|
+
_renderMonths() {
|
|
2464
|
+
let e = new Intl.DateTimeFormat(this.locale, { month: "short" }), n = Array.from({ length: 12 }, (t, n) => ({
|
|
2465
|
+
index: n,
|
|
2466
|
+
name: e.format(new Date(2024, n, 1))
|
|
2467
|
+
}));
|
|
2468
|
+
return t`
|
|
2469
|
+
<div class="void-calendar-header">
|
|
2470
|
+
<button
|
|
2471
|
+
class="void-calendar-nav"
|
|
2472
|
+
aria-label="Previous year"
|
|
2473
|
+
?disabled=${this.disabled}
|
|
2474
|
+
@click=${this._prevYear}
|
|
2475
|
+
>
|
|
2476
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
|
|
2477
|
+
</button>
|
|
2478
|
+
<button
|
|
2479
|
+
class="void-calendar-title"
|
|
2480
|
+
aria-label="Switch to year picker"
|
|
2481
|
+
?disabled=${this.disabled}
|
|
2482
|
+
@click=${this._showYears}
|
|
2483
|
+
>${this._viewYear}</button>
|
|
2484
|
+
<button
|
|
2485
|
+
class="void-calendar-nav"
|
|
2486
|
+
aria-label="Next year"
|
|
2487
|
+
?disabled=${this.disabled}
|
|
2488
|
+
@click=${this._nextYear}
|
|
2489
|
+
>
|
|
2490
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
|
2491
|
+
</button>
|
|
2492
|
+
</div>
|
|
2493
|
+
<div class="void-calendar-months">
|
|
2494
|
+
${n.map((e) => t`
|
|
2495
|
+
<button
|
|
2496
|
+
class="void-calendar-month${e.index === this._viewMonth && this._viewYear === (/* @__PURE__ */ new Date()).getFullYear() ? " current" : ""}"
|
|
2497
|
+
?disabled=${this.disabled}
|
|
2498
|
+
@click=${() => this._pickMonth(e.index)}
|
|
2499
|
+
>${e.name}</button>
|
|
2500
|
+
`)}
|
|
2501
|
+
</div>
|
|
2502
|
+
`;
|
|
2503
|
+
}
|
|
2504
|
+
_renderYears() {
|
|
2505
|
+
let e = this._yearsPageStart, n = Array.from({ length: 12 }, (t, n) => e + n), r = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2506
|
+
return t`
|
|
2507
|
+
<div class="void-calendar-header">
|
|
2508
|
+
<button
|
|
2509
|
+
class="void-calendar-nav"
|
|
2510
|
+
aria-label="Previous years"
|
|
2511
|
+
?disabled=${this.disabled}
|
|
2512
|
+
@click=${this._prevYearsPage}
|
|
2513
|
+
>
|
|
2514
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"></polyline></svg>
|
|
2515
|
+
</button>
|
|
2516
|
+
<span class="void-calendar-title void-calendar-title--static">${e} – ${e + 11}</span>
|
|
2517
|
+
<button
|
|
2518
|
+
class="void-calendar-nav"
|
|
2519
|
+
aria-label="Next years"
|
|
2520
|
+
?disabled=${this.disabled}
|
|
2521
|
+
@click=${this._nextYearsPage}
|
|
2522
|
+
>
|
|
2523
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
|
2524
|
+
</button>
|
|
2525
|
+
</div>
|
|
2526
|
+
<div class="void-calendar-years">
|
|
2527
|
+
${n.map((e) => t`
|
|
2528
|
+
<button
|
|
2529
|
+
class="void-calendar-year${e === r ? " current" : ""}"
|
|
2530
|
+
?disabled=${this.disabled}
|
|
2531
|
+
@click=${() => this._pickYear(e)}
|
|
2532
|
+
>${e}</button>
|
|
2533
|
+
`)}
|
|
2534
|
+
</div>
|
|
2535
|
+
`;
|
|
2536
|
+
}
|
|
2537
|
+
_pickMonth(e) {
|
|
2538
|
+
this._viewMonth = e, this._view = "days", this.requestUpdate();
|
|
2539
|
+
}
|
|
2540
|
+
_pickYear(e) {
|
|
2541
|
+
this._viewYear = e, this._yearsPageStart = e - e % 12, this._view = "months", this.requestUpdate();
|
|
2542
|
+
}
|
|
2543
|
+
_selectDate(e) {
|
|
2544
|
+
if (this.disabled || this._isOutOfRange(e)) return;
|
|
2545
|
+
this.value = e, this._focusDate = e;
|
|
2546
|
+
let t = G(e);
|
|
2547
|
+
this._viewYear = t[0], this._viewMonth = t[1], this._view = "days", this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
2548
|
+
bubbles: !0,
|
|
2549
|
+
composed: !0,
|
|
2550
|
+
detail: {
|
|
2551
|
+
value: e,
|
|
2552
|
+
date: new Date(t[0], t[1], t[2])
|
|
2553
|
+
}
|
|
2554
|
+
}));
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2557
|
+
s([r({
|
|
2558
|
+
type: String,
|
|
2559
|
+
reflect: !0
|
|
2560
|
+
})], q.prototype, "value", void 0), s([r({ type: String })], q.prototype, "min", void 0), s([r({ type: String })], q.prototype, "max", void 0), s([r({
|
|
2561
|
+
type: Boolean,
|
|
2562
|
+
reflect: !0
|
|
2563
|
+
})], q.prototype, "disabled", void 0), s([r({
|
|
2171
2564
|
type: String,
|
|
2172
2565
|
reflect: !0
|
|
2173
|
-
})],
|
|
2566
|
+
})], q.prototype, "size", void 0), s([r({ type: String })], q.prototype, "locale", void 0), s([r({
|
|
2567
|
+
attribute: "first-day",
|
|
2568
|
+
type: Number
|
|
2569
|
+
})], q.prototype, "firstDay", void 0), customElements.get("void-calendar") || customElements.define("void-calendar", q);
|
|
2570
|
+
var J = class extends o {
|
|
2571
|
+
constructor(...e) {
|
|
2572
|
+
super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this.open = !1, this.placeholder = "Select date", this.format = "MM/DD/YYYY", this.color = "default", this._toggle = () => {
|
|
2573
|
+
this.disabled || (this.open = !this.open, this.requestUpdate());
|
|
2574
|
+
}, this._onCalendarChange = (e) => {
|
|
2575
|
+
e.stopPropagation(), this.value = e.detail.value, this.open = !1, this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
2576
|
+
bubbles: !0,
|
|
2577
|
+
composed: !0,
|
|
2578
|
+
detail: e.detail
|
|
2579
|
+
}));
|
|
2580
|
+
}, this._onDocumentClick = (e) => {
|
|
2581
|
+
this.open && !this.contains(e.target) && (this.open = !1, this.requestUpdate());
|
|
2582
|
+
}, this._onDocumentKeydown = (e) => {
|
|
2583
|
+
e.key === "Escape" && this.open && (this.open = !1, this.requestUpdate());
|
|
2584
|
+
}, this._onInputKeydown = (e) => {
|
|
2585
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._toggle()), e.key === "Escape" && this.open && (this.open = !1, this.requestUpdate());
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2588
|
+
connectedCallback() {
|
|
2589
|
+
super.connectedCallback(), this.setAttribute("role", "combobox"), this.setAttribute("aria-haspopup", "dialog"), document.addEventListener("mousedown", this._onDocumentClick), document.addEventListener("keydown", this._onDocumentKeydown);
|
|
2590
|
+
}
|
|
2591
|
+
disconnectedCallback() {
|
|
2592
|
+
super.disconnectedCallback(), document.removeEventListener("mousedown", this._onDocumentClick), document.removeEventListener("keydown", this._onDocumentKeydown);
|
|
2593
|
+
}
|
|
2594
|
+
updated(e) {
|
|
2595
|
+
super.updated(e), this.setAttribute("aria-expanded", String(this.open));
|
|
2596
|
+
}
|
|
2597
|
+
render() {
|
|
2598
|
+
return t`
|
|
2599
|
+
<div class="void-date-picker-anchor">
|
|
2600
|
+
<input
|
|
2601
|
+
class="void-date-picker-input"
|
|
2602
|
+
.value=${this.value ? be(this.value, this.format) : ""}
|
|
2603
|
+
placeholder=${this.placeholder}
|
|
2604
|
+
?disabled=${this.disabled}
|
|
2605
|
+
readonly
|
|
2606
|
+
aria-expanded=${String(this.open)}
|
|
2607
|
+
aria-haspopup="dialog"
|
|
2608
|
+
@click=${this._toggle}
|
|
2609
|
+
@keydown=${this._onInputKeydown}
|
|
2610
|
+
/>
|
|
2611
|
+
<button
|
|
2612
|
+
class="void-date-picker-icon"
|
|
2613
|
+
aria-label="Toggle calendar"
|
|
2614
|
+
?disabled=${this.disabled}
|
|
2615
|
+
tabindex="-1"
|
|
2616
|
+
@click=${this._toggle}
|
|
2617
|
+
>
|
|
2618
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
2619
|
+
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
2620
|
+
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
2621
|
+
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
2622
|
+
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
2623
|
+
</svg>
|
|
2624
|
+
</button>
|
|
2625
|
+
</div>
|
|
2626
|
+
${this.open ? t`
|
|
2627
|
+
<div class="void-date-picker-dropdown" role="dialog" aria-label="Choose date">
|
|
2628
|
+
<void-calendar
|
|
2629
|
+
value=${this.value}
|
|
2630
|
+
min=${this.min}
|
|
2631
|
+
max=${this.max}
|
|
2632
|
+
?disabled=${this.disabled}
|
|
2633
|
+
size=${this.size}
|
|
2634
|
+
locale=${this.locale}
|
|
2635
|
+
first-day=${this.firstDay}
|
|
2636
|
+
@void-change=${this._onCalendarChange}
|
|
2637
|
+
></void-calendar>
|
|
2638
|
+
</div>
|
|
2639
|
+
` : n}
|
|
2640
|
+
`;
|
|
2641
|
+
}
|
|
2642
|
+
};
|
|
2643
|
+
s([r({
|
|
2174
2644
|
type: String,
|
|
2175
2645
|
reflect: !0
|
|
2176
|
-
})],
|
|
2646
|
+
})], J.prototype, "value", void 0), s([r({ type: String })], J.prototype, "min", void 0), s([r({ type: String })], J.prototype, "max", void 0), s([r({
|
|
2647
|
+
type: Boolean,
|
|
2648
|
+
reflect: !0
|
|
2649
|
+
})], J.prototype, "disabled", void 0), s([r({
|
|
2177
2650
|
type: String,
|
|
2178
2651
|
reflect: !0
|
|
2179
|
-
})],
|
|
2652
|
+
})], J.prototype, "size", void 0), s([r({ type: String })], J.prototype, "locale", void 0), s([r({
|
|
2653
|
+
attribute: "first-day",
|
|
2654
|
+
type: Number
|
|
2655
|
+
})], J.prototype, "firstDay", void 0), s([r({
|
|
2656
|
+
type: Boolean,
|
|
2657
|
+
reflect: !0
|
|
2658
|
+
})], J.prototype, "open", void 0), s([r({ type: String })], J.prototype, "placeholder", void 0), s([r({ type: String })], J.prototype, "format", void 0), s([r({
|
|
2180
2659
|
type: String,
|
|
2181
2660
|
reflect: !0
|
|
2182
|
-
})],
|
|
2661
|
+
})], J.prototype, "color", void 0), customElements.get("void-date-picker") || customElements.define("void-date-picker", J);
|
|
2662
|
+
//#endregion
|
|
2663
|
+
//#region src/components/carousel.ts
|
|
2664
|
+
var xe = class extends o {
|
|
2665
|
+
connectedCallback() {
|
|
2666
|
+
super.connectedCallback(), this.setAttribute("role", "group"), this.setAttribute("aria-roledescription", "slide");
|
|
2667
|
+
}
|
|
2668
|
+
};
|
|
2669
|
+
customElements.get("void-carousel-slide") || customElements.define("void-carousel-slide", xe);
|
|
2670
|
+
var Y = class extends o {
|
|
2671
|
+
constructor(...e) {
|
|
2672
|
+
super(...e), this.active = 0, this.loop = !1, this.autoplay = !1, this.interval = 5e3, this.size = "md", this.controls = !0, this.indicators = !0, this.orientation = "horizontal", this._slides = [], this._autoplayTimer = null, this._userContent = [], this._didSetup = !1, this._prev = () => {
|
|
2673
|
+
this._goTo(this.active - 1);
|
|
2674
|
+
}, this._next = () => {
|
|
2675
|
+
this._goTo(this.active + 1);
|
|
2676
|
+
}, this._onMouseEnter = () => {
|
|
2677
|
+
this.autoplay && this._stopAutoplay();
|
|
2678
|
+
}, this._onMouseLeave = () => {
|
|
2679
|
+
this.autoplay && this._startAutoplay();
|
|
2680
|
+
}, this._onKeydown = (e) => {
|
|
2681
|
+
let t = this.orientation === "horizontal", n = t ? "ArrowLeft" : "ArrowUp", r = t ? "ArrowRight" : "ArrowDown";
|
|
2682
|
+
e.key === n ? (e.preventDefault(), this._prev()) : e.key === r && (e.preventDefault(), this._next());
|
|
2683
|
+
};
|
|
2684
|
+
}
|
|
2685
|
+
connectedCallback() {
|
|
2686
|
+
super.connectedCallback(), this._didSetup || (this._userContent = Array.from(this.childNodes)), this.setAttribute("role", "region"), this.setAttribute("aria-roledescription", "carousel"), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), this.addEventListener("keydown", this._onKeydown);
|
|
2687
|
+
}
|
|
2688
|
+
disconnectedCallback() {
|
|
2689
|
+
super.disconnectedCallback(), this._stopAutoplay(), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("keydown", this._onKeydown);
|
|
2690
|
+
}
|
|
2691
|
+
updated(e) {
|
|
2692
|
+
super.updated(e);
|
|
2693
|
+
let t = !1;
|
|
2694
|
+
if (!this._didSetup) {
|
|
2695
|
+
this._didSetup = !0;
|
|
2696
|
+
let e = this.querySelector(".void-carousel-track");
|
|
2697
|
+
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
2698
|
+
t = !0;
|
|
2699
|
+
}
|
|
2700
|
+
this._slides = Array.from(this.querySelectorAll("void-carousel-slide")), this._syncSlides(), (e.has("autoplay") || e.has("interval")) && (this._stopAutoplay(), this.autoplay && this._startAutoplay()), this.style.setProperty("--void-carousel-offset", String(this.active)), t && this.requestUpdate();
|
|
2701
|
+
}
|
|
2702
|
+
_syncSlides() {
|
|
2703
|
+
for (let e = 0; e < this._slides.length; e++) {
|
|
2704
|
+
let t = this._slides[e];
|
|
2705
|
+
t.setAttribute("aria-label", `Slide ${e + 1} of ${this._slides.length}`), e === this.active ? t.setAttribute("active", "") : t.removeAttribute("active");
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
_goTo(e) {
|
|
2709
|
+
let t = this._slides.length;
|
|
2710
|
+
if (t === 0) return;
|
|
2711
|
+
let n = this.active;
|
|
2712
|
+
e = this.loop ? (e % t + t) % t : Math.max(0, Math.min(e, t - 1)), e !== n && (this.active = e, this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
2713
|
+
bubbles: !0,
|
|
2714
|
+
composed: !0,
|
|
2715
|
+
detail: {
|
|
2716
|
+
index: this.active,
|
|
2717
|
+
previous: n
|
|
2718
|
+
}
|
|
2719
|
+
})));
|
|
2720
|
+
}
|
|
2721
|
+
_goToSlide(e) {
|
|
2722
|
+
this._goTo(e);
|
|
2723
|
+
}
|
|
2724
|
+
_startAutoplay() {
|
|
2725
|
+
this._autoplayTimer ||= setInterval(() => {
|
|
2726
|
+
this._next();
|
|
2727
|
+
}, this.interval);
|
|
2728
|
+
}
|
|
2729
|
+
_stopAutoplay() {
|
|
2730
|
+
this._autoplayTimer &&= (clearInterval(this._autoplayTimer), null);
|
|
2731
|
+
}
|
|
2732
|
+
render() {
|
|
2733
|
+
let e = this._slides.length, n = !this.loop && this.active === 0, r = !this.loop && this.active === e - 1;
|
|
2734
|
+
return t`
|
|
2735
|
+
<div class="void-carousel-viewport">
|
|
2736
|
+
<div class="void-carousel-track" aria-live="polite"></div>
|
|
2737
|
+
</div>
|
|
2738
|
+
${this.controls ? t`
|
|
2739
|
+
<button
|
|
2740
|
+
class="void-carousel-prev"
|
|
2741
|
+
aria-label="Previous slide"
|
|
2742
|
+
?disabled=${n}
|
|
2743
|
+
@click=${this._prev}
|
|
2744
|
+
>
|
|
2745
|
+
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
2746
|
+
<path d="M10 4L6 8l4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2747
|
+
</svg>
|
|
2748
|
+
</button>
|
|
2749
|
+
<button
|
|
2750
|
+
class="void-carousel-next"
|
|
2751
|
+
aria-label="Next slide"
|
|
2752
|
+
?disabled=${r}
|
|
2753
|
+
@click=${this._next}
|
|
2754
|
+
>
|
|
2755
|
+
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
2756
|
+
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2757
|
+
</svg>
|
|
2758
|
+
</button>
|
|
2759
|
+
` : ""}
|
|
2760
|
+
${this.indicators ? t`
|
|
2761
|
+
<div class="void-carousel-indicators" role="tablist" aria-label="Slide indicators">
|
|
2762
|
+
${this._slides.map((e, n) => t`
|
|
2763
|
+
<button
|
|
2764
|
+
class="void-carousel-dot"
|
|
2765
|
+
role="tab"
|
|
2766
|
+
aria-selected=${n === this.active ? "true" : "false"}
|
|
2767
|
+
aria-label="Go to slide ${n + 1}"
|
|
2768
|
+
?active=${n === this.active}
|
|
2769
|
+
@click=${() => this._goToSlide(n)}
|
|
2770
|
+
></button>
|
|
2771
|
+
`)}
|
|
2772
|
+
</div>
|
|
2773
|
+
` : ""}
|
|
2774
|
+
`;
|
|
2775
|
+
}
|
|
2776
|
+
};
|
|
2777
|
+
s([r({
|
|
2778
|
+
type: Number,
|
|
2779
|
+
reflect: !0
|
|
2780
|
+
})], Y.prototype, "active", void 0), s([r({
|
|
2781
|
+
type: Boolean,
|
|
2782
|
+
reflect: !0
|
|
2783
|
+
})], Y.prototype, "loop", void 0), s([r({
|
|
2784
|
+
type: Boolean,
|
|
2785
|
+
reflect: !0
|
|
2786
|
+
})], Y.prototype, "autoplay", void 0), s([r({ type: Number })], Y.prototype, "interval", void 0), s([r({
|
|
2787
|
+
type: String,
|
|
2788
|
+
reflect: !0
|
|
2789
|
+
})], Y.prototype, "size", void 0), s([r({
|
|
2790
|
+
type: Boolean,
|
|
2791
|
+
reflect: !0
|
|
2792
|
+
})], Y.prototype, "controls", void 0), s([r({
|
|
2793
|
+
type: Boolean,
|
|
2794
|
+
reflect: !0
|
|
2795
|
+
})], Y.prototype, "indicators", void 0), s([r({
|
|
2183
2796
|
type: String,
|
|
2184
2797
|
reflect: !0
|
|
2185
|
-
})],
|
|
2798
|
+
})], Y.prototype, "orientation", void 0), customElements.get("void-carousel") || customElements.define("void-carousel", Y);
|
|
2186
2799
|
//#endregion
|
|
2187
2800
|
//#region src/components/dropdown-menu.ts
|
|
2188
|
-
var
|
|
2801
|
+
var Se = class extends o {
|
|
2189
2802
|
constructor(...e) {
|
|
2190
2803
|
super(...e), this.open = !1, this.position = "bottom-start", this._triggerEl = null, this._panel = null, this._handleTriggerClick = () => {
|
|
2191
2804
|
this.open = !this.open;
|
|
@@ -2214,11 +2827,11 @@ var ce = class extends o {
|
|
|
2214
2827
|
s([r({
|
|
2215
2828
|
type: Boolean,
|
|
2216
2829
|
reflect: !0
|
|
2217
|
-
})],
|
|
2830
|
+
})], Se.prototype, "open", void 0), s([r({
|
|
2218
2831
|
type: String,
|
|
2219
2832
|
reflect: !0
|
|
2220
|
-
})],
|
|
2221
|
-
var
|
|
2833
|
+
})], Se.prototype, "position", void 0), customElements.get("void-dropdown-menu") || customElements.define("void-dropdown-menu", Se);
|
|
2834
|
+
var Ce = class extends o {
|
|
2222
2835
|
constructor(...e) {
|
|
2223
2836
|
super(...e), this.disabled = !1, this.destructive = !1, this._handleClick = (e) => {
|
|
2224
2837
|
if (this.disabled) {
|
|
@@ -2247,13 +2860,13 @@ var le = class extends o {
|
|
|
2247
2860
|
s([r({
|
|
2248
2861
|
type: Boolean,
|
|
2249
2862
|
reflect: !0
|
|
2250
|
-
})],
|
|
2863
|
+
})], Ce.prototype, "disabled", void 0), s([r({
|
|
2251
2864
|
type: Boolean,
|
|
2252
2865
|
reflect: !0
|
|
2253
|
-
})],
|
|
2866
|
+
})], Ce.prototype, "destructive", void 0), customElements.get("void-dropdown-menu-item") || customElements.define("void-dropdown-menu-item", Ce);
|
|
2254
2867
|
//#endregion
|
|
2255
2868
|
//#region src/components/indicator.ts
|
|
2256
|
-
var
|
|
2869
|
+
var X = class extends o {
|
|
2257
2870
|
constructor(...e) {
|
|
2258
2871
|
super(...e), this.color = "default", this.position = "top-right", this.count = null, this.ping = !1, this.size = "md";
|
|
2259
2872
|
}
|
|
@@ -2273,18 +2886,313 @@ var $ = class extends o {
|
|
|
2273
2886
|
s([r({
|
|
2274
2887
|
type: String,
|
|
2275
2888
|
reflect: !0
|
|
2276
|
-
})],
|
|
2889
|
+
})], X.prototype, "color", void 0), s([r({
|
|
2890
|
+
type: String,
|
|
2891
|
+
reflect: !0
|
|
2892
|
+
})], X.prototype, "position", void 0), s([r({
|
|
2893
|
+
type: Number,
|
|
2894
|
+
reflect: !0
|
|
2895
|
+
})], X.prototype, "count", void 0), s([r({
|
|
2896
|
+
type: Boolean,
|
|
2897
|
+
reflect: !0
|
|
2898
|
+
})], X.prototype, "ping", void 0), s([r({
|
|
2899
|
+
type: String,
|
|
2900
|
+
reflect: !0
|
|
2901
|
+
})], X.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", X);
|
|
2902
|
+
//#endregion
|
|
2903
|
+
//#region src/components/menu.ts
|
|
2904
|
+
var Z = class extends o {
|
|
2905
|
+
constructor(...e) {
|
|
2906
|
+
super(...e), this.open = !1, this.searchable = !1, this.size = "md", this.placeholder = "Search...", this._query = "", this._userContent = [], this._didSetup = !1, this._handleKeydown = (e) => {
|
|
2907
|
+
if (this.open) {
|
|
2908
|
+
if (e.key === "Escape") {
|
|
2909
|
+
e.preventDefault(), this.open = !1, this._clearSearch();
|
|
2910
|
+
return;
|
|
2911
|
+
}
|
|
2912
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
2913
|
+
e.preventDefault();
|
|
2914
|
+
let t = Array.from(this.querySelectorAll("void-menu-item:not([disabled]):not([hidden])"));
|
|
2915
|
+
if (!t.length) return;
|
|
2916
|
+
let n = t.indexOf(document.activeElement);
|
|
2917
|
+
e.key === "ArrowDown" ? (t[n + 1] ?? t[0]).focus() : (t[n - 1] ?? t[t.length - 1]).focus();
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
}, this._onSearchInput = (e) => {
|
|
2921
|
+
this._query = e.target.value, this._filterItems();
|
|
2922
|
+
};
|
|
2923
|
+
}
|
|
2924
|
+
connectedCallback() {
|
|
2925
|
+
super.connectedCallback(), this.setAttribute("role", "menu"), this._didSetup || (this._userContent = Array.from(this.childNodes)), document.addEventListener("keydown", this._handleKeydown);
|
|
2926
|
+
}
|
|
2927
|
+
disconnectedCallback() {
|
|
2928
|
+
super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeydown);
|
|
2929
|
+
}
|
|
2930
|
+
updated(e) {
|
|
2931
|
+
if (super.updated(e), !this._didSetup) {
|
|
2932
|
+
this._didSetup = !0;
|
|
2933
|
+
let e = this.querySelector(".void-menu-list");
|
|
2934
|
+
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
2935
|
+
}
|
|
2936
|
+
e.has("open") && this.open && this.searchable && requestAnimationFrame(() => {
|
|
2937
|
+
this.querySelector(".void-menu-search")?.focus();
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
_filterItems() {
|
|
2941
|
+
let e = this._query.toLowerCase();
|
|
2942
|
+
this.querySelectorAll("void-menu-item").forEach((t) => {
|
|
2943
|
+
let n = (t.textContent?.trim() ?? "").toLowerCase(), r = (t.getAttribute("value") ?? "").toLowerCase();
|
|
2944
|
+
!e || n.includes(e) || r.includes(e) ? t.removeAttribute("hidden") : t.setAttribute("hidden", "");
|
|
2945
|
+
}), this.querySelectorAll("void-menu-group").forEach((e) => {
|
|
2946
|
+
e.querySelectorAll("void-menu-item:not([hidden])").length === 0 ? e.setAttribute("hidden", "") : e.removeAttribute("hidden");
|
|
2947
|
+
}), this._updateEmptyState();
|
|
2948
|
+
}
|
|
2949
|
+
_updateEmptyState() {
|
|
2950
|
+
let e = this.querySelector(".void-menu-list");
|
|
2951
|
+
if (!e) return;
|
|
2952
|
+
let t = this.querySelector(".void-menu-empty");
|
|
2953
|
+
this.querySelectorAll("void-menu-item:not([hidden])").length === 0 && this._query ? t || (t = document.createElement("div"), t.className = "void-menu-empty", t.textContent = "No results found", e.appendChild(t)) : t && t.remove();
|
|
2954
|
+
}
|
|
2955
|
+
_clearSearch() {
|
|
2956
|
+
this._query = "";
|
|
2957
|
+
let e = this.querySelector(".void-menu-search");
|
|
2958
|
+
e && (e.value = ""), this.querySelectorAll("void-menu-item[hidden], void-menu-group[hidden]").forEach((e) => {
|
|
2959
|
+
e.removeAttribute("hidden");
|
|
2960
|
+
});
|
|
2961
|
+
let t = this.querySelector(".void-menu-empty");
|
|
2962
|
+
t && t.remove();
|
|
2963
|
+
}
|
|
2964
|
+
render() {
|
|
2965
|
+
return this.open ? t`
|
|
2966
|
+
${this.searchable ? t`
|
|
2967
|
+
<input
|
|
2968
|
+
class="void-menu-search"
|
|
2969
|
+
type="text"
|
|
2970
|
+
placeholder=${this.placeholder}
|
|
2971
|
+
autocomplete="off"
|
|
2972
|
+
@input=${this._onSearchInput}
|
|
2973
|
+
/>
|
|
2974
|
+
` : n}
|
|
2975
|
+
<div class="void-menu-list" role="listbox" aria-label="Menu options"></div>
|
|
2976
|
+
` : n;
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
s([r({
|
|
2980
|
+
type: Boolean,
|
|
2981
|
+
reflect: !0
|
|
2982
|
+
})], Z.prototype, "open", void 0), s([r({
|
|
2983
|
+
type: Boolean,
|
|
2984
|
+
reflect: !0
|
|
2985
|
+
})], Z.prototype, "searchable", void 0), s([r({
|
|
2986
|
+
type: String,
|
|
2987
|
+
reflect: !0
|
|
2988
|
+
})], Z.prototype, "size", void 0), s([r({ type: String })], Z.prototype, "placeholder", void 0), customElements.get("void-menu") || customElements.define("void-menu", Z);
|
|
2989
|
+
var Q = class extends o {
|
|
2990
|
+
constructor(...e) {
|
|
2991
|
+
super(...e), this.value = "", this.disabled = !1, this.shortcut = "", this.icon = "", this._originalContent = null, this._handleClick = (e) => {
|
|
2992
|
+
if (this.disabled) {
|
|
2993
|
+
e.stopImmediatePropagation();
|
|
2994
|
+
return;
|
|
2995
|
+
}
|
|
2996
|
+
this.dispatchEvent(new CustomEvent("void-select", {
|
|
2997
|
+
bubbles: !0,
|
|
2998
|
+
composed: !0,
|
|
2999
|
+
detail: { value: this.value }
|
|
3000
|
+
}));
|
|
3001
|
+
}, this._handleKeydown = (e) => {
|
|
3002
|
+
(e.key === "Enter" || e.key === " ") && !this.disabled && (e.preventDefault(), this._handleClick(e));
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
connectedCallback() {
|
|
3006
|
+
super.connectedCallback(), this.setAttribute("role", "menuitem"), this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown), this._originalContent === null && (this._originalContent = Array.from(this.childNodes).map((e) => e.cloneNode(!0))), this._buildContent();
|
|
3007
|
+
}
|
|
3008
|
+
disconnectedCallback() {
|
|
3009
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("keydown", this._handleKeydown);
|
|
3010
|
+
}
|
|
3011
|
+
updated(e) {
|
|
3012
|
+
e.has("disabled") && (this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.setAttribute("aria-disabled", String(this.disabled)));
|
|
3013
|
+
}
|
|
3014
|
+
_buildContent() {
|
|
3015
|
+
if (!this.icon && !this.shortcut) return;
|
|
3016
|
+
let e = document.createDocumentFragment();
|
|
3017
|
+
if (this.icon) {
|
|
3018
|
+
let t = document.createElement("span");
|
|
3019
|
+
t.className = "void-menu-item-icon", t.textContent = this.icon, e.appendChild(t);
|
|
3020
|
+
}
|
|
3021
|
+
let t = document.createElement("span");
|
|
3022
|
+
if (t.className = "void-menu-item-label", this._originalContent) for (let e of this._originalContent) t.appendChild(e.cloneNode(!0));
|
|
3023
|
+
if (e.appendChild(t), this.shortcut) {
|
|
3024
|
+
let t = document.createElement("span");
|
|
3025
|
+
t.className = "void-menu-item-shortcut", t.textContent = this.shortcut, e.appendChild(t);
|
|
3026
|
+
}
|
|
3027
|
+
this.textContent = "", this.appendChild(e);
|
|
3028
|
+
}
|
|
3029
|
+
};
|
|
3030
|
+
s([r({ type: String })], Q.prototype, "value", void 0), s([r({
|
|
3031
|
+
type: Boolean,
|
|
3032
|
+
reflect: !0
|
|
3033
|
+
})], Q.prototype, "disabled", void 0), s([r({ type: String })], Q.prototype, "shortcut", void 0), s([r({ type: String })], Q.prototype, "icon", void 0), customElements.get("void-menu-item") || customElements.define("void-menu-item", Q);
|
|
3034
|
+
var we = class extends o {
|
|
3035
|
+
constructor(...e) {
|
|
3036
|
+
super(...e), this.label = "", this._userContent = [], this._didSetup = !1;
|
|
3037
|
+
}
|
|
3038
|
+
connectedCallback() {
|
|
3039
|
+
super.connectedCallback(), this.setAttribute("role", "group"), this.label && this.setAttribute("aria-label", this.label), this._didSetup || (this._userContent = Array.from(this.childNodes));
|
|
3040
|
+
}
|
|
3041
|
+
updated(e) {
|
|
3042
|
+
if (super.updated(e), e.has("label") && this.label && this.setAttribute("aria-label", this.label), !this._didSetup) {
|
|
3043
|
+
this._didSetup = !0;
|
|
3044
|
+
let e = this.querySelector(".void-menu-group-items");
|
|
3045
|
+
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
render() {
|
|
3049
|
+
return t`
|
|
3050
|
+
${this.label ? t`<div class="void-menu-group-label">${this.label}</div>` : n}
|
|
3051
|
+
<div class="void-menu-group-items"></div>
|
|
3052
|
+
`;
|
|
3053
|
+
}
|
|
3054
|
+
};
|
|
3055
|
+
s([r({
|
|
2277
3056
|
type: String,
|
|
2278
3057
|
reflect: !0
|
|
2279
|
-
})],
|
|
3058
|
+
})], we.prototype, "label", void 0), customElements.get("void-menu-group") || customElements.define("void-menu-group", we);
|
|
3059
|
+
//#endregion
|
|
3060
|
+
//#region src/components/number-input.ts
|
|
3061
|
+
var $ = class extends o {
|
|
3062
|
+
constructor(...e) {
|
|
3063
|
+
super(...e), this.value = 0, this.min = -Infinity, this.max = Infinity, this.step = 1, this.precision = -1, this.disabled = !1, this.readonly = !1, this.size = "md", this.color = "default", this.placeholder = "", this.controls = "sides", this.label = "", this._pressTimer = null, this._repeatTimer = null, this._repeatInterval = 300, this._repeatCount = 0;
|
|
3064
|
+
}
|
|
3065
|
+
connectedCallback() {
|
|
3066
|
+
super.connectedCallback(), this.setAttribute("role", "spinbutton"), this.label && this.setAttribute("aria-label", this.label), isFinite(this.min) && this.setAttribute("aria-valuemin", String(this.min)), isFinite(this.max) && this.setAttribute("aria-valuemax", String(this.max)), this.setAttribute("aria-valuenow", String(this.value));
|
|
3067
|
+
}
|
|
3068
|
+
updated(e) {
|
|
3069
|
+
e.has("value") && this.setAttribute("aria-valuenow", String(this.value)), e.has("min") && isFinite(this.min) && this.setAttribute("aria-valuemin", String(this.min)), e.has("max") && isFinite(this.max) && this.setAttribute("aria-valuemax", String(this.max)), e.has("label") && this.setAttribute("aria-label", this.label);
|
|
3070
|
+
}
|
|
3071
|
+
disconnectedCallback() {
|
|
3072
|
+
super.disconnectedCallback(), this._stopRepeat();
|
|
3073
|
+
}
|
|
3074
|
+
_clamp(e) {
|
|
3075
|
+
return Math.min(Math.max(e, this.min), this.max);
|
|
3076
|
+
}
|
|
3077
|
+
_format(e) {
|
|
3078
|
+
return this.precision >= 0 ? e.toFixed(this.precision) : String(e);
|
|
3079
|
+
}
|
|
3080
|
+
_commit(e) {
|
|
3081
|
+
let t = this._clamp(e);
|
|
3082
|
+
if (t === this.value) return;
|
|
3083
|
+
let n = this.value;
|
|
3084
|
+
this.value = t, this._input && (this._input.value = this._format(t)), this.dispatchEvent(new CustomEvent("void-change", {
|
|
3085
|
+
bubbles: !0,
|
|
3086
|
+
composed: !0,
|
|
3087
|
+
detail: {
|
|
3088
|
+
value: t,
|
|
3089
|
+
previous: n
|
|
3090
|
+
}
|
|
3091
|
+
}));
|
|
3092
|
+
}
|
|
3093
|
+
_increment() {
|
|
3094
|
+
this.disabled || this.readonly || this._commit(this.value + this.step);
|
|
3095
|
+
}
|
|
3096
|
+
_decrement() {
|
|
3097
|
+
this.disabled || this.readonly || this._commit(this.value - this.step);
|
|
3098
|
+
}
|
|
3099
|
+
_startRepeat(e) {
|
|
3100
|
+
e(), this._pressTimer = setTimeout(() => {
|
|
3101
|
+
this._repeatInterval = 300, this._repeatCount = 0, this._repeatTimer = setInterval(() => {
|
|
3102
|
+
if (e(), this._repeatCount++, this._repeatCount % 5 == 0 && this._repeatInterval > 50) {
|
|
3103
|
+
let t = Math.max(50, Math.floor(this._repeatInterval / 2));
|
|
3104
|
+
t !== this._repeatInterval && (this._repeatInterval = t, clearInterval(this._repeatTimer), this._repeatTimer = setInterval(() => {
|
|
3105
|
+
e(), this._repeatCount++;
|
|
3106
|
+
}, this._repeatInterval));
|
|
3107
|
+
}
|
|
3108
|
+
}, this._repeatInterval);
|
|
3109
|
+
}, 400);
|
|
3110
|
+
}
|
|
3111
|
+
_stopRepeat() {
|
|
3112
|
+
this._pressTimer !== null && (clearTimeout(this._pressTimer), this._pressTimer = null), this._repeatTimer !== null && (clearInterval(this._repeatTimer), this._repeatTimer = null), this._repeatCount = 0;
|
|
3113
|
+
}
|
|
3114
|
+
_onKeydown(e) {
|
|
3115
|
+
this.disabled || this.readonly || (e.key === "ArrowUp" ? (e.preventDefault(), this._increment()) : e.key === "ArrowDown" && (e.preventDefault(), this._decrement()));
|
|
3116
|
+
}
|
|
3117
|
+
_onBlur() {
|
|
3118
|
+
if (!this._input || this.readonly) return;
|
|
3119
|
+
let e = parseFloat(this._input.value);
|
|
3120
|
+
isNaN(e) ? this._input.value = this._format(this.value) : this._commit(e);
|
|
3121
|
+
}
|
|
3122
|
+
_onInputChange() {}
|
|
3123
|
+
render() {
|
|
3124
|
+
let e = t`
|
|
3125
|
+
<button
|
|
3126
|
+
class="void-number-input-btn void-number-input-btn-dec"
|
|
3127
|
+
type="button"
|
|
3128
|
+
?disabled=${this.disabled || this.readonly || this.value <= this.min}
|
|
3129
|
+
aria-label="Decrement"
|
|
3130
|
+
@pointerdown=${(e) => {
|
|
3131
|
+
e.preventDefault(), this._startRepeat(() => this._decrement());
|
|
3132
|
+
}}
|
|
3133
|
+
@pointerup=${() => this._stopRepeat()}
|
|
3134
|
+
@pointerleave=${() => this._stopRepeat()}
|
|
3135
|
+
>
|
|
3136
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em">
|
|
3137
|
+
<line x1="3" y1="8" x2="13" y2="8"/>
|
|
3138
|
+
</svg>
|
|
3139
|
+
</button>
|
|
3140
|
+
`, n = t`
|
|
3141
|
+
<button
|
|
3142
|
+
class="void-number-input-btn void-number-input-btn-inc"
|
|
3143
|
+
type="button"
|
|
3144
|
+
?disabled=${this.disabled || this.readonly || this.value >= this.max}
|
|
3145
|
+
aria-label="Increment"
|
|
3146
|
+
@pointerdown=${(e) => {
|
|
3147
|
+
e.preventDefault(), this._startRepeat(() => this._increment());
|
|
3148
|
+
}}
|
|
3149
|
+
@pointerup=${() => this._stopRepeat()}
|
|
3150
|
+
@pointerleave=${() => this._stopRepeat()}
|
|
3151
|
+
>
|
|
3152
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em">
|
|
3153
|
+
<line x1="8" y1="3" x2="8" y2="13"/>
|
|
3154
|
+
<line x1="3" y1="8" x2="13" y2="8"/>
|
|
3155
|
+
</svg>
|
|
3156
|
+
</button>
|
|
3157
|
+
`;
|
|
3158
|
+
return t`
|
|
3159
|
+
${this.controls !== "none" && this.controls !== "right" ? e : ""}
|
|
3160
|
+
<input
|
|
3161
|
+
class="void-number-input-field"
|
|
3162
|
+
type="text"
|
|
3163
|
+
inputmode="numeric"
|
|
3164
|
+
.value=${this._format(this.value)}
|
|
3165
|
+
placeholder=${this.placeholder}
|
|
3166
|
+
?disabled=${this.disabled}
|
|
3167
|
+
?readonly=${this.readonly}
|
|
3168
|
+
aria-label=${this.label || "Number input"}
|
|
3169
|
+
@keydown=${this._onKeydown}
|
|
3170
|
+
@blur=${this._onBlur}
|
|
3171
|
+
@change=${this._onInputChange}
|
|
3172
|
+
/>
|
|
3173
|
+
${this.controls === "right" ? t`<div class="void-number-input-btn-group">${n}${e}</div>` : ""}
|
|
3174
|
+
${this.controls === "sides" ? n : ""}
|
|
3175
|
+
`;
|
|
3176
|
+
}
|
|
3177
|
+
};
|
|
3178
|
+
s([r({
|
|
2280
3179
|
type: Number,
|
|
2281
3180
|
reflect: !0
|
|
2282
|
-
})], $.prototype, "
|
|
3181
|
+
})], $.prototype, "value", void 0), s([r({ type: Number })], $.prototype, "min", void 0), s([r({ type: Number })], $.prototype, "max", void 0), s([r({ type: Number })], $.prototype, "step", void 0), s([r({ type: Number })], $.prototype, "precision", void 0), s([r({
|
|
3182
|
+
type: Boolean,
|
|
3183
|
+
reflect: !0
|
|
3184
|
+
})], $.prototype, "disabled", void 0), s([r({
|
|
2283
3185
|
type: Boolean,
|
|
2284
3186
|
reflect: !0
|
|
2285
|
-
})], $.prototype, "
|
|
3187
|
+
})], $.prototype, "readonly", void 0), s([r({
|
|
3188
|
+
type: String,
|
|
3189
|
+
reflect: !0
|
|
3190
|
+
})], $.prototype, "size", void 0), s([r({
|
|
3191
|
+
type: String,
|
|
3192
|
+
reflect: !0
|
|
3193
|
+
})], $.prototype, "color", void 0), s([r({ type: String })], $.prototype, "placeholder", void 0), s([r({
|
|
2286
3194
|
type: String,
|
|
2287
3195
|
reflect: !0
|
|
2288
|
-
})], $.prototype, "
|
|
3196
|
+
})], $.prototype, "controls", void 0), s([r({ type: String })], $.prototype, "label", void 0), s([i(".void-number-input-field")], $.prototype, "_input", void 0), customElements.get("void-number-input") || customElements.define("void-number-input", $);
|
|
2289
3197
|
//#endregion
|
|
2290
|
-
export {
|
|
3198
|
+
export { se as VoidAccordion, ce as VoidAccordionItem, p as VoidAlert, f as VoidAvatar, c as VoidBadge, j as VoidBanner, le as VoidBreadcrumbs, l as VoidButton, q as VoidCalendar, O as VoidCard, Y as VoidCarousel, xe as VoidCarouselSlide, y as VoidCheckbox, me as VoidCheckboxGroup, F as VoidCombobox, z as VoidComposeInput, J as VoidDatePicker, w as VoidDialog, u as VoidDivider, D as VoidDrawer, Se as VoidDropdownMenu, Ce as VoidDropdownMenuItem, o as VoidElement, P as VoidErrorFallback, S as VoidField, L as VoidFileUpload, he as VoidHamburger, X as VoidIndicator, g as VoidInput, ue as VoidList, T as VoidListItem, Z as VoidMenu, we as VoidMenuGroup, Q as VoidMenuItem, C as VoidMultiselect, R as VoidNavBar, $ as VoidNumberInput, ie as VoidOption, N as VoidPagination, re as VoidPanel, k as VoidPopover, h as VoidProgress, b as VoidRadio, x as VoidRadioGroup, pe as VoidScrollArea, U as VoidSegmentedControl, ge as VoidSegmentedControlItem, v as VoidSelect, B as VoidSidebar, te as VoidSkeleton, I as VoidSlider, ee as VoidSpinner, W as VoidStat, ne as VoidStatusDot, fe as VoidStepper, d as VoidSwitch, ae as VoidTabPanel, M as VoidTable, oe as VoidTabs, m as VoidTag, _ as VoidTextarea, E as VoidToast, de as VoidToastContainer, V as VoidToggle, H as VoidToggleGroup, A as VoidTooltip };
|