@1337exp/taoui 5.28.0 → 5.30.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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { shallowReactive, defineComponent, useCssVars, computed, openBlock, createElementBlock, renderSlot, normalizeClass, normalizeStyle, ref, inject, provide, shallowRef, unref, createElementVNode, createStaticVNode, toDisplayString, createCommentVNode, useSlots, useAttrs, createBlock, useId, mergeProps, watch, createVNode, toValue, onBeforeUnmount, nextTick, onMounted, Teleport, Transition, withCtx, Fragment, renderList, createTextVNode, createSlots, normalizeProps, guardReactiveProps, resolveDynamicComponent, withModifiers, onBeforeMount, resolveComponent, toRef, withDirectives, vShow, getCurrentInstance, reactive, withKeys, vModelText, TransitionGroup, onUpdated, createApp } from "vue";
1
+ import { Comment, Text, Fragment, shallowReactive, defineComponent, useCssVars, computed, openBlock, createElementBlock, renderSlot, normalizeClass, normalizeStyle, ref, inject, provide, shallowRef, unref, createElementVNode, createStaticVNode, toDisplayString, createCommentVNode, useSlots, useAttrs, createBlock, useId, mergeProps, watch, createVNode, toValue, onBeforeUnmount, nextTick, onMounted, Teleport, Transition, withCtx, renderList, createTextVNode, withDirectives, withModifiers, withKeys, vModelText, createSlots, normalizeProps, guardReactiveProps, resolveDynamicComponent, onBeforeMount, resolveComponent, toRef, vShow, getCurrentInstance, reactive, TransitionGroup, onUpdated, createApp } from "vue";
2
2
  function isDev() {
3
3
  try {
4
4
  return process.env.NODE_ENV !== "production";
@@ -28,6 +28,18 @@ function resolveSize(el, size) {
28
28
  const value = getComputedStyle(el).getPropertyValue("--tao-size").trim();
29
29
  return sizes.includes(value) ? value : "medium";
30
30
  }
31
+ function slotHas(slots, name = "default") {
32
+ return slotHasContent(slots[name]?.());
33
+ }
34
+ function slotHasContent(nodes) {
35
+ if (!nodes) return false;
36
+ return nodes.some((node) => {
37
+ if (node.type === Comment) return false;
38
+ if (node.type === Text) return typeof node.children === "string" && node.children.trim() !== "";
39
+ if (node.type === Fragment) return Array.isArray(node.children) && slotHasContent(node.children);
40
+ return true;
41
+ });
42
+ }
31
43
  const tones = ["accent", "neutral", "success", "danger", "warning", "info"];
32
44
  function toneClass(tone) {
33
45
  if (tone && !tones.includes(tone)) {
@@ -258,6 +270,7 @@ const localeEn = {
258
270
  clearText: "Clear"
259
271
  },
260
272
  scrubber: { playLabel: "Play", pauseLabel: "Pause", restartLabel: "Restart" },
273
+ slider: { editLabel: "Value" },
261
274
  toast: { closeLabel: "Close notification" }
262
275
  };
263
276
  const confirmDefaults = {
@@ -491,6 +504,7 @@ const localeRu = {
491
504
  clearText: "Очистить"
492
505
  },
493
506
  scrubber: { playLabel: "Играть", pauseLabel: "Пауза", restartLabel: "В начало" },
507
+ slider: { editLabel: "Значение" },
494
508
  toast: { closeLabel: "Закрыть уведомление" }
495
509
  };
496
510
  const language = (tag) => tag.toLowerCase().split(/[-_]/)[0] ?? "";
@@ -658,7 +672,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
658
672
  }
659
673
  });
660
674
  const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__scopeId", "data-v-03f29efb"]]);
661
- const _hoisted_1$16 = ["type", "aria-pressed", "aria-keyshortcuts", "aria-busy", "disabled"];
675
+ const _hoisted_1$16 = ["type", "aria-pressed", "aria-keyshortcuts", "title", "aria-busy", "disabled"];
662
676
  const _hoisted_2$Y = {
663
677
  key: 2,
664
678
  class: "tao-button__content"
@@ -694,10 +708,18 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
694
708
  const emit = __emit;
695
709
  const slots = useSlots();
696
710
  const attrs = useAttrs();
697
- const iconOnly = computed(() => Boolean(props.icon || props.iconEnd) && !slots.default);
698
- if (iconOnly.value && !attrs["aria-label"] && !attrs["aria-labelledby"] && !attrs.title) {
711
+ const hasContent = () => slotHasContent(slots.default?.());
712
+ const isIconOnly = () => Boolean(props.icon || props.iconEnd) && !hasContent();
713
+ if (Boolean(props.icon || props.iconEnd) && !slots.default && !attrs["aria-label"] && !attrs["aria-labelledby"] && !attrs.title) {
699
714
  devWarning("button:icon-only", "TaoButton: a button with only an icon needs aria-label (or aria-labelledby / title).");
700
715
  }
716
+ function shortcutTitle() {
717
+ if (!props.shortcut || !isIconOnly()) {
718
+ return void 0;
719
+ }
720
+ const label = attrs["aria-label"];
721
+ return typeof label === "string" && label ? `${label} (${props.shortcut})` : props.shortcut;
722
+ }
701
723
  function handleClick(event) {
702
724
  if (!props.disabled && !props.loading) {
703
725
  emit("click", event);
@@ -716,7 +738,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
716
738
  "tao-button--disabled": __props.disabled,
717
739
  "tao-button--loading": __props.loading,
718
740
  "tao-button--block": __props.block,
719
- "tao-button--icon-only": iconOnly.value,
741
+ "tao-button--icon-only": isIconOnly(),
720
742
  "tao-button--toned": !!__props.tone && __props.tone !== "accent",
721
743
  "tao-button--pressed": __props.pressed === true
722
744
  }
@@ -725,6 +747,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
725
747
  type: __props.type,
726
748
  "aria-pressed": __props.pressed === void 0 ? void 0 : __props.pressed,
727
749
  "aria-keyshortcuts": __props.shortcut || void 0,
750
+ title: shortcutTitle(),
728
751
  "aria-busy": __props.loading || void 0,
729
752
  disabled: __props.disabled || __props.loading,
730
753
  onClick: handleClick
@@ -742,7 +765,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
742
765
  class: "tao-button__icon",
743
766
  name: __props.icon
744
767
  }, null, 8, ["name"])) : createCommentVNode("", true),
745
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_2$Y, [
768
+ hasContent() ? (openBlock(), createElementBlock("span", _hoisted_2$Y, [
746
769
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
747
770
  ])) : createCommentVNode("", true),
748
771
  __props.iconEnd ? (openBlock(), createBlock(TaoIcon, {
@@ -750,12 +773,12 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
750
773
  class: "tao-button__icon",
751
774
  name: __props.iconEnd
752
775
  }, null, 8, ["name"])) : createCommentVNode("", true),
753
- __props.shortcut ? (openBlock(), createElementBlock("kbd", _hoisted_3$P, toDisplayString(__props.shortcut), 1)) : createCommentVNode("", true)
776
+ __props.shortcut && !isIconOnly() ? (openBlock(), createElementBlock("kbd", _hoisted_3$P, toDisplayString(__props.shortcut), 1)) : createCommentVNode("", true)
754
777
  ], 14, _hoisted_1$16);
755
778
  };
756
779
  }
757
780
  });
758
- const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__scopeId", "data-v-278f587a"]]);
781
+ const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__scopeId", "data-v-be24f74d"]]);
759
782
  function toCssLength(value) {
760
783
  if (value === void 0 || value === null || value === "") {
761
784
  return void 0;
@@ -870,6 +893,8 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
870
893
  focused.value = true;
871
894
  emit("focus", event);
872
895
  }
896
+ const slots = useSlots();
897
+ const has = (name) => slotHas(slots, name);
873
898
  return (_ctx, _cache) => {
874
899
  return openBlock(), createElementBlock("div", mergeProps(unref(rootAttrs)(), {
875
900
  class: ["tao-input-wrapper", unref(sizeClass)(__props.size)]
@@ -880,11 +905,11 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
880
905
  "tao-input-shell--focused": focused.value,
881
906
  "tao-input-shell--invalid": unref(invalid),
882
907
  "tao-input-shell--disabled": __props.disabled,
883
- "tao-input-shell--prefix": _ctx.$slots.prefix,
884
- "tao-input-shell--suffix": _ctx.$slots.suffix
908
+ "tao-input-shell--prefix": has("prefix"),
909
+ "tao-input-shell--suffix": has("suffix")
885
910
  }])
886
911
  }, [
887
- _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_1$15, [
912
+ has("prefix") ? (openBlock(), createElementBlock("span", _hoisted_1$15, [
888
913
  renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
889
914
  ])) : createCommentVNode("", true),
890
915
  createElementVNode("input", mergeProps(unref(controlAttrs)(), {
@@ -900,7 +925,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
900
925
  onBlur: handleBlur,
901
926
  onFocus: handleFocus
902
927
  }), null, 16, _hoisted_2$X),
903
- _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_3$O, [
928
+ has("suffix") ? (openBlock(), createElementBlock("span", _hoisted_3$O, [
904
929
  renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
905
930
  ])) : createCommentVNode("", true)
906
931
  ], 2)
@@ -908,7 +933,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
908
933
  };
909
934
  }
910
935
  });
911
- const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-5b617319"]]);
936
+ const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-66bc5496"]]);
912
937
  const _hoisted_1$14 = {
913
938
  key: 0,
914
939
  class: "tao-input-group__addon tao-input-group__addon--before"
@@ -936,6 +961,8 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
936
961
  focused.value = false;
937
962
  }
938
963
  }
964
+ const slots = useSlots();
965
+ const has = (name) => slotHas(slots, name);
939
966
  return (_ctx, _cache) => {
940
967
  return openBlock(), createElementBlock("div", {
941
968
  class: normalizeClass(["tao-input-group", [unref(sizeClass)(__props.size), { "tao-input-group--focused": focused.value }]]),
@@ -943,20 +970,20 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
943
970
  onFocusin: onFocusIn,
944
971
  onFocusout: onFocusOut
945
972
  }, [
946
- _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_1$14, [
973
+ has("before") ? (openBlock(), createElementBlock("div", _hoisted_1$14, [
947
974
  renderSlot(_ctx.$slots, "before", {}, void 0, true)
948
975
  ])) : createCommentVNode("", true),
949
976
  createElementVNode("div", _hoisted_2$W, [
950
977
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
951
978
  ]),
952
- _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$N, [
979
+ has("after") ? (openBlock(), createElementBlock("div", _hoisted_3$N, [
953
980
  renderSlot(_ctx.$slots, "after", {}, void 0, true)
954
981
  ])) : createCommentVNode("", true)
955
982
  ], 34);
956
983
  };
957
984
  }
958
985
  });
959
- const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-55b2d297"]]);
986
+ const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-d38f6b53"]]);
960
987
  const _hoisted_1$13 = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
961
988
  const _hoisted_2$V = {
962
989
  key: 0,
@@ -1374,7 +1401,7 @@ const _hoisted_6$o = {
1374
1401
  key: 0,
1375
1402
  class: "tao-card__title"
1376
1403
  };
1377
- const _hoisted_7$j = {
1404
+ const _hoisted_7$k = {
1378
1405
  key: 1,
1379
1406
  class: "tao-card__sub"
1380
1407
  };
@@ -1415,11 +1442,12 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
1415
1442
  const l10n = useLocaleText(props, "card");
1416
1443
  const emit = __emit;
1417
1444
  const slots = useSlots();
1445
+ const has = (name) => slotHas(slots, name);
1418
1446
  const hasContent = computed(
1419
- () => Boolean(slots.header) || Boolean(slots.title) || Boolean(slots.sub) || Boolean(slots.default) || Boolean(slots.footer)
1447
+ () => has("header") || has("title") || has("sub") || has("default") || has("footer")
1420
1448
  );
1421
- const mediaOnly = computed(() => Boolean(slots.media) && !hasContent.value);
1422
- const hasCorner = computed(() => Boolean(slots.corner) || props.closable);
1449
+ const mediaOnly = computed(() => has("media") && !hasContent.value);
1450
+ const hasCorner = computed(() => has("corner") || props.closable);
1423
1451
  const paddingStyle = computed(() => props.padding === void 0 || props.flush ? void 0 : { padding: toCssBox(props.padding) });
1424
1452
  const radiusStyle = computed(() => {
1425
1453
  const pad = props.padding;
@@ -1457,21 +1485,21 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
1457
1485
  class: "tao-card__content",
1458
1486
  style: normalizeStyle(paddingStyle.value)
1459
1487
  }, [
1460
- _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_4$D, [
1488
+ has("header") ? (openBlock(), createElementBlock("div", _hoisted_4$D, [
1461
1489
  renderSlot(_ctx.$slots, "header", {}, void 0, true)
1462
1490
  ])) : createCommentVNode("", true),
1463
- _ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_5$t, [
1464
- _ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_6$o, [
1491
+ has("title") || has("sub") ? (openBlock(), createElementBlock("div", _hoisted_5$t, [
1492
+ has("title") ? (openBlock(), createElementBlock("h2", _hoisted_6$o, [
1465
1493
  renderSlot(_ctx.$slots, "title", {}, void 0, true)
1466
1494
  ])) : createCommentVNode("", true),
1467
- _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_7$j, [
1495
+ has("sub") ? (openBlock(), createElementBlock("div", _hoisted_7$k, [
1468
1496
  renderSlot(_ctx.$slots, "sub", {}, void 0, true)
1469
1497
  ])) : createCommentVNode("", true)
1470
1498
  ])) : createCommentVNode("", true),
1471
- _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_8$d, [
1499
+ has("default") ? (openBlock(), createElementBlock("div", _hoisted_8$d, [
1472
1500
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1473
1501
  ])) : createCommentVNode("", true),
1474
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_9$9, [
1502
+ has("footer") ? (openBlock(), createElementBlock("div", _hoisted_9$9, [
1475
1503
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
1476
1504
  ])) : createCommentVNode("", true)
1477
1505
  ], 4)) : createCommentVNode("", true),
@@ -1494,7 +1522,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
1494
1522
  };
1495
1523
  }
1496
1524
  });
1497
- const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-72c9a80f"]]);
1525
+ const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-4096cfb6"]]);
1498
1526
  const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1499
1527
  function getFocusable(root) {
1500
1528
  return [...root.querySelectorAll(FOCUSABLE)].filter(
@@ -1665,7 +1693,7 @@ const _hoisted_3$J = ["id"];
1665
1693
  const _hoisted_4$C = { key: 1 };
1666
1694
  const _hoisted_5$s = ["aria-label"];
1667
1695
  const _hoisted_6$n = { "aria-hidden": "true" };
1668
- const _hoisted_7$i = { class: "tao-modal__content" };
1696
+ const _hoisted_7$j = { class: "tao-modal__content" };
1669
1697
  const _hoisted_8$c = {
1670
1698
  key: 1,
1671
1699
  class: "tao-modal__footer"
@@ -1730,6 +1758,8 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
1730
1758
  },
1731
1759
  { immediate: true }
1732
1760
  );
1761
+ const slots = useSlots();
1762
+ const has = (name) => slotHas(slots, name);
1733
1763
  return (_ctx, _cache) => {
1734
1764
  return openBlock(), createBlock(Teleport, { to: "body" }, [
1735
1765
  createVNode(Transition, { name: "tao-modal-fade" }, {
@@ -1775,10 +1805,10 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
1775
1805
  ])
1776
1806
  ], 8, _hoisted_5$s)) : createCommentVNode("", true)
1777
1807
  ])) : createCommentVNode("", true),
1778
- createElementVNode("div", _hoisted_7$i, [
1808
+ createElementVNode("div", _hoisted_7$j, [
1779
1809
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1780
1810
  ]),
1781
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8$c, [
1811
+ has("footer") ? (openBlock(), createElementBlock("div", _hoisted_8$c, [
1782
1812
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
1783
1813
  ])) : createCommentVNode("", true)
1784
1814
  ], 16, _hoisted_1$10)
@@ -1790,7 +1820,7 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
1790
1820
  };
1791
1821
  }
1792
1822
  });
1793
- const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-347eb7af"]]);
1823
+ const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-855470e7"]]);
1794
1824
  const _hoisted_1$$ = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
1795
1825
  const _hoisted_2$R = ["id", "aria-labelledby"];
1796
1826
  const _sfc_main$1b = /* @__PURE__ */ defineComponent({
@@ -2417,17 +2447,18 @@ function zoneGradient(zones, min, max, vertical = false, dimmed = false) {
2417
2447
  return `linear-gradient(${vertical ? "to top" : "to right"}, ${stops.join(", ")})`;
2418
2448
  }
2419
2449
  const _hoisted_1$_ = ["aria-disabled"];
2420
- const _hoisted_2$Q = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-label", "aria-orientation", "aria-disabled", "aria-invalid", "aria-describedby", "onKeydown"];
2450
+ const _hoisted_2$Q = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-label", "aria-orientation", "aria-disabled", "aria-invalid", "aria-describedby", "aria-keyshortcuts", "onKeydown"];
2421
2451
  const _hoisted_3$I = {
2422
2452
  key: 2,
2423
2453
  class: "tao-slider__value"
2424
2454
  };
2425
- const _hoisted_4$B = {
2455
+ const _hoisted_4$B = ["aria-label", "onKeydown"];
2456
+ const _hoisted_5$r = {
2426
2457
  key: 0,
2427
2458
  class: "tao-slider__marks"
2428
2459
  };
2429
- const _hoisted_5$r = ["disabled", "onClick"];
2430
- const _hoisted_6$m = {
2460
+ const _hoisted_6$m = ["disabled", "onClick"];
2461
+ const _hoisted_7$i = {
2431
2462
  key: 0,
2432
2463
  class: "tao-slider__mark-label"
2433
2464
  };
@@ -2454,6 +2485,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2454
2485
  size: {},
2455
2486
  ariaLabel: {},
2456
2487
  wheel: { default: 0 },
2488
+ editable: { type: Boolean, default: false },
2489
+ editLabel: {},
2457
2490
  modelValue: {}
2458
2491
  },
2459
2492
  emits: ["update:modelValue", "change"],
@@ -2461,6 +2494,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2461
2494
  const props = __props;
2462
2495
  const emit = __emit;
2463
2496
  const { controlId, invalid, describedBy } = useField(props);
2497
+ const l10n = useLocaleText(props, "slider");
2464
2498
  const isRange = computed(() => Array.isArray(props.modelValue));
2465
2499
  const values = computed(() => normalizeValue(props.modelValue, props.min, props.max));
2466
2500
  const text = (v) => props.format ? props.format(v) : String(v);
@@ -2585,6 +2619,53 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2585
2619
  if (dragPointer !== -1 && event.pointerId !== dragPointer) return;
2586
2620
  endDrag();
2587
2621
  }
2622
+ const editorRef = ref(null);
2623
+ const editing = ref(null);
2624
+ const draft = ref("");
2625
+ const DECIMAL = /^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i;
2626
+ function openEditor(index) {
2627
+ if (!props.editable || props.disabled) return;
2628
+ endDrag();
2629
+ activeThumb.value = index;
2630
+ draft.value = String(values.value[index]);
2631
+ editing.value = index;
2632
+ void nextTick(() => {
2633
+ editorRef.value?.focus();
2634
+ editorRef.value?.select();
2635
+ });
2636
+ }
2637
+ function closeEditor(refocus) {
2638
+ const index = editing.value;
2639
+ editing.value = null;
2640
+ if (refocus && index !== null) {
2641
+ void nextTick(() => railRef.value?.querySelectorAll(".tao-slider__thumb")[index]?.focus({ preventScroll: true }));
2642
+ }
2643
+ return index;
2644
+ }
2645
+ function commitEditor(refocus = false) {
2646
+ const index = closeEditor(refocus);
2647
+ if (index === null) return;
2648
+ const typed = draft.value.trim().replace(/\s/g, "").replace(",", ".");
2649
+ if (!DECIMAL.test(typed)) return;
2650
+ const parsed = Number(typed);
2651
+ if (!Number.isFinite(parsed)) return;
2652
+ const target = stepped.value ? nearestMark(parsed, markValues.value) : valueAt(ratioOf(parsed, props.min, props.max), props.min, props.max, props.step);
2653
+ setThumb(index, target, true);
2654
+ }
2655
+ function cancelEditor() {
2656
+ closeEditor(true);
2657
+ }
2658
+ function onEditGesture(event) {
2659
+ if (!props.editable || props.disabled) return;
2660
+ event.preventDefault();
2661
+ openEditor(nearestThumb(values.value, valueUnder(event), activeThumb.value));
2662
+ }
2663
+ watch(
2664
+ () => props.disabled || !props.editable,
2665
+ (off) => {
2666
+ if (off) editing.value = null;
2667
+ }
2668
+ );
2588
2669
  function onKeydown2(event, index) {
2589
2670
  if (props.disabled) return;
2590
2671
  pointerFocus.value = false;
@@ -2603,6 +2684,10 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2603
2684
  next = props.min;
2604
2685
  } else if (event.key === "End") {
2605
2686
  next = props.max;
2687
+ } else if (props.editable && (event.key === "Enter" || event.key === "F2")) {
2688
+ event.preventDefault();
2689
+ openEditor(index);
2690
+ return;
2606
2691
  }
2607
2692
  if (next === null) return;
2608
2693
  event.preventDefault();
@@ -2660,9 +2745,11 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2660
2745
  onPointermove: onPointerMove,
2661
2746
  onPointerup: onPointerEnd,
2662
2747
  onPointercancel: onPointerEnd,
2663
- onLostpointercapture: endDrag
2748
+ onLostpointercapture: endDrag,
2749
+ onContextmenu: onEditGesture,
2750
+ onDblclick: onEditGesture
2664
2751
  }, [
2665
- _cache[1] || (_cache[1] = createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
2752
+ _cache[8] || (_cache[8] = createElementVNode("div", { class: "tao-slider__track" }, null, -1)),
2666
2753
  zoneList.value.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2667
2754
  createElementVNode("div", {
2668
2755
  class: "tao-slider__track tao-slider__zones tao-slider__zones--dim",
@@ -2702,6 +2789,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2702
2789
  "aria-disabled": __props.disabled || void 0,
2703
2790
  "aria-invalid": unref(invalid) || void 0,
2704
2791
  "aria-describedby": unref(describedBy),
2792
+ "aria-keyshortcuts": __props.editable ? "Enter F2" : void 0,
2705
2793
  onKeydown: ($event) => onKeydown2($event, i),
2706
2794
  onBlur: _cache[0] || (_cache[0] = ($event) => pointerFocus.value = false)
2707
2795
  }, null, 46, _hoisted_2$Q),
@@ -2720,13 +2808,40 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2720
2808
  ], 6)) : createCommentVNode("", true)
2721
2809
  ], 64);
2722
2810
  }), 128)),
2723
- __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$I, [
2811
+ __props.showValue && editing.value === null ? (openBlock(), createElementBlock("div", _hoisted_3$I, [
2724
2812
  renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
2725
2813
  createTextVNode(toDisplayString(barText.value), 1),
2726
2814
  renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
2727
- ])) : createCommentVNode("", true)
2815
+ ])) : createCommentVNode("", true),
2816
+ editing.value !== null ? withDirectives((openBlock(), createElementBlock("input", {
2817
+ key: 3,
2818
+ ref_key: "editorRef",
2819
+ ref: editorRef,
2820
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => draft.value = $event),
2821
+ class: "tao-slider__editor",
2822
+ type: "text",
2823
+ inputmode: "decimal",
2824
+ autocomplete: "off",
2825
+ spellcheck: "false",
2826
+ "aria-label": __props.ariaLabel ?? unref(l10n).editLabel,
2827
+ onKeydown: [
2828
+ _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => commitEditor(true), ["prevent"]), ["enter"])),
2829
+ withKeys(withModifiers(cancelEditor, ["prevent", "stop"]), ["esc"])
2830
+ ],
2831
+ onBlur: _cache[3] || (_cache[3] = ($event) => commitEditor()),
2832
+ onPointerdown: _cache[4] || (_cache[4] = withModifiers(() => {
2833
+ }, ["stop"])),
2834
+ onContextmenu: _cache[5] || (_cache[5] = withModifiers(() => {
2835
+ }, ["stop"])),
2836
+ onDblclick: _cache[6] || (_cache[6] = withModifiers(() => {
2837
+ }, ["stop"])),
2838
+ onWheel: _cache[7] || (_cache[7] = withModifiers(() => {
2839
+ }, ["stop"]))
2840
+ }, null, 40, _hoisted_4$B)), [
2841
+ [vModelText, draft.value]
2842
+ ]) : createCommentVNode("", true)
2728
2843
  ], 34),
2729
- markList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_4$B, [
2844
+ markList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5$r, [
2730
2845
  (openBlock(true), createElementBlock(Fragment, null, renderList(markList.value, (mark) => {
2731
2846
  return openBlock(), createElementBlock("button", {
2732
2847
  key: mark.value,
@@ -2741,8 +2856,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2741
2856
  tabindex: "-1",
2742
2857
  onClick: ($event) => onMarkClick(mark)
2743
2858
  }, [
2744
- _cache[2] || (_cache[2] = createElementVNode("span", { class: "tao-slider__tick" }, null, -1)),
2745
- mark.label ? (openBlock(), createElementBlock("span", _hoisted_6$m, [
2859
+ _cache[9] || (_cache[9] = createElementVNode("span", { class: "tao-slider__tick" }, null, -1)),
2860
+ mark.label ? (openBlock(), createElementBlock("span", _hoisted_7$i, [
2746
2861
  renderSlot(_ctx.$slots, "mark", {
2747
2862
  mark,
2748
2863
  active: unref(isMarkActive)(mark.value, values.value)
@@ -2750,14 +2865,14 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
2750
2865
  createTextVNode(toDisplayString(mark.label), 1)
2751
2866
  ], true)
2752
2867
  ])) : createCommentVNode("", true)
2753
- ], 14, _hoisted_5$r);
2868
+ ], 14, _hoisted_6$m);
2754
2869
  }), 128))
2755
2870
  ])) : createCommentVNode("", true)
2756
2871
  ], 42, _hoisted_1$_);
2757
2872
  };
2758
2873
  }
2759
2874
  });
2760
- const TaoSliderBase = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-f2374981"]]);
2875
+ const TaoSliderBase = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-8ec84551"]]);
2761
2876
  const _sfc_main$19 = /* @__PURE__ */ defineComponent({
2762
2877
  ...{ name: "TaoSlider" },
2763
2878
  __name: "TaoSlider",
@@ -2781,6 +2896,8 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
2781
2896
  size: {},
2782
2897
  ariaLabel: {},
2783
2898
  wheel: {},
2899
+ editable: { type: Boolean },
2900
+ editLabel: {},
2784
2901
  modelValue: {}
2785
2902
  },
2786
2903
  emits: ["update:modelValue", "change"],
@@ -3144,6 +3261,17 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
3144
3261
  }
3145
3262
  });
3146
3263
  const TaoTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-32ae3936"]]);
3264
+ const resolved = ["compact", "default", "comfortable"];
3265
+ function densityClass(density) {
3266
+ return density ? `tao-density-${density}` : void 0;
3267
+ }
3268
+ function resolveDensity(el) {
3269
+ if (!el || typeof getComputedStyle === "undefined") {
3270
+ return "default";
3271
+ }
3272
+ const value = getComputedStyle(el).getPropertyValue("--tao-density").trim();
3273
+ return resolved.includes(value) ? value : "default";
3274
+ }
3147
3275
  function useDismiss(open, inside, onDismiss) {
3148
3276
  function onPointer(event) {
3149
3277
  const target = event.target;
@@ -3190,6 +3318,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
3190
3318
  const internal = ref(false);
3191
3319
  const isControlled = computed(() => props.modelValue !== void 0);
3192
3320
  const open = computed(() => isControlled.value ? Boolean(props.modelValue) : internal.value);
3321
+ const panelSize = ref("medium");
3322
+ const panelDensity = ref("default");
3193
3323
  function setOpen(next) {
3194
3324
  if (props.disabled && next) {
3195
3325
  return;
@@ -3223,6 +3353,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
3223
3353
  });
3224
3354
  watch(open, (isOpen) => {
3225
3355
  if (isOpen) {
3356
+ panelSize.value = resolveSize(triggerRef.value);
3357
+ panelDensity.value = resolveDensity(triggerRef.value);
3226
3358
  void nextTick(() => panelRef.value?.focus({ preventScroll: true }));
3227
3359
  }
3228
3360
  });
@@ -3244,19 +3376,19 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
3244
3376
  key: 0,
3245
3377
  ref_key: "panelRef",
3246
3378
  ref: panelRef,
3247
- class: "tao-popover__panel",
3379
+ class: normalizeClass(["tao-popover__panel", [unref(sizeClass)(panelSize.value), unref(densityClass)(panelDensity.value)]]),
3248
3380
  role: "dialog",
3249
3381
  tabindex: "-1",
3250
3382
  style: normalizeStyle(unref(panelStyle))
3251
3383
  }, [
3252
3384
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
3253
- ], 4)) : createCommentVNode("", true)
3385
+ ], 6)) : createCommentVNode("", true)
3254
3386
  ]))
3255
3387
  ]);
3256
3388
  };
3257
3389
  }
3258
3390
  });
3259
- const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-6822af1e"]]);
3391
+ const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-5b104664"]]);
3260
3392
  const spoilerGroupKey = Symbol("taoSpoilerGroup");
3261
3393
  function frameStyle(bordered) {
3262
3394
  if (bordered === void 0 || bordered === null) {
@@ -3327,6 +3459,8 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
3327
3459
  element.style.height = "0";
3328
3460
  });
3329
3461
  }
3462
+ const slots = useSlots();
3463
+ const has = (name) => slotHas(slots, name);
3330
3464
  return (_ctx, _cache) => {
3331
3465
  return openBlock(), createElementBlock("div", {
3332
3466
  class: "tao-spoiler",
@@ -3343,7 +3477,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
3343
3477
  class: normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }]),
3344
3478
  name: "tao-chevron-right"
3345
3479
  }, null, 8, ["class"]),
3346
- __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_2$O, [
3480
+ __props.title || has("title") ? (openBlock(), createElementBlock("span", _hoisted_2$O, [
3347
3481
  renderSlot(_ctx.$slots, "title", {}, () => [
3348
3482
  createTextVNode(toDisplayString(__props.title), 1)
3349
3483
  ], true)
@@ -3373,7 +3507,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
3373
3507
  };
3374
3508
  }
3375
3509
  });
3376
- const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-1e16d6d1"]]);
3510
+ const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-e9a2fb77"]]);
3377
3511
  const _hoisted_1$W = { class: "tao-spoiler-group" };
3378
3512
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
3379
3513
  ...{ name: "TaoSpoilerGroup" },
@@ -4581,6 +4715,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
4581
4715
  const l10n = useLocaleText(props, "tag");
4582
4716
  const emit = __emit;
4583
4717
  const slots = useSlots();
4718
+ const has = (name) => slotHas(slots, name);
4584
4719
  const style = computed(() => ({
4585
4720
  color: props.color || "",
4586
4721
  background: props.background || "",
@@ -4603,7 +4738,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
4603
4738
  ]]),
4604
4739
  style: normalizeStyle(style.value)
4605
4740
  }, [
4606
- _ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_1$P, [
4741
+ has("prefix") ? (openBlock(), createElementBlock("span", _hoisted_1$P, [
4607
4742
  renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
4608
4743
  ])) : createCommentVNode("", true),
4609
4744
  createElementVNode("span", _hoisted_2$J, [
@@ -4626,7 +4761,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
4626
4761
  };
4627
4762
  }
4628
4763
  });
4629
- const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-03794ffd"]]);
4764
+ const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-0af1f161"]]);
4630
4765
  const _hoisted_1$O = ["role", "aria-hidden"];
4631
4766
  const _hoisted_2$I = {
4632
4767
  key: 1,
@@ -4648,8 +4783,9 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
4648
4783
  setup(__props) {
4649
4784
  const props = __props;
4650
4785
  const slots = useSlots();
4786
+ const has = (name) => slotHas(slots, name);
4651
4787
  const gapSize = computed(() => props.size);
4652
- const hasLabel = computed(() => Boolean(props.text) || Boolean(slots.default));
4788
+ const hasLabel = computed(() => Boolean(props.text) || has("default"));
4653
4789
  return (_ctx, _cache) => {
4654
4790
  return openBlock(), createElementBlock("div", {
4655
4791
  class: normalizeClass(["tao-divider", [
@@ -4677,7 +4813,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
4677
4813
  };
4678
4814
  }
4679
4815
  });
4680
- const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-5899337f"]]);
4816
+ const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-c4a941aa"]]);
4681
4817
  const _hoisted_1$N = {
4682
4818
  key: 0,
4683
4819
  class: "tao-fieldset__legend"
@@ -4691,11 +4827,13 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
4691
4827
  align: { default: "start" }
4692
4828
  },
4693
4829
  setup(__props) {
4830
+ const slots = useSlots();
4831
+ const has = (name) => slotHas(slots, name);
4694
4832
  return (_ctx, _cache) => {
4695
4833
  return openBlock(), createElementBlock("fieldset", {
4696
4834
  class: normalizeClass(["tao-fieldset", `tao-fieldset--${__props.align}`])
4697
4835
  }, [
4698
- __props.legend || _ctx.$slots.legend ? (openBlock(), createElementBlock("legend", _hoisted_1$N, [
4836
+ __props.legend || has("legend") ? (openBlock(), createElementBlock("legend", _hoisted_1$N, [
4699
4837
  renderSlot(_ctx.$slots, "legend", {}, () => [
4700
4838
  createTextVNode(toDisplayString(__props.legend), 1)
4701
4839
  ], true)
@@ -4707,7 +4845,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
4707
4845
  };
4708
4846
  }
4709
4847
  });
4710
- const TaoFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-3445dafd"]]);
4848
+ const TaoFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-3ab4beaf"]]);
4711
4849
  const _sfc_main$R = /* @__PURE__ */ defineComponent({
4712
4850
  ...{ name: "TaoAnimatedBorder" },
4713
4851
  __name: "TaoAnimatedBorder",
@@ -5061,9 +5199,10 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
5061
5199
  setup(__props) {
5062
5200
  const props = __props;
5063
5201
  const slots = useSlots();
5202
+ const has = (name) => slotHas(slots, name);
5064
5203
  const minW = computed(() => props.minWidth ?? 200);
5065
5204
  const maxW = computed(() => props.maxWidth ?? 400);
5066
- const hasRight = computed(() => Boolean(slots.right));
5205
+ const hasRight = computed(() => has("right"));
5067
5206
  const percentPlace = computed(() => {
5068
5207
  if (!props.showPercentage) {
5069
5208
  return null;
@@ -5081,7 +5220,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
5081
5220
  class: normalizeClass(["tao-progress__container", { "tao-progress__container--over": showOverPercent.value }]),
5082
5221
  style: normalizeStyle({ minWidth: `${minW.value}px`, maxWidth: `${maxW.value}px` })
5083
5222
  }, [
5084
- _ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
5223
+ has("left") ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
5085
5224
  renderSlot(_ctx.$slots, "left", {}, void 0, true)
5086
5225
  ])) : createCommentVNode("", true),
5087
5226
  createElementVNode("div", _hoisted_3$y, [
@@ -5096,7 +5235,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
5096
5235
  }, null, 6)
5097
5236
  ], 4)
5098
5237
  ]),
5099
- _ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$p, [
5238
+ has("right") || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$p, [
5100
5239
  renderSlot(_ctx.$slots, "right", {}, void 0, true),
5101
5240
  showEndPercent.value ? (openBlock(), createElementBlock("span", _hoisted_6$k, toDisplayString(endPercentLabel.value), 1)) : createCommentVNode("", true)
5102
5241
  ])) : createCommentVNode("", true)
@@ -5105,7 +5244,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
5105
5244
  };
5106
5245
  }
5107
5246
  });
5108
- const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-4de488a6"]]);
5247
+ const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-35c69b59"]]);
5109
5248
  const _sfc_main$N = /* @__PURE__ */ defineComponent({
5110
5249
  ...{ name: "TaoRangeSlider" },
5111
5250
  __name: "TaoRangeSlider",
@@ -5129,6 +5268,8 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
5129
5268
  size: {},
5130
5269
  ariaLabel: {},
5131
5270
  wheel: {},
5271
+ editable: { type: Boolean },
5272
+ editLabel: {},
5132
5273
  modelValue: {}
5133
5274
  },
5134
5275
  emits: ["update:modelValue", "change"],
@@ -5403,17 +5544,6 @@ function menuReturnsFocus(reason) {
5403
5544
  return reason !== "outside" && reason !== "scroll";
5404
5545
  }
5405
5546
  const menuTreeKey = Symbol("taoMenuTree");
5406
- const resolved = ["compact", "default", "comfortable"];
5407
- function densityClass(density) {
5408
- return density ? `tao-density-${density}` : void 0;
5409
- }
5410
- function resolveDensity(el) {
5411
- if (!el || typeof getComputedStyle === "undefined") {
5412
- return "default";
5413
- }
5414
- const value = getComputedStyle(el).getPropertyValue("--tao-density").trim();
5415
- return resolved.includes(value) ? value : "default";
5416
- }
5417
5547
  function stepEnabled(enabled, from, delta, loop = true) {
5418
5548
  const count = enabled.length;
5419
5549
  if (!enabled.some(Boolean)) {
@@ -6608,6 +6738,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6608
6738
  const parts = props.segments ? arcs.value.map((arc) => `${arc.label} ${percent(arc.share)}`).join(", ") : `${props.value} / ${props.max}`;
6609
6739
  return props.label ? `${props.label}: ${parts}` : parts;
6610
6740
  });
6741
+ const slots = useSlots();
6742
+ const has = (name) => slotHas(slots, name);
6611
6743
  return (_ctx, _cache) => {
6612
6744
  return openBlock(), createElementBlock("div", {
6613
6745
  class: normalizeClass(["tao-donut", { "tao-donut--legend": __props.legend }])
@@ -6649,7 +6781,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6649
6781
  ]);
6650
6782
  }), 128))
6651
6783
  ], 8, _hoisted_2$x)),
6652
- _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_5$l, [
6784
+ has("default") ? (openBlock(), createElementBlock("div", _hoisted_5$l, [
6653
6785
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
6654
6786
  ])) : createCommentVNode("", true)
6655
6787
  ], 12, _hoisted_1$A),
@@ -6672,7 +6804,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6672
6804
  };
6673
6805
  }
6674
6806
  });
6675
- const TaoDonut = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-30b93ef0"]]);
6807
+ const TaoDonut = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-51178c3f"]]);
6676
6808
  const _hoisted_1$z = ["aria-label", "aria-rowcount", "aria-colcount"];
6677
6809
  const _hoisted_2$w = {
6678
6810
  class: "tao-heatmap__row tao-heatmap__head",
@@ -6989,6 +7121,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
6989
7121
  const l10n = useLocaleText(props, "nav");
6990
7122
  const emit = __emit;
6991
7123
  const slots = useSlots();
7124
+ const has = (name) => slotHas(slots, name);
6992
7125
  const standalone = computed(() => !slots.default);
6993
7126
  const overflowing = computed(() => props.items.length > props.maxBarItems);
6994
7127
  const barCount = computed(() => overflowing.value ? Math.max(1, props.maxBarItems - 1) : props.items.length);
@@ -7036,7 +7169,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
7036
7169
  "aria-label": unref(l10n).ariaLabel
7037
7170
  }, [
7038
7171
  createElementVNode("div", _hoisted_3$q, [
7039
- _ctx.$slots.action ? (openBlock(), createElementBlock("div", _hoisted_4$o, [
7172
+ has("action") ? (openBlock(), createElementBlock("div", _hoisted_4$o, [
7040
7173
  renderSlot(_ctx.$slots, "action", {}, void 0, true)
7041
7174
  ])) : createCommentVNode("", true),
7042
7175
  createElementVNode("ul", _hoisted_5$j, [
@@ -7099,7 +7232,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
7099
7232
  ], 10, _hoisted_10$3)
7100
7233
  ])) : createCommentVNode("", true)
7101
7234
  ]),
7102
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_13$1, [
7235
+ has("footer") ? (openBlock(), createElementBlock("div", _hoisted_13$1, [
7103
7236
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
7104
7237
  ])) : createCommentVNode("", true)
7105
7238
  ])
@@ -7122,7 +7255,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
7122
7255
  };
7123
7256
  }
7124
7257
  });
7125
- const TaoNav = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-31b1af76"]]);
7258
+ const TaoNav = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-83603250"]]);
7126
7259
  function visibleRows(nodes, expanded, children) {
7127
7260
  const rows = [];
7128
7261
  const ancestors = /* @__PURE__ */ new Set();
@@ -7730,6 +7863,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
7730
7863
  setup(__props, { expose: __expose }) {
7731
7864
  const props = __props;
7732
7865
  const slots = useSlots();
7866
+ const has = (name) => slotHas(slots, name);
7733
7867
  const box = ref(null);
7734
7868
  const meter = ref(null);
7735
7869
  const itemWidth = ref(0);
@@ -7793,7 +7927,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
7793
7927
  /** Measures again (after the content changed in a way the marquee cannot see). / Перемерить. */
7794
7928
  measure
7795
7929
  });
7796
- const hasSlot = computed(() => Boolean(slots.default));
7930
+ const hasSlot = computed(() => has("default"));
7797
7931
  return (_ctx, _cache) => {
7798
7932
  return openBlock(), createElementBlock("span", {
7799
7933
  ref_key: "box",
@@ -7842,7 +7976,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
7842
7976
  };
7843
7977
  }
7844
7978
  });
7845
- const TaoMarquee = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-300f470a"]]);
7979
+ const TaoMarquee = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-0d2fc5c4"]]);
7846
7980
  const PIN_CELL = "#";
7847
7981
  function parsePinFormat(format) {
7848
7982
  const mask = [...format];
@@ -8640,7 +8774,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
8640
8774
  };
8641
8775
  }
8642
8776
  });
8643
- const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-98154a39"]]);
8777
+ const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-49ed8ced"]]);
8644
8778
  const _hoisted_1$p = ["for"];
8645
8779
  const _hoisted_2$n = ["id", "name", "value", "checked", "disabled", "aria-label"];
8646
8780
  const _hoisted_3$j = { class: "tao-segmented-option__face" };
@@ -8680,6 +8814,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
8680
8814
  const emit = __emit;
8681
8815
  const group = inject(segmentedKey, null);
8682
8816
  const slots = useSlots();
8817
+ const has = (name) => slotHas(slots, name);
8683
8818
  const localId = useId();
8684
8819
  const isDisabled = computed(() => props.disabled || Boolean(group?.disabled.value));
8685
8820
  const inputName = computed(() => group?.name.value ?? props.name);
@@ -8687,8 +8822,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
8687
8822
  const current2 = group ? group.model.value : props.modelValue;
8688
8823
  return current2 === props.value;
8689
8824
  });
8690
- const hasLabel = computed(() => Boolean(props.label || slots.default));
8691
- const isIconOnly = computed(() => Boolean((props.icon || slots.icon) && !hasLabel.value));
8825
+ const hasLabel = computed(() => Boolean(props.label || has("default")));
8826
+ const isIconOnly = computed(() => Boolean((props.icon || has("icon")) && !hasLabel.value));
8692
8827
  const countLabel = computed(() => {
8693
8828
  if (props.count === void 0 || props.count === null || props.count === "") {
8694
8829
  return "";
@@ -8733,7 +8868,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
8733
8868
  onChange
8734
8869
  }, null, 40, _hoisted_2$n),
8735
8870
  createElementVNode("span", _hoisted_3$j, [
8736
- __props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$i, [
8871
+ __props.icon || has("icon") ? (openBlock(), createElementBlock("span", _hoisted_4$i, [
8737
8872
  renderSlot(_ctx.$slots, "icon", {}, () => [
8738
8873
  createVNode(TaoIcon, { name: __props.icon }, null, 8, ["name"])
8739
8874
  ], true)
@@ -8749,7 +8884,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
8749
8884
  };
8750
8885
  }
8751
8886
  });
8752
- const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-d2951a99"]]);
8887
+ const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-71f5d295"]]);
8753
8888
  const _hoisted_1$o = ["tabindex", "aria-label", "aria-valuetext", "aria-valuenow"];
8754
8889
  const _hoisted_2$m = { class: "tao-color-picker__strips" };
8755
8890
  const _hoisted_3$i = { class: "tao-color-picker__row" };
@@ -10611,6 +10746,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
10611
10746
  emit("update:modelValue", next);
10612
10747
  emit("change", next);
10613
10748
  }
10749
+ const slots = useSlots();
10750
+ const has = (name) => slotHas(slots, name);
10614
10751
  return (_ctx, _cache) => {
10615
10752
  return openBlock(), createElementBlock("label", mergeProps(unref(rootAttrs)(), {
10616
10753
  class: ["tao-switch", [unref(sizeClass)(__props.size), { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": unref(invalid), "tao-switch--loading": __props.loading }]],
@@ -10635,14 +10772,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
10635
10772
  }, [
10636
10773
  createElementVNode("span", { class: "tao-switch__thumb" })
10637
10774
  ], -1)),
10638
- __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$d, toDisplayString(__props.label), 1)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$d, [
10775
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$d, toDisplayString(__props.label), 1)) : has("default") ? (openBlock(), createElementBlock("span", _hoisted_4$d, [
10639
10776
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
10640
10777
  ])) : createCommentVNode("", true)
10641
10778
  ], 16, _hoisted_1$i);
10642
10779
  };
10643
10780
  }
10644
10781
  });
10645
- const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-06d25cc6"]]);
10782
+ const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-a2c618be"]]);
10646
10783
  const radioGroupKey = Symbol("taoRadioGroup");
10647
10784
  const _hoisted_1$h = ["for"];
10648
10785
  const _hoisted_2$f = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
@@ -10847,6 +10984,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10847
10984
  });
10848
10985
  onBeforeUnmount(() => pending?.());
10849
10986
  const isUrgent = computed(() => props.tone === "danger" || props.tone === "warning");
10987
+ const slots = useSlots();
10988
+ const has = (name) => slotHas(slots, name);
10850
10989
  return (_ctx, _cache) => {
10851
10990
  return openBlock(), createElementBlock("div", {
10852
10991
  class: normalizeClass(["tao-alert", unref(toneClass)(__props.tone)]),
@@ -10871,7 +11010,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10871
11010
  createVNode(TaoIcon, { name: "tao-chevron-down" })
10872
11011
  ], 2)
10873
11012
  ], 8, _hoisted_3$b)) : __props.title ? (openBlock(), createElementBlock("strong", _hoisted_5$a, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
10874
- _ctx.$slots.default && __props.collapsible ? (openBlock(), createElementBlock("div", {
11013
+ has("default") && __props.collapsible ? (openBlock(), createElementBlock("div", {
10875
11014
  key: 2,
10876
11015
  ref_key: "fold",
10877
11016
  ref: fold,
@@ -10885,7 +11024,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10885
11024
  }, [
10886
11025
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
10887
11026
  ], 40, _hoisted_6$7)
10888
- ], 2)) : _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
11027
+ ], 2)) : has("default") ? (openBlock(), createElementBlock("div", {
10889
11028
  key: 3,
10890
11029
  id: unref(bodyId),
10891
11030
  class: "tao-alert__message"
@@ -10910,7 +11049,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10910
11049
  };
10911
11050
  }
10912
11051
  });
10913
- const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-6fe7dc5f"]]);
11052
+ const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-6327e98d"]]);
10914
11053
  const _hoisted_1$e = { key: 0 };
10915
11054
  const _hoisted_2$c = ["aria-sort"];
10916
11055
  const _hoisted_3$a = ["onClick"];
@@ -11375,23 +11514,25 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
11375
11514
  setup(__props) {
11376
11515
  const props = __props;
11377
11516
  const l10n = useLocaleText(props, "empty");
11517
+ const slots = useSlots();
11518
+ const has = (name) => slotHas(slots, name);
11378
11519
  return (_ctx, _cache) => {
11379
11520
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
11380
- _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
11521
+ has("icon") ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
11381
11522
  renderSlot(_ctx.$slots, "icon", {}, void 0, true)
11382
11523
  ])) : createCommentVNode("", true),
11383
11524
  unref(l10n).title ? (openBlock(), createElementBlock("p", _hoisted_3$8, toDisplayString(unref(l10n).title), 1)) : createCommentVNode("", true),
11384
- _ctx.$slots.default ? (openBlock(), createElementBlock("p", _hoisted_4$8, [
11525
+ has("default") ? (openBlock(), createElementBlock("p", _hoisted_4$8, [
11385
11526
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11386
11527
  ])) : createCommentVNode("", true),
11387
- _ctx.$slots.action ? (openBlock(), createElementBlock("div", _hoisted_5$7, [
11528
+ has("action") ? (openBlock(), createElementBlock("div", _hoisted_5$7, [
11388
11529
  renderSlot(_ctx.$slots, "action", {}, void 0, true)
11389
11530
  ])) : createCommentVNode("", true)
11390
11531
  ]);
11391
11532
  };
11392
11533
  }
11393
11534
  });
11394
- const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-7d3efeaf"]]);
11535
+ const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-8dc64a22"]]);
11395
11536
  const _hoisted_1$b = ["aria-label"];
11396
11537
  const _hoisted_2$9 = {
11397
11538
  key: 0,
@@ -11554,10 +11695,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
11554
11695
  const props = __props;
11555
11696
  const emit = __emit;
11556
11697
  const slots = useSlots();
11557
- const hasAction = computed(() => Boolean(slots.action));
11558
- const hasPrefix = computed(() => Boolean(slots.prefix));
11559
- const hasSuffix = computed(() => Boolean(slots.suffix));
11560
- const hasDescription = computed(() => Boolean(props.description || slots.description));
11698
+ const has = (name) => slotHas(slots, name);
11699
+ const hasAction = computed(() => has("action"));
11700
+ const hasPrefix = computed(() => has("prefix"));
11701
+ const hasSuffix = computed(() => has("suffix"));
11702
+ const hasDescription = computed(() => Boolean(props.description || has("description")));
11561
11703
  function onHitClick(event) {
11562
11704
  if (props.disabled || !props.clickable) {
11563
11705
  return;
@@ -11623,7 +11765,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
11623
11765
  };
11624
11766
  }
11625
11767
  });
11626
- const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-dd4f25c2"]]);
11768
+ const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-a366ba66"]]);
11627
11769
  const _hoisted_1$9 = {
11628
11770
  class: "tao-skeleton-group",
11629
11771
  "aria-hidden": true
@@ -11862,6 +12004,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
11862
12004
  },
11863
12005
  { immediate: true }
11864
12006
  );
12007
+ const slots = useSlots();
12008
+ const has = (name) => slotHas(slots, name);
11865
12009
  return (_ctx, _cache) => {
11866
12010
  return openBlock(), createBlock(Teleport, { to: "body" }, [
11867
12011
  createVNode(Transition, {
@@ -11919,7 +12063,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
11919
12063
  createElementVNode("div", _hoisted_8$1, [
11920
12064
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11921
12065
  ]),
11922
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
12066
+ has("footer") ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
11923
12067
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
11924
12068
  ])) : createCommentVNode("", true)
11925
12069
  ], 16, _hoisted_1$8)
@@ -11931,7 +12075,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
11931
12075
  };
11932
12076
  }
11933
12077
  });
11934
- const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-3b465e73"]]);
12078
+ const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-62e7a0d6"]]);
11935
12079
  const _hoisted_1$7 = ["title"];
11936
12080
  const _hoisted_2$6 = { class: "tao-avatar__face" };
11937
12081
  const _hoisted_3$5 = ["src", "alt"];