@1337exp/taoui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1745 @@
1
+ (function(global, factory) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.TaoUI = {}, global.Vue));
3
+ })(this, function(exports2, vue) {
4
+ "use strict";
5
+ const _hoisted_1$h = ["type", "disabled"];
6
+ const _hoisted_2$f = {
7
+ key: 0,
8
+ class: "tao-button__loader"
9
+ };
10
+ const _hoisted_3$9 = {
11
+ key: 1,
12
+ class: "tao-button__icon"
13
+ };
14
+ const _hoisted_4$6 = { class: "tao-button__content" };
15
+ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
16
+ __name: "TaoButton",
17
+ props: {
18
+ type: { default: "button" },
19
+ size: { default: "medium" },
20
+ variant: { default: "primary" },
21
+ disabled: { type: Boolean, default: false },
22
+ loading: { type: Boolean, default: false },
23
+ block: { type: Boolean, default: false },
24
+ icon: { default: "" }
25
+ },
26
+ emits: ["click"],
27
+ setup(__props, { emit: __emit }) {
28
+ const props = __props;
29
+ const emit = __emit;
30
+ function handleClick(event) {
31
+ if (!props.disabled && !props.loading) {
32
+ emit("click", event);
33
+ }
34
+ }
35
+ return (_ctx, _cache) => {
36
+ return vue.openBlock(), vue.createElementBlock("button", {
37
+ class: vue.normalizeClass(["tao-button", [
38
+ `tao-button--${__props.size}`,
39
+ `tao-button--${__props.variant}`,
40
+ {
41
+ "tao-button--disabled": __props.disabled,
42
+ "tao-button--loading": __props.loading,
43
+ "tao-button--block": __props.block,
44
+ "tao-button--icon": !!__props.icon
45
+ }
46
+ ]]),
47
+ type: __props.type,
48
+ disabled: __props.disabled || __props.loading,
49
+ onClick: handleClick
50
+ }, [
51
+ __props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$f)) : vue.createCommentVNode("", true),
52
+ __props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$9, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
53
+ vue.createElementVNode("span", _hoisted_4$6, [
54
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
55
+ ])
56
+ ], 10, _hoisted_1$h);
57
+ };
58
+ }
59
+ });
60
+ const _export_sfc = (sfc, props) => {
61
+ const target = sfc.__vccOpts || sfc;
62
+ for (const [key, val] of props) {
63
+ target[key] = val;
64
+ }
65
+ return target;
66
+ };
67
+ const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-0e8431c3"]]);
68
+ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
69
+ __name: "TaoBlock",
70
+ props: {
71
+ padding: { default: 16 },
72
+ radius: { default: 8 },
73
+ shadow: { type: Boolean, default: true },
74
+ hover: { type: Boolean, default: false }
75
+ },
76
+ setup(__props) {
77
+ const props = __props;
78
+ const paddingStyle = vue.computed(() => {
79
+ if (Array.isArray(props.padding)) {
80
+ return {
81
+ padding: `${props.padding.map((p) => `${p}px`).join(" ")}`
82
+ };
83
+ }
84
+ return { padding: `${props.padding}px` };
85
+ });
86
+ const radiusStyle = vue.computed(() => ({
87
+ borderRadius: `${props.radius}px`
88
+ }));
89
+ return (_ctx, _cache) => {
90
+ return vue.openBlock(), vue.createElementBlock("div", {
91
+ class: vue.normalizeClass(["tao-block", { "tao-block--shadow": __props.shadow, "tao-block--hover": __props.hover }]),
92
+ style: vue.normalizeStyle([paddingStyle.value, radiusStyle.value])
93
+ }, [
94
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
95
+ ], 6);
96
+ };
97
+ }
98
+ });
99
+ const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-4d014dd0"]]);
100
+ const _hoisted_1$g = { class: "tao-input-wrapper" };
101
+ const _hoisted_2$e = {
102
+ key: 0,
103
+ class: "tao-input__label"
104
+ };
105
+ const _hoisted_3$8 = ["type", "value", "placeholder", "disabled"];
106
+ const _hoisted_4$5 = {
107
+ key: 1,
108
+ class: "tao-input__error"
109
+ };
110
+ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
111
+ __name: "TaoInput",
112
+ props: {
113
+ modelValue: {},
114
+ type: { default: "text" },
115
+ placeholder: { default: "" },
116
+ disabled: { type: Boolean, default: false },
117
+ error: { type: Boolean, default: false },
118
+ errorMessage: { default: "" },
119
+ label: { default: "" }
120
+ },
121
+ emits: ["update:modelValue", "blur", "focus"],
122
+ setup(__props, { emit: __emit }) {
123
+ const emit = __emit;
124
+ function handleInput(event) {
125
+ const target = event.target;
126
+ emit("update:modelValue", target.value);
127
+ }
128
+ function handleBlur(event) {
129
+ emit("blur", event);
130
+ }
131
+ function handleFocus(event) {
132
+ emit("focus", event);
133
+ }
134
+ return (_ctx, _cache) => {
135
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
136
+ __props.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_2$e, vue.toDisplayString(__props.label), 1)) : vue.createCommentVNode("", true),
137
+ vue.createElementVNode("input", {
138
+ class: vue.normalizeClass(["tao-input", { "tao-input--error": __props.error }]),
139
+ type: __props.type,
140
+ value: __props.modelValue,
141
+ placeholder: __props.placeholder,
142
+ disabled: __props.disabled,
143
+ onInput: handleInput,
144
+ onBlur: handleBlur,
145
+ onFocus: handleFocus
146
+ }, null, 42, _hoisted_3$8),
147
+ __props.error && __props.errorMessage ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$5, vue.toDisplayString(__props.errorMessage), 1)) : vue.createCommentVNode("", true)
148
+ ]);
149
+ };
150
+ }
151
+ });
152
+ const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-c742d574"]]);
153
+ const _hoisted_1$f = {
154
+ key: 0,
155
+ class: "tao-card__cover"
156
+ };
157
+ const _hoisted_2$d = {
158
+ key: 0,
159
+ class: "tao-card__header-title"
160
+ };
161
+ const _hoisted_3$7 = { key: 0 };
162
+ const _hoisted_4$4 = {
163
+ key: 2,
164
+ class: "tao-card__title-block"
165
+ };
166
+ const _hoisted_5$2 = {
167
+ key: 0,
168
+ class: "tao-card__title"
169
+ };
170
+ const _hoisted_6$1 = {
171
+ key: 1,
172
+ class: "tao-card__sub"
173
+ };
174
+ const _hoisted_7 = {
175
+ key: 3,
176
+ class: "tao-card__body"
177
+ };
178
+ const _hoisted_8 = {
179
+ key: 4,
180
+ class: "tao-card__footer"
181
+ };
182
+ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
183
+ __name: "TaoCard",
184
+ props: {
185
+ padding: { default: 20 },
186
+ radius: { default: 8 },
187
+ shadow: { type: Boolean, default: true },
188
+ shadowBottomOnly: { type: Boolean, default: false },
189
+ hover: { type: Boolean, default: false },
190
+ active: { type: Boolean, default: false },
191
+ overflow: { type: Boolean, default: false }
192
+ },
193
+ setup(__props) {
194
+ const props = __props;
195
+ const paddingStyle = vue.computed(() => {
196
+ if (Array.isArray(props.padding)) {
197
+ return { padding: `${props.padding.map((p) => `${p}px`).join(" ")}` };
198
+ }
199
+ return { padding: `${props.padding}px` };
200
+ });
201
+ const radiusStyle = vue.computed(() => ({ borderRadius: `${props.radius}px` }));
202
+ return (_ctx, _cache) => {
203
+ return vue.openBlock(), vue.createElementBlock("div", {
204
+ class: vue.normalizeClass(["tao-card", {
205
+ "tao-card--shadow": __props.shadow && !__props.shadowBottomOnly,
206
+ "tao-card--shadow-bottom": __props.shadowBottomOnly,
207
+ "tao-card--hover": __props.hover,
208
+ "tao-card--active": __props.active,
209
+ "tao-card--overflow": __props.overflow
210
+ }]),
211
+ style: vue.normalizeStyle(radiusStyle.value)
212
+ }, [
213
+ _ctx.$slots.cover ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
214
+ vue.renderSlot(_ctx.$slots, "cover", {}, void 0, true)
215
+ ])) : vue.createCommentVNode("", true),
216
+ vue.createElementVNode("div", {
217
+ class: "tao-card__content",
218
+ style: vue.normalizeStyle(paddingStyle.value)
219
+ }, [
220
+ _ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_2$d, [
221
+ vue.renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
222
+ ])) : vue.createCommentVNode("", true),
223
+ _ctx.$slots.header || _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("div", {
224
+ key: 1,
225
+ class: vue.normalizeClass(["tao-card__header", { "tao-card__header--between": _ctx.$slots.headerSecondary }])
226
+ }, [
227
+ vue.createElementVNode("span", null, [
228
+ vue.renderSlot(_ctx.$slots, "header", {}, void 0, true)
229
+ ]),
230
+ _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$7, [
231
+ vue.renderSlot(_ctx.$slots, "headerSecondary", {}, void 0, true)
232
+ ])) : vue.createCommentVNode("", true)
233
+ ], 2)) : vue.createCommentVNode("", true),
234
+ _ctx.$slots.title || _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
235
+ _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_5$2, [
236
+ vue.renderSlot(_ctx.$slots, "title", {}, void 0, true)
237
+ ])) : vue.createCommentVNode("", true),
238
+ _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
239
+ vue.renderSlot(_ctx.$slots, "sub", {}, void 0, true)
240
+ ])) : vue.createCommentVNode("", true)
241
+ ])) : vue.createCommentVNode("", true),
242
+ _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
243
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
244
+ ])) : vue.createCommentVNode("", true),
245
+ _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
246
+ vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
247
+ ])) : vue.createCommentVNode("", true)
248
+ ], 4)
249
+ ], 6);
250
+ };
251
+ }
252
+ });
253
+ const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-b752c7cb"]]);
254
+ const _hoisted_1$e = { class: "tao-modal" };
255
+ const _hoisted_2$c = {
256
+ key: 0,
257
+ class: "tao-modal__header"
258
+ };
259
+ const _hoisted_3$6 = { class: "tao-modal__title" };
260
+ const _hoisted_4$3 = { class: "tao-modal__content" };
261
+ const _hoisted_5$1 = {
262
+ key: 1,
263
+ class: "tao-modal__footer"
264
+ };
265
+ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
266
+ __name: "TaoModal",
267
+ props: {
268
+ modelValue: { type: Boolean },
269
+ title: { default: "" },
270
+ closable: { type: Boolean, default: true }
271
+ },
272
+ emits: ["update:modelValue", "close"],
273
+ setup(__props, { emit: __emit }) {
274
+ const props = __props;
275
+ const emit = __emit;
276
+ function close() {
277
+ emit("update:modelValue", false);
278
+ emit("close");
279
+ }
280
+ let previousOverflow = "";
281
+ function lockBodyScroll() {
282
+ previousOverflow = document.body.style.overflow;
283
+ document.body.style.overflow = "hidden";
284
+ }
285
+ function unlockBodyScroll() {
286
+ document.body.style.overflow = previousOverflow;
287
+ }
288
+ vue.watch(
289
+ () => props.modelValue,
290
+ (isOpen) => {
291
+ if (isOpen) {
292
+ lockBodyScroll();
293
+ } else {
294
+ unlockBodyScroll();
295
+ }
296
+ },
297
+ { immediate: true }
298
+ );
299
+ vue.onBeforeUnmount(() => {
300
+ if (props.modelValue) {
301
+ unlockBodyScroll();
302
+ }
303
+ });
304
+ return (_ctx, _cache) => {
305
+ return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
306
+ vue.createVNode(vue.Transition, { name: "tao-modal-fade" }, {
307
+ default: vue.withCtx(() => [
308
+ __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", {
309
+ key: 0,
310
+ class: "tao-modal-overlay",
311
+ onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => __props.closable && close(), ["self"]))
312
+ }, [
313
+ vue.createElementVNode("div", _hoisted_1$e, [
314
+ __props.title || _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
315
+ vue.renderSlot(_ctx.$slots, "header", {}, () => [
316
+ vue.createElementVNode("h2", _hoisted_3$6, vue.toDisplayString(__props.title), 1)
317
+ ], true),
318
+ __props.closable ? (vue.openBlock(), vue.createElementBlock("button", {
319
+ key: 0,
320
+ class: "tao-modal__close",
321
+ onClick: close
322
+ }, "×")) : vue.createCommentVNode("", true)
323
+ ])) : vue.createCommentVNode("", true),
324
+ vue.createElementVNode("div", _hoisted_4$3, [
325
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
326
+ ]),
327
+ _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [
328
+ vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
329
+ ])) : vue.createCommentVNode("", true)
330
+ ])
331
+ ])) : vue.createCommentVNode("", true)
332
+ ]),
333
+ _: 3
334
+ })
335
+ ]);
336
+ };
337
+ }
338
+ });
339
+ const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-4746b5a3"]]);
340
+ const _hoisted_1$d = { class: "tao-tabs" };
341
+ const _hoisted_2$b = { class: "tao-tabs__list" };
342
+ const _hoisted_3$5 = ["onClick"];
343
+ const _hoisted_4$2 = { key: 0 };
344
+ const _hoisted_5 = { key: 1 };
345
+ const _hoisted_6 = { class: "tao-tabs__content" };
346
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
347
+ __name: "TaoTabs",
348
+ props: {
349
+ tabs: {},
350
+ modelValue: {}
351
+ },
352
+ emits: ["update:modelValue"],
353
+ setup(__props, { emit: __emit }) {
354
+ const props = __props;
355
+ const emit = __emit;
356
+ function selectTab(key) {
357
+ const tab = props.tabs.find((t) => t.key === key);
358
+ if (tab && !tab.disabled) {
359
+ emit("update:modelValue", key);
360
+ }
361
+ }
362
+ return (_ctx, _cache) => {
363
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
364
+ vue.createElementVNode("ul", _hoisted_2$b, [
365
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.tabs, (tab) => {
366
+ return vue.openBlock(), vue.createElementBlock("li", {
367
+ key: tab.key,
368
+ class: vue.normalizeClass({ active: tab.key === __props.modelValue, disabled: tab.disabled }),
369
+ onClick: ($event) => selectTab(tab.key)
370
+ }, [
371
+ _ctx.$slots.label ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_4$2, [
372
+ vue.renderSlot(_ctx.$slots, "label", {
373
+ text: tab.label,
374
+ value: tab.key
375
+ }, void 0, true)
376
+ ])) : (vue.openBlock(), vue.createElementBlock("a", _hoisted_5, vue.toDisplayString(tab.label), 1))
377
+ ], 10, _hoisted_3$5);
378
+ }), 128))
379
+ ]),
380
+ vue.createElementVNode("div", _hoisted_6, [
381
+ vue.renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
382
+ ])
383
+ ]);
384
+ };
385
+ }
386
+ });
387
+ const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-90a6a489"]]);
388
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
389
+ __name: "TaoTooltip",
390
+ props: {
391
+ content: {},
392
+ position: { default: "top" }
393
+ },
394
+ setup(__props) {
395
+ const showTooltip = vue.ref(false);
396
+ return (_ctx, _cache) => {
397
+ return vue.openBlock(), vue.createElementBlock("div", {
398
+ class: "tao-tooltip-wrapper",
399
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => showTooltip.value = true),
400
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => showTooltip.value = false)
401
+ }, [
402
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
403
+ vue.createVNode(vue.Transition, { name: "tao-tooltip-fade" }, {
404
+ default: vue.withCtx(() => [
405
+ showTooltip.value ? (vue.openBlock(), vue.createElementBlock("div", {
406
+ key: 0,
407
+ class: vue.normalizeClass(["tao-tooltip", [`tao-tooltip--${__props.position}`]])
408
+ }, vue.toDisplayString(__props.content), 3)) : vue.createCommentVNode("", true)
409
+ ]),
410
+ _: 1
411
+ })
412
+ ], 32);
413
+ };
414
+ }
415
+ });
416
+ const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-a22f010b"]]);
417
+ const _hoisted_1$c = { class: "tao-spoiler" };
418
+ const _hoisted_2$a = {
419
+ key: 0,
420
+ class: "tao-spoiler__title"
421
+ };
422
+ const _hoisted_3$4 = {
423
+ key: 0,
424
+ class: "tao-spoiler__content"
425
+ };
426
+ const _hoisted_4$1 = { class: "tao-spoiler__content-inner" };
427
+ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
428
+ __name: "TaoSpoiler",
429
+ props: {
430
+ title: { default: "" },
431
+ defaultOpen: { type: Boolean, default: false }
432
+ },
433
+ setup(__props) {
434
+ const props = __props;
435
+ const isOpen = vue.ref(props.defaultOpen);
436
+ function toggle() {
437
+ isOpen.value = !isOpen.value;
438
+ }
439
+ function onBeforeEnter(el) {
440
+ el.style.height = "0";
441
+ }
442
+ function onEnter(el) {
443
+ const element = el;
444
+ requestAnimationFrame(() => {
445
+ element.style.height = `${element.scrollHeight}px`;
446
+ });
447
+ }
448
+ function onAfterEnter(el) {
449
+ el.style.height = "auto";
450
+ }
451
+ function onLeave(el) {
452
+ const element = el;
453
+ element.style.height = `${element.scrollHeight}px`;
454
+ requestAnimationFrame(() => {
455
+ element.style.height = "0";
456
+ });
457
+ }
458
+ return (_ctx, _cache) => {
459
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
460
+ vue.createElementVNode("button", {
461
+ class: "tao-spoiler__header",
462
+ onClick: toggle
463
+ }, [
464
+ vue.createElementVNode("span", {
465
+ class: vue.normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
466
+ }, "▶", 2),
467
+ __props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$a, [
468
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
469
+ vue.createTextVNode(vue.toDisplayString(__props.title), 1)
470
+ ], true)
471
+ ])) : vue.createCommentVNode("", true)
472
+ ]),
473
+ vue.createVNode(vue.Transition, {
474
+ name: "tao-spoiler-slide",
475
+ onBeforeEnter,
476
+ onEnter,
477
+ onAfterEnter,
478
+ onLeave
479
+ }, {
480
+ default: vue.withCtx(() => [
481
+ isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, [
482
+ vue.createElementVNode("div", _hoisted_4$1, [
483
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
484
+ ])
485
+ ])) : vue.createCommentVNode("", true)
486
+ ]),
487
+ _: 3
488
+ })
489
+ ]);
490
+ };
491
+ }
492
+ });
493
+ const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-061480fb"]]);
494
+ const _hoisted_1$b = { class: "tao-copy" };
495
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
496
+ __name: "TaoCopy",
497
+ props: {
498
+ text: {},
499
+ successMessage: { default: "Скопировано!" }
500
+ },
501
+ setup(__props) {
502
+ const props = __props;
503
+ const copied = vue.ref(false);
504
+ let timeoutId;
505
+ async function copy() {
506
+ try {
507
+ await navigator.clipboard.writeText(props.text);
508
+ copied.value = true;
509
+ clearTimeout(timeoutId);
510
+ timeoutId = setTimeout(() => {
511
+ copied.value = false;
512
+ }, 2e3);
513
+ } catch (err) {
514
+ console.error("Failed to copy:", err);
515
+ }
516
+ }
517
+ return (_ctx, _cache) => {
518
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
519
+ vue.renderSlot(_ctx.$slots, "default", {
520
+ copy,
521
+ copied: copied.value
522
+ }, () => [
523
+ vue.createElementVNode("button", {
524
+ class: vue.normalizeClass(["tao-copy__button", { "tao-copy__button--copied": copied.value }]),
525
+ onClick: copy
526
+ }, vue.toDisplayString(copied.value ? __props.successMessage : "Копировать"), 3)
527
+ ], true)
528
+ ]);
529
+ };
530
+ }
531
+ });
532
+ const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-810f1bc7"]]);
533
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
534
+ __name: "TaoContainer",
535
+ props: {
536
+ size: { default: "wide" },
537
+ free: { type: Boolean, default: false }
538
+ },
539
+ setup(__props) {
540
+ return (_ctx, _cache) => {
541
+ return vue.openBlock(), vue.createElementBlock("div", {
542
+ class: vue.normalizeClass(["tao-container", [`tao-container--${__props.size}`, { "tao-container--center": !__props.free }]])
543
+ }, [
544
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
545
+ ], 2);
546
+ };
547
+ }
548
+ });
549
+ const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-e2ebdf8f"]]);
550
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
551
+ __name: "TaoFlex",
552
+ props: {
553
+ tag: { default: "div" },
554
+ justify: { default: "flex-start" },
555
+ align: { default: "stretch" },
556
+ direction: { default: "row" },
557
+ wrap: { default: "nowrap" },
558
+ gap: { default: "0px" }
559
+ },
560
+ setup(__props) {
561
+ return (_ctx, _cache) => {
562
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.tag), {
563
+ style: vue.normalizeStyle({
564
+ display: "flex",
565
+ justifyContent: __props.justify,
566
+ alignItems: __props.align,
567
+ flexDirection: __props.direction,
568
+ flexWrap: __props.wrap,
569
+ gap: __props.gap
570
+ })
571
+ }, {
572
+ default: vue.withCtx(() => [
573
+ vue.renderSlot(_ctx.$slots, "default")
574
+ ]),
575
+ _: 3
576
+ }, 8, ["style"]);
577
+ };
578
+ }
579
+ });
580
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
581
+ __name: "TaoSpace",
582
+ props: {
583
+ block: { type: Boolean, default: false },
584
+ expand: { type: Boolean, default: false },
585
+ vertical: { type: Boolean, default: false }
586
+ },
587
+ setup(__props) {
588
+ const props = __props;
589
+ return (_ctx, _cache) => {
590
+ return vue.openBlock(), vue.createElementBlock("div", {
591
+ class: vue.normalizeClass(["tao-space", { "tao-space--vertical": props.vertical }]),
592
+ style: vue.normalizeStyle([props.block ? "display: flex; flex-wrap: initial;" : "", props.expand ? "width: 100%" : ""])
593
+ }, [
594
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
595
+ ], 6);
596
+ };
597
+ }
598
+ });
599
+ const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-4190f6ba"]]);
600
+ const _hoisted_1$a = { class: "tao-icon" };
601
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
602
+ __name: "TaoIcon",
603
+ props: {
604
+ name: {},
605
+ margin: { default: "0px" },
606
+ size: {},
607
+ invert: { type: Boolean }
608
+ },
609
+ setup(__props) {
610
+ vue.useCssVars((_ctx) => ({
611
+ "v2b130076": props.margin
612
+ }));
613
+ const props = __props;
614
+ return (_ctx, _cache) => {
615
+ return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$a, [
616
+ vue.renderSlot(_ctx.$slots, "prefix", {}, void 0, true),
617
+ vue.createElementVNode("i", {
618
+ class: vue.normalizeClass(["tao-icon__value", [`icon-${props.name}`, { "tao-icon__value--invert": props.invert }]]),
619
+ style: vue.normalizeStyle(props.size ? `font-size: ${props.size}px` : "")
620
+ }, null, 6),
621
+ vue.renderSlot(_ctx.$slots, "postfix", {}, void 0, true)
622
+ ]);
623
+ };
624
+ }
625
+ });
626
+ const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-b561364f"]]);
627
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
628
+ __name: "TaoLoader",
629
+ props: {
630
+ color: { default: "var(--tao-color-accent)" },
631
+ size: { default: 80 },
632
+ inline: { type: Boolean, default: false }
633
+ },
634
+ setup(__props) {
635
+ vue.useCssVars((_ctx) => ({
636
+ "v052ed61b": positions.value.first,
637
+ "v05f388d2": positions.value.third,
638
+ "bdfc57e2": positions.value.fourth,
639
+ "v50ec8284": positions.value.animationDistance
640
+ }));
641
+ const props = __props;
642
+ const normalizedSize = vue.computed(() => {
643
+ if (typeof props.size === "number") {
644
+ return `${props.size}px`;
645
+ }
646
+ return props.size;
647
+ });
648
+ const dotSizeNumber = vue.computed(() => {
649
+ const baseSize = typeof props.size === "number" ? props.size : parseInt(props.size, 10) || 80;
650
+ return baseSize * 0.1625;
651
+ });
652
+ const dotSize = vue.computed(() => `${dotSizeNumber.value}px`);
653
+ const positions = vue.computed(() => {
654
+ const baseSize = typeof props.size === "number" ? props.size : parseInt(props.size, 10) || 80;
655
+ return {
656
+ first: `${baseSize * 0.1}px`,
657
+ third: `${baseSize * 0.4}px`,
658
+ fourth: `${baseSize * 0.7}px`,
659
+ animationDistance: `${baseSize * 0.3}px`
660
+ };
661
+ });
662
+ return (_ctx, _cache) => {
663
+ return vue.openBlock(), vue.createElementBlock("div", {
664
+ class: vue.normalizeClass(["tao-loader", { "tao-loader--inline": props.inline }])
665
+ }, [
666
+ vue.createElementVNode("div", {
667
+ class: "tao-loader__ellipsis",
668
+ style: vue.normalizeStyle({ width: normalizedSize.value, height: dotSize.value, marginLeft: `-${dotSizeNumber.value / 2}px` })
669
+ }, [
670
+ vue.createElementVNode("div", {
671
+ style: vue.normalizeStyle({ background: props.color, width: dotSize.value, height: dotSize.value })
672
+ }, null, 4),
673
+ vue.createElementVNode("div", {
674
+ style: vue.normalizeStyle({ background: props.color, width: dotSize.value, height: dotSize.value })
675
+ }, null, 4),
676
+ vue.createElementVNode("div", {
677
+ style: vue.normalizeStyle({ background: props.color, width: dotSize.value, height: dotSize.value })
678
+ }, null, 4),
679
+ vue.createElementVNode("div", {
680
+ style: vue.normalizeStyle({ background: props.color, width: dotSize.value, height: dotSize.value })
681
+ }, null, 4)
682
+ ], 4)
683
+ ], 2);
684
+ };
685
+ }
686
+ });
687
+ const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-3a29f095"]]);
688
+ const _hoisted_1$9 = { class: "tao-image" };
689
+ const _hoisted_2$9 = ["src", "alt"];
690
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
691
+ __name: "TaoImage",
692
+ props: {
693
+ src: { default: "" },
694
+ alt: { default: "" },
695
+ pixelated: { type: Boolean, default: false }
696
+ },
697
+ emits: ["load", "error"],
698
+ setup(__props, { emit: __emit }) {
699
+ const props = __props;
700
+ const emit = __emit;
701
+ const isLoaded = vue.ref(false);
702
+ function handleLoad() {
703
+ isLoaded.value = true;
704
+ emit("load");
705
+ }
706
+ function handleError() {
707
+ isLoaded.value = false;
708
+ emit("error");
709
+ }
710
+ vue.watch(() => props.src, () => {
711
+ isLoaded.value = false;
712
+ });
713
+ return (_ctx, _cache) => {
714
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
715
+ __props.src ? (vue.openBlock(), vue.createElementBlock("img", {
716
+ key: 0,
717
+ class: vue.normalizeClass({ "tao-image__img--hidden": !isLoaded.value, "tao-image__img--pixelated": props.pixelated }),
718
+ src: __props.src,
719
+ alt: __props.alt,
720
+ draggable: "false",
721
+ onLoad: handleLoad,
722
+ onError: handleError
723
+ }, null, 42, _hoisted_2$9)) : vue.renderSlot(_ctx.$slots, "default", {}, () => [
724
+ _cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "tao-image__placeholder" }, "No image available", -1))
725
+ ], true, 1)
726
+ ]);
727
+ };
728
+ }
729
+ });
730
+ const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-8272e203"]]);
731
+ const _hoisted_1$8 = ["checked", "disabled"];
732
+ const _hoisted_2$8 = {
733
+ key: 0,
734
+ class: "tao-checkbox__label"
735
+ };
736
+ const _hoisted_3$3 = {
737
+ key: 1,
738
+ class: "tao-checkbox__label"
739
+ };
740
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
741
+ __name: "TaoCheckbox",
742
+ props: {
743
+ value: { type: Boolean, default: void 0 },
744
+ modelValue: { type: Boolean, default: void 0 },
745
+ label: { default: "" },
746
+ disabled: { type: Boolean, default: false }
747
+ },
748
+ emits: ["update:modelValue", "change"],
749
+ setup(__props, { emit: __emit }) {
750
+ const props = __props;
751
+ const emit = __emit;
752
+ const isChecked = vue.computed({
753
+ get: () => {
754
+ if (props.modelValue !== void 0) {
755
+ return props.modelValue;
756
+ }
757
+ return props.value;
758
+ },
759
+ set: (value) => {
760
+ if (props.modelValue !== void 0) {
761
+ emit("update:modelValue", value);
762
+ }
763
+ emit("change", value);
764
+ }
765
+ });
766
+ function onInputChange(event) {
767
+ if (props.disabled) {
768
+ return;
769
+ }
770
+ const target = event.target;
771
+ isChecked.value = target.checked;
772
+ }
773
+ return (_ctx, _cache) => {
774
+ return vue.openBlock(), vue.createElementBlock("label", {
775
+ class: vue.normalizeClass(["tao-checkbox", { "tao-checkbox--disabled": props.disabled }])
776
+ }, [
777
+ vue.renderSlot(_ctx.$slots, "pre", {
778
+ text: props.label
779
+ }, void 0, true),
780
+ vue.createElementVNode("input", {
781
+ class: "tao-checkbox__input",
782
+ type: "checkbox",
783
+ checked: isChecked.value,
784
+ disabled: props.disabled,
785
+ onChange: onInputChange
786
+ }, null, 40, _hoisted_1$8),
787
+ _cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
788
+ props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$8, vue.toDisplayString(props.label), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$3, [
789
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
790
+ ])),
791
+ vue.renderSlot(_ctx.$slots, "post", {
792
+ text: props.label
793
+ }, void 0, true)
794
+ ], 2);
795
+ };
796
+ }
797
+ });
798
+ const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-0ece6da0"]]);
799
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
800
+ __name: "TaoTag",
801
+ props: {
802
+ type: { default: "" },
803
+ color: {},
804
+ background: {},
805
+ borderColor: {},
806
+ pointer: { type: Boolean, default: false }
807
+ },
808
+ setup(__props) {
809
+ const props = __props;
810
+ const style = vue.computed(() => ({
811
+ color: props.color || "",
812
+ background: props.background || "",
813
+ "border-color": props.borderColor || ""
814
+ }));
815
+ return (_ctx, _cache) => {
816
+ return vue.openBlock(), vue.createElementBlock("div", {
817
+ class: vue.normalizeClass(["tao-tag", [props.pointer && "tao-tag--pointer", props.type ? `tao-tag--${props.type}` : ""]]),
818
+ style: vue.normalizeStyle(style.value)
819
+ }, [
820
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
821
+ ], 6);
822
+ };
823
+ }
824
+ });
825
+ const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f615cf3c"]]);
826
+ const _hoisted_1$7 = {
827
+ key: 1,
828
+ class: "tao-divider-text"
829
+ };
830
+ const _hoisted_2$7 = { class: "tao-divider-text__value" };
831
+ const _hoisted_3$2 = {
832
+ key: 2,
833
+ class: "tao-divider-line"
834
+ };
835
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
836
+ __name: "TaoDivider",
837
+ props: {
838
+ variant: { default: "line" },
839
+ size: { default: "medium" }
840
+ },
841
+ setup(__props) {
842
+ return (_ctx, _cache) => {
843
+ return __props.variant === "gap" ? (vue.openBlock(), vue.createElementBlock("div", {
844
+ key: 0,
845
+ class: vue.normalizeClass(["tao-divider-gap", `tao-divider-gap--${__props.size}`])
846
+ }, null, 2)) : __props.variant === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
847
+ _cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--left" }, null, -1)),
848
+ vue.createElementVNode("span", _hoisted_2$7, [
849
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
850
+ ]),
851
+ _cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "tao-divider-text__line tao-divider-text__line--right" }, null, -1))
852
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2));
853
+ };
854
+ }
855
+ });
856
+ const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-9db02640"]]);
857
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
858
+ __name: "TaoAnimatedBorder",
859
+ props: {
860
+ borderWidth: { default: 3 },
861
+ speed: { default: 6 },
862
+ glow: { default: 16 },
863
+ light: { type: Boolean, default: false }
864
+ },
865
+ setup(__props) {
866
+ return (_ctx, _cache) => {
867
+ return vue.openBlock(), vue.createElementBlock("div", {
868
+ class: vue.normalizeClass(["tao-animated-border", { "tao-animated-border--light": __props.light }]),
869
+ style: vue.normalizeStyle({
870
+ "--tao-animated-border-width": `${__props.borderWidth}px`,
871
+ "--tao-animated-border-speed": `${__props.speed}s`,
872
+ "--tao-animated-border-glow": `${__props.glow}px`
873
+ })
874
+ }, [
875
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
876
+ ], 6);
877
+ };
878
+ }
879
+ });
880
+ const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-4ca22c09"]]);
881
+ const _hoisted_1$6 = {
882
+ key: 0,
883
+ class: "tao-textarea tao-textarea--dummy"
884
+ };
885
+ const _hoisted_2$6 = ["placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value"];
886
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
887
+ __name: "TaoTextarea",
888
+ props: {
889
+ placeholder: { default: "" },
890
+ spellcheck: { type: Boolean, default: true },
891
+ autocomplete: { default: "" },
892
+ minlength: { default: 0 },
893
+ maxlength: { default: void 0 },
894
+ disabled: { type: Boolean, default: false },
895
+ noSpace: { type: Boolean, default: false },
896
+ dummy: { type: Boolean, default: false },
897
+ rows: { default: 3 },
898
+ resize: { type: Boolean, default: true },
899
+ modelValue: { default: "" },
900
+ noBorder: { type: Boolean, default: false },
901
+ noBackground: { type: Boolean, default: false },
902
+ autoFocus: { type: Boolean, default: false },
903
+ borderInverse: { type: Boolean, default: false },
904
+ textCenter: { type: Boolean, default: false },
905
+ submitOnEnter: { type: Boolean, default: false }
906
+ },
907
+ emits: ["update:modelValue", "change", "focus", "blur", "keydown"],
908
+ setup(__props, { emit: __emit }) {
909
+ const props = __props;
910
+ const emit = __emit;
911
+ const textareaRef = vue.ref(null);
912
+ function onInput(e) {
913
+ const target = e.target;
914
+ emit("update:modelValue", target.value);
915
+ autoResize();
916
+ }
917
+ function onChange(e) {
918
+ emit("change", e.target.value);
919
+ }
920
+ function onFocus(e) {
921
+ emit("focus", e);
922
+ }
923
+ function onBlur(e) {
924
+ emit("blur", e);
925
+ }
926
+ function onKeydown(event) {
927
+ var _a;
928
+ emit("keydown", event);
929
+ if (props.submitOnEnter && event.key === "Enter" && !event.shiftKey) {
930
+ (_a = textareaRef.value) == null ? void 0 : _a.blur();
931
+ event.preventDefault();
932
+ return;
933
+ }
934
+ if (props.noSpace && event.key === " ") {
935
+ event.preventDefault();
936
+ }
937
+ }
938
+ function autoResize() {
939
+ const textarea = textareaRef.value;
940
+ if (!textarea) {
941
+ return;
942
+ }
943
+ textarea.style.height = "auto";
944
+ textarea.style.height = `${Math.min(textarea.scrollHeight, 500)}px`;
945
+ }
946
+ vue.watch(() => props.modelValue, () => {
947
+ vue.nextTick(autoResize);
948
+ });
949
+ vue.onMounted(() => {
950
+ var _a;
951
+ if (props.autoFocus) {
952
+ (_a = textareaRef.value) == null ? void 0 : _a.focus();
953
+ }
954
+ vue.nextTick(autoResize);
955
+ });
956
+ return (_ctx, _cache) => {
957
+ return props.dummy ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$6, vue.toDisplayString(props.modelValue), 1)) : (vue.openBlock(), vue.createElementBlock("textarea", {
958
+ key: 1,
959
+ ref_key: "textareaRef",
960
+ ref: textareaRef,
961
+ class: vue.normalizeClass(["tao-textarea", {
962
+ "tao-textarea--inverse": props.borderInverse,
963
+ "tao-textarea--center": props.textCenter,
964
+ "tao-textarea--no-border": props.noBorder,
965
+ "tao-textarea--no-background": props.noBackground,
966
+ "tao-textarea--no-resize": !props.resize
967
+ }]),
968
+ placeholder: props.placeholder,
969
+ spellcheck: props.spellcheck,
970
+ autocomplete: props.autocomplete,
971
+ minlength: props.minlength,
972
+ maxlength: props.maxlength,
973
+ disabled: props.disabled,
974
+ rows: props.rows,
975
+ value: props.modelValue,
976
+ draggable: "false",
977
+ onInput,
978
+ onChange,
979
+ onFocus,
980
+ onBlur,
981
+ onKeydown
982
+ }, null, 42, _hoisted_2$6));
983
+ };
984
+ }
985
+ });
986
+ const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-a56ad167"]]);
987
+ const _hoisted_1$5 = ["tabindex"];
988
+ const _hoisted_2$5 = { class: "tao-scroll-top__content" };
989
+ const RIPPLE_DURATION = 750;
990
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
991
+ __name: "TaoScrollTop",
992
+ props: {
993
+ size: { default: 40 },
994
+ right: { default: 24 },
995
+ bottom: { default: 24 },
996
+ zIndex: { default: 1e3 },
997
+ boundary: { default: 300 },
998
+ hasOutline: { type: Boolean, default: true },
999
+ tabindex: { default: 0 }
1000
+ },
1001
+ setup(__props) {
1002
+ const props = __props;
1003
+ const fmtProp = (value, unit = "px") => typeof value === "number" ? value + unit : value;
1004
+ let prevPos = 0;
1005
+ let activeBack = false;
1006
+ const mainStyle = vue.reactive({
1007
+ width: fmtProp(props.size),
1008
+ height: fmtProp(props.size),
1009
+ right: fmtProp(props.right),
1010
+ bottom: fmtProp(props.bottom),
1011
+ zIndex: props.zIndex
1012
+ });
1013
+ const rippleStyle = vue.reactive({
1014
+ top: fmtProp(-1 * props.size),
1015
+ left: fmtProp(-1 * props.size),
1016
+ width: "200%",
1017
+ height: "200%"
1018
+ });
1019
+ const isActive = vue.ref(false);
1020
+ const isRippleActive = vue.ref(false);
1021
+ function getScrollValue() {
1022
+ if (typeof window.pageYOffset !== "undefined") {
1023
+ return window.pageYOffset;
1024
+ }
1025
+ if (typeof document.compatMode !== "undefined" && document.compatMode !== "BackCompat") {
1026
+ return document.documentElement.scrollTop;
1027
+ }
1028
+ return document.body.scrollTop;
1029
+ }
1030
+ function goToTop() {
1031
+ const c = getScrollValue();
1032
+ if (c > 0) {
1033
+ window.requestAnimationFrame(goToTop);
1034
+ window.scrollTo(0, c - Math.max(10, c / 8));
1035
+ }
1036
+ }
1037
+ function onScroll() {
1038
+ const pY = getScrollValue();
1039
+ const tooFar = pY > props.boundary;
1040
+ const goBack = prevPos > pY;
1041
+ if (activeBack) {
1042
+ if (!goBack && pY - prevPos > 15) {
1043
+ activeBack = false;
1044
+ }
1045
+ } else {
1046
+ activeBack = prevPos - pY >= 20;
1047
+ if (activeBack && pY - props.boundary < 150) {
1048
+ activeBack = false;
1049
+ }
1050
+ }
1051
+ prevPos = pY;
1052
+ isActive.value = tooFar && activeBack;
1053
+ }
1054
+ function onClick(e) {
1055
+ if (!isRippleActive.value) {
1056
+ const elTarget = e.currentTarget;
1057
+ if (elTarget) {
1058
+ const rect = elTarget.getBoundingClientRect();
1059
+ const top = e.clientY - rect.top;
1060
+ const left = e.clientX - rect.left;
1061
+ rippleStyle.top = fmtProp(top - props.size);
1062
+ rippleStyle.left = fmtProp(left - props.size);
1063
+ }
1064
+ isRippleActive.value = true;
1065
+ setTimeout(() => {
1066
+ isRippleActive.value = false;
1067
+ }, RIPPLE_DURATION);
1068
+ }
1069
+ goToTop();
1070
+ }
1071
+ vue.onBeforeMount(() => {
1072
+ window.addEventListener("scroll", onScroll);
1073
+ });
1074
+ vue.onBeforeUnmount(() => {
1075
+ window.removeEventListener("scroll", onScroll);
1076
+ });
1077
+ return (_ctx, _cache) => {
1078
+ return vue.openBlock(), vue.createBlock(vue.Transition, { name: "tao-scroll-top-fade" }, {
1079
+ default: vue.withCtx(() => [
1080
+ isActive.value ? (vue.openBlock(), vue.createElementBlock("button", {
1081
+ key: 0,
1082
+ style: vue.normalizeStyle(mainStyle),
1083
+ tabindex: props.tabindex,
1084
+ class: vue.normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline": !props.hasOutline }]),
1085
+ "aria-label": "Scroll to top",
1086
+ onClick: vue.withModifiers(onClick, ["prevent"])
1087
+ }, [
1088
+ vue.createElementVNode("div", _hoisted_2$5, [
1089
+ vue.createElementVNode("div", {
1090
+ class: vue.normalizeClass([{ "tao-scroll-top__ripple--active": isRippleActive.value }, "tao-scroll-top__ripple"]),
1091
+ style: vue.normalizeStyle(rippleStyle)
1092
+ }, null, 6),
1093
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
1094
+ _cache[0] || (_cache[0] = vue.createElementVNode("svg", {
1095
+ class: "tao-scroll-top__icon",
1096
+ viewBox: "0 0 24 24",
1097
+ width: "16",
1098
+ height: "16",
1099
+ fill: "currentColor"
1100
+ }, [
1101
+ vue.createElementVNode("path", { d: "M12 6l-7 7 1.4 1.4L12 8.8l5.6 5.6L19 13z" })
1102
+ ], -1))
1103
+ ], true)
1104
+ ])
1105
+ ], 14, _hoisted_1$5)) : vue.createCommentVNode("", true)
1106
+ ]),
1107
+ _: 3
1108
+ });
1109
+ };
1110
+ }
1111
+ });
1112
+ const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a6b96e61"]]);
1113
+ const _hoisted_1$4 = { class: "tao-progress" };
1114
+ const _hoisted_2$4 = {
1115
+ key: 0,
1116
+ class: "tao-progress__side"
1117
+ };
1118
+ const _hoisted_3$1 = { class: "tao-progress__side" };
1119
+ const _hoisted_4 = {
1120
+ key: 0,
1121
+ class: "tao-progress__percentage"
1122
+ };
1123
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
1124
+ __name: "TaoProgress",
1125
+ props: {
1126
+ min: { default: 200 },
1127
+ max: { default: 400 },
1128
+ progress: { default: 0 },
1129
+ height: { default: 8 },
1130
+ showPercentage: { type: Boolean, default: false },
1131
+ animated: { type: Boolean, default: true }
1132
+ },
1133
+ setup(__props) {
1134
+ return (_ctx, _cache) => {
1135
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
1136
+ vue.createElementVNode("div", {
1137
+ class: "tao-progress__container",
1138
+ style: vue.normalizeStyle({ minWidth: `${__props.min}px`, maxWidth: `${__props.max}px` })
1139
+ }, [
1140
+ _ctx.$slots.left ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [
1141
+ vue.renderSlot(_ctx.$slots, "left", {}, void 0, true)
1142
+ ])) : vue.createCommentVNode("", true),
1143
+ vue.createElementVNode("div", {
1144
+ class: "tao-progress__track",
1145
+ style: vue.normalizeStyle({ height: `${__props.height}px` })
1146
+ }, [
1147
+ vue.createElementVNode("div", {
1148
+ class: vue.normalizeClass(["tao-progress__fill", { "tao-progress__fill--animated": __props.animated }]),
1149
+ style: vue.normalizeStyle({ width: `${__props.progress}%` })
1150
+ }, null, 6)
1151
+ ], 4),
1152
+ vue.createElementVNode("div", _hoisted_3$1, [
1153
+ __props.showPercentage ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(__props.progress) + "%", 1)) : vue.createCommentVNode("", true),
1154
+ vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
1155
+ ])
1156
+ ], 4)
1157
+ ]);
1158
+ };
1159
+ }
1160
+ });
1161
+ const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-3780642d"]]);
1162
+ const _hoisted_1$3 = ["placeholder"];
1163
+ const _hoisted_2$3 = {
1164
+ key: 1,
1165
+ class: "tao-slider__value"
1166
+ };
1167
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
1168
+ __name: "TaoSlider",
1169
+ props: {
1170
+ min: { default: 0 },
1171
+ max: { default: 100 },
1172
+ step: { default: 1 },
1173
+ showValue: { type: Boolean, default: false },
1174
+ placeholder: { default: "" },
1175
+ modelValue: {}
1176
+ },
1177
+ emits: ["update:modelValue"],
1178
+ setup(__props, { emit: __emit }) {
1179
+ const props = __props;
1180
+ const emit = __emit;
1181
+ function packModelValue(value) {
1182
+ return typeof props.modelValue === "string" ? `${value}` : value;
1183
+ }
1184
+ function unpackModelValue() {
1185
+ return typeof props.modelValue === "string" ? parseFloat(props.modelValue) : props.modelValue;
1186
+ }
1187
+ const trackRef = vue.ref(null);
1188
+ const isDragging = vue.ref(false);
1189
+ const shadowInputRef = vue.ref(null);
1190
+ const shadowModel = vue.ref("0");
1191
+ const showShadowModel = vue.ref(false);
1192
+ const progressPercent = vue.computed(() => {
1193
+ const range = props.max - props.min;
1194
+ return (unpackModelValue() - props.min) / range * 100;
1195
+ });
1196
+ function clampValue(v) {
1197
+ return Math.min(Math.max(v, props.min), props.max);
1198
+ }
1199
+ function calculateValue(event) {
1200
+ if (!trackRef.value) {
1201
+ return props.min;
1202
+ }
1203
+ const rect = trackRef.value.getBoundingClientRect();
1204
+ const clientX = "touches" in event ? event.touches[0].clientX : event.clientX;
1205
+ const x = Math.min(Math.max(clientX - rect.left, 0), rect.width);
1206
+ const ratio = x / rect.width;
1207
+ const v = Math.round(props.min + ratio * (props.max - props.min));
1208
+ return clampValue(Math.round((v - props.min) / props.step) * props.step + props.min);
1209
+ }
1210
+ function handleMove(event) {
1211
+ emit("update:modelValue", packModelValue(calculateValue(event)));
1212
+ }
1213
+ function onMouseUp(event) {
1214
+ const evBtn = "touches" in event ? void 0 : event.button;
1215
+ if (typeof evBtn !== "undefined" && evBtn !== 0 || showShadowModel.value) {
1216
+ return;
1217
+ }
1218
+ isDragging.value = false;
1219
+ }
1220
+ function onMouseDown(event) {
1221
+ const evBtn = "touches" in event ? void 0 : event.button;
1222
+ if (typeof evBtn !== "undefined" && evBtn !== 0 || showShadowModel.value) {
1223
+ return;
1224
+ }
1225
+ isDragging.value = true;
1226
+ handleMove(event);
1227
+ event.preventDefault();
1228
+ }
1229
+ function onMouseMove(event) {
1230
+ if (!isDragging.value) {
1231
+ return;
1232
+ }
1233
+ handleMove(event);
1234
+ }
1235
+ function onBlurShadowModel() {
1236
+ if (shadowModel.value) {
1237
+ const newValue = packModelValue(clampValue(parseFloat(shadowModel.value) || 0));
1238
+ shadowModel.value = `${newValue}`;
1239
+ emit("update:modelValue", newValue);
1240
+ }
1241
+ showShadowModel.value = false;
1242
+ }
1243
+ function onShadowKeydown(event) {
1244
+ var _a;
1245
+ if (event.key === "Enter") {
1246
+ (_a = shadowInputRef.value) == null ? void 0 : _a.blur();
1247
+ }
1248
+ }
1249
+ function onContextMenu() {
1250
+ if (props.showValue) {
1251
+ shadowModel.value = `${props.modelValue}`;
1252
+ showShadowModel.value = true;
1253
+ requestAnimationFrame(() => {
1254
+ var _a;
1255
+ return (_a = shadowInputRef.value) == null ? void 0 : _a.focus();
1256
+ });
1257
+ }
1258
+ }
1259
+ vue.onMounted(() => {
1260
+ window.addEventListener("mouseleave", onMouseUp);
1261
+ window.addEventListener("mouseup", onMouseUp);
1262
+ window.addEventListener("mousemove", onMouseMove);
1263
+ window.addEventListener("touchend", onMouseUp);
1264
+ window.addEventListener("touchmove", onMouseMove);
1265
+ });
1266
+ vue.onBeforeUnmount(() => {
1267
+ window.removeEventListener("mouseleave", onMouseUp);
1268
+ window.removeEventListener("mouseup", onMouseUp);
1269
+ window.removeEventListener("mousemove", onMouseMove);
1270
+ window.removeEventListener("touchend", onMouseUp);
1271
+ window.removeEventListener("touchmove", onMouseMove);
1272
+ });
1273
+ return (_ctx, _cache) => {
1274
+ return vue.openBlock(), vue.createElementBlock("div", {
1275
+ ref_key: "trackRef",
1276
+ ref: trackRef,
1277
+ class: vue.normalizeClass(["tao-slider", { "tao-slider--show-value": __props.showValue }]),
1278
+ onContextmenu: vue.withModifiers(onContextMenu, ["prevent"]),
1279
+ onMousedown: onMouseDown,
1280
+ onTouchstart: onMouseDown
1281
+ }, [
1282
+ _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
1283
+ vue.createElementVNode("div", {
1284
+ class: "tao-slider__fill",
1285
+ style: vue.normalizeStyle({ width: `${progressPercent.value}%` })
1286
+ }, null, 4),
1287
+ vue.createElementVNode("div", {
1288
+ class: "tao-slider__thumb",
1289
+ style: vue.normalizeStyle({ left: `${progressPercent.value}%` })
1290
+ }, null, 4),
1291
+ showShadowModel.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
1292
+ key: 0,
1293
+ ref_key: "shadowInputRef",
1294
+ ref: shadowInputRef,
1295
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => shadowModel.value = $event),
1296
+ type: "number",
1297
+ inputmode: "numeric",
1298
+ placeholder: __props.placeholder,
1299
+ class: "tao-slider__shadow-input",
1300
+ onBlur: onBlurShadowModel,
1301
+ onKeydown: onShadowKeydown,
1302
+ onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(() => {
1303
+ }, ["stop"]))
1304
+ }, null, 40, _hoisted_1$3)), [
1305
+ [vue.vModelText, shadowModel.value]
1306
+ ]) : __props.showValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
1307
+ vue.renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
1308
+ vue.createTextVNode(vue.toDisplayString(__props.modelValue), 1),
1309
+ vue.renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
1310
+ ])) : vue.createCommentVNode("", true)
1311
+ ], 34);
1312
+ };
1313
+ }
1314
+ });
1315
+ const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-9f531a81"]]);
1316
+ const _hoisted_1$2 = { class: "tao-file-drop" };
1317
+ const _hoisted_2$2 = ["accept", "multiple"];
1318
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
1319
+ __name: "TaoFileDrop",
1320
+ props: {
1321
+ modelValue: { default: () => [] },
1322
+ size: { default: "medium" },
1323
+ accept: { default: "*" },
1324
+ multiple: { type: Boolean, default: false },
1325
+ showClear: { type: Boolean, default: false }
1326
+ },
1327
+ emits: ["update:modelValue", "files", "clear-request"],
1328
+ setup(__props, { emit: __emit }) {
1329
+ const props = __props;
1330
+ const emit = __emit;
1331
+ const isDragging = vue.ref(false);
1332
+ const fileInput = vue.ref(null);
1333
+ function handleDragOver(event) {
1334
+ event.preventDefault();
1335
+ isDragging.value = true;
1336
+ }
1337
+ function handleDragLeave() {
1338
+ isDragging.value = false;
1339
+ }
1340
+ function handleDrop(event) {
1341
+ var _a;
1342
+ event.preventDefault();
1343
+ isDragging.value = false;
1344
+ const files = (_a = event.dataTransfer) == null ? void 0 : _a.files;
1345
+ if (files && files.length > 0) {
1346
+ processFiles(files);
1347
+ }
1348
+ }
1349
+ function handleFileSelect(event) {
1350
+ const input = event.target;
1351
+ if (input.files && input.files.length > 0) {
1352
+ processFiles(input.files);
1353
+ }
1354
+ }
1355
+ function requestClear() {
1356
+ emit("clear-request");
1357
+ }
1358
+ function triggerFileInput() {
1359
+ var _a;
1360
+ (_a = fileInput.value) == null ? void 0 : _a.click();
1361
+ }
1362
+ function processFiles(fileList) {
1363
+ const files = Array.from(fileList);
1364
+ const result = !props.multiple && files.length > 1 ? [files[0]] : files;
1365
+ emit("update:modelValue", result);
1366
+ emit("files", result);
1367
+ const el = fileInput.value;
1368
+ if (el) {
1369
+ el.type = "text";
1370
+ el.type = "file";
1371
+ }
1372
+ }
1373
+ return (_ctx, _cache) => {
1374
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
1375
+ __props.showClear && __props.modelValue.length ? (vue.openBlock(), vue.createElementBlock("button", {
1376
+ key: 0,
1377
+ type: "button",
1378
+ class: "tao-file-drop__clear",
1379
+ onClick: requestClear
1380
+ }, " ✕ ")) : vue.createCommentVNode("", true),
1381
+ vue.createElementVNode("div", {
1382
+ class: vue.normalizeClass(["tao-file-drop__zone", [`tao-file-drop__zone--${__props.size}`, { "tao-file-drop__zone--dragging": isDragging.value }]]),
1383
+ onDragover: handleDragOver,
1384
+ onDragleave: handleDragLeave,
1385
+ onDrop: handleDrop,
1386
+ onClick: triggerFileInput
1387
+ }, [
1388
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
1389
+ _cache[0] || (_cache[0] = vue.createTextVNode("Drag & drop your file(s) here or click to select", -1))
1390
+ ], true),
1391
+ vue.createElementVNode("input", {
1392
+ ref_key: "fileInput",
1393
+ ref: fileInput,
1394
+ type: "file",
1395
+ hidden: "",
1396
+ accept: __props.accept,
1397
+ multiple: __props.multiple,
1398
+ onChange: handleFileSelect
1399
+ }, null, 40, _hoisted_2$2)
1400
+ ], 34)
1401
+ ]);
1402
+ };
1403
+ }
1404
+ });
1405
+ const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-db5ffca4"]]);
1406
+ const _hoisted_1$1 = { key: 1 };
1407
+ const _hoisted_2$1 = ["onClick"];
1408
+ const _hoisted_3 = { key: 1 };
1409
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1410
+ __name: "TaoDropdownMenu",
1411
+ props: {
1412
+ actions: { default: () => [] }
1413
+ },
1414
+ emits: ["selected"],
1415
+ setup(__props, { emit: __emit }) {
1416
+ const emit = __emit;
1417
+ let animationFrameId = 0;
1418
+ const menuRef = vue.ref(null);
1419
+ const listRef = vue.ref(null);
1420
+ const isOpen = vue.ref(false);
1421
+ const listPosition = vue.reactive({ top: "0", left: "0" });
1422
+ function updatePosition() {
1423
+ const elMenu = menuRef.value;
1424
+ const elList = listRef.value;
1425
+ if (elMenu && elList && isOpen.value) {
1426
+ const rect = elMenu.getBoundingClientRect();
1427
+ const rectList = elList.getBoundingClientRect();
1428
+ let px = rect.right;
1429
+ let py = rect.top;
1430
+ if (px + rectList.width > window.innerWidth) {
1431
+ px = rect.left - rectList.width;
1432
+ }
1433
+ if (py + rectList.height > window.innerHeight) {
1434
+ py = rect.bottom - rectList.height;
1435
+ }
1436
+ listPosition.top = `${py + window.scrollY}px`;
1437
+ listPosition.left = `${px}px`;
1438
+ }
1439
+ }
1440
+ function toggleMenu() {
1441
+ isOpen.value = !isOpen.value;
1442
+ if (isOpen.value) {
1443
+ animationFrameId = requestAnimationFrame(function render() {
1444
+ updatePosition();
1445
+ animationFrameId = requestAnimationFrame(render);
1446
+ });
1447
+ } else {
1448
+ cancelAnimationFrame(animationFrameId);
1449
+ }
1450
+ }
1451
+ function closeMenu(event) {
1452
+ if (menuRef.value && !menuRef.value.contains(event.target)) {
1453
+ isOpen.value = false;
1454
+ }
1455
+ }
1456
+ function emitAction(id) {
1457
+ isOpen.value = false;
1458
+ emit("selected", id);
1459
+ }
1460
+ function onWinScroll() {
1461
+ isOpen.value = false;
1462
+ }
1463
+ vue.onMounted(() => {
1464
+ document.addEventListener("click", closeMenu);
1465
+ window.addEventListener("scroll", onWinScroll);
1466
+ });
1467
+ vue.onUnmounted(() => {
1468
+ document.removeEventListener("click", closeMenu);
1469
+ window.removeEventListener("scroll", onWinScroll);
1470
+ cancelAnimationFrame(animationFrameId);
1471
+ });
1472
+ return (_ctx, _cache) => {
1473
+ return vue.openBlock(), vue.createElementBlock("div", {
1474
+ ref_key: "menuRef",
1475
+ ref: menuRef,
1476
+ class: "tao-dropdown-menu"
1477
+ }, [
1478
+ vue.createElementVNode("div", {
1479
+ class: "tao-dropdown-menu__button",
1480
+ onClick: toggleMenu
1481
+ }, [
1482
+ _ctx.$slots.button ? vue.renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, "⋮"))
1483
+ ]),
1484
+ (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
1485
+ isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
1486
+ key: 0,
1487
+ ref_key: "listRef",
1488
+ ref: listRef,
1489
+ class: "tao-dropdown-menu__list",
1490
+ style: vue.normalizeStyle(listPosition)
1491
+ }, [
1492
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, (action) => {
1493
+ return vue.openBlock(), vue.createElementBlock("div", {
1494
+ key: action.id,
1495
+ class: "tao-dropdown-menu__item",
1496
+ onClick: ($event) => emitAction(action.id)
1497
+ }, [
1498
+ _ctx.$slots.item ? vue.renderSlot(_ctx.$slots, "item", {
1499
+ id: action.id,
1500
+ ico: action.ico,
1501
+ text: action.name
1502
+ }, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3, vue.toDisplayString(action.name), 1))
1503
+ ], 8, _hoisted_2$1);
1504
+ }), 128))
1505
+ ], 4)) : vue.createCommentVNode("", true)
1506
+ ]))
1507
+ ], 512);
1508
+ };
1509
+ }
1510
+ });
1511
+ const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d54be7aa"]]);
1512
+ const _hoisted_1 = { class: "tao-pin-code" };
1513
+ const _hoisted_2 = ["value", "placeholder", "type", "inputmode", "pattern", "onInput", "onKeydown", "onFocus"];
1514
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
1515
+ __name: "TaoPinCode",
1516
+ props: {
1517
+ length: {},
1518
+ hidden: { type: Boolean, default: false },
1519
+ placeholder: { default: "" },
1520
+ modelValue: {},
1521
+ numbersOnly: { type: Boolean, default: false }
1522
+ },
1523
+ emits: ["update:modelValue", "change", "active", "blur"],
1524
+ setup(__props, { emit: __emit }) {
1525
+ const props = __props;
1526
+ const emit = __emit;
1527
+ let lastPinCode = NaN;
1528
+ const numbers = vue.ref([]);
1529
+ const inputRefs = vue.ref([]);
1530
+ const activeNumber = vue.ref(-1);
1531
+ function emitChange() {
1532
+ const s = numbers.value.map((e) => e ? e : "0").join("");
1533
+ const curPinCode = parseFloat(s);
1534
+ if (lastPinCode !== curPinCode) {
1535
+ lastPinCode = curPinCode;
1536
+ emit("change", curPinCode);
1537
+ }
1538
+ emit("update:modelValue", s);
1539
+ }
1540
+ function emitBlur() {
1541
+ activeNumber.value = -1;
1542
+ emit("blur");
1543
+ }
1544
+ function init() {
1545
+ numbers.value = [...Array(props.length)].map(() => "");
1546
+ inputRefs.value = [];
1547
+ activeNumber.value = -1;
1548
+ }
1549
+ function mutation(v, index) {
1550
+ var _a, _b;
1551
+ numbers.value = [...numbers.value];
1552
+ if (v.length > 1) {
1553
+ v = v[v.length - 1] ?? "";
1554
+ }
1555
+ if (props.numbersOnly && v && !/^[0-9]$/.test(v)) {
1556
+ numbers.value[index] = numbers.value[index] ?? "";
1557
+ return;
1558
+ }
1559
+ numbers.value[index] = v;
1560
+ const getNextIdx = () => {
1561
+ if (numbers.value.length >= index + 1) {
1562
+ return numbers.value.findIndex((e) => e === "");
1563
+ }
1564
+ return index + 1;
1565
+ };
1566
+ const nextIndex = getNextIdx();
1567
+ if (nextIndex !== -1 && !numbers.value[nextIndex]) {
1568
+ const el = inputRefs.value[nextIndex];
1569
+ if (el) {
1570
+ el.focus();
1571
+ } else {
1572
+ (_a = inputRefs.value[index]) == null ? void 0 : _a.blur();
1573
+ emitBlur();
1574
+ }
1575
+ } else {
1576
+ (_b = inputRefs.value[index]) == null ? void 0 : _b.blur();
1577
+ emitBlur();
1578
+ }
1579
+ emitChange();
1580
+ }
1581
+ function onFocus(index) {
1582
+ numbers.value = [...numbers.value];
1583
+ numbers.value[index] = "";
1584
+ activeNumber.value = index;
1585
+ emitChange();
1586
+ emit("active", inputRefs.value[index], index);
1587
+ }
1588
+ function onChange(e, index) {
1589
+ const v = e.target.value;
1590
+ mutation(v, index);
1591
+ }
1592
+ function onKeydown(event, index) {
1593
+ if (event.key !== "Backspace") {
1594
+ return;
1595
+ }
1596
+ if (!numbers.value[index] && index > 0) {
1597
+ event.preventDefault();
1598
+ numbers.value = [...numbers.value];
1599
+ numbers.value[index - 1] = "";
1600
+ const prevEl = inputRefs.value[index - 1];
1601
+ prevEl == null ? void 0 : prevEl.focus();
1602
+ activeNumber.value = index - 1;
1603
+ emitChange();
1604
+ }
1605
+ }
1606
+ vue.watch(() => props.modelValue, (v) => {
1607
+ if (!v.length) {
1608
+ init();
1609
+ emitChange();
1610
+ }
1611
+ });
1612
+ init();
1613
+ return (_ctx, _cache) => {
1614
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
1615
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(numbers.value, (num, index) => {
1616
+ return vue.openBlock(), vue.createElementBlock("input", {
1617
+ key: index,
1618
+ ref_for: true,
1619
+ ref: (el) => inputRefs.value[index] = el,
1620
+ class: vue.normalizeClass(["tao-pin-code__value", { "tao-pin-code__value--active": activeNumber.value === index }]),
1621
+ value: num,
1622
+ placeholder: __props.placeholder,
1623
+ type: __props.hidden ? "password" : "text",
1624
+ inputmode: __props.numbersOnly ? "numeric" : "text",
1625
+ pattern: __props.numbersOnly ? "[0-9]" : void 0,
1626
+ maxlength: "1",
1627
+ onInput: ($event) => onChange($event, index),
1628
+ onKeydown: ($event) => onKeydown($event, index),
1629
+ onFocus: ($event) => onFocus(index)
1630
+ }, null, 42, _hoisted_2);
1631
+ }), 128))
1632
+ ]);
1633
+ };
1634
+ }
1635
+ });
1636
+ const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b8c7bf2c"]]);
1637
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1638
+ __name: "TaoLink",
1639
+ props: {
1640
+ to: { default: void 0 },
1641
+ asNewTab: { type: Boolean, default: false },
1642
+ private: { type: Boolean, default: false },
1643
+ exactPath: { type: Boolean, default: false }
1644
+ },
1645
+ setup(__props) {
1646
+ const props = __props;
1647
+ const linkComponent = vue.computed(() => {
1648
+ const resolved = vue.resolveComponent("NuxtLink");
1649
+ return typeof resolved === "string" ? "a" : resolved;
1650
+ });
1651
+ const linkProps = vue.computed(() => {
1652
+ const target = props.asNewTab ? "_blank" : void 0;
1653
+ const rel = props.private && "noopener noreferrer" || props.asNewTab && "noopener" || void 0;
1654
+ if (linkComponent.value === "a") {
1655
+ return {
1656
+ href: typeof props.to === "string" ? props.to : void 0,
1657
+ target,
1658
+ rel
1659
+ };
1660
+ }
1661
+ return {
1662
+ to: props.to,
1663
+ target,
1664
+ rel,
1665
+ exactPath: props.exactPath
1666
+ };
1667
+ });
1668
+ return (_ctx, _cache) => {
1669
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(linkComponent.value), vue.mergeProps(linkProps.value, { draggable: "false" }), {
1670
+ default: vue.withCtx(() => [
1671
+ vue.renderSlot(_ctx.$slots, "default")
1672
+ ]),
1673
+ _: 3
1674
+ }, 16);
1675
+ };
1676
+ }
1677
+ });
1678
+ const components = [
1679
+ TaoButton,
1680
+ TaoBlock,
1681
+ TaoInput,
1682
+ TaoCard,
1683
+ TaoModal,
1684
+ TaoTabs,
1685
+ TaoTooltip,
1686
+ TaoSpoiler,
1687
+ TaoCopy,
1688
+ TaoContainer,
1689
+ _sfc_main$g,
1690
+ TaoSpace,
1691
+ TaoIcon,
1692
+ TaoLoader,
1693
+ TaoImage,
1694
+ TaoCheckbox,
1695
+ TaoTag,
1696
+ TaoDivider,
1697
+ TaoAnimatedBorder,
1698
+ TaoTextarea,
1699
+ TaoScrollTop,
1700
+ TaoProgress,
1701
+ TaoSlider,
1702
+ TaoFileDrop,
1703
+ TaoDropdownMenu,
1704
+ TaoPinCode,
1705
+ _sfc_main
1706
+ ];
1707
+ const TaoUI = {
1708
+ install(app) {
1709
+ components.forEach((component) => {
1710
+ app.component(component.name, component);
1711
+ });
1712
+ }
1713
+ };
1714
+ exports2.TaoAnimatedBorder = TaoAnimatedBorder;
1715
+ exports2.TaoBlock = TaoBlock;
1716
+ exports2.TaoButton = TaoButton;
1717
+ exports2.TaoCard = TaoCard;
1718
+ exports2.TaoCheckbox = TaoCheckbox;
1719
+ exports2.TaoContainer = TaoContainer;
1720
+ exports2.TaoCopy = TaoCopy;
1721
+ exports2.TaoDivider = TaoDivider;
1722
+ exports2.TaoDropdownMenu = TaoDropdownMenu;
1723
+ exports2.TaoFileDrop = TaoFileDrop;
1724
+ exports2.TaoFlex = _sfc_main$g;
1725
+ exports2.TaoIcon = TaoIcon;
1726
+ exports2.TaoImage = TaoImage;
1727
+ exports2.TaoInput = TaoInput;
1728
+ exports2.TaoLink = _sfc_main;
1729
+ exports2.TaoLoader = TaoLoader;
1730
+ exports2.TaoModal = TaoModal;
1731
+ exports2.TaoPinCode = TaoPinCode;
1732
+ exports2.TaoProgress = TaoProgress;
1733
+ exports2.TaoScrollTop = TaoScrollTop;
1734
+ exports2.TaoSlider = TaoSlider;
1735
+ exports2.TaoSpace = TaoSpace;
1736
+ exports2.TaoSpoiler = TaoSpoiler;
1737
+ exports2.TaoTabs = TaoTabs;
1738
+ exports2.TaoTag = TaoTag;
1739
+ exports2.TaoTextarea = TaoTextarea;
1740
+ exports2.TaoTooltip = TaoTooltip;
1741
+ exports2.TaoUI = TaoUI;
1742
+ exports2.default = TaoUI;
1743
+ Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
1744
+ });
1745
+ //# sourceMappingURL=index.cjs.map