@1337exp/taoui 5.6.2 → 5.8.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.js CHANGED
@@ -236,7 +236,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
236
236
  };
237
237
  }
238
238
  });
239
- const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-2fd6b7f2"]]);
239
+ const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-475b0135"]]);
240
240
  function toCssLength(value) {
241
241
  if (value === void 0 || value === null || value === "") {
242
242
  return void 0;
@@ -499,6 +499,7 @@ const localeEn = {
499
499
  jumpNextLabel: "Forward {n} pages",
500
500
  goToText: "Go to",
501
501
  goToLabel: "Go to page, 1 to {count}",
502
+ perPageText: "Per page",
502
503
  totalText: "{from}–{to} of {total}",
503
504
  emptyTotalText: "0 of 0"
504
505
  },
@@ -608,7 +609,12 @@ function addToast(record) {
608
609
  }
609
610
  }
610
611
  if (record.displayMode === "replace" && record.dedupeId) {
611
- toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
612
+ const index = toasts.value.findIndex((item) => item.dedupeId === record.dedupeId);
613
+ if (index !== -1) {
614
+ const kept = { ...record, id: toasts.value[index].id };
615
+ toasts.value = toasts.value.filter((item, i) => i === index || item.dedupeId !== record.dedupeId).map((item) => item.id === kept.id ? kept : item);
616
+ return;
617
+ }
612
618
  }
613
619
  toasts.value = [...toasts.value, record];
614
620
  }
@@ -721,6 +727,7 @@ const localeRu = {
721
727
  jumpNextLabel: "Вперёд на {n} страниц",
722
728
  goToText: "Перейти",
723
729
  goToLabel: "Перейти на страницу, от 1 до {count}",
730
+ perPageText: "На странице",
724
731
  totalText: "{from}–{to} из {total}",
725
732
  emptyTotalText: "0 из 0"
726
733
  },
@@ -999,7 +1006,7 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
999
1006
  };
1000
1007
  }
1001
1008
  });
1002
- const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-46475c32"]]);
1009
+ const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-5e78531a"]]);
1003
1010
  const _hoisted_1$10 = ["aria-label", "disabled"];
1004
1011
  const _hoisted_2$S = { "aria-hidden": "true" };
1005
1012
  const _hoisted_3$K = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
@@ -1332,7 +1339,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
1332
1339
  };
1333
1340
  }
1334
1341
  });
1335
- const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-10c58c01"]]);
1342
+ const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-72c9a80f"]]);
1336
1343
  const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1337
1344
  function getFocusable(root) {
1338
1345
  return [...root.querySelectorAll(FOCUSABLE)].filter(
@@ -2665,7 +2672,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
2665
2672
  };
2666
2673
  }
2667
2674
  });
2668
- const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-f759a4e5"]]);
2675
+ const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-042715ba"]]);
2669
2676
  const _hoisted_1$U = { class: "tao-spoiler-group" };
2670
2677
  const _sfc_main$11 = /* @__PURE__ */ defineComponent({
2671
2678
  ...{ name: "TaoSpoilerGroup" },
@@ -2787,7 +2794,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
2787
2794
  };
2788
2795
  }
2789
2796
  });
2790
- const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-456b4811"]]);
2797
+ const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-1fb47e53"]]);
2791
2798
  const _sfc_main$$ = /* @__PURE__ */ defineComponent({
2792
2799
  ...{ name: "TaoContainer" },
2793
2800
  __name: "TaoContainer",
@@ -3566,7 +3573,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
3566
3573
  };
3567
3574
  }
3568
3575
  });
3569
- const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-9e6e243f"]]);
3576
+ const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-03794ffd"]]);
3570
3577
  const _hoisted_1$N = ["role", "aria-hidden"];
3571
3578
  const _hoisted_2$H = {
3572
3579
  key: 1,
@@ -4747,7 +4754,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
4747
4754
  };
4748
4755
  }
4749
4756
  });
4750
- const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-d4e0951a"]]);
4757
+ const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-e1b857ad"]]);
4751
4758
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
4752
4759
  ...{ name: "TaoContextMenu" },
4753
4760
  __name: "TaoContextMenu",
@@ -4981,7 +4988,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
4981
4988
  };
4982
4989
  }
4983
4990
  });
4984
- const TaoMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-9d46a2dc"]]);
4991
+ const TaoMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-ce01bc7e"]]);
4985
4992
  const toolbarKey = Symbol("tao-toolbar");
4986
4993
  const ITEMS = 'button, a[href], input, select, textarea, [role="button"], [data-tao-toolbar-item]';
4987
4994
  const TEXT_INPUT = /^(text|search|email|url|tel|password|number|date|time|datetime-local|month|week)$/;
@@ -5587,7 +5594,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5587
5594
  maxBarItems: { default: 5 },
5588
5595
  ariaLabel: { default: void 0 },
5589
5596
  moreLabel: { default: void 0 },
5590
- floating: { type: Boolean, default: false }
5597
+ floating: { type: Boolean, default: false },
5598
+ indicator: { default: "pill" }
5591
5599
  },
5592
5600
  emits: ["update:modelValue", "select"],
5593
5601
  setup(__props, { emit: __emit }) {
@@ -5634,7 +5642,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5634
5642
  }
5635
5643
  return (_ctx, _cache) => {
5636
5644
  return openBlock(), createElementBlock("div", {
5637
- class: normalizeClass(["tao-nav", [`tao-nav--${__props.layout}`, { "tao-nav--standalone": standalone.value, "tao-nav--floating": __props.floating }]])
5645
+ class: normalizeClass(["tao-nav", [`tao-nav--${__props.layout}`, `tao-nav--indicator-${__props.indicator}`, { "tao-nav--standalone": standalone.value, "tao-nav--floating": __props.floating }]])
5638
5646
  }, [
5639
5647
  createElementVNode("div", _hoisted_1$y, [
5640
5648
  createElementVNode("nav", {
@@ -5725,7 +5733,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5725
5733
  };
5726
5734
  }
5727
5735
  });
5728
- const TaoNav = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-beedd254"]]);
5736
+ const TaoNav = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-172be4ea"]]);
5729
5737
  function visibleRows(nodes, expanded, children) {
5730
5738
  const rows = [];
5731
5739
  const walk = (list, level, parentId) => {
@@ -6090,7 +6098,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
6090
6098
  };
6091
6099
  }
6092
6100
  });
6093
- const TaoTree = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-cdbcd8e8"]]);
6101
+ const TaoTree = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-ce3110d4"]]);
6094
6102
  const _hoisted_1$w = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
6095
6103
  const _hoisted_2$t = {
6096
6104
  key: 0,
@@ -7070,7 +7078,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
7070
7078
  };
7071
7079
  }
7072
7080
  });
7073
- const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-66b1ad03"]]);
7081
+ const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-3daa5544"]]);
7074
7082
  const clamp = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
7075
7083
  const byte = (v) => Math.round(clamp(v, 0, 255));
7076
7084
  const hex2 = (v) => byte(v).toString(16).padStart(2, "0");
@@ -8270,7 +8278,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
8270
8278
  };
8271
8279
  }
8272
8280
  });
8273
- const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-89db7a66"]]);
8281
+ const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-e1a2d281"]]);
8274
8282
  const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
8275
8283
  function formatTaoDateIso(parts) {
8276
8284
  return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
@@ -9029,7 +9037,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9029
9037
  };
9030
9038
  }
9031
9039
  });
9032
- const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-584a0343"]]);
9040
+ const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-b2630763"]]);
9033
9041
  const _hoisted_1$j = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
9034
9042
  const _hoisted_2$h = { class: "tao-date-range__value" };
9035
9043
  const _hoisted_3$e = {
@@ -9204,7 +9212,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9204
9212
  };
9205
9213
  }
9206
9214
  });
9207
- const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-4f6bc7bf"]]);
9215
+ const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-f287d32b"]]);
9208
9216
  const _hoisted_1$i = ["for"];
9209
9217
  const _hoisted_2$g = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby", "aria-busy"];
9210
9218
  const _hoisted_3$d = {
@@ -9729,7 +9737,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
9729
9737
  };
9730
9738
  }
9731
9739
  });
9732
- const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-f0e4fd72"]]);
9740
+ const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-f876770f"]]);
9733
9741
  function buildPaginationItems(page, pageCount, siblingCount = 1) {
9734
9742
  if (pageCount <= 0) {
9735
9743
  return [];
@@ -9756,30 +9764,39 @@ function buildPaginationItems(page, pageCount, siblingCount = 1) {
9756
9764
  }
9757
9765
  const _hoisted_1$d = ["aria-label"];
9758
9766
  const _hoisted_2$b = {
9767
+ key: 0,
9768
+ class: "tao-pagination__info"
9769
+ };
9770
+ const _hoisted_3$9 = {
9759
9771
  key: 0,
9760
9772
  class: "tao-pagination__total"
9761
9773
  };
9762
- const _hoisted_3$9 = { class: "tao-pagination__pages" };
9763
- const _hoisted_4$9 = ["aria-label", "disabled"];
9764
- const _hoisted_5$8 = { "aria-hidden": "true" };
9765
- const _hoisted_6$5 = ["aria-label", "disabled", "onClick"];
9766
- const _hoisted_7$3 = {
9774
+ const _hoisted_4$9 = {
9775
+ key: 1,
9776
+ class: "tao-pagination__sizes"
9777
+ };
9778
+ const _hoisted_5$8 = { class: "tao-pagination__sizes-text" };
9779
+ const _hoisted_6$5 = { class: "tao-pagination__pages" };
9780
+ const _hoisted_7$3 = ["aria-label", "disabled"];
9781
+ const _hoisted_8$2 = { "aria-hidden": "true" };
9782
+ const _hoisted_9$2 = ["aria-label", "disabled", "onClick"];
9783
+ const _hoisted_10$1 = {
9767
9784
  key: 1,
9768
9785
  class: "tao-pagination__ellipsis",
9769
9786
  "aria-hidden": "true"
9770
9787
  };
9771
- const _hoisted_8$2 = ["aria-current", "aria-label", "disabled", "onClick"];
9772
- const _hoisted_9$2 = ["aria-label", "disabled"];
9773
- const _hoisted_10$1 = { "aria-hidden": "true" };
9774
- const _hoisted_11$1 = {
9788
+ const _hoisted_11$1 = ["aria-current", "aria-label", "disabled", "onClick"];
9789
+ const _hoisted_12$1 = ["aria-label", "disabled"];
9790
+ const _hoisted_13 = { "aria-hidden": "true" };
9791
+ const _hoisted_14 = {
9775
9792
  key: 0,
9776
9793
  class: "tao-pagination__goto"
9777
9794
  };
9778
- const _hoisted_12$1 = {
9795
+ const _hoisted_15 = {
9779
9796
  class: "tao-pagination__goto-text",
9780
9797
  "aria-hidden": "true"
9781
9798
  };
9782
- const _hoisted_13 = ["placeholder", "aria-label", "disabled", "onKeydown"];
9799
+ const _hoisted_16 = ["placeholder", "aria-label", "disabled", "onKeydown"];
9783
9800
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
9784
9801
  ...{ name: "TaoPagination" },
9785
9802
  __name: "TaoPagination",
@@ -9800,14 +9817,29 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9800
9817
  jumpPrevLabel: {},
9801
9818
  jumpNextLabel: {},
9802
9819
  goToText: {},
9803
- goToLabel: {}
9820
+ goToLabel: {},
9821
+ pageSizes: {},
9822
+ perPageText: {}
9804
9823
  },
9805
- emits: ["update:page", "change"],
9824
+ emits: ["update:page", "change", "update:pageSize"],
9806
9825
  setup(__props, { emit: __emit }) {
9807
9826
  const appLocale = useTaoLocale();
9808
9827
  const props = __props;
9809
9828
  const l10n = useLocaleText(props, "pagination");
9810
9829
  const emit = __emit;
9830
+ const sizeOptions = computed(() => (props.pageSizes ?? []).map((n) => ({ value: n, label: String(n) })));
9831
+ function onPageSize(value) {
9832
+ const size = Number(value);
9833
+ if (!Number.isFinite(size) || size <= 0 || size === props.pageSize || props.disabled) {
9834
+ return;
9835
+ }
9836
+ const page = Math.floor((Math.max(from.value, 1) - 1) / size) + 1;
9837
+ emit("update:pageSize", size);
9838
+ if (page !== props.page) {
9839
+ emit("update:page", page);
9840
+ emit("change", page);
9841
+ }
9842
+ }
9811
9843
  const pageCount = computed(() => Math.max(1, Math.ceil(Math.max(props.total, 0) / Math.max(props.pageSize, 1))));
9812
9844
  const current2 = computed(() => Math.min(Math.max(props.page, 1), pageCount.value));
9813
9845
  const items = computed(() => buildPaginationItems(current2.value, pageCount.value, props.siblingCount));
@@ -9850,20 +9882,32 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9850
9882
  class: normalizeClass(["tao-pagination", unref(sizeClass)(__props.size)]),
9851
9883
  "aria-label": unref(l10n).ariaLabel
9852
9884
  }, [
9853
- __props.showTotal ? (openBlock(), createElementBlock("p", _hoisted_2$b, [
9854
- renderSlot(_ctx.$slots, "total", {
9855
- from: from.value,
9856
- to: to.value,
9857
- total: __props.total
9858
- }, () => [
9859
- __props.total === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
9860
- createTextVNode(toDisplayString(unref(appLocale).pagination.emptyTotalText), 1)
9861
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
9862
- createTextVNode(toDisplayString(unref(formatText)(unref(appLocale).pagination.totalText, { from: from.value, to: to.value, total: __props.total })), 1)
9863
- ], 64))
9864
- ], true)
9885
+ __props.showTotal || sizeOptions.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
9886
+ __props.showTotal ? (openBlock(), createElementBlock("p", _hoisted_3$9, [
9887
+ renderSlot(_ctx.$slots, "total", {
9888
+ from: from.value,
9889
+ to: to.value,
9890
+ total: __props.total
9891
+ }, () => [
9892
+ __props.total === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
9893
+ createTextVNode(toDisplayString(unref(appLocale).pagination.emptyTotalText), 1)
9894
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
9895
+ createTextVNode(toDisplayString(unref(formatText)(unref(appLocale).pagination.totalText, { from: from.value, to: to.value, total: __props.total })), 1)
9896
+ ], 64))
9897
+ ], true)
9898
+ ])) : createCommentVNode("", true),
9899
+ sizeOptions.value.length ? (openBlock(), createElementBlock("label", _hoisted_4$9, [
9900
+ createElementVNode("span", _hoisted_5$8, toDisplayString(unref(l10n).perPageText ?? unref(localeEn).pagination.perPageText), 1),
9901
+ createVNode(TaoSelect, {
9902
+ class: "tao-pagination__sizes-select",
9903
+ "model-value": __props.pageSize,
9904
+ options: sizeOptions.value,
9905
+ disabled: __props.disabled,
9906
+ "onUpdate:modelValue": onPageSize
9907
+ }, null, 8, ["model-value", "options", "disabled"])
9908
+ ])) : createCommentVNode("", true)
9865
9909
  ])) : createCommentVNode("", true),
9866
- createElementVNode("div", _hoisted_3$9, [
9910
+ createElementVNode("div", _hoisted_6$5, [
9867
9911
  createElementVNode("button", {
9868
9912
  type: "button",
9869
9913
  class: "tao-pagination__btn",
@@ -9871,12 +9915,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9871
9915
  disabled: __props.disabled || current2.value <= 1,
9872
9916
  onClick: _cache[0] || (_cache[0] = ($event) => goTo(current2.value - 1))
9873
9917
  }, [
9874
- createElementVNode("span", _hoisted_5$8, [
9918
+ createElementVNode("span", _hoisted_8$2, [
9875
9919
  renderSlot(_ctx.$slots, "prev-icon", {}, () => [
9876
9920
  createVNode(TaoIcon, { name: "tao-chevron-left" })
9877
9921
  ], true)
9878
9922
  ])
9879
- ], 8, _hoisted_4$9),
9923
+ ], 8, _hoisted_7$3),
9880
9924
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item) => {
9881
9925
  return openBlock(), createElementBlock(Fragment, {
9882
9926
  key: item.type === "page" ? item.page : item.id
@@ -9888,7 +9932,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9888
9932
  "aria-label": item.id === "left" ? unref(l10n).jumpPrevLabel.replace("{n}", String(__props.jump)) : unref(l10n).jumpNextLabel.replace("{n}", String(__props.jump)),
9889
9933
  disabled: __props.disabled,
9890
9934
  onClick: ($event) => goTo(item.id === "left" ? current2.value - __props.jump : current2.value + __props.jump)
9891
- }, " … ", 8, _hoisted_6$5)) : item.type === "ellipsis" ? (openBlock(), createElementBlock("span", _hoisted_7$3, "…")) : (openBlock(), createElementBlock("button", {
9935
+ }, " … ", 8, _hoisted_9$2)) : item.type === "ellipsis" ? (openBlock(), createElementBlock("span", _hoisted_10$1, "…")) : (openBlock(), createElementBlock("button", {
9892
9936
  key: 2,
9893
9937
  type: "button",
9894
9938
  class: normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page === current2.value }]),
@@ -9896,7 +9940,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9896
9940
  "aria-label": unref(l10n).pageLabel.replace("{page}", String(item.page)),
9897
9941
  disabled: __props.disabled,
9898
9942
  onClick: ($event) => goTo(item.page)
9899
- }, toDisplayString(item.page), 11, _hoisted_8$2))
9943
+ }, toDisplayString(item.page), 11, _hoisted_11$1))
9900
9944
  ], 64);
9901
9945
  }), 128)),
9902
9946
  createElementVNode("button", {
@@ -9906,14 +9950,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9906
9950
  disabled: __props.disabled || current2.value >= pageCount.value,
9907
9951
  onClick: _cache[1] || (_cache[1] = ($event) => goTo(current2.value + 1))
9908
9952
  }, [
9909
- createElementVNode("span", _hoisted_10$1, [
9953
+ createElementVNode("span", _hoisted_13, [
9910
9954
  renderSlot(_ctx.$slots, "next-icon", {}, () => [
9911
9955
  createVNode(TaoIcon, { name: "tao-chevron-right" })
9912
9956
  ], true)
9913
9957
  ])
9914
- ], 8, _hoisted_9$2),
9915
- showInput.value ? (openBlock(), createElementBlock("label", _hoisted_11$1, [
9916
- createElementVNode("span", _hoisted_12$1, toDisplayString(unref(l10n).goToText), 1),
9958
+ ], 8, _hoisted_12$1),
9959
+ showInput.value ? (openBlock(), createElementBlock("label", _hoisted_14, [
9960
+ createElementVNode("span", _hoisted_15, toDisplayString(unref(l10n).goToText), 1),
9917
9961
  withDirectives(createElementVNode("input", {
9918
9962
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => typed.value = $event),
9919
9963
  class: "tao-pagination__input",
@@ -9930,7 +9974,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9930
9974
  _cache[3] || (_cache[3] = withKeys(($event) => typed.value = "", ["esc"]))
9931
9975
  ],
9932
9976
  onBlur: submitTyped
9933
- }, null, 44, _hoisted_13), [
9977
+ }, null, 44, _hoisted_16), [
9934
9978
  [vModelText, typed.value]
9935
9979
  ])
9936
9980
  ])) : createCommentVNode("", true)
@@ -9939,7 +9983,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9939
9983
  };
9940
9984
  }
9941
9985
  });
9942
- const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-046d8bcd"]]);
9986
+ const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-a576ce4e"]]);
9943
9987
  const _hoisted_1$c = { class: "tao-empty" };
9944
9988
  const _hoisted_2$a = {
9945
9989
  key: 0,
@@ -10133,7 +10177,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
10133
10177
  };
10134
10178
  }
10135
10179
  });
10136
- const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-215a8394"]]);
10180
+ const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-5b58c12a"]]);
10137
10181
  const _hoisted_1$9 = {
10138
10182
  class: "tao-skeleton-group",
10139
10183
  "aria-hidden": true
@@ -11141,7 +11185,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
11141
11185
  };
11142
11186
  }
11143
11187
  });
11144
- const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-2f3bafe8"]]);
11188
+ const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-5d5b1c78"]]);
11145
11189
  const _hoisted_1$3 = ["aria-label"];
11146
11190
  const _hoisted_2$2 = ["aria-label"];
11147
11191
  const _hoisted_3$2 = {
@@ -11226,12 +11270,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
11226
11270
  }
11227
11271
  });
11228
11272
  const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6e1917e1"]]);
11229
- const _hoisted_1$2 = ["role"];
11273
+ const _hoisted_1$2 = ["role", "aria-busy"];
11230
11274
  const _hoisted_2$1 = {
11275
+ key: 0,
11231
11276
  class: "tao-toast__icon",
11232
11277
  "aria-hidden": "true"
11233
11278
  };
11234
- const _hoisted_3$1 = { class: "tao-toast__body" };
11279
+ const _hoisted_3$1 = {
11280
+ key: 0,
11281
+ class: "tao-toast__spinner"
11282
+ };
11235
11283
  const _hoisted_4$1 = {
11236
11284
  key: 0,
11237
11285
  class: "tao-toast__title"
@@ -11286,6 +11334,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11286
11334
  paused.value = false;
11287
11335
  startTimer();
11288
11336
  }
11337
+ const inline = computed(() => !props.toast.title && props.toast.actions.length > 0);
11338
+ const hasIcon = computed(() => props.toast.loading || Boolean(props.toast.icon) || props.toast.type !== "neutral");
11289
11339
  function close() {
11290
11340
  clearTimer();
11291
11341
  removeToast(props.toast.id);
@@ -11295,6 +11345,16 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11295
11345
  close();
11296
11346
  }
11297
11347
  startTimer();
11348
+ watch(
11349
+ () => props.toast,
11350
+ (next, prev) => {
11351
+ if (next === prev) return;
11352
+ clearTimer();
11353
+ remaining = next.timeout;
11354
+ paused.value = false;
11355
+ startTimer();
11356
+ }
11357
+ );
11298
11358
  let stopFocusLoss;
11299
11359
  onMounted(() => {
11300
11360
  stopFocusLoss = listenFocusLoss(resume);
@@ -11308,6 +11368,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11308
11368
  class: normalizeClass(["tao-toast", [unref(toneClass)(__props.toast.type === "neutral" ? void 0 : __props.toast.type), unref(surfaceClass)(__props.toast.surface), { "tao-toast--paused": paused.value }]]),
11309
11369
  role: __props.toast.type === "danger" || __props.toast.type === "warning" ? "alert" : "status",
11310
11370
  "aria-live": "polite",
11371
+ "aria-busy": __props.toast.loading || void 0,
11311
11372
  onMouseenter: pause,
11312
11373
  onMouseleave: resume
11313
11374
  }, [
@@ -11315,30 +11376,32 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11315
11376
  class: "tao-toast__accent",
11316
11377
  "aria-hidden": "true"
11317
11378
  }, null, -1)),
11318
- createElementVNode("span", _hoisted_2$1, [
11319
- __props.toast.icon ? (openBlock(), createBlock(TaoIcon, {
11320
- key: 0,
11379
+ hasIcon.value ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
11380
+ __props.toast.loading ? (openBlock(), createElementBlock("span", _hoisted_3$1)) : __props.toast.icon ? (openBlock(), createBlock(TaoIcon, {
11381
+ key: 1,
11321
11382
  name: __props.toast.icon,
11322
11383
  size: 18
11323
11384
  }, null, 8, ["name"])) : __props.toast.type === "success" ? (openBlock(), createBlock(TaoIcon, {
11324
- key: 1,
11385
+ key: 2,
11325
11386
  name: "tao-check-circle",
11326
11387
  size: 18
11327
11388
  })) : __props.toast.type === "danger" ? (openBlock(), createBlock(TaoIcon, {
11328
- key: 2,
11389
+ key: 3,
11329
11390
  name: "tao-x-circle",
11330
11391
  size: 18
11331
11392
  })) : __props.toast.type === "warning" ? (openBlock(), createBlock(TaoIcon, {
11332
- key: 3,
11393
+ key: 4,
11333
11394
  name: "tao-alert-triangle",
11334
11395
  size: 18
11335
11396
  })) : (openBlock(), createBlock(TaoIcon, {
11336
- key: 4,
11397
+ key: 5,
11337
11398
  name: "tao-info",
11338
11399
  size: 18
11339
11400
  }))
11340
- ]),
11341
- createElementVNode("div", _hoisted_3$1, [
11401
+ ])) : createCommentVNode("", true),
11402
+ createElementVNode("div", {
11403
+ class: normalizeClass(["tao-toast__body", { "tao-toast__body--inline": inline.value, "tao-toast__body--closable": __props.toast.closable }])
11404
+ }, [
11342
11405
  __props.toast.title ? (openBlock(), createElementBlock("strong", _hoisted_4$1, toDisplayString(__props.toast.title), 1)) : createCommentVNode("", true),
11343
11406
  __props.toast.message ? (openBlock(), createElementBlock("p", _hoisted_5$1, toDisplayString(__props.toast.message), 1)) : createCommentVNode("", true),
11344
11407
  __props.toast.actions.length ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
@@ -11346,19 +11409,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11346
11409
  return openBlock(), createBlock(TaoButton, {
11347
11410
  key: action.label,
11348
11411
  size: "small",
11349
- variant: "secondary",
11412
+ variant: inline.value ? "text" : "secondary",
11350
11413
  onClick: ($event) => runAction(action.onClick)
11351
11414
  }, {
11352
11415
  default: withCtx(() => [
11353
11416
  createTextVNode(toDisplayString(action.label), 1)
11354
11417
  ]),
11355
11418
  _: 2
11356
- }, 1032, ["onClick"]);
11419
+ }, 1032, ["variant", "onClick"]);
11357
11420
  }), 128))
11358
11421
  ])) : createCommentVNode("", true)
11359
- ]),
11422
+ ], 2),
11360
11423
  __props.toast.closable ? (openBlock(), createElementBlock("button", {
11361
- key: 0,
11424
+ key: 1,
11362
11425
  type: "button",
11363
11426
  class: "tao-toast__close",
11364
11427
  "aria-label": unref(toastDefaults).closeLabel,
@@ -11367,7 +11430,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11367
11430
  createVNode(TaoIcon, { name: "tao-close" })
11368
11431
  ], 8, _hoisted_7)) : createCommentVNode("", true),
11369
11432
  __props.toast.progress && __props.toast.timeout ? (openBlock(), createElementBlock("span", {
11370
- key: 1,
11433
+ key: 2,
11371
11434
  class: "tao-toast__progress",
11372
11435
  style: normalizeStyle({ animationDuration: `${__props.toast.timeout}ms` })
11373
11436
  }, null, 4)) : createCommentVNode("", true)
@@ -11375,7 +11438,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11375
11438
  };
11376
11439
  }
11377
11440
  });
11378
- const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ac6f0b22"]]);
11441
+ const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-eb76e6db"]]);
11379
11442
  const _hoisted_1$1 = { class: "tao-toast-slot__inner" };
11380
11443
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
11381
11444
  ...{ name: "TaoToastViewport" },
@@ -11429,7 +11492,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
11429
11492
  };
11430
11493
  }
11431
11494
  });
11432
- const TaoToastViewport = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-14bc09d4"]]);
11495
+ const TaoToastViewport = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d9fb6134"]]);
11433
11496
  const _hoisted_1 = ["aria-labelledby", "aria-describedby"];
11434
11497
  const _hoisted_2 = {
11435
11498
  class: "tao-confirm__icon",
@@ -11595,13 +11658,16 @@ function flushDraft(draft) {
11595
11658
  icon: draft.icon,
11596
11659
  timeout: draft.timeout,
11597
11660
  position: draft.position,
11598
- closable: draft.closable,
11661
+ // a snackbar (no title, an action) has no cross unless asked: next to the action it is a mistap waiting to happen
11662
+ // у snackbar (без заголовка, с действием) крестика нет, если не попросили: рядом с действием по нему промахиваются
11663
+ closable: draft.closableSet || draft.title || !draft.actions.length ? draft.closable : false,
11599
11664
  progress: draft.progress,
11600
11665
  surface: draft.surface,
11601
11666
  displayMode: draft.displayMode,
11602
11667
  dedupeId,
11603
11668
  actions: draft.actions,
11604
- onClosed: draft.onClosed
11669
+ onClosed: draft.onClosed,
11670
+ loading: draft.loading
11605
11671
  });
11606
11672
  }
11607
11673
  function createDraft$1() {
@@ -11700,6 +11766,7 @@ function createBuilder$1() {
11700
11766
  },
11701
11767
  closable(value = true) {
11702
11768
  draft.closable = value;
11769
+ draft.closableSet = true;
11703
11770
  return ctx;
11704
11771
  },
11705
11772
  progress(value = true) {
@@ -11729,6 +11796,12 @@ function createBuilder$1() {
11729
11796
  onClosed(fn) {
11730
11797
  draft.onClosed = fn;
11731
11798
  return ctx;
11799
+ },
11800
+ loading() {
11801
+ draft.type = "neutral";
11802
+ draft.loading = true;
11803
+ draft.timeout = 0;
11804
+ return ctx;
11732
11805
  }
11733
11806
  };
11734
11807
  setTimeout(() => flushDraft(draft), 0);
@@ -11818,6 +11891,21 @@ const toast = Object.assign(createBuilder$1, {
11818
11891
  },
11819
11892
  dismiss(id) {
11820
11893
  dismissToasts(id);
11894
+ },
11895
+ promise(promise, texts, options) {
11896
+ const id = options?.id ?? nextToastId();
11897
+ const start = (builder) => {
11898
+ builder.id(id).replace();
11899
+ if (options?.title) builder.title(options.title);
11900
+ if (options?.position) builder.position(options.position);
11901
+ return builder;
11902
+ };
11903
+ start(createBuilder$1().loading()).message(texts.loading);
11904
+ promise.then(
11905
+ (value) => start(createBuilder$1().success()).message(typeof texts.success === "function" ? texts.success(value) : texts.success),
11906
+ (error) => start(createBuilder$1().danger()).message(typeof texts.error === "function" ? texts.error(error) : texts.error)
11907
+ );
11908
+ return promise;
11821
11909
  }
11822
11910
  });
11823
11911
  function isClient() {