vlite3 1.4.30 → 1.4.32

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.
Files changed (79) hide show
  1. package/components/Accordion/Accordion.vue.js +19 -16
  2. package/components/Accordion/AccordionContent.vue.js +2 -2
  3. package/components/Accordion/AccordionItem.vue.js +38 -36
  4. package/components/CategoryManager/CategoryManager.vue2.js +3 -2
  5. package/components/Chart/GanttChart.vue.d.ts +13 -1
  6. package/components/Chart/GanttChart.vue.js +2 -2
  7. package/components/Chart/GanttChart.vue2.js +1185 -607
  8. package/components/Chart/GanttChartDateUtils.d.ts +38 -0
  9. package/components/Chart/GanttChartDateUtils.js +79 -0
  10. package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
  11. package/components/Chart/GanttChartDependencyUtils.js +113 -0
  12. package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
  13. package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
  14. package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
  15. package/components/Chart/GanttChartTooltipUtils.js +63 -0
  16. package/components/Chart/index.d.ts +3 -1
  17. package/components/Chart/types.d.ts +76 -1
  18. package/components/Chart/types.js +8 -0
  19. package/components/FilePicker/FilePickerDropzone.vue.js +1 -1
  20. package/components/FilePicker/index.vue.js +2 -4
  21. package/components/Form/AccordionView.vue2.js +5 -2
  22. package/components/Form/AccordionView.vue3.js +250 -0
  23. package/components/Form/Form.vue.d.ts +0 -2
  24. package/components/Form/Form.vue.js +1 -1
  25. package/components/Form/Form.vue2.js +415 -354
  26. package/components/Form/FormField.vue.js +175 -196
  27. package/components/Form/FormFields.vue.js +1 -1
  28. package/components/Form/FormFields.vue2.js +60 -60
  29. package/components/Form/FormSkeleton.vue.js +50 -35
  30. package/components/Form/TableView.vue.js +59 -43
  31. package/components/Form/composables/useForm.js +159 -148
  32. package/components/Form/index.vue2.js +8 -8
  33. package/components/Form/utils/form.utils.d.ts +2 -0
  34. package/components/Form/utils/form.utils.js +17 -13
  35. package/components/GoogleMap.vue.d.ts +1 -1
  36. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
  37. package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
  38. package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
  39. package/components/PanZoomViewport/index.d.ts +2 -0
  40. package/components/PanZoomViewport/types.d.ts +121 -0
  41. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
  42. package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
  43. package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
  44. package/components/ScaleGenerator/types.d.ts +2 -0
  45. package/components/Screen/ScreenFilter.vue.js +18 -17
  46. package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
  47. package/components/SeoProvider/SeoProvider.vue.js +39 -33
  48. package/components/SeoProvider/domAdapter.d.ts +1 -4
  49. package/components/SeoProvider/domAdapter.js +71 -58
  50. package/components/SeoProvider/index.d.ts +5 -2
  51. package/components/SeoProvider/normalizeSeo.d.ts +10 -49
  52. package/components/SeoProvider/normalizeSeo.js +246 -182
  53. package/components/SeoProvider/plainText.d.ts +8 -0
  54. package/components/SeoProvider/plainText.js +117 -0
  55. package/components/SeoProvider/seoUrl.d.ts +13 -0
  56. package/components/SeoProvider/seoUrl.js +25 -0
  57. package/components/SeoProvider/structuredData.d.ts +100 -0
  58. package/components/SeoProvider/structuredData.js +33 -0
  59. package/components/SeoProvider/types.d.ts +47 -109
  60. package/components/Tabes/Tabes.vue.d.ts +10 -1
  61. package/components/Tabes/Tabes.vue.js +1 -1
  62. package/components/Tabes/Tabes.vue2.js +271 -170
  63. package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
  64. package/components/Tabes/TabesMarkerGeometry.js +21 -0
  65. package/components/Tabes/tabes.utils.d.ts +14 -0
  66. package/components/Tabes/tabes.utils.js +26 -0
  67. package/components/Tabes/types.d.ts +32 -0
  68. package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
  69. package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
  70. package/components/ThemeProvider/index.d.ts +1 -1
  71. package/components/ThemeProvider/themeVars.d.ts +9 -13
  72. package/components/ThemeProvider/themeVars.js +173 -125
  73. package/components/ThemeProvider/types.d.ts +10 -0
  74. package/components/index.d.ts +2 -1
  75. package/index.d.ts +1 -0
  76. package/index.js +415 -387
  77. package/package.json +3 -2
  78. package/style.css +1 -1
  79. package/components/Form/AccordionView.vue.js +0 -222
@@ -1,9 +1,12 @@
1
- import { defineComponent as Y, ref as d, watch as g, onMounted as Z, computed as v, openBlock as m, createElementBlock as z, normalizeClass as l, withDirectives as x, createVNode as y, vShow as h, createElementVNode as f, normalizeStyle as ee, createCommentVNode as j, Fragment as te, renderList as re, createBlock as M, resolveDynamicComponent as ae, mergeProps as ne, withCtx as oe, toDisplayString as se, nextTick as le } from "vue";
2
- import { useResizeObserver as T } from "@vueuse/core";
3
- import R from "../Icon.vue.js";
4
- import A from "../FadeOverlay/FadeOverlay.vue.js";
5
- import { $t as ie } from "../../utils/i18n.js";
6
- const ce = ["data-variant"], me = /* @__PURE__ */ Y({
1
+ import { defineComponent as Ce, ref as h, computed as d, watch as p, onMounted as Ve, onBeforeUnmount as ze, openBlock as f, createElementBlock as $, normalizeClass as l, withDirectives as M, createVNode as y, vShow as L, createElementVNode as c, normalizeStyle as Se, createCommentVNode as E, Fragment as J, renderList as Be, unref as X, createBlock as A, withCtx as Y, toDisplayString as Z, withMemo as $e, resolveDynamicComponent as Me, mergeProps as Le, nextTick as Ae } from "vue";
2
+ import { useResizeObserver as _ } from "@vueuse/core";
3
+ import { getActiveMarkerKey as Oe, isMenuTab as ee, isTabActive as te } from "./tabes.utils.js";
4
+ import { measureTabesMarkerGeometry as Re, toTabesLocalScrollDelta as ne } from "./TabesMarkerGeometry.js";
5
+ import w from "../Icon.vue.js";
6
+ import re from "../FadeOverlay/FadeOverlay.vue.js";
7
+ import Fe from "../Dropdown/Dropdown.vue.js";
8
+ import { $t as Ie } from "../../utils/i18n.js";
9
+ const Ee = ["dir"], Te = ["data-variant"], je = ["aria-selected", "aria-expanded", "disabled"], Qe = /* @__PURE__ */ Ce({
7
10
  __name: "Tabes",
8
11
  props: {
9
12
  options: {},
@@ -13,95 +16,130 @@ const ce = ["data-variant"], me = /* @__PURE__ */ Y({
13
16
  block: { type: Boolean, default: !1 },
14
17
  textClass: {},
15
18
  wrap: { type: Boolean, default: !1 },
16
- tabClass: {}
19
+ tabClass: {},
20
+ direction: { default: "ltr" }
17
21
  },
18
- emits: ["update:modelValue", "change"],
19
- setup(c, { emit: E }) {
20
- const t = c, $ = E, b = d(null), i = d(null), p = d(/* @__PURE__ */ new Map()), w = d(!1), C = d(!1), o = () => {
21
- if (!i.value) return;
22
- const { scrollLeft: e, scrollWidth: a, clientWidth: r } = i.value;
23
- w.value = e > 1, C.value = Math.ceil(e + r) < a - 1;
24
- }, S = (e) => {
25
- i.value && i.value.scrollBy({ left: e, behavior: "smooth" });
26
- }, V = () => {
27
- if (!i.value || !b.value) return;
28
- const e = p.value.get(t.modelValue);
29
- if (!e) return;
30
- const a = i.value, r = e.getBoundingClientRect(), n = a.getBoundingClientRect(), s = 40;
31
- r.left < n.left + s ? a.scrollBy({
32
- left: r.left - n.left - s,
22
+ emits: ["update:modelValue", "change", "menu-select", "menu-open", "menu-close"],
23
+ setup(s, { emit: ae }) {
24
+ const n = s, m = ae, k = h(null), u = h(null), v = /* @__PURE__ */ new Map(), C = h(!1), V = h(!1);
25
+ let O = 0, T = 0, z = !1, S = !1, R = 0;
26
+ const j = () => {
27
+ if (!u.value) return;
28
+ const { scrollLeft: e, scrollWidth: r, clientWidth: t } = u.value, a = e > 1, o = Math.ceil(e + t) < r - 1;
29
+ C.value !== a && (C.value = a), V.value !== o && (V.value = o);
30
+ }, se = () => {
31
+ S || (S = !0, T = requestAnimationFrame(() => {
32
+ S = !1, j();
33
+ }));
34
+ }, q = (e) => {
35
+ u.value && u.value.scrollBy({ left: e, behavior: "smooth" });
36
+ }, D = d(() => Oe(n.options, n.modelValue)), oe = () => {
37
+ if (!u.value || !k.value) return;
38
+ const e = D.value;
39
+ if (e === void 0) return;
40
+ const r = v.get(e);
41
+ if (!r) return;
42
+ const t = u.value, a = r.getBoundingClientRect(), o = t.getBoundingClientRect(), g = 40;
43
+ a.left < o.left + g ? t.scrollBy({
44
+ left: ne(
45
+ t,
46
+ a.left - o.left - g
47
+ ),
33
48
  behavior: "smooth"
34
- }) : r.right > n.right - s && a.scrollBy({
35
- left: r.right - n.right + s,
49
+ }) : a.right > o.right - g && t.scrollBy({
50
+ left: ne(
51
+ t,
52
+ a.right - o.right + g
53
+ ),
36
54
  behavior: "smooth"
37
55
  });
38
- };
39
- T(i, o);
40
- const O = (e, a) => {
41
- e ? p.value.set(a, e) : p.value.delete(a);
42
- }, k = d({
56
+ }, W = (e, r) => {
57
+ e instanceof HTMLElement ? v.set(r, e) : e && typeof e == "object" && "$el" in e && e.$el instanceof HTMLElement ? v.set(r, e.$el) : v.delete(r);
58
+ }, b = h({
43
59
  width: "0px",
44
60
  height: "0px",
45
61
  transform: "translate(0px, 0px)",
46
62
  opacity: 0
47
- }), B = d(!1), u = async () => {
48
- await le();
49
- const e = b.value, a = p.value.get(t.modelValue);
50
- if (!e || !a) {
51
- k.value.opacity = 0;
63
+ }), F = h(!1), P = () => {
64
+ b.value.opacity !== 0 && (b.value = {
65
+ ...b.value,
66
+ opacity: 0
67
+ });
68
+ }, le = async () => {
69
+ await Ae();
70
+ const e = k.value, r = D.value, t = r !== void 0 ? v.get(r) : void 0;
71
+ if (!e || !t) {
72
+ P();
52
73
  return;
53
74
  }
54
- const r = e.getBoundingClientRect(), n = a.getBoundingClientRect(), s = n.left - r.left, Q = n.top - r.top, U = n.width, X = n.height;
55
- k.value = {
56
- width: `${U}px`,
57
- height: `${X}px`,
58
- transform: `translate(${s}px, ${Q}px)`,
75
+ if (e.offsetWidth <= 0 || t.offsetWidth <= 0) {
76
+ P();
77
+ return;
78
+ }
79
+ const { width: a, height: o, left: g, top: ke } = Re(e, t), x = {
80
+ width: `${a}px`,
81
+ height: `${o}px`,
82
+ transform: `translate(${g}px, ${ke}px)`,
59
83
  opacity: 1
60
- }, B.value || setTimeout(() => {
61
- B.value = !0;
62
- }, 50);
84
+ }, B = b.value;
85
+ B.width === x.width && B.height === x.height && B.transform === x.transform && B.opacity === x.opacity || (b.value = x, F.value || (cancelAnimationFrame(R), R = requestAnimationFrame(() => {
86
+ F.value = !0;
87
+ })));
63
88
  };
64
- T(b, () => {
65
- u(), o();
66
- }), g(
67
- () => t.modelValue,
68
- async () => {
69
- await u(), V();
70
- }
71
- ), g(
72
- () => t.options,
73
- async () => {
74
- await u(), o();
75
- },
76
- { deep: !0 }
77
- ), g(
78
- () => t.size,
79
- async () => {
80
- await u(), o();
81
- }
82
- ), g(
83
- () => t.block,
84
- async () => {
85
- await u(), o();
86
- }
87
- ), g(
88
- () => t.wrap,
89
- async () => {
90
- await u(), o();
91
- }
92
- ), Z(async () => {
93
- await u(), o(), setTimeout(o, 100), setTimeout(V, 100);
89
+ let I = !1;
90
+ const H = async (e) => {
91
+ await le(), j(), e?.ensureVisible && oe();
92
+ }, i = (e) => {
93
+ e?.ensureVisible && (I = !0), !z && (z = !0, cancelAnimationFrame(O), O = requestAnimationFrame(() => {
94
+ z = !1;
95
+ const r = I;
96
+ I = !1, H({ ensureVisible: r });
97
+ }));
98
+ };
99
+ _(u, () => i()), _(k, () => i()), p(
100
+ () => n.modelValue,
101
+ () => i({ ensureVisible: !0 })
102
+ ), p(
103
+ () => n.options,
104
+ () => i()
105
+ ), p(
106
+ () => n.size,
107
+ () => i()
108
+ ), p(
109
+ () => n.block,
110
+ () => i()
111
+ ), p(
112
+ () => n.wrap,
113
+ () => i()
114
+ ), p(
115
+ () => n.variant,
116
+ () => i()
117
+ ), Ve(() => {
118
+ H({ ensureVisible: !0 });
119
+ }), ze(() => {
120
+ cancelAnimationFrame(O), cancelAnimationFrame(T), cancelAnimationFrame(R), z = !1, S = !1, v.clear();
94
121
  });
95
- const D = v(() => {
96
- const e = t.variant === "line";
97
- return t.block || e ? "flex w-full relative" : "inline-flex max-w-full relative";
98
- }), L = v(() => [
122
+ const ie = d(() => {
123
+ const e = n.variant === "line";
124
+ return n.block || e ? "flex w-full relative" : "inline-flex max-w-full relative";
125
+ }), N = d(() => [
99
126
  "absolute top-0 bottom-0 z-20 flex items-center pointer-events-none transition-opacity duration-200",
100
- t.variant === "line" ? "pb-[10px]" : ""
101
- ]), N = (e) => {
102
- e.disabled || ($("update:modelValue", e.value), $("change", e.value));
103
- }, P = v(() => {
104
- const e = t.variant === "line", a = {
127
+ n.variant === "line" ? "pb-[10px]" : ""
128
+ ]), ce = (e) => {
129
+ e.disabled || ee(e) || (m("update:modelValue", e.value), m("change", e.value));
130
+ }, ue = (e, r) => {
131
+ if (e.disabled) return;
132
+ const t = r.value;
133
+ t != null && (m("update:modelValue", t), m("change", t), m("menu-select", { value: t, option: r.option, tab: e }));
134
+ }, de = (e) => {
135
+ m("menu-open", e);
136
+ }, fe = (e) => {
137
+ m("menu-close", e), i();
138
+ }, me = d(() => {
139
+ const e = n.variant === "line";
140
+ return (n.block || n.wrap) && !e ? "flex-1 min-w-max" : "shrink-0";
141
+ }), ve = (e) => e.dropdown?.direction ?? n.direction, be = d(() => {
142
+ const e = n.variant === "line", r = {
105
143
  surface: "bg-secondary/80 p-1",
106
144
  primary: "bg-secondary p-1",
107
145
  secondary: "bg-secondary p-1",
@@ -109,52 +147,52 @@ const ce = ["data-variant"], me = /* @__PURE__ */ Y({
109
147
  success: "bg-success/10 p-1",
110
148
  outline: "bg-transparent border border-border p-1",
111
149
  line: "bg-transparent gap-6 rounded-none p-0 border-b border-border"
112
- }, r = t.wrap && !e ? "flex-wrap" : "";
113
- return [`${t.block || e ? "flex min-w-full w-max" : "inline-flex"} rounded-lg relative isolate ${r}`, a[t.variant]];
114
- }), I = v(() => t.variant === "surface" || t.variant === "primary" || t.variant === "secondary" ? "var(--color-secondary)" : t.variant === "danger" ? "color-mix(in srgb, var(--color-danger) 10%, transparent)" : t.variant === "success" ? "color-mix(in srgb, var(--color-success) 10%, transparent)" : "var(--color-background)"), W = {
150
+ }, t = n.wrap && !e ? "flex-wrap" : "";
151
+ return [`${n.block || e ? "flex min-w-full w-max" : "inline-flex"} rounded-lg relative isolate ${t}`, r[n.variant]];
152
+ }), G = d(() => n.variant === "surface" || n.variant === "primary" || n.variant === "secondary" ? "var(--color-secondary)" : n.variant === "danger" ? "color-mix(in srgb, var(--color-danger) 10%, transparent)" : n.variant === "success" ? "color-mix(in srgb, var(--color-success) 10%, transparent)" : "var(--color-background)"), K = {
115
153
  sm: "text-xs px-2.5 py-1",
116
154
  md: "-text-fs-2 px-3 py-1",
117
155
  lg: "-text-fs-1 px-4 py-1"
118
- }, _ = v(() => {
119
- const e = t.variant === "line", a = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none pb-3 border-b-2 border-transparent hover:text-foreground shrink-0" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none shrink-0", r = (t.block || t.wrap) && !e ? "flex-1" : "";
120
- return [a, r];
121
- }), F = (e) => {
122
- const a = e.value === t.modelValue, r = t.variant === "line";
123
- let n = "";
124
- if (a)
125
- if (r)
126
- n = t.wrap ? "text-primary !border-primary" : "text-primary";
156
+ }, ge = d(() => {
157
+ const e = n.variant === "line", r = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none pb-3 border-b-2 border-transparent hover:text-foreground shrink-0" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none shrink-0", t = (n.block || n.wrap) && !e ? "flex-1" : "";
158
+ return [r, t];
159
+ }), Q = (e) => {
160
+ const r = te(e, n.modelValue), t = n.variant === "line";
161
+ let a = "";
162
+ if (r)
163
+ if (t)
164
+ a = n.wrap ? "text-primary !border-primary" : "text-primary";
127
165
  else
128
- switch (t.variant) {
166
+ switch (n.variant) {
129
167
  case "surface":
130
- n = t.wrap ? "text-foreground bg-[#ffff] dark:bg-[#0B0B0B] shadow-sm" : "text-foreground";
168
+ a = n.wrap ? "text-foreground bg-[#ffff] dark:bg-[#0B0B0B] shadow-sm" : "text-foreground";
131
169
  break;
132
170
  case "primary":
133
- n = t.wrap ? "text-primary-foreground bg-primary" : "text-primary-foreground";
171
+ a = n.wrap ? "text-primary-foreground bg-primary" : "text-primary-foreground";
134
172
  break;
135
173
  case "secondary":
136
- n = t.wrap ? "text-secondary bg-secondary-foreground" : "text-secondary";
174
+ a = n.wrap ? "text-secondary bg-secondary-foreground" : "text-secondary";
137
175
  break;
138
176
  case "danger":
139
- n = t.wrap ? "text-danger-fg bg-danger" : "text-danger-fg";
177
+ a = n.wrap ? "text-danger-fg bg-danger" : "text-danger-fg";
140
178
  break;
141
179
  case "success":
142
- n = t.wrap ? "text-success-fg bg-success" : "text-success-fg";
180
+ a = n.wrap ? "text-success-fg bg-success" : "text-success-fg";
143
181
  break;
144
182
  case "outline":
145
- n = t.wrap ? "text-accent-foreground bg-accent/50 ring-1 ring-border" : "text-accent-foreground";
183
+ a = n.wrap ? "text-accent-foreground bg-accent/50 ring-1 ring-border" : "text-accent-foreground";
146
184
  break;
147
185
  default:
148
- n = "text-foreground";
186
+ a = "text-foreground";
149
187
  }
150
188
  else
151
- n = r ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
152
- const s = e.disabled ? "opacity-50 cursor-not-allowed" : "";
153
- return [_.value, n, t?.tabClass, s].join(" ");
154
- }, q = v(() => {
155
- const a = `absolute left-0 top-0 z-0 pointer-events-none ${B.value ? "transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]" : ""}`;
156
- return t.variant === "line" ? `${a} !h-[2px] !top-auto bottom-0` : `${a} rounded-md shadow-sm`;
157
- }), G = () => ({
189
+ a = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
190
+ const o = e.disabled ? "opacity-50 cursor-not-allowed" : "";
191
+ return [ge.value, a, n?.tabClass, o].join(" ");
192
+ }, he = d(() => {
193
+ const r = `absolute left-0 top-0 z-0 pointer-events-none ${F.value ? "transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]" : ""}`;
194
+ return n.variant === "line" ? `${r} !h-[2px] !top-auto bottom-0` : `${r} rounded-md shadow-sm`;
195
+ }), pe = () => ({
158
196
  surface: "bg-[#ffff] dark:bg-[#0B0B0B]",
159
197
  primary: "bg-primary",
160
198
  secondary: "bg-secondary-foreground",
@@ -162,112 +200,175 @@ const ce = ["data-variant"], me = /* @__PURE__ */ Y({
162
200
  success: "bg-success",
163
201
  outline: "bg-accent/50 ring-1 ring-border",
164
202
  line: "bg-primary"
165
- })[t.variant], H = (e) => e.labelI18n ? ie(e.labelI18n) : e.label, J = (e) => e.to ? "router-link" : e.href ? "a" : "button", K = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
166
- return (e, a) => (m(), z("div", {
167
- class: l([D.value, "group"])
203
+ })[n.variant], U = (e) => e.labelI18n ? Ie(e.labelI18n) : e.label, xe = (e) => e.to ? "router-link" : e.href ? "a" : "button", ye = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" }, we = (e) => [
204
+ n.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5",
205
+ "opacity-70 shrink-0 transition-transform duration-200",
206
+ e ? "rotate-180" : ""
207
+ ].join(" ");
208
+ return (e, r) => (f(), $("div", {
209
+ class: l([ie.value, "group"]),
210
+ dir: s.direction
168
211
  }, [
169
- x(y(A, {
212
+ M(y(re, {
170
213
  direction: "left",
171
- color: I.value,
214
+ color: G.value,
172
215
  coverage: "100px",
173
216
  blur: "40px",
174
217
  easing: "smooth",
175
218
  tintOpacity: 1,
176
- class: l(["z-10 pointer-events-none", t.variant === "line" ? "" : "rounded-l-lg"])
219
+ class: l(["z-10 pointer-events-none", n.variant === "line" ? "" : "rounded-l-lg"])
177
220
  }, null, 8, ["color", "class"]), [
178
- [h, w.value]
221
+ [L, C.value]
179
222
  ]),
180
- x(f("div", {
181
- class: l(["left-0 pl-1", L.value])
223
+ M(c("div", {
224
+ class: l(["left-0 pl-1", N.value])
182
225
  }, [
183
- f("button", {
184
- onClick: a[0] || (a[0] = (r) => S(-200)),
226
+ c("button", {
227
+ onClick: r[0] || (r[0] = (t) => q(-200)),
185
228
  class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
186
229
  "aria-label": "Scroll left"
187
230
  }, [
188
- y(R, {
231
+ y(w, {
189
232
  icon: "lucide:chevron-left",
190
233
  class: "w-5 h-5"
191
234
  })
192
235
  ])
193
236
  ], 2), [
194
- [h, w.value]
237
+ [L, C.value]
195
238
  ]),
196
- f("div", {
239
+ c("div", {
197
240
  ref_key: "scrollRef",
198
- ref: i,
199
- class: "flex-1 min-w-0 max-w-full overflow-x-auto scrollbar-hide scroll-smooth",
200
- onScroll: o
241
+ ref: u,
242
+ class: "tabes-scroll flex-1 min-w-0 max-w-full overflow-x-auto scrollbar-hide scroll-smooth",
243
+ onScroll: se
201
244
  }, [
202
- f("div", {
245
+ c("div", {
203
246
  ref_key: "containerRef",
204
- ref: b,
205
- class: l([P.value, "tabes-container"]),
247
+ ref: k,
248
+ class: l([be.value, "tabes-container"]),
206
249
  role: "tablist",
207
- "data-variant": t.variant,
250
+ "data-variant": n.variant,
208
251
  "data-tabes": ""
209
252
  }, [
210
- c.modelValue !== void 0 && !c.wrap ? (m(), z("div", {
253
+ s.modelValue !== void 0 && !s.wrap ? (f(), $("div", {
211
254
  key: 0,
212
- class: l([q.value, G()]),
213
- style: ee(k.value)
214
- }, null, 6)) : j("", !0),
215
- (m(!0), z(te, null, re(c.options, (r) => (m(), M(ae(J(r)), ne({
216
- key: r.value,
217
- ref_for: !0,
218
- ref: (n) => O(n?.$el || n, r.value),
219
- role: "tab",
220
- "data-tabes-item": "",
221
- "aria-selected": c.modelValue === r.value,
222
- disabled: r.disabled,
223
- class: [F(r), W[t.size]]
224
- }, { ref_for: !0 }, K(r), {
225
- onClick: (n) => N(r)
226
- }), {
227
- default: oe(() => [
228
- r.icon ? (m(), M(R, {
229
- key: 0,
230
- icon: r.icon,
231
- class: l(c.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
232
- }, null, 8, ["icon", "class"])) : j("", !0),
233
- f("span", {
234
- class: l(["whitespace-nowrap z-20 relative", c.textClass])
235
- }, se(H(r)), 3)
236
- ]),
237
- _: 2
238
- }, 1040, ["aria-selected", "disabled", "class", "onClick"]))), 128))
239
- ], 10, ce)
255
+ class: l(["tabes-marker", [he.value, pe()]]),
256
+ style: Se(b.value)
257
+ }, null, 6)) : E("", !0),
258
+ (f(!0), $(J, null, Be(s.options, (t) => (f(), $(J, {
259
+ key: t.value
260
+ }, [
261
+ X(ee)(t) ? (f(), A(Fe, {
262
+ key: 0,
263
+ options: t.menu,
264
+ selected: s.modelValue,
265
+ disabled: t.disabled,
266
+ direction: ve(t),
267
+ position: t.dropdown?.position,
268
+ offset: t.dropdown?.offset ?? [0, 8],
269
+ searchable: t.dropdown?.searchable ?? !1,
270
+ "close-on-select": t.dropdown?.closeOnSelect ?? !0,
271
+ "max-height": t.dropdown?.maxHeight ?? "300px",
272
+ "min-width": t.dropdown?.minWidth ?? "160px",
273
+ width: t.dropdown?.width,
274
+ "menu-id": t.dropdown?.menuId ?? `tabes-menu-${t.value}`,
275
+ teleport: t.dropdown?.teleport ?? !0,
276
+ "show-selected-label": !1,
277
+ "show-selected-icon": !1,
278
+ "toggle-selection": !1,
279
+ selectable: !0,
280
+ class: l(["tabes-menu", "inline-flex!", me.value]),
281
+ onOnSelect: (a) => ue(t, a),
282
+ onOnOpen: () => de(t),
283
+ onOnClose: () => fe(t)
284
+ }, {
285
+ trigger: Y(({ isOpen: a }) => [
286
+ c("button", {
287
+ ref_for: !0,
288
+ ref: (o) => W(o, t.value),
289
+ type: "button",
290
+ role: "tab",
291
+ "data-tabes-item": "",
292
+ "data-tabes-menu-trigger": "",
293
+ "aria-selected": X(te)(t, s.modelValue),
294
+ "aria-haspopup": !0,
295
+ "aria-expanded": a,
296
+ disabled: t.disabled,
297
+ class: l([Q(t), K[n.size], "w-full"])
298
+ }, [
299
+ t.icon ? (f(), A(w, {
300
+ key: 0,
301
+ icon: t.icon,
302
+ class: l(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
303
+ }, null, 8, ["icon", "class"])) : E("", !0),
304
+ c("span", {
305
+ class: l(["whitespace-nowrap z-20 relative", s.textClass])
306
+ }, Z(U(t)), 3),
307
+ y(w, {
308
+ icon: "lucide:chevron-down",
309
+ class: l(we(a)),
310
+ "aria-hidden": "true"
311
+ }, null, 8, ["class"])
312
+ ], 10, je)
313
+ ]),
314
+ _: 2
315
+ }, 1032, ["options", "selected", "disabled", "direction", "position", "offset", "searchable", "close-on-select", "max-height", "min-width", "width", "menu-id", "teleport", "class", "onOnSelect", "onOnOpen", "onOnClose"])) : $e([t, s.modelValue === t.value, s.size, s.variant, s.block, s.wrap, s.tabClass, s.textClass], () => (f(), A(Me(xe(t)), Le({
316
+ key: 1,
317
+ ref_for: !0,
318
+ ref: (a) => W(a, t.value),
319
+ role: "tab",
320
+ "data-tabes-item": "",
321
+ "aria-selected": s.modelValue === t.value,
322
+ disabled: t.disabled,
323
+ class: [Q(t), K[n.size]]
324
+ }, { ref_for: !0 }, ye(t), {
325
+ onClick: (a) => ce(t)
326
+ }), {
327
+ default: Y(() => [
328
+ t.icon ? (f(), A(w, {
329
+ key: 0,
330
+ icon: t.icon,
331
+ class: l(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
332
+ }, null, 8, ["icon", "class"])) : E("", !0),
333
+ c("span", {
334
+ class: l(["whitespace-nowrap z-20 relative", s.textClass])
335
+ }, Z(U(t)), 3)
336
+ ]),
337
+ _: 2
338
+ }, 1040, ["aria-selected", "disabled", "class", "onClick"])), r, 1)
339
+ ], 64))), 128))
340
+ ], 10, Te)
240
341
  ], 544),
241
- x(y(A, {
342
+ M(y(re, {
242
343
  direction: "right",
243
- color: I.value,
344
+ color: G.value,
244
345
  coverage: "100px",
245
346
  blur: "40",
246
347
  easing: "smooth",
247
348
  tintOpacity: 1,
248
- class: l(["z-10 pointer-events-none", t.variant === "line" ? "" : "rounded-r-lg"])
349
+ class: l(["z-10 pointer-events-none", n.variant === "line" ? "" : "rounded-r-lg"])
249
350
  }, null, 8, ["color", "class"]), [
250
- [h, C.value]
351
+ [L, V.value]
251
352
  ]),
252
- x(f("div", {
253
- class: l(["right-0 pr-1", L.value])
353
+ M(c("div", {
354
+ class: l(["right-0 pr-1", N.value])
254
355
  }, [
255
- f("button", {
256
- onClick: a[1] || (a[1] = (r) => S(200)),
356
+ c("button", {
357
+ onClick: r[2] || (r[2] = (t) => q(200)),
257
358
  class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
258
359
  "aria-label": "Scroll right"
259
360
  }, [
260
- y(R, {
361
+ y(w, {
261
362
  icon: "lucide:chevron-right",
262
363
  class: "w-5 h-5"
263
364
  })
264
365
  ])
265
366
  ], 2), [
266
- [h, C.value]
367
+ [L, V.value]
267
368
  ])
268
- ], 2));
369
+ ], 10, Ee));
269
370
  }
270
371
  });
271
372
  export {
272
- me as default
373
+ Qe as default
273
374
  };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Local-coordinate geometry helpers for the Tabes active marker.
3
+ *
4
+ * Ancestor CSS transforms (e.g. ScaleGenerator's `transform: scale(...)`)
5
+ * affect `getBoundingClientRect()` but not layout sizes (`offsetWidth`).
6
+ * Feeding visual rect sizes into local CSS `width` / `translate` would
7
+ * double-apply the scale. These helpers normalize measurements into the
8
+ * container's own CSS pixel space.
9
+ */
10
+ export interface TabesMarkerGeometry {
11
+ width: number;
12
+ height: number;
13
+ left: number;
14
+ top: number;
15
+ }
16
+ /**
17
+ * Returns the horizontal transform scale currently applied to `element`
18
+ * (visual width ÷ layout width). `1` when unscaled or zero-sized.
19
+ */
20
+ export declare const getTabesElementScaleX: (element: HTMLElement) => number;
21
+ /**
22
+ * Returns the vertical transform scale currently applied to `element`.
23
+ */
24
+ export declare const getTabesElementScaleY: (element: HTMLElement) => number;
25
+ /**
26
+ * Measure active-tab marker geometry in `container`'s local CSS coordinates.
27
+ * Width/height use layout sizes; left/top normalize visual deltas by scale.
28
+ */
29
+ export declare const measureTabesMarkerGeometry: (container: HTMLElement, activeElement: HTMLElement) => TabesMarkerGeometry;
30
+ /**
31
+ * Convert a visual (viewport) horizontal delta into a local `scrollLeft` delta
32
+ * for `scrollContainer`, accounting for ancestor CSS scale transforms.
33
+ */
34
+ export declare const toTabesLocalScrollDelta: (scrollContainer: HTMLElement, visualDelta: number) => number;
@@ -0,0 +1,21 @@
1
+ const s = (t, e) => {
2
+ if (e <= 0) return 1;
3
+ const o = t / e;
4
+ return o > 1e-3 ? o : 1;
5
+ }, i = (t) => {
6
+ const e = t.getBoundingClientRect();
7
+ return s(e.width, t.offsetWidth);
8
+ }, r = (t, e) => {
9
+ const o = t.getBoundingClientRect(), c = e.getBoundingClientRect(), n = s(o.width, t.offsetWidth), f = s(o.height, t.offsetHeight);
10
+ return {
11
+ width: e.offsetWidth,
12
+ height: e.offsetHeight,
13
+ left: (c.left - o.left) / n,
14
+ top: (c.top - o.top) / f
15
+ };
16
+ }, h = (t, e) => e / i(t);
17
+ export {
18
+ i as getTabesElementScaleX,
19
+ r as measureTabesMarkerGeometry,
20
+ h as toTabesLocalScrollDelta
21
+ };
@@ -0,0 +1,14 @@
1
+ import { IDropdownOption } from '../../types';
2
+ import { TabesOption } from './types';
3
+ /** Whether the tab option is a dropdown menu trigger */
4
+ export declare function isMenuTab(option: TabesOption): boolean;
5
+ export declare function getMenuOptionValue(option: IDropdownOption): string | number | undefined;
6
+ /** Recursively check if a menu tree contains the given value */
7
+ export declare function menuContainsValue(menu: IDropdownOption[] | undefined, value: string | number): boolean;
8
+ /** Whether a tab (standard or menu parent) should appear active for the current modelValue */
9
+ export declare function isTabActive(option: TabesOption, modelValue: string | number): boolean;
10
+ /**
11
+ * Resolve which tab option value should own the animated marker.
12
+ * For menu tabs, returns the parent tab's value when a child is selected.
13
+ */
14
+ export declare function getActiveMarkerKey(options: TabesOption[], modelValue: string | number): string | number | undefined;