@1337exp/taoui 2.1.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, getCurrentInstance, camelize, inject, useId, ref, shallowRef, watch, createTextVNode, useSlots, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, nextTick, Fragment, renderList, onMounted, provide, resolveDynamicComponent, withModifiers, useCssVars, reactive, onBeforeMount, withDirectives, vModelText, mergeProps, TransitionGroup, onUpdated, createApp } from "vue";
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, getCurrentInstance, camelize, inject, useId, ref, shallowRef, watch, createTextVNode, useSlots, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, nextTick, Fragment, renderList, onMounted, mergeProps, createSlots, normalizeProps, guardReactiveProps, provide, resolveDynamicComponent, withModifiers, useCssVars, reactive, onBeforeMount, withKeys, TransitionGroup, onUpdated, createApp } from "vue";
2
2
  const sizes = ["small", "medium", "large"];
3
3
  function sizeClass(size) {
4
4
  return size ? `tao-size-${size}` : void 0;
@@ -13,17 +13,17 @@ function resolveSize(el, size) {
13
13
  const value = getComputedStyle(el).getPropertyValue("--tao-size").trim();
14
14
  return sizes.includes(value) ? value : "medium";
15
15
  }
16
- const _hoisted_1$P = ["type", "disabled"];
17
- const _hoisted_2$I = {
16
+ const _hoisted_1$S = ["type", "disabled"];
17
+ const _hoisted_2$L = {
18
18
  key: 0,
19
19
  class: "tao-button__loader"
20
20
  };
21
- const _hoisted_3$z = {
21
+ const _hoisted_3$C = {
22
22
  key: 1,
23
23
  class: "tao-button__icon"
24
24
  };
25
- const _hoisted_4$u = { class: "tao-button__content" };
26
- const _sfc_main$Z = /* @__PURE__ */ defineComponent({
25
+ const _hoisted_4$w = { class: "tao-button__content" };
26
+ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
27
27
  ...{ name: "TaoButton" },
28
28
  __name: "TaoButton",
29
29
  props: {
@@ -62,12 +62,12 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
62
62
  disabled: __props.disabled || __props.loading,
63
63
  onClick: handleClick
64
64
  }, [
65
- __props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$I)) : createCommentVNode("", true),
66
- __props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$z, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
67
- createElementVNode("span", _hoisted_4$u, [
65
+ __props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$L)) : createCommentVNode("", true),
66
+ __props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$C, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
67
+ createElementVNode("span", _hoisted_4$w, [
68
68
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
69
69
  ])
70
- ], 10, _hoisted_1$P);
70
+ ], 10, _hoisted_1$S);
71
71
  };
72
72
  }
73
73
  });
@@ -78,7 +78,7 @@ const _export_sfc = (sfc, props) => {
78
78
  }
79
79
  return target;
80
80
  };
81
- const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-eb25f649"]]);
81
+ const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-eb25f649"]]);
82
82
  function toCssLength(value) {
83
83
  if (value === void 0 || value === null || value === "") {
84
84
  return void 0;
@@ -91,7 +91,7 @@ function toCssBox(value) {
91
91
  function surfaceClass(surface) {
92
92
  return surface && surface !== "flat" ? `tao-surface-${surface}` : void 0;
93
93
  }
94
- const _sfc_main$Y = /* @__PURE__ */ defineComponent({
94
+ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
95
95
  ...{ name: "TaoBlock" },
96
96
  __name: "TaoBlock",
97
97
  props: {
@@ -115,7 +115,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
115
115
  };
116
116
  }
117
117
  });
118
- const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-3d9abbef"]]);
118
+ const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-3d9abbef"]]);
119
119
  const formFieldKey = Symbol("taoFormField");
120
120
  function isDev() {
121
121
  try {
@@ -155,21 +155,21 @@ function warnDeprecated(component, replacements) {
155
155
  deprecationWarning(component, label, instead);
156
156
  }
157
157
  }
158
- const _hoisted_1$O = ["for"];
159
- const _hoisted_2$H = {
158
+ const _hoisted_1$R = ["for"];
159
+ const _hoisted_2$K = {
160
160
  key: 0,
161
161
  class: "tao-input__affix tao-input__affix--prefix"
162
162
  };
163
- const _hoisted_3$y = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
164
- const _hoisted_4$t = {
163
+ const _hoisted_3$B = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
164
+ const _hoisted_4$v = {
165
165
  key: 1,
166
166
  class: "tao-input__affix tao-input__affix--suffix"
167
167
  };
168
- const _hoisted_5$m = {
168
+ const _hoisted_5$o = {
169
169
  key: 1,
170
170
  class: "tao-input__error"
171
171
  };
172
- const _sfc_main$X = /* @__PURE__ */ defineComponent({
172
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
173
173
  ...{ name: "TaoInput" },
174
174
  __name: "TaoInput",
175
175
  props: {
@@ -217,7 +217,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
217
217
  key: 0,
218
218
  class: "tao-input__label",
219
219
  for: controlId.value
220
- }, toDisplayString(__props.label), 9, _hoisted_1$O)) : createCommentVNode("", true),
220
+ }, toDisplayString(__props.label), 9, _hoisted_1$R)) : createCommentVNode("", true),
221
221
  createElementVNode("div", {
222
222
  class: normalizeClass(["tao-input-shell", {
223
223
  "tao-input-shell--focused": focused.value,
@@ -227,7 +227,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
227
227
  "tao-input-shell--suffix": _ctx.$slots.suffix
228
228
  }])
229
229
  }, [
230
- _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_2$H, [
230
+ _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_2$K, [
231
231
  renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
232
232
  ])) : createCommentVNode("", true),
233
233
  createElementVNode("input", {
@@ -242,27 +242,27 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
242
242
  onInput: handleInput,
243
243
  onBlur: handleBlur,
244
244
  onFocus: handleFocus
245
- }, null, 42, _hoisted_3$y),
246
- _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_4$t, [
245
+ }, null, 42, _hoisted_3$B),
246
+ _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_4$v, [
247
247
  renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
248
248
  ])) : createCommentVNode("", true)
249
249
  ], 2),
250
- __props.error && __props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_5$m, toDisplayString(__props.errorMessage), 1)) : createCommentVNode("", true)
250
+ __props.error && __props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_5$o, toDisplayString(__props.errorMessage), 1)) : createCommentVNode("", true)
251
251
  ], 2);
252
252
  };
253
253
  }
254
254
  });
255
- const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-aca887be"]]);
256
- const _hoisted_1$N = {
255
+ const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-aca887be"]]);
256
+ const _hoisted_1$Q = {
257
257
  key: 0,
258
258
  class: "tao-input-group__addon tao-input-group__addon--before"
259
259
  };
260
- const _hoisted_2$G = { class: "tao-input-group__field" };
261
- const _hoisted_3$x = {
260
+ const _hoisted_2$J = { class: "tao-input-group__field" };
261
+ const _hoisted_3$A = {
262
262
  key: 1,
263
263
  class: "tao-input-group__addon tao-input-group__addon--after"
264
264
  };
265
- const _sfc_main$W = /* @__PURE__ */ defineComponent({
265
+ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
266
266
  ...{ name: "TaoInputGroup" },
267
267
  __name: "TaoInputGroup",
268
268
  props: {
@@ -287,20 +287,20 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
287
287
  onFocusin: onFocusIn,
288
288
  onFocusout: onFocusOut
289
289
  }, [
290
- _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_1$N, [
290
+ _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
291
291
  renderSlot(_ctx.$slots, "before", {}, void 0, true)
292
292
  ])) : createCommentVNode("", true),
293
- createElementVNode("div", _hoisted_2$G, [
293
+ createElementVNode("div", _hoisted_2$J, [
294
294
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
295
295
  ]),
296
- _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$x, [
296
+ _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
297
297
  renderSlot(_ctx.$slots, "after", {}, void 0, true)
298
298
  ])) : createCommentVNode("", true)
299
299
  ], 34);
300
300
  };
301
301
  }
302
302
  });
303
- const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-55b2d297"]]);
303
+ const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-55b2d297"]]);
304
304
  const localeRu = {
305
305
  code: "ru-RU",
306
306
  alert: { closeLabel: "Закрыть" },
@@ -377,6 +377,17 @@ const localeRu = {
377
377
  },
378
378
  table: { emptyText: "Нет данных" },
379
379
  tag: { closeLabel: "Убрать" },
380
+ colorPicker: {
381
+ areaLabel: "Насыщенность и яркость",
382
+ hueLabel: "Оттенок",
383
+ alphaLabel: "Прозрачность",
384
+ hexLabel: "Цвет в hex",
385
+ modeLabel: "Способ ввода",
386
+ swatchesLabel: "Образцы",
387
+ eyedropperLabel: "Пипетка",
388
+ chooseLabel: "Выбрать цвет"
389
+ },
390
+ timeline: { playLabel: "Играть", pauseLabel: "Пауза", restartLabel: "В начало" },
380
391
  toast: { closeLabel: "Закрыть уведомление" }
381
392
  };
382
393
  const confirmDefaults = {
@@ -580,6 +591,17 @@ const localeEn = {
580
591
  },
581
592
  table: { emptyText: "No data" },
582
593
  tag: { closeLabel: "Remove" },
594
+ colorPicker: {
595
+ areaLabel: "Saturation and brightness",
596
+ hueLabel: "Hue",
597
+ alphaLabel: "Opacity",
598
+ hexLabel: "Color in hex",
599
+ modeLabel: "Input mode",
600
+ swatchesLabel: "Swatches",
601
+ eyedropperLabel: "Eyedropper",
602
+ chooseLabel: "Choose color"
603
+ },
604
+ timeline: { playLabel: "Play", pauseLabel: "Pause", restartLabel: "Restart" },
583
605
  toast: { closeLabel: "Close notification" }
584
606
  };
585
607
  const current = shallowRef(localeRu);
@@ -622,16 +644,16 @@ function useLocaleText(props, section) {
622
644
  function formatText(template, values) {
623
645
  return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
624
646
  }
625
- const _hoisted_1$M = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
626
- const _hoisted_2$F = {
647
+ const _hoisted_1$P = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
648
+ const _hoisted_2$I = {
627
649
  key: 0,
628
650
  class: "tao-input-number__steppers"
629
651
  };
630
- const _hoisted_3$w = ["aria-label", "disabled"];
631
- const _hoisted_4$s = { "aria-hidden": "true" };
632
- const _hoisted_5$l = ["aria-label", "disabled"];
633
- const _hoisted_6$g = { "aria-hidden": "true" };
634
- const _sfc_main$V = /* @__PURE__ */ defineComponent({
652
+ const _hoisted_3$z = ["aria-label", "disabled"];
653
+ const _hoisted_4$u = { "aria-hidden": "true" };
654
+ const _hoisted_5$n = ["aria-label", "disabled"];
655
+ const _hoisted_6$i = { "aria-hidden": "true" };
656
+ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
635
657
  ...{ name: "TaoInputNumber" },
636
658
  __name: "TaoInputNumber",
637
659
  props: {
@@ -660,36 +682,37 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
660
682
  const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
661
683
  const focused = ref(false);
662
684
  const draft = ref(toDraft(props.modelValue));
685
+ let emitted;
663
686
  watch(
664
687
  () => props.modelValue,
665
688
  (value) => {
666
- if (!focused.value) {
689
+ if (!focused.value || value !== emitted) {
667
690
  draft.value = toDraft(value);
668
691
  }
669
692
  }
670
693
  );
671
- function decimalsOf(value) {
694
+ function decimalsOf2(value) {
672
695
  const text = String(value);
673
696
  const dot = text.indexOf(".");
674
697
  return dot === -1 ? 0 : text.length - dot - 1;
675
698
  }
676
- function roundTo(value) {
677
- const digits = props.precision ?? decimalsOf(props.step);
699
+ function roundTo2(value) {
700
+ const digits = props.precision ?? decimalsOf2(props.step);
678
701
  if (digits <= 0) {
679
702
  return Math.round(value);
680
703
  }
681
704
  const factor = 10 ** digits;
682
705
  return Math.round(value * factor) / factor;
683
706
  }
684
- function clamp(value) {
685
- let next = roundTo(value);
707
+ function clamp2(value) {
708
+ let next = roundTo2(value);
686
709
  if (props.min !== void 0 && next < props.min) {
687
710
  next = props.min;
688
711
  }
689
712
  if (props.max !== void 0 && next > props.max) {
690
713
  next = props.max;
691
714
  }
692
- return roundTo(next);
715
+ return roundTo2(next);
693
716
  }
694
717
  function toDraft(value) {
695
718
  if (value === null || value === void 0 || Number.isNaN(value)) {
@@ -715,7 +738,8 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
715
738
  return /^-?\d*([.,]\d*)?$/.test(text);
716
739
  }
717
740
  function commit(value) {
718
- const next = value === null ? null : clamp(value);
741
+ const next = value === null ? null : clamp2(value);
742
+ emitted = next;
719
743
  emit("update:modelValue", next);
720
744
  draft.value = toDraft(next);
721
745
  emit("commit", next);
@@ -735,7 +759,8 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
735
759
  draft.value = text;
736
760
  const parsed = parseDraft(text);
737
761
  if (parsed !== "incomplete") {
738
- emit("update:modelValue", parsed === null ? null : clamp(parsed));
762
+ emitted = parsed === null ? null : clamp2(parsed);
763
+ emit("update:modelValue", emitted);
739
764
  }
740
765
  }
741
766
  function onFocus(event) {
@@ -789,8 +814,8 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
789
814
  onFocus,
790
815
  onBlur,
791
816
  onKeydown
792
- }, null, 40, _hoisted_1$M),
793
- __props.controls ? (openBlock(), createElementBlock("div", _hoisted_2$F, [
817
+ }, null, 40, _hoisted_1$P),
818
+ __props.controls ? (openBlock(), createElementBlock("div", _hoisted_2$I, [
794
819
  createElementVNode("button", {
795
820
  type: "button",
796
821
  class: "tao-input-number__step",
@@ -799,12 +824,12 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
799
824
  disabled: __props.disabled || atMax.value,
800
825
  onClick: _cache[0] || (_cache[0] = ($event) => bump(1))
801
826
  }, [
802
- createElementVNode("span", _hoisted_4$s, [
827
+ createElementVNode("span", _hoisted_4$u, [
803
828
  renderSlot(_ctx.$slots, "increment-icon", {}, () => [
804
829
  _cache[2] || (_cache[2] = createTextVNode("+", -1))
805
830
  ], true)
806
831
  ])
807
- ], 8, _hoisted_3$w),
832
+ ], 8, _hoisted_3$z),
808
833
  createElementVNode("button", {
809
834
  type: "button",
810
835
  class: "tao-input-number__step",
@@ -813,24 +838,24 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
813
838
  disabled: __props.disabled || atMin.value,
814
839
  onClick: _cache[1] || (_cache[1] = ($event) => bump(-1))
815
840
  }, [
816
- createElementVNode("span", _hoisted_6$g, [
841
+ createElementVNode("span", _hoisted_6$i, [
817
842
  renderSlot(_ctx.$slots, "decrement-icon", {}, () => [
818
843
  _cache[3] || (_cache[3] = createTextVNode("−", -1))
819
844
  ], true)
820
845
  ])
821
- ], 8, _hoisted_5$l)
846
+ ], 8, _hoisted_5$n)
822
847
  ])) : createCommentVNode("", true)
823
848
  ], 2);
824
849
  };
825
850
  }
826
851
  });
827
- const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-52c1f25a"]]);
828
- const _hoisted_1$L = ["aria-label", "disabled"];
829
- const _hoisted_2$E = { "aria-hidden": "true" };
830
- const _hoisted_3$v = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
831
- const _hoisted_4$r = ["aria-label", "disabled"];
832
- const _hoisted_5$k = { "aria-hidden": "true" };
833
- const _sfc_main$U = /* @__PURE__ */ defineComponent({
852
+ const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-0594919d"]]);
853
+ const _hoisted_1$O = ["aria-label", "disabled"];
854
+ const _hoisted_2$H = { "aria-hidden": "true" };
855
+ const _hoisted_3$y = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
856
+ const _hoisted_4$t = ["aria-label", "disabled"];
857
+ const _hoisted_5$m = { "aria-hidden": "true" };
858
+ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
834
859
  ...{ name: "TaoQuantity" },
835
860
  __name: "TaoQuantity",
836
861
  props: {
@@ -973,12 +998,12 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
973
998
  disabled: minusDisabled.value,
974
999
  onClick: onDec
975
1000
  }, [
976
- createElementVNode("span", _hoisted_2$E, [
1001
+ createElementVNode("span", _hoisted_2$H, [
977
1002
  renderSlot(_ctx.$slots, "decrement-icon", {}, () => [
978
1003
  _cache[0] || (_cache[0] = createTextVNode("−", -1))
979
1004
  ], true)
980
1005
  ])
981
- ], 8, _hoisted_1$L),
1006
+ ], 8, _hoisted_1$O),
982
1007
  createElementVNode("input", {
983
1008
  id: controlId.value,
984
1009
  class: "tao-quantity__input",
@@ -998,7 +1023,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
998
1023
  onFocus,
999
1024
  onBlur,
1000
1025
  onKeydown
1001
- }, null, 40, _hoisted_3$v),
1026
+ }, null, 40, _hoisted_3$y),
1002
1027
  createElementVNode("button", {
1003
1028
  type: "button",
1004
1029
  class: "tao-quantity__btn tao-quantity__btn--inc",
@@ -1006,43 +1031,43 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1006
1031
  disabled: plusDisabled.value,
1007
1032
  onClick: onInc
1008
1033
  }, [
1009
- createElementVNode("span", _hoisted_5$k, [
1034
+ createElementVNode("span", _hoisted_5$m, [
1010
1035
  renderSlot(_ctx.$slots, "increment-icon", {}, () => [
1011
1036
  _cache[1] || (_cache[1] = createTextVNode("+", -1))
1012
1037
  ], true)
1013
1038
  ])
1014
- ], 8, _hoisted_4$r)
1039
+ ], 8, _hoisted_4$t)
1015
1040
  ], 2);
1016
1041
  };
1017
1042
  }
1018
1043
  });
1019
- const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-e27165e3"]]);
1020
- const _hoisted_1$K = {
1044
+ const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-e27165e3"]]);
1045
+ const _hoisted_1$N = {
1021
1046
  key: 0,
1022
1047
  class: "tao-card__cover"
1023
1048
  };
1024
- const _hoisted_2$D = {
1049
+ const _hoisted_2$G = {
1025
1050
  key: 0,
1026
1051
  class: "tao-card__overlay"
1027
1052
  };
1028
- const _hoisted_3$u = {
1053
+ const _hoisted_3$x = {
1029
1054
  key: 1,
1030
1055
  class: "tao-card__overlay"
1031
1056
  };
1032
- const _hoisted_4$q = {
1057
+ const _hoisted_4$s = {
1033
1058
  key: 0,
1034
1059
  class: "tao-card__header-title"
1035
1060
  };
1036
- const _hoisted_5$j = { key: 0 };
1037
- const _hoisted_6$f = {
1061
+ const _hoisted_5$l = { key: 0 };
1062
+ const _hoisted_6$h = {
1038
1063
  key: 2,
1039
1064
  class: "tao-card__title-block"
1040
1065
  };
1041
- const _hoisted_7$c = {
1066
+ const _hoisted_7$d = {
1042
1067
  key: 0,
1043
1068
  class: "tao-card__title"
1044
1069
  };
1045
- const _hoisted_8$b = {
1070
+ const _hoisted_8$c = {
1046
1071
  key: 1,
1047
1072
  class: "tao-card__sub"
1048
1073
  };
@@ -1054,7 +1079,7 @@ const _hoisted_10$4 = {
1054
1079
  key: 4,
1055
1080
  class: "tao-card__footer"
1056
1081
  };
1057
- const _sfc_main$T = /* @__PURE__ */ defineComponent({
1082
+ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
1058
1083
  ...{ name: "TaoCard" },
1059
1084
  __name: "TaoCard",
1060
1085
  props: {
@@ -1096,12 +1121,12 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1096
1121
  }]]),
1097
1122
  style: normalizeStyle(radiusStyle.value)
1098
1123
  }, [
1099
- _ctx.$slots.cover ? (openBlock(), createElementBlock("div", _hoisted_1$K, [
1124
+ _ctx.$slots.cover ? (openBlock(), createElementBlock("div", _hoisted_1$N, [
1100
1125
  renderSlot(_ctx.$slots, "cover", {}, void 0, true),
1101
- _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
1126
+ _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_2$G, [
1102
1127
  renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
1103
1128
  ])) : createCommentVNode("", true)
1104
- ])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
1129
+ ])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$x, [
1105
1130
  renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
1106
1131
  ])) : createCommentVNode("", true),
1107
1132
  hasContent.value ? (openBlock(), createElementBlock("div", {
@@ -1109,7 +1134,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1109
1134
  class: "tao-card__content",
1110
1135
  style: normalizeStyle(paddingStyle.value)
1111
1136
  }, [
1112
- _ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$q, [
1137
+ _ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$s, [
1113
1138
  renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
1114
1139
  ])) : createCommentVNode("", true),
1115
1140
  _ctx.$slots.header || _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("div", {
@@ -1119,15 +1144,15 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1119
1144
  createElementVNode("span", null, [
1120
1145
  renderSlot(_ctx.$slots, "header", {}, void 0, true)
1121
1146
  ]),
1122
- _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("span", _hoisted_5$j, [
1147
+ _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("span", _hoisted_5$l, [
1123
1148
  renderSlot(_ctx.$slots, "headerSecondary", {}, void 0, true)
1124
1149
  ])) : createCommentVNode("", true)
1125
1150
  ], 2)) : createCommentVNode("", true),
1126
- _ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_6$f, [
1127
- _ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_7$c, [
1151
+ _ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_6$h, [
1152
+ _ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_7$d, [
1128
1153
  renderSlot(_ctx.$slots, "title", {}, void 0, true)
1129
1154
  ])) : createCommentVNode("", true),
1130
- _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_8$b, [
1155
+ _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_8$c, [
1131
1156
  renderSlot(_ctx.$slots, "sub", {}, void 0, true)
1132
1157
  ])) : createCommentVNode("", true)
1133
1158
  ])) : createCommentVNode("", true),
@@ -1142,7 +1167,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1142
1167
  };
1143
1168
  }
1144
1169
  });
1145
- const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-53c366d1"]]);
1170
+ const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-53c366d1"]]);
1146
1171
  const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1147
1172
  function getFocusable(root) {
1148
1173
  return [...root.querySelectorAll(FOCUSABLE)].filter(
@@ -1196,21 +1221,21 @@ function unlockBodyScroll() {
1196
1221
  previousOverflow = "";
1197
1222
  }
1198
1223
  }
1199
- const _hoisted_1$J = ["aria-labelledby"];
1200
- const _hoisted_2$C = {
1224
+ const _hoisted_1$M = ["aria-labelledby"];
1225
+ const _hoisted_2$F = {
1201
1226
  key: 0,
1202
1227
  class: "tao-modal__header"
1203
1228
  };
1204
- const _hoisted_3$t = ["id"];
1205
- const _hoisted_4$p = { key: 1 };
1206
- const _hoisted_5$i = ["aria-label"];
1207
- const _hoisted_6$e = { "aria-hidden": "true" };
1208
- const _hoisted_7$b = { class: "tao-modal__content" };
1209
- const _hoisted_8$a = {
1229
+ const _hoisted_3$w = ["id"];
1230
+ const _hoisted_4$r = { key: 1 };
1231
+ const _hoisted_5$k = ["aria-label"];
1232
+ const _hoisted_6$g = { "aria-hidden": "true" };
1233
+ const _hoisted_7$c = { class: "tao-modal__content" };
1234
+ const _hoisted_8$b = {
1210
1235
  key: 1,
1211
1236
  class: "tao-modal__footer"
1212
1237
  };
1213
- const _sfc_main$S = /* @__PURE__ */ defineComponent({
1238
+ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1214
1239
  ...{ name: "TaoModal" },
1215
1240
  __name: "TaoModal",
1216
1241
  props: {
@@ -1327,13 +1352,13 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1327
1352
  "aria-labelledby": __props.title ? unref(titleId) : void 0,
1328
1353
  tabindex: "-1"
1329
1354
  }, [
1330
- __props.title || _ctx.$slots.header || __props.closable ? (openBlock(), createElementBlock("div", _hoisted_2$C, [
1355
+ __props.title || _ctx.$slots.header || __props.closable ? (openBlock(), createElementBlock("div", _hoisted_2$F, [
1331
1356
  renderSlot(_ctx.$slots, "header", {}, () => [
1332
1357
  __props.title ? (openBlock(), createElementBlock("h2", {
1333
1358
  key: 0,
1334
1359
  id: unref(titleId),
1335
1360
  class: "tao-modal__title"
1336
- }, toDisplayString(__props.title), 9, _hoisted_3$t)) : (openBlock(), createElementBlock("span", _hoisted_4$p))
1361
+ }, toDisplayString(__props.title), 9, _hoisted_3$w)) : (openBlock(), createElementBlock("span", _hoisted_4$r))
1337
1362
  ], true),
1338
1363
  __props.closable ? (openBlock(), createElementBlock("button", {
1339
1364
  key: 0,
@@ -1342,20 +1367,20 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1342
1367
  "aria-label": unref(l10n).closeLabel,
1343
1368
  onClick: close
1344
1369
  }, [
1345
- createElementVNode("span", _hoisted_6$e, [
1370
+ createElementVNode("span", _hoisted_6$g, [
1346
1371
  renderSlot(_ctx.$slots, "close-icon", {}, () => [
1347
1372
  _cache[0] || (_cache[0] = createTextVNode("×", -1))
1348
1373
  ], true)
1349
1374
  ])
1350
- ], 8, _hoisted_5$i)) : createCommentVNode("", true)
1375
+ ], 8, _hoisted_5$k)) : createCommentVNode("", true)
1351
1376
  ])) : createCommentVNode("", true),
1352
- createElementVNode("div", _hoisted_7$b, [
1377
+ createElementVNode("div", _hoisted_7$c, [
1353
1378
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1354
1379
  ]),
1355
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8$a, [
1380
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8$b, [
1356
1381
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
1357
1382
  ])) : createCommentVNode("", true)
1358
- ], 8, _hoisted_1$J)
1383
+ ], 8, _hoisted_1$M)
1359
1384
  ], 32)) : createCommentVNode("", true)
1360
1385
  ]),
1361
1386
  _: 3
@@ -1364,13 +1389,13 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1364
1389
  };
1365
1390
  }
1366
1391
  });
1367
- const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-742274be"]]);
1392
+ const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-742274be"]]);
1368
1393
  function tabValue(tab) {
1369
1394
  return tab.value ?? tab.key;
1370
1395
  }
1371
- const _hoisted_1$I = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
1372
- const _hoisted_2$B = ["id", "aria-labelledby"];
1373
- const _sfc_main$R = /* @__PURE__ */ defineComponent({
1396
+ const _hoisted_1$L = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
1397
+ const _hoisted_2$E = ["id", "aria-labelledby"];
1398
+ const _sfc_main$W = /* @__PURE__ */ defineComponent({
1374
1399
  ...{ name: "TaoTabs" },
1375
1400
  __name: "TaoTabs",
1376
1401
  props: {
@@ -1475,7 +1500,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
1475
1500
  }, void 0, true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1476
1501
  createTextVNode(toDisplayString(tab.label), 1)
1477
1502
  ], 64))
1478
- ], 8, _hoisted_1$I);
1503
+ ], 8, _hoisted_1$L);
1479
1504
  }), 128))
1480
1505
  ], 36),
1481
1506
  createElementVNode("div", {
@@ -1485,12 +1510,12 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
1485
1510
  "aria-labelledby": tabId(__props.modelValue)
1486
1511
  }, [
1487
1512
  renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
1488
- ], 8, _hoisted_2$B)
1513
+ ], 8, _hoisted_2$E)
1489
1514
  ], 2);
1490
1515
  };
1491
1516
  }
1492
1517
  });
1493
- const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-a9238d96"]]);
1518
+ const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-a9238d96"]]);
1494
1519
  function listenFocusLoss(onLoss) {
1495
1520
  function onVisibilityChange() {
1496
1521
  if (document.hidden) {
@@ -1506,7 +1531,536 @@ function listenFocusLoss(onLoss) {
1506
1531
  window.removeEventListener("pagehide", onLoss);
1507
1532
  };
1508
1533
  }
1509
- const _sfc_main$Q = /* @__PURE__ */ defineComponent({
1534
+ const clamp$1 = (v, min, max) => Math.min(Math.max(v, min), max);
1535
+ function decimalsOf(step) {
1536
+ if (!Number.isFinite(step) || step <= 0) return 0;
1537
+ const s = String(step);
1538
+ if (s.includes("e-")) return Number(s.split("e-")[1]);
1539
+ return s.includes(".") ? s.split(".")[1].length : 0;
1540
+ }
1541
+ const roundTo = (v, decimals) => {
1542
+ const k = Math.pow(10, decimals);
1543
+ return Math.round(v * k) / k + 0;
1544
+ };
1545
+ function ratioOf(value, min, max) {
1546
+ return max > min ? clamp$1((value - min) / (max - min), 0, 1) : 0;
1547
+ }
1548
+ function valueAt(ratio, min, max, step) {
1549
+ const raw = min + clamp$1(ratio, 0, 1) * (max - min);
1550
+ if (!(step > 0)) return clamp$1(raw, min, max);
1551
+ const snapped = min + Math.round((raw - min) / step) * step;
1552
+ return clamp$1(roundTo(snapped, Math.max(decimalsOf(step), decimalsOf(min))), min, max);
1553
+ }
1554
+ function nearestMark(value, marks) {
1555
+ let best = value;
1556
+ let bestDistance = Infinity;
1557
+ for (const m of marks) {
1558
+ const d = Math.abs(m - value);
1559
+ if (d < bestDistance || d === bestDistance && m < best) {
1560
+ best = m;
1561
+ bestDistance = d;
1562
+ }
1563
+ }
1564
+ return best;
1565
+ }
1566
+ function stepMark(value, marks, dir) {
1567
+ const sorted = [...marks].sort((a, b) => a - b);
1568
+ const next = dir > 0 ? sorted.find((m) => m > value) : [...sorted].reverse().find((m) => m < value);
1569
+ return next ?? value;
1570
+ }
1571
+ function nearestThumb(values, target, last = 0) {
1572
+ if (values.length < 2) return 0;
1573
+ const d0 = Math.abs(values[0] - target);
1574
+ const d1 = Math.abs(values[1] - target);
1575
+ if (d0 !== d1) return d0 < d1 ? 0 : 1;
1576
+ if (target > values[0]) return 1;
1577
+ if (target < values[0]) return 0;
1578
+ return last === 1 ? 1 : 0;
1579
+ }
1580
+ function moveThumb(values, index, next, min, max, gap = 0) {
1581
+ const [a, b] = values;
1582
+ return index === 0 ? [clamp$1(next, min, Math.max(min, b - gap)), b] : [a, clamp$1(next, Math.min(max, a + gap), max)];
1583
+ }
1584
+ function normalizeValue(value, min, max) {
1585
+ const list = Array.isArray(value) ? [value[0], value[1]] : [value];
1586
+ const clamped = list.map((v) => clamp$1(Number.isFinite(v) ? v : min, min, max));
1587
+ return clamped.length === 2 ? clamped.sort((x, y) => x - y) : clamped;
1588
+ }
1589
+ function niceStep(span, count) {
1590
+ if (!(span > 0)) return 1;
1591
+ const raw = span / Math.max(1, count);
1592
+ const pow = Math.pow(10, Math.floor(Math.log10(raw)));
1593
+ const f = raw / pow;
1594
+ return (f < 1.5 ? 1 : f < 3.5 ? 2 : f < 7.5 ? 5 : 10) * pow;
1595
+ }
1596
+ function niceTicks(min, max, count = 5) {
1597
+ if (!(max > min)) return [min];
1598
+ const step = niceStep(max - min, count);
1599
+ const decimals = decimalsOf(step);
1600
+ const out = [];
1601
+ for (let i = Math.ceil(min / step - 1e-9); i * step <= max + step * 1e-9; i++) out.push(roundTo(i * step, decimals));
1602
+ return out;
1603
+ }
1604
+ function normalizeMarks(marks, min, max, format = String) {
1605
+ if (!marks) return [];
1606
+ const list = marks === true ? niceTicks(min, max).map((value) => ({ value })) : marks.map((m) => typeof m === "number" ? { value: m } : m);
1607
+ return list.filter((m) => m.value >= min && m.value <= max).map((m) => m.label === void 0 ? { ...m, label: format(m.value) } : m).sort((a, b) => a.value - b.value);
1608
+ }
1609
+ function isMarkActive(markValue, values) {
1610
+ return values.length === 2 ? markValue >= values[0] && markValue <= values[1] : markValue <= (values[0] ?? 0);
1611
+ }
1612
+ const _hoisted_1$K = ["aria-disabled"];
1613
+ const _hoisted_2$D = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-label", "aria-orientation", "aria-disabled", "aria-invalid", "aria-describedby", "onKeydown"];
1614
+ const _hoisted_3$v = {
1615
+ key: 0,
1616
+ class: "tao-slider__value"
1617
+ };
1618
+ const _hoisted_4$q = {
1619
+ key: 0,
1620
+ class: "tao-slider__marks"
1621
+ };
1622
+ const _hoisted_5$j = ["disabled", "onClick"];
1623
+ const _hoisted_6$f = {
1624
+ key: 0,
1625
+ class: "tao-slider__mark-label"
1626
+ };
1627
+ const _sfc_main$V = /* @__PURE__ */ defineComponent({
1628
+ ...{ name: "TaoSliderBase" },
1629
+ __name: "TaoSliderBase",
1630
+ props: {
1631
+ min: { default: 0 },
1632
+ max: { default: 100 },
1633
+ step: { default: 1 },
1634
+ minGap: { default: 0 },
1635
+ showValue: { type: Boolean, default: false },
1636
+ marks: { type: [Boolean, Array] },
1637
+ marksSide: { default: "end" },
1638
+ discrete: { type: Boolean, default: false },
1639
+ format: {},
1640
+ flat: { type: Boolean, default: false },
1641
+ vertical: { type: Boolean, default: false },
1642
+ disabled: { type: Boolean, default: false },
1643
+ error: { type: Boolean, default: false },
1644
+ variant: { default: "bar" },
1645
+ size: {},
1646
+ ariaLabel: {},
1647
+ wheel: { default: 0 },
1648
+ modelValue: {}
1649
+ },
1650
+ emits: ["update:modelValue", "change"],
1651
+ setup(__props, { emit: __emit }) {
1652
+ const props = __props;
1653
+ const emit = __emit;
1654
+ const field = inject(formFieldKey, null);
1655
+ const localId = useId();
1656
+ const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
1657
+ const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
1658
+ const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
1659
+ const isRange = computed(() => Array.isArray(props.modelValue));
1660
+ const values = computed(() => normalizeValue(props.modelValue, props.min, props.max));
1661
+ const text = (v) => props.format ? props.format(v) : String(v);
1662
+ const markList = computed(() => normalizeMarks(props.marks, props.min, props.max, text));
1663
+ const markValues = computed(() => markList.value.map((m) => m.value));
1664
+ const hasCaptions = computed(() => markList.value.some((m) => m.label));
1665
+ const stepped = computed(() => props.discrete && markValues.value.length > 0);
1666
+ const percent = (v) => ratioOf(v, props.min, props.max) * 100;
1667
+ const place = (v) => props.vertical ? { bottom: `${percent(v)}%` } : { left: `${percent(v)}%` };
1668
+ const fillStyle = computed(() => {
1669
+ const from = isRange.value ? percent(values.value[0]) : 0;
1670
+ const to = percent(values.value[isRange.value ? 1 : 0]);
1671
+ return props.vertical ? { bottom: `${from}%`, height: `${to - from}%` } : { left: `${from}%`, width: `${to - from}%` };
1672
+ });
1673
+ const barText = computed(() => values.value.map(text).join(" – "));
1674
+ function write(next, final = false) {
1675
+ const before = values.value;
1676
+ const value = isRange.value ? [next[0], next[1]] : next[0];
1677
+ const changed = next.some((v, i) => v !== before[i]);
1678
+ emit("update:modelValue", value);
1679
+ if (final && changed) emit("change", value);
1680
+ }
1681
+ function setThumb(index, target, final = false) {
1682
+ if (isRange.value) {
1683
+ write(moveThumb(values.value, index, target, props.min, props.max, props.minGap), final);
1684
+ } else {
1685
+ write([Math.min(Math.max(target, props.min), props.max)], final);
1686
+ }
1687
+ }
1688
+ function valueUnder(event) {
1689
+ const el = railRef.value;
1690
+ if (!el) return props.min;
1691
+ const rect = el.getBoundingClientRect();
1692
+ const ratio = props.vertical ? rect.height ? 1 - (event.clientY - rect.top) / rect.height : 0 : rect.width ? (event.clientX - rect.left) / rect.width : 0;
1693
+ const raw = valueAt(ratio, props.min, props.max, stepped.value ? 0 : props.step);
1694
+ return stepped.value ? nearestMark(raw, markValues.value) : raw;
1695
+ }
1696
+ const railRef = ref(null);
1697
+ const isDragging = ref(false);
1698
+ const activeThumb = ref(0);
1699
+ const pointerFocus = ref(false);
1700
+ let dragPointer = -1;
1701
+ let dragStart = [];
1702
+ let tieAt = null;
1703
+ function releaseDragCapture() {
1704
+ const el = railRef.value;
1705
+ const id = dragPointer;
1706
+ if (!el || id === -1) return;
1707
+ if (typeof el.hasPointerCapture === "function" && !el.hasPointerCapture(id)) return;
1708
+ try {
1709
+ el.releasePointerCapture(id);
1710
+ } catch {
1711
+ }
1712
+ }
1713
+ function endDrag() {
1714
+ if (!isDragging.value) return;
1715
+ isDragging.value = false;
1716
+ releaseDragCapture();
1717
+ dragPointer = -1;
1718
+ tieAt = null;
1719
+ if (values.value.some((v, i) => v !== dragStart[i])) {
1720
+ emit("change", isRange.value ? [values.value[0], values.value[1]] : values.value[0]);
1721
+ }
1722
+ }
1723
+ function onPointerDown(event) {
1724
+ var _a;
1725
+ if (props.disabled || event.button !== 0 || !railRef.value) return;
1726
+ const target = valueUnder(event);
1727
+ dragPointer = event.pointerId;
1728
+ dragStart = [...values.value];
1729
+ isDragging.value = true;
1730
+ activeThumb.value = nearestThumb(values.value, target, activeThumb.value);
1731
+ tieAt = isRange.value && values.value[0] === values.value[1] && target === values.value[0] ? target : null;
1732
+ pointerFocus.value = true;
1733
+ (_a = railRef.value.querySelectorAll(".tao-slider__thumb")[activeThumb.value]) == null ? void 0 : _a.focus({ preventScroll: true });
1734
+ setThumb(activeThumb.value, target);
1735
+ event.preventDefault();
1736
+ try {
1737
+ railRef.value.setPointerCapture(event.pointerId);
1738
+ } catch {
1739
+ }
1740
+ }
1741
+ function onPointerMove(event) {
1742
+ if (!isDragging.value || event.pointerId !== dragPointer) return;
1743
+ const target = valueUnder(event);
1744
+ if (tieAt !== null) {
1745
+ if (target === tieAt) return;
1746
+ activeThumb.value = target > tieAt ? 1 : 0;
1747
+ tieAt = null;
1748
+ }
1749
+ setThumb(activeThumb.value, target);
1750
+ }
1751
+ function onPointerEnd(event) {
1752
+ if (!isDragging.value) return;
1753
+ if (dragPointer !== -1 && event.pointerId !== dragPointer) return;
1754
+ endDrag();
1755
+ }
1756
+ function onKeydown(event, index) {
1757
+ if (props.disabled) return;
1758
+ pointerFocus.value = false;
1759
+ activeThumb.value = index;
1760
+ const at = values.value[index];
1761
+ let next = null;
1762
+ const forward = event.key === "ArrowRight" || event.key === "ArrowUp";
1763
+ const backward = event.key === "ArrowLeft" || event.key === "ArrowDown";
1764
+ if (forward || backward) {
1765
+ const dir = forward ? 1 : -1;
1766
+ next = stepped.value ? stepMark(at, markValues.value, dir) : at + dir * props.step;
1767
+ } else if (event.key === "PageUp" || event.key === "PageDown") {
1768
+ const dir = event.key === "PageUp" ? 1 : -1;
1769
+ next = stepped.value ? stepMark(at, markValues.value, dir) : at + dir * props.step * 10;
1770
+ } else if (event.key === "Home") {
1771
+ next = props.min;
1772
+ } else if (event.key === "End") {
1773
+ next = props.max;
1774
+ }
1775
+ if (next === null) return;
1776
+ event.preventDefault();
1777
+ setThumb(index, stepped.value ? nearestMark(next, markValues.value) : valueAt(ratioOf(next, props.min, props.max), props.min, props.max, props.step), true);
1778
+ }
1779
+ function onWheel(event) {
1780
+ if (props.disabled || props.wheel <= 0 || isRange.value) return;
1781
+ event.preventDefault();
1782
+ setThumb(0, values.value[0] + (event.deltaY < 0 ? props.wheel : -props.wheel), true);
1783
+ }
1784
+ function onMarkClick(mark) {
1785
+ if (props.disabled) return;
1786
+ activeThumb.value = nearestThumb(values.value, mark.value, activeThumb.value);
1787
+ setThumb(activeThumb.value, mark.value, true);
1788
+ }
1789
+ let stopFocusLoss;
1790
+ onMounted(() => {
1791
+ stopFocusLoss = listenFocusLoss(endDrag);
1792
+ });
1793
+ onBeforeUnmount(() => {
1794
+ endDrag();
1795
+ stopFocusLoss == null ? void 0 : stopFocusLoss();
1796
+ });
1797
+ return (_ctx, _cache) => {
1798
+ return openBlock(), createElementBlock("div", {
1799
+ class: normalizeClass(["tao-slider", [
1800
+ `tao-slider--${__props.variant}`,
1801
+ unref(sizeClass)(__props.size),
1802
+ {
1803
+ "tao-slider--vertical": __props.vertical,
1804
+ "tao-slider--flat": __props.flat,
1805
+ "tao-slider--pointer-focus": pointerFocus.value,
1806
+ "tao-slider--collapsed": isRange.value && values.value[0] === values.value[1],
1807
+ "tao-slider--range": isRange.value,
1808
+ "tao-slider--has-marks": markList.value.length > 0,
1809
+ "tao-slider--marks-start": __props.marksSide === "start",
1810
+ "tao-slider--marks-bare": markList.value.length > 0 && !hasCaptions.value,
1811
+ "tao-slider--show-value": __props.showValue,
1812
+ "tao-slider--disabled": __props.disabled,
1813
+ "tao-slider--invalid": invalid.value
1814
+ }
1815
+ ]]),
1816
+ role: "group",
1817
+ "aria-disabled": __props.disabled || void 0,
1818
+ onWheel
1819
+ }, [
1820
+ createElementVNode("div", {
1821
+ ref_key: "railRef",
1822
+ ref: railRef,
1823
+ class: "tao-slider__rail",
1824
+ onPointerdown: onPointerDown,
1825
+ onPointermove: onPointerMove,
1826
+ onPointerup: onPointerEnd,
1827
+ onPointercancel: onPointerEnd,
1828
+ onLostpointercapture: endDrag
1829
+ }, [
1830
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
1831
+ createElementVNode("div", {
1832
+ class: "tao-slider__fill",
1833
+ style: normalizeStyle(fillStyle.value)
1834
+ }, null, 4),
1835
+ (openBlock(true), createElementBlock(Fragment, null, renderList(values.value, (v, i) => {
1836
+ return openBlock(), createElementBlock("div", {
1837
+ id: i === 0 ? controlId.value : void 0,
1838
+ key: i,
1839
+ class: normalizeClass(["tao-slider__thumb", { "tao-slider__thumb--active": isDragging.value && activeThumb.value === i }]),
1840
+ style: normalizeStyle(place(v)),
1841
+ role: "slider",
1842
+ tabindex: __props.disabled ? -1 : 0,
1843
+ "aria-valuemin": __props.min,
1844
+ "aria-valuemax": __props.max,
1845
+ "aria-valuenow": v,
1846
+ "aria-valuetext": text(v),
1847
+ "aria-label": __props.ariaLabel,
1848
+ "aria-orientation": __props.vertical ? "vertical" : "horizontal",
1849
+ "aria-disabled": __props.disabled || void 0,
1850
+ "aria-invalid": invalid.value || void 0,
1851
+ "aria-describedby": describedBy.value,
1852
+ onKeydown: ($event) => onKeydown($event, i),
1853
+ onBlur: _cache[0] || (_cache[0] = ($event) => pointerFocus.value = false)
1854
+ }, null, 46, _hoisted_2$D);
1855
+ }), 128)),
1856
+ __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
1857
+ renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
1858
+ createTextVNode(toDisplayString(barText.value), 1),
1859
+ renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
1860
+ ])) : createCommentVNode("", true)
1861
+ ], 544),
1862
+ markList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_4$q, [
1863
+ (openBlock(true), createElementBlock(Fragment, null, renderList(markList.value, (mark) => {
1864
+ return openBlock(), createElementBlock("button", {
1865
+ key: mark.value,
1866
+ type: "button",
1867
+ class: normalizeClass(["tao-slider__mark", {
1868
+ "tao-slider__mark--active": unref(isMarkActive)(mark.value, values.value),
1869
+ "tao-slider__mark--start": mark.value === __props.min,
1870
+ "tao-slider__mark--end": mark.value === __props.max && __props.max > __props.min
1871
+ }]),
1872
+ style: normalizeStyle(place(mark.value)),
1873
+ disabled: __props.disabled,
1874
+ tabindex: "-1",
1875
+ onClick: ($event) => onMarkClick(mark)
1876
+ }, [
1877
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "tao-slider__tick" }, null, -1)),
1878
+ mark.label ? (openBlock(), createElementBlock("span", _hoisted_6$f, [
1879
+ renderSlot(_ctx.$slots, "mark", {
1880
+ mark,
1881
+ active: unref(isMarkActive)(mark.value, values.value)
1882
+ }, () => [
1883
+ createTextVNode(toDisplayString(mark.label), 1)
1884
+ ], true)
1885
+ ])) : createCommentVNode("", true)
1886
+ ], 14, _hoisted_5$j);
1887
+ }), 128))
1888
+ ])) : createCommentVNode("", true)
1889
+ ], 42, _hoisted_1$K);
1890
+ };
1891
+ }
1892
+ });
1893
+ const TaoSliderBase = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-648d0bf1"]]);
1894
+ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1895
+ ...{ name: "TaoSlider" },
1896
+ __name: "TaoSlider",
1897
+ props: {
1898
+ min: {},
1899
+ max: {},
1900
+ step: {},
1901
+ minGap: {},
1902
+ showValue: { type: Boolean },
1903
+ marks: { type: [Boolean, Array] },
1904
+ marksSide: {},
1905
+ discrete: { type: Boolean },
1906
+ format: { type: Function },
1907
+ flat: { type: Boolean },
1908
+ vertical: { type: Boolean },
1909
+ disabled: { type: Boolean },
1910
+ error: { type: Boolean },
1911
+ variant: {},
1912
+ size: {},
1913
+ ariaLabel: {},
1914
+ wheel: {},
1915
+ modelValue: {}
1916
+ },
1917
+ emits: ["update:modelValue", "change"],
1918
+ setup(__props, { emit: __emit }) {
1919
+ const props = __props;
1920
+ const emit = __emit;
1921
+ return (_ctx, _cache) => {
1922
+ return openBlock(), createBlock(TaoSliderBase, mergeProps(props, {
1923
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
1924
+ onChange: _cache[1] || (_cache[1] = ($event) => emit("change", $event))
1925
+ }), createSlots({ _: 2 }, [
1926
+ _ctx.$slots.mark ? {
1927
+ name: "mark",
1928
+ fn: withCtx((slot) => [
1929
+ renderSlot(_ctx.$slots, "mark", normalizeProps(guardReactiveProps(slot)))
1930
+ ]),
1931
+ key: "0"
1932
+ } : void 0,
1933
+ _ctx.$slots["pre-value"] ? {
1934
+ name: "pre-value",
1935
+ fn: withCtx(() => [
1936
+ renderSlot(_ctx.$slots, "pre-value")
1937
+ ]),
1938
+ key: "1"
1939
+ } : void 0,
1940
+ _ctx.$slots["post-value"] ? {
1941
+ name: "post-value",
1942
+ fn: withCtx(() => [
1943
+ renderSlot(_ctx.$slots, "post-value")
1944
+ ]),
1945
+ key: "2"
1946
+ } : void 0
1947
+ ]), 1040);
1948
+ };
1949
+ }
1950
+ });
1951
+ const _hoisted_1$J = { class: "tao-timeline__controls" };
1952
+ const _hoisted_2$C = { class: "tao-timeline__track" };
1953
+ const _hoisted_3$u = {
1954
+ key: 0,
1955
+ class: "tao-timeline__time"
1956
+ };
1957
+ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1958
+ ...{ name: "TaoTimeline" },
1959
+ __name: "TaoTimeline",
1960
+ props: {
1961
+ modelValue: {},
1962
+ playing: { type: Boolean, default: false },
1963
+ length: {},
1964
+ step: { default: 0.01 },
1965
+ marks: {},
1966
+ marksSide: { default: "end" },
1967
+ format: {},
1968
+ pauseOnScrub: { type: Boolean, default: true },
1969
+ showRestart: { type: Boolean, default: true },
1970
+ showTime: { type: Boolean, default: true },
1971
+ variant: { default: "thin" },
1972
+ size: {},
1973
+ disabled: { type: Boolean, default: false },
1974
+ playLabel: {},
1975
+ pauseLabel: {},
1976
+ restartLabel: {}
1977
+ },
1978
+ emits: ["update:modelValue", "update:playing", "restart", "seek"],
1979
+ setup(__props, { emit: __emit }) {
1980
+ const props = __props;
1981
+ const emit = __emit;
1982
+ const l10n = useLocaleText(props, "timeline");
1983
+ const text = (t) => props.format ? props.format(t) : t.toFixed(2);
1984
+ const label = computed(() => `${text(props.modelValue)} / ${text(props.length)}`);
1985
+ function onScrub(time) {
1986
+ emit("update:modelValue", time);
1987
+ if (props.pauseOnScrub && props.playing) emit("update:playing", false);
1988
+ }
1989
+ function onRestart() {
1990
+ emit("update:modelValue", 0);
1991
+ emit("restart");
1992
+ }
1993
+ return (_ctx, _cache) => {
1994
+ return openBlock(), createElementBlock("div", {
1995
+ class: normalizeClass(["tao-timeline", [unref(sizeClass)(__props.size), `tao-timeline--${__props.variant}`, { "tao-timeline--marks-start": __props.marksSide === "start", "tao-timeline--disabled": __props.disabled }]])
1996
+ }, [
1997
+ createElementVNode("div", _hoisted_1$J, [
1998
+ createVNode(TaoButton, {
1999
+ size: "small",
2000
+ variant: "secondary",
2001
+ disabled: __props.disabled,
2002
+ "aria-label": __props.playing ? unref(l10n).pauseLabel : unref(l10n).playLabel,
2003
+ "aria-pressed": __props.playing,
2004
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("update:playing", !__props.playing))
2005
+ }, {
2006
+ default: withCtx(() => [
2007
+ createTextVNode(toDisplayString(__props.playing ? "❚❚" : "▶"), 1)
2008
+ ]),
2009
+ _: 1
2010
+ }, 8, ["disabled", "aria-label", "aria-pressed"]),
2011
+ __props.showRestart ? (openBlock(), createBlock(TaoButton, {
2012
+ key: 0,
2013
+ size: "small",
2014
+ variant: "ghost",
2015
+ disabled: __props.disabled,
2016
+ "aria-label": unref(l10n).restartLabel,
2017
+ onClick: onRestart
2018
+ }, {
2019
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
2020
+ createTextVNode("⏮", -1)
2021
+ ])]),
2022
+ _: 1
2023
+ }, 8, ["disabled", "aria-label"])) : createCommentVNode("", true)
2024
+ ]),
2025
+ createElementVNode("div", _hoisted_2$C, [
2026
+ createVNode(_sfc_main$U, {
2027
+ "model-value": __props.modelValue,
2028
+ min: 0,
2029
+ max: __props.length,
2030
+ step: __props.step,
2031
+ marks: __props.marks,
2032
+ "marks-side": __props.marksSide,
2033
+ format: text,
2034
+ variant: __props.variant,
2035
+ size: __props.size,
2036
+ disabled: __props.disabled,
2037
+ "onUpdate:modelValue": onScrub,
2038
+ onChange: _cache[1] || (_cache[1] = ($event) => emit("seek", $event))
2039
+ }, createSlots({ _: 2 }, [
2040
+ _ctx.$slots.mark ? {
2041
+ name: "mark",
2042
+ fn: withCtx((slot) => [
2043
+ renderSlot(_ctx.$slots, "mark", normalizeProps(guardReactiveProps(slot)), void 0, true)
2044
+ ]),
2045
+ key: "0"
2046
+ } : void 0
2047
+ ]), 1032, ["model-value", "max", "step", "marks", "marks-side", "variant", "size", "disabled"])
2048
+ ]),
2049
+ __props.showTime ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
2050
+ renderSlot(_ctx.$slots, "time", {
2051
+ time: __props.modelValue,
2052
+ length: __props.length,
2053
+ text: label.value
2054
+ }, () => [
2055
+ createTextVNode(toDisplayString(label.value), 1)
2056
+ ], true)
2057
+ ])) : createCommentVNode("", true)
2058
+ ], 2);
2059
+ };
2060
+ }
2061
+ });
2062
+ const TaoTimeline = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-fb8f6331"]]);
2063
+ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1510
2064
  ...{ name: "TaoTooltip" },
1511
2065
  __name: "TaoTooltip",
1512
2066
  props: {
@@ -1668,9 +2222,9 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
1668
2222
  };
1669
2223
  }
1670
2224
  });
1671
- const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-09caf2f5"]]);
1672
- const _hoisted_1$H = { class: "tao-popover" };
1673
- const _sfc_main$P = /* @__PURE__ */ defineComponent({
2225
+ const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-09caf2f5"]]);
2226
+ const _hoisted_1$I = { class: "tao-popover" };
2227
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
1674
2228
  ...{ name: "TaoPopover" },
1675
2229
  __name: "TaoPopover",
1676
2230
  props: {
@@ -1839,7 +2393,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
1839
2393
  unbindDismiss();
1840
2394
  });
1841
2395
  return (_ctx, _cache) => {
1842
- return openBlock(), createElementBlock("div", _hoisted_1$H, [
2396
+ return openBlock(), createElementBlock("div", _hoisted_1$I, [
1843
2397
  createElementVNode("div", {
1844
2398
  ref_key: "triggerRef",
1845
2399
  ref: triggerRef,
@@ -1868,17 +2422,17 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
1868
2422
  };
1869
2423
  }
1870
2424
  });
1871
- const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-3e488e1b"]]);
2425
+ const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-3e488e1b"]]);
1872
2426
  const spoilerGroupKey = Symbol("taoSpoilerGroup");
1873
- const _hoisted_1$G = { class: "tao-spoiler" };
1874
- const _hoisted_2$A = ["aria-expanded", "aria-controls"];
1875
- const _hoisted_3$s = {
2427
+ const _hoisted_1$H = { class: "tao-spoiler" };
2428
+ const _hoisted_2$B = ["aria-expanded", "aria-controls"];
2429
+ const _hoisted_3$t = {
1876
2430
  key: 0,
1877
2431
  class: "tao-spoiler__title"
1878
2432
  };
1879
- const _hoisted_4$o = ["id"];
1880
- const _hoisted_5$h = { class: "tao-spoiler__content-inner" };
1881
- const _sfc_main$O = /* @__PURE__ */ defineComponent({
2433
+ const _hoisted_4$p = ["id"];
2434
+ const _hoisted_5$i = { class: "tao-spoiler__content-inner" };
2435
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
1882
2436
  ...{ name: "TaoSpoiler" },
1883
2437
  __name: "TaoSpoiler",
1884
2438
  props: {
@@ -1934,7 +2488,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
1934
2488
  });
1935
2489
  }
1936
2490
  return (_ctx, _cache) => {
1937
- return openBlock(), createElementBlock("div", _hoisted_1$G, [
2491
+ return openBlock(), createElementBlock("div", _hoisted_1$H, [
1938
2492
  createElementVNode("button", {
1939
2493
  type: "button",
1940
2494
  class: "tao-spoiler__header",
@@ -1945,12 +2499,12 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
1945
2499
  createElementVNode("span", {
1946
2500
  class: normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
1947
2501
  }, "▶", 2),
1948
- __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$s, [
2502
+ __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$t, [
1949
2503
  renderSlot(_ctx.$slots, "title", {}, () => [
1950
2504
  createTextVNode(toDisplayString(__props.title), 1)
1951
2505
  ], true)
1952
2506
  ])) : createCommentVNode("", true)
1953
- ], 8, _hoisted_2$A),
2507
+ ], 8, _hoisted_2$B),
1954
2508
  createVNode(Transition, {
1955
2509
  name: "tao-spoiler-slide",
1956
2510
  onBeforeEnter,
@@ -1964,10 +2518,10 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
1964
2518
  id: unref(panelId),
1965
2519
  class: "tao-spoiler__content"
1966
2520
  }, [
1967
- createElementVNode("div", _hoisted_5$h, [
2521
+ createElementVNode("div", _hoisted_5$i, [
1968
2522
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1969
2523
  ])
1970
- ], 8, _hoisted_4$o)) : createCommentVNode("", true)
2524
+ ], 8, _hoisted_4$p)) : createCommentVNode("", true)
1971
2525
  ]),
1972
2526
  _: 3
1973
2527
  })
@@ -1975,9 +2529,9 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
1975
2529
  };
1976
2530
  }
1977
2531
  });
1978
- const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-5a3147a2"]]);
1979
- const _hoisted_1$F = { class: "tao-spoiler-group" };
1980
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
2532
+ const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-5a3147a2"]]);
2533
+ const _hoisted_1$G = { class: "tao-spoiler-group" };
2534
+ const _sfc_main$P = /* @__PURE__ */ defineComponent({
1981
2535
  ...{ name: "TaoSpoilerGroup" },
1982
2536
  __name: "TaoSpoilerGroup",
1983
2537
  props: {
@@ -2002,15 +2556,15 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
2002
2556
  setOpen
2003
2557
  });
2004
2558
  return (_ctx, _cache) => {
2005
- return openBlock(), createElementBlock("div", _hoisted_1$F, [
2559
+ return openBlock(), createElementBlock("div", _hoisted_1$G, [
2006
2560
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
2007
2561
  ]);
2008
2562
  };
2009
2563
  }
2010
2564
  });
2011
- const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-7986fd2a"]]);
2012
- const _hoisted_1$E = ["aria-label"];
2013
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
2565
+ const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-7986fd2a"]]);
2566
+ const _hoisted_1$F = ["aria-label"];
2567
+ const _sfc_main$O = /* @__PURE__ */ defineComponent({
2014
2568
  ...{ name: "TaoCopy" },
2015
2569
  __name: "TaoCopy",
2016
2570
  props: {
@@ -2151,7 +2705,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2151
2705
  "stroke-width": "2"
2152
2706
  })
2153
2707
  ], -1)
2154
- ])], 10, _hoisted_1$E)
2708
+ ])], 10, _hoisted_1$F)
2155
2709
  ], true),
2156
2710
  (openBlock(), createBlock(Teleport, { to: "body" }, [
2157
2711
  copied.value && __props.tip && doneText.value ? (openBlock(), createElementBlock("div", {
@@ -2167,8 +2721,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2167
2721
  };
2168
2722
  }
2169
2723
  });
2170
- const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-16581b4e"]]);
2171
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
2724
+ const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-16581b4e"]]);
2725
+ const _sfc_main$N = /* @__PURE__ */ defineComponent({
2172
2726
  ...{ name: "TaoContainer" },
2173
2727
  __name: "TaoContainer",
2174
2728
  props: {
@@ -2191,8 +2745,8 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
2191
2745
  };
2192
2746
  }
2193
2747
  });
2194
- const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-ef005f57"]]);
2195
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
2748
+ const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-ef005f57"]]);
2749
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2196
2750
  ...{ name: "TaoFlex" },
2197
2751
  __name: "TaoFlex",
2198
2752
  props: {
@@ -2223,7 +2777,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
2223
2777
  };
2224
2778
  }
2225
2779
  });
2226
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
2780
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
2227
2781
  ...{ name: "TaoSpace" },
2228
2782
  __name: "TaoSpace",
2229
2783
  props: {
@@ -2248,8 +2802,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
2248
2802
  };
2249
2803
  }
2250
2804
  });
2251
- const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-67c9d3a2"]]);
2252
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
2805
+ const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-67c9d3a2"]]);
2806
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
2253
2807
  ...{ name: "TaoGrid" },
2254
2808
  __name: "TaoGrid",
2255
2809
  props: {
@@ -2275,8 +2829,8 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
2275
2829
  };
2276
2830
  }
2277
2831
  });
2278
- const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-5baa4944"]]);
2279
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
2832
+ const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-5baa4944"]]);
2833
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
2280
2834
  ...{ name: "TaoGridItem" },
2281
2835
  __name: "TaoGridItem",
2282
2836
  props: {
@@ -2299,15 +2853,15 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
2299
2853
  };
2300
2854
  }
2301
2855
  });
2302
- const TaoGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-ad288026"]]);
2303
- const _hoisted_1$D = { class: "tao-split__pane tao-split__pane--start" };
2304
- const _hoisted_2$z = ["aria-orientation", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-disabled", "tabindex"];
2305
- const _hoisted_3$r = { class: "tao-split__pane tao-split__pane--end" };
2306
- const _hoisted_4$n = {
2856
+ const TaoGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-ad288026"]]);
2857
+ const _hoisted_1$E = { class: "tao-split__pane tao-split__pane--start" };
2858
+ const _hoisted_2$A = ["aria-orientation", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-disabled", "tabindex"];
2859
+ const _hoisted_3$s = { class: "tao-split__pane tao-split__pane--end" };
2860
+ const _hoisted_4$o = {
2307
2861
  key: 0,
2308
2862
  class: "tao-split__shield"
2309
2863
  };
2310
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
2864
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
2311
2865
  ...{ name: "TaoSplit" },
2312
2866
  __name: "TaoSplit",
2313
2867
  props: {
@@ -2604,7 +3158,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
2604
3158
  ]]),
2605
3159
  style: normalizeStyle({ "--tao-split-start": `${startPx.value}px` })
2606
3160
  }, [
2607
- createElementVNode("div", _hoisted_1$D, [
3161
+ createElementVNode("div", _hoisted_1$E, [
2608
3162
  renderSlot(_ctx.$slots, "start", {}, void 0, true)
2609
3163
  ]),
2610
3164
  createElementVNode("div", {
@@ -2627,18 +3181,18 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
2627
3181
  onKeydown,
2628
3182
  onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {
2629
3183
  }, ["prevent"]))
2630
- }, null, 40, _hoisted_2$z),
2631
- createElementVNode("div", _hoisted_3$r, [
3184
+ }, null, 40, _hoisted_2$A),
3185
+ createElementVNode("div", _hoisted_3$s, [
2632
3186
  renderSlot(_ctx.$slots, "end", {}, void 0, true)
2633
3187
  ]),
2634
- isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$n)) : createCommentVNode("", true)
3188
+ isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$o)) : createCommentVNode("", true)
2635
3189
  ], 6);
2636
3190
  };
2637
3191
  }
2638
3192
  });
2639
- const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-f34ab385"]]);
2640
- const _hoisted_1$C = { class: "tao-icon" };
2641
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
3193
+ const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-f34ab385"]]);
3194
+ const _hoisted_1$D = { class: "tao-icon" };
3195
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
2642
3196
  ...{ name: "TaoIcon" },
2643
3197
  __name: "TaoIcon",
2644
3198
  props: {
@@ -2653,7 +3207,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
2653
3207
  }));
2654
3208
  const props = __props;
2655
3209
  return (_ctx, _cache) => {
2656
- return openBlock(), createElementBlock("span", _hoisted_1$C, [
3210
+ return openBlock(), createElementBlock("span", _hoisted_1$D, [
2657
3211
  renderSlot(_ctx.$slots, "prefix", {}, void 0, true),
2658
3212
  createElementVNode("i", {
2659
3213
  class: normalizeClass(["tao-icon__value", [`icon-${props.name}`, { "tao-icon__value--invert": props.invert }]]),
@@ -2664,8 +3218,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
2664
3218
  };
2665
3219
  }
2666
3220
  });
2667
- const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-350b3502"]]);
2668
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
3221
+ const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-350b3502"]]);
3222
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
2669
3223
  ...{ name: "TaoLoader" },
2670
3224
  __name: "TaoLoader",
2671
3225
  props: {
@@ -2726,11 +3280,11 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
2726
3280
  };
2727
3281
  }
2728
3282
  });
2729
- const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-49a9f1b2"]]);
2730
- const _hoisted_1$B = { class: "tao-image" };
2731
- const _hoisted_2$y = ["src", "alt", "loading"];
2732
- const _hoisted_3$q = { class: "tao-image__placeholder" };
2733
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
3283
+ const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-49a9f1b2"]]);
3284
+ const _hoisted_1$C = { class: "tao-image" };
3285
+ const _hoisted_2$z = ["src", "alt", "loading"];
3286
+ const _hoisted_3$r = { class: "tao-image__placeholder" };
3287
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
2734
3288
  ...{ name: "TaoImage" },
2735
3289
  __name: "TaoImage",
2736
3290
  props: {
@@ -2761,7 +3315,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2761
3315
  hasError.value = false;
2762
3316
  });
2763
3317
  return (_ctx, _cache) => {
2764
- return openBlock(), createElementBlock("div", _hoisted_1$B, [
3318
+ return openBlock(), createElementBlock("div", _hoisted_1$C, [
2765
3319
  __props.src && !hasError.value ? (openBlock(), createElementBlock("img", {
2766
3320
  key: 0,
2767
3321
  class: normalizeClass({ "tao-image__img--hidden": !isLoaded.value, "tao-image__img--pixelated": props.pixelated }),
@@ -2772,26 +3326,26 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2772
3326
  draggable: "false",
2773
3327
  onLoad: handleLoad,
2774
3328
  onError: handleError
2775
- }, null, 42, _hoisted_2$y)) : createCommentVNode("", true),
3329
+ }, null, 42, _hoisted_2$z)) : createCommentVNode("", true),
2776
3330
  !__props.src || hasError.value ? renderSlot(_ctx.$slots, "default", {}, () => [
2777
- createElementVNode("div", _hoisted_3$q, toDisplayString(__props.placeholderText), 1)
3331
+ createElementVNode("div", _hoisted_3$r, toDisplayString(__props.placeholderText), 1)
2778
3332
  ], true, 1) : createCommentVNode("", true)
2779
3333
  ]);
2780
3334
  };
2781
3335
  }
2782
3336
  });
2783
- const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-61f47c52"]]);
2784
- const _hoisted_1$A = ["for"];
2785
- const _hoisted_2$x = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
2786
- const _hoisted_3$p = {
3337
+ const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-61f47c52"]]);
3338
+ const _hoisted_1$B = ["for"];
3339
+ const _hoisted_2$y = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
3340
+ const _hoisted_3$q = {
2787
3341
  key: 0,
2788
3342
  class: "tao-checkbox__label"
2789
3343
  };
2790
- const _hoisted_4$m = {
3344
+ const _hoisted_4$n = {
2791
3345
  key: 1,
2792
3346
  class: "tao-checkbox__label"
2793
3347
  };
2794
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
3348
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
2795
3349
  ...{ name: "TaoCheckbox" },
2796
3350
  __name: "TaoCheckbox",
2797
3351
  props: {
@@ -2869,25 +3423,25 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
2869
3423
  "aria-invalid": invalid.value || void 0,
2870
3424
  "aria-describedby": describedBy.value,
2871
3425
  onChange: onInputChange
2872
- }, null, 40, _hoisted_2$x),
3426
+ }, null, 40, _hoisted_2$y),
2873
3427
  _cache[0] || (_cache[0] = createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
2874
- __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$p, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$m, [
3428
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$q, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$n, [
2875
3429
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
2876
3430
  ])),
2877
3431
  renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
2878
- ], 10, _hoisted_1$A);
3432
+ ], 10, _hoisted_1$B);
2879
3433
  };
2880
3434
  }
2881
3435
  });
2882
- const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-13f6cd33"]]);
2883
- const _hoisted_1$z = {
3436
+ const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-13f6cd33"]]);
3437
+ const _hoisted_1$A = {
2884
3438
  key: 0,
2885
3439
  class: "tao-tag__prefix"
2886
3440
  };
2887
- const _hoisted_2$w = { class: "tao-tag__text" };
2888
- const _hoisted_3$o = ["aria-label"];
2889
- const _hoisted_4$l = { "aria-hidden": "true" };
2890
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
3441
+ const _hoisted_2$x = { class: "tao-tag__text" };
3442
+ const _hoisted_3$p = ["aria-label"];
3443
+ const _hoisted_4$m = { "aria-hidden": "true" };
3444
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2891
3445
  ...{ name: "TaoTag" },
2892
3446
  __name: "TaoTag",
2893
3447
  props: {
@@ -2939,10 +3493,10 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2939
3493
  ]]),
2940
3494
  style: normalizeStyle(style.value)
2941
3495
  }, [
2942
- _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_1$z, [
3496
+ _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_1$A, [
2943
3497
  renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
2944
3498
  ])) : createCommentVNode("", true),
2945
- createElementVNode("span", _hoisted_2$w, [
3499
+ createElementVNode("span", _hoisted_2$x, [
2946
3500
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
2947
3501
  ]),
2948
3502
  __props.closable ? (openBlock(), createElementBlock("button", {
@@ -2952,27 +3506,27 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2952
3506
  "aria-label": unref(l10n).closeLabel,
2953
3507
  onClick: withModifiers(onClose, ["stop"])
2954
3508
  }, [
2955
- createElementVNode("span", _hoisted_4$l, [
3509
+ createElementVNode("span", _hoisted_4$m, [
2956
3510
  renderSlot(_ctx.$slots, "close-icon", {}, () => [
2957
3511
  _cache[0] || (_cache[0] = createTextVNode("✕", -1))
2958
3512
  ], true)
2959
3513
  ])
2960
- ], 8, _hoisted_3$o)) : createCommentVNode("", true)
3514
+ ], 8, _hoisted_3$p)) : createCommentVNode("", true)
2961
3515
  ], 6);
2962
3516
  };
2963
3517
  }
2964
3518
  });
2965
- const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-ca0b1b42"]]);
2966
- const _hoisted_1$y = ["role", "aria-hidden"];
2967
- const _hoisted_2$v = {
3519
+ const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-ca0b1b42"]]);
3520
+ const _hoisted_1$z = ["role", "aria-hidden"];
3521
+ const _hoisted_2$w = {
2968
3522
  key: 1,
2969
3523
  class: "tao-divider__text"
2970
3524
  };
2971
- const _hoisted_3$n = {
3525
+ const _hoisted_3$o = {
2972
3526
  key: 2,
2973
3527
  class: "tao-divider__line tao-divider__line--end"
2974
3528
  };
2975
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
3529
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
2976
3530
  ...{ name: "TaoDivider" },
2977
3531
  __name: "TaoDivider",
2978
3532
  props: {
@@ -3006,23 +3560,23 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
3006
3560
  key: 0,
3007
3561
  class: normalizeClass(["tao-divider__line", { "tao-divider__line--start": hasLabel.value }])
3008
3562
  }, null, 2)) : createCommentVNode("", true),
3009
- hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_2$v, [
3563
+ hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_2$w, [
3010
3564
  renderSlot(_ctx.$slots, "default", {}, () => [
3011
3565
  createTextVNode(toDisplayString(__props.text), 1)
3012
3566
  ], true)
3013
3567
  ])) : createCommentVNode("", true),
3014
- __props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$n)) : createCommentVNode("", true)
3015
- ], 10, _hoisted_1$y);
3568
+ __props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$o)) : createCommentVNode("", true)
3569
+ ], 10, _hoisted_1$z);
3016
3570
  };
3017
3571
  }
3018
3572
  });
3019
- const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-32544dcc"]]);
3020
- const _hoisted_1$x = {
3573
+ const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-32544dcc"]]);
3574
+ const _hoisted_1$y = {
3021
3575
  key: 0,
3022
3576
  class: "tao-fieldset__legend"
3023
3577
  };
3024
- const _hoisted_2$u = { class: "tao-fieldset__body" };
3025
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
3578
+ const _hoisted_2$v = { class: "tao-fieldset__body" };
3579
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3026
3580
  ...{ name: "TaoFieldset" },
3027
3581
  __name: "TaoFieldset",
3028
3582
  props: {
@@ -3034,20 +3588,20 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3034
3588
  return openBlock(), createElementBlock("fieldset", {
3035
3589
  class: normalizeClass(["tao-fieldset", `tao-fieldset--${__props.align}`])
3036
3590
  }, [
3037
- __props.legend || _ctx.$slots.legend ? (openBlock(), createElementBlock("legend", _hoisted_1$x, [
3591
+ __props.legend || _ctx.$slots.legend ? (openBlock(), createElementBlock("legend", _hoisted_1$y, [
3038
3592
  renderSlot(_ctx.$slots, "legend", {}, () => [
3039
3593
  createTextVNode(toDisplayString(__props.legend), 1)
3040
3594
  ], true)
3041
3595
  ])) : createCommentVNode("", true),
3042
- createElementVNode("div", _hoisted_2$u, [
3596
+ createElementVNode("div", _hoisted_2$v, [
3043
3597
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
3044
3598
  ])
3045
3599
  ], 2);
3046
3600
  };
3047
3601
  }
3048
3602
  });
3049
- const TaoFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-3445dafd"]]);
3050
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
3603
+ const TaoFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-3445dafd"]]);
3604
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
3051
3605
  ...{ name: "TaoAnimatedBorder" },
3052
3606
  __name: "TaoAnimatedBorder",
3053
3607
  props: {
@@ -3071,10 +3625,10 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
3071
3625
  };
3072
3626
  }
3073
3627
  });
3074
- const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-c9434028"]]);
3075
- const _hoisted_1$w = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "readonly", "rows", "value", "aria-invalid", "aria-describedby"];
3076
- const _hoisted_2$t = ["id"];
3077
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
3628
+ const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-c9434028"]]);
3629
+ const _hoisted_1$x = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "readonly", "rows", "value", "aria-invalid", "aria-describedby"];
3630
+ const _hoisted_2$u = ["id"];
3631
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3078
3632
  ...{ name: "TaoTextarea" },
3079
3633
  __name: "TaoTextarea",
3080
3634
  props: {
@@ -3250,21 +3804,21 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
3250
3804
  onFocus,
3251
3805
  onBlur,
3252
3806
  onKeydown
3253
- }, null, 42, _hoisted_1$w),
3807
+ }, null, 42, _hoisted_1$x),
3254
3808
  __props.count ? (openBlock(), createElementBlock("span", {
3255
3809
  key: 0,
3256
3810
  id: counterId.value,
3257
3811
  class: normalizeClass(["tao-textarea__count", { "tao-textarea__count--limit": atLimit.value }])
3258
- }, toDisplayString(countLabel.value), 11, _hoisted_2$t)) : createCommentVNode("", true)
3812
+ }, toDisplayString(countLabel.value), 11, _hoisted_2$u)) : createCommentVNode("", true)
3259
3813
  ], 2));
3260
3814
  };
3261
3815
  }
3262
3816
  });
3263
- const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-50628dd9"]]);
3264
- const _hoisted_1$v = ["tabindex", "aria-label"];
3265
- const _hoisted_2$s = { class: "tao-scroll-top__content" };
3817
+ const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-50628dd9"]]);
3818
+ const _hoisted_1$w = ["tabindex", "aria-label"];
3819
+ const _hoisted_2$t = { class: "tao-scroll-top__content" };
3266
3820
  const RIPPLE_DURATION = 750;
3267
- const _sfc_main$w = /* @__PURE__ */ defineComponent({
3821
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
3268
3822
  ...{ name: "TaoScrollTop" },
3269
3823
  __name: "TaoScrollTop",
3270
3824
  props: {
@@ -3371,7 +3925,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
3371
3925
  "aria-label": props.ariaLabel,
3372
3926
  onClick: withModifiers(onClick, ["prevent"])
3373
3927
  }, [
3374
- createElementVNode("div", _hoisted_2$s, [
3928
+ createElementVNode("div", _hoisted_2$t, [
3375
3929
  createElementVNode("div", {
3376
3930
  class: normalizeClass([{ "tao-scroll-top__ripple--active": isRippleActive.value }, "tao-scroll-top__ripple"]),
3377
3931
  style: normalizeStyle(rippleStyle)
@@ -3388,33 +3942,33 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
3388
3942
  ], -1))
3389
3943
  ], true)
3390
3944
  ])
3391
- ], 14, _hoisted_1$v)) : createCommentVNode("", true)
3945
+ ], 14, _hoisted_1$w)) : createCommentVNode("", true)
3392
3946
  ]),
3393
3947
  _: 3
3394
3948
  });
3395
3949
  };
3396
3950
  }
3397
3951
  });
3398
- const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-89d2feaa"]]);
3399
- const _hoisted_1$u = { class: "tao-progress" };
3400
- const _hoisted_2$r = {
3952
+ const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-89d2feaa"]]);
3953
+ const _hoisted_1$v = { class: "tao-progress" };
3954
+ const _hoisted_2$s = {
3401
3955
  key: 0,
3402
3956
  class: "tao-progress__side"
3403
3957
  };
3404
- const _hoisted_3$m = { class: "tao-progress__main" };
3405
- const _hoisted_4$k = {
3958
+ const _hoisted_3$n = { class: "tao-progress__main" };
3959
+ const _hoisted_4$l = {
3406
3960
  key: 0,
3407
3961
  class: "tao-progress__percentage"
3408
3962
  };
3409
- const _hoisted_5$g = {
3963
+ const _hoisted_5$h = {
3410
3964
  key: 1,
3411
3965
  class: "tao-progress__side"
3412
3966
  };
3413
- const _hoisted_6$d = {
3967
+ const _hoisted_6$e = {
3414
3968
  key: 0,
3415
3969
  class: "tao-progress__percentage"
3416
3970
  };
3417
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
3971
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
3418
3972
  ...{ name: "TaoProgress" },
3419
3973
  __name: "TaoProgress",
3420
3974
  props: {
@@ -3445,16 +3999,16 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
3445
3999
  () => hasRight.value ? `(${props.progress}%)` : `${props.progress}%`
3446
4000
  );
3447
4001
  return (_ctx, _cache) => {
3448
- return openBlock(), createElementBlock("div", _hoisted_1$u, [
4002
+ return openBlock(), createElementBlock("div", _hoisted_1$v, [
3449
4003
  createElementVNode("div", {
3450
4004
  class: normalizeClass(["tao-progress__container", { "tao-progress__container--over": showOverPercent.value }]),
3451
4005
  style: normalizeStyle({ minWidth: `${minW.value}px`, maxWidth: `${maxW.value}px` })
3452
4006
  }, [
3453
- _ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_2$r, [
4007
+ _ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_2$s, [
3454
4008
  renderSlot(_ctx.$slots, "left", {}, void 0, true)
3455
4009
  ])) : createCommentVNode("", true),
3456
- createElementVNode("div", _hoisted_3$m, [
3457
- showOverPercent.value ? (openBlock(), createElementBlock("span", _hoisted_4$k, toDisplayString(__props.progress) + "%", 1)) : createCommentVNode("", true),
4010
+ createElementVNode("div", _hoisted_3$n, [
4011
+ showOverPercent.value ? (openBlock(), createElementBlock("span", _hoisted_4$l, toDisplayString(__props.progress) + "%", 1)) : createCommentVNode("", true),
3458
4012
  createElementVNode("div", {
3459
4013
  class: "tao-progress__track",
3460
4014
  style: normalizeStyle({ height: `${__props.height}px` })
@@ -3465,289 +4019,86 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
3465
4019
  }, null, 6)
3466
4020
  ], 4)
3467
4021
  ]),
3468
- _ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$g, [
4022
+ _ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$h, [
3469
4023
  renderSlot(_ctx.$slots, "right", {}, void 0, true),
3470
- showEndPercent.value ? (openBlock(), createElementBlock("span", _hoisted_6$d, toDisplayString(endPercentLabel.value), 1)) : createCommentVNode("", true)
4024
+ showEndPercent.value ? (openBlock(), createElementBlock("span", _hoisted_6$e, toDisplayString(endPercentLabel.value), 1)) : createCommentVNode("", true)
3471
4025
  ])) : createCommentVNode("", true)
3472
4026
  ], 6)
3473
4027
  ]);
3474
4028
  };
3475
4029
  }
3476
4030
  });
3477
- const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-1aae89cd"]]);
3478
- const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-invalid", "aria-describedby"];
3479
- const _hoisted_2$q = ["placeholder"];
3480
- const _hoisted_3$l = {
3481
- key: 1,
3482
- class: "tao-slider__value"
3483
- };
3484
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
3485
- ...{ name: "TaoSlider" },
3486
- __name: "TaoSlider",
4031
+ const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-1aae89cd"]]);
4032
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
4033
+ ...{ name: "TaoRangeSlider" },
4034
+ __name: "TaoRangeSlider",
3487
4035
  props: {
3488
- min: { default: 0 },
3489
- max: { default: 100 },
3490
- step: { default: 1 },
3491
- showValue: { type: Boolean, default: false },
3492
- placeholder: { default: "" },
3493
- modelValue: {},
3494
- disabled: { type: Boolean, default: false },
3495
- error: { type: Boolean, default: false },
3496
- variant: { default: "bar" },
4036
+ min: {},
4037
+ max: {},
4038
+ step: {},
4039
+ minGap: {},
4040
+ showValue: { type: Boolean },
4041
+ marks: { type: [Boolean, Array] },
4042
+ marksSide: {},
4043
+ discrete: { type: Boolean },
4044
+ format: { type: Function },
4045
+ flat: { type: Boolean },
4046
+ vertical: { type: Boolean },
4047
+ disabled: { type: Boolean },
4048
+ error: { type: Boolean },
4049
+ variant: {},
3497
4050
  size: {},
3498
- wheel: { default: 0 }
4051
+ ariaLabel: {},
4052
+ wheel: {},
4053
+ modelValue: {}
3499
4054
  },
3500
4055
  emits: ["update:modelValue", "change"],
3501
4056
  setup(__props, { emit: __emit }) {
3502
4057
  const props = __props;
3503
4058
  const emit = __emit;
3504
- const field = inject(formFieldKey, null);
3505
- const localId = useId();
3506
- const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
3507
- const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
3508
- const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
3509
- function packModelValue(value) {
3510
- return typeof props.modelValue === "string" ? `${value}` : value;
3511
- }
3512
- function unpackModelValue() {
3513
- const raw = typeof props.modelValue === "string" ? parseFloat(props.modelValue) : props.modelValue;
3514
- return Number.isFinite(raw) ? raw : props.min;
3515
- }
3516
- const current2 = computed(() => unpackModelValue());
3517
- const trackRef = ref(null);
3518
- const isDragging = ref(false);
3519
- let dragPointer = -1;
3520
- let dragStartValue = 0;
3521
- const shadowInputRef = ref(null);
3522
- const shadowModel = ref("0");
3523
- const showShadowModel = ref(false);
3524
- const progressPercent = computed(() => {
3525
- const range = props.max - props.min;
3526
- if (range <= 0) {
3527
- return 0;
3528
- }
3529
- return (current2.value - props.min) / range * 100;
3530
- });
3531
- function clampValue(v) {
3532
- return Math.min(Math.max(v, props.min), props.max);
3533
- }
3534
- function commit(value, final = false) {
3535
- const next = clampValue(value);
3536
- const changed = next !== current2.value;
3537
- emit("update:modelValue", packModelValue(next));
3538
- if (final && changed) {
3539
- emit("change", packModelValue(next));
3540
- }
3541
- }
3542
- function calculateValue(event) {
3543
- if (!trackRef.value) {
3544
- return props.min;
3545
- }
3546
- const rect = trackRef.value.getBoundingClientRect();
3547
- const x = Math.min(Math.max(event.clientX - rect.left, 0), rect.width);
3548
- const ratio = rect.width ? x / rect.width : 0;
3549
- const v = props.min + ratio * (props.max - props.min);
3550
- return clampValue(Math.round((v - props.min) / props.step) * props.step + props.min);
3551
- }
3552
- function releaseDragCapture() {
3553
- const el = trackRef.value;
3554
- const id = dragPointer;
3555
- if (!el || id === -1) {
3556
- return;
3557
- }
3558
- if (typeof el.hasPointerCapture === "function" && !el.hasPointerCapture(id)) {
3559
- return;
3560
- }
3561
- try {
3562
- el.releasePointerCapture(id);
3563
- } catch {
3564
- }
3565
- }
3566
- function endDrag() {
3567
- if (!isDragging.value) {
3568
- return;
3569
- }
3570
- isDragging.value = false;
3571
- releaseDragCapture();
3572
- dragPointer = -1;
3573
- if (current2.value !== dragStartValue) {
3574
- emit("change", packModelValue(current2.value));
3575
- }
3576
- }
3577
- function onPointerDown(event) {
3578
- if (props.disabled || showShadowModel.value || event.button !== 0 || !trackRef.value) {
3579
- return;
3580
- }
3581
- dragPointer = event.pointerId;
3582
- dragStartValue = current2.value;
3583
- isDragging.value = true;
3584
- commit(calculateValue(event));
3585
- event.preventDefault();
3586
- try {
3587
- trackRef.value.setPointerCapture(event.pointerId);
3588
- } catch {
3589
- }
3590
- }
3591
- function onPointerMove(event) {
3592
- if (!isDragging.value || event.pointerId !== dragPointer) {
3593
- return;
3594
- }
3595
- commit(calculateValue(event));
3596
- }
3597
- function onPointerEnd(event) {
3598
- if (!isDragging.value) {
3599
- return;
3600
- }
3601
- if (dragPointer !== -1 && event.pointerId !== dragPointer) {
3602
- return;
3603
- }
3604
- endDrag();
3605
- }
3606
- function onLostPointerCapture() {
3607
- endDrag();
3608
- }
3609
- function onKeydown(event) {
3610
- if (props.disabled || showShadowModel.value) {
3611
- return;
3612
- }
3613
- const keys = {
3614
- ArrowLeft: -props.step,
3615
- ArrowDown: -props.step,
3616
- ArrowRight: props.step,
3617
- ArrowUp: props.step,
3618
- PageDown: -props.step * 10,
3619
- PageUp: props.step * 10
3620
- };
3621
- if (event.key in keys) {
3622
- event.preventDefault();
3623
- commit(current2.value + keys[event.key], true);
3624
- return;
3625
- }
3626
- if (event.key === "Home") {
3627
- event.preventDefault();
3628
- commit(props.min, true);
3629
- return;
3630
- }
3631
- if (event.key === "End") {
3632
- event.preventDefault();
3633
- commit(props.max, true);
3634
- }
3635
- }
3636
- function onWheel(event) {
3637
- if (props.disabled || props.wheel <= 0 || showShadowModel.value) {
3638
- return;
3639
- }
3640
- event.preventDefault();
3641
- const delta = event.deltaY < 0 ? props.wheel : -props.wheel;
3642
- commit(current2.value + delta, true);
3643
- }
3644
- function onBlurShadowModel() {
3645
- if (shadowModel.value) {
3646
- const next = clampValue(parseFloat(shadowModel.value) || 0);
3647
- shadowModel.value = `${packModelValue(next)}`;
3648
- commit(next, true);
3649
- }
3650
- showShadowModel.value = false;
3651
- }
3652
- function onShadowKeydown(event) {
3653
- var _a;
3654
- if (event.key === "Enter") {
3655
- (_a = shadowInputRef.value) == null ? void 0 : _a.blur();
3656
- }
3657
- }
3658
- function onContextMenu() {
3659
- if (props.disabled || !props.showValue) {
3660
- return;
3661
- }
3662
- shadowModel.value = `${props.modelValue}`;
3663
- showShadowModel.value = true;
3664
- requestAnimationFrame(() => {
3665
- var _a;
3666
- return (_a = shadowInputRef.value) == null ? void 0 : _a.focus();
3667
- });
3668
- }
3669
- let stopFocusLoss;
3670
- onMounted(() => {
3671
- stopFocusLoss = listenFocusLoss(endDrag);
3672
- });
3673
- onBeforeUnmount(() => {
3674
- endDrag();
3675
- stopFocusLoss == null ? void 0 : stopFocusLoss();
3676
- });
3677
4059
  return (_ctx, _cache) => {
3678
- return openBlock(), createElementBlock("div", {
3679
- id: controlId.value,
3680
- ref_key: "trackRef",
3681
- ref: trackRef,
3682
- class: normalizeClass(["tao-slider", [
3683
- `tao-slider--${__props.variant}`,
3684
- unref(sizeClass)(__props.size),
3685
- { "tao-slider--show-value": __props.showValue, "tao-slider--disabled": __props.disabled, "tao-slider--invalid": invalid.value }
3686
- ]]),
3687
- role: "slider",
3688
- tabindex: __props.disabled ? -1 : 0,
3689
- "aria-valuemin": __props.min,
3690
- "aria-valuemax": __props.max,
3691
- "aria-valuenow": current2.value,
3692
- "aria-disabled": __props.disabled || void 0,
3693
- "aria-invalid": invalid.value || void 0,
3694
- "aria-describedby": describedBy.value,
3695
- onContextmenu: withModifiers(onContextMenu, ["prevent"]),
3696
- onPointerdown: onPointerDown,
3697
- onPointermove: onPointerMove,
3698
- onPointerup: onPointerEnd,
3699
- onPointercancel: onPointerEnd,
3700
- onLostpointercapture: onLostPointerCapture,
3701
- onKeydown,
3702
- onWheel
3703
- }, [
3704
- _cache[2] || (_cache[2] = createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
3705
- createElementVNode("div", {
3706
- class: "tao-slider__fill",
3707
- style: normalizeStyle({ width: `${progressPercent.value}%` })
3708
- }, null, 4),
3709
- createElementVNode("div", {
3710
- class: "tao-slider__thumb",
3711
- style: normalizeStyle({ left: `${progressPercent.value}%` })
3712
- }, null, 4),
3713
- showShadowModel.value ? withDirectives((openBlock(), createElementBlock("input", {
3714
- key: 0,
3715
- ref_key: "shadowInputRef",
3716
- ref: shadowInputRef,
3717
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => shadowModel.value = $event),
3718
- type: "number",
3719
- inputmode: "numeric",
3720
- placeholder: __props.placeholder,
3721
- class: "tao-slider__shadow-input",
3722
- onBlur: onBlurShadowModel,
3723
- onKeydown: onShadowKeydown,
3724
- onPointerdown: _cache[1] || (_cache[1] = withModifiers(() => {
3725
- }, ["stop"]))
3726
- }, null, 40, _hoisted_2$q)), [
3727
- [vModelText, shadowModel.value]
3728
- ]) : __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$l, [
3729
- renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
3730
- createTextVNode(toDisplayString(__props.modelValue), 1),
3731
- renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
3732
- ])) : createCommentVNode("", true)
3733
- ], 42, _hoisted_1$t);
4060
+ return openBlock(), createBlock(TaoSliderBase, mergeProps(props, {
4061
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
4062
+ onChange: _cache[1] || (_cache[1] = ($event) => emit("change", $event))
4063
+ }), createSlots({ _: 2 }, [
4064
+ _ctx.$slots.mark ? {
4065
+ name: "mark",
4066
+ fn: withCtx((slot) => [
4067
+ renderSlot(_ctx.$slots, "mark", normalizeProps(guardReactiveProps(slot)))
4068
+ ]),
4069
+ key: "0"
4070
+ } : void 0,
4071
+ _ctx.$slots["pre-value"] ? {
4072
+ name: "pre-value",
4073
+ fn: withCtx(() => [
4074
+ renderSlot(_ctx.$slots, "pre-value")
4075
+ ]),
4076
+ key: "1"
4077
+ } : void 0,
4078
+ _ctx.$slots["post-value"] ? {
4079
+ name: "post-value",
4080
+ fn: withCtx(() => [
4081
+ renderSlot(_ctx.$slots, "post-value")
4082
+ ]),
4083
+ key: "2"
4084
+ } : void 0
4085
+ ]), 1040);
3734
4086
  };
3735
4087
  }
3736
4088
  });
3737
- const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-47d32e2a"]]);
3738
- const _hoisted_1$s = { class: "tao-file-drop__row" };
3739
- const _hoisted_2$p = ["aria-label"];
3740
- const _hoisted_3$k = { "aria-hidden": "true" };
3741
- const _hoisted_4$j = ["accept", "multiple"];
3742
- const _hoisted_5$f = {
4089
+ const _hoisted_1$u = { class: "tao-file-drop__row" };
4090
+ const _hoisted_2$r = ["aria-label"];
4091
+ const _hoisted_3$m = { "aria-hidden": "true" };
4092
+ const _hoisted_4$k = ["accept", "multiple"];
4093
+ const _hoisted_5$g = {
3743
4094
  key: 0,
3744
4095
  class: "tao-file-drop__list"
3745
4096
  };
3746
- const _hoisted_6$c = { class: "tao-file-drop__name" };
3747
- const _hoisted_7$a = { class: "tao-file-drop__meta" };
3748
- const _hoisted_8$9 = ["aria-label", "onClick"];
4097
+ const _hoisted_6$d = { class: "tao-file-drop__name" };
4098
+ const _hoisted_7$b = { class: "tao-file-drop__meta" };
4099
+ const _hoisted_8$a = ["aria-label", "onClick"];
3749
4100
  const _hoisted_9$4 = { "aria-hidden": "true" };
3750
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
4101
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
3751
4102
  ...{ name: "TaoFileDrop" },
3752
4103
  __name: "TaoFileDrop",
3753
4104
  props: {
@@ -3887,7 +4238,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3887
4238
  return openBlock(), createElementBlock("div", {
3888
4239
  class: normalizeClass(["tao-file-drop", unref(sizeClass)(__props.size)])
3889
4240
  }, [
3890
- createElementVNode("div", _hoisted_1$s, [
4241
+ createElementVNode("div", _hoisted_1$u, [
3891
4242
  __props.showClear && __props.modelValue.length ? (openBlock(), createElementBlock("button", {
3892
4243
  key: 0,
3893
4244
  type: "button",
@@ -3895,12 +4246,12 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3895
4246
  "aria-label": unref(l10n).clearLabel,
3896
4247
  onClick: requestClear
3897
4248
  }, [
3898
- createElementVNode("span", _hoisted_3$k, [
4249
+ createElementVNode("span", _hoisted_3$m, [
3899
4250
  renderSlot(_ctx.$slots, "clear-icon", {}, () => [
3900
4251
  _cache[1] || (_cache[1] = createTextVNode("✕", -1))
3901
4252
  ], true)
3902
4253
  ])
3903
- ], 8, _hoisted_2$p)) : createCommentVNode("", true),
4254
+ ], 8, _hoisted_2$r)) : createCommentVNode("", true),
3904
4255
  createElementVNode("label", {
3905
4256
  class: normalizeClass(["tao-file-drop__zone", { "tao-file-drop__zone--dragging": isDragging.value }]),
3906
4257
  onDragover: handleDragOver,
@@ -3920,17 +4271,17 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3920
4271
  onChange: handleFileSelect,
3921
4272
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
3922
4273
  }, ["stop"]))
3923
- }, null, 40, _hoisted_4$j)
4274
+ }, null, 40, _hoisted_4$k)
3924
4275
  ], 34)
3925
4276
  ]),
3926
- __props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul", _hoisted_5$f, [
4277
+ __props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul", _hoisted_5$g, [
3927
4278
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (file, index) => {
3928
4279
  return openBlock(), createElementBlock("li", {
3929
4280
  key: fileKey(file, index),
3930
4281
  class: "tao-file-drop__file"
3931
4282
  }, [
3932
- createElementVNode("span", _hoisted_6$c, toDisplayString(file.name), 1),
3933
- createElementVNode("span", _hoisted_7$a, toDisplayString(sizeLabel(file.size)), 1),
4283
+ createElementVNode("span", _hoisted_6$d, toDisplayString(file.name), 1),
4284
+ createElementVNode("span", _hoisted_7$b, toDisplayString(sizeLabel(file.size)), 1),
3934
4285
  createElementVNode("button", {
3935
4286
  type: "button",
3936
4287
  class: "tao-file-drop__remove",
@@ -3942,7 +4293,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3942
4293
  _cache[2] || (_cache[2] = createTextVNode("✕", -1))
3943
4294
  ], true)
3944
4295
  ])
3945
- ], 8, _hoisted_8$9)
4296
+ ], 8, _hoisted_8$a)
3946
4297
  ]);
3947
4298
  }), 128))
3948
4299
  ])) : createCommentVNode("", true)
@@ -3950,15 +4301,15 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
3950
4301
  };
3951
4302
  }
3952
4303
  });
3953
- const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-f8c58faa"]]);
3954
- const _hoisted_1$r = ["aria-expanded", "aria-label"];
3955
- const _hoisted_2$o = {
4304
+ const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-f8c58faa"]]);
4305
+ const _hoisted_1$t = ["aria-expanded", "aria-label"];
4306
+ const _hoisted_2$q = {
3956
4307
  key: 1,
3957
4308
  "aria-hidden": "true"
3958
4309
  };
3959
- const _hoisted_3$j = ["onClick", "onMouseenter"];
3960
- const _hoisted_4$i = { key: 1 };
3961
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
4310
+ const _hoisted_3$l = ["onClick", "onMouseenter"];
4311
+ const _hoisted_4$j = { key: 1 };
4312
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
3962
4313
  ...{ name: "TaoDropdownMenu" },
3963
4314
  __name: "TaoDropdownMenu",
3964
4315
  props: {
@@ -4100,12 +4451,12 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4100
4451
  "aria-label": _ctx.$slots.button ? void 0 : unref(l10n).menuLabel,
4101
4452
  onClick: toggleMenu
4102
4453
  }, [
4103
- _ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$o, [
4454
+ _ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$q, [
4104
4455
  renderSlot(_ctx.$slots, "icon", {}, () => [
4105
4456
  _cache[0] || (_cache[0] = createTextVNode("⋮", -1))
4106
4457
  ], true)
4107
4458
  ]))
4108
- ], 8, _hoisted_1$r),
4459
+ ], 8, _hoisted_1$t),
4109
4460
  (openBlock(), createBlock(Teleport, { to: "body" }, [
4110
4461
  isOpen.value ? (openBlock(), createElementBlock("div", {
4111
4462
  key: 0,
@@ -4130,8 +4481,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4130
4481
  id: action.id,
4131
4482
  ico: action.ico,
4132
4483
  text: action.name
4133
- }, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_4$i, toDisplayString(action.name), 1))
4134
- ], 42, _hoisted_3$j);
4484
+ }, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_4$j, toDisplayString(action.name), 1))
4485
+ ], 42, _hoisted_3$l);
4135
4486
  }), 128))
4136
4487
  ], 36)) : createCommentVNode("", true)
4137
4488
  ]))
@@ -4139,10 +4490,10 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4139
4490
  };
4140
4491
  }
4141
4492
  });
4142
- const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5db490aa"]]);
4143
- const _hoisted_1$q = ["aria-invalid", "aria-describedby"];
4144
- const _hoisted_2$n = ["id", "value", "placeholder", "type", "disabled", "aria-invalid", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
4145
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
4493
+ const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-5db490aa"]]);
4494
+ const _hoisted_1$s = ["aria-invalid", "aria-describedby"];
4495
+ const _hoisted_2$p = ["id", "value", "placeholder", "type", "disabled", "aria-invalid", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
4496
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
4146
4497
  ...{ name: "TaoPinCode" },
4147
4498
  __name: "TaoPinCode",
4148
4499
  props: {
@@ -4361,14 +4712,14 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
4361
4712
  onKeydown: ($event) => onKeydown($event, index),
4362
4713
  onFocus: ($event) => onFocus(index),
4363
4714
  onBlur
4364
- }, null, 42, _hoisted_2$n);
4715
+ }, null, 42, _hoisted_2$p);
4365
4716
  }), 128))
4366
- ], 10, _hoisted_1$q);
4717
+ ], 10, _hoisted_1$s);
4367
4718
  };
4368
4719
  }
4369
4720
  });
4370
- const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-6f0df8bd"]]);
4371
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
4721
+ const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-6f0df8bd"]]);
4722
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4372
4723
  ...{ name: "TaoLink" },
4373
4724
  __name: "TaoLink",
4374
4725
  props: {
@@ -4415,8 +4766,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
4415
4766
  };
4416
4767
  }
4417
4768
  });
4418
- const _hoisted_1$p = ["for"];
4419
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
4769
+ const _hoisted_1$r = ["for"];
4770
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
4420
4771
  ...{ name: "TaoFormField" },
4421
4772
  __name: "TaoFormField",
4422
4773
  props: {
@@ -4467,7 +4818,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4467
4818
  class: "tao-form-field__label",
4468
4819
  for: unref(id),
4469
4820
  onClick: onLabelClick
4470
- }, toDisplayString(__props.label), 9, _hoisted_1$p)) : createCommentVNode("", true),
4821
+ }, toDisplayString(__props.label), 9, _hoisted_1$r)) : createCommentVNode("", true),
4471
4822
  renderSlot(_ctx.$slots, "default", {}, void 0, true),
4472
4823
  __props.error ? (openBlock(), createElementBlock("p", {
4473
4824
  key: 1,
@@ -4482,12 +4833,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4482
4833
  };
4483
4834
  }
4484
4835
  });
4485
- const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-3cf90e3a"]]);
4486
- const _hoisted_1$o = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
4487
- const _hoisted_2$m = { class: "tao-select__value" };
4488
- const _hoisted_3$i = ["aria-activedescendant"];
4489
- const _hoisted_4$h = ["id", "aria-selected", "aria-disabled", "data-tao-select-index", "onClick", "onMouseenter"];
4490
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
4836
+ const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-3cf90e3a"]]);
4837
+ const _hoisted_1$q = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
4838
+ const _hoisted_2$o = { class: "tao-select__value" };
4839
+ const _hoisted_3$k = ["aria-activedescendant"];
4840
+ const _hoisted_4$i = ["id", "aria-selected", "aria-disabled", "data-tao-select-index", "onClick", "onMouseenter"];
4841
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
4491
4842
  ...{ name: "TaoSelect" },
4492
4843
  __name: "TaoSelect",
4493
4844
  props: {
@@ -4710,14 +5061,14 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
4710
5061
  onClick: toggle,
4711
5062
  onKeydown: onTriggerKeydown
4712
5063
  }, [
4713
- createElementVNode("span", _hoisted_2$m, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? unref(l10n).placeholder), 1),
5064
+ createElementVNode("span", _hoisted_2$o, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? unref(l10n).placeholder), 1),
4714
5065
  createElementVNode("span", {
4715
5066
  class: normalizeClass(["tao-select__chevron", { "tao-select__chevron--custom": _ctx.$slots.chevron }]),
4716
5067
  "aria-hidden": "true"
4717
5068
  }, [
4718
5069
  renderSlot(_ctx.$slots, "chevron", {}, void 0, true)
4719
5070
  ], 2)
4720
- ], 42, _hoisted_1$o),
5071
+ ], 42, _hoisted_1$q),
4721
5072
  (openBlock(), createBlock(Teleport, { to: "body" }, [
4722
5073
  open.value ? (openBlock(), createElementBlock("div", {
4723
5074
  key: 0,
@@ -4753,9 +5104,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
4753
5104
  }, ["prevent"])),
4754
5105
  onClick: ($event) => selectOption(option),
4755
5106
  onMouseenter: ($event) => !option.disabled && (activeIndex.value = index)
4756
- }, toDisplayString(option.label), 43, _hoisted_4$h);
5107
+ }, toDisplayString(option.label), 43, _hoisted_4$i);
4757
5108
  }), 128))
4758
- ], 40, _hoisted_3$i),
5109
+ ], 40, _hoisted_3$k),
4759
5110
  __props.clearable && selected.value ? (openBlock(), createElementBlock("button", {
4760
5111
  key: 0,
4761
5112
  type: "button",
@@ -4774,55 +5125,804 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
4774
5125
  };
4775
5126
  }
4776
5127
  });
4777
- const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-47d327a3"]]);
4778
- const _hoisted_1$n = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
4779
- const _hoisted_2$l = {
5128
+ const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-47d327a3"]]);
5129
+ const clamp = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
5130
+ const byte = (v) => Math.round(clamp(v, 0, 255));
5131
+ const hex2 = (v) => byte(v).toString(16).padStart(2, "0");
5132
+ function channel(text, scale) {
5133
+ const t = text.trim();
5134
+ return t.endsWith("%") ? parseFloat(t) / 100 * scale : parseFloat(t);
5135
+ }
5136
+ function parseColor(input) {
5137
+ const text = input.trim();
5138
+ const hex = /^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(text);
5139
+ if (hex) {
5140
+ let h = hex[1];
5141
+ if (h.length <= 4) h = [...h].map((c) => c + c).join("");
5142
+ const n = (i) => parseInt(h.slice(i, i + 2), 16);
5143
+ return { r: n(0), g: n(2), b: n(4), a: h.length === 8 ? n(6) / 255 : 1 };
5144
+ }
5145
+ const fn = /^(rgba?|hsla?)\(\s*([^)]+?)\s*\)$/i.exec(text);
5146
+ if (fn && fn[1].toLowerCase().startsWith("hsl")) {
5147
+ const [main, slash] = fn[2].split("/");
5148
+ const parts = main.trim().split(/[\s,]+/);
5149
+ const alphaText = slash !== void 0 ? slash : parts[3];
5150
+ if (parts.length < 3 || parts.length > (slash === void 0 ? 4 : 3)) return null;
5151
+ const h = parseFloat(parts[0]);
5152
+ const s = parseFloat(parts[1]) / 100;
5153
+ const l = parseFloat(parts[2]) / 100;
5154
+ const a = alphaText === void 0 ? 1 : channel(alphaText, 1);
5155
+ if ([h, s, l, a].some((v) => Number.isNaN(v))) return null;
5156
+ return { ...hslToRgb(h, s, l), a: clamp(a, 0, 1) };
5157
+ }
5158
+ if (fn) {
5159
+ const [main, slash] = fn[2].split("/");
5160
+ const parts = main.trim().split(/[\s,]+/);
5161
+ const alphaText = slash !== void 0 ? slash : parts[3];
5162
+ if (parts.length < 3 || parts.length > (slash === void 0 ? 4 : 3)) return null;
5163
+ const r = channel(parts[0], 255);
5164
+ const g = channel(parts[1], 255);
5165
+ const b = channel(parts[2], 255);
5166
+ const a = alphaText === void 0 ? 1 : channel(alphaText, 1);
5167
+ if ([r, g, b, a].some((v) => Number.isNaN(v))) return null;
5168
+ return { r: byte(r), g: byte(g), b: byte(b), a: clamp(a, 0, 1) };
5169
+ }
5170
+ return null;
5171
+ }
5172
+ function toHex(color, alpha = false) {
5173
+ const base = `#${hex2(color.r)}${hex2(color.g)}${hex2(color.b)}`;
5174
+ return alpha ? `${base}${hex2(clamp(color.a, 0, 1) * 255)}` : base;
5175
+ }
5176
+ function rgbToHsv(r, g, b) {
5177
+ const R = clamp(r, 0, 255) / 255;
5178
+ const G = clamp(g, 0, 255) / 255;
5179
+ const B = clamp(b, 0, 255) / 255;
5180
+ const max = Math.max(R, G, B);
5181
+ const d = max - Math.min(R, G, B);
5182
+ let h = 0;
5183
+ if (d > 0) {
5184
+ if (max === R) h = (G - B) / d % 6;
5185
+ else if (max === G) h = (B - R) / d + 2;
5186
+ else h = (R - G) / d + 4;
5187
+ h *= 60;
5188
+ if (h < 0) h += 360;
5189
+ }
5190
+ return { h, s: max === 0 ? 0 : d / max, v: max };
5191
+ }
5192
+ function hsvToRgb(h, s, v) {
5193
+ const H = (h % 360 + 360) % 360 / 60;
5194
+ const S = clamp(s, 0, 1);
5195
+ const V = clamp(v, 0, 1);
5196
+ const f = (n) => {
5197
+ const k = (n + H) % 6;
5198
+ return V - V * S * Math.max(0, Math.min(k, 4 - k, 1));
5199
+ };
5200
+ return { r: f(5) * 255, g: f(3) * 255, b: f(1) * 255 };
5201
+ }
5202
+ function rgbToHsl(r, g, b) {
5203
+ const { h, s: sv, v } = rgbToHsv(r, g, b);
5204
+ const l = v * (1 - sv / 2);
5205
+ return { h, s: l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l), l };
5206
+ }
5207
+ function hslToRgb(h, s, l) {
5208
+ const S = clamp(s, 0, 1);
5209
+ const L = clamp(l, 0, 1);
5210
+ const v = L + S * Math.min(L, 1 - L);
5211
+ const rgb = hsvToRgb(h, v === 0 ? 0 : 2 * (1 - L / v), v);
5212
+ return { r: byte(rgb.r), g: byte(rgb.g), b: byte(rgb.b) };
5213
+ }
5214
+ const rgbaToHsva = (c) => ({ ...rgbToHsv(c.r, c.g, c.b), a: c.a });
5215
+ const hsvaToRgba = (c) => ({ ...hsvToRgb(c.h, c.s, c.v), a: c.a });
5216
+ const linearToSrgb = (c) => {
5217
+ const x = clamp(c, 0, 1);
5218
+ return x <= 31308e-7 ? x * 12.92 : 1.055 * Math.pow(x, 1 / 2.4) - 0.055;
5219
+ };
5220
+ const srgbToLinear = (c) => {
5221
+ const x = clamp(c, 0, 1);
5222
+ return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
5223
+ };
5224
+ function normalizeHex(input, alpha = false) {
5225
+ const c = parseColor(input);
5226
+ return c ? toHex(c, alpha) : null;
5227
+ }
5228
+ const segmentedKey = Symbol("taoSegmented");
5229
+ const _hoisted_1$p = ["disabled", "aria-describedby", "aria-invalid", "aria-labelledby", "id"];
5230
+ const _hoisted_2$n = {
4780
5231
  key: 0,
4781
- class: "tao-combobox__empty"
5232
+ class: "tao-segmented__legend"
4782
5233
  };
4783
- const _hoisted_3$h = ["id", "aria-selected", "aria-disabled", "data-tao-combobox-index", "onClick", "onMouseenter"];
4784
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
4785
- ...{ name: "TaoCombobox" },
4786
- __name: "TaoCombobox",
5234
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
5235
+ ...{ name: "TaoSegmented" },
5236
+ __name: "TaoSegmented",
4787
5237
  props: {
4788
- modelValue: { default: null },
4789
- options: { default: () => [] },
4790
- placeholder: {},
5238
+ modelValue: { type: [String, Number, Boolean] },
5239
+ name: {},
5240
+ legend: {},
4791
5241
  disabled: { type: Boolean, default: false },
4792
5242
  error: { type: Boolean, default: false },
4793
- emptyText: {},
4794
- clearText: {},
4795
- clearable: { type: Boolean, default: true },
4796
5243
  size: {},
4797
- allowCreate: { type: Boolean, default: false }
5244
+ block: { type: Boolean, default: false }
4798
5245
  },
4799
- emits: ["update:modelValue", "change", "create"],
5246
+ emits: ["update:modelValue", "change"],
4800
5247
  setup(__props, { emit: __emit }) {
4801
5248
  const props = __props;
4802
- const l10n = useLocaleText(props, "combobox");
4803
5249
  const emit = __emit;
4804
5250
  const field = inject(formFieldKey, null);
4805
- const localId = useId();
4806
- const listId = `${localId}-list`;
4807
- const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
5251
+ const autoName = useId();
5252
+ const groupName = computed(() => props.name || autoName);
5253
+ const model = computed(() => props.modelValue);
5254
+ const groupDisabled = computed(() => props.disabled);
4808
5255
  const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
4809
5256
  const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
4810
- const open = ref(false);
4811
- const focused = ref(false);
4812
- const picking = ref(false);
4813
- const skipFocusOpen = ref(false);
4814
- const query = ref("");
4815
- const activeIndex = ref(-1);
4816
- const fieldRef = ref(null);
4817
- const inputRef = ref(null);
4818
- const panelRef = ref(null);
4819
- const panelSize = ref("medium");
4820
- const listRef = ref(null);
4821
- const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
4822
- const selected = computed(() => {
4823
- const found = props.options.find((option) => option.value === props.modelValue);
4824
- if (found) {
4825
- return found;
5257
+ const trackRef = ref(null);
5258
+ const thumbStyle = ref({ opacity: "0" });
5259
+ let resizeObserver = null;
5260
+ let mutationObserver = null;
5261
+ function setValue(value) {
5262
+ emit("update:modelValue", value);
5263
+ emit("change", value);
5264
+ }
5265
+ function updateThumb() {
5266
+ const track = trackRef.value;
5267
+ if (!track) {
5268
+ return;
5269
+ }
5270
+ const selected = track.querySelector(".tao-segmented-option--checked");
5271
+ if (!selected) {
5272
+ if (thumbStyle.value.opacity !== "0") {
5273
+ thumbStyle.value = { opacity: "0" };
5274
+ }
5275
+ return;
5276
+ }
5277
+ const trackBox = track.getBoundingClientRect();
5278
+ const optionBox = selected.getBoundingClientRect();
5279
+ const next = {
5280
+ width: `${optionBox.width}px`,
5281
+ height: `${optionBox.height}px`,
5282
+ transform: `translate(${optionBox.left - trackBox.left - track.clientLeft}px, ${optionBox.top - trackBox.top - track.clientTop}px)`,
5283
+ opacity: "1"
5284
+ };
5285
+ const prev = thumbStyle.value;
5286
+ if (prev.width === next.width && prev.height === next.height && prev.transform === next.transform && prev.opacity === next.opacity) {
5287
+ return;
5288
+ }
5289
+ thumbStyle.value = next;
5290
+ }
5291
+ provide(segmentedKey, {
5292
+ name: groupName,
5293
+ model,
5294
+ disabled: groupDisabled,
5295
+ setValue
5296
+ });
5297
+ onMounted(() => {
5298
+ const track = trackRef.value;
5299
+ void nextTick(updateThumb);
5300
+ if (!track) {
5301
+ return;
5302
+ }
5303
+ if (typeof ResizeObserver !== "undefined") {
5304
+ resizeObserver = new ResizeObserver(() => updateThumb());
5305
+ resizeObserver.observe(track);
5306
+ }
5307
+ mutationObserver = new MutationObserver(() => updateThumb());
5308
+ mutationObserver.observe(track, {
5309
+ subtree: true,
5310
+ childList: true,
5311
+ attributes: true,
5312
+ attributeFilter: ["class"]
5313
+ });
5314
+ });
5315
+ watch(
5316
+ () => [props.modelValue, props.size, props.block, props.disabled],
5317
+ () => {
5318
+ void nextTick(updateThumb);
5319
+ }
5320
+ );
5321
+ onBeforeUnmount(() => {
5322
+ resizeObserver == null ? void 0 : resizeObserver.disconnect();
5323
+ resizeObserver = null;
5324
+ mutationObserver == null ? void 0 : mutationObserver.disconnect();
5325
+ mutationObserver = null;
5326
+ });
5327
+ return (_ctx, _cache) => {
5328
+ var _a;
5329
+ return openBlock(), createElementBlock("fieldset", {
5330
+ class: normalizeClass(["tao-segmented", [
5331
+ unref(sizeClass)(__props.size),
5332
+ {
5333
+ "tao-segmented--block": __props.block,
5334
+ "tao-segmented--disabled": __props.disabled,
5335
+ "tao-segmented--invalid": invalid.value
5336
+ }
5337
+ ]]),
5338
+ disabled: __props.disabled,
5339
+ "aria-describedby": describedBy.value,
5340
+ "aria-invalid": invalid.value || void 0,
5341
+ "aria-labelledby": __props.legend ? void 0 : unref(field) ? `${unref(field).id}-label` : void 0,
5342
+ id: (_a = unref(field)) == null ? void 0 : _a.id
5343
+ }, [
5344
+ __props.legend ? (openBlock(), createElementBlock("legend", _hoisted_2$n, toDisplayString(__props.legend), 1)) : createCommentVNode("", true),
5345
+ createElementVNode("div", {
5346
+ ref_key: "trackRef",
5347
+ ref: trackRef,
5348
+ class: "tao-segmented__track"
5349
+ }, [
5350
+ createElementVNode("div", {
5351
+ class: "tao-segmented__thumb",
5352
+ style: normalizeStyle(thumbStyle.value),
5353
+ "aria-hidden": "true"
5354
+ }, null, 4),
5355
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
5356
+ ], 512)
5357
+ ], 10, _hoisted_1$p);
5358
+ };
5359
+ }
5360
+ });
5361
+ const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-7dc6820f"]]);
5362
+ const _hoisted_1$o = ["for"];
5363
+ const _hoisted_2$m = ["id", "name", "value", "checked", "disabled", "aria-label"];
5364
+ const _hoisted_3$j = { class: "tao-segmented-option__face" };
5365
+ const _hoisted_4$h = {
5366
+ key: 0,
5367
+ class: "tao-segmented-option__icon",
5368
+ "aria-hidden": "true"
5369
+ };
5370
+ const _hoisted_5$f = {
5371
+ key: 1,
5372
+ class: "tao-segmented-option__label"
5373
+ };
5374
+ const _hoisted_6$c = {
5375
+ key: 2,
5376
+ class: "tao-segmented-option__sr"
5377
+ };
5378
+ const _hoisted_7$a = {
5379
+ key: 3,
5380
+ class: "tao-segmented-option__count"
5381
+ };
5382
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
5383
+ ...{ name: "TaoSegmentedOption" },
5384
+ __name: "TaoSegmentedOption",
5385
+ props: {
5386
+ value: { type: [String, Number, Boolean] },
5387
+ modelValue: { type: [String, Number, Boolean] },
5388
+ name: {},
5389
+ label: { default: "" },
5390
+ icon: { default: "" },
5391
+ count: {},
5392
+ disabled: { type: Boolean, default: false },
5393
+ ariaLabel: {}
5394
+ },
5395
+ emits: ["update:modelValue", "change"],
5396
+ setup(__props, { emit: __emit }) {
5397
+ const props = __props;
5398
+ const emit = __emit;
5399
+ const group = inject(segmentedKey, null);
5400
+ const slots = useSlots();
5401
+ const localId = useId();
5402
+ const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
5403
+ const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
5404
+ const isChecked = computed(() => {
5405
+ const current2 = group ? group.model.value : props.modelValue;
5406
+ return current2 === props.value;
5407
+ });
5408
+ const hasLabel = computed(() => Boolean(props.label || slots.default));
5409
+ const isIconOnly = computed(() => Boolean((props.icon || slots.icon) && !hasLabel.value));
5410
+ const countLabel = computed(() => {
5411
+ if (props.count === void 0 || props.count === null || props.count === "") {
5412
+ return "";
5413
+ }
5414
+ if (typeof props.count === "number") {
5415
+ if (props.count > 99) {
5416
+ return "99+";
5417
+ }
5418
+ return String(props.count);
5419
+ }
5420
+ return String(props.count);
5421
+ });
5422
+ function onChange() {
5423
+ if (isDisabled.value) {
5424
+ return;
5425
+ }
5426
+ if (group) {
5427
+ group.setValue(props.value);
5428
+ return;
5429
+ }
5430
+ emit("update:modelValue", props.value);
5431
+ emit("change", props.value);
5432
+ }
5433
+ return (_ctx, _cache) => {
5434
+ return openBlock(), createElementBlock("label", {
5435
+ class: normalizeClass(["tao-segmented-option", {
5436
+ "tao-segmented-option--checked": isChecked.value,
5437
+ "tao-segmented-option--disabled": props.disabled,
5438
+ "tao-segmented-option--icon-only": isIconOnly.value
5439
+ }]),
5440
+ for: unref(localId)
5441
+ }, [
5442
+ createElementVNode("input", {
5443
+ id: unref(localId),
5444
+ class: "tao-segmented-option__input",
5445
+ type: "radio",
5446
+ name: inputName.value,
5447
+ value: String(__props.value),
5448
+ checked: isChecked.value,
5449
+ disabled: isDisabled.value,
5450
+ "aria-label": __props.ariaLabel,
5451
+ onChange
5452
+ }, null, 40, _hoisted_2$m),
5453
+ createElementVNode("span", _hoisted_3$j, [
5454
+ __props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$h, [
5455
+ renderSlot(_ctx.$slots, "icon", {}, () => [
5456
+ createTextVNode(toDisplayString(__props.icon), 1)
5457
+ ], true)
5458
+ ])) : createCommentVNode("", true),
5459
+ hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_5$f, [
5460
+ renderSlot(_ctx.$slots, "default", {}, () => [
5461
+ createTextVNode(toDisplayString(__props.label), 1)
5462
+ ], true)
5463
+ ])) : __props.ariaLabel ? (openBlock(), createElementBlock("span", _hoisted_6$c, toDisplayString(__props.ariaLabel), 1)) : createCommentVNode("", true),
5464
+ countLabel.value ? (openBlock(), createElementBlock("span", _hoisted_7$a, toDisplayString(countLabel.value), 1)) : createCommentVNode("", true)
5465
+ ])
5466
+ ], 10, _hoisted_1$o);
5467
+ };
5468
+ }
5469
+ });
5470
+ const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-fba7ca12"]]);
5471
+ const _hoisted_1$n = ["tabindex", "aria-label", "aria-valuetext", "aria-valuenow"];
5472
+ const _hoisted_2$l = { class: "tao-color-picker__strips" };
5473
+ const _hoisted_3$i = { class: "tao-color-picker__row" };
5474
+ const _hoisted_4$g = { class: "tao-color-picker__preview" };
5475
+ const _hoisted_5$e = {
5476
+ key: 1,
5477
+ class: "tao-color-picker__channels"
5478
+ };
5479
+ const _hoisted_6$b = ["disabled", "aria-label", "title"];
5480
+ const _hoisted_7$9 = ["aria-label"];
5481
+ const _hoisted_8$9 = ["disabled", "aria-label", "title", "onClick"];
5482
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
5483
+ ...{ name: "TaoColorPicker" },
5484
+ __name: "TaoColorPicker",
5485
+ props: {
5486
+ modelValue: {},
5487
+ alpha: { type: Boolean, default: false },
5488
+ swatches: {},
5489
+ modes: { default: () => ["hex", "rgb", "hsl"] },
5490
+ mode: {},
5491
+ eyedropper: { type: Boolean, default: true },
5492
+ disabled: { type: Boolean, default: false },
5493
+ size: {},
5494
+ areaLabel: {},
5495
+ hueLabel: {},
5496
+ alphaLabel: {},
5497
+ hexLabel: {},
5498
+ modeLabel: {},
5499
+ swatchesLabel: {},
5500
+ eyedropperLabel: {}
5501
+ },
5502
+ emits: ["update:modelValue", "update:mode", "change"],
5503
+ setup(__props, { emit: __emit }) {
5504
+ const props = __props;
5505
+ const emit = __emit;
5506
+ const l10n = useLocaleText(props, "colorPicker");
5507
+ const state = reactive({ h: 0, s: 0, v: 0, a: 1 });
5508
+ const hex = computed(() => toHex(hsvaToRgba(state), props.alpha));
5509
+ function load(value) {
5510
+ const c = parseColor(value);
5511
+ if (!c) return;
5512
+ const next = rgbaToHsva(c);
5513
+ state.h = next.s === 0 || next.v === 0 ? state.h : next.h;
5514
+ state.s = next.s;
5515
+ state.v = next.v;
5516
+ state.a = props.alpha ? next.a : 1;
5517
+ }
5518
+ load(props.modelValue);
5519
+ watch(
5520
+ () => props.modelValue,
5521
+ (value) => {
5522
+ if (normalizeHex(value, props.alpha) !== hex.value) load(value);
5523
+ }
5524
+ );
5525
+ watch(
5526
+ () => props.alpha,
5527
+ () => load(props.modelValue)
5528
+ );
5529
+ const currentMode = ref(props.mode ?? props.modes[0] ?? "hex");
5530
+ watch(
5531
+ () => props.mode,
5532
+ (m) => {
5533
+ if (m) currentMode.value = m;
5534
+ }
5535
+ );
5536
+ const activeMode = computed(() => props.modes.includes(currentMode.value) ? currentMode.value : props.modes[0] ?? "hex");
5537
+ const modeValue = computed({
5538
+ get: () => activeMode.value,
5539
+ set: (m) => {
5540
+ currentMode.value = m;
5541
+ emit("update:mode", m);
5542
+ }
5543
+ });
5544
+ const rgbFields = computed(() => {
5545
+ const c = hsvaToRgba(state);
5546
+ return [Math.round(c.r), Math.round(c.g), Math.round(c.b)];
5547
+ });
5548
+ const hslFields = computed(() => {
5549
+ const [r, g, b] = rgbFields.value;
5550
+ const { s, l } = rgbToHsl(r, g, b);
5551
+ return [Math.round(state.h) % 360, Math.round(s * 100), Math.round(l * 100)];
5552
+ });
5553
+ const alphaPercent = computed(() => Math.round(state.a * 100));
5554
+ const channels = computed(() => {
5555
+ const list = [];
5556
+ if (activeMode.value === "rgb") {
5557
+ ["R", "G", "B"].forEach((label, index) => list.push({ key: label, label, max: 255, value: rgbFields.value[index], kind: "rgb", index }));
5558
+ } else if (activeMode.value === "hsl") {
5559
+ const max = [360, 100, 100];
5560
+ ["H", "S", "L"].forEach((label, index) => list.push({ key: label, label, max: max[index], value: hslFields.value[index], kind: "hsl", index }));
5561
+ }
5562
+ if (activeMode.value !== "hex" && props.alpha) list.push({ key: "A", label: "A", max: 100, value: alphaPercent.value, kind: "alpha", index: 0 });
5563
+ return list;
5564
+ });
5565
+ function commitChannel(kind, index, value) {
5566
+ if (value === null || !Number.isFinite(value)) return;
5567
+ if (kind === "alpha") {
5568
+ state.a = Math.min(100, Math.max(0, value)) / 100;
5569
+ } else if (kind === "rgb") {
5570
+ const next = [...rgbFields.value];
5571
+ next[index] = Math.min(255, Math.max(0, Math.round(value)));
5572
+ load(toHex({ r: next[0], g: next[1], b: next[2], a: state.a }, true));
5573
+ } else {
5574
+ const next = [...hslFields.value];
5575
+ next[index] = value;
5576
+ const rgb = hslToRgb((next[0] % 360 + 360) % 360, next[1] / 100, next[2] / 100);
5577
+ load(toHex({ ...rgb, a: state.a }, true));
5578
+ state.h = (next[0] % 360 + 360) % 360;
5579
+ }
5580
+ push(true);
5581
+ }
5582
+ const hexText = ref(hex.value);
5583
+ const hexInvalid = ref(false);
5584
+ watch(hex, (h) => {
5585
+ hexText.value = h;
5586
+ hexInvalid.value = false;
5587
+ });
5588
+ function push(final = false) {
5589
+ emit("update:modelValue", hex.value);
5590
+ if (final) emit("change", hex.value);
5591
+ }
5592
+ const areaRef = ref(null);
5593
+ let dragging = -1;
5594
+ function fromPointer(e) {
5595
+ const el = areaRef.value;
5596
+ if (!el) return;
5597
+ const r = el.getBoundingClientRect();
5598
+ state.s = r.width ? Math.min(1, Math.max(0, (e.clientX - r.left) / r.width)) : 0;
5599
+ state.v = r.height ? 1 - Math.min(1, Math.max(0, (e.clientY - r.top) / r.height)) : 0;
5600
+ push();
5601
+ }
5602
+ function onAreaDown(e) {
5603
+ var _a, _b;
5604
+ if (props.disabled || e.button !== 0) return;
5605
+ dragging = e.pointerId;
5606
+ fromPointer(e);
5607
+ e.preventDefault();
5608
+ (_a = areaRef.value) == null ? void 0 : _a.focus({ preventScroll: true });
5609
+ try {
5610
+ (_b = areaRef.value) == null ? void 0 : _b.setPointerCapture(e.pointerId);
5611
+ } catch {
5612
+ }
5613
+ }
5614
+ function onAreaMove(e) {
5615
+ if (dragging === e.pointerId) fromPointer(e);
5616
+ }
5617
+ function onAreaUp(e) {
5618
+ if (dragging !== e.pointerId) return;
5619
+ dragging = -1;
5620
+ emit("change", hex.value);
5621
+ }
5622
+ function onAreaKey(e) {
5623
+ if (props.disabled) return;
5624
+ const k = e.shiftKey ? 0.1 : 0.01;
5625
+ const keys = { ArrowLeft: [-k, 0], ArrowRight: [k, 0], ArrowUp: [0, k], ArrowDown: [0, -k] };
5626
+ const d = keys[e.key];
5627
+ if (!d) return;
5628
+ e.preventDefault();
5629
+ state.s = Math.min(1, Math.max(0, Math.round((state.s + d[0]) * 1e3) / 1e3));
5630
+ state.v = Math.min(1, Math.max(0, Math.round((state.v + d[1]) * 1e3) / 1e3));
5631
+ push(true);
5632
+ }
5633
+ const hueValue = computed({ get: () => state.h, set: (v) => (state.h = v, push()) });
5634
+ const alphaValue = computed({ get: () => state.a, set: (v) => (state.a = v, push()) });
5635
+ const hueCss = computed(() => toHex(hsvaToRgba({ h: state.h, s: 1, v: 1, a: 1 })));
5636
+ const solidCss = computed(() => toHex(hsvaToRgba({ ...state, a: 1 })));
5637
+ function commitHex() {
5638
+ const next = normalizeHex(hexText.value, props.alpha);
5639
+ if (!next) {
5640
+ hexInvalid.value = true;
5641
+ return;
5642
+ }
5643
+ hexInvalid.value = false;
5644
+ load(next);
5645
+ hexText.value = hex.value;
5646
+ push(true);
5647
+ }
5648
+ function pick(color) {
5649
+ if (props.disabled) return;
5650
+ load(color);
5651
+ push(true);
5652
+ }
5653
+ const canEyedrop = computed(() => props.eyedropper && typeof window !== "undefined" && "EyeDropper" in window);
5654
+ async function eyedrop() {
5655
+ try {
5656
+ const EyeDropperCtor = window.EyeDropper;
5657
+ const { sRGBHex } = await new EyeDropperCtor().open();
5658
+ pick(sRGBHex);
5659
+ } catch {
5660
+ }
5661
+ }
5662
+ const areaText = computed(() => `${Math.round(state.s * 100)}%, ${Math.round(state.v * 100)}%`);
5663
+ return (_ctx, _cache) => {
5664
+ var _a;
5665
+ return openBlock(), createElementBlock("div", {
5666
+ class: normalizeClass(["tao-color-picker", [unref(sizeClass)(__props.size), { "tao-color-picker--disabled": __props.disabled }]])
5667
+ }, [
5668
+ createElementVNode("div", {
5669
+ ref_key: "areaRef",
5670
+ ref: areaRef,
5671
+ class: "tao-color-picker__area",
5672
+ style: normalizeStyle({ backgroundColor: hueCss.value }),
5673
+ role: "slider",
5674
+ tabindex: __props.disabled ? -1 : 0,
5675
+ "aria-label": unref(l10n).areaLabel,
5676
+ "aria-valuetext": areaText.value,
5677
+ "aria-valuenow": Math.round(state.s * 100),
5678
+ "aria-valuemin": "0",
5679
+ "aria-valuemax": "100",
5680
+ onPointerdown: onAreaDown,
5681
+ onPointermove: onAreaMove,
5682
+ onPointerup: onAreaUp,
5683
+ onPointercancel: onAreaUp,
5684
+ onKeydown: onAreaKey
5685
+ }, [
5686
+ createElementVNode("span", {
5687
+ class: "tao-color-picker__cursor",
5688
+ style: normalizeStyle({ left: `${state.s * 100}%`, top: `${(1 - state.v) * 100}%`, backgroundColor: solidCss.value })
5689
+ }, null, 4)
5690
+ ], 44, _hoisted_1$n),
5691
+ createElementVNode("div", _hoisted_2$l, [
5692
+ createVNode(_sfc_main$U, {
5693
+ modelValue: hueValue.value,
5694
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => hueValue.value = $event),
5695
+ class: "tao-color-picker__hue",
5696
+ variant: "thin",
5697
+ min: 0,
5698
+ max: 360,
5699
+ step: 1,
5700
+ disabled: __props.disabled,
5701
+ "aria-label": unref(l10n).hueLabel,
5702
+ onChange: _cache[1] || (_cache[1] = ($event) => emit("change", hex.value))
5703
+ }, null, 8, ["modelValue", "disabled", "aria-label"]),
5704
+ __props.alpha ? (openBlock(), createBlock(_sfc_main$U, {
5705
+ key: 0,
5706
+ modelValue: alphaValue.value,
5707
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => alphaValue.value = $event),
5708
+ class: "tao-color-picker__alpha",
5709
+ variant: "thin",
5710
+ min: 0,
5711
+ max: 1,
5712
+ step: 0.01,
5713
+ disabled: __props.disabled,
5714
+ "aria-label": unref(l10n).alphaLabel,
5715
+ style: normalizeStyle({ "--tao-color-picker-solid": solidCss.value }),
5716
+ onChange: _cache[3] || (_cache[3] = ($event) => emit("change", hex.value))
5717
+ }, null, 8, ["modelValue", "disabled", "aria-label", "style"])) : createCommentVNode("", true)
5718
+ ]),
5719
+ __props.modes.length > 1 ? (openBlock(), createBlock(TaoSegmented, {
5720
+ key: 0,
5721
+ modelValue: modeValue.value,
5722
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => modeValue.value = $event),
5723
+ class: "tao-color-picker__modes",
5724
+ size: "small",
5725
+ "aria-label": unref(l10n).modeLabel,
5726
+ disabled: __props.disabled
5727
+ }, {
5728
+ default: withCtx(() => [
5729
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.modes, (m) => {
5730
+ return openBlock(), createBlock(TaoSegmentedOption, {
5731
+ key: m,
5732
+ value: m,
5733
+ label: m.toUpperCase()
5734
+ }, null, 8, ["value", "label"]);
5735
+ }), 128))
5736
+ ]),
5737
+ _: 1
5738
+ }, 8, ["modelValue", "aria-label", "disabled"])) : createCommentVNode("", true),
5739
+ createElementVNode("div", _hoisted_3$i, [
5740
+ createElementVNode("span", _hoisted_4$g, [
5741
+ createElementVNode("span", {
5742
+ style: normalizeStyle({ backgroundColor: hex.value })
5743
+ }, null, 4)
5744
+ ]),
5745
+ activeMode.value === "hex" ? (openBlock(), createBlock(TaoInput, {
5746
+ key: 0,
5747
+ modelValue: hexText.value,
5748
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => hexText.value = $event),
5749
+ class: "tao-color-picker__hex",
5750
+ size: "small",
5751
+ error: hexInvalid.value,
5752
+ disabled: __props.disabled,
5753
+ "aria-label": unref(l10n).hexLabel,
5754
+ onBlur: commitHex,
5755
+ onKeydown: withKeys(commitHex, ["enter"])
5756
+ }, null, 8, ["modelValue", "error", "disabled", "aria-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$e, [
5757
+ (openBlock(true), createElementBlock(Fragment, null, renderList(channels.value, (c) => {
5758
+ return openBlock(), createElementBlock("label", {
5759
+ key: c.key,
5760
+ class: "tao-color-picker__channel"
5761
+ }, [
5762
+ createElementVNode("span", null, toDisplayString(c.label), 1),
5763
+ createVNode(TaoInputNumber, {
5764
+ size: "small",
5765
+ controls: false,
5766
+ min: 0,
5767
+ max: c.max,
5768
+ step: 1,
5769
+ "model-value": c.value,
5770
+ disabled: __props.disabled,
5771
+ onCommit: (v) => commitChannel(c.kind, c.index, v)
5772
+ }, null, 8, ["max", "model-value", "disabled", "onCommit"])
5773
+ ]);
5774
+ }), 128))
5775
+ ])),
5776
+ canEyedrop.value ? (openBlock(), createElementBlock("button", {
5777
+ key: 2,
5778
+ type: "button",
5779
+ class: "tao-color-picker__eyedropper",
5780
+ disabled: __props.disabled,
5781
+ "aria-label": unref(l10n).eyedropperLabel,
5782
+ title: unref(l10n).eyedropperLabel,
5783
+ onClick: eyedrop
5784
+ }, " ✎ ", 8, _hoisted_6$b)) : createCommentVNode("", true)
5785
+ ]),
5786
+ ((_a = __props.swatches) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", {
5787
+ key: 1,
5788
+ class: "tao-color-picker__swatches",
5789
+ role: "group",
5790
+ "aria-label": unref(l10n).swatchesLabel
5791
+ }, [
5792
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.swatches, (s) => {
5793
+ return openBlock(), createElementBlock("button", {
5794
+ key: s,
5795
+ type: "button",
5796
+ class: normalizeClass(["tao-color-picker__swatch", { "tao-color-picker__swatch--on": unref(normalizeHex)(s, __props.alpha) === hex.value }]),
5797
+ style: normalizeStyle({ backgroundColor: s }),
5798
+ disabled: __props.disabled,
5799
+ "aria-label": s,
5800
+ title: s,
5801
+ onClick: ($event) => pick(s)
5802
+ }, null, 14, _hoisted_8$9);
5803
+ }), 128))
5804
+ ], 8, _hoisted_7$9)) : createCommentVNode("", true)
5805
+ ], 2);
5806
+ };
5807
+ }
5808
+ });
5809
+ const TaoColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-9fe54966"]]);
5810
+ const _hoisted_1$m = ["disabled", "aria-label", "aria-expanded"];
5811
+ const _hoisted_2$k = { class: "tao-color-input__swatch" };
5812
+ const _hoisted_3$h = { class: "tao-color-input__text" };
5813
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5814
+ ...{ name: "TaoColorInput" },
5815
+ __name: "TaoColorInput",
5816
+ props: {
5817
+ modelValue: {},
5818
+ alpha: { type: Boolean, default: false },
5819
+ swatches: {},
5820
+ modes: { default: () => ["hex", "rgb", "hsl"] },
5821
+ mode: {},
5822
+ eyedropper: { type: Boolean, default: true },
5823
+ disabled: { type: Boolean, default: false },
5824
+ error: { type: Boolean, default: false },
5825
+ position: { default: "bottom" },
5826
+ size: {},
5827
+ chooseLabel: {}
5828
+ },
5829
+ emits: ["update:modelValue", "update:mode", "change"],
5830
+ setup(__props, { emit: __emit }) {
5831
+ const props = __props;
5832
+ const emit = __emit;
5833
+ const l10n = useLocaleText(props, "colorPicker");
5834
+ const shown = computed(() => normalizeHex(props.modelValue, props.alpha) ?? props.modelValue);
5835
+ return (_ctx, _cache) => {
5836
+ return openBlock(), createBlock(TaoPopover, {
5837
+ position: __props.position,
5838
+ disabled: __props.disabled,
5839
+ class: "tao-color-input-root"
5840
+ }, {
5841
+ trigger: withCtx(({ open }) => [
5842
+ createElementVNode("button", {
5843
+ type: "button",
5844
+ class: normalizeClass(["tao-color-input", [unref(sizeClass)(__props.size), { "tao-color-input--open": open, "tao-color-input--invalid": __props.error }]]),
5845
+ disabled: __props.disabled,
5846
+ "aria-label": `${unref(l10n).chooseLabel}: ${shown.value}`,
5847
+ "aria-haspopup": "dialog",
5848
+ "aria-expanded": open
5849
+ }, [
5850
+ createElementVNode("span", _hoisted_2$k, [
5851
+ createElementVNode("span", {
5852
+ style: normalizeStyle({ backgroundColor: shown.value })
5853
+ }, null, 4)
5854
+ ]),
5855
+ createElementVNode("span", _hoisted_3$h, toDisplayString(shown.value), 1)
5856
+ ], 10, _hoisted_1$m)
5857
+ ]),
5858
+ default: withCtx(() => [
5859
+ createVNode(TaoColorPicker, {
5860
+ "model-value": __props.modelValue,
5861
+ alpha: __props.alpha,
5862
+ swatches: __props.swatches,
5863
+ modes: __props.modes,
5864
+ mode: __props.mode,
5865
+ eyedropper: __props.eyedropper,
5866
+ size: __props.size,
5867
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
5868
+ "onUpdate:mode": _cache[1] || (_cache[1] = ($event) => emit("update:mode", $event)),
5869
+ onChange: _cache[2] || (_cache[2] = ($event) => emit("change", $event))
5870
+ }, null, 8, ["model-value", "alpha", "swatches", "modes", "mode", "eyedropper", "size"])
5871
+ ]),
5872
+ _: 1
5873
+ }, 8, ["position", "disabled"]);
5874
+ };
5875
+ }
5876
+ });
5877
+ const TaoColorInput = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-cc186067"]]);
5878
+ const _hoisted_1$l = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
5879
+ const _hoisted_2$j = {
5880
+ key: 0,
5881
+ class: "tao-combobox__empty"
5882
+ };
5883
+ const _hoisted_3$g = ["id", "aria-selected", "aria-disabled", "data-tao-combobox-index", "onClick", "onMouseenter"];
5884
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
5885
+ ...{ name: "TaoCombobox" },
5886
+ __name: "TaoCombobox",
5887
+ props: {
5888
+ modelValue: { default: null },
5889
+ options: { default: () => [] },
5890
+ placeholder: {},
5891
+ disabled: { type: Boolean, default: false },
5892
+ error: { type: Boolean, default: false },
5893
+ emptyText: {},
5894
+ clearText: {},
5895
+ clearable: { type: Boolean, default: true },
5896
+ size: {},
5897
+ allowCreate: { type: Boolean, default: false }
5898
+ },
5899
+ emits: ["update:modelValue", "change", "create"],
5900
+ setup(__props, { emit: __emit }) {
5901
+ const props = __props;
5902
+ const l10n = useLocaleText(props, "combobox");
5903
+ const emit = __emit;
5904
+ const field = inject(formFieldKey, null);
5905
+ const localId = useId();
5906
+ const listId = `${localId}-list`;
5907
+ const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
5908
+ const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
5909
+ const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
5910
+ const open = ref(false);
5911
+ const focused = ref(false);
5912
+ const picking = ref(false);
5913
+ const skipFocusOpen = ref(false);
5914
+ const query = ref("");
5915
+ const activeIndex = ref(-1);
5916
+ const fieldRef = ref(null);
5917
+ const inputRef = ref(null);
5918
+ const panelRef = ref(null);
5919
+ const panelSize = ref("medium");
5920
+ const listRef = ref(null);
5921
+ const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
5922
+ const selected = computed(() => {
5923
+ const found = props.options.find((option) => option.value === props.modelValue);
5924
+ if (found) {
5925
+ return found;
4826
5926
  }
4827
5927
  if (props.modelValue === null || props.modelValue === void 0 || props.modelValue === "") {
4828
5928
  return null;
@@ -5210,7 +6310,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
5210
6310
  onFocus,
5211
6311
  onBlur,
5212
6312
  onKeydown: onInputKeydown
5213
- }, null, 40, _hoisted_1$n),
6313
+ }, null, 40, _hoisted_1$l),
5214
6314
  createElementVNode("span", {
5215
6315
  class: normalizeClass(["tao-combobox__chevron", { "tao-combobox__chevron--custom": _ctx.$slots.chevron }]),
5216
6316
  "aria-hidden": "true"
@@ -5233,7 +6333,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
5233
6333
  class: "tao-combobox__list",
5234
6334
  role: "listbox"
5235
6335
  }, [
5236
- !rows.value.length ? (openBlock(), createElementBlock("li", _hoisted_2$l, [
6336
+ !rows.value.length ? (openBlock(), createElementBlock("li", _hoisted_2$j, [
5237
6337
  renderSlot(_ctx.$slots, "empty", {}, () => [
5238
6338
  createTextVNode(toDisplayString(unref(l10n).emptyText), 1)
5239
6339
  ], true)
@@ -5263,7 +6363,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
5263
6363
  ], true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
5264
6364
  createTextVNode(toDisplayString(row.option.label), 1)
5265
6365
  ], 64))
5266
- ], 42, _hoisted_3$h);
6366
+ ], 42, _hoisted_3$g);
5267
6367
  }), 128))
5268
6368
  ], 512),
5269
6369
  __props.clearable && selected.value ? (openBlock(), createElementBlock("button", {
@@ -5283,7 +6383,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
5283
6383
  };
5284
6384
  }
5285
6385
  });
5286
- const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-e75a5550"]]);
6386
+ const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-e75a5550"]]);
5287
6387
  const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
5288
6388
  function formatTaoDateIso(parts) {
5289
6389
  return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
@@ -5426,16 +6526,16 @@ function buildTaoDateGrid(year, month) {
5426
6526
  };
5427
6527
  });
5428
6528
  }
5429
- const _hoisted_1$m = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
5430
- const _hoisted_2$k = { class: "tao-date__value" };
5431
- const _hoisted_3$g = {
6529
+ const _hoisted_1$k = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
6530
+ const _hoisted_2$i = { class: "tao-date__value" };
6531
+ const _hoisted_3$f = {
5432
6532
  class: "tao-date__icon",
5433
6533
  "aria-hidden": "true"
5434
6534
  };
5435
- const _hoisted_4$g = ["aria-label"];
5436
- const _hoisted_5$e = { class: "tao-date__header" };
5437
- const _hoisted_6$b = ["aria-label"];
5438
- const _hoisted_7$9 = { "aria-hidden": "true" };
6535
+ const _hoisted_4$f = ["aria-label"];
6536
+ const _hoisted_5$d = { class: "tao-date__header" };
6537
+ const _hoisted_6$a = ["aria-label"];
6538
+ const _hoisted_7$8 = { "aria-hidden": "true" };
5439
6539
  const _hoisted_8$8 = { class: "tao-date__month" };
5440
6540
  const _hoisted_9$3 = ["aria-label"];
5441
6541
  const _hoisted_10$3 = { "aria-hidden": "true" };
@@ -5450,7 +6550,7 @@ const _hoisted_12$1 = {
5450
6550
  const _hoisted_13$1 = ["aria-label", "aria-selected", "disabled", "onClick"];
5451
6551
  const _hoisted_14$1 = { class: "tao-date__footer" };
5452
6552
  const _hoisted_15 = ["disabled"];
5453
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
6553
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5454
6554
  ...{ name: "TaoDate" },
5455
6555
  __name: "TaoDate",
5456
6556
  props: {
@@ -5682,8 +6782,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5682
6782
  onClick: toggle,
5683
6783
  onKeydown: onTriggerKeydown
5684
6784
  }, [
5685
- createElementVNode("span", _hoisted_2$k, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
5686
- createElementVNode("span", _hoisted_3$g, [
6785
+ createElementVNode("span", _hoisted_2$i, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
6786
+ createElementVNode("span", _hoisted_3$f, [
5687
6787
  renderSlot(_ctx.$slots, "icon", {}, () => [
5688
6788
  _cache[4] || (_cache[4] = createElementVNode("svg", {
5689
6789
  viewBox: "0 0 16 16",
@@ -5711,7 +6811,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5711
6811
  ], -1))
5712
6812
  ], true)
5713
6813
  ])
5714
- ], 42, _hoisted_1$m),
6814
+ ], 42, _hoisted_1$k),
5715
6815
  (openBlock(), createBlock(Teleport, { to: "body" }, [
5716
6816
  open.value ? (openBlock(), createElementBlock("div", {
5717
6817
  key: 0,
@@ -5725,14 +6825,14 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5725
6825
  style: normalizeStyle(panelStyle.value),
5726
6826
  onKeydown: onPanelKeydown
5727
6827
  }, [
5728
- createElementVNode("div", _hoisted_5$e, [
6828
+ createElementVNode("div", _hoisted_5$d, [
5729
6829
  createElementVNode("button", {
5730
6830
  type: "button",
5731
6831
  class: "tao-date__nav",
5732
6832
  "aria-label": unref(l10n).prevMonthLabel,
5733
6833
  onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
5734
6834
  }, [
5735
- createElementVNode("span", _hoisted_7$9, [
6835
+ createElementVNode("span", _hoisted_7$8, [
5736
6836
  renderSlot(_ctx.$slots, "prev-icon", {}, () => [
5737
6837
  _cache[5] || (_cache[5] = createElementVNode("svg", {
5738
6838
  viewBox: "0 0 24 24",
@@ -5751,7 +6851,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5751
6851
  ], -1))
5752
6852
  ], true)
5753
6853
  ])
5754
- ], 8, _hoisted_6$b),
6854
+ ], 8, _hoisted_6$a),
5755
6855
  createElementVNode("p", _hoisted_8$8, toDisplayString(monthLabel.value), 1),
5756
6856
  createElementVNode("button", {
5757
6857
  type: "button",
@@ -5829,23 +6929,23 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5829
6929
  ], true)
5830
6930
  ])) : createCommentVNode("", true)
5831
6931
  ])
5832
- ], 44, _hoisted_4$g)) : createCommentVNode("", true)
6932
+ ], 44, _hoisted_4$f)) : createCommentVNode("", true)
5833
6933
  ]))
5834
6934
  ], 2);
5835
6935
  };
5836
6936
  }
5837
6937
  });
5838
- const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-97f71e11"]]);
5839
- const _hoisted_1$l = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
5840
- const _hoisted_2$j = { class: "tao-date-range__value" };
5841
- const _hoisted_3$f = {
6938
+ const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-97f71e11"]]);
6939
+ const _hoisted_1$j = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
6940
+ const _hoisted_2$h = { class: "tao-date-range__value" };
6941
+ const _hoisted_3$e = {
5842
6942
  class: "tao-date-range__icon",
5843
6943
  "aria-hidden": "true"
5844
6944
  };
5845
- const _hoisted_4$f = ["aria-label"];
5846
- const _hoisted_5$d = { class: "tao-date__header" };
5847
- const _hoisted_6$a = ["aria-label"];
5848
- const _hoisted_7$8 = { "aria-hidden": "true" };
6945
+ const _hoisted_4$e = ["aria-label"];
6946
+ const _hoisted_5$c = { class: "tao-date__header" };
6947
+ const _hoisted_6$9 = ["aria-label"];
6948
+ const _hoisted_7$7 = { "aria-hidden": "true" };
5849
6949
  const _hoisted_8$7 = { class: "tao-date__month" };
5850
6950
  const _hoisted_9$2 = ["aria-label"];
5851
6951
  const _hoisted_10$2 = { "aria-hidden": "true" };
@@ -5856,7 +6956,7 @@ const _hoisted_11$1 = {
5856
6956
  const _hoisted_12 = ["aria-label", "aria-selected", "disabled", "onMouseenter", "onClick"];
5857
6957
  const _hoisted_13 = { class: "tao-date__footer" };
5858
6958
  const _hoisted_14 = ["disabled"];
5859
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
6959
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5860
6960
  ...{ name: "TaoDateRange" },
5861
6961
  __name: "TaoDateRange",
5862
6962
  props: {
@@ -6142,8 +7242,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6142
7242
  onClick: toggle,
6143
7243
  onKeydown: onTriggerKeydown
6144
7244
  }, [
6145
- createElementVNode("span", _hoisted_2$j, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
6146
- createElementVNode("span", _hoisted_3$f, [
7245
+ createElementVNode("span", _hoisted_2$h, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
7246
+ createElementVNode("span", _hoisted_3$e, [
6147
7247
  renderSlot(_ctx.$slots, "icon", {}, () => [
6148
7248
  _cache[3] || (_cache[3] = createElementVNode("svg", {
6149
7249
  viewBox: "0 0 16 16",
@@ -6171,7 +7271,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6171
7271
  ], -1))
6172
7272
  ], true)
6173
7273
  ])
6174
- ], 42, _hoisted_1$l),
7274
+ ], 42, _hoisted_1$j),
6175
7275
  (openBlock(), createBlock(Teleport, { to: "body" }, [
6176
7276
  open.value ? (openBlock(), createElementBlock("div", {
6177
7277
  key: 0,
@@ -6185,14 +7285,14 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6185
7285
  style: normalizeStyle(panelStyle.value),
6186
7286
  onKeydown: onPanelKeydown
6187
7287
  }, [
6188
- createElementVNode("div", _hoisted_5$d, [
7288
+ createElementVNode("div", _hoisted_5$c, [
6189
7289
  createElementVNode("button", {
6190
7290
  type: "button",
6191
7291
  class: "tao-date__nav",
6192
7292
  "aria-label": unref(l10n).prevMonthLabel,
6193
7293
  onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
6194
7294
  }, [
6195
- createElementVNode("span", _hoisted_7$8, [
7295
+ createElementVNode("span", _hoisted_7$7, [
6196
7296
  renderSlot(_ctx.$slots, "prev-icon", {}, () => [
6197
7297
  _cache[4] || (_cache[4] = createElementVNode("svg", {
6198
7298
  viewBox: "0 0 24 24",
@@ -6211,7 +7311,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6211
7311
  ], -1))
6212
7312
  ], true)
6213
7313
  ])
6214
- ], 8, _hoisted_6$a),
7314
+ ], 8, _hoisted_6$9),
6215
7315
  createElementVNode("p", _hoisted_8$7, toDisplayString(monthLabel.value), 1),
6216
7316
  createElementVNode("button", {
6217
7317
  type: "button",
@@ -6298,24 +7398,24 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6298
7398
  ], true)
6299
7399
  ])) : createCommentVNode("", true)
6300
7400
  ])
6301
- ], 44, _hoisted_4$f)) : createCommentVNode("", true)
7401
+ ], 44, _hoisted_4$e)) : createCommentVNode("", true)
6302
7402
  ]))
6303
7403
  ], 2);
6304
7404
  };
6305
7405
  }
6306
7406
  });
6307
- const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-da3794c7"]]);
6308
- const _hoisted_1$k = ["for"];
6309
- const _hoisted_2$i = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
6310
- const _hoisted_3$e = {
7407
+ const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-da3794c7"]]);
7408
+ const _hoisted_1$i = ["for"];
7409
+ const _hoisted_2$g = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
7410
+ const _hoisted_3$d = {
6311
7411
  key: 0,
6312
7412
  class: "tao-switch__label"
6313
7413
  };
6314
- const _hoisted_4$e = {
7414
+ const _hoisted_4$d = {
6315
7415
  key: 1,
6316
7416
  class: "tao-switch__label"
6317
7417
  };
6318
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
7418
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6319
7419
  ...{ name: "TaoSwitch" },
6320
7420
  __name: "TaoSwitch",
6321
7421
  props: {
@@ -6358,33 +7458,33 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
6358
7458
  "aria-invalid": invalid.value || void 0,
6359
7459
  "aria-describedby": describedBy.value,
6360
7460
  onChange: toggle
6361
- }, null, 40, _hoisted_2$i),
7461
+ }, null, 40, _hoisted_2$g),
6362
7462
  _cache[0] || (_cache[0] = createElementVNode("span", {
6363
7463
  class: "tao-switch__track",
6364
7464
  "aria-hidden": "true"
6365
7465
  }, [
6366
7466
  createElementVNode("span", { class: "tao-switch__thumb" })
6367
7467
  ], -1)),
6368
- __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$e, toDisplayString(__props.label), 1)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$e, [
7468
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$d, toDisplayString(__props.label), 1)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$d, [
6369
7469
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
6370
7470
  ])) : createCommentVNode("", true)
6371
- ], 10, _hoisted_1$k);
7471
+ ], 10, _hoisted_1$i);
6372
7472
  };
6373
7473
  }
6374
7474
  });
6375
- const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-28965b34"]]);
7475
+ const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-28965b34"]]);
6376
7476
  const radioGroupKey = Symbol("taoRadioGroup");
6377
- const _hoisted_1$j = ["for"];
6378
- const _hoisted_2$h = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
6379
- const _hoisted_3$d = {
7477
+ const _hoisted_1$h = ["for"];
7478
+ const _hoisted_2$f = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
7479
+ const _hoisted_3$c = {
6380
7480
  key: 0,
6381
7481
  class: "tao-radio__label"
6382
7482
  };
6383
- const _hoisted_4$d = {
7483
+ const _hoisted_4$c = {
6384
7484
  key: 1,
6385
7485
  class: "tao-radio__label"
6386
7486
  };
6387
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
7487
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
6388
7488
  ...{ name: "TaoRadio" },
6389
7489
  __name: "TaoRadio",
6390
7490
  props: {
@@ -6439,25 +7539,25 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6439
7539
  "aria-invalid": !unref(group) && invalid.value || void 0,
6440
7540
  "aria-describedby": describedBy.value,
6441
7541
  onChange
6442
- }, null, 40, _hoisted_2$h),
7542
+ }, null, 40, _hoisted_2$f),
6443
7543
  _cache[0] || (_cache[0] = createElementVNode("span", {
6444
7544
  class: "tao-radio__dot",
6445
7545
  "aria-hidden": "true"
6446
7546
  }, null, -1)),
6447
- __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$d, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$d, [
7547
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$c, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$c, [
6448
7548
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
6449
7549
  ]))
6450
- ], 10, _hoisted_1$j);
7550
+ ], 10, _hoisted_1$h);
6451
7551
  };
6452
7552
  }
6453
7553
  });
6454
- const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-70ac1c11"]]);
6455
- const _hoisted_1$i = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
6456
- const _hoisted_2$g = {
7554
+ const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-70ac1c11"]]);
7555
+ const _hoisted_1$g = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
7556
+ const _hoisted_2$e = {
6457
7557
  key: 0,
6458
7558
  class: "tao-radio-group__legend"
6459
7559
  };
6460
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
7560
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
6461
7561
  ...{ name: "TaoRadioGroup" },
6462
7562
  __name: "TaoRadioGroup",
6463
7563
  props: {
@@ -6501,256 +7601,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6501
7601
  "aria-invalid": invalid.value || void 0,
6502
7602
  "aria-labelledby": labelledBy.value
6503
7603
  }, [
6504
- __props.legend ? (openBlock(), createElementBlock("legend", _hoisted_2$g, toDisplayString(__props.legend), 1)) : createCommentVNode("", true),
7604
+ __props.legend ? (openBlock(), createElementBlock("legend", _hoisted_2$e, toDisplayString(__props.legend), 1)) : createCommentVNode("", true),
6505
7605
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
6506
- ], 10, _hoisted_1$i);
6507
- };
6508
- }
6509
- });
6510
- const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-c76ef504"]]);
6511
- const segmentedKey = Symbol("taoSegmented");
6512
- const _hoisted_1$h = ["disabled", "aria-describedby", "aria-invalid", "aria-labelledby", "id"];
6513
- const _hoisted_2$f = {
6514
- key: 0,
6515
- class: "tao-segmented__legend"
6516
- };
6517
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
6518
- ...{ name: "TaoSegmented" },
6519
- __name: "TaoSegmented",
6520
- props: {
6521
- modelValue: { type: [String, Number, Boolean] },
6522
- name: {},
6523
- legend: {},
6524
- disabled: { type: Boolean, default: false },
6525
- error: { type: Boolean, default: false },
6526
- size: {},
6527
- block: { type: Boolean, default: false }
6528
- },
6529
- emits: ["update:modelValue", "change"],
6530
- setup(__props, { emit: __emit }) {
6531
- const props = __props;
6532
- const emit = __emit;
6533
- const field = inject(formFieldKey, null);
6534
- const autoName = useId();
6535
- const groupName = computed(() => props.name || autoName);
6536
- const model = computed(() => props.modelValue);
6537
- const groupDisabled = computed(() => props.disabled);
6538
- const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
6539
- const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
6540
- const trackRef = ref(null);
6541
- const thumbStyle = ref({ opacity: "0" });
6542
- let resizeObserver = null;
6543
- let mutationObserver = null;
6544
- function setValue(value) {
6545
- emit("update:modelValue", value);
6546
- emit("change", value);
6547
- }
6548
- function updateThumb() {
6549
- const track = trackRef.value;
6550
- if (!track) {
6551
- return;
6552
- }
6553
- const selected = track.querySelector(".tao-segmented-option--checked");
6554
- if (!selected) {
6555
- if (thumbStyle.value.opacity !== "0") {
6556
- thumbStyle.value = { opacity: "0" };
6557
- }
6558
- return;
6559
- }
6560
- const trackBox = track.getBoundingClientRect();
6561
- const optionBox = selected.getBoundingClientRect();
6562
- const next = {
6563
- width: `${optionBox.width}px`,
6564
- height: `${optionBox.height}px`,
6565
- transform: `translate(${optionBox.left - trackBox.left - track.clientLeft}px, ${optionBox.top - trackBox.top - track.clientTop}px)`,
6566
- opacity: "1"
6567
- };
6568
- const prev = thumbStyle.value;
6569
- if (prev.width === next.width && prev.height === next.height && prev.transform === next.transform && prev.opacity === next.opacity) {
6570
- return;
6571
- }
6572
- thumbStyle.value = next;
6573
- }
6574
- provide(segmentedKey, {
6575
- name: groupName,
6576
- model,
6577
- disabled: groupDisabled,
6578
- setValue
6579
- });
6580
- onMounted(() => {
6581
- const track = trackRef.value;
6582
- void nextTick(updateThumb);
6583
- if (!track) {
6584
- return;
6585
- }
6586
- if (typeof ResizeObserver !== "undefined") {
6587
- resizeObserver = new ResizeObserver(() => updateThumb());
6588
- resizeObserver.observe(track);
6589
- }
6590
- mutationObserver = new MutationObserver(() => updateThumb());
6591
- mutationObserver.observe(track, {
6592
- subtree: true,
6593
- childList: true,
6594
- attributes: true,
6595
- attributeFilter: ["class"]
6596
- });
6597
- });
6598
- watch(
6599
- () => [props.modelValue, props.size, props.block, props.disabled],
6600
- () => {
6601
- void nextTick(updateThumb);
6602
- }
6603
- );
6604
- onBeforeUnmount(() => {
6605
- resizeObserver == null ? void 0 : resizeObserver.disconnect();
6606
- resizeObserver = null;
6607
- mutationObserver == null ? void 0 : mutationObserver.disconnect();
6608
- mutationObserver = null;
6609
- });
6610
- return (_ctx, _cache) => {
6611
- var _a;
6612
- return openBlock(), createElementBlock("fieldset", {
6613
- class: normalizeClass(["tao-segmented", [
6614
- unref(sizeClass)(__props.size),
6615
- {
6616
- "tao-segmented--block": __props.block,
6617
- "tao-segmented--disabled": __props.disabled,
6618
- "tao-segmented--invalid": invalid.value
6619
- }
6620
- ]]),
6621
- disabled: __props.disabled,
6622
- "aria-describedby": describedBy.value,
6623
- "aria-invalid": invalid.value || void 0,
6624
- "aria-labelledby": __props.legend ? void 0 : unref(field) ? `${unref(field).id}-label` : void 0,
6625
- id: (_a = unref(field)) == null ? void 0 : _a.id
6626
- }, [
6627
- __props.legend ? (openBlock(), createElementBlock("legend", _hoisted_2$f, toDisplayString(__props.legend), 1)) : createCommentVNode("", true),
6628
- createElementVNode("div", {
6629
- ref_key: "trackRef",
6630
- ref: trackRef,
6631
- class: "tao-segmented__track"
6632
- }, [
6633
- createElementVNode("div", {
6634
- class: "tao-segmented__thumb",
6635
- style: normalizeStyle(thumbStyle.value),
6636
- "aria-hidden": "true"
6637
- }, null, 4),
6638
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
6639
- ], 512)
6640
- ], 10, _hoisted_1$h);
6641
- };
6642
- }
6643
- });
6644
- const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-7dc6820f"]]);
6645
- const _hoisted_1$g = ["for"];
6646
- const _hoisted_2$e = ["id", "name", "value", "checked", "disabled", "aria-label"];
6647
- const _hoisted_3$c = { class: "tao-segmented-option__face" };
6648
- const _hoisted_4$c = {
6649
- key: 0,
6650
- class: "tao-segmented-option__icon",
6651
- "aria-hidden": "true"
6652
- };
6653
- const _hoisted_5$c = {
6654
- key: 1,
6655
- class: "tao-segmented-option__label"
6656
- };
6657
- const _hoisted_6$9 = {
6658
- key: 2,
6659
- class: "tao-segmented-option__sr"
6660
- };
6661
- const _hoisted_7$7 = {
6662
- key: 3,
6663
- class: "tao-segmented-option__count"
6664
- };
6665
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
6666
- ...{ name: "TaoSegmentedOption" },
6667
- __name: "TaoSegmentedOption",
6668
- props: {
6669
- value: { type: [String, Number, Boolean] },
6670
- modelValue: { type: [String, Number, Boolean] },
6671
- name: {},
6672
- label: { default: "" },
6673
- icon: { default: "" },
6674
- count: {},
6675
- disabled: { type: Boolean, default: false },
6676
- ariaLabel: {}
6677
- },
6678
- emits: ["update:modelValue", "change"],
6679
- setup(__props, { emit: __emit }) {
6680
- const props = __props;
6681
- const emit = __emit;
6682
- const group = inject(segmentedKey, null);
6683
- const slots = useSlots();
6684
- const localId = useId();
6685
- const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
6686
- const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
6687
- const isChecked = computed(() => {
6688
- const current2 = group ? group.model.value : props.modelValue;
6689
- return current2 === props.value;
6690
- });
6691
- const hasLabel = computed(() => Boolean(props.label || slots.default));
6692
- const isIconOnly = computed(() => Boolean((props.icon || slots.icon) && !hasLabel.value));
6693
- const countLabel = computed(() => {
6694
- if (props.count === void 0 || props.count === null || props.count === "") {
6695
- return "";
6696
- }
6697
- if (typeof props.count === "number") {
6698
- if (props.count > 99) {
6699
- return "99+";
6700
- }
6701
- return String(props.count);
6702
- }
6703
- return String(props.count);
6704
- });
6705
- function onChange() {
6706
- if (isDisabled.value) {
6707
- return;
6708
- }
6709
- if (group) {
6710
- group.setValue(props.value);
6711
- return;
6712
- }
6713
- emit("update:modelValue", props.value);
6714
- emit("change", props.value);
6715
- }
6716
- return (_ctx, _cache) => {
6717
- return openBlock(), createElementBlock("label", {
6718
- class: normalizeClass(["tao-segmented-option", {
6719
- "tao-segmented-option--checked": isChecked.value,
6720
- "tao-segmented-option--disabled": props.disabled,
6721
- "tao-segmented-option--icon-only": isIconOnly.value
6722
- }]),
6723
- for: unref(localId)
6724
- }, [
6725
- createElementVNode("input", {
6726
- id: unref(localId),
6727
- class: "tao-segmented-option__input",
6728
- type: "radio",
6729
- name: inputName.value,
6730
- value: String(__props.value),
6731
- checked: isChecked.value,
6732
- disabled: isDisabled.value,
6733
- "aria-label": __props.ariaLabel,
6734
- onChange
6735
- }, null, 40, _hoisted_2$e),
6736
- createElementVNode("span", _hoisted_3$c, [
6737
- __props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$c, [
6738
- renderSlot(_ctx.$slots, "icon", {}, () => [
6739
- createTextVNode(toDisplayString(__props.icon), 1)
6740
- ], true)
6741
- ])) : createCommentVNode("", true),
6742
- hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_5$c, [
6743
- renderSlot(_ctx.$slots, "default", {}, () => [
6744
- createTextVNode(toDisplayString(__props.label), 1)
6745
- ], true)
6746
- ])) : __props.ariaLabel ? (openBlock(), createElementBlock("span", _hoisted_6$9, toDisplayString(__props.ariaLabel), 1)) : createCommentVNode("", true),
6747
- countLabel.value ? (openBlock(), createElementBlock("span", _hoisted_7$7, toDisplayString(countLabel.value), 1)) : createCommentVNode("", true)
6748
- ])
6749
7606
  ], 10, _hoisted_1$g);
6750
7607
  };
6751
7608
  }
6752
7609
  });
6753
- const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-fba7ca12"]]);
7610
+ const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-c76ef504"]]);
6754
7611
  const _hoisted_1$f = ["role", "aria-live"];
6755
7612
  const _hoisted_2$d = { class: "tao-alert__body" };
6756
7613
  const _hoisted_3$b = {
@@ -7722,7 +8579,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7722
8579
  class: "tao-breadcrumb__item"
7723
8580
  }, [
7724
8581
  index > 0 ? (openBlock(), createElementBlock("span", _hoisted_3$4, "/")) : createCommentVNode("", true),
7725
- index === __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(item.label), 1)) : item.to ? (openBlock(), createBlock(_sfc_main$q, {
8582
+ index === __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(item.label), 1)) : item.to ? (openBlock(), createBlock(_sfc_main$s, {
7726
8583
  key: 2,
7727
8584
  class: "tao-breadcrumb__link",
7728
8585
  to: item.to
@@ -9406,6 +10263,50 @@ const confirm = Object.assign(confirmFn, {
9406
10263
  resolveConfirm(false);
9407
10264
  }
9408
10265
  });
10266
+ const round = (v, digits) => {
10267
+ const k = Math.pow(10, digits);
10268
+ return Math.round(v * k) / k + 0;
10269
+ };
10270
+ function colorModel(source, options = {}) {
10271
+ const { format = "object", range = 255, space = "srgb", alpha = false, precision = 5 } = options;
10272
+ if (space === "linear" && range !== 1) throw new Error("colorModel: linear space needs range: 1");
10273
+ function read(value) {
10274
+ let parts;
10275
+ if (format === "css") {
10276
+ return parseColor(String(value)) ?? { r: 0, g: 0, b: 0, a: 1 };
10277
+ } else if (format === "array") {
10278
+ parts = value.slice(0, 4);
10279
+ } else {
10280
+ const o = value;
10281
+ parts = [o.r ?? 0, o.g ?? 0, o.b ?? 0, o.a ?? 1];
10282
+ }
10283
+ const channels = [0, 1, 2].map((i) => {
10284
+ const v = Number(parts[i] ?? 0);
10285
+ return space === "linear" ? linearToSrgb(v) * 255 : range === 1 ? v * 255 : v;
10286
+ });
10287
+ return { r: channels[0], g: channels[1], b: channels[2], a: parts[3] === void 0 ? 1 : Number(parts[3]) };
10288
+ }
10289
+ function write(c) {
10290
+ const out = [c.r, c.g, c.b].map((v) => {
10291
+ if (space === "linear") return round(srgbToLinear(v / 255), precision);
10292
+ return range === 1 ? round(v / 255, precision) : Math.round(v);
10293
+ });
10294
+ const a = round(c.a, 3);
10295
+ if (format === "css") {
10296
+ const [r, g, b] = [c.r, c.g, c.b].map(Math.round);
10297
+ return alpha ? `rgb(${r} ${g} ${b} / ${a})` : `rgb(${r} ${g} ${b})`;
10298
+ }
10299
+ if (format === "array") return alpha ? [...out, a] : out;
10300
+ return alpha ? { r: out[0], g: out[1], b: out[2], a } : { r: out[0], g: out[1], b: out[2] };
10301
+ }
10302
+ return computed({
10303
+ get: () => toHex(read(source.value), alpha),
10304
+ set: (hex) => {
10305
+ const parsed = parseColor(hex);
10306
+ if (parsed) source.value = write(parsed);
10307
+ }
10308
+ });
10309
+ }
9409
10310
  const components = [
9410
10311
  TaoButton,
9411
10312
  TaoBlock,
@@ -9416,13 +10317,14 @@ const components = [
9416
10317
  TaoCard,
9417
10318
  TaoModal,
9418
10319
  TaoTabs,
10320
+ TaoTimeline,
9419
10321
  TaoTooltip,
9420
10322
  TaoPopover,
9421
10323
  TaoSpoiler,
9422
10324
  TaoSpoilerGroup,
9423
10325
  TaoCopy,
9424
10326
  TaoContainer,
9425
- _sfc_main$K,
10327
+ _sfc_main$M,
9426
10328
  TaoSpace,
9427
10329
  TaoGrid,
9428
10330
  TaoGridItem,
@@ -9438,13 +10340,16 @@ const components = [
9438
10340
  TaoTextarea,
9439
10341
  TaoScrollTop,
9440
10342
  TaoProgress,
9441
- TaoSlider,
10343
+ _sfc_main$U,
10344
+ _sfc_main$w,
9442
10345
  TaoFileDrop,
9443
10346
  TaoDropdownMenu,
9444
10347
  TaoPinCode,
9445
- _sfc_main$q,
10348
+ _sfc_main$s,
9446
10349
  TaoFormField,
9447
10350
  TaoSelect,
10351
+ TaoColorInput,
10352
+ TaoColorPicker,
9448
10353
  TaoCombobox,
9449
10354
  TaoDate,
9450
10355
  TaoDateRange,
@@ -9489,6 +10394,8 @@ export {
9489
10394
  TaoCard,
9490
10395
  TaoCarousel,
9491
10396
  TaoCheckbox,
10397
+ TaoColorInput,
10398
+ TaoColorPicker,
9492
10399
  TaoCombobox,
9493
10400
  TaoConfirmHost,
9494
10401
  TaoContainer,
@@ -9502,7 +10409,7 @@ export {
9502
10409
  TaoEmpty,
9503
10410
  TaoFieldset,
9504
10411
  TaoFileDrop,
9505
- _sfc_main$K as TaoFlex,
10412
+ _sfc_main$M as TaoFlex,
9506
10413
  TaoFormField,
9507
10414
  TaoGrid,
9508
10415
  TaoGridItem,
@@ -9511,7 +10418,7 @@ export {
9511
10418
  TaoInput,
9512
10419
  TaoInputGroup,
9513
10420
  TaoInputNumber,
9514
- _sfc_main$q as TaoLink,
10421
+ _sfc_main$s as TaoLink,
9515
10422
  TaoList,
9516
10423
  TaoListItem,
9517
10424
  TaoLoader,
@@ -9523,12 +10430,13 @@ export {
9523
10430
  TaoQuantity,
9524
10431
  TaoRadio,
9525
10432
  TaoRadioGroup,
10433
+ _sfc_main$w as TaoRangeSlider,
9526
10434
  TaoScrollTop,
9527
10435
  TaoSegmented,
9528
10436
  TaoSegmentedOption,
9529
10437
  TaoSelect,
9530
10438
  TaoSkeleton,
9531
- TaoSlider,
10439
+ _sfc_main$U as TaoSlider,
9532
10440
  TaoSpace,
9533
10441
  TaoSplit,
9534
10442
  TaoSpoiler,
@@ -9539,20 +10447,31 @@ export {
9539
10447
  TaoTabs,
9540
10448
  TaoTag,
9541
10449
  TaoTextarea,
10450
+ TaoTimeline,
9542
10451
  TaoToastViewport,
9543
10452
  TaoTooltip,
9544
10453
  TaoUI,
10454
+ colorModel,
9545
10455
  confirm,
9546
10456
  TaoUI as default,
9547
10457
  formatTaoDateIso,
9548
10458
  formatTaoDateLabel,
9549
10459
  formatTaoDateRangeLabel,
10460
+ hslToRgb,
10461
+ hsvaToRgba,
10462
+ linearToSrgb,
9550
10463
  localeEn,
9551
10464
  localeRu,
10465
+ normalizeHex,
10466
+ parseColor,
9552
10467
  parseTaoDate,
9553
10468
  parseTaoDateRange,
10469
+ rgbToHsl,
10470
+ rgbaToHsva,
9554
10471
  setTaoLocale,
10472
+ srgbToLinear,
9555
10473
  taoLocale,
10474
+ toHex,
9556
10475
  toast,
9557
10476
  todayTaoDate
9558
10477
  };