vlite3 1.4.40 → 1.5.0

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 (137) 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.vue.d.ts +2 -2
  29. package/components/CategoryManager/CategoryManager.vue2.js +18 -18
  30. package/components/CategoryManager/CategoryNode.vue.js +4 -4
  31. package/components/CategoryMenu/CategoryMenu.vue.js +3 -2
  32. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +3 -2
  33. package/components/Chat/ChatInterface.vue.js +23 -23
  34. package/components/Clipboard.vue.d.ts +7 -1
  35. package/components/Clipboard.vue.js +19 -17
  36. package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +22 -22
  37. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  38. package/components/ColorPicker/ColorPicker.vue.js +8 -8
  39. package/components/Comment/CommentEditor.vue.js +14 -14
  40. package/components/Comment/CommentItem.vue2.js +6 -6
  41. package/components/Comment/CommentThread.vue.js +4 -4
  42. package/components/DataList/DataList.vue.js +7 -7
  43. package/components/DataTable/DataTable.vue.d.ts +9 -1
  44. package/components/DataTable/DataTable.vue.js +374 -263
  45. package/components/DataTable/DataTableRow.vue.d.ts +23 -2
  46. package/components/DataTable/DataTableRow.vue.js +5 -198
  47. package/components/DataTable/DataTableRow.vue2.js +360 -2
  48. package/components/DataTable/dataTableHeaders.d.ts +18 -0
  49. package/components/DataTable/dataTableHeaders.js +9 -0
  50. package/components/DataTable/types.d.ts +6 -0
  51. package/components/DatePicker.vue.js +8 -9
  52. package/components/DateRangePicker.vue2.js +34 -34
  53. package/components/Dropdown/Dropdown.vue.d.ts +7 -2
  54. package/components/Dropdown/Dropdown.vue.js +146 -139
  55. package/components/Dropdown/DropdownTrigger.vue.js +6 -6
  56. package/components/ExportData/ExportData.vue.js +15 -15
  57. package/components/FilePicker/FilePickerDropzone.vue.js +16 -16
  58. package/components/FilePicker/FilePickerInput.vue.js +3 -2
  59. package/components/FilePicker/FilePreview.vue.js +3 -3
  60. package/components/FileTree/FileTree.vue.js +4 -4
  61. package/components/FileTree/FileTree.vue2.js +9 -9
  62. package/components/FileTree/FileTreeNode.vue.js +76 -72
  63. package/components/Footer/Variant1.vue.js +48 -48
  64. package/components/Footer/Variant2.vue.js +42 -42
  65. package/components/Form/AccordionView.vue.d.ts +1 -1
  66. package/components/Form/AccordionView.vue.js +2 -2
  67. package/components/Form/AccordionView.vue3.js +61 -57
  68. package/components/Form/Form.vue2.js +41 -41
  69. package/components/Form/TableRow.vue.d.ts +7 -0
  70. package/components/Form/TableRow.vue.js +187 -41
  71. package/components/Form/TableView.vue.d.ts +11 -1
  72. package/components/Form/TableView.vue.js +71 -49
  73. package/components/Form/composables/useForm.js +146 -142
  74. package/components/Form/index.vue.d.ts +5 -1
  75. package/components/Form/index.vue.js +2 -2
  76. package/components/Form/index.vue2.js +44 -37
  77. package/components/Form/rowHelpers.d.ts +20 -0
  78. package/components/Form/rowHelpers.js +76 -28
  79. package/components/Form/types.d.ts +11 -0
  80. package/components/GoogleLogin.vue.js +4 -4
  81. package/components/IconPicker.vue.js +9 -9
  82. package/components/ImportData/ImportData.vue.js +11 -11
  83. package/components/ImportData/ImportStep1.vue.js +10 -10
  84. package/components/ImportData/ImportStep2.vue.js +15 -14
  85. package/components/Input.vue.js +133 -129
  86. package/components/Kanban/KanbanBoard.vue.js +1 -1
  87. package/components/Kanban/KanbanBoard.vue2.js +9 -9
  88. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  89. package/components/Navbar/Navbar.vue.js +17 -17
  90. package/components/Navbar/NavbarGroup.vue.js +8 -7
  91. package/components/Navbar/NavbarItem.vue.js +40 -39
  92. package/components/Navbar/NavbarTabs.vue.js +6 -184
  93. package/components/Navbar/NavbarTabs.vue2.js +204 -0
  94. package/components/Navbar/useNavbar.js +3 -3
  95. package/components/NavbarCommandPalette.vue.js +1 -1
  96. package/components/NumberInput.vue.js +2 -2
  97. package/components/NumberInput.vue2.js +81 -77
  98. package/components/OTPInput/OTPInput.vue.js +24 -23
  99. package/components/Pagination/Pagination.vue.d.ts +1 -1
  100. package/components/Pagination/Pagination.vue.js +5 -274
  101. package/components/Pagination/Pagination.vue2.js +283 -2
  102. package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
  103. package/components/PricingPlan/PricingPlanItem.vue.js +7 -7
  104. package/components/Screen/Screen.vue.d.ts +1 -1
  105. package/components/Screen/Screen.vue.js +21 -21
  106. package/components/Screen/ScreenFilter.vue.js +5 -5
  107. package/components/Screen/components/ScreenAddAction.vue.js +3 -3
  108. package/components/Screen/components/ScreenEmptyState.vue.js +10 -10
  109. package/components/Screen/components/ScreenExportModal.vue.js +12 -12
  110. package/components/Screen/components/ScreenOptionsDropdown.vue.js +5 -5
  111. package/components/Screen/components/ScreenToolbar.vue.js +15 -15
  112. package/components/SidePanel.vue.js +2 -2
  113. package/components/SidePanel.vue2.js +6 -6
  114. package/components/SidebarMenu/SidebarMenu.vue.js +77 -72
  115. package/components/SidebarMenu/SidebarMenuItem.vue.js +172 -168
  116. package/components/Slider.vue.js +123 -108
  117. package/components/Tabes/Tabes.vue.d.ts +25 -4
  118. package/components/Tabes/Tabes.vue.js +3 -3
  119. package/components/Tabes/Tabes.vue2.js +274 -211
  120. package/components/Tabes/tabes.utils.d.ts +30 -0
  121. package/components/Tabes/tabes.utils.js +49 -18
  122. package/components/Tabes/types.d.ts +7 -0
  123. package/components/Textarea.vue.d.ts +2 -0
  124. package/components/Textarea.vue.js +19 -16
  125. package/components/ThemeToggle.vue.js +8 -8
  126. package/components/ToastNotification.vue2.js +10 -10
  127. package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
  128. package/components/TreeConnectors/TreeConnectors.vue.js +13 -8
  129. package/components/TreeConnectors/geometry.js +77 -69
  130. package/components/Workbook/WorkbookAddButton.vue.js +2 -2
  131. package/composables/useRtl.d.ts +14 -0
  132. package/composables/useRtl.js +33 -0
  133. package/index.js +470 -471
  134. package/package.json +5 -4
  135. package/style.css +86 -1
  136. package/types/button.d.ts +8 -0
  137. package/components/Navbar/NavbarTabs.vue3.js +0 -5
@@ -21,6 +21,11 @@ interface Props {
21
21
  treeLoading?: boolean;
22
22
  isLastSibling?: boolean;
23
23
  ancestorLastFlags?: boolean[];
24
+ /**
25
+ * Small-screen card layout (driven by DataTable `responsive` + breakpoint).
26
+ * Skips tree connector overlays; keeps expand + indent on the primary cell.
27
+ */
28
+ stacked?: boolean;
24
29
  }
25
30
  declare function __VLS_template(): {
26
31
  attrs: Partial<{}>;
@@ -29,9 +34,24 @@ declare function __VLS_template(): {
29
34
  row: any;
30
35
  index: number;
31
36
  field: string;
37
+ }) => any>> & Partial<Record<string, (_: {
38
+ value: any;
39
+ row: any;
40
+ index: number;
41
+ field: string;
42
+ }) => any>> & Partial<Record<string, (_: {
43
+ value: any;
44
+ row: any;
45
+ index: number;
46
+ field: string;
47
+ }) => any>> & Partial<Record<string, (_: {
48
+ value: any;
49
+ row: any;
50
+ index: number;
51
+ field: string;
32
52
  }) => any>>;
33
53
  refs: {};
34
- rootEl: HTMLTableRowElement;
54
+ rootEl: any;
35
55
  };
36
56
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
37
57
  declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -52,6 +72,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
52
72
  size: "xs" | "sm" | "md" | "lg";
53
73
  compact: boolean;
54
74
  striped: boolean;
75
+ stacked: boolean;
55
76
  selectable: boolean;
56
77
  isSelected: boolean;
57
78
  depth: number;
@@ -65,7 +86,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
65
86
  expandable: boolean;
66
87
  expanded: boolean;
67
88
  treeLoading: boolean;
68
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLTableRowElement>;
89
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
69
90
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
70
91
  export default _default;
71
92
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,200 +1,7 @@
1
- import { defineComponent as D, computed as g, openBlock as o, createElementBlock as d, normalizeClass as x, withModifiers as I, createElementVNode as b, createVNode as v, createCommentVNode as w, Fragment as p, renderList as U, normalizeStyle as y, unref as c, createBlock as u, renderSlot as V } from "vue";
2
- import R from "../CheckBox.vue.js";
3
- import h from "../Icon.vue.js";
4
- import G from "../Price/Price.vue.js";
5
- import P from "../DateTime/DateTime.vue.js";
6
- import O from "../TreeConnectors/TreeConnectors.vue.js";
7
- import { DEFAULT_TOGGLE_SIZE as H, DEFAULT_TREE_CONTENT_GAP as k, DEFAULT_TREE_LEAF_INSET as E, DEFAULT_TREE_LEADING as j } from "../TreeConnectors/geometry.js";
8
- const Z = ["data-state"], q = { class: "flex items-center justify-center" }, J = ["aria-expanded"], K = ["title", "innerHTML"], le = /* @__PURE__ */ D({
9
- __name: "DataTableRow",
10
- props: {
11
- row: {},
12
- headers: {},
13
- index: {},
14
- keyField: { default: "_id" },
15
- selectable: { type: Boolean, default: !1 },
16
- isSelected: { type: Boolean, default: !1 },
17
- isIndeterminate: { type: Boolean, default: !1 },
18
- hoverable: { type: Boolean, default: !0 },
19
- striped: { type: Boolean, default: !1 },
20
- compact: { type: Boolean, default: !1 },
21
- size: { default: "md" },
22
- cellBordered: { type: Boolean },
23
- treeMode: { type: Boolean, default: !1 },
24
- depth: { default: 0 },
25
- treeIndent: { default: 20 },
26
- expandable: { type: Boolean, default: !1 },
27
- expanded: { type: Boolean, default: !1 },
28
- treeLoading: { type: Boolean, default: !1 },
29
- isLastSibling: { type: Boolean, default: !1 },
30
- ancestorLastFlags: { default: () => [] }
31
- },
32
- emits: ["select", "rowClick", "toggleExpand"],
33
- setup(e, { emit: C }) {
34
- const s = e, f = C, a = (n, l) => {
35
- if (!(!n || !l))
36
- return l.includes(".") ? l.split(".").reduce((t, i) => t?.[i], n) : n[l];
37
- }, S = (n, l, t) => n.format ? n.format(l, t) : l == null ? "-" : n.type === "number" ? new Intl.NumberFormat("en-US").format(Number(l)) : String(l), L = (n, l, t) => {
38
- const i = [];
39
- if (n.width && /(?:^|\s|:)w-/.test(n.width) && i.push(n.width), n.minWidth && /(?:^|\s|:)min-w-/.test(n.minWidth) && i.push(n.minWidth), n.capitalize && i.push("capitalize"), n.addStatusColor) {
40
- const r = B(l);
41
- r && i.push(r);
42
- }
43
- if (typeof n.class == "function") {
44
- const r = n.class(l, t);
45
- r && i.push(r);
46
- } else n.class && i.push(n.class);
47
- return i.join(" ");
48
- }, B = (n) => {
49
- const l = {
50
- active: "text-success font-medium",
51
- inactive: "text-muted-foreground",
52
- pending: "text-warning font-medium",
53
- completed: "text-success font-medium",
54
- cancelled: "text-destructive font-medium",
55
- failed: "text-destructive font-medium",
56
- success: "text-success font-medium",
57
- error: "text-destructive font-medium",
58
- warning: "text-warning font-medium",
59
- info: "text-info font-medium",
60
- high: "text-destructive font-medium",
61
- medium: "text-warning font-medium",
62
- low: "text-muted-foreground"
63
- }, t = String(n).toLowerCase().replace(/[-_\s]/g, "");
64
- return l[t] || "";
65
- }, T = (n) => ({
66
- left: "text-left",
67
- center: "text-center",
68
- right: "text-right"
69
- })[n.align || "left"], M = g(() => a(s.row, s.keyField)), F = () => {
70
- const { size: n, compact: l, cellBordered: t } = s;
71
- return n === "xs" || l ? `py-1.5! -text-fs-1.5! ${t ? "px-3!" : "pr-4 max-sm:pr-10!"}` : n === "sm" ? `py-2! -text-fs-1.5! ${t ? "px-3!" : "pr-5 max-sm:pr-10!"}` : n === "lg" ? `py-4! text-base ${t ? "px-4!" : "pr-7 max-sm:pr-12!"}` : `py-3! -text-fs-1.5! ${t ? "px-3.5!" : "pr-6! max-sm:pr-10!"}`;
72
- }, m = j, z = g(
73
- () => s.treeMode ? m + s.depth * s.treeIndent : 0
74
- ), N = g(() => {
75
- const n = m + s.depth * s.treeIndent;
76
- return s.expandable ? n + H + k : n + E;
77
- }), $ = () => {
78
- f("rowClick", { row: s.row, index: s.index });
79
- }, A = () => {
80
- f("select", M.value);
81
- }, W = (n) => {
82
- n.stopPropagation(), f("toggleExpand");
83
- };
84
- return (n, l) => (o(), d("tr", {
85
- class: x(["border-b data-[state=selected]:bg-muted h-full", [
86
- e.hoverable ? "hover:bg-muted/20" : "",
87
- e.striped && e.index % 2 === 1 ? "bg-muted/20" : "bg-background",
88
- e.isSelected ? "bg-muted! hover:bg-muted/30" : "",
89
- "group"
90
- ]]),
91
- "data-state": e.isSelected ? "selected" : void 0,
92
- onClick: $
93
- }, [
94
- e.selectable ? (o(), d("td", {
95
- key: 0,
96
- class: "px-0! py-1! align-middle text-center",
97
- onClick: l[0] || (l[0] = I(() => {
98
- }, ["stop"]))
99
- }, [
100
- b("div", q, [
101
- v(R, {
102
- "model-value": e.isSelected,
103
- indeterminate: e.isIndeterminate,
104
- size: "xs",
105
- "onUpdate:modelValue": A
106
- }, null, 8, ["model-value", "indeterminate"])
107
- ])
108
- ])) : w("", !0),
109
- (o(!0), d(p, null, U(e.headers, (t, i) => (o(), d("td", {
110
- key: t.field,
111
- class: x(["align-middle whitespace-normal wrap-break-word", [
112
- F(),
113
- T(t),
114
- t.hideOnMobile ? "hidden md:table-cell" : "",
115
- e.treeMode ? "max-w-none min-w-0" : "max-w-[400px]",
116
- // Keep overflow clip on data cells; last column (actions) must stay visible
117
- i === e.headers.length - 1 ? "overflow-visible" : "overflow-hidden",
118
- // Tree chrome overlays the whole first cell (incl. padding) so branch
119
- // lines join seamlessly across rows. overflow-visible lets the connector
120
- // overlay bleed across the collapsed row border for continuous trunks.
121
- e.treeMode && i === 0 ? "relative pl-0! overflow-visible!" : "",
122
- L(t, a(e.row, t.field), e.row)
123
- ]]),
124
- style: y(
125
- e.treeMode ? void 0 : {
126
- ...t.width && !/(?:^|\s|:)w-/.test(t.width) ? { width: t.width } : {},
127
- ...t.minWidth && !/(?:^|\s|:)min-w-/.test(t.minWidth) ? { minWidth: t.minWidth } : {}
128
- }
129
- )
130
- }, [
131
- e.treeMode && i === 0 ? (o(), d(p, { key: 0 }, [
132
- v(c(O), {
133
- depth: e.depth,
134
- "is-last-sibling": e.isLastSibling,
135
- "ancestor-last-flags": e.ancestorLastFlags,
136
- "has-toggle": e.expandable,
137
- indent: e.treeIndent,
138
- "base-inset": c(m),
139
- "content-gap": c(k),
140
- "leaf-has-spacer": !1,
141
- "leaf-inset": c(E),
142
- "bleed-y": ""
143
- }, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle", "indent", "base-inset", "content-gap", "leaf-inset"]),
144
- e.expandable ? (o(), d("button", {
145
- key: 0,
146
- type: "button",
147
- class: "absolute z-10 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus:outline-none",
148
- style: y({ left: z.value + "px" }),
149
- "aria-expanded": e.expanded,
150
- onClick: W
151
- }, [
152
- e.treeLoading ? (o(), u(h, {
153
- key: 0,
154
- icon: "lucide:loader-2",
155
- class: "h-4 w-4 animate-spin"
156
- })) : (o(), u(h, {
157
- key: 1,
158
- icon: e.expanded ? "lucide:chevron-down" : "lucide:chevron-right",
159
- class: "h-4 w-4"
160
- }, null, 8, ["icon"]))
161
- ], 12, J)) : w("", !0)
162
- ], 64)) : w("", !0),
163
- b("div", {
164
- class: x([
165
- "w-full min-w-0",
166
- e.treeMode && i === 0 ? "relative flex items-center min-h-[28px] max-h-[80px] overflow-y-auto scrollbar-hide" : i === e.headers.length - 1 ? "overflow-visible" : "max-h-[80px] overflow-y-auto scrollbar-hide"
167
- ]),
168
- style: y(e.treeMode && i === 0 ? { paddingLeft: N.value + "px" } : void 0)
169
- }, [
170
- V(n.$slots, t.field, {
171
- value: a(e.row, t.field),
172
- row: e.row,
173
- index: e.index,
174
- field: t.field
175
- }, () => [
176
- t.type === "price" ? (o(), u(G, {
177
- key: 0,
178
- value: a(e.row, t.field),
179
- class: "block",
180
- title: String(a(e.row, t.field))
181
- }, null, 8, ["value", "title"])) : t.type === "date" ? (o(), u(P, {
182
- key: 1,
183
- value: a(e.row, t.field),
184
- class: "block",
185
- title: String(a(e.row, t.field))
186
- }, null, 8, ["value", "title"])) : (o(), d("span", {
187
- key: 2,
188
- class: "block",
189
- title: String(a(e.row, t.field)),
190
- innerHTML: S(t, a(e.row, t.field), e.row)
191
- }, null, 8, K))
192
- ])
193
- ], 6)
194
- ], 6))), 128))
195
- ], 10, Z));
196
- }
197
- });
1
+ import o from "./DataTableRow.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-af551256"]]);
198
5
  export {
199
- le as default
6
+ m as default
200
7
  };
@@ -1,4 +1,362 @@
1
- import f from "./DataTableRow.vue.js";
1
+ import { defineComponent as q, computed as w, openBlock as i, createElementBlock as o, normalizeStyle as k, normalizeClass as m, createElementVNode as g, withModifiers as x, createVNode as B, createCommentVNode as c, createBlock as u, renderSlot as S, Fragment as C, renderList as $, toDisplayString as J, unref as H } from "vue";
2
+ import j from "../CheckBox.vue.js";
3
+ import L from "../Icon.vue.js";
4
+ import z from "../Price/Price.vue.js";
5
+ import I from "../DateTime/DateTime.vue.js";
6
+ import K from "../TreeConnectors/TreeConnectors.vue.js";
7
+ import { DEFAULT_TOGGLE_SIZE as Q, DEFAULT_TREE_CONTENT_GAP as A, DEFAULT_TREE_LEAF_INSET as R, DEFAULT_TREE_LEADING as X } from "../TreeConnectors/geometry.js";
8
+ import { $t as Y } from "../../utils/i18n.js";
9
+ import { useRtl as _ } from "../../composables/useRtl.js";
10
+ import { splitStackedHeaders as ee } from "./dataTableHeaders.js";
11
+ const te = ["data-state"], le = ["aria-expanded"], ie = ["title", "innerHTML"], ne = {
12
+ key: 0,
13
+ class: "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground shrink-0 pt-0.5 max-w-[40%]"
14
+ }, ae = ["title", "innerHTML"], oe = ["innerHTML"], de = ["data-state"], se = { class: "flex items-center justify-center" }, re = ["onClick"], ue = ["aria-expanded"], ce = ["title", "innerHTML"], Ce = /* @__PURE__ */ q({
15
+ __name: "DataTableRow",
16
+ props: {
17
+ row: {},
18
+ headers: {},
19
+ index: {},
20
+ keyField: { default: "_id" },
21
+ selectable: { type: Boolean, default: !1 },
22
+ isSelected: { type: Boolean, default: !1 },
23
+ isIndeterminate: { type: Boolean, default: !1 },
24
+ hoverable: { type: Boolean, default: !0 },
25
+ striped: { type: Boolean, default: !1 },
26
+ compact: { type: Boolean, default: !1 },
27
+ size: { default: "md" },
28
+ cellBordered: { type: Boolean },
29
+ treeMode: { type: Boolean, default: !1 },
30
+ depth: { default: 0 },
31
+ treeIndent: { default: 20 },
32
+ expandable: { type: Boolean, default: !1 },
33
+ expanded: { type: Boolean, default: !1 },
34
+ treeLoading: { type: Boolean, default: !1 },
35
+ isLastSibling: { type: Boolean, default: !1 },
36
+ ancestorLastFlags: { default: () => [] },
37
+ stacked: { type: Boolean, default: !1 }
38
+ },
39
+ emits: ["select", "rowClick", "toggleExpand"],
40
+ setup(e, { emit: U }) {
41
+ const V = _(), r = e, M = U, n = (l, a) => {
42
+ if (!(!l || !a))
43
+ return a.includes(".") ? a.split(".").reduce((t, s) => t?.[s], l) : l[a];
44
+ }, y = (l, a, t) => l.format ? l.format(a, t) : a == null ? "-" : l.type === "number" ? new Intl.NumberFormat("en-US").format(Number(a)) : String(a), v = (l, a, t) => {
45
+ const s = [];
46
+ if (l.width && /(?:^|\s|:)w-/.test(l.width) && s.push(l.width), l.minWidth && /(?:^|\s|:)min-w-/.test(l.minWidth) && s.push(l.minWidth), l.capitalize && s.push("capitalize"), l.addStatusColor) {
47
+ const f = W(a);
48
+ f && s.push(f);
49
+ }
50
+ if (typeof l.class == "function") {
51
+ const f = l.class(a, t);
52
+ f && s.push(f);
53
+ } else l.class && s.push(l.class);
54
+ return s.join(" ");
55
+ }, W = (l) => {
56
+ const a = {
57
+ active: "text-success font-medium",
58
+ inactive: "text-muted-foreground",
59
+ pending: "text-warning font-medium",
60
+ completed: "text-success font-medium",
61
+ cancelled: "text-destructive font-medium",
62
+ failed: "text-destructive font-medium",
63
+ success: "text-success font-medium",
64
+ error: "text-destructive font-medium",
65
+ warning: "text-warning font-medium",
66
+ info: "text-info font-medium",
67
+ high: "text-destructive font-medium",
68
+ medium: "text-warning font-medium",
69
+ low: "text-muted-foreground"
70
+ }, t = String(l).toLowerCase().replace(/[-_\s]/g, "");
71
+ return a[t] || "";
72
+ }, G = (l) => ({
73
+ left: "text-left",
74
+ center: "text-center",
75
+ right: "text-right"
76
+ })[l.align || "left"], P = w(() => n(r.row, r.keyField)), d = w(() => ee(r.headers)), T = (l) => l.titleI18n ? Y(l.titleI18n) : l.title, p = () => {
77
+ const { size: l, compact: a, cellBordered: t } = r;
78
+ return l === "xs" || a ? `py-1.5! -text-fs-1.5! ${t ? "px-3!" : "pr-4 max-sm:pr-10!"}` : l === "sm" ? `py-2! -text-fs-1.5! ${t ? "px-3!" : "pr-5 max-sm:pr-10!"}` : l === "lg" ? `py-4! text-base ${t ? "px-4!" : "pr-7 max-sm:pr-12!"}` : `py-3! -text-fs-1.5! ${t ? "px-3.5!" : "pr-6! max-sm:pr-10!"}`;
79
+ }, E = X, O = w(
80
+ () => r.treeMode ? E + r.depth * r.treeIndent : 0
81
+ ), Z = w(() => {
82
+ const l = E + r.depth * r.treeIndent;
83
+ return r.expandable ? l + Q + A : l + R;
84
+ }), F = w(
85
+ () => r.treeMode ? r.depth * Math.min(r.treeIndent, 16) : 0
86
+ ), b = () => {
87
+ M("rowClick", { row: r.row, index: r.index });
88
+ }, N = () => {
89
+ M("select", P.value);
90
+ }, h = (l) => {
91
+ l?.stopPropagation(), l?.preventDefault(), M("toggleExpand");
92
+ }, D = w(
93
+ () => V.value ? "lucide:chevron-left" : "lucide:chevron-right"
94
+ );
95
+ return (l, a) => e.stacked ? (i(), o("div", {
96
+ key: 0,
97
+ class: m(["data-table-row--stacked border rounded-lg overflow-hidden min-w-0 bg-background", [
98
+ e.hoverable && !e.isSelected ? "hover:bg-muted/30" : "",
99
+ e.striped && e.index % 2 === 1 && !e.isSelected ? "bg-muted/20" : "",
100
+ // Selected: primary outline (Design.md active state) + soft muted wash — no faint ring.
101
+ e.isSelected ? "border-primary bg-muted" : "",
102
+ "group transition-colors"
103
+ ]]),
104
+ "data-state": e.isSelected ? "selected" : void 0,
105
+ style: k(F.value ? { marginInlineStart: F.value + "px" } : void 0),
106
+ onClick: b
107
+ }, [
108
+ g("div", {
109
+ class: "flex items-center gap-3 px-3 py-3 border-b min-w-0",
110
+ onClick: a[1] || (a[1] = x(() => {
111
+ }, ["stop"]))
112
+ }, [
113
+ e.selectable ? (i(), o("div", {
114
+ key: 0,
115
+ class: "shrink-0 self-center",
116
+ onClick: a[0] || (a[0] = x(() => {
117
+ }, ["stop"]))
118
+ }, [
119
+ B(j, {
120
+ "model-value": e.isSelected,
121
+ indeterminate: e.isIndeterminate,
122
+ size: "xs",
123
+ "onUpdate:modelValue": N
124
+ }, null, 8, ["model-value", "indeterminate"])
125
+ ])) : c("", !0),
126
+ e.treeMode && e.expandable ? (i(), o("button", {
127
+ key: 1,
128
+ type: "button",
129
+ class: "tree-expand-toggle shrink-0 flex h-7 w-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus:outline-none",
130
+ "aria-expanded": e.expanded,
131
+ onClick: h
132
+ }, [
133
+ e.treeLoading ? (i(), u(L, {
134
+ key: 0,
135
+ icon: "lucide:loader-2",
136
+ class: "h-4 w-4 animate-spin"
137
+ })) : (i(), u(L, {
138
+ key: 1,
139
+ icon: e.expanded ? "lucide:chevron-down" : D.value,
140
+ class: "h-4 w-4"
141
+ }, null, 8, ["icon"]))
142
+ ], 8, le)) : c("", !0),
143
+ d.value.primaryHeader ? (i(), o("div", {
144
+ key: 2,
145
+ class: m(["min-w-0 flex-1", v(d.value.primaryHeader, n(e.row, d.value.primaryHeader.field), e.row)]),
146
+ onClick: b
147
+ }, [
148
+ S(l.$slots, d.value.primaryHeader.field, {
149
+ value: n(e.row, d.value.primaryHeader.field),
150
+ row: e.row,
151
+ index: e.index,
152
+ field: d.value.primaryHeader.field
153
+ }, () => [
154
+ d.value.primaryHeader.type === "price" ? (i(), u(z, {
155
+ key: 0,
156
+ value: n(e.row, d.value.primaryHeader.field),
157
+ class: "block",
158
+ title: String(n(e.row, d.value.primaryHeader.field))
159
+ }, null, 8, ["value", "title"])) : d.value.primaryHeader.type === "date" ? (i(), u(I, {
160
+ key: 1,
161
+ value: n(e.row, d.value.primaryHeader.field),
162
+ class: "block",
163
+ title: String(n(e.row, d.value.primaryHeader.field))
164
+ }, null, 8, ["value", "title"])) : (i(), o("span", {
165
+ key: 2,
166
+ class: "block text-sm font-semibold truncate",
167
+ title: String(n(e.row, d.value.primaryHeader.field)),
168
+ innerHTML: y(
169
+ d.value.primaryHeader,
170
+ n(e.row, d.value.primaryHeader.field),
171
+ e.row
172
+ )
173
+ }, null, 8, ie))
174
+ ], !0)
175
+ ], 2)) : c("", !0)
176
+ ]),
177
+ d.value.bodyHeaders.length ? (i(), o("div", {
178
+ key: 0,
179
+ class: "flex flex-col gap-2.5 px-3 py-3 min-w-0",
180
+ onClick: b
181
+ }, [
182
+ (i(!0), o(C, null, $(d.value.bodyHeaders, (t) => (i(), o("div", {
183
+ key: t.field,
184
+ class: "flex items-start justify-between gap-7 min-w-0"
185
+ }, [
186
+ T(t) ? (i(), o("span", ne, J(T(t)), 1)) : c("", !0),
187
+ g("div", {
188
+ class: m(["stacked-cell-value min-w-0 flex-1 text-sm text-right flex justify-end items-start", [
189
+ v(t, n(e.row, t.field), e.row),
190
+ T(t) ? "" : "w-full text-left justify-start"
191
+ ]])
192
+ }, [
193
+ S(l.$slots, t.field, {
194
+ value: n(e.row, t.field),
195
+ row: e.row,
196
+ index: e.index,
197
+ field: t.field
198
+ }, () => [
199
+ t.type === "price" ? (i(), u(z, {
200
+ key: 0,
201
+ value: n(e.row, t.field),
202
+ class: "block",
203
+ title: String(n(e.row, t.field))
204
+ }, null, 8, ["value", "title"])) : t.type === "date" ? (i(), u(I, {
205
+ key: 1,
206
+ value: n(e.row, t.field),
207
+ class: "block",
208
+ title: String(n(e.row, t.field))
209
+ }, null, 8, ["value", "title"])) : (i(), o("span", {
210
+ key: 2,
211
+ class: "block",
212
+ title: String(n(e.row, t.field)),
213
+ innerHTML: y(t, n(e.row, t.field), e.row)
214
+ }, null, 8, ae))
215
+ ], !0)
216
+ ], 2)
217
+ ]))), 128))
218
+ ])) : c("", !0),
219
+ d.value.actionHeaders.length ? (i(), o("div", {
220
+ key: 1,
221
+ class: "flex items-center justify-end gap-1 flex-wrap px-2 py-2 border-t",
222
+ onClick: a[2] || (a[2] = x(() => {
223
+ }, ["stop"]))
224
+ }, [
225
+ (i(!0), o(C, null, $(d.value.actionHeaders, (t) => (i(), o("div", {
226
+ key: t.field,
227
+ class: m(["min-w-0 flex items-center justify-end gap-0.5", v(t, n(e.row, t.field), e.row)])
228
+ }, [
229
+ S(l.$slots, t.field, {
230
+ value: n(e.row, t.field),
231
+ row: e.row,
232
+ index: e.index,
233
+ field: t.field
234
+ }, () => [
235
+ g("span", {
236
+ class: "block",
237
+ innerHTML: y(t, n(e.row, t.field), e.row)
238
+ }, null, 8, oe)
239
+ ], !0)
240
+ ], 2))), 128))
241
+ ])) : c("", !0)
242
+ ], 14, te)) : (i(), o("tr", {
243
+ key: 1,
244
+ class: m(["border-b data-[state=selected]:bg-muted h-full", [
245
+ e.hoverable ? "hover:bg-muted/20" : "",
246
+ e.striped && e.index % 2 === 1 ? "bg-muted/20" : "bg-background",
247
+ e.isSelected ? "bg-muted! hover:bg-muted/30" : "",
248
+ "group"
249
+ ]]),
250
+ "data-state": e.isSelected ? "selected" : void 0,
251
+ onClick: b
252
+ }, [
253
+ e.selectable ? (i(), o("td", {
254
+ key: 0,
255
+ class: "px-0! py-1! align-middle text-center",
256
+ onClick: a[3] || (a[3] = x(() => {
257
+ }, ["stop"]))
258
+ }, [
259
+ g("div", se, [
260
+ B(j, {
261
+ "model-value": e.isSelected,
262
+ indeterminate: e.isIndeterminate,
263
+ size: "xs",
264
+ "onUpdate:modelValue": N
265
+ }, null, 8, ["model-value", "indeterminate"])
266
+ ])
267
+ ])) : c("", !0),
268
+ (i(!0), o(C, null, $(e.headers, (t, s) => (i(), o("td", {
269
+ key: t.field,
270
+ class: m(["align-middle whitespace-normal wrap-break-word", [
271
+ p(),
272
+ G(t),
273
+ t.hideOnMobile ? "hidden md:table-cell" : "",
274
+ e.treeMode ? "max-w-none min-w-0" : "max-w-[400px]",
275
+ // Keep overflow clip on data cells; last column (actions) must stay visible
276
+ s === e.headers.length - 1 ? "overflow-visible" : "overflow-hidden",
277
+ // Tree chrome overlays the whole first cell (incl. padding) so branch
278
+ // lines join seamlessly across rows. overflow-visible lets the connector
279
+ // overlay bleed across the collapsed row border for continuous trunks.
280
+ e.treeMode && s === 0 ? "relative ps-0! overflow-visible!" : "",
281
+ v(t, n(e.row, t.field), e.row)
282
+ ]]),
283
+ style: k(
284
+ e.treeMode ? void 0 : {
285
+ ...t.width && !/(?:^|\s|:)w-/.test(t.width) ? { width: t.width } : {},
286
+ ...t.minWidth && !/(?:^|\s|:)min-w-/.test(t.minWidth) ? { minWidth: t.minWidth } : {}
287
+ }
288
+ ),
289
+ onClick: (f) => e.treeMode && s === 0 && e.expandable ? h(f) : void 0
290
+ }, [
291
+ e.treeMode && s === 0 ? (i(), o(C, { key: 0 }, [
292
+ B(H(K), {
293
+ depth: e.depth,
294
+ "is-last-sibling": e.isLastSibling,
295
+ "ancestor-last-flags": e.ancestorLastFlags,
296
+ "has-toggle": e.expandable,
297
+ indent: e.treeIndent,
298
+ "base-inset": H(E),
299
+ "content-gap": H(A),
300
+ "leaf-has-spacer": !1,
301
+ "leaf-inset": H(R),
302
+ "bleed-y": ""
303
+ }, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle", "indent", "base-inset", "content-gap", "leaf-inset"]),
304
+ e.expandable ? (i(), o("button", {
305
+ key: 0,
306
+ type: "button",
307
+ class: "tree-expand-toggle absolute z-20 top-1/2 -translate-y-1/2 flex h-7 w-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus:outline-none",
308
+ style: k({ insetInlineStart: O.value + "px" }),
309
+ "aria-expanded": e.expanded,
310
+ onClick: x(h, ["stop"])
311
+ }, [
312
+ e.treeLoading ? (i(), u(L, {
313
+ key: 0,
314
+ icon: "lucide:loader-2",
315
+ class: "h-4 w-4 animate-spin"
316
+ })) : (i(), u(L, {
317
+ key: 1,
318
+ icon: e.expanded ? "lucide:chevron-down" : D.value,
319
+ class: "h-4 w-4"
320
+ }, null, 8, ["icon"]))
321
+ ], 12, ue)) : c("", !0)
322
+ ], 64)) : c("", !0),
323
+ g("div", {
324
+ class: m([
325
+ "tree-row-content w-full min-w-0",
326
+ e.treeMode && s === 0 ? "relative z-10 flex items-center min-h-[28px] max-h-[80px] overflow-y-auto scrollbar-hide" : s === e.headers.length - 1 ? "overflow-visible" : "max-h-[80px] overflow-y-auto scrollbar-hide"
327
+ ]),
328
+ style: k(
329
+ e.treeMode && s === 0 ? { paddingInlineStart: Z.value + "px" } : void 0
330
+ )
331
+ }, [
332
+ S(l.$slots, t.field, {
333
+ value: n(e.row, t.field),
334
+ row: e.row,
335
+ index: e.index,
336
+ field: t.field
337
+ }, () => [
338
+ t.type === "price" ? (i(), u(z, {
339
+ key: 0,
340
+ value: n(e.row, t.field),
341
+ class: "block",
342
+ title: String(n(e.row, t.field))
343
+ }, null, 8, ["value", "title"])) : t.type === "date" ? (i(), u(I, {
344
+ key: 1,
345
+ value: n(e.row, t.field),
346
+ class: "block",
347
+ title: String(n(e.row, t.field))
348
+ }, null, 8, ["value", "title"])) : (i(), o("span", {
349
+ key: 2,
350
+ class: "block",
351
+ title: String(n(e.row, t.field)),
352
+ innerHTML: y(t, n(e.row, t.field), e.row)
353
+ }, null, 8, ce))
354
+ ], !0)
355
+ ], 6)
356
+ ], 14, re))), 128))
357
+ ], 10, de));
358
+ }
359
+ });
2
360
  export {
3
- f as default
361
+ Ce as default
4
362
  };
@@ -0,0 +1,18 @@
1
+ import { TableHeader } from './types';
2
+ /** Action columns (`action` / `actions`) render in the stacked card footer. */
3
+ export declare const isActionHeader: (header: TableHeader) => boolean;
4
+ /** Headers visible in stacked (mobile) card mode. */
5
+ export declare const getStackedVisibleHeaders: (headers: TableHeader[]) => TableHeader[];
6
+ export interface StackedHeaderGroups {
7
+ primaryHeader: TableHeader | undefined;
8
+ bodyHeaders: TableHeader[];
9
+ actionHeaders: TableHeader[];
10
+ visible: TableHeader[];
11
+ }
12
+ /**
13
+ * Split headers for the stacked card layout:
14
+ * - primary: first non-action visible column (card toolbar)
15
+ * - body: remaining non-action columns (labeled rows)
16
+ * - action: action/actions columns (card footer)
17
+ */
18
+ export declare const splitStackedHeaders: (headers: TableHeader[]) => StackedHeaderGroups;
@@ -0,0 +1,9 @@
1
+ const i = (e) => /^actions?$/i.test(e.field), d = (e) => e.filter((t) => !t.hideOnMobile), n = (e) => {
2
+ const t = d(e), r = t.filter(i), s = t.filter((o) => !i(o)), a = s[0], c = s.slice(1);
3
+ return { primaryHeader: a, bodyHeaders: c, actionHeaders: r, visible: t };
4
+ };
5
+ export {
6
+ d as getStackedVisibleHeaders,
7
+ i as isActionHeader,
8
+ n as splitStackedHeaders
9
+ };
@@ -88,6 +88,12 @@ export interface DataTableProps {
88
88
  * @default 20
89
89
  */
90
90
  treeIndent?: number;
91
+ /**
92
+ * When `true` (default), viewports below the Tailwind `md` breakpoint render
93
+ * stacked labeled cards instead of the multi-column table.
94
+ * Set to `false` to keep the always-table + horizontal-scroll layout.
95
+ */
96
+ responsive?: boolean;
91
97
  }
92
98
  export interface SelectionState {
93
99
  selected: any[];