@1337exp/taoui 1.1.0 → 1.1.1

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