ezux 1.1.19 → 1.1.21
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.
- package/README.md +7 -1
- package/dist/{DeleteConfirmationModal-CukNDgtX.cjs → DeleteConfirmationModal-BM1PoL6P.cjs} +1 -1
- package/dist/{DeleteConfirmationModal-p8XGDGIw.js → DeleteConfirmationModal-B_tXm0N0.js} +4 -4
- package/dist/{EzEventModal-BrCBSXBM.cjs → EzEventModal-D1EzXBsQ.cjs} +1 -1
- package/dist/{EzEventModal-BDSHG11m.js → EzEventModal-D5lX9XuW.js} +2 -2
- package/dist/{EzFlow-CQFeY7DL.cjs → EzFlow-B4qRm5KH.cjs} +3 -3
- package/dist/{EzFlow-C74NbZA9.js → EzFlow-CEfPykao.js} +278 -278
- package/dist/EzKanban-2b9skOep.cjs +2 -0
- package/dist/{EzKanban-COcGidzh.js → EzKanban-CpYH8b8g.js} +86 -80
- package/dist/{EzLayout-CiaPLniV.js → EzLayout-DFxegglu.js} +30 -24
- package/dist/EzLayout-EYOfpFXs.cjs +1 -0
- package/dist/{EzScheduler-CjQbi1Na.js → EzScheduler-D7aH4KCY.js} +60 -55
- package/dist/EzScheduler-hC9PsLrI.cjs +1 -0
- package/dist/{EzSchedulerQuickAdd-BeNfGdWs.cjs → EzSchedulerQuickAdd-BYrV9PQ-.cjs} +1 -1
- package/dist/{EzSchedulerQuickAdd-BIC8xbSn.js → EzSchedulerQuickAdd-D0kGTzE3.js} +2 -2
- package/dist/{EzSchedulerToolbar-jMw8KB8k.js → EzSchedulerToolbar-BhlCMeOT.js} +2 -2
- package/dist/{EzSchedulerToolbar-ihfe-5Yd.cjs → EzSchedulerToolbar-Dy62PVnH.cjs} +1 -1
- package/dist/{EzSignature-7UHO5lSP.js → EzSignature-B-CPcf7e.js} +5 -2
- package/dist/{EzSignature-Df7UZ-IS.cjs → EzSignature-DcmWBPIL.cjs} +1 -1
- package/dist/EzTable-Bcq7TByw.cjs +3 -0
- package/dist/{EzTable-D2p1IWHc.js → EzTable-DLbb3nl7.js} +1296 -1161
- package/dist/EzTableEditDialog--8pD39Rp.cjs +1 -0
- package/dist/EzTableEditDialog-m0zW6r6z.js +100 -0
- package/dist/{EzTableFooter-DrLoWelo.js → EzTableFooter-BuTS3wDK.js} +1 -1
- package/dist/{EzTableToolbar-DwuumvWP.cjs → EzTableToolbar-BWjqKfwx.cjs} +1 -1
- package/dist/{EzTableToolbar-BH5z9fSJ.js → EzTableToolbar-BiRfKm9d.js} +2 -2
- package/dist/{EzTreeView-D1G0Aomc.js → EzTreeView-B2B_Ruwm.js} +37 -37
- package/dist/EzTreeView-DLoPKe2i.cjs +1 -0
- package/dist/{KanbanBoard-BsZP_PJi.js → KanbanBoard-CRF0-mYa.js} +119 -119
- package/dist/{KanbanBoard-C9bjU_gk.cjs → KanbanBoard-DdXD-Zjt.cjs} +1 -1
- package/dist/advanced.cjs +2 -2
- package/dist/advanced.es.js +30 -29
- package/dist/card-NlCLCGFb.cjs +1 -0
- package/dist/{card-ZUNxcdIM.js → card-urNaa5h-.js} +1 -1
- package/dist/{checkbox-BrCh_Iid.cjs → checkbox-B9yPkCYi.cjs} +1 -1
- package/dist/{checkbox-DRkQuB4W.js → checkbox-BTuckDEm.js} +1 -1
- package/dist/components/EzTable/EzTableEditDialog.d.ts +1 -1
- package/dist/components/EzTable/hooks/useTableFiltering.d.ts +6 -6
- package/dist/components/EzTable/hooks/useTableHistory.d.ts +3 -3
- package/dist/components/EzTable/hooks/useTableImperative.d.ts +9 -6
- package/dist/components/EzTable/hooks/useTableState.d.ts +12 -12
- package/dist/components/EzTable/types/EzTableProps.d.ts +9 -1
- package/dist/ezux.css +1 -1
- package/dist/flow.cjs +1 -1
- package/dist/flow.es.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +20 -20
- package/dist/input-CcRi0LeO.js +14 -0
- package/dist/input-DOh8O0iX.cjs +1 -0
- package/dist/kanban.cjs +1 -1
- package/dist/kanban.es.js +2 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.es.js +1 -1
- package/dist/mock-services.cjs +1 -1
- package/dist/mock-services.es.js +1 -1
- package/dist/scheduler.cjs +1 -1
- package/dist/scheduler.es.js +1 -1
- package/dist/signature.cjs +1 -1
- package/dist/signature.es.js +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.es.js +1 -1
- package/dist/theme-vars.css +25 -5
- package/dist/treeview.cjs +1 -1
- package/dist/treeview.es.js +1 -1
- package/package.json +39 -36
- package/dist/EzKanban-DokdXGqQ.cjs +0 -2
- package/dist/EzLayout-BGnqFtvO.cjs +0 -1
- package/dist/EzScheduler-B8nV1VWY.cjs +0 -1
- package/dist/EzTable-CEXvJR1t.cjs +0 -3
- package/dist/EzTableEditDialog-BXnnYSSy.cjs +0 -1
- package/dist/EzTableEditDialog-Ccd5XoHm.js +0 -84
- package/dist/EzTreeView-KMGlU4ax.cjs +0 -1
- package/dist/card-CPlRZxbq.cjs +0 -1
- package/dist/input-CYlvlbF7.cjs +0 -1
- package/dist/input-Cj3sQK3M.js +0 -14
|
@@ -1,40 +1,103 @@
|
|
|
1
1
|
import { _ as e, f as t, n, u as r } from "./EzProvider-AlmsYIDk.js";
|
|
2
2
|
import { t as i } from "./button-CYyNwV8S.js";
|
|
3
|
-
import { t as a } from "./input-
|
|
3
|
+
import { t as a } from "./input-CcRi0LeO.js";
|
|
4
4
|
import { t as o } from "./label-DWEV--5W.js";
|
|
5
5
|
import { n as s, t as c } from "./EzErrorBoundary-C7a6VisX.js";
|
|
6
6
|
import { t as l } from "./useComponentState-DiSFLYju.js";
|
|
7
7
|
import { n as u, t as d } from "./useInitCoreServices-CuBrviDM.js";
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import { a as
|
|
17
|
-
import * as
|
|
18
|
-
import
|
|
19
|
-
import { AlertTriangle as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { Store as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import * as at from "@radix-ui/react-
|
|
28
|
-
import
|
|
8
|
+
import { _ as f, d as p, g as m, i as h, n as g, o as _, t as v } from "./EzContextMenu-srLxujt8.js";
|
|
9
|
+
import { t as y } from "./useImperativeAPI-Dbx2hMTb.js";
|
|
10
|
+
import { t as b } from "./useServiceState-CkrJZm1D.js";
|
|
11
|
+
import { n as x, r as S, t as C } from "./popover-D1akYj0W.js";
|
|
12
|
+
import { i as w, n as T, r as E, t as D } from "./tooltip-B1wC9m05.js";
|
|
13
|
+
import { n as O, r as ee, t as k } from "./HighlightText-DNA2R2uf.js";
|
|
14
|
+
import { a as A, i as j, n as M, r as N, t as P } from "./select-D4tFaSai.js";
|
|
15
|
+
import { t as te } from "./checkbox-BTuckDEm.js";
|
|
16
|
+
import { a as F, i as I, o as L, r as ne, s as R, t as z } from "./TooltipWrapper-BSAmUx9H.js";
|
|
17
|
+
import * as B from "react";
|
|
18
|
+
import V, { createContext as re, memo as H, useCallback as U, useContext as ie, useEffect as W, useLayoutEffect as ae, useMemo as G, useRef as K, useState as q, useTransition as J } from "react";
|
|
19
|
+
import { AlertTriangle as oe, ArrowDown as se, ArrowUp as ce, Check as Y, ChevronDown as le, ChevronLeft as ue, ChevronRight as de, ChevronsLeft as fe, ChevronsRight as pe, ChevronsUpDown as me, Circle as he, Copy as ge, FilterIcon as _e, GripVertical as ve, Group as ye, ListFilter as be, Loader2 as xe, Maximize2 as Se, Minus as Ce, Pin as we, PinOff as Te, PlusIcon as Ee, RefreshCw as De, Search as Oe, Ungroup as ke, X as Ae, XIcon as je } from "lucide-react";
|
|
20
|
+
import { Fragment as Me, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
21
|
+
import { Store as Ne } from "@tanstack/store";
|
|
22
|
+
import { useVirtualizer as Pe } from "@tanstack/react-virtual";
|
|
23
|
+
import { DndContext as Fe, DragOverlay as Ie, PointerSensor as Le, pointerWithin as Re, useDraggable as ze, useDroppable as Be, useSensor as Ve, useSensors as He } from "@dnd-kit/core";
|
|
24
|
+
import { useStore as Ue } from "@tanstack/react-store";
|
|
25
|
+
import { QueryClient as We, QueryClientProvider as Ge, useMutation as Ke, useQuery as qe, useQueryClient as Je } from "@tanstack/react-query";
|
|
26
|
+
import { flexRender as Ye, getCoreRowModel as Xe, getExpandedRowModel as Ze, getFacetedMinMaxValues as Qe, getFacetedUniqueValues as $e, getFilteredRowModel as et, getGroupedRowModel as tt, getPaginationRowModel as nt, getSortedRowModel as rt, useReactTable as it } from "@tanstack/react-table";
|
|
27
|
+
import * as at from "@radix-ui/react-switch";
|
|
28
|
+
import * as ot from "@radix-ui/react-radio-group";
|
|
29
29
|
import { Command as Q } from "cmdk";
|
|
30
|
+
//#region src/shared/hooks/useLifecycleEvents.ts
|
|
31
|
+
var st = (e) => {
|
|
32
|
+
let t = K(!1);
|
|
33
|
+
ae(() => {
|
|
34
|
+
e.onRenderStart && e.onRenderStart();
|
|
35
|
+
}), W(() => {
|
|
36
|
+
!t.current && e.onRenderComplete && (e.onRenderComplete(), t.current = !0);
|
|
37
|
+
}, [e.onRenderComplete]), W(() => () => {
|
|
38
|
+
t.current = !1;
|
|
39
|
+
}, []);
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/shared/hooks/useEventHandlers.ts
|
|
43
|
+
function ct(e) {
|
|
44
|
+
return {
|
|
45
|
+
handleDragStart: U((t) => {
|
|
46
|
+
e.onDragStart?.(t);
|
|
47
|
+
}, [e.onDragStart]),
|
|
48
|
+
handleDragOver: U((t) => {
|
|
49
|
+
e.onDragOver?.(t);
|
|
50
|
+
}, [e.onDragOver]),
|
|
51
|
+
handleDragEnd: U((t) => {
|
|
52
|
+
e.onDragEnd?.(t);
|
|
53
|
+
}, [e.onDragEnd]),
|
|
54
|
+
handleKeyPress: U((t) => {
|
|
55
|
+
e.onKeyPress?.(t);
|
|
56
|
+
}, [e.onKeyPress]),
|
|
57
|
+
handleKeyDown: U((t) => {
|
|
58
|
+
e.onKeyDown?.(t);
|
|
59
|
+
}, [e.onKeyDown]),
|
|
60
|
+
handleKeyUp: U((t) => {
|
|
61
|
+
e.onKeyUp?.(t);
|
|
62
|
+
}, [e.onKeyUp]),
|
|
63
|
+
handleClick: U((t) => {
|
|
64
|
+
e.onClick?.(t);
|
|
65
|
+
}, [e.onClick]),
|
|
66
|
+
handleDoubleClick: U((t) => {
|
|
67
|
+
e.onDoubleClick?.(t);
|
|
68
|
+
}, [e.onDoubleClick]),
|
|
69
|
+
handlePointerDown: U((t) => {
|
|
70
|
+
e.onPointerDown?.(t);
|
|
71
|
+
}, [e.onPointerDown]),
|
|
72
|
+
handlePointerMove: U((t) => {
|
|
73
|
+
e.onPointerMove?.(t);
|
|
74
|
+
}, [e.onPointerMove]),
|
|
75
|
+
handlePointerUp: U((t) => {
|
|
76
|
+
e.onPointerUp?.(t);
|
|
77
|
+
}, [e.onPointerUp]),
|
|
78
|
+
handlePointerLeave: U((t) => {
|
|
79
|
+
e.onPointerLeave?.(t);
|
|
80
|
+
}, [e.onPointerLeave]),
|
|
81
|
+
handlePointerEnter: U((t) => {
|
|
82
|
+
e.onPointerEnter?.(t);
|
|
83
|
+
}, [e.onPointerEnter]),
|
|
84
|
+
handleFocus: U(() => {
|
|
85
|
+
e.onFocusChange?.(!0);
|
|
86
|
+
}, [e.onFocusChange]),
|
|
87
|
+
handleBlur: U(() => {
|
|
88
|
+
e.onFocusChange?.(!1);
|
|
89
|
+
}, [e.onFocusChange])
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
30
93
|
//#region src/shared/hooks/useDndHandlers.ts
|
|
31
|
-
var
|
|
32
|
-
sensors: Ve(
|
|
94
|
+
var lt = (e) => ({
|
|
95
|
+
sensors: He(Ve(Le, { activationConstraint: { distance: e.distance ?? 5 } })),
|
|
33
96
|
onDragStart: e.onDragStart,
|
|
34
97
|
onDragEnd: e.onDragEnd,
|
|
35
98
|
collisionDetection: e.collisionDetection
|
|
36
|
-
}),
|
|
37
|
-
let { validateField: t, editSettings: n } = e, r =
|
|
99
|
+
}), ut = (e) => {
|
|
100
|
+
let { validateField: t, editSettings: n } = e, r = U((e, r, i) => {
|
|
38
101
|
if (n?.requiredFields?.includes(e) && (r == null || r === "")) return {
|
|
39
102
|
isValid: !1,
|
|
40
103
|
error: "Field is required"
|
|
@@ -62,7 +125,7 @@ var st = (e) => ({
|
|
|
62
125
|
}, [t, n]);
|
|
63
126
|
return {
|
|
64
127
|
validate: r,
|
|
65
|
-
validateForm:
|
|
128
|
+
validateForm: U((e, t) => {
|
|
66
129
|
let n = {}, i = !0;
|
|
67
130
|
return t.forEach((t) => {
|
|
68
131
|
let a = r(t, e[t], e);
|
|
@@ -73,20 +136,20 @@ var st = (e) => ({
|
|
|
73
136
|
};
|
|
74
137
|
//#endregion
|
|
75
138
|
//#region src/shared/hooks/useDialogState.ts
|
|
76
|
-
function
|
|
77
|
-
let [t, n] =
|
|
139
|
+
function dt(e = {}) {
|
|
140
|
+
let [t, n] = q(!1), [r, i] = q(e.initialMode || "view"), [a, o] = q(e.initialData || {}), [s, c] = q({});
|
|
78
141
|
return {
|
|
79
142
|
isOpen: t,
|
|
80
143
|
mode: r,
|
|
81
144
|
data: a,
|
|
82
145
|
meta: s,
|
|
83
|
-
open:
|
|
146
|
+
open: U((t, r, a) => {
|
|
84
147
|
i(t), r === void 0 ? e.defaultData && o(e.defaultData) : o(r), a !== void 0 && c(a), n(!0);
|
|
85
148
|
}, [e.defaultData]),
|
|
86
|
-
close:
|
|
149
|
+
close: U(() => {
|
|
87
150
|
n(!1);
|
|
88
151
|
}, []),
|
|
89
|
-
toggle:
|
|
152
|
+
toggle: U(() => {
|
|
90
153
|
n((e) => !e);
|
|
91
154
|
}, []),
|
|
92
155
|
setData: o,
|
|
@@ -95,20 +158,20 @@ function lt(e = {}) {
|
|
|
95
158
|
}
|
|
96
159
|
//#endregion
|
|
97
160
|
//#region src/components/EzTable/hooks/useTableHistory.ts
|
|
98
|
-
var
|
|
99
|
-
let n =
|
|
161
|
+
var ft = (e, t = "id") => {
|
|
162
|
+
let n = G(() => {
|
|
100
163
|
let n = /* @__PURE__ */ new Map();
|
|
101
164
|
return Array.isArray(e) && e.forEach((e) => {
|
|
102
165
|
let r = e[t];
|
|
103
166
|
r !== void 0 && n.set(r, e);
|
|
104
167
|
}), n;
|
|
105
|
-
}, [e, t]), [r, i] =
|
|
168
|
+
}, [e, t]), [r, i] = q({
|
|
106
169
|
data: Array.isArray(e) ? e : [],
|
|
107
170
|
history: {
|
|
108
171
|
past: [],
|
|
109
172
|
future: []
|
|
110
173
|
}
|
|
111
|
-
}), a =
|
|
174
|
+
}), a = K(/* @__PURE__ */ new Set()), o = K(e);
|
|
112
175
|
o.current !== e && (o.current = e, i({
|
|
113
176
|
data: Array.isArray(e) ? e : [],
|
|
114
177
|
history: {
|
|
@@ -116,12 +179,12 @@ var ut = (e, t = "id") => {
|
|
|
116
179
|
future: []
|
|
117
180
|
}
|
|
118
181
|
}), a.current.clear());
|
|
119
|
-
let s =
|
|
182
|
+
let s = U((e) => {
|
|
120
183
|
i((t) => ({
|
|
121
184
|
...t,
|
|
122
185
|
data: typeof e == "function" ? e(t.data) : e
|
|
123
186
|
}));
|
|
124
|
-
}, []), c =
|
|
187
|
+
}, []), c = U((e, n, r) => {
|
|
125
188
|
i((i) => {
|
|
126
189
|
let o = i.data[e];
|
|
127
190
|
if (!o) return i;
|
|
@@ -151,7 +214,7 @@ var ut = (e, t = "id") => {
|
|
|
151
214
|
}
|
|
152
215
|
};
|
|
153
216
|
});
|
|
154
|
-
}, [t]), l =
|
|
217
|
+
}, [t]), l = U((e, n = 0) => {
|
|
155
218
|
i((r) => {
|
|
156
219
|
let i = { ...e };
|
|
157
220
|
i[t] === void 0 && (i[t] = `_temp_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`);
|
|
@@ -174,7 +237,7 @@ var ut = (e, t = "id") => {
|
|
|
174
237
|
}
|
|
175
238
|
};
|
|
176
239
|
});
|
|
177
|
-
}, [t]), u =
|
|
240
|
+
}, [t]), u = U((e) => {
|
|
178
241
|
i((n) => {
|
|
179
242
|
let r = [...e].sort((e, t) => t - e), i = [...n.history.past], o = [...n.data];
|
|
180
243
|
return r.forEach((e) => {
|
|
@@ -198,7 +261,7 @@ var ut = (e, t = "id") => {
|
|
|
198
261
|
}
|
|
199
262
|
};
|
|
200
263
|
});
|
|
201
|
-
}, [t]), d =
|
|
264
|
+
}, [t]), d = U(() => {
|
|
202
265
|
i((e) => {
|
|
203
266
|
if (e.history.past.length === 0) return e;
|
|
204
267
|
let n = e.history.past[e.history.past.length - 1], r = e.history.past.slice(0, -1), i = [...e.data];
|
|
@@ -223,7 +286,7 @@ var ut = (e, t = "id") => {
|
|
|
223
286
|
}
|
|
224
287
|
};
|
|
225
288
|
});
|
|
226
|
-
}, [t]), f =
|
|
289
|
+
}, [t]), f = U(() => {
|
|
227
290
|
i((e) => {
|
|
228
291
|
if (e.history.future.length === 0) return e;
|
|
229
292
|
let n = e.history.future[0], r = e.history.future.slice(1), i = [...e.data];
|
|
@@ -259,7 +322,7 @@ var ut = (e, t = "id") => {
|
|
|
259
322
|
redo: f,
|
|
260
323
|
canUndo: r.history.past.length > 0,
|
|
261
324
|
canRedo: r.history.future.length > 0,
|
|
262
|
-
changes:
|
|
325
|
+
changes: G(() => {
|
|
263
326
|
if (p === e) return {
|
|
264
327
|
added: 0,
|
|
265
328
|
edited: 0,
|
|
@@ -277,7 +340,7 @@ var ut = (e, t = "id") => {
|
|
|
277
340
|
else {
|
|
278
341
|
let t = n.get(r);
|
|
279
342
|
if (e === t) return;
|
|
280
|
-
Object.keys(e).some((n) => n.startsWith("_")
|
|
343
|
+
Object.keys(e).some((n) => !n.startsWith("_") && e[n] !== t[n]) && a++;
|
|
281
344
|
}
|
|
282
345
|
}), n.forEach((e, t) => {
|
|
283
346
|
r.has(t) || o++;
|
|
@@ -292,7 +355,7 @@ var ut = (e, t = "id") => {
|
|
|
292
355
|
n,
|
|
293
356
|
t
|
|
294
357
|
]),
|
|
295
|
-
batchChanges:
|
|
358
|
+
batchChanges: G(() => {
|
|
296
359
|
if (p === e) return {
|
|
297
360
|
addedRecords: [],
|
|
298
361
|
changedRecords: [],
|
|
@@ -310,7 +373,7 @@ var ut = (e, t = "id") => {
|
|
|
310
373
|
else {
|
|
311
374
|
let t = n.get(r);
|
|
312
375
|
if (e === t) return;
|
|
313
|
-
Object.keys(e).some((n) => n.startsWith("_")
|
|
376
|
+
Object.keys(e).some((n) => !n.startsWith("_") && e[n] !== t[n]) && a.push(e);
|
|
314
377
|
}
|
|
315
378
|
}), n.forEach((e, t) => {
|
|
316
379
|
r.has(t) || o.push(e);
|
|
@@ -325,7 +388,7 @@ var ut = (e, t = "id") => {
|
|
|
325
388
|
n,
|
|
326
389
|
t
|
|
327
390
|
]),
|
|
328
|
-
resetData:
|
|
391
|
+
resetData: U(() => {
|
|
329
392
|
a.current.clear(), i({
|
|
330
393
|
data: e,
|
|
331
394
|
history: {
|
|
@@ -335,14 +398,14 @@ var ut = (e, t = "id") => {
|
|
|
335
398
|
});
|
|
336
399
|
}, [e])
|
|
337
400
|
};
|
|
338
|
-
},
|
|
401
|
+
}, pt = (e, t = "14px Inter, sans-serif") => {
|
|
339
402
|
if (typeof document > "u") return 0;
|
|
340
403
|
let n = document.createElement("canvas").getContext("2d");
|
|
341
404
|
return n ? (n.font = t, n.measureText(e).width) : 0;
|
|
342
|
-
},
|
|
343
|
-
let { fontSize: n = "14px", fontWeight: r = "600", fontFamily: i = "Inter, sans-serif", padding: a = 32, hasIcons: o = !0 } = t, s =
|
|
405
|
+
}, mt = (e, t = {}) => {
|
|
406
|
+
let { fontSize: n = "14px", fontWeight: r = "600", fontFamily: i = "Inter, sans-serif", padding: a = 32, hasIcons: o = !0 } = t, s = pt(e, `${r} ${n} ${i}`), c = o ? 70 : 0;
|
|
344
407
|
return Math.ceil(s + a + c);
|
|
345
|
-
},
|
|
408
|
+
}, ht = (e) => ({ autoFitColumn: U((n) => {
|
|
346
409
|
let i = e.getColumn(n);
|
|
347
410
|
if (!i) return;
|
|
348
411
|
let a = e.getRowModel().rows.slice(0, 50), o = {
|
|
@@ -354,18 +417,18 @@ var ut = (e, t = "id") => {
|
|
|
354
417
|
fontWeight: "600",
|
|
355
418
|
fontFamily: "Inter, sans-serif"
|
|
356
419
|
}, c = i.columnDef.meta, l = 0, u = typeof i.columnDef.header == "string" ? i.columnDef.header : n;
|
|
357
|
-
l = Math.max(l,
|
|
420
|
+
l = Math.max(l, mt(u, { ...s })), a.forEach((e) => {
|
|
358
421
|
let i = e.getValue(n);
|
|
359
422
|
c?.columnType === "number" ? i = t(i, c.numberOptions) : c?.columnType === "date" ? i = r(i, c.dateOptions) : c?.columnType === "datetime" && (i = r(i, c.dateTimeOptions));
|
|
360
423
|
let a = i == null ? "" : String(i), s = a;
|
|
361
424
|
c?.columnType === "longtext" && c?.longTextOptions?.previewLength && (s = a.length > c.longTextOptions.previewLength ? a.substring(0, c.longTextOptions.previewLength) + "..." : a);
|
|
362
|
-
let u =
|
|
425
|
+
let u = pt(s, `${o.fontWeight} ${o.fontSize} ${o.fontFamily}`);
|
|
363
426
|
l = Math.max(l, u + 32);
|
|
364
427
|
}), e.setColumnSizing((e) => ({
|
|
365
428
|
...e,
|
|
366
429
|
[n]: l
|
|
367
430
|
}));
|
|
368
|
-
}, [e]) }),
|
|
431
|
+
}, [e]) }), gt = (e) => e?.kind === "group", _t = (e, t, n) => {
|
|
369
432
|
if (typeof n == "string") {
|
|
370
433
|
if (!n) return !0;
|
|
371
434
|
let t = n.toLowerCase();
|
|
@@ -382,8 +445,8 @@ var ut = (e, t = "id") => {
|
|
|
382
445
|
return String(n ?? "").toLowerCase().includes(t);
|
|
383
446
|
})) return !1;
|
|
384
447
|
}
|
|
385
|
-
return !(i && !
|
|
386
|
-
},
|
|
448
|
+
return !(i && !O(i, (t) => e.getValue(t)));
|
|
449
|
+
}, vt = (e, t, n) => {
|
|
387
450
|
try {
|
|
388
451
|
if (Array.isArray(n)) {
|
|
389
452
|
if (n.length === 0) return !0;
|
|
@@ -391,8 +454,8 @@ var ut = (e, t = "id") => {
|
|
|
391
454
|
return n.includes(r);
|
|
392
455
|
}
|
|
393
456
|
if (typeof n == "object" && n) {
|
|
394
|
-
if (
|
|
395
|
-
if ("operator" in n) return
|
|
457
|
+
if (gt(n)) return O(n, (n) => e.getValue(n || t));
|
|
458
|
+
if ("operator" in n) return ee({
|
|
396
459
|
kind: "rule",
|
|
397
460
|
id: t,
|
|
398
461
|
field: t,
|
|
@@ -405,16 +468,16 @@ var ut = (e, t = "id") => {
|
|
|
405
468
|
} catch (e) {
|
|
406
469
|
return console.error(`Error in smartColumnFilterFn for column ${t}:`, e), !0;
|
|
407
470
|
}
|
|
408
|
-
},
|
|
471
|
+
}, yt = ({ value: t, className: n, title: r, children: i, fallback: a = /* @__PURE__ */ X("span", {
|
|
409
472
|
className: "text-muted-foreground text-sm italic",
|
|
410
473
|
children: "—"
|
|
411
|
-
}), align: o = "left" }) => t == null ? /* @__PURE__ */
|
|
474
|
+
}), align: o = "left" }) => t == null ? /* @__PURE__ */ X(Me, { children: a }) : /* @__PURE__ */ X("div", {
|
|
412
475
|
className: e("text-sm", o === "center" && "text-center", o === "right" && "text-right", n),
|
|
413
476
|
title: r === void 0 ? typeof t == "string" ? t : String(t) : r,
|
|
414
477
|
children: i || String(t)
|
|
415
|
-
}),
|
|
478
|
+
}), bt = ({ value: n, columnType: a, meta: o, className: s, align: c, table: l }) => {
|
|
416
479
|
let u = n;
|
|
417
|
-
if (n == null) return /* @__PURE__ */
|
|
480
|
+
if (n == null) return /* @__PURE__ */ X(yt, {
|
|
418
481
|
value: n,
|
|
419
482
|
align: c,
|
|
420
483
|
className: s
|
|
@@ -433,13 +496,13 @@ var ut = (e, t = "id") => {
|
|
|
433
496
|
break;
|
|
434
497
|
case "longtext":
|
|
435
498
|
let e = String(n);
|
|
436
|
-
u = /* @__PURE__ */
|
|
499
|
+
u = /* @__PURE__ */ Z("div", {
|
|
437
500
|
className: "flex items-start gap-1 group/longtext w-full overflow-hidden py-1.5",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ Z(D, { children: [/* @__PURE__ */ X(w, {
|
|
439
502
|
asChild: !0,
|
|
440
|
-
children: /* @__PURE__ */
|
|
503
|
+
children: /* @__PURE__ */ X("div", {
|
|
441
504
|
className: "flex-1 min-w-0 cursor-help",
|
|
442
|
-
children: /* @__PURE__ */
|
|
505
|
+
children: /* @__PURE__ */ X("span", {
|
|
443
506
|
className: "block !whitespace-normal break-words text-sm leading-normal",
|
|
444
507
|
style: {
|
|
445
508
|
display: "-webkit-box",
|
|
@@ -450,39 +513,39 @@ var ut = (e, t = "id") => {
|
|
|
450
513
|
children: e
|
|
451
514
|
})
|
|
452
515
|
})
|
|
453
|
-
}), /* @__PURE__ */
|
|
516
|
+
}), /* @__PURE__ */ X(T, {
|
|
454
517
|
className: "max-w-[300px] p-3 break-words text-sm leading-relaxed",
|
|
455
518
|
children: e
|
|
456
|
-
})] }), e.length > 20 && /* @__PURE__ */
|
|
519
|
+
})] }), e.length > 20 && /* @__PURE__ */ Z(C, { children: [/* @__PURE__ */ X(S, {
|
|
457
520
|
asChild: !0,
|
|
458
|
-
children: /* @__PURE__ */
|
|
521
|
+
children: /* @__PURE__ */ X(i, {
|
|
459
522
|
variant: "ghost",
|
|
460
523
|
size: "icon",
|
|
461
524
|
className: "h-5 w-5 opacity-0 group-hover/longtext:opacity-100 transition-opacity shrink-0",
|
|
462
525
|
onClick: (e) => e.stopPropagation(),
|
|
463
|
-
children: /* @__PURE__ */
|
|
526
|
+
children: /* @__PURE__ */ X(Se, { className: "h-3 w-3 text-muted-foreground hover:text-primary" })
|
|
464
527
|
})
|
|
465
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ X(x, {
|
|
466
529
|
className: "w-[400px] p-4 shadow-xl border-border bg-popover",
|
|
467
530
|
align: "end",
|
|
468
531
|
onClick: (e) => e.stopPropagation(),
|
|
469
|
-
children: /* @__PURE__ */
|
|
532
|
+
children: /* @__PURE__ */ Z("div", {
|
|
470
533
|
className: "space-y-3",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
534
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
472
535
|
className: "flex items-center justify-between border-b pb-2",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
536
|
+
children: [/* @__PURE__ */ X("h4", {
|
|
474
537
|
className: "text-xs font-bold uppercase tracking-widest text-muted-foreground",
|
|
475
538
|
children: "Detailed Description"
|
|
476
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ Z(i, {
|
|
477
540
|
variant: "outline",
|
|
478
541
|
size: "sm",
|
|
479
542
|
className: "h-7 px-2 gap-1.5 text-[10px] font-bold",
|
|
480
543
|
onClick: (t) => {
|
|
481
544
|
t.stopPropagation(), navigator.clipboard.writeText(e);
|
|
482
545
|
},
|
|
483
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ X(ge, { className: "h-3 w-3" }), "Copy"]
|
|
484
547
|
})]
|
|
485
|
-
}), /* @__PURE__ */
|
|
548
|
+
}), /* @__PURE__ */ X("div", {
|
|
486
549
|
className: "text-sm leading-relaxed text-foreground max-h-[300px] overflow-auto pr-2 custom-scrollbar whitespace-pre-wrap",
|
|
487
550
|
children: e
|
|
488
551
|
})]
|
|
@@ -494,25 +557,25 @@ var ut = (e, t = "id") => {
|
|
|
494
557
|
}
|
|
495
558
|
if (l?.options.meta?.enableSearchHighlighting) {
|
|
496
559
|
let e = l.getState().globalFilter, t = typeof e == "string" ? e : e?.quickSearch;
|
|
497
|
-
t && (u = /* @__PURE__ */
|
|
560
|
+
t && (u = /* @__PURE__ */ X(k, {
|
|
498
561
|
text: u,
|
|
499
562
|
highlight: t
|
|
500
563
|
}));
|
|
501
564
|
}
|
|
502
565
|
let d = c || (a === "number" ? "right" : "left");
|
|
503
|
-
return /* @__PURE__ */
|
|
566
|
+
return /* @__PURE__ */ X(yt, {
|
|
504
567
|
value: n,
|
|
505
568
|
align: d,
|
|
506
569
|
title: a === "longtext" || o?.clipMode === "ellipsis-tooltip" ? "" : void 0,
|
|
507
570
|
className: e(a === "number" && "font-mono tabular-nums", a === "number" && n < 0 && "text-rose-600 dark:text-rose-400", "px-3 min-h-full flex", a === "longtext" ? "items-start py-2 overflow-hidden" : o?.wrapText ? "items-start" : "items-center", d === "right" && "justify-end", d === "center" && "justify-center", s),
|
|
508
571
|
children: u
|
|
509
572
|
});
|
|
510
|
-
},
|
|
511
|
-
let d =
|
|
512
|
-
|
|
573
|
+
}, xt = ({ value: t, onChange: n, onBlur: r, columnType: i, autoFocus: o = !0, isFocused: s, className: c, placeholder: l, meta: u }) => {
|
|
574
|
+
let d = V.useRef(null);
|
|
575
|
+
V.useEffect(() => {
|
|
513
576
|
s && d.current && d.current.focus();
|
|
514
577
|
}, [s]);
|
|
515
|
-
let [f, p] =
|
|
578
|
+
let [f, p] = V.useState(() => t == null ? "" : i === "number" ? new Intl.NumberFormat("en-US", {
|
|
516
579
|
minimumFractionDigits: 0,
|
|
517
580
|
maximumFractionDigits: 20
|
|
518
581
|
}).format(t) : String(t)), m = (e) => {
|
|
@@ -533,7 +596,7 @@ var ut = (e, t = "id") => {
|
|
|
533
596
|
}
|
|
534
597
|
r?.();
|
|
535
598
|
}, g = u?.align || (i === "number" ? "right" : "left");
|
|
536
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ X(a, {
|
|
537
600
|
ref: d,
|
|
538
601
|
type: i === "date" ? "date" : "text",
|
|
539
602
|
value: f,
|
|
@@ -544,7 +607,7 @@ var ut = (e, t = "id") => {
|
|
|
544
607
|
placeholder: l,
|
|
545
608
|
onClick: (e) => e.stopPropagation()
|
|
546
609
|
});
|
|
547
|
-
},
|
|
610
|
+
}, St = {
|
|
548
611
|
text: [
|
|
549
612
|
{
|
|
550
613
|
label: "Contains",
|
|
@@ -623,34 +686,34 @@ var ut = (e, t = "id") => {
|
|
|
623
686
|
value: "between"
|
|
624
687
|
}
|
|
625
688
|
]
|
|
626
|
-
},
|
|
627
|
-
let o =
|
|
628
|
-
return /* @__PURE__ */
|
|
689
|
+
}, Ct = ({ columnType: e, value: t, valueTo: n, operator: r, onChange: i }) => {
|
|
690
|
+
let o = St[e === "datetime" || e === "date" ? "date" : e === "number" ? "number" : "text"] || St.text, s = e === "number" ? "number" : e === "date" || e === "datetime" ? "date" : "text";
|
|
691
|
+
return /* @__PURE__ */ Z("div", {
|
|
629
692
|
className: "p-3 space-y-3",
|
|
630
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
631
694
|
className: "space-y-1",
|
|
632
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ X("label", {
|
|
633
696
|
className: "text-xs font-medium text-muted-foreground ml-1",
|
|
634
697
|
children: "Condition"
|
|
635
|
-
}), /* @__PURE__ */
|
|
698
|
+
}), /* @__PURE__ */ Z(P, {
|
|
636
699
|
value: r,
|
|
637
700
|
onValueChange: (e) => i(t, e, n),
|
|
638
|
-
children: [/* @__PURE__ */
|
|
701
|
+
children: [/* @__PURE__ */ X(j, {
|
|
639
702
|
className: "h-8",
|
|
640
|
-
children: /* @__PURE__ */
|
|
641
|
-
}), /* @__PURE__ */
|
|
703
|
+
children: /* @__PURE__ */ X(A, {})
|
|
704
|
+
}), /* @__PURE__ */ X(M, { children: o.map((e) => /* @__PURE__ */ X(N, {
|
|
642
705
|
value: e.value,
|
|
643
706
|
children: e.label
|
|
644
707
|
}, e.value)) })]
|
|
645
708
|
})]
|
|
646
|
-
}), /* @__PURE__ */
|
|
709
|
+
}), /* @__PURE__ */ Z("div", {
|
|
647
710
|
className: "space-y-2",
|
|
648
711
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ X("label", {
|
|
650
713
|
className: "text-xs font-medium text-muted-foreground ml-1",
|
|
651
714
|
children: "Value"
|
|
652
715
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ X(a, {
|
|
654
717
|
type: s,
|
|
655
718
|
value: t ?? "",
|
|
656
719
|
onChange: (e) => i(e.target.value, r, n),
|
|
@@ -658,17 +721,17 @@ var ut = (e, t = "id") => {
|
|
|
658
721
|
placeholder: "Enter value...",
|
|
659
722
|
onClick: (e) => e.stopPropagation()
|
|
660
723
|
}),
|
|
661
|
-
r === "between" && /* @__PURE__ */
|
|
724
|
+
r === "between" && /* @__PURE__ */ Z(Me, { children: [/* @__PURE__ */ Z("div", {
|
|
662
725
|
className: "flex items-center gap-2 px-1",
|
|
663
726
|
children: [
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ X("div", { className: "h-[1px] flex-1 bg-border" }),
|
|
728
|
+
/* @__PURE__ */ X("span", {
|
|
666
729
|
className: "text-[10px] text-muted-foreground uppercase font-bold",
|
|
667
730
|
children: "and"
|
|
668
731
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ X("div", { className: "h-[1px] flex-1 bg-border" })
|
|
670
733
|
]
|
|
671
|
-
}), /* @__PURE__ */
|
|
734
|
+
}), /* @__PURE__ */ X(a, {
|
|
672
735
|
type: s,
|
|
673
736
|
value: n ?? "",
|
|
674
737
|
onChange: (e) => i(t, r, e.target.value),
|
|
@@ -682,59 +745,59 @@ var ut = (e, t = "id") => {
|
|
|
682
745
|
};
|
|
683
746
|
//#endregion
|
|
684
747
|
//#region src/components/ui/switch.tsx
|
|
685
|
-
function
|
|
686
|
-
return /* @__PURE__ */
|
|
748
|
+
function wt({ className: t, ref: n, ...r }) {
|
|
749
|
+
return /* @__PURE__ */ X(at.Root, {
|
|
687
750
|
className: e("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", t),
|
|
688
751
|
...r,
|
|
689
752
|
ref: n,
|
|
690
|
-
children: /* @__PURE__ */
|
|
753
|
+
children: /* @__PURE__ */ X(at.Thumb, { className: e("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") })
|
|
691
754
|
});
|
|
692
755
|
}
|
|
693
756
|
//#endregion
|
|
694
757
|
//#region src/shared/components/BooleanRenderer.tsx
|
|
695
|
-
var
|
|
758
|
+
var Tt = ({ value: t, trueLabel: n = "Yes", falseLabel: r = "No", nullLabel: i = "N/A", showIcon: a = !0, showLabel: o = !1, variant: s = "checkbox", className: c, disabled: l = !0, onChange: u }) => {
|
|
696
759
|
let d = t === !0, f = t === !1, p = t == null;
|
|
697
|
-
return s === "switch" ? /* @__PURE__ */
|
|
760
|
+
return s === "switch" ? /* @__PURE__ */ Z("div", {
|
|
698
761
|
className: e("flex items-center gap-2", c),
|
|
699
|
-
children: [/* @__PURE__ */
|
|
762
|
+
children: [/* @__PURE__ */ X(wt, {
|
|
700
763
|
checked: d,
|
|
701
764
|
onCheckedChange: u,
|
|
702
765
|
disabled: l,
|
|
703
766
|
className: "scale-90"
|
|
704
|
-
}), o && /* @__PURE__ */
|
|
767
|
+
}), o && /* @__PURE__ */ X("span", {
|
|
705
768
|
className: "text-sm font-medium",
|
|
706
769
|
children: d ? n : f ? r : i
|
|
707
770
|
})]
|
|
708
|
-
}) : /* @__PURE__ */
|
|
771
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
709
772
|
className: e("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md transition-colors text-sm font-medium", d && "bg-emerald-50/50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400", f && "bg-rose-50/50 text-rose-700 dark:bg-rose-900/20 dark:text-rose-400", p && "bg-muted/60 text-muted-foreground", c),
|
|
710
|
-
children: [a && /* @__PURE__ */
|
|
711
|
-
d && /* @__PURE__ */ Y
|
|
712
|
-
f && /* @__PURE__ */
|
|
713
|
-
p && /* @__PURE__ */
|
|
714
|
-
] }), o && /* @__PURE__ */
|
|
773
|
+
children: [a && /* @__PURE__ */ Z(Me, { children: [
|
|
774
|
+
d && /* @__PURE__ */ X(Y, { className: "w-3.5 h-3.5" }),
|
|
775
|
+
f && /* @__PURE__ */ X(Ae, { className: "w-3.5 h-3.5" }),
|
|
776
|
+
p && /* @__PURE__ */ X(Ce, { className: "w-3.5 h-3.5" })
|
|
777
|
+
] }), o && /* @__PURE__ */ X("span", {
|
|
715
778
|
className: "text-sm font-medium",
|
|
716
779
|
children: d ? n : f ? r : i
|
|
717
780
|
})]
|
|
718
781
|
});
|
|
719
|
-
},
|
|
782
|
+
}, Et = ({ value: t, onChange: n, trueLabel: r = "Yes", falseLabel: i = "No", variant: a = "checkbox", disabled: s = !1, className: c }) => {
|
|
720
783
|
let l = t === !0;
|
|
721
|
-
return a === "switch" ? /* @__PURE__ */
|
|
784
|
+
return a === "switch" ? /* @__PURE__ */ Z("div", {
|
|
722
785
|
className: e("flex items-center gap-2 p-2", c),
|
|
723
|
-
children: [/* @__PURE__ */
|
|
786
|
+
children: [/* @__PURE__ */ X(wt, {
|
|
724
787
|
id: "boolean-switch",
|
|
725
788
|
checked: l,
|
|
726
789
|
onCheckedChange: (e) => {
|
|
727
790
|
n(e);
|
|
728
791
|
},
|
|
729
792
|
disabled: s
|
|
730
|
-
}), /* @__PURE__ */
|
|
793
|
+
}), /* @__PURE__ */ X(o, {
|
|
731
794
|
htmlFor: "boolean-switch",
|
|
732
795
|
className: "text-sm font-medium cursor-pointer",
|
|
733
796
|
children: l ? r : i
|
|
734
797
|
})]
|
|
735
|
-
}) : /* @__PURE__ */
|
|
798
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
736
799
|
className: e("flex items-center gap-2 p-2", c),
|
|
737
|
-
children: [/* @__PURE__ */
|
|
800
|
+
children: [/* @__PURE__ */ X(te, {
|
|
738
801
|
id: "boolean-editor",
|
|
739
802
|
checked: l,
|
|
740
803
|
onCheckedChange: (e) => {
|
|
@@ -742,174 +805,174 @@ var Ct = ({ value: t, trueLabel: n = "Yes", falseLabel: r = "No", nullLabel: i =
|
|
|
742
805
|
},
|
|
743
806
|
disabled: s,
|
|
744
807
|
className: "data-[state=checked]:bg-primary data-[state=checked]:border-primary"
|
|
745
|
-
}), /* @__PURE__ */
|
|
808
|
+
}), /* @__PURE__ */ X(o, {
|
|
746
809
|
htmlFor: "boolean-editor",
|
|
747
810
|
className: "text-sm font-medium cursor-pointer",
|
|
748
811
|
children: l ? r : i
|
|
749
812
|
})]
|
|
750
813
|
});
|
|
751
|
-
},
|
|
814
|
+
}, Dt = ({ value: t, onChange: n, trueLabel: r = "Yes", falseLabel: i = "No", nullLabel: a = "N/A", allLabel: o = "All", className: s }) => /* @__PURE__ */ Z(P, {
|
|
752
815
|
value: t,
|
|
753
816
|
onValueChange: n,
|
|
754
|
-
children: [/* @__PURE__ */
|
|
817
|
+
children: [/* @__PURE__ */ X(j, {
|
|
755
818
|
className: e("w-full h-8", s),
|
|
756
|
-
children: /* @__PURE__ */
|
|
757
|
-
}), /* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ X(A, { placeholder: "Filter..." })
|
|
820
|
+
}), /* @__PURE__ */ Z(M, { children: [
|
|
821
|
+
/* @__PURE__ */ X(N, {
|
|
759
822
|
value: "all",
|
|
760
|
-
children: /* @__PURE__ */
|
|
823
|
+
children: /* @__PURE__ */ Z("div", {
|
|
761
824
|
className: "flex items-center gap-2",
|
|
762
|
-
children: [/* @__PURE__ */
|
|
825
|
+
children: [/* @__PURE__ */ X(Ce, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ X("span", { children: o })]
|
|
763
826
|
})
|
|
764
827
|
}),
|
|
765
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ X(N, {
|
|
766
829
|
value: "true",
|
|
767
|
-
children: /* @__PURE__ */
|
|
830
|
+
children: /* @__PURE__ */ Z("div", {
|
|
768
831
|
className: "flex items-center gap-2",
|
|
769
|
-
children: [/* @__PURE__ */ Y
|
|
832
|
+
children: [/* @__PURE__ */ X(Y, { className: "w-4 h-4 text-emerald-600" }), /* @__PURE__ */ X("span", { children: r })]
|
|
770
833
|
})
|
|
771
834
|
}),
|
|
772
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ X(N, {
|
|
773
836
|
value: "false",
|
|
774
|
-
children: /* @__PURE__ */
|
|
837
|
+
children: /* @__PURE__ */ Z("div", {
|
|
775
838
|
className: "flex items-center gap-2",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
839
|
+
children: [/* @__PURE__ */ X(Ae, { className: "w-4 h-4 text-rose-600" }), /* @__PURE__ */ X("span", { children: i })]
|
|
777
840
|
})
|
|
778
841
|
}),
|
|
779
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ X(N, {
|
|
780
843
|
value: "null",
|
|
781
|
-
children: /* @__PURE__ */
|
|
844
|
+
children: /* @__PURE__ */ Z("div", {
|
|
782
845
|
className: "flex items-center gap-2",
|
|
783
|
-
children: [/* @__PURE__ */
|
|
846
|
+
children: [/* @__PURE__ */ X(Ce, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ X("span", { children: a })]
|
|
784
847
|
})
|
|
785
848
|
})
|
|
786
849
|
] })]
|
|
787
|
-
}),
|
|
850
|
+
}), Ot = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(ot.Root, {
|
|
788
851
|
className: e("grid gap-2", t),
|
|
789
852
|
...n,
|
|
790
853
|
ref: r
|
|
791
854
|
}));
|
|
792
|
-
|
|
793
|
-
var
|
|
855
|
+
Ot.displayName = ot.Root.displayName;
|
|
856
|
+
var kt = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(ot.Item, {
|
|
794
857
|
ref: r,
|
|
795
858
|
className: e("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary", t),
|
|
796
859
|
...n,
|
|
797
|
-
children: /* @__PURE__ */
|
|
860
|
+
children: /* @__PURE__ */ X(ot.Indicator, {
|
|
798
861
|
className: "flex items-center justify-center",
|
|
799
|
-
children: /* @__PURE__ */
|
|
862
|
+
children: /* @__PURE__ */ X(he, { className: "h-1.5 w-1.5 fill-white text-white" })
|
|
800
863
|
})
|
|
801
864
|
}));
|
|
802
|
-
|
|
865
|
+
kt.displayName = ot.Item.displayName;
|
|
803
866
|
//#endregion
|
|
804
867
|
//#region src/components/ui/command.tsx
|
|
805
|
-
var
|
|
868
|
+
var At = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(Q, {
|
|
806
869
|
ref: r,
|
|
807
870
|
className: e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", t),
|
|
808
871
|
...n
|
|
809
872
|
}));
|
|
810
|
-
|
|
811
|
-
var
|
|
873
|
+
At.displayName = Q.displayName;
|
|
874
|
+
var jt = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ Z("div", {
|
|
812
875
|
className: "flex items-center border-b px-3",
|
|
813
876
|
"cmdk-input-wrapper": "",
|
|
814
|
-
children: [/* @__PURE__ */
|
|
877
|
+
children: [/* @__PURE__ */ X(Oe, { className: "me-2 h-4 w-4 shrink-0 opacity-50" }), /* @__PURE__ */ X(Q.Input, {
|
|
815
878
|
ref: r,
|
|
816
879
|
className: e("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", t),
|
|
817
880
|
...n
|
|
818
881
|
})]
|
|
819
882
|
}));
|
|
820
|
-
|
|
821
|
-
var
|
|
883
|
+
jt.displayName = Q.Input.displayName;
|
|
884
|
+
var Mt = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(Q.List, {
|
|
822
885
|
ref: r,
|
|
823
886
|
className: e("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
|
|
824
887
|
...n
|
|
825
888
|
}));
|
|
826
|
-
|
|
827
|
-
var
|
|
889
|
+
Mt.displayName = Q.List.displayName;
|
|
890
|
+
var Nt = B.forwardRef((e, t) => /* @__PURE__ */ X(Q.Empty, {
|
|
828
891
|
ref: t,
|
|
829
892
|
className: "py-6 text-center text-sm text-muted-foreground",
|
|
830
893
|
...e
|
|
831
894
|
}));
|
|
832
|
-
|
|
833
|
-
var
|
|
895
|
+
Nt.displayName = Q.Empty.displayName;
|
|
896
|
+
var Pt = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(Q.Group, {
|
|
834
897
|
ref: r,
|
|
835
898
|
className: e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", t),
|
|
836
899
|
...n
|
|
837
900
|
}));
|
|
838
|
-
|
|
839
|
-
var
|
|
901
|
+
Pt.displayName = Q.Group.displayName;
|
|
902
|
+
var Ft = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(Q.Separator, {
|
|
840
903
|
ref: r,
|
|
841
904
|
className: e("-mx-1 h-px bg-border", t),
|
|
842
905
|
...n
|
|
843
906
|
}));
|
|
844
|
-
|
|
845
|
-
var
|
|
907
|
+
Ft.displayName = Q.Separator.displayName;
|
|
908
|
+
var It = B.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ X(Q.Item, {
|
|
846
909
|
ref: r,
|
|
847
910
|
className: e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-[selected='true']:bg-accent aria-[selected='true']:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50 text-start", t),
|
|
848
911
|
...n
|
|
849
912
|
}));
|
|
850
|
-
|
|
851
|
-
var
|
|
913
|
+
It.displayName = Q.Item.displayName;
|
|
914
|
+
var Lt = ({ className: t, ...n }) => /* @__PURE__ */ X("span", {
|
|
852
915
|
className: e("ms-auto text-xs tracking-widest text-muted-foreground", t),
|
|
853
916
|
...n
|
|
854
917
|
});
|
|
855
|
-
|
|
918
|
+
Lt.displayName = "CommandShortcut";
|
|
856
919
|
//#endregion
|
|
857
920
|
//#region src/shared/components/SearchableSelect.tsx
|
|
858
|
-
var
|
|
859
|
-
let [c, l] =
|
|
921
|
+
var Rt = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select option...", className: o, onBlur: s }) => {
|
|
922
|
+
let [c, l] = q(!1), [u, d] = q(""), f = G(() => {
|
|
860
923
|
if (!u) return r;
|
|
861
924
|
let e = u.toLowerCase();
|
|
862
925
|
return r.filter((t) => t.label.toLowerCase().includes(e) || t.value.toLowerCase().includes(e));
|
|
863
|
-
}, [r, u]), [p,
|
|
926
|
+
}, [r, u]), [p, m] = q(null), h = Pe({
|
|
864
927
|
count: f.length,
|
|
865
928
|
getScrollElement: () => p,
|
|
866
929
|
estimateSize: () => 35,
|
|
867
930
|
overscan: 5
|
|
868
931
|
});
|
|
869
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ Z(C, {
|
|
870
933
|
open: c,
|
|
871
934
|
onOpenChange: l,
|
|
872
|
-
children: [/* @__PURE__ */
|
|
935
|
+
children: [/* @__PURE__ */ X(S, {
|
|
873
936
|
asChild: !0,
|
|
874
|
-
children: /* @__PURE__ */
|
|
937
|
+
children: /* @__PURE__ */ Z(i, {
|
|
875
938
|
variant: "outline",
|
|
876
939
|
role: "combobox",
|
|
877
940
|
"aria-expanded": c,
|
|
878
941
|
className: e("w-full justify-between h-8 px-2 font-normal text-xs", o),
|
|
879
|
-
children: [/* @__PURE__ */
|
|
942
|
+
children: [/* @__PURE__ */ X("span", {
|
|
880
943
|
className: "truncate",
|
|
881
944
|
children: t ? r.find((e) => e.value === t)?.label || t : a
|
|
882
|
-
}), /* @__PURE__ */
|
|
945
|
+
}), /* @__PURE__ */ X(me, { className: "ml-2 h-3 w-3 shrink-0 opacity-50" })]
|
|
883
946
|
})
|
|
884
|
-
}), /* @__PURE__ */
|
|
947
|
+
}), /* @__PURE__ */ X(x, {
|
|
885
948
|
className: "w-[var(--radix-popover-trigger-width)] p-0 max-h-[400px] overflow-hidden",
|
|
886
949
|
align: "start",
|
|
887
950
|
side: "bottom",
|
|
888
951
|
collisionPadding: 10,
|
|
889
|
-
children: /* @__PURE__ */
|
|
952
|
+
children: /* @__PURE__ */ Z(At, {
|
|
890
953
|
shouldFilter: !1,
|
|
891
954
|
className: "h-full",
|
|
892
|
-
children: [/* @__PURE__ */
|
|
955
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
893
956
|
className: "flex items-center border-b px-3",
|
|
894
|
-
children: [/* @__PURE__ */
|
|
957
|
+
children: [/* @__PURE__ */ X(Oe, { className: "mr-2 h-3.5 w-3.5 shrink-0 opacity-50" }), /* @__PURE__ */ X("input", {
|
|
895
958
|
className: "flex h-9 w-full rounded-md bg-transparent py-3 text-xs outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 text-zinc-950 dark:text-zinc-50",
|
|
896
959
|
placeholder: "Type to search...",
|
|
897
960
|
value: u,
|
|
898
961
|
onChange: (e) => d(e.target.value)
|
|
899
962
|
})]
|
|
900
|
-
}), /* @__PURE__ */
|
|
901
|
-
ref:
|
|
963
|
+
}), /* @__PURE__ */ Z(Mt, {
|
|
964
|
+
ref: m,
|
|
902
965
|
className: "max-h-[300px] overflow-y-auto",
|
|
903
966
|
style: { maxHeight: "300px" },
|
|
904
|
-
children: [f.length === 0 && /* @__PURE__ */
|
|
967
|
+
children: [f.length === 0 && /* @__PURE__ */ X(Nt, { children: "No option found." }), /* @__PURE__ */ X("div", {
|
|
905
968
|
style: {
|
|
906
|
-
height: `${
|
|
969
|
+
height: `${h.getTotalSize()}px`,
|
|
907
970
|
width: "100%",
|
|
908
971
|
position: "relative"
|
|
909
972
|
},
|
|
910
|
-
children:
|
|
973
|
+
children: h.getVirtualItems().map((r) => {
|
|
911
974
|
let i = f[r.index];
|
|
912
|
-
return /* @__PURE__ */
|
|
975
|
+
return /* @__PURE__ */ X("div", {
|
|
913
976
|
style: {
|
|
914
977
|
position: "absolute",
|
|
915
978
|
top: 0,
|
|
@@ -918,16 +981,16 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
918
981
|
height: `${r.size}px`,
|
|
919
982
|
transform: `translateY(${r.start}px)`
|
|
920
983
|
},
|
|
921
|
-
children: /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ Z(It, {
|
|
922
985
|
value: i.value,
|
|
923
986
|
onSelect: (e) => {
|
|
924
987
|
n(e === t ? "" : e), l(!1), d("");
|
|
925
988
|
},
|
|
926
989
|
className: "flex items-center justify-between text-xs py-1.5",
|
|
927
|
-
children: [/* @__PURE__ */
|
|
990
|
+
children: [/* @__PURE__ */ X("span", {
|
|
928
991
|
className: "truncate",
|
|
929
992
|
children: i.label
|
|
930
|
-
}), /* @__PURE__ */ Y
|
|
993
|
+
}), /* @__PURE__ */ X(Y, { className: e("h-3 w-3", t === i.value ? "opacity-100" : "opacity-0") })]
|
|
931
994
|
})
|
|
932
995
|
}, r.key);
|
|
933
996
|
})
|
|
@@ -936,13 +999,13 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
936
999
|
})
|
|
937
1000
|
})]
|
|
938
1001
|
});
|
|
939
|
-
},
|
|
940
|
-
if (t == null) return /* @__PURE__ */
|
|
1002
|
+
}, zt = ({ value: t, options: n = [], className: r, table: i }) => {
|
|
1003
|
+
if (t == null) return /* @__PURE__ */ X("span", {
|
|
941
1004
|
className: "text-muted-foreground text-sm italic",
|
|
942
1005
|
children: "—"
|
|
943
1006
|
});
|
|
944
1007
|
let a = Array.isArray(t) ? t : [t];
|
|
945
|
-
if (a.length === 0) return /* @__PURE__ */
|
|
1008
|
+
if (a.length === 0) return /* @__PURE__ */ X("span", {
|
|
946
1009
|
className: "text-muted-foreground text-sm italic",
|
|
947
1010
|
children: "—"
|
|
948
1011
|
});
|
|
@@ -962,55 +1025,55 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
962
1025
|
isColored: !n
|
|
963
1026
|
};
|
|
964
1027
|
};
|
|
965
|
-
return /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ X("div", {
|
|
966
1029
|
className: e("inline-flex items-center gap-1.5 flex-wrap py-1", r),
|
|
967
1030
|
children: o.map((e, t) => {
|
|
968
1031
|
let n = s(e.color);
|
|
969
|
-
return /* @__PURE__ */
|
|
1032
|
+
return /* @__PURE__ */ Z("div", {
|
|
970
1033
|
className: "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[13px] font-bold border transition-all duration-300 shadow-sm",
|
|
971
1034
|
style: n.container,
|
|
972
|
-
children: [/* @__PURE__ */
|
|
1035
|
+
children: [/* @__PURE__ */ X("span", {
|
|
973
1036
|
className: "w-1.5 h-1.5 rounded-full",
|
|
974
1037
|
style: n.dot
|
|
975
|
-
}), i?.options.meta?.enableSearchHighlighting ? /* @__PURE__ */
|
|
1038
|
+
}), i?.options.meta?.enableSearchHighlighting ? /* @__PURE__ */ X(k, {
|
|
976
1039
|
text: e.label,
|
|
977
1040
|
highlight: typeof i.getState().globalFilter == "string" ? i.getState().globalFilter : i.getState().globalFilter?.quickSearch
|
|
978
1041
|
}) : e.label]
|
|
979
1042
|
}, `${e.value}-${t}`);
|
|
980
1043
|
})
|
|
981
1044
|
});
|
|
982
|
-
},
|
|
983
|
-
let [u, d] =
|
|
984
|
-
return
|
|
1045
|
+
}, Bt = ({ value: t, onChange: n, options: r = [], variant: i = "dropdown", onBlur: a, className: s, placeholder: c = "Select...", isFocused: l }) => {
|
|
1046
|
+
let [u, d] = V.useState(!1), f = V.useRef(!1);
|
|
1047
|
+
return V.useEffect(() => {
|
|
985
1048
|
l && i === "dropdown" ? f.current ||= (d(!0), !0) : (d(!1), f.current = !1);
|
|
986
|
-
}, [l, i]), i === "combobox" ? /* @__PURE__ */
|
|
1049
|
+
}, [l, i]), i === "combobox" ? /* @__PURE__ */ X("div", {
|
|
987
1050
|
className: e("w-full", s),
|
|
988
|
-
children: /* @__PURE__ */
|
|
1051
|
+
children: /* @__PURE__ */ X(Rt, {
|
|
989
1052
|
value: t,
|
|
990
1053
|
onChange: n,
|
|
991
1054
|
options: r,
|
|
992
1055
|
placeholder: c,
|
|
993
1056
|
onBlur: a
|
|
994
1057
|
})
|
|
995
|
-
}) : i === "radio" ? /* @__PURE__ */
|
|
1058
|
+
}) : i === "radio" ? /* @__PURE__ */ X("div", {
|
|
996
1059
|
className: e("w-full px-2 py-1", s),
|
|
997
1060
|
onBlur: a,
|
|
998
|
-
children: /* @__PURE__ */
|
|
1061
|
+
children: /* @__PURE__ */ X(Ot, {
|
|
999
1062
|
value: t || "",
|
|
1000
1063
|
onValueChange: n,
|
|
1001
|
-
children: r.map((e) => /* @__PURE__ */
|
|
1064
|
+
children: r.map((e) => /* @__PURE__ */ Z("div", {
|
|
1002
1065
|
className: "flex items-center space-x-2",
|
|
1003
|
-
children: [/* @__PURE__ */
|
|
1066
|
+
children: [/* @__PURE__ */ X(kt, {
|
|
1004
1067
|
value: e.value,
|
|
1005
1068
|
id: `radio-${e.value}`
|
|
1006
|
-
}), /* @__PURE__ */
|
|
1069
|
+
}), /* @__PURE__ */ X(o, {
|
|
1007
1070
|
htmlFor: `radio-${e.value}`,
|
|
1008
1071
|
className: "text-xs font-medium cursor-pointer",
|
|
1009
1072
|
children: e.label
|
|
1010
1073
|
})]
|
|
1011
1074
|
}, e.value))
|
|
1012
1075
|
})
|
|
1013
|
-
}) : /* @__PURE__ */
|
|
1076
|
+
}) : /* @__PURE__ */ X("div", {
|
|
1014
1077
|
className: e("w-full -m-1 p-0.5", s),
|
|
1015
1078
|
onBlur: a,
|
|
1016
1079
|
onKeyDown: (e) => {
|
|
@@ -1021,49 +1084,49 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1021
1084
|
"ArrowDown"
|
|
1022
1085
|
].includes(e.key) && e.stopPropagation();
|
|
1023
1086
|
},
|
|
1024
|
-
children: /* @__PURE__ */
|
|
1087
|
+
children: /* @__PURE__ */ Z(P, {
|
|
1025
1088
|
value: t,
|
|
1026
1089
|
onValueChange: n,
|
|
1027
1090
|
open: u,
|
|
1028
1091
|
onOpenChange: d,
|
|
1029
|
-
children: [/* @__PURE__ */
|
|
1092
|
+
children: [/* @__PURE__ */ X(j, {
|
|
1030
1093
|
className: "h-7 py-0 border-0 shadow-none bg-transparent focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none",
|
|
1031
|
-
children: /* @__PURE__ */
|
|
1032
|
-
}), /* @__PURE__ */
|
|
1094
|
+
children: /* @__PURE__ */ X(A, { placeholder: c })
|
|
1095
|
+
}), /* @__PURE__ */ X(M, { children: r.map((e) => /* @__PURE__ */ X(N, {
|
|
1033
1096
|
value: e.value,
|
|
1034
1097
|
children: e.label
|
|
1035
1098
|
}, e.value)) })]
|
|
1036
1099
|
})
|
|
1037
1100
|
});
|
|
1038
|
-
},
|
|
1101
|
+
}, Vt = ({ options: t = [], selectedValues: n = [], onChange: r, className: i }) => {
|
|
1039
1102
|
let a = (e) => {
|
|
1040
1103
|
n.includes(e) ? r(n.filter((t) => t !== e)) : r([...n, e]);
|
|
1041
1104
|
};
|
|
1042
|
-
return /* @__PURE__ */
|
|
1105
|
+
return /* @__PURE__ */ Z("div", {
|
|
1043
1106
|
className: e("flex flex-col gap-2 p-2 min-w-[180px]", i),
|
|
1044
|
-
children: [/* @__PURE__ */
|
|
1107
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
1045
1108
|
className: "flex items-center justify-between border-b pb-2 mb-1",
|
|
1046
|
-
children: [/* @__PURE__ */
|
|
1109
|
+
children: [/* @__PURE__ */ X("span", {
|
|
1047
1110
|
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider",
|
|
1048
1111
|
children: "Filter Options"
|
|
1049
|
-
}), /* @__PURE__ */
|
|
1112
|
+
}), /* @__PURE__ */ X("button", {
|
|
1050
1113
|
onClick: () => {
|
|
1051
1114
|
n.length === t.length ? r([]) : r(t.map((e) => e.value));
|
|
1052
1115
|
},
|
|
1053
1116
|
className: "text-[10px] font-medium text-primary hover:underline",
|
|
1054
1117
|
children: n.length === t.length ? "Clear All" : "Select All"
|
|
1055
1118
|
})]
|
|
1056
|
-
}), /* @__PURE__ */
|
|
1119
|
+
}), /* @__PURE__ */ X("div", {
|
|
1057
1120
|
className: "max-h-[180px] overflow-y-auto",
|
|
1058
|
-
children: /* @__PURE__ */
|
|
1121
|
+
children: /* @__PURE__ */ X("div", {
|
|
1059
1122
|
className: "flex flex-col gap-2 pr-2",
|
|
1060
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1123
|
+
children: t.map((e) => /* @__PURE__ */ Z("div", {
|
|
1061
1124
|
className: "flex items-center gap-2",
|
|
1062
|
-
children: [/* @__PURE__ */
|
|
1125
|
+
children: [/* @__PURE__ */ X(te, {
|
|
1063
1126
|
id: `filter-${e.value}`,
|
|
1064
1127
|
checked: n.includes(e.value),
|
|
1065
1128
|
onCheckedChange: () => a(e.value)
|
|
1066
|
-
}), /* @__PURE__ */
|
|
1129
|
+
}), /* @__PURE__ */ X(o, {
|
|
1067
1130
|
htmlFor: `filter-${e.value}`,
|
|
1068
1131
|
className: "text-sm font-normal cursor-pointer flex-1",
|
|
1069
1132
|
children: e.label
|
|
@@ -1072,13 +1135,13 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1072
1135
|
})
|
|
1073
1136
|
})]
|
|
1074
1137
|
});
|
|
1075
|
-
},
|
|
1138
|
+
}, Ht = ({ value: t, showLabel: n = !0, color: r = "default", size: i = "md", className: a }) => {
|
|
1076
1139
|
let o = Math.max(0, Math.min(100, t));
|
|
1077
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ Z("div", {
|
|
1078
1141
|
className: e("flex items-center gap-2 w-full", a),
|
|
1079
|
-
children: [/* @__PURE__ */
|
|
1142
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1080
1143
|
className: "flex-1 bg-muted rounded-full overflow-hidden min-w-[60px]",
|
|
1081
|
-
children: /* @__PURE__ */
|
|
1144
|
+
children: /* @__PURE__ */ X("div", {
|
|
1082
1145
|
className: e("transition-all duration-300 rounded-full", (() => {
|
|
1083
1146
|
switch (i) {
|
|
1084
1147
|
case "sm": return "h-1.5";
|
|
@@ -1096,13 +1159,13 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1096
1159
|
})()),
|
|
1097
1160
|
style: { width: `${o}%` }
|
|
1098
1161
|
})
|
|
1099
|
-
}), n && /* @__PURE__ */
|
|
1162
|
+
}), n && /* @__PURE__ */ Z("span", {
|
|
1100
1163
|
className: "text-xs font-medium text-muted-foreground tabular-nums min-w-[42px] text-right",
|
|
1101
1164
|
children: [o.toFixed(0), "%"]
|
|
1102
1165
|
})]
|
|
1103
1166
|
});
|
|
1104
|
-
},
|
|
1105
|
-
let c = t || n || [], l =
|
|
1167
|
+
}, Ut = ({ value: t, values: n, color: r = "default", height: i = 32, width: a = 100, showDots: o = !1, className: s }) => {
|
|
1168
|
+
let c = t || n || [], l = G(() => {
|
|
1106
1169
|
if (!c || c.length === 0) return "";
|
|
1107
1170
|
let e = Math.max(...c), t = Math.min(...c), n = e - t || 1;
|
|
1108
1171
|
return `M ${c.map((e, r) => `${r / (c.length - 1) * a},${i - (e - t) / n * i}`).join(" L ")}`;
|
|
@@ -1110,7 +1173,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1110
1173
|
c,
|
|
1111
1174
|
i,
|
|
1112
1175
|
a
|
|
1113
|
-
]), u =
|
|
1176
|
+
]), u = G(() => {
|
|
1114
1177
|
if (!c || c.length === 0 || !o) return [];
|
|
1115
1178
|
let e = Math.max(...c), t = Math.min(...c), n = e - t || 1;
|
|
1116
1179
|
return c.map((e, r) => ({
|
|
@@ -1139,83 +1202,83 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1139
1202
|
default: return "fill-primary";
|
|
1140
1203
|
}
|
|
1141
1204
|
};
|
|
1142
|
-
return !c || c.length === 0 ? /* @__PURE__ */
|
|
1205
|
+
return !c || c.length === 0 ? /* @__PURE__ */ X("div", {
|
|
1143
1206
|
className: "text-muted-foreground text-xs italic",
|
|
1144
1207
|
children: "No data"
|
|
1145
|
-
}) : /* @__PURE__ */
|
|
1208
|
+
}) : /* @__PURE__ */ Z("svg", {
|
|
1146
1209
|
width: a,
|
|
1147
1210
|
height: i,
|
|
1148
1211
|
className: e("inline-block", s),
|
|
1149
1212
|
viewBox: `0 0 ${a} ${i}`,
|
|
1150
|
-
children: [/* @__PURE__ */
|
|
1213
|
+
children: [/* @__PURE__ */ X("path", {
|
|
1151
1214
|
d: l,
|
|
1152
1215
|
fill: "none",
|
|
1153
1216
|
className: e("transition-colors", d()),
|
|
1154
1217
|
strokeWidth: "2",
|
|
1155
1218
|
strokeLinecap: "round",
|
|
1156
1219
|
strokeLinejoin: "round"
|
|
1157
|
-
}), o && u.map((t, n) => /* @__PURE__ */
|
|
1220
|
+
}), o && u.map((t, n) => /* @__PURE__ */ X("circle", {
|
|
1158
1221
|
cx: t.x,
|
|
1159
1222
|
cy: t.y,
|
|
1160
1223
|
r: "2",
|
|
1161
1224
|
className: e("transition-colors", f())
|
|
1162
1225
|
}, n))]
|
|
1163
1226
|
});
|
|
1164
|
-
},
|
|
1227
|
+
}, Wt = re({ renderers: {
|
|
1165
1228
|
text: {
|
|
1166
|
-
Cell:
|
|
1167
|
-
Editor:
|
|
1229
|
+
Cell: bt,
|
|
1230
|
+
Editor: xt
|
|
1168
1231
|
},
|
|
1169
1232
|
number: {
|
|
1170
|
-
Cell:
|
|
1171
|
-
Editor:
|
|
1233
|
+
Cell: bt,
|
|
1234
|
+
Editor: xt
|
|
1172
1235
|
},
|
|
1173
1236
|
date: {
|
|
1174
|
-
Cell:
|
|
1175
|
-
Editor:
|
|
1237
|
+
Cell: bt,
|
|
1238
|
+
Editor: xt
|
|
1176
1239
|
},
|
|
1177
1240
|
datetime: {
|
|
1178
|
-
Cell:
|
|
1179
|
-
Editor:
|
|
1241
|
+
Cell: bt,
|
|
1242
|
+
Editor: xt
|
|
1180
1243
|
},
|
|
1181
1244
|
longtext: {
|
|
1182
|
-
Cell:
|
|
1183
|
-
Editor:
|
|
1245
|
+
Cell: bt,
|
|
1246
|
+
Editor: xt
|
|
1184
1247
|
},
|
|
1185
1248
|
boolean: {
|
|
1186
|
-
Cell:
|
|
1187
|
-
Editor:
|
|
1249
|
+
Cell: Tt,
|
|
1250
|
+
Editor: Et
|
|
1188
1251
|
},
|
|
1189
1252
|
select: {
|
|
1190
|
-
Cell:
|
|
1191
|
-
Editor:
|
|
1253
|
+
Cell: zt,
|
|
1254
|
+
Editor: Bt
|
|
1192
1255
|
},
|
|
1193
1256
|
multiselect: {
|
|
1194
|
-
Cell:
|
|
1195
|
-
Editor:
|
|
1257
|
+
Cell: zt,
|
|
1258
|
+
Editor: Bt
|
|
1196
1259
|
},
|
|
1197
|
-
progress: { Cell:
|
|
1198
|
-
sparkline: { Cell:
|
|
1260
|
+
progress: { Cell: Ht },
|
|
1261
|
+
sparkline: { Cell: Ut },
|
|
1199
1262
|
chart: { Cell: (e) => {
|
|
1200
1263
|
let t = e.value;
|
|
1201
|
-
return Array.isArray(t) ?
|
|
1264
|
+
return Array.isArray(t) ? V.createElement(Ut, {
|
|
1202
1265
|
values: t,
|
|
1203
1266
|
...e
|
|
1204
|
-
}) :
|
|
1267
|
+
}) : V.createElement(Ht, {
|
|
1205
1268
|
value: t,
|
|
1206
1269
|
...e
|
|
1207
1270
|
});
|
|
1208
1271
|
} }
|
|
1209
|
-
} }),
|
|
1210
|
-
let { renderers: i } =
|
|
1211
|
-
|
|
1272
|
+
} }), Gt = () => ie(Wt), Kt = ({ getValue: e, row: t, column: n, table: r }) => {
|
|
1273
|
+
let { renderers: i } = Gt(), a = e(), [o, s] = q(a), c = n.columnDef.meta, l = c?.columnType || "text", u = !r.options.meta?.isRowEditable || r.options.meta.isRowEditable(t.original), d = !r.options.meta?.isCellEditable || r.options.meta.isCellEditable(t.original, n.id), f = n.columnDef.enableEditing !== !1, p = r.options.meta?.enableEditing || !1, m = r.options.meta?.editingRows?.[t.index] || !1, h = p && m && u && d && f;
|
|
1274
|
+
W(() => {
|
|
1212
1275
|
s(a);
|
|
1213
1276
|
}, [a]);
|
|
1214
1277
|
let g = () => {
|
|
1215
1278
|
r.options.meta?.updateData(t.index, n.id, o);
|
|
1216
1279
|
}, _ = (e) => {
|
|
1217
1280
|
s(e), (l === "boolean" || l === "select") && r.options.meta?.updateData(t.index, n.id, e);
|
|
1218
|
-
}, v =
|
|
1281
|
+
}, v = G(() => ({
|
|
1219
1282
|
getValue: e,
|
|
1220
1283
|
row: t,
|
|
1221
1284
|
column: n,
|
|
@@ -1242,7 +1305,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1242
1305
|
if (h) {
|
|
1243
1306
|
if (c?.Editor) {
|
|
1244
1307
|
let e = c.Editor;
|
|
1245
|
-
return /* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ X(e, { ...v });
|
|
1246
1309
|
}
|
|
1247
1310
|
let e = i[l];
|
|
1248
1311
|
if (e?.Editor) {
|
|
@@ -1250,7 +1313,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1250
1313
|
...l === "boolean" ? c?.booleanOptions : {},
|
|
1251
1314
|
...l === "select" ? c?.selectOptions : {}
|
|
1252
1315
|
};
|
|
1253
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ X(t, {
|
|
1254
1317
|
...v,
|
|
1255
1318
|
...n
|
|
1256
1319
|
});
|
|
@@ -1258,7 +1321,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1258
1321
|
}
|
|
1259
1322
|
if (c?.Cell) {
|
|
1260
1323
|
let e = c.Cell;
|
|
1261
|
-
return /* @__PURE__ */
|
|
1324
|
+
return /* @__PURE__ */ X(e, { ...v });
|
|
1262
1325
|
}
|
|
1263
1326
|
let y = (i[l] || i.text).Cell, b = {
|
|
1264
1327
|
...l === "boolean" ? c?.booleanOptions : {},
|
|
@@ -1269,11 +1332,11 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1269
1332
|
...l === "select" ? c?.selectOptions : {},
|
|
1270
1333
|
...l === "progress" || l === "chart" || l === "sparkline" ? c?.chartOptions : {}
|
|
1271
1334
|
};
|
|
1272
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ X(y, {
|
|
1273
1336
|
...v,
|
|
1274
1337
|
...b
|
|
1275
1338
|
});
|
|
1276
|
-
}, $ = (e, t) => typeof e == "function" ? e(t) : e,
|
|
1339
|
+
}, $ = (e, t) => typeof e == "function" ? e(t) : e, qt = (e, t) => {
|
|
1277
1340
|
let { columns: n, rowCount: r, pageCount: i, pagination: a, pageSize: o = 10, enableRowSelection: s, selectionSettings: c, enableGrouping: u, enableRowPinning: d, enableColumnPinning: f, enableTreeData: p, getSubRows: m, manualPagination: h, manualSorting: g, manualFiltering: _, enablePersistence: v, persistenceKey: y, defaultGrouping: b = [], getRowId: x } = e, S = !!e.service || !!e.serviceName, { state: C, setState: w } = l({
|
|
1278
1341
|
initialState: {
|
|
1279
1342
|
sorting: [],
|
|
@@ -1299,101 +1362,116 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1299
1362
|
columnOrder: []
|
|
1300
1363
|
},
|
|
1301
1364
|
persistenceKey: v ? y : void 0
|
|
1302
|
-
}), T =
|
|
1303
|
-
w((
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
return setTimeout(() => {
|
|
1319
|
-
e.onPaginationChange?.(r), e.onPageChange?.({
|
|
1320
|
-
action: "page",
|
|
1321
|
-
currentPage: r.pageIndex + 1
|
|
1322
|
-
});
|
|
1323
|
-
}, 0), {
|
|
1324
|
-
...n,
|
|
1325
|
-
pagination: r
|
|
1326
|
-
};
|
|
1327
|
-
});
|
|
1328
|
-
}, O = (n) => {
|
|
1329
|
-
w((r) => {
|
|
1330
|
-
let i = $(n, r.rowSelection), a = T.current, o = Object.keys(a).filter((e) => a[e]), s = Object.keys(i).filter((e) => i[e]), c = s.filter((e) => !o.includes(e)), l = o.filter((e) => !s.includes(e));
|
|
1331
|
-
return setTimeout(() => {
|
|
1332
|
-
e.onRowSelectionChange?.(i), c.forEach((n) => {
|
|
1333
|
-
let r = parseInt(n);
|
|
1334
|
-
!isNaN(r) && t[r] && e.onRowSelect?.({
|
|
1335
|
-
data: t[r],
|
|
1336
|
-
rowIndex: r
|
|
1337
|
-
});
|
|
1338
|
-
}), l.forEach((n) => {
|
|
1339
|
-
let r = parseInt(n);
|
|
1340
|
-
!isNaN(r) && t[r] && e.onRowDeselect?.({
|
|
1341
|
-
data: t[r],
|
|
1342
|
-
rowIndex: r
|
|
1343
|
-
});
|
|
1344
|
-
});
|
|
1345
|
-
}, 0), T.current = i, {
|
|
1346
|
-
...r,
|
|
1347
|
-
rowSelection: i
|
|
1365
|
+
}), T = K({}), E = (e) => {
|
|
1366
|
+
w((t) => ({
|
|
1367
|
+
...t,
|
|
1368
|
+
sorting: $(e, t.sorting)
|
|
1369
|
+
}));
|
|
1370
|
+
}, D = (e) => {
|
|
1371
|
+
w((t) => ({
|
|
1372
|
+
...t,
|
|
1373
|
+
pagination: $(e, t.pagination)
|
|
1374
|
+
}));
|
|
1375
|
+
}, O = (e) => {
|
|
1376
|
+
w((t) => {
|
|
1377
|
+
let n = $(e, t.rowSelection);
|
|
1378
|
+
return T.current = n, {
|
|
1379
|
+
...t,
|
|
1380
|
+
rowSelection: n
|
|
1348
1381
|
};
|
|
1349
1382
|
});
|
|
1350
|
-
},
|
|
1383
|
+
}, ee = (e) => w((t) => ({
|
|
1351
1384
|
...t,
|
|
1352
1385
|
columnFilters: $(e, t.columnFilters)
|
|
1353
|
-
})),
|
|
1386
|
+
})), k = (e) => w((t) => ({
|
|
1354
1387
|
...t,
|
|
1355
1388
|
globalFilter: $(e, t.globalFilter)
|
|
1356
|
-
})),
|
|
1389
|
+
})), A = (e) => w((t) => ({
|
|
1357
1390
|
...t,
|
|
1358
1391
|
columnSizing: $(e, t.columnSizing)
|
|
1359
|
-
})),
|
|
1392
|
+
})), j = (e) => w((t) => ({
|
|
1360
1393
|
...t,
|
|
1361
1394
|
grouping: $(e, t.grouping)
|
|
1362
|
-
})),
|
|
1395
|
+
})), M = (e) => w((t) => ({
|
|
1363
1396
|
...t,
|
|
1364
1397
|
expanded: $(e, t.expanded)
|
|
1365
|
-
})),
|
|
1398
|
+
})), N = (e) => w((t) => ({
|
|
1366
1399
|
...t,
|
|
1367
1400
|
rowPinning: $(e, t.rowPinning)
|
|
1368
|
-
})),
|
|
1401
|
+
})), P = (e) => w((t) => ({
|
|
1369
1402
|
...t,
|
|
1370
1403
|
columnPinning: $(e, t.columnPinning)
|
|
1371
|
-
})),
|
|
1404
|
+
})), te = (e) => w((t) => ({
|
|
1372
1405
|
...t,
|
|
1373
1406
|
columnVisibility: $(e, t.columnVisibility)
|
|
1374
|
-
})),
|
|
1375
|
-
w((
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1407
|
+
})), F = (e) => {
|
|
1408
|
+
w((t) => ({
|
|
1409
|
+
...t,
|
|
1410
|
+
columnOrder: $(e, t.columnOrder)
|
|
1411
|
+
}));
|
|
1412
|
+
}, I = K(!0), L = K(C.sorting), ne = K(C.pagination), R = K(C.rowSelection), z = K(C.columnOrder);
|
|
1413
|
+
W(() => {
|
|
1414
|
+
I.current || JSON.stringify(C.sorting) !== JSON.stringify(L.current) && (e.onSortingChange?.(C.sorting), e.onSort?.({ columns: C.sorting.map((e) => ({
|
|
1415
|
+
direction: e.desc ? "Descending" : "Ascending",
|
|
1416
|
+
name: e.id
|
|
1417
|
+
})) }), L.current = C.sorting);
|
|
1418
|
+
}, [
|
|
1419
|
+
C.sorting,
|
|
1420
|
+
e.onSortingChange,
|
|
1421
|
+
e.onSort
|
|
1422
|
+
]), W(() => {
|
|
1423
|
+
I.current || JSON.stringify(C.pagination) !== JSON.stringify(ne.current) && (e.onPaginationChange?.(C.pagination), e.onPageChange?.({
|
|
1424
|
+
action: "page",
|
|
1425
|
+
currentPage: C.pagination.pageIndex + 1
|
|
1426
|
+
}), ne.current = C.pagination);
|
|
1427
|
+
}, [
|
|
1428
|
+
C.pagination,
|
|
1429
|
+
e.onPaginationChange,
|
|
1430
|
+
e.onPageChange
|
|
1431
|
+
]), W(() => {
|
|
1432
|
+
if (!I.current && JSON.stringify(C.rowSelection) !== JSON.stringify(R.current)) {
|
|
1433
|
+
e.onRowSelectionChange?.(C.rowSelection);
|
|
1434
|
+
let n = Object.keys(R.current).filter((e) => R.current[e]), r = Object.keys(C.rowSelection).filter((e) => C.rowSelection[e]), i = r.filter((e) => !n.includes(e)), a = n.filter((e) => !r.includes(e));
|
|
1435
|
+
i.forEach((n) => {
|
|
1436
|
+
let r = parseInt(n);
|
|
1437
|
+
!isNaN(r) && t[r] && e.onRowSelect?.({
|
|
1438
|
+
data: t[r],
|
|
1439
|
+
rowIndex: r
|
|
1440
|
+
});
|
|
1441
|
+
}), a.forEach((n) => {
|
|
1442
|
+
let r = parseInt(n);
|
|
1443
|
+
!isNaN(r) && t[r] && e.onRowDeselect?.({
|
|
1444
|
+
data: t[r],
|
|
1445
|
+
rowIndex: r
|
|
1446
|
+
});
|
|
1447
|
+
}), R.current = C.rowSelection;
|
|
1448
|
+
}
|
|
1449
|
+
}, [
|
|
1450
|
+
C.rowSelection,
|
|
1451
|
+
t,
|
|
1452
|
+
e.onRowSelectionChange,
|
|
1453
|
+
e.onRowSelect,
|
|
1454
|
+
e.onRowDeselect
|
|
1455
|
+
]), W(() => {
|
|
1456
|
+
I.current || JSON.stringify(C.columnOrder) !== JSON.stringify(z.current) && (e.onColumnOrderChange?.(C.columnOrder), z.current = C.columnOrder);
|
|
1457
|
+
}, [C.columnOrder, e.onColumnOrderChange]), W(() => {
|
|
1458
|
+
I.current = !1;
|
|
1459
|
+
}, []);
|
|
1460
|
+
let B = K(e.onColumnFiltersChange), V = K(e.onGlobalFilterChange);
|
|
1461
|
+
return W(() => {
|
|
1462
|
+
B.current = e.onColumnFiltersChange, V.current = e.onGlobalFilterChange;
|
|
1463
|
+
}), W(() => {
|
|
1464
|
+
_ && C.columnFilters.length >= 0 && B.current?.(C.columnFilters);
|
|
1465
|
+
}, [C.columnFilters, _]), W(() => {
|
|
1466
|
+
_ && V.current?.(C.globalFilter);
|
|
1389
1467
|
}, [C.globalFilter, _]), {
|
|
1390
|
-
table:
|
|
1468
|
+
table: it({
|
|
1391
1469
|
data: t,
|
|
1392
1470
|
columns: n,
|
|
1393
1471
|
getRowId: x,
|
|
1394
1472
|
rowCount: r,
|
|
1395
1473
|
pageCount: i,
|
|
1396
|
-
state:
|
|
1474
|
+
state: G(() => ({
|
|
1397
1475
|
sorting: C.sorting,
|
|
1398
1476
|
columnFilters: C.columnFilters,
|
|
1399
1477
|
globalFilter: C.globalFilter,
|
|
@@ -1409,27 +1487,27 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1409
1487
|
...e.state
|
|
1410
1488
|
}), [C, e.state]),
|
|
1411
1489
|
onSortingChange: E,
|
|
1412
|
-
onColumnFiltersChange:
|
|
1413
|
-
onGlobalFilterChange:
|
|
1414
|
-
onColumnSizingChange:
|
|
1490
|
+
onColumnFiltersChange: ee,
|
|
1491
|
+
onGlobalFilterChange: k,
|
|
1492
|
+
onColumnSizingChange: A,
|
|
1415
1493
|
onRowSelectionChange: O,
|
|
1416
1494
|
onPaginationChange: D,
|
|
1417
|
-
onGroupingChange:
|
|
1418
|
-
onExpandedChange:
|
|
1419
|
-
onRowPinningChange:
|
|
1420
|
-
onColumnPinningChange:
|
|
1421
|
-
onColumnVisibilityChange:
|
|
1422
|
-
onColumnOrderChange:
|
|
1423
|
-
globalFilterFn:
|
|
1495
|
+
onGroupingChange: j,
|
|
1496
|
+
onExpandedChange: M,
|
|
1497
|
+
onRowPinningChange: N,
|
|
1498
|
+
onColumnPinningChange: P,
|
|
1499
|
+
onColumnVisibilityChange: te,
|
|
1500
|
+
onColumnOrderChange: F,
|
|
1501
|
+
globalFilterFn: _t,
|
|
1424
1502
|
defaultColumn: {
|
|
1425
|
-
cell:
|
|
1426
|
-
filterFn:
|
|
1503
|
+
cell: Kt,
|
|
1504
|
+
filterFn: vt
|
|
1427
1505
|
},
|
|
1428
1506
|
manualPagination: S || h,
|
|
1429
1507
|
manualSorting: S || g,
|
|
1430
1508
|
manualFiltering: S || _,
|
|
1431
1509
|
enableRowSelection: c ? !0 : s,
|
|
1432
|
-
enableMultiRowSelection: c
|
|
1510
|
+
enableMultiRowSelection: !c || c.type === "Multiple",
|
|
1433
1511
|
enableGrouping: u,
|
|
1434
1512
|
enableSorting: !0,
|
|
1435
1513
|
enableRowPinning: d,
|
|
@@ -1438,43 +1516,43 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1438
1516
|
enableColumnResizing: !0,
|
|
1439
1517
|
aggregationFns: { uniqueCount: (e, t) => new Set(t.map((t) => t.getValue(e))).size },
|
|
1440
1518
|
getSubRows: p ? m : void 0,
|
|
1441
|
-
getCoreRowModel:
|
|
1442
|
-
getSortedRowModel:
|
|
1443
|
-
getFilteredRowModel:
|
|
1444
|
-
getPaginationRowModel: a ?
|
|
1445
|
-
getGroupedRowModel: u ?
|
|
1446
|
-
getExpandedRowModel: u || p ?
|
|
1447
|
-
getFacetedUniqueValues:
|
|
1448
|
-
getFacetedMinMaxValues:
|
|
1519
|
+
getCoreRowModel: Xe(),
|
|
1520
|
+
getSortedRowModel: rt(),
|
|
1521
|
+
getFilteredRowModel: et(),
|
|
1522
|
+
getPaginationRowModel: a ? nt() : void 0,
|
|
1523
|
+
getGroupedRowModel: u ? tt() : void 0,
|
|
1524
|
+
getExpandedRowModel: u || p ? Ze() : void 0,
|
|
1525
|
+
getFacetedUniqueValues: $e(),
|
|
1526
|
+
getFacetedMinMaxValues: Qe(),
|
|
1449
1527
|
meta: {}
|
|
1450
1528
|
}),
|
|
1451
1529
|
states: {
|
|
1452
1530
|
sorting: C.sorting,
|
|
1453
1531
|
setSorting: E,
|
|
1454
1532
|
columnFilters: C.columnFilters,
|
|
1455
|
-
setColumnFilters:
|
|
1533
|
+
setColumnFilters: ee,
|
|
1456
1534
|
globalFilter: C.globalFilter,
|
|
1457
|
-
setGlobalFilter:
|
|
1535
|
+
setGlobalFilter: k,
|
|
1458
1536
|
rowSelection: C.rowSelection,
|
|
1459
1537
|
setRowSelection: O,
|
|
1460
1538
|
paginationState: C.pagination,
|
|
1461
1539
|
setPaginationState: D,
|
|
1462
1540
|
grouping: C.grouping,
|
|
1463
|
-
setGrouping:
|
|
1541
|
+
setGrouping: j,
|
|
1464
1542
|
expanded: C.expanded,
|
|
1465
|
-
setExpanded:
|
|
1543
|
+
setExpanded: M,
|
|
1466
1544
|
rowPinning: C.rowPinning,
|
|
1467
|
-
setRowPinning:
|
|
1545
|
+
setRowPinning: N,
|
|
1468
1546
|
columnPinning: C.columnPinning,
|
|
1469
|
-
setColumnPinning:
|
|
1547
|
+
setColumnPinning: P,
|
|
1470
1548
|
columnVisibility: C.columnVisibility,
|
|
1471
|
-
setColumnVisibility:
|
|
1549
|
+
setColumnVisibility: te,
|
|
1472
1550
|
columnOrder: C.columnOrder,
|
|
1473
|
-
setColumnOrder:
|
|
1551
|
+
setColumnOrder: F
|
|
1474
1552
|
}
|
|
1475
1553
|
};
|
|
1476
|
-
},
|
|
1477
|
-
let { density: r = "standard", rowHeight: i, estimatedRowHeight: a, rowSizingMode: o = "auto", enableColumnVirtualization: s = !1 } = e, { rows: c } = t.getRowModel(), l =
|
|
1554
|
+
}, Jt = (e, t, n = "ltr") => {
|
|
1555
|
+
let { density: r = "standard", rowHeight: i, estimatedRowHeight: a, rowSizingMode: o = "auto", enableColumnVirtualization: s = !1 } = e, { rows: c } = t.getRowModel(), l = G(() => {
|
|
1478
1556
|
if (i) return i;
|
|
1479
1557
|
if (a) return a;
|
|
1480
1558
|
switch (r) {
|
|
@@ -1486,13 +1564,13 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1486
1564
|
i,
|
|
1487
1565
|
a,
|
|
1488
1566
|
r
|
|
1489
|
-
]), u =
|
|
1567
|
+
]), u = G(() => {
|
|
1490
1568
|
switch (r) {
|
|
1491
1569
|
case "compact": return 40;
|
|
1492
1570
|
case "comfortable": return 56;
|
|
1493
1571
|
default: return 48;
|
|
1494
1572
|
}
|
|
1495
|
-
}, [r]), d =
|
|
1573
|
+
}, [r]), d = G(() => {
|
|
1496
1574
|
if (i) return !1;
|
|
1497
1575
|
if (o === "dynamic") return !0;
|
|
1498
1576
|
if (o === "fixed") return !1;
|
|
@@ -1506,7 +1584,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1506
1584
|
e.renderDetailPanel,
|
|
1507
1585
|
e.enableEditing,
|
|
1508
1586
|
e.adaptiveSizing
|
|
1509
|
-
]), { parentRef:
|
|
1587
|
+
]), { parentRef: p, rowVirtualizer: m, columnVirtualizer: h, scrollToIndex: g, scrollToRow: _, scrollToColumn: v } = f({
|
|
1510
1588
|
rowCount: c.length,
|
|
1511
1589
|
rowHeight: l,
|
|
1512
1590
|
overscanCount: e.overscanCount ?? 30,
|
|
@@ -1523,17 +1601,17 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1523
1601
|
scrollMargin: 0
|
|
1524
1602
|
});
|
|
1525
1603
|
return {
|
|
1526
|
-
parentRef:
|
|
1527
|
-
rowVirtualizer:
|
|
1528
|
-
columnVirtualizer:
|
|
1529
|
-
scrollToIndex:
|
|
1530
|
-
scrollToRow:
|
|
1531
|
-
scrollToColumn:
|
|
1604
|
+
parentRef: p,
|
|
1605
|
+
rowVirtualizer: m,
|
|
1606
|
+
columnVirtualizer: h,
|
|
1607
|
+
scrollToIndex: g,
|
|
1608
|
+
scrollToRow: _,
|
|
1609
|
+
scrollToColumn: v,
|
|
1532
1610
|
effectiveRowHeight: l,
|
|
1533
1611
|
dynamicRowSizing: d
|
|
1534
1612
|
};
|
|
1535
|
-
},
|
|
1536
|
-
let { enableRangeSelection: n = !1 } = e, { rows: r } = t.getRowModel(), [i, a] =
|
|
1613
|
+
}, Yt = (e, t) => {
|
|
1614
|
+
let { enableRangeSelection: n = !1 } = e, { rows: r } = t.getRowModel(), [i, a] = q(null), [o, s] = q(!1), c = U((e, t) => {
|
|
1537
1615
|
n && (s(!0), a({
|
|
1538
1616
|
start: {
|
|
1539
1617
|
r: e,
|
|
@@ -1544,7 +1622,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1544
1622
|
c: t
|
|
1545
1623
|
}
|
|
1546
1624
|
}));
|
|
1547
|
-
}, [n]), l =
|
|
1625
|
+
}, [n]), l = U((e, t) => {
|
|
1548
1626
|
!n || !o || a((n) => n ? {
|
|
1549
1627
|
...n,
|
|
1550
1628
|
end: {
|
|
@@ -1553,7 +1631,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1553
1631
|
}
|
|
1554
1632
|
} : null);
|
|
1555
1633
|
}, [n, o]);
|
|
1556
|
-
return
|
|
1634
|
+
return W(() => {
|
|
1557
1635
|
if (!n) return;
|
|
1558
1636
|
let e = () => s(!1);
|
|
1559
1637
|
return window.addEventListener("mouseup", e), () => window.removeEventListener("mouseup", e);
|
|
@@ -1561,7 +1639,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1561
1639
|
rangeSelection: i,
|
|
1562
1640
|
onCellMouseDown: c,
|
|
1563
1641
|
onCellMouseEnter: l,
|
|
1564
|
-
selectRowByRange:
|
|
1642
|
+
selectRowByRange: U((e, n) => {
|
|
1565
1643
|
let i = {}, [a, o] = [Math.min(e, n), Math.max(e, n)];
|
|
1566
1644
|
for (let e = a; e <= o; e++) {
|
|
1567
1645
|
let t = r[e];
|
|
@@ -1574,51 +1652,59 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1574
1652
|
}, [r, t]),
|
|
1575
1653
|
isSelecting: o
|
|
1576
1654
|
};
|
|
1577
|
-
},
|
|
1578
|
-
let [n, r] =
|
|
1579
|
-
|
|
1655
|
+
}, Xt = (e, t) => {
|
|
1656
|
+
let [n, r] = J(), i = U((e) => {
|
|
1657
|
+
r(() => {
|
|
1658
|
+
t.setColumnFilters(e);
|
|
1659
|
+
});
|
|
1660
|
+
}, [t]), a = U((e) => {
|
|
1661
|
+
r(() => {
|
|
1662
|
+
t.setGlobalFilter(e);
|
|
1663
|
+
});
|
|
1664
|
+
}, [t]), o = t.getState().columnFilters, s = t.getState().globalFilter, c = K(!0), l = K(o), u = K(s);
|
|
1665
|
+
return W(() => {
|
|
1666
|
+
if (!c.current && JSON.stringify(o) !== JSON.stringify(l.current)) {
|
|
1667
|
+
e.onColumnFiltersChange?.(o);
|
|
1668
|
+
let n = o.map((e) => ({
|
|
1669
|
+
id: e.id,
|
|
1670
|
+
field: e.id,
|
|
1671
|
+
operator: "contains",
|
|
1672
|
+
value: e.value
|
|
1673
|
+
}));
|
|
1674
|
+
e.onFilter?.({
|
|
1675
|
+
columns: n,
|
|
1676
|
+
table: t
|
|
1677
|
+
}), l.current = o;
|
|
1678
|
+
}
|
|
1679
|
+
}, [
|
|
1680
|
+
o,
|
|
1681
|
+
e.onColumnFiltersChange,
|
|
1682
|
+
e.onFilter,
|
|
1683
|
+
t
|
|
1684
|
+
]), W(() => {
|
|
1685
|
+
if (c.current) {
|
|
1686
|
+
c.current = !1;
|
|
1687
|
+
return;
|
|
1688
|
+
}
|
|
1689
|
+
s !== u.current && (e.onGlobalFilterChange?.(s), typeof s == "string" && e.onSearch?.(s), u.current = s);
|
|
1690
|
+
}, [
|
|
1691
|
+
s,
|
|
1692
|
+
e.onGlobalFilterChange,
|
|
1693
|
+
e.onSearch
|
|
1694
|
+
]), {
|
|
1580
1695
|
isFiltering: n,
|
|
1581
|
-
handleColumnFiltersChange:
|
|
1582
|
-
|
|
1583
|
-
t.setColumnFilters((t) => {
|
|
1584
|
-
let r = typeof n == "function" ? n(t) : n;
|
|
1585
|
-
return setTimeout(() => {
|
|
1586
|
-
e.onColumnFiltersChange?.(r);
|
|
1587
|
-
let t = r.map((e) => ({
|
|
1588
|
-
id: e.id,
|
|
1589
|
-
field: e.id,
|
|
1590
|
-
operator: "contains",
|
|
1591
|
-
value: e.value
|
|
1592
|
-
}));
|
|
1593
|
-
e.onFilter?.({ columns: t });
|
|
1594
|
-
}, 0), r;
|
|
1595
|
-
});
|
|
1596
|
-
});
|
|
1597
|
-
}, [
|
|
1598
|
-
t,
|
|
1599
|
-
e.onColumnFiltersChange,
|
|
1600
|
-
e.onFilter
|
|
1601
|
-
]),
|
|
1602
|
-
handleGlobalFilterChange: H((n) => {
|
|
1603
|
-
r(() => {
|
|
1604
|
-
t.setGlobalFilter((t) => {
|
|
1605
|
-
let r = typeof n == "function" ? n(t) : n;
|
|
1606
|
-
return setTimeout(() => {
|
|
1607
|
-
e.onGlobalFilterChange?.(r), typeof r == "string" && e.onSearch?.(r);
|
|
1608
|
-
}, 0), r;
|
|
1609
|
-
});
|
|
1610
|
-
});
|
|
1611
|
-
}, [
|
|
1612
|
-
t,
|
|
1613
|
-
e.onGlobalFilterChange,
|
|
1614
|
-
e.onSearch
|
|
1615
|
-
]),
|
|
1696
|
+
handleColumnFiltersChange: i,
|
|
1697
|
+
handleGlobalFilterChange: a,
|
|
1616
1698
|
setFilterModel: t.setColumnFilters,
|
|
1617
1699
|
setGlobalFilter: t.setGlobalFilter
|
|
1618
1700
|
};
|
|
1619
|
-
},
|
|
1620
|
-
let c = n(), { rows: l } = t.getRowModel(), u =
|
|
1621
|
-
|
|
1701
|
+
}, Zt = (e, t, r, i, a, o = {}) => {
|
|
1702
|
+
let c = n(), { rows: l } = t.getRowModel(), u = K([]);
|
|
1703
|
+
W(() => () => {
|
|
1704
|
+
u.current.forEach((e) => clearTimeout(e));
|
|
1705
|
+
}, []);
|
|
1706
|
+
let d = G(() => {
|
|
1707
|
+
let n = F(i.refresh, i.forceUpdate), a = R(i.showSpinner, i.hideSpinner), s = L((e) => {
|
|
1622
1708
|
let t = l[typeof e == "string" ? parseInt(e) : e];
|
|
1623
1709
|
t?.getCanSelect() && t.toggleSelected(!0);
|
|
1624
1710
|
}, (e) => {
|
|
@@ -1630,13 +1716,33 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1630
1716
|
}, () => t.resetRowSelection(), () => t.toggleAllRowsSelected(!0), () => t.getSelectedRowModel().rows.map((e) => e.original), (e, t) => {
|
|
1631
1717
|
let n = typeof e == "string" ? parseInt(e) : e;
|
|
1632
1718
|
i.scrollToIndex(n);
|
|
1633
|
-
}),
|
|
1719
|
+
}), d = I(i.scrollToIndex, (e) => t.setPageIndex(e)), f = ne(() => e.onExportCSV?.(t), () => e.onExportExcel?.(t), () => {
|
|
1634
1720
|
window.print();
|
|
1635
1721
|
});
|
|
1636
1722
|
return {
|
|
1637
1723
|
...n,
|
|
1638
1724
|
...a,
|
|
1639
1725
|
getData: () => r,
|
|
1726
|
+
getState: () => t.getState(),
|
|
1727
|
+
getSelectedRows: () => t.getSelectedRowModel().rows.map((e) => e.original),
|
|
1728
|
+
saveChanges: async () => {
|
|
1729
|
+
e.onDataChangeComplete?.({
|
|
1730
|
+
action: "edit",
|
|
1731
|
+
data: i.batchChanges.changedRecords
|
|
1732
|
+
}), c.get("NotificationService")?.show({
|
|
1733
|
+
type: "success",
|
|
1734
|
+
message: "Changes Saved Successfully!",
|
|
1735
|
+
duration: 3e3
|
|
1736
|
+
});
|
|
1737
|
+
},
|
|
1738
|
+
cancelChanges: () => {
|
|
1739
|
+
i.resetData(), e.onDataChangeCancel?.({ action: "edit" }), c.get("NotificationService")?.show({
|
|
1740
|
+
type: "info",
|
|
1741
|
+
message: "Changes Discarded",
|
|
1742
|
+
duration: 3e3
|
|
1743
|
+
});
|
|
1744
|
+
},
|
|
1745
|
+
validateField: (e) => !0,
|
|
1640
1746
|
setCellValue: (e, t, n) => {
|
|
1641
1747
|
let r = parseInt(e);
|
|
1642
1748
|
isNaN(r) || i.performEdit(r, t, n);
|
|
@@ -1659,12 +1765,15 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1659
1765
|
type: "success",
|
|
1660
1766
|
message: "Row Added Successfully!",
|
|
1661
1767
|
duration: 3e3
|
|
1662
|
-
})
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
let a =
|
|
1666
|
-
|
|
1768
|
+
});
|
|
1769
|
+
let n = setTimeout(() => {
|
|
1770
|
+
u.current = u.current.filter((e) => e !== n);
|
|
1771
|
+
let a = e[s] || l;
|
|
1772
|
+
t.setRowSelection({ [a]: !0 });
|
|
1773
|
+
let o = r.findIndex((e) => e[s] === a);
|
|
1774
|
+
o !== -1 && (i.toggleRowEditing(o, !0), i.scrollToIndex(o));
|
|
1667
1775
|
}, 100);
|
|
1776
|
+
u.current.push(n);
|
|
1668
1777
|
return;
|
|
1669
1778
|
} catch (e) {
|
|
1670
1779
|
throw c.get("NotificationService")?.show({
|
|
@@ -1683,9 +1792,11 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1683
1792
|
type: "success",
|
|
1684
1793
|
message: "Row Added Successfully!",
|
|
1685
1794
|
duration: 3e3
|
|
1686
|
-
})
|
|
1687
|
-
|
|
1795
|
+
});
|
|
1796
|
+
let d = setTimeout(() => {
|
|
1797
|
+
u.current = u.current.filter((e) => e !== d), t.resetRowSelection(), t.setRowSelection({ [l]: !0 }), i.toggleRowEditing(0, !0), i.scrollToIndex(0);
|
|
1688
1798
|
}, 50);
|
|
1799
|
+
u.current.push(d);
|
|
1689
1800
|
},
|
|
1690
1801
|
updateRecord: async (t, n) => {
|
|
1691
1802
|
let a = typeof t == "number" ? t : parseInt(t), o = e.editSettings?.primaryKey, s = o ? Array.isArray(o) ? o[0] : o : "id", l = r[a]?.[s];
|
|
@@ -1808,7 +1919,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1808
1919
|
...s,
|
|
1809
1920
|
getSelectedRowIndexes: () => Object.keys(t.getState().rowSelection).map(Number),
|
|
1810
1921
|
clearRowSelection: () => t.resetRowSelection(),
|
|
1811
|
-
...
|
|
1922
|
+
...d,
|
|
1812
1923
|
search: (e) => t.setGlobalFilter(e),
|
|
1813
1924
|
filterByColumn: (e, n, r) => t.getColumn(e)?.setFilterValue({
|
|
1814
1925
|
operator: n,
|
|
@@ -1864,7 +1975,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1864
1975
|
let t = e.editSettings?.primaryKey;
|
|
1865
1976
|
return t ? Array.isArray(t) ? t : [t] : [];
|
|
1866
1977
|
},
|
|
1867
|
-
...
|
|
1978
|
+
...f,
|
|
1868
1979
|
...o
|
|
1869
1980
|
};
|
|
1870
1981
|
}, [
|
|
@@ -1875,184 +1986,259 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
1875
1986
|
i,
|
|
1876
1987
|
o
|
|
1877
1988
|
]);
|
|
1878
|
-
return s(a,
|
|
1879
|
-
},
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
t.current = !1;
|
|
1887
|
-
}, []);
|
|
1888
|
-
}, Zt = [], Qt = (e, t, n = {}) => {
|
|
1889
|
-
let { api: r, serviceRegistry: i } = u(e), a = qe(), { dataSource: o, data: s, onRefresh: c, onDataRequest: l, onDataLoad: d, onError: f, enableEditing: m, isRowEditable: h, isCellEditable: g, pagination: _ = !0, enableExport: v = !1, enableStickyHeader: y = !0, enableStickyPagination: b = !0, enableChangeTracking: x = !0, density: S = "standard", dir: C } = e, w = p("I18nService"), T = C === "auto" || !C ? w?.dir || "ltr" : C, E = o || s || Zt, { data: D, setData: O, performEdit: k, addRow: A, deleteRows: j, undo: ee, redo: te, canUndo: M, canRedo: N, changes: P, batchChanges: ne, resetData: F } = ut(E, W(() => {
|
|
1989
|
+
return s(a, d), d;
|
|
1990
|
+
}, Qt = [], $t = /* @__PURE__ */ new WeakMap(), en = 1;
|
|
1991
|
+
function tn(e) {
|
|
1992
|
+
let t = $t.get(e);
|
|
1993
|
+
return t || (t = `inline-service-${en++}`, $t.set(e, t)), t;
|
|
1994
|
+
}
|
|
1995
|
+
var nn = (e, t, n = {}) => {
|
|
1996
|
+
let { api: r, serviceRegistry: i } = u(e), a = Je(), { dataSource: o, data: s, onRefresh: c, onDataRequest: l, onDataLoad: d, onError: f, enableEditing: p, isRowEditable: m, isCellEditable: h, pagination: g = !0, enableExport: _ = !1, enableStickyHeader: v = !0, enableStickyPagination: y = !0, enableChangeTracking: x = !0, density: S = "standard", dir: C } = e, w = b("I18nService"), T = C === "auto" || !C ? w?.dir || "ltr" : C, E = o || s || Qt, D = G(() => {
|
|
1890
1997
|
let t = e.editSettings?.primaryKey;
|
|
1891
1998
|
return t ? Array.isArray(t) ? t[0] : t : "id";
|
|
1892
|
-
}, [e.editSettings?.primaryKey])), [
|
|
1999
|
+
}, [e.editSettings?.primaryKey]), { data: O, setData: ee, performEdit: k, addRow: A, deleteRows: j, undo: M, redo: N, canUndo: P, canRedo: te, changes: F, batchChanges: I, resetData: L } = ft(E, D), [ne, R] = q(void 0), z = G(() => e.service ? e.service : e.serviceName ? i.get(e.serviceName) : null, [e.service, e.serviceName]), { table: B, states: V } = qt(e, O), re = B.getState().pagination, H = B.getState().sorting, ie = B.getState().columnFilters, ae = B.getState().globalFilter, K = G(() => {
|
|
2000
|
+
if (e.serviceName) return e.serviceName;
|
|
2001
|
+
if (e.service) {
|
|
2002
|
+
let t = e.service;
|
|
2003
|
+
return t.resourceKey || t.serviceKey || t.name || t.id || tn(e.service);
|
|
2004
|
+
}
|
|
2005
|
+
return "local";
|
|
2006
|
+
}, [e.serviceName, e.service]), J = G(() => [
|
|
1893
2007
|
"table-data",
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
2008
|
+
K,
|
|
2009
|
+
re.pageIndex,
|
|
2010
|
+
re.pageSize,
|
|
2011
|
+
H,
|
|
1897
2012
|
ie,
|
|
1898
|
-
V,
|
|
1899
2013
|
ae
|
|
1900
2014
|
], [
|
|
1901
|
-
|
|
1902
|
-
|
|
2015
|
+
K,
|
|
2016
|
+
re,
|
|
2017
|
+
H,
|
|
1903
2018
|
ie,
|
|
1904
|
-
V,
|
|
1905
2019
|
ae
|
|
1906
|
-
]), { data:
|
|
1907
|
-
queryKey:
|
|
2020
|
+
]), { data: oe, isLoading: se, error: ce } = qe({
|
|
2021
|
+
queryKey: J,
|
|
1908
2022
|
queryFn: async () => {
|
|
1909
|
-
if (!
|
|
2023
|
+
if (!z) return {
|
|
1910
2024
|
data: E,
|
|
1911
2025
|
totalCount: E.length
|
|
1912
2026
|
};
|
|
1913
|
-
let { onDataChange: t, ...n } = e
|
|
1914
|
-
return await L.getData({
|
|
2027
|
+
let { onDataChange: t, ...n } = e, r = await z.getData({
|
|
1915
2028
|
...n,
|
|
1916
|
-
state:
|
|
2029
|
+
state: B.getState(),
|
|
1917
2030
|
data: [],
|
|
1918
2031
|
columns: []
|
|
1919
|
-
});
|
|
2032
|
+
}), i = r.data;
|
|
2033
|
+
return {
|
|
2034
|
+
data: i,
|
|
2035
|
+
totalCount: ("totalCount" in r ? r.totalCount : r.rowCount) ?? i.length
|
|
2036
|
+
};
|
|
1920
2037
|
},
|
|
1921
|
-
enabled: !!
|
|
2038
|
+
enabled: !!z,
|
|
1922
2039
|
placeholderData: {
|
|
1923
2040
|
data: E,
|
|
1924
2041
|
totalCount: E.length
|
|
1925
2042
|
}
|
|
1926
|
-
}),
|
|
1927
|
-
|
|
1928
|
-
|
|
2043
|
+
}), Y = oe?.data || E, le = oe?.totalCount ?? E.length;
|
|
2044
|
+
W(() => {
|
|
2045
|
+
z && Y && !F.added && !F.edited && !F.deleted && ee(Y);
|
|
1929
2046
|
}, [
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
2047
|
+
Y,
|
|
2048
|
+
z,
|
|
2049
|
+
ee,
|
|
2050
|
+
F.added,
|
|
2051
|
+
F.edited,
|
|
2052
|
+
F.deleted
|
|
1936
2053
|
]);
|
|
1937
|
-
let
|
|
1938
|
-
mutationFn: (e) =>
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
2054
|
+
let ue = Ke({
|
|
2055
|
+
mutationFn: (e) => z.createRow(e),
|
|
2056
|
+
onMutate: async (e) => {
|
|
2057
|
+
await a.cancelQueries({ queryKey: J });
|
|
2058
|
+
let t = a.getQueryData(J);
|
|
2059
|
+
return a.setQueryData(J, (t) => ({
|
|
2060
|
+
data: [...t?.data || [], e],
|
|
2061
|
+
totalCount: (t?.totalCount ?? 0) + 1
|
|
2062
|
+
})), { previousData: t };
|
|
2063
|
+
},
|
|
2064
|
+
onError: (e, t, n) => {
|
|
2065
|
+
n?.previousData && a.setQueryData(J, n.previousData);
|
|
2066
|
+
},
|
|
2067
|
+
onSuccess: () => a.invalidateQueries({ queryKey: J })
|
|
2068
|
+
}), de = Ke({
|
|
2069
|
+
mutationFn: ({ id: e, updates: t }) => z.updateRow(e, t),
|
|
2070
|
+
onMutate: async ({ id: t, updates: n }) => {
|
|
2071
|
+
await a.cancelQueries({ queryKey: J });
|
|
2072
|
+
let r = a.getQueryData(J);
|
|
2073
|
+
return a.setQueryData(J, (r) => {
|
|
2074
|
+
let i = r?.data || [];
|
|
2075
|
+
return {
|
|
2076
|
+
data: i.map((r) => {
|
|
2077
|
+
let i = e.getRowId ? e.getRowId(r) : r.id || r[D];
|
|
2078
|
+
return String(i) === String(t) ? {
|
|
2079
|
+
...r,
|
|
2080
|
+
...n
|
|
2081
|
+
} : r;
|
|
2082
|
+
}),
|
|
2083
|
+
totalCount: r?.totalCount ?? i.length
|
|
2084
|
+
};
|
|
2085
|
+
}), { previousData: r };
|
|
2086
|
+
},
|
|
2087
|
+
onError: (e, t, n) => {
|
|
2088
|
+
n?.previousData && a.setQueryData(J, n.previousData);
|
|
2089
|
+
},
|
|
2090
|
+
onSuccess: () => a.invalidateQueries({ queryKey: J })
|
|
2091
|
+
}), fe = Ke({
|
|
2092
|
+
mutationFn: (e) => z.deleteRow(e),
|
|
2093
|
+
onMutate: async (t) => {
|
|
2094
|
+
await a.cancelQueries({ queryKey: J });
|
|
2095
|
+
let n = a.getQueryData(J);
|
|
2096
|
+
return a.setQueryData(J, (n) => {
|
|
2097
|
+
let r = n?.data || [];
|
|
2098
|
+
return {
|
|
2099
|
+
data: r.filter((n) => {
|
|
2100
|
+
let r = e.getRowId ? e.getRowId(n) : n.id || n[D];
|
|
2101
|
+
return String(r) !== String(t);
|
|
2102
|
+
}),
|
|
2103
|
+
totalCount: Math.max(0, (n?.totalCount ?? r.length) - 1)
|
|
2104
|
+
};
|
|
2105
|
+
}), { previousData: n };
|
|
2106
|
+
},
|
|
2107
|
+
onError: (e, t, n) => {
|
|
2108
|
+
n?.previousData && a.setQueryData(J, n.previousData);
|
|
2109
|
+
},
|
|
2110
|
+
onSuccess: () => a.invalidateQueries({ queryKey: J })
|
|
2111
|
+
}), [pe, me] = q(!1), he = se || pe, { isFiltering: ge, handleColumnFiltersChange: _e, handleGlobalFilterChange: ve, setFilterModel: ye, setGlobalFilter: be } = Xt(e, B), { parentRef: xe, rowVirtualizer: Se, columnVirtualizer: Ce, effectiveRowHeight: we, dynamicRowSizing: Te } = Jt(e, B, T), { rangeSelection: Ee, onCellMouseDown: De, onCellMouseEnter: Oe, selectRowByRange: ke } = Yt(e, B), [Ae, je] = q(null), Me = U((e, t) => {
|
|
1947
2112
|
je((n) => {
|
|
1948
2113
|
if (!n) return {
|
|
1949
2114
|
r: 0,
|
|
1950
2115
|
c: 0
|
|
1951
2116
|
};
|
|
1952
|
-
let r =
|
|
2117
|
+
let r = B.getRowModel().rows.length;
|
|
1953
2118
|
return {
|
|
1954
2119
|
r: Math.max(0, Math.min(r - 1, n.r + e)),
|
|
1955
|
-
c: Math.max(0, Math.min(
|
|
2120
|
+
c: Math.max(0, Math.min(B.getVisibleLeafColumns().length - 1, n.c + t))
|
|
1956
2121
|
};
|
|
1957
2122
|
});
|
|
1958
|
-
}, [
|
|
2123
|
+
}, [B]), X = U((e) => {
|
|
2124
|
+
let t = B.getVisibleLeafColumns(), n = O[e];
|
|
2125
|
+
return Math.max(0, t.findIndex((e) => e.id === "select" || e.id === "actions" || e.columnDef?.enableEditing === !1 ? !1 : !h || !n || h(n, e.id)));
|
|
2126
|
+
}, [
|
|
2127
|
+
O,
|
|
2128
|
+
h,
|
|
2129
|
+
B
|
|
2130
|
+
]), Z = U((e) => {
|
|
2131
|
+
let t = X(e);
|
|
2132
|
+
je({
|
|
2133
|
+
r: e,
|
|
2134
|
+
c: t
|
|
2135
|
+
});
|
|
2136
|
+
let n = window.setTimeout(() => {
|
|
2137
|
+
let n = document.querySelector(`[role="cell"][data-row-index="${e}"][data-cell-index="${t}"]`);
|
|
2138
|
+
n?.scrollIntoView({
|
|
2139
|
+
block: "nearest",
|
|
2140
|
+
inline: "nearest"
|
|
2141
|
+
}), n?.focus({ preventScroll: !0 }), n?.click();
|
|
2142
|
+
let r = n?.querySelector("input, textarea, button, [tabindex]:not([tabindex=\"-1\"])");
|
|
2143
|
+
r?.focus({ preventScroll: !0 }), r?.click();
|
|
2144
|
+
}, 0);
|
|
2145
|
+
return () => window.clearTimeout(n);
|
|
2146
|
+
}, [X]), [Ne, Pe] = q({}), Fe = U((t, n) => {
|
|
1959
2147
|
let r = n === !0 || n === void 0 && !Ne[t];
|
|
1960
|
-
r &&
|
|
1961
|
-
row:
|
|
1962
|
-
data:
|
|
1963
|
-
}),
|
|
2148
|
+
r && O[t] && e.onRowEditStart?.({
|
|
2149
|
+
row: B.getRowModel().rows[t],
|
|
2150
|
+
data: O[t]
|
|
2151
|
+
}), Pe((i) => r && (e.editSettings?.mode === "Normal" || !e.editSettings?.mode) ? { [String(t)]: !0 } : {
|
|
1964
2152
|
...i,
|
|
1965
2153
|
[t]: n === void 0 ? !i[t] : n
|
|
1966
|
-
}), r &&
|
|
1967
|
-
r: t,
|
|
1968
|
-
c: e?.c ?? 0
|
|
1969
|
-
}));
|
|
2154
|
+
}), r && Z(t);
|
|
1970
2155
|
}, [
|
|
1971
|
-
|
|
2156
|
+
O,
|
|
1972
2157
|
Ne,
|
|
2158
|
+
Z,
|
|
1973
2159
|
e.onRowEditStart,
|
|
1974
2160
|
e.editSettings?.mode,
|
|
1975
|
-
|
|
1976
|
-
]),
|
|
1977
|
-
if (!
|
|
1978
|
-
let r =
|
|
1979
|
-
|
|
2161
|
+
B
|
|
2162
|
+
]), Ie = U((e, t, n) => {
|
|
2163
|
+
if (!p) return;
|
|
2164
|
+
let r = O[e];
|
|
2165
|
+
m && !m(r) || h && !h(r, t) || k(e, t, n);
|
|
1980
2166
|
}, [
|
|
1981
|
-
|
|
2167
|
+
p,
|
|
1982
2168
|
k,
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
]), { autoFitColumn:
|
|
1987
|
-
if (
|
|
2169
|
+
O,
|
|
2170
|
+
m,
|
|
2171
|
+
h
|
|
2172
|
+
]), { autoFitColumn: Le } = ht(B), Re = U(async () => {
|
|
2173
|
+
if (z) await a.invalidateQueries({ queryKey: J });
|
|
1988
2174
|
else if (l) {
|
|
1989
2175
|
me(!0);
|
|
1990
2176
|
try {
|
|
1991
|
-
l(
|
|
2177
|
+
l(B.getState());
|
|
1992
2178
|
} catch (e) {
|
|
1993
2179
|
f && f(e);
|
|
1994
2180
|
} finally {
|
|
1995
2181
|
me(!1);
|
|
1996
2182
|
}
|
|
1997
2183
|
}
|
|
1998
|
-
|
|
2184
|
+
B.reset(), c?.();
|
|
1999
2185
|
}, [
|
|
2000
2186
|
l,
|
|
2001
|
-
|
|
2187
|
+
B,
|
|
2002
2188
|
c,
|
|
2003
2189
|
f,
|
|
2004
|
-
|
|
2190
|
+
z,
|
|
2005
2191
|
a,
|
|
2006
|
-
|
|
2192
|
+
J
|
|
2007
2193
|
]);
|
|
2008
|
-
|
|
2194
|
+
W(() => {
|
|
2009
2195
|
ce && f && f(ce);
|
|
2010
|
-
}, [ce, f]),
|
|
2011
|
-
|
|
2196
|
+
}, [ce, f]), W(() => {
|
|
2197
|
+
z && le !== void 0 && B.setOptions((e) => ({
|
|
2012
2198
|
...e,
|
|
2013
|
-
rowCount:
|
|
2199
|
+
rowCount: le
|
|
2014
2200
|
}));
|
|
2015
2201
|
}, [
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2202
|
+
le,
|
|
2203
|
+
B,
|
|
2204
|
+
z
|
|
2019
2205
|
]);
|
|
2020
|
-
let
|
|
2021
|
-
refresh:
|
|
2022
|
-
setData:
|
|
2206
|
+
let ze = Zt(e, B, O, {
|
|
2207
|
+
refresh: Re,
|
|
2208
|
+
setData: ee,
|
|
2023
2209
|
performEdit: k,
|
|
2024
2210
|
showSpinner: () => me(!0),
|
|
2025
2211
|
hideSpinner: () => me(!1),
|
|
2026
2212
|
scrollToIndex: (e) => Se.scrollToIndex(e, { align: "center" }),
|
|
2027
|
-
toggleRowEditing:
|
|
2213
|
+
toggleRowEditing: Fe,
|
|
2028
2214
|
forceUpdate: () => {
|
|
2029
2215
|
me((e) => !e), setTimeout(() => me((e) => !e), 0);
|
|
2030
2216
|
},
|
|
2031
|
-
resetData:
|
|
2032
|
-
setPagerMessage:
|
|
2033
|
-
batchChanges:
|
|
2034
|
-
changes:
|
|
2217
|
+
resetData: L,
|
|
2218
|
+
setPagerMessage: R,
|
|
2219
|
+
batchChanges: I,
|
|
2220
|
+
changes: F,
|
|
2035
2221
|
addRow: A,
|
|
2036
2222
|
deleteRows: j,
|
|
2037
2223
|
setFocusedCell: je,
|
|
2038
|
-
autoFitColumn:
|
|
2039
|
-
addMutation:
|
|
2224
|
+
autoFitColumn: Le,
|
|
2225
|
+
addMutation: ue,
|
|
2040
2226
|
updateMutation: de,
|
|
2041
2227
|
deleteMutation: fe,
|
|
2042
|
-
service:
|
|
2043
|
-
}, t, n),
|
|
2044
|
-
updateData:
|
|
2228
|
+
service: z
|
|
2229
|
+
}, t, n), Be = G(() => ({
|
|
2230
|
+
updateData: Ie,
|
|
2045
2231
|
editingRows: Ne,
|
|
2046
|
-
toggleRowEditing:
|
|
2232
|
+
toggleRowEditing: Fe,
|
|
2047
2233
|
focusedCell: Ae,
|
|
2048
2234
|
setFocusedCell: je,
|
|
2049
2235
|
navigateFocus: Me,
|
|
2050
|
-
addRecord:
|
|
2051
|
-
deleteRecord:
|
|
2052
|
-
deleteRecords:
|
|
2236
|
+
addRecord: ze.addRecord,
|
|
2237
|
+
deleteRecord: ze.deleteRecord,
|
|
2238
|
+
deleteRecords: ze.deleteRecords,
|
|
2053
2239
|
enableEditing: e.enableEditing && (e.editSettings?.allowEditing ?? !0),
|
|
2054
|
-
isRowEditable:
|
|
2055
|
-
isCellEditable:
|
|
2240
|
+
isRowEditable: m,
|
|
2241
|
+
isCellEditable: h,
|
|
2056
2242
|
enableSearchHighlighting: e.enableSearchHighlighting,
|
|
2057
2243
|
selectionSettings: e.selectionSettings,
|
|
2058
2244
|
editSettings: e.editSettings,
|
|
@@ -2064,17 +2250,17 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
2064
2250
|
dir: T,
|
|
2065
2251
|
containerRef: xe
|
|
2066
2252
|
}), [
|
|
2067
|
-
|
|
2253
|
+
Ie,
|
|
2068
2254
|
Ne,
|
|
2069
|
-
|
|
2255
|
+
Fe,
|
|
2070
2256
|
Ae,
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2257
|
+
ze.addRecord,
|
|
2258
|
+
ze.deleteRecord,
|
|
2259
|
+
ze.deleteRecords,
|
|
2074
2260
|
e.enableEditing,
|
|
2075
2261
|
e.editSettings,
|
|
2262
|
+
m,
|
|
2076
2263
|
h,
|
|
2077
|
-
g,
|
|
2078
2264
|
e.enableSearchHighlighting,
|
|
2079
2265
|
e.selectionSettings,
|
|
2080
2266
|
e.editSettings,
|
|
@@ -2085,35 +2271,35 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
2085
2271
|
e.localization,
|
|
2086
2272
|
xe
|
|
2087
2273
|
]);
|
|
2088
|
-
return
|
|
2089
|
-
d && d(
|
|
2090
|
-
}, [
|
|
2274
|
+
return B.options.meta = Be, W(() => {
|
|
2275
|
+
d && d(O);
|
|
2276
|
+
}, [O, d]), st({
|
|
2091
2277
|
onRenderStart: e.onGridRenderStart,
|
|
2092
2278
|
onRenderComplete: e.onGridRenderComplete
|
|
2093
|
-
}),
|
|
2279
|
+
}), G(() => ({
|
|
2094
2280
|
state: {
|
|
2095
|
-
...
|
|
2096
|
-
rows:
|
|
2281
|
+
...V,
|
|
2282
|
+
rows: B.getRowModel().rows,
|
|
2097
2283
|
rangeSelection: Ee,
|
|
2098
|
-
canUndo:
|
|
2099
|
-
canRedo:
|
|
2100
|
-
changes:
|
|
2101
|
-
batchChanges:
|
|
2284
|
+
canUndo: P,
|
|
2285
|
+
canRedo: te,
|
|
2286
|
+
changes: F,
|
|
2287
|
+
batchChanges: I,
|
|
2102
2288
|
density: S,
|
|
2103
2289
|
isPending: ge || e.isLoading || he,
|
|
2104
2290
|
focusedCell: Ae,
|
|
2105
|
-
globalFilter:
|
|
2106
|
-
pagerMessage:
|
|
2291
|
+
globalFilter: V.globalFilter,
|
|
2292
|
+
pagerMessage: ne,
|
|
2107
2293
|
internalLoading: pe
|
|
2108
2294
|
},
|
|
2109
2295
|
actions: {
|
|
2110
|
-
undo:
|
|
2111
|
-
redo:
|
|
2112
|
-
resetData:
|
|
2296
|
+
undo: M,
|
|
2297
|
+
redo: N,
|
|
2298
|
+
resetData: L,
|
|
2113
2299
|
addRow: A,
|
|
2114
2300
|
deleteRows: j,
|
|
2115
|
-
toggleRowEditing:
|
|
2116
|
-
autoFitColumn:
|
|
2301
|
+
toggleRowEditing: Fe,
|
|
2302
|
+
autoFitColumn: Le,
|
|
2117
2303
|
onCellMouseDown: De,
|
|
2118
2304
|
onCellMouseEnter: Oe,
|
|
2119
2305
|
onRowClick: e.onRowClick,
|
|
@@ -2125,7 +2311,7 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
2125
2311
|
handleColumnFiltersChange: _e,
|
|
2126
2312
|
handleGlobalFilterChange: ve,
|
|
2127
2313
|
setFilterModel: ye,
|
|
2128
|
-
getData: () =>
|
|
2314
|
+
getData: () => O,
|
|
2129
2315
|
getPrimaryKeyFieldNames: () => {
|
|
2130
2316
|
let t = e.editSettings?.primaryKey;
|
|
2131
2317
|
return t ? Array.isArray(t) ? t : [t] : [];
|
|
@@ -2137,12 +2323,12 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
2137
2323
|
columnVirtualizer: Ce
|
|
2138
2324
|
},
|
|
2139
2325
|
config: {
|
|
2140
|
-
paginationEnabled:
|
|
2141
|
-
exportEnabled:
|
|
2142
|
-
enableStickyHeader:
|
|
2143
|
-
enableStickyPagination:
|
|
2326
|
+
paginationEnabled: g,
|
|
2327
|
+
exportEnabled: _,
|
|
2328
|
+
enableStickyHeader: v,
|
|
2329
|
+
enableStickyPagination: y,
|
|
2144
2330
|
enableChangeTracking: x,
|
|
2145
|
-
enableEditing:
|
|
2331
|
+
enableEditing: p,
|
|
2146
2332
|
gridLines: e.gridLines,
|
|
2147
2333
|
enableAltRow: e.enableAltRow,
|
|
2148
2334
|
enableHover: e.enableHover,
|
|
@@ -2155,106 +2341,52 @@ var It = ({ value: t, onChange: n, options: r = [], placeholder: a = "Select opt
|
|
|
2155
2341
|
editSettings: e.editSettings
|
|
2156
2342
|
},
|
|
2157
2343
|
services: {},
|
|
2158
|
-
table:
|
|
2344
|
+
table: B,
|
|
2159
2345
|
dir: T,
|
|
2160
2346
|
baseApi: r,
|
|
2161
|
-
imperativeAPI:
|
|
2347
|
+
imperativeAPI: ze
|
|
2162
2348
|
}), [
|
|
2163
2349
|
r,
|
|
2164
|
-
|
|
2165
|
-
|
|
2350
|
+
ze,
|
|
2351
|
+
V,
|
|
2166
2352
|
xe,
|
|
2167
2353
|
Se,
|
|
2168
2354
|
Ce,
|
|
2169
|
-
|
|
2355
|
+
B,
|
|
2170
2356
|
T,
|
|
2357
|
+
g,
|
|
2171
2358
|
_,
|
|
2172
|
-
v,
|
|
2173
2359
|
Ee,
|
|
2174
2360
|
De,
|
|
2175
2361
|
Oe,
|
|
2362
|
+
v,
|
|
2176
2363
|
y,
|
|
2177
|
-
b,
|
|
2178
2364
|
x,
|
|
2179
|
-
ee,
|
|
2180
|
-
te,
|
|
2181
2365
|
M,
|
|
2182
2366
|
N,
|
|
2183
2367
|
P,
|
|
2184
|
-
|
|
2368
|
+
te,
|
|
2185
2369
|
F,
|
|
2370
|
+
I,
|
|
2371
|
+
L,
|
|
2186
2372
|
A,
|
|
2187
2373
|
j,
|
|
2188
|
-
|
|
2374
|
+
Fe,
|
|
2189
2375
|
S,
|
|
2190
2376
|
ge,
|
|
2191
2377
|
e,
|
|
2192
|
-
|
|
2378
|
+
O,
|
|
2193
2379
|
_e,
|
|
2194
2380
|
ve,
|
|
2195
2381
|
ye,
|
|
2196
2382
|
be,
|
|
2197
|
-
|
|
2383
|
+
ne,
|
|
2198
2384
|
Ae,
|
|
2199
2385
|
je,
|
|
2200
2386
|
pe
|
|
2201
2387
|
]);
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
|
-
//#region src/shared/hooks/useEventHandlers.ts
|
|
2205
|
-
function $t(e) {
|
|
2206
|
-
return {
|
|
2207
|
-
handleDragStart: H((t) => {
|
|
2208
|
-
e.onDragStart?.(t);
|
|
2209
|
-
}, [e.onDragStart]),
|
|
2210
|
-
handleDragOver: H((t) => {
|
|
2211
|
-
e.onDragOver?.(t);
|
|
2212
|
-
}, [e.onDragOver]),
|
|
2213
|
-
handleDragEnd: H((t) => {
|
|
2214
|
-
e.onDragEnd?.(t);
|
|
2215
|
-
}, [e.onDragEnd]),
|
|
2216
|
-
handleKeyPress: H((t) => {
|
|
2217
|
-
e.onKeyPress?.(t);
|
|
2218
|
-
}, [e.onKeyPress]),
|
|
2219
|
-
handleKeyDown: H((t) => {
|
|
2220
|
-
e.onKeyDown?.(t);
|
|
2221
|
-
}, [e.onKeyDown]),
|
|
2222
|
-
handleKeyUp: H((t) => {
|
|
2223
|
-
e.onKeyUp?.(t);
|
|
2224
|
-
}, [e.onKeyUp]),
|
|
2225
|
-
handleClick: H((t) => {
|
|
2226
|
-
e.onClick?.(t);
|
|
2227
|
-
}, [e.onClick]),
|
|
2228
|
-
handleDoubleClick: H((t) => {
|
|
2229
|
-
e.onDoubleClick?.(t);
|
|
2230
|
-
}, [e.onDoubleClick]),
|
|
2231
|
-
handlePointerDown: H((t) => {
|
|
2232
|
-
e.onPointerDown?.(t);
|
|
2233
|
-
}, [e.onPointerDown]),
|
|
2234
|
-
handlePointerMove: H((t) => {
|
|
2235
|
-
e.onPointerMove?.(t);
|
|
2236
|
-
}, [e.onPointerMove]),
|
|
2237
|
-
handlePointerUp: H((t) => {
|
|
2238
|
-
e.onPointerUp?.(t);
|
|
2239
|
-
}, [e.onPointerUp]),
|
|
2240
|
-
handlePointerLeave: H((t) => {
|
|
2241
|
-
e.onPointerLeave?.(t);
|
|
2242
|
-
}, [e.onPointerLeave]),
|
|
2243
|
-
handlePointerEnter: H((t) => {
|
|
2244
|
-
e.onPointerEnter?.(t);
|
|
2245
|
-
}, [e.onPointerEnter]),
|
|
2246
|
-
handleFocus: H(() => {
|
|
2247
|
-
e.onFocusChange?.(!0);
|
|
2248
|
-
}, [e.onFocusChange]),
|
|
2249
|
-
handleBlur: H(() => {
|
|
2250
|
-
e.onFocusChange?.(!1);
|
|
2251
|
-
}, [e.onFocusChange])
|
|
2252
|
-
};
|
|
2253
|
-
}
|
|
2254
|
-
//#endregion
|
|
2255
|
-
//#region src/components/EzTable/hooks/useContainerResize.ts
|
|
2256
|
-
var en = ({ containerRef: e, containerSizeRef: t, resizeTimeoutRef: n, onResize: r }, i) => {
|
|
2257
|
-
U(() => {
|
|
2388
|
+
}, rn = ({ containerRef: e, containerSizeRef: t, resizeTimeoutRef: n, onResize: r }, i) => {
|
|
2389
|
+
W(() => {
|
|
2258
2390
|
if (!e.current) return;
|
|
2259
2391
|
let i = e.current;
|
|
2260
2392
|
i.style.height = "100%", i.style.minHeight = "0", i.style.height = "";
|
|
@@ -2273,8 +2405,8 @@ var en = ({ containerRef: e, containerSizeRef: t, resizeTimeoutRef: n, onResize:
|
|
|
2273
2405
|
a.disconnect(), n.current && clearTimeout(n.current);
|
|
2274
2406
|
};
|
|
2275
2407
|
}, i);
|
|
2276
|
-
},
|
|
2277
|
-
let s =
|
|
2408
|
+
}, an = ({ table: e, editSettings: t, toggleRowEditing: n, onRowClickProp: r, onRowDoubleClickProp: i, onCellClickProp: a, onCellDoubleClickProp: o }) => {
|
|
2409
|
+
let s = U((s, c) => {
|
|
2278
2410
|
let l = e.options.meta;
|
|
2279
2411
|
if (l?.setFocusedCell) {
|
|
2280
2412
|
let t = s.colIndex ?? e.getVisibleLeafColumns().findIndex((e) => e.id === s.columnId);
|
|
@@ -2297,8 +2429,8 @@ var en = ({ containerRef: e, containerSizeRef: t, resizeTimeoutRef: n, onResize:
|
|
|
2297
2429
|
onCellClick: (e) => s(e, "click"),
|
|
2298
2430
|
onCellDoubleClick: (e) => s(e, "dblclick")
|
|
2299
2431
|
};
|
|
2300
|
-
},
|
|
2301
|
-
|
|
2432
|
+
}, on = ({ dialogState: e, isDialogMode: t, rows: n, table: r }) => {
|
|
2433
|
+
W(() => {
|
|
2302
2434
|
if (!t) return;
|
|
2303
2435
|
let i = Object.keys(r.options.meta?.editingRows || {}).find((e) => r.options.meta?.editingRows?.[e]);
|
|
2304
2436
|
if (i !== void 0) {
|
|
@@ -2311,147 +2443,147 @@ var en = ({ containerRef: e, containerSizeRef: t, resizeTimeoutRef: n, onResize:
|
|
|
2311
2443
|
n,
|
|
2312
2444
|
r
|
|
2313
2445
|
]);
|
|
2314
|
-
},
|
|
2446
|
+
}, sn = () => /* @__PURE__ */ X("div", {
|
|
2315
2447
|
className: "flex flex-col items-center justify-center min-h-screen p-4",
|
|
2316
|
-
children: /* @__PURE__ */
|
|
2448
|
+
children: /* @__PURE__ */ Z("div", {
|
|
2317
2449
|
className: "flex flex-col items-center gap-4 max-w-md w-full",
|
|
2318
2450
|
children: [
|
|
2319
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ X("div", {
|
|
2320
2452
|
className: "flex items-center justify-center w-16 h-16 rounded-full bg-destructive/10",
|
|
2321
|
-
children: /* @__PURE__ */
|
|
2453
|
+
children: /* @__PURE__ */ X(oe, { className: "w-8 h-8 text-destructive" })
|
|
2322
2454
|
}),
|
|
2323
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ Z("div", {
|
|
2324
2456
|
className: "flex flex-col items-center gap-2 text-center",
|
|
2325
|
-
children: [/* @__PURE__ */
|
|
2457
|
+
children: [/* @__PURE__ */ X("h2", {
|
|
2326
2458
|
className: "text-lg font-semibold",
|
|
2327
2459
|
children: "Table Error"
|
|
2328
|
-
}), /* @__PURE__ */
|
|
2460
|
+
}), /* @__PURE__ */ X("p", {
|
|
2329
2461
|
className: "text-sm text-muted-foreground",
|
|
2330
2462
|
children: "Something went wrong with the table. Please refresh the page or try again."
|
|
2331
2463
|
})]
|
|
2332
2464
|
}),
|
|
2333
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ Z("button", {
|
|
2334
2466
|
onClick: () => window.location.reload(),
|
|
2335
2467
|
className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 rounded-md transition-colors",
|
|
2336
|
-
children: [/* @__PURE__ */
|
|
2468
|
+
children: [/* @__PURE__ */ X(De, { className: "w-4 h-4" }), "Refresh Page"]
|
|
2337
2469
|
})
|
|
2338
2470
|
]
|
|
2339
2471
|
})
|
|
2340
|
-
}),
|
|
2472
|
+
}), cn = (e) => {
|
|
2341
2473
|
switch (e) {
|
|
2342
2474
|
case "compact": return "min-h-[40px]";
|
|
2343
2475
|
case "comfortable": return "min-h-[56px]";
|
|
2344
2476
|
default: return "min-h-[48px]";
|
|
2345
2477
|
}
|
|
2346
|
-
},
|
|
2478
|
+
}, ln = (e) => {
|
|
2347
2479
|
switch (e) {
|
|
2348
2480
|
case "compact": return "py-0 px-2";
|
|
2349
2481
|
case "comfortable": return "py-4 px-4";
|
|
2350
2482
|
default: return "py-2 px-4";
|
|
2351
2483
|
}
|
|
2352
|
-
},
|
|
2484
|
+
}, un = (e) => {
|
|
2353
2485
|
switch (e) {
|
|
2354
2486
|
case "compact": return "text-[13px] leading-5";
|
|
2355
2487
|
case "comfortable": return "text-base";
|
|
2356
2488
|
default: return "text-sm";
|
|
2357
2489
|
}
|
|
2358
|
-
},
|
|
2490
|
+
}, dn = (t) => e(cn(t), ln(t), un(t)), fn = (e, t, n = "ltr") => e ? {
|
|
2359
2491
|
position: "sticky",
|
|
2360
2492
|
[n === "rtl" ? e === "left" ? "right" : "left" : e === "left" ? "left" : "right"]: `${t}px`,
|
|
2361
2493
|
zIndex: 30
|
|
2362
|
-
} : {},
|
|
2494
|
+
} : {}, pn = (t, n = "ltr") => {
|
|
2363
2495
|
if (!t) return "";
|
|
2364
2496
|
let r = t === "left", i = n === "rtl";
|
|
2365
2497
|
return e("bg-background", r && !i || !r && i ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)] dark:shadow-[2px_0_5px_-2px_rgba(0,0,0,0.3)]" : "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)] dark:shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.3)]");
|
|
2366
|
-
},
|
|
2498
|
+
}, mn = (e, t = "ltr") => {
|
|
2367
2499
|
switch (e) {
|
|
2368
2500
|
case "center": return "justify-center text-center";
|
|
2369
2501
|
case "right": return "justify-end text-right";
|
|
2370
2502
|
case "left": return "justify-start text-left";
|
|
2371
2503
|
default: return t === "rtl" ? "justify-end text-right" : "justify-start text-left";
|
|
2372
2504
|
}
|
|
2373
|
-
},
|
|
2505
|
+
}, hn = (t, n) => e(t && "bg-primary/10 ring-1 ring-inset ring-primary/30 z-[1]", n && "bg-primary/10 z-[10]"), gn = (e, t) => {
|
|
2374
2506
|
switch (e) {
|
|
2375
2507
|
case "wrap": return "whitespace-normal break-words";
|
|
2376
2508
|
case "ellipsis": return t ? "overflow-hidden" : "truncate";
|
|
2377
2509
|
default: return "truncate";
|
|
2378
2510
|
}
|
|
2379
|
-
},
|
|
2511
|
+
}, _n = (e, t, n = "ltr") => t || !e || e === "None" || e === "Horizontal" ? "" : n === "rtl" ? "border-l border-border/50" : "border-r border-border/50", vn = {
|
|
2380
2512
|
compact: "py-1 text-xs",
|
|
2381
2513
|
standard: "py-2 text-sm",
|
|
2382
2514
|
comfortable: "py-4 text-base"
|
|
2383
|
-
},
|
|
2515
|
+
}, yn = (e = "standard") => vn[e], bn = "flex flex-col", xn = {
|
|
2384
2516
|
default: "border border-border",
|
|
2385
2517
|
bottom: "border-b border-border",
|
|
2386
2518
|
top: "border-t border-border",
|
|
2387
2519
|
left: "border-l border-border",
|
|
2388
2520
|
right: "border-r border-border",
|
|
2389
2521
|
none: "border-0"
|
|
2390
|
-
},
|
|
2522
|
+
}, Sn = ({ header: t, density: n }) => {
|
|
2391
2523
|
let r = t.column.columnDef.meta?.align || "left";
|
|
2392
|
-
return /* @__PURE__ */
|
|
2393
|
-
className: e("relative h-full font-semibold text-foreground flex items-center select-none px-4", "bg-background/90 border border-border/50 shadow-lg rounded-md opacity-90 cursor-grabbing", "ring-2 ring-primary/20",
|
|
2524
|
+
return /* @__PURE__ */ X("div", {
|
|
2525
|
+
className: e("relative h-full font-semibold text-foreground flex items-center select-none px-4", "bg-background/90 border border-border/50 shadow-lg rounded-md opacity-90 cursor-grabbing", "ring-2 ring-primary/20", yn(n), r === "center" && "justify-center text-center", r === "right" && "justify-end text-right"),
|
|
2394
2526
|
style: {
|
|
2395
2527
|
width: t.getSize(),
|
|
2396
2528
|
maxWidth: t.column.columnDef.maxSize,
|
|
2397
2529
|
minWidth: t.column.columnDef.minSize
|
|
2398
2530
|
},
|
|
2399
|
-
children: /* @__PURE__ */
|
|
2531
|
+
children: /* @__PURE__ */ Z("div", {
|
|
2400
2532
|
className: e("flex items-center w-full gap-2", r === "center" && "justify-center relative", r === "right" && "justify-end"),
|
|
2401
|
-
children: [/* @__PURE__ */
|
|
2533
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2402
2534
|
className: "p-1 text-zinc-400",
|
|
2403
|
-
children: /* @__PURE__ */
|
|
2404
|
-
}), /* @__PURE__ */
|
|
2535
|
+
children: /* @__PURE__ */ X(ve, { className: "w-3.5 h-3.5" })
|
|
2536
|
+
}), /* @__PURE__ */ X("span", {
|
|
2405
2537
|
className: "truncate",
|
|
2406
|
-
children:
|
|
2538
|
+
children: Ye(t.column.columnDef.header, t.getContext())
|
|
2407
2539
|
})]
|
|
2408
2540
|
})
|
|
2409
2541
|
});
|
|
2410
|
-
},
|
|
2542
|
+
}, Cn = H(({ table: t, totalRows: n, selectionInfo: r, rowSelection: i }) => {
|
|
2411
2543
|
let a = n ?? (t.getPrePaginationRowModel().rows.length || t.options.rowCount || t.getRowModel().rows.length), o = typeof a == "number" ? a : 0, s = Object.keys(i || {}).length;
|
|
2412
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ Z("div", {
|
|
2413
2545
|
className: e("flex border-t border-border p-2 text-xs text-muted-foreground justify-between bg-muted/30", "rounded-b-md"),
|
|
2414
|
-
children: [/* @__PURE__ */
|
|
2546
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
2415
2547
|
className: "flex gap-4 items-center",
|
|
2416
2548
|
children: [
|
|
2417
|
-
/* @__PURE__ */
|
|
2549
|
+
/* @__PURE__ */ Z("span", { children: [
|
|
2418
2550
|
"Total: ",
|
|
2419
2551
|
o,
|
|
2420
2552
|
" rows"
|
|
2421
2553
|
] }),
|
|
2422
|
-
s > 0 && /* @__PURE__ */
|
|
2554
|
+
s > 0 && /* @__PURE__ */ Z("span", {
|
|
2423
2555
|
className: "text-primary font-medium",
|
|
2424
2556
|
children: [s, " selected"]
|
|
2425
2557
|
}),
|
|
2426
|
-
typeof r == "string" && /* @__PURE__ */
|
|
2558
|
+
typeof r == "string" && /* @__PURE__ */ Z("span", { children: ["| ", r] })
|
|
2427
2559
|
]
|
|
2428
|
-
}), /* @__PURE__ */
|
|
2560
|
+
}), /* @__PURE__ */ X("div", { className: "flex gap-2" })]
|
|
2429
2561
|
});
|
|
2430
2562
|
});
|
|
2431
|
-
|
|
2563
|
+
Cn.displayName = "EzTableStatusBar";
|
|
2432
2564
|
//#endregion
|
|
2433
2565
|
//#region src/components/EzTable/utils/columnTypeDetector.ts
|
|
2434
|
-
function
|
|
2566
|
+
function wn(e) {
|
|
2435
2567
|
if (!e || e.length === 0) return "text";
|
|
2436
2568
|
let t = e.slice(0, 100).filter((e) => e != null && e !== "");
|
|
2437
2569
|
if (t.length === 0) return "text";
|
|
2438
2570
|
if (t.every((e) => typeof e == "boolean" || e === "true" || e === "false")) return "boolean";
|
|
2439
2571
|
if (t.every((e) => typeof e == "number" || !isNaN(parseFloat(e)) && isFinite(e))) return "number";
|
|
2440
|
-
if (t.every((e) => e instanceof Date
|
|
2572
|
+
if (t.every((e) => e instanceof Date || typeof e == "string" && !isNaN(Date.parse(e)) && e.length > 5 && (e.includes("-") || e.includes("/") || e.includes(":")))) return t.some((e) => String(e).includes(":") || e instanceof Date && (e.getHours() !== 0 || e.getMinutes() !== 0)) ? "datetime" : "date";
|
|
2441
2573
|
let n = new Set(t.map((e) => String(e)));
|
|
2442
2574
|
return n.size > 0 && n.size <= Math.min(t.length * .2, 10) ? "select" : t.some((e) => typeof e == "string" && e.length > 100) ? "longtext" : "text";
|
|
2443
2575
|
}
|
|
2444
2576
|
//#endregion
|
|
2445
2577
|
//#region src/components/EzTable/hooks/useFilterSelection.ts
|
|
2446
|
-
function
|
|
2447
|
-
let [n, r] =
|
|
2578
|
+
function Tn(e, t) {
|
|
2579
|
+
let [n, r] = q(() => Array.isArray(e) ? new Set(e) : null);
|
|
2448
2580
|
return {
|
|
2449
2581
|
selectedValues: n,
|
|
2450
2582
|
isAllSelected: n === null,
|
|
2451
|
-
handleSelectAll:
|
|
2583
|
+
handleSelectAll: U((e) => {
|
|
2452
2584
|
r(e ? null : /* @__PURE__ */ new Set());
|
|
2453
2585
|
}, []),
|
|
2454
|
-
handleSelect:
|
|
2586
|
+
handleSelect: U((e, n) => {
|
|
2455
2587
|
r((r) => {
|
|
2456
2588
|
if (r === null) {
|
|
2457
2589
|
if (n) return null;
|
|
@@ -2465,7 +2597,7 @@ function Sn(e, t) {
|
|
|
2465
2597
|
return i;
|
|
2466
2598
|
});
|
|
2467
2599
|
}, [t]),
|
|
2468
|
-
handleBulkSelect:
|
|
2600
|
+
handleBulkSelect: U((e, n) => {
|
|
2469
2601
|
r((r) => {
|
|
2470
2602
|
let i = r || new Set(t), a = new Set(i);
|
|
2471
2603
|
if (n) {
|
|
@@ -2474,35 +2606,35 @@ function Sn(e, t) {
|
|
|
2474
2606
|
return a;
|
|
2475
2607
|
});
|
|
2476
2608
|
}, [t]),
|
|
2477
|
-
clearSelection:
|
|
2609
|
+
clearSelection: U(() => {
|
|
2478
2610
|
r(null);
|
|
2479
2611
|
}, [])
|
|
2480
2612
|
};
|
|
2481
2613
|
}
|
|
2482
2614
|
//#endregion
|
|
2483
2615
|
//#region src/components/EzTable/components/SelectAllCheckbox.tsx
|
|
2484
|
-
var
|
|
2616
|
+
var En = V.memo(({ checked: e, indeterminate: t, onSelectAll: n, showSearchResults: r = !1 }) => /* @__PURE__ */ Z("div", {
|
|
2485
2617
|
className: "flex items-center space-x-2 px-2 py-1.5 hover:bg-muted rounded text-sm cursor-pointer",
|
|
2486
2618
|
onClick: () => n(!e),
|
|
2487
|
-
children: [/* @__PURE__ */
|
|
2619
|
+
children: [/* @__PURE__ */ X(te, {
|
|
2488
2620
|
checked: e ? !0 : t ? "indeterminate" : !1,
|
|
2489
2621
|
onCheckedChange: (e) => n(e === !0)
|
|
2490
|
-
}), /* @__PURE__ */
|
|
2622
|
+
}), /* @__PURE__ */ X("label", {
|
|
2491
2623
|
className: "flex-1 cursor-pointer",
|
|
2492
2624
|
children: r ? "(Select All Search Results)" : "(Select All)"
|
|
2493
2625
|
})]
|
|
2494
2626
|
}));
|
|
2495
|
-
|
|
2627
|
+
En.displayName = "SelectAllCheckbox";
|
|
2496
2628
|
//#endregion
|
|
2497
2629
|
//#region src/components/EzTable/components/BooleanFilterSection.tsx
|
|
2498
|
-
var
|
|
2630
|
+
var Dn = V.memo(({ column: e }) => {
|
|
2499
2631
|
let t = e.columnDef.meta;
|
|
2500
|
-
return /* @__PURE__ */
|
|
2632
|
+
return /* @__PURE__ */ Z("div", {
|
|
2501
2633
|
className: "p-3 space-y-3",
|
|
2502
|
-
children: [/* @__PURE__ */
|
|
2634
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2503
2635
|
className: "text-sm font-medium",
|
|
2504
2636
|
children: "Filter by value:"
|
|
2505
|
-
}), /* @__PURE__ */
|
|
2637
|
+
}), /* @__PURE__ */ X(Dt, {
|
|
2506
2638
|
value: e.getFilterValue() || "all",
|
|
2507
2639
|
onChange: (t) => {
|
|
2508
2640
|
e.setFilterValue(t);
|
|
@@ -2513,12 +2645,12 @@ var wn = B.memo(({ column: e }) => {
|
|
|
2513
2645
|
})]
|
|
2514
2646
|
});
|
|
2515
2647
|
});
|
|
2516
|
-
|
|
2648
|
+
Dn.displayName = "BooleanFilterSection";
|
|
2517
2649
|
//#endregion
|
|
2518
2650
|
//#region src/components/EzTable/components/SelectFilterSection.tsx
|
|
2519
|
-
var
|
|
2651
|
+
var On = V.memo(({ column: e, allAvailableValues: t }) => /* @__PURE__ */ X("div", {
|
|
2520
2652
|
className: "p-1",
|
|
2521
|
-
children: /* @__PURE__ */
|
|
2653
|
+
children: /* @__PURE__ */ X(Vt, {
|
|
2522
2654
|
options: t.map((e) => ({
|
|
2523
2655
|
value: String(e),
|
|
2524
2656
|
label: String(e)
|
|
@@ -2529,20 +2661,20 @@ var Tn = B.memo(({ column: e, allAvailableValues: t }) => /* @__PURE__ */ Y("div
|
|
|
2529
2661
|
}
|
|
2530
2662
|
})
|
|
2531
2663
|
}));
|
|
2532
|
-
|
|
2664
|
+
On.displayName = "SelectFilterSection";
|
|
2533
2665
|
//#endregion
|
|
2534
2666
|
//#region src/components/EzTable/components/VirtualizedFilterList.tsx
|
|
2535
|
-
var
|
|
2536
|
-
let i =
|
|
2667
|
+
var kn = V.memo(({ sortedUniqueValues: e, selectedValues: t, handleSelect: n, formatter: r }) => {
|
|
2668
|
+
let i = K(null), a = Pe({
|
|
2537
2669
|
count: e.length,
|
|
2538
2670
|
getScrollElement: () => i.current,
|
|
2539
2671
|
estimateSize: () => 32,
|
|
2540
2672
|
overscan: 5
|
|
2541
2673
|
});
|
|
2542
|
-
return /* @__PURE__ */
|
|
2674
|
+
return /* @__PURE__ */ X("div", {
|
|
2543
2675
|
ref: i,
|
|
2544
2676
|
className: "flex-1 overflow-y-auto px-2 pb-2 min-h-0 pt-2",
|
|
2545
|
-
children: /* @__PURE__ */
|
|
2677
|
+
children: /* @__PURE__ */ X("div", {
|
|
2546
2678
|
style: {
|
|
2547
2679
|
height: `${a.getTotalSize()}px`,
|
|
2548
2680
|
width: "100%",
|
|
@@ -2550,17 +2682,17 @@ var En = B.memo(({ sortedUniqueValues: e, selectedValues: t, handleSelect: n, fo
|
|
|
2550
2682
|
},
|
|
2551
2683
|
children: a.getVirtualItems().map((i) => {
|
|
2552
2684
|
let a = e[i.index], o = t === null || t.has(a), s = r ? r(a) : String(a) || "(Empty)";
|
|
2553
|
-
return /* @__PURE__ */
|
|
2685
|
+
return /* @__PURE__ */ Z("div", {
|
|
2554
2686
|
className: "absolute top-0 left-0 w-full flex items-center space-x-2 px-2 py-1 hover:bg-muted rounded text-sm cursor-pointer",
|
|
2555
2687
|
style: {
|
|
2556
2688
|
height: `${i.size}px`,
|
|
2557
2689
|
transform: `translateY(${i.start}px)`
|
|
2558
2690
|
},
|
|
2559
2691
|
onClick: () => n(a, !o),
|
|
2560
|
-
children: [/* @__PURE__ */
|
|
2692
|
+
children: [/* @__PURE__ */ X(te, {
|
|
2561
2693
|
checked: o,
|
|
2562
2694
|
onCheckedChange: (e) => n(a, e === !0)
|
|
2563
|
-
}), /* @__PURE__ */
|
|
2695
|
+
}), /* @__PURE__ */ X("span", {
|
|
2564
2696
|
className: "flex-1 truncate",
|
|
2565
2697
|
children: s
|
|
2566
2698
|
})]
|
|
@@ -2569,50 +2701,50 @@ var En = B.memo(({ sortedUniqueValues: e, selectedValues: t, handleSelect: n, fo
|
|
|
2569
2701
|
})
|
|
2570
2702
|
});
|
|
2571
2703
|
});
|
|
2572
|
-
|
|
2704
|
+
kn.displayName = "VirtualizedFilterList";
|
|
2573
2705
|
//#endregion
|
|
2574
2706
|
//#region src/components/EzTable/components/FilterActionButtons.tsx
|
|
2575
|
-
var
|
|
2707
|
+
var An = V.memo(({ onClear: e, onApply: t, onAddRule: n, onAddGroup: r, onRemove: a, showClear: o = !0, showApply: s = !0, showAddRule: c = !1, showAddGroup: l = !1, showRemove: u = !1, className: d }) => /* @__PURE__ */ Z("div", {
|
|
2576
2708
|
className: `p-2 border-t flex justify-between bg-popover text-popover-foreground flex-shrink-0 sticky bottom-0 z-20 ${d || ""}`,
|
|
2577
|
-
children: [/* @__PURE__ */
|
|
2709
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
2578
2710
|
className: "flex gap-2",
|
|
2579
2711
|
children: [
|
|
2580
|
-
o && e && /* @__PURE__ */
|
|
2712
|
+
o && e && /* @__PURE__ */ X(i, {
|
|
2581
2713
|
variant: "ghost",
|
|
2582
2714
|
size: "sm",
|
|
2583
2715
|
onClick: e,
|
|
2584
2716
|
className: "h-8 text-xs",
|
|
2585
2717
|
children: "Clear"
|
|
2586
2718
|
}),
|
|
2587
|
-
c && n && /* @__PURE__ */
|
|
2719
|
+
c && n && /* @__PURE__ */ X(i, {
|
|
2588
2720
|
variant: "ghost",
|
|
2589
2721
|
size: "icon",
|
|
2590
2722
|
className: "h-6 w-6",
|
|
2591
2723
|
onClick: n,
|
|
2592
2724
|
title: "Add Rule",
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2725
|
+
children: /* @__PURE__ */ X(Ee, { className: "w-4 h-4" })
|
|
2594
2726
|
}),
|
|
2595
|
-
l && r && /* @__PURE__ */
|
|
2727
|
+
l && r && /* @__PURE__ */ X(i, {
|
|
2596
2728
|
variant: "ghost",
|
|
2597
2729
|
size: "icon",
|
|
2598
2730
|
className: "h-6 w-6",
|
|
2599
2731
|
onClick: r,
|
|
2600
2732
|
title: "Add Group",
|
|
2601
|
-
children: /* @__PURE__ */
|
|
2733
|
+
children: /* @__PURE__ */ X("span", {
|
|
2602
2734
|
className: "font-bold text-xs",
|
|
2603
2735
|
children: "( )"
|
|
2604
2736
|
})
|
|
2605
2737
|
})
|
|
2606
2738
|
]
|
|
2607
|
-
}), /* @__PURE__ */
|
|
2739
|
+
}), /* @__PURE__ */ Z("div", {
|
|
2608
2740
|
className: "flex gap-2",
|
|
2609
|
-
children: [u && a && /* @__PURE__ */
|
|
2741
|
+
children: [u && a && /* @__PURE__ */ X(i, {
|
|
2610
2742
|
variant: "ghost",
|
|
2611
2743
|
size: "icon",
|
|
2612
2744
|
className: "h-6 w-6 text-red-500 hover:text-red-600",
|
|
2613
2745
|
onClick: a,
|
|
2614
|
-
children: /* @__PURE__ */
|
|
2615
|
-
}), s && t && /* @__PURE__ */
|
|
2746
|
+
children: /* @__PURE__ */ X(je, { className: "w-4 h-4" })
|
|
2747
|
+
}), s && t && /* @__PURE__ */ X(i, {
|
|
2616
2748
|
size: "sm",
|
|
2617
2749
|
onClick: t,
|
|
2618
2750
|
className: "min-w-[70px] h-8 text-xs font-semibold",
|
|
@@ -2620,40 +2752,40 @@ var Dn = B.memo(({ onClear: e, onApply: t, onAddRule: n, onAddGroup: r, onRemove
|
|
|
2620
2752
|
})]
|
|
2621
2753
|
})]
|
|
2622
2754
|
}));
|
|
2623
|
-
|
|
2755
|
+
An.displayName = "FilterActionButtons";
|
|
2624
2756
|
//#endregion
|
|
2625
2757
|
//#region src/components/EzTable/EzDateFilterTree.tsx
|
|
2626
|
-
function
|
|
2627
|
-
let [r, i] =
|
|
2758
|
+
function jn({ node: e, selectedValues: t, onBulkSelect: n }) {
|
|
2759
|
+
let [r, i] = q(!1), a = !1;
|
|
2628
2760
|
if (t === null) a = !0;
|
|
2629
2761
|
else {
|
|
2630
2762
|
let n = e.fullValues.filter((e) => t.has(e)).length;
|
|
2631
|
-
a = n === e.fullValues.length && e.fullValues.length > 0
|
|
2763
|
+
a = n === e.fullValues.length && e.fullValues.length > 0 || n > 0 && "indeterminate";
|
|
2632
2764
|
}
|
|
2633
2765
|
let o = (t) => {
|
|
2634
2766
|
n(e.fullValues, t);
|
|
2635
2767
|
};
|
|
2636
|
-
return /* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ Z("div", {
|
|
2637
2769
|
className: "pl-4",
|
|
2638
|
-
children: [/* @__PURE__ */
|
|
2770
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
2639
2771
|
className: "flex items-center space-x-2 py-1 hover:bg-muted/50 rounded",
|
|
2640
2772
|
children: [
|
|
2641
|
-
e.children && e.children.length > 0 ? /* @__PURE__ */
|
|
2773
|
+
e.children && e.children.length > 0 ? /* @__PURE__ */ X("button", {
|
|
2642
2774
|
onClick: (e) => {
|
|
2643
2775
|
e.stopPropagation(), i(!r);
|
|
2644
2776
|
},
|
|
2645
2777
|
className: "p-0.5 hover:bg-muted rounded mr-1 text-muted-foreground",
|
|
2646
|
-
children:
|
|
2647
|
-
}) : /* @__PURE__ */
|
|
2648
|
-
/* @__PURE__ */
|
|
2778
|
+
children: X(r ? le : de, { className: "w-4 h-4" })
|
|
2779
|
+
}) : /* @__PURE__ */ X("span", { className: "w-5 mr-1" }),
|
|
2780
|
+
/* @__PURE__ */ X(te, {
|
|
2649
2781
|
checked: a === "indeterminate" ? "indeterminate" : a,
|
|
2650
2782
|
onCheckedChange: (e) => o(e === !0),
|
|
2651
2783
|
id: `node-${e.key}`
|
|
2652
2784
|
}),
|
|
2653
|
-
/* @__PURE__ */
|
|
2785
|
+
/* @__PURE__ */ Z("label", {
|
|
2654
2786
|
htmlFor: `node-${e.key}`,
|
|
2655
2787
|
className: "text-sm flex-1 cursor-pointer select-none text-foreground",
|
|
2656
|
-
children: [e.label, /* @__PURE__ */
|
|
2788
|
+
children: [e.label, /* @__PURE__ */ Z("span", {
|
|
2657
2789
|
className: "ml-2 text-xs text-muted-foreground",
|
|
2658
2790
|
children: [
|
|
2659
2791
|
"(",
|
|
@@ -2663,9 +2795,9 @@ function On({ node: e, selectedValues: t, onBulkSelect: n }) {
|
|
|
2663
2795
|
})]
|
|
2664
2796
|
})
|
|
2665
2797
|
]
|
|
2666
|
-
}), e.children && r && /* @__PURE__ */
|
|
2798
|
+
}), e.children && r && /* @__PURE__ */ X("div", {
|
|
2667
2799
|
className: "border-l border-border ml-2",
|
|
2668
|
-
children: e.children.map((e) => /* @__PURE__ */
|
|
2800
|
+
children: e.children.map((e) => /* @__PURE__ */ X(jn, {
|
|
2669
2801
|
node: e,
|
|
2670
2802
|
selectedValues: t,
|
|
2671
2803
|
onBulkSelect: n
|
|
@@ -2673,8 +2805,8 @@ function On({ node: e, selectedValues: t, onBulkSelect: n }) {
|
|
|
2673
2805
|
})]
|
|
2674
2806
|
});
|
|
2675
2807
|
}
|
|
2676
|
-
function
|
|
2677
|
-
let r =
|
|
2808
|
+
function Mn({ uniqueValues: e, selectedValues: t, onBulkSelect: n }) {
|
|
2809
|
+
let r = G(() => {
|
|
2678
2810
|
let t = [], n = Array.from(e.keys()).map((e) => {
|
|
2679
2811
|
let t = e instanceof Date ? e : new Date(e);
|
|
2680
2812
|
return {
|
|
@@ -2723,12 +2855,12 @@ function kn({ uniqueValues: e, selectedValues: t, onBulkSelect: n }) {
|
|
|
2723
2855
|
}), t.push(r);
|
|
2724
2856
|
}), t;
|
|
2725
2857
|
}, [e]);
|
|
2726
|
-
return /* @__PURE__ */
|
|
2858
|
+
return /* @__PURE__ */ Z("div", {
|
|
2727
2859
|
className: "space-y-1",
|
|
2728
|
-
children: [r.length === 0 && /* @__PURE__ */
|
|
2860
|
+
children: [r.length === 0 && /* @__PURE__ */ X("div", {
|
|
2729
2861
|
className: "p-2 text-sm text-muted-foreground",
|
|
2730
2862
|
children: "No dates found"
|
|
2731
|
-
}), r.map((e) => /* @__PURE__ */
|
|
2863
|
+
}), r.map((e) => /* @__PURE__ */ X(jn, {
|
|
2732
2864
|
node: e,
|
|
2733
2865
|
selectedValues: t,
|
|
2734
2866
|
onBulkSelect: n
|
|
@@ -2737,21 +2869,21 @@ function kn({ uniqueValues: e, selectedValues: t, onBulkSelect: n }) {
|
|
|
2737
2869
|
}
|
|
2738
2870
|
//#endregion
|
|
2739
2871
|
//#region src/components/EzTable/components/FilterRuleSelect.tsx
|
|
2740
|
-
var
|
|
2872
|
+
var Nn = V.memo(({ value: e, onChange: t, options: n, placeholder: r, className: i }) => /* @__PURE__ */ Z(P, {
|
|
2741
2873
|
value: e,
|
|
2742
2874
|
onValueChange: (e) => t(e),
|
|
2743
|
-
children: [/* @__PURE__ */
|
|
2875
|
+
children: [/* @__PURE__ */ X(j, {
|
|
2744
2876
|
className: i,
|
|
2745
|
-
children: /* @__PURE__ */
|
|
2746
|
-
}), /* @__PURE__ */
|
|
2877
|
+
children: /* @__PURE__ */ X(A, { placeholder: r })
|
|
2878
|
+
}), /* @__PURE__ */ X(M, { children: n.map((e) => /* @__PURE__ */ X(N, {
|
|
2747
2879
|
value: e.value,
|
|
2748
2880
|
children: e.label
|
|
2749
2881
|
}, e.value)) })]
|
|
2750
2882
|
}));
|
|
2751
|
-
|
|
2883
|
+
Nn.displayName = "FilterRuleSelect";
|
|
2752
2884
|
//#endregion
|
|
2753
2885
|
//#region src/components/EzTable/components/AdvancedColumnFilter.tsx
|
|
2754
|
-
var
|
|
2886
|
+
var Pn = {
|
|
2755
2887
|
text: [
|
|
2756
2888
|
{
|
|
2757
2889
|
label: "Contains",
|
|
@@ -2830,15 +2962,15 @@ var jn = {
|
|
|
2830
2962
|
value: "between"
|
|
2831
2963
|
}
|
|
2832
2964
|
]
|
|
2833
|
-
},
|
|
2834
|
-
let i =
|
|
2965
|
+
}, Fn = ({ columnType: e, columnId: t, value: n, onChange: r }) => {
|
|
2966
|
+
let i = Pn[e === "datetime" || e === "date" ? "date" : e === "number" ? "number" : "text"] || Pn.text, s = e === "number" ? "number" : e === "date" || e === "datetime" ? "date" : "text", c = n?.kind === "group", l = c ? n.filters[0] : n?.operator ? n : {
|
|
2835
2967
|
operator: i[0].value,
|
|
2836
2968
|
value: ""
|
|
2837
2969
|
}, u = c ? n.filters[1] : {
|
|
2838
2970
|
operator: i[0].value,
|
|
2839
2971
|
value: ""
|
|
2840
|
-
}, d = c ? n.logic : "OR", f = c, [p, m] =
|
|
2841
|
-
|
|
2972
|
+
}, d = c ? n.logic : "OR", f = c, [p, m] = q(l), [h, g] = q(u), [_, v] = q(d), [y, b] = q(f);
|
|
2973
|
+
V.useEffect(() => {
|
|
2842
2974
|
let e = n?.kind === "group", t = e ? n.filters[0] : n?.operator ? n : {
|
|
2843
2975
|
operator: i[0].value,
|
|
2844
2976
|
value: ""
|
|
@@ -2888,15 +3020,15 @@ var jn = {
|
|
|
2888
3020
|
};
|
|
2889
3021
|
if (e.operator === "between") {
|
|
2890
3022
|
let t = Array.isArray(e.value) ? e.value : [e.value ?? "", ""];
|
|
2891
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ Z("div", {
|
|
2892
3024
|
className: "flex gap-2",
|
|
2893
|
-
children: [/* @__PURE__ */
|
|
3025
|
+
children: [/* @__PURE__ */ X(a, {
|
|
2894
3026
|
type: s,
|
|
2895
3027
|
value: t[0],
|
|
2896
3028
|
onChange: (e) => r([e.target.value, t[1]]),
|
|
2897
3029
|
className: "h-8 shadow-none flex-1",
|
|
2898
3030
|
placeholder: "From..."
|
|
2899
|
-
}), /* @__PURE__ */
|
|
3031
|
+
}), /* @__PURE__ */ X(a, {
|
|
2900
3032
|
type: s,
|
|
2901
3033
|
value: t[1],
|
|
2902
3034
|
onChange: (e) => r([t[0], e.target.value]),
|
|
@@ -2905,7 +3037,7 @@ var jn = {
|
|
|
2905
3037
|
})]
|
|
2906
3038
|
});
|
|
2907
3039
|
}
|
|
2908
|
-
return /* @__PURE__ */
|
|
3040
|
+
return /* @__PURE__ */ X(a, {
|
|
2909
3041
|
type: s,
|
|
2910
3042
|
value: e.value ?? "",
|
|
2911
3043
|
onChange: (e) => r(e.target.value),
|
|
@@ -2913,17 +3045,17 @@ var jn = {
|
|
|
2913
3045
|
placeholder: "Enter value..."
|
|
2914
3046
|
});
|
|
2915
3047
|
};
|
|
2916
|
-
return /* @__PURE__ */
|
|
3048
|
+
return /* @__PURE__ */ Z("div", {
|
|
2917
3049
|
className: "p-3 space-y-4",
|
|
2918
3050
|
children: [
|
|
2919
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ Z("div", {
|
|
2920
3052
|
className: "space-y-2",
|
|
2921
|
-
children: [/* @__PURE__ */
|
|
3053
|
+
children: [/* @__PURE__ */ X(o, {
|
|
2922
3054
|
className: "text-xs font-medium text-muted-foreground uppercase",
|
|
2923
3055
|
children: "Show rows where:"
|
|
2924
|
-
}), /* @__PURE__ */
|
|
3056
|
+
}), /* @__PURE__ */ Z("div", {
|
|
2925
3057
|
className: "space-y-2",
|
|
2926
|
-
children: [/* @__PURE__ */
|
|
3058
|
+
children: [/* @__PURE__ */ X(Nn, {
|
|
2927
3059
|
value: p.operator,
|
|
2928
3060
|
options: i,
|
|
2929
3061
|
onChange: (e) => {
|
|
@@ -2939,32 +3071,32 @@ var jn = {
|
|
|
2939
3071
|
}), S(p, m, !1)]
|
|
2940
3072
|
})]
|
|
2941
3073
|
}),
|
|
2942
|
-
/* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ X("div", {
|
|
2943
3075
|
className: "flex justify-center",
|
|
2944
|
-
children: /* @__PURE__ */
|
|
3076
|
+
children: /* @__PURE__ */ Z(Ot, {
|
|
2945
3077
|
value: _,
|
|
2946
3078
|
onValueChange: (e) => {
|
|
2947
3079
|
v(e), y || b(!0), x(p, h, e, !0);
|
|
2948
3080
|
},
|
|
2949
3081
|
className: "flex gap-4",
|
|
2950
|
-
children: [/* @__PURE__ */
|
|
3082
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
2951
3083
|
className: "flex items-center space-x-1.5 focus-within:bg-muted/50 px-2 py-0.5 rounded transition",
|
|
2952
|
-
children: [/* @__PURE__ */
|
|
3084
|
+
children: [/* @__PURE__ */ X(kt, {
|
|
2953
3085
|
value: "AND",
|
|
2954
3086
|
id: "and",
|
|
2955
3087
|
className: "h-3.5 w-3.5"
|
|
2956
|
-
}), /* @__PURE__ */
|
|
3088
|
+
}), /* @__PURE__ */ X(o, {
|
|
2957
3089
|
htmlFor: "and",
|
|
2958
3090
|
className: "text-xs cursor-pointer font-semibold uppercase tracking-wider",
|
|
2959
3091
|
children: "And"
|
|
2960
3092
|
})]
|
|
2961
|
-
}), /* @__PURE__ */
|
|
3093
|
+
}), /* @__PURE__ */ Z("div", {
|
|
2962
3094
|
className: "flex items-center space-x-1.5 focus-within:bg-muted/50 px-2 py-0.5 rounded transition",
|
|
2963
|
-
children: [/* @__PURE__ */
|
|
3095
|
+
children: [/* @__PURE__ */ X(kt, {
|
|
2964
3096
|
value: "OR",
|
|
2965
3097
|
id: "or",
|
|
2966
3098
|
className: "h-3.5 w-3.5"
|
|
2967
|
-
}), /* @__PURE__ */
|
|
3099
|
+
}), /* @__PURE__ */ X(o, {
|
|
2968
3100
|
htmlFor: "or",
|
|
2969
3101
|
className: "text-xs cursor-pointer font-semibold uppercase tracking-wider",
|
|
2970
3102
|
children: "Or"
|
|
@@ -2972,11 +3104,11 @@ var jn = {
|
|
|
2972
3104
|
})]
|
|
2973
3105
|
})
|
|
2974
3106
|
}),
|
|
2975
|
-
/* @__PURE__ */
|
|
3107
|
+
/* @__PURE__ */ X("div", {
|
|
2976
3108
|
className: `space-y-2 transition-opacity duration-200 ${y ? "" : "opacity-50"}`,
|
|
2977
|
-
children: /* @__PURE__ */
|
|
3109
|
+
children: /* @__PURE__ */ Z("div", {
|
|
2978
3110
|
className: "space-y-2",
|
|
2979
|
-
children: [/* @__PURE__ */
|
|
3111
|
+
children: [/* @__PURE__ */ X(Nn, {
|
|
2980
3112
|
value: h.operator,
|
|
2981
3113
|
options: i,
|
|
2982
3114
|
onChange: (e) => {
|
|
@@ -2992,7 +3124,7 @@ var jn = {
|
|
|
2992
3124
|
}), S(h, g, !0)]
|
|
2993
3125
|
})
|
|
2994
3126
|
}),
|
|
2995
|
-
!y && /* @__PURE__ */
|
|
3127
|
+
!y && /* @__PURE__ */ X("div", {
|
|
2996
3128
|
className: "text-[10px] text-muted-foreground italic text-center",
|
|
2997
3129
|
children: "Select AND/OR or enter a second value to combine filters"
|
|
2998
3130
|
})
|
|
@@ -3001,26 +3133,26 @@ var jn = {
|
|
|
3001
3133
|
};
|
|
3002
3134
|
//#endregion
|
|
3003
3135
|
//#region src/components/EzTable/EzExcelFilter.tsx
|
|
3004
|
-
function
|
|
3005
|
-
let [r, i] =
|
|
3006
|
-
return /* @__PURE__ */
|
|
3136
|
+
function In({ column: t, table: n }) {
|
|
3137
|
+
let [r, i] = q(!1), a = n.options.meta?.containerRef;
|
|
3138
|
+
return /* @__PURE__ */ Z(C, {
|
|
3007
3139
|
open: r,
|
|
3008
3140
|
onOpenChange: i,
|
|
3009
|
-
children: [/* @__PURE__ */
|
|
3141
|
+
children: [/* @__PURE__ */ X(S, {
|
|
3010
3142
|
asChild: !0,
|
|
3011
|
-
children: /* @__PURE__ */
|
|
3143
|
+
children: /* @__PURE__ */ X("div", {
|
|
3012
3144
|
className: e("ml-1 cursor-pointer p-1 rounded hover:bg-muted transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", t.getIsFiltered() ? "bg-primary/10" : ""),
|
|
3013
3145
|
onClick: (e) => {
|
|
3014
3146
|
e.stopPropagation();
|
|
3015
3147
|
},
|
|
3016
|
-
children: /* @__PURE__ */
|
|
3148
|
+
children: /* @__PURE__ */ X(be, { className: e("w-4 h-4", t.getIsFiltered() ? "text-primary fill-primary" : "text-muted-foreground") })
|
|
3017
3149
|
})
|
|
3018
|
-
}), /* @__PURE__ */
|
|
3150
|
+
}), /* @__PURE__ */ X(x, {
|
|
3019
3151
|
className: "w-[280px] p-0",
|
|
3020
3152
|
align: "start",
|
|
3021
3153
|
container: a?.current,
|
|
3022
3154
|
collisionBoundary: a?.current,
|
|
3023
|
-
children: r && /* @__PURE__ */
|
|
3155
|
+
children: r && /* @__PURE__ */ X(Bn, {
|
|
3024
3156
|
column: t,
|
|
3025
3157
|
table: n,
|
|
3026
3158
|
setIsOpen: i,
|
|
@@ -3029,9 +3161,9 @@ function Nn({ column: t, table: n }) {
|
|
|
3029
3161
|
})]
|
|
3030
3162
|
});
|
|
3031
3163
|
}
|
|
3032
|
-
var
|
|
3033
|
-
let [c, l] =
|
|
3034
|
-
|
|
3164
|
+
var Ln = ["date", "datetime"], Rn = ["boolean"], zn = ["select"], Bn = V.memo(({ column: n, table: r, setIsOpen: o, filterValue: s }) => {
|
|
3165
|
+
let [c, l] = q("list"), [u, d] = q(""), [f, p] = q(""), [m, h] = q(!0), [g, _] = q(/* @__PURE__ */ new Map()), [v, y] = q([]), b = (r.options.meta?.containerRef?.current || (typeof document < "u" ? document.getElementById("ez-table-default") : null))?.clientHeight ?? 500, x = Math.min(500, b > 100 ? b - 40 : 500);
|
|
3166
|
+
W(() => {
|
|
3035
3167
|
let e = setTimeout(() => p(u), 200), t = setTimeout(() => {
|
|
3036
3168
|
let e = n.getFacetedUniqueValues();
|
|
3037
3169
|
_(e), y(Array.from(e.keys())), h(!1);
|
|
@@ -3040,10 +3172,10 @@ var Pn = ["date", "datetime"], Fn = ["boolean"], In = ["select"], Ln = B.memo(({
|
|
|
3040
3172
|
clearTimeout(e), clearTimeout(t);
|
|
3041
3173
|
};
|
|
3042
3174
|
}, [u, n]);
|
|
3043
|
-
let { selectedValues: S, handleSelectAll: C, handleSelect: w, handleBulkSelect: T, clearSelection: E } =
|
|
3175
|
+
let { selectedValues: S, handleSelectAll: C, handleSelect: w, handleBulkSelect: T, clearSelection: E } = Tn(s, v), D = G(() => {
|
|
3044
3176
|
let e = n.columnDef.meta;
|
|
3045
|
-
return e?.columnType ? e.columnType : v.length === 0 ? "text" :
|
|
3046
|
-
}, [n.columnDef.meta, v]), O =
|
|
3177
|
+
return e?.columnType ? e.columnType : v.length === 0 ? "text" : wn(v);
|
|
3178
|
+
}, [n.columnDef.meta, v]), O = Ln.includes(D), ee = Rn.includes(D), k = zn.includes(D), A = G(() => {
|
|
3047
3179
|
let e = [...v].sort((e, t) => {
|
|
3048
3180
|
if (e === t) return 0;
|
|
3049
3181
|
if (e == null) return -1;
|
|
@@ -3057,103 +3189,103 @@ var Pn = ["date", "datetime"], Fn = ["boolean"], In = ["select"], Ln = B.memo(({
|
|
|
3057
3189
|
if (!f) return e;
|
|
3058
3190
|
let t = f.toLowerCase();
|
|
3059
3191
|
return e.filter((e) => String(e).toLowerCase().includes(t));
|
|
3060
|
-
}, [v, f]),
|
|
3192
|
+
}, [v, f]), j = () => {
|
|
3061
3193
|
if (c === "filters") {
|
|
3062
3194
|
o(!1);
|
|
3063
3195
|
return;
|
|
3064
3196
|
}
|
|
3065
3197
|
let e;
|
|
3066
|
-
e = S === null ? f ?
|
|
3067
|
-
},
|
|
3198
|
+
e = S === null ? f ? A : void 0 : Array.from(S), n.setFilterValue(e?.length === 0 ? void 0 : e), o(!1);
|
|
3199
|
+
}, M = () => {
|
|
3068
3200
|
n.setFilterValue(void 0), o(!1), E(), d("");
|
|
3069
|
-
},
|
|
3201
|
+
}, N = s, P = N && typeof N == "object" && !Array.isArray(N), te = (e) => {
|
|
3070
3202
|
n.setFilterValue(e);
|
|
3071
|
-
},
|
|
3072
|
-
return m ? /* @__PURE__ */
|
|
3203
|
+
}, F = G(() => S === null || A.length > 0 && A.every((e) => S.has(e)), [S, A]), I = G(() => S === null ? A.length > 0 : A.some((e) => S.has(e)), [S, A]);
|
|
3204
|
+
return m ? /* @__PURE__ */ Z("div", {
|
|
3073
3205
|
className: "h-[300px] flex flex-col items-center justify-center space-y-3 bg-popover text-popover-foreground",
|
|
3074
|
-
children: [/* @__PURE__ */
|
|
3206
|
+
children: [/* @__PURE__ */ X(xe, { className: "h-8 w-8 animate-spin text-primary" }), /* @__PURE__ */ X("span", {
|
|
3075
3207
|
className: "text-sm text-muted-foreground animate-pulse font-medium",
|
|
3076
3208
|
children: "Calculating filter values..."
|
|
3077
3209
|
})]
|
|
3078
|
-
}) : /* @__PURE__ */
|
|
3210
|
+
}) : /* @__PURE__ */ X("div", {
|
|
3079
3211
|
className: "flex flex-col min-h-0 overflow-hidden",
|
|
3080
3212
|
style: { maxHeight: `${x}px` },
|
|
3081
|
-
children: c === "filters" ? /* @__PURE__ */
|
|
3213
|
+
children: c === "filters" ? /* @__PURE__ */ Z("div", {
|
|
3082
3214
|
className: "flex flex-col animate-in fade-in slide-in-from-right-2 duration-200",
|
|
3083
3215
|
children: [
|
|
3084
|
-
/* @__PURE__ */
|
|
3216
|
+
/* @__PURE__ */ Z("div", {
|
|
3085
3217
|
className: "p-3 border-b flex items-center space-x-2 bg-muted/30",
|
|
3086
|
-
children: [/* @__PURE__ */
|
|
3218
|
+
children: [/* @__PURE__ */ X(i, {
|
|
3087
3219
|
variant: "ghost",
|
|
3088
3220
|
size: "sm",
|
|
3089
3221
|
onClick: () => l("list"),
|
|
3090
3222
|
className: "h-6 w-6 p-0",
|
|
3091
|
-
children: /* @__PURE__ */
|
|
3092
|
-
}), /* @__PURE__ */
|
|
3223
|
+
children: /* @__PURE__ */ X(ue, { className: "h-4 w-4" })
|
|
3224
|
+
}), /* @__PURE__ */ Z("span", {
|
|
3093
3225
|
className: "font-semibold text-sm capitalize",
|
|
3094
3226
|
children: [D, " Filters"]
|
|
3095
3227
|
})]
|
|
3096
3228
|
}),
|
|
3097
|
-
/* @__PURE__ */
|
|
3229
|
+
/* @__PURE__ */ X("div", {
|
|
3098
3230
|
className: "flex-1 overflow-y-auto min-h-0",
|
|
3099
|
-
children: /* @__PURE__ */
|
|
3231
|
+
children: /* @__PURE__ */ X(Fn, {
|
|
3100
3232
|
columnType: D,
|
|
3101
3233
|
columnId: n.id,
|
|
3102
|
-
value:
|
|
3103
|
-
onChange:
|
|
3234
|
+
value: P ? N : void 0,
|
|
3235
|
+
onChange: te
|
|
3104
3236
|
})
|
|
3105
3237
|
}),
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
onClear:
|
|
3108
|
-
onApply:
|
|
3238
|
+
/* @__PURE__ */ X(An, {
|
|
3239
|
+
onClear: M,
|
|
3240
|
+
onApply: j,
|
|
3109
3241
|
className: "border-t mt-auto"
|
|
3110
3242
|
})
|
|
3111
3243
|
]
|
|
3112
|
-
}) : /* @__PURE__ */
|
|
3244
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
3113
3245
|
className: "flex flex-col animate-in fade-in slide-in-from-left-2 duration-200 flex-1 min-h-0",
|
|
3114
3246
|
children: [
|
|
3115
|
-
n.getCanPin() && /* @__PURE__ */
|
|
3247
|
+
n.getCanPin() && /* @__PURE__ */ Z("div", {
|
|
3116
3248
|
className: "p-1 border-b border-border space-y-0.5",
|
|
3117
|
-
children: [["left", "right"].map((t) => n.getIsPinned() !== t && /* @__PURE__ */
|
|
3249
|
+
children: [["left", "right"].map((t) => n.getIsPinned() !== t && /* @__PURE__ */ Z("div", {
|
|
3118
3250
|
className: "flex items-center gap-2 px-2 py-1.5 text-xs font-medium cursor-pointer hover:bg-muted rounded",
|
|
3119
3251
|
onClick: () => {
|
|
3120
3252
|
n.pin(t), o(!1);
|
|
3121
3253
|
},
|
|
3122
3254
|
children: [
|
|
3123
|
-
/* @__PURE__ */
|
|
3255
|
+
/* @__PURE__ */ X(we, { className: e("w-3.5 h-3.5", t === "left" ? "rotate-[-45deg]" : "rotate-[45deg]") }),
|
|
3124
3256
|
" Pin to ",
|
|
3125
3257
|
t.charAt(0).toUpperCase() + t.slice(1)
|
|
3126
3258
|
]
|
|
3127
|
-
}, t)), n.getIsPinned() && /* @__PURE__ */
|
|
3259
|
+
}, t)), n.getIsPinned() && /* @__PURE__ */ Z("div", {
|
|
3128
3260
|
className: "flex items-center gap-2 px-2 py-1.5 text-xs font-medium text-red-500 cursor-pointer hover:bg-red-50 dark:hover:bg-red-900/20 rounded",
|
|
3129
3261
|
onClick: () => {
|
|
3130
3262
|
n.pin(!1), o(!1);
|
|
3131
3263
|
},
|
|
3132
|
-
children: [/* @__PURE__ */
|
|
3264
|
+
children: [/* @__PURE__ */ X(Te, { className: "w-3.5 h-3.5" }), " Unpin Column"]
|
|
3133
3265
|
})]
|
|
3134
3266
|
}),
|
|
3135
|
-
!
|
|
3267
|
+
!ee && !k && /* @__PURE__ */ Z("div", {
|
|
3136
3268
|
className: "p-2 border-b border-border flex justify-between items-center cursor-pointer hover:bg-muted/50 transition group",
|
|
3137
3269
|
onClick: () => l("filters"),
|
|
3138
|
-
children: [/* @__PURE__ */
|
|
3270
|
+
children: [/* @__PURE__ */ Z("span", {
|
|
3139
3271
|
className: "text-sm font-medium capitalize",
|
|
3140
3272
|
children: [D, " Filters"]
|
|
3141
|
-
}), /* @__PURE__ */
|
|
3273
|
+
}), /* @__PURE__ */ X(de, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" })]
|
|
3142
3274
|
}),
|
|
3143
|
-
/* @__PURE__ */
|
|
3275
|
+
/* @__PURE__ */ X("div", {
|
|
3144
3276
|
className: "flex flex-col flex-1 overflow-hidden min-h-0",
|
|
3145
|
-
children:
|
|
3277
|
+
children: ee ? /* @__PURE__ */ X(Dn, { column: n }) : k ? /* @__PURE__ */ X(On, {
|
|
3146
3278
|
column: n,
|
|
3147
3279
|
allAvailableValues: v
|
|
3148
|
-
}) : /* @__PURE__ */
|
|
3280
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
3149
3281
|
className: "flex flex-col flex-1 min-h-0 pointer-events-auto",
|
|
3150
|
-
children: [/* @__PURE__ */
|
|
3282
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
3151
3283
|
className: "sticky top-0 bg-popover text-popover-foreground border-b z-20",
|
|
3152
|
-
children: [/* @__PURE__ */
|
|
3284
|
+
children: [/* @__PURE__ */ X("div", {
|
|
3153
3285
|
className: "p-2",
|
|
3154
|
-
children: /* @__PURE__ */
|
|
3286
|
+
children: /* @__PURE__ */ Z("div", {
|
|
3155
3287
|
className: "relative",
|
|
3156
|
-
children: [/* @__PURE__ */
|
|
3288
|
+
children: [/* @__PURE__ */ X(Oe, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ X(a, {
|
|
3157
3289
|
placeholder: "Search...",
|
|
3158
3290
|
value: u,
|
|
3159
3291
|
onChange: (e) => d(e.target.value),
|
|
@@ -3161,23 +3293,23 @@ var Pn = ["date", "datetime"], Fn = ["boolean"], In = ["select"], Ln = B.memo(({
|
|
|
3161
3293
|
autoFocus: !0
|
|
3162
3294
|
})]
|
|
3163
3295
|
})
|
|
3164
|
-
}), /* @__PURE__ */
|
|
3165
|
-
checked:
|
|
3166
|
-
indeterminate:
|
|
3296
|
+
}), /* @__PURE__ */ X(En, {
|
|
3297
|
+
checked: F,
|
|
3298
|
+
indeterminate: I && !F,
|
|
3167
3299
|
onSelectAll: (e) => {
|
|
3168
|
-
f ? T(
|
|
3300
|
+
f ? T(A, e) : C(e);
|
|
3169
3301
|
},
|
|
3170
3302
|
showSearchResults: !!f
|
|
3171
3303
|
})]
|
|
3172
|
-
}), O ? /* @__PURE__ */
|
|
3304
|
+
}), O ? /* @__PURE__ */ X("div", {
|
|
3173
3305
|
className: "flex-1 overflow-y-auto px-2 pb-2 min-h-0 pt-2",
|
|
3174
|
-
children: /* @__PURE__ */
|
|
3306
|
+
children: /* @__PURE__ */ X(Mn, {
|
|
3175
3307
|
uniqueValues: g,
|
|
3176
3308
|
selectedValues: S,
|
|
3177
3309
|
onBulkSelect: T
|
|
3178
3310
|
})
|
|
3179
|
-
}) : /* @__PURE__ */
|
|
3180
|
-
sortedUniqueValues:
|
|
3311
|
+
}) : /* @__PURE__ */ X(kn, {
|
|
3312
|
+
sortedUniqueValues: A,
|
|
3181
3313
|
selectedValues: S,
|
|
3182
3314
|
handleSelect: w,
|
|
3183
3315
|
formatter: (e) => {
|
|
@@ -3201,87 +3333,87 @@ var Pn = ["date", "datetime"], Fn = ["boolean"], In = ["select"], Ln = B.memo(({
|
|
|
3201
3333
|
})]
|
|
3202
3334
|
})
|
|
3203
3335
|
}),
|
|
3204
|
-
/* @__PURE__ */
|
|
3205
|
-
onClear:
|
|
3206
|
-
onApply:
|
|
3336
|
+
/* @__PURE__ */ X(An, {
|
|
3337
|
+
onClear: M,
|
|
3338
|
+
onApply: j
|
|
3207
3339
|
})
|
|
3208
3340
|
]
|
|
3209
3341
|
})
|
|
3210
3342
|
});
|
|
3211
3343
|
});
|
|
3212
|
-
|
|
3344
|
+
Bn.displayName = "FilterContent";
|
|
3213
3345
|
//#endregion
|
|
3214
3346
|
//#region src/components/EzTable/EzHeaderContextMenu.tsx
|
|
3215
|
-
function
|
|
3347
|
+
function Vn({ header: e, children: t }) {
|
|
3216
3348
|
let n = e.column, r = n.getIsPinned(), i = n.getCanGroup(), a = n.getIsGrouped();
|
|
3217
|
-
return /* @__PURE__ */
|
|
3349
|
+
return /* @__PURE__ */ Z(g, { children: [/* @__PURE__ */ X(m, {
|
|
3218
3350
|
asChild: !0,
|
|
3219
3351
|
children: t
|
|
3220
|
-
}), /* @__PURE__ */
|
|
3352
|
+
}), /* @__PURE__ */ Z(h, {
|
|
3221
3353
|
className: "w-48",
|
|
3222
3354
|
children: [
|
|
3223
|
-
i && /* @__PURE__ */
|
|
3355
|
+
i && /* @__PURE__ */ Z(Me, { children: [/* @__PURE__ */ X(_, {
|
|
3224
3356
|
onClick: () => n.toggleGrouping(),
|
|
3225
3357
|
className: "gap-2",
|
|
3226
|
-
children: a ? /* @__PURE__ */
|
|
3227
|
-
/* @__PURE__ */
|
|
3358
|
+
children: a ? /* @__PURE__ */ Z(Me, { children: [
|
|
3359
|
+
/* @__PURE__ */ X(ke, { className: "w-3.5 h-3.5" }),
|
|
3228
3360
|
"Ungroup ",
|
|
3229
3361
|
n.id
|
|
3230
|
-
] }) : /* @__PURE__ */
|
|
3231
|
-
}), /* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3362
|
+
] }) : /* @__PURE__ */ Z(Me, { children: [/* @__PURE__ */ X(ye, { className: "w-3.5 h-3.5 text-zinc-500/70" }), "Group by column"] })
|
|
3363
|
+
}), /* @__PURE__ */ X(p, {})] }),
|
|
3364
|
+
/* @__PURE__ */ Z(_, {
|
|
3233
3365
|
onClick: () => n.pin("left"),
|
|
3234
3366
|
disabled: r === "left",
|
|
3235
3367
|
className: "gap-2",
|
|
3236
|
-
children: [/* @__PURE__ */
|
|
3368
|
+
children: [/* @__PURE__ */ X(we, { className: "w-3.5 h-3.5 rotate-[-45deg]" }), "Pin to Left"]
|
|
3237
3369
|
}),
|
|
3238
|
-
/* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ Z(_, {
|
|
3239
3371
|
onClick: () => n.pin("right"),
|
|
3240
3372
|
disabled: r === "right",
|
|
3241
3373
|
className: "gap-2",
|
|
3242
|
-
children: [/* @__PURE__ */
|
|
3374
|
+
children: [/* @__PURE__ */ X(we, { className: "w-3.5 h-3.5 rotate-[45deg]" }), "Pin to Right"]
|
|
3243
3375
|
}),
|
|
3244
|
-
r && /* @__PURE__ */
|
|
3376
|
+
r && /* @__PURE__ */ Z(Me, { children: [/* @__PURE__ */ X(p, {}), /* @__PURE__ */ Z(_, {
|
|
3245
3377
|
onClick: () => n.pin(!1),
|
|
3246
3378
|
className: "text-red-600 focus:text-red-700 focus:bg-red-50 dark:focus:bg-red-900/20 gap-2",
|
|
3247
|
-
children: [/* @__PURE__ */
|
|
3379
|
+
children: [/* @__PURE__ */ X(Te, { className: "w-3.5 h-3.5" }), "Unpin Column"]
|
|
3248
3380
|
})] })
|
|
3249
3381
|
]
|
|
3250
3382
|
})] });
|
|
3251
3383
|
}
|
|
3252
3384
|
//#endregion
|
|
3253
3385
|
//#region src/components/EzTable/components/EzDraggableHeader.tsx
|
|
3254
|
-
var
|
|
3255
|
-
let a = t.getContext().table.options.meta, o = t.id === "select" || t.id === "actions", s = t.column.columnDef.meta, c = t.column.columnDef, l = a?.enableColumnReorder !== !1 && !o && s?.allowReordering !== !1 && c?.allowReordering !== !1, u = !(t.column.getCanGroup() && !o) && !l || t.isPlaceholder, { attributes: d, listeners: f, setNodeRef: p, isDragging: m } =
|
|
3386
|
+
var Hn = H(({ header: t, density: n, onAutoFit: r, columnPinning: i }) => {
|
|
3387
|
+
let a = t.getContext().table.options.meta, o = t.id === "select" || t.id === "actions", s = t.column.columnDef.meta, c = t.column.columnDef, l = a?.enableColumnReorder !== !1 && !o && s?.allowReordering !== !1 && c?.allowReordering !== !1, u = !(t.column.getCanGroup() && !o) && !l || t.isPlaceholder, { attributes: d, listeners: f, setNodeRef: p, isDragging: m } = ze({
|
|
3256
3388
|
id: t.column.id,
|
|
3257
3389
|
disabled: u,
|
|
3258
3390
|
data: {
|
|
3259
3391
|
type: "column",
|
|
3260
3392
|
columnId: t.column.id
|
|
3261
3393
|
}
|
|
3262
|
-
}), { setNodeRef: h, isOver: g } =
|
|
3394
|
+
}), { setNodeRef: h, isOver: g } = Be({
|
|
3263
3395
|
id: `header-${t.column.id}`,
|
|
3264
3396
|
disabled: u,
|
|
3265
3397
|
data: {
|
|
3266
3398
|
type: "header",
|
|
3267
3399
|
columnId: t.column.id
|
|
3268
3400
|
}
|
|
3269
|
-
}), _ = t.column.getIsPinned(), v =
|
|
3401
|
+
}), _ = t.column.getIsPinned(), v = G(() => {
|
|
3270
3402
|
if (!_) return {};
|
|
3271
3403
|
let e = _ === "right" ? t.column.getAfter("right") : t.column.getStart("left"), n = t.getContext().table.options.meta;
|
|
3272
|
-
return
|
|
3404
|
+
return fn(_, e, n?.dir);
|
|
3273
3405
|
}, [
|
|
3274
3406
|
_,
|
|
3275
3407
|
t.column,
|
|
3276
3408
|
i
|
|
3277
|
-
]), y =
|
|
3409
|
+
]), y = V.useRef(0), b = U((e) => {
|
|
3278
3410
|
let n = Date.now();
|
|
3279
3411
|
n - y.current < 300 && r?.(t.column.id), y.current = n, t.getResizeHandler()(e);
|
|
3280
|
-
}, [t, r]), x = t.column.columnDef.meta?.align || "left", S = t.column.columnDef.meta?.gridLines || t.getContext().table.options.meta?.gridLines, C = a?.focusedCell?.c === t.index, w = /* @__PURE__ */
|
|
3412
|
+
}, [t, r]), x = t.column.columnDef.meta?.align || "left", S = t.column.columnDef.meta?.gridLines || t.getContext().table.options.meta?.gridLines, C = a?.focusedCell?.c === t.index, w = /* @__PURE__ */ Z("div", {
|
|
3281
3413
|
ref: (e) => {
|
|
3282
3414
|
p(e), h(e);
|
|
3283
3415
|
},
|
|
3284
|
-
className: e("relative h-full font-semibold text-foreground flex items-center select-none group/header transition-all flex-shrink-0 px-4", a?.dir === "rtl" ? "border-l border-border/50" : "border-r border-border/50",
|
|
3416
|
+
className: e("relative h-full font-semibold text-foreground flex items-center select-none group/header transition-all flex-shrink-0 px-4", a?.dir === "rtl" ? "border-l border-border/50" : "border-r border-border/50", yn(n), m && "opacity-50 bg-muted pointer-events-none", g && "ring-2 ring-inset ring-primary bg-accent/50", t.column.getIsGrouped() && "bg-accent/30", C && "bg-primary/5 text-primary border-b-2 border-primary", x === "center" && "justify-center text-center", x === "right" && "justify-end text-right", pn(_), (S === "Both" || S === "Vertical") && (a?.dir === "rtl" ? "border-l border-border" : "border-r border-border")),
|
|
3285
3417
|
style: {
|
|
3286
3418
|
width: `calc(var(--header-${t.id}-size) * 1px)`,
|
|
3287
3419
|
minWidth: (t.column.columnDef.minSize ?? 0) > 0 ? t.column.columnDef.minSize : void 0,
|
|
@@ -3291,75 +3423,75 @@ var zn = V(({ header: t, density: n, onAutoFit: r, columnPinning: i }) => {
|
|
|
3291
3423
|
role: "columnheader",
|
|
3292
3424
|
"aria-colindex": t.index + 1,
|
|
3293
3425
|
"aria-sort": t.column.getIsSorted() === "asc" ? "ascending" : t.column.getIsSorted() === "desc" ? "descending" : "none",
|
|
3294
|
-
children: [/* @__PURE__ */
|
|
3426
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
3295
3427
|
className: e("flex items-center w-full h-full gap-2", x === "center" && "justify-center relative", x === "right" && "justify-end"),
|
|
3296
3428
|
children: [
|
|
3297
|
-
!u && /* @__PURE__ */
|
|
3429
|
+
!u && /* @__PURE__ */ X("div", {
|
|
3298
3430
|
...d,
|
|
3299
3431
|
...f,
|
|
3300
3432
|
className: e("cursor-grab active:cursor-grabbing p-1 text-muted-foreground hover:text-foreground transition-colors z-50", x === "center" ? a?.dir === "rtl" ? "absolute right-1 top-1/2 -translate-y-1/2" : "absolute left-1 top-1/2 -translate-y-1/2" : a?.dir === "rtl" ? "-mr-2 ml-1" : "-ml-2 mr-1"),
|
|
3301
|
-
children: /* @__PURE__ */
|
|
3433
|
+
children: /* @__PURE__ */ X(ve, { className: "w-3.5 h-3.5" })
|
|
3302
3434
|
}),
|
|
3303
|
-
/* @__PURE__ */
|
|
3435
|
+
/* @__PURE__ */ Z("div", {
|
|
3304
3436
|
className: e("flex items-center min-w-0 gap-2 cursor-pointer group h-full select-none", x === "center" && "justify-center", x === "right" && "justify-end", t.column.getCanSort() ? "hover:text-foreground/80" : "", x !== "center" && x !== "right" && "flex-1"),
|
|
3305
3437
|
onClick: t.column.getToggleSortingHandler(),
|
|
3306
3438
|
tabIndex: t.column.getCanSort() ? 0 : -1,
|
|
3307
3439
|
role: "button",
|
|
3308
3440
|
"aria-label": `Sort by ${t.column.columnDef.header}`,
|
|
3309
3441
|
children: [
|
|
3310
|
-
x === "center" && t.column.getIsSorted() && /* @__PURE__ */
|
|
3442
|
+
x === "center" && t.column.getIsSorted() && /* @__PURE__ */ X("div", {
|
|
3311
3443
|
className: "w-4 h-4 flex-shrink-0",
|
|
3312
3444
|
"aria-hidden": "true"
|
|
3313
3445
|
}),
|
|
3314
|
-
/* @__PURE__ */
|
|
3446
|
+
/* @__PURE__ */ X("span", {
|
|
3315
3447
|
className: "truncate min-w-0",
|
|
3316
|
-
children: !t.isPlaceholder &&
|
|
3448
|
+
children: !t.isPlaceholder && Ye(t.column.columnDef.header, t.getContext())
|
|
3317
3449
|
}),
|
|
3318
|
-
t.column.getIsSorted() === "asc" && /* @__PURE__ */
|
|
3319
|
-
t.column.getIsSorted() === "desc" && /* @__PURE__ */
|
|
3450
|
+
t.column.getIsSorted() === "asc" && /* @__PURE__ */ X(ce, { className: "w-4 h-4 text-foreground flex-shrink-0" }),
|
|
3451
|
+
t.column.getIsSorted() === "desc" && /* @__PURE__ */ X(se, { className: "w-4 h-4 text-foreground flex-shrink-0" })
|
|
3320
3452
|
]
|
|
3321
3453
|
}),
|
|
3322
|
-
!t.isPlaceholder && t.column.getCanFilter() && /* @__PURE__ */
|
|
3454
|
+
!t.isPlaceholder && t.column.getCanFilter() && /* @__PURE__ */ X("div", {
|
|
3323
3455
|
className: e(a?.dir === "rtl" ? "ml-2" : "mr-2", x === "center" && (a?.dir === "rtl" ? "absolute left-1 top-1/2 -translate-y-1/2 ml-0" : "absolute right-1 top-1/2 -translate-y-1/2 mr-0")),
|
|
3324
|
-
children: /* @__PURE__ */
|
|
3456
|
+
children: /* @__PURE__ */ X(In, {
|
|
3325
3457
|
column: t.column,
|
|
3326
3458
|
table: t.getContext().table
|
|
3327
3459
|
})
|
|
3328
3460
|
})
|
|
3329
3461
|
]
|
|
3330
|
-
}), t.column.getCanResize() && /* @__PURE__ */
|
|
3462
|
+
}), t.column.getCanResize() && /* @__PURE__ */ X("div", {
|
|
3331
3463
|
onMouseDown: b,
|
|
3332
3464
|
onTouchStart: t.getResizeHandler(),
|
|
3333
3465
|
className: e("absolute top-0 h-full w-4 cursor-col-resize hover:bg-primary/10 touch-none select-none z-30 transition-colors", a?.dir === "rtl" ? "left-0" : "right-0", t.column.getIsResizing() ? "bg-primary w-1" : ""),
|
|
3334
3466
|
role: "separator"
|
|
3335
3467
|
})]
|
|
3336
3468
|
});
|
|
3337
|
-
return t.column.getCanPin() || t.column.getCanGroup() ? /* @__PURE__ */
|
|
3469
|
+
return t.column.getCanPin() || t.column.getCanGroup() ? /* @__PURE__ */ X(Vn, {
|
|
3338
3470
|
header: t,
|
|
3339
3471
|
children: w
|
|
3340
3472
|
}) : w;
|
|
3341
3473
|
});
|
|
3342
|
-
|
|
3474
|
+
Hn.displayName = "EzDraggableHeader";
|
|
3343
3475
|
//#endregion
|
|
3344
3476
|
//#region src/components/EzTable/components/EzTableHeaderSection.tsx
|
|
3345
|
-
var
|
|
3346
|
-
function
|
|
3347
|
-
return /* @__PURE__ */
|
|
3348
|
-
className: e(
|
|
3477
|
+
var Un = V.memo(Wn);
|
|
3478
|
+
function Wn({ table: t, enableStickyHeader: n, classNames: r, density: i, autoFitColumn: a, slots: o }) {
|
|
3479
|
+
return /* @__PURE__ */ X("div", {
|
|
3480
|
+
className: e(bn, "w-full bg-white dark:bg-zinc-900 shadow-sm", xn.bottom, n && "sticky top-0 z-30", r?.header),
|
|
3349
3481
|
role: "rowgroup",
|
|
3350
|
-
children: t.getHeaderGroups().map((n) => /* @__PURE__ */
|
|
3351
|
-
className: e("flex w-full border-border/50 last:border-0 h-full",
|
|
3482
|
+
children: t.getHeaderGroups().map((n) => /* @__PURE__ */ X("div", {
|
|
3483
|
+
className: e("flex w-full border-border/50 last:border-0 h-full", xn.bottom),
|
|
3352
3484
|
role: "row",
|
|
3353
|
-
children: o?.header ? /* @__PURE__ */
|
|
3485
|
+
children: o?.header ? /* @__PURE__ */ X("div", {
|
|
3354
3486
|
className: "contents",
|
|
3355
3487
|
children: (() => {
|
|
3356
3488
|
let e = o.header;
|
|
3357
|
-
return n.headers.map((n) => /* @__PURE__ */
|
|
3489
|
+
return n.headers.map((n) => /* @__PURE__ */ X(e, {
|
|
3358
3490
|
header: n,
|
|
3359
3491
|
table: t
|
|
3360
3492
|
}, n.id));
|
|
3361
3493
|
})()
|
|
3362
|
-
}) : n.headers.map((e) => /* @__PURE__ */
|
|
3494
|
+
}) : n.headers.map((e) => /* @__PURE__ */ X(Hn, {
|
|
3363
3495
|
header: e,
|
|
3364
3496
|
density: i,
|
|
3365
3497
|
onAutoFit: a,
|
|
@@ -3370,14 +3502,14 @@ function Vn({ table: t, enableStickyHeader: n, classNames: r, density: i, autoFi
|
|
|
3370
3502
|
}
|
|
3371
3503
|
//#endregion
|
|
3372
3504
|
//#region src/components/EzTable/EzTableOverlays.tsx
|
|
3373
|
-
var
|
|
3505
|
+
var Gn = H(({ isLoading: e, rowCount: t, renderNoRowsOverlay: n, slots: r, localization: i }) => {
|
|
3374
3506
|
if (e) {
|
|
3375
3507
|
let e = r?.loading || r?.loadingOverlay;
|
|
3376
|
-
return e ? /* @__PURE__ */
|
|
3508
|
+
return e ? /* @__PURE__ */ X(e, {}) : /* @__PURE__ */ X("div", {
|
|
3377
3509
|
className: "absolute inset-x-0 top-0 z-50 flex flex-col items-center justify-center bg-white/50 dark:bg-black/50 backdrop-blur-[1px] min-h-[200px]",
|
|
3378
|
-
children: /* @__PURE__ */
|
|
3510
|
+
children: /* @__PURE__ */ Z("div", {
|
|
3379
3511
|
className: "flex flex-col items-center gap-3 py-10",
|
|
3380
|
-
children: [/* @__PURE__ */
|
|
3512
|
+
children: [/* @__PURE__ */ X("div", { className: "w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" }), /* @__PURE__ */ X("span", {
|
|
3381
3513
|
className: "text-sm font-medium text-zinc-600 dark:text-zinc-400",
|
|
3382
3514
|
children: i?.loadingLabel || "Loading data..."
|
|
3383
3515
|
})]
|
|
@@ -3386,17 +3518,17 @@ var Hn = V(({ isLoading: e, rowCount: t, renderNoRowsOverlay: n, slots: r, local
|
|
|
3386
3518
|
}
|
|
3387
3519
|
if (t === 0) {
|
|
3388
3520
|
let e = r?.emptyRecord || r?.noRowsOverlay;
|
|
3389
|
-
return e ? /* @__PURE__ */
|
|
3521
|
+
return e ? /* @__PURE__ */ X(e, {}) : /* @__PURE__ */ X("div", {
|
|
3390
3522
|
className: "absolute inset-0 flex flex-col items-center justify-center p-10 text-center",
|
|
3391
|
-
children: n ? n() : /* @__PURE__ */
|
|
3523
|
+
children: n ? n() : /* @__PURE__ */ Z("div", {
|
|
3392
3524
|
className: "flex flex-col items-center gap-2 text-zinc-400",
|
|
3393
3525
|
children: [
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
/* @__PURE__ */
|
|
3526
|
+
/* @__PURE__ */ X(_e, { className: "w-12 h-12 opacity-10 mb-2" }),
|
|
3527
|
+
/* @__PURE__ */ X("span", {
|
|
3396
3528
|
className: "text-sm font-medium",
|
|
3397
3529
|
children: i?.noRowsLabel || "No results found"
|
|
3398
3530
|
}),
|
|
3399
|
-
/* @__PURE__ */
|
|
3531
|
+
/* @__PURE__ */ X("p", {
|
|
3400
3532
|
className: "text-xs",
|
|
3401
3533
|
children: "Adjust your filters or search to see more results"
|
|
3402
3534
|
})
|
|
@@ -3406,22 +3538,22 @@ var Hn = V(({ isLoading: e, rowCount: t, renderNoRowsOverlay: n, slots: r, local
|
|
|
3406
3538
|
}
|
|
3407
3539
|
return null;
|
|
3408
3540
|
});
|
|
3409
|
-
|
|
3541
|
+
Gn.displayName = "EzTableOverlays";
|
|
3410
3542
|
//#endregion
|
|
3411
3543
|
//#region src/components/EzTable/utils/TruncatedTooltip.tsx
|
|
3412
|
-
var
|
|
3413
|
-
let n =
|
|
3414
|
-
return
|
|
3544
|
+
var Kn = ({ children: e, text: t }) => {
|
|
3545
|
+
let n = K(null), [r, i] = q(!1), a = () => n.current ? n.current.scrollWidth > n.current.clientWidth + 1 : !1;
|
|
3546
|
+
return W(() => {
|
|
3415
3547
|
if (a(), n.current) {
|
|
3416
3548
|
let e = new ResizeObserver(a);
|
|
3417
3549
|
return e.observe(n.current), () => e.disconnect();
|
|
3418
3550
|
}
|
|
3419
|
-
}, [e, t]), /* @__PURE__ */
|
|
3551
|
+
}, [e, t]), /* @__PURE__ */ X(E, { children: /* @__PURE__ */ Z(D, {
|
|
3420
3552
|
delayDuration: 300,
|
|
3421
3553
|
open: r,
|
|
3422
|
-
children: [/* @__PURE__ */
|
|
3554
|
+
children: [/* @__PURE__ */ X(w, {
|
|
3423
3555
|
asChild: !0,
|
|
3424
|
-
children: /* @__PURE__ */
|
|
3556
|
+
children: /* @__PURE__ */ X("div", {
|
|
3425
3557
|
ref: n,
|
|
3426
3558
|
className: "truncate w-full cursor-default min-w-0",
|
|
3427
3559
|
onMouseEnter: () => {
|
|
@@ -3432,17 +3564,17 @@ var Un = ({ children: e, text: t }) => {
|
|
|
3432
3564
|
},
|
|
3433
3565
|
children: e
|
|
3434
3566
|
})
|
|
3435
|
-
}), /* @__PURE__ */
|
|
3567
|
+
}), /* @__PURE__ */ X(T, { children: /* @__PURE__ */ X("p", {
|
|
3436
3568
|
className: "max-w-sm break-words",
|
|
3437
3569
|
children: t || e
|
|
3438
3570
|
}) })]
|
|
3439
3571
|
}) });
|
|
3440
|
-
},
|
|
3441
|
-
let _ =
|
|
3572
|
+
}, qn = H(({ cell: t, virtualRowIndex: n, cellIndex: r, isPinned: i, isSelected: a, isFocused: o, density: s, onCellMouseDown: c, onCellMouseEnter: l, onCellClick: u, onCellDoubleClick: d, tableMeta: f, rowDepth: p, renderDetailPanel: m, isFirstColumn: h, columnPinning: g }) => {
|
|
3573
|
+
let _ = G(() => ({
|
|
3442
3574
|
width: `calc(var(--col-${t.column.id}-size) * 1px)`,
|
|
3443
3575
|
minWidth: (t.column.columnDef.minSize ?? 0) > 0 ? t.column.columnDef.minSize : void 0,
|
|
3444
3576
|
maxWidth: (t.column.columnDef.maxSize ?? 0) > 0 && t.column.columnDef.maxSize !== 2 ** 53 - 1 ? t.column.columnDef.maxSize : void 0,
|
|
3445
|
-
...
|
|
3577
|
+
...fn(i, i === "right" ? t.column.getAfter("right") : t.column.getStart("left"), f?.dir),
|
|
3446
3578
|
paddingLeft: f?.dir !== "rtl" && (t.column.id === "firstName" || t.column.id === "name" || t.column.id === "id") ? `${p * 20 + 16}px` : void 0,
|
|
3447
3579
|
paddingRight: f?.dir === "rtl" && (t.column.id === "firstName" || t.column.id === "name" || t.column.id === "id") ? `${p * 20 + 16}px` : void 0
|
|
3448
3580
|
}), [
|
|
@@ -3450,9 +3582,9 @@ var Un = ({ children: e, text: t }) => {
|
|
|
3450
3582
|
i,
|
|
3451
3583
|
p,
|
|
3452
3584
|
g
|
|
3453
|
-
]), v = /* @__PURE__ */
|
|
3585
|
+
]), v = /* @__PURE__ */ X(Me, { children: t.getIsGrouped() ? /* @__PURE__ */ Z("span", {
|
|
3454
3586
|
className: "font-semibold",
|
|
3455
|
-
children: [
|
|
3587
|
+
children: [Ye(t.column.columnDef.cell, t.getContext()), /* @__PURE__ */ Z("span", {
|
|
3456
3588
|
className: "text-muted-foreground font-normal ml-1",
|
|
3457
3589
|
children: [
|
|
3458
3590
|
"(",
|
|
@@ -3460,10 +3592,10 @@ var Un = ({ children: e, text: t }) => {
|
|
|
3460
3592
|
")"
|
|
3461
3593
|
]
|
|
3462
3594
|
})]
|
|
3463
|
-
}) : t.getIsAggregated() ? /* @__PURE__ */
|
|
3595
|
+
}) : t.getIsAggregated() ? /* @__PURE__ */ X("span", {
|
|
3464
3596
|
className: e("font-medium tabular-nums", f?.enableGroupFooters && "text-primary/80 bg-primary/5 px-2 py-0.5 rounded"),
|
|
3465
|
-
children:
|
|
3466
|
-
}) : t.getIsPlaceholder() ? null :
|
|
3597
|
+
children: Ye(t.column.columnDef.aggregatedCell ?? t.column.columnDef.cell, t.getContext())
|
|
3598
|
+
}) : t.getIsPlaceholder() ? null : Ye(t.column.columnDef.cell, t.getContext()) }), y = t.column.columnDef.meta?.clipMode, b = G(() => {
|
|
3467
3599
|
if (!f?.validate || !f?.validationAttempted) return { isValid: !0 };
|
|
3468
3600
|
let e = t.column.id, n = t.getValue(), r = t.row.original;
|
|
3469
3601
|
return f.validate(e, n, r);
|
|
@@ -3477,7 +3609,7 @@ var Un = ({ children: e, text: t }) => {
|
|
|
3477
3609
|
zIndex: 20,
|
|
3478
3610
|
position: "relative"
|
|
3479
3611
|
} : {};
|
|
3480
|
-
return /* @__PURE__ */
|
|
3612
|
+
return /* @__PURE__ */ Z("div", {
|
|
3481
3613
|
onMouseDown: (e) => {
|
|
3482
3614
|
e.button === 0 && (c(n, r, e), f?.setFocusedCell?.({
|
|
3483
3615
|
r: n,
|
|
@@ -3503,39 +3635,42 @@ var Un = ({ children: e, text: t }) => {
|
|
|
3503
3635
|
rowIndex: n,
|
|
3504
3636
|
colIndex: r
|
|
3505
3637
|
}),
|
|
3506
|
-
className: e("px-4 text-sm font-medium text-foreground flex select-none min-h-full min-w-0 flex-shrink-0 relative", o && "z-20", o && b.isValid && "bg-primary/5", o && !b.isValid && "bg-destructive/5", !b.isValid && "ring-1 ring-inset ring-destructive", !o && (f?.dir === "rtl" ? "border-l border-border/50" : "border-r border-border/50"), t.column.columnDef.meta?.wrapText ? "items-start pt-3" : "items-center",
|
|
3638
|
+
className: e("px-4 text-sm font-medium text-foreground flex select-none min-h-full min-w-0 flex-shrink-0 relative", o && "z-20", o && b.isValid && "bg-primary/5", o && !b.isValid && "bg-destructive/5", !b.isValid && "ring-1 ring-inset ring-destructive", !o && (f?.dir === "rtl" ? "border-l border-border/50" : "border-r border-border/50"), t.column.columnDef.meta?.wrapText ? "items-start pt-3" : "items-center", dn(s), hn(a, o), mn(t.column.columnDef.meta?.align, f?.dir), gn(t.column.columnDef.meta?.wrapText ? "wrap" : y === "ellipsis-tooltip" ? "ellipsis" : "truncate", y === "ellipsis-tooltip"), pn(i, f?.dir), !o && _n(t.column.columnDef.meta?.gridLines || f?.gridLines, void 0, f?.dir), typeof f?.classNames?.cell == "function" ? f.classNames.cell(t) : f?.classNames?.cell),
|
|
3507
3639
|
style: {
|
|
3508
3640
|
..._,
|
|
3509
3641
|
...x
|
|
3510
3642
|
},
|
|
3511
3643
|
role: "cell",
|
|
3644
|
+
tabIndex: o ? 0 : -1,
|
|
3645
|
+
"data-row-index": n,
|
|
3646
|
+
"data-cell-index": r,
|
|
3512
3647
|
"data-column-id": t.column.id,
|
|
3513
|
-
children: [t.getIsGrouped() || t.row.getCanExpand() && h || m && h ? /* @__PURE__ */
|
|
3648
|
+
children: [t.getIsGrouped() || t.row.getCanExpand() && h || m && h ? /* @__PURE__ */ X("button", {
|
|
3514
3649
|
className: e(f?.dir === "rtl" ? "ml-2" : "mr-2", "p-1 hover:bg-muted rounded transition-transform", !t.row.getCanExpand() && !m && "invisible"),
|
|
3515
3650
|
onClick: (e) => {
|
|
3516
3651
|
e.stopPropagation(), t.row.getToggleExpandedHandler()();
|
|
3517
3652
|
},
|
|
3518
|
-
children: t.row.getIsExpanded() ? /* @__PURE__ */
|
|
3519
|
-
}) : null, b.isValid ? y === "ellipsis-tooltip" ? /* @__PURE__ */
|
|
3653
|
+
children: t.row.getIsExpanded() ? /* @__PURE__ */ X(le, { className: "w-4 h-4" }) : /* @__PURE__ */ X(de, { className: "w-4 h-4" })
|
|
3654
|
+
}) : null, b.isValid ? y === "ellipsis-tooltip" ? /* @__PURE__ */ X("div", {
|
|
3520
3655
|
className: "flex-1 min-w-0",
|
|
3521
|
-
children: /* @__PURE__ */
|
|
3656
|
+
children: /* @__PURE__ */ X(Kn, {
|
|
3522
3657
|
text: typeof t.getValue() == "string" ? t.getValue() : void 0,
|
|
3523
3658
|
children: v
|
|
3524
3659
|
})
|
|
3525
|
-
}) : v : /* @__PURE__ */
|
|
3660
|
+
}) : v : /* @__PURE__ */ X("div", {
|
|
3526
3661
|
className: "flex-1 min-w-0",
|
|
3527
|
-
children: /* @__PURE__ */
|
|
3662
|
+
children: /* @__PURE__ */ X(z, {
|
|
3528
3663
|
enabled: !0,
|
|
3529
3664
|
side: f?.dir === "rtl" ? "left" : "right",
|
|
3530
3665
|
className: "bg-destructive text-destructive-foreground border-destructive/20 shadow-xl z-50",
|
|
3531
|
-
content: /* @__PURE__ */
|
|
3666
|
+
content: /* @__PURE__ */ Z(Me, { children: [/* @__PURE__ */ X("p", {
|
|
3532
3667
|
className: "text-[10px] font-bold uppercase tracking-wider mb-0.5 opacity-80",
|
|
3533
3668
|
children: "Validation Error"
|
|
3534
|
-
}), /* @__PURE__ */
|
|
3669
|
+
}), /* @__PURE__ */ X("p", {
|
|
3535
3670
|
className: "text-xs font-medium",
|
|
3536
3671
|
children: b.error
|
|
3537
3672
|
})] }),
|
|
3538
|
-
children: /* @__PURE__ */
|
|
3673
|
+
children: /* @__PURE__ */ X("div", {
|
|
3539
3674
|
className: "w-full h-full flex items-center",
|
|
3540
3675
|
children: v
|
|
3541
3676
|
})
|
|
@@ -3543,24 +3678,24 @@ var Un = ({ children: e, text: t }) => {
|
|
|
3543
3678
|
})]
|
|
3544
3679
|
});
|
|
3545
3680
|
});
|
|
3546
|
-
|
|
3681
|
+
qn.displayName = "EzTableCell";
|
|
3547
3682
|
//#endregion
|
|
3548
3683
|
//#region src/components/EzTable/components/EzTableRow.tsx
|
|
3549
|
-
var
|
|
3550
|
-
let
|
|
3684
|
+
var Jn = H(({ virtualRow: t, row: n, table: r, density: i, enableContextMenu: a, onContextMenuItemClick: o, isCellSelected: s, onCellMouseDown: c, onCellMouseEnter: l, onCellClick: u, onCellDoubleClick: d, focusedCell: f, renderDetailPanel: p, measureElement: m, dynamicRowSizing: h, columnVirtualizer: g, onRowClick: _, onRowDoubleClick: y, onRowMouseEnter: b, onRowMouseLeave: x, columnPinning: S }) => {
|
|
3685
|
+
let C = g?.getVirtualItems() || n.getVisibleCells().map((e, t) => ({ index: t })), w = n.getVisibleCells(), T = !!h || n.getIsExpanded() || w.some((e) => e.column.columnDef.meta?.wrapText), { paddingLeft: E, paddingRight: D } = G(() => !g || C.length === 0 ? {
|
|
3551
3686
|
paddingLeft: 0,
|
|
3552
3687
|
paddingRight: 0
|
|
3553
3688
|
} : {
|
|
3554
|
-
paddingLeft:
|
|
3555
|
-
paddingRight: g.getTotalSize() - (
|
|
3556
|
-
}, [g,
|
|
3557
|
-
return /* @__PURE__ */
|
|
3689
|
+
paddingLeft: C[0]?.start || 0,
|
|
3690
|
+
paddingRight: g.getTotalSize() - (C[C.length - 1]?.end || 0)
|
|
3691
|
+
}, [g, C]);
|
|
3692
|
+
return /* @__PURE__ */ X(v, {
|
|
3558
3693
|
row: n,
|
|
3559
3694
|
enabled: a,
|
|
3560
3695
|
onAction: (e, t) => {
|
|
3561
3696
|
e === "pin-top" ? n.pin("top") : e === "pin-bottom" ? n.pin("bottom") : e === "unpin" ? n.pin(!1) : o?.(e, t);
|
|
3562
3697
|
},
|
|
3563
|
-
children: /* @__PURE__ */
|
|
3698
|
+
children: /* @__PURE__ */ Z("div", {
|
|
3564
3699
|
"data-index": t.index,
|
|
3565
3700
|
ref: m,
|
|
3566
3701
|
className: "absolute top-0 left-0 w-full flex flex-col group border-b border-border",
|
|
@@ -3568,7 +3703,7 @@ var Gn = V(({ virtualRow: t, row: n, table: r, density: i, enableContextMenu: a,
|
|
|
3568
3703
|
"aria-rowindex": t.index + 1,
|
|
3569
3704
|
style: {
|
|
3570
3705
|
transform: `translateY(${t.start}px)`,
|
|
3571
|
-
...
|
|
3706
|
+
...T ? { minHeight: `${t.size}px` } : { height: `${t.size}px` }
|
|
3572
3707
|
},
|
|
3573
3708
|
onClick: (e) => _?.({
|
|
3574
3709
|
row: n.original,
|
|
@@ -3576,21 +3711,21 @@ var Gn = V(({ virtualRow: t, row: n, table: r, density: i, enableContextMenu: a,
|
|
|
3576
3711
|
rowIndex: n.index,
|
|
3577
3712
|
originalEvent: e
|
|
3578
3713
|
}),
|
|
3579
|
-
onDoubleClick: (e) =>
|
|
3714
|
+
onDoubleClick: (e) => y?.({
|
|
3580
3715
|
row: n.original,
|
|
3581
3716
|
data: n.original,
|
|
3582
3717
|
rowIndex: n.index,
|
|
3583
3718
|
originalEvent: e
|
|
3584
3719
|
}),
|
|
3585
|
-
onMouseEnter: (e) =>
|
|
3586
|
-
onMouseLeave: (e) =>
|
|
3587
|
-
children: [/* @__PURE__ */
|
|
3588
|
-
className: e("flex items-stretch w-full min-w-max hover:bg-muted/50 transition-[background-color] duration-200", n.getIsSelected() && "bg-muted",
|
|
3720
|
+
onMouseEnter: (e) => b?.(n.index, e),
|
|
3721
|
+
onMouseLeave: (e) => x?.(n.index, e),
|
|
3722
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
3723
|
+
className: e("flex items-stretch w-full min-w-max hover:bg-muted/50 transition-[background-color] duration-200", n.getIsSelected() && "bg-muted", dn(i), typeof r.options.meta?.classNames?.row == "function" ? r.options.meta.classNames.row(n) : r.options.meta?.classNames?.row),
|
|
3589
3724
|
children: [
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
let a =
|
|
3593
|
-
return a ? /* @__PURE__ */
|
|
3725
|
+
E > 0 && /* @__PURE__ */ X("div", { style: { flex: `0 0 ${E}px` } }),
|
|
3726
|
+
C.map((e) => {
|
|
3727
|
+
let a = w[e.index];
|
|
3728
|
+
return a ? /* @__PURE__ */ X(qn, {
|
|
3594
3729
|
cell: a,
|
|
3595
3730
|
virtualRowIndex: t.index,
|
|
3596
3731
|
cellIndex: e.index,
|
|
@@ -3607,31 +3742,31 @@ var Gn = V(({ virtualRow: t, row: n, table: r, density: i, enableContextMenu: a,
|
|
|
3607
3742
|
renderDetailPanel: p,
|
|
3608
3743
|
isFirstColumn: e.index === 0,
|
|
3609
3744
|
table: r,
|
|
3610
|
-
columnPinning:
|
|
3745
|
+
columnPinning: S
|
|
3611
3746
|
}, a.id) : null;
|
|
3612
3747
|
}),
|
|
3613
|
-
|
|
3748
|
+
D > 0 && /* @__PURE__ */ X("div", { style: { flex: `0 0 ${D}px` } })
|
|
3614
3749
|
]
|
|
3615
|
-
}), n.getIsExpanded() && p && /* @__PURE__ */
|
|
3750
|
+
}), n.getIsExpanded() && p && /* @__PURE__ */ X("div", {
|
|
3616
3751
|
className: "w-full bg-muted/30 border-t border-border",
|
|
3617
3752
|
children: p({ row: n })
|
|
3618
3753
|
})]
|
|
3619
3754
|
})
|
|
3620
3755
|
});
|
|
3621
3756
|
});
|
|
3622
|
-
|
|
3757
|
+
Jn.displayName = "EzTableRow";
|
|
3623
3758
|
//#endregion
|
|
3624
3759
|
//#region src/components/EzTable/components/EzTableBodySection.tsx
|
|
3625
|
-
function
|
|
3760
|
+
function Yn({ table: t, rows: n, rowVirtualizer: r, columnVirtualizer: i, density: a, classNames: o, isLoading: s, enableInfiniteScroll: c, isPending: l, renderNoRowsOverlay: u, slots: d, localization: f, enableContextMenu: p, onContextMenuItemClick: m, isCellSelected: h, focusedCell: g, onCellMouseDown: _, onCellMouseEnter: v, onCellClick: y, onCellDoubleClick: b, renderDetailPanel: x, dynamicRowSizing: S, onRowClick: C, onRowDoubleClick: w }) {
|
|
3626
3761
|
let T = !!((s || l) && !c);
|
|
3627
|
-
return /* @__PURE__ */
|
|
3762
|
+
return /* @__PURE__ */ Z("div", {
|
|
3628
3763
|
className: e("relative w-full", o?.body),
|
|
3629
3764
|
style: {
|
|
3630
3765
|
height: `${r?.getTotalSize() ?? 0}px`,
|
|
3631
3766
|
minHeight: "0",
|
|
3632
3767
|
flexShrink: "0"
|
|
3633
3768
|
},
|
|
3634
|
-
children: [/* @__PURE__ */
|
|
3769
|
+
children: [/* @__PURE__ */ X(Gn, {
|
|
3635
3770
|
isLoading: T,
|
|
3636
3771
|
rowCount: n.length,
|
|
3637
3772
|
renderNoRowsOverlay: u,
|
|
@@ -3639,7 +3774,7 @@ function Kn({ table: t, rows: n, rowVirtualizer: r, columnVirtualizer: i, densit
|
|
|
3639
3774
|
localization: f
|
|
3640
3775
|
}), r?.getVirtualItems().map((e) => {
|
|
3641
3776
|
let o = n[e.index];
|
|
3642
|
-
return /* @__PURE__ */
|
|
3777
|
+
return /* @__PURE__ */ X(d?.row || Jn, {
|
|
3643
3778
|
virtualRow: e,
|
|
3644
3779
|
row: o,
|
|
3645
3780
|
table: t,
|
|
@@ -3666,132 +3801,132 @@ function Kn({ table: t, rows: n, rowVirtualizer: r, columnVirtualizer: i, densit
|
|
|
3666
3801
|
}
|
|
3667
3802
|
//#endregion
|
|
3668
3803
|
//#region src/components/EzTable/EzPagination.tsx
|
|
3669
|
-
var
|
|
3804
|
+
var Xn = ({ pageIndex: e, pageSize: t, pageCount: n, totalRows: r, onPageChange: o, onPageSizeChange: s, canPreviousPage: c, canNextPage: l, localization: u, changes: d }) => /* @__PURE__ */ Z("div", {
|
|
3670
3805
|
className: "flex items-center justify-between w-full px-4 py-3 border-t border-border bg-background",
|
|
3671
|
-
children: [/* @__PURE__ */
|
|
3806
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
3672
3807
|
className: "flex items-center gap-6",
|
|
3673
3808
|
children: [
|
|
3674
|
-
/* @__PURE__ */
|
|
3809
|
+
/* @__PURE__ */ Z("div", {
|
|
3675
3810
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
3676
3811
|
children: [
|
|
3677
|
-
/* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ X("span", {
|
|
3678
3813
|
className: "hidden sm:inline whitespace-nowrap",
|
|
3679
3814
|
children: u?.rowsPerPageLabel || "Rows per page"
|
|
3680
3815
|
}),
|
|
3681
|
-
/* @__PURE__ */
|
|
3816
|
+
/* @__PURE__ */ X("span", {
|
|
3682
3817
|
className: "sm:hidden",
|
|
3683
3818
|
children: u?.rowsLabel || "Rows"
|
|
3684
3819
|
}),
|
|
3685
|
-
/* @__PURE__ */
|
|
3820
|
+
/* @__PURE__ */ Z(P, {
|
|
3686
3821
|
value: `${t}`,
|
|
3687
3822
|
onValueChange: (e) => s(Number(e)),
|
|
3688
|
-
children: [/* @__PURE__ */
|
|
3823
|
+
children: [/* @__PURE__ */ X(j, {
|
|
3689
3824
|
className: "h-8 w-[70px] bg-muted/20 border-border",
|
|
3690
|
-
children: /* @__PURE__ */
|
|
3691
|
-
}), /* @__PURE__ */
|
|
3825
|
+
children: /* @__PURE__ */ X(A, { placeholder: t.toString() })
|
|
3826
|
+
}), /* @__PURE__ */ X(M, { children: [
|
|
3692
3827
|
10,
|
|
3693
3828
|
20,
|
|
3694
3829
|
30,
|
|
3695
3830
|
40,
|
|
3696
3831
|
50,
|
|
3697
3832
|
100
|
|
3698
|
-
].map((e) => /* @__PURE__ */
|
|
3833
|
+
].map((e) => /* @__PURE__ */ X(N, {
|
|
3699
3834
|
value: `${e}`,
|
|
3700
3835
|
children: e
|
|
3701
3836
|
}, e)) })]
|
|
3702
3837
|
})
|
|
3703
3838
|
]
|
|
3704
3839
|
}),
|
|
3705
|
-
/* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
3840
|
+
/* @__PURE__ */ X("div", { className: "h-4 w-px bg-border hidden sm:block" }),
|
|
3841
|
+
/* @__PURE__ */ Z("div", {
|
|
3707
3842
|
className: "hidden md:flex items-center gap-2 text-sm text-muted-foreground font-medium bg-muted/30 px-3 py-1 rounded-full border border-border/50",
|
|
3708
|
-
children: [/* @__PURE__ */
|
|
3843
|
+
children: [/* @__PURE__ */ Z("div", { children: [
|
|
3709
3844
|
u?.totalLabel || "Total",
|
|
3710
3845
|
" ",
|
|
3711
|
-
/* @__PURE__ */
|
|
3846
|
+
/* @__PURE__ */ X("span", {
|
|
3712
3847
|
className: "text-foreground font-bold",
|
|
3713
3848
|
children: r
|
|
3714
3849
|
}),
|
|
3715
3850
|
" ",
|
|
3716
3851
|
u?.recordsLabel || "records"
|
|
3717
|
-
] }), d && (d.added > 0 || d.edited > 0 || d.deleted > 0) && /* @__PURE__ */
|
|
3852
|
+
] }), d && (d.added > 0 || d.edited > 0 || d.deleted > 0) && /* @__PURE__ */ Z("div", {
|
|
3718
3853
|
className: "flex items-center gap-2 border-l border-border/50 pl-2 ml-1",
|
|
3719
3854
|
children: [
|
|
3720
|
-
d.added > 0 && /* @__PURE__ */
|
|
3855
|
+
d.added > 0 && /* @__PURE__ */ Z("span", {
|
|
3721
3856
|
className: "text-success dark:text-success/80 font-bold",
|
|
3722
3857
|
children: [d.added, " added"]
|
|
3723
3858
|
}),
|
|
3724
|
-
d.edited > 0 && /* @__PURE__ */
|
|
3859
|
+
d.edited > 0 && /* @__PURE__ */ Z("span", {
|
|
3725
3860
|
className: "text-warning dark:text-warning/80 font-bold",
|
|
3726
3861
|
children: [d.edited, " edited"]
|
|
3727
3862
|
}),
|
|
3728
|
-
d.deleted > 0 && /* @__PURE__ */
|
|
3863
|
+
d.deleted > 0 && /* @__PURE__ */ Z("span", {
|
|
3729
3864
|
className: "text-error dark:text-error/80 font-bold",
|
|
3730
3865
|
children: [d.deleted, " deleted"]
|
|
3731
3866
|
})
|
|
3732
3867
|
]
|
|
3733
3868
|
})]
|
|
3734
3869
|
}),
|
|
3735
|
-
u?.pagerMessage && /* @__PURE__ */
|
|
3870
|
+
u?.pagerMessage && /* @__PURE__ */ X("div", {
|
|
3736
3871
|
className: "hidden lg:block text-sm text-muted-foreground italic",
|
|
3737
3872
|
children: u.pagerMessage
|
|
3738
3873
|
})
|
|
3739
3874
|
]
|
|
3740
|
-
}), /* @__PURE__ */
|
|
3875
|
+
}), /* @__PURE__ */ Z("div", {
|
|
3741
3876
|
className: "flex items-center gap-4",
|
|
3742
|
-
children: [/* @__PURE__ */
|
|
3877
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
3743
3878
|
className: "flex items-center text-sm font-medium text-foreground whitespace-nowrap bg-muted/20 px-3 py-1 rounded-md border border-border/50 gap-1.5",
|
|
3744
3879
|
children: [
|
|
3745
|
-
/* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ X("span", {
|
|
3746
3881
|
className: "text-muted-foreground font-normal",
|
|
3747
3882
|
children: u?.pageLabel || "Page"
|
|
3748
3883
|
}),
|
|
3749
|
-
/* @__PURE__ */
|
|
3884
|
+
/* @__PURE__ */ X("span", {
|
|
3750
3885
|
className: "text-primary font-black px-0.5",
|
|
3751
3886
|
children: e + 1
|
|
3752
3887
|
}),
|
|
3753
|
-
/* @__PURE__ */
|
|
3888
|
+
/* @__PURE__ */ X("span", {
|
|
3754
3889
|
className: "text-muted-foreground font-normal",
|
|
3755
3890
|
children: u?.ofLabel || "of"
|
|
3756
3891
|
}),
|
|
3757
|
-
/* @__PURE__ */
|
|
3892
|
+
/* @__PURE__ */ X("span", {
|
|
3758
3893
|
className: "font-bold px-0.5",
|
|
3759
3894
|
children: n
|
|
3760
3895
|
})
|
|
3761
3896
|
]
|
|
3762
|
-
}), /* @__PURE__ */
|
|
3897
|
+
}), /* @__PURE__ */ Z("div", {
|
|
3763
3898
|
className: "flex items-center gap-1.5",
|
|
3764
3899
|
children: [
|
|
3765
|
-
/* @__PURE__ */
|
|
3900
|
+
/* @__PURE__ */ Z("div", {
|
|
3766
3901
|
className: "flex items-center gap-1",
|
|
3767
|
-
children: [/* @__PURE__ */
|
|
3902
|
+
children: [/* @__PURE__ */ Z(i, {
|
|
3768
3903
|
variant: "outline",
|
|
3769
3904
|
className: "hidden h-8 w-8 p-0 lg:flex bg-background border-border hover:bg-muted",
|
|
3770
3905
|
onClick: () => o(0),
|
|
3771
3906
|
disabled: !c,
|
|
3772
3907
|
title: u?.firstPage || "First Page",
|
|
3773
|
-
children: [/* @__PURE__ */
|
|
3908
|
+
children: [/* @__PURE__ */ X(fe, { className: "h-4 w-4" }), /* @__PURE__ */ X("span", {
|
|
3774
3909
|
className: "sr-only",
|
|
3775
3910
|
children: "Go to first page"
|
|
3776
3911
|
})]
|
|
3777
|
-
}), /* @__PURE__ */
|
|
3912
|
+
}), /* @__PURE__ */ Z(i, {
|
|
3778
3913
|
variant: "outline",
|
|
3779
3914
|
className: "h-8 w-8 p-0 bg-background border-border hover:bg-muted",
|
|
3780
3915
|
onClick: () => o(e - 1),
|
|
3781
3916
|
disabled: !c,
|
|
3782
3917
|
title: u?.previousPage || "Previous Page",
|
|
3783
|
-
children: [/* @__PURE__ */
|
|
3918
|
+
children: [/* @__PURE__ */ X(ue, { className: "h-4 w-4" }), /* @__PURE__ */ X("span", {
|
|
3784
3919
|
className: "sr-only",
|
|
3785
3920
|
children: "Go to previous page"
|
|
3786
3921
|
})]
|
|
3787
3922
|
})]
|
|
3788
3923
|
}),
|
|
3789
|
-
/* @__PURE__ */
|
|
3924
|
+
/* @__PURE__ */ Z("div", {
|
|
3790
3925
|
className: "flex items-center gap-2 px-2 h-8 bg-muted/20 rounded-md border border-border/50 hover:border-primary/50 transition-colors",
|
|
3791
|
-
children: [/* @__PURE__ */
|
|
3926
|
+
children: [/* @__PURE__ */ X("span", {
|
|
3792
3927
|
className: "text-[10px] hidden sm:inline text-muted-foreground uppercase font-black tracking-tighter",
|
|
3793
3928
|
children: u?.goToLabel || "Go To"
|
|
3794
|
-
}), /* @__PURE__ */
|
|
3929
|
+
}), /* @__PURE__ */ X(a, {
|
|
3795
3930
|
type: "number",
|
|
3796
3931
|
min: 1,
|
|
3797
3932
|
max: n,
|
|
@@ -3807,25 +3942,25 @@ var qn = ({ pageIndex: e, pageSize: t, pageCount: n, totalRows: r, onPageChange:
|
|
|
3807
3942
|
className: "h-6 w-10 p-0 text-center border-none bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm font-bold"
|
|
3808
3943
|
})]
|
|
3809
3944
|
}),
|
|
3810
|
-
/* @__PURE__ */
|
|
3945
|
+
/* @__PURE__ */ Z("div", {
|
|
3811
3946
|
className: "flex items-center gap-1",
|
|
3812
|
-
children: [/* @__PURE__ */
|
|
3947
|
+
children: [/* @__PURE__ */ Z(i, {
|
|
3813
3948
|
variant: "outline",
|
|
3814
3949
|
className: "h-8 w-8 p-0 bg-background border-border hover:bg-muted",
|
|
3815
3950
|
onClick: () => o(e + 1),
|
|
3816
3951
|
disabled: !l,
|
|
3817
3952
|
title: u?.nextPage || "Next Page",
|
|
3818
|
-
children: [/* @__PURE__ */
|
|
3953
|
+
children: [/* @__PURE__ */ X(de, { className: "h-4 w-4" }), /* @__PURE__ */ X("span", {
|
|
3819
3954
|
className: "sr-only",
|
|
3820
3955
|
children: "Go to next page"
|
|
3821
3956
|
})]
|
|
3822
|
-
}), /* @__PURE__ */
|
|
3957
|
+
}), /* @__PURE__ */ Z(i, {
|
|
3823
3958
|
variant: "outline",
|
|
3824
3959
|
className: "hidden h-8 w-8 p-0 lg:flex bg-background border-border hover:bg-muted",
|
|
3825
3960
|
onClick: () => o(n - 1),
|
|
3826
3961
|
disabled: !l,
|
|
3827
3962
|
title: u?.lastPage || "Last Page",
|
|
3828
|
-
children: [/* @__PURE__ */
|
|
3963
|
+
children: [/* @__PURE__ */ X(pe, { className: "h-4 w-4" }), /* @__PURE__ */ X("span", {
|
|
3829
3964
|
className: "sr-only",
|
|
3830
3965
|
children: "Go to last page"
|
|
3831
3966
|
})]
|
|
@@ -3837,10 +3972,10 @@ var qn = ({ pageIndex: e, pageSize: t, pageCount: n, totalRows: r, onPageChange:
|
|
|
3837
3972
|
});
|
|
3838
3973
|
//#endregion
|
|
3839
3974
|
//#region src/components/EzTable/components/EzTablePaginationSection.tsx
|
|
3840
|
-
function
|
|
3841
|
-
return /* @__PURE__ */
|
|
3975
|
+
function Zn({ table: t, pagerMessage: n, enableStickyPagination: r, classNames: i, localization: a, changes: o }) {
|
|
3976
|
+
return /* @__PURE__ */ X("div", {
|
|
3842
3977
|
className: e("w-full bg-background border-t border-border z-30", r && "sticky bottom-0 shadow-[0_-4px_12px_rgba(0,0,0,0.1)] dark:shadow-[0_-4px_12px_rgba(0,0,0,0.3)]", i?.footer),
|
|
3843
|
-
children: /* @__PURE__ */
|
|
3978
|
+
children: /* @__PURE__ */ X(Xn, {
|
|
3844
3979
|
pageIndex: t.getState().pagination.pageIndex,
|
|
3845
3980
|
pageSize: t.getState().pagination.pageSize,
|
|
3846
3981
|
pageCount: t.getPageCount(),
|
|
@@ -3859,7 +3994,7 @@ function Jn({ table: t, pagerMessage: n, enableStickyPagination: r, classNames:
|
|
|
3859
3994
|
}
|
|
3860
3995
|
//#endregion
|
|
3861
3996
|
//#region src/components/EzTable/hooks/useColumnSizeVars.ts
|
|
3862
|
-
var
|
|
3997
|
+
var Qn = (e) => G(() => {
|
|
3863
3998
|
let t = e.getFlatHeaders(), n = {};
|
|
3864
3999
|
for (let e = 0; e < t.length; e++) {
|
|
3865
4000
|
let r = t[e];
|
|
@@ -3871,7 +4006,7 @@ var Yn = (e) => W(() => {
|
|
|
3871
4006
|
e.getState().columnSizingInfo,
|
|
3872
4007
|
e.getState().columnVisibility,
|
|
3873
4008
|
e.getFlatHeaders()
|
|
3874
|
-
]),
|
|
4009
|
+
]), $n = (e = []) => new Ne({
|
|
3875
4010
|
data: e,
|
|
3876
4011
|
globalFilter: "",
|
|
3877
4012
|
columnFilters: [],
|
|
@@ -3883,184 +4018,184 @@ var Yn = (e) => W(() => {
|
|
|
3883
4018
|
rowSelection: {},
|
|
3884
4019
|
columnVisibility: {},
|
|
3885
4020
|
isPending: !1
|
|
3886
|
-
}),
|
|
3887
|
-
let n =
|
|
3888
|
-
return
|
|
4021
|
+
}), er = re(null), tr = re(null), nr = ({ data: e, children: t }) => {
|
|
4022
|
+
let n = G(() => $n(e), []);
|
|
4023
|
+
return V.useEffect(() => {
|
|
3889
4024
|
n.setState((t) => ({
|
|
3890
4025
|
...t,
|
|
3891
4026
|
data: e
|
|
3892
4027
|
}));
|
|
3893
|
-
}, [e, n]), /* @__PURE__ */
|
|
4028
|
+
}, [e, n]), /* @__PURE__ */ X(er.Provider, {
|
|
3894
4029
|
value: n,
|
|
3895
4030
|
children: t
|
|
3896
4031
|
});
|
|
3897
|
-
},
|
|
3898
|
-
let t =
|
|
4032
|
+
}, rr = (e) => {
|
|
4033
|
+
let t = ie(er);
|
|
3899
4034
|
if (!t) throw Error("EzTable components must be wrapped in <EzTable.Root>");
|
|
3900
|
-
return
|
|
3901
|
-
},
|
|
3902
|
-
let i = n(), a =
|
|
3903
|
-
|
|
4035
|
+
return Ue(t, e);
|
|
4036
|
+
}, ir = V.lazy(() => import("./EzGroupingPanel-BVaAJaVU.js").then((e) => ({ default: e.EzGroupingPanel }))), ar = V.lazy(() => import("./EzTableEditDialog-m0zW6r6z.js").then((e) => ({ default: e.EzTableEditDialog }))), or = V.lazy(() => import("./EzTableToolbar-BiRfKm9d.js").then((e) => e.n).then((e) => ({ default: e.EzTableToolbar }))), sr = V.lazy(() => import("./EzTableFooter-BuTS3wDK.js").then((e) => e.n).then((e) => ({ default: e.EzTableFooter }))), cr = ({ ref: t, ...r }) => {
|
|
4037
|
+
let i = n(), a = nn(r), o = K(null);
|
|
4038
|
+
rn({
|
|
3904
4039
|
containerRef: o,
|
|
3905
|
-
containerSizeRef:
|
|
4040
|
+
containerSizeRef: K({
|
|
3906
4041
|
width: 0,
|
|
3907
4042
|
height: 0
|
|
3908
4043
|
}),
|
|
3909
|
-
resizeTimeoutRef:
|
|
4044
|
+
resizeTimeoutRef: K(null),
|
|
3910
4045
|
onResize: () => {
|
|
3911
4046
|
a.rowVirtualizer && a.rowVirtualizer.measure();
|
|
3912
4047
|
}
|
|
3913
4048
|
}, [a.rowVirtualizer]);
|
|
3914
|
-
let { state: { rows: s, rangeSelection: l, canUndo: u, canRedo: d, changes:
|
|
4049
|
+
let { state: { rows: s, rangeSelection: l, canUndo: u, canRedo: d, changes: f, batchChanges: p, density: m, isPending: h, focusedCell: g, globalFilter: _, pagerMessage: v }, actions: { undo: b, redo: x, resetData: S, toggleRowEditing: C, autoFitColumn: w, onCellMouseDown: T, onCellMouseEnter: D, setGlobalFilter: O, handleGlobalFilterChange: ee, getData: k, onRowClick: A, onRowDoubleClick: j }, refs: { parentRef: M, rowVirtualizer: N, columnVirtualizer: P }, config: { enableStickyHeader: te, enableChangeTracking: F, enableEditing: I, editSettings: L, dynamicRowSizing: ne }, table: R, dir: z, imperativeAPI: { addRecord: B, updateRecord: re } } = a, { validate: H, validateForm: ie } = ut({
|
|
3915
4050
|
validateField: r.validateField ? ({ fieldName: e, value: t, data: n }) => r.validateField?.({
|
|
3916
4051
|
field: e,
|
|
3917
4052
|
value: t,
|
|
3918
4053
|
row: n,
|
|
3919
|
-
table:
|
|
4054
|
+
table: R
|
|
3920
4055
|
}) ?? !0 : void 0,
|
|
3921
|
-
editSettings:
|
|
3922
|
-
}), [
|
|
3923
|
-
|
|
3924
|
-
if (
|
|
4056
|
+
editSettings: L
|
|
4057
|
+
}), [ae, G] = V.useState(!1);
|
|
4058
|
+
W(() => {
|
|
4059
|
+
if (f.added + f.edited + f.deleted > 0 && I) {
|
|
3925
4060
|
let e = (e) => (e.preventDefault(), e.returnValue = "", "");
|
|
3926
4061
|
return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
3927
4062
|
}
|
|
3928
|
-
}, [
|
|
3929
|
-
r.onDataChange && r.onDataChange(
|
|
3930
|
-
}, [
|
|
3931
|
-
let { onRowClick:
|
|
3932
|
-
table:
|
|
3933
|
-
editSettings:
|
|
3934
|
-
toggleRowEditing:
|
|
3935
|
-
onRowClickProp:
|
|
3936
|
-
onRowDoubleClickProp:
|
|
3937
|
-
}),
|
|
3938
|
-
|
|
3939
|
-
dialogState:
|
|
3940
|
-
isDialogMode:
|
|
4063
|
+
}, [f, I]), W(() => {
|
|
4064
|
+
r.onDataChange && r.onDataChange(f);
|
|
4065
|
+
}, [f, r.onDataChange]);
|
|
4066
|
+
let { onRowClick: q, onRowDoubleClick: J, onCellClick: oe, onCellDoubleClick: se } = an({
|
|
4067
|
+
table: R,
|
|
4068
|
+
editSettings: L,
|
|
4069
|
+
toggleRowEditing: C,
|
|
4070
|
+
onRowClickProp: A,
|
|
4071
|
+
onRowDoubleClickProp: j
|
|
4072
|
+
}), ce = Qn(R), Y = dt({ initialMode: "view" });
|
|
4073
|
+
on({
|
|
4074
|
+
dialogState: Y,
|
|
4075
|
+
isDialogMode: L?.mode === "Dialog",
|
|
3941
4076
|
rows: s,
|
|
3942
|
-
table:
|
|
4077
|
+
table: R
|
|
3943
4078
|
});
|
|
3944
|
-
let
|
|
3945
|
-
|
|
4079
|
+
let le = U((e) => {
|
|
4080
|
+
Y.mode === "create" ? B(e) : (re(Y.meta.index, e), C(Y.meta.index, !1)), Y.close();
|
|
3946
4081
|
}, [
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
]),
|
|
3952
|
-
|
|
3953
|
-
}, [
|
|
4082
|
+
Y,
|
|
4083
|
+
B,
|
|
4084
|
+
re,
|
|
4085
|
+
C
|
|
4086
|
+
]), ue = U(() => {
|
|
4087
|
+
L?.mode === "Dialog" ? Y.open("create", {}) : B({});
|
|
4088
|
+
}, [L?.mode, B]), de = U(() => {
|
|
3954
4089
|
if (r.onBatchSave) {
|
|
3955
|
-
let e = [...
|
|
3956
|
-
for (let n of e) if (!
|
|
3957
|
-
|
|
4090
|
+
let e = [...p.addedRecords, ...p.changedRecords], t = R.getVisibleLeafColumns().map((e) => e.id).filter((e) => e !== "select" && e !== "actions");
|
|
4091
|
+
for (let n of e) if (!ie(n, t).__form.isValid) {
|
|
4092
|
+
G(!0);
|
|
3958
4093
|
return;
|
|
3959
4094
|
}
|
|
3960
|
-
r.onBatchSave(
|
|
4095
|
+
r.onBatchSave(p);
|
|
3961
4096
|
let n = i.get("NotificationService");
|
|
3962
4097
|
if (n && n.add({
|
|
3963
4098
|
type: "success",
|
|
3964
|
-
message: `Successfully saved ${
|
|
4099
|
+
message: `Successfully saved ${p.addedRecords.length + p.changedRecords.length} changes.`,
|
|
3965
4100
|
duration: 5e3
|
|
3966
|
-
}),
|
|
3967
|
-
let e =
|
|
4101
|
+
}), S(), G(!1), R.options.meta?.toggleRowEditing) {
|
|
4102
|
+
let e = R.options.meta.editingRows || {};
|
|
3968
4103
|
Object.keys(e).forEach((e) => {
|
|
3969
|
-
|
|
4104
|
+
R.options.meta?.toggleRowEditing?.(parseInt(e), !1);
|
|
3970
4105
|
});
|
|
3971
4106
|
}
|
|
3972
4107
|
}
|
|
3973
4108
|
}, [
|
|
3974
4109
|
r.onBatchSave,
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
]),
|
|
3981
|
-
if (r.onBatchDiscard && r.onBatchDiscard(),
|
|
3982
|
-
let e =
|
|
4110
|
+
p,
|
|
4111
|
+
S,
|
|
4112
|
+
R.options.meta,
|
|
4113
|
+
ie,
|
|
4114
|
+
R
|
|
4115
|
+
]), fe = U(() => {
|
|
4116
|
+
if (r.onBatchDiscard && r.onBatchDiscard(), S(), G(!1), R.options.meta?.toggleRowEditing) {
|
|
4117
|
+
let e = R.options.meta.editingRows || {};
|
|
3983
4118
|
Object.keys(e).forEach((e) => {
|
|
3984
|
-
|
|
4119
|
+
R.options.meta?.toggleRowEditing?.(parseInt(e), !1);
|
|
3985
4120
|
});
|
|
3986
4121
|
}
|
|
3987
4122
|
}, [
|
|
3988
4123
|
r.onBatchDiscard,
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
]),
|
|
4124
|
+
S,
|
|
4125
|
+
R.options.meta
|
|
4126
|
+
]), pe = V.useMemo(() => ({
|
|
3992
4127
|
...a.imperativeAPI,
|
|
3993
4128
|
...a.baseApi,
|
|
3994
4129
|
validateField: (e) => {
|
|
3995
4130
|
let t = {};
|
|
3996
|
-
if (
|
|
4131
|
+
if (L?.mode === "Dialog" && Y.isOpen) t = Y.data;
|
|
3997
4132
|
else {
|
|
3998
|
-
let e =
|
|
4133
|
+
let e = R.options.meta?.editingRows || {}, n = Object.keys(e).find((t) => e[t]);
|
|
3999
4134
|
if (n) {
|
|
4000
|
-
let e = parseInt(n), r =
|
|
4135
|
+
let e = parseInt(n), r = k();
|
|
4001
4136
|
r && r[e] && (t = r[e]);
|
|
4002
4137
|
}
|
|
4003
4138
|
}
|
|
4004
|
-
let { isValid: n } =
|
|
4139
|
+
let { isValid: n } = H(e, t[e], t);
|
|
4005
4140
|
return n;
|
|
4006
4141
|
},
|
|
4007
4142
|
validateEditForm: () => {
|
|
4008
|
-
let e =
|
|
4143
|
+
let e = R.getVisibleLeafColumns(), t = !0;
|
|
4009
4144
|
return e.forEach((e) => {
|
|
4010
4145
|
let n = e.id, r = {};
|
|
4011
|
-
if (
|
|
4146
|
+
if (L?.mode === "Dialog" && Y.isOpen) r = Y.data;
|
|
4012
4147
|
else {
|
|
4013
|
-
let e =
|
|
4014
|
-
t &&
|
|
4148
|
+
let e = R.options.meta?.editingRows || {}, t = Object.keys(e).find((t) => e[t]);
|
|
4149
|
+
t && k()[parseInt(t)] && (r = k()[parseInt(t)]);
|
|
4015
4150
|
}
|
|
4016
|
-
let { isValid: i } =
|
|
4151
|
+
let { isValid: i } = H(n, r[n], r);
|
|
4017
4152
|
i || (t = !1);
|
|
4018
4153
|
}), t;
|
|
4019
4154
|
}
|
|
4020
4155
|
}), [
|
|
4021
4156
|
a,
|
|
4022
|
-
|
|
4023
|
-
I,
|
|
4024
|
-
q,
|
|
4157
|
+
k,
|
|
4025
4158
|
L,
|
|
4026
|
-
|
|
4159
|
+
Y,
|
|
4160
|
+
R,
|
|
4161
|
+
H
|
|
4027
4162
|
]);
|
|
4028
|
-
|
|
4029
|
-
...
|
|
4163
|
+
R.options.meta = {
|
|
4164
|
+
...R.options.meta,
|
|
4030
4165
|
...r,
|
|
4031
|
-
validate:
|
|
4032
|
-
validationAttempted:
|
|
4033
|
-
},
|
|
4034
|
-
let [
|
|
4166
|
+
validate: H,
|
|
4167
|
+
validationAttempted: ae
|
|
4168
|
+
}, y(t, pe);
|
|
4169
|
+
let [me, he] = V.useState(null), { handleDragEnd: ge, handleKeyDown: _e, handleDragStart: ve } = ct({
|
|
4035
4170
|
onDragStart: (e) => {
|
|
4036
|
-
|
|
4171
|
+
he(e.active.id);
|
|
4037
4172
|
},
|
|
4038
4173
|
onDragEnd: (e) => {
|
|
4039
|
-
|
|
4174
|
+
he(null);
|
|
4040
4175
|
let { active: t, over: n } = e;
|
|
4041
4176
|
if (!n) return;
|
|
4042
|
-
let i = t.id, a = [...
|
|
4043
|
-
if (n.id === "grouping-panel") !a.includes(i) && r.enableGrouping &&
|
|
4177
|
+
let i = t.id, a = [...R.getState().grouping];
|
|
4178
|
+
if (n.id === "grouping-panel") !a.includes(i) && r.enableGrouping && R.setGrouping([...a, i]);
|
|
4044
4179
|
else if (typeof n.id == "string" && n.id.startsWith("header-")) {
|
|
4045
4180
|
let e = n.id.replace("header-", "");
|
|
4046
4181
|
if (i !== e) {
|
|
4047
4182
|
if (r.enableColumnReorder !== !1) {
|
|
4048
|
-
let t =
|
|
4183
|
+
let t = R.getState().columnOrder.length > 0 ? R.getState().columnOrder : R.getAllLeafColumns().map((e) => e.id), n = t.indexOf(i), r = t.indexOf(e);
|
|
4049
4184
|
if (n !== -1 && r !== -1 && n !== r) {
|
|
4050
4185
|
let e = [...t];
|
|
4051
|
-
e.splice(n, 1), e.splice(r, 0, i),
|
|
4186
|
+
e.splice(n, 1), e.splice(r, 0, i), R.setColumnOrder(e);
|
|
4052
4187
|
}
|
|
4053
4188
|
} else if (r.enableGrouping) {
|
|
4054
4189
|
let t = [...a];
|
|
4055
4190
|
t.includes(e) || t.push(e), t.includes(i) && (t = t.filter((e) => e !== i));
|
|
4056
4191
|
let n = t.indexOf(e);
|
|
4057
|
-
t.splice(n + 0, 0, i),
|
|
4192
|
+
t.splice(n + 0, 0, i), R.setGrouping(t);
|
|
4058
4193
|
}
|
|
4059
4194
|
}
|
|
4060
4195
|
}
|
|
4061
4196
|
},
|
|
4062
4197
|
onKeyDown: (e) => {
|
|
4063
|
-
let t =
|
|
4198
|
+
let t = R.options.meta;
|
|
4064
4199
|
if (t?.navigateFocus) {
|
|
4065
4200
|
if (e.target.tagName === "INPUT") {
|
|
4066
4201
|
e.key === "Enter" && (e.preventDefault(), e.target.blur(), t.navigateFocus(1, 0)), e.key === "Tab" && (e.preventDefault(), e.target.blur(), t.navigateFocus(0, e.shiftKey ? -1 : 1));
|
|
@@ -4088,79 +4223,79 @@ var Yn = (e) => W(() => {
|
|
|
4088
4223
|
}
|
|
4089
4224
|
}
|
|
4090
4225
|
}
|
|
4091
|
-
}),
|
|
4226
|
+
}), ye = U((e, t) => {
|
|
4092
4227
|
if (!l) return !1;
|
|
4093
4228
|
let { start: n, end: r } = l;
|
|
4094
4229
|
return e >= Math.min(n.r, r.r) && e <= Math.max(n.r, r.r) && t >= Math.min(n.c, r.c) && t <= Math.max(n.c, r.c);
|
|
4095
|
-
}, [l]), { sensors:
|
|
4096
|
-
onDragStart:
|
|
4097
|
-
onDragEnd:
|
|
4098
|
-
collisionDetection:
|
|
4230
|
+
}, [l]), { sensors: be, onDragEnd: xe, onDragStart: Se } = lt({
|
|
4231
|
+
onDragStart: ve,
|
|
4232
|
+
onDragEnd: ge,
|
|
4233
|
+
collisionDetection: Re,
|
|
4099
4234
|
distance: 5
|
|
4100
4235
|
});
|
|
4101
|
-
return /* @__PURE__ */
|
|
4102
|
-
fallback: /* @__PURE__ */
|
|
4103
|
-
children: /* @__PURE__ */
|
|
4104
|
-
sensors:
|
|
4105
|
-
onDragEnd:
|
|
4106
|
-
onDragStart:
|
|
4107
|
-
collisionDetection:
|
|
4108
|
-
children: /* @__PURE__ */
|
|
4109
|
-
className: e(
|
|
4110
|
-
dir:
|
|
4236
|
+
return /* @__PURE__ */ X(c, {
|
|
4237
|
+
fallback: /* @__PURE__ */ X(sn, {}),
|
|
4238
|
+
children: /* @__PURE__ */ X(E, { children: /* @__PURE__ */ X(Fe, {
|
|
4239
|
+
sensors: be,
|
|
4240
|
+
onDragEnd: xe,
|
|
4241
|
+
onDragStart: Se,
|
|
4242
|
+
collisionDetection: Re,
|
|
4243
|
+
children: /* @__PURE__ */ Z("div", {
|
|
4244
|
+
className: e(bn, "w-full min-h-0 gap-3 h-full", r.className, r.classNames?.root),
|
|
4245
|
+
dir: z,
|
|
4111
4246
|
children: [
|
|
4112
|
-
r.enableGrouping && /* @__PURE__ */
|
|
4247
|
+
r.enableGrouping && /* @__PURE__ */ X(V.Suspense, {
|
|
4113
4248
|
fallback: null,
|
|
4114
|
-
children: /* @__PURE__ */
|
|
4115
|
-
grouping:
|
|
4116
|
-
onGroupingChange:
|
|
4117
|
-
columns:
|
|
4249
|
+
children: /* @__PURE__ */ X(ir, {
|
|
4250
|
+
grouping: R.getState().grouping,
|
|
4251
|
+
onGroupingChange: R.setGrouping,
|
|
4252
|
+
columns: R.getAllColumns()
|
|
4118
4253
|
})
|
|
4119
4254
|
}),
|
|
4120
|
-
r.slots?.toolbar ? /* @__PURE__ */
|
|
4121
|
-
table:
|
|
4122
|
-
globalFilter:
|
|
4255
|
+
r.slots?.toolbar ? /* @__PURE__ */ X(r.slots.toolbar, {
|
|
4256
|
+
table: R,
|
|
4257
|
+
globalFilter: _,
|
|
4123
4258
|
setGlobalFilter: O,
|
|
4124
|
-
isPending:
|
|
4125
|
-
columns:
|
|
4259
|
+
isPending: h,
|
|
4260
|
+
columns: R.getAllColumns(),
|
|
4126
4261
|
...r.slotProps?.toolbar || {}
|
|
4127
|
-
}) : /* @__PURE__ */
|
|
4128
|
-
fallback: /* @__PURE__ */
|
|
4129
|
-
children: /* @__PURE__ */
|
|
4130
|
-
globalFilter:
|
|
4131
|
-
setGlobalFilter:
|
|
4262
|
+
}) : /* @__PURE__ */ X(V.Suspense, {
|
|
4263
|
+
fallback: /* @__PURE__ */ X("div", { className: "h-10 w-full animate-pulse bg-muted/20 rounded-md" }),
|
|
4264
|
+
children: /* @__PURE__ */ X(or, {
|
|
4265
|
+
globalFilter: _,
|
|
4266
|
+
setGlobalFilter: ee,
|
|
4132
4267
|
enableAdvancedFiltering: r.enableAdvancedFiltering,
|
|
4133
4268
|
enableExport: r.enableExport,
|
|
4134
|
-
onExportExcel: r.onExportExcel ? () => r.onExportExcel(
|
|
4135
|
-
onExportCSV: r.onExportCSV ? () => r.onExportCSV(
|
|
4136
|
-
onExportPDF: r.onExportPDF ? () => r.onExportPDF(
|
|
4137
|
-
enableChangeTracking:
|
|
4269
|
+
onExportExcel: r.onExportExcel ? () => r.onExportExcel(R) : void 0,
|
|
4270
|
+
onExportCSV: r.onExportCSV ? () => r.onExportCSV(R) : void 0,
|
|
4271
|
+
onExportPDF: r.onExportPDF ? () => r.onExportPDF(R) : void 0,
|
|
4272
|
+
enableChangeTracking: F,
|
|
4138
4273
|
canUndo: u,
|
|
4139
4274
|
canRedo: d,
|
|
4140
|
-
undo:
|
|
4141
|
-
redo:
|
|
4142
|
-
columns:
|
|
4143
|
-
isPending:
|
|
4144
|
-
onAdd:
|
|
4145
|
-
onSave:
|
|
4146
|
-
onDiscard:
|
|
4147
|
-
enableEditing:
|
|
4275
|
+
undo: b,
|
|
4276
|
+
redo: x,
|
|
4277
|
+
columns: R.getAllColumns(),
|
|
4278
|
+
isPending: h,
|
|
4279
|
+
onAdd: L?.allowAdding ? ue : void 0,
|
|
4280
|
+
onSave: de,
|
|
4281
|
+
onDiscard: fe,
|
|
4282
|
+
enableEditing: I,
|
|
4148
4283
|
enableHiding: r.enableHiding,
|
|
4149
|
-
changes:
|
|
4150
|
-
table:
|
|
4284
|
+
changes: f,
|
|
4285
|
+
table: R
|
|
4151
4286
|
})
|
|
4152
4287
|
}),
|
|
4153
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ X("div", {
|
|
4154
4289
|
ref: (e) => {
|
|
4155
|
-
|
|
4290
|
+
M.current = e, o.current = e;
|
|
4156
4291
|
},
|
|
4157
4292
|
id: r.id ? `ez-table-${r.id}` : "ez-table-default",
|
|
4158
|
-
className: e("flex-1 w-full overflow-auto rounded-md bg-background focus:outline-none focus:ring-1 focus:ring-primary/20",
|
|
4159
|
-
dir:
|
|
4293
|
+
className: e("flex-1 w-full overflow-auto rounded-md bg-background focus:outline-none focus:ring-1 focus:ring-primary/20", xn.default),
|
|
4294
|
+
dir: z,
|
|
4160
4295
|
onScroll: (e) => {
|
|
4161
4296
|
if (r.enableInfiniteScroll) {
|
|
4162
4297
|
let { scrollTop: t, scrollHeight: n, clientHeight: i } = e.currentTarget;
|
|
4163
|
-
n - t - i < 50 &&
|
|
4298
|
+
n - t - i < 50 && R.getCanNextPage() && !r.isLoading && R.nextPage();
|
|
4164
4299
|
}
|
|
4165
4300
|
},
|
|
4166
4301
|
role: "table",
|
|
@@ -4171,39 +4306,39 @@ var Yn = (e) => W(() => {
|
|
|
4171
4306
|
minHeight: "0",
|
|
4172
4307
|
WebkitOverflowScrolling: "touch"
|
|
4173
4308
|
},
|
|
4174
|
-
onKeyDown:
|
|
4175
|
-
children: /* @__PURE__ */
|
|
4309
|
+
onKeyDown: _e,
|
|
4310
|
+
children: /* @__PURE__ */ Z("div", {
|
|
4176
4311
|
className: "flex flex-col w-full min-w-max",
|
|
4177
4312
|
role: "presentation",
|
|
4178
4313
|
style: {
|
|
4179
|
-
...
|
|
4314
|
+
...ce,
|
|
4180
4315
|
minHeight: "100%"
|
|
4181
4316
|
},
|
|
4182
4317
|
children: [
|
|
4183
|
-
/* @__PURE__ */
|
|
4184
|
-
table:
|
|
4185
|
-
enableStickyHeader:
|
|
4318
|
+
/* @__PURE__ */ X(Un, {
|
|
4319
|
+
table: R,
|
|
4320
|
+
enableStickyHeader: te,
|
|
4186
4321
|
classNames: r.classNames,
|
|
4187
|
-
density:
|
|
4188
|
-
autoFitColumn:
|
|
4322
|
+
density: m,
|
|
4323
|
+
autoFitColumn: w,
|
|
4189
4324
|
slots: r.slots,
|
|
4190
|
-
columnPinning:
|
|
4191
|
-
columnSizing:
|
|
4192
|
-
sorting:
|
|
4193
|
-
grouping:
|
|
4194
|
-
columnVisibility:
|
|
4195
|
-
columnOrder:
|
|
4325
|
+
columnPinning: R.getState().columnPinning,
|
|
4326
|
+
columnSizing: R.getState().columnSizing,
|
|
4327
|
+
sorting: R.getState().sorting,
|
|
4328
|
+
grouping: R.getState().grouping,
|
|
4329
|
+
columnVisibility: R.getState().columnVisibility,
|
|
4330
|
+
columnOrder: R.getState().columnOrder
|
|
4196
4331
|
}),
|
|
4197
|
-
/* @__PURE__ */
|
|
4198
|
-
table:
|
|
4332
|
+
/* @__PURE__ */ X(Yn, {
|
|
4333
|
+
table: R,
|
|
4199
4334
|
rows: s,
|
|
4200
|
-
rowVirtualizer:
|
|
4201
|
-
columnVirtualizer:
|
|
4202
|
-
density:
|
|
4335
|
+
rowVirtualizer: N,
|
|
4336
|
+
columnVirtualizer: P,
|
|
4337
|
+
density: m,
|
|
4203
4338
|
classNames: r.classNames,
|
|
4204
4339
|
isLoading: r.isLoading,
|
|
4205
4340
|
enableInfiniteScroll: r.enableInfiniteScroll,
|
|
4206
|
-
isPending:
|
|
4341
|
+
isPending: h,
|
|
4207
4342
|
renderNoRowsOverlay: r.renderNoRowsOverlay,
|
|
4208
4343
|
slots: r.slots,
|
|
4209
4344
|
localization: r.localization,
|
|
@@ -4212,79 +4347,79 @@ var Yn = (e) => W(() => {
|
|
|
4212
4347
|
action: e,
|
|
4213
4348
|
data: t
|
|
4214
4349
|
}) : void 0,
|
|
4215
|
-
isCellSelected:
|
|
4216
|
-
focusedCell:
|
|
4217
|
-
onCellMouseDown:
|
|
4350
|
+
isCellSelected: ye,
|
|
4351
|
+
focusedCell: g,
|
|
4352
|
+
onCellMouseDown: T,
|
|
4218
4353
|
onCellMouseEnter: D,
|
|
4219
|
-
onCellClick:
|
|
4220
|
-
onCellDoubleClick:
|
|
4354
|
+
onCellClick: oe,
|
|
4355
|
+
onCellDoubleClick: se,
|
|
4221
4356
|
renderDetailPanel: r.renderDetailPanel,
|
|
4222
|
-
dynamicRowSizing:
|
|
4223
|
-
onRowClick:
|
|
4224
|
-
onRowDoubleClick:
|
|
4357
|
+
dynamicRowSizing: ne,
|
|
4358
|
+
onRowClick: q,
|
|
4359
|
+
onRowDoubleClick: J
|
|
4225
4360
|
}),
|
|
4226
|
-
r.slots?.footer ? /* @__PURE__ */
|
|
4227
|
-
table:
|
|
4361
|
+
r.slots?.footer ? /* @__PURE__ */ X(r.slots.footer, {
|
|
4362
|
+
table: R,
|
|
4228
4363
|
...r.slotProps?.footer || {}
|
|
4229
|
-
}) : /* @__PURE__ */
|
|
4364
|
+
}) : /* @__PURE__ */ X(V.Suspense, {
|
|
4230
4365
|
fallback: null,
|
|
4231
|
-
children: /* @__PURE__ */
|
|
4232
|
-
table:
|
|
4233
|
-
columnVirtualizer:
|
|
4234
|
-
density:
|
|
4366
|
+
children: /* @__PURE__ */ X(sr, {
|
|
4367
|
+
table: R,
|
|
4368
|
+
columnVirtualizer: P,
|
|
4369
|
+
density: m
|
|
4235
4370
|
})
|
|
4236
4371
|
})
|
|
4237
4372
|
]
|
|
4238
4373
|
})
|
|
4239
4374
|
}),
|
|
4240
|
-
r.pagination && /* @__PURE__ */
|
|
4241
|
-
table:
|
|
4242
|
-
pagerMessage:
|
|
4375
|
+
r.pagination && /* @__PURE__ */ X(Zn, {
|
|
4376
|
+
table: R,
|
|
4377
|
+
pagerMessage: v,
|
|
4243
4378
|
enableStickyPagination: r.enableStickyPagination,
|
|
4244
4379
|
classNames: r.classNames,
|
|
4245
4380
|
localization: r.localization,
|
|
4246
|
-
changes:
|
|
4381
|
+
changes: f
|
|
4247
4382
|
}),
|
|
4248
|
-
r.enableStatusBar === !0 && /* @__PURE__ */
|
|
4249
|
-
table:
|
|
4250
|
-
totalRows:
|
|
4251
|
-
selectionInfo:
|
|
4252
|
-
rowSelection:
|
|
4383
|
+
r.enableStatusBar === !0 && /* @__PURE__ */ X(Cn, {
|
|
4384
|
+
table: R,
|
|
4385
|
+
totalRows: R.options.rowCount ?? R.getPrePaginationRowModel().rows.length,
|
|
4386
|
+
selectionInfo: f.added + f.edited + f.deleted > 0 ? `${f.added + f.edited + f.deleted} pending changes` : void 0,
|
|
4387
|
+
rowSelection: R.getState().rowSelection
|
|
4253
4388
|
}),
|
|
4254
|
-
|
|
4389
|
+
L?.mode === "Dialog" && /* @__PURE__ */ X(V.Suspense, {
|
|
4255
4390
|
fallback: null,
|
|
4256
|
-
children: /* @__PURE__ */
|
|
4257
|
-
open:
|
|
4391
|
+
children: /* @__PURE__ */ X(ar, {
|
|
4392
|
+
open: Y.isOpen,
|
|
4258
4393
|
onClose: () => {
|
|
4259
|
-
|
|
4394
|
+
Y.close(), Y.mode !== "create" && Y.meta.index !== void 0 && C(Y.meta.index, !1);
|
|
4260
4395
|
},
|
|
4261
|
-
onSave:
|
|
4262
|
-
columns:
|
|
4263
|
-
initialData:
|
|
4264
|
-
isNew:
|
|
4396
|
+
onSave: le,
|
|
4397
|
+
columns: R.getAllColumns(),
|
|
4398
|
+
initialData: Y.data,
|
|
4399
|
+
isNew: Y.mode === "create",
|
|
4265
4400
|
onFormRender: r.onFormRender
|
|
4266
4401
|
})
|
|
4267
4402
|
}),
|
|
4268
|
-
/* @__PURE__ */
|
|
4403
|
+
/* @__PURE__ */ X(Ie, {
|
|
4269
4404
|
dropAnimation: null,
|
|
4270
|
-
children:
|
|
4271
|
-
header:
|
|
4272
|
-
density:
|
|
4405
|
+
children: me ? /* @__PURE__ */ X(Sn, {
|
|
4406
|
+
header: R.getFlatHeaders().find((e) => e.id === me) || R.getLeafHeaders().find((e) => e.id === me),
|
|
4407
|
+
density: m
|
|
4273
4408
|
}) : null
|
|
4274
4409
|
})
|
|
4275
4410
|
]
|
|
4276
4411
|
})
|
|
4277
4412
|
}) })
|
|
4278
4413
|
});
|
|
4279
|
-
},
|
|
4280
|
-
function
|
|
4281
|
-
return d(), /* @__PURE__ */
|
|
4282
|
-
client:
|
|
4283
|
-
children: /* @__PURE__ */
|
|
4414
|
+
}, lr = cr, ur = new We();
|
|
4415
|
+
function dr({ ref: e, ...t }) {
|
|
4416
|
+
return d(), /* @__PURE__ */ X(Ge, {
|
|
4417
|
+
client: ur,
|
|
4418
|
+
children: /* @__PURE__ */ X(cr, {
|
|
4284
4419
|
...t,
|
|
4285
4420
|
ref: e
|
|
4286
4421
|
})
|
|
4287
4422
|
});
|
|
4288
4423
|
}
|
|
4289
4424
|
//#endregion
|
|
4290
|
-
export {
|
|
4425
|
+
export { yt as A, Tt as C, bt as D, wt as E, xt as O, kt as S, Dt as T, It as _, rr as a, Lt as b, Ut as c, Vt as d, Rt as f, jt as g, Pt as h, tr as i, mt as j, Ct as k, zt as l, Nt as m, lr as n, nn as o, At as p, nr as r, Ht as s, dr as t, Bt as u, Mt as v, Et as w, Ot as x, Ft as y };
|