vlite3 1.4.39 → 1.4.41

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 (135) hide show
  1. package/components/AppShell/AppShellLayoutClassic.vue.js +27 -28
  2. package/components/AppShell/AppShellLayoutDashboard.vue.js +48 -48
  3. package/components/AppShell/AppShellLayoutDock.vue.js +51 -51
  4. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +69 -69
  5. package/components/AppShell/AppShellLayoutSidebarFirst.vue.d.ts +2 -2
  6. package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +78 -78
  7. package/components/AppShell/AppShellLayoutStorefront.vue.js +14 -15
  8. package/components/AppShell/useAppShell.d.ts +4 -0
  9. package/components/AppShell/useAppShell.js +45 -40
  10. package/components/AsyncSelect/createAsyncSelect.js +10 -10
  11. package/components/AttachmentsList/AttachmentsList.vue.d.ts +50 -2
  12. package/components/AttachmentsList/AttachmentsList.vue.js +289 -272
  13. package/components/AttachmentsList/types.d.ts +37 -0
  14. package/components/BackButton.vue.js +2 -2
  15. package/components/Button.vue.d.ts +1 -0
  16. package/components/Button.vue.js +5 -241
  17. package/components/Button.vue2.js +245 -2
  18. package/components/ButtonGroup.vue.js +2 -2
  19. package/components/ButtonGroup.vue2.js +4 -1
  20. package/components/Calendar/Calendar.vue2.js +16 -16
  21. package/components/Cart/CartCouponInput.vue.js +24 -24
  22. package/components/Cart/CartEmptyState.vue.js +4 -4
  23. package/components/Cart/CartLineItem.vue.js +33 -33
  24. package/components/Cart/CartVariant1.vue.js +3 -3
  25. package/components/Cart/CartVariant2.vue.js +5 -5
  26. package/components/Cart/CartVariant3.vue.js +25 -25
  27. package/components/Cart/CartVariant4.vue.js +9 -9
  28. package/components/CategoryManager/CategoryManager.vue2.js +18 -18
  29. package/components/CategoryManager/CategoryNode.vue.js +4 -4
  30. package/components/CategoryMenu/CategoryMenu.vue.js +3 -2
  31. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +3 -2
  32. package/components/Chat/ChatInterface.vue.js +23 -23
  33. package/components/Clipboard.vue.d.ts +7 -1
  34. package/components/Clipboard.vue.js +19 -17
  35. package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +22 -22
  36. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  37. package/components/ColorPicker/ColorPicker.vue.js +8 -8
  38. package/components/Comment/CommentEditor.vue.js +14 -14
  39. package/components/Comment/CommentItem.vue2.js +6 -6
  40. package/components/Comment/CommentThread.vue.js +4 -4
  41. package/components/DataList/DataList.vue.js +7 -7
  42. package/components/DataTable/DataTable.vue.d.ts +9 -0
  43. package/components/DataTable/DataTable.vue.js +380 -265
  44. package/components/DataTable/DataTableRow.vue.d.ts +23 -2
  45. package/components/DataTable/DataTableRow.vue.js +5 -198
  46. package/components/DataTable/DataTableRow.vue2.js +360 -2
  47. package/components/DataTable/dataTableHeaders.d.ts +18 -0
  48. package/components/DataTable/dataTableHeaders.js +9 -0
  49. package/components/DataTable/types.d.ts +11 -0
  50. package/components/DatePicker.vue.js +8 -9
  51. package/components/DateRangePicker.vue2.js +34 -34
  52. package/components/Dropdown/Dropdown.vue.d.ts +7 -2
  53. package/components/Dropdown/Dropdown.vue.js +146 -139
  54. package/components/Dropdown/DropdownTrigger.vue.js +6 -6
  55. package/components/ExportData/ExportData.vue.js +15 -15
  56. package/components/FilePicker/FilePickerDropzone.vue.js +16 -16
  57. package/components/FilePicker/FilePickerInput.vue.js +3 -2
  58. package/components/FilePicker/FilePreview.vue.js +3 -3
  59. package/components/FileTree/FileTree.vue.js +4 -4
  60. package/components/FileTree/FileTree.vue2.js +9 -9
  61. package/components/FileTree/FileTreeNode.vue.js +76 -72
  62. package/components/Footer/Variant1.vue.js +48 -48
  63. package/components/Footer/Variant2.vue.js +42 -42
  64. package/components/Form/AccordionView.vue.d.ts +1 -1
  65. package/components/Form/AccordionView.vue2.js +2 -2
  66. package/components/Form/AccordionView.vue3.js +61 -57
  67. package/components/Form/Form.vue2.js +41 -41
  68. package/components/Form/TableRow.vue.d.ts +7 -0
  69. package/components/Form/TableRow.vue.js +187 -41
  70. package/components/Form/TableView.vue.d.ts +11 -1
  71. package/components/Form/TableView.vue.js +71 -49
  72. package/components/Form/composables/useForm.js +146 -142
  73. package/components/Form/index.vue.d.ts +5 -1
  74. package/components/Form/index.vue.js +2 -2
  75. package/components/Form/index.vue2.js +44 -37
  76. package/components/Form/rowHelpers.d.ts +20 -0
  77. package/components/Form/rowHelpers.js +76 -28
  78. package/components/Form/types.d.ts +11 -0
  79. package/components/GoogleLogin.vue.js +4 -4
  80. package/components/IconPicker.vue.js +9 -9
  81. package/components/ImportData/ImportData.vue.js +11 -11
  82. package/components/ImportData/ImportStep1.vue.js +10 -10
  83. package/components/ImportData/ImportStep2.vue.js +15 -14
  84. package/components/Input.vue.js +133 -129
  85. package/components/Kanban/KanbanBoard.vue.js +1 -1
  86. package/components/Kanban/KanbanBoard.vue2.js +9 -9
  87. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  88. package/components/Navbar/Navbar.vue.js +17 -17
  89. package/components/Navbar/NavbarGroup.vue.js +8 -7
  90. package/components/Navbar/NavbarItem.vue.js +40 -39
  91. package/components/Navbar/NavbarTabs.vue.js +6 -184
  92. package/components/Navbar/NavbarTabs.vue2.js +204 -0
  93. package/components/Navbar/useNavbar.js +3 -3
  94. package/components/NavbarCommandPalette.vue.js +1 -1
  95. package/components/NumberInput.vue.js +2 -2
  96. package/components/NumberInput.vue2.js +81 -77
  97. package/components/OTPInput/OTPInput.vue.js +24 -23
  98. package/components/Pagination/Pagination.vue.d.ts +1 -1
  99. package/components/Pagination/Pagination.vue.js +5 -274
  100. package/components/Pagination/Pagination.vue2.js +283 -2
  101. package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
  102. package/components/PricingPlan/PricingPlanItem.vue.js +7 -7
  103. package/components/Screen/Screen.vue.d.ts +1 -1
  104. package/components/Screen/Screen.vue.js +21 -21
  105. package/components/Screen/ScreenFilter.vue.js +5 -5
  106. package/components/Screen/components/ScreenAddAction.vue.js +3 -3
  107. package/components/Screen/components/ScreenEmptyState.vue.js +10 -10
  108. package/components/Screen/components/ScreenExportModal.vue.js +12 -12
  109. package/components/Screen/components/ScreenOptionsDropdown.vue.js +5 -5
  110. package/components/Screen/components/ScreenToolbar.vue.js +15 -15
  111. package/components/SidePanel.vue.js +2 -2
  112. package/components/SidePanel.vue2.js +6 -6
  113. package/components/SidebarMenu/SidebarMenu.vue.js +77 -72
  114. package/components/SidebarMenu/SidebarMenuItem.vue.js +172 -168
  115. package/components/Slider.vue.js +123 -108
  116. package/components/Tabes/Tabes.vue.d.ts +8 -3
  117. package/components/Tabes/Tabes.vue.js +2 -2
  118. package/components/Tabes/Tabes.vue2.js +209 -200
  119. package/components/Tabes/tabes.utils.d.ts +23 -0
  120. package/components/Tabes/tabes.utils.js +39 -16
  121. package/components/Textarea.vue.d.ts +2 -0
  122. package/components/Textarea.vue.js +19 -16
  123. package/components/ThemeToggle.vue.js +8 -8
  124. package/components/ToastNotification.vue2.js +10 -10
  125. package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
  126. package/components/TreeConnectors/TreeConnectors.vue.js +13 -8
  127. package/components/TreeConnectors/geometry.js +77 -69
  128. package/components/Workbook/WorkbookAddButton.vue.js +2 -2
  129. package/composables/useRtl.d.ts +14 -0
  130. package/composables/useRtl.js +33 -0
  131. package/index.js +470 -471
  132. package/package.json +1 -1
  133. package/style.css +86 -1
  134. package/types/button.d.ts +8 -0
  135. package/components/Navbar/NavbarTabs.vue3.js +0 -5
@@ -1,26 +1,49 @@
1
- function t(e) {
2
- return Array.isArray(e.menu) && e.menu.length > 0;
1
+ function u(r) {
2
+ return Array.isArray(r.menu) && r.menu.length > 0;
3
3
  }
4
- function f(e) {
5
- return e.value !== void 0 && e.value !== null ? e.value : e.label;
4
+ function f(r) {
5
+ return r.value !== void 0 && r.value !== null ? r.value : r.label;
6
6
  }
7
- function u(e, r) {
8
- if (!e?.length) return !1;
9
- for (const n of e)
10
- if (f(n) === r || n.children?.length && u(n.children, r)) return !0;
7
+ function a(r, n) {
8
+ if (!r?.length) return !1;
9
+ for (const t of r)
10
+ if (f(t) === n || t.children?.length && a(t.children, n)) return !0;
11
11
  return !1;
12
12
  }
13
- function i(e, r) {
14
- return t(e) ? e.value === r || u(e.menu, r) : e.value === r;
13
+ function i(r, n) {
14
+ return u(r) ? r.value === n || a(r.menu, n) : r.value === n;
15
15
  }
16
- function a(e, r) {
17
- for (const n of e)
18
- if (i(n, r)) return n.value;
16
+ function o(r, n) {
17
+ for (const t of r)
18
+ if (i(t, n)) return t.value;
19
+ }
20
+ function s(r) {
21
+ return typeof window > "u" ? !1 : window.getComputedStyle(r).direction === "rtl";
22
+ }
23
+ function S(r, n) {
24
+ if (!r) return { canScrollStart: !1, canScrollEnd: !1 };
25
+ if (n && r.querySelector(n) === null)
26
+ return { canScrollStart: !1, canScrollEnd: !1 };
27
+ const { scrollLeft: t, scrollWidth: e, clientWidth: l } = r;
28
+ if (e - l <= 1)
29
+ return { canScrollStart: !1, canScrollEnd: !1 };
30
+ const c = Math.abs(t);
31
+ return {
32
+ canScrollStart: c > 1,
33
+ canScrollEnd: Math.ceil(c + l) < e - 1
34
+ };
35
+ }
36
+ function d(r, n, t) {
37
+ if (!r) return;
38
+ const e = n === "start" ? -1 : 1, l = (s(r) ? -e : e) * Math.abs(t);
39
+ r.scrollBy({ left: l, behavior: "smooth" });
19
40
  }
20
41
  export {
21
- a as getActiveMarkerKey,
42
+ o as getActiveMarkerKey,
22
43
  f as getMenuOptionValue,
23
- t as isMenuTab,
44
+ S as getTabesScrollOverflow,
45
+ u as isMenuTab,
24
46
  i as isTabActive,
25
- u as menuContainsValue
47
+ a as menuContainsValue,
48
+ d as scrollTabesStrip
26
49
  };
@@ -5,6 +5,8 @@ interface Props {
5
5
  disabled?: boolean;
6
6
  rows?: number;
7
7
  class?: string;
8
+ /** Explicit text direction; defaults to page dir so placeholders mirror under RTL. */
9
+ dir?: 'ltr' | 'rtl';
8
10
  }
9
11
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
10
12
  blur: (event: FocusEvent) => any;
@@ -1,6 +1,7 @@
1
- import { defineComponent as c, computed as r, openBlock as m, createElementBlock as p, normalizeClass as f } from "vue";
2
- import { resolveI18nText as b } from "../utils/i18n.js";
3
- const x = ["value", "rows", "disabled", "placeholder", "data-testid"], g = /* @__PURE__ */ c({
1
+ import { defineComponent as p, computed as d, openBlock as f, createElementBlock as b, normalizeClass as x } from "vue";
2
+ import { resolveI18nText as v } from "../utils/i18n.js";
3
+ import { useRtl as h } from "../composables/useRtl.js";
4
+ const g = ["value", "rows", "disabled", "placeholder", "dir", "data-testid"], y = /* @__PURE__ */ p({
4
5
  __name: "Textarea",
5
6
  props: {
6
7
  modelValue: { default: "" },
@@ -8,32 +9,34 @@ const x = ["value", "rows", "disabled", "placeholder", "data-testid"], g = /* @_
8
9
  placeholderI18n: {},
9
10
  disabled: { type: Boolean, default: !1 },
10
11
  rows: { default: 3 },
11
- class: { default: "" }
12
+ class: { default: "" },
13
+ dir: {}
12
14
  },
13
15
  emits: ["update:modelValue", "focus", "blur"],
14
16
  setup(l, { emit: s }) {
15
- const a = l, o = s, n = r(() => [
17
+ const a = l, o = s, n = h(), u = d(() => a.dir ?? (n.value ? "rtl" : "ltr")), i = d(() => [
16
18
  "flex min-h-[80px] w-full rounded-md border border-input px-3 py-2 text-sm placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
17
19
  a.class
18
- ].join(" ")), u = (t) => {
20
+ ].join(" ")), c = (t) => {
19
21
  const e = t.target;
20
22
  o("update:modelValue", e.value);
21
- }, i = r(
22
- () => b(a.placeholderI18n, a.placeholder)
23
+ }, m = d(
24
+ () => v(a.placeholderI18n, a.placeholder)
23
25
  );
24
- return (t, e) => (m(), p("textarea", {
26
+ return (t, e) => (f(), b("textarea", {
25
27
  value: l.modelValue,
26
28
  rows: l.rows,
27
29
  disabled: l.disabled,
28
- placeholder: i.value,
29
- class: f(n.value),
30
- onInput: u,
31
- onFocus: e[0] || (e[0] = (d) => o("focus", d)),
32
- onBlur: e[1] || (e[1] = (d) => o("blur", d)),
30
+ placeholder: m.value,
31
+ class: x(i.value),
32
+ dir: u.value,
33
+ onInput: c,
34
+ onFocus: e[0] || (e[0] = (r) => o("focus", r)),
35
+ onBlur: e[1] || (e[1] = (r) => o("blur", r)),
33
36
  "data-testid": t.$attrs["data-testid"] || (t.$attrs.name ? `textarea-${t.$attrs.name}` : "textarea")
34
- }, null, 42, x));
37
+ }, null, 42, g));
35
38
  }
36
39
  });
37
40
  export {
38
- g as default
41
+ y as default
39
42
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as m, computed as d, renderSlot as u, unref as o, createVNode as h, normalizeClass as g } from "vue";
1
+ import { defineComponent as m, computed as u, renderSlot as d, unref as o, createVNode as h, normalizeClass as g } from "vue";
2
2
  import { useTheme as f } from "../composables/useTheme.js";
3
3
  import T from "./Button.vue.js";
4
4
  import { $t as c } from "../utils/i18n.js";
@@ -11,18 +11,18 @@ const w = /* @__PURE__ */ m({
11
11
  variant: {}
12
12
  },
13
13
  setup(t) {
14
- const { theme: i, toggleTheme: s } = f(), a = d(() => {
15
- const n = i.value === "light", l = "vlite.themeToggle.switchToDark", r = "vlite.themeToggle.switchToLight";
14
+ const { theme: i, toggleTheme: r } = f(), a = u(() => {
15
+ const n = i.value === "light", l = "vlite.themeToggle.switchToDark", s = "vlite.themeToggle.switchToLight";
16
16
  if (n) {
17
17
  const e = c(l);
18
18
  return e !== l ? e : "Switch to dark mode";
19
19
  } else {
20
- const e = c(r);
21
- return e !== r ? e : "Switch to light mode";
20
+ const e = c(s);
21
+ return e !== s ? e : "Switch to light mode";
22
22
  }
23
23
  });
24
- return (n, l) => u(n.$slots, "default", {
25
- toggleTheme: o(s),
24
+ return (n, l) => d(n.$slots, "default", {
25
+ toggleTheme: o(r),
26
26
  theme: o(i)
27
27
  }, () => [
28
28
  h(T, {
@@ -32,7 +32,7 @@ const w = /* @__PURE__ */ m({
32
32
  size: t.size,
33
33
  class: g(t.class),
34
34
  title: a.value,
35
- onClick: o(s)
35
+ onClick: o(r)
36
36
  }, null, 8, ["icon", "variant", "rounded", "size", "class", "title", "onClick"])
37
37
  ]);
38
38
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, ref as Y, onUnmounted as F, openBlock as o, createElementBlock as i, createBlock as y, Teleport as U, Fragment as v, renderList as _, createElementVNode as m, normalizeClass as g, createVNode as w, TransitionGroup as q, withCtx as k, unref as H, isMemoSame as J, normalizeStyle as K, toDisplayString as p, createCommentVNode as T, createTextVNode as Q } from "vue";
1
+ import { defineComponent as P, ref as Y, onUnmounted as F, openBlock as o, createElementBlock as i, createBlock as y, Teleport as U, Fragment as v, renderList as w, createElementVNode as m, normalizeClass as g, createVNode as _, TransitionGroup as q, withCtx as k, unref as H, isMemoSame as J, normalizeStyle as K, toDisplayString as p, createCommentVNode as T, createTextVNode as Q } from "vue";
2
2
  import R from "./Icon.vue.js";
3
3
  import { useNotifications as W } from "../composables/useNotifications.js";
4
4
  import X from "./Button.vue.js";
@@ -15,14 +15,14 @@ const Z = {
15
15
  expand: { type: Boolean }
16
16
  },
17
17
  setup(oe) {
18
- const { notifications: z, removeToast: B, globalConfig: b, pauseTimers: $, resumeTimers: S } = W(), c = Y(!1), V = [
18
+ const { notifications: B, removeToast: z, globalConfig: b, pauseTimers: S, resumeTimers: V } = W(), c = Y(!1), $ = [
19
19
  "top-left",
20
20
  "top-center",
21
21
  "top-right",
22
22
  "bottom-left",
23
23
  "bottom-center",
24
24
  "bottom-right"
25
- ], d = (e) => z.value.filter((t) => t.position === e).slice().reverse(), N = {
25
+ ], d = (e) => B.value.filter((t) => t.position === e).slice().reverse(), N = {
26
26
  "top-left": "top-0 left-0 py-4",
27
27
  "top-center": "top-0 left-1/2 -translate-x-1/2 py-4",
28
28
  "top-right": "top-0 right-0 py-4",
@@ -54,7 +54,7 @@ const Z = {
54
54
  "--entrance-offset": e.includes("bottom") ? "25px" : "-25px",
55
55
  "--entrance-opacity": "0.6"
56
56
  }, M = (e) => {
57
- e.action && (e.action.onClick(), B(e.id));
57
+ e.action && (e.action.onClick(), z(e.id));
58
58
  }, h = {
59
59
  error: "lucide:octagon-x",
60
60
  success: "lucide:circle-check",
@@ -70,10 +70,10 @@ const Z = {
70
70
  }, D = (e) => x[e] || x.default;
71
71
  let n = null;
72
72
  const O = () => {
73
- n && (clearTimeout(n), n = null), c.value = !0, $();
73
+ n && (clearTimeout(n), n = null), c.value = !0, S();
74
74
  }, j = () => {
75
75
  n = setTimeout(() => {
76
- c.value = !1, S();
76
+ c.value = !1, V();
77
77
  }, 400);
78
78
  };
79
79
  F(() => {
@@ -85,7 +85,7 @@ const Z = {
85
85
  };
86
86
  return (e, s) => (o(), i("div", Z, [
87
87
  (o(), y(U, { to: "body" }, [
88
- (o(), i(v, null, _(V, (t) => m("div", {
88
+ (o(), i(v, null, w($, (t) => m("div", {
89
89
  key: t,
90
90
  class: g(["fixed z-[9999999999]! pointer-events-none px-4 flex flex-col gap-2 transition-all duration-300 max-w-full sm:max-w-120", [
91
91
  N[t],
@@ -97,7 +97,7 @@ const Z = {
97
97
  m("div", {
98
98
  class: g(["relative w-full transition-all", [{ "flex-col-reverse": t.includes("top") }]])
99
99
  }, [
100
- w(q, {
100
+ _(q, {
101
101
  name: d(t).length <= 1 ? "first-toast" : "stack-toast",
102
102
  tag: "div",
103
103
  class: g(["w-full grid grid-cols-1 grid-rows-1", [
@@ -106,7 +106,7 @@ const Z = {
106
106
  style: { "min-height": "20px" }
107
107
  }, {
108
108
  default: k(() => [
109
- (o(!0), i(v, null, _(d(t), (r, l, L, a) => {
109
+ (o(!0), i(v, null, w(d(t), (r, l, L, a) => {
110
110
  const u = [
111
111
  r,
112
112
  l,
@@ -130,7 +130,7 @@ const Z = {
130
130
  }
131
131
  ])
132
132
  }, [
133
- w(R, {
133
+ _(R, {
134
134
  icon: h[r.type] || h.default,
135
135
  class: "w-5 h-5 shrink-0 mt-0.5"
136
136
  }, null, 8, ["icon"]),
@@ -23,5 +23,5 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
23
23
  ancestorLastFlags: boolean[];
24
24
  lineClass: string;
25
25
  bleedY: boolean;
26
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
27
  export default _default;
@@ -1,4 +1,4 @@
1
- import { defineComponent as m, computed as u, openBlock as s, createElementBlock as l, normalizeClass as i, Fragment as c, renderList as f, isMemoSame as g, normalizeStyle as S } from "vue";
1
+ import { defineComponent as m, computed as u, openBlock as s, createElementBlock as o, normalizeClass as i, Fragment as c, renderList as f, isMemoSame as g, normalizeStyle as S } from "vue";
2
2
  import { EMPTY_ANCESTOR_LAST_FLAGS as b, buildTreeConnectorSegments as y } from "./geometry.js";
3
3
  const x = /* @__PURE__ */ m({
4
4
  __name: "TreeConnectors",
@@ -31,19 +31,24 @@ const x = /* @__PURE__ */ m({
31
31
  leafInset: e.leafInset
32
32
  })
33
33
  );
34
- return (L, d) => (s(), l("span", {
34
+ return (L, d) => (s(), o("span", {
35
35
  class: i(["tree-connectors pointer-events-none absolute inset-x-0", n.bleedY ? "-inset-y-px z-[1]" : "inset-y-0 overflow-hidden"]),
36
36
  "aria-hidden": "true"
37
37
  }, [
38
- (s(!0), l(c, null, f(p.value, (t, C, T, a) => {
39
- const o = [t, n.lineClass];
40
- if (a && a.key === t.key && g(a, o)) return a;
41
- const r = (s(), l("span", {
38
+ (s(!0), o(c, null, f(p.value, (t, C, T, a) => {
39
+ const l = [t, n.lineClass];
40
+ if (a && a.key === t.key && g(a, l)) return a;
41
+ const r = (s(), o("span", {
42
42
  key: t.key,
43
- class: i(["absolute", [t.orientation === "vertical" ? "w-px" : "h-px", n.lineClass]]),
43
+ class: i(["pointer-events-none absolute", [
44
+ // Vertical: 1px physical width. Horizontal: height only — length comes from
45
+ // logical `inlineSize` in segment style (grows toward inline-end / RTL-safe).
46
+ t.orientation === "vertical" ? "w-px" : "h-px",
47
+ n.lineClass
48
+ ]]),
44
49
  style: S(t.style)
45
50
  }, null, 6));
46
- return r.memo = o, r;
51
+ return r.memo = l, r;
47
52
  }, d, 0), 128))
48
53
  ], 2));
49
54
  }
@@ -1,137 +1,145 @@
1
- import { markRaw as c } from "vue";
2
- const I = 20, C = 20, w = 10, H = 10, O = 5, i = 0.5, N = 2, y = 5, G = 512;
3
- function R(n, e, o) {
4
- return n * e + o / 2;
1
+ import { markRaw as i } from "vue";
2
+ const C = 20, y = 20, O = 10, v = 10, w = 5, l = 0.5, m = 2, z = 5, G = 512;
3
+ function x(n, e, s) {
4
+ return n * e + s / 2;
5
5
  }
6
- const f = (n) => `${n}px`, k = Object.freeze([]), S = /* @__PURE__ */ new Map();
7
- function x(n) {
8
- if (!n.length) return k;
6
+ const E = (n) => `${n}px`, R = Object.freeze([]), N = /* @__PURE__ */ new Map();
7
+ function k(n) {
8
+ if (!n.length) return R;
9
9
  let e = "";
10
10
  for (let a = 0; a < n.length; a++)
11
11
  e += n[a] ? "1" : "0";
12
- const o = S.get(e);
13
- if (o) return o;
14
- const s = c(n.slice());
15
- return S.set(e, s), s;
12
+ const s = N.get(e);
13
+ if (s) return s;
14
+ const o = i(n.slice());
15
+ return N.set(e, o), o;
16
16
  }
17
- function v(n, e) {
18
- return x([...n, e]);
17
+ function U(n, e) {
18
+ return k([...n, e]);
19
19
  }
20
- const E = /* @__PURE__ */ new Map();
20
+ const h = /* @__PURE__ */ new Map();
21
21
  function D(n) {
22
22
  const {
23
23
  depth: e,
24
- isLastSibling: o,
25
- hasToggle: s,
24
+ isLastSibling: s,
25
+ hasToggle: o,
26
26
  indent: a,
27
27
  toggleSize: r,
28
- baseInset: h,
29
- contentGap: l,
28
+ baseInset: f,
29
+ contentGap: c,
30
30
  leafHasSpacer: g,
31
31
  leafInset: p,
32
32
  flagsKey: u
33
33
  } = n;
34
34
  return [
35
35
  e,
36
- o ? 1 : 0,
37
36
  s ? 1 : 0,
37
+ o ? 1 : 0,
38
38
  a,
39
39
  r,
40
- h,
41
- l,
40
+ f,
41
+ c,
42
42
  g ? 1 : 0,
43
43
  p,
44
44
  u
45
45
  ].join("|");
46
46
  }
47
47
  function M(n, e) {
48
- if (E.size >= G) {
49
- const s = E.keys().next().value;
50
- s !== void 0 && E.delete(s);
48
+ if (h.size >= G) {
49
+ const o = h.keys().next().value;
50
+ o !== void 0 && h.delete(o);
51
51
  }
52
- const o = c(e);
53
- return E.set(n, o), o;
52
+ const s = i(e);
53
+ return h.set(n, s), s;
54
54
  }
55
- function U(n) {
55
+ function $(n) {
56
56
  const {
57
57
  depth: e,
58
- isLastSibling: o,
59
- ancestorLastFlags: s,
58
+ isLastSibling: s,
59
+ ancestorLastFlags: o,
60
60
  hasToggle: a = !1,
61
- indent: r = I,
62
- toggleSize: h = C,
63
- baseInset: l = 0,
61
+ indent: r = C,
62
+ toggleSize: f = y,
63
+ baseInset: c = 0,
64
64
  contentGap: g = 0,
65
65
  leafHasSpacer: p = !0,
66
66
  leafInset: u = 0
67
67
  } = n;
68
68
  if (!Number.isFinite(e) || e < 0) return [];
69
- let b = "";
70
- for (let t = 0; t < s.length; t++)
71
- b += s[t] ? "1" : "0";
72
- const d = D({
69
+ let A = "";
70
+ for (let t = 0; t < o.length; t++)
71
+ A += o[t] ? "1" : "0";
72
+ const I = D({
73
73
  depth: e,
74
- isLastSibling: o,
74
+ isLastSibling: s,
75
75
  hasToggle: a,
76
76
  indent: r,
77
- toggleSize: h,
78
- baseInset: l,
77
+ toggleSize: f,
78
+ baseInset: c,
79
79
  contentGap: g,
80
80
  leafHasSpacer: p,
81
81
  leafInset: u,
82
- flagsKey: b
83
- }), m = E.get(d);
84
- if (m) return m;
85
- const T = [], _ = (t) => l + R(t, r, h);
82
+ flagsKey: A
83
+ }), b = h.get(I);
84
+ if (b) return b;
85
+ const T = [], _ = (t) => c + x(t, r, f);
86
86
  for (let t = 0; t <= e - 2; t++)
87
- s[t + 1] === !1 && T.push(
88
- c({
87
+ o[t + 1] === !1 && T.push(
88
+ i({
89
89
  key: `trunk-${t}`,
90
90
  orientation: "vertical",
91
91
  role: "trunk",
92
- style: c({ left: f(_(t) - i), top: "0", bottom: "0" })
92
+ // Logical inset so rails flip with `dir="rtl"` (inline-start = right in RTL).
93
+ style: i({
94
+ insetInlineStart: E(_(t) - l),
95
+ top: "0",
96
+ bottom: "0"
97
+ })
93
98
  })
94
99
  );
95
100
  if (e >= 1) {
96
101
  const t = _(e - 1);
97
102
  T.push(
98
- c({
103
+ i({
99
104
  key: `elbow-${e}`,
100
105
  orientation: "vertical",
101
106
  role: "elbow",
102
- style: c(
103
- o ? { left: f(t - i), top: "0", height: "50%" } : { left: f(t - i), top: "0", bottom: "0" }
107
+ style: i(
108
+ s ? { insetInlineStart: E(t - l), top: "0", height: "50%" } : { insetInlineStart: E(t - l), top: "0", bottom: "0" }
104
109
  )
105
110
  })
106
111
  );
107
- const A = l + e * r;
108
- let L;
109
- a ? L = A - N : p ? L = _(e) + g : L = A + u - N;
110
- const F = Math.max(t + y, L);
112
+ const L = c + e * r;
113
+ let S;
114
+ a ? S = L - m : p ? S = _(e) + g : S = L + u - m;
115
+ const F = Math.max(t + z, S), d = E(Math.max(0, F - t));
111
116
  T.push(
112
- c({
117
+ i({
113
118
  key: `branch-${e}`,
114
119
  orientation: "horizontal",
115
120
  role: "branch",
116
- style: c({
117
- left: f(t - i),
118
- top: `calc(50% - ${i}px)`,
119
- width: f(Math.max(0, F - t))
121
+ // Only logical inline sizing — physical `width` would grow to the right
122
+ // in RTL and point the branch the wrong way.
123
+ style: i({
124
+ insetInlineStart: E(t - l),
125
+ top: `calc(50% - ${l}px)`,
126
+ inlineSize: d,
127
+ maxInlineSize: d
120
128
  })
121
129
  })
122
130
  );
123
131
  }
124
- return M(d, T);
132
+ return M(I, T);
125
133
  }
126
134
  export {
127
- C as DEFAULT_TOGGLE_SIZE,
128
- H as DEFAULT_TREE_CONTENT_GAP,
129
- I as DEFAULT_TREE_INDENT,
130
- w as DEFAULT_TREE_LEADING,
131
- O as DEFAULT_TREE_LEAF_INSET,
132
- k as EMPTY_ANCESTOR_LAST_FLAGS,
133
- v as appendAncestorLastFlag,
134
- U as buildTreeConnectorSegments,
135
- R as railX,
136
- x as stabilizeAncestorLastFlags
135
+ y as DEFAULT_TOGGLE_SIZE,
136
+ v as DEFAULT_TREE_CONTENT_GAP,
137
+ C as DEFAULT_TREE_INDENT,
138
+ O as DEFAULT_TREE_LEADING,
139
+ w as DEFAULT_TREE_LEAF_INSET,
140
+ R as EMPTY_ANCESTOR_LAST_FLAGS,
141
+ U as appendAncestorLastFlag,
142
+ $ as buildTreeConnectorSegments,
143
+ x as railX,
144
+ k as stabilizeAncestorLastFlags
137
145
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as l, computed as c, openBlock as s, createBlock as d } from "vue";
1
+ import { defineComponent as l, computed as c, openBlock as d, createBlock as s } from "vue";
2
2
  import m from "../Button.vue.js";
3
3
  import { $t as u } from "../../utils/i18n.js";
4
4
  const _ = /* @__PURE__ */ l({
@@ -9,7 +9,7 @@ const _ = /* @__PURE__ */ l({
9
9
  const t = u("vlite.workbook.addSheet");
10
10
  return t !== "vlite.workbook.addSheet" ? t : "Add New Sheet";
11
11
  });
12
- return (t, e) => (s(), d(m, {
12
+ return (t, e) => (d(), s(m, {
13
13
  variant: "ghost",
14
14
  size: "md",
15
15
  icon: "lucide:plus",
@@ -0,0 +1,14 @@
1
+ import { Ref } from 'vue';
2
+ export type TextDirection = 'ltr' | 'rtl';
3
+ /**
4
+ * Nearest explicit `dir` on an ancestor of `el` (not including `el` itself).
5
+ * Falls back to `document.documentElement.dir`, then `'ltr'`.
6
+ * Used so widgets inside `dir="ltr"` islands (e.g. input addon groups) do not
7
+ * inherit page-level RTL via `direction: auto → html[dir]`.
8
+ */
9
+ export declare function resolveDirFromAncestors(el: HTMLElement | null | undefined): TextDirection;
10
+ /**
11
+ * Reactive `document.documentElement.dir === 'rtl'`.
12
+ * Used by tree UIs (DataTable / FileTree) for chevron direction and layout.
13
+ */
14
+ export declare function useRtl(): Readonly<Ref<boolean>>;
@@ -0,0 +1,33 @@
1
+ import { ref as r, onMounted as u, onUnmounted as o, readonly as l } from "vue";
2
+ function d(n) {
3
+ let e = n?.parentElement ?? null;
4
+ for (; e; ) {
5
+ const t = e.getAttribute("dir");
6
+ if (t === "ltr" || t === "rtl") return t;
7
+ e = e.parentElement;
8
+ }
9
+ return typeof document < "u" && document.documentElement.getAttribute("dir") === "rtl" ? "rtl" : "ltr";
10
+ }
11
+ function c() {
12
+ const n = r(!1);
13
+ let e = null;
14
+ const t = () => {
15
+ if (typeof document > "u") {
16
+ n.value = !1;
17
+ return;
18
+ }
19
+ n.value = document.documentElement.getAttribute("dir") === "rtl";
20
+ };
21
+ return u(() => {
22
+ t(), e = new MutationObserver(t), e.observe(document.documentElement, {
23
+ attributes: !0,
24
+ attributeFilter: ["dir"]
25
+ });
26
+ }), o(() => {
27
+ e?.disconnect(), e = null;
28
+ }), t(), l(n);
29
+ }
30
+ export {
31
+ d as resolveDirFromAncestors,
32
+ c as useRtl
33
+ };