@1337exp/taoui 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -106,7 +106,7 @@ const _hoisted_3$z = {
106
106
  class: "tao-input__affix tao-input__affix--prefix"
107
107
  };
108
108
  const _hoisted_4$t = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
109
- const _hoisted_5$m = {
109
+ const _hoisted_5$l = {
110
110
  key: 1,
111
111
  class: "tao-input__affix tao-input__affix--suffix"
112
112
  };
@@ -181,7 +181,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
181
181
  onBlur: handleBlur,
182
182
  onFocus: handleFocus
183
183
  }, null, 42, _hoisted_4$t),
184
- _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_5$m, [
184
+ _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_5$l, [
185
185
  renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
186
186
  ])) : createCommentVNode("", true)
187
187
  ], 2),
@@ -243,7 +243,7 @@ const _hoisted_2$D = {
243
243
  };
244
244
  const _hoisted_3$x = ["aria-label", "disabled"];
245
245
  const _hoisted_4$s = { "aria-hidden": "true" };
246
- const _hoisted_5$l = ["aria-label", "disabled"];
246
+ const _hoisted_5$k = ["aria-label", "disabled"];
247
247
  const _hoisted_6$f = { "aria-hidden": "true" };
248
248
  const _sfc_main$R = /* @__PURE__ */ defineComponent({
249
249
  ...{ name: "TaoInputNumber" },
@@ -425,7 +425,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
425
425
  _cache[3] || (_cache[3] = createTextVNode("−", -1))
426
426
  ], true)
427
427
  ])
428
- ], 8, _hoisted_5$l)
428
+ ], 8, _hoisted_5$k)
429
429
  ])) : createCommentVNode("", true)
430
430
  ], 2);
431
431
  };
@@ -436,7 +436,7 @@ const _hoisted_1$J = ["aria-label", "disabled"];
436
436
  const _hoisted_2$C = { "aria-hidden": "true" };
437
437
  const _hoisted_3$w = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
438
438
  const _hoisted_4$r = ["aria-label", "disabled"];
439
- const _hoisted_5$k = { "aria-hidden": "true" };
439
+ const _hoisted_5$j = { "aria-hidden": "true" };
440
440
  const _sfc_main$Q = /* @__PURE__ */ defineComponent({
441
441
  ...{ name: "TaoQuantity" },
442
442
  __name: "TaoQuantity",
@@ -607,7 +607,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
607
607
  disabled: plusDisabled.value,
608
608
  onClick: onInc
609
609
  }, [
610
- createElementVNode("span", _hoisted_5$k, [
610
+ createElementVNode("span", _hoisted_5$j, [
611
611
  renderSlot(_ctx.$slots, "increment-icon", {}, () => [
612
612
  _cache[1] || (_cache[1] = createTextVNode("+", -1))
613
613
  ], true)
@@ -631,7 +631,7 @@ const _hoisted_4$q = {
631
631
  key: 2,
632
632
  class: "tao-card__title-block"
633
633
  };
634
- const _hoisted_5$j = {
634
+ const _hoisted_5$i = {
635
635
  key: 0,
636
636
  class: "tao-card__title"
637
637
  };
@@ -701,7 +701,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
701
701
  ])) : createCommentVNode("", true)
702
702
  ], 2)) : createCommentVNode("", true),
703
703
  _ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_4$q, [
704
- _ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_5$j, [
704
+ _ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_5$i, [
705
705
  renderSlot(_ctx.$slots, "title", {}, void 0, true)
706
706
  ])) : createCommentVNode("", true),
707
707
  _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_6$e, [
@@ -748,6 +748,31 @@ function trapTab(event, root) {
748
748
  first.focus();
749
749
  }
750
750
  }
751
+ let locks = 0;
752
+ let previousOverflow = "";
753
+ function isBrowser() {
754
+ return typeof document !== "undefined";
755
+ }
756
+ function lockBodyScroll() {
757
+ if (!isBrowser()) {
758
+ return;
759
+ }
760
+ if (locks === 0) {
761
+ previousOverflow = document.body.style.overflow;
762
+ document.body.style.overflow = "hidden";
763
+ }
764
+ locks += 1;
765
+ }
766
+ function unlockBodyScroll() {
767
+ if (!isBrowser() || locks === 0) {
768
+ return;
769
+ }
770
+ locks -= 1;
771
+ if (locks === 0) {
772
+ document.body.style.overflow = previousOverflow;
773
+ previousOverflow = "";
774
+ }
775
+ }
751
776
  const _hoisted_1$H = ["aria-labelledby"];
752
777
  const _hoisted_2$A = {
753
778
  key: 0,
@@ -755,7 +780,7 @@ const _hoisted_2$A = {
755
780
  };
756
781
  const _hoisted_3$u = ["id"];
757
782
  const _hoisted_4$p = { key: 1 };
758
- const _hoisted_5$i = ["aria-label"];
783
+ const _hoisted_5$h = ["aria-label"];
759
784
  const _hoisted_6$d = { "aria-hidden": "true" };
760
785
  const _hoisted_7$b = { class: "tao-modal__content" };
761
786
  const _hoisted_8$a = {
@@ -777,9 +802,8 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
777
802
  const emit = __emit;
778
803
  const panelRef = ref(null);
779
804
  const titleId = useId();
780
- let previousOverflow = "";
781
805
  let previousFocus = null;
782
- let scrollLocked = false;
806
+ let scrollHeld = false;
783
807
  function close() {
784
808
  if (!props.closable) {
785
809
  return;
@@ -787,21 +811,19 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
787
811
  emit("update:modelValue", false);
788
812
  emit("close");
789
813
  }
790
- function lockBodyScroll() {
791
- if (scrollLocked) {
814
+ function holdScroll() {
815
+ if (scrollHeld || !isBrowser()) {
792
816
  return;
793
817
  }
794
- previousOverflow = document.body.style.overflow;
795
- document.body.style.overflow = "hidden";
796
- scrollLocked = true;
818
+ lockBodyScroll();
819
+ scrollHeld = true;
797
820
  }
798
- function unlockBodyScroll() {
799
- if (!scrollLocked) {
821
+ function releaseScroll() {
822
+ if (!scrollHeld) {
800
823
  return;
801
824
  }
802
- document.body.style.overflow = previousOverflow;
803
- previousOverflow = "";
804
- scrollLocked = false;
825
+ unlockBodyScroll();
826
+ scrollHeld = false;
805
827
  }
806
828
  function restoreFocus() {
807
829
  var _a;
@@ -819,6 +841,9 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
819
841
  }
820
842
  function onKeydown(event) {
821
843
  if (event.key === "Escape") {
844
+ if (!props.closable) {
845
+ return;
846
+ }
822
847
  event.preventDefault();
823
848
  close();
824
849
  return;
@@ -830,19 +855,23 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
830
855
  watch(
831
856
  () => props.modelValue,
832
857
  (isOpen) => {
858
+ if (!isBrowser()) {
859
+ return;
860
+ }
833
861
  if (isOpen) {
834
862
  previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
835
- lockBodyScroll();
863
+ holdScroll();
836
864
  void focusPanel();
837
865
  return;
838
866
  }
839
- unlockBodyScroll();
867
+ releaseScroll();
840
868
  restoreFocus();
841
869
  },
842
870
  { immediate: true }
843
871
  );
844
872
  onBeforeUnmount(() => {
845
- unlockBodyScroll();
873
+ releaseScroll();
874
+ restoreFocus();
846
875
  });
847
876
  return (_ctx, _cache) => {
848
877
  return openBlock(), createBlock(Teleport, { to: "body" }, [
@@ -883,7 +912,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
883
912
  _cache[0] || (_cache[0] = createTextVNode("×", -1))
884
913
  ], true)
885
914
  ])
886
- ], 8, _hoisted_5$i)) : createCommentVNode("", true)
915
+ ], 8, _hoisted_5$h)) : createCommentVNode("", true)
887
916
  ])) : createCommentVNode("", true),
888
917
  createElementVNode("div", _hoisted_7$b, [
889
918
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
@@ -900,7 +929,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
900
929
  };
901
930
  }
902
931
  });
903
- const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-67d4b1e8"]]);
932
+ const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-102cfd66"]]);
904
933
  const _hoisted_1$G = { class: "tao-tabs" };
905
934
  const _hoisted_2$z = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
906
935
  const _hoisted_3$t = ["id", "aria-labelledby"];
@@ -1222,15 +1251,26 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
1222
1251
  function close() {
1223
1252
  void applyOpen(false);
1224
1253
  }
1225
- async function applyOpen(next) {
1226
- var _a;
1227
- setOpen(next);
1228
- if (!next) {
1254
+ function bindDismiss() {
1255
+ if (typeof document === "undefined") {
1229
1256
  return;
1230
1257
  }
1231
- await nextTick();
1232
- updatePosition();
1233
- (_a = panelRef.value) == null ? void 0 : _a.focus();
1258
+ document.addEventListener("pointerdown", onDocumentPointer);
1259
+ document.addEventListener("keydown", onDocumentKey);
1260
+ window.addEventListener("resize", onViewportChange);
1261
+ window.addEventListener("scroll", onViewportChange, true);
1262
+ }
1263
+ function unbindDismiss() {
1264
+ if (typeof document === "undefined") {
1265
+ return;
1266
+ }
1267
+ document.removeEventListener("pointerdown", onDocumentPointer);
1268
+ document.removeEventListener("keydown", onDocumentKey);
1269
+ window.removeEventListener("resize", onViewportChange);
1270
+ window.removeEventListener("scroll", onViewportChange, true);
1271
+ }
1272
+ function applyOpen(next) {
1273
+ setOpen(next);
1234
1274
  }
1235
1275
  function focusTrigger() {
1236
1276
  var _a, _b;
@@ -1243,7 +1283,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
1243
1283
  function updatePosition() {
1244
1284
  const trigger = triggerRef.value;
1245
1285
  const panel = panelRef.value;
1246
- if (!trigger || !panel) {
1286
+ if (typeof window === "undefined" || !trigger || !panel) {
1247
1287
  return;
1248
1288
  }
1249
1289
  const rect = trigger.getBoundingClientRect();
@@ -1326,24 +1366,24 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
1326
1366
  updatePosition();
1327
1367
  }
1328
1368
  }
1329
- watch(open, (isOpen) => {
1330
- if (isOpen) {
1331
- document.addEventListener("pointerdown", onDocumentPointer);
1332
- document.addEventListener("keydown", onDocumentKey);
1333
- window.addEventListener("resize", onViewportChange);
1334
- window.addEventListener("scroll", onViewportChange, true);
1335
- return;
1336
- }
1337
- document.removeEventListener("pointerdown", onDocumentPointer);
1338
- document.removeEventListener("keydown", onDocumentKey);
1339
- window.removeEventListener("resize", onViewportChange);
1340
- window.removeEventListener("scroll", onViewportChange, true);
1341
- });
1369
+ watch(
1370
+ open,
1371
+ (isOpen) => {
1372
+ if (isOpen) {
1373
+ bindDismiss();
1374
+ void nextTick(() => {
1375
+ var _a;
1376
+ updatePosition();
1377
+ (_a = panelRef.value) == null ? void 0 : _a.focus();
1378
+ });
1379
+ return;
1380
+ }
1381
+ unbindDismiss();
1382
+ },
1383
+ { immediate: true }
1384
+ );
1342
1385
  onBeforeUnmount(() => {
1343
- document.removeEventListener("pointerdown", onDocumentPointer);
1344
- document.removeEventListener("keydown", onDocumentKey);
1345
- window.removeEventListener("resize", onViewportChange);
1346
- window.removeEventListener("scroll", onViewportChange, true);
1386
+ unbindDismiss();
1347
1387
  });
1348
1388
  return (_ctx, _cache) => {
1349
1389
  return openBlock(), createElementBlock("div", _hoisted_1$F, [
@@ -1375,7 +1415,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
1375
1415
  };
1376
1416
  }
1377
1417
  });
1378
- const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-e4ead301"]]);
1418
+ const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-afd791a7"]]);
1379
1419
  const spoilerGroupKey = Symbol("taoSpoilerGroup");
1380
1420
  const _hoisted_1$E = { class: "tao-spoiler" };
1381
1421
  const _hoisted_2$y = ["aria-expanded", "aria-controls"];
@@ -1384,7 +1424,7 @@ const _hoisted_3$s = {
1384
1424
  class: "tao-spoiler__title"
1385
1425
  };
1386
1426
  const _hoisted_4$o = ["id"];
1387
- const _hoisted_5$h = { class: "tao-spoiler__content-inner" };
1427
+ const _hoisted_5$g = { class: "tao-spoiler__content-inner" };
1388
1428
  const _sfc_main$K = /* @__PURE__ */ defineComponent({
1389
1429
  ...{ name: "TaoSpoiler" },
1390
1430
  __name: "TaoSpoiler",
@@ -1470,7 +1510,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
1470
1510
  id: unref(panelId),
1471
1511
  class: "tao-spoiler__content"
1472
1512
  }, [
1473
- createElementVNode("div", _hoisted_5$h, [
1513
+ createElementVNode("div", _hoisted_5$g, [
1474
1514
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1475
1515
  ])
1476
1516
  ], 8, _hoisted_4$o)) : createCommentVNode("", true)
@@ -1487,14 +1527,19 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
1487
1527
  ...{ name: "TaoSpoilerGroup" },
1488
1528
  __name: "TaoSpoilerGroup",
1489
1529
  props: {
1490
- modelValue: { default: null }
1530
+ modelValue: {}
1491
1531
  },
1492
1532
  emits: ["update:modelValue", "change"],
1493
1533
  setup(__props, { emit: __emit }) {
1494
1534
  const props = __props;
1495
1535
  const emit = __emit;
1496
- const model = computed(() => props.modelValue);
1536
+ const isControlled = computed(() => props.modelValue !== void 0);
1537
+ const internal = ref(null);
1538
+ const model = computed(() => isControlled.value ? props.modelValue : internal.value);
1497
1539
  function setOpen(name) {
1540
+ if (!isControlled.value) {
1541
+ internal.value = name;
1542
+ }
1498
1543
  emit("update:modelValue", name);
1499
1544
  emit("change", name);
1500
1545
  }
@@ -1509,7 +1554,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
1509
1554
  };
1510
1555
  }
1511
1556
  });
1512
- const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-6b172e89"]]);
1557
+ const TaoSpoilerGroup = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-118970dd"]]);
1513
1558
  const _hoisted_1$C = ["aria-label"];
1514
1559
  const _sfc_main$I = /* @__PURE__ */ defineComponent({
1515
1560
  ...{ name: "TaoCopy" },
@@ -2166,20 +2211,24 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2166
2211
  const props = __props;
2167
2212
  const emit = __emit;
2168
2213
  const isLoaded = ref(false);
2214
+ const hasError = ref(false);
2169
2215
  function handleLoad() {
2170
2216
  isLoaded.value = true;
2217
+ hasError.value = false;
2171
2218
  emit("load");
2172
2219
  }
2173
2220
  function handleError() {
2174
2221
  isLoaded.value = false;
2222
+ hasError.value = true;
2175
2223
  emit("error");
2176
2224
  }
2177
2225
  watch(() => props.src, () => {
2178
2226
  isLoaded.value = false;
2227
+ hasError.value = false;
2179
2228
  });
2180
2229
  return (_ctx, _cache) => {
2181
2230
  return openBlock(), createElementBlock("div", _hoisted_1$z, [
2182
- __props.src ? (openBlock(), createElementBlock("img", {
2231
+ __props.src && !hasError.value ? (openBlock(), createElementBlock("img", {
2183
2232
  key: 0,
2184
2233
  class: normalizeClass({ "tao-image__img--hidden": !isLoaded.value, "tao-image__img--pixelated": props.pixelated }),
2185
2234
  src: __props.src,
@@ -2189,14 +2238,15 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2189
2238
  draggable: "false",
2190
2239
  onLoad: handleLoad,
2191
2240
  onError: handleError
2192
- }, null, 42, _hoisted_2$w)) : renderSlot(_ctx.$slots, "default", {}, () => [
2241
+ }, null, 42, _hoisted_2$w)) : createCommentVNode("", true),
2242
+ !__props.src || hasError.value ? renderSlot(_ctx.$slots, "default", {}, () => [
2193
2243
  createElementVNode("div", _hoisted_3$q, toDisplayString(__props.placeholderText), 1)
2194
- ], true, 1)
2244
+ ], true, 1) : createCommentVNode("", true)
2195
2245
  ]);
2196
2246
  };
2197
2247
  }
2198
2248
  });
2199
- const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-e7c911e5"]]);
2249
+ const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-aea39025"]]);
2200
2250
  const _hoisted_1$y = ["for"];
2201
2251
  const _hoisted_2$v = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
2202
2252
  const _hoisted_3$p = {
@@ -2734,7 +2784,7 @@ const _hoisted_4$j = {
2734
2784
  key: 0,
2735
2785
  class: "tao-progress__percentage"
2736
2786
  };
2737
- const _hoisted_5$g = {
2787
+ const _hoisted_5$f = {
2738
2788
  key: 1,
2739
2789
  class: "tao-progress__side"
2740
2790
  };
@@ -2793,7 +2843,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
2793
2843
  }, null, 6)
2794
2844
  ], 4)
2795
2845
  ]),
2796
- _ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$g, [
2846
+ _ctx.$slots.right || showEndPercent.value ? (openBlock(), createElementBlock("div", _hoisted_5$f, [
2797
2847
  renderSlot(_ctx.$slots, "right", {}, void 0, true),
2798
2848
  showEndPercent.value ? (openBlock(), createElementBlock("span", _hoisted_6$c, toDisplayString(endPercentLabel.value), 1)) : createCommentVNode("", true)
2799
2849
  ])) : createCommentVNode("", true)
@@ -3042,7 +3092,7 @@ const _hoisted_1$q = { class: "tao-file-drop" };
3042
3092
  const _hoisted_2$n = { class: "tao-file-drop__row" };
3043
3093
  const _hoisted_3$j = ["aria-label"];
3044
3094
  const _hoisted_4$i = { "aria-hidden": "true" };
3045
- const _hoisted_5$f = ["accept", "multiple"];
3095
+ const _hoisted_5$e = ["accept", "multiple"];
3046
3096
  const _hoisted_6$b = {
3047
3097
  key: 0,
3048
3098
  class: "tao-file-drop__list"
@@ -3074,6 +3124,28 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3074
3124
  function sameFile(a, b) {
3075
3125
  return a.name === b.name && a.size === b.size && a.lastModified === b.lastModified;
3076
3126
  }
3127
+ function acceptTokens(accept) {
3128
+ return accept.split(",").map((token) => token.trim().toLowerCase()).filter(Boolean);
3129
+ }
3130
+ function fileMatchesAccept(file, accept) {
3131
+ const tokens = acceptTokens(accept);
3132
+ if (!tokens.length || tokens.includes("*") || tokens.includes("*/*")) {
3133
+ return true;
3134
+ }
3135
+ const name = file.name.toLowerCase();
3136
+ const mime = (file.type || "").toLowerCase();
3137
+ const dot = name.lastIndexOf(".");
3138
+ const ext = dot >= 0 ? name.slice(dot) : "";
3139
+ return tokens.some((token) => {
3140
+ if (token.startsWith(".")) {
3141
+ return ext === token;
3142
+ }
3143
+ if (token.endsWith("/*")) {
3144
+ return mime.startsWith(token.slice(0, -1));
3145
+ }
3146
+ return mime === token;
3147
+ });
3148
+ }
3077
3149
  function commit(files) {
3078
3150
  emit("update:modelValue", files);
3079
3151
  emit("files", files);
@@ -3106,9 +3178,17 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3106
3178
  function removeAt(index) {
3107
3179
  commit(props.modelValue.filter((_, item) => item !== index));
3108
3180
  }
3181
+ function resetInput() {
3182
+ const el = fileInput.value;
3183
+ if (el) {
3184
+ el.type = "text";
3185
+ el.type = "file";
3186
+ }
3187
+ }
3109
3188
  function processFiles(fileList) {
3110
- const incoming = Array.from(fileList);
3189
+ const incoming = Array.from(fileList).filter((file) => fileMatchesAccept(file, props.accept));
3111
3190
  if (!incoming.length) {
3191
+ resetInput();
3112
3192
  return;
3113
3193
  }
3114
3194
  let result;
@@ -3123,11 +3203,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3123
3203
  }
3124
3204
  }
3125
3205
  commit(result);
3126
- const el = fileInput.value;
3127
- if (el) {
3128
- el.type = "text";
3129
- el.type = "file";
3130
- }
3206
+ resetInput();
3131
3207
  }
3132
3208
  function defaultFormatSize(bytes) {
3133
3209
  if (bytes < 1024) {
@@ -3190,7 +3266,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3190
3266
  onChange: handleFileSelect,
3191
3267
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
3192
3268
  }, ["stop"]))
3193
- }, null, 40, _hoisted_5$f)
3269
+ }, null, 40, _hoisted_5$e)
3194
3270
  ], 34)
3195
3271
  ]),
3196
3272
  __props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul", _hoisted_6$b, [
@@ -3220,12 +3296,14 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3220
3296
  };
3221
3297
  }
3222
3298
  });
3223
- const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-570fc1bb"]]);
3224
- const _hoisted_1$p = ["aria-expanded"];
3225
- const _hoisted_2$m = ["aria-label"];
3226
- const _hoisted_3$i = { "aria-hidden": "true" };
3227
- const _hoisted_4$h = ["onClick", "onMouseenter"];
3228
- const _hoisted_5$e = { key: 1 };
3299
+ const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-4b36e2a3"]]);
3300
+ const _hoisted_1$p = ["aria-expanded", "aria-label"];
3301
+ const _hoisted_2$m = {
3302
+ key: 1,
3303
+ "aria-hidden": "true"
3304
+ };
3305
+ const _hoisted_3$i = ["onClick", "onMouseenter"];
3306
+ const _hoisted_4$h = { key: 1 };
3229
3307
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
3230
3308
  ...{ name: "TaoDropdownMenu" },
3231
3309
  __name: "TaoDropdownMenu",
@@ -3360,18 +3438,14 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3360
3438
  class: "tao-dropdown-menu__button",
3361
3439
  "aria-haspopup": "menu",
3362
3440
  "aria-expanded": isOpen.value,
3441
+ "aria-label": _ctx.$slots.button ? void 0 : __props.menuLabel,
3363
3442
  onClick: toggleMenu
3364
3443
  }, [
3365
- _ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", {
3366
- key: 1,
3367
- "aria-label": __props.menuLabel
3368
- }, [
3369
- createElementVNode("span", _hoisted_3$i, [
3370
- renderSlot(_ctx.$slots, "icon", {}, () => [
3371
- _cache[0] || (_cache[0] = createTextVNode("⋮", -1))
3372
- ], true)
3373
- ])
3374
- ], 8, _hoisted_2$m))
3444
+ _ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$m, [
3445
+ renderSlot(_ctx.$slots, "icon", {}, () => [
3446
+ _cache[0] || (_cache[0] = createTextVNode("⋮", -1))
3447
+ ], true)
3448
+ ]))
3375
3449
  ], 8, _hoisted_1$p),
3376
3450
  (openBlock(), createBlock(Teleport, { to: "body" }, [
3377
3451
  isOpen.value ? (openBlock(), createElementBlock("div", {
@@ -3397,8 +3471,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3397
3471
  id: action.id,
3398
3472
  ico: action.ico,
3399
3473
  text: action.name
3400
- }, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_5$e, toDisplayString(action.name), 1))
3401
- ], 42, _hoisted_4$h);
3474
+ }, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_4$h, toDisplayString(action.name), 1))
3475
+ ], 42, _hoisted_3$i);
3402
3476
  }), 128))
3403
3477
  ], 36)) : createCommentVNode("", true)
3404
3478
  ]))
@@ -3406,9 +3480,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3406
3480
  };
3407
3481
  }
3408
3482
  });
3409
- const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-42bc0a2a"]]);
3483
+ const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-4750fe54"]]);
3410
3484
  const _hoisted_1$o = ["aria-invalid", "aria-describedby"];
3411
- const _hoisted_2$l = ["id", "value", "placeholder", "type", "inputmode", "pattern", "onInput", "onKeydown", "onFocus"];
3485
+ const _hoisted_2$l = ["id", "value", "placeholder", "type", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
3412
3486
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
3413
3487
  ...{ name: "TaoPinCode" },
3414
3488
  __name: "TaoPinCode",
@@ -3466,11 +3540,43 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3466
3540
  function isFilled() {
3467
3541
  return numbers.value.length === props.length && numbers.value.every((cell) => cell !== "");
3468
3542
  }
3543
+ function applyChars(index, raw) {
3544
+ var _a;
3545
+ const chars = [...raw].map((ch) => acceptChar(ch)).filter(Boolean);
3546
+ if (!chars.length) {
3547
+ return;
3548
+ }
3549
+ numbers.value = [...numbers.value];
3550
+ let cursor = index;
3551
+ for (const ch of chars) {
3552
+ if (cursor >= props.length) {
3553
+ break;
3554
+ }
3555
+ numbers.value[cursor] = ch;
3556
+ cursor += 1;
3557
+ }
3558
+ emitChange();
3559
+ if (isFilled()) {
3560
+ (_a = inputRefs.value[index]) == null ? void 0 : _a.blur();
3561
+ emit("complete", serialize());
3562
+ return;
3563
+ }
3564
+ if (cursor < props.length) {
3565
+ focusCell(cursor);
3566
+ }
3567
+ }
3469
3568
  function mutation(v, index) {
3470
3569
  var _a;
3471
- const char = v.length > 1 ? v[v.length - 1] ?? "" : v;
3472
- const next = acceptChar(char);
3473
- if (props.numbersOnly && char && !next) {
3570
+ if (v.length > 1) {
3571
+ applyChars(index, v);
3572
+ return;
3573
+ }
3574
+ const next = acceptChar(v);
3575
+ if (props.numbersOnly && v && !next) {
3576
+ const el = inputRefs.value[index];
3577
+ if (el) {
3578
+ el.value = numbers.value[index] ?? "";
3579
+ }
3474
3580
  return;
3475
3581
  }
3476
3582
  numbers.value = [...numbers.value];
@@ -3490,6 +3596,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3490
3596
  focusCell(target);
3491
3597
  }
3492
3598
  }
3599
+ function onPaste(event, index) {
3600
+ var _a;
3601
+ const text = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text")) ?? "";
3602
+ if (!text) {
3603
+ return;
3604
+ }
3605
+ event.preventDefault();
3606
+ applyChars(index, text);
3607
+ }
3493
3608
  function onFocus(index) {
3494
3609
  if (props.clearOn === "input") {
3495
3610
  const firstEmpty = firstEmptyIndex();
@@ -3571,8 +3686,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3571
3686
  inputmode: __props.numbersOnly ? "numeric" : "text",
3572
3687
  pattern: __props.numbersOnly ? "[0-9]" : void 0,
3573
3688
  autocomplete: "one-time-code",
3574
- maxlength: "1",
3689
+ maxlength: index === 0 ? __props.length : 1,
3575
3690
  onInput: ($event) => onChange($event, index),
3691
+ onPaste: ($event) => onPaste($event, index),
3576
3692
  onKeydown: ($event) => onKeydown($event, index),
3577
3693
  onFocus: ($event) => onFocus(index),
3578
3694
  onBlur
@@ -3582,7 +3698,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3582
3698
  };
3583
3699
  }
3584
3700
  });
3585
- const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-c3182673"]]);
3701
+ const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-44474500"]]);
3586
3702
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
3587
3703
  ...{ name: "TaoLink" },
3588
3704
  __name: "TaoLink",
@@ -3639,6 +3755,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
3639
3755
  const id = useId();
3640
3756
  const hintId = `${id}-hint`;
3641
3757
  const errorId = `${id}-error`;
3758
+ const labelId = `${id}-label`;
3642
3759
  const invalid = computed(() => Boolean(props.error));
3643
3760
  const describedBy = computed(() => {
3644
3761
  if (props.error) {
@@ -3654,14 +3771,27 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
3654
3771
  invalid,
3655
3772
  describedBy
3656
3773
  });
3774
+ function onLabelClick() {
3775
+ var _a, _b;
3776
+ const target = document.getElementById(id);
3777
+ if (target instanceof HTMLInputElement || target instanceof HTMLButtonElement || target instanceof HTMLSelectElement || target instanceof HTMLTextAreaElement) {
3778
+ return;
3779
+ }
3780
+ const scope = target ?? ((_a = document.getElementById(labelId)) == null ? void 0 : _a.parentElement);
3781
+ (_b = scope == null ? void 0 : scope.querySelector(
3782
+ "input:not([disabled]), button:not([disabled]), textarea:not([disabled]), select:not([disabled])"
3783
+ )) == null ? void 0 : _b.focus();
3784
+ }
3657
3785
  return (_ctx, _cache) => {
3658
3786
  return openBlock(), createElementBlock("div", {
3659
3787
  class: normalizeClass(["tao-form-field", { "tao-form-field--invalid": invalid.value }])
3660
3788
  }, [
3661
3789
  __props.label ? (openBlock(), createElementBlock("label", {
3662
3790
  key: 0,
3791
+ id: labelId,
3663
3792
  class: "tao-form-field__label",
3664
- for: unref(id)
3793
+ for: unref(id),
3794
+ onClick: onLabelClick
3665
3795
  }, toDisplayString(__props.label), 9, _hoisted_1$n)) : createCommentVNode("", true),
3666
3796
  renderSlot(_ctx.$slots, "default", {}, void 0, true),
3667
3797
  __props.error ? (openBlock(), createElementBlock("p", {
@@ -3677,7 +3807,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
3677
3807
  };
3678
3808
  }
3679
3809
  });
3680
- const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-11324f0c"]]);
3810
+ const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-edd0be31"]]);
3681
3811
  const _hoisted_1$m = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
3682
3812
  const _hoisted_2$k = { class: "tao-select__value" };
3683
3813
  const _hoisted_3$h = ["aria-activedescendant"];
@@ -3721,12 +3851,16 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
3721
3851
  }
3722
3852
  const rect = trigger.getBoundingClientRect();
3723
3853
  const panelHeight = panel.offsetHeight;
3854
+ const panelWidth = panel.offsetWidth || rect.width;
3724
3855
  const gap = 4;
3856
+ const pad = 8;
3725
3857
  const spaceBelow = window.innerHeight - rect.bottom - gap;
3726
3858
  const openUp = spaceBelow < panelHeight && rect.top > spaceBelow;
3859
+ const maxLeft = Math.max(pad, window.innerWidth - panelWidth - pad);
3860
+ const left = Math.min(Math.max(rect.left, pad), maxLeft);
3727
3861
  listStyle.value = {
3728
3862
  top: `${openUp ? rect.top - panelHeight - gap : rect.bottom + gap}px`,
3729
- left: `${rect.left}px`,
3863
+ left: `${left}px`,
3730
3864
  width: `${rect.width}px`
3731
3865
  };
3732
3866
  }
@@ -3740,7 +3874,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
3740
3874
  return;
3741
3875
  }
3742
3876
  const selectedIndex = props.options.findIndex((option) => option.value === props.modelValue);
3743
- activeIndex.value = selectedIndex >= 0 ? selectedIndex : enabledIndexes.value[0] ?? -1;
3877
+ activeIndex.value = selectedIndex >= 0 && enabledIndexes.value.includes(selectedIndex) ? selectedIndex : enabledIndexes.value[0] ?? -1;
3744
3878
  await nextTick();
3745
3879
  updatePosition();
3746
3880
  (_a = listRef.value) == null ? void 0 : _a.focus();
@@ -3960,7 +4094,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
3960
4094
  };
3961
4095
  }
3962
4096
  });
3963
- const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-c5d6cdd3"]]);
4097
+ const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-d9b336d8"]]);
3964
4098
  const _hoisted_1$l = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
3965
4099
  const _hoisted_2$j = {
3966
4100
  key: 0,
@@ -4048,12 +4182,16 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
4048
4182
  }
4049
4183
  const rect = trigger.getBoundingClientRect();
4050
4184
  const panelHeight = panel.offsetHeight;
4185
+ const panelWidth = panel.offsetWidth || rect.width;
4051
4186
  const gap = 4;
4187
+ const pad = 8;
4052
4188
  const spaceBelow = window.innerHeight - rect.bottom - gap;
4053
4189
  const openUp = spaceBelow < panelHeight && rect.top > spaceBelow;
4190
+ const maxLeft = Math.max(pad, window.innerWidth - panelWidth - pad);
4191
+ const left = Math.min(Math.max(rect.left, pad), maxLeft);
4054
4192
  listStyle.value = {
4055
4193
  top: `${openUp ? rect.top - panelHeight - gap : rect.bottom + gap}px`,
4056
- left: `${rect.left}px`,
4194
+ left: `${left}px`,
4057
4195
  width: `${rect.width}px`
4058
4196
  };
4059
4197
  }
@@ -4120,6 +4258,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
4120
4258
  }
4121
4259
  commitCreated(value);
4122
4260
  }
4261
+ function clear() {
4262
+ var _a;
4263
+ emitValue(null);
4264
+ query.value = "";
4265
+ open.value = false;
4266
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
4267
+ }
4123
4268
  function revertQuery() {
4124
4269
  syncQueryFromModel();
4125
4270
  }
@@ -4437,7 +4582,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
4437
4582
  key: 0,
4438
4583
  type: "button",
4439
4584
  class: "tao-combobox__clear",
4440
- onMousedown: withModifiers(markPicking, ["prevent"])
4585
+ onMousedown: withModifiers(markPicking, ["prevent"]),
4586
+ onClick: clear
4441
4587
  }, [
4442
4588
  renderSlot(_ctx.$slots, "clear", {}, () => [
4443
4589
  createTextVNode(toDisplayString(__props.clearText), 1)
@@ -4449,7 +4595,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
4449
4595
  };
4450
4596
  }
4451
4597
  });
4452
- const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-2281e009"]]);
4598
+ const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-131d254d"]]);
4453
4599
  const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
4454
4600
  function formatTaoDateIso(parts) {
4455
4601
  return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
@@ -4488,8 +4634,23 @@ function shiftTaoMonth(iso, months) {
4488
4634
  if (!parts) {
4489
4635
  return iso;
4490
4636
  }
4491
- const date = new Date(parts.y, parts.m - 1 + months, parts.d);
4492
- return formatTaoDateIso({ y: date.getFullYear(), m: date.getMonth() + 1, d: date.getDate() });
4637
+ const monthStart = new Date(parts.y, parts.m - 1 + months, 1);
4638
+ const y = monthStart.getFullYear();
4639
+ const m = monthStart.getMonth() + 1;
4640
+ const lastDay = new Date(y, m, 0).getDate();
4641
+ return formatTaoDateIso({ y, m, d: Math.min(parts.d, lastDay) });
4642
+ }
4643
+ function clampTaoDateCursor(iso, min, max) {
4644
+ if (isTaoDateInRange(iso, min, max)) {
4645
+ return iso;
4646
+ }
4647
+ if (min && parseTaoDate(min) && iso < min) {
4648
+ return min;
4649
+ }
4650
+ if (max && parseTaoDate(max) && iso > max) {
4651
+ return max;
4652
+ }
4653
+ return iso;
4493
4654
  }
4494
4655
  function isTaoDateInRange(iso, min, max) {
4495
4656
  if (!parseTaoDate(iso)) {
@@ -4680,7 +4841,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
4680
4841
  if (!next) {
4681
4842
  return;
4682
4843
  }
4683
- syncViewFrom(valueIso.value ?? todayIso.value);
4844
+ syncViewFrom(clampTaoDateCursor(valueIso.value ?? todayIso.value, props.min, props.max));
4684
4845
  await nextTick();
4685
4846
  updatePosition();
4686
4847
  (_a = panelRef.value) == null ? void 0 : _a.focus();
@@ -4709,18 +4870,13 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
4709
4870
  (_a = triggerRef.value) == null ? void 0 : _a.focus();
4710
4871
  }
4711
4872
  function goMonth(delta) {
4712
- const next = shiftTaoMonth(`${viewYear.value}-${String(viewMonth.value).padStart(2, "0")}-01`, delta);
4713
- const parts = parseTaoDate(next);
4714
- if (!parts) {
4715
- return;
4716
- }
4717
- viewYear.value = parts.y;
4718
- viewMonth.value = parts.m;
4719
- cursorIso.value = shiftTaoMonth(cursorIso.value, delta);
4873
+ cursorIso.value = clampTaoDateCursor(shiftTaoMonth(cursorIso.value, delta), props.min, props.max);
4874
+ syncViewFrom(cursorIso.value);
4720
4875
  void nextTick(updatePosition);
4721
4876
  }
4722
4877
  function moveCursor(days) {
4723
- cursorIso.value = shiftTaoDate(cursorIso.value, days);
4878
+ const next = shiftTaoDate(cursorIso.value, days);
4879
+ cursorIso.value = isTaoDateInRange(next, props.min, props.max) ? next : clampTaoDateCursor(next, props.min, props.max);
4724
4880
  syncViewFrom(cursorIso.value);
4725
4881
  void nextTick(updatePosition);
4726
4882
  }
@@ -4988,7 +5144,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
4988
5144
  };
4989
5145
  }
4990
5146
  });
4991
- const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-771836c8"]]);
5147
+ const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-ebd437a8"]]);
4992
5148
  const _hoisted_1$j = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
4993
5149
  const _hoisted_2$h = { class: "tao-date-range__value" };
4994
5150
  const _hoisted_3$e = {
@@ -5103,7 +5259,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5103
5259
  }
5104
5260
  draftStart.value = null;
5105
5261
  hoverIso.value = null;
5106
- syncViewFrom(((_a = committed.value) == null ? void 0 : _a.start) ?? todayIso.value);
5262
+ syncViewFrom(clampTaoDateCursor(((_a = committed.value) == null ? void 0 : _a.start) ?? todayIso.value, props.min, props.max));
5107
5263
  await nextTick();
5108
5264
  updatePosition();
5109
5265
  (_b = panelRef.value) == null ? void 0 : _b.focus();
@@ -5152,19 +5308,14 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5152
5308
  }
5153
5309
  function goMonth(delta) {
5154
5310
  hoverIso.value = null;
5155
- const next = shiftTaoMonth(`${viewYear.value}-${String(viewMonth.value).padStart(2, "0")}-01`, delta);
5156
- const parts = parseTaoDate(next);
5157
- if (!parts) {
5158
- return;
5159
- }
5160
- viewYear.value = parts.y;
5161
- viewMonth.value = parts.m;
5162
- cursorIso.value = shiftTaoMonth(cursorIso.value, delta);
5311
+ cursorIso.value = clampTaoDateCursor(shiftTaoMonth(cursorIso.value, delta), props.min, props.max);
5312
+ syncViewFrom(cursorIso.value);
5163
5313
  void nextTick(updatePosition);
5164
5314
  }
5165
5315
  function moveCursor(days) {
5166
5316
  hoverIso.value = null;
5167
- cursorIso.value = shiftTaoDate(cursorIso.value, days);
5317
+ const next = shiftTaoDate(cursorIso.value, days);
5318
+ cursorIso.value = isTaoDateInRange(next, props.min, props.max) ? next : clampTaoDateCursor(next, props.min, props.max);
5168
5319
  syncViewFrom(cursorIso.value);
5169
5320
  void nextTick(updatePosition);
5170
5321
  }
@@ -5459,9 +5610,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5459
5610
  };
5460
5611
  }
5461
5612
  });
5462
- const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-4394053c"]]);
5613
+ const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-aa589793"]]);
5463
5614
  const _hoisted_1$i = ["for"];
5464
- const _hoisted_2$g = ["id", "checked", "disabled", "aria-checked"];
5615
+ const _hoisted_2$g = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
5465
5616
  const _hoisted_3$d = {
5466
5617
  key: 0,
5467
5618
  class: "tao-switch__label"
@@ -5485,6 +5636,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
5485
5636
  const field = inject(formFieldKey, null);
5486
5637
  const localId = useId();
5487
5638
  const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
5639
+ const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
5640
+ const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
5488
5641
  function toggle() {
5489
5642
  if (props.disabled) {
5490
5643
  return;
@@ -5495,7 +5648,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
5495
5648
  }
5496
5649
  return (_ctx, _cache) => {
5497
5650
  return openBlock(), createElementBlock("label", {
5498
- class: normalizeClass(["tao-switch", { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue }]),
5651
+ class: normalizeClass(["tao-switch", { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]),
5499
5652
  for: controlId.value
5500
5653
  }, [
5501
5654
  createElementVNode("input", {
@@ -5506,6 +5659,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
5506
5659
  checked: __props.modelValue,
5507
5660
  disabled: __props.disabled,
5508
5661
  "aria-checked": __props.modelValue,
5662
+ "aria-invalid": invalid.value || void 0,
5663
+ "aria-describedby": describedBy.value,
5509
5664
  onChange: toggle
5510
5665
  }, null, 40, _hoisted_2$g),
5511
5666
  _cache[0] || (_cache[0] = createElementVNode("span", {
@@ -5521,10 +5676,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
5521
5676
  };
5522
5677
  }
5523
5678
  });
5524
- const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-db2bca61"]]);
5679
+ const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-17ce5000"]]);
5525
5680
  const radioGroupKey = Symbol("taoRadioGroup");
5526
5681
  const _hoisted_1$h = ["for"];
5527
- const _hoisted_2$f = ["id", "name", "value", "checked", "disabled"];
5682
+ const _hoisted_2$f = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
5528
5683
  const _hoisted_3$c = {
5529
5684
  key: 0,
5530
5685
  class: "tao-radio__label"
@@ -5548,7 +5703,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5548
5703
  const props = __props;
5549
5704
  const emit = __emit;
5550
5705
  const group = inject(radioGroupKey, null);
5706
+ const field = inject(formFieldKey, null);
5551
5707
  const localId = useId();
5708
+ const controlId = computed(() => group ? localId : (field == null ? void 0 : field.id) ?? localId);
5709
+ const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
5710
+ const describedBy = computed(() => group ? void 0 : field == null ? void 0 : field.describedBy.value);
5552
5711
  const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
5553
5712
  const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
5554
5713
  const isChecked = computed(() => {
@@ -5568,17 +5727,19 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5568
5727
  }
5569
5728
  return (_ctx, _cache) => {
5570
5729
  return openBlock(), createElementBlock("label", {
5571
- class: normalizeClass(["tao-radio", { "tao-radio--disabled": isDisabled.value }]),
5572
- for: unref(localId)
5730
+ class: normalizeClass(["tao-radio", { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !unref(group) }]),
5731
+ for: controlId.value
5573
5732
  }, [
5574
5733
  createElementVNode("input", {
5575
- id: unref(localId),
5734
+ id: controlId.value,
5576
5735
  class: "tao-radio__input",
5577
5736
  type: "radio",
5578
5737
  name: inputName.value,
5579
5738
  value: String(__props.value),
5580
5739
  checked: isChecked.value,
5581
5740
  disabled: isDisabled.value,
5741
+ "aria-invalid": !unref(group) && invalid.value || void 0,
5742
+ "aria-describedby": describedBy.value,
5582
5743
  onChange
5583
5744
  }, null, 40, _hoisted_2$f),
5584
5745
  _cache[0] || (_cache[0] = createElementVNode("span", {
@@ -5592,8 +5753,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5592
5753
  };
5593
5754
  }
5594
5755
  });
5595
- const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-c9c84481"]]);
5596
- const _hoisted_1$g = ["disabled"];
5756
+ const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-e79d1fb6"]]);
5757
+ const _hoisted_1$g = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
5597
5758
  const _hoisted_2$e = {
5598
5759
  key: 0,
5599
5760
  class: "tao-radio-group__legend"
@@ -5612,10 +5773,14 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
5612
5773
  setup(__props, { emit: __emit }) {
5613
5774
  const props = __props;
5614
5775
  const emit = __emit;
5776
+ const field = inject(formFieldKey, null);
5615
5777
  const autoName = useId();
5616
5778
  const groupName = computed(() => props.name || autoName);
5617
5779
  const model = computed(() => props.modelValue);
5618
5780
  const groupDisabled = computed(() => props.disabled);
5781
+ const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
5782
+ const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
5783
+ const labelledBy = computed(() => props.legend || !field ? void 0 : `${field.id}-label`);
5619
5784
  function setValue(value) {
5620
5785
  emit("update:modelValue", value);
5621
5786
  emit("change", value);
@@ -5627,9 +5792,14 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
5627
5792
  setValue
5628
5793
  });
5629
5794
  return (_ctx, _cache) => {
5795
+ var _a;
5630
5796
  return openBlock(), createElementBlock("fieldset", {
5631
- class: normalizeClass(["tao-radio-group", `tao-radio-group--${__props.direction}`]),
5632
- disabled: __props.disabled
5797
+ id: (_a = unref(field)) == null ? void 0 : _a.id,
5798
+ class: normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, { "tao-radio-group--invalid": invalid.value }]]),
5799
+ disabled: __props.disabled,
5800
+ "aria-describedby": describedBy.value,
5801
+ "aria-invalid": invalid.value || void 0,
5802
+ "aria-labelledby": labelledBy.value
5633
5803
  }, [
5634
5804
  __props.legend ? (openBlock(), createElementBlock("legend", _hoisted_2$e, toDisplayString(__props.legend), 1)) : createCommentVNode("", true),
5635
5805
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
@@ -5637,9 +5807,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
5637
5807
  };
5638
5808
  }
5639
5809
  });
5640
- const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-a0b1cb1f"]]);
5810
+ const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-6f6fa977"]]);
5641
5811
  const segmentedKey = Symbol("taoSegmented");
5642
- const _hoisted_1$f = ["disabled", "aria-describedby", "aria-invalid"];
5812
+ const _hoisted_1$f = ["disabled", "aria-describedby", "aria-invalid", "aria-labelledby", "id"];
5643
5813
  const _hoisted_2$d = {
5644
5814
  key: 0,
5645
5815
  class: "tao-segmented__legend"
@@ -5739,6 +5909,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
5739
5909
  mutationObserver = null;
5740
5910
  });
5741
5911
  return (_ctx, _cache) => {
5912
+ var _a;
5742
5913
  return openBlock(), createElementBlock("fieldset", {
5743
5914
  class: normalizeClass(["tao-segmented", [
5744
5915
  `tao-segmented--${__props.size}`,
@@ -5750,7 +5921,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
5750
5921
  ]]),
5751
5922
  disabled: __props.disabled,
5752
5923
  "aria-describedby": describedBy.value,
5753
- "aria-invalid": invalid.value || void 0
5924
+ "aria-invalid": invalid.value || void 0,
5925
+ "aria-labelledby": __props.legend ? void 0 : unref(field) ? `${unref(field).id}-label` : void 0,
5926
+ id: (_a = unref(field)) == null ? void 0 : _a.id
5754
5927
  }, [
5755
5928
  __props.legend ? (openBlock(), createElementBlock("legend", _hoisted_2$d, toDisplayString(__props.legend), 1)) : createCommentVNode("", true),
5756
5929
  createElementVNode("div", {
@@ -5769,7 +5942,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
5769
5942
  };
5770
5943
  }
5771
5944
  });
5772
- const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cb3c591b"]]);
5945
+ const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-af757a32"]]);
5773
5946
  const _hoisted_1$e = ["for"];
5774
5947
  const _hoisted_2$c = ["id", "name", "value", "checked", "disabled", "aria-label"];
5775
5948
  const _hoisted_3$b = { class: "tao-segmented-option__face" };
@@ -6183,11 +6356,15 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
6183
6356
  const items = computed(() => buildPaginationItems(current.value, pageCount.value, props.siblingCount));
6184
6357
  const from = computed(() => props.total === 0 ? 0 : (current.value - 1) * props.pageSize + 1);
6185
6358
  const to = computed(() => Math.min(current.value * props.pageSize, props.total));
6186
- watch(pageCount, (count) => {
6187
- if (props.page > count) {
6188
- goTo(count);
6189
- }
6190
- });
6359
+ watch(
6360
+ () => [props.page, pageCount.value],
6361
+ ([page, count]) => {
6362
+ if (page > count || page < 1) {
6363
+ goTo(page);
6364
+ }
6365
+ },
6366
+ { immediate: true }
6367
+ );
6191
6368
  function goTo(next) {
6192
6369
  if (props.disabled) {
6193
6370
  return;
@@ -6271,7 +6448,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
6271
6448
  };
6272
6449
  }
6273
6450
  });
6274
- const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-a890810c"]]);
6451
+ const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-37f3d381"]]);
6275
6452
  const _hoisted_1$a = { class: "tao-empty" };
6276
6453
  const _hoisted_2$8 = {
6277
6454
  key: 0,
@@ -6373,9 +6550,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6373
6550
  const emit = __emit;
6374
6551
  const panelRef = ref(null);
6375
6552
  const titleId = useId();
6376
- let previousOverflow = "";
6377
6553
  let previousFocus = null;
6378
- let scrollLocked = false;
6554
+ let scrollHeld = false;
6379
6555
  function close() {
6380
6556
  if (!props.closable) {
6381
6557
  return;
@@ -6383,21 +6559,19 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6383
6559
  emit("update:modelValue", false);
6384
6560
  emit("close");
6385
6561
  }
6386
- function lockBodyScroll() {
6387
- if (scrollLocked) {
6562
+ function holdScroll() {
6563
+ if (scrollHeld || !isBrowser()) {
6388
6564
  return;
6389
6565
  }
6390
- previousOverflow = document.body.style.overflow;
6391
- document.body.style.overflow = "hidden";
6392
- scrollLocked = true;
6566
+ lockBodyScroll();
6567
+ scrollHeld = true;
6393
6568
  }
6394
- function unlockBodyScroll() {
6395
- if (!scrollLocked) {
6569
+ function releaseScroll() {
6570
+ if (!scrollHeld) {
6396
6571
  return;
6397
6572
  }
6398
- document.body.style.overflow = previousOverflow;
6399
- previousOverflow = "";
6400
- scrollLocked = false;
6573
+ unlockBodyScroll();
6574
+ scrollHeld = false;
6401
6575
  }
6402
6576
  function restoreFocus() {
6403
6577
  var _a;
@@ -6415,6 +6589,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6415
6589
  }
6416
6590
  function onKeydown(event) {
6417
6591
  if (event.key === "Escape") {
6592
+ if (!props.closable) {
6593
+ return;
6594
+ }
6418
6595
  event.preventDefault();
6419
6596
  close();
6420
6597
  return;
@@ -6426,19 +6603,23 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6426
6603
  watch(
6427
6604
  () => props.modelValue,
6428
6605
  (isOpen) => {
6606
+ if (!isBrowser()) {
6607
+ return;
6608
+ }
6429
6609
  if (isOpen) {
6430
6610
  previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
6431
- lockBodyScroll();
6611
+ holdScroll();
6432
6612
  void focusPanel();
6433
6613
  return;
6434
6614
  }
6435
- unlockBodyScroll();
6615
+ releaseScroll();
6436
6616
  restoreFocus();
6437
6617
  },
6438
6618
  { immediate: true }
6439
6619
  );
6440
6620
  onBeforeUnmount(() => {
6441
- unlockBodyScroll();
6621
+ releaseScroll();
6622
+ restoreFocus();
6442
6623
  });
6443
6624
  return (_ctx, _cache) => {
6444
6625
  return openBlock(), createBlock(Teleport, { to: "body" }, [
@@ -6499,7 +6680,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6499
6680
  };
6500
6681
  }
6501
6682
  });
6502
- const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-14730fe9"]]);
6683
+ const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-10fb02f2"]]);
6503
6684
  const _hoisted_1$7 = ["title"];
6504
6685
  const _hoisted_2$6 = { class: "tao-avatar__face" };
6505
6686
  const _hoisted_3$5 = ["src", "alt"];
@@ -6584,18 +6765,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
6584
6765
  }
6585
6766
  return extra.length ? `${base}, ${extra.join(", ")}` : base;
6586
6767
  });
6768
+ const imgFailed = ref(false);
6769
+ const showImage = computed(() => Boolean(props.src) && !imgFailed.value);
6770
+ watch(
6771
+ () => props.src,
6772
+ () => {
6773
+ imgFailed.value = false;
6774
+ }
6775
+ );
6776
+ function onImgError() {
6777
+ imgFailed.value = true;
6778
+ }
6587
6779
  return (_ctx, _cache) => {
6588
6780
  return openBlock(), createElementBlock("span", {
6589
6781
  class: normalizeClass(["tao-avatar", `tao-avatar--${sizeClass.value}`]),
6590
6782
  title: label.value
6591
6783
  }, [
6592
6784
  createElementVNode("span", _hoisted_2$6, [
6593
- __props.src ? (openBlock(), createElementBlock("img", {
6785
+ showImage.value ? (openBlock(), createElementBlock("img", {
6594
6786
  key: 0,
6595
6787
  class: "tao-avatar__img",
6596
6788
  src: __props.src,
6597
- alt: label.value
6598
- }, null, 8, _hoisted_3$5)) : (openBlock(), createElementBlock("span", {
6789
+ alt: label.value,
6790
+ onError: onImgError
6791
+ }, null, 40, _hoisted_3$5)) : (openBlock(), createElementBlock("span", {
6599
6792
  key: 1,
6600
6793
  class: "tao-avatar__fallback",
6601
6794
  "aria-label": label.value
@@ -6611,7 +6804,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
6611
6804
  };
6612
6805
  }
6613
6806
  });
6614
- const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-03b60017"]]);
6807
+ const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-65ed2d7a"]]);
6615
6808
  const _hoisted_1$6 = ["aria-label"];
6616
6809
  const _hoisted_2$5 = { class: "tao-breadcrumb__list" };
6617
6810
  const _hoisted_3$4 = {
@@ -6820,7 +7013,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
6820
7013
  return 0;
6821
7014
  }
6822
7015
  const left = ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
6823
- return Math.min(Math.max(Math.round(left / (width + gap)), 0), total - 1);
7016
+ const last = Math.max(total - step.value, 0);
7017
+ return Math.min(Math.max(Math.round(left / (width + gap)), 0), last);
6824
7018
  }
6825
7019
  function setIndex(next) {
6826
7020
  if (next === index.value) {
@@ -6871,13 +7065,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
6871
7065
  autoplayTimer = 0;
6872
7066
  }
6873
7067
  function canAutoplay() {
6874
- return props.autoplay > 0 && count.value > step.value && !hoverPaused.value && !focusPaused.value && !dragging.value && typeof document !== "undefined" && !document.hidden && !prefersReducedMotion();
7068
+ return props.autoplay > 0 && count.value > step.value && !hoverPaused.value && !focusPaused.value && !dragging.value && typeof document !== "undefined" && !document.hidden && !prefersReducedMotion() && (props.loop || index.value < lastIndex.value);
6875
7069
  }
6876
7070
  function tickAutoplay() {
6877
7071
  if (!canAutoplay()) {
6878
- return;
6879
- }
6880
- if (!props.loop && index.value >= lastIndex.value) {
6881
7072
  stopAutoplay();
6882
7073
  return;
6883
7074
  }
@@ -6917,7 +7108,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
6917
7108
  }
6918
7109
  cancelAnimationFrame(scrollFrame);
6919
7110
  scrollFrame = requestAnimationFrame(() => {
6920
- setIndex(nearestIndex());
7111
+ const next = nearestIndex();
7112
+ const { width, gap } = metrics();
7113
+ const el = track.value;
7114
+ if (el && width > 0 && el.scrollLeft - next * (width + gap) > (width + gap) / 2) {
7115
+ goTo(next, true);
7116
+ return;
7117
+ }
7118
+ setIndex(next);
6921
7119
  });
6922
7120
  }
6923
7121
  function releaseDragCapture() {
@@ -7022,7 +7220,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
7022
7220
  }
7023
7221
  );
7024
7222
  watch(
7025
- () => [props.autoplay, props.loop, count.value, dragging.value],
7223
+ () => [props.autoplay, props.loop, count.value, dragging.value, index.value],
7026
7224
  () => syncAutoplay()
7027
7225
  );
7028
7226
  onMounted(() => {
@@ -7174,7 +7372,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
7174
7372
  };
7175
7373
  }
7176
7374
  });
7177
- const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-239073ed"]]);
7375
+ const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-bc396e5d"]]);
7178
7376
  const _hoisted_1$3 = ["aria-label"];
7179
7377
  const _hoisted_2$2 = ["aria-label"];
7180
7378
  const _hoisted_3$2 = {
@@ -7751,14 +7949,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7751
7949
  __name: "TaoConfirmHost",
7752
7950
  setup(__props) {
7753
7951
  const panelRef = ref(null);
7754
- let previousOverflow = "";
7755
7952
  let previousFocus = null;
7756
- let scrollLocked = false;
7953
+ let scrollHeld = false;
7757
7954
  onMounted(() => {
7758
7955
  registerConfirmHost();
7759
7956
  });
7760
7957
  onBeforeUnmount(() => {
7761
- unlockBodyScroll();
7958
+ releaseScroll();
7762
7959
  unregisterConfirmHost();
7763
7960
  });
7764
7961
  watch(
@@ -7769,12 +7966,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7769
7966
  async (id) => {
7770
7967
  var _a, _b;
7771
7968
  if (!id) {
7772
- unlockBodyScroll();
7969
+ releaseScroll();
7773
7970
  restoreFocus();
7774
7971
  return;
7775
7972
  }
7973
+ if (!isBrowser()) {
7974
+ return;
7975
+ }
7776
7976
  previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
7777
- lockBodyScroll();
7977
+ holdScroll();
7778
7978
  await nextTick();
7779
7979
  (_b = queryButton(((_a = currentConfirm.value) == null ? void 0 : _a.danger) ? "cancel" : "ok")) == null ? void 0 : _b.focus();
7780
7980
  }
@@ -7783,21 +7983,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7783
7983
  var _a;
7784
7984
  return ((_a = panelRef.value) == null ? void 0 : _a.querySelector(`[data-tao-confirm-${which}]`)) ?? null;
7785
7985
  }
7786
- function lockBodyScroll() {
7787
- if (scrollLocked) {
7986
+ function holdScroll() {
7987
+ if (scrollHeld || !isBrowser()) {
7788
7988
  return;
7789
7989
  }
7790
- previousOverflow = document.body.style.overflow;
7791
- document.body.style.overflow = "hidden";
7792
- scrollLocked = true;
7990
+ lockBodyScroll();
7991
+ scrollHeld = true;
7793
7992
  }
7794
- function unlockBodyScroll() {
7795
- if (!scrollLocked) {
7993
+ function releaseScroll() {
7994
+ if (!scrollHeld) {
7796
7995
  return;
7797
7996
  }
7798
- document.body.style.overflow = previousOverflow;
7799
- previousOverflow = "";
7800
- scrollLocked = false;
7997
+ unlockBodyScroll();
7998
+ scrollHeld = false;
7801
7999
  }
7802
8000
  function restoreFocus() {
7803
8001
  var _a;
@@ -7811,26 +8009,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7811
8009
  answer(false);
7812
8010
  }
7813
8011
  function onKeydown(event) {
7814
- var _a, _b;
7815
8012
  if (event.key === "Escape") {
7816
8013
  event.preventDefault();
7817
8014
  answer(false);
7818
8015
  return;
7819
8016
  }
7820
- if (event.key !== "Tab") {
7821
- return;
7822
- }
7823
- const first = queryButton(((_a = currentConfirm.value) == null ? void 0 : _a.danger) ? "cancel" : "ok");
7824
- const last = queryButton(((_b = currentConfirm.value) == null ? void 0 : _b.danger) ? "ok" : "cancel");
7825
- if (!first || !last) {
7826
- return;
7827
- }
7828
- if (event.shiftKey && document.activeElement === first) {
7829
- event.preventDefault();
7830
- last.focus();
7831
- } else if (!event.shiftKey && document.activeElement === last) {
7832
- event.preventDefault();
7833
- first.focus();
8017
+ if (panelRef.value) {
8018
+ trapTab(event, panelRef.value);
7834
8019
  }
7835
8020
  }
7836
8021
  return (_ctx, _cache) => {
@@ -7933,7 +8118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7933
8118
  };
7934
8119
  }
7935
8120
  });
7936
- const TaoConfirmHost = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-503301db"]]);
8121
+ const TaoConfirmHost = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d54ae27e"]]);
7937
8122
  const TYPE_TIMEOUT = {
7938
8123
  success: 3e3,
7939
8124
  error: 5e3,