@1337exp/taoui 1.1.1 → 1.3.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.RU.md +492 -0
- package/README.md +214 -202
- package/dist/index.cjs +1872 -435
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +558 -212
- package/dist/index.mjs +1873 -436
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +459 -71
- package/package.json +1 -1
- package/src/styles/date-popup.css +178 -0
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, inject, useId, ref, unref, watch, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, withModifiers, nextTick, Fragment, renderList, createTextVNode, resolveDynamicComponent, useCssVars,
|
|
2
|
-
const _hoisted_1$
|
|
3
|
-
const _hoisted_2$
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, inject, useId, ref, unref, watch, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, withModifiers, nextTick, Fragment, renderList, createTextVNode, provide, onMounted, resolveDynamicComponent, useCssVars, reactive, onBeforeMount, useSlots, withDirectives, vModelText, resolveComponent, mergeProps, TransitionGroup, onUpdated, createApp } from "vue";
|
|
2
|
+
const _hoisted_1$J = ["type", "disabled"];
|
|
3
|
+
const _hoisted_2$C = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "tao-button__loader"
|
|
6
6
|
};
|
|
7
|
-
const _hoisted_3$
|
|
7
|
+
const _hoisted_3$w = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "tao-button__icon"
|
|
10
10
|
};
|
|
11
|
-
const _hoisted_4$
|
|
12
|
-
const _sfc_main$
|
|
11
|
+
const _hoisted_4$q = { class: "tao-button__content" };
|
|
12
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
13
13
|
...{ name: "TaoButton" },
|
|
14
14
|
__name: "TaoButton",
|
|
15
15
|
props: {
|
|
@@ -46,12 +46,12 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
46
46
|
disabled: __props.disabled || __props.loading,
|
|
47
47
|
onClick: handleClick
|
|
48
48
|
}, [
|
|
49
|
-
__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
50
|
-
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
51
|
-
createElementVNode("span", _hoisted_4$
|
|
49
|
+
__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$C)) : createCommentVNode("", true),
|
|
50
|
+
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$w, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
|
|
51
|
+
createElementVNode("span", _hoisted_4$q, [
|
|
52
52
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
53
53
|
])
|
|
54
|
-
], 10, _hoisted_1$
|
|
54
|
+
], 10, _hoisted_1$J);
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -62,8 +62,8 @@ const _export_sfc = (sfc, props) => {
|
|
|
62
62
|
}
|
|
63
63
|
return target;
|
|
64
64
|
};
|
|
65
|
-
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
66
|
-
const _sfc_main$
|
|
65
|
+
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-5a0fd489"]]);
|
|
66
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
67
67
|
...{ name: "TaoBlock" },
|
|
68
68
|
__name: "TaoBlock",
|
|
69
69
|
props: {
|
|
@@ -95,24 +95,24 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
98
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-feb87e36"]]);
|
|
99
99
|
const formFieldKey = Symbol("taoFormField");
|
|
100
|
-
const _hoisted_1$
|
|
101
|
-
const _hoisted_2$
|
|
102
|
-
const _hoisted_3$
|
|
100
|
+
const _hoisted_1$I = { class: "tao-input-wrapper" };
|
|
101
|
+
const _hoisted_2$B = ["for"];
|
|
102
|
+
const _hoisted_3$v = {
|
|
103
103
|
key: 0,
|
|
104
104
|
class: "tao-input__affix tao-input__affix--prefix"
|
|
105
105
|
};
|
|
106
|
-
const _hoisted_4$
|
|
107
|
-
const _hoisted_5$
|
|
106
|
+
const _hoisted_4$p = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
|
|
107
|
+
const _hoisted_5$h = {
|
|
108
108
|
key: 1,
|
|
109
109
|
class: "tao-input__affix tao-input__affix--suffix"
|
|
110
110
|
};
|
|
111
|
-
const _hoisted_6$
|
|
111
|
+
const _hoisted_6$d = {
|
|
112
112
|
key: 1,
|
|
113
113
|
class: "tao-input__error"
|
|
114
114
|
};
|
|
115
|
-
const _sfc_main$
|
|
115
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
116
116
|
...{ name: "TaoInput" },
|
|
117
117
|
__name: "TaoInput",
|
|
118
118
|
props: {
|
|
@@ -148,12 +148,12 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
148
148
|
emit("focus", event);
|
|
149
149
|
}
|
|
150
150
|
return (_ctx, _cache) => {
|
|
151
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
151
|
+
return openBlock(), createElementBlock("div", _hoisted_1$I, [
|
|
152
152
|
__props.label && !unref(field) ? (openBlock(), createElementBlock("label", {
|
|
153
153
|
key: 0,
|
|
154
154
|
class: "tao-input__label",
|
|
155
155
|
for: controlId.value
|
|
156
|
-
}, toDisplayString(__props.label), 9, _hoisted_2$
|
|
156
|
+
}, toDisplayString(__props.label), 9, _hoisted_2$B)) : createCommentVNode("", true),
|
|
157
157
|
createElementVNode("div", {
|
|
158
158
|
class: normalizeClass(["tao-input-shell", {
|
|
159
159
|
"tao-input-shell--focused": focused.value,
|
|
@@ -163,7 +163,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
163
163
|
"tao-input-shell--suffix": _ctx.$slots.suffix
|
|
164
164
|
}])
|
|
165
165
|
}, [
|
|
166
|
-
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
166
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_3$v, [
|
|
167
167
|
renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
168
168
|
])) : createCommentVNode("", true),
|
|
169
169
|
createElementVNode("input", {
|
|
@@ -178,27 +178,27 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
178
178
|
onInput: handleInput,
|
|
179
179
|
onBlur: handleBlur,
|
|
180
180
|
onFocus: handleFocus
|
|
181
|
-
}, null, 42, _hoisted_4$
|
|
182
|
-
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
181
|
+
}, null, 42, _hoisted_4$p),
|
|
182
|
+
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_5$h, [
|
|
183
183
|
renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
|
|
184
184
|
])) : createCommentVNode("", true)
|
|
185
185
|
], 2),
|
|
186
|
-
__props.error && __props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
186
|
+
__props.error && __props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_6$d, toDisplayString(__props.errorMessage), 1)) : createCommentVNode("", true)
|
|
187
187
|
]);
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
|
-
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
192
|
-
const _hoisted_1$
|
|
191
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-b522e041"]]);
|
|
192
|
+
const _hoisted_1$H = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
195
195
|
};
|
|
196
|
-
const _hoisted_2$
|
|
197
|
-
const _hoisted_3$
|
|
196
|
+
const _hoisted_2$A = { class: "tao-input-group__field" };
|
|
197
|
+
const _hoisted_3$u = {
|
|
198
198
|
key: 1,
|
|
199
199
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
200
200
|
};
|
|
201
|
-
const _sfc_main$
|
|
201
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
202
202
|
...{ name: "TaoInputGroup" },
|
|
203
203
|
__name: "TaoInputGroup",
|
|
204
204
|
setup(__props) {
|
|
@@ -220,28 +220,28 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
220
220
|
onFocusin: onFocusIn,
|
|
221
221
|
onFocusout: onFocusOut
|
|
222
222
|
}, [
|
|
223
|
-
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
223
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_1$H, [
|
|
224
224
|
renderSlot(_ctx.$slots, "before", {}, void 0, true)
|
|
225
225
|
])) : createCommentVNode("", true),
|
|
226
|
-
createElementVNode("div", _hoisted_2$
|
|
226
|
+
createElementVNode("div", _hoisted_2$A, [
|
|
227
227
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
228
228
|
]),
|
|
229
|
-
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
229
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
|
|
230
230
|
renderSlot(_ctx.$slots, "after", {}, void 0, true)
|
|
231
231
|
])) : createCommentVNode("", true)
|
|
232
232
|
], 34);
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
|
-
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
237
|
-
const _hoisted_1$
|
|
238
|
-
const _hoisted_2$
|
|
236
|
+
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-f06bb3b1"]]);
|
|
237
|
+
const _hoisted_1$G = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
238
|
+
const _hoisted_2$z = {
|
|
239
239
|
key: 0,
|
|
240
240
|
class: "tao-input-number__steppers"
|
|
241
241
|
};
|
|
242
|
-
const _hoisted_3$
|
|
243
|
-
const _hoisted_4$
|
|
244
|
-
const _sfc_main$
|
|
242
|
+
const _hoisted_3$t = ["disabled"];
|
|
243
|
+
const _hoisted_4$o = ["disabled"];
|
|
244
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
245
245
|
...{ name: "TaoInputNumber" },
|
|
246
246
|
__name: "TaoInputNumber",
|
|
247
247
|
props: {
|
|
@@ -390,8 +390,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
390
390
|
onFocus,
|
|
391
391
|
onBlur,
|
|
392
392
|
onKeydown
|
|
393
|
-
}, null, 40, _hoisted_1$
|
|
394
|
-
__props.controls ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
393
|
+
}, null, 40, _hoisted_1$G),
|
|
394
|
+
__props.controls ? (openBlock(), createElementBlock("div", _hoisted_2$z, [
|
|
395
395
|
createElementVNode("button", {
|
|
396
396
|
type: "button",
|
|
397
397
|
class: "tao-input-number__step",
|
|
@@ -399,7 +399,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
399
399
|
tabindex: "-1",
|
|
400
400
|
disabled: __props.disabled || atMax.value,
|
|
401
401
|
onClick: _cache[0] || (_cache[0] = ($event) => bump(1))
|
|
402
|
-
}, " + ", 8, _hoisted_3$
|
|
402
|
+
}, " + ", 8, _hoisted_3$t),
|
|
403
403
|
createElementVNode("button", {
|
|
404
404
|
type: "button",
|
|
405
405
|
class: "tao-input-number__step",
|
|
@@ -407,17 +407,17 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
407
407
|
tabindex: "-1",
|
|
408
408
|
disabled: __props.disabled || atMin.value,
|
|
409
409
|
onClick: _cache[1] || (_cache[1] = ($event) => bump(-1))
|
|
410
|
-
}, " − ", 8, _hoisted_4$
|
|
410
|
+
}, " − ", 8, _hoisted_4$o)
|
|
411
411
|
])) : createCommentVNode("", true)
|
|
412
412
|
], 2);
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
|
-
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
417
|
-
const _hoisted_1$
|
|
418
|
-
const _hoisted_2$
|
|
419
|
-
const _hoisted_3$
|
|
420
|
-
const _sfc_main$
|
|
416
|
+
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-55b65a4d"]]);
|
|
417
|
+
const _hoisted_1$F = ["aria-label", "disabled"];
|
|
418
|
+
const _hoisted_2$y = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
419
|
+
const _hoisted_3$s = ["disabled"];
|
|
420
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
421
421
|
...{ name: "TaoQuantity" },
|
|
422
422
|
__name: "TaoQuantity",
|
|
423
423
|
props: {
|
|
@@ -550,7 +550,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
550
550
|
"aria-label": minusLabel.value,
|
|
551
551
|
disabled: minusDisabled.value,
|
|
552
552
|
onClick: onDec
|
|
553
|
-
}, " − ", 8, _hoisted_1$
|
|
553
|
+
}, " − ", 8, _hoisted_1$F),
|
|
554
554
|
createElementVNode("input", {
|
|
555
555
|
id: controlId.value,
|
|
556
556
|
class: "tao-quantity__input",
|
|
@@ -570,49 +570,49 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
570
570
|
onFocus,
|
|
571
571
|
onBlur,
|
|
572
572
|
onKeydown
|
|
573
|
-
}, null, 40, _hoisted_2$
|
|
573
|
+
}, null, 40, _hoisted_2$y),
|
|
574
574
|
createElementVNode("button", {
|
|
575
575
|
type: "button",
|
|
576
576
|
class: "tao-quantity__btn tao-quantity__btn--inc",
|
|
577
577
|
"aria-label": "Увеличить",
|
|
578
578
|
disabled: plusDisabled.value,
|
|
579
579
|
onClick: onInc
|
|
580
|
-
}, " + ", 8, _hoisted_3$
|
|
580
|
+
}, " + ", 8, _hoisted_3$s)
|
|
581
581
|
], 2);
|
|
582
582
|
};
|
|
583
583
|
}
|
|
584
584
|
});
|
|
585
|
-
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
586
|
-
const _hoisted_1$
|
|
585
|
+
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-df6baf04"]]);
|
|
586
|
+
const _hoisted_1$E = {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "tao-card__cover"
|
|
589
589
|
};
|
|
590
|
-
const _hoisted_2$
|
|
590
|
+
const _hoisted_2$x = {
|
|
591
591
|
key: 0,
|
|
592
592
|
class: "tao-card__header-title"
|
|
593
593
|
};
|
|
594
|
-
const _hoisted_3$
|
|
595
|
-
const _hoisted_4$
|
|
594
|
+
const _hoisted_3$r = { key: 0 };
|
|
595
|
+
const _hoisted_4$n = {
|
|
596
596
|
key: 2,
|
|
597
597
|
class: "tao-card__title-block"
|
|
598
598
|
};
|
|
599
|
-
const _hoisted_5$
|
|
599
|
+
const _hoisted_5$g = {
|
|
600
600
|
key: 0,
|
|
601
601
|
class: "tao-card__title"
|
|
602
602
|
};
|
|
603
|
-
const _hoisted_6$
|
|
603
|
+
const _hoisted_6$c = {
|
|
604
604
|
key: 1,
|
|
605
605
|
class: "tao-card__sub"
|
|
606
606
|
};
|
|
607
|
-
const _hoisted_7$
|
|
607
|
+
const _hoisted_7$8 = {
|
|
608
608
|
key: 3,
|
|
609
609
|
class: "tao-card__body"
|
|
610
610
|
};
|
|
611
|
-
const _hoisted_8$
|
|
611
|
+
const _hoisted_8$7 = {
|
|
612
612
|
key: 4,
|
|
613
613
|
class: "tao-card__footer"
|
|
614
614
|
};
|
|
615
|
-
const _sfc_main$
|
|
615
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
616
616
|
...{ name: "TaoCard" },
|
|
617
617
|
__name: "TaoCard",
|
|
618
618
|
props: {
|
|
@@ -644,14 +644,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
644
644
|
}]),
|
|
645
645
|
style: normalizeStyle(radiusStyle.value)
|
|
646
646
|
}, [
|
|
647
|
-
_ctx.$slots.cover ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
647
|
+
_ctx.$slots.cover ? (openBlock(), createElementBlock("div", _hoisted_1$E, [
|
|
648
648
|
renderSlot(_ctx.$slots, "cover", {}, void 0, true)
|
|
649
649
|
])) : createCommentVNode("", true),
|
|
650
650
|
createElementVNode("div", {
|
|
651
651
|
class: "tao-card__content",
|
|
652
652
|
style: normalizeStyle(paddingStyle.value)
|
|
653
653
|
}, [
|
|
654
|
-
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_2$
|
|
654
|
+
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_2$x, [
|
|
655
655
|
renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
|
|
656
656
|
])) : createCommentVNode("", true),
|
|
657
657
|
_ctx.$slots.header || _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("div", {
|
|
@@ -661,22 +661,22 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
661
661
|
createElementVNode("span", null, [
|
|
662
662
|
renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
663
663
|
]),
|
|
664
|
-
_ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
664
|
+
_ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("span", _hoisted_3$r, [
|
|
665
665
|
renderSlot(_ctx.$slots, "headerSecondary", {}, void 0, true)
|
|
666
666
|
])) : createCommentVNode("", true)
|
|
667
667
|
], 2)) : createCommentVNode("", true),
|
|
668
|
-
_ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
669
|
-
_ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_5$
|
|
668
|
+
_ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
|
|
669
|
+
_ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_5$g, [
|
|
670
670
|
renderSlot(_ctx.$slots, "title", {}, void 0, true)
|
|
671
671
|
])) : createCommentVNode("", true),
|
|
672
|
-
_ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
672
|
+
_ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_6$c, [
|
|
673
673
|
renderSlot(_ctx.$slots, "sub", {}, void 0, true)
|
|
674
674
|
])) : createCommentVNode("", true)
|
|
675
675
|
])) : createCommentVNode("", true),
|
|
676
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_7$
|
|
676
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_7$8, [
|
|
677
677
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
678
678
|
])) : createCommentVNode("", true),
|
|
679
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
679
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8$7, [
|
|
680
680
|
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
681
681
|
])) : createCommentVNode("", true)
|
|
682
682
|
], 4)
|
|
@@ -684,7 +684,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
686
|
});
|
|
687
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
687
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-2ff3d055"]]);
|
|
688
688
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
689
689
|
function getFocusable(root) {
|
|
690
690
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -713,19 +713,19 @@ function trapTab(event, root) {
|
|
|
713
713
|
first.focus();
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
|
-
const _hoisted_1$
|
|
717
|
-
const _hoisted_2$
|
|
716
|
+
const _hoisted_1$D = ["aria-labelledby"];
|
|
717
|
+
const _hoisted_2$w = {
|
|
718
718
|
key: 0,
|
|
719
719
|
class: "tao-modal__header"
|
|
720
720
|
};
|
|
721
|
-
const _hoisted_3$
|
|
722
|
-
const _hoisted_4$
|
|
723
|
-
const _hoisted_5$
|
|
724
|
-
const _hoisted_6$
|
|
721
|
+
const _hoisted_3$q = ["id"];
|
|
722
|
+
const _hoisted_4$m = { key: 1 };
|
|
723
|
+
const _hoisted_5$f = { class: "tao-modal__content" };
|
|
724
|
+
const _hoisted_6$b = {
|
|
725
725
|
key: 1,
|
|
726
726
|
class: "tao-modal__footer"
|
|
727
727
|
};
|
|
728
|
-
const _sfc_main$
|
|
728
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
729
729
|
...{ name: "TaoModal" },
|
|
730
730
|
__name: "TaoModal",
|
|
731
731
|
props: {
|
|
@@ -825,13 +825,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
825
825
|
"aria-labelledby": __props.title ? unref(titleId) : void 0,
|
|
826
826
|
tabindex: "-1"
|
|
827
827
|
}, [
|
|
828
|
-
__props.title || _ctx.$slots.header || __props.closable ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
828
|
+
__props.title || _ctx.$slots.header || __props.closable ? (openBlock(), createElementBlock("div", _hoisted_2$w, [
|
|
829
829
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
830
830
|
__props.title ? (openBlock(), createElementBlock("h2", {
|
|
831
831
|
key: 0,
|
|
832
832
|
id: unref(titleId),
|
|
833
833
|
class: "tao-modal__title"
|
|
834
|
-
}, toDisplayString(__props.title), 9, _hoisted_3$
|
|
834
|
+
}, toDisplayString(__props.title), 9, _hoisted_3$q)) : (openBlock(), createElementBlock("span", _hoisted_4$m))
|
|
835
835
|
], true),
|
|
836
836
|
__props.closable ? (openBlock(), createElementBlock("button", {
|
|
837
837
|
key: 0,
|
|
@@ -841,13 +841,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
841
841
|
onClick: close
|
|
842
842
|
}, " × ")) : createCommentVNode("", true)
|
|
843
843
|
])) : createCommentVNode("", true),
|
|
844
|
-
createElementVNode("div", _hoisted_5$
|
|
844
|
+
createElementVNode("div", _hoisted_5$f, [
|
|
845
845
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
846
846
|
]),
|
|
847
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
847
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$b, [
|
|
848
848
|
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
849
849
|
])) : createCommentVNode("", true)
|
|
850
|
-
], 8, _hoisted_1$
|
|
850
|
+
], 8, _hoisted_1$D)
|
|
851
851
|
], 32)) : createCommentVNode("", true)
|
|
852
852
|
]),
|
|
853
853
|
_: 3
|
|
@@ -856,11 +856,11 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
858
|
});
|
|
859
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
860
|
-
const _hoisted_1$
|
|
861
|
-
const _hoisted_2$
|
|
862
|
-
const _hoisted_3$
|
|
863
|
-
const _sfc_main$
|
|
859
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-0cffe849"]]);
|
|
860
|
+
const _hoisted_1$C = { class: "tao-tabs" };
|
|
861
|
+
const _hoisted_2$v = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
862
|
+
const _hoisted_3$p = ["id", "aria-labelledby"];
|
|
863
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
864
864
|
...{ name: "TaoTabs" },
|
|
865
865
|
__name: "TaoTabs",
|
|
866
866
|
props: {
|
|
@@ -924,7 +924,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
return (_ctx, _cache) => {
|
|
927
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
927
|
+
return openBlock(), createElementBlock("div", _hoisted_1$C, [
|
|
928
928
|
createElementVNode("div", {
|
|
929
929
|
class: "tao-tabs__list",
|
|
930
930
|
role: "tablist",
|
|
@@ -949,7 +949,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
949
949
|
}, void 0, true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
950
950
|
createTextVNode(toDisplayString(tab.label), 1)
|
|
951
951
|
], 64))
|
|
952
|
-
], 8, _hoisted_2$
|
|
952
|
+
], 8, _hoisted_2$v);
|
|
953
953
|
}), 128))
|
|
954
954
|
], 32),
|
|
955
955
|
createElementVNode("div", {
|
|
@@ -959,13 +959,13 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
959
959
|
"aria-labelledby": tabId(__props.modelValue)
|
|
960
960
|
}, [
|
|
961
961
|
renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
|
|
962
|
-
], 8, _hoisted_3$
|
|
962
|
+
], 8, _hoisted_3$p)
|
|
963
963
|
]);
|
|
964
964
|
};
|
|
965
965
|
}
|
|
966
966
|
});
|
|
967
|
-
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
968
|
-
const _sfc_main$
|
|
967
|
+
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-bf16735e"]]);
|
|
968
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
969
969
|
...{ name: "TaoTooltip" },
|
|
970
970
|
__name: "TaoTooltip",
|
|
971
971
|
props: {
|
|
@@ -997,22 +997,213 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
997
997
|
};
|
|
998
998
|
}
|
|
999
999
|
});
|
|
1000
|
-
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1001
|
-
const _hoisted_1$
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1000
|
+
const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-6f3b3c11"]]);
|
|
1001
|
+
const _hoisted_1$B = { class: "tao-popover" };
|
|
1002
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
1003
|
+
...{ name: "TaoPopover" },
|
|
1004
|
+
__name: "TaoPopover",
|
|
1005
|
+
props: {
|
|
1006
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
1007
|
+
position: { default: "bottom" },
|
|
1008
|
+
disabled: { type: Boolean, default: false }
|
|
1009
|
+
},
|
|
1010
|
+
emits: ["update:modelValue", "change"],
|
|
1011
|
+
setup(__props, { emit: __emit }) {
|
|
1012
|
+
const props = __props;
|
|
1013
|
+
const emit = __emit;
|
|
1014
|
+
const triggerRef = ref(null);
|
|
1015
|
+
const panelRef = ref(null);
|
|
1016
|
+
const internal = ref(false);
|
|
1017
|
+
const panelStyle = ref({ top: "0px", left: "0px" });
|
|
1018
|
+
const isControlled = computed(() => props.modelValue !== void 0);
|
|
1019
|
+
const open = computed(() => isControlled.value ? Boolean(props.modelValue) : internal.value);
|
|
1020
|
+
function setOpen(next) {
|
|
1021
|
+
if (props.disabled && next) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
if (!isControlled.value) {
|
|
1025
|
+
internal.value = next;
|
|
1026
|
+
}
|
|
1027
|
+
emit("update:modelValue", next);
|
|
1028
|
+
emit("change", next);
|
|
1029
|
+
}
|
|
1030
|
+
function toggle() {
|
|
1031
|
+
void applyOpen(!open.value);
|
|
1032
|
+
}
|
|
1033
|
+
function close() {
|
|
1034
|
+
void applyOpen(false);
|
|
1035
|
+
}
|
|
1036
|
+
async function applyOpen(next) {
|
|
1037
|
+
var _a;
|
|
1038
|
+
setOpen(next);
|
|
1039
|
+
if (!next) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
await nextTick();
|
|
1043
|
+
updatePosition();
|
|
1044
|
+
(_a = panelRef.value) == null ? void 0 : _a.focus();
|
|
1045
|
+
}
|
|
1046
|
+
function focusTrigger() {
|
|
1047
|
+
var _a, _b;
|
|
1048
|
+
const root = triggerRef.value;
|
|
1049
|
+
const focusable = root == null ? void 0 : root.querySelector(
|
|
1050
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1051
|
+
);
|
|
1052
|
+
(_b = (_a = focusable ?? root) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
1053
|
+
}
|
|
1054
|
+
function updatePosition() {
|
|
1055
|
+
const trigger = triggerRef.value;
|
|
1056
|
+
const panel = panelRef.value;
|
|
1057
|
+
if (!trigger || !panel) {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
const rect = trigger.getBoundingClientRect();
|
|
1061
|
+
const width = panel.offsetWidth;
|
|
1062
|
+
const height = panel.offsetHeight;
|
|
1063
|
+
const gap = 4;
|
|
1064
|
+
const pad = 8;
|
|
1065
|
+
const viewW = window.innerWidth;
|
|
1066
|
+
const viewH = window.innerHeight;
|
|
1067
|
+
const space = {
|
|
1068
|
+
bottom: viewH - rect.bottom - gap - pad,
|
|
1069
|
+
top: rect.top - gap - pad,
|
|
1070
|
+
right: viewW - rect.right - gap - pad,
|
|
1071
|
+
left: rect.left - gap - pad
|
|
1072
|
+
};
|
|
1073
|
+
const opposite = {
|
|
1074
|
+
bottom: "top",
|
|
1075
|
+
top: "bottom",
|
|
1076
|
+
left: "right",
|
|
1077
|
+
right: "left"
|
|
1078
|
+
};
|
|
1079
|
+
let side = props.position;
|
|
1080
|
+
const need = side === "top" || side === "bottom" ? height : width;
|
|
1081
|
+
if (space[side] < need && space[opposite[side]] > space[side]) {
|
|
1082
|
+
side = opposite[side];
|
|
1083
|
+
}
|
|
1084
|
+
let top = 0;
|
|
1085
|
+
let left = 0;
|
|
1086
|
+
if (side === "bottom") {
|
|
1087
|
+
top = rect.bottom + gap;
|
|
1088
|
+
left = rect.left;
|
|
1089
|
+
} else if (side === "top") {
|
|
1090
|
+
top = rect.top - height - gap;
|
|
1091
|
+
left = rect.left;
|
|
1092
|
+
} else if (side === "right") {
|
|
1093
|
+
top = rect.top;
|
|
1094
|
+
left = rect.right + gap;
|
|
1095
|
+
} else {
|
|
1096
|
+
top = rect.top;
|
|
1097
|
+
left = rect.left - width - gap;
|
|
1098
|
+
}
|
|
1099
|
+
if (left + width > viewW - pad) {
|
|
1100
|
+
left = viewW - pad - width;
|
|
1101
|
+
}
|
|
1102
|
+
if (left < pad) {
|
|
1103
|
+
left = pad;
|
|
1104
|
+
}
|
|
1105
|
+
if (top + height > viewH - pad) {
|
|
1106
|
+
top = viewH - pad - height;
|
|
1107
|
+
}
|
|
1108
|
+
if (top < pad) {
|
|
1109
|
+
top = pad;
|
|
1110
|
+
}
|
|
1111
|
+
panelStyle.value = { top: `${top}px`, left: `${left}px` };
|
|
1112
|
+
}
|
|
1113
|
+
function onTriggerClick() {
|
|
1114
|
+
if (props.disabled) {
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
toggle();
|
|
1118
|
+
}
|
|
1119
|
+
function onDocumentPointer(event) {
|
|
1120
|
+
var _a, _b;
|
|
1121
|
+
const target = event.target;
|
|
1122
|
+
if (((_a = triggerRef.value) == null ? void 0 : _a.contains(target)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(target))) {
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
close();
|
|
1126
|
+
}
|
|
1127
|
+
function onDocumentKey(event) {
|
|
1128
|
+
if (event.key !== "Escape") {
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
event.preventDefault();
|
|
1132
|
+
close();
|
|
1133
|
+
focusTrigger();
|
|
1134
|
+
}
|
|
1135
|
+
function onViewportChange() {
|
|
1136
|
+
if (open.value) {
|
|
1137
|
+
updatePosition();
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
watch(open, (isOpen) => {
|
|
1141
|
+
if (isOpen) {
|
|
1142
|
+
document.addEventListener("pointerdown", onDocumentPointer);
|
|
1143
|
+
document.addEventListener("keydown", onDocumentKey);
|
|
1144
|
+
window.addEventListener("resize", onViewportChange);
|
|
1145
|
+
window.addEventListener("scroll", onViewportChange, true);
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
1149
|
+
document.removeEventListener("keydown", onDocumentKey);
|
|
1150
|
+
window.removeEventListener("resize", onViewportChange);
|
|
1151
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
1152
|
+
});
|
|
1153
|
+
onBeforeUnmount(() => {
|
|
1154
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
1155
|
+
document.removeEventListener("keydown", onDocumentKey);
|
|
1156
|
+
window.removeEventListener("resize", onViewportChange);
|
|
1157
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
1158
|
+
});
|
|
1159
|
+
return (_ctx, _cache) => {
|
|
1160
|
+
return openBlock(), createElementBlock("div", _hoisted_1$B, [
|
|
1161
|
+
createElementVNode("div", {
|
|
1162
|
+
ref_key: "triggerRef",
|
|
1163
|
+
ref: triggerRef,
|
|
1164
|
+
class: "tao-popover__trigger",
|
|
1165
|
+
onClick: onTriggerClick
|
|
1166
|
+
}, [
|
|
1167
|
+
renderSlot(_ctx.$slots, "trigger", {
|
|
1168
|
+
open: open.value,
|
|
1169
|
+
toggle
|
|
1170
|
+
}, void 0, true)
|
|
1171
|
+
], 512),
|
|
1172
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1173
|
+
open.value ? (openBlock(), createElementBlock("div", {
|
|
1174
|
+
key: 0,
|
|
1175
|
+
ref_key: "panelRef",
|
|
1176
|
+
ref: panelRef,
|
|
1177
|
+
class: "tao-popover__panel",
|
|
1178
|
+
role: "dialog",
|
|
1179
|
+
tabindex: "-1",
|
|
1180
|
+
style: normalizeStyle(panelStyle.value)
|
|
1181
|
+
}, [
|
|
1182
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1183
|
+
], 4)) : createCommentVNode("", true)
|
|
1184
|
+
]))
|
|
1185
|
+
]);
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-e4ead301"]]);
|
|
1190
|
+
const spoilerGroupKey = Symbol("taoSpoilerGroup");
|
|
1191
|
+
const _hoisted_1$A = { class: "tao-spoiler" };
|
|
1192
|
+
const _hoisted_2$u = ["aria-expanded", "aria-controls"];
|
|
1193
|
+
const _hoisted_3$o = {
|
|
1004
1194
|
key: 0,
|
|
1005
1195
|
class: "tao-spoiler__title"
|
|
1006
1196
|
};
|
|
1007
|
-
const _hoisted_4$
|
|
1008
|
-
const _hoisted_5$
|
|
1009
|
-
const _sfc_main$
|
|
1197
|
+
const _hoisted_4$l = ["id"];
|
|
1198
|
+
const _hoisted_5$e = { class: "tao-spoiler__content-inner" };
|
|
1199
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
1010
1200
|
...{ name: "TaoSpoiler" },
|
|
1011
1201
|
__name: "TaoSpoiler",
|
|
1012
1202
|
props: {
|
|
1013
1203
|
title: { default: "" },
|
|
1014
1204
|
defaultOpen: { type: Boolean, default: false },
|
|
1015
|
-
modelValue: { type: Boolean, default: void 0 }
|
|
1205
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
1206
|
+
name: { default: void 0 }
|
|
1016
1207
|
},
|
|
1017
1208
|
emits: ["update:modelValue"],
|
|
1018
1209
|
setup(__props, { emit: __emit }) {
|
|
@@ -1020,9 +1211,20 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
1020
1211
|
const emit = __emit;
|
|
1021
1212
|
const panelId = useId();
|
|
1022
1213
|
const internal = ref(props.defaultOpen);
|
|
1214
|
+
const group = inject(spoilerGroupKey, null);
|
|
1215
|
+
const inGroup = computed(() => group !== null && props.name !== void 0 && props.name !== "");
|
|
1023
1216
|
const isControlled = computed(() => props.modelValue !== void 0);
|
|
1024
|
-
const isOpen = computed(() =>
|
|
1217
|
+
const isOpen = computed(() => {
|
|
1218
|
+
if (inGroup.value) {
|
|
1219
|
+
return group.model.value === props.name;
|
|
1220
|
+
}
|
|
1221
|
+
return isControlled.value ? Boolean(props.modelValue) : internal.value;
|
|
1222
|
+
});
|
|
1025
1223
|
function toggle() {
|
|
1224
|
+
if (inGroup.value) {
|
|
1225
|
+
group.setOpen(isOpen.value ? null : props.name);
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1026
1228
|
const next = !isOpen.value;
|
|
1027
1229
|
if (!isControlled.value) {
|
|
1028
1230
|
internal.value = next;
|
|
@@ -1049,7 +1251,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
1049
1251
|
});
|
|
1050
1252
|
}
|
|
1051
1253
|
return (_ctx, _cache) => {
|
|
1052
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1254
|
+
return openBlock(), createElementBlock("div", _hoisted_1$A, [
|
|
1053
1255
|
createElementVNode("button", {
|
|
1054
1256
|
type: "button",
|
|
1055
1257
|
class: "tao-spoiler__header",
|
|
@@ -1060,12 +1262,12 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
1060
1262
|
createElementVNode("span", {
|
|
1061
1263
|
class: normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
|
|
1062
1264
|
}, "▶", 2),
|
|
1063
|
-
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
1265
|
+
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$o, [
|
|
1064
1266
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1065
1267
|
createTextVNode(toDisplayString(__props.title), 1)
|
|
1066
1268
|
], true)
|
|
1067
1269
|
])) : createCommentVNode("", true)
|
|
1068
|
-
], 8, _hoisted_2$
|
|
1270
|
+
], 8, _hoisted_2$u),
|
|
1069
1271
|
createVNode(Transition, {
|
|
1070
1272
|
name: "tao-spoiler-slide",
|
|
1071
1273
|
onBeforeEnter,
|
|
@@ -1079,10 +1281,10 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
1079
1281
|
id: unref(panelId),
|
|
1080
1282
|
class: "tao-spoiler__content"
|
|
1081
1283
|
}, [
|
|
1082
|
-
createElementVNode("div", _hoisted_5$
|
|
1284
|
+
createElementVNode("div", _hoisted_5$e, [
|
|
1083
1285
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1084
1286
|
])
|
|
1085
|
-
], 8, _hoisted_4$
|
|
1287
|
+
], 8, _hoisted_4$l)) : createCommentVNode("", true)
|
|
1086
1288
|
]),
|
|
1087
1289
|
_: 3
|
|
1088
1290
|
})
|
|
@@ -1090,33 +1292,136 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
1090
1292
|
};
|
|
1091
1293
|
}
|
|
1092
1294
|
});
|
|
1093
|
-
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1094
|
-
const _hoisted_1$
|
|
1095
|
-
const _sfc_main$
|
|
1295
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-ccb052cf"]]);
|
|
1296
|
+
const _hoisted_1$z = { class: "tao-spoiler-group" };
|
|
1297
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
1298
|
+
...{ name: "TaoSpoilerGroup" },
|
|
1299
|
+
__name: "TaoSpoilerGroup",
|
|
1300
|
+
props: {
|
|
1301
|
+
modelValue: { default: null }
|
|
1302
|
+
},
|
|
1303
|
+
emits: ["update:modelValue", "change"],
|
|
1304
|
+
setup(__props, { emit: __emit }) {
|
|
1305
|
+
const props = __props;
|
|
1306
|
+
const emit = __emit;
|
|
1307
|
+
const model = computed(() => props.modelValue);
|
|
1308
|
+
function setOpen(name) {
|
|
1309
|
+
emit("update:modelValue", name);
|
|
1310
|
+
emit("change", name);
|
|
1311
|
+
}
|
|
1312
|
+
provide(spoilerGroupKey, {
|
|
1313
|
+
model,
|
|
1314
|
+
setOpen
|
|
1315
|
+
});
|
|
1316
|
+
return (_ctx, _cache) => {
|
|
1317
|
+
return openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
1318
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1319
|
+
]);
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
});
|
|
1323
|
+
const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-6b172e89"]]);
|
|
1324
|
+
const _hoisted_1$y = ["aria-label"];
|
|
1325
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
1096
1326
|
...{ name: "TaoCopy" },
|
|
1097
1327
|
__name: "TaoCopy",
|
|
1098
1328
|
props: {
|
|
1099
1329
|
text: {},
|
|
1100
|
-
successMessage: { default: "Скопировано!" }
|
|
1330
|
+
successMessage: { default: "Скопировано!" },
|
|
1331
|
+
tip: { type: Boolean, default: true }
|
|
1101
1332
|
},
|
|
1102
1333
|
setup(__props) {
|
|
1103
1334
|
const props = __props;
|
|
1104
1335
|
const copied = ref(false);
|
|
1105
|
-
|
|
1336
|
+
const triggerRef = ref(null);
|
|
1337
|
+
const tipRef = ref(null);
|
|
1338
|
+
const tipStyle = ref({ top: "0px", left: "0px" });
|
|
1339
|
+
let hideTimer = 0;
|
|
1340
|
+
let visibleObserver = null;
|
|
1341
|
+
function hideTip() {
|
|
1342
|
+
copied.value = false;
|
|
1343
|
+
window.clearTimeout(hideTimer);
|
|
1344
|
+
hideTimer = 0;
|
|
1345
|
+
}
|
|
1346
|
+
function updateTipPosition() {
|
|
1347
|
+
const trigger = triggerRef.value;
|
|
1348
|
+
const tip = tipRef.value;
|
|
1349
|
+
if (!trigger || !tip) {
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
const rect = trigger.getBoundingClientRect();
|
|
1353
|
+
if (rect.width === 0 && rect.height === 0) {
|
|
1354
|
+
hideTip();
|
|
1355
|
+
return;
|
|
1356
|
+
}
|
|
1357
|
+
const gap = 8;
|
|
1358
|
+
const pad = 8;
|
|
1359
|
+
const width = tip.offsetWidth;
|
|
1360
|
+
const height = tip.offsetHeight;
|
|
1361
|
+
let left = rect.left + rect.width / 2 - width / 2;
|
|
1362
|
+
let top = rect.top - height - gap;
|
|
1363
|
+
if (left < pad) {
|
|
1364
|
+
left = pad;
|
|
1365
|
+
}
|
|
1366
|
+
if (left + width > window.innerWidth - pad) {
|
|
1367
|
+
left = window.innerWidth - pad - width;
|
|
1368
|
+
}
|
|
1369
|
+
if (top < pad) {
|
|
1370
|
+
top = rect.bottom + gap;
|
|
1371
|
+
}
|
|
1372
|
+
tipStyle.value = { top: `${top}px`, left: `${left}px` };
|
|
1373
|
+
}
|
|
1374
|
+
function bindTipGuards() {
|
|
1375
|
+
window.addEventListener("scroll", updateTipPosition, true);
|
|
1376
|
+
window.addEventListener("resize", updateTipPosition);
|
|
1377
|
+
}
|
|
1378
|
+
function unbindTipGuards() {
|
|
1379
|
+
window.removeEventListener("scroll", updateTipPosition, true);
|
|
1380
|
+
window.removeEventListener("resize", updateTipPosition);
|
|
1381
|
+
}
|
|
1106
1382
|
async function copy() {
|
|
1107
1383
|
try {
|
|
1108
1384
|
await navigator.clipboard.writeText(props.text);
|
|
1109
1385
|
copied.value = true;
|
|
1110
|
-
clearTimeout(
|
|
1111
|
-
|
|
1112
|
-
copied.value = false;
|
|
1113
|
-
}, 2e3);
|
|
1386
|
+
window.clearTimeout(hideTimer);
|
|
1387
|
+
hideTimer = window.setTimeout(hideTip, 2e3);
|
|
1114
1388
|
} catch (err) {
|
|
1115
1389
|
console.error("Failed to copy:", err);
|
|
1390
|
+
hideTip();
|
|
1116
1391
|
}
|
|
1117
1392
|
}
|
|
1393
|
+
watch(copied, async (isCopied) => {
|
|
1394
|
+
if (!isCopied || !props.tip) {
|
|
1395
|
+
unbindTipGuards();
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
await nextTick();
|
|
1399
|
+
await nextTick();
|
|
1400
|
+
updateTipPosition();
|
|
1401
|
+
bindTipGuards();
|
|
1402
|
+
});
|
|
1403
|
+
onMounted(() => {
|
|
1404
|
+
visibleObserver = new IntersectionObserver((entries) => {
|
|
1405
|
+
if (entries.some((entry) => !entry.isIntersecting)) {
|
|
1406
|
+
hideTip();
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1409
|
+
if (triggerRef.value) {
|
|
1410
|
+
visibleObserver.observe(triggerRef.value);
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
onBeforeUnmount(() => {
|
|
1414
|
+
hideTip();
|
|
1415
|
+
unbindTipGuards();
|
|
1416
|
+
visibleObserver == null ? void 0 : visibleObserver.disconnect();
|
|
1417
|
+
visibleObserver = null;
|
|
1418
|
+
});
|
|
1118
1419
|
return (_ctx, _cache) => {
|
|
1119
|
-
return openBlock(), createElementBlock("
|
|
1420
|
+
return openBlock(), createElementBlock("span", {
|
|
1421
|
+
ref_key: "triggerRef",
|
|
1422
|
+
ref: triggerRef,
|
|
1423
|
+
class: "tao-copy"
|
|
1424
|
+
}, [
|
|
1120
1425
|
renderSlot(_ctx.$slots, "default", {
|
|
1121
1426
|
copy,
|
|
1122
1427
|
copied: copied.value
|
|
@@ -1124,15 +1429,51 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
1124
1429
|
createElementVNode("button", {
|
|
1125
1430
|
type: "button",
|
|
1126
1431
|
class: normalizeClass(["tao-copy__button", { "tao-copy__button--copied": copied.value }]),
|
|
1432
|
+
"aria-label": copied.value ? __props.successMessage : "Копировать",
|
|
1127
1433
|
onClick: copy
|
|
1128
|
-
},
|
|
1129
|
-
|
|
1130
|
-
|
|
1434
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
1435
|
+
createElementVNode("svg", {
|
|
1436
|
+
viewBox: "0 0 24 24",
|
|
1437
|
+
width: "16",
|
|
1438
|
+
height: "16",
|
|
1439
|
+
"aria-hidden": "true",
|
|
1440
|
+
focusable: "false"
|
|
1441
|
+
}, [
|
|
1442
|
+
createElementVNode("rect", {
|
|
1443
|
+
x: "8",
|
|
1444
|
+
y: "7",
|
|
1445
|
+
width: "12",
|
|
1446
|
+
height: "14",
|
|
1447
|
+
rx: "2",
|
|
1448
|
+
fill: "none",
|
|
1449
|
+
stroke: "currentColor",
|
|
1450
|
+
"stroke-width": "2"
|
|
1451
|
+
}),
|
|
1452
|
+
createElementVNode("path", {
|
|
1453
|
+
d: "M16 7V5a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h2",
|
|
1454
|
+
fill: "none",
|
|
1455
|
+
stroke: "currentColor",
|
|
1456
|
+
"stroke-width": "2"
|
|
1457
|
+
})
|
|
1458
|
+
], -1)
|
|
1459
|
+
])], 10, _hoisted_1$y)
|
|
1460
|
+
], true),
|
|
1461
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1462
|
+
copied.value && __props.tip && __props.successMessage ? (openBlock(), createElementBlock("div", {
|
|
1463
|
+
key: 0,
|
|
1464
|
+
ref_key: "tipRef",
|
|
1465
|
+
ref: tipRef,
|
|
1466
|
+
class: "tao-copy__tip",
|
|
1467
|
+
role: "status",
|
|
1468
|
+
style: normalizeStyle(tipStyle.value)
|
|
1469
|
+
}, toDisplayString(__props.successMessage), 5)) : createCommentVNode("", true)
|
|
1470
|
+
]))
|
|
1471
|
+
], 512);
|
|
1131
1472
|
};
|
|
1132
1473
|
}
|
|
1133
1474
|
});
|
|
1134
|
-
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1135
|
-
const _sfc_main$
|
|
1475
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-1953c07e"]]);
|
|
1476
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
1136
1477
|
...{ name: "TaoContainer" },
|
|
1137
1478
|
__name: "TaoContainer",
|
|
1138
1479
|
props: {
|
|
@@ -1149,8 +1490,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
1149
1490
|
};
|
|
1150
1491
|
}
|
|
1151
1492
|
});
|
|
1152
|
-
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1153
|
-
const _sfc_main$
|
|
1493
|
+
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-4c0deb90"]]);
|
|
1494
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
1154
1495
|
...{ name: "TaoFlex" },
|
|
1155
1496
|
__name: "TaoFlex",
|
|
1156
1497
|
props: {
|
|
@@ -1181,7 +1522,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
1181
1522
|
};
|
|
1182
1523
|
}
|
|
1183
1524
|
});
|
|
1184
|
-
const _sfc_main$
|
|
1525
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
1185
1526
|
...{ name: "TaoSpace" },
|
|
1186
1527
|
__name: "TaoSpace",
|
|
1187
1528
|
props: {
|
|
@@ -1201,9 +1542,9 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
1201
1542
|
};
|
|
1202
1543
|
}
|
|
1203
1544
|
});
|
|
1204
|
-
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1205
|
-
const _hoisted_1$
|
|
1206
|
-
const _sfc_main$
|
|
1545
|
+
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-698ca712"]]);
|
|
1546
|
+
const _hoisted_1$x = { class: "tao-icon" };
|
|
1547
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
1207
1548
|
...{ name: "TaoIcon" },
|
|
1208
1549
|
__name: "TaoIcon",
|
|
1209
1550
|
props: {
|
|
@@ -1218,7 +1559,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
1218
1559
|
}));
|
|
1219
1560
|
const props = __props;
|
|
1220
1561
|
return (_ctx, _cache) => {
|
|
1221
|
-
return openBlock(), createElementBlock("span", _hoisted_1$
|
|
1562
|
+
return openBlock(), createElementBlock("span", _hoisted_1$x, [
|
|
1222
1563
|
renderSlot(_ctx.$slots, "prefix", {}, void 0, true),
|
|
1223
1564
|
createElementVNode("i", {
|
|
1224
1565
|
class: normalizeClass(["tao-icon__value", [`icon-${props.name}`, { "tao-icon__value--invert": props.invert }]]),
|
|
@@ -1229,8 +1570,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
1229
1570
|
};
|
|
1230
1571
|
}
|
|
1231
1572
|
});
|
|
1232
|
-
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1233
|
-
const _sfc_main$
|
|
1573
|
+
const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-145b2cfc"]]);
|
|
1574
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
1234
1575
|
...{ name: "TaoLoader" },
|
|
1235
1576
|
__name: "TaoLoader",
|
|
1236
1577
|
props: {
|
|
@@ -1291,16 +1632,17 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
1291
1632
|
};
|
|
1292
1633
|
}
|
|
1293
1634
|
});
|
|
1294
|
-
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1295
|
-
const _hoisted_1$
|
|
1296
|
-
const _hoisted_2$
|
|
1297
|
-
const _sfc_main$
|
|
1635
|
+
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-75a40018"]]);
|
|
1636
|
+
const _hoisted_1$w = { class: "tao-image" };
|
|
1637
|
+
const _hoisted_2$t = ["src", "alt", "loading"];
|
|
1638
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
1298
1639
|
...{ name: "TaoImage" },
|
|
1299
1640
|
__name: "TaoImage",
|
|
1300
1641
|
props: {
|
|
1301
1642
|
src: { default: "" },
|
|
1302
1643
|
alt: { default: "" },
|
|
1303
|
-
pixelated: { type: Boolean, default: false }
|
|
1644
|
+
pixelated: { type: Boolean, default: false },
|
|
1645
|
+
lazy: { type: Boolean, default: false }
|
|
1304
1646
|
},
|
|
1305
1647
|
emits: ["load", "error"],
|
|
1306
1648
|
setup(__props, { emit: __emit }) {
|
|
@@ -1319,34 +1661,36 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1319
1661
|
isLoaded.value = false;
|
|
1320
1662
|
});
|
|
1321
1663
|
return (_ctx, _cache) => {
|
|
1322
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1664
|
+
return openBlock(), createElementBlock("div", _hoisted_1$w, [
|
|
1323
1665
|
__props.src ? (openBlock(), createElementBlock("img", {
|
|
1324
1666
|
key: 0,
|
|
1325
1667
|
class: normalizeClass({ "tao-image__img--hidden": !isLoaded.value, "tao-image__img--pixelated": props.pixelated }),
|
|
1326
1668
|
src: __props.src,
|
|
1327
1669
|
alt: __props.alt,
|
|
1670
|
+
loading: __props.lazy ? "lazy" : "eager",
|
|
1671
|
+
decoding: "async",
|
|
1328
1672
|
draggable: "false",
|
|
1329
1673
|
onLoad: handleLoad,
|
|
1330
1674
|
onError: handleError
|
|
1331
|
-
}, null, 42, _hoisted_2$
|
|
1675
|
+
}, null, 42, _hoisted_2$t)) : renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1332
1676
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "tao-image__placeholder" }, "No image available", -1))
|
|
1333
1677
|
], true, 1)
|
|
1334
1678
|
]);
|
|
1335
1679
|
};
|
|
1336
1680
|
}
|
|
1337
1681
|
});
|
|
1338
|
-
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1339
|
-
const _hoisted_1$
|
|
1340
|
-
const _hoisted_2$
|
|
1341
|
-
const _hoisted_3$
|
|
1682
|
+
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-522fe4da"]]);
|
|
1683
|
+
const _hoisted_1$v = ["for"];
|
|
1684
|
+
const _hoisted_2$s = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
1685
|
+
const _hoisted_3$n = {
|
|
1342
1686
|
key: 0,
|
|
1343
1687
|
class: "tao-checkbox__label"
|
|
1344
1688
|
};
|
|
1345
|
-
const _hoisted_4$
|
|
1689
|
+
const _hoisted_4$k = {
|
|
1346
1690
|
key: 1,
|
|
1347
1691
|
class: "tao-checkbox__label"
|
|
1348
1692
|
};
|
|
1349
|
-
const _sfc_main$
|
|
1693
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
1350
1694
|
...{ name: "TaoCheckbox" },
|
|
1351
1695
|
__name: "TaoCheckbox",
|
|
1352
1696
|
props: {
|
|
@@ -1416,18 +1760,18 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1416
1760
|
"aria-invalid": invalid.value || void 0,
|
|
1417
1761
|
"aria-describedby": describedBy.value,
|
|
1418
1762
|
onChange: onInputChange
|
|
1419
|
-
}, null, 40, _hoisted_2$
|
|
1763
|
+
}, null, 40, _hoisted_2$s),
|
|
1420
1764
|
_cache[0] || (_cache[0] = createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
|
|
1421
|
-
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
1765
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$n, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$k, [
|
|
1422
1766
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1423
1767
|
])),
|
|
1424
1768
|
renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
|
|
1425
|
-
], 10, _hoisted_1$
|
|
1769
|
+
], 10, _hoisted_1$v);
|
|
1426
1770
|
};
|
|
1427
1771
|
}
|
|
1428
1772
|
});
|
|
1429
|
-
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1430
|
-
const _sfc_main$
|
|
1773
|
+
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-f6b0e565"]]);
|
|
1774
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
1431
1775
|
...{ name: "TaoTag" },
|
|
1432
1776
|
__name: "TaoTag",
|
|
1433
1777
|
props: {
|
|
@@ -1455,17 +1799,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1455
1799
|
};
|
|
1456
1800
|
}
|
|
1457
1801
|
});
|
|
1458
|
-
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1459
|
-
const _hoisted_1$
|
|
1802
|
+
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-290c0f6a"]]);
|
|
1803
|
+
const _hoisted_1$u = {
|
|
1460
1804
|
key: 1,
|
|
1461
1805
|
class: "tao-divider-text"
|
|
1462
1806
|
};
|
|
1463
|
-
const _hoisted_2$
|
|
1464
|
-
const _hoisted_3$
|
|
1807
|
+
const _hoisted_2$r = { class: "tao-divider-text__value" };
|
|
1808
|
+
const _hoisted_3$m = {
|
|
1465
1809
|
key: 2,
|
|
1466
1810
|
class: "tao-divider-line"
|
|
1467
1811
|
};
|
|
1468
|
-
const _sfc_main$
|
|
1812
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
1469
1813
|
...{ name: "TaoDivider" },
|
|
1470
1814
|
__name: "TaoDivider",
|
|
1471
1815
|
props: {
|
|
@@ -1479,18 +1823,48 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
1479
1823
|
return __props.variant === "gap" ? (openBlock(), createElementBlock("div", {
|
|
1480
1824
|
key: 0,
|
|
1481
1825
|
class: normalizeClass(["tao-divider-gap", `tao-divider-gap--${gapSize.value}`])
|
|
1482
|
-
}, null, 2)) : __props.variant === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1826
|
+
}, null, 2)) : __props.variant === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
1483
1827
|
_cache[0] || (_cache[0] = createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--left" }, null, -1)),
|
|
1484
|
-
createElementVNode("span", _hoisted_2$
|
|
1828
|
+
createElementVNode("span", _hoisted_2$r, [
|
|
1485
1829
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1486
1830
|
]),
|
|
1487
1831
|
_cache[1] || (_cache[1] = createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--right" }, null, -1))
|
|
1488
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1832
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3$m));
|
|
1489
1833
|
};
|
|
1490
1834
|
}
|
|
1491
1835
|
});
|
|
1492
|
-
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1493
|
-
const
|
|
1836
|
+
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-8187a15d"]]);
|
|
1837
|
+
const _hoisted_1$t = {
|
|
1838
|
+
key: 0,
|
|
1839
|
+
class: "tao-fieldset__legend"
|
|
1840
|
+
};
|
|
1841
|
+
const _hoisted_2$q = { class: "tao-fieldset__body" };
|
|
1842
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
1843
|
+
...{ name: "TaoFieldset" },
|
|
1844
|
+
__name: "TaoFieldset",
|
|
1845
|
+
props: {
|
|
1846
|
+
legend: { default: "" },
|
|
1847
|
+
align: { default: "start" }
|
|
1848
|
+
},
|
|
1849
|
+
setup(__props) {
|
|
1850
|
+
return (_ctx, _cache) => {
|
|
1851
|
+
return openBlock(), createElementBlock("fieldset", {
|
|
1852
|
+
class: normalizeClass(["tao-fieldset", `tao-fieldset--${__props.align}`])
|
|
1853
|
+
}, [
|
|
1854
|
+
__props.legend || _ctx.$slots.legend ? (openBlock(), createElementBlock("legend", _hoisted_1$t, [
|
|
1855
|
+
renderSlot(_ctx.$slots, "legend", {}, () => [
|
|
1856
|
+
createTextVNode(toDisplayString(__props.legend), 1)
|
|
1857
|
+
], true)
|
|
1858
|
+
])) : createCommentVNode("", true),
|
|
1859
|
+
createElementVNode("div", _hoisted_2$q, [
|
|
1860
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1861
|
+
])
|
|
1862
|
+
], 2);
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
});
|
|
1866
|
+
const TaoFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-34440ba5"]]);
|
|
1867
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
1494
1868
|
...{ name: "TaoAnimatedBorder" },
|
|
1495
1869
|
__name: "TaoAnimatedBorder",
|
|
1496
1870
|
props: {
|
|
@@ -1514,18 +1888,18 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
1514
1888
|
};
|
|
1515
1889
|
}
|
|
1516
1890
|
});
|
|
1517
|
-
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1518
|
-
const _hoisted_1$
|
|
1891
|
+
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-f1534571"]]);
|
|
1892
|
+
const _hoisted_1$s = {
|
|
1519
1893
|
key: 0,
|
|
1520
1894
|
class: "tao-textarea tao-textarea--dummy"
|
|
1521
1895
|
};
|
|
1522
|
-
const _hoisted_2$
|
|
1896
|
+
const _hoisted_2$p = {
|
|
1523
1897
|
key: 1,
|
|
1524
1898
|
class: "tao-textarea-wrap"
|
|
1525
1899
|
};
|
|
1526
|
-
const _hoisted_3$
|
|
1527
|
-
const _hoisted_4$
|
|
1528
|
-
const _sfc_main$
|
|
1900
|
+
const _hoisted_3$l = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
1901
|
+
const _hoisted_4$j = ["id"];
|
|
1902
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
1529
1903
|
...{ name: "TaoTextarea" },
|
|
1530
1904
|
__name: "TaoTextarea",
|
|
1531
1905
|
props: {
|
|
@@ -1622,7 +1996,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
1622
1996
|
nextTick(autoResize);
|
|
1623
1997
|
});
|
|
1624
1998
|
return (_ctx, _cache) => {
|
|
1625
|
-
return __props.dummy ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
1999
|
+
return __props.dummy ? (openBlock(), createElementBlock("span", _hoisted_1$s, toDisplayString(__props.modelValue), 1)) : (openBlock(), createElementBlock("div", _hoisted_2$p, [
|
|
1626
2000
|
createElementVNode("textarea", {
|
|
1627
2001
|
id: controlId.value,
|
|
1628
2002
|
ref_key: "textareaRef",
|
|
@@ -1651,21 +2025,21 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
1651
2025
|
onFocus,
|
|
1652
2026
|
onBlur,
|
|
1653
2027
|
onKeydown
|
|
1654
|
-
}, null, 42, _hoisted_3$
|
|
2028
|
+
}, null, 42, _hoisted_3$l),
|
|
1655
2029
|
__props.count ? (openBlock(), createElementBlock("span", {
|
|
1656
2030
|
key: 0,
|
|
1657
2031
|
id: counterId.value,
|
|
1658
2032
|
class: normalizeClass(["tao-textarea__count", { "tao-textarea__count--limit": atLimit.value }])
|
|
1659
|
-
}, toDisplayString(countLabel.value), 11, _hoisted_4$
|
|
2033
|
+
}, toDisplayString(countLabel.value), 11, _hoisted_4$j)) : createCommentVNode("", true)
|
|
1660
2034
|
]));
|
|
1661
2035
|
};
|
|
1662
2036
|
}
|
|
1663
2037
|
});
|
|
1664
|
-
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1665
|
-
const _hoisted_1$
|
|
1666
|
-
const _hoisted_2$
|
|
2038
|
+
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-2534c0c4"]]);
|
|
2039
|
+
const _hoisted_1$r = ["tabindex"];
|
|
2040
|
+
const _hoisted_2$o = { class: "tao-scroll-top__content" };
|
|
1667
2041
|
const RIPPLE_DURATION = 750;
|
|
1668
|
-
const _sfc_main$
|
|
2042
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
1669
2043
|
...{ name: "TaoScrollTop" },
|
|
1670
2044
|
__name: "TaoScrollTop",
|
|
1671
2045
|
props: {
|
|
@@ -1765,7 +2139,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1765
2139
|
"aria-label": "Наверх",
|
|
1766
2140
|
onClick: withModifiers(onClick, ["prevent"])
|
|
1767
2141
|
}, [
|
|
1768
|
-
createElementVNode("div", _hoisted_2$
|
|
2142
|
+
createElementVNode("div", _hoisted_2$o, [
|
|
1769
2143
|
createElementVNode("div", {
|
|
1770
2144
|
class: normalizeClass([{ "tao-scroll-top__ripple--active": isRippleActive.value }, "tao-scroll-top__ripple"]),
|
|
1771
2145
|
style: normalizeStyle(rippleStyle)
|
|
@@ -1782,33 +2156,33 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1782
2156
|
], -1))
|
|
1783
2157
|
], true)
|
|
1784
2158
|
])
|
|
1785
|
-
], 14, _hoisted_1$
|
|
2159
|
+
], 14, _hoisted_1$r)) : createCommentVNode("", true)
|
|
1786
2160
|
]),
|
|
1787
2161
|
_: 3
|
|
1788
2162
|
});
|
|
1789
2163
|
};
|
|
1790
2164
|
}
|
|
1791
2165
|
});
|
|
1792
|
-
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1793
|
-
const _hoisted_1$
|
|
1794
|
-
const _hoisted_2$
|
|
2166
|
+
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-ce902f42"]]);
|
|
2167
|
+
const _hoisted_1$q = { class: "tao-progress" };
|
|
2168
|
+
const _hoisted_2$n = {
|
|
1795
2169
|
key: 0,
|
|
1796
2170
|
class: "tao-progress__side"
|
|
1797
2171
|
};
|
|
1798
|
-
const _hoisted_3$
|
|
1799
|
-
const _hoisted_4$
|
|
2172
|
+
const _hoisted_3$k = { class: "tao-progress__main" };
|
|
2173
|
+
const _hoisted_4$i = {
|
|
1800
2174
|
key: 0,
|
|
1801
2175
|
class: "tao-progress__percentage"
|
|
1802
2176
|
};
|
|
1803
|
-
const _hoisted_5$
|
|
2177
|
+
const _hoisted_5$d = {
|
|
1804
2178
|
key: 1,
|
|
1805
2179
|
class: "tao-progress__side"
|
|
1806
2180
|
};
|
|
1807
|
-
const _hoisted_6$
|
|
2181
|
+
const _hoisted_6$a = {
|
|
1808
2182
|
key: 0,
|
|
1809
2183
|
class: "tao-progress__percentage"
|
|
1810
2184
|
};
|
|
1811
|
-
const _sfc_main$
|
|
2185
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
1812
2186
|
...{ name: "TaoProgress" },
|
|
1813
2187
|
__name: "TaoProgress",
|
|
1814
2188
|
props: {
|
|
@@ -1839,16 +2213,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1839
2213
|
() => hasRight.value ? `(${props.progress}%)` : `${props.progress}%`
|
|
1840
2214
|
);
|
|
1841
2215
|
return (_ctx, _cache) => {
|
|
1842
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2216
|
+
return openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
1843
2217
|
createElementVNode("div", {
|
|
1844
2218
|
class: normalizeClass(["tao-progress__container", { "tao-progress__container--over": showOverPercent.value }]),
|
|
1845
2219
|
style: normalizeStyle({ minWidth: `${minW.value}px`, maxWidth: `${maxW.value}px` })
|
|
1846
2220
|
}, [
|
|
1847
|
-
_ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2221
|
+
_ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_2$n, [
|
|
1848
2222
|
renderSlot(_ctx.$slots, "left", {}, void 0, true)
|
|
1849
2223
|
])) : createCommentVNode("", true),
|
|
1850
|
-
createElementVNode("div", _hoisted_3$
|
|
1851
|
-
showOverPercent.value ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
2224
|
+
createElementVNode("div", _hoisted_3$k, [
|
|
2225
|
+
showOverPercent.value ? (openBlock(), createElementBlock("span", _hoisted_4$i, toDisplayString(__props.progress) + "%", 1)) : createCommentVNode("", true),
|
|
1852
2226
|
createElementVNode("div", {
|
|
1853
2227
|
class: "tao-progress__track",
|
|
1854
2228
|
style: normalizeStyle({ height: `${__props.height}px` })
|
|
@@ -1859,23 +2233,23 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1859
2233
|
}, null, 6)
|
|
1860
2234
|
], 4)
|
|
1861
2235
|
]),
|
|
1862
|
-
_ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
2236
|
+
_ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$d, [
|
|
1863
2237
|
renderSlot(_ctx.$slots, "right", {}, void 0, true),
|
|
1864
|
-
showEndPercent.value ? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
2238
|
+
showEndPercent.value ? (openBlock(), createElementBlock("span", _hoisted_6$a, toDisplayString(endPercentLabel.value), 1)) : createCommentVNode("", true)
|
|
1865
2239
|
])) : createCommentVNode("", true)
|
|
1866
2240
|
], 6)
|
|
1867
2241
|
]);
|
|
1868
2242
|
};
|
|
1869
2243
|
}
|
|
1870
2244
|
});
|
|
1871
|
-
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1872
|
-
const _hoisted_1$
|
|
1873
|
-
const _hoisted_2$
|
|
1874
|
-
const _hoisted_3$
|
|
2245
|
+
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-54c13718"]]);
|
|
2246
|
+
const _hoisted_1$p = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-describedby"];
|
|
2247
|
+
const _hoisted_2$m = ["placeholder"];
|
|
2248
|
+
const _hoisted_3$j = {
|
|
1875
2249
|
key: 1,
|
|
1876
2250
|
class: "tao-slider__value"
|
|
1877
2251
|
};
|
|
1878
|
-
const _sfc_main$
|
|
2252
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
1879
2253
|
...{ name: "TaoSlider" },
|
|
1880
2254
|
__name: "TaoSlider",
|
|
1881
2255
|
props: {
|
|
@@ -2069,21 +2443,29 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2069
2443
|
onKeydown: onShadowKeydown,
|
|
2070
2444
|
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
2071
2445
|
}, ["stop"]))
|
|
2072
|
-
}, null, 40, _hoisted_2$
|
|
2446
|
+
}, null, 40, _hoisted_2$m)), [
|
|
2073
2447
|
[vModelText, shadowModel.value]
|
|
2074
|
-
]) : __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2448
|
+
]) : __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$j, [
|
|
2075
2449
|
renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
|
|
2076
2450
|
createTextVNode(toDisplayString(__props.modelValue), 1),
|
|
2077
2451
|
renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
|
|
2078
2452
|
])) : createCommentVNode("", true)
|
|
2079
|
-
], 42, _hoisted_1$
|
|
2453
|
+
], 42, _hoisted_1$p);
|
|
2080
2454
|
};
|
|
2081
2455
|
}
|
|
2082
2456
|
});
|
|
2083
|
-
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2084
|
-
const _hoisted_1$
|
|
2085
|
-
const _hoisted_2$
|
|
2086
|
-
const
|
|
2457
|
+
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-241d1042"]]);
|
|
2458
|
+
const _hoisted_1$o = { class: "tao-file-drop" };
|
|
2459
|
+
const _hoisted_2$l = { class: "tao-file-drop__row" };
|
|
2460
|
+
const _hoisted_3$i = ["accept", "multiple"];
|
|
2461
|
+
const _hoisted_4$h = {
|
|
2462
|
+
key: 0,
|
|
2463
|
+
class: "tao-file-drop__list"
|
|
2464
|
+
};
|
|
2465
|
+
const _hoisted_5$c = { class: "tao-file-drop__name" };
|
|
2466
|
+
const _hoisted_6$9 = { class: "tao-file-drop__meta" };
|
|
2467
|
+
const _hoisted_7$7 = ["aria-label", "onClick"];
|
|
2468
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
2087
2469
|
...{ name: "TaoFileDrop" },
|
|
2088
2470
|
__name: "TaoFileDrop",
|
|
2089
2471
|
props: {
|
|
@@ -2091,7 +2473,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2091
2473
|
size: { default: "medium" },
|
|
2092
2474
|
accept: { default: "*" },
|
|
2093
2475
|
multiple: { type: Boolean, default: false },
|
|
2094
|
-
showClear: { type: Boolean, default: false }
|
|
2476
|
+
showClear: { type: Boolean, default: false },
|
|
2477
|
+
list: { type: Boolean, default: true }
|
|
2095
2478
|
},
|
|
2096
2479
|
emits: ["update:modelValue", "files", "clear-request"],
|
|
2097
2480
|
setup(__props, { emit: __emit }) {
|
|
@@ -2099,6 +2482,13 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2099
2482
|
const emit = __emit;
|
|
2100
2483
|
const isDragging = ref(false);
|
|
2101
2484
|
const fileInput = ref(null);
|
|
2485
|
+
function sameFile(a, b) {
|
|
2486
|
+
return a.name === b.name && a.size === b.size && a.lastModified === b.lastModified;
|
|
2487
|
+
}
|
|
2488
|
+
function commit(files) {
|
|
2489
|
+
emit("update:modelValue", files);
|
|
2490
|
+
emit("files", files);
|
|
2491
|
+
}
|
|
2102
2492
|
function handleDragOver(event) {
|
|
2103
2493
|
event.preventDefault();
|
|
2104
2494
|
isDragging.value = true;
|
|
@@ -2124,60 +2514,110 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2124
2514
|
function requestClear() {
|
|
2125
2515
|
emit("clear-request");
|
|
2126
2516
|
}
|
|
2517
|
+
function removeAt(index) {
|
|
2518
|
+
commit(props.modelValue.filter((_, item) => item !== index));
|
|
2519
|
+
}
|
|
2127
2520
|
function processFiles(fileList) {
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2521
|
+
const incoming = Array.from(fileList);
|
|
2522
|
+
if (!incoming.length) {
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
let result;
|
|
2526
|
+
if (!props.multiple) {
|
|
2527
|
+
result = [incoming[0]];
|
|
2528
|
+
} else {
|
|
2529
|
+
result = [...props.modelValue];
|
|
2530
|
+
for (const file of incoming) {
|
|
2531
|
+
if (!result.some((item) => sameFile(item, file))) {
|
|
2532
|
+
result.push(file);
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
commit(result);
|
|
2132
2537
|
const el = fileInput.value;
|
|
2133
2538
|
if (el) {
|
|
2134
2539
|
el.type = "text";
|
|
2135
2540
|
el.type = "file";
|
|
2136
2541
|
}
|
|
2137
2542
|
}
|
|
2543
|
+
function formatSize(bytes) {
|
|
2544
|
+
if (bytes < 1024) {
|
|
2545
|
+
return `${bytes} Б`;
|
|
2546
|
+
}
|
|
2547
|
+
const kb = bytes / 1024;
|
|
2548
|
+
if (kb < 1024) {
|
|
2549
|
+
const value2 = kb < 10 ? kb.toFixed(1) : String(Math.round(kb));
|
|
2550
|
+
return `${value2.replace(".", ",")} КБ`;
|
|
2551
|
+
}
|
|
2552
|
+
const mb = kb / 1024;
|
|
2553
|
+
const value = mb < 10 ? mb.toFixed(1) : String(Math.round(mb));
|
|
2554
|
+
return `${value.replace(".", ",")} МБ`;
|
|
2555
|
+
}
|
|
2556
|
+
function fileKey(file, index) {
|
|
2557
|
+
return `${file.name}-${file.size}-${file.lastModified}-${index}`;
|
|
2558
|
+
}
|
|
2138
2559
|
return (_ctx, _cache) => {
|
|
2139
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2560
|
+
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
2561
|
+
createElementVNode("div", _hoisted_2$l, [
|
|
2562
|
+
__props.showClear && __props.modelValue.length ? (openBlock(), createElementBlock("button", {
|
|
2563
|
+
key: 0,
|
|
2564
|
+
type: "button",
|
|
2565
|
+
class: "tao-file-drop__clear",
|
|
2566
|
+
"aria-label": "Очистить файлы",
|
|
2567
|
+
onClick: requestClear
|
|
2568
|
+
}, " ✕ ")) : createCommentVNode("", true),
|
|
2569
|
+
createElementVNode("label", {
|
|
2570
|
+
class: normalizeClass(["tao-file-drop__zone", [`tao-file-drop__zone--${__props.size}`, { "tao-file-drop__zone--dragging": isDragging.value }]]),
|
|
2571
|
+
onDragover: handleDragOver,
|
|
2572
|
+
onDragleave: handleDragLeave,
|
|
2573
|
+
onDrop: handleDrop
|
|
2574
|
+
}, [
|
|
2575
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2576
|
+
_cache[1] || (_cache[1] = createTextVNode("Перетащите файл сюда или нажмите, чтобы выбрать", -1))
|
|
2577
|
+
], true),
|
|
2578
|
+
createElementVNode("input", {
|
|
2579
|
+
ref_key: "fileInput",
|
|
2580
|
+
ref: fileInput,
|
|
2581
|
+
class: "tao-sr-only",
|
|
2582
|
+
type: "file",
|
|
2583
|
+
accept: __props.accept,
|
|
2584
|
+
multiple: __props.multiple,
|
|
2585
|
+
onChange: handleFileSelect,
|
|
2586
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
2587
|
+
}, ["stop"]))
|
|
2588
|
+
}, null, 40, _hoisted_3$i)
|
|
2589
|
+
], 34)
|
|
2590
|
+
]),
|
|
2591
|
+
__props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul", _hoisted_4$h, [
|
|
2592
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (file, index) => {
|
|
2593
|
+
return openBlock(), createElementBlock("li", {
|
|
2594
|
+
key: fileKey(file, index),
|
|
2595
|
+
class: "tao-file-drop__file"
|
|
2596
|
+
}, [
|
|
2597
|
+
createElementVNode("span", _hoisted_5$c, toDisplayString(file.name), 1),
|
|
2598
|
+
createElementVNode("span", _hoisted_6$9, toDisplayString(formatSize(file.size)), 1),
|
|
2599
|
+
createElementVNode("button", {
|
|
2600
|
+
type: "button",
|
|
2601
|
+
class: "tao-file-drop__remove",
|
|
2602
|
+
"aria-label": `Убрать «${file.name}»`,
|
|
2603
|
+
onClick: ($event) => removeAt(index)
|
|
2604
|
+
}, " ✕ ", 8, _hoisted_7$7)
|
|
2605
|
+
]);
|
|
2606
|
+
}), 128))
|
|
2607
|
+
])) : createCommentVNode("", true)
|
|
2168
2608
|
]);
|
|
2169
2609
|
};
|
|
2170
2610
|
}
|
|
2171
2611
|
});
|
|
2172
|
-
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2173
|
-
const _hoisted_1$
|
|
2174
|
-
const _hoisted_2$
|
|
2612
|
+
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-fbd848b0"]]);
|
|
2613
|
+
const _hoisted_1$n = ["aria-expanded"];
|
|
2614
|
+
const _hoisted_2$k = {
|
|
2175
2615
|
key: 1,
|
|
2176
2616
|
"aria-label": "Меню"
|
|
2177
2617
|
};
|
|
2178
|
-
const _hoisted_3$
|
|
2179
|
-
const _hoisted_4$
|
|
2180
|
-
const _sfc_main$
|
|
2618
|
+
const _hoisted_3$h = ["onClick", "onMouseenter"];
|
|
2619
|
+
const _hoisted_4$g = { key: 1 };
|
|
2620
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2181
2621
|
...{ name: "TaoDropdownMenu" },
|
|
2182
2622
|
__name: "TaoDropdownMenu",
|
|
2183
2623
|
props: {
|
|
@@ -2312,8 +2752,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2312
2752
|
"aria-expanded": isOpen.value,
|
|
2313
2753
|
onClick: toggleMenu
|
|
2314
2754
|
}, [
|
|
2315
|
-
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$
|
|
2316
|
-
], 8, _hoisted_1$
|
|
2755
|
+
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$k, "⋮"))
|
|
2756
|
+
], 8, _hoisted_1$n),
|
|
2317
2757
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
2318
2758
|
isOpen.value ? (openBlock(), createElementBlock("div", {
|
|
2319
2759
|
key: 0,
|
|
@@ -2338,8 +2778,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2338
2778
|
id: action.id,
|
|
2339
2779
|
ico: action.ico,
|
|
2340
2780
|
text: action.name
|
|
2341
|
-
}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
2342
|
-
], 42, _hoisted_3$
|
|
2781
|
+
}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_4$g, toDisplayString(action.name), 1))
|
|
2782
|
+
], 42, _hoisted_3$h);
|
|
2343
2783
|
}), 128))
|
|
2344
2784
|
], 36)) : createCommentVNode("", true)
|
|
2345
2785
|
]))
|
|
@@ -2347,10 +2787,10 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2347
2787
|
};
|
|
2348
2788
|
}
|
|
2349
2789
|
});
|
|
2350
|
-
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2351
|
-
const _hoisted_1$
|
|
2352
|
-
const _hoisted_2$
|
|
2353
|
-
const _sfc_main$
|
|
2790
|
+
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-420a7e63"]]);
|
|
2791
|
+
const _hoisted_1$m = ["aria-invalid", "aria-describedby"];
|
|
2792
|
+
const _hoisted_2$j = ["id", "value", "placeholder", "type", "inputmode", "pattern", "onInput", "onKeydown", "onFocus"];
|
|
2793
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
2354
2794
|
...{ name: "TaoPinCode" },
|
|
2355
2795
|
__name: "TaoPinCode",
|
|
2356
2796
|
props: {
|
|
@@ -2517,14 +2957,14 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
2517
2957
|
onKeydown: ($event) => onKeydown($event, index),
|
|
2518
2958
|
onFocus: ($event) => onFocus(index),
|
|
2519
2959
|
onBlur
|
|
2520
|
-
}, null, 42, _hoisted_2$
|
|
2960
|
+
}, null, 42, _hoisted_2$j);
|
|
2521
2961
|
}), 128))
|
|
2522
|
-
], 8, _hoisted_1$
|
|
2962
|
+
], 8, _hoisted_1$m);
|
|
2523
2963
|
};
|
|
2524
2964
|
}
|
|
2525
2965
|
});
|
|
2526
|
-
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2527
|
-
const _sfc_main$
|
|
2966
|
+
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-c3182673"]]);
|
|
2967
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
2528
2968
|
...{ name: "TaoLink" },
|
|
2529
2969
|
__name: "TaoLink",
|
|
2530
2970
|
props: {
|
|
@@ -2566,8 +3006,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
2566
3006
|
};
|
|
2567
3007
|
}
|
|
2568
3008
|
});
|
|
2569
|
-
const _hoisted_1$
|
|
2570
|
-
const _sfc_main$
|
|
3009
|
+
const _hoisted_1$l = ["for"];
|
|
3010
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2571
3011
|
...{ name: "TaoFormField" },
|
|
2572
3012
|
__name: "TaoFormField",
|
|
2573
3013
|
props: {
|
|
@@ -2603,7 +3043,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2603
3043
|
key: 0,
|
|
2604
3044
|
class: "tao-form-field__label",
|
|
2605
3045
|
for: unref(id)
|
|
2606
|
-
}, toDisplayString(__props.label), 9, _hoisted_1$
|
|
3046
|
+
}, toDisplayString(__props.label), 9, _hoisted_1$l)) : createCommentVNode("", true),
|
|
2607
3047
|
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
2608
3048
|
__props.error ? (openBlock(), createElementBlock("p", {
|
|
2609
3049
|
key: 1,
|
|
@@ -2618,12 +3058,12 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2618
3058
|
};
|
|
2619
3059
|
}
|
|
2620
3060
|
});
|
|
2621
|
-
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2622
|
-
const _hoisted_1$
|
|
2623
|
-
const _hoisted_2$
|
|
2624
|
-
const _hoisted_3$
|
|
2625
|
-
const _hoisted_4$
|
|
2626
|
-
const _sfc_main$
|
|
3061
|
+
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-11324f0c"]]);
|
|
3062
|
+
const _hoisted_1$k = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
3063
|
+
const _hoisted_2$i = { class: "tao-select__value" };
|
|
3064
|
+
const _hoisted_3$g = ["aria-activedescendant"];
|
|
3065
|
+
const _hoisted_4$f = ["id", "aria-selected", "aria-disabled", "data-tao-select-index", "onClick", "onMouseenter"];
|
|
3066
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2627
3067
|
...{ name: "TaoSelect" },
|
|
2628
3068
|
__name: "TaoSelect",
|
|
2629
3069
|
props: {
|
|
@@ -2836,12 +3276,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2836
3276
|
onClick: toggle,
|
|
2837
3277
|
onKeydown: onTriggerKeydown
|
|
2838
3278
|
}, [
|
|
2839
|
-
createElementVNode("span", _hoisted_2$
|
|
3279
|
+
createElementVNode("span", _hoisted_2$i, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? __props.placeholder), 1),
|
|
2840
3280
|
_cache[2] || (_cache[2] = createElementVNode("span", {
|
|
2841
3281
|
class: "tao-select__chevron",
|
|
2842
3282
|
"aria-hidden": "true"
|
|
2843
3283
|
}, null, -1))
|
|
2844
|
-
], 42, _hoisted_1$
|
|
3284
|
+
], 42, _hoisted_1$k),
|
|
2845
3285
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
2846
3286
|
open.value ? (openBlock(), createElementBlock("div", {
|
|
2847
3287
|
key: 0,
|
|
@@ -2869,131 +3309,1013 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2869
3309
|
"tao-select__option--selected": option.value === __props.modelValue,
|
|
2870
3310
|
"tao-select__option--disabled": option.disabled
|
|
2871
3311
|
}]),
|
|
2872
|
-
role: "option",
|
|
2873
|
-
"aria-selected": option.value === __props.modelValue,
|
|
2874
|
-
"aria-disabled": option.disabled || void 0,
|
|
2875
|
-
"data-tao-select-index": index,
|
|
2876
|
-
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
3312
|
+
role: "option",
|
|
3313
|
+
"aria-selected": option.value === __props.modelValue,
|
|
3314
|
+
"aria-disabled": option.disabled || void 0,
|
|
3315
|
+
"data-tao-select-index": index,
|
|
3316
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
3317
|
+
}, ["prevent"])),
|
|
3318
|
+
onClick: ($event) => selectOption(option),
|
|
3319
|
+
onMouseenter: ($event) => !option.disabled && (activeIndex.value = index)
|
|
3320
|
+
}, toDisplayString(option.label), 43, _hoisted_4$f);
|
|
3321
|
+
}), 128))
|
|
3322
|
+
], 40, _hoisted_3$g),
|
|
3323
|
+
selected.value ? (openBlock(), createElementBlock("button", {
|
|
3324
|
+
key: 0,
|
|
3325
|
+
type: "button",
|
|
3326
|
+
class: "tao-select__clear",
|
|
3327
|
+
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
3328
|
+
}, ["prevent"])),
|
|
3329
|
+
onClick: clear
|
|
3330
|
+
}, " Очистить ", 32)) : createCommentVNode("", true)
|
|
3331
|
+
], 4)) : createCommentVNode("", true)
|
|
3332
|
+
]))
|
|
3333
|
+
], 2);
|
|
3334
|
+
};
|
|
3335
|
+
}
|
|
3336
|
+
});
|
|
3337
|
+
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-42551757"]]);
|
|
3338
|
+
const _hoisted_1$j = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
|
|
3339
|
+
const _hoisted_2$h = {
|
|
3340
|
+
key: 0,
|
|
3341
|
+
class: "tao-combobox__empty"
|
|
3342
|
+
};
|
|
3343
|
+
const _hoisted_3$f = ["id", "aria-selected", "aria-disabled", "data-tao-combobox-index", "onClick", "onMouseenter"];
|
|
3344
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
3345
|
+
...{ name: "TaoCombobox" },
|
|
3346
|
+
__name: "TaoCombobox",
|
|
3347
|
+
props: {
|
|
3348
|
+
modelValue: { default: null },
|
|
3349
|
+
options: { default: () => [] },
|
|
3350
|
+
placeholder: { default: "Начните вводить" },
|
|
3351
|
+
disabled: { type: Boolean, default: false },
|
|
3352
|
+
error: { type: Boolean, default: false },
|
|
3353
|
+
allowCreate: { type: Boolean, default: false }
|
|
3354
|
+
},
|
|
3355
|
+
emits: ["update:modelValue", "change", "create"],
|
|
3356
|
+
setup(__props, { emit: __emit }) {
|
|
3357
|
+
const props = __props;
|
|
3358
|
+
const emit = __emit;
|
|
3359
|
+
const field = inject(formFieldKey, null);
|
|
3360
|
+
const localId = useId();
|
|
3361
|
+
const listId = `${localId}-list`;
|
|
3362
|
+
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
3363
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
3364
|
+
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3365
|
+
const open = ref(false);
|
|
3366
|
+
const focused = ref(false);
|
|
3367
|
+
const picking = ref(false);
|
|
3368
|
+
const skipFocusOpen = ref(false);
|
|
3369
|
+
const query = ref("");
|
|
3370
|
+
const activeIndex = ref(-1);
|
|
3371
|
+
const fieldRef = ref(null);
|
|
3372
|
+
const inputRef = ref(null);
|
|
3373
|
+
const panelRef = ref(null);
|
|
3374
|
+
const listRef = ref(null);
|
|
3375
|
+
const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
|
|
3376
|
+
const selected = computed(() => {
|
|
3377
|
+
const found = props.options.find((option) => option.value === props.modelValue);
|
|
3378
|
+
if (found) {
|
|
3379
|
+
return found;
|
|
3380
|
+
}
|
|
3381
|
+
if (props.modelValue === null || props.modelValue === void 0 || props.modelValue === "") {
|
|
3382
|
+
return null;
|
|
3383
|
+
}
|
|
3384
|
+
return { value: props.modelValue, label: String(props.modelValue) };
|
|
3385
|
+
});
|
|
3386
|
+
const needle = computed(() => query.value.trim().toLowerCase());
|
|
3387
|
+
const filtered = computed(() => {
|
|
3388
|
+
if (!needle.value) {
|
|
3389
|
+
return props.options;
|
|
3390
|
+
}
|
|
3391
|
+
return props.options.filter((option) => option.label.toLowerCase().includes(needle.value));
|
|
3392
|
+
});
|
|
3393
|
+
const canCreate = computed(() => {
|
|
3394
|
+
const text = query.value.trim();
|
|
3395
|
+
if (!props.allowCreate || !text) {
|
|
3396
|
+
return false;
|
|
3397
|
+
}
|
|
3398
|
+
return !props.options.some((option) => option.label.toLowerCase() === text.toLowerCase());
|
|
3399
|
+
});
|
|
3400
|
+
const rows = computed(() => {
|
|
3401
|
+
const next = filtered.value.map((option) => ({ kind: "option", option }));
|
|
3402
|
+
if (canCreate.value) {
|
|
3403
|
+
next.push({ kind: "create", text: query.value.trim() });
|
|
3404
|
+
}
|
|
3405
|
+
return next;
|
|
3406
|
+
});
|
|
3407
|
+
const enabledIndexes = computed(
|
|
3408
|
+
() => rows.value.map((row, index) => row.kind === "option" && row.option.disabled ? -1 : index).filter((index) => index >= 0)
|
|
3409
|
+
);
|
|
3410
|
+
const activeId = computed(() => activeIndex.value >= 0 ? `${listId}-row-${activeIndex.value}` : void 0);
|
|
3411
|
+
function syncQueryFromModel() {
|
|
3412
|
+
var _a;
|
|
3413
|
+
query.value = ((_a = selected.value) == null ? void 0 : _a.label) ?? "";
|
|
3414
|
+
}
|
|
3415
|
+
function updatePosition() {
|
|
3416
|
+
const trigger = fieldRef.value;
|
|
3417
|
+
const panel = panelRef.value;
|
|
3418
|
+
if (!trigger || !panel) {
|
|
3419
|
+
return;
|
|
3420
|
+
}
|
|
3421
|
+
const rect = trigger.getBoundingClientRect();
|
|
3422
|
+
const panelHeight = panel.offsetHeight;
|
|
3423
|
+
const gap = 4;
|
|
3424
|
+
const spaceBelow = window.innerHeight - rect.bottom - gap;
|
|
3425
|
+
const openUp = spaceBelow < panelHeight && rect.top > spaceBelow;
|
|
3426
|
+
listStyle.value = {
|
|
3427
|
+
top: `${openUp ? rect.top - panelHeight - gap : rect.bottom + gap}px`,
|
|
3428
|
+
left: `${rect.left}px`,
|
|
3429
|
+
width: `${rect.width}px`
|
|
3430
|
+
};
|
|
3431
|
+
}
|
|
3432
|
+
function resetActive() {
|
|
3433
|
+
const selectedIndex = rows.value.findIndex(
|
|
3434
|
+
(row) => row.kind === "option" && row.option.value === props.modelValue
|
|
3435
|
+
);
|
|
3436
|
+
if (selectedIndex >= 0 && enabledIndexes.value.includes(selectedIndex)) {
|
|
3437
|
+
activeIndex.value = selectedIndex;
|
|
3438
|
+
return;
|
|
3439
|
+
}
|
|
3440
|
+
activeIndex.value = enabledIndexes.value[0] ?? -1;
|
|
3441
|
+
}
|
|
3442
|
+
async function setOpen(next) {
|
|
3443
|
+
if (props.disabled) {
|
|
3444
|
+
return;
|
|
3445
|
+
}
|
|
3446
|
+
open.value = next;
|
|
3447
|
+
resetActive();
|
|
3448
|
+
await nextTick();
|
|
3449
|
+
updatePosition();
|
|
3450
|
+
scrollActiveIntoView();
|
|
3451
|
+
}
|
|
3452
|
+
function emitValue(value) {
|
|
3453
|
+
emit("update:modelValue", value);
|
|
3454
|
+
emit("change", value);
|
|
3455
|
+
}
|
|
3456
|
+
function keepFocusQuiet() {
|
|
3457
|
+
var _a;
|
|
3458
|
+
skipFocusOpen.value = true;
|
|
3459
|
+
picking.value = false;
|
|
3460
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
3461
|
+
}
|
|
3462
|
+
function commitCreated(value) {
|
|
3463
|
+
emitValue(value);
|
|
3464
|
+
emit("create", value);
|
|
3465
|
+
query.value = value;
|
|
3466
|
+
open.value = false;
|
|
3467
|
+
keepFocusQuiet();
|
|
3468
|
+
}
|
|
3469
|
+
function selectOption(option) {
|
|
3470
|
+
if (option.disabled) {
|
|
3471
|
+
return;
|
|
3472
|
+
}
|
|
3473
|
+
emitValue(option.value);
|
|
3474
|
+
query.value = option.label;
|
|
3475
|
+
open.value = false;
|
|
3476
|
+
keepFocusQuiet();
|
|
3477
|
+
}
|
|
3478
|
+
function createFromQuery(text) {
|
|
3479
|
+
const value = text.trim();
|
|
3480
|
+
if (!value) {
|
|
3481
|
+
return;
|
|
3482
|
+
}
|
|
3483
|
+
const exact = props.options.find(
|
|
3484
|
+
(option) => !option.disabled && option.label.toLowerCase() === value.toLowerCase()
|
|
3485
|
+
);
|
|
3486
|
+
if (exact) {
|
|
3487
|
+
selectOption(exact);
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
if (!props.allowCreate) {
|
|
3491
|
+
return;
|
|
3492
|
+
}
|
|
3493
|
+
commitCreated(value);
|
|
3494
|
+
}
|
|
3495
|
+
function revertQuery() {
|
|
3496
|
+
syncQueryFromModel();
|
|
3497
|
+
}
|
|
3498
|
+
function closeAndRevert() {
|
|
3499
|
+
open.value = false;
|
|
3500
|
+
revertQuery();
|
|
3501
|
+
}
|
|
3502
|
+
function closeAndCommit() {
|
|
3503
|
+
open.value = false;
|
|
3504
|
+
const text = query.value.trim();
|
|
3505
|
+
if (!text) {
|
|
3506
|
+
revertQuery();
|
|
3507
|
+
return;
|
|
3508
|
+
}
|
|
3509
|
+
const exact = props.options.find(
|
|
3510
|
+
(option) => !option.disabled && option.label.toLowerCase() === text.toLowerCase()
|
|
3511
|
+
);
|
|
3512
|
+
if (exact) {
|
|
3513
|
+
emitValue(exact.value);
|
|
3514
|
+
query.value = exact.label;
|
|
3515
|
+
return;
|
|
3516
|
+
}
|
|
3517
|
+
if (props.allowCreate) {
|
|
3518
|
+
emitValue(text);
|
|
3519
|
+
emit("create", text);
|
|
3520
|
+
query.value = text;
|
|
3521
|
+
return;
|
|
3522
|
+
}
|
|
3523
|
+
revertQuery();
|
|
3524
|
+
}
|
|
3525
|
+
function moveActive(delta) {
|
|
3526
|
+
const enabled = enabledIndexes.value;
|
|
3527
|
+
if (!enabled.length) {
|
|
3528
|
+
return;
|
|
3529
|
+
}
|
|
3530
|
+
const currentPos = enabled.indexOf(activeIndex.value);
|
|
3531
|
+
const nextPos = currentPos < 0 ? 0 : (currentPos + delta + enabled.length) % enabled.length;
|
|
3532
|
+
activeIndex.value = enabled[nextPos];
|
|
3533
|
+
scrollActiveIntoView();
|
|
3534
|
+
}
|
|
3535
|
+
function scrollActiveIntoView() {
|
|
3536
|
+
const list = listRef.value;
|
|
3537
|
+
if (!list || activeIndex.value < 0) {
|
|
3538
|
+
return;
|
|
3539
|
+
}
|
|
3540
|
+
const option = list.querySelector(`[data-tao-combobox-index="${activeIndex.value}"]`);
|
|
3541
|
+
option == null ? void 0 : option.scrollIntoView({ block: "nearest" });
|
|
3542
|
+
}
|
|
3543
|
+
function onFieldMouseDown(event) {
|
|
3544
|
+
var _a;
|
|
3545
|
+
if (props.disabled || event.button !== 0) {
|
|
3546
|
+
return;
|
|
3547
|
+
}
|
|
3548
|
+
const onInput2 = event.target === inputRef.value;
|
|
3549
|
+
if (onInput2) {
|
|
3550
|
+
if (focused.value && !open.value) {
|
|
3551
|
+
void setOpen(true);
|
|
3552
|
+
}
|
|
3553
|
+
return;
|
|
3554
|
+
}
|
|
3555
|
+
event.preventDefault();
|
|
3556
|
+
if (open.value) {
|
|
3557
|
+
open.value = false;
|
|
3558
|
+
return;
|
|
3559
|
+
}
|
|
3560
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
3561
|
+
void setOpen(true);
|
|
3562
|
+
}
|
|
3563
|
+
function onInput() {
|
|
3564
|
+
if (props.disabled) {
|
|
3565
|
+
return;
|
|
3566
|
+
}
|
|
3567
|
+
void setOpen(true);
|
|
3568
|
+
resetActive();
|
|
3569
|
+
}
|
|
3570
|
+
function onFocus() {
|
|
3571
|
+
if (props.disabled) {
|
|
3572
|
+
return;
|
|
3573
|
+
}
|
|
3574
|
+
focused.value = true;
|
|
3575
|
+
if (skipFocusOpen.value) {
|
|
3576
|
+
skipFocusOpen.value = false;
|
|
3577
|
+
return;
|
|
3578
|
+
}
|
|
3579
|
+
void setOpen(true);
|
|
3580
|
+
nextTick(() => {
|
|
3581
|
+
var _a;
|
|
3582
|
+
return (_a = inputRef.value) == null ? void 0 : _a.select();
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
function markPicking() {
|
|
3586
|
+
picking.value = true;
|
|
3587
|
+
}
|
|
3588
|
+
function onBlur() {
|
|
3589
|
+
focused.value = false;
|
|
3590
|
+
window.setTimeout(() => {
|
|
3591
|
+
var _a, _b;
|
|
3592
|
+
if (picking.value) {
|
|
3593
|
+
picking.value = false;
|
|
3594
|
+
return;
|
|
3595
|
+
}
|
|
3596
|
+
if (((_a = fieldRef.value) == null ? void 0 : _a.contains(document.activeElement)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(document.activeElement))) {
|
|
3597
|
+
return;
|
|
3598
|
+
}
|
|
3599
|
+
if (props.allowCreate) {
|
|
3600
|
+
closeAndCommit();
|
|
3601
|
+
return;
|
|
3602
|
+
}
|
|
3603
|
+
closeAndRevert();
|
|
3604
|
+
}, 0);
|
|
3605
|
+
}
|
|
3606
|
+
function activateRow(row) {
|
|
3607
|
+
if (row.kind === "create") {
|
|
3608
|
+
createFromQuery(row.text);
|
|
3609
|
+
return;
|
|
3610
|
+
}
|
|
3611
|
+
selectOption(row.option);
|
|
3612
|
+
}
|
|
3613
|
+
function onInputKeydown(event) {
|
|
3614
|
+
if (props.disabled) {
|
|
3615
|
+
return;
|
|
3616
|
+
}
|
|
3617
|
+
if (event.key === "Escape") {
|
|
3618
|
+
event.preventDefault();
|
|
3619
|
+
closeAndRevert();
|
|
3620
|
+
return;
|
|
3621
|
+
}
|
|
3622
|
+
if (event.key === "ArrowDown") {
|
|
3623
|
+
event.preventDefault();
|
|
3624
|
+
if (!open.value) {
|
|
3625
|
+
void setOpen(true);
|
|
3626
|
+
return;
|
|
3627
|
+
}
|
|
3628
|
+
moveActive(1);
|
|
3629
|
+
return;
|
|
3630
|
+
}
|
|
3631
|
+
if (event.key === "ArrowUp") {
|
|
3632
|
+
event.preventDefault();
|
|
3633
|
+
if (!open.value) {
|
|
3634
|
+
void setOpen(true);
|
|
3635
|
+
return;
|
|
3636
|
+
}
|
|
3637
|
+
moveActive(-1);
|
|
3638
|
+
return;
|
|
3639
|
+
}
|
|
3640
|
+
if (event.key === "Enter") {
|
|
3641
|
+
event.preventDefault();
|
|
3642
|
+
if (!open.value) {
|
|
3643
|
+
void setOpen(true);
|
|
3644
|
+
return;
|
|
3645
|
+
}
|
|
3646
|
+
const row = rows.value[activeIndex.value];
|
|
3647
|
+
if (row) {
|
|
3648
|
+
activateRow(row);
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
if (props.allowCreate) {
|
|
3652
|
+
createFromQuery(query.value);
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
function onDocumentPointer(event) {
|
|
3657
|
+
var _a, _b;
|
|
3658
|
+
const target = event.target;
|
|
3659
|
+
if (((_a = fieldRef.value) == null ? void 0 : _a.contains(target)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(target))) {
|
|
3660
|
+
return;
|
|
3661
|
+
}
|
|
3662
|
+
if (props.allowCreate) {
|
|
3663
|
+
closeAndCommit();
|
|
3664
|
+
return;
|
|
3665
|
+
}
|
|
3666
|
+
closeAndRevert();
|
|
3667
|
+
}
|
|
3668
|
+
function onViewportChange() {
|
|
3669
|
+
if (open.value) {
|
|
3670
|
+
updatePosition();
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
watch(
|
|
3674
|
+
() => props.modelValue,
|
|
3675
|
+
() => {
|
|
3676
|
+
if (!focused.value) {
|
|
3677
|
+
syncQueryFromModel();
|
|
3678
|
+
}
|
|
3679
|
+
},
|
|
3680
|
+
{ immediate: true }
|
|
3681
|
+
);
|
|
3682
|
+
watch(rows, () => {
|
|
3683
|
+
if (!open.value) {
|
|
3684
|
+
return;
|
|
3685
|
+
}
|
|
3686
|
+
if (!enabledIndexes.value.includes(activeIndex.value)) {
|
|
3687
|
+
activeIndex.value = enabledIndexes.value[0] ?? -1;
|
|
3688
|
+
}
|
|
3689
|
+
});
|
|
3690
|
+
watch(open, (isOpen) => {
|
|
3691
|
+
if (isOpen) {
|
|
3692
|
+
document.addEventListener("pointerdown", onDocumentPointer);
|
|
3693
|
+
window.addEventListener("resize", onViewportChange);
|
|
3694
|
+
window.addEventListener("scroll", onViewportChange, true);
|
|
3695
|
+
return;
|
|
3696
|
+
}
|
|
3697
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
3698
|
+
window.removeEventListener("resize", onViewportChange);
|
|
3699
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
3700
|
+
});
|
|
3701
|
+
onBeforeUnmount(() => {
|
|
3702
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
3703
|
+
window.removeEventListener("resize", onViewportChange);
|
|
3704
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
3705
|
+
});
|
|
3706
|
+
return (_ctx, _cache) => {
|
|
3707
|
+
return openBlock(), createElementBlock("div", {
|
|
3708
|
+
class: normalizeClass(["tao-combobox", {
|
|
3709
|
+
"tao-combobox--open": open.value,
|
|
3710
|
+
"tao-combobox--invalid": invalid.value,
|
|
3711
|
+
"tao-combobox--disabled": __props.disabled
|
|
3712
|
+
}])
|
|
3713
|
+
}, [
|
|
3714
|
+
createElementVNode("div", {
|
|
3715
|
+
ref_key: "fieldRef",
|
|
3716
|
+
ref: fieldRef,
|
|
3717
|
+
class: "tao-combobox__field",
|
|
3718
|
+
onMousedown: onFieldMouseDown
|
|
3719
|
+
}, [
|
|
3720
|
+
createElementVNode("input", {
|
|
3721
|
+
id: controlId.value,
|
|
3722
|
+
ref_key: "inputRef",
|
|
3723
|
+
ref: inputRef,
|
|
3724
|
+
class: "tao-combobox__input",
|
|
3725
|
+
type: "text",
|
|
3726
|
+
role: "combobox",
|
|
3727
|
+
autocomplete: "off",
|
|
3728
|
+
"aria-autocomplete": "list",
|
|
3729
|
+
"aria-haspopup": "listbox",
|
|
3730
|
+
"aria-expanded": open.value,
|
|
3731
|
+
"aria-controls": listId,
|
|
3732
|
+
"aria-activedescendant": open.value ? activeId.value : void 0,
|
|
3733
|
+
"aria-invalid": invalid.value || void 0,
|
|
3734
|
+
"aria-describedby": describedBy.value,
|
|
3735
|
+
disabled: __props.disabled,
|
|
3736
|
+
placeholder: __props.placeholder,
|
|
3737
|
+
value: query.value,
|
|
3738
|
+
onInput: _cache[0] || (_cache[0] = ($event) => {
|
|
3739
|
+
query.value = $event.target.value;
|
|
3740
|
+
onInput();
|
|
3741
|
+
}),
|
|
3742
|
+
onFocus,
|
|
3743
|
+
onBlur,
|
|
3744
|
+
onKeydown: onInputKeydown
|
|
3745
|
+
}, null, 40, _hoisted_1$j),
|
|
3746
|
+
_cache[1] || (_cache[1] = createElementVNode("span", {
|
|
3747
|
+
class: "tao-combobox__chevron",
|
|
3748
|
+
"aria-hidden": "true"
|
|
3749
|
+
}, null, -1))
|
|
3750
|
+
], 544),
|
|
3751
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3752
|
+
open.value ? (openBlock(), createElementBlock("div", {
|
|
3753
|
+
key: 0,
|
|
3754
|
+
ref_key: "panelRef",
|
|
3755
|
+
ref: panelRef,
|
|
3756
|
+
class: "tao-combobox__panel",
|
|
3757
|
+
style: normalizeStyle(listStyle.value)
|
|
3758
|
+
}, [
|
|
3759
|
+
createElementVNode("ul", {
|
|
3760
|
+
id: listId,
|
|
3761
|
+
ref_key: "listRef",
|
|
3762
|
+
ref: listRef,
|
|
3763
|
+
class: "tao-combobox__list",
|
|
3764
|
+
role: "listbox"
|
|
3765
|
+
}, [
|
|
3766
|
+
!rows.value.length ? (openBlock(), createElementBlock("li", _hoisted_2$h, "Ничего не найдено")) : createCommentVNode("", true),
|
|
3767
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, index) => {
|
|
3768
|
+
return openBlock(), createElementBlock("li", {
|
|
3769
|
+
id: `${listId}-row-${index}`,
|
|
3770
|
+
key: row.kind === "create" ? "create" : String(row.option.value),
|
|
3771
|
+
class: normalizeClass(["tao-combobox__option", {
|
|
3772
|
+
"tao-combobox__option--active": index === activeIndex.value,
|
|
3773
|
+
"tao-combobox__option--selected": row.kind === "option" && row.option.value === __props.modelValue,
|
|
3774
|
+
"tao-combobox__option--disabled": row.kind === "option" && row.option.disabled,
|
|
3775
|
+
"tao-combobox__option--create": row.kind === "create"
|
|
3776
|
+
}]),
|
|
3777
|
+
role: "option",
|
|
3778
|
+
"aria-selected": row.kind === "option" && row.option.value === __props.modelValue,
|
|
3779
|
+
"aria-disabled": row.kind === "option" && row.option.disabled ? true : void 0,
|
|
3780
|
+
"data-tao-combobox-index": index,
|
|
3781
|
+
onMousedown: withModifiers(markPicking, ["prevent"]),
|
|
3782
|
+
onClick: ($event) => activateRow(row),
|
|
3783
|
+
onMouseenter: ($event) => !(row.kind === "option" && row.option.disabled) && (activeIndex.value = index)
|
|
3784
|
+
}, [
|
|
3785
|
+
row.kind === "create" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3786
|
+
createTextVNode("Добавить «" + toDisplayString(row.text) + "»", 1)
|
|
3787
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3788
|
+
createTextVNode(toDisplayString(row.option.label), 1)
|
|
3789
|
+
], 64))
|
|
3790
|
+
], 42, _hoisted_3$f);
|
|
3791
|
+
}), 128))
|
|
3792
|
+
], 512),
|
|
3793
|
+
selected.value ? (openBlock(), createElementBlock("button", {
|
|
3794
|
+
key: 0,
|
|
3795
|
+
type: "button",
|
|
3796
|
+
class: "tao-combobox__clear",
|
|
3797
|
+
onMousedown: withModifiers(markPicking, ["prevent"])
|
|
3798
|
+
}, " Очистить ", 32)) : createCommentVNode("", true)
|
|
3799
|
+
], 4)) : createCommentVNode("", true)
|
|
3800
|
+
]))
|
|
3801
|
+
], 2);
|
|
3802
|
+
};
|
|
3803
|
+
}
|
|
3804
|
+
});
|
|
3805
|
+
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-adeb76a4"]]);
|
|
3806
|
+
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
3807
|
+
function formatTaoDateIso(parts) {
|
|
3808
|
+
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
3809
|
+
}
|
|
3810
|
+
function parseTaoDate(value) {
|
|
3811
|
+
if (!value) {
|
|
3812
|
+
return null;
|
|
3813
|
+
}
|
|
3814
|
+
const match = ISO_DATE.exec(value);
|
|
3815
|
+
if (!match) {
|
|
3816
|
+
return null;
|
|
3817
|
+
}
|
|
3818
|
+
const y = Number(match[1]);
|
|
3819
|
+
const m = Number(match[2]);
|
|
3820
|
+
const d = Number(match[3]);
|
|
3821
|
+
const date = new Date(y, m - 1, d);
|
|
3822
|
+
if (date.getFullYear() !== y || date.getMonth() !== m - 1 || date.getDate() !== d) {
|
|
3823
|
+
return null;
|
|
3824
|
+
}
|
|
3825
|
+
return { y, m, d };
|
|
3826
|
+
}
|
|
3827
|
+
function todayTaoDate() {
|
|
3828
|
+
const now = /* @__PURE__ */ new Date();
|
|
3829
|
+
return formatTaoDateIso({ y: now.getFullYear(), m: now.getMonth() + 1, d: now.getDate() });
|
|
3830
|
+
}
|
|
3831
|
+
function shiftTaoDate(iso, days) {
|
|
3832
|
+
const parts = parseTaoDate(iso);
|
|
3833
|
+
if (!parts) {
|
|
3834
|
+
return iso;
|
|
3835
|
+
}
|
|
3836
|
+
const date = new Date(parts.y, parts.m - 1, parts.d + days);
|
|
3837
|
+
return formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() });
|
|
3838
|
+
}
|
|
3839
|
+
function shiftTaoMonth(iso, months) {
|
|
3840
|
+
const parts = parseTaoDate(iso);
|
|
3841
|
+
if (!parts) {
|
|
3842
|
+
return iso;
|
|
3843
|
+
}
|
|
3844
|
+
const date = new Date(parts.y, parts.m - 1 + months, parts.d);
|
|
3845
|
+
return formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() });
|
|
3846
|
+
}
|
|
3847
|
+
function isTaoDateInRange(iso, min, max) {
|
|
3848
|
+
if (!parseTaoDate(iso)) {
|
|
3849
|
+
return false;
|
|
3850
|
+
}
|
|
3851
|
+
if (min && parseTaoDate(min) && iso < min) {
|
|
3852
|
+
return false;
|
|
3853
|
+
}
|
|
3854
|
+
if (max && parseTaoDate(max) && iso > max) {
|
|
3855
|
+
return false;
|
|
3856
|
+
}
|
|
3857
|
+
return true;
|
|
3858
|
+
}
|
|
3859
|
+
function formatTaoDateLabel(iso, locale = "ru-RU") {
|
|
3860
|
+
const parts = parseTaoDate(iso);
|
|
3861
|
+
if (!parts) {
|
|
3862
|
+
return "";
|
|
3863
|
+
}
|
|
3864
|
+
return new Date(parts.y, parts.m - 1, parts.d).toLocaleDateString(locale, {
|
|
3865
|
+
day: "numeric",
|
|
3866
|
+
month: "long",
|
|
3867
|
+
year: "numeric"
|
|
3868
|
+
});
|
|
3869
|
+
}
|
|
3870
|
+
function sortTaoDateRange(a, b) {
|
|
3871
|
+
return a <= b ? { start: a, end: b } : { start: b, end: a };
|
|
3872
|
+
}
|
|
3873
|
+
function parseTaoDateRange(value) {
|
|
3874
|
+
if (!value) {
|
|
3875
|
+
return null;
|
|
3876
|
+
}
|
|
3877
|
+
const start = parseTaoDate(value.start);
|
|
3878
|
+
const end = parseTaoDate(value.end);
|
|
3879
|
+
if (!start || !end) {
|
|
3880
|
+
return null;
|
|
3881
|
+
}
|
|
3882
|
+
return sortTaoDateRange(formatTaoDateIso(start), formatTaoDateIso(end));
|
|
3883
|
+
}
|
|
3884
|
+
function formatTaoDateRangeLabel(start, end, locale = "ru-RU") {
|
|
3885
|
+
const fromParts = parseTaoDate(start);
|
|
3886
|
+
const toParts = parseTaoDate(end);
|
|
3887
|
+
if (!fromParts || !toParts) {
|
|
3888
|
+
return "";
|
|
3889
|
+
}
|
|
3890
|
+
if (start === end) {
|
|
3891
|
+
return formatTaoDateLabel(start, locale);
|
|
3892
|
+
}
|
|
3893
|
+
const from = new Date(fromParts.y, fromParts.m - 1, fromParts.d).toLocaleDateString(locale, {
|
|
3894
|
+
day: "numeric",
|
|
3895
|
+
month: "long",
|
|
3896
|
+
...fromParts.y === toParts.y ? {} : { year: "numeric" }
|
|
3897
|
+
});
|
|
3898
|
+
return `${from} — ${formatTaoDateLabel(end, locale)}`;
|
|
3899
|
+
}
|
|
3900
|
+
function formatTaoMonthLabel(year, month, locale = "ru-RU") {
|
|
3901
|
+
const label = new Date(year, month - 1, 1).toLocaleDateString(locale, {
|
|
3902
|
+
month: "long",
|
|
3903
|
+
year: "numeric"
|
|
3904
|
+
});
|
|
3905
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
3906
|
+
}
|
|
3907
|
+
function taoDateWeekdayIndex(iso) {
|
|
3908
|
+
const parts = parseTaoDate(iso);
|
|
3909
|
+
if (!parts) {
|
|
3910
|
+
return 0;
|
|
3911
|
+
}
|
|
3912
|
+
return (new Date(parts.y, parts.m - 1, parts.d).getDay() + 6) % 7;
|
|
3913
|
+
}
|
|
3914
|
+
function taoWeekdayLabels(locale = "ru-RU") {
|
|
3915
|
+
return Array.from({ length: 7 }, (_, index) => {
|
|
3916
|
+
const label = new Date(2026, 0, 5 + index).toLocaleDateString(locale, { weekday: "short" });
|
|
3917
|
+
return label.replace(/\.$/, "");
|
|
3918
|
+
});
|
|
3919
|
+
}
|
|
3920
|
+
function buildTaoDateGrid(year, month) {
|
|
3921
|
+
const first = new Date(year, month - 1, 1);
|
|
3922
|
+
const mondayOffset = (first.getDay() + 6) % 7;
|
|
3923
|
+
const start = new Date(year, month - 1, 1 - mondayOffset);
|
|
3924
|
+
return Array.from({ length: 42 }, (_, index) => {
|
|
3925
|
+
const date = new Date(start.getFullYear(), start.getMonth(), start.getDate() + index);
|
|
3926
|
+
return {
|
|
3927
|
+
iso: formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() }),
|
|
3928
|
+
day: date.getDate(),
|
|
3929
|
+
currentMonth: date.getMonth() === month - 1
|
|
3930
|
+
};
|
|
3931
|
+
});
|
|
3932
|
+
}
|
|
3933
|
+
const _hoisted_1$i = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
3934
|
+
const _hoisted_2$g = { class: "tao-date__value" };
|
|
3935
|
+
const _hoisted_3$e = ["aria-label"];
|
|
3936
|
+
const _hoisted_4$e = { class: "tao-date__header" };
|
|
3937
|
+
const _hoisted_5$b = { class: "tao-date__month" };
|
|
3938
|
+
const _hoisted_6$8 = {
|
|
3939
|
+
class: "tao-date__weekdays",
|
|
3940
|
+
"aria-hidden": "true"
|
|
3941
|
+
};
|
|
3942
|
+
const _hoisted_7$6 = {
|
|
3943
|
+
class: "tao-date__grid",
|
|
3944
|
+
role: "grid"
|
|
3945
|
+
};
|
|
3946
|
+
const _hoisted_8$6 = ["aria-label", "aria-selected", "disabled", "onClick"];
|
|
3947
|
+
const _hoisted_9$2 = { class: "tao-date__footer" };
|
|
3948
|
+
const _hoisted_10$1 = ["disabled"];
|
|
3949
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
3950
|
+
...{ name: "TaoDate" },
|
|
3951
|
+
__name: "TaoDate",
|
|
3952
|
+
props: {
|
|
3953
|
+
modelValue: { default: null },
|
|
3954
|
+
placeholder: { default: "Дата" },
|
|
3955
|
+
disabled: { type: Boolean, default: false },
|
|
3956
|
+
error: { type: Boolean, default: false },
|
|
3957
|
+
min: { default: void 0 },
|
|
3958
|
+
max: { default: void 0 },
|
|
3959
|
+
locale: { default: "ru-RU" }
|
|
3960
|
+
},
|
|
3961
|
+
emits: ["update:modelValue", "change"],
|
|
3962
|
+
setup(__props, { emit: __emit }) {
|
|
3963
|
+
const props = __props;
|
|
3964
|
+
const emit = __emit;
|
|
3965
|
+
const field = inject(formFieldKey, null);
|
|
3966
|
+
const localId = useId();
|
|
3967
|
+
const gridId = `${localId}-grid`;
|
|
3968
|
+
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
3969
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
3970
|
+
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3971
|
+
const open = ref(false);
|
|
3972
|
+
const viewYear = ref(2026);
|
|
3973
|
+
const viewMonth = ref(1);
|
|
3974
|
+
const cursorIso = ref(todayTaoDate());
|
|
3975
|
+
const triggerRef = ref(null);
|
|
3976
|
+
const panelRef = ref(null);
|
|
3977
|
+
const panelStyle = ref({ top: "0px", left: "0px" });
|
|
3978
|
+
const valueIso = computed(() => {
|
|
3979
|
+
const parsed = parseTaoDate(props.modelValue);
|
|
3980
|
+
return parsed ? formatTaoDateIso(parsed) : null;
|
|
3981
|
+
});
|
|
3982
|
+
const displayLabel = computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value, props.locale) : "");
|
|
3983
|
+
const weekdays = computed(() => taoWeekdayLabels(props.locale));
|
|
3984
|
+
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, props.locale));
|
|
3985
|
+
const cells = computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
3986
|
+
const todayIso = computed(() => todayTaoDate());
|
|
3987
|
+
const todayEnabled = computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
3988
|
+
function syncViewFrom(iso) {
|
|
3989
|
+
const parts = parseTaoDate(iso);
|
|
3990
|
+
if (!parts) {
|
|
3991
|
+
return;
|
|
3992
|
+
}
|
|
3993
|
+
viewYear.value = parts.y;
|
|
3994
|
+
viewMonth.value = parts.m;
|
|
3995
|
+
cursorIso.value = iso;
|
|
3996
|
+
}
|
|
3997
|
+
function updatePosition() {
|
|
3998
|
+
const trigger = triggerRef.value;
|
|
3999
|
+
const panel = panelRef.value;
|
|
4000
|
+
if (!trigger || !panel) {
|
|
4001
|
+
return;
|
|
4002
|
+
}
|
|
4003
|
+
const rect = trigger.getBoundingClientRect();
|
|
4004
|
+
const height = panel.offsetHeight;
|
|
4005
|
+
const width = panel.offsetWidth;
|
|
4006
|
+
const gap = 4;
|
|
4007
|
+
const spaceBelow = window.innerHeight - rect.bottom - gap;
|
|
4008
|
+
const openUp = spaceBelow < height && rect.top > spaceBelow;
|
|
4009
|
+
const left = Math.min(rect.left, Math.max(8, window.innerWidth - width - 8));
|
|
4010
|
+
panelStyle.value = {
|
|
4011
|
+
top: `${openUp ? rect.top - height - gap : rect.bottom + gap}px`,
|
|
4012
|
+
left: `${Math.max(8, left)}px`
|
|
4013
|
+
};
|
|
4014
|
+
}
|
|
4015
|
+
async function setOpen(next) {
|
|
4016
|
+
var _a;
|
|
4017
|
+
if (props.disabled) {
|
|
4018
|
+
return;
|
|
4019
|
+
}
|
|
4020
|
+
open.value = next;
|
|
4021
|
+
if (!next) {
|
|
4022
|
+
return;
|
|
4023
|
+
}
|
|
4024
|
+
syncViewFrom(valueIso.value ?? todayIso.value);
|
|
4025
|
+
await nextTick();
|
|
4026
|
+
updatePosition();
|
|
4027
|
+
(_a = panelRef.value) == null ? void 0 : _a.focus();
|
|
4028
|
+
}
|
|
4029
|
+
function toggle() {
|
|
4030
|
+
void setOpen(!open.value);
|
|
4031
|
+
}
|
|
4032
|
+
function close() {
|
|
4033
|
+
open.value = false;
|
|
4034
|
+
}
|
|
4035
|
+
function selectDay(iso) {
|
|
4036
|
+
var _a;
|
|
4037
|
+
if (!isTaoDateInRange(iso, props.min, props.max)) {
|
|
4038
|
+
return;
|
|
4039
|
+
}
|
|
4040
|
+
emit("update:modelValue", iso);
|
|
4041
|
+
emit("change", iso);
|
|
4042
|
+
close();
|
|
4043
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
4044
|
+
}
|
|
4045
|
+
function clear() {
|
|
4046
|
+
var _a;
|
|
4047
|
+
emit("update:modelValue", null);
|
|
4048
|
+
emit("change", null);
|
|
4049
|
+
close();
|
|
4050
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
4051
|
+
}
|
|
4052
|
+
function goMonth(delta) {
|
|
4053
|
+
const next = shiftTaoMonth(`${viewYear.value}-${String(viewMonth.value).padStart(2, "0")}-01`, delta);
|
|
4054
|
+
const parts = parseTaoDate(next);
|
|
4055
|
+
if (!parts) {
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
viewYear.value = parts.y;
|
|
4059
|
+
viewMonth.value = parts.m;
|
|
4060
|
+
cursorIso.value = shiftTaoMonth(cursorIso.value, delta);
|
|
4061
|
+
void nextTick(updatePosition);
|
|
4062
|
+
}
|
|
4063
|
+
function moveCursor(days) {
|
|
4064
|
+
cursorIso.value = shiftTaoDate(cursorIso.value, days);
|
|
4065
|
+
syncViewFrom(cursorIso.value);
|
|
4066
|
+
void nextTick(updatePosition);
|
|
4067
|
+
}
|
|
4068
|
+
function onTriggerKeydown(event) {
|
|
4069
|
+
if (props.disabled) {
|
|
4070
|
+
return;
|
|
4071
|
+
}
|
|
4072
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
|
|
4073
|
+
event.preventDefault();
|
|
4074
|
+
void setOpen(true);
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
function onPanelKeydown(event) {
|
|
4078
|
+
var _a;
|
|
4079
|
+
if (event.key === "Escape") {
|
|
4080
|
+
event.preventDefault();
|
|
4081
|
+
close();
|
|
4082
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
4083
|
+
return;
|
|
4084
|
+
}
|
|
4085
|
+
if (event.key === "ArrowLeft") {
|
|
4086
|
+
event.preventDefault();
|
|
4087
|
+
moveCursor(-1);
|
|
4088
|
+
return;
|
|
4089
|
+
}
|
|
4090
|
+
if (event.key === "ArrowRight") {
|
|
4091
|
+
event.preventDefault();
|
|
4092
|
+
moveCursor(1);
|
|
4093
|
+
return;
|
|
4094
|
+
}
|
|
4095
|
+
if (event.key === "ArrowUp") {
|
|
4096
|
+
event.preventDefault();
|
|
4097
|
+
moveCursor(-7);
|
|
4098
|
+
return;
|
|
4099
|
+
}
|
|
4100
|
+
if (event.key === "ArrowDown") {
|
|
4101
|
+
event.preventDefault();
|
|
4102
|
+
moveCursor(7);
|
|
4103
|
+
return;
|
|
4104
|
+
}
|
|
4105
|
+
if (event.key === "PageUp") {
|
|
4106
|
+
event.preventDefault();
|
|
4107
|
+
goMonth(-1);
|
|
4108
|
+
return;
|
|
4109
|
+
}
|
|
4110
|
+
if (event.key === "PageDown") {
|
|
4111
|
+
event.preventDefault();
|
|
4112
|
+
goMonth(1);
|
|
4113
|
+
return;
|
|
4114
|
+
}
|
|
4115
|
+
if (event.key === "Home") {
|
|
4116
|
+
event.preventDefault();
|
|
4117
|
+
moveCursor(-taoDateWeekdayIndex(cursorIso.value));
|
|
4118
|
+
return;
|
|
4119
|
+
}
|
|
4120
|
+
if (event.key === "End") {
|
|
4121
|
+
event.preventDefault();
|
|
4122
|
+
moveCursor(6 - taoDateWeekdayIndex(cursorIso.value));
|
|
4123
|
+
return;
|
|
4124
|
+
}
|
|
4125
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
4126
|
+
event.preventDefault();
|
|
4127
|
+
selectDay(cursorIso.value);
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
function onDocumentPointer(event) {
|
|
4131
|
+
var _a, _b;
|
|
4132
|
+
const target = event.target;
|
|
4133
|
+
if (((_a = triggerRef.value) == null ? void 0 : _a.contains(target)) || ((_b = panelRef.value) == null ? void 0 : _b.contains(target))) {
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
close();
|
|
4137
|
+
}
|
|
4138
|
+
function onViewportChange() {
|
|
4139
|
+
if (open.value) {
|
|
4140
|
+
updatePosition();
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
4143
|
+
watch(open, (isOpen) => {
|
|
4144
|
+
if (isOpen) {
|
|
4145
|
+
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4146
|
+
window.addEventListener("resize", onViewportChange);
|
|
4147
|
+
window.addEventListener("scroll", onViewportChange, true);
|
|
4148
|
+
return;
|
|
4149
|
+
}
|
|
4150
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
4151
|
+
window.removeEventListener("resize", onViewportChange);
|
|
4152
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
4153
|
+
});
|
|
4154
|
+
onBeforeUnmount(() => {
|
|
4155
|
+
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
4156
|
+
window.removeEventListener("resize", onViewportChange);
|
|
4157
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
4158
|
+
});
|
|
4159
|
+
return (_ctx, _cache) => {
|
|
4160
|
+
return openBlock(), createElementBlock("div", {
|
|
4161
|
+
class: normalizeClass(["tao-date", { "tao-date--open": open.value, "tao-date--invalid": invalid.value }])
|
|
4162
|
+
}, [
|
|
4163
|
+
createElementVNode("button", {
|
|
4164
|
+
id: controlId.value,
|
|
4165
|
+
ref_key: "triggerRef",
|
|
4166
|
+
ref: triggerRef,
|
|
4167
|
+
type: "button",
|
|
4168
|
+
class: normalizeClass(["tao-date__trigger", { "tao-date__trigger--placeholder": !valueIso.value }]),
|
|
4169
|
+
role: "combobox",
|
|
4170
|
+
"aria-expanded": open.value,
|
|
4171
|
+
"aria-haspopup": "dialog",
|
|
4172
|
+
"aria-controls": gridId,
|
|
4173
|
+
"aria-invalid": invalid.value || void 0,
|
|
4174
|
+
"aria-describedby": describedBy.value,
|
|
4175
|
+
disabled: __props.disabled,
|
|
4176
|
+
onClick: toggle,
|
|
4177
|
+
onKeydown: onTriggerKeydown
|
|
4178
|
+
}, [
|
|
4179
|
+
createElementVNode("span", _hoisted_2$g, toDisplayString(displayLabel.value || __props.placeholder), 1),
|
|
4180
|
+
_cache[4] || (_cache[4] = createElementVNode("svg", {
|
|
4181
|
+
class: "tao-date__icon",
|
|
4182
|
+
viewBox: "0 0 16 16",
|
|
4183
|
+
width: "16",
|
|
4184
|
+
height: "16",
|
|
4185
|
+
"aria-hidden": "true",
|
|
4186
|
+
focusable: "false"
|
|
4187
|
+
}, [
|
|
4188
|
+
createElementVNode("rect", {
|
|
4189
|
+
x: "2",
|
|
4190
|
+
y: "3",
|
|
4191
|
+
width: "12",
|
|
4192
|
+
height: "11",
|
|
4193
|
+
rx: "1.5",
|
|
4194
|
+
fill: "none",
|
|
4195
|
+
stroke: "currentColor",
|
|
4196
|
+
"stroke-width": "1.4"
|
|
4197
|
+
}),
|
|
4198
|
+
createElementVNode("path", {
|
|
4199
|
+
d: "M5 1.5v3M11 1.5v3M2 6.5h12",
|
|
4200
|
+
fill: "none",
|
|
4201
|
+
stroke: "currentColor",
|
|
4202
|
+
"stroke-width": "1.4",
|
|
4203
|
+
"stroke-linecap": "round"
|
|
4204
|
+
})
|
|
4205
|
+
], -1))
|
|
4206
|
+
], 42, _hoisted_1$i),
|
|
4207
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
4208
|
+
open.value ? (openBlock(), createElementBlock("div", {
|
|
4209
|
+
key: 0,
|
|
4210
|
+
id: gridId,
|
|
4211
|
+
ref_key: "panelRef",
|
|
4212
|
+
ref: panelRef,
|
|
4213
|
+
class: "tao-date__panel",
|
|
4214
|
+
role: "dialog",
|
|
4215
|
+
"aria-label": monthLabel.value,
|
|
4216
|
+
tabindex: "-1",
|
|
4217
|
+
style: normalizeStyle(panelStyle.value),
|
|
4218
|
+
onKeydown: onPanelKeydown
|
|
4219
|
+
}, [
|
|
4220
|
+
createElementVNode("div", _hoisted_4$e, [
|
|
4221
|
+
createElementVNode("button", {
|
|
4222
|
+
type: "button",
|
|
4223
|
+
class: "tao-date__nav",
|
|
4224
|
+
"aria-label": "Предыдущий месяц",
|
|
4225
|
+
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
4226
|
+
}, [..._cache[5] || (_cache[5] = [
|
|
4227
|
+
createElementVNode("svg", {
|
|
4228
|
+
viewBox: "0 0 24 24",
|
|
4229
|
+
width: "14",
|
|
4230
|
+
height: "14",
|
|
4231
|
+
"aria-hidden": "true",
|
|
4232
|
+
focusable: "false"
|
|
4233
|
+
}, [
|
|
4234
|
+
createElementVNode("path", {
|
|
4235
|
+
fill: "none",
|
|
4236
|
+
stroke: "currentColor",
|
|
4237
|
+
"stroke-width": "2.2",
|
|
4238
|
+
"stroke-linecap": "round",
|
|
4239
|
+
"stroke-linejoin": "round",
|
|
4240
|
+
d: "M14.5 5 8 12l6.5 7"
|
|
4241
|
+
})
|
|
4242
|
+
], -1)
|
|
4243
|
+
])]),
|
|
4244
|
+
createElementVNode("p", _hoisted_5$b, toDisplayString(monthLabel.value), 1),
|
|
4245
|
+
createElementVNode("button", {
|
|
4246
|
+
type: "button",
|
|
4247
|
+
class: "tao-date__nav",
|
|
4248
|
+
"aria-label": "Следующий месяц",
|
|
4249
|
+
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
4250
|
+
}, [..._cache[6] || (_cache[6] = [
|
|
4251
|
+
createElementVNode("svg", {
|
|
4252
|
+
viewBox: "0 0 24 24",
|
|
4253
|
+
width: "14",
|
|
4254
|
+
height: "14",
|
|
4255
|
+
"aria-hidden": "true",
|
|
4256
|
+
focusable: "false"
|
|
4257
|
+
}, [
|
|
4258
|
+
createElementVNode("path", {
|
|
4259
|
+
fill: "none",
|
|
4260
|
+
stroke: "currentColor",
|
|
4261
|
+
"stroke-width": "2.2",
|
|
4262
|
+
"stroke-linecap": "round",
|
|
4263
|
+
"stroke-linejoin": "round",
|
|
4264
|
+
d: "M9.5 5 16 12l-6.5 7"
|
|
4265
|
+
})
|
|
4266
|
+
], -1)
|
|
4267
|
+
])])
|
|
4268
|
+
]),
|
|
4269
|
+
createElementVNode("div", _hoisted_6$8, [
|
|
4270
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(weekdays.value, (day) => {
|
|
4271
|
+
return openBlock(), createElementBlock("span", { key: day }, toDisplayString(day), 1);
|
|
4272
|
+
}), 128))
|
|
4273
|
+
]),
|
|
4274
|
+
createElementVNode("div", _hoisted_7$6, [
|
|
4275
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cells.value, (cell) => {
|
|
4276
|
+
return openBlock(), createElementBlock("button", {
|
|
4277
|
+
key: cell.iso,
|
|
4278
|
+
type: "button",
|
|
4279
|
+
class: normalizeClass(["tao-date__day", {
|
|
4280
|
+
"tao-date__day--outside": !cell.currentMonth,
|
|
4281
|
+
"tao-date__day--today": cell.iso === todayIso.value,
|
|
4282
|
+
"tao-date__day--selected": cell.iso === valueIso.value,
|
|
4283
|
+
"tao-date__day--cursor": cell.iso === cursorIso.value,
|
|
4284
|
+
"tao-date__day--disabled": !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
4285
|
+
}]),
|
|
4286
|
+
role: "gridcell",
|
|
4287
|
+
"aria-label": unref(formatTaoDateLabel)(cell.iso, __props.locale),
|
|
4288
|
+
"aria-selected": cell.iso === valueIso.value,
|
|
4289
|
+
disabled: !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
4290
|
+
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
2877
4291
|
}, ["prevent"])),
|
|
2878
|
-
onClick: ($event) =>
|
|
2879
|
-
|
|
2880
|
-
}, toDisplayString(option.label), 43, _hoisted_4$e);
|
|
4292
|
+
onClick: ($event) => selectDay(cell.iso)
|
|
4293
|
+
}, toDisplayString(cell.day), 43, _hoisted_8$6);
|
|
2881
4294
|
}), 128))
|
|
2882
|
-
]
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
4295
|
+
]),
|
|
4296
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
4297
|
+
createElementVNode("button", {
|
|
4298
|
+
type: "button",
|
|
4299
|
+
class: "tao-date__link",
|
|
4300
|
+
disabled: !todayEnabled.value,
|
|
4301
|
+
onClick: _cache[3] || (_cache[3] = ($event) => selectDay(todayIso.value))
|
|
4302
|
+
}, " Сегодня ", 8, _hoisted_10$1),
|
|
4303
|
+
valueIso.value ? (openBlock(), createElementBlock("button", {
|
|
4304
|
+
key: 0,
|
|
4305
|
+
type: "button",
|
|
4306
|
+
class: "tao-date__link",
|
|
4307
|
+
onClick: clear
|
|
4308
|
+
}, "Очистить")) : createCommentVNode("", true)
|
|
4309
|
+
])
|
|
4310
|
+
], 44, _hoisted_3$e)) : createCommentVNode("", true)
|
|
2892
4311
|
]))
|
|
2893
4312
|
], 2);
|
|
2894
4313
|
};
|
|
2895
4314
|
}
|
|
2896
4315
|
});
|
|
2897
|
-
const
|
|
2898
|
-
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
2899
|
-
function formatTaoDateIso(parts) {
|
|
2900
|
-
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
2901
|
-
}
|
|
2902
|
-
function parseTaoDate(value) {
|
|
2903
|
-
if (!value) {
|
|
2904
|
-
return null;
|
|
2905
|
-
}
|
|
2906
|
-
const match = ISO_DATE.exec(value);
|
|
2907
|
-
if (!match) {
|
|
2908
|
-
return null;
|
|
2909
|
-
}
|
|
2910
|
-
const y = Number(match[1]);
|
|
2911
|
-
const m = Number(match[2]);
|
|
2912
|
-
const d = Number(match[3]);
|
|
2913
|
-
const date = new Date(y, m - 1, d);
|
|
2914
|
-
if (date.getFullYear() !== y || date.getMonth() !== m - 1 || date.getDate() !== d) {
|
|
2915
|
-
return null;
|
|
2916
|
-
}
|
|
2917
|
-
return { y, m, d };
|
|
2918
|
-
}
|
|
2919
|
-
function todayTaoDate() {
|
|
2920
|
-
const now = /* @__PURE__ */ new Date();
|
|
2921
|
-
return formatTaoDateIso({ y: now.getFullYear(), m: now.getMonth() + 1, d: now.getDate() });
|
|
2922
|
-
}
|
|
2923
|
-
function shiftTaoDate(iso, days) {
|
|
2924
|
-
const parts = parseTaoDate(iso);
|
|
2925
|
-
if (!parts) {
|
|
2926
|
-
return iso;
|
|
2927
|
-
}
|
|
2928
|
-
const date = new Date(parts.y, parts.m - 1, parts.d + days);
|
|
2929
|
-
return formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() });
|
|
2930
|
-
}
|
|
2931
|
-
function shiftTaoMonth(iso, months) {
|
|
2932
|
-
const parts = parseTaoDate(iso);
|
|
2933
|
-
if (!parts) {
|
|
2934
|
-
return iso;
|
|
2935
|
-
}
|
|
2936
|
-
const date = new Date(parts.y, parts.m - 1 + months, parts.d);
|
|
2937
|
-
return formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() });
|
|
2938
|
-
}
|
|
2939
|
-
function isTaoDateInRange(iso, min, max) {
|
|
2940
|
-
if (!parseTaoDate(iso)) {
|
|
2941
|
-
return false;
|
|
2942
|
-
}
|
|
2943
|
-
if (min && parseTaoDate(min) && iso < min) {
|
|
2944
|
-
return false;
|
|
2945
|
-
}
|
|
2946
|
-
if (max && parseTaoDate(max) && iso > max) {
|
|
2947
|
-
return false;
|
|
2948
|
-
}
|
|
2949
|
-
return true;
|
|
2950
|
-
}
|
|
2951
|
-
function formatTaoDateLabel(iso, locale = "ru-RU") {
|
|
2952
|
-
const parts = parseTaoDate(iso);
|
|
2953
|
-
if (!parts) {
|
|
2954
|
-
return "";
|
|
2955
|
-
}
|
|
2956
|
-
return new Date(parts.y, parts.m - 1, parts.d).toLocaleDateString(locale, {
|
|
2957
|
-
day: "numeric",
|
|
2958
|
-
month: "long",
|
|
2959
|
-
year: "numeric"
|
|
2960
|
-
});
|
|
2961
|
-
}
|
|
2962
|
-
function formatTaoMonthLabel(year, month, locale = "ru-RU") {
|
|
2963
|
-
const label = new Date(year, month - 1, 1).toLocaleDateString(locale, {
|
|
2964
|
-
month: "long",
|
|
2965
|
-
year: "numeric"
|
|
2966
|
-
});
|
|
2967
|
-
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
2968
|
-
}
|
|
2969
|
-
function taoDateWeekdayIndex(iso) {
|
|
2970
|
-
const parts = parseTaoDate(iso);
|
|
2971
|
-
if (!parts) {
|
|
2972
|
-
return 0;
|
|
2973
|
-
}
|
|
2974
|
-
return (new Date(parts.y, parts.m - 1, parts.d).getDay() + 6) % 7;
|
|
2975
|
-
}
|
|
2976
|
-
function taoWeekdayLabels(locale = "ru-RU") {
|
|
2977
|
-
return Array.from({ length: 7 }, (_, index) => {
|
|
2978
|
-
const label = new Date(2026, 0, 5 + index).toLocaleDateString(locale, { weekday: "short" });
|
|
2979
|
-
return label.replace(/\.$/, "");
|
|
2980
|
-
});
|
|
2981
|
-
}
|
|
2982
|
-
function buildTaoDateGrid(year, month) {
|
|
2983
|
-
const first = new Date(year, month - 1, 1);
|
|
2984
|
-
const mondayOffset = (first.getDay() + 6) % 7;
|
|
2985
|
-
const start = new Date(year, month - 1, 1 - mondayOffset);
|
|
2986
|
-
return Array.from({ length: 42 }, (_, index) => {
|
|
2987
|
-
const date = new Date(start.getFullYear(), start.getMonth(), start.getDate() + index);
|
|
2988
|
-
return {
|
|
2989
|
-
iso: formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() }),
|
|
2990
|
-
day: date.getDate(),
|
|
2991
|
-
currentMonth: date.getMonth() === month - 1
|
|
2992
|
-
};
|
|
2993
|
-
});
|
|
2994
|
-
}
|
|
4316
|
+
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-f4a9cddd"]]);
|
|
2995
4317
|
const _hoisted_1$h = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
2996
|
-
const _hoisted_2$f = { class: "tao-
|
|
4318
|
+
const _hoisted_2$f = { class: "tao-date-range__value" };
|
|
2997
4319
|
const _hoisted_3$d = ["aria-label"];
|
|
2998
4320
|
const _hoisted_4$d = { class: "tao-date__header" };
|
|
2999
4321
|
const _hoisted_5$a = { class: "tao-date__month" };
|
|
@@ -3001,19 +4323,15 @@ const _hoisted_6$7 = {
|
|
|
3001
4323
|
class: "tao-date__weekdays",
|
|
3002
4324
|
"aria-hidden": "true"
|
|
3003
4325
|
};
|
|
3004
|
-
const _hoisted_7$5 =
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
};
|
|
3008
|
-
const _hoisted_8$5 = ["aria-selected", "disabled", "onClick"];
|
|
3009
|
-
const _hoisted_9$1 = { class: "tao-date__footer" };
|
|
3010
|
-
const _hoisted_10$1 = ["disabled"];
|
|
4326
|
+
const _hoisted_7$5 = ["aria-label", "aria-selected", "disabled", "onMouseenter", "onClick"];
|
|
4327
|
+
const _hoisted_8$5 = { class: "tao-date__footer" };
|
|
4328
|
+
const _hoisted_9$1 = ["disabled"];
|
|
3011
4329
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
3012
|
-
...{ name: "
|
|
3013
|
-
__name: "
|
|
4330
|
+
...{ name: "TaoDateRange" },
|
|
4331
|
+
__name: "TaoDateRange",
|
|
3014
4332
|
props: {
|
|
3015
4333
|
modelValue: { default: null },
|
|
3016
|
-
placeholder: { default: "
|
|
4334
|
+
placeholder: { default: "Период" },
|
|
3017
4335
|
disabled: { type: Boolean, default: false },
|
|
3018
4336
|
error: { type: Boolean, default: false },
|
|
3019
4337
|
min: { default: void 0 },
|
|
@@ -3034,19 +4352,32 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3034
4352
|
const viewYear = ref(2026);
|
|
3035
4353
|
const viewMonth = ref(1);
|
|
3036
4354
|
const cursorIso = ref(todayTaoDate());
|
|
4355
|
+
const draftStart = ref(null);
|
|
4356
|
+
const hoverIso = ref(null);
|
|
3037
4357
|
const triggerRef = ref(null);
|
|
3038
4358
|
const panelRef = ref(null);
|
|
3039
4359
|
const panelStyle = ref({ top: "0px", left: "0px" });
|
|
3040
|
-
const
|
|
3041
|
-
|
|
3042
|
-
|
|
4360
|
+
const committed = computed(() => parseTaoDateRange(props.modelValue));
|
|
4361
|
+
const highlight = computed(() => {
|
|
4362
|
+
if (draftStart.value) {
|
|
4363
|
+
return sortTaoDateRange(draftStart.value, hoverIso.value ?? cursorIso.value ?? draftStart.value);
|
|
4364
|
+
}
|
|
4365
|
+
return committed.value;
|
|
3043
4366
|
});
|
|
3044
|
-
const displayLabel = computed(
|
|
4367
|
+
const displayLabel = computed(
|
|
4368
|
+
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end, props.locale) : ""
|
|
4369
|
+
);
|
|
3045
4370
|
const weekdays = computed(() => taoWeekdayLabels(props.locale));
|
|
3046
4371
|
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, props.locale));
|
|
3047
4372
|
const cells = computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
3048
4373
|
const todayIso = computed(() => todayTaoDate());
|
|
3049
4374
|
const todayEnabled = computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
4375
|
+
function daySelected(iso) {
|
|
4376
|
+
return Boolean(highlight.value && (iso === highlight.value.start || iso === highlight.value.end));
|
|
4377
|
+
}
|
|
4378
|
+
function dayInRange(iso) {
|
|
4379
|
+
return Boolean(highlight.value && iso > highlight.value.start && iso < highlight.value.end);
|
|
4380
|
+
}
|
|
3050
4381
|
function syncViewFrom(iso) {
|
|
3051
4382
|
const parts = parseTaoDate(iso);
|
|
3052
4383
|
if (!parts) {
|
|
@@ -3075,7 +4406,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3075
4406
|
};
|
|
3076
4407
|
}
|
|
3077
4408
|
async function setOpen(next) {
|
|
3078
|
-
var _a;
|
|
4409
|
+
var _a, _b;
|
|
3079
4410
|
if (props.disabled) {
|
|
3080
4411
|
return;
|
|
3081
4412
|
}
|
|
@@ -3083,10 +4414,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3083
4414
|
if (!next) {
|
|
3084
4415
|
return;
|
|
3085
4416
|
}
|
|
3086
|
-
|
|
4417
|
+
draftStart.value = null;
|
|
4418
|
+
hoverIso.value = null;
|
|
4419
|
+
syncViewFrom(((_a = committed.value) == null ? void 0 : _a.start) ?? todayIso.value);
|
|
3087
4420
|
await nextTick();
|
|
3088
4421
|
updatePosition();
|
|
3089
|
-
(
|
|
4422
|
+
(_b = panelRef.value) == null ? void 0 : _b.focus();
|
|
3090
4423
|
}
|
|
3091
4424
|
function toggle() {
|
|
3092
4425
|
void setOpen(!open.value);
|
|
@@ -3094,24 +4427,44 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3094
4427
|
function close() {
|
|
3095
4428
|
open.value = false;
|
|
3096
4429
|
}
|
|
3097
|
-
function
|
|
4430
|
+
function commitRange(range) {
|
|
3098
4431
|
var _a;
|
|
4432
|
+
emit("update:modelValue", range);
|
|
4433
|
+
emit("change", range);
|
|
4434
|
+
draftStart.value = null;
|
|
4435
|
+
hoverIso.value = null;
|
|
4436
|
+
close();
|
|
4437
|
+
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
4438
|
+
}
|
|
4439
|
+
function selectDay(iso) {
|
|
3099
4440
|
if (!isTaoDateInRange(iso, props.min, props.max)) {
|
|
3100
4441
|
return;
|
|
3101
4442
|
}
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
4443
|
+
if (!draftStart.value) {
|
|
4444
|
+
draftStart.value = iso;
|
|
4445
|
+
hoverIso.value = iso;
|
|
4446
|
+
cursorIso.value = iso;
|
|
4447
|
+
return;
|
|
4448
|
+
}
|
|
4449
|
+
commitRange(sortTaoDateRange(draftStart.value, iso));
|
|
4450
|
+
}
|
|
4451
|
+
function selectToday() {
|
|
4452
|
+
if (!todayEnabled.value) {
|
|
4453
|
+
return;
|
|
4454
|
+
}
|
|
4455
|
+
commitRange({ start: todayIso.value, end: todayIso.value });
|
|
3106
4456
|
}
|
|
3107
4457
|
function clear() {
|
|
3108
4458
|
var _a;
|
|
3109
4459
|
emit("update:modelValue", null);
|
|
3110
4460
|
emit("change", null);
|
|
4461
|
+
draftStart.value = null;
|
|
4462
|
+
hoverIso.value = null;
|
|
3111
4463
|
close();
|
|
3112
4464
|
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
3113
4465
|
}
|
|
3114
4466
|
function goMonth(delta) {
|
|
4467
|
+
hoverIso.value = null;
|
|
3115
4468
|
const next = shiftTaoMonth(`${viewYear.value}-${String(viewMonth.value).padStart(2, "0")}-01`, delta);
|
|
3116
4469
|
const parts = parseTaoDate(next);
|
|
3117
4470
|
if (!parts) {
|
|
@@ -3123,10 +4476,20 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3123
4476
|
void nextTick(updatePosition);
|
|
3124
4477
|
}
|
|
3125
4478
|
function moveCursor(days) {
|
|
4479
|
+
hoverIso.value = null;
|
|
3126
4480
|
cursorIso.value = shiftTaoDate(cursorIso.value, days);
|
|
3127
4481
|
syncViewFrom(cursorIso.value);
|
|
3128
4482
|
void nextTick(updatePosition);
|
|
3129
4483
|
}
|
|
4484
|
+
function onDayEnter(iso) {
|
|
4485
|
+
if (!isTaoDateInRange(iso, props.min, props.max)) {
|
|
4486
|
+
return;
|
|
4487
|
+
}
|
|
4488
|
+
hoverIso.value = iso;
|
|
4489
|
+
}
|
|
4490
|
+
function onGridLeave() {
|
|
4491
|
+
hoverIso.value = null;
|
|
4492
|
+
}
|
|
3130
4493
|
function onTriggerKeydown(event) {
|
|
3131
4494
|
if (props.disabled) {
|
|
3132
4495
|
return;
|
|
@@ -3209,6 +4572,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3209
4572
|
window.addEventListener("scroll", onViewportChange, true);
|
|
3210
4573
|
return;
|
|
3211
4574
|
}
|
|
4575
|
+
draftStart.value = null;
|
|
4576
|
+
hoverIso.value = null;
|
|
3212
4577
|
document.removeEventListener("pointerdown", onDocumentPointer);
|
|
3213
4578
|
window.removeEventListener("resize", onViewportChange);
|
|
3214
4579
|
window.removeEventListener("scroll", onViewportChange, true);
|
|
@@ -3220,14 +4585,14 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3220
4585
|
});
|
|
3221
4586
|
return (_ctx, _cache) => {
|
|
3222
4587
|
return openBlock(), createElementBlock("div", {
|
|
3223
|
-
class: normalizeClass(["tao-date", { "tao-date--open": open.value, "tao-date--invalid": invalid.value }])
|
|
4588
|
+
class: normalizeClass(["tao-date-range", { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }])
|
|
3224
4589
|
}, [
|
|
3225
4590
|
createElementVNode("button", {
|
|
3226
4591
|
id: controlId.value,
|
|
3227
4592
|
ref_key: "triggerRef",
|
|
3228
4593
|
ref: triggerRef,
|
|
3229
4594
|
type: "button",
|
|
3230
|
-
class: normalizeClass(["tao-
|
|
4595
|
+
class: normalizeClass(["tao-date-range__trigger", { "tao-date-range__trigger--placeholder": !committed.value }]),
|
|
3231
4596
|
role: "combobox",
|
|
3232
4597
|
"aria-expanded": open.value,
|
|
3233
4598
|
"aria-haspopup": "dialog",
|
|
@@ -3239,8 +4604,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3239
4604
|
onKeydown: onTriggerKeydown
|
|
3240
4605
|
}, [
|
|
3241
4606
|
createElementVNode("span", _hoisted_2$f, toDisplayString(displayLabel.value || __props.placeholder), 1),
|
|
3242
|
-
_cache[
|
|
3243
|
-
class: "tao-
|
|
4607
|
+
_cache[3] || (_cache[3] = createElementVNode("svg", {
|
|
4608
|
+
class: "tao-date-range__icon",
|
|
3244
4609
|
viewBox: "0 0 16 16",
|
|
3245
4610
|
width: "16",
|
|
3246
4611
|
height: "16",
|
|
@@ -3285,7 +4650,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3285
4650
|
class: "tao-date__nav",
|
|
3286
4651
|
"aria-label": "Предыдущий месяц",
|
|
3287
4652
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
3288
|
-
}, [..._cache[
|
|
4653
|
+
}, [..._cache[4] || (_cache[4] = [
|
|
3289
4654
|
createElementVNode("svg", {
|
|
3290
4655
|
viewBox: "0 0 24 24",
|
|
3291
4656
|
width: "14",
|
|
@@ -3309,7 +4674,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3309
4674
|
class: "tao-date__nav",
|
|
3310
4675
|
"aria-label": "Следующий месяц",
|
|
3311
4676
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
3312
|
-
}, [..._cache[
|
|
4677
|
+
}, [..._cache[5] || (_cache[5] = [
|
|
3313
4678
|
createElementVNode("svg", {
|
|
3314
4679
|
viewBox: "0 0 24 24",
|
|
3315
4680
|
width: "14",
|
|
@@ -3333,35 +4698,45 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3333
4698
|
return openBlock(), createElementBlock("span", { key: day }, toDisplayString(day), 1);
|
|
3334
4699
|
}), 128))
|
|
3335
4700
|
]),
|
|
3336
|
-
createElementVNode("div",
|
|
4701
|
+
createElementVNode("div", {
|
|
4702
|
+
class: "tao-date__grid",
|
|
4703
|
+
role: "grid",
|
|
4704
|
+
onMouseleave: onGridLeave
|
|
4705
|
+
}, [
|
|
3337
4706
|
(openBlock(true), createElementBlock(Fragment, null, renderList(cells.value, (cell) => {
|
|
4707
|
+
var _a, _b;
|
|
3338
4708
|
return openBlock(), createElementBlock("button", {
|
|
3339
4709
|
key: cell.iso,
|
|
3340
4710
|
type: "button",
|
|
3341
4711
|
class: normalizeClass(["tao-date__day", {
|
|
3342
4712
|
"tao-date__day--outside": !cell.currentMonth,
|
|
3343
4713
|
"tao-date__day--today": cell.iso === todayIso.value,
|
|
3344
|
-
"tao-date__day--selected": cell.iso
|
|
4714
|
+
"tao-date__day--selected": daySelected(cell.iso),
|
|
4715
|
+
"tao-date__day--in-range": dayInRange(cell.iso),
|
|
4716
|
+
"tao-date__day--range-start": ((_a = highlight.value) == null ? void 0 : _a.start) === cell.iso,
|
|
4717
|
+
"tao-date__day--range-end": ((_b = highlight.value) == null ? void 0 : _b.end) === cell.iso,
|
|
3345
4718
|
"tao-date__day--cursor": cell.iso === cursorIso.value,
|
|
3346
4719
|
"tao-date__day--disabled": !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
3347
4720
|
}]),
|
|
3348
4721
|
role: "gridcell",
|
|
3349
|
-
"aria-
|
|
4722
|
+
"aria-label": unref(formatTaoDateLabel)(cell.iso, __props.locale),
|
|
4723
|
+
"aria-selected": daySelected(cell.iso),
|
|
3350
4724
|
disabled: !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
3351
4725
|
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
3352
4726
|
}, ["prevent"])),
|
|
4727
|
+
onMouseenter: ($event) => onDayEnter(cell.iso),
|
|
3353
4728
|
onClick: ($event) => selectDay(cell.iso)
|
|
3354
|
-
}, toDisplayString(cell.day), 43,
|
|
4729
|
+
}, toDisplayString(cell.day), 43, _hoisted_7$5);
|
|
3355
4730
|
}), 128))
|
|
3356
|
-
]),
|
|
3357
|
-
createElementVNode("div",
|
|
4731
|
+
], 32),
|
|
4732
|
+
createElementVNode("div", _hoisted_8$5, [
|
|
3358
4733
|
createElementVNode("button", {
|
|
3359
4734
|
type: "button",
|
|
3360
4735
|
class: "tao-date__link",
|
|
3361
4736
|
disabled: !todayEnabled.value,
|
|
3362
|
-
onClick:
|
|
3363
|
-
}, " Сегодня ", 8,
|
|
3364
|
-
|
|
4737
|
+
onClick: selectToday
|
|
4738
|
+
}, " Сегодня ", 8, _hoisted_9$1),
|
|
4739
|
+
committed.value ? (openBlock(), createElementBlock("button", {
|
|
3365
4740
|
key: 0,
|
|
3366
4741
|
type: "button",
|
|
3367
4742
|
class: "tao-date__link",
|
|
@@ -3374,7 +4749,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3374
4749
|
};
|
|
3375
4750
|
}
|
|
3376
4751
|
});
|
|
3377
|
-
const
|
|
4752
|
+
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-4e222262"]]);
|
|
3378
4753
|
const _hoisted_1$g = ["for"];
|
|
3379
4754
|
const _hoisted_2$e = ["id", "checked", "disabled", "aria-checked"];
|
|
3380
4755
|
const _hoisted_3$c = {
|
|
@@ -4271,7 +5646,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
4271
5646
|
class: "tao-breadcrumb__item"
|
|
4272
5647
|
}, [
|
|
4273
5648
|
index > 0 ? (openBlock(), createElementBlock("span", _hoisted_3$4, "/")) : createCommentVNode("", true),
|
|
4274
|
-
index === __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(item.label), 1)) : item.to ? (openBlock(), createBlock(_sfc_main$
|
|
5649
|
+
index === __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(item.label), 1)) : item.to ? (openBlock(), createBlock(_sfc_main$m, {
|
|
4275
5650
|
key: 2,
|
|
4276
5651
|
class: "tao-breadcrumb__link",
|
|
4277
5652
|
to: item.to
|
|
@@ -4462,7 +5837,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4462
5837
|
function goNext() {
|
|
4463
5838
|
goTo(index.value + step.value);
|
|
4464
5839
|
}
|
|
4465
|
-
function goTo(next) {
|
|
5840
|
+
function goTo(next, instant = false) {
|
|
4466
5841
|
const el = track.value;
|
|
4467
5842
|
const { width, gap, total } = metrics();
|
|
4468
5843
|
if (!el || width <= 0 || total <= 0) {
|
|
@@ -4484,7 +5859,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4484
5859
|
}
|
|
4485
5860
|
el.scrollTo({
|
|
4486
5861
|
left: page * (width + gap),
|
|
4487
|
-
behavior: prefersReducedMotion() || dragging.value || wrapping ? "auto" : "smooth"
|
|
5862
|
+
behavior: prefersReducedMotion() || dragging.value || wrapping || instant ? "auto" : "smooth"
|
|
4488
5863
|
});
|
|
4489
5864
|
setIndex(page);
|
|
4490
5865
|
}
|
|
@@ -4542,6 +5917,35 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4542
5917
|
setIndex(nearestIndex());
|
|
4543
5918
|
});
|
|
4544
5919
|
}
|
|
5920
|
+
function releaseDragCapture() {
|
|
5921
|
+
const el = track.value;
|
|
5922
|
+
const id = dragPointer;
|
|
5923
|
+
if (!el || id === -1) {
|
|
5924
|
+
return;
|
|
5925
|
+
}
|
|
5926
|
+
if (typeof el.hasPointerCapture === "function" && !el.hasPointerCapture(id)) {
|
|
5927
|
+
return;
|
|
5928
|
+
}
|
|
5929
|
+
try {
|
|
5930
|
+
el.releasePointerCapture(id);
|
|
5931
|
+
} catch {
|
|
5932
|
+
}
|
|
5933
|
+
}
|
|
5934
|
+
function endDrag(keepClickGuard = false) {
|
|
5935
|
+
if (!dragging.value) {
|
|
5936
|
+
return;
|
|
5937
|
+
}
|
|
5938
|
+
dragging.value = false;
|
|
5939
|
+
releaseDragCapture();
|
|
5940
|
+
dragPointer = -1;
|
|
5941
|
+
if (!keepClickGuard) {
|
|
5942
|
+
dragMoved = 0;
|
|
5943
|
+
}
|
|
5944
|
+
if (track.value) {
|
|
5945
|
+
goTo(nearestIndex(), true);
|
|
5946
|
+
}
|
|
5947
|
+
syncAutoplay();
|
|
5948
|
+
}
|
|
4545
5949
|
function onPointerDown(event) {
|
|
4546
5950
|
if (event.pointerType !== "mouse" || event.button !== 0 || !track.value) {
|
|
4547
5951
|
return;
|
|
@@ -4551,7 +5955,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4551
5955
|
dragStartScroll = track.value.scrollLeft;
|
|
4552
5956
|
dragMoved = 0;
|
|
4553
5957
|
dragging.value = true;
|
|
4554
|
-
|
|
5958
|
+
try {
|
|
5959
|
+
track.value.setPointerCapture(event.pointerId);
|
|
5960
|
+
} catch {
|
|
5961
|
+
}
|
|
4555
5962
|
}
|
|
4556
5963
|
function onPointerMove(event) {
|
|
4557
5964
|
if (!dragging.value || event.pointerId !== dragPointer || !track.value) {
|
|
@@ -4561,13 +5968,25 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4561
5968
|
dragMoved = Math.abs(dx);
|
|
4562
5969
|
track.value.scrollLeft = dragStartScroll - dx;
|
|
4563
5970
|
}
|
|
4564
|
-
function
|
|
4565
|
-
if (!dragging.value
|
|
5971
|
+
function onPointerEnd(event) {
|
|
5972
|
+
if (!dragging.value) {
|
|
4566
5973
|
return;
|
|
4567
5974
|
}
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
5975
|
+
if (dragPointer !== -1 && event.pointerId !== dragPointer) {
|
|
5976
|
+
return;
|
|
5977
|
+
}
|
|
5978
|
+
endDrag(true);
|
|
5979
|
+
}
|
|
5980
|
+
function onLostPointerCapture() {
|
|
5981
|
+
endDrag();
|
|
5982
|
+
}
|
|
5983
|
+
function onWindowBlur() {
|
|
5984
|
+
endDrag();
|
|
5985
|
+
}
|
|
5986
|
+
function onVisibilityChange() {
|
|
5987
|
+
if (document.hidden) {
|
|
5988
|
+
endDrag();
|
|
5989
|
+
}
|
|
4571
5990
|
syncAutoplay();
|
|
4572
5991
|
}
|
|
4573
5992
|
function onClickCapture(event) {
|
|
@@ -4606,13 +6025,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4606
6025
|
goTo(props.modelValue);
|
|
4607
6026
|
syncAutoplay();
|
|
4608
6027
|
});
|
|
4609
|
-
document.addEventListener("visibilitychange",
|
|
6028
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
6029
|
+
window.addEventListener("blur", onWindowBlur);
|
|
6030
|
+
window.addEventListener("pagehide", onWindowBlur);
|
|
4610
6031
|
});
|
|
4611
6032
|
onUpdated(refreshCount);
|
|
4612
6033
|
onBeforeUnmount(() => {
|
|
6034
|
+
endDrag();
|
|
4613
6035
|
cancelAnimationFrame(scrollFrame);
|
|
4614
6036
|
stopAutoplay();
|
|
4615
|
-
document.removeEventListener("visibilitychange",
|
|
6037
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
6038
|
+
window.removeEventListener("blur", onWindowBlur);
|
|
6039
|
+
window.removeEventListener("pagehide", onWindowBlur);
|
|
4616
6040
|
});
|
|
4617
6041
|
return (_ctx, _cache) => {
|
|
4618
6042
|
return openBlock(), createElementBlock("div", {
|
|
@@ -4665,8 +6089,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4665
6089
|
onKeydown,
|
|
4666
6090
|
onPointerdown: onPointerDown,
|
|
4667
6091
|
onPointermove: onPointerMove,
|
|
4668
|
-
onPointerup:
|
|
4669
|
-
onPointercancel:
|
|
6092
|
+
onPointerup: onPointerEnd,
|
|
6093
|
+
onPointercancel: onPointerEnd,
|
|
6094
|
+
onLostpointercapture: onLostPointerCapture,
|
|
4670
6095
|
onClickCapture
|
|
4671
6096
|
}, [
|
|
4672
6097
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -4732,7 +6157,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4732
6157
|
};
|
|
4733
6158
|
}
|
|
4734
6159
|
});
|
|
4735
|
-
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
6160
|
+
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-81afb8b0"]]);
|
|
4736
6161
|
const _hoisted_1$3 = ["aria-label"];
|
|
4737
6162
|
const _hoisted_2$2 = ["aria-label"];
|
|
4738
6163
|
const _hoisted_3$2 = {
|
|
@@ -5869,10 +7294,12 @@ const components = [
|
|
|
5869
7294
|
TaoModal,
|
|
5870
7295
|
TaoTabs,
|
|
5871
7296
|
TaoTooltip,
|
|
7297
|
+
TaoPopover,
|
|
5872
7298
|
TaoSpoiler,
|
|
7299
|
+
TaoSpoilerGroup,
|
|
5873
7300
|
TaoCopy,
|
|
5874
7301
|
TaoContainer,
|
|
5875
|
-
_sfc_main$
|
|
7302
|
+
_sfc_main$D,
|
|
5876
7303
|
TaoSpace,
|
|
5877
7304
|
TaoIcon,
|
|
5878
7305
|
TaoLoader,
|
|
@@ -5880,6 +7307,7 @@ const components = [
|
|
|
5880
7307
|
TaoCheckbox,
|
|
5881
7308
|
TaoTag,
|
|
5882
7309
|
TaoDivider,
|
|
7310
|
+
TaoFieldset,
|
|
5883
7311
|
TaoAnimatedBorder,
|
|
5884
7312
|
TaoTextarea,
|
|
5885
7313
|
TaoScrollTop,
|
|
@@ -5888,10 +7316,12 @@ const components = [
|
|
|
5888
7316
|
TaoFileDrop,
|
|
5889
7317
|
TaoDropdownMenu,
|
|
5890
7318
|
TaoPinCode,
|
|
5891
|
-
_sfc_main$
|
|
7319
|
+
_sfc_main$m,
|
|
5892
7320
|
TaoFormField,
|
|
5893
7321
|
TaoSelect,
|
|
7322
|
+
TaoCombobox,
|
|
5894
7323
|
TaoDate,
|
|
7324
|
+
TaoDateRange,
|
|
5895
7325
|
TaoSwitch,
|
|
5896
7326
|
TaoRadio,
|
|
5897
7327
|
TaoRadioGroup,
|
|
@@ -5926,28 +7356,32 @@ export {
|
|
|
5926
7356
|
TaoCard,
|
|
5927
7357
|
TaoCarousel,
|
|
5928
7358
|
TaoCheckbox,
|
|
7359
|
+
TaoCombobox,
|
|
5929
7360
|
TaoConfirmHost,
|
|
5930
7361
|
TaoContainer,
|
|
5931
7362
|
TaoCopy,
|
|
5932
7363
|
TaoCounter,
|
|
5933
7364
|
TaoDate,
|
|
7365
|
+
TaoDateRange,
|
|
5934
7366
|
TaoDivider,
|
|
5935
7367
|
TaoDrawer,
|
|
5936
7368
|
TaoDropdownMenu,
|
|
5937
7369
|
TaoEmpty,
|
|
7370
|
+
TaoFieldset,
|
|
5938
7371
|
TaoFileDrop,
|
|
5939
|
-
_sfc_main$
|
|
7372
|
+
_sfc_main$D as TaoFlex,
|
|
5940
7373
|
TaoFormField,
|
|
5941
7374
|
TaoIcon,
|
|
5942
7375
|
TaoImage,
|
|
5943
7376
|
TaoInput,
|
|
5944
7377
|
TaoInputGroup,
|
|
5945
7378
|
TaoInputNumber,
|
|
5946
|
-
_sfc_main$
|
|
7379
|
+
_sfc_main$m as TaoLink,
|
|
5947
7380
|
TaoLoader,
|
|
5948
7381
|
TaoModal,
|
|
5949
7382
|
TaoPagination,
|
|
5950
7383
|
TaoPinCode,
|
|
7384
|
+
TaoPopover,
|
|
5951
7385
|
TaoProgress,
|
|
5952
7386
|
TaoQuantity,
|
|
5953
7387
|
TaoRadio,
|
|
@@ -5958,6 +7392,7 @@ export {
|
|
|
5958
7392
|
TaoSlider,
|
|
5959
7393
|
TaoSpace,
|
|
5960
7394
|
TaoSpoiler,
|
|
7395
|
+
TaoSpoilerGroup,
|
|
5961
7396
|
TaoStages,
|
|
5962
7397
|
TaoSwitch,
|
|
5963
7398
|
TaoTable,
|
|
@@ -5971,7 +7406,9 @@ export {
|
|
|
5971
7406
|
TaoUI as default,
|
|
5972
7407
|
formatTaoDateIso,
|
|
5973
7408
|
formatTaoDateLabel,
|
|
7409
|
+
formatTaoDateRangeLabel,
|
|
5974
7410
|
parseTaoDate,
|
|
7411
|
+
parseTaoDateRange,
|
|
5975
7412
|
toast,
|
|
5976
7413
|
todayTaoDate
|
|
5977
7414
|
};
|