@auronui/vue 1.0.13 → 1.0.14

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.
@@ -13430,12 +13430,10 @@ var TabList_default = /* @__PURE__ */ (0, vue.defineComponent)({
13430
13430
  }, { immediate: true });
13431
13431
  (0, _vueuse_core.useResizeObserver)(scrollWrapperEl, () => (0, vue.nextTick)(updateScrollButtons));
13432
13432
  const containerEl = (0, vue.useTemplateRef)("containerEl");
13433
- const moreBtnEl = (0, vue.useTemplateRef)("moreBtnEl");
13434
13433
  const dropdownEl = (0, vue.useTemplateRef)("dropdownEl");
13435
13434
  const hiddenTabs = (0, vue.ref)([]);
13436
13435
  const dropdownOpen = (0, vue.ref)(false);
13437
13436
  const hasOverflow = (0, vue.computed)(() => hiddenTabs.value.length > 0);
13438
- let moreBtnNaturalWidth = 48;
13439
13437
  (0, _vueuse_core.onClickOutside)(dropdownEl, () => {
13440
13438
  dropdownOpen.value = false;
13441
13439
  });
@@ -13452,7 +13450,19 @@ var TabList_default = /* @__PURE__ */ (0, vue.defineComponent)({
13452
13450
  });
13453
13451
  listEl.offsetWidth;
13454
13452
  }
13455
- const containerWidth = containerEl.value.clientWidth;
13453
+ let moreWidth = 0;
13454
+ const moreEl = dropdownEl.value;
13455
+ if (moreEl) {
13456
+ const prevDisplay = moreEl.style.display;
13457
+ moreEl.style.display = "flex";
13458
+ moreEl.offsetWidth;
13459
+ moreWidth = moreEl.offsetWidth;
13460
+ moreEl.style.display = prevDisplay;
13461
+ }
13462
+ const cs = getComputedStyle(containerEl.value);
13463
+ const padX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
13464
+ const gap = parseFloat(cs.columnGap) || 0;
13465
+ const contentWidth = containerEl.value.clientWidth - padX;
13456
13466
  const tabWidths = allTabs.map((t) => t.offsetWidth);
13457
13467
  const totalWidth = tabWidths.reduce((sum, w) => sum + w, 0);
13458
13468
  if (listEl) {
@@ -13462,11 +13472,11 @@ var TabList_default = /* @__PURE__ */ (0, vue.defineComponent)({
13462
13472
  t.style.width = "";
13463
13473
  });
13464
13474
  }
13465
- if (totalWidth <= containerWidth) {
13475
+ if (totalWidth <= contentWidth) {
13466
13476
  hiddenTabs.value = [];
13467
13477
  return;
13468
13478
  }
13469
- const available = containerWidth - moreBtnNaturalWidth;
13479
+ const available = contentWidth - moreWidth - gap - 1;
13470
13480
  let accumulated = 0;
13471
13481
  const newHidden = [];
13472
13482
  const visibleEls = [];
@@ -13508,13 +13518,6 @@ var TabList_default = /* @__PURE__ */ (0, vue.defineComponent)({
13508
13518
  }
13509
13519
  (0, _vueuse_core.useResizeObserver)(containerEl, () => (0, vue.nextTick)(computeOverflow));
13510
13520
  (0, vue.onMounted)(() => {
13511
- const btnEl = moreBtnEl.value?.$el;
13512
- if (btnEl) {
13513
- btnEl.style.display = "flex";
13514
- btnEl.offsetWidth;
13515
- moreBtnNaturalWidth = btnEl.offsetWidth;
13516
- btnEl.style.display = "";
13517
- }
13518
13521
  (0, vue.nextTick)(computeOverflow);
13519
13522
  });
13520
13523
  (0, vue.watch)(() => ctx.currentValue.value, () => {
@@ -13619,8 +13622,6 @@ var TabList_default = /* @__PURE__ */ (0, vue.defineComponent)({
13619
13622
  ref: dropdownEl,
13620
13623
  class: (0, vue.normalizeClass)(["tabs__more", { "tabs__more--visible": hasOverflow.value }])
13621
13624
  }, [(0, vue.createVNode)(Button_default, {
13622
- ref_key: "moreBtnEl",
13623
- ref: moreBtnEl,
13624
13625
  variant: "secondary",
13625
13626
  size: "sm",
13626
13627
  radius: "full",