laif-ds 0.2.23 → 0.2.25

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 (54) hide show
  1. package/dist/_virtual/index2.js +5 -2
  2. package/dist/_virtual/index3.js +2 -5
  3. package/dist/_virtual/index6.js +2 -2
  4. package/dist/_virtual/index7.js +2 -2
  5. package/dist/components/ui/alert-dialog.js +6 -6
  6. package/dist/components/ui/app-multiple-select-dropdown.js +34 -34
  7. package/dist/components/ui/app-select.js +127 -124
  8. package/dist/components/ui/badge.js +13 -12
  9. package/dist/components/ui/button.js +20 -18
  10. package/dist/components/ui/calendar.js +6 -6
  11. package/dist/components/ui/checkbox.js +9 -9
  12. package/dist/components/ui/confirmer.js +45 -19
  13. package/dist/components/ui/context-menu.js +4 -4
  14. package/dist/components/ui/date-picker.js +45 -36
  15. package/dist/components/ui/input-otp.js +16 -16
  16. package/dist/components/ui/input-selector.js +19 -19
  17. package/dist/components/ui/input.js +19 -19
  18. package/dist/components/ui/menubar.js +1 -1
  19. package/dist/components/ui/pagination.js +90 -77
  20. package/dist/components/ui/radio-group.js +14 -14
  21. package/dist/components/ui/select.js +27 -27
  22. package/dist/components/ui/switch.js +8 -6
  23. package/dist/components/ui/table.js +16 -16
  24. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +6 -6
  25. package/dist/components/ui/tables/data-table/components/data-table-actions.js +51 -0
  26. package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +470 -0
  27. package/dist/components/ui/tables/data-table/components/data-table-body.js +340 -0
  28. package/dist/components/ui/tables/data-table/components/data-table-column-visibility.js +274 -0
  29. package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +177 -0
  30. package/dist/components/ui/tables/data-table/components/data-table-filters.js +286 -0
  31. package/dist/components/ui/tables/data-table/components/data-table-pagination.js +131 -0
  32. package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +112 -0
  33. package/dist/components/ui/tables/data-table/components/data-table-simple-filters.js +263 -0
  34. package/dist/components/ui/tables/data-table/components/data-table-sorting.js +128 -0
  35. package/dist/components/ui/tables/data-table/data-table-constants.js +58 -0
  36. package/dist/components/ui/tables/data-table/data-table-i18n.js +138 -0
  37. package/dist/components/ui/tables/data-table/data-table.js +549 -0
  38. package/dist/components/ui/tables/data-table/data-table.service.js +254 -0
  39. package/dist/components/ui/tabs.js +33 -33
  40. package/dist/components/ui/textarea.js +11 -11
  41. package/dist/components/ui/tooltip.js +10 -10
  42. package/dist/css-for-template.css +57 -0
  43. package/dist/index.d.ts +249 -76
  44. package/dist/index.js +64 -64
  45. package/dist/node_modules/eventemitter3/index.js +1 -1
  46. package/dist/node_modules/eventemitter3/index2.js +1 -1
  47. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  48. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  49. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/styles.v3.css +1 -1
  52. package/package.json +5 -3
  53. package/dist/components/ui/data-table.js +0 -461
  54. package/dist/components/ui/data-table.service.js +0 -62
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- import { cn as a } from "../../lib/utils.js";
4
- function d({ className: e, ...t }) {
3
+ import { cn as o } from "../../lib/utils.js";
4
+ function l({ className: e, ...t }) {
5
5
  return /* @__PURE__ */ r(
6
6
  "table",
7
7
  {
8
8
  "data-slot": "table-container",
9
- className: a(
9
+ className: o(
10
10
  "relative w-full caption-bottom overflow-x-auto text-sm",
11
11
  e
12
12
  ),
@@ -14,22 +14,22 @@ function d({ className: e, ...t }) {
14
14
  }
15
15
  );
16
16
  }
17
- function n({ className: e, ...t }) {
17
+ function b({ className: e, ...t }) {
18
18
  return /* @__PURE__ */ r(
19
19
  "thead",
20
20
  {
21
21
  "data-slot": "table-header",
22
- className: a("border-d-border [&_tr]:border-b", e),
22
+ className: o("border-d-border [&_tr]:border-b", e),
23
23
  ...t
24
24
  }
25
25
  );
26
26
  }
27
- function b({ className: e, ...t }) {
27
+ function n({ className: e, ...t }) {
28
28
  return /* @__PURE__ */ r(
29
29
  "tbody",
30
30
  {
31
31
  "data-slot": "table-body",
32
- className: a("border-d-border [&_tr:last-child]:border-0", e),
32
+ className: o("border-d-border [&_tr:last-child]:border-0", e),
33
33
  ...t
34
34
  }
35
35
  );
@@ -39,7 +39,7 @@ function s({ className: e, ...t }) {
39
39
  "tfoot",
40
40
  {
41
41
  "data-slot": "table-footer",
42
- className: a(
42
+ className: o(
43
43
  "bg-d-secondary/50 border-d-border border-t font-medium [&>tr]:last:border-b-0",
44
44
  e
45
45
  ),
@@ -52,7 +52,7 @@ function c({ className: e, ...t }) {
52
52
  "tr",
53
53
  {
54
54
  "data-slot": "table-row",
55
- className: a(
55
+ className: o(
56
56
  "hover:bg-d-secondary/50 data-[state=selected]:bg-d-secondary border-d-border border-b transition-colors",
57
57
  e
58
58
  ),
@@ -65,7 +65,7 @@ function i({ className: e, ...t }) {
65
65
  "th",
66
66
  {
67
67
  "data-slot": "table-head",
68
- className: a(
68
+ className: o(
69
69
  "text-d-foreground border-d-border h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
70
70
  e
71
71
  ),
@@ -78,8 +78,8 @@ function u({ className: e, ...t }) {
78
78
  "td",
79
79
  {
80
80
  "data-slot": "table-cell",
81
- className: a(
82
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
81
+ className: o(
82
+ "border-d-border/50 border p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
83
83
  e
84
84
  ),
85
85
  ...t
@@ -94,18 +94,18 @@ function m({
94
94
  "caption",
95
95
  {
96
96
  "data-slot": "table-caption",
97
- className: a("text-d-secondary-foreground mt-4 text-sm", e),
97
+ className: o("text-d-secondary-foreground mt-4 text-sm", e),
98
98
  ...t
99
99
  }
100
100
  );
101
101
  }
102
102
  export {
103
- d as Table,
104
- b as TableBody,
103
+ l as Table,
104
+ n as TableBody,
105
105
  m as TableCaption,
106
106
  u as TableCell,
107
107
  s as TableFooter,
108
108
  i as TableHead,
109
- n as TableHeader,
109
+ b as TableHeader,
110
110
  c as TableRow
111
111
  };
@@ -10,8 +10,8 @@ import { cn as V } from "../../../../lib/utils.js";
10
10
  import { Button as k } from "../../button.js";
11
11
  import { Icon as q } from "../../icon.js";
12
12
  import { Popover as Be, PopoverTrigger as Fe, PopoverContent as Oe } from "../../popover.js";
13
- import { Table as ie, TableHeader as ae, TableRow as G, TableHead as ce, TableBody as We, TableCell as Ue } from "../../table.js";
14
- import { getSortedRowModel as Xe, getCoreRowModel as Ye } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
13
+ import { getSortedRowModel as We, getCoreRowModel as Ue } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
14
+ import { Table as ie, TableHeader as ae, TableRow as G, TableHead as ce, TableBody as Xe, TableCell as Ye } from "../../table.js";
15
15
  function ct({
16
16
  crossTableData: E,
17
17
  filterable: v = !1,
@@ -180,8 +180,8 @@ function ct({
180
180
  columns: Ee,
181
181
  state: { sorting: ge },
182
182
  onSortingChange: xe,
183
- getCoreRowModel: Ye(),
184
- getSortedRowModel: Xe()
183
+ getCoreRowModel: Ue(),
184
+ getSortedRowModel: We()
185
185
  }), Z = Le(null), ee = $e({
186
186
  count: R.getRowModel().rows.length,
187
187
  getScrollElement: () => Z.current,
@@ -287,7 +287,7 @@ function ct({
287
287
  }
288
288
  ),
289
289
  /* @__PURE__ */ l(
290
- We,
290
+ Xe,
291
291
  {
292
292
  style: {
293
293
  height: `${ee.getTotalSize()}px`,
@@ -312,7 +312,7 @@ function ct({
312
312
  children: e.getVisibleCells().map((n, o) => {
313
313
  const i = o === 0, r = n.getValue(), a = i ? "var(--d-secondary)" : r?.bgColor || "transparent", N = r.editable ?? !0;
314
314
  return /* @__PURE__ */ l(
315
- Ue,
315
+ Ye,
316
316
  {
317
317
  onClick: (m) => {
318
318
  !N || !C || (m.stopPropagation(), m.preventDefault());
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
3
+ import { Button as n } from "../../../button.js";
4
+ import { Popover as r, PopoverTrigger as s, PopoverContent as a } from "../../../popover.js";
5
+ function x({
6
+ actions: l,
7
+ i18n: o
8
+ }) {
9
+ if (!l?.length) return null;
10
+ if (l.length === 1) {
11
+ const [e] = l;
12
+ return /* @__PURE__ */ t(
13
+ n,
14
+ {
15
+ size: "sm",
16
+ iconLeft: e.icon,
17
+ variant: "default",
18
+ onClick: e.onClick,
19
+ className: "h-6 max-h-6 text-xs",
20
+ children: e.label
21
+ }
22
+ );
23
+ }
24
+ return /* @__PURE__ */ i(r, { children: [
25
+ /* @__PURE__ */ t(s, { asChild: !0, children: /* @__PURE__ */ t(
26
+ n,
27
+ {
28
+ size: "sm",
29
+ iconRight: "ChevronDown",
30
+ variant: "default",
31
+ className: "h-6 max-h-6 !px-2 text-xs",
32
+ children: o.tableActions.actions
33
+ }
34
+ ) }),
35
+ /* @__PURE__ */ t(a, { side: "top", className: "flex w-auto flex-col p-2", children: l.map((e) => /* @__PURE__ */ t(
36
+ n,
37
+ {
38
+ variant: "ghost",
39
+ iconLeft: e.icon,
40
+ size: "sm",
41
+ onClick: e.onClick,
42
+ className: "justify-start text-xs",
43
+ children: e.label
44
+ },
45
+ e.label
46
+ )) })
47
+ ] });
48
+ }
49
+ export {
50
+ x as DataTableActionsComponent
51
+ };
@@ -0,0 +1,470 @@
1
+ "use client";
2
+ import { jsxs as m, jsx as o, Fragment as T } from "react/jsx-runtime";
3
+ import { useState as P } from "react";
4
+ import { AppSelect as O } from "../../../app-select.js";
5
+ import { Button as x } from "../../../button.js";
6
+ import { Popover as G, PopoverTrigger as L, PopoverContent as R } from "../../../popover.js";
7
+ import { errorSelectClass as y, getListMultiSelectFilterOptions as k, getListSingleSelectFilterOptions as V, getDateTimeFilterOptions as q, getDateFilterOptions as B, getBooleanFilterOptions as E, getNumberFilterOptions as M, getStringFilterOptions as $ } from "../data-table-constants.js";
8
+ import { FilterValueInput as H } from "./data-table-filter-inputs.js";
9
+ import { cn as J } from "../../../../../lib/utils.js";
10
+ function u() {
11
+ return Math.random().toString(36).substr(2, 9);
12
+ }
13
+ function A({
14
+ onDelete: s,
15
+ onDuplicate: e,
16
+ type: d,
17
+ i18n: i
18
+ }) {
19
+ return /* @__PURE__ */ m(G, { children: [
20
+ /* @__PURE__ */ o(L, { asChild: !0, children: /* @__PURE__ */ o(
21
+ x,
22
+ {
23
+ variant: "ghost",
24
+ iconLeft: "Ellipsis",
25
+ size: "sm",
26
+ className: "size-7"
27
+ }
28
+ ) }),
29
+ /* @__PURE__ */ m(R, { side: "right", className: "flex w-auto flex-col p-1", children: [
30
+ /* @__PURE__ */ o(
31
+ x,
32
+ {
33
+ className: "justify-start text-xs",
34
+ variant: "ghost-destructive",
35
+ iconLeft: "Trash2",
36
+ size: "sm",
37
+ onClick: s,
38
+ children: d === "condition" ? i.filters.deleteCondition : i.filters.deleteGroup
39
+ }
40
+ ),
41
+ /* @__PURE__ */ o(
42
+ x,
43
+ {
44
+ className: "justify-start text-xs",
45
+ variant: "ghost",
46
+ iconLeft: "Copy",
47
+ size: "sm",
48
+ onClick: e,
49
+ children: d === "condition" ? i.filters.duplicateCondition : i.filters.duplicateGroup
50
+ }
51
+ )
52
+ ] })
53
+ ] });
54
+ }
55
+ function S(s, e) {
56
+ switch (s) {
57
+ case "string":
58
+ return $(e);
59
+ case "number":
60
+ return M(e);
61
+ case "boolean":
62
+ return E(e);
63
+ case "date":
64
+ return B(e);
65
+ case "datetime":
66
+ return q(e);
67
+ case "list_single_select":
68
+ return V(e);
69
+ case "list_multi_select":
70
+ return k(e);
71
+ default:
72
+ return [];
73
+ }
74
+ }
75
+ function K({
76
+ condition: s,
77
+ columns: e,
78
+ onUpdate: d,
79
+ onRemove: i,
80
+ onDuplicate: w,
81
+ showLogicalOperator: h = !1,
82
+ logicalOperator: p = "AND",
83
+ onLogicalOperatorChange: n,
84
+ isFirstInGroup: g = !1,
85
+ isSecondInGroup: C = !1,
86
+ i18n: c
87
+ }) {
88
+ const v = e.find((r) => r.id === s.columnId), D = v ? S(
89
+ v.column.columnDef.meta?.type,
90
+ c
91
+ ) : [], F = () => {
92
+ if (!v) return null;
93
+ const r = v.column.columnDef.meta?.type, f = s.value === void 0 || typeof s.value == "string" && s.value === "" || r === "list_multi_select" && !Array.isArray(s.value);
94
+ return /* @__PURE__ */ o(
95
+ H,
96
+ {
97
+ columnType: r,
98
+ value: s.value,
99
+ onChange: (N) => d({ ...s, value: N }),
100
+ listOptions: v.column.columnDef.meta?.listOptions ?? [],
101
+ placeholder: c.filters.value,
102
+ operator: s.operator,
103
+ size: "sm",
104
+ className: r === "list_single_select" || r === "list_multi_select" ? "w-52" : "",
105
+ hasError: f
106
+ }
107
+ );
108
+ };
109
+ return /* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 items-center gap-2 rounded-md", children: [
110
+ /* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-x-auto overflow-y-clip", children: [
111
+ h && n && /* @__PURE__ */ o(T, { children: C ? /* @__PURE__ */ o(
112
+ O,
113
+ {
114
+ size: "sm",
115
+ className: `w-[72px] min-w-[72px] ${p === void 0 ? y : ""}`,
116
+ options: [
117
+ { value: "AND", label: c.filters.and },
118
+ { value: "OR", label: c.filters.or }
119
+ ],
120
+ value: p,
121
+ onValueChange: (r) => n(r)
122
+ }
123
+ ) : /* @__PURE__ */ o("span", { className: "text-muted-foreground w-[72px] min-w-[72px] text-right text-xs", children: p }) }),
124
+ g && /* @__PURE__ */ o("span", { className: "text-muted-foreground w-[72px] min-w-[72px] text-right text-xs", children: c.filters.where }),
125
+ /* @__PURE__ */ o(
126
+ O,
127
+ {
128
+ size: "sm",
129
+ placeholder: c.filters.column,
130
+ className: s.columnId === void 0 || s.columnId === "" ? y : "",
131
+ options: e.map((r) => ({
132
+ value: r.id,
133
+ label: r.column.columnDef.header?.toString() ?? ""
134
+ })),
135
+ value: s.columnId || void 0,
136
+ onValueChange: (r) => {
137
+ if (r) {
138
+ const f = e.find((N) => N.id === r);
139
+ if (f) {
140
+ const N = S(
141
+ f.column.columnDef.meta?.type,
142
+ c
143
+ )[0]?.value;
144
+ d({
145
+ ...s,
146
+ columnId: String(r),
147
+ columnLabel: f.column.columnDef.header?.toString() ?? "",
148
+ columnType: f.column.columnDef.meta?.type,
149
+ operator: String(N || "eq"),
150
+ value: void 0
151
+ });
152
+ }
153
+ }
154
+ }
155
+ }
156
+ ),
157
+ s.columnId && /* @__PURE__ */ o(
158
+ O,
159
+ {
160
+ size: "sm",
161
+ placeholder: c.filters.operator,
162
+ className: s.operator === void 0 ? y : "",
163
+ options: D,
164
+ value: s.operator || void 0,
165
+ onValueChange: (r) => {
166
+ r && d({
167
+ ...s,
168
+ operator: String(r)
169
+ });
170
+ }
171
+ }
172
+ ),
173
+ F()
174
+ ] }),
175
+ /* @__PURE__ */ o(
176
+ A,
177
+ {
178
+ type: "condition",
179
+ onDelete: i,
180
+ onDuplicate: w,
181
+ i18n: c
182
+ }
183
+ )
184
+ ] });
185
+ }
186
+ function _({
187
+ className: s,
188
+ group: e,
189
+ columns: d,
190
+ onUpdate: i,
191
+ isRoot: w = !1,
192
+ depth: h,
193
+ maxNestedDepth: p = 2,
194
+ i18n: n
195
+ }) {
196
+ const g = {
197
+ id: u(),
198
+ columnId: "",
199
+ columnLabel: "",
200
+ columnType: "string",
201
+ operator: "eq",
202
+ value: void 0
203
+ }, C = {
204
+ id: u(),
205
+ logicalOperator: "AND",
206
+ conditions: [
207
+ {
208
+ id: u(),
209
+ columnId: "",
210
+ columnLabel: "",
211
+ columnType: "string",
212
+ operator: "eq",
213
+ value: void 0
214
+ }
215
+ ],
216
+ groups: []
217
+ }, c = () => {
218
+ i({
219
+ ...e,
220
+ conditions: [...e.conditions, g]
221
+ });
222
+ }, v = () => {
223
+ i({
224
+ ...e,
225
+ groups: [...e.groups || [], C]
226
+ });
227
+ }, D = (l, t) => {
228
+ i({
229
+ ...e,
230
+ conditions: e.conditions.map(
231
+ (a) => a.id === l ? t : a
232
+ )
233
+ });
234
+ }, F = (l) => {
235
+ const t = e.conditions.findIndex((I) => I.id === l);
236
+ if (t === -1) return;
237
+ const b = {
238
+ ...e.conditions[t],
239
+ id: u()
240
+ };
241
+ i({
242
+ ...e,
243
+ conditions: [
244
+ ...e.conditions.slice(0, t + 1),
245
+ b,
246
+ ...e.conditions.slice(t + 1)
247
+ ]
248
+ });
249
+ }, r = (l) => {
250
+ i({
251
+ ...e,
252
+ conditions: e.conditions.filter((t) => t.id !== l)
253
+ });
254
+ }, f = (l, t) => {
255
+ i({
256
+ ...e,
257
+ groups: (e.groups || []).map(
258
+ (a) => a.id === l ? t : a
259
+ )
260
+ });
261
+ }, N = (l) => {
262
+ i({
263
+ ...e,
264
+ groups: (e.groups || []).filter((t) => t.id !== l)
265
+ });
266
+ }, z = (l) => ({
267
+ id: u(),
268
+ logicalOperator: l.logicalOperator,
269
+ conditions: l.conditions.map((t) => ({
270
+ ...t,
271
+ id: u()
272
+ })),
273
+ groups: (l.groups || []).map((t) => z(t))
274
+ }), j = (l) => {
275
+ const t = e.groups || [], a = t.findIndex((I) => I.id === l);
276
+ if (a === -1) return;
277
+ const b = z(t[a]);
278
+ i({
279
+ ...e,
280
+ groups: [...t.slice(0, a + 1), b, ...t.slice(a + 1)]
281
+ });
282
+ };
283
+ return /* @__PURE__ */ m(
284
+ "div",
285
+ {
286
+ className: J(
287
+ "min-w-0 space-y-2 overflow-auto",
288
+ w ? "" : "bg-d-foreground/5 border-d-foreground rounded border-l-2 p-2 pl-3",
289
+ s
290
+ ),
291
+ children: [
292
+ e.conditions.map((l, t) => /* @__PURE__ */ o(
293
+ K,
294
+ {
295
+ condition: l,
296
+ columns: d,
297
+ onUpdate: (a) => D(l.id, a),
298
+ onRemove: () => r(l.id),
299
+ onDuplicate: () => F(l.id),
300
+ showLogicalOperator: t > 0,
301
+ logicalOperator: e.logicalOperator,
302
+ onLogicalOperatorChange: (a) => i({ ...e, logicalOperator: a }),
303
+ isFirstInGroup: t === 0,
304
+ isSecondInGroup: t === 1,
305
+ i18n: n
306
+ },
307
+ l.id
308
+ )),
309
+ (e.groups || []).map((l, t) => /* @__PURE__ */ m(
310
+ "div",
311
+ {
312
+ className: "flex min-w-0 flex-1 flex-row gap-2",
313
+ children: [
314
+ t === 1 && e.conditions.length === 0 || t === 0 && e.conditions.length === 1 ? /* @__PURE__ */ o(
315
+ O,
316
+ {
317
+ className: `w-[72px] min-w-[72px] ${e.logicalOperator === void 0 ? y : ""}`,
318
+ size: "sm",
319
+ options: [
320
+ { value: "AND", label: n.filters.and },
321
+ { value: "OR", label: n.filters.or }
322
+ ],
323
+ value: e.logicalOperator,
324
+ onValueChange: (a) => i({
325
+ ...e,
326
+ logicalOperator: a
327
+ })
328
+ }
329
+ ) : t === 0 && e.conditions.length === 0 ? /* @__PURE__ */ o("span", { className: "text-muted-foreground w-[72px] text-right text-xs", children: n.filters.where }) : /* @__PURE__ */ o("span", { className: "text-muted-foreground w-[72px] text-right text-xs", children: e.logicalOperator }),
330
+ /* @__PURE__ */ o(
331
+ _,
332
+ {
333
+ className: "flex flex-1 flex-col",
334
+ group: l,
335
+ columns: d,
336
+ onUpdate: (a) => f(l.id, a),
337
+ depth: h + 1,
338
+ maxNestedDepth: p,
339
+ i18n: n
340
+ }
341
+ ),
342
+ /* @__PURE__ */ o(
343
+ A,
344
+ {
345
+ type: "group",
346
+ onDelete: () => N(l.id),
347
+ onDuplicate: () => j(l.id),
348
+ i18n: n
349
+ }
350
+ )
351
+ ]
352
+ },
353
+ l.id
354
+ )),
355
+ h < p ? /* @__PURE__ */ m(G, { children: [
356
+ /* @__PURE__ */ o(L, { asChild: !0, children: /* @__PURE__ */ o(
357
+ x,
358
+ {
359
+ variant: "ghost",
360
+ size: "sm",
361
+ className: "w-full justify-start text-xs",
362
+ iconLeft: "Plus",
363
+ iconRight: "ChevronDown",
364
+ children: n.filters.addFilterRule
365
+ }
366
+ ) }),
367
+ /* @__PURE__ */ m(R, { side: "top", className: "flex w-auto flex-col p-1", children: [
368
+ /* @__PURE__ */ o(
369
+ x,
370
+ {
371
+ variant: "ghost",
372
+ size: "sm",
373
+ className: "justify-start text-xs",
374
+ iconLeft: "Plus",
375
+ onClick: c,
376
+ children: n.filters.addFilterRule
377
+ }
378
+ ),
379
+ /* @__PURE__ */ o(
380
+ x,
381
+ {
382
+ variant: "ghost",
383
+ size: "sm",
384
+ className: "justify-start text-xs",
385
+ iconLeft: "CopyPlus",
386
+ onClick: v,
387
+ children: n.filters.addFilterGroup
388
+ }
389
+ )
390
+ ] })
391
+ ] }) : /* @__PURE__ */ o(
392
+ x,
393
+ {
394
+ variant: "ghost",
395
+ size: "sm",
396
+ className: "w-full justify-start text-xs",
397
+ iconLeft: "Plus",
398
+ onClick: c,
399
+ children: n.filters.addFilterRule
400
+ }
401
+ )
402
+ ]
403
+ }
404
+ );
405
+ }
406
+ function le({
407
+ columns: s,
408
+ onFilterChange: e,
409
+ initialFilter: d,
410
+ i18n: i
411
+ }) {
412
+ const [w, h] = P(
413
+ d || {
414
+ id: u(),
415
+ rootGroup: {
416
+ id: u(),
417
+ logicalOperator: "AND",
418
+ conditions: [],
419
+ groups: []
420
+ }
421
+ }
422
+ ), p = (g) => {
423
+ const C = {
424
+ ...w,
425
+ rootGroup: g
426
+ };
427
+ h(C), e(C);
428
+ }, n = () => {
429
+ const g = {
430
+ id: u(),
431
+ rootGroup: {
432
+ id: u(),
433
+ logicalOperator: "AND",
434
+ conditions: [],
435
+ groups: []
436
+ }
437
+ };
438
+ h(g), e(null);
439
+ };
440
+ return /* @__PURE__ */ m("div", { className: "flex max-h-[500px] min-w-0 flex-col gap-0.5 overflow-auto", children: [
441
+ /* @__PURE__ */ o(
442
+ _,
443
+ {
444
+ className: "flex flex-1 flex-col",
445
+ group: w.rootGroup,
446
+ columns: s,
447
+ onUpdate: p,
448
+ isRoot: !0,
449
+ depth: 0,
450
+ maxNestedDepth: 2,
451
+ i18n: i
452
+ }
453
+ ),
454
+ /* @__PURE__ */ o("div", { className: "border-d-border w-full border-b" }),
455
+ /* @__PURE__ */ o(
456
+ x,
457
+ {
458
+ variant: "ghost-destructive",
459
+ size: "sm",
460
+ onClick: n,
461
+ className: "w-full justify-start text-xs",
462
+ iconRight: "Trash2",
463
+ children: i.filters.deleteFilter
464
+ }
465
+ )
466
+ ] });
467
+ }
468
+ export {
469
+ le as DataTableAdvancedFilterComponent
470
+ };