@1337exp/taoui 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -11
- package/dist/index.cjs +696 -344
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +292 -169
- package/dist/index.mjs +697 -345
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +488 -306
- package/package.json +1 -1
- package/src/styles/base.css +10 -0
- package/src/styles/semantic.css +3 -1
- package/src/styles/themes/light.css +3 -1
- package/src/styles/variables.css +0 -77
package/dist/index.cjs
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "tao-button__loader"
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_3$
|
|
10
|
+
const _hoisted_3$t = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "tao-button__icon"
|
|
13
13
|
};
|
|
14
|
-
const _hoisted_4$
|
|
14
|
+
const _hoisted_4$o = { class: "tao-button__content" };
|
|
15
15
|
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
16
16
|
...{ name: "TaoButton" },
|
|
17
17
|
__name: "TaoButton",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
onClick: handleClick
|
|
51
51
|
}, [
|
|
52
52
|
__props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$z)) : vue.createCommentVNode("", true),
|
|
53
|
-
__props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
54
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
53
|
+
__props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$t, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
|
|
54
|
+
vue.createElementVNode("span", _hoisted_4$o, [
|
|
55
55
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
56
56
|
])
|
|
57
57
|
], 10, _hoisted_1$E);
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
};
|
|
68
68
|
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-5a0fd489"]]);
|
|
69
69
|
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
70
|
+
...{ name: "TaoBlock" },
|
|
70
71
|
__name: "TaoBlock",
|
|
71
72
|
props: {
|
|
72
73
|
padding: { default: 16 },
|
|
@@ -97,20 +98,20 @@
|
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-
|
|
101
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-feb87e36"]]);
|
|
101
102
|
const formFieldKey = Symbol("taoFormField");
|
|
102
103
|
const _hoisted_1$D = { class: "tao-input-wrapper" };
|
|
103
104
|
const _hoisted_2$y = ["for"];
|
|
104
|
-
const _hoisted_3$
|
|
105
|
+
const _hoisted_3$s = {
|
|
105
106
|
key: 0,
|
|
106
107
|
class: "tao-input__affix tao-input__affix--prefix"
|
|
107
108
|
};
|
|
108
|
-
const _hoisted_4$
|
|
109
|
-
const _hoisted_5$
|
|
109
|
+
const _hoisted_4$n = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
|
|
110
|
+
const _hoisted_5$f = {
|
|
110
111
|
key: 1,
|
|
111
112
|
class: "tao-input__affix tao-input__affix--suffix"
|
|
112
113
|
};
|
|
113
|
-
const _hoisted_6$
|
|
114
|
+
const _hoisted_6$b = {
|
|
114
115
|
key: 1,
|
|
115
116
|
class: "tao-input__error"
|
|
116
117
|
};
|
|
@@ -151,7 +152,7 @@
|
|
|
151
152
|
}
|
|
152
153
|
return (_ctx, _cache) => {
|
|
153
154
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
|
|
154
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
155
|
+
__props.label && !vue.unref(field) ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
155
156
|
key: 0,
|
|
156
157
|
class: "tao-input__label",
|
|
157
158
|
for: controlId.value
|
|
@@ -165,7 +166,7 @@
|
|
|
165
166
|
"tao-input-shell--suffix": _ctx.$slots.suffix
|
|
166
167
|
}])
|
|
167
168
|
}, [
|
|
168
|
-
_ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
169
|
+
_ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$s, [
|
|
169
170
|
vue.renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
170
171
|
])) : vue.createCommentVNode("", true),
|
|
171
172
|
vue.createElementVNode("input", {
|
|
@@ -180,23 +181,23 @@
|
|
|
180
181
|
onInput: handleInput,
|
|
181
182
|
onBlur: handleBlur,
|
|
182
183
|
onFocus: handleFocus
|
|
183
|
-
}, null, 42, _hoisted_4$
|
|
184
|
-
_ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$
|
|
184
|
+
}, null, 42, _hoisted_4$n),
|
|
185
|
+
_ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$f, [
|
|
185
186
|
vue.renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
|
|
186
187
|
])) : vue.createCommentVNode("", true)
|
|
187
188
|
], 2),
|
|
188
|
-
__props.error && __props.errorMessage ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$
|
|
189
|
+
__props.error && __props.errorMessage ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$b, vue.toDisplayString(__props.errorMessage), 1)) : vue.createCommentVNode("", true)
|
|
189
190
|
]);
|
|
190
191
|
};
|
|
191
192
|
}
|
|
192
193
|
});
|
|
193
|
-
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-
|
|
194
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-b522e041"]]);
|
|
194
195
|
const _hoisted_1$C = {
|
|
195
196
|
key: 0,
|
|
196
197
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
197
198
|
};
|
|
198
199
|
const _hoisted_2$x = { class: "tao-input-group__field" };
|
|
199
|
-
const _hoisted_3$
|
|
200
|
+
const _hoisted_3$r = {
|
|
200
201
|
key: 1,
|
|
201
202
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
202
203
|
};
|
|
@@ -228,7 +229,7 @@
|
|
|
228
229
|
vue.createElementVNode("div", _hoisted_2$x, [
|
|
229
230
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
230
231
|
]),
|
|
231
|
-
_ctx.$slots.after ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
232
|
+
_ctx.$slots.after ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$r, [
|
|
232
233
|
vue.renderSlot(_ctx.$slots, "after", {}, void 0, true)
|
|
233
234
|
])) : vue.createCommentVNode("", true)
|
|
234
235
|
], 34);
|
|
@@ -241,8 +242,8 @@
|
|
|
241
242
|
key: 0,
|
|
242
243
|
class: "tao-input-number__steppers"
|
|
243
244
|
};
|
|
244
|
-
const _hoisted_3$
|
|
245
|
-
const _hoisted_4$
|
|
245
|
+
const _hoisted_3$q = ["disabled"];
|
|
246
|
+
const _hoisted_4$m = ["disabled"];
|
|
246
247
|
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
247
248
|
...{ name: "TaoInputNumber" },
|
|
248
249
|
__name: "TaoInputNumber",
|
|
@@ -401,7 +402,7 @@
|
|
|
401
402
|
tabindex: "-1",
|
|
402
403
|
disabled: __props.disabled || atMax.value,
|
|
403
404
|
onClick: _cache[0] || (_cache[0] = ($event) => bump(1))
|
|
404
|
-
}, " + ", 8, _hoisted_3$
|
|
405
|
+
}, " + ", 8, _hoisted_3$q),
|
|
405
406
|
vue.createElementVNode("button", {
|
|
406
407
|
type: "button",
|
|
407
408
|
class: "tao-input-number__step",
|
|
@@ -409,7 +410,7 @@
|
|
|
409
410
|
tabindex: "-1",
|
|
410
411
|
disabled: __props.disabled || atMin.value,
|
|
411
412
|
onClick: _cache[1] || (_cache[1] = ($event) => bump(-1))
|
|
412
|
-
}, " − ", 8, _hoisted_4$
|
|
413
|
+
}, " − ", 8, _hoisted_4$m)
|
|
413
414
|
])) : vue.createCommentVNode("", true)
|
|
414
415
|
], 2);
|
|
415
416
|
};
|
|
@@ -418,7 +419,7 @@
|
|
|
418
419
|
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-55b65a4d"]]);
|
|
419
420
|
const _hoisted_1$A = ["aria-label", "disabled"];
|
|
420
421
|
const _hoisted_2$v = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
421
|
-
const _hoisted_3$
|
|
422
|
+
const _hoisted_3$p = ["disabled"];
|
|
422
423
|
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
423
424
|
...{ name: "TaoQuantity" },
|
|
424
425
|
__name: "TaoQuantity",
|
|
@@ -579,7 +580,7 @@
|
|
|
579
580
|
"aria-label": "Увеличить",
|
|
580
581
|
disabled: plusDisabled.value,
|
|
581
582
|
onClick: onInc
|
|
582
|
-
}, " + ", 8, _hoisted_3$
|
|
583
|
+
}, " + ", 8, _hoisted_3$p)
|
|
583
584
|
], 2);
|
|
584
585
|
};
|
|
585
586
|
}
|
|
@@ -593,16 +594,16 @@
|
|
|
593
594
|
key: 0,
|
|
594
595
|
class: "tao-card__header-title"
|
|
595
596
|
};
|
|
596
|
-
const _hoisted_3$
|
|
597
|
-
const _hoisted_4$
|
|
597
|
+
const _hoisted_3$o = { key: 0 };
|
|
598
|
+
const _hoisted_4$l = {
|
|
598
599
|
key: 2,
|
|
599
600
|
class: "tao-card__title-block"
|
|
600
601
|
};
|
|
601
|
-
const _hoisted_5$
|
|
602
|
+
const _hoisted_5$e = {
|
|
602
603
|
key: 0,
|
|
603
604
|
class: "tao-card__title"
|
|
604
605
|
};
|
|
605
|
-
const _hoisted_6$
|
|
606
|
+
const _hoisted_6$a = {
|
|
606
607
|
key: 1,
|
|
607
608
|
class: "tao-card__sub"
|
|
608
609
|
};
|
|
@@ -615,6 +616,7 @@
|
|
|
615
616
|
class: "tao-card__footer"
|
|
616
617
|
};
|
|
617
618
|
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
619
|
+
...{ name: "TaoCard" },
|
|
618
620
|
__name: "TaoCard",
|
|
619
621
|
props: {
|
|
620
622
|
padding: { default: 20 },
|
|
@@ -662,15 +664,15 @@
|
|
|
662
664
|
vue.createElementVNode("span", null, [
|
|
663
665
|
vue.renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
664
666
|
]),
|
|
665
|
-
_ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
667
|
+
_ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$o, [
|
|
666
668
|
vue.renderSlot(_ctx.$slots, "headerSecondary", {}, void 0, true)
|
|
667
669
|
])) : vue.createCommentVNode("", true)
|
|
668
670
|
], 2)) : vue.createCommentVNode("", true),
|
|
669
|
-
_ctx.$slots.title || _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
670
|
-
_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_5$
|
|
671
|
+
_ctx.$slots.title || _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$l, [
|
|
672
|
+
_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_5$e, [
|
|
671
673
|
vue.renderSlot(_ctx.$slots, "title", {}, void 0, true)
|
|
672
674
|
])) : vue.createCommentVNode("", true),
|
|
673
|
-
_ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$
|
|
675
|
+
_ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$a, [
|
|
674
676
|
vue.renderSlot(_ctx.$slots, "sub", {}, void 0, true)
|
|
675
677
|
])) : vue.createCommentVNode("", true)
|
|
676
678
|
])) : vue.createCommentVNode("", true),
|
|
@@ -685,7 +687,7 @@
|
|
|
685
687
|
};
|
|
686
688
|
}
|
|
687
689
|
});
|
|
688
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-
|
|
690
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-2ff3d055"]]);
|
|
689
691
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
690
692
|
function getFocusable(root) {
|
|
691
693
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -719,9 +721,10 @@
|
|
|
719
721
|
key: 0,
|
|
720
722
|
class: "tao-modal__header"
|
|
721
723
|
};
|
|
722
|
-
const _hoisted_3$
|
|
723
|
-
const _hoisted_4$
|
|
724
|
-
const _hoisted_5$
|
|
724
|
+
const _hoisted_3$n = ["id"];
|
|
725
|
+
const _hoisted_4$k = { key: 1 };
|
|
726
|
+
const _hoisted_5$d = { class: "tao-modal__content" };
|
|
727
|
+
const _hoisted_6$9 = {
|
|
725
728
|
key: 1,
|
|
726
729
|
class: "tao-modal__footer"
|
|
727
730
|
};
|
|
@@ -825,12 +828,13 @@
|
|
|
825
828
|
"aria-labelledby": __props.title ? vue.unref(titleId) : void 0,
|
|
826
829
|
tabindex: "-1"
|
|
827
830
|
}, [
|
|
828
|
-
__props.title || _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$t, [
|
|
831
|
+
__props.title || _ctx.$slots.header || __props.closable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$t, [
|
|
829
832
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
830
|
-
vue.
|
|
833
|
+
__props.title ? (vue.openBlock(), vue.createElementBlock("h2", {
|
|
834
|
+
key: 0,
|
|
831
835
|
id: vue.unref(titleId),
|
|
832
836
|
class: "tao-modal__title"
|
|
833
|
-
}, vue.toDisplayString(__props.title), 9, _hoisted_3$
|
|
837
|
+
}, vue.toDisplayString(__props.title), 9, _hoisted_3$n)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$k))
|
|
834
838
|
], true),
|
|
835
839
|
__props.closable ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
836
840
|
key: 0,
|
|
@@ -840,10 +844,10 @@
|
|
|
840
844
|
onClick: close
|
|
841
845
|
}, " × ")) : vue.createCommentVNode("", true)
|
|
842
846
|
])) : vue.createCommentVNode("", true),
|
|
843
|
-
vue.createElementVNode("div",
|
|
847
|
+
vue.createElementVNode("div", _hoisted_5$d, [
|
|
844
848
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
845
849
|
]),
|
|
846
|
-
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div",
|
|
850
|
+
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$9, [
|
|
847
851
|
vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
848
852
|
])) : vue.createCommentVNode("", true)
|
|
849
853
|
], 8, _hoisted_1$y)
|
|
@@ -855,10 +859,10 @@
|
|
|
855
859
|
};
|
|
856
860
|
}
|
|
857
861
|
});
|
|
858
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
862
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-0cffe849"]]);
|
|
859
863
|
const _hoisted_1$x = { class: "tao-tabs" };
|
|
860
864
|
const _hoisted_2$s = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
861
|
-
const _hoisted_3$
|
|
865
|
+
const _hoisted_3$m = ["id", "aria-labelledby"];
|
|
862
866
|
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
863
867
|
...{ name: "TaoTabs" },
|
|
864
868
|
__name: "TaoTabs",
|
|
@@ -958,13 +962,14 @@
|
|
|
958
962
|
"aria-labelledby": tabId(__props.modelValue)
|
|
959
963
|
}, [
|
|
960
964
|
vue.renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
|
|
961
|
-
], 8, _hoisted_3$
|
|
965
|
+
], 8, _hoisted_3$m)
|
|
962
966
|
]);
|
|
963
967
|
};
|
|
964
968
|
}
|
|
965
969
|
});
|
|
966
970
|
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-bf16735e"]]);
|
|
967
971
|
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
972
|
+
...{ name: "TaoTooltip" },
|
|
968
973
|
__name: "TaoTooltip",
|
|
969
974
|
props: {
|
|
970
975
|
content: {},
|
|
@@ -995,28 +1000,37 @@
|
|
|
995
1000
|
};
|
|
996
1001
|
}
|
|
997
1002
|
});
|
|
998
|
-
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-
|
|
1003
|
+
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-6f3b3c11"]]);
|
|
999
1004
|
const _hoisted_1$w = { class: "tao-spoiler" };
|
|
1000
|
-
const _hoisted_2$r =
|
|
1005
|
+
const _hoisted_2$r = ["aria-expanded", "aria-controls"];
|
|
1006
|
+
const _hoisted_3$l = {
|
|
1001
1007
|
key: 0,
|
|
1002
1008
|
class: "tao-spoiler__title"
|
|
1003
1009
|
};
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
class: "tao-spoiler__content"
|
|
1007
|
-
};
|
|
1008
|
-
const _hoisted_4$g = { class: "tao-spoiler__content-inner" };
|
|
1010
|
+
const _hoisted_4$j = ["id"];
|
|
1011
|
+
const _hoisted_5$c = { class: "tao-spoiler__content-inner" };
|
|
1009
1012
|
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
1013
|
+
...{ name: "TaoSpoiler" },
|
|
1010
1014
|
__name: "TaoSpoiler",
|
|
1011
1015
|
props: {
|
|
1012
1016
|
title: { default: "" },
|
|
1013
|
-
defaultOpen: { type: Boolean, default: false }
|
|
1017
|
+
defaultOpen: { type: Boolean, default: false },
|
|
1018
|
+
modelValue: { type: Boolean, default: void 0 }
|
|
1014
1019
|
},
|
|
1015
|
-
|
|
1020
|
+
emits: ["update:modelValue"],
|
|
1021
|
+
setup(__props, { emit: __emit }) {
|
|
1016
1022
|
const props = __props;
|
|
1017
|
-
const
|
|
1023
|
+
const emit = __emit;
|
|
1024
|
+
const panelId = vue.useId();
|
|
1025
|
+
const internal = vue.ref(props.defaultOpen);
|
|
1026
|
+
const isControlled = vue.computed(() => props.modelValue !== void 0);
|
|
1027
|
+
const isOpen = vue.computed(() => isControlled.value ? Boolean(props.modelValue) : internal.value);
|
|
1018
1028
|
function toggle() {
|
|
1019
|
-
|
|
1029
|
+
const next = !isOpen.value;
|
|
1030
|
+
if (!isControlled.value) {
|
|
1031
|
+
internal.value = next;
|
|
1032
|
+
}
|
|
1033
|
+
emit("update:modelValue", next);
|
|
1020
1034
|
}
|
|
1021
1035
|
function onBeforeEnter(el) {
|
|
1022
1036
|
el.style.height = "0";
|
|
@@ -1040,18 +1054,21 @@
|
|
|
1040
1054
|
return (_ctx, _cache) => {
|
|
1041
1055
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$w, [
|
|
1042
1056
|
vue.createElementVNode("button", {
|
|
1057
|
+
type: "button",
|
|
1043
1058
|
class: "tao-spoiler__header",
|
|
1059
|
+
"aria-expanded": isOpen.value,
|
|
1060
|
+
"aria-controls": vue.unref(panelId),
|
|
1044
1061
|
onClick: toggle
|
|
1045
1062
|
}, [
|
|
1046
1063
|
vue.createElementVNode("span", {
|
|
1047
1064
|
class: vue.normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
|
|
1048
1065
|
}, "▶", 2),
|
|
1049
|
-
__props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span",
|
|
1066
|
+
__props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$l, [
|
|
1050
1067
|
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1051
1068
|
vue.createTextVNode(vue.toDisplayString(__props.title), 1)
|
|
1052
1069
|
], true)
|
|
1053
1070
|
])) : vue.createCommentVNode("", true)
|
|
1054
|
-
]),
|
|
1071
|
+
], 8, _hoisted_2$r),
|
|
1055
1072
|
vue.createVNode(vue.Transition, {
|
|
1056
1073
|
name: "tao-spoiler-slide",
|
|
1057
1074
|
onBeforeEnter,
|
|
@@ -1060,11 +1077,15 @@
|
|
|
1060
1077
|
onLeave
|
|
1061
1078
|
}, {
|
|
1062
1079
|
default: vue.withCtx(() => [
|
|
1063
|
-
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div",
|
|
1064
|
-
|
|
1080
|
+
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1081
|
+
key: 0,
|
|
1082
|
+
id: vue.unref(panelId),
|
|
1083
|
+
class: "tao-spoiler__content"
|
|
1084
|
+
}, [
|
|
1085
|
+
vue.createElementVNode("div", _hoisted_5$c, [
|
|
1065
1086
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1066
1087
|
])
|
|
1067
|
-
])) : vue.createCommentVNode("", true)
|
|
1088
|
+
], 8, _hoisted_4$j)) : vue.createCommentVNode("", true)
|
|
1068
1089
|
]),
|
|
1069
1090
|
_: 3
|
|
1070
1091
|
})
|
|
@@ -1072,9 +1093,10 @@
|
|
|
1072
1093
|
};
|
|
1073
1094
|
}
|
|
1074
1095
|
});
|
|
1075
|
-
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
1096
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-c9f4d962"]]);
|
|
1076
1097
|
const _hoisted_1$v = { class: "tao-copy" };
|
|
1077
1098
|
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
1099
|
+
...{ name: "TaoCopy" },
|
|
1078
1100
|
__name: "TaoCopy",
|
|
1079
1101
|
props: {
|
|
1080
1102
|
text: {},
|
|
@@ -1103,6 +1125,7 @@
|
|
|
1103
1125
|
copied: copied.value
|
|
1104
1126
|
}, () => [
|
|
1105
1127
|
vue.createElementVNode("button", {
|
|
1128
|
+
type: "button",
|
|
1106
1129
|
class: vue.normalizeClass(["tao-copy__button", { "tao-copy__button--copied": copied.value }]),
|
|
1107
1130
|
onClick: copy
|
|
1108
1131
|
}, vue.toDisplayString(copied.value ? __props.successMessage : "Копировать"), 3)
|
|
@@ -1111,8 +1134,9 @@
|
|
|
1111
1134
|
};
|
|
1112
1135
|
}
|
|
1113
1136
|
});
|
|
1114
|
-
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
1137
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-73a42ad9"]]);
|
|
1115
1138
|
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
1139
|
+
...{ name: "TaoContainer" },
|
|
1116
1140
|
__name: "TaoContainer",
|
|
1117
1141
|
props: {
|
|
1118
1142
|
size: { default: "wide" },
|
|
@@ -1128,8 +1152,9 @@
|
|
|
1128
1152
|
};
|
|
1129
1153
|
}
|
|
1130
1154
|
});
|
|
1131
|
-
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-
|
|
1155
|
+
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-4c0deb90"]]);
|
|
1132
1156
|
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
1157
|
+
...{ name: "TaoFlex" },
|
|
1133
1158
|
__name: "TaoFlex",
|
|
1134
1159
|
props: {
|
|
1135
1160
|
tag: { default: "div" },
|
|
@@ -1160,6 +1185,7 @@
|
|
|
1160
1185
|
}
|
|
1161
1186
|
});
|
|
1162
1187
|
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
1188
|
+
...{ name: "TaoSpace" },
|
|
1163
1189
|
__name: "TaoSpace",
|
|
1164
1190
|
props: {
|
|
1165
1191
|
block: { type: Boolean, default: false },
|
|
@@ -1178,9 +1204,10 @@
|
|
|
1178
1204
|
};
|
|
1179
1205
|
}
|
|
1180
1206
|
});
|
|
1181
|
-
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-
|
|
1207
|
+
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-698ca712"]]);
|
|
1182
1208
|
const _hoisted_1$u = { class: "tao-icon" };
|
|
1183
1209
|
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
1210
|
+
...{ name: "TaoIcon" },
|
|
1184
1211
|
__name: "TaoIcon",
|
|
1185
1212
|
props: {
|
|
1186
1213
|
name: {},
|
|
@@ -1190,7 +1217,7 @@
|
|
|
1190
1217
|
},
|
|
1191
1218
|
setup(__props) {
|
|
1192
1219
|
vue.useCssVars((_ctx) => ({
|
|
1193
|
-
"
|
|
1220
|
+
"a2e86200": props.margin
|
|
1194
1221
|
}));
|
|
1195
1222
|
const props = __props;
|
|
1196
1223
|
return (_ctx, _cache) => {
|
|
@@ -1205,8 +1232,9 @@
|
|
|
1205
1232
|
};
|
|
1206
1233
|
}
|
|
1207
1234
|
});
|
|
1208
|
-
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-
|
|
1235
|
+
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-145b2cfc"]]);
|
|
1209
1236
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
1237
|
+
...{ name: "TaoLoader" },
|
|
1210
1238
|
__name: "TaoLoader",
|
|
1211
1239
|
props: {
|
|
1212
1240
|
color: { default: "var(--tao-color-accent)" },
|
|
@@ -1215,10 +1243,10 @@
|
|
|
1215
1243
|
},
|
|
1216
1244
|
setup(__props) {
|
|
1217
1245
|
vue.useCssVars((_ctx) => ({
|
|
1218
|
-
"
|
|
1219
|
-
"
|
|
1220
|
-
"
|
|
1221
|
-
"
|
|
1246
|
+
"d349d504": positions.value.first,
|
|
1247
|
+
"d1c06f96": positions.value.third,
|
|
1248
|
+
"v355d810c": positions.value.fourth,
|
|
1249
|
+
"v09447532": positions.value.animationDistance
|
|
1222
1250
|
}));
|
|
1223
1251
|
const props = __props;
|
|
1224
1252
|
const normalizedSize = vue.computed(() => {
|
|
@@ -1266,10 +1294,11 @@
|
|
|
1266
1294
|
};
|
|
1267
1295
|
}
|
|
1268
1296
|
});
|
|
1269
|
-
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
1297
|
+
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-75a40018"]]);
|
|
1270
1298
|
const _hoisted_1$t = { class: "tao-image" };
|
|
1271
1299
|
const _hoisted_2$q = ["src", "alt"];
|
|
1272
1300
|
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
1301
|
+
...{ name: "TaoImage" },
|
|
1273
1302
|
__name: "TaoImage",
|
|
1274
1303
|
props: {
|
|
1275
1304
|
src: { default: "" },
|
|
@@ -1309,40 +1338,47 @@
|
|
|
1309
1338
|
};
|
|
1310
1339
|
}
|
|
1311
1340
|
});
|
|
1312
|
-
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-
|
|
1313
|
-
const _hoisted_1$s = ["
|
|
1314
|
-
const _hoisted_2$p =
|
|
1341
|
+
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-9da4bb7d"]]);
|
|
1342
|
+
const _hoisted_1$s = ["for"];
|
|
1343
|
+
const _hoisted_2$p = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
1344
|
+
const _hoisted_3$k = {
|
|
1315
1345
|
key: 0,
|
|
1316
1346
|
class: "tao-checkbox__label"
|
|
1317
1347
|
};
|
|
1318
|
-
const
|
|
1348
|
+
const _hoisted_4$i = {
|
|
1319
1349
|
key: 1,
|
|
1320
1350
|
class: "tao-checkbox__label"
|
|
1321
1351
|
};
|
|
1322
1352
|
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
1353
|
+
...{ name: "TaoCheckbox" },
|
|
1323
1354
|
__name: "TaoCheckbox",
|
|
1324
1355
|
props: {
|
|
1325
1356
|
value: { type: Boolean, default: void 0 },
|
|
1326
1357
|
modelValue: { type: Boolean, default: void 0 },
|
|
1327
1358
|
label: { default: "" },
|
|
1328
|
-
disabled: { type: Boolean, default: false }
|
|
1359
|
+
disabled: { type: Boolean, default: false },
|
|
1360
|
+
error: { type: Boolean, default: false },
|
|
1361
|
+
indeterminate: { type: Boolean, default: false }
|
|
1329
1362
|
},
|
|
1330
1363
|
emits: ["update:modelValue", "change"],
|
|
1331
1364
|
setup(__props, { emit: __emit }) {
|
|
1332
1365
|
const props = __props;
|
|
1333
1366
|
const emit = __emit;
|
|
1367
|
+
const field = vue.inject(formFieldKey, null);
|
|
1368
|
+
const localId = vue.useId();
|
|
1369
|
+
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
1370
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
1371
|
+
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
1334
1372
|
const isChecked = vue.computed({
|
|
1335
1373
|
get: () => {
|
|
1336
1374
|
if (props.modelValue !== void 0) {
|
|
1337
1375
|
return props.modelValue;
|
|
1338
1376
|
}
|
|
1339
|
-
return props.value;
|
|
1377
|
+
return Boolean(props.value);
|
|
1340
1378
|
},
|
|
1341
|
-
set: (
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
}
|
|
1345
|
-
emit("change", value);
|
|
1379
|
+
set: (next) => {
|
|
1380
|
+
emit("update:modelValue", next);
|
|
1381
|
+
emit("change", next);
|
|
1346
1382
|
}
|
|
1347
1383
|
});
|
|
1348
1384
|
function onInputChange(event) {
|
|
@@ -1352,33 +1388,50 @@
|
|
|
1352
1388
|
const target = event.target;
|
|
1353
1389
|
isChecked.value = target.checked;
|
|
1354
1390
|
}
|
|
1391
|
+
const inputRef = vue.ref(null);
|
|
1392
|
+
vue.watch(
|
|
1393
|
+
[inputRef, isChecked, () => props.indeterminate],
|
|
1394
|
+
() => {
|
|
1395
|
+
const el = inputRef.value;
|
|
1396
|
+
if (!el) {
|
|
1397
|
+
return;
|
|
1398
|
+
}
|
|
1399
|
+
el.checked = isChecked.value;
|
|
1400
|
+
el.indeterminate = Boolean(props.indeterminate);
|
|
1401
|
+
},
|
|
1402
|
+
{ flush: "post" }
|
|
1403
|
+
);
|
|
1355
1404
|
return (_ctx, _cache) => {
|
|
1356
1405
|
return vue.openBlock(), vue.createElementBlock("label", {
|
|
1357
|
-
class: vue.normalizeClass(["tao-checkbox", { "tao-checkbox--disabled":
|
|
1406
|
+
class: vue.normalizeClass(["tao-checkbox", { "tao-checkbox--disabled": __props.disabled }]),
|
|
1407
|
+
for: controlId.value
|
|
1358
1408
|
}, [
|
|
1359
|
-
vue.renderSlot(_ctx.$slots, "pre", {
|
|
1360
|
-
text: props.label
|
|
1361
|
-
}, void 0, true),
|
|
1409
|
+
vue.renderSlot(_ctx.$slots, "pre", { text: __props.label }, void 0, true),
|
|
1362
1410
|
vue.createElementVNode("input", {
|
|
1411
|
+
id: controlId.value,
|
|
1412
|
+
ref_key: "inputRef",
|
|
1413
|
+
ref: inputRef,
|
|
1363
1414
|
class: "tao-checkbox__input tao-sr-only",
|
|
1364
1415
|
type: "checkbox",
|
|
1365
1416
|
checked: isChecked.value,
|
|
1366
|
-
disabled:
|
|
1417
|
+
disabled: __props.disabled,
|
|
1418
|
+
"aria-checked": __props.indeterminate ? "mixed" : void 0,
|
|
1419
|
+
"aria-invalid": invalid.value || void 0,
|
|
1420
|
+
"aria-describedby": describedBy.value,
|
|
1367
1421
|
onChange: onInputChange
|
|
1368
|
-
}, null, 40,
|
|
1422
|
+
}, null, 40, _hoisted_2$p),
|
|
1369
1423
|
_cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
|
|
1370
|
-
|
|
1424
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$k, vue.toDisplayString(__props.label), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$i, [
|
|
1371
1425
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1372
1426
|
])),
|
|
1373
|
-
vue.renderSlot(_ctx.$slots, "post", {
|
|
1374
|
-
|
|
1375
|
-
}, void 0, true)
|
|
1376
|
-
], 2);
|
|
1427
|
+
vue.renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
|
|
1428
|
+
], 10, _hoisted_1$s);
|
|
1377
1429
|
};
|
|
1378
1430
|
}
|
|
1379
1431
|
});
|
|
1380
|
-
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-
|
|
1432
|
+
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-f6b0e565"]]);
|
|
1381
1433
|
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
1434
|
+
...{ name: "TaoTag" },
|
|
1382
1435
|
__name: "TaoTag",
|
|
1383
1436
|
props: {
|
|
1384
1437
|
type: { default: "" },
|
|
@@ -1389,6 +1442,7 @@
|
|
|
1389
1442
|
},
|
|
1390
1443
|
setup(__props) {
|
|
1391
1444
|
const props = __props;
|
|
1445
|
+
const tone = vue.computed(() => props.type === "error" ? "danger" : props.type);
|
|
1392
1446
|
const style = vue.computed(() => ({
|
|
1393
1447
|
color: props.color || "",
|
|
1394
1448
|
background: props.background || "",
|
|
@@ -1396,7 +1450,7 @@
|
|
|
1396
1450
|
}));
|
|
1397
1451
|
return (_ctx, _cache) => {
|
|
1398
1452
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1399
|
-
class: vue.normalizeClass(["tao-tag", [props.pointer && "tao-tag--pointer",
|
|
1453
|
+
class: vue.normalizeClass(["tao-tag", [props.pointer && "tao-tag--pointer", tone.value ? `tao-tag--${tone.value}` : ""]]),
|
|
1400
1454
|
style: vue.normalizeStyle(style.value)
|
|
1401
1455
|
}, [
|
|
1402
1456
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -1404,39 +1458,43 @@
|
|
|
1404
1458
|
};
|
|
1405
1459
|
}
|
|
1406
1460
|
});
|
|
1407
|
-
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
1461
|
+
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-290c0f6a"]]);
|
|
1408
1462
|
const _hoisted_1$r = {
|
|
1409
1463
|
key: 1,
|
|
1410
1464
|
class: "tao-divider-text"
|
|
1411
1465
|
};
|
|
1412
1466
|
const _hoisted_2$o = { class: "tao-divider-text__value" };
|
|
1413
|
-
const _hoisted_3$
|
|
1467
|
+
const _hoisted_3$j = {
|
|
1414
1468
|
key: 2,
|
|
1415
1469
|
class: "tao-divider-line"
|
|
1416
1470
|
};
|
|
1417
1471
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
1472
|
+
...{ name: "TaoDivider" },
|
|
1418
1473
|
__name: "TaoDivider",
|
|
1419
1474
|
props: {
|
|
1420
1475
|
variant: { default: "line" },
|
|
1421
1476
|
size: { default: "medium" }
|
|
1422
1477
|
},
|
|
1423
1478
|
setup(__props) {
|
|
1479
|
+
const props = __props;
|
|
1480
|
+
const gapSize = vue.computed(() => props.size === "big" ? "large" : props.size);
|
|
1424
1481
|
return (_ctx, _cache) => {
|
|
1425
1482
|
return __props.variant === "gap" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1426
1483
|
key: 0,
|
|
1427
|
-
class: vue.normalizeClass(["tao-divider-gap", `tao-divider-gap--${
|
|
1484
|
+
class: vue.normalizeClass(["tao-divider-gap", `tao-divider-gap--${gapSize.value}`])
|
|
1428
1485
|
}, null, 2)) : __props.variant === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$r, [
|
|
1429
1486
|
_cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--left" }, null, -1)),
|
|
1430
1487
|
vue.createElementVNode("span", _hoisted_2$o, [
|
|
1431
1488
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1432
1489
|
]),
|
|
1433
1490
|
_cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--right" }, null, -1))
|
|
1434
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
1491
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$j));
|
|
1435
1492
|
};
|
|
1436
1493
|
}
|
|
1437
1494
|
});
|
|
1438
|
-
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-
|
|
1495
|
+
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-8187a15d"]]);
|
|
1439
1496
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
1497
|
+
...{ name: "TaoAnimatedBorder" },
|
|
1440
1498
|
__name: "TaoAnimatedBorder",
|
|
1441
1499
|
props: {
|
|
1442
1500
|
borderWidth: { default: 3 },
|
|
@@ -1459,13 +1517,19 @@
|
|
|
1459
1517
|
};
|
|
1460
1518
|
}
|
|
1461
1519
|
});
|
|
1462
|
-
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
1520
|
+
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-f1534571"]]);
|
|
1463
1521
|
const _hoisted_1$q = {
|
|
1464
1522
|
key: 0,
|
|
1465
1523
|
class: "tao-textarea tao-textarea--dummy"
|
|
1466
1524
|
};
|
|
1467
|
-
const _hoisted_2$n =
|
|
1525
|
+
const _hoisted_2$n = {
|
|
1526
|
+
key: 1,
|
|
1527
|
+
class: "tao-textarea-wrap"
|
|
1528
|
+
};
|
|
1529
|
+
const _hoisted_3$i = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
1530
|
+
const _hoisted_4$h = ["id"];
|
|
1468
1531
|
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
1532
|
+
...{ name: "TaoTextarea" },
|
|
1469
1533
|
__name: "TaoTextarea",
|
|
1470
1534
|
props: {
|
|
1471
1535
|
placeholder: { default: "" },
|
|
@@ -1484,12 +1548,34 @@
|
|
|
1484
1548
|
autoFocus: { type: Boolean, default: false },
|
|
1485
1549
|
borderInverse: { type: Boolean, default: false },
|
|
1486
1550
|
textCenter: { type: Boolean, default: false },
|
|
1487
|
-
submitOnEnter: { type: Boolean, default: false }
|
|
1551
|
+
submitOnEnter: { type: Boolean, default: false },
|
|
1552
|
+
error: { type: Boolean, default: false },
|
|
1553
|
+
id: {},
|
|
1554
|
+
count: { type: Boolean, default: false }
|
|
1488
1555
|
},
|
|
1489
1556
|
emits: ["update:modelValue", "change", "focus", "blur", "keydown"],
|
|
1490
1557
|
setup(__props, { emit: __emit }) {
|
|
1491
1558
|
const props = __props;
|
|
1492
1559
|
const emit = __emit;
|
|
1560
|
+
const field = vue.inject(formFieldKey, null);
|
|
1561
|
+
const localId = vue.useId();
|
|
1562
|
+
const controlId = vue.computed(() => props.id || (field == null ? void 0 : field.id) || localId);
|
|
1563
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
1564
|
+
const counterId = vue.computed(() => `${controlId.value}-count`);
|
|
1565
|
+
const describedBy = vue.computed(() => {
|
|
1566
|
+
const ids = [field == null ? void 0 : field.describedBy.value, props.count ? counterId.value : void 0].filter(Boolean);
|
|
1567
|
+
return ids.length ? ids.join(" ") : void 0;
|
|
1568
|
+
});
|
|
1569
|
+
const currentLength = vue.computed(() => String(props.modelValue ?? "").length);
|
|
1570
|
+
const countLabel = vue.computed(() => {
|
|
1571
|
+
if (props.maxlength != null && props.maxlength > 0) {
|
|
1572
|
+
return `${currentLength.value} / ${props.maxlength}`;
|
|
1573
|
+
}
|
|
1574
|
+
return String(currentLength.value);
|
|
1575
|
+
});
|
|
1576
|
+
const atLimit = vue.computed(
|
|
1577
|
+
() => props.maxlength != null && props.maxlength > 0 && currentLength.value >= props.maxlength
|
|
1578
|
+
);
|
|
1493
1579
|
const textareaRef = vue.ref(null);
|
|
1494
1580
|
function onInput(e) {
|
|
1495
1581
|
const target = e.target;
|
|
@@ -1525,9 +1611,12 @@
|
|
|
1525
1611
|
textarea.style.height = "auto";
|
|
1526
1612
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 500)}px`;
|
|
1527
1613
|
}
|
|
1528
|
-
vue.watch(
|
|
1529
|
-
|
|
1530
|
-
|
|
1614
|
+
vue.watch(
|
|
1615
|
+
() => props.modelValue,
|
|
1616
|
+
() => {
|
|
1617
|
+
vue.nextTick(autoResize);
|
|
1618
|
+
}
|
|
1619
|
+
);
|
|
1531
1620
|
vue.onMounted(() => {
|
|
1532
1621
|
var _a;
|
|
1533
1622
|
if (props.autoFocus) {
|
|
@@ -1536,40 +1625,51 @@
|
|
|
1536
1625
|
vue.nextTick(autoResize);
|
|
1537
1626
|
});
|
|
1538
1627
|
return (_ctx, _cache) => {
|
|
1539
|
-
return
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
"tao-textarea
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1628
|
+
return __props.dummy ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$q, vue.toDisplayString(__props.modelValue), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$n, [
|
|
1629
|
+
vue.createElementVNode("textarea", {
|
|
1630
|
+
id: controlId.value,
|
|
1631
|
+
ref_key: "textareaRef",
|
|
1632
|
+
ref: textareaRef,
|
|
1633
|
+
class: vue.normalizeClass(["tao-textarea", {
|
|
1634
|
+
"tao-textarea--inverse": __props.borderInverse,
|
|
1635
|
+
"tao-textarea--center": __props.textCenter,
|
|
1636
|
+
"tao-textarea--no-border": __props.noBorder,
|
|
1637
|
+
"tao-textarea--no-background": __props.noBackground,
|
|
1638
|
+
"tao-textarea--no-resize": !__props.resize,
|
|
1639
|
+
"tao-textarea--invalid": invalid.value
|
|
1640
|
+
}]),
|
|
1641
|
+
placeholder: __props.placeholder,
|
|
1642
|
+
spellcheck: __props.spellcheck,
|
|
1643
|
+
autocomplete: __props.autocomplete,
|
|
1644
|
+
minlength: __props.minlength,
|
|
1645
|
+
maxlength: __props.maxlength,
|
|
1646
|
+
disabled: __props.disabled,
|
|
1647
|
+
rows: __props.rows,
|
|
1648
|
+
value: __props.modelValue,
|
|
1649
|
+
"aria-invalid": invalid.value || void 0,
|
|
1650
|
+
"aria-describedby": describedBy.value,
|
|
1651
|
+
draggable: "false",
|
|
1652
|
+
onInput,
|
|
1653
|
+
onChange,
|
|
1654
|
+
onFocus,
|
|
1655
|
+
onBlur,
|
|
1656
|
+
onKeydown
|
|
1657
|
+
}, null, 42, _hoisted_3$i),
|
|
1658
|
+
__props.count ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1659
|
+
key: 0,
|
|
1660
|
+
id: counterId.value,
|
|
1661
|
+
class: vue.normalizeClass(["tao-textarea__count", { "tao-textarea__count--limit": atLimit.value }])
|
|
1662
|
+
}, vue.toDisplayString(countLabel.value), 11, _hoisted_4$h)) : vue.createCommentVNode("", true)
|
|
1663
|
+
]));
|
|
1565
1664
|
};
|
|
1566
1665
|
}
|
|
1567
1666
|
});
|
|
1568
|
-
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-
|
|
1667
|
+
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-2534c0c4"]]);
|
|
1569
1668
|
const _hoisted_1$p = ["tabindex"];
|
|
1570
1669
|
const _hoisted_2$m = { class: "tao-scroll-top__content" };
|
|
1571
1670
|
const RIPPLE_DURATION = 750;
|
|
1572
1671
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
1672
|
+
...{ name: "TaoScrollTop" },
|
|
1573
1673
|
__name: "TaoScrollTop",
|
|
1574
1674
|
props: {
|
|
1575
1675
|
size: { default: 40 },
|
|
@@ -1661,10 +1761,11 @@
|
|
|
1661
1761
|
default: vue.withCtx(() => [
|
|
1662
1762
|
isActive.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
1663
1763
|
key: 0,
|
|
1764
|
+
type: "button",
|
|
1664
1765
|
style: vue.normalizeStyle(mainStyle),
|
|
1665
1766
|
tabindex: props.tabindex,
|
|
1666
1767
|
class: vue.normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline": !props.hasOutline }]),
|
|
1667
|
-
"aria-label": "
|
|
1768
|
+
"aria-label": "Наверх",
|
|
1668
1769
|
onClick: vue.withModifiers(onClick, ["prevent"])
|
|
1669
1770
|
}, [
|
|
1670
1771
|
vue.createElementVNode("div", _hoisted_2$m, [
|
|
@@ -1691,62 +1792,94 @@
|
|
|
1691
1792
|
};
|
|
1692
1793
|
}
|
|
1693
1794
|
});
|
|
1694
|
-
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-
|
|
1795
|
+
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-ce902f42"]]);
|
|
1695
1796
|
const _hoisted_1$o = { class: "tao-progress" };
|
|
1696
1797
|
const _hoisted_2$l = {
|
|
1697
1798
|
key: 0,
|
|
1698
1799
|
class: "tao-progress__side"
|
|
1699
1800
|
};
|
|
1700
|
-
const _hoisted_3$
|
|
1701
|
-
const _hoisted_4$
|
|
1801
|
+
const _hoisted_3$h = { class: "tao-progress__main" };
|
|
1802
|
+
const _hoisted_4$g = {
|
|
1803
|
+
key: 0,
|
|
1804
|
+
class: "tao-progress__percentage"
|
|
1805
|
+
};
|
|
1806
|
+
const _hoisted_5$b = {
|
|
1807
|
+
key: 1,
|
|
1808
|
+
class: "tao-progress__side"
|
|
1809
|
+
};
|
|
1810
|
+
const _hoisted_6$8 = {
|
|
1702
1811
|
key: 0,
|
|
1703
1812
|
class: "tao-progress__percentage"
|
|
1704
1813
|
};
|
|
1705
1814
|
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
1815
|
+
...{ name: "TaoProgress" },
|
|
1706
1816
|
__name: "TaoProgress",
|
|
1707
1817
|
props: {
|
|
1708
|
-
|
|
1709
|
-
|
|
1818
|
+
minWidth: { default: void 0 },
|
|
1819
|
+
maxWidth: { default: void 0 },
|
|
1820
|
+
min: { default: void 0 },
|
|
1821
|
+
max: { default: void 0 },
|
|
1710
1822
|
progress: { default: 0 },
|
|
1711
1823
|
height: { default: 8 },
|
|
1712
|
-
showPercentage: { type: Boolean, default:
|
|
1824
|
+
showPercentage: { type: [Boolean, String], default: true },
|
|
1713
1825
|
animated: { type: Boolean, default: true }
|
|
1714
1826
|
},
|
|
1715
1827
|
setup(__props) {
|
|
1828
|
+
const props = __props;
|
|
1829
|
+
const slots = vue.useSlots();
|
|
1830
|
+
const minW = vue.computed(() => props.minWidth ?? props.min ?? 200);
|
|
1831
|
+
const maxW = vue.computed(() => props.maxWidth ?? props.max ?? 400);
|
|
1832
|
+
const hasRight = vue.computed(() => Boolean(slots.right));
|
|
1833
|
+
const percentPlace = vue.computed(() => {
|
|
1834
|
+
if (!props.showPercentage) {
|
|
1835
|
+
return null;
|
|
1836
|
+
}
|
|
1837
|
+
return props.showPercentage === "right" ? "right" : "top";
|
|
1838
|
+
});
|
|
1839
|
+
const showOverPercent = vue.computed(() => percentPlace.value === "top");
|
|
1840
|
+
const showEndPercent = vue.computed(() => percentPlace.value === "right");
|
|
1841
|
+
const endPercentLabel = vue.computed(
|
|
1842
|
+
() => hasRight.value ? `(${props.progress}%)` : `${props.progress}%`
|
|
1843
|
+
);
|
|
1716
1844
|
return (_ctx, _cache) => {
|
|
1717
1845
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
1718
1846
|
vue.createElementVNode("div", {
|
|
1719
|
-
class: "tao-progress__container",
|
|
1720
|
-
style: vue.normalizeStyle({ minWidth: `${
|
|
1847
|
+
class: vue.normalizeClass(["tao-progress__container", { "tao-progress__container--over": showOverPercent.value }]),
|
|
1848
|
+
style: vue.normalizeStyle({ minWidth: `${minW.value}px`, maxWidth: `${maxW.value}px` })
|
|
1721
1849
|
}, [
|
|
1722
1850
|
_ctx.$slots.left ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$l, [
|
|
1723
1851
|
vue.renderSlot(_ctx.$slots, "left", {}, void 0, true)
|
|
1724
1852
|
])) : vue.createCommentVNode("", true),
|
|
1725
|
-
vue.createElementVNode("div",
|
|
1726
|
-
|
|
1727
|
-
style: vue.normalizeStyle({ height: `${__props.height}px` })
|
|
1728
|
-
}, [
|
|
1853
|
+
vue.createElementVNode("div", _hoisted_3$h, [
|
|
1854
|
+
showOverPercent.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$g, vue.toDisplayString(__props.progress) + "%", 1)) : vue.createCommentVNode("", true),
|
|
1729
1855
|
vue.createElementVNode("div", {
|
|
1730
|
-
class:
|
|
1731
|
-
style: vue.normalizeStyle({
|
|
1732
|
-
},
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1856
|
+
class: "tao-progress__track",
|
|
1857
|
+
style: vue.normalizeStyle({ height: `${__props.height}px` })
|
|
1858
|
+
}, [
|
|
1859
|
+
vue.createElementVNode("div", {
|
|
1860
|
+
class: vue.normalizeClass(["tao-progress__fill", { "tao-progress__fill--animated": __props.animated }]),
|
|
1861
|
+
style: vue.normalizeStyle({ width: `${__props.progress}%` })
|
|
1862
|
+
}, null, 6)
|
|
1863
|
+
], 4)
|
|
1864
|
+
]),
|
|
1865
|
+
_ctx.$slots.right || showEndPercent.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$b, [
|
|
1866
|
+
vue.renderSlot(_ctx.$slots, "right", {}, void 0, true),
|
|
1867
|
+
showEndPercent.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$8, vue.toDisplayString(endPercentLabel.value), 1)) : vue.createCommentVNode("", true)
|
|
1868
|
+
])) : vue.createCommentVNode("", true)
|
|
1869
|
+
], 6)
|
|
1739
1870
|
]);
|
|
1740
1871
|
};
|
|
1741
1872
|
}
|
|
1742
1873
|
});
|
|
1743
|
-
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
1744
|
-
const _hoisted_1$n = ["
|
|
1745
|
-
const _hoisted_2$k =
|
|
1874
|
+
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-54c13718"]]);
|
|
1875
|
+
const _hoisted_1$n = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-describedby"];
|
|
1876
|
+
const _hoisted_2$k = ["placeholder"];
|
|
1877
|
+
const _hoisted_3$g = {
|
|
1746
1878
|
key: 1,
|
|
1747
1879
|
class: "tao-slider__value"
|
|
1748
1880
|
};
|
|
1749
1881
|
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
1882
|
+
...{ name: "TaoSlider" },
|
|
1750
1883
|
__name: "TaoSlider",
|
|
1751
1884
|
props: {
|
|
1752
1885
|
min: { default: 0 },
|
|
@@ -1754,18 +1887,25 @@
|
|
|
1754
1887
|
step: { default: 1 },
|
|
1755
1888
|
showValue: { type: Boolean, default: false },
|
|
1756
1889
|
placeholder: { default: "" },
|
|
1757
|
-
modelValue: {}
|
|
1890
|
+
modelValue: {},
|
|
1891
|
+
disabled: { type: Boolean, default: false }
|
|
1758
1892
|
},
|
|
1759
1893
|
emits: ["update:modelValue"],
|
|
1760
1894
|
setup(__props, { emit: __emit }) {
|
|
1761
1895
|
const props = __props;
|
|
1762
1896
|
const emit = __emit;
|
|
1897
|
+
const field = vue.inject(formFieldKey, null);
|
|
1898
|
+
const localId = vue.useId();
|
|
1899
|
+
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
1900
|
+
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
1763
1901
|
function packModelValue(value) {
|
|
1764
1902
|
return typeof props.modelValue === "string" ? `${value}` : value;
|
|
1765
1903
|
}
|
|
1766
1904
|
function unpackModelValue() {
|
|
1767
|
-
|
|
1905
|
+
const raw = typeof props.modelValue === "string" ? parseFloat(props.modelValue) : props.modelValue;
|
|
1906
|
+
return Number.isFinite(raw) ? raw : props.min;
|
|
1768
1907
|
}
|
|
1908
|
+
const current = vue.computed(() => unpackModelValue());
|
|
1769
1909
|
const trackRef = vue.ref(null);
|
|
1770
1910
|
const isDragging = vue.ref(false);
|
|
1771
1911
|
const shadowInputRef = vue.ref(null);
|
|
@@ -1773,11 +1913,17 @@
|
|
|
1773
1913
|
const showShadowModel = vue.ref(false);
|
|
1774
1914
|
const progressPercent = vue.computed(() => {
|
|
1775
1915
|
const range = props.max - props.min;
|
|
1776
|
-
|
|
1916
|
+
if (range <= 0) {
|
|
1917
|
+
return 0;
|
|
1918
|
+
}
|
|
1919
|
+
return (current.value - props.min) / range * 100;
|
|
1777
1920
|
});
|
|
1778
1921
|
function clampValue(v) {
|
|
1779
1922
|
return Math.min(Math.max(v, props.min), props.max);
|
|
1780
1923
|
}
|
|
1924
|
+
function commit(value) {
|
|
1925
|
+
emit("update:modelValue", packModelValue(clampValue(value)));
|
|
1926
|
+
}
|
|
1781
1927
|
function calculateValue(event) {
|
|
1782
1928
|
if (!trackRef.value) {
|
|
1783
1929
|
return props.min;
|
|
@@ -1785,12 +1931,15 @@
|
|
|
1785
1931
|
const rect = trackRef.value.getBoundingClientRect();
|
|
1786
1932
|
const clientX = "touches" in event ? event.touches[0].clientX : event.clientX;
|
|
1787
1933
|
const x = Math.min(Math.max(clientX - rect.left, 0), rect.width);
|
|
1788
|
-
const ratio = x / rect.width;
|
|
1789
|
-
const v =
|
|
1934
|
+
const ratio = rect.width ? x / rect.width : 0;
|
|
1935
|
+
const v = props.min + ratio * (props.max - props.min);
|
|
1790
1936
|
return clampValue(Math.round((v - props.min) / props.step) * props.step + props.min);
|
|
1791
1937
|
}
|
|
1792
1938
|
function handleMove(event) {
|
|
1793
|
-
|
|
1939
|
+
if (props.disabled) {
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
commit(calculateValue(event));
|
|
1794
1943
|
}
|
|
1795
1944
|
function onMouseUp(event) {
|
|
1796
1945
|
const evBtn = "touches" in event ? void 0 : event.button;
|
|
@@ -1800,6 +1949,9 @@
|
|
|
1800
1949
|
isDragging.value = false;
|
|
1801
1950
|
}
|
|
1802
1951
|
function onMouseDown(event) {
|
|
1952
|
+
if (props.disabled) {
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1803
1955
|
const evBtn = "touches" in event ? void 0 : event.button;
|
|
1804
1956
|
if (typeof evBtn !== "undefined" && evBtn !== 0 || showShadowModel.value) {
|
|
1805
1957
|
return;
|
|
@@ -1814,6 +1966,33 @@
|
|
|
1814
1966
|
}
|
|
1815
1967
|
handleMove(event);
|
|
1816
1968
|
}
|
|
1969
|
+
function onKeydown(event) {
|
|
1970
|
+
if (props.disabled || showShadowModel.value) {
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
const keys = {
|
|
1974
|
+
ArrowLeft: -props.step,
|
|
1975
|
+
ArrowDown: -props.step,
|
|
1976
|
+
ArrowRight: props.step,
|
|
1977
|
+
ArrowUp: props.step,
|
|
1978
|
+
PageDown: -props.step * 10,
|
|
1979
|
+
PageUp: props.step * 10
|
|
1980
|
+
};
|
|
1981
|
+
if (event.key in keys) {
|
|
1982
|
+
event.preventDefault();
|
|
1983
|
+
commit(current.value + keys[event.key]);
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
if (event.key === "Home") {
|
|
1987
|
+
event.preventDefault();
|
|
1988
|
+
commit(props.min);
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
if (event.key === "End") {
|
|
1992
|
+
event.preventDefault();
|
|
1993
|
+
commit(props.max);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1817
1996
|
function onBlurShadowModel() {
|
|
1818
1997
|
if (shadowModel.value) {
|
|
1819
1998
|
const newValue = packModelValue(clampValue(parseFloat(shadowModel.value) || 0));
|
|
@@ -1829,14 +2008,15 @@
|
|
|
1829
2008
|
}
|
|
1830
2009
|
}
|
|
1831
2010
|
function onContextMenu() {
|
|
1832
|
-
if (props.showValue) {
|
|
1833
|
-
|
|
1834
|
-
showShadowModel.value = true;
|
|
1835
|
-
requestAnimationFrame(() => {
|
|
1836
|
-
var _a;
|
|
1837
|
-
return (_a = shadowInputRef.value) == null ? void 0 : _a.focus();
|
|
1838
|
-
});
|
|
2011
|
+
if (props.disabled || !props.showValue) {
|
|
2012
|
+
return;
|
|
1839
2013
|
}
|
|
2014
|
+
shadowModel.value = `${props.modelValue}`;
|
|
2015
|
+
showShadowModel.value = true;
|
|
2016
|
+
requestAnimationFrame(() => {
|
|
2017
|
+
var _a;
|
|
2018
|
+
return (_a = shadowInputRef.value) == null ? void 0 : _a.focus();
|
|
2019
|
+
});
|
|
1840
2020
|
}
|
|
1841
2021
|
vue.onMounted(() => {
|
|
1842
2022
|
window.addEventListener("mouseleave", onMouseUp);
|
|
@@ -1854,12 +2034,21 @@
|
|
|
1854
2034
|
});
|
|
1855
2035
|
return (_ctx, _cache) => {
|
|
1856
2036
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2037
|
+
id: controlId.value,
|
|
1857
2038
|
ref_key: "trackRef",
|
|
1858
2039
|
ref: trackRef,
|
|
1859
|
-
class: vue.normalizeClass(["tao-slider", { "tao-slider--show-value": __props.showValue }]),
|
|
2040
|
+
class: vue.normalizeClass(["tao-slider", { "tao-slider--show-value": __props.showValue, "tao-slider--disabled": __props.disabled }]),
|
|
2041
|
+
role: "slider",
|
|
2042
|
+
tabindex: __props.disabled ? -1 : 0,
|
|
2043
|
+
"aria-valuemin": __props.min,
|
|
2044
|
+
"aria-valuemax": __props.max,
|
|
2045
|
+
"aria-valuenow": current.value,
|
|
2046
|
+
"aria-disabled": __props.disabled || void 0,
|
|
2047
|
+
"aria-describedby": describedBy.value,
|
|
1860
2048
|
onContextmenu: vue.withModifiers(onContextMenu, ["prevent"]),
|
|
1861
2049
|
onMousedown: onMouseDown,
|
|
1862
|
-
onTouchstart: onMouseDown
|
|
2050
|
+
onTouchstart: onMouseDown,
|
|
2051
|
+
onKeydown
|
|
1863
2052
|
}, [
|
|
1864
2053
|
_cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
|
|
1865
2054
|
vue.createElementVNode("div", {
|
|
@@ -1883,21 +2072,22 @@
|
|
|
1883
2072
|
onKeydown: onShadowKeydown,
|
|
1884
2073
|
onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
1885
2074
|
}, ["stop"]))
|
|
1886
|
-
}, null, 40,
|
|
2075
|
+
}, null, 40, _hoisted_2$k)), [
|
|
1887
2076
|
[vue.vModelText, shadowModel.value]
|
|
1888
|
-
]) : __props.showValue ? (vue.openBlock(), vue.createElementBlock("div",
|
|
2077
|
+
]) : __props.showValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$g, [
|
|
1889
2078
|
vue.renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
|
|
1890
2079
|
vue.createTextVNode(vue.toDisplayString(__props.modelValue), 1),
|
|
1891
2080
|
vue.renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
|
|
1892
2081
|
])) : vue.createCommentVNode("", true)
|
|
1893
|
-
],
|
|
2082
|
+
], 42, _hoisted_1$n);
|
|
1894
2083
|
};
|
|
1895
2084
|
}
|
|
1896
2085
|
});
|
|
1897
|
-
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
2086
|
+
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-241d1042"]]);
|
|
1898
2087
|
const _hoisted_1$m = { class: "tao-file-drop" };
|
|
1899
2088
|
const _hoisted_2$j = ["accept", "multiple"];
|
|
1900
2089
|
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
2090
|
+
...{ name: "TaoFileDrop" },
|
|
1901
2091
|
__name: "TaoFileDrop",
|
|
1902
2092
|
props: {
|
|
1903
2093
|
modelValue: { default: () => [] },
|
|
@@ -1937,10 +2127,6 @@
|
|
|
1937
2127
|
function requestClear() {
|
|
1938
2128
|
emit("clear-request");
|
|
1939
2129
|
}
|
|
1940
|
-
function triggerFileInput() {
|
|
1941
|
-
var _a;
|
|
1942
|
-
(_a = fileInput.value) == null ? void 0 : _a.click();
|
|
1943
|
-
}
|
|
1944
2130
|
function processFiles(fileList) {
|
|
1945
2131
|
const files = Array.from(fileList);
|
|
1946
2132
|
const result = !props.multiple && files.length > 1 ? [files[0]] : files;
|
|
@@ -1958,40 +2144,42 @@
|
|
|
1958
2144
|
key: 0,
|
|
1959
2145
|
type: "button",
|
|
1960
2146
|
class: "tao-file-drop__clear",
|
|
2147
|
+
"aria-label": "Очистить файлы",
|
|
1961
2148
|
onClick: requestClear
|
|
1962
2149
|
}, " ✕ ")) : vue.createCommentVNode("", true),
|
|
1963
|
-
vue.createElementVNode("
|
|
2150
|
+
vue.createElementVNode("label", {
|
|
1964
2151
|
class: vue.normalizeClass(["tao-file-drop__zone", [`tao-file-drop__zone--${__props.size}`, { "tao-file-drop__zone--dragging": isDragging.value }]]),
|
|
1965
2152
|
onDragover: handleDragOver,
|
|
1966
2153
|
onDragleave: handleDragLeave,
|
|
1967
|
-
onDrop: handleDrop
|
|
1968
|
-
onClick: triggerFileInput
|
|
2154
|
+
onDrop: handleDrop
|
|
1969
2155
|
}, [
|
|
1970
2156
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1971
|
-
_cache[
|
|
2157
|
+
_cache[1] || (_cache[1] = vue.createTextVNode("Перетащите файл сюда или нажмите, чтобы выбрать", -1))
|
|
1972
2158
|
], true),
|
|
1973
2159
|
vue.createElementVNode("input", {
|
|
1974
2160
|
ref_key: "fileInput",
|
|
1975
2161
|
ref: fileInput,
|
|
2162
|
+
class: "tao-sr-only",
|
|
1976
2163
|
type: "file",
|
|
1977
|
-
hidden: "",
|
|
1978
2164
|
accept: __props.accept,
|
|
1979
2165
|
multiple: __props.multiple,
|
|
1980
|
-
onChange: handleFileSelect
|
|
2166
|
+
onChange: handleFileSelect,
|
|
2167
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
2168
|
+
}, ["stop"]))
|
|
1981
2169
|
}, null, 40, _hoisted_2$j)
|
|
1982
2170
|
], 34)
|
|
1983
2171
|
]);
|
|
1984
2172
|
};
|
|
1985
2173
|
}
|
|
1986
2174
|
});
|
|
1987
|
-
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
2175
|
+
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-3543419a"]]);
|
|
1988
2176
|
const _hoisted_1$l = ["aria-expanded"];
|
|
1989
2177
|
const _hoisted_2$i = {
|
|
1990
2178
|
key: 1,
|
|
1991
2179
|
"aria-label": "Меню"
|
|
1992
2180
|
};
|
|
1993
2181
|
const _hoisted_3$f = ["onClick", "onMouseenter"];
|
|
1994
|
-
const _hoisted_4$
|
|
2182
|
+
const _hoisted_4$f = { key: 1 };
|
|
1995
2183
|
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
1996
2184
|
...{ name: "TaoDropdownMenu" },
|
|
1997
2185
|
__name: "TaoDropdownMenu",
|
|
@@ -2153,7 +2341,7 @@
|
|
|
2153
2341
|
id: action.id,
|
|
2154
2342
|
ico: action.ico,
|
|
2155
2343
|
text: action.name
|
|
2156
|
-
}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
2344
|
+
}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$f, vue.toDisplayString(action.name), 1))
|
|
2157
2345
|
], 42, _hoisted_3$f);
|
|
2158
2346
|
}), 128))
|
|
2159
2347
|
], 36)) : vue.createCommentVNode("", true)
|
|
@@ -2162,133 +2350,185 @@
|
|
|
2162
2350
|
};
|
|
2163
2351
|
}
|
|
2164
2352
|
});
|
|
2165
|
-
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
2166
|
-
const _hoisted_1$k =
|
|
2167
|
-
const _hoisted_2$h = ["value", "placeholder", "type", "inputmode", "pattern", "onInput", "onKeydown", "onFocus"];
|
|
2353
|
+
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-420a7e63"]]);
|
|
2354
|
+
const _hoisted_1$k = ["aria-invalid", "aria-describedby"];
|
|
2355
|
+
const _hoisted_2$h = ["id", "value", "placeholder", "type", "inputmode", "pattern", "onInput", "onKeydown", "onFocus"];
|
|
2168
2356
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
2357
|
+
...{ name: "TaoPinCode" },
|
|
2169
2358
|
__name: "TaoPinCode",
|
|
2170
2359
|
props: {
|
|
2171
2360
|
length: {},
|
|
2172
2361
|
hidden: { type: Boolean, default: false },
|
|
2173
2362
|
placeholder: { default: "" },
|
|
2174
|
-
modelValue: {},
|
|
2175
|
-
numbersOnly: { type: Boolean, default: false }
|
|
2363
|
+
modelValue: { default: "" },
|
|
2364
|
+
numbersOnly: { type: Boolean, default: false },
|
|
2365
|
+
clearOn: { default: "focus" }
|
|
2176
2366
|
},
|
|
2177
|
-
emits: ["update:modelValue", "change", "active", "blur"],
|
|
2367
|
+
emits: ["update:modelValue", "change", "complete", "active", "blur"],
|
|
2178
2368
|
setup(__props, { emit: __emit }) {
|
|
2179
2369
|
const props = __props;
|
|
2180
2370
|
const emit = __emit;
|
|
2181
|
-
|
|
2371
|
+
const field = vue.inject(formFieldKey, null);
|
|
2372
|
+
const localId = vue.useId();
|
|
2373
|
+
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
2374
|
+
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
2375
|
+
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
2182
2376
|
const numbers = vue.ref([]);
|
|
2183
2377
|
const inputRefs = vue.ref([]);
|
|
2184
2378
|
const activeNumber = vue.ref(-1);
|
|
2379
|
+
function acceptChar(ch) {
|
|
2380
|
+
if (!ch) {
|
|
2381
|
+
return "";
|
|
2382
|
+
}
|
|
2383
|
+
if (props.numbersOnly && !/^[0-9]$/.test(ch)) {
|
|
2384
|
+
return "";
|
|
2385
|
+
}
|
|
2386
|
+
return ch;
|
|
2387
|
+
}
|
|
2388
|
+
function cellsFromModel(value) {
|
|
2389
|
+
const raw = value ?? "";
|
|
2390
|
+
return Array.from({ length: props.length }, (_, index) => acceptChar(raw[index] ?? ""));
|
|
2391
|
+
}
|
|
2392
|
+
function serialize() {
|
|
2393
|
+
return numbers.value.join("");
|
|
2394
|
+
}
|
|
2185
2395
|
function emitChange() {
|
|
2186
|
-
const
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
emit("change", curPinCode);
|
|
2396
|
+
const next = serialize();
|
|
2397
|
+
if (next !== (props.modelValue ?? "")) {
|
|
2398
|
+
emit("update:modelValue", next);
|
|
2399
|
+
emit("change", next);
|
|
2191
2400
|
}
|
|
2192
|
-
emit("update:modelValue", s);
|
|
2193
2401
|
}
|
|
2194
|
-
function
|
|
2195
|
-
|
|
2196
|
-
|
|
2402
|
+
function firstEmptyIndex() {
|
|
2403
|
+
const index = numbers.value.findIndex((cell) => !cell);
|
|
2404
|
+
return index === -1 ? numbers.value.length : index;
|
|
2197
2405
|
}
|
|
2198
|
-
function
|
|
2199
|
-
|
|
2200
|
-
inputRefs.value
|
|
2201
|
-
|
|
2406
|
+
function focusCell(index) {
|
|
2407
|
+
var _a;
|
|
2408
|
+
(_a = inputRefs.value[index]) == null ? void 0 : _a.focus();
|
|
2409
|
+
}
|
|
2410
|
+
function isFilled() {
|
|
2411
|
+
return numbers.value.length === props.length && numbers.value.every((cell) => cell !== "");
|
|
2202
2412
|
}
|
|
2203
2413
|
function mutation(v, index) {
|
|
2204
|
-
var _a
|
|
2414
|
+
var _a;
|
|
2415
|
+
const char = v.length > 1 ? v[v.length - 1] ?? "" : v;
|
|
2416
|
+
const next = acceptChar(char);
|
|
2417
|
+
if (props.numbersOnly && char && !next) {
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2205
2420
|
numbers.value = [...numbers.value];
|
|
2206
|
-
|
|
2207
|
-
|
|
2421
|
+
numbers.value[index] = next;
|
|
2422
|
+
emitChange();
|
|
2423
|
+
if (!next) {
|
|
2424
|
+
return;
|
|
2208
2425
|
}
|
|
2209
|
-
if (
|
|
2210
|
-
|
|
2426
|
+
if (isFilled()) {
|
|
2427
|
+
(_a = inputRefs.value[index]) == null ? void 0 : _a.blur();
|
|
2428
|
+
emit("complete", serialize());
|
|
2211
2429
|
return;
|
|
2212
2430
|
}
|
|
2213
|
-
numbers.value
|
|
2214
|
-
const
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
}
|
|
2218
|
-
return index + 1;
|
|
2219
|
-
};
|
|
2220
|
-
const nextIndex = getNextIdx();
|
|
2221
|
-
if (nextIndex !== -1 && !numbers.value[nextIndex]) {
|
|
2222
|
-
const el = inputRefs.value[nextIndex];
|
|
2223
|
-
if (el) {
|
|
2224
|
-
el.focus();
|
|
2225
|
-
} else {
|
|
2226
|
-
(_a = inputRefs.value[index]) == null ? void 0 : _a.blur();
|
|
2227
|
-
emitBlur();
|
|
2228
|
-
}
|
|
2229
|
-
} else {
|
|
2230
|
-
(_b = inputRefs.value[index]) == null ? void 0 : _b.blur();
|
|
2231
|
-
emitBlur();
|
|
2431
|
+
const nextEmpty = numbers.value.findIndex((cell, cellIndex) => cellIndex > index && !cell);
|
|
2432
|
+
const target = nextEmpty !== -1 ? nextEmpty : index + 1;
|
|
2433
|
+
if (target < props.length) {
|
|
2434
|
+
focusCell(target);
|
|
2232
2435
|
}
|
|
2233
|
-
emitChange();
|
|
2234
2436
|
}
|
|
2235
2437
|
function onFocus(index) {
|
|
2236
|
-
|
|
2237
|
-
|
|
2438
|
+
if (props.clearOn === "input") {
|
|
2439
|
+
const firstEmpty = firstEmptyIndex();
|
|
2440
|
+
if (firstEmpty < props.length && index > firstEmpty) {
|
|
2441
|
+
focusCell(firstEmpty);
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
2444
|
+
activeNumber.value = index;
|
|
2445
|
+
emit("active", inputRefs.value[index] ?? null, index);
|
|
2446
|
+
requestAnimationFrame(() => {
|
|
2447
|
+
var _a;
|
|
2448
|
+
return (_a = inputRefs.value[index]) == null ? void 0 : _a.select();
|
|
2449
|
+
});
|
|
2450
|
+
return;
|
|
2451
|
+
}
|
|
2452
|
+
numbers.value = numbers.value.map((cell, cellIndex) => cellIndex >= index ? "" : cell);
|
|
2238
2453
|
activeNumber.value = index;
|
|
2239
2454
|
emitChange();
|
|
2240
|
-
emit("active", inputRefs.value[index], index);
|
|
2455
|
+
emit("active", inputRefs.value[index] ?? null, index);
|
|
2241
2456
|
}
|
|
2242
2457
|
function onChange(e, index) {
|
|
2243
|
-
|
|
2244
|
-
mutation(v, index);
|
|
2458
|
+
mutation(e.target.value, index);
|
|
2245
2459
|
}
|
|
2246
2460
|
function onKeydown(event, index) {
|
|
2247
2461
|
if (event.key !== "Backspace") {
|
|
2248
2462
|
return;
|
|
2249
2463
|
}
|
|
2250
|
-
if (
|
|
2464
|
+
if (numbers.value[index]) {
|
|
2465
|
+
return;
|
|
2466
|
+
}
|
|
2467
|
+
if (index > 0) {
|
|
2251
2468
|
event.preventDefault();
|
|
2252
2469
|
numbers.value = [...numbers.value];
|
|
2253
2470
|
numbers.value[index - 1] = "";
|
|
2254
|
-
|
|
2255
|
-
prevEl == null ? void 0 : prevEl.focus();
|
|
2471
|
+
focusCell(index - 1);
|
|
2256
2472
|
activeNumber.value = index - 1;
|
|
2257
2473
|
emitChange();
|
|
2258
2474
|
}
|
|
2259
2475
|
}
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2476
|
+
function onBlur() {
|
|
2477
|
+
requestAnimationFrame(() => {
|
|
2478
|
+
const active = document.activeElement;
|
|
2479
|
+
if (!inputRefs.value.includes(active)) {
|
|
2480
|
+
activeNumber.value = -1;
|
|
2481
|
+
emit("blur");
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
vue.watch(
|
|
2486
|
+
() => [props.modelValue, props.length, props.numbersOnly],
|
|
2487
|
+
() => {
|
|
2488
|
+
const next = cellsFromModel(props.modelValue ?? "");
|
|
2489
|
+
if (next.join("") !== numbers.value.join("") || next.length !== numbers.value.length) {
|
|
2490
|
+
numbers.value = next;
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
{ immediate: true }
|
|
2494
|
+
);
|
|
2267
2495
|
return (_ctx, _cache) => {
|
|
2268
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
2496
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2497
|
+
class: "tao-pin-code",
|
|
2498
|
+
role: "group",
|
|
2499
|
+
"aria-invalid": invalid.value || void 0,
|
|
2500
|
+
"aria-describedby": describedBy.value
|
|
2501
|
+
}, [
|
|
2269
2502
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(numbers.value, (num, index) => {
|
|
2270
2503
|
return vue.openBlock(), vue.createElementBlock("input", {
|
|
2504
|
+
id: index === 0 ? controlId.value : void 0,
|
|
2271
2505
|
key: index,
|
|
2272
2506
|
ref_for: true,
|
|
2273
2507
|
ref: (el) => inputRefs.value[index] = el,
|
|
2274
|
-
class: vue.normalizeClass(["tao-pin-code__value", {
|
|
2508
|
+
class: vue.normalizeClass(["tao-pin-code__value", {
|
|
2509
|
+
"tao-pin-code__value--active": activeNumber.value === index,
|
|
2510
|
+
"tao-pin-code__value--invalid": invalid.value
|
|
2511
|
+
}]),
|
|
2275
2512
|
value: num,
|
|
2276
2513
|
placeholder: __props.placeholder,
|
|
2277
2514
|
type: __props.hidden ? "password" : "text",
|
|
2278
2515
|
inputmode: __props.numbersOnly ? "numeric" : "text",
|
|
2279
2516
|
pattern: __props.numbersOnly ? "[0-9]" : void 0,
|
|
2517
|
+
autocomplete: "one-time-code",
|
|
2280
2518
|
maxlength: "1",
|
|
2281
2519
|
onInput: ($event) => onChange($event, index),
|
|
2282
2520
|
onKeydown: ($event) => onKeydown($event, index),
|
|
2283
|
-
onFocus: ($event) => onFocus(index)
|
|
2521
|
+
onFocus: ($event) => onFocus(index),
|
|
2522
|
+
onBlur
|
|
2284
2523
|
}, null, 42, _hoisted_2$h);
|
|
2285
2524
|
}), 128))
|
|
2286
|
-
]);
|
|
2525
|
+
], 8, _hoisted_1$k);
|
|
2287
2526
|
};
|
|
2288
2527
|
}
|
|
2289
2528
|
});
|
|
2290
|
-
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-
|
|
2529
|
+
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-c3182673"]]);
|
|
2291
2530
|
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
2531
|
+
...{ name: "TaoLink" },
|
|
2292
2532
|
__name: "TaoLink",
|
|
2293
2533
|
props: {
|
|
2294
2534
|
to: { default: void 0 },
|
|
@@ -2385,7 +2625,7 @@
|
|
|
2385
2625
|
const _hoisted_1$i = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
2386
2626
|
const _hoisted_2$g = { class: "tao-select__value" };
|
|
2387
2627
|
const _hoisted_3$e = ["aria-activedescendant"];
|
|
2388
|
-
const _hoisted_4$
|
|
2628
|
+
const _hoisted_4$e = ["id", "aria-selected", "aria-disabled", "data-tao-select-index", "onClick", "onMouseenter"];
|
|
2389
2629
|
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2390
2630
|
...{ name: "TaoSelect" },
|
|
2391
2631
|
__name: "TaoSelect",
|
|
@@ -2409,6 +2649,7 @@
|
|
|
2409
2649
|
const open = vue.ref(false);
|
|
2410
2650
|
const activeIndex = vue.ref(-1);
|
|
2411
2651
|
const triggerRef = vue.ref(null);
|
|
2652
|
+
const panelRef = vue.ref(null);
|
|
2412
2653
|
const listRef = vue.ref(null);
|
|
2413
2654
|
const listStyle = vue.ref({ top: "0px", left: "0px", width: "0px" });
|
|
2414
2655
|
const selected = vue.computed(() => props.options.find((option) => option.value === props.modelValue) ?? null);
|
|
@@ -2417,17 +2658,17 @@
|
|
|
2417
2658
|
);
|
|
2418
2659
|
function updatePosition() {
|
|
2419
2660
|
const trigger = triggerRef.value;
|
|
2420
|
-
const
|
|
2421
|
-
if (!trigger || !
|
|
2661
|
+
const panel = panelRef.value;
|
|
2662
|
+
if (!trigger || !panel) {
|
|
2422
2663
|
return;
|
|
2423
2664
|
}
|
|
2424
2665
|
const rect = trigger.getBoundingClientRect();
|
|
2425
|
-
const
|
|
2666
|
+
const panelHeight = panel.offsetHeight;
|
|
2426
2667
|
const gap = 4;
|
|
2427
2668
|
const spaceBelow = window.innerHeight - rect.bottom - gap;
|
|
2428
|
-
const openUp = spaceBelow <
|
|
2669
|
+
const openUp = spaceBelow < panelHeight && rect.top > spaceBelow;
|
|
2429
2670
|
listStyle.value = {
|
|
2430
|
-
top: `${openUp ? rect.top -
|
|
2671
|
+
top: `${openUp ? rect.top - panelHeight - gap : rect.bottom + gap}px`,
|
|
2431
2672
|
left: `${rect.left}px`,
|
|
2432
2673
|
width: `${rect.width}px`
|
|
2433
2674
|
};
|
|
@@ -2464,6 +2705,13 @@
|
|
|
2464
2705
|
close();
|
|
2465
2706
|
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
2466
2707
|
}
|
|
2708
|
+
function clear() {
|
|
2709
|
+
var _a;
|
|
2710
|
+
emit("update:modelValue", null);
|
|
2711
|
+
emit("change", null);
|
|
2712
|
+
close();
|
|
2713
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
2714
|
+
}
|
|
2467
2715
|
function moveActive(delta) {
|
|
2468
2716
|
const enabled = enabledIndexes.value;
|
|
2469
2717
|
if (!enabled.length) {
|
|
@@ -2486,6 +2734,11 @@
|
|
|
2486
2734
|
if (props.disabled) {
|
|
2487
2735
|
return;
|
|
2488
2736
|
}
|
|
2737
|
+
if ((event.key === "Backspace" || event.key === "Delete") && selected.value) {
|
|
2738
|
+
event.preventDefault();
|
|
2739
|
+
clear();
|
|
2740
|
+
return;
|
|
2741
|
+
}
|
|
2489
2742
|
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
|
|
2490
2743
|
event.preventDefault();
|
|
2491
2744
|
void setOpen(true);
|
|
@@ -2521,6 +2774,13 @@
|
|
|
2521
2774
|
scrollActiveIntoView();
|
|
2522
2775
|
return;
|
|
2523
2776
|
}
|
|
2777
|
+
if (event.key === "Backspace" || event.key === "Delete") {
|
|
2778
|
+
if (selected.value) {
|
|
2779
|
+
event.preventDefault();
|
|
2780
|
+
clear();
|
|
2781
|
+
}
|
|
2782
|
+
return;
|
|
2783
|
+
}
|
|
2524
2784
|
if (event.key === "Enter" || event.key === " ") {
|
|
2525
2785
|
event.preventDefault();
|
|
2526
2786
|
const option = props.options[activeIndex.value];
|
|
@@ -2532,7 +2792,7 @@
|
|
|
2532
2792
|
function onDocumentPointer(event) {
|
|
2533
2793
|
var _a, _b;
|
|
2534
2794
|
const target = event.target;
|
|
2535
|
-
if (((_a = triggerRef.value) == null ? void 0 : _a.contains(target)) || ((_b =
|
|
2795
|
+
if (((_a = triggerRef.value) == null ? void 0 : _a.contains(target)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(target))) {
|
|
2536
2796
|
return;
|
|
2537
2797
|
}
|
|
2538
2798
|
close();
|
|
@@ -2580,50 +2840,64 @@
|
|
|
2580
2840
|
onKeydown: onTriggerKeydown
|
|
2581
2841
|
}, [
|
|
2582
2842
|
vue.createElementVNode("span", _hoisted_2$g, vue.toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? __props.placeholder), 1),
|
|
2583
|
-
_cache[
|
|
2843
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("span", {
|
|
2584
2844
|
class: "tao-select__chevron",
|
|
2585
2845
|
"aria-hidden": "true"
|
|
2586
2846
|
}, null, -1))
|
|
2587
2847
|
], 42, _hoisted_1$i),
|
|
2588
2848
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
2589
|
-
open.value ? (vue.openBlock(), vue.createElementBlock("
|
|
2849
|
+
open.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2590
2850
|
key: 0,
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
role: "listbox",
|
|
2596
|
-
tabindex: "-1",
|
|
2597
|
-
"aria-activedescendant": activeIndex.value >= 0 ? `${listId}-opt-${activeIndex.value}` : void 0,
|
|
2598
|
-
style: vue.normalizeStyle(listStyle.value),
|
|
2599
|
-
onKeydown: onListKeydown
|
|
2851
|
+
ref_key: "panelRef",
|
|
2852
|
+
ref: panelRef,
|
|
2853
|
+
class: "tao-select__panel",
|
|
2854
|
+
style: vue.normalizeStyle(listStyle.value)
|
|
2600
2855
|
}, [
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2856
|
+
vue.createElementVNode("ul", {
|
|
2857
|
+
id: listId,
|
|
2858
|
+
ref_key: "listRef",
|
|
2859
|
+
ref: listRef,
|
|
2860
|
+
class: "tao-select__list",
|
|
2861
|
+
role: "listbox",
|
|
2862
|
+
tabindex: "-1",
|
|
2863
|
+
"aria-activedescendant": activeIndex.value >= 0 ? `${listId}-opt-${activeIndex.value}` : void 0,
|
|
2864
|
+
onKeydown: onListKeydown
|
|
2865
|
+
}, [
|
|
2866
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (option, index) => {
|
|
2867
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
2868
|
+
id: `${listId}-opt-${index}`,
|
|
2869
|
+
key: String(option.value),
|
|
2870
|
+
class: vue.normalizeClass(["tao-select__option", {
|
|
2871
|
+
"tao-select__option--active": index === activeIndex.value,
|
|
2872
|
+
"tao-select__option--selected": option.value === __props.modelValue,
|
|
2873
|
+
"tao-select__option--disabled": option.disabled
|
|
2874
|
+
}]),
|
|
2875
|
+
role: "option",
|
|
2876
|
+
"aria-selected": option.value === __props.modelValue,
|
|
2877
|
+
"aria-disabled": option.disabled || void 0,
|
|
2878
|
+
"data-tao-select-index": index,
|
|
2879
|
+
onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
2880
|
+
}, ["prevent"])),
|
|
2881
|
+
onClick: ($event) => selectOption(option),
|
|
2882
|
+
onMouseenter: ($event) => !option.disabled && (activeIndex.value = index)
|
|
2883
|
+
}, vue.toDisplayString(option.label), 43, _hoisted_4$e);
|
|
2884
|
+
}), 128))
|
|
2885
|
+
], 40, _hoisted_3$e),
|
|
2886
|
+
selected.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
2887
|
+
key: 0,
|
|
2888
|
+
type: "button",
|
|
2889
|
+
class: "tao-select__clear",
|
|
2890
|
+
onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
2891
|
+
}, ["prevent"])),
|
|
2892
|
+
onClick: clear
|
|
2893
|
+
}, " Очистить ", 32)) : vue.createCommentVNode("", true)
|
|
2894
|
+
], 4)) : vue.createCommentVNode("", true)
|
|
2621
2895
|
]))
|
|
2622
2896
|
], 2);
|
|
2623
2897
|
};
|
|
2624
2898
|
}
|
|
2625
2899
|
});
|
|
2626
|
-
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
2900
|
+
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-42551757"]]);
|
|
2627
2901
|
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
2628
2902
|
function formatTaoDateIso(parts) {
|
|
2629
2903
|
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
@@ -2724,8 +2998,8 @@
|
|
|
2724
2998
|
const _hoisted_1$h = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
2725
2999
|
const _hoisted_2$f = { class: "tao-date__value" };
|
|
2726
3000
|
const _hoisted_3$d = ["aria-label"];
|
|
2727
|
-
const _hoisted_4$
|
|
2728
|
-
const _hoisted_5$
|
|
3001
|
+
const _hoisted_4$d = { class: "tao-date__header" };
|
|
3002
|
+
const _hoisted_5$a = { class: "tao-date__month" };
|
|
2729
3003
|
const _hoisted_6$7 = {
|
|
2730
3004
|
class: "tao-date__weekdays",
|
|
2731
3005
|
"aria-hidden": "true"
|
|
@@ -3008,7 +3282,7 @@
|
|
|
3008
3282
|
style: vue.normalizeStyle(panelStyle.value),
|
|
3009
3283
|
onKeydown: onPanelKeydown
|
|
3010
3284
|
}, [
|
|
3011
|
-
vue.createElementVNode("div", _hoisted_4$
|
|
3285
|
+
vue.createElementVNode("div", _hoisted_4$d, [
|
|
3012
3286
|
vue.createElementVNode("button", {
|
|
3013
3287
|
type: "button",
|
|
3014
3288
|
class: "tao-date__nav",
|
|
@@ -3032,7 +3306,7 @@
|
|
|
3032
3306
|
})
|
|
3033
3307
|
], -1)
|
|
3034
3308
|
])]),
|
|
3035
|
-
vue.createElementVNode("p", _hoisted_5$
|
|
3309
|
+
vue.createElementVNode("p", _hoisted_5$a, vue.toDisplayString(monthLabel.value), 1),
|
|
3036
3310
|
vue.createElementVNode("button", {
|
|
3037
3311
|
type: "button",
|
|
3038
3312
|
class: "tao-date__nav",
|
|
@@ -3103,14 +3377,14 @@
|
|
|
3103
3377
|
};
|
|
3104
3378
|
}
|
|
3105
3379
|
});
|
|
3106
|
-
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
3380
|
+
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-4227e5f8"]]);
|
|
3107
3381
|
const _hoisted_1$g = ["for"];
|
|
3108
3382
|
const _hoisted_2$e = ["id", "checked", "disabled", "aria-checked"];
|
|
3109
3383
|
const _hoisted_3$c = {
|
|
3110
3384
|
key: 0,
|
|
3111
3385
|
class: "tao-switch__label"
|
|
3112
3386
|
};
|
|
3113
|
-
const _hoisted_4$
|
|
3387
|
+
const _hoisted_4$c = {
|
|
3114
3388
|
key: 1,
|
|
3115
3389
|
class: "tao-switch__label"
|
|
3116
3390
|
};
|
|
@@ -3158,7 +3432,7 @@
|
|
|
3158
3432
|
}, [
|
|
3159
3433
|
vue.createElementVNode("span", { class: "tao-switch__thumb" })
|
|
3160
3434
|
], -1)),
|
|
3161
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$c, vue.toDisplayString(__props.label), 1)) : _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
3435
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$c, vue.toDisplayString(__props.label), 1)) : _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$c, [
|
|
3162
3436
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3163
3437
|
])) : vue.createCommentVNode("", true)
|
|
3164
3438
|
], 10, _hoisted_1$g);
|
|
@@ -3173,7 +3447,7 @@
|
|
|
3173
3447
|
key: 0,
|
|
3174
3448
|
class: "tao-radio__label"
|
|
3175
3449
|
};
|
|
3176
|
-
const _hoisted_4$
|
|
3450
|
+
const _hoisted_4$b = {
|
|
3177
3451
|
key: 1,
|
|
3178
3452
|
class: "tao-radio__label"
|
|
3179
3453
|
};
|
|
@@ -3229,7 +3503,7 @@
|
|
|
3229
3503
|
class: "tao-radio__dot",
|
|
3230
3504
|
"aria-hidden": "true"
|
|
3231
3505
|
}, null, -1)),
|
|
3232
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$b, vue.toDisplayString(__props.label), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
3506
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$b, vue.toDisplayString(__props.label), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$b, [
|
|
3233
3507
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3234
3508
|
]))
|
|
3235
3509
|
], 10, _hoisted_1$f);
|
|
@@ -3288,7 +3562,7 @@
|
|
|
3288
3562
|
key: 0,
|
|
3289
3563
|
class: "tao-alert__title"
|
|
3290
3564
|
};
|
|
3291
|
-
const _hoisted_4$
|
|
3565
|
+
const _hoisted_4$a = {
|
|
3292
3566
|
key: 1,
|
|
3293
3567
|
class: "tao-alert__message"
|
|
3294
3568
|
};
|
|
@@ -3304,16 +3578,17 @@
|
|
|
3304
3578
|
setup(__props, { emit: __emit }) {
|
|
3305
3579
|
const props = __props;
|
|
3306
3580
|
const emit = __emit;
|
|
3307
|
-
const
|
|
3581
|
+
const tone = vue.computed(() => props.type === "danger" ? "error" : props.type);
|
|
3582
|
+
const live = vue.computed(() => tone.value === "error" || tone.value === "warning" ? "assertive" : "polite");
|
|
3308
3583
|
return (_ctx, _cache) => {
|
|
3309
3584
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3310
|
-
class: vue.normalizeClass(["tao-alert", `tao-alert--${
|
|
3311
|
-
role:
|
|
3585
|
+
class: vue.normalizeClass(["tao-alert", `tao-alert--${tone.value}`]),
|
|
3586
|
+
role: tone.value === "error" ? "alert" : "status",
|
|
3312
3587
|
"aria-live": live.value
|
|
3313
3588
|
}, [
|
|
3314
3589
|
vue.createElementVNode("div", _hoisted_2$b, [
|
|
3315
3590
|
__props.title ? (vue.openBlock(), vue.createElementBlock("strong", _hoisted_3$a, vue.toDisplayString(__props.title), 1)) : vue.createCommentVNode("", true),
|
|
3316
|
-
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$
|
|
3591
|
+
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$a, [
|
|
3317
3592
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3318
3593
|
])) : vue.createCommentVNode("", true)
|
|
3319
3594
|
]),
|
|
@@ -3328,12 +3603,12 @@
|
|
|
3328
3603
|
};
|
|
3329
3604
|
}
|
|
3330
3605
|
});
|
|
3331
|
-
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
3606
|
+
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-4c89fa1f"]]);
|
|
3332
3607
|
const _hoisted_1$c = { key: 0 };
|
|
3333
3608
|
const _hoisted_2$a = ["aria-sort"];
|
|
3334
3609
|
const _hoisted_3$9 = ["onClick"];
|
|
3335
|
-
const _hoisted_4$
|
|
3336
|
-
const _hoisted_5$
|
|
3610
|
+
const _hoisted_4$9 = { key: 1 };
|
|
3611
|
+
const _hoisted_5$9 = { key: 0 };
|
|
3337
3612
|
const _hoisted_6$6 = ["colspan"];
|
|
3338
3613
|
const _hoisted_7$4 = ["onClick"];
|
|
3339
3614
|
const _hoisted_8$4 = {
|
|
@@ -3446,13 +3721,13 @@
|
|
|
3446
3721
|
}]),
|
|
3447
3722
|
"aria-hidden": "true"
|
|
3448
3723
|
}, null, 2)
|
|
3449
|
-
], 8, _hoisted_3$9)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
3724
|
+
], 8, _hoisted_3$9)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$9, vue.toDisplayString(column.label), 1))
|
|
3450
3725
|
], 12, _hoisted_2$a);
|
|
3451
3726
|
}), 128))
|
|
3452
3727
|
])
|
|
3453
3728
|
]),
|
|
3454
3729
|
vue.createElementVNode("tbody", null, [
|
|
3455
|
-
isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_5$
|
|
3730
|
+
isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_5$9, [
|
|
3456
3731
|
vue.createElementVNode("td", {
|
|
3457
3732
|
class: "tao-table__empty",
|
|
3458
3733
|
colspan: colCount.value
|
|
@@ -3533,8 +3808,8 @@
|
|
|
3533
3808
|
class: "tao-pagination__total"
|
|
3534
3809
|
};
|
|
3535
3810
|
const _hoisted_3$8 = { class: "tao-pagination__pages" };
|
|
3536
|
-
const _hoisted_4$
|
|
3537
|
-
const _hoisted_5$
|
|
3811
|
+
const _hoisted_4$8 = ["disabled"];
|
|
3812
|
+
const _hoisted_5$8 = ["aria-label", "disabled", "onClick"];
|
|
3538
3813
|
const _hoisted_6$5 = {
|
|
3539
3814
|
key: 1,
|
|
3540
3815
|
class: "tao-pagination__ellipsis",
|
|
@@ -3600,7 +3875,7 @@
|
|
|
3600
3875
|
"aria-label": "Назад",
|
|
3601
3876
|
disabled: __props.disabled || current.value <= 1,
|
|
3602
3877
|
onClick: _cache[0] || (_cache[0] = ($event) => goTo(current.value - 1))
|
|
3603
|
-
}, " ‹ ", 8, _hoisted_4$
|
|
3878
|
+
}, " ‹ ", 8, _hoisted_4$8),
|
|
3604
3879
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item) => {
|
|
3605
3880
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
3606
3881
|
key: item.type === "page" ? item.page : item.id
|
|
@@ -3612,7 +3887,7 @@
|
|
|
3612
3887
|
"aria-label": item.id === "left" ? `Назад на ${__props.jump} страниц` : `Вперёд на ${__props.jump} страниц`,
|
|
3613
3888
|
disabled: __props.disabled,
|
|
3614
3889
|
onClick: ($event) => goTo(item.id === "left" ? current.value - __props.jump : current.value + __props.jump)
|
|
3615
|
-
}, " … ", 8, _hoisted_5$
|
|
3890
|
+
}, " … ", 8, _hoisted_5$8)) : item.type === "ellipsis" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$5, "…")) : (vue.openBlock(), vue.createElementBlock("button", {
|
|
3616
3891
|
key: 2,
|
|
3617
3892
|
type: "button",
|
|
3618
3893
|
class: vue.normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page === current.value }]),
|
|
@@ -3645,11 +3920,11 @@
|
|
|
3645
3920
|
key: 1,
|
|
3646
3921
|
class: "tao-empty__title"
|
|
3647
3922
|
};
|
|
3648
|
-
const _hoisted_4$
|
|
3923
|
+
const _hoisted_4$7 = {
|
|
3649
3924
|
key: 2,
|
|
3650
3925
|
class: "tao-empty__text"
|
|
3651
3926
|
};
|
|
3652
|
-
const _hoisted_5$
|
|
3927
|
+
const _hoisted_5$7 = {
|
|
3653
3928
|
key: 3,
|
|
3654
3929
|
class: "tao-empty__action"
|
|
3655
3930
|
};
|
|
@@ -3666,10 +3941,10 @@
|
|
|
3666
3941
|
vue.renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
3667
3942
|
])) : vue.createCommentVNode("", true),
|
|
3668
3943
|
__props.title ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3$7, vue.toDisplayString(__props.title), 1)) : vue.createCommentVNode("", true),
|
|
3669
|
-
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$
|
|
3944
|
+
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$7, [
|
|
3670
3945
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3671
3946
|
])) : vue.createCommentVNode("", true),
|
|
3672
|
-
_ctx.$slots.action ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$
|
|
3947
|
+
_ctx.$slots.action ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7, [
|
|
3673
3948
|
vue.renderSlot(_ctx.$slots, "action", {}, void 0, true)
|
|
3674
3949
|
])) : vue.createCommentVNode("", true)
|
|
3675
3950
|
]);
|
|
@@ -3713,8 +3988,8 @@
|
|
|
3713
3988
|
class: "tao-drawer__header"
|
|
3714
3989
|
};
|
|
3715
3990
|
const _hoisted_3$6 = ["id"];
|
|
3716
|
-
const _hoisted_4$
|
|
3717
|
-
const _hoisted_5$
|
|
3991
|
+
const _hoisted_4$6 = { key: 1 };
|
|
3992
|
+
const _hoisted_5$6 = { class: "tao-drawer__content" };
|
|
3718
3993
|
const _hoisted_6$4 = {
|
|
3719
3994
|
key: 1,
|
|
3720
3995
|
class: "tao-drawer__footer"
|
|
@@ -3830,7 +4105,7 @@
|
|
|
3830
4105
|
key: 0,
|
|
3831
4106
|
id: vue.unref(titleId),
|
|
3832
4107
|
class: "tao-drawer__title"
|
|
3833
|
-
}, vue.toDisplayString(__props.title), 9, _hoisted_3$6)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
4108
|
+
}, vue.toDisplayString(__props.title), 9, _hoisted_3$6)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$6)),
|
|
3834
4109
|
__props.closable ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
3835
4110
|
key: 2,
|
|
3836
4111
|
type: "button",
|
|
@@ -3839,7 +4114,7 @@
|
|
|
3839
4114
|
onClick: close
|
|
3840
4115
|
}, " × ")) : vue.createCommentVNode("", true)
|
|
3841
4116
|
])) : vue.createCommentVNode("", true),
|
|
3842
|
-
vue.createElementVNode("div", _hoisted_5$
|
|
4117
|
+
vue.createElementVNode("div", _hoisted_5$6, [
|
|
3843
4118
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3844
4119
|
]),
|
|
3845
4120
|
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$4, [
|
|
@@ -3856,8 +4131,14 @@
|
|
|
3856
4131
|
});
|
|
3857
4132
|
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-6a0c0e98"]]);
|
|
3858
4133
|
const _hoisted_1$7 = ["title"];
|
|
3859
|
-
const _hoisted_2$6 =
|
|
3860
|
-
const _hoisted_3$5 = ["
|
|
4134
|
+
const _hoisted_2$6 = { class: "tao-avatar__face" };
|
|
4135
|
+
const _hoisted_3$5 = ["src", "alt"];
|
|
4136
|
+
const _hoisted_4$5 = ["aria-label"];
|
|
4137
|
+
const _hoisted_5$5 = {
|
|
4138
|
+
key: 1,
|
|
4139
|
+
class: "tao-avatar__badge",
|
|
4140
|
+
"aria-hidden": "true"
|
|
4141
|
+
};
|
|
3861
4142
|
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
3862
4143
|
...{ name: "TaoAvatar" },
|
|
3863
4144
|
__name: "TaoAvatar",
|
|
@@ -3865,10 +4146,21 @@
|
|
|
3865
4146
|
src: { default: "" },
|
|
3866
4147
|
name: { default: "" },
|
|
3867
4148
|
alt: { default: "" },
|
|
3868
|
-
size: { default: "
|
|
4149
|
+
size: { default: "medium" },
|
|
4150
|
+
dot: { type: [Boolean, String], default: false },
|
|
4151
|
+
count: { default: void 0 }
|
|
3869
4152
|
},
|
|
3870
4153
|
setup(__props) {
|
|
3871
4154
|
const props = __props;
|
|
4155
|
+
const sizeClass = vue.computed(() => {
|
|
4156
|
+
if (props.size === "small" || props.size === "s") {
|
|
4157
|
+
return "s";
|
|
4158
|
+
}
|
|
4159
|
+
if (props.size === "large" || props.size === "l") {
|
|
4160
|
+
return "l";
|
|
4161
|
+
}
|
|
4162
|
+
return "m";
|
|
4163
|
+
});
|
|
3872
4164
|
const initials = vue.computed(() => {
|
|
3873
4165
|
const parts = props.name.trim().split(/\s+/).filter(Boolean);
|
|
3874
4166
|
if (!parts.length) {
|
|
@@ -3879,27 +4171,74 @@
|
|
|
3879
4171
|
}
|
|
3880
4172
|
return `${parts[0][0] ?? ""}${parts[1][0] ?? ""}`.toUpperCase();
|
|
3881
4173
|
});
|
|
3882
|
-
const
|
|
4174
|
+
const dotTone = vue.computed(() => {
|
|
4175
|
+
if (!props.dot) {
|
|
4176
|
+
return null;
|
|
4177
|
+
}
|
|
4178
|
+
if (props.dot === true) {
|
|
4179
|
+
return "success";
|
|
4180
|
+
}
|
|
4181
|
+
return props.dot === "error" ? "danger" : props.dot;
|
|
4182
|
+
});
|
|
4183
|
+
const badge = vue.computed(() => {
|
|
4184
|
+
if (props.count === void 0 || props.count === "") {
|
|
4185
|
+
return "";
|
|
4186
|
+
}
|
|
4187
|
+
const numeric = typeof props.count === "number" ? props.count : Number(props.count);
|
|
4188
|
+
if (Number.isFinite(numeric)) {
|
|
4189
|
+
if (numeric <= 0) {
|
|
4190
|
+
return "";
|
|
4191
|
+
}
|
|
4192
|
+
return numeric > 99 ? "99+" : String(numeric);
|
|
4193
|
+
}
|
|
4194
|
+
return String(props.count);
|
|
4195
|
+
});
|
|
4196
|
+
const dotLabel = {
|
|
4197
|
+
success: "в сети",
|
|
4198
|
+
danger: "занят",
|
|
4199
|
+
warning: "отошёл",
|
|
4200
|
+
info: "статус",
|
|
4201
|
+
neutral: "не в сети"
|
|
4202
|
+
};
|
|
4203
|
+
const label = vue.computed(() => {
|
|
4204
|
+
const base = props.alt || props.name || "Аватар";
|
|
4205
|
+
const extra = [];
|
|
4206
|
+
if (dotTone.value) {
|
|
4207
|
+
extra.push(dotLabel[dotTone.value]);
|
|
4208
|
+
}
|
|
4209
|
+
if (badge.value) {
|
|
4210
|
+
extra.push(`${badge.value} уведомлений`);
|
|
4211
|
+
}
|
|
4212
|
+
return extra.length ? `${base}, ${extra.join(", ")}` : base;
|
|
4213
|
+
});
|
|
3883
4214
|
return (_ctx, _cache) => {
|
|
3884
4215
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
3885
|
-
class: vue.normalizeClass(["tao-avatar", `tao-avatar--${
|
|
3886
|
-
title:
|
|
4216
|
+
class: vue.normalizeClass(["tao-avatar", `tao-avatar--${sizeClass.value}`]),
|
|
4217
|
+
title: label.value
|
|
3887
4218
|
}, [
|
|
3888
|
-
|
|
4219
|
+
vue.createElementVNode("span", _hoisted_2$6, [
|
|
4220
|
+
__props.src ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
4221
|
+
key: 0,
|
|
4222
|
+
class: "tao-avatar__img",
|
|
4223
|
+
src: __props.src,
|
|
4224
|
+
alt: label.value
|
|
4225
|
+
}, null, 8, _hoisted_3$5)) : (vue.openBlock(), vue.createElementBlock("span", {
|
|
4226
|
+
key: 1,
|
|
4227
|
+
class: "tao-avatar__fallback",
|
|
4228
|
+
"aria-label": label.value
|
|
4229
|
+
}, vue.toDisplayString(initials.value || "?"), 9, _hoisted_4$5))
|
|
4230
|
+
]),
|
|
4231
|
+
dotTone.value ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3889
4232
|
key: 0,
|
|
3890
|
-
class: "tao-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
key: 1,
|
|
3895
|
-
class: "tao-avatar__fallback",
|
|
3896
|
-
"aria-label": label.value
|
|
3897
|
-
}, vue.toDisplayString(initials.value || "?"), 9, _hoisted_3$5))
|
|
4233
|
+
class: vue.normalizeClass(["tao-avatar__dot", `tao-avatar__dot--${dotTone.value}`]),
|
|
4234
|
+
"aria-hidden": "true"
|
|
4235
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
4236
|
+
badge.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$5, vue.toDisplayString(badge.value), 1)) : vue.createCommentVNode("", true)
|
|
3898
4237
|
], 10, _hoisted_1$7);
|
|
3899
4238
|
};
|
|
3900
4239
|
}
|
|
3901
4240
|
});
|
|
3902
|
-
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
4241
|
+
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-cb4ec893"]]);
|
|
3903
4242
|
const _hoisted_1$6 = {
|
|
3904
4243
|
class: "tao-breadcrumb",
|
|
3905
4244
|
"aria-label": "Хлебные крошки"
|
|
@@ -4449,6 +4788,9 @@
|
|
|
4449
4788
|
bad: "ошибка"
|
|
4450
4789
|
};
|
|
4451
4790
|
function statusOf(item) {
|
|
4791
|
+
if (item.status === "danger") {
|
|
4792
|
+
return "bad";
|
|
4793
|
+
}
|
|
4452
4794
|
return item.status ?? "wait";
|
|
4453
4795
|
}
|
|
4454
4796
|
function itemLabel(item) {
|
|
@@ -4526,7 +4868,7 @@
|
|
|
4526
4868
|
};
|
|
4527
4869
|
}
|
|
4528
4870
|
});
|
|
4529
|
-
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
4871
|
+
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-fefa5c65"]]);
|
|
4530
4872
|
const TOAST_POSITIONS = [
|
|
4531
4873
|
"topRight",
|
|
4532
4874
|
"topLeft",
|
|
@@ -4652,6 +4994,7 @@
|
|
|
4652
4994
|
class: "tao-toast__actions"
|
|
4653
4995
|
};
|
|
4654
4996
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
4997
|
+
...{ name: "TaoToastItem" },
|
|
4655
4998
|
__name: "TaoToastItem",
|
|
4656
4999
|
props: {
|
|
4657
5000
|
toast: {}
|
|
@@ -4706,7 +5049,7 @@
|
|
|
4706
5049
|
return (_ctx, _cache) => {
|
|
4707
5050
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4708
5051
|
class: vue.normalizeClass(["tao-toast", [`tao-toast--${__props.toast.type}`, { "tao-toast--paused": paused.value }]]),
|
|
4709
|
-
role: __props.toast.type === "error" || __props.toast.type === "warning" ? "alert" : "status",
|
|
5052
|
+
role: __props.toast.type === "error" || __props.toast.type === "danger" || __props.toast.type === "warning" ? "alert" : "status",
|
|
4710
5053
|
"aria-live": "polite",
|
|
4711
5054
|
onMouseenter: pause,
|
|
4712
5055
|
onMouseleave: resume
|
|
@@ -4735,7 +5078,7 @@
|
|
|
4735
5078
|
"stroke-linecap": "round",
|
|
4736
5079
|
"stroke-linejoin": "round"
|
|
4737
5080
|
}, null, -1)
|
|
4738
|
-
])])) : __props.toast.type === "error" ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [
|
|
5081
|
+
])])) : __props.toast.type === "error" || __props.toast.type === "danger" ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [
|
|
4739
5082
|
vue.createElementVNode("circle", {
|
|
4740
5083
|
cx: "10",
|
|
4741
5084
|
cy: "10",
|
|
@@ -4825,7 +5168,7 @@
|
|
|
4825
5168
|
};
|
|
4826
5169
|
}
|
|
4827
5170
|
});
|
|
4828
|
-
const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
5171
|
+
const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c8a329f5"]]);
|
|
4829
5172
|
const _hoisted_1$1 = { class: "tao-toast-slot__inner" };
|
|
4830
5173
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
4831
5174
|
...{ name: "TaoToastViewport" },
|
|
@@ -5146,6 +5489,7 @@
|
|
|
5146
5489
|
const TYPE_TIMEOUT = {
|
|
5147
5490
|
success: 3e3,
|
|
5148
5491
|
error: 5e3,
|
|
5492
|
+
danger: 5e3,
|
|
5149
5493
|
warning: 4e3,
|
|
5150
5494
|
info: 3e3,
|
|
5151
5495
|
neutral: 2500
|
|
@@ -5218,6 +5562,11 @@
|
|
|
5218
5562
|
draft.timeout = TYPE_TIMEOUT.error;
|
|
5219
5563
|
return ctx;
|
|
5220
5564
|
},
|
|
5565
|
+
danger() {
|
|
5566
|
+
draft.type = "danger";
|
|
5567
|
+
draft.timeout = TYPE_TIMEOUT.danger;
|
|
5568
|
+
return ctx;
|
|
5569
|
+
},
|
|
5221
5570
|
warning() {
|
|
5222
5571
|
draft.type = "warning";
|
|
5223
5572
|
draft.timeout = TYPE_TIMEOUT.warning;
|
|
@@ -5367,6 +5716,9 @@
|
|
|
5367
5716
|
error(message, options) {
|
|
5368
5717
|
return shortcut("error", message, options);
|
|
5369
5718
|
},
|
|
5719
|
+
danger(message, options) {
|
|
5720
|
+
return shortcut("danger", message, options);
|
|
5721
|
+
},
|
|
5370
5722
|
warning(message, options) {
|
|
5371
5723
|
return shortcut("warning", message, options);
|
|
5372
5724
|
},
|