@1337exp/taoui 1.1.0 → 1.2.2
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 +29 -12
- package/dist/index.cjs +1407 -535
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +391 -200
- package/dist/index.mjs +1408 -536
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +633 -326
- 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
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.TaoUI = {}, global.Vue));
|
|
3
3
|
})(this, function(exports2, vue) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const _hoisted_1$
|
|
6
|
-
const _hoisted_2$
|
|
5
|
+
const _hoisted_1$F = ["type", "disabled"];
|
|
6
|
+
const _hoisted_2$A = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "tao-button__loader"
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_3$
|
|
10
|
+
const _hoisted_3$u = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "tao-button__icon"
|
|
13
13
|
};
|
|
14
|
-
const _hoisted_4$
|
|
15
|
-
const _sfc_main$
|
|
14
|
+
const _hoisted_4$o = { class: "tao-button__content" };
|
|
15
|
+
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
16
16
|
...{ name: "TaoButton" },
|
|
17
17
|
__name: "TaoButton",
|
|
18
18
|
props: {
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
disabled: __props.disabled || __props.loading,
|
|
50
50
|
onClick: handleClick
|
|
51
51
|
}, [
|
|
52
|
-
__props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$
|
|
53
|
-
__props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
54
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
52
|
+
__props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$A)) : vue.createCommentVNode("", true),
|
|
53
|
+
__props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$u, 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
|
-
], 10, _hoisted_1$
|
|
57
|
+
], 10, _hoisted_1$F);
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -65,8 +65,9 @@
|
|
|
65
65
|
}
|
|
66
66
|
return target;
|
|
67
67
|
};
|
|
68
|
-
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
69
|
-
const _sfc_main$
|
|
68
|
+
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-5a0fd489"]]);
|
|
69
|
+
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
70
|
+
...{ name: "TaoBlock" },
|
|
70
71
|
__name: "TaoBlock",
|
|
71
72
|
props: {
|
|
72
73
|
padding: { default: 16 },
|
|
@@ -97,24 +98,24 @@
|
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
101
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-feb87e36"]]);
|
|
101
102
|
const formFieldKey = Symbol("taoFormField");
|
|
102
|
-
const _hoisted_1$
|
|
103
|
-
const _hoisted_2$
|
|
104
|
-
const _hoisted_3$
|
|
103
|
+
const _hoisted_1$E = { class: "tao-input-wrapper" };
|
|
104
|
+
const _hoisted_2$z = ["for"];
|
|
105
|
+
const _hoisted_3$t = {
|
|
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
|
};
|
|
117
|
-
const _sfc_main$
|
|
118
|
+
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
118
119
|
...{ name: "TaoInput" },
|
|
119
120
|
__name: "TaoInput",
|
|
120
121
|
props: {
|
|
@@ -150,12 +151,12 @@
|
|
|
150
151
|
emit("focus", event);
|
|
151
152
|
}
|
|
152
153
|
return (_ctx, _cache) => {
|
|
153
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
154
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
154
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$E, [
|
|
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
|
|
158
|
-
}, vue.toDisplayString(__props.label), 9, _hoisted_2$
|
|
159
|
+
}, vue.toDisplayString(__props.label), 9, _hoisted_2$z)) : vue.createCommentVNode("", true),
|
|
159
160
|
vue.createElementVNode("div", {
|
|
160
161
|
class: vue.normalizeClass(["tao-input-shell", {
|
|
161
162
|
"tao-input-shell--focused": focused.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$t, [
|
|
169
170
|
vue.renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
170
171
|
])) : vue.createCommentVNode("", true),
|
|
171
172
|
vue.createElementVNode("input", {
|
|
@@ -180,27 +181,27 @@
|
|
|
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$
|
|
194
|
-
const _hoisted_1$
|
|
194
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-b522e041"]]);
|
|
195
|
+
const _hoisted_1$D = {
|
|
195
196
|
key: 0,
|
|
196
197
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
197
198
|
};
|
|
198
|
-
const _hoisted_2$
|
|
199
|
-
const _hoisted_3$
|
|
199
|
+
const _hoisted_2$y = { class: "tao-input-group__field" };
|
|
200
|
+
const _hoisted_3$s = {
|
|
200
201
|
key: 1,
|
|
201
202
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
202
203
|
};
|
|
203
|
-
const _sfc_main$
|
|
204
|
+
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
204
205
|
...{ name: "TaoInputGroup" },
|
|
205
206
|
__name: "TaoInputGroup",
|
|
206
207
|
setup(__props) {
|
|
@@ -222,28 +223,28 @@
|
|
|
222
223
|
onFocusin: onFocusIn,
|
|
223
224
|
onFocusout: onFocusOut
|
|
224
225
|
}, [
|
|
225
|
-
_ctx.$slots.before ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
226
|
+
_ctx.$slots.before ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
|
|
226
227
|
vue.renderSlot(_ctx.$slots, "before", {}, void 0, true)
|
|
227
228
|
])) : vue.createCommentVNode("", true),
|
|
228
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
229
|
+
vue.createElementVNode("div", _hoisted_2$y, [
|
|
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$s, [
|
|
232
233
|
vue.renderSlot(_ctx.$slots, "after", {}, void 0, true)
|
|
233
234
|
])) : vue.createCommentVNode("", true)
|
|
234
235
|
], 34);
|
|
235
236
|
};
|
|
236
237
|
}
|
|
237
238
|
});
|
|
238
|
-
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
239
|
-
const _hoisted_1$
|
|
240
|
-
const _hoisted_2$
|
|
239
|
+
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-f06bb3b1"]]);
|
|
240
|
+
const _hoisted_1$C = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
241
|
+
const _hoisted_2$x = {
|
|
241
242
|
key: 0,
|
|
242
243
|
class: "tao-input-number__steppers"
|
|
243
244
|
};
|
|
244
|
-
const _hoisted_3$
|
|
245
|
-
const _hoisted_4$
|
|
246
|
-
const _sfc_main$
|
|
245
|
+
const _hoisted_3$r = ["disabled"];
|
|
246
|
+
const _hoisted_4$m = ["disabled"];
|
|
247
|
+
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
247
248
|
...{ name: "TaoInputNumber" },
|
|
248
249
|
__name: "TaoInputNumber",
|
|
249
250
|
props: {
|
|
@@ -392,8 +393,8 @@
|
|
|
392
393
|
onFocus,
|
|
393
394
|
onBlur,
|
|
394
395
|
onKeydown
|
|
395
|
-
}, null, 40, _hoisted_1$
|
|
396
|
-
__props.controls ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
396
|
+
}, null, 40, _hoisted_1$C),
|
|
397
|
+
__props.controls ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$x, [
|
|
397
398
|
vue.createElementVNode("button", {
|
|
398
399
|
type: "button",
|
|
399
400
|
class: "tao-input-number__step",
|
|
@@ -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$r),
|
|
405
406
|
vue.createElementVNode("button", {
|
|
406
407
|
type: "button",
|
|
407
408
|
class: "tao-input-number__step",
|
|
@@ -409,17 +410,17 @@
|
|
|
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
|
};
|
|
416
417
|
}
|
|
417
418
|
});
|
|
418
|
-
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
419
|
-
const _hoisted_1$
|
|
420
|
-
const _hoisted_2$
|
|
421
|
-
const _hoisted_3$
|
|
422
|
-
const _sfc_main$
|
|
419
|
+
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-55b65a4d"]]);
|
|
420
|
+
const _hoisted_1$B = ["aria-label", "disabled"];
|
|
421
|
+
const _hoisted_2$w = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
422
|
+
const _hoisted_3$q = ["disabled"];
|
|
423
|
+
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
423
424
|
...{ name: "TaoQuantity" },
|
|
424
425
|
__name: "TaoQuantity",
|
|
425
426
|
props: {
|
|
@@ -552,7 +553,7 @@
|
|
|
552
553
|
"aria-label": minusLabel.value,
|
|
553
554
|
disabled: minusDisabled.value,
|
|
554
555
|
onClick: onDec
|
|
555
|
-
}, " − ", 8, _hoisted_1$
|
|
556
|
+
}, " − ", 8, _hoisted_1$B),
|
|
556
557
|
vue.createElementVNode("input", {
|
|
557
558
|
id: controlId.value,
|
|
558
559
|
class: "tao-quantity__input",
|
|
@@ -572,37 +573,37 @@
|
|
|
572
573
|
onFocus,
|
|
573
574
|
onBlur,
|
|
574
575
|
onKeydown
|
|
575
|
-
}, null, 40, _hoisted_2$
|
|
576
|
+
}, null, 40, _hoisted_2$w),
|
|
576
577
|
vue.createElementVNode("button", {
|
|
577
578
|
type: "button",
|
|
578
579
|
class: "tao-quantity__btn tao-quantity__btn--inc",
|
|
579
580
|
"aria-label": "Увеличить",
|
|
580
581
|
disabled: plusDisabled.value,
|
|
581
582
|
onClick: onInc
|
|
582
|
-
}, " + ", 8, _hoisted_3$
|
|
583
|
+
}, " + ", 8, _hoisted_3$q)
|
|
583
584
|
], 2);
|
|
584
585
|
};
|
|
585
586
|
}
|
|
586
587
|
});
|
|
587
|
-
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
588
|
-
const _hoisted_1$
|
|
588
|
+
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-df6baf04"]]);
|
|
589
|
+
const _hoisted_1$A = {
|
|
589
590
|
key: 0,
|
|
590
591
|
class: "tao-card__cover"
|
|
591
592
|
};
|
|
592
|
-
const _hoisted_2$
|
|
593
|
+
const _hoisted_2$v = {
|
|
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$p = { 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
|
};
|
|
@@ -614,7 +615,8 @@
|
|
|
614
615
|
key: 4,
|
|
615
616
|
class: "tao-card__footer"
|
|
616
617
|
};
|
|
617
|
-
const _sfc_main$
|
|
618
|
+
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
619
|
+
...{ name: "TaoCard" },
|
|
618
620
|
__name: "TaoCard",
|
|
619
621
|
props: {
|
|
620
622
|
padding: { default: 20 },
|
|
@@ -645,14 +647,14 @@
|
|
|
645
647
|
}]),
|
|
646
648
|
style: vue.normalizeStyle(radiusStyle.value)
|
|
647
649
|
}, [
|
|
648
|
-
_ctx.$slots.cover ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
650
|
+
_ctx.$slots.cover ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
|
|
649
651
|
vue.renderSlot(_ctx.$slots, "cover", {}, void 0, true)
|
|
650
652
|
])) : vue.createCommentVNode("", true),
|
|
651
653
|
vue.createElementVNode("div", {
|
|
652
654
|
class: "tao-card__content",
|
|
653
655
|
style: vue.normalizeStyle(paddingStyle.value)
|
|
654
656
|
}, [
|
|
655
|
-
_ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_2$
|
|
657
|
+
_ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_2$v, [
|
|
656
658
|
vue.renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
|
|
657
659
|
])) : vue.createCommentVNode("", true),
|
|
658
660
|
_ctx.$slots.header || _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -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$p, [
|
|
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$
|
|
690
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__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(
|
|
@@ -714,18 +716,19 @@
|
|
|
714
716
|
first.focus();
|
|
715
717
|
}
|
|
716
718
|
}
|
|
717
|
-
const _hoisted_1$
|
|
718
|
-
const _hoisted_2$
|
|
719
|
+
const _hoisted_1$z = ["aria-labelledby"];
|
|
720
|
+
const _hoisted_2$u = {
|
|
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$o = ["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
|
};
|
|
728
|
-
const _sfc_main$
|
|
731
|
+
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
729
732
|
...{ name: "TaoModal" },
|
|
730
733
|
__name: "TaoModal",
|
|
731
734
|
props: {
|
|
@@ -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$
|
|
831
|
+
__props.title || _ctx.$slots.header || __props.closable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$u, [
|
|
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$o)) : (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,13 +844,13 @@
|
|
|
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
|
-
], 8, _hoisted_1$
|
|
853
|
+
], 8, _hoisted_1$z)
|
|
850
854
|
], 32)) : vue.createCommentVNode("", true)
|
|
851
855
|
]),
|
|
852
856
|
_: 3
|
|
@@ -855,11 +859,11 @@
|
|
|
855
859
|
};
|
|
856
860
|
}
|
|
857
861
|
});
|
|
858
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
859
|
-
const _hoisted_1$
|
|
860
|
-
const _hoisted_2$
|
|
861
|
-
const _hoisted_3$
|
|
862
|
-
const _sfc_main$
|
|
862
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-0cffe849"]]);
|
|
863
|
+
const _hoisted_1$y = { class: "tao-tabs" };
|
|
864
|
+
const _hoisted_2$t = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
865
|
+
const _hoisted_3$n = ["id", "aria-labelledby"];
|
|
866
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
863
867
|
...{ name: "TaoTabs" },
|
|
864
868
|
__name: "TaoTabs",
|
|
865
869
|
props: {
|
|
@@ -923,7 +927,7 @@
|
|
|
923
927
|
}
|
|
924
928
|
}
|
|
925
929
|
return (_ctx, _cache) => {
|
|
926
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
930
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$y, [
|
|
927
931
|
vue.createElementVNode("div", {
|
|
928
932
|
class: "tao-tabs__list",
|
|
929
933
|
role: "tablist",
|
|
@@ -948,7 +952,7 @@
|
|
|
948
952
|
}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
949
953
|
vue.createTextVNode(vue.toDisplayString(tab.label), 1)
|
|
950
954
|
], 64))
|
|
951
|
-
], 8, _hoisted_2$
|
|
955
|
+
], 8, _hoisted_2$t);
|
|
952
956
|
}), 128))
|
|
953
957
|
], 32),
|
|
954
958
|
vue.createElementVNode("div", {
|
|
@@ -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$n)
|
|
962
966
|
]);
|
|
963
967
|
};
|
|
964
968
|
}
|
|
965
969
|
});
|
|
966
|
-
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
967
|
-
const _sfc_main$
|
|
970
|
+
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-bf16735e"]]);
|
|
971
|
+
const _sfc_main$F = /* @__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$
|
|
999
|
-
const _hoisted_1$
|
|
1000
|
-
const _hoisted_2$
|
|
1003
|
+
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-6f3b3c11"]]);
|
|
1004
|
+
const _hoisted_1$x = { class: "tao-spoiler" };
|
|
1005
|
+
const _hoisted_2$s = ["aria-expanded", "aria-controls"];
|
|
1006
|
+
const _hoisted_3$m = {
|
|
1001
1007
|
key: 0,
|
|
1002
1008
|
class: "tao-spoiler__title"
|
|
1003
1009
|
};
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
const _hoisted_4$g = { class: "tao-spoiler__content-inner" };
|
|
1009
|
-
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
1010
|
+
const _hoisted_4$j = ["id"];
|
|
1011
|
+
const _hoisted_5$c = { class: "tao-spoiler__content-inner" };
|
|
1012
|
+
const _sfc_main$E = /* @__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";
|
|
@@ -1038,20 +1052,23 @@
|
|
|
1038
1052
|
});
|
|
1039
1053
|
}
|
|
1040
1054
|
return (_ctx, _cache) => {
|
|
1041
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1055
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$x, [
|
|
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$m, [
|
|
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$s),
|
|
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$
|
|
1076
|
-
const _hoisted_1$
|
|
1077
|
-
const _sfc_main$
|
|
1096
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-c9f4d962"]]);
|
|
1097
|
+
const _hoisted_1$w = { class: "tao-copy" };
|
|
1098
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
1099
|
+
...{ name: "TaoCopy" },
|
|
1078
1100
|
__name: "TaoCopy",
|
|
1079
1101
|
props: {
|
|
1080
1102
|
text: {},
|
|
@@ -1097,12 +1119,13 @@
|
|
|
1097
1119
|
}
|
|
1098
1120
|
}
|
|
1099
1121
|
return (_ctx, _cache) => {
|
|
1100
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1122
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$w, [
|
|
1101
1123
|
vue.renderSlot(_ctx.$slots, "default", {
|
|
1102
1124
|
copy,
|
|
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$
|
|
1115
|
-
const _sfc_main$
|
|
1137
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-73a42ad9"]]);
|
|
1138
|
+
const _sfc_main$C = /* @__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$
|
|
1132
|
-
const _sfc_main$
|
|
1155
|
+
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-4c0deb90"]]);
|
|
1156
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
1157
|
+
...{ name: "TaoFlex" },
|
|
1133
1158
|
__name: "TaoFlex",
|
|
1134
1159
|
props: {
|
|
1135
1160
|
tag: { default: "div" },
|
|
@@ -1159,7 +1184,8 @@
|
|
|
1159
1184
|
};
|
|
1160
1185
|
}
|
|
1161
1186
|
});
|
|
1162
|
-
const _sfc_main$
|
|
1187
|
+
const _sfc_main$A = /* @__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$
|
|
1182
|
-
const _hoisted_1$
|
|
1183
|
-
const _sfc_main$
|
|
1207
|
+
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-698ca712"]]);
|
|
1208
|
+
const _hoisted_1$v = { class: "tao-icon" };
|
|
1209
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
1210
|
+
...{ name: "TaoIcon" },
|
|
1184
1211
|
__name: "TaoIcon",
|
|
1185
1212
|
props: {
|
|
1186
1213
|
name: {},
|
|
@@ -1190,11 +1217,11 @@
|
|
|
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) => {
|
|
1197
|
-
return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
1224
|
+
return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$v, [
|
|
1198
1225
|
vue.renderSlot(_ctx.$slots, "prefix", {}, void 0, true),
|
|
1199
1226
|
vue.createElementVNode("i", {
|
|
1200
1227
|
class: vue.normalizeClass(["tao-icon__value", [`icon-${props.name}`, { "tao-icon__value--invert": props.invert }]]),
|
|
@@ -1205,8 +1232,9 @@
|
|
|
1205
1232
|
};
|
|
1206
1233
|
}
|
|
1207
1234
|
});
|
|
1208
|
-
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1209
|
-
const _sfc_main$
|
|
1235
|
+
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-145b2cfc"]]);
|
|
1236
|
+
const _sfc_main$y = /* @__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$
|
|
1270
|
-
const _hoisted_1$
|
|
1271
|
-
const _hoisted_2$
|
|
1272
|
-
const _sfc_main$
|
|
1297
|
+
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-75a40018"]]);
|
|
1298
|
+
const _hoisted_1$u = { class: "tao-image" };
|
|
1299
|
+
const _hoisted_2$r = ["src", "alt"];
|
|
1300
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
1301
|
+
...{ name: "TaoImage" },
|
|
1273
1302
|
__name: "TaoImage",
|
|
1274
1303
|
props: {
|
|
1275
1304
|
src: { default: "" },
|
|
@@ -1293,7 +1322,7 @@
|
|
|
1293
1322
|
isLoaded.value = false;
|
|
1294
1323
|
});
|
|
1295
1324
|
return (_ctx, _cache) => {
|
|
1296
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1325
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
|
|
1297
1326
|
__props.src ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
1298
1327
|
key: 0,
|
|
1299
1328
|
class: vue.normalizeClass({ "tao-image__img--hidden": !isLoaded.value, "tao-image__img--pixelated": props.pixelated }),
|
|
@@ -1302,47 +1331,54 @@
|
|
|
1302
1331
|
draggable: "false",
|
|
1303
1332
|
onLoad: handleLoad,
|
|
1304
1333
|
onError: handleError
|
|
1305
|
-
}, null, 42, _hoisted_2$
|
|
1334
|
+
}, null, 42, _hoisted_2$r)) : vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1306
1335
|
_cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "tao-image__placeholder" }, "No image available", -1))
|
|
1307
1336
|
], true, 1)
|
|
1308
1337
|
]);
|
|
1309
1338
|
};
|
|
1310
1339
|
}
|
|
1311
1340
|
});
|
|
1312
|
-
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1313
|
-
const _hoisted_1$
|
|
1314
|
-
const _hoisted_2$
|
|
1341
|
+
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-9da4bb7d"]]);
|
|
1342
|
+
const _hoisted_1$t = ["for"];
|
|
1343
|
+
const _hoisted_2$q = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
1344
|
+
const _hoisted_3$l = {
|
|
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
|
-
const _sfc_main$
|
|
1352
|
+
const _sfc_main$w = /* @__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$q),
|
|
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$l, 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$t);
|
|
1377
1429
|
};
|
|
1378
1430
|
}
|
|
1379
1431
|
});
|
|
1380
|
-
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1381
|
-
const _sfc_main$
|
|
1432
|
+
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-f6b0e565"]]);
|
|
1433
|
+
const _sfc_main$v = /* @__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$
|
|
1408
|
-
const _hoisted_1$
|
|
1461
|
+
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-290c0f6a"]]);
|
|
1462
|
+
const _hoisted_1$s = {
|
|
1409
1463
|
key: 1,
|
|
1410
1464
|
class: "tao-divider-text"
|
|
1411
1465
|
};
|
|
1412
|
-
const _hoisted_2$
|
|
1413
|
-
const _hoisted_3$
|
|
1466
|
+
const _hoisted_2$p = { class: "tao-divider-text__value" };
|
|
1467
|
+
const _hoisted_3$k = {
|
|
1414
1468
|
key: 2,
|
|
1415
1469
|
class: "tao-divider-line"
|
|
1416
1470
|
};
|
|
1417
|
-
const _sfc_main$
|
|
1471
|
+
const _sfc_main$u = /* @__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--${
|
|
1428
|
-
}, null, 2)) : __props.variant === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1484
|
+
class: vue.normalizeClass(["tao-divider-gap", `tao-divider-gap--${gapSize.value}`])
|
|
1485
|
+
}, null, 2)) : __props.variant === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$s, [
|
|
1429
1486
|
_cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--left" }, null, -1)),
|
|
1430
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
1487
|
+
vue.createElementVNode("span", _hoisted_2$p, [
|
|
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$k));
|
|
1435
1492
|
};
|
|
1436
1493
|
}
|
|
1437
1494
|
});
|
|
1438
|
-
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1439
|
-
const _sfc_main$
|
|
1495
|
+
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-8187a15d"]]);
|
|
1496
|
+
const _sfc_main$t = /* @__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$
|
|
1463
|
-
const _hoisted_1$
|
|
1520
|
+
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-f1534571"]]);
|
|
1521
|
+
const _hoisted_1$r = {
|
|
1464
1522
|
key: 0,
|
|
1465
1523
|
class: "tao-textarea tao-textarea--dummy"
|
|
1466
1524
|
};
|
|
1467
|
-
const _hoisted_2$
|
|
1468
|
-
|
|
1525
|
+
const _hoisted_2$o = {
|
|
1526
|
+
key: 1,
|
|
1527
|
+
class: "tao-textarea-wrap"
|
|
1528
|
+
};
|
|
1529
|
+
const _hoisted_3$j = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
1530
|
+
const _hoisted_4$h = ["id"];
|
|
1531
|
+
const _sfc_main$s = /* @__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$r, vue.toDisplayString(__props.modelValue), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$o, [
|
|
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$j),
|
|
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$
|
|
1569
|
-
const _hoisted_1$
|
|
1570
|
-
const _hoisted_2$
|
|
1667
|
+
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-2534c0c4"]]);
|
|
1668
|
+
const _hoisted_1$q = ["tabindex"];
|
|
1669
|
+
const _hoisted_2$n = { class: "tao-scroll-top__content" };
|
|
1571
1670
|
const RIPPLE_DURATION = 750;
|
|
1572
|
-
const _sfc_main$
|
|
1671
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
1672
|
+
...{ name: "TaoScrollTop" },
|
|
1573
1673
|
__name: "TaoScrollTop",
|
|
1574
1674
|
props: {
|
|
1575
1675
|
size: { default: 40 },
|
|
@@ -1661,13 +1761,14 @@
|
|
|
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
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
1771
|
+
vue.createElementVNode("div", _hoisted_2$n, [
|
|
1671
1772
|
vue.createElementVNode("div", {
|
|
1672
1773
|
class: vue.normalizeClass([{ "tao-scroll-top__ripple--active": isRippleActive.value }, "tao-scroll-top__ripple"]),
|
|
1673
1774
|
style: vue.normalizeStyle(rippleStyle)
|
|
@@ -1684,69 +1785,101 @@
|
|
|
1684
1785
|
], -1))
|
|
1685
1786
|
], true)
|
|
1686
1787
|
])
|
|
1687
|
-
], 14, _hoisted_1$
|
|
1788
|
+
], 14, _hoisted_1$q)) : vue.createCommentVNode("", true)
|
|
1688
1789
|
]),
|
|
1689
1790
|
_: 3
|
|
1690
1791
|
});
|
|
1691
1792
|
};
|
|
1692
1793
|
}
|
|
1693
1794
|
});
|
|
1694
|
-
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1695
|
-
const _hoisted_1$
|
|
1696
|
-
const _hoisted_2$
|
|
1795
|
+
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-ce902f42"]]);
|
|
1796
|
+
const _hoisted_1$p = { class: "tao-progress" };
|
|
1797
|
+
const _hoisted_2$m = {
|
|
1697
1798
|
key: 0,
|
|
1698
1799
|
class: "tao-progress__side"
|
|
1699
1800
|
};
|
|
1700
|
-
const _hoisted_3$
|
|
1701
|
-
const _hoisted_4$
|
|
1801
|
+
const _hoisted_3$i = { class: "tao-progress__main" };
|
|
1802
|
+
const _hoisted_4$g = {
|
|
1702
1803
|
key: 0,
|
|
1703
1804
|
class: "tao-progress__percentage"
|
|
1704
1805
|
};
|
|
1705
|
-
const
|
|
1806
|
+
const _hoisted_5$b = {
|
|
1807
|
+
key: 1,
|
|
1808
|
+
class: "tao-progress__side"
|
|
1809
|
+
};
|
|
1810
|
+
const _hoisted_6$8 = {
|
|
1811
|
+
key: 0,
|
|
1812
|
+
class: "tao-progress__percentage"
|
|
1813
|
+
};
|
|
1814
|
+
const _sfc_main$q = /* @__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
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1845
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
|
|
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
|
-
_ctx.$slots.left ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
1850
|
+
_ctx.$slots.left ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$m, [
|
|
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$i, [
|
|
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$
|
|
1744
|
-
const _hoisted_1$
|
|
1745
|
-
const _hoisted_2$
|
|
1874
|
+
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-54c13718"]]);
|
|
1875
|
+
const _hoisted_1$o = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-describedby"];
|
|
1876
|
+
const _hoisted_2$l = ["placeholder"];
|
|
1877
|
+
const _hoisted_3$h = {
|
|
1746
1878
|
key: 1,
|
|
1747
1879
|
class: "tao-slider__value"
|
|
1748
1880
|
};
|
|
1749
|
-
const _sfc_main$
|
|
1881
|
+
const _sfc_main$p = /* @__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$l)), [
|
|
1887
2076
|
[vue.vModelText, shadowModel.value]
|
|
1888
|
-
]) : __props.showValue ? (vue.openBlock(), vue.createElementBlock("div",
|
|
2077
|
+
]) : __props.showValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$h, [
|
|
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$o);
|
|
1894
2083
|
};
|
|
1895
2084
|
}
|
|
1896
2085
|
});
|
|
1897
|
-
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1898
|
-
const _hoisted_1$
|
|
1899
|
-
const _hoisted_2$
|
|
1900
|
-
const _sfc_main$
|
|
2086
|
+
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-241d1042"]]);
|
|
2087
|
+
const _hoisted_1$n = { class: "tao-file-drop" };
|
|
2088
|
+
const _hoisted_2$k = ["accept", "multiple"];
|
|
2089
|
+
const _sfc_main$o = /* @__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;
|
|
@@ -1953,46 +2139,48 @@
|
|
|
1953
2139
|
}
|
|
1954
2140
|
}
|
|
1955
2141
|
return (_ctx, _cache) => {
|
|
1956
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2142
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
1957
2143
|
__props.showClear && __props.modelValue.length ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
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
|
|
1981
|
-
|
|
2166
|
+
onChange: handleFileSelect,
|
|
2167
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
2168
|
+
}, ["stop"]))
|
|
2169
|
+
}, null, 40, _hoisted_2$k)
|
|
1982
2170
|
], 34)
|
|
1983
2171
|
]);
|
|
1984
2172
|
};
|
|
1985
2173
|
}
|
|
1986
2174
|
});
|
|
1987
|
-
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1988
|
-
const _hoisted_1$
|
|
1989
|
-
const _hoisted_2$
|
|
2175
|
+
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-3543419a"]]);
|
|
2176
|
+
const _hoisted_1$m = ["aria-expanded"];
|
|
2177
|
+
const _hoisted_2$j = {
|
|
1990
2178
|
key: 1,
|
|
1991
2179
|
"aria-label": "Меню"
|
|
1992
2180
|
};
|
|
1993
|
-
const _hoisted_3$
|
|
1994
|
-
const _hoisted_4$
|
|
1995
|
-
const _sfc_main$
|
|
2181
|
+
const _hoisted_3$g = ["onClick", "onMouseenter"];
|
|
2182
|
+
const _hoisted_4$f = { key: 1 };
|
|
2183
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
1996
2184
|
...{ name: "TaoDropdownMenu" },
|
|
1997
2185
|
__name: "TaoDropdownMenu",
|
|
1998
2186
|
props: {
|
|
@@ -2127,8 +2315,8 @@
|
|
|
2127
2315
|
"aria-expanded": isOpen.value,
|
|
2128
2316
|
onClick: toggleMenu
|
|
2129
2317
|
}, [
|
|
2130
|
-
_ctx.$slots.button ? vue.renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$
|
|
2131
|
-
], 8, _hoisted_1$
|
|
2318
|
+
_ctx.$slots.button ? vue.renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$j, "⋮"))
|
|
2319
|
+
], 8, _hoisted_1$m),
|
|
2132
2320
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
2133
2321
|
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2134
2322
|
key: 0,
|
|
@@ -2153,8 +2341,8 @@
|
|
|
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$
|
|
2157
|
-
], 42, _hoisted_3$
|
|
2344
|
+
}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$f, vue.toDisplayString(action.name), 1))
|
|
2345
|
+
], 42, _hoisted_3$g);
|
|
2158
2346
|
}), 128))
|
|
2159
2347
|
], 36)) : vue.createCommentVNode("", true)
|
|
2160
2348
|
]))
|
|
@@ -2162,133 +2350,185 @@
|
|
|
2162
2350
|
};
|
|
2163
2351
|
}
|
|
2164
2352
|
});
|
|
2165
|
-
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2166
|
-
const _hoisted_1$
|
|
2167
|
-
const _hoisted_2$
|
|
2168
|
-
const _sfc_main$
|
|
2353
|
+
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-420a7e63"]]);
|
|
2354
|
+
const _hoisted_1$l = ["aria-invalid", "aria-describedby"];
|
|
2355
|
+
const _hoisted_2$i = ["id", "value", "placeholder", "type", "inputmode", "pattern", "onInput", "onKeydown", "onFocus"];
|
|
2356
|
+
const _sfc_main$m = /* @__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;
|
|
2405
|
+
}
|
|
2406
|
+
function focusCell(index) {
|
|
2407
|
+
var _a;
|
|
2408
|
+
(_a = inputRefs.value[index]) == null ? void 0 : _a.focus();
|
|
2197
2409
|
}
|
|
2198
|
-
function
|
|
2199
|
-
numbers.value
|
|
2200
|
-
inputRefs.value = [];
|
|
2201
|
-
activeNumber.value = -1;
|
|
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)
|
|
2284
|
-
|
|
2521
|
+
onFocus: ($event) => onFocus(index),
|
|
2522
|
+
onBlur
|
|
2523
|
+
}, null, 42, _hoisted_2$i);
|
|
2285
2524
|
}), 128))
|
|
2286
|
-
]);
|
|
2525
|
+
], 8, _hoisted_1$l);
|
|
2287
2526
|
};
|
|
2288
2527
|
}
|
|
2289
2528
|
});
|
|
2290
|
-
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2291
|
-
const _sfc_main$
|
|
2529
|
+
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-c3182673"]]);
|
|
2530
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
2531
|
+
...{ name: "TaoLink" },
|
|
2292
2532
|
__name: "TaoLink",
|
|
2293
2533
|
props: {
|
|
2294
2534
|
to: { default: void 0 },
|
|
@@ -2329,8 +2569,8 @@
|
|
|
2329
2569
|
};
|
|
2330
2570
|
}
|
|
2331
2571
|
});
|
|
2332
|
-
const _hoisted_1$
|
|
2333
|
-
const _sfc_main$
|
|
2572
|
+
const _hoisted_1$k = ["for"];
|
|
2573
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
2334
2574
|
...{ name: "TaoFormField" },
|
|
2335
2575
|
__name: "TaoFormField",
|
|
2336
2576
|
props: {
|
|
@@ -2366,7 +2606,7 @@
|
|
|
2366
2606
|
key: 0,
|
|
2367
2607
|
class: "tao-form-field__label",
|
|
2368
2608
|
for: vue.unref(id)
|
|
2369
|
-
}, vue.toDisplayString(__props.label), 9, _hoisted_1$
|
|
2609
|
+
}, vue.toDisplayString(__props.label), 9, _hoisted_1$k)) : vue.createCommentVNode("", true),
|
|
2370
2610
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
2371
2611
|
__props.error ? (vue.openBlock(), vue.createElementBlock("p", {
|
|
2372
2612
|
key: 1,
|
|
@@ -2381,12 +2621,12 @@
|
|
|
2381
2621
|
};
|
|
2382
2622
|
}
|
|
2383
2623
|
});
|
|
2384
|
-
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2385
|
-
const _hoisted_1$
|
|
2386
|
-
const _hoisted_2$
|
|
2387
|
-
const _hoisted_3$
|
|
2388
|
-
const _hoisted_4$
|
|
2389
|
-
const _sfc_main$
|
|
2624
|
+
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-11324f0c"]]);
|
|
2625
|
+
const _hoisted_1$j = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
2626
|
+
const _hoisted_2$h = { class: "tao-select__value" };
|
|
2627
|
+
const _hoisted_3$f = ["aria-activedescendant"];
|
|
2628
|
+
const _hoisted_4$e = ["id", "aria-selected", "aria-disabled", "data-tao-select-index", "onClick", "onMouseenter"];
|
|
2629
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
2390
2630
|
...{ name: "TaoSelect" },
|
|
2391
2631
|
__name: "TaoSelect",
|
|
2392
2632
|
props: {
|
|
@@ -2396,7 +2636,286 @@
|
|
|
2396
2636
|
disabled: { type: Boolean, default: false },
|
|
2397
2637
|
error: { type: Boolean, default: false }
|
|
2398
2638
|
},
|
|
2399
|
-
emits: ["update:modelValue", "change"],
|
|
2639
|
+
emits: ["update:modelValue", "change"],
|
|
2640
|
+
setup(__props, { emit: __emit }) {
|
|
2641
|
+
const props = __props;
|
|
2642
|
+
const emit = __emit;
|
|
2643
|
+
const field = vue.inject(formFieldKey, null);
|
|
2644
|
+
const localId = vue.useId();
|
|
2645
|
+
const listId = `${localId}-list`;
|
|
2646
|
+
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
2647
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2648
|
+
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
2649
|
+
const open = vue.ref(false);
|
|
2650
|
+
const activeIndex = vue.ref(-1);
|
|
2651
|
+
const triggerRef = vue.ref(null);
|
|
2652
|
+
const panelRef = vue.ref(null);
|
|
2653
|
+
const listRef = vue.ref(null);
|
|
2654
|
+
const listStyle = vue.ref({ top: "0px", left: "0px", width: "0px" });
|
|
2655
|
+
const selected = vue.computed(() => props.options.find((option) => option.value === props.modelValue) ?? null);
|
|
2656
|
+
const enabledIndexes = vue.computed(
|
|
2657
|
+
() => props.options.map((option, index) => option.disabled ? -1 : index).filter((index) => index >= 0)
|
|
2658
|
+
);
|
|
2659
|
+
function updatePosition() {
|
|
2660
|
+
const trigger = triggerRef.value;
|
|
2661
|
+
const panel = panelRef.value;
|
|
2662
|
+
if (!trigger || !panel) {
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
const rect = trigger.getBoundingClientRect();
|
|
2666
|
+
const panelHeight = panel.offsetHeight;
|
|
2667
|
+
const gap = 4;
|
|
2668
|
+
const spaceBelow = window.innerHeight - rect.bottom - gap;
|
|
2669
|
+
const openUp = spaceBelow < panelHeight && rect.top > spaceBelow;
|
|
2670
|
+
listStyle.value = {
|
|
2671
|
+
top: `${openUp ? rect.top - panelHeight - gap : rect.bottom + gap}px`,
|
|
2672
|
+
left: `${rect.left}px`,
|
|
2673
|
+
width: `${rect.width}px`
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
async function setOpen(next) {
|
|
2677
|
+
var _a;
|
|
2678
|
+
if (props.disabled) {
|
|
2679
|
+
return;
|
|
2680
|
+
}
|
|
2681
|
+
open.value = next;
|
|
2682
|
+
if (!next) {
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
const selectedIndex = props.options.findIndex((option) => option.value === props.modelValue);
|
|
2686
|
+
activeIndex.value = selectedIndex >= 0 ? selectedIndex : enabledIndexes.value[0] ?? -1;
|
|
2687
|
+
await vue.nextTick();
|
|
2688
|
+
updatePosition();
|
|
2689
|
+
(_a = listRef.value) == null ? void 0 : _a.focus();
|
|
2690
|
+
scrollActiveIntoView();
|
|
2691
|
+
}
|
|
2692
|
+
function toggle() {
|
|
2693
|
+
void setOpen(!open.value);
|
|
2694
|
+
}
|
|
2695
|
+
function close() {
|
|
2696
|
+
open.value = false;
|
|
2697
|
+
}
|
|
2698
|
+
function selectOption(option) {
|
|
2699
|
+
var _a;
|
|
2700
|
+
if (option.disabled) {
|
|
2701
|
+
return;
|
|
2702
|
+
}
|
|
2703
|
+
emit("update:modelValue", option.value);
|
|
2704
|
+
emit("change", option.value);
|
|
2705
|
+
close();
|
|
2706
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
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
|
+
}
|
|
2715
|
+
function moveActive(delta) {
|
|
2716
|
+
const enabled = enabledIndexes.value;
|
|
2717
|
+
if (!enabled.length) {
|
|
2718
|
+
return;
|
|
2719
|
+
}
|
|
2720
|
+
const currentPos = enabled.indexOf(activeIndex.value);
|
|
2721
|
+
const nextPos = currentPos < 0 ? 0 : (currentPos + delta + enabled.length) % enabled.length;
|
|
2722
|
+
activeIndex.value = enabled[nextPos];
|
|
2723
|
+
scrollActiveIntoView();
|
|
2724
|
+
}
|
|
2725
|
+
function scrollActiveIntoView() {
|
|
2726
|
+
const list = listRef.value;
|
|
2727
|
+
if (!list || activeIndex.value < 0) {
|
|
2728
|
+
return;
|
|
2729
|
+
}
|
|
2730
|
+
const option = list.querySelector(`[data-tao-select-index="${activeIndex.value}"]`);
|
|
2731
|
+
option == null ? void 0 : option.scrollIntoView({ block: "nearest" });
|
|
2732
|
+
}
|
|
2733
|
+
function onTriggerKeydown(event) {
|
|
2734
|
+
if (props.disabled) {
|
|
2735
|
+
return;
|
|
2736
|
+
}
|
|
2737
|
+
if ((event.key === "Backspace" || event.key === "Delete") && selected.value) {
|
|
2738
|
+
event.preventDefault();
|
|
2739
|
+
clear();
|
|
2740
|
+
return;
|
|
2741
|
+
}
|
|
2742
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
|
|
2743
|
+
event.preventDefault();
|
|
2744
|
+
void setOpen(true);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
function onListKeydown(event) {
|
|
2748
|
+
var _a;
|
|
2749
|
+
if (event.key === "Escape") {
|
|
2750
|
+
event.preventDefault();
|
|
2751
|
+
close();
|
|
2752
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
2753
|
+
return;
|
|
2754
|
+
}
|
|
2755
|
+
if (event.key === "ArrowDown") {
|
|
2756
|
+
event.preventDefault();
|
|
2757
|
+
moveActive(1);
|
|
2758
|
+
return;
|
|
2759
|
+
}
|
|
2760
|
+
if (event.key === "ArrowUp") {
|
|
2761
|
+
event.preventDefault();
|
|
2762
|
+
moveActive(-1);
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
if (event.key === "Home") {
|
|
2766
|
+
event.preventDefault();
|
|
2767
|
+
activeIndex.value = enabledIndexes.value[0] ?? -1;
|
|
2768
|
+
scrollActiveIntoView();
|
|
2769
|
+
return;
|
|
2770
|
+
}
|
|
2771
|
+
if (event.key === "End") {
|
|
2772
|
+
event.preventDefault();
|
|
2773
|
+
activeIndex.value = enabledIndexes.value[enabledIndexes.value.length - 1] ?? -1;
|
|
2774
|
+
scrollActiveIntoView();
|
|
2775
|
+
return;
|
|
2776
|
+
}
|
|
2777
|
+
if (event.key === "Backspace" || event.key === "Delete") {
|
|
2778
|
+
if (selected.value) {
|
|
2779
|
+
event.preventDefault();
|
|
2780
|
+
clear();
|
|
2781
|
+
}
|
|
2782
|
+
return;
|
|
2783
|
+
}
|
|
2784
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
2785
|
+
event.preventDefault();
|
|
2786
|
+
const option = props.options[activeIndex.value];
|
|
2787
|
+
if (option) {
|
|
2788
|
+
selectOption(option);
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
function onDocumentPointer(event) {
|
|
2793
|
+
var _a, _b;
|
|
2794
|
+
const target = event.target;
|
|
2795
|
+
if (((_a = triggerRef.value) == null ? void 0 : _a.contains(target)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(target))) {
|
|
2796
|
+
return;
|
|
2797
|
+
}
|
|
2798
|
+
close();
|
|
2799
|
+
}
|
|
2800
|
+
function onViewportChange() {
|
|
2801
|
+
if (open.value) {
|
|
2802
|
+
updatePosition();
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
vue.watch(open, (isOpen) => {
|
|
2806
|
+
if (isOpen) {
|
|
2807
|
+
document.addEventListener("pointerdown", onDocumentPointer);
|
|
2808
|
+
window.addEventListener("resize", onViewportChange);
|
|
2809
|
+
window.addEventListener("scroll", onViewportChange, true);
|
|
2810
|
+
return;
|
|
2811
|
+
}
|
|
2812
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
2813
|
+
window.removeEventListener("resize", onViewportChange);
|
|
2814
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
2815
|
+
});
|
|
2816
|
+
vue.onBeforeUnmount(() => {
|
|
2817
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
2818
|
+
window.removeEventListener("resize", onViewportChange);
|
|
2819
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
2820
|
+
});
|
|
2821
|
+
return (_ctx, _cache) => {
|
|
2822
|
+
var _a;
|
|
2823
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2824
|
+
class: vue.normalizeClass(["tao-select", { "tao-select--open": open.value, "tao-select--invalid": invalid.value }])
|
|
2825
|
+
}, [
|
|
2826
|
+
vue.createElementVNode("button", {
|
|
2827
|
+
id: controlId.value,
|
|
2828
|
+
ref_key: "triggerRef",
|
|
2829
|
+
ref: triggerRef,
|
|
2830
|
+
type: "button",
|
|
2831
|
+
class: vue.normalizeClass(["tao-select__trigger", { "tao-select__trigger--placeholder": !selected.value }]),
|
|
2832
|
+
role: "combobox",
|
|
2833
|
+
"aria-expanded": open.value,
|
|
2834
|
+
"aria-haspopup": "listbox",
|
|
2835
|
+
"aria-controls": listId,
|
|
2836
|
+
"aria-invalid": invalid.value || void 0,
|
|
2837
|
+
"aria-describedby": describedBy.value,
|
|
2838
|
+
disabled: __props.disabled,
|
|
2839
|
+
onClick: toggle,
|
|
2840
|
+
onKeydown: onTriggerKeydown
|
|
2841
|
+
}, [
|
|
2842
|
+
vue.createElementVNode("span", _hoisted_2$h, vue.toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? __props.placeholder), 1),
|
|
2843
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("span", {
|
|
2844
|
+
class: "tao-select__chevron",
|
|
2845
|
+
"aria-hidden": "true"
|
|
2846
|
+
}, null, -1))
|
|
2847
|
+
], 42, _hoisted_1$j),
|
|
2848
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
2849
|
+
open.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2850
|
+
key: 0,
|
|
2851
|
+
ref_key: "panelRef",
|
|
2852
|
+
ref: panelRef,
|
|
2853
|
+
class: "tao-select__panel",
|
|
2854
|
+
style: vue.normalizeStyle(listStyle.value)
|
|
2855
|
+
}, [
|
|
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$f),
|
|
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)
|
|
2895
|
+
]))
|
|
2896
|
+
], 2);
|
|
2897
|
+
};
|
|
2898
|
+
}
|
|
2899
|
+
});
|
|
2900
|
+
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-42551757"]]);
|
|
2901
|
+
const _hoisted_1$i = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
|
|
2902
|
+
const _hoisted_2$g = {
|
|
2903
|
+
key: 0,
|
|
2904
|
+
class: "tao-combobox__empty"
|
|
2905
|
+
};
|
|
2906
|
+
const _hoisted_3$e = ["id", "aria-selected", "aria-disabled", "data-tao-combobox-index", "onClick", "onMouseenter"];
|
|
2907
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2908
|
+
...{ name: "TaoCombobox" },
|
|
2909
|
+
__name: "TaoCombobox",
|
|
2910
|
+
props: {
|
|
2911
|
+
modelValue: { default: null },
|
|
2912
|
+
options: { default: () => [] },
|
|
2913
|
+
placeholder: { default: "Начните вводить" },
|
|
2914
|
+
disabled: { type: Boolean, default: false },
|
|
2915
|
+
error: { type: Boolean, default: false },
|
|
2916
|
+
allowCreate: { type: Boolean, default: false }
|
|
2917
|
+
},
|
|
2918
|
+
emits: ["update:modelValue", "change", "create"],
|
|
2400
2919
|
setup(__props, { emit: __emit }) {
|
|
2401
2920
|
const props = __props;
|
|
2402
2921
|
const emit = __emit;
|
|
@@ -2407,62 +2926,164 @@
|
|
|
2407
2926
|
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2408
2927
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
2409
2928
|
const open = vue.ref(false);
|
|
2929
|
+
const focused = vue.ref(false);
|
|
2930
|
+
const picking = vue.ref(false);
|
|
2931
|
+
const skipFocusOpen = vue.ref(false);
|
|
2932
|
+
const query = vue.ref("");
|
|
2410
2933
|
const activeIndex = vue.ref(-1);
|
|
2411
|
-
const
|
|
2934
|
+
const fieldRef = vue.ref(null);
|
|
2935
|
+
const inputRef = vue.ref(null);
|
|
2936
|
+
const panelRef = vue.ref(null);
|
|
2412
2937
|
const listRef = vue.ref(null);
|
|
2413
2938
|
const listStyle = vue.ref({ top: "0px", left: "0px", width: "0px" });
|
|
2414
|
-
const selected = vue.computed(() =>
|
|
2939
|
+
const selected = vue.computed(() => {
|
|
2940
|
+
const found = props.options.find((option) => option.value === props.modelValue);
|
|
2941
|
+
if (found) {
|
|
2942
|
+
return found;
|
|
2943
|
+
}
|
|
2944
|
+
if (props.modelValue === null || props.modelValue === void 0 || props.modelValue === "") {
|
|
2945
|
+
return null;
|
|
2946
|
+
}
|
|
2947
|
+
return { value: props.modelValue, label: String(props.modelValue) };
|
|
2948
|
+
});
|
|
2949
|
+
const needle = vue.computed(() => query.value.trim().toLowerCase());
|
|
2950
|
+
const filtered = vue.computed(() => {
|
|
2951
|
+
if (!needle.value) {
|
|
2952
|
+
return props.options;
|
|
2953
|
+
}
|
|
2954
|
+
return props.options.filter((option) => option.label.toLowerCase().includes(needle.value));
|
|
2955
|
+
});
|
|
2956
|
+
const canCreate = vue.computed(() => {
|
|
2957
|
+
const text = query.value.trim();
|
|
2958
|
+
if (!props.allowCreate || !text) {
|
|
2959
|
+
return false;
|
|
2960
|
+
}
|
|
2961
|
+
return !props.options.some((option) => option.label.toLowerCase() === text.toLowerCase());
|
|
2962
|
+
});
|
|
2963
|
+
const rows = vue.computed(() => {
|
|
2964
|
+
const next = filtered.value.map((option) => ({ kind: "option", option }));
|
|
2965
|
+
if (canCreate.value) {
|
|
2966
|
+
next.push({ kind: "create", text: query.value.trim() });
|
|
2967
|
+
}
|
|
2968
|
+
return next;
|
|
2969
|
+
});
|
|
2415
2970
|
const enabledIndexes = vue.computed(
|
|
2416
|
-
() =>
|
|
2971
|
+
() => rows.value.map((row, index) => row.kind === "option" && row.option.disabled ? -1 : index).filter((index) => index >= 0)
|
|
2417
2972
|
);
|
|
2973
|
+
const activeId = vue.computed(() => activeIndex.value >= 0 ? `${listId}-row-${activeIndex.value}` : void 0);
|
|
2974
|
+
function syncQueryFromModel() {
|
|
2975
|
+
var _a;
|
|
2976
|
+
query.value = ((_a = selected.value) == null ? void 0 : _a.label) ?? "";
|
|
2977
|
+
}
|
|
2418
2978
|
function updatePosition() {
|
|
2419
|
-
const trigger =
|
|
2420
|
-
const
|
|
2421
|
-
if (!trigger || !
|
|
2979
|
+
const trigger = fieldRef.value;
|
|
2980
|
+
const panel = panelRef.value;
|
|
2981
|
+
if (!trigger || !panel) {
|
|
2422
2982
|
return;
|
|
2423
2983
|
}
|
|
2424
2984
|
const rect = trigger.getBoundingClientRect();
|
|
2425
|
-
const
|
|
2985
|
+
const panelHeight = panel.offsetHeight;
|
|
2426
2986
|
const gap = 4;
|
|
2427
2987
|
const spaceBelow = window.innerHeight - rect.bottom - gap;
|
|
2428
|
-
const openUp = spaceBelow <
|
|
2988
|
+
const openUp = spaceBelow < panelHeight && rect.top > spaceBelow;
|
|
2429
2989
|
listStyle.value = {
|
|
2430
|
-
top: `${openUp ? rect.top -
|
|
2990
|
+
top: `${openUp ? rect.top - panelHeight - gap : rect.bottom + gap}px`,
|
|
2431
2991
|
left: `${rect.left}px`,
|
|
2432
2992
|
width: `${rect.width}px`
|
|
2433
2993
|
};
|
|
2434
2994
|
}
|
|
2995
|
+
function resetActive() {
|
|
2996
|
+
const selectedIndex = rows.value.findIndex(
|
|
2997
|
+
(row) => row.kind === "option" && row.option.value === props.modelValue
|
|
2998
|
+
);
|
|
2999
|
+
if (selectedIndex >= 0 && enabledIndexes.value.includes(selectedIndex)) {
|
|
3000
|
+
activeIndex.value = selectedIndex;
|
|
3001
|
+
return;
|
|
3002
|
+
}
|
|
3003
|
+
activeIndex.value = enabledIndexes.value[0] ?? -1;
|
|
3004
|
+
}
|
|
2435
3005
|
async function setOpen(next) {
|
|
2436
|
-
var _a;
|
|
2437
3006
|
if (props.disabled) {
|
|
2438
3007
|
return;
|
|
2439
3008
|
}
|
|
2440
3009
|
open.value = next;
|
|
2441
|
-
|
|
2442
|
-
return;
|
|
2443
|
-
}
|
|
2444
|
-
const selectedIndex = props.options.findIndex((option) => option.value === props.modelValue);
|
|
2445
|
-
activeIndex.value = selectedIndex >= 0 ? selectedIndex : enabledIndexes.value[0] ?? -1;
|
|
3010
|
+
resetActive();
|
|
2446
3011
|
await vue.nextTick();
|
|
2447
3012
|
updatePosition();
|
|
2448
|
-
(_a = listRef.value) == null ? void 0 : _a.focus();
|
|
2449
3013
|
scrollActiveIntoView();
|
|
2450
3014
|
}
|
|
2451
|
-
function
|
|
2452
|
-
|
|
3015
|
+
function emitValue(value) {
|
|
3016
|
+
emit("update:modelValue", value);
|
|
3017
|
+
emit("change", value);
|
|
2453
3018
|
}
|
|
2454
|
-
function
|
|
3019
|
+
function keepFocusQuiet() {
|
|
3020
|
+
var _a;
|
|
3021
|
+
skipFocusOpen.value = true;
|
|
3022
|
+
picking.value = false;
|
|
3023
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
3024
|
+
}
|
|
3025
|
+
function commitCreated(value) {
|
|
3026
|
+
emitValue(value);
|
|
3027
|
+
emit("create", value);
|
|
3028
|
+
query.value = value;
|
|
2455
3029
|
open.value = false;
|
|
3030
|
+
keepFocusQuiet();
|
|
2456
3031
|
}
|
|
2457
3032
|
function selectOption(option) {
|
|
2458
|
-
var _a;
|
|
2459
3033
|
if (option.disabled) {
|
|
2460
3034
|
return;
|
|
2461
3035
|
}
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
(
|
|
3036
|
+
emitValue(option.value);
|
|
3037
|
+
query.value = option.label;
|
|
3038
|
+
open.value = false;
|
|
3039
|
+
keepFocusQuiet();
|
|
3040
|
+
}
|
|
3041
|
+
function createFromQuery(text) {
|
|
3042
|
+
const value = text.trim();
|
|
3043
|
+
if (!value) {
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
const exact = props.options.find(
|
|
3047
|
+
(option) => !option.disabled && option.label.toLowerCase() === value.toLowerCase()
|
|
3048
|
+
);
|
|
3049
|
+
if (exact) {
|
|
3050
|
+
selectOption(exact);
|
|
3051
|
+
return;
|
|
3052
|
+
}
|
|
3053
|
+
if (!props.allowCreate) {
|
|
3054
|
+
return;
|
|
3055
|
+
}
|
|
3056
|
+
commitCreated(value);
|
|
3057
|
+
}
|
|
3058
|
+
function revertQuery() {
|
|
3059
|
+
syncQueryFromModel();
|
|
3060
|
+
}
|
|
3061
|
+
function closeAndRevert() {
|
|
3062
|
+
open.value = false;
|
|
3063
|
+
revertQuery();
|
|
3064
|
+
}
|
|
3065
|
+
function closeAndCommit() {
|
|
3066
|
+
open.value = false;
|
|
3067
|
+
const text = query.value.trim();
|
|
3068
|
+
if (!text) {
|
|
3069
|
+
revertQuery();
|
|
3070
|
+
return;
|
|
3071
|
+
}
|
|
3072
|
+
const exact = props.options.find(
|
|
3073
|
+
(option) => !option.disabled && option.label.toLowerCase() === text.toLowerCase()
|
|
3074
|
+
);
|
|
3075
|
+
if (exact) {
|
|
3076
|
+
emitValue(exact.value);
|
|
3077
|
+
query.value = exact.label;
|
|
3078
|
+
return;
|
|
3079
|
+
}
|
|
3080
|
+
if (props.allowCreate) {
|
|
3081
|
+
emitValue(text);
|
|
3082
|
+
emit("create", text);
|
|
3083
|
+
query.value = text;
|
|
3084
|
+
return;
|
|
3085
|
+
}
|
|
3086
|
+
revertQuery();
|
|
2466
3087
|
}
|
|
2467
3088
|
function moveActive(delta) {
|
|
2468
3089
|
const enabled = enabledIndexes.value;
|
|
@@ -2479,69 +3100,156 @@
|
|
|
2479
3100
|
if (!list || activeIndex.value < 0) {
|
|
2480
3101
|
return;
|
|
2481
3102
|
}
|
|
2482
|
-
const option = list.querySelector(`[data-tao-
|
|
3103
|
+
const option = list.querySelector(`[data-tao-combobox-index="${activeIndex.value}"]`);
|
|
2483
3104
|
option == null ? void 0 : option.scrollIntoView({ block: "nearest" });
|
|
2484
3105
|
}
|
|
2485
|
-
function
|
|
3106
|
+
function onFieldMouseDown(event) {
|
|
3107
|
+
var _a;
|
|
3108
|
+
if (props.disabled || event.button !== 0) {
|
|
3109
|
+
return;
|
|
3110
|
+
}
|
|
3111
|
+
const onInput2 = event.target === inputRef.value;
|
|
3112
|
+
if (onInput2) {
|
|
3113
|
+
if (focused.value && !open.value) {
|
|
3114
|
+
void setOpen(true);
|
|
3115
|
+
}
|
|
3116
|
+
return;
|
|
3117
|
+
}
|
|
3118
|
+
event.preventDefault();
|
|
3119
|
+
if (open.value) {
|
|
3120
|
+
open.value = false;
|
|
3121
|
+
return;
|
|
3122
|
+
}
|
|
3123
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
3124
|
+
void setOpen(true);
|
|
3125
|
+
}
|
|
3126
|
+
function onInput() {
|
|
2486
3127
|
if (props.disabled) {
|
|
2487
3128
|
return;
|
|
2488
3129
|
}
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
3130
|
+
void setOpen(true);
|
|
3131
|
+
resetActive();
|
|
3132
|
+
}
|
|
3133
|
+
function onFocus() {
|
|
3134
|
+
if (props.disabled) {
|
|
3135
|
+
return;
|
|
2492
3136
|
}
|
|
3137
|
+
focused.value = true;
|
|
3138
|
+
if (skipFocusOpen.value) {
|
|
3139
|
+
skipFocusOpen.value = false;
|
|
3140
|
+
return;
|
|
3141
|
+
}
|
|
3142
|
+
void setOpen(true);
|
|
3143
|
+
vue.nextTick(() => {
|
|
3144
|
+
var _a;
|
|
3145
|
+
return (_a = inputRef.value) == null ? void 0 : _a.select();
|
|
3146
|
+
});
|
|
2493
3147
|
}
|
|
2494
|
-
function
|
|
2495
|
-
|
|
3148
|
+
function markPicking() {
|
|
3149
|
+
picking.value = true;
|
|
3150
|
+
}
|
|
3151
|
+
function onBlur() {
|
|
3152
|
+
focused.value = false;
|
|
3153
|
+
window.setTimeout(() => {
|
|
3154
|
+
var _a, _b;
|
|
3155
|
+
if (picking.value) {
|
|
3156
|
+
picking.value = false;
|
|
3157
|
+
return;
|
|
3158
|
+
}
|
|
3159
|
+
if (((_a = fieldRef.value) == null ? void 0 : _a.contains(document.activeElement)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(document.activeElement))) {
|
|
3160
|
+
return;
|
|
3161
|
+
}
|
|
3162
|
+
if (props.allowCreate) {
|
|
3163
|
+
closeAndCommit();
|
|
3164
|
+
return;
|
|
3165
|
+
}
|
|
3166
|
+
closeAndRevert();
|
|
3167
|
+
}, 0);
|
|
3168
|
+
}
|
|
3169
|
+
function activateRow(row) {
|
|
3170
|
+
if (row.kind === "create") {
|
|
3171
|
+
createFromQuery(row.text);
|
|
3172
|
+
return;
|
|
3173
|
+
}
|
|
3174
|
+
selectOption(row.option);
|
|
3175
|
+
}
|
|
3176
|
+
function onInputKeydown(event) {
|
|
3177
|
+
if (props.disabled) {
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
2496
3180
|
if (event.key === "Escape") {
|
|
2497
3181
|
event.preventDefault();
|
|
2498
|
-
|
|
2499
|
-
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
3182
|
+
closeAndRevert();
|
|
2500
3183
|
return;
|
|
2501
3184
|
}
|
|
2502
3185
|
if (event.key === "ArrowDown") {
|
|
2503
3186
|
event.preventDefault();
|
|
3187
|
+
if (!open.value) {
|
|
3188
|
+
void setOpen(true);
|
|
3189
|
+
return;
|
|
3190
|
+
}
|
|
2504
3191
|
moveActive(1);
|
|
2505
3192
|
return;
|
|
2506
3193
|
}
|
|
2507
3194
|
if (event.key === "ArrowUp") {
|
|
2508
3195
|
event.preventDefault();
|
|
3196
|
+
if (!open.value) {
|
|
3197
|
+
void setOpen(true);
|
|
3198
|
+
return;
|
|
3199
|
+
}
|
|
2509
3200
|
moveActive(-1);
|
|
2510
3201
|
return;
|
|
2511
3202
|
}
|
|
2512
|
-
if (event.key === "
|
|
2513
|
-
event.preventDefault();
|
|
2514
|
-
activeIndex.value = enabledIndexes.value[0] ?? -1;
|
|
2515
|
-
scrollActiveIntoView();
|
|
2516
|
-
return;
|
|
2517
|
-
}
|
|
2518
|
-
if (event.key === "End") {
|
|
2519
|
-
event.preventDefault();
|
|
2520
|
-
activeIndex.value = enabledIndexes.value[enabledIndexes.value.length - 1] ?? -1;
|
|
2521
|
-
scrollActiveIntoView();
|
|
2522
|
-
return;
|
|
2523
|
-
}
|
|
2524
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
3203
|
+
if (event.key === "Enter") {
|
|
2525
3204
|
event.preventDefault();
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
3205
|
+
if (!open.value) {
|
|
3206
|
+
void setOpen(true);
|
|
3207
|
+
return;
|
|
3208
|
+
}
|
|
3209
|
+
const row = rows.value[activeIndex.value];
|
|
3210
|
+
if (row) {
|
|
3211
|
+
activateRow(row);
|
|
3212
|
+
return;
|
|
3213
|
+
}
|
|
3214
|
+
if (props.allowCreate) {
|
|
3215
|
+
createFromQuery(query.value);
|
|
2529
3216
|
}
|
|
2530
3217
|
}
|
|
2531
3218
|
}
|
|
2532
3219
|
function onDocumentPointer(event) {
|
|
2533
3220
|
var _a, _b;
|
|
2534
3221
|
const target = event.target;
|
|
2535
|
-
if (((_a =
|
|
3222
|
+
if (((_a = fieldRef.value) == null ? void 0 : _a.contains(target)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(target))) {
|
|
2536
3223
|
return;
|
|
2537
3224
|
}
|
|
2538
|
-
|
|
3225
|
+
if (props.allowCreate) {
|
|
3226
|
+
closeAndCommit();
|
|
3227
|
+
return;
|
|
3228
|
+
}
|
|
3229
|
+
closeAndRevert();
|
|
2539
3230
|
}
|
|
2540
3231
|
function onViewportChange() {
|
|
2541
3232
|
if (open.value) {
|
|
2542
3233
|
updatePosition();
|
|
2543
3234
|
}
|
|
2544
3235
|
}
|
|
3236
|
+
vue.watch(
|
|
3237
|
+
() => props.modelValue,
|
|
3238
|
+
() => {
|
|
3239
|
+
if (!focused.value) {
|
|
3240
|
+
syncQueryFromModel();
|
|
3241
|
+
}
|
|
3242
|
+
},
|
|
3243
|
+
{ immediate: true }
|
|
3244
|
+
);
|
|
3245
|
+
vue.watch(rows, () => {
|
|
3246
|
+
if (!open.value) {
|
|
3247
|
+
return;
|
|
3248
|
+
}
|
|
3249
|
+
if (!enabledIndexes.value.includes(activeIndex.value)) {
|
|
3250
|
+
activeIndex.value = enabledIndexes.value[0] ?? -1;
|
|
3251
|
+
}
|
|
3252
|
+
});
|
|
2545
3253
|
vue.watch(open, (isOpen) => {
|
|
2546
3254
|
if (isOpen) {
|
|
2547
3255
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
@@ -2559,71 +3267,105 @@
|
|
|
2559
3267
|
window.removeEventListener("scroll", onViewportChange, true);
|
|
2560
3268
|
});
|
|
2561
3269
|
return (_ctx, _cache) => {
|
|
2562
|
-
var _a;
|
|
2563
3270
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2564
|
-
class: vue.normalizeClass(["tao-
|
|
3271
|
+
class: vue.normalizeClass(["tao-combobox", {
|
|
3272
|
+
"tao-combobox--open": open.value,
|
|
3273
|
+
"tao-combobox--invalid": invalid.value,
|
|
3274
|
+
"tao-combobox--disabled": __props.disabled
|
|
3275
|
+
}])
|
|
2565
3276
|
}, [
|
|
2566
|
-
vue.createElementVNode("
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
class: vue.normalizeClass(["tao-select__trigger", { "tao-select__trigger--placeholder": !selected.value }]),
|
|
2572
|
-
role: "combobox",
|
|
2573
|
-
"aria-expanded": open.value,
|
|
2574
|
-
"aria-haspopup": "listbox",
|
|
2575
|
-
"aria-controls": listId,
|
|
2576
|
-
"aria-invalid": invalid.value || void 0,
|
|
2577
|
-
"aria-describedby": describedBy.value,
|
|
2578
|
-
disabled: __props.disabled,
|
|
2579
|
-
onClick: toggle,
|
|
2580
|
-
onKeydown: onTriggerKeydown
|
|
3277
|
+
vue.createElementVNode("div", {
|
|
3278
|
+
ref_key: "fieldRef",
|
|
3279
|
+
ref: fieldRef,
|
|
3280
|
+
class: "tao-combobox__field",
|
|
3281
|
+
onMousedown: onFieldMouseDown
|
|
2581
3282
|
}, [
|
|
2582
|
-
vue.createElementVNode("
|
|
3283
|
+
vue.createElementVNode("input", {
|
|
3284
|
+
id: controlId.value,
|
|
3285
|
+
ref_key: "inputRef",
|
|
3286
|
+
ref: inputRef,
|
|
3287
|
+
class: "tao-combobox__input",
|
|
3288
|
+
type: "text",
|
|
3289
|
+
role: "combobox",
|
|
3290
|
+
autocomplete: "off",
|
|
3291
|
+
"aria-autocomplete": "list",
|
|
3292
|
+
"aria-haspopup": "listbox",
|
|
3293
|
+
"aria-expanded": open.value,
|
|
3294
|
+
"aria-controls": listId,
|
|
3295
|
+
"aria-activedescendant": open.value ? activeId.value : void 0,
|
|
3296
|
+
"aria-invalid": invalid.value || void 0,
|
|
3297
|
+
"aria-describedby": describedBy.value,
|
|
3298
|
+
disabled: __props.disabled,
|
|
3299
|
+
placeholder: __props.placeholder,
|
|
3300
|
+
value: query.value,
|
|
3301
|
+
onInput: _cache[0] || (_cache[0] = ($event) => {
|
|
3302
|
+
query.value = $event.target.value;
|
|
3303
|
+
onInput();
|
|
3304
|
+
}),
|
|
3305
|
+
onFocus,
|
|
3306
|
+
onBlur,
|
|
3307
|
+
onKeydown: onInputKeydown
|
|
3308
|
+
}, null, 40, _hoisted_1$i),
|
|
2583
3309
|
_cache[1] || (_cache[1] = vue.createElementVNode("span", {
|
|
2584
|
-
class: "tao-
|
|
3310
|
+
class: "tao-combobox__chevron",
|
|
2585
3311
|
"aria-hidden": "true"
|
|
2586
3312
|
}, null, -1))
|
|
2587
|
-
],
|
|
3313
|
+
], 544),
|
|
2588
3314
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
2589
|
-
open.value ? (vue.openBlock(), vue.createElementBlock("
|
|
3315
|
+
open.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2590
3316
|
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
|
|
3317
|
+
ref_key: "panelRef",
|
|
3318
|
+
ref: panelRef,
|
|
3319
|
+
class: "tao-combobox__panel",
|
|
3320
|
+
style: vue.normalizeStyle(listStyle.value)
|
|
2600
3321
|
}, [
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
3322
|
+
vue.createElementVNode("ul", {
|
|
3323
|
+
id: listId,
|
|
3324
|
+
ref_key: "listRef",
|
|
3325
|
+
ref: listRef,
|
|
3326
|
+
class: "tao-combobox__list",
|
|
3327
|
+
role: "listbox"
|
|
3328
|
+
}, [
|
|
3329
|
+
!rows.value.length ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_2$g, "Ничего не найдено")) : vue.createCommentVNode("", true),
|
|
3330
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(rows.value, (row, index) => {
|
|
3331
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
3332
|
+
id: `${listId}-row-${index}`,
|
|
3333
|
+
key: row.kind === "create" ? "create" : String(row.option.value),
|
|
3334
|
+
class: vue.normalizeClass(["tao-combobox__option", {
|
|
3335
|
+
"tao-combobox__option--active": index === activeIndex.value,
|
|
3336
|
+
"tao-combobox__option--selected": row.kind === "option" && row.option.value === __props.modelValue,
|
|
3337
|
+
"tao-combobox__option--disabled": row.kind === "option" && row.option.disabled,
|
|
3338
|
+
"tao-combobox__option--create": row.kind === "create"
|
|
3339
|
+
}]),
|
|
3340
|
+
role: "option",
|
|
3341
|
+
"aria-selected": row.kind === "option" && row.option.value === __props.modelValue,
|
|
3342
|
+
"aria-disabled": row.kind === "option" && row.option.disabled ? true : void 0,
|
|
3343
|
+
"data-tao-combobox-index": index,
|
|
3344
|
+
onMousedown: vue.withModifiers(markPicking, ["prevent"]),
|
|
3345
|
+
onClick: ($event) => activateRow(row),
|
|
3346
|
+
onMouseenter: ($event) => !(row.kind === "option" && row.option.disabled) && (activeIndex.value = index)
|
|
3347
|
+
}, [
|
|
3348
|
+
row.kind === "create" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
3349
|
+
vue.createTextVNode("Добавить «" + vue.toDisplayString(row.text) + "»", 1)
|
|
3350
|
+
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
3351
|
+
vue.createTextVNode(vue.toDisplayString(row.option.label), 1)
|
|
3352
|
+
], 64))
|
|
3353
|
+
], 42, _hoisted_3$e);
|
|
3354
|
+
}), 128))
|
|
3355
|
+
], 512),
|
|
3356
|
+
selected.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
3357
|
+
key: 0,
|
|
3358
|
+
type: "button",
|
|
3359
|
+
class: "tao-combobox__clear",
|
|
3360
|
+
onMousedown: vue.withModifiers(markPicking, ["prevent"])
|
|
3361
|
+
}, " Очистить ", 32)) : vue.createCommentVNode("", true)
|
|
3362
|
+
], 4)) : vue.createCommentVNode("", true)
|
|
2621
3363
|
]))
|
|
2622
3364
|
], 2);
|
|
2623
3365
|
};
|
|
2624
3366
|
}
|
|
2625
3367
|
});
|
|
2626
|
-
const
|
|
3368
|
+
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-adeb76a4"]]);
|
|
2627
3369
|
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
2628
3370
|
function formatTaoDateIso(parts) {
|
|
2629
3371
|
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
@@ -2724,8 +3466,8 @@
|
|
|
2724
3466
|
const _hoisted_1$h = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
2725
3467
|
const _hoisted_2$f = { class: "tao-date__value" };
|
|
2726
3468
|
const _hoisted_3$d = ["aria-label"];
|
|
2727
|
-
const _hoisted_4$
|
|
2728
|
-
const _hoisted_5$
|
|
3469
|
+
const _hoisted_4$d = { class: "tao-date__header" };
|
|
3470
|
+
const _hoisted_5$a = { class: "tao-date__month" };
|
|
2729
3471
|
const _hoisted_6$7 = {
|
|
2730
3472
|
class: "tao-date__weekdays",
|
|
2731
3473
|
"aria-hidden": "true"
|
|
@@ -3008,7 +3750,7 @@
|
|
|
3008
3750
|
style: vue.normalizeStyle(panelStyle.value),
|
|
3009
3751
|
onKeydown: onPanelKeydown
|
|
3010
3752
|
}, [
|
|
3011
|
-
vue.createElementVNode("div", _hoisted_4$
|
|
3753
|
+
vue.createElementVNode("div", _hoisted_4$d, [
|
|
3012
3754
|
vue.createElementVNode("button", {
|
|
3013
3755
|
type: "button",
|
|
3014
3756
|
class: "tao-date__nav",
|
|
@@ -3032,7 +3774,7 @@
|
|
|
3032
3774
|
})
|
|
3033
3775
|
], -1)
|
|
3034
3776
|
])]),
|
|
3035
|
-
vue.createElementVNode("p", _hoisted_5$
|
|
3777
|
+
vue.createElementVNode("p", _hoisted_5$a, vue.toDisplayString(monthLabel.value), 1),
|
|
3036
3778
|
vue.createElementVNode("button", {
|
|
3037
3779
|
type: "button",
|
|
3038
3780
|
class: "tao-date__nav",
|
|
@@ -3103,14 +3845,14 @@
|
|
|
3103
3845
|
};
|
|
3104
3846
|
}
|
|
3105
3847
|
});
|
|
3106
|
-
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
3848
|
+
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-4227e5f8"]]);
|
|
3107
3849
|
const _hoisted_1$g = ["for"];
|
|
3108
3850
|
const _hoisted_2$e = ["id", "checked", "disabled", "aria-checked"];
|
|
3109
3851
|
const _hoisted_3$c = {
|
|
3110
3852
|
key: 0,
|
|
3111
3853
|
class: "tao-switch__label"
|
|
3112
3854
|
};
|
|
3113
|
-
const _hoisted_4$
|
|
3855
|
+
const _hoisted_4$c = {
|
|
3114
3856
|
key: 1,
|
|
3115
3857
|
class: "tao-switch__label"
|
|
3116
3858
|
};
|
|
@@ -3158,7 +3900,7 @@
|
|
|
3158
3900
|
}, [
|
|
3159
3901
|
vue.createElementVNode("span", { class: "tao-switch__thumb" })
|
|
3160
3902
|
], -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$
|
|
3903
|
+
__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
3904
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3163
3905
|
])) : vue.createCommentVNode("", true)
|
|
3164
3906
|
], 10, _hoisted_1$g);
|
|
@@ -3173,7 +3915,7 @@
|
|
|
3173
3915
|
key: 0,
|
|
3174
3916
|
class: "tao-radio__label"
|
|
3175
3917
|
};
|
|
3176
|
-
const _hoisted_4$
|
|
3918
|
+
const _hoisted_4$b = {
|
|
3177
3919
|
key: 1,
|
|
3178
3920
|
class: "tao-radio__label"
|
|
3179
3921
|
};
|
|
@@ -3229,7 +3971,7 @@
|
|
|
3229
3971
|
class: "tao-radio__dot",
|
|
3230
3972
|
"aria-hidden": "true"
|
|
3231
3973
|
}, 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$
|
|
3974
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$b, vue.toDisplayString(__props.label), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$b, [
|
|
3233
3975
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3234
3976
|
]))
|
|
3235
3977
|
], 10, _hoisted_1$f);
|
|
@@ -3288,7 +4030,7 @@
|
|
|
3288
4030
|
key: 0,
|
|
3289
4031
|
class: "tao-alert__title"
|
|
3290
4032
|
};
|
|
3291
|
-
const _hoisted_4$
|
|
4033
|
+
const _hoisted_4$a = {
|
|
3292
4034
|
key: 1,
|
|
3293
4035
|
class: "tao-alert__message"
|
|
3294
4036
|
};
|
|
@@ -3304,16 +4046,17 @@
|
|
|
3304
4046
|
setup(__props, { emit: __emit }) {
|
|
3305
4047
|
const props = __props;
|
|
3306
4048
|
const emit = __emit;
|
|
3307
|
-
const
|
|
4049
|
+
const tone = vue.computed(() => props.type === "danger" ? "error" : props.type);
|
|
4050
|
+
const live = vue.computed(() => tone.value === "error" || tone.value === "warning" ? "assertive" : "polite");
|
|
3308
4051
|
return (_ctx, _cache) => {
|
|
3309
4052
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3310
|
-
class: vue.normalizeClass(["tao-alert", `tao-alert--${
|
|
3311
|
-
role:
|
|
4053
|
+
class: vue.normalizeClass(["tao-alert", `tao-alert--${tone.value}`]),
|
|
4054
|
+
role: tone.value === "error" ? "alert" : "status",
|
|
3312
4055
|
"aria-live": live.value
|
|
3313
4056
|
}, [
|
|
3314
4057
|
vue.createElementVNode("div", _hoisted_2$b, [
|
|
3315
4058
|
__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$
|
|
4059
|
+
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$a, [
|
|
3317
4060
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3318
4061
|
])) : vue.createCommentVNode("", true)
|
|
3319
4062
|
]),
|
|
@@ -3328,12 +4071,12 @@
|
|
|
3328
4071
|
};
|
|
3329
4072
|
}
|
|
3330
4073
|
});
|
|
3331
|
-
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
4074
|
+
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-4c89fa1f"]]);
|
|
3332
4075
|
const _hoisted_1$c = { key: 0 };
|
|
3333
4076
|
const _hoisted_2$a = ["aria-sort"];
|
|
3334
4077
|
const _hoisted_3$9 = ["onClick"];
|
|
3335
|
-
const _hoisted_4$
|
|
3336
|
-
const _hoisted_5$
|
|
4078
|
+
const _hoisted_4$9 = { key: 1 };
|
|
4079
|
+
const _hoisted_5$9 = { key: 0 };
|
|
3337
4080
|
const _hoisted_6$6 = ["colspan"];
|
|
3338
4081
|
const _hoisted_7$4 = ["onClick"];
|
|
3339
4082
|
const _hoisted_8$4 = {
|
|
@@ -3446,13 +4189,13 @@
|
|
|
3446
4189
|
}]),
|
|
3447
4190
|
"aria-hidden": "true"
|
|
3448
4191
|
}, null, 2)
|
|
3449
|
-
], 8, _hoisted_3$9)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
4192
|
+
], 8, _hoisted_3$9)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$9, vue.toDisplayString(column.label), 1))
|
|
3450
4193
|
], 12, _hoisted_2$a);
|
|
3451
4194
|
}), 128))
|
|
3452
4195
|
])
|
|
3453
4196
|
]),
|
|
3454
4197
|
vue.createElementVNode("tbody", null, [
|
|
3455
|
-
isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_5$
|
|
4198
|
+
isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_5$9, [
|
|
3456
4199
|
vue.createElementVNode("td", {
|
|
3457
4200
|
class: "tao-table__empty",
|
|
3458
4201
|
colspan: colCount.value
|
|
@@ -3533,8 +4276,8 @@
|
|
|
3533
4276
|
class: "tao-pagination__total"
|
|
3534
4277
|
};
|
|
3535
4278
|
const _hoisted_3$8 = { class: "tao-pagination__pages" };
|
|
3536
|
-
const _hoisted_4$
|
|
3537
|
-
const _hoisted_5$
|
|
4279
|
+
const _hoisted_4$8 = ["disabled"];
|
|
4280
|
+
const _hoisted_5$8 = ["aria-label", "disabled", "onClick"];
|
|
3538
4281
|
const _hoisted_6$5 = {
|
|
3539
4282
|
key: 1,
|
|
3540
4283
|
class: "tao-pagination__ellipsis",
|
|
@@ -3600,7 +4343,7 @@
|
|
|
3600
4343
|
"aria-label": "Назад",
|
|
3601
4344
|
disabled: __props.disabled || current.value <= 1,
|
|
3602
4345
|
onClick: _cache[0] || (_cache[0] = ($event) => goTo(current.value - 1))
|
|
3603
|
-
}, " ‹ ", 8, _hoisted_4$
|
|
4346
|
+
}, " ‹ ", 8, _hoisted_4$8),
|
|
3604
4347
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item) => {
|
|
3605
4348
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
3606
4349
|
key: item.type === "page" ? item.page : item.id
|
|
@@ -3612,7 +4355,7 @@
|
|
|
3612
4355
|
"aria-label": item.id === "left" ? `Назад на ${__props.jump} страниц` : `Вперёд на ${__props.jump} страниц`,
|
|
3613
4356
|
disabled: __props.disabled,
|
|
3614
4357
|
onClick: ($event) => goTo(item.id === "left" ? current.value - __props.jump : current.value + __props.jump)
|
|
3615
|
-
}, " … ", 8, _hoisted_5$
|
|
4358
|
+
}, " … ", 8, _hoisted_5$8)) : item.type === "ellipsis" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$5, "…")) : (vue.openBlock(), vue.createElementBlock("button", {
|
|
3616
4359
|
key: 2,
|
|
3617
4360
|
type: "button",
|
|
3618
4361
|
class: vue.normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page === current.value }]),
|
|
@@ -3645,11 +4388,11 @@
|
|
|
3645
4388
|
key: 1,
|
|
3646
4389
|
class: "tao-empty__title"
|
|
3647
4390
|
};
|
|
3648
|
-
const _hoisted_4$
|
|
4391
|
+
const _hoisted_4$7 = {
|
|
3649
4392
|
key: 2,
|
|
3650
4393
|
class: "tao-empty__text"
|
|
3651
4394
|
};
|
|
3652
|
-
const _hoisted_5$
|
|
4395
|
+
const _hoisted_5$7 = {
|
|
3653
4396
|
key: 3,
|
|
3654
4397
|
class: "tao-empty__action"
|
|
3655
4398
|
};
|
|
@@ -3666,10 +4409,10 @@
|
|
|
3666
4409
|
vue.renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
3667
4410
|
])) : vue.createCommentVNode("", true),
|
|
3668
4411
|
__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$
|
|
4412
|
+
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$7, [
|
|
3670
4413
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3671
4414
|
])) : vue.createCommentVNode("", true),
|
|
3672
|
-
_ctx.$slots.action ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$
|
|
4415
|
+
_ctx.$slots.action ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7, [
|
|
3673
4416
|
vue.renderSlot(_ctx.$slots, "action", {}, void 0, true)
|
|
3674
4417
|
])) : vue.createCommentVNode("", true)
|
|
3675
4418
|
]);
|
|
@@ -3713,8 +4456,8 @@
|
|
|
3713
4456
|
class: "tao-drawer__header"
|
|
3714
4457
|
};
|
|
3715
4458
|
const _hoisted_3$6 = ["id"];
|
|
3716
|
-
const _hoisted_4$
|
|
3717
|
-
const _hoisted_5$
|
|
4459
|
+
const _hoisted_4$6 = { key: 1 };
|
|
4460
|
+
const _hoisted_5$6 = { class: "tao-drawer__content" };
|
|
3718
4461
|
const _hoisted_6$4 = {
|
|
3719
4462
|
key: 1,
|
|
3720
4463
|
class: "tao-drawer__footer"
|
|
@@ -3830,7 +4573,7 @@
|
|
|
3830
4573
|
key: 0,
|
|
3831
4574
|
id: vue.unref(titleId),
|
|
3832
4575
|
class: "tao-drawer__title"
|
|
3833
|
-
}, vue.toDisplayString(__props.title), 9, _hoisted_3$6)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
4576
|
+
}, vue.toDisplayString(__props.title), 9, _hoisted_3$6)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$6)),
|
|
3834
4577
|
__props.closable ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
3835
4578
|
key: 2,
|
|
3836
4579
|
type: "button",
|
|
@@ -3839,7 +4582,7 @@
|
|
|
3839
4582
|
onClick: close
|
|
3840
4583
|
}, " × ")) : vue.createCommentVNode("", true)
|
|
3841
4584
|
])) : vue.createCommentVNode("", true),
|
|
3842
|
-
vue.createElementVNode("div", _hoisted_5$
|
|
4585
|
+
vue.createElementVNode("div", _hoisted_5$6, [
|
|
3843
4586
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3844
4587
|
]),
|
|
3845
4588
|
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$4, [
|
|
@@ -3856,8 +4599,14 @@
|
|
|
3856
4599
|
});
|
|
3857
4600
|
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-6a0c0e98"]]);
|
|
3858
4601
|
const _hoisted_1$7 = ["title"];
|
|
3859
|
-
const _hoisted_2$6 =
|
|
3860
|
-
const _hoisted_3$5 = ["
|
|
4602
|
+
const _hoisted_2$6 = { class: "tao-avatar__face" };
|
|
4603
|
+
const _hoisted_3$5 = ["src", "alt"];
|
|
4604
|
+
const _hoisted_4$5 = ["aria-label"];
|
|
4605
|
+
const _hoisted_5$5 = {
|
|
4606
|
+
key: 1,
|
|
4607
|
+
class: "tao-avatar__badge",
|
|
4608
|
+
"aria-hidden": "true"
|
|
4609
|
+
};
|
|
3861
4610
|
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
3862
4611
|
...{ name: "TaoAvatar" },
|
|
3863
4612
|
__name: "TaoAvatar",
|
|
@@ -3865,10 +4614,21 @@
|
|
|
3865
4614
|
src: { default: "" },
|
|
3866
4615
|
name: { default: "" },
|
|
3867
4616
|
alt: { default: "" },
|
|
3868
|
-
size: { default: "
|
|
4617
|
+
size: { default: "medium" },
|
|
4618
|
+
dot: { type: [Boolean, String], default: false },
|
|
4619
|
+
count: { default: void 0 }
|
|
3869
4620
|
},
|
|
3870
4621
|
setup(__props) {
|
|
3871
4622
|
const props = __props;
|
|
4623
|
+
const sizeClass = vue.computed(() => {
|
|
4624
|
+
if (props.size === "small" || props.size === "s") {
|
|
4625
|
+
return "s";
|
|
4626
|
+
}
|
|
4627
|
+
if (props.size === "large" || props.size === "l") {
|
|
4628
|
+
return "l";
|
|
4629
|
+
}
|
|
4630
|
+
return "m";
|
|
4631
|
+
});
|
|
3872
4632
|
const initials = vue.computed(() => {
|
|
3873
4633
|
const parts = props.name.trim().split(/\s+/).filter(Boolean);
|
|
3874
4634
|
if (!parts.length) {
|
|
@@ -3879,27 +4639,74 @@
|
|
|
3879
4639
|
}
|
|
3880
4640
|
return `${parts[0][0] ?? ""}${parts[1][0] ?? ""}`.toUpperCase();
|
|
3881
4641
|
});
|
|
3882
|
-
const
|
|
4642
|
+
const dotTone = vue.computed(() => {
|
|
4643
|
+
if (!props.dot) {
|
|
4644
|
+
return null;
|
|
4645
|
+
}
|
|
4646
|
+
if (props.dot === true) {
|
|
4647
|
+
return "success";
|
|
4648
|
+
}
|
|
4649
|
+
return props.dot === "error" ? "danger" : props.dot;
|
|
4650
|
+
});
|
|
4651
|
+
const badge = vue.computed(() => {
|
|
4652
|
+
if (props.count === void 0 || props.count === "") {
|
|
4653
|
+
return "";
|
|
4654
|
+
}
|
|
4655
|
+
const numeric = typeof props.count === "number" ? props.count : Number(props.count);
|
|
4656
|
+
if (Number.isFinite(numeric)) {
|
|
4657
|
+
if (numeric <= 0) {
|
|
4658
|
+
return "";
|
|
4659
|
+
}
|
|
4660
|
+
return numeric > 99 ? "99+" : String(numeric);
|
|
4661
|
+
}
|
|
4662
|
+
return String(props.count);
|
|
4663
|
+
});
|
|
4664
|
+
const dotLabel = {
|
|
4665
|
+
success: "в сети",
|
|
4666
|
+
danger: "занят",
|
|
4667
|
+
warning: "отошёл",
|
|
4668
|
+
info: "статус",
|
|
4669
|
+
neutral: "не в сети"
|
|
4670
|
+
};
|
|
4671
|
+
const label = vue.computed(() => {
|
|
4672
|
+
const base = props.alt || props.name || "Аватар";
|
|
4673
|
+
const extra = [];
|
|
4674
|
+
if (dotTone.value) {
|
|
4675
|
+
extra.push(dotLabel[dotTone.value]);
|
|
4676
|
+
}
|
|
4677
|
+
if (badge.value) {
|
|
4678
|
+
extra.push(`${badge.value} уведомлений`);
|
|
4679
|
+
}
|
|
4680
|
+
return extra.length ? `${base}, ${extra.join(", ")}` : base;
|
|
4681
|
+
});
|
|
3883
4682
|
return (_ctx, _cache) => {
|
|
3884
4683
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
3885
|
-
class: vue.normalizeClass(["tao-avatar", `tao-avatar--${
|
|
3886
|
-
title:
|
|
4684
|
+
class: vue.normalizeClass(["tao-avatar", `tao-avatar--${sizeClass.value}`]),
|
|
4685
|
+
title: label.value
|
|
3887
4686
|
}, [
|
|
3888
|
-
|
|
4687
|
+
vue.createElementVNode("span", _hoisted_2$6, [
|
|
4688
|
+
__props.src ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
4689
|
+
key: 0,
|
|
4690
|
+
class: "tao-avatar__img",
|
|
4691
|
+
src: __props.src,
|
|
4692
|
+
alt: label.value
|
|
4693
|
+
}, null, 8, _hoisted_3$5)) : (vue.openBlock(), vue.createElementBlock("span", {
|
|
4694
|
+
key: 1,
|
|
4695
|
+
class: "tao-avatar__fallback",
|
|
4696
|
+
"aria-label": label.value
|
|
4697
|
+
}, vue.toDisplayString(initials.value || "?"), 9, _hoisted_4$5))
|
|
4698
|
+
]),
|
|
4699
|
+
dotTone.value ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3889
4700
|
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))
|
|
4701
|
+
class: vue.normalizeClass(["tao-avatar__dot", `tao-avatar__dot--${dotTone.value}`]),
|
|
4702
|
+
"aria-hidden": "true"
|
|
4703
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
4704
|
+
badge.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$5, vue.toDisplayString(badge.value), 1)) : vue.createCommentVNode("", true)
|
|
3898
4705
|
], 10, _hoisted_1$7);
|
|
3899
4706
|
};
|
|
3900
4707
|
}
|
|
3901
4708
|
});
|
|
3902
|
-
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
4709
|
+
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-cb4ec893"]]);
|
|
3903
4710
|
const _hoisted_1$6 = {
|
|
3904
4711
|
class: "tao-breadcrumb",
|
|
3905
4712
|
"aria-label": "Хлебные крошки"
|
|
@@ -3935,7 +4742,7 @@
|
|
|
3935
4742
|
class: "tao-breadcrumb__item"
|
|
3936
4743
|
}, [
|
|
3937
4744
|
index > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$4, "/")) : vue.createCommentVNode("", true),
|
|
3938
|
-
index === __props.items.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$4, vue.toDisplayString(item.label), 1)) : item.to ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4745
|
+
index === __props.items.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$4, vue.toDisplayString(item.label), 1)) : item.to ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
3939
4746
|
key: 2,
|
|
3940
4747
|
class: "tao-breadcrumb__link",
|
|
3941
4748
|
to: item.to
|
|
@@ -4126,7 +4933,7 @@
|
|
|
4126
4933
|
function goNext() {
|
|
4127
4934
|
goTo(index.value + step.value);
|
|
4128
4935
|
}
|
|
4129
|
-
function goTo(next) {
|
|
4936
|
+
function goTo(next, instant = false) {
|
|
4130
4937
|
const el = track.value;
|
|
4131
4938
|
const { width, gap, total } = metrics();
|
|
4132
4939
|
if (!el || width <= 0 || total <= 0) {
|
|
@@ -4148,7 +4955,7 @@
|
|
|
4148
4955
|
}
|
|
4149
4956
|
el.scrollTo({
|
|
4150
4957
|
left: page * (width + gap),
|
|
4151
|
-
behavior: prefersReducedMotion() || dragging.value || wrapping ? "auto" : "smooth"
|
|
4958
|
+
behavior: prefersReducedMotion() || dragging.value || wrapping || instant ? "auto" : "smooth"
|
|
4152
4959
|
});
|
|
4153
4960
|
setIndex(page);
|
|
4154
4961
|
}
|
|
@@ -4206,6 +5013,35 @@
|
|
|
4206
5013
|
setIndex(nearestIndex());
|
|
4207
5014
|
});
|
|
4208
5015
|
}
|
|
5016
|
+
function releaseDragCapture() {
|
|
5017
|
+
const el = track.value;
|
|
5018
|
+
const id = dragPointer;
|
|
5019
|
+
if (!el || id === -1) {
|
|
5020
|
+
return;
|
|
5021
|
+
}
|
|
5022
|
+
if (typeof el.hasPointerCapture === "function" && !el.hasPointerCapture(id)) {
|
|
5023
|
+
return;
|
|
5024
|
+
}
|
|
5025
|
+
try {
|
|
5026
|
+
el.releasePointerCapture(id);
|
|
5027
|
+
} catch {
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
5030
|
+
function endDrag(keepClickGuard = false) {
|
|
5031
|
+
if (!dragging.value) {
|
|
5032
|
+
return;
|
|
5033
|
+
}
|
|
5034
|
+
dragging.value = false;
|
|
5035
|
+
releaseDragCapture();
|
|
5036
|
+
dragPointer = -1;
|
|
5037
|
+
if (!keepClickGuard) {
|
|
5038
|
+
dragMoved = 0;
|
|
5039
|
+
}
|
|
5040
|
+
if (track.value) {
|
|
5041
|
+
goTo(nearestIndex(), true);
|
|
5042
|
+
}
|
|
5043
|
+
syncAutoplay();
|
|
5044
|
+
}
|
|
4209
5045
|
function onPointerDown(event) {
|
|
4210
5046
|
if (event.pointerType !== "mouse" || event.button !== 0 || !track.value) {
|
|
4211
5047
|
return;
|
|
@@ -4215,7 +5051,10 @@
|
|
|
4215
5051
|
dragStartScroll = track.value.scrollLeft;
|
|
4216
5052
|
dragMoved = 0;
|
|
4217
5053
|
dragging.value = true;
|
|
4218
|
-
|
|
5054
|
+
try {
|
|
5055
|
+
track.value.setPointerCapture(event.pointerId);
|
|
5056
|
+
} catch {
|
|
5057
|
+
}
|
|
4219
5058
|
}
|
|
4220
5059
|
function onPointerMove(event) {
|
|
4221
5060
|
if (!dragging.value || event.pointerId !== dragPointer || !track.value) {
|
|
@@ -4225,13 +5064,25 @@
|
|
|
4225
5064
|
dragMoved = Math.abs(dx);
|
|
4226
5065
|
track.value.scrollLeft = dragStartScroll - dx;
|
|
4227
5066
|
}
|
|
4228
|
-
function
|
|
4229
|
-
if (!dragging.value
|
|
5067
|
+
function onPointerEnd(event) {
|
|
5068
|
+
if (!dragging.value) {
|
|
4230
5069
|
return;
|
|
4231
5070
|
}
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
5071
|
+
if (dragPointer !== -1 && event.pointerId !== dragPointer) {
|
|
5072
|
+
return;
|
|
5073
|
+
}
|
|
5074
|
+
endDrag(true);
|
|
5075
|
+
}
|
|
5076
|
+
function onLostPointerCapture() {
|
|
5077
|
+
endDrag();
|
|
5078
|
+
}
|
|
5079
|
+
function onWindowBlur() {
|
|
5080
|
+
endDrag();
|
|
5081
|
+
}
|
|
5082
|
+
function onVisibilityChange() {
|
|
5083
|
+
if (document.hidden) {
|
|
5084
|
+
endDrag();
|
|
5085
|
+
}
|
|
4235
5086
|
syncAutoplay();
|
|
4236
5087
|
}
|
|
4237
5088
|
function onClickCapture(event) {
|
|
@@ -4270,13 +5121,18 @@
|
|
|
4270
5121
|
goTo(props.modelValue);
|
|
4271
5122
|
syncAutoplay();
|
|
4272
5123
|
});
|
|
4273
|
-
document.addEventListener("visibilitychange",
|
|
5124
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
5125
|
+
window.addEventListener("blur", onWindowBlur);
|
|
5126
|
+
window.addEventListener("pagehide", onWindowBlur);
|
|
4274
5127
|
});
|
|
4275
5128
|
vue.onUpdated(refreshCount);
|
|
4276
5129
|
vue.onBeforeUnmount(() => {
|
|
5130
|
+
endDrag();
|
|
4277
5131
|
cancelAnimationFrame(scrollFrame);
|
|
4278
5132
|
stopAutoplay();
|
|
4279
|
-
document.removeEventListener("visibilitychange",
|
|
5133
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
5134
|
+
window.removeEventListener("blur", onWindowBlur);
|
|
5135
|
+
window.removeEventListener("pagehide", onWindowBlur);
|
|
4280
5136
|
});
|
|
4281
5137
|
return (_ctx, _cache) => {
|
|
4282
5138
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -4329,8 +5185,9 @@
|
|
|
4329
5185
|
onKeydown,
|
|
4330
5186
|
onPointerdown: onPointerDown,
|
|
4331
5187
|
onPointermove: onPointerMove,
|
|
4332
|
-
onPointerup:
|
|
4333
|
-
onPointercancel:
|
|
5188
|
+
onPointerup: onPointerEnd,
|
|
5189
|
+
onPointercancel: onPointerEnd,
|
|
5190
|
+
onLostpointercapture: onLostPointerCapture,
|
|
4334
5191
|
onClickCapture
|
|
4335
5192
|
}, [
|
|
4336
5193
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -4396,7 +5253,7 @@
|
|
|
4396
5253
|
};
|
|
4397
5254
|
}
|
|
4398
5255
|
});
|
|
4399
|
-
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
5256
|
+
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-81afb8b0"]]);
|
|
4400
5257
|
const _hoisted_1$3 = ["aria-label"];
|
|
4401
5258
|
const _hoisted_2$2 = ["aria-label"];
|
|
4402
5259
|
const _hoisted_3$2 = {
|
|
@@ -4449,6 +5306,9 @@
|
|
|
4449
5306
|
bad: "ошибка"
|
|
4450
5307
|
};
|
|
4451
5308
|
function statusOf(item) {
|
|
5309
|
+
if (item.status === "danger") {
|
|
5310
|
+
return "bad";
|
|
5311
|
+
}
|
|
4452
5312
|
return item.status ?? "wait";
|
|
4453
5313
|
}
|
|
4454
5314
|
function itemLabel(item) {
|
|
@@ -4526,7 +5386,7 @@
|
|
|
4526
5386
|
};
|
|
4527
5387
|
}
|
|
4528
5388
|
});
|
|
4529
|
-
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
5389
|
+
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-fefa5c65"]]);
|
|
4530
5390
|
const TOAST_POSITIONS = [
|
|
4531
5391
|
"topRight",
|
|
4532
5392
|
"topLeft",
|
|
@@ -4652,6 +5512,7 @@
|
|
|
4652
5512
|
class: "tao-toast__actions"
|
|
4653
5513
|
};
|
|
4654
5514
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
5515
|
+
...{ name: "TaoToastItem" },
|
|
4655
5516
|
__name: "TaoToastItem",
|
|
4656
5517
|
props: {
|
|
4657
5518
|
toast: {}
|
|
@@ -4706,7 +5567,7 @@
|
|
|
4706
5567
|
return (_ctx, _cache) => {
|
|
4707
5568
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4708
5569
|
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",
|
|
5570
|
+
role: __props.toast.type === "error" || __props.toast.type === "danger" || __props.toast.type === "warning" ? "alert" : "status",
|
|
4710
5571
|
"aria-live": "polite",
|
|
4711
5572
|
onMouseenter: pause,
|
|
4712
5573
|
onMouseleave: resume
|
|
@@ -4735,7 +5596,7 @@
|
|
|
4735
5596
|
"stroke-linecap": "round",
|
|
4736
5597
|
"stroke-linejoin": "round"
|
|
4737
5598
|
}, null, -1)
|
|
4738
|
-
])])) : __props.toast.type === "error" ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [
|
|
5599
|
+
])])) : __props.toast.type === "error" || __props.toast.type === "danger" ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4$1, [..._cache[1] || (_cache[1] = [
|
|
4739
5600
|
vue.createElementVNode("circle", {
|
|
4740
5601
|
cx: "10",
|
|
4741
5602
|
cy: "10",
|
|
@@ -4825,7 +5686,7 @@
|
|
|
4825
5686
|
};
|
|
4826
5687
|
}
|
|
4827
5688
|
});
|
|
4828
|
-
const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
5689
|
+
const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c8a329f5"]]);
|
|
4829
5690
|
const _hoisted_1$1 = { class: "tao-toast-slot__inner" };
|
|
4830
5691
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
4831
5692
|
...{ name: "TaoToastViewport" },
|
|
@@ -5146,6 +6007,7 @@
|
|
|
5146
6007
|
const TYPE_TIMEOUT = {
|
|
5147
6008
|
success: 3e3,
|
|
5148
6009
|
error: 5e3,
|
|
6010
|
+
danger: 5e3,
|
|
5149
6011
|
warning: 4e3,
|
|
5150
6012
|
info: 3e3,
|
|
5151
6013
|
neutral: 2500
|
|
@@ -5218,6 +6080,11 @@
|
|
|
5218
6080
|
draft.timeout = TYPE_TIMEOUT.error;
|
|
5219
6081
|
return ctx;
|
|
5220
6082
|
},
|
|
6083
|
+
danger() {
|
|
6084
|
+
draft.type = "danger";
|
|
6085
|
+
draft.timeout = TYPE_TIMEOUT.danger;
|
|
6086
|
+
return ctx;
|
|
6087
|
+
},
|
|
5221
6088
|
warning() {
|
|
5222
6089
|
draft.type = "warning";
|
|
5223
6090
|
draft.timeout = TYPE_TIMEOUT.warning;
|
|
@@ -5367,6 +6234,9 @@
|
|
|
5367
6234
|
error(message, options) {
|
|
5368
6235
|
return shortcut("error", message, options);
|
|
5369
6236
|
},
|
|
6237
|
+
danger(message, options) {
|
|
6238
|
+
return shortcut("danger", message, options);
|
|
6239
|
+
},
|
|
5370
6240
|
warning(message, options) {
|
|
5371
6241
|
return shortcut("warning", message, options);
|
|
5372
6242
|
},
|
|
@@ -5523,7 +6393,7 @@
|
|
|
5523
6393
|
TaoSpoiler,
|
|
5524
6394
|
TaoCopy,
|
|
5525
6395
|
TaoContainer,
|
|
5526
|
-
_sfc_main$
|
|
6396
|
+
_sfc_main$B,
|
|
5527
6397
|
TaoSpace,
|
|
5528
6398
|
TaoIcon,
|
|
5529
6399
|
TaoLoader,
|
|
@@ -5539,9 +6409,10 @@
|
|
|
5539
6409
|
TaoFileDrop,
|
|
5540
6410
|
TaoDropdownMenu,
|
|
5541
6411
|
TaoPinCode,
|
|
5542
|
-
_sfc_main$
|
|
6412
|
+
_sfc_main$l,
|
|
5543
6413
|
TaoFormField,
|
|
5544
6414
|
TaoSelect,
|
|
6415
|
+
TaoCombobox,
|
|
5545
6416
|
TaoDate,
|
|
5546
6417
|
TaoSwitch,
|
|
5547
6418
|
TaoRadio,
|
|
@@ -5576,6 +6447,7 @@
|
|
|
5576
6447
|
exports2.TaoCard = TaoCard;
|
|
5577
6448
|
exports2.TaoCarousel = TaoCarousel;
|
|
5578
6449
|
exports2.TaoCheckbox = TaoCheckbox;
|
|
6450
|
+
exports2.TaoCombobox = TaoCombobox;
|
|
5579
6451
|
exports2.TaoConfirmHost = TaoConfirmHost;
|
|
5580
6452
|
exports2.TaoContainer = TaoContainer;
|
|
5581
6453
|
exports2.TaoCopy = TaoCopy;
|
|
@@ -5586,14 +6458,14 @@
|
|
|
5586
6458
|
exports2.TaoDropdownMenu = TaoDropdownMenu;
|
|
5587
6459
|
exports2.TaoEmpty = TaoEmpty;
|
|
5588
6460
|
exports2.TaoFileDrop = TaoFileDrop;
|
|
5589
|
-
exports2.TaoFlex = _sfc_main$
|
|
6461
|
+
exports2.TaoFlex = _sfc_main$B;
|
|
5590
6462
|
exports2.TaoFormField = TaoFormField;
|
|
5591
6463
|
exports2.TaoIcon = TaoIcon;
|
|
5592
6464
|
exports2.TaoImage = TaoImage;
|
|
5593
6465
|
exports2.TaoInput = TaoInput;
|
|
5594
6466
|
exports2.TaoInputGroup = TaoInputGroup;
|
|
5595
6467
|
exports2.TaoInputNumber = TaoInputNumber;
|
|
5596
|
-
exports2.TaoLink = _sfc_main$
|
|
6468
|
+
exports2.TaoLink = _sfc_main$l;
|
|
5597
6469
|
exports2.TaoLoader = TaoLoader;
|
|
5598
6470
|
exports2.TaoModal = TaoModal;
|
|
5599
6471
|
exports2.TaoPagination = TaoPagination;
|