@1337exp/taoui 5.23.2 → 5.24.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/CHANGELOG.md +6 -0
- package/README.md +4 -3
- package/README.ru.md +4 -3
- package/dist/index.d.ts +543 -432
- package/dist/index.js +148 -42
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/skills/taoui/SKILL.md +2 -2
- package/skills/taoui/references/components.md +15 -0
package/dist/index.js
CHANGED
|
@@ -58,6 +58,8 @@ const builtin = {
|
|
|
58
58
|
pause: { body: '<path d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" fill="currentColor"/>' },
|
|
59
59
|
"skip-back": { body: '<path d="M19 5.5v13L9.5 12z" fill="currentColor"/><path d="M6 5.5v13"/>' },
|
|
60
60
|
copy: { body: '<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M15 9V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7a2 2 0 002 2h3"/>' },
|
|
61
|
+
sun: { body: '<circle cx="12" cy="12" r="4.25"/><path d="M12 3.75L12 1M18.45 6.86L20.6 5.14M20.04 13.84L22.72 14.45M15.58 19.43L16.77 21.91M8.42 19.43L7.23 21.91M3.96 13.84L1.28 14.45M5.55 6.86L3.4 5.14"/>' },
|
|
62
|
+
moon: { body: '<path d="M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z"/>' },
|
|
61
63
|
calendar: { body: '<rect x="4" y="5.5" width="16" height="14.5" rx="2"/><path d="M4 10h16M8.5 3.5v4M15.5 3.5v4"/>' },
|
|
62
64
|
info: { body: '<circle cx="12" cy="12" r="9"/><path d="M12 11v5.5"/>' + dot(12, 7.8, 1.1) },
|
|
63
65
|
"alert-triangle": { body: '<path d="M12 4L2.8 19.5h18.4z"/><path d="M12 10v4.5"/>' + dot(12, 17.2, 1.1) },
|
|
@@ -97,7 +99,7 @@ function resolveTaoIcon(name) {
|
|
|
97
99
|
const taoIconNames = Object.keys(builtin).map((name) => TAO_ICON_PREFIX + name);
|
|
98
100
|
const _hoisted_1$17 = { class: "tao-icon" };
|
|
99
101
|
const _hoisted_2$Z = ["viewBox", "width", "height", "innerHTML"];
|
|
100
|
-
const _sfc_main$
|
|
102
|
+
const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
101
103
|
...{ name: "TaoIcon" },
|
|
102
104
|
__name: "TaoIcon",
|
|
103
105
|
props: {
|
|
@@ -150,7 +152,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
150
152
|
}
|
|
151
153
|
return target;
|
|
152
154
|
};
|
|
153
|
-
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
155
|
+
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__scopeId", "data-v-ef842331"]]);
|
|
154
156
|
const localeEn = {
|
|
155
157
|
code: "en-US",
|
|
156
158
|
alert: { closeLabel: "Close", detailsLabel: "Details" },
|
|
@@ -185,6 +187,7 @@ const localeEn = {
|
|
|
185
187
|
},
|
|
186
188
|
confirm: { ok: "OK", cancel: "Cancel" },
|
|
187
189
|
copy: { copyLabel: "Copy", successText: "Copied!" },
|
|
190
|
+
themeToggle: { toLightLabel: "Switch to the light theme", toDarkLabel: "Switch to the dark theme" },
|
|
188
191
|
loader: { label: "Loading" },
|
|
189
192
|
date: {
|
|
190
193
|
placeholder: "Date",
|
|
@@ -414,6 +417,7 @@ const localeRu = {
|
|
|
414
417
|
},
|
|
415
418
|
confirm: { ok: "ОК", cancel: "Отмена" },
|
|
416
419
|
copy: { copyLabel: "Копировать", successText: "Скопировано!" },
|
|
420
|
+
themeToggle: { toLightLabel: "Включить светлую тему", toDarkLabel: "Включить тёмную тему" },
|
|
417
421
|
loader: { label: "Загрузка" },
|
|
418
422
|
date: {
|
|
419
423
|
placeholder: "Дата",
|
|
@@ -555,7 +559,7 @@ const _hoisted_5$v = {
|
|
|
555
559
|
key: 3,
|
|
556
560
|
class: "tao-sr-only"
|
|
557
561
|
};
|
|
558
|
-
const _sfc_main$
|
|
562
|
+
const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
559
563
|
...{ name: "TaoLoader" },
|
|
560
564
|
__name: "TaoLoader",
|
|
561
565
|
props: {
|
|
@@ -604,7 +608,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
|
604
608
|
};
|
|
605
609
|
}
|
|
606
610
|
});
|
|
607
|
-
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
611
|
+
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__scopeId", "data-v-77dd8549"]]);
|
|
608
612
|
const _hoisted_1$15 = ["type", "aria-pressed", "aria-keyshortcuts", "aria-busy", "disabled"];
|
|
609
613
|
const _hoisted_2$X = {
|
|
610
614
|
key: 2,
|
|
@@ -615,7 +619,7 @@ const _hoisted_3$P = {
|
|
|
615
619
|
class: "tao-button__shortcut",
|
|
616
620
|
"aria-hidden": "true"
|
|
617
621
|
};
|
|
618
|
-
const _sfc_main$
|
|
622
|
+
const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
619
623
|
...{ name: "TaoButton" },
|
|
620
624
|
__name: "TaoButton",
|
|
621
625
|
props: {
|
|
@@ -702,7 +706,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
702
706
|
};
|
|
703
707
|
}
|
|
704
708
|
});
|
|
705
|
-
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
709
|
+
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-278f587a"]]);
|
|
706
710
|
function toCssLength(value) {
|
|
707
711
|
if (value === void 0 || value === null || value === "") {
|
|
708
712
|
return void 0;
|
|
@@ -721,7 +725,7 @@ function stripeClasses(stripe, tone = "accent") {
|
|
|
721
725
|
function surfaceClass(surface) {
|
|
722
726
|
return surface && surface !== "flat" ? `tao-surface-${surface}` : void 0;
|
|
723
727
|
}
|
|
724
|
-
const _sfc_main$
|
|
728
|
+
const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
725
729
|
...{ name: "TaoBlock" },
|
|
726
730
|
__name: "TaoBlock",
|
|
727
731
|
props: {
|
|
@@ -754,7 +758,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
754
758
|
};
|
|
755
759
|
}
|
|
756
760
|
});
|
|
757
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
761
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-1fc66575"]]);
|
|
758
762
|
function useControlAttrs() {
|
|
759
763
|
const attrs = useAttrs();
|
|
760
764
|
return {
|
|
@@ -785,7 +789,7 @@ const _hoisted_3$O = {
|
|
|
785
789
|
key: 1,
|
|
786
790
|
class: "tao-input__affix tao-input__affix--suffix"
|
|
787
791
|
};
|
|
788
|
-
const _sfc_main$
|
|
792
|
+
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
789
793
|
...{ name: "TaoInput", inheritAttrs: false },
|
|
790
794
|
__name: "TaoInput",
|
|
791
795
|
props: {
|
|
@@ -855,7 +859,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
855
859
|
};
|
|
856
860
|
}
|
|
857
861
|
});
|
|
858
|
-
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
862
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__scopeId", "data-v-5b617319"]]);
|
|
859
863
|
const _hoisted_1$13 = {
|
|
860
864
|
key: 0,
|
|
861
865
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
@@ -865,7 +869,7 @@ const _hoisted_3$N = {
|
|
|
865
869
|
key: 1,
|
|
866
870
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
867
871
|
};
|
|
868
|
-
const _sfc_main$
|
|
872
|
+
const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
869
873
|
...{ name: "TaoInputGroup" },
|
|
870
874
|
__name: "TaoInputGroup",
|
|
871
875
|
props: {
|
|
@@ -903,7 +907,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
903
907
|
};
|
|
904
908
|
}
|
|
905
909
|
});
|
|
906
|
-
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
910
|
+
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__scopeId", "data-v-55b2d297"]]);
|
|
907
911
|
const _hoisted_1$12 = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
908
912
|
const _hoisted_2$U = {
|
|
909
913
|
key: 0,
|
|
@@ -913,7 +917,7 @@ const _hoisted_3$M = ["aria-label", "disabled"];
|
|
|
913
917
|
const _hoisted_4$E = { "aria-hidden": "true" };
|
|
914
918
|
const _hoisted_5$u = ["aria-label", "disabled"];
|
|
915
919
|
const _hoisted_6$o = { "aria-hidden": "true" };
|
|
916
|
-
const _sfc_main$
|
|
920
|
+
const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
917
921
|
...{ name: "TaoInputNumber", inheritAttrs: false },
|
|
918
922
|
__name: "TaoInputNumber",
|
|
919
923
|
props: {
|
|
@@ -1107,13 +1111,13 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
1107
1111
|
};
|
|
1108
1112
|
}
|
|
1109
1113
|
});
|
|
1110
|
-
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1114
|
+
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-dc5bb759"]]);
|
|
1111
1115
|
const _hoisted_1$11 = ["aria-label", "disabled"];
|
|
1112
1116
|
const _hoisted_2$T = { "aria-hidden": "true" };
|
|
1113
1117
|
const _hoisted_3$L = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
1114
1118
|
const _hoisted_4$D = ["aria-label", "disabled"];
|
|
1115
1119
|
const _hoisted_5$t = { "aria-hidden": "true" };
|
|
1116
|
-
const _sfc_main$
|
|
1120
|
+
const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
1117
1121
|
...{ name: "TaoQuantity", inheritAttrs: false },
|
|
1118
1122
|
__name: "TaoQuantity",
|
|
1119
1123
|
props: {
|
|
@@ -1296,7 +1300,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
1296
1300
|
};
|
|
1297
1301
|
}
|
|
1298
1302
|
});
|
|
1299
|
-
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1303
|
+
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-6453479c"]]);
|
|
1300
1304
|
const _hoisted_1$10 = {
|
|
1301
1305
|
key: 0,
|
|
1302
1306
|
class: "tao-card__media"
|
|
@@ -1338,7 +1342,7 @@ const _hoisted_10$4 = {
|
|
|
1338
1342
|
class: "tao-card__corner"
|
|
1339
1343
|
};
|
|
1340
1344
|
const _hoisted_11$4 = ["aria-label"];
|
|
1341
|
-
const _sfc_main$
|
|
1345
|
+
const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
1342
1346
|
...{ name: "TaoCard" },
|
|
1343
1347
|
__name: "TaoCard",
|
|
1344
1348
|
props: {
|
|
@@ -1441,7 +1445,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
1441
1445
|
};
|
|
1442
1446
|
}
|
|
1443
1447
|
});
|
|
1444
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1448
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["__scopeId", "data-v-72c9a80f"]]);
|
|
1445
1449
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1446
1450
|
function getFocusable(root) {
|
|
1447
1451
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -1577,7 +1581,7 @@ const _hoisted_8$b = {
|
|
|
1577
1581
|
key: 1,
|
|
1578
1582
|
class: "tao-modal__footer"
|
|
1579
1583
|
};
|
|
1580
|
-
const _sfc_main$
|
|
1584
|
+
const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
1581
1585
|
...{ name: "TaoModal", inheritAttrs: false },
|
|
1582
1586
|
__name: "TaoModal",
|
|
1583
1587
|
props: {
|
|
@@ -1696,10 +1700,10 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
1696
1700
|
};
|
|
1697
1701
|
}
|
|
1698
1702
|
});
|
|
1699
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1703
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-ea0d125e"]]);
|
|
1700
1704
|
const _hoisted_1$_ = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
1701
1705
|
const _hoisted_2$Q = ["id", "aria-labelledby"];
|
|
1702
|
-
const _sfc_main$
|
|
1706
|
+
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
1703
1707
|
...{ name: "TaoTabs" },
|
|
1704
1708
|
__name: "TaoTabs",
|
|
1705
1709
|
props: {
|
|
@@ -1809,7 +1813,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
1809
1813
|
};
|
|
1810
1814
|
}
|
|
1811
1815
|
});
|
|
1812
|
-
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1816
|
+
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["__scopeId", "data-v-70811078"]]);
|
|
1813
1817
|
function listenFocusLoss(onLoss) {
|
|
1814
1818
|
function onVisibilityChange() {
|
|
1815
1819
|
if (document.hidden) {
|
|
@@ -2337,7 +2341,7 @@ const _hoisted_6$l = {
|
|
|
2337
2341
|
key: 0,
|
|
2338
2342
|
class: "tao-slider__mark-label"
|
|
2339
2343
|
};
|
|
2340
|
-
const _sfc_main$
|
|
2344
|
+
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
2341
2345
|
...{ name: "TaoSliderBase" },
|
|
2342
2346
|
__name: "TaoSliderBase",
|
|
2343
2347
|
props: {
|
|
@@ -2663,8 +2667,8 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
2663
2667
|
};
|
|
2664
2668
|
}
|
|
2665
2669
|
});
|
|
2666
|
-
const TaoSliderBase = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2667
|
-
const _sfc_main$
|
|
2670
|
+
const TaoSliderBase = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-f2374981"]]);
|
|
2671
|
+
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
2668
2672
|
...{ name: "TaoSlider" },
|
|
2669
2673
|
__name: "TaoSlider",
|
|
2670
2674
|
props: {
|
|
@@ -2736,7 +2740,7 @@ const _hoisted_3$H = {
|
|
|
2736
2740
|
key: 0,
|
|
2737
2741
|
class: "tao-scrubber__time"
|
|
2738
2742
|
};
|
|
2739
|
-
const _sfc_main$
|
|
2743
|
+
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
2740
2744
|
...{ name: "TaoScrubber" },
|
|
2741
2745
|
__name: "TaoScrubber",
|
|
2742
2746
|
props: {
|
|
@@ -2807,7 +2811,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
2807
2811
|
}, 8, ["disabled", "aria-label"])) : createCommentVNode("", true)
|
|
2808
2812
|
]),
|
|
2809
2813
|
createElementVNode("div", _hoisted_2$O, [
|
|
2810
|
-
createVNode(_sfc_main$
|
|
2814
|
+
createVNode(_sfc_main$17, {
|
|
2811
2815
|
"model-value": __props.modelValue,
|
|
2812
2816
|
min: 0,
|
|
2813
2817
|
max: __props.length,
|
|
@@ -2843,7 +2847,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
2843
2847
|
};
|
|
2844
2848
|
}
|
|
2845
2849
|
});
|
|
2846
|
-
const TaoScrubber = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2850
|
+
const TaoScrubber = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-517dc331"]]);
|
|
2847
2851
|
const opposite = { top: "bottom", bottom: "top", left: "right", right: "left" };
|
|
2848
2852
|
function computePosition(input) {
|
|
2849
2853
|
const { anchor, size, viewport, placement = "bottom-start", gap = 4, pad = 8, flip = true } = input;
|
|
@@ -2969,7 +2973,7 @@ function useFloating(anchor, panel, open, options = {}) {
|
|
|
2969
2973
|
});
|
|
2970
2974
|
return { style, side, anchorOffset, placed, update };
|
|
2971
2975
|
}
|
|
2972
|
-
const _sfc_main$
|
|
2976
|
+
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
2973
2977
|
...{ name: "TaoTooltip" },
|
|
2974
2978
|
__name: "TaoTooltip",
|
|
2975
2979
|
props: {
|
|
@@ -3047,7 +3051,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
3047
3051
|
};
|
|
3048
3052
|
}
|
|
3049
3053
|
});
|
|
3050
|
-
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3054
|
+
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-32ae3936"]]);
|
|
3051
3055
|
function useDismiss(open, inside, onDismiss) {
|
|
3052
3056
|
function onPointer(event) {
|
|
3053
3057
|
const target = event.target;
|
|
@@ -3077,7 +3081,7 @@ function useDismiss(open, inside, onDismiss) {
|
|
|
3077
3081
|
onBeforeUnmount(stop);
|
|
3078
3082
|
}
|
|
3079
3083
|
const _hoisted_1$X = { class: "tao-popover" };
|
|
3080
|
-
const _sfc_main$
|
|
3084
|
+
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
3081
3085
|
...{ name: "TaoPopover" },
|
|
3082
3086
|
__name: "TaoPopover",
|
|
3083
3087
|
props: {
|
|
@@ -3160,7 +3164,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
3160
3164
|
};
|
|
3161
3165
|
}
|
|
3162
3166
|
});
|
|
3163
|
-
const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3167
|
+
const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-6822af1e"]]);
|
|
3164
3168
|
const spoilerGroupKey = Symbol("taoSpoilerGroup");
|
|
3165
3169
|
function frameStyle(bordered) {
|
|
3166
3170
|
if (bordered === void 0 || bordered === null) {
|
|
@@ -3175,7 +3179,7 @@ const _hoisted_2$N = {
|
|
|
3175
3179
|
};
|
|
3176
3180
|
const _hoisted_3$G = ["id"];
|
|
3177
3181
|
const _hoisted_4$z = { class: "tao-spoiler__content-inner" };
|
|
3178
|
-
const _sfc_main$
|
|
3182
|
+
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
3179
3183
|
...{ name: "TaoSpoiler" },
|
|
3180
3184
|
__name: "TaoSpoiler",
|
|
3181
3185
|
props: {
|
|
@@ -3277,9 +3281,9 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
3277
3281
|
};
|
|
3278
3282
|
}
|
|
3279
3283
|
});
|
|
3280
|
-
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3284
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-1e16d6d1"]]);
|
|
3281
3285
|
const _hoisted_1$V = { class: "tao-spoiler-group" };
|
|
3282
|
-
const _sfc_main$
|
|
3286
|
+
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
3283
3287
|
...{ name: "TaoSpoilerGroup" },
|
|
3284
3288
|
__name: "TaoSpoilerGroup",
|
|
3285
3289
|
props: {
|
|
@@ -3310,9 +3314,9 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
3310
3314
|
};
|
|
3311
3315
|
}
|
|
3312
3316
|
});
|
|
3313
|
-
const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3317
|
+
const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-7986fd2a"]]);
|
|
3314
3318
|
const _hoisted_1$U = ["aria-label"];
|
|
3315
|
-
const _sfc_main$
|
|
3319
|
+
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
3316
3320
|
...{ name: "TaoCopy" },
|
|
3317
3321
|
__name: "TaoCopy",
|
|
3318
3322
|
props: {
|
|
@@ -3400,7 +3404,105 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
3400
3404
|
};
|
|
3401
3405
|
}
|
|
3402
3406
|
});
|
|
3403
|
-
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3407
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-e181129d"]]);
|
|
3408
|
+
function readTaoMode(el) {
|
|
3409
|
+
const mode = el.getAttribute("data-tao-mode");
|
|
3410
|
+
if (mode === "light" || mode === "dark") {
|
|
3411
|
+
return mode;
|
|
3412
|
+
}
|
|
3413
|
+
return el.getAttribute("data-tao-theme") === "light" ? "light" : "dark";
|
|
3414
|
+
}
|
|
3415
|
+
function applyTaoMode(el, mode) {
|
|
3416
|
+
el.setAttribute("data-tao-mode", mode);
|
|
3417
|
+
const theme = el.getAttribute("data-tao-theme");
|
|
3418
|
+
if (theme === "dark" || theme === "light") {
|
|
3419
|
+
el.setAttribute("data-tao-theme", mode);
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
3423
|
+
...{ name: "TaoThemeToggle" },
|
|
3424
|
+
__name: "TaoThemeToggle",
|
|
3425
|
+
props: {
|
|
3426
|
+
modelValue: { default: void 0 },
|
|
3427
|
+
apply: { type: Boolean, default: true },
|
|
3428
|
+
size: { default: void 0 },
|
|
3429
|
+
variant: { default: "ghost" },
|
|
3430
|
+
toLightLabel: { default: void 0 },
|
|
3431
|
+
toDarkLabel: { default: void 0 }
|
|
3432
|
+
},
|
|
3433
|
+
emits: ["update:modelValue", "change"],
|
|
3434
|
+
setup(__props, { emit: __emit }) {
|
|
3435
|
+
const props = __props;
|
|
3436
|
+
const emit = __emit;
|
|
3437
|
+
const l10n = useLocaleText(props, "themeToggle");
|
|
3438
|
+
const own = ref("dark");
|
|
3439
|
+
const mode = computed(() => props.modelValue ?? own.value);
|
|
3440
|
+
let observer = null;
|
|
3441
|
+
onMounted(() => {
|
|
3442
|
+
const root = document.documentElement;
|
|
3443
|
+
if (props.modelValue === void 0) {
|
|
3444
|
+
own.value = readTaoMode(root);
|
|
3445
|
+
observer = new MutationObserver(() => {
|
|
3446
|
+
if (props.modelValue === void 0) {
|
|
3447
|
+
own.value = readTaoMode(root);
|
|
3448
|
+
}
|
|
3449
|
+
});
|
|
3450
|
+
observer.observe(root, { attributes: true, attributeFilter: ["data-tao-mode", "data-tao-theme"] });
|
|
3451
|
+
} else if (props.apply) {
|
|
3452
|
+
applyTaoMode(root, props.modelValue);
|
|
3453
|
+
}
|
|
3454
|
+
});
|
|
3455
|
+
onBeforeUnmount(() => {
|
|
3456
|
+
observer?.disconnect();
|
|
3457
|
+
observer = null;
|
|
3458
|
+
});
|
|
3459
|
+
watch(
|
|
3460
|
+
() => props.modelValue,
|
|
3461
|
+
(value) => {
|
|
3462
|
+
if (value && props.apply && typeof document !== "undefined") {
|
|
3463
|
+
applyTaoMode(document.documentElement, value);
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
);
|
|
3467
|
+
function toggle() {
|
|
3468
|
+
const next = mode.value === "dark" ? "light" : "dark";
|
|
3469
|
+
own.value = next;
|
|
3470
|
+
if (props.apply && typeof document !== "undefined") {
|
|
3471
|
+
applyTaoMode(document.documentElement, next);
|
|
3472
|
+
}
|
|
3473
|
+
emit("update:modelValue", next);
|
|
3474
|
+
emit("change", next);
|
|
3475
|
+
}
|
|
3476
|
+
const icon = computed(() => mode.value === "dark" ? "tao-sun" : "tao-moon");
|
|
3477
|
+
const label = computed(() => mode.value === "dark" ? l10n.value.toLightLabel : l10n.value.toDarkLabel);
|
|
3478
|
+
return (_ctx, _cache) => {
|
|
3479
|
+
return _ctx.$slots.icon ? (openBlock(), createBlock(TaoButton, {
|
|
3480
|
+
key: 0,
|
|
3481
|
+
class: "tao-theme-toggle tao-theme-toggle--custom",
|
|
3482
|
+
size: __props.size,
|
|
3483
|
+
variant: __props.variant,
|
|
3484
|
+
"aria-label": label.value,
|
|
3485
|
+
onClick: toggle
|
|
3486
|
+
}, {
|
|
3487
|
+
default: withCtx(() => [
|
|
3488
|
+
renderSlot(_ctx.$slots, "icon", {
|
|
3489
|
+
mode: mode.value,
|
|
3490
|
+
next: mode.value === "dark" ? "light" : "dark"
|
|
3491
|
+
})
|
|
3492
|
+
]),
|
|
3493
|
+
_: 3
|
|
3494
|
+
}, 8, ["size", "variant", "aria-label"])) : (openBlock(), createBlock(TaoButton, {
|
|
3495
|
+
key: 1,
|
|
3496
|
+
class: "tao-theme-toggle",
|
|
3497
|
+
icon: icon.value,
|
|
3498
|
+
size: __props.size,
|
|
3499
|
+
variant: __props.variant,
|
|
3500
|
+
"aria-label": label.value,
|
|
3501
|
+
onClick: toggle
|
|
3502
|
+
}, null, 8, ["icon", "size", "variant", "aria-label"]));
|
|
3503
|
+
};
|
|
3504
|
+
}
|
|
3505
|
+
});
|
|
3404
3506
|
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
3405
3507
|
...{ name: "TaoContainer" },
|
|
3406
3508
|
__name: "TaoContainer",
|
|
@@ -8445,7 +8547,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8445
8547
|
}, null, 4)
|
|
8446
8548
|
], 44, _hoisted_1$o),
|
|
8447
8549
|
createElementVNode("div", _hoisted_2$m, [
|
|
8448
|
-
createVNode(_sfc_main$
|
|
8550
|
+
createVNode(_sfc_main$17, {
|
|
8449
8551
|
modelValue: hueValue.value,
|
|
8450
8552
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => hueValue.value = $event),
|
|
8451
8553
|
class: "tao-color-picker__hue",
|
|
@@ -8457,7 +8559,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8457
8559
|
"aria-label": unref(l10n).hueLabel,
|
|
8458
8560
|
onChange: _cache[1] || (_cache[1] = ($event) => emit("change", hex.value))
|
|
8459
8561
|
}, null, 8, ["modelValue", "disabled", "aria-label"]),
|
|
8460
|
-
__props.alpha ? (openBlock(), createBlock(_sfc_main$
|
|
8562
|
+
__props.alpha ? (openBlock(), createBlock(_sfc_main$17, {
|
|
8461
8563
|
key: 0,
|
|
8462
8564
|
modelValue: alphaValue.value,
|
|
8463
8565
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => alphaValue.value = $event),
|
|
@@ -13190,6 +13292,7 @@ const components = [
|
|
|
13190
13292
|
TaoSpoiler,
|
|
13191
13293
|
TaoSpoilerGroup,
|
|
13192
13294
|
TaoCopy,
|
|
13295
|
+
_sfc_main$10,
|
|
13193
13296
|
TaoContainer,
|
|
13194
13297
|
_sfc_main$_,
|
|
13195
13298
|
TaoSpace,
|
|
@@ -13207,7 +13310,7 @@ const components = [
|
|
|
13207
13310
|
TaoTextarea,
|
|
13208
13311
|
TaoScrollTop,
|
|
13209
13312
|
TaoProgress,
|
|
13210
|
-
_sfc_main$
|
|
13313
|
+
_sfc_main$17,
|
|
13211
13314
|
_sfc_main$M,
|
|
13212
13315
|
TaoFileDrop,
|
|
13213
13316
|
TaoDropdownMenu,
|
|
@@ -13335,7 +13438,7 @@ export {
|
|
|
13335
13438
|
TaoSegmentedOption,
|
|
13336
13439
|
TaoSelect,
|
|
13337
13440
|
TaoSkeleton,
|
|
13338
|
-
_sfc_main$
|
|
13441
|
+
_sfc_main$17 as TaoSlider,
|
|
13339
13442
|
TaoSpace,
|
|
13340
13443
|
TaoSparkline,
|
|
13341
13444
|
TaoSplit,
|
|
@@ -13347,6 +13450,7 @@ export {
|
|
|
13347
13450
|
TaoTabs,
|
|
13348
13451
|
TaoTag,
|
|
13349
13452
|
TaoTextarea,
|
|
13453
|
+
_sfc_main$10 as TaoThemeToggle,
|
|
13350
13454
|
TaoTimeline,
|
|
13351
13455
|
TaoToastViewport,
|
|
13352
13456
|
TaoToolbar,
|
|
@@ -13356,6 +13460,7 @@ export {
|
|
|
13356
13460
|
TaoTree,
|
|
13357
13461
|
TaoUI,
|
|
13358
13462
|
apcaContrast,
|
|
13463
|
+
applyTaoMode,
|
|
13359
13464
|
applyTaoPalette,
|
|
13360
13465
|
colorModel,
|
|
13361
13466
|
confirm,
|
|
@@ -13377,6 +13482,7 @@ export {
|
|
|
13377
13482
|
parseTaoDateInput,
|
|
13378
13483
|
parseTaoDateRange,
|
|
13379
13484
|
provideTaoLocale,
|
|
13485
|
+
readTaoMode,
|
|
13380
13486
|
registerTaoIcons,
|
|
13381
13487
|
rgbToHsl,
|
|
13382
13488
|
rgbaToHsva,
|