@devalok/shilp-sutra 0.16.0 → 0.16.1
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/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +321 -306
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/ui/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EACL,KAAK,SAAS,EAkBf,MAAM,uBAAuB,CAAA;AAwB9B,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAWrE,yDAAyD;AACzD,MAAM,WAAW,UAAU,CAAC,KAAK;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,IAAI,CAAA;IACxC,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK,EAAE,MAAM;IAC3C,kDAAkD;IAClD,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAA;IACnC,eAAe;IACf,IAAI,EAAE,KAAK,EAAE,CAAA;IACb,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CA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s as
|
|
3
|
-
import
|
|
4
|
-
import { useReactTable as
|
|
5
|
-
import { useVirtualizer as
|
|
6
|
-
import { IconArrowUp as
|
|
7
|
-
import { Table as
|
|
8
|
-
import { B as
|
|
9
|
-
import { C as
|
|
10
|
-
import { Skeleton as
|
|
11
|
-
import { c as
|
|
12
|
-
import { DataTableToolbar as
|
|
13
|
-
const
|
|
2
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import Pe, { useState as u, useRef as B, useEffect as D, useCallback as V, useMemo as et } from "react";
|
|
4
|
+
import { useReactTable as tt, getExpandedRowModel as lt, getPaginationRowModel as nt, getFilteredRowModel as ot, getSortedRowModel as st, getCoreRowModel as at, flexRender as ee } from "@tanstack/react-table";
|
|
5
|
+
import { useVirtualizer as rt } from "@tanstack/react-virtual";
|
|
6
|
+
import { IconArrowUp as ct, IconArrowDown as dt, IconArrowsSort as it, IconSearch as ut, IconChevronLeft as mt, IconChevronRight as ye, IconX as ft } from "@tabler/icons-react";
|
|
7
|
+
import { Table as gt, TableHeader as ht, TableRow as z, TableHead as Se, TableBody as H, TableCell as O } from "./table.js";
|
|
8
|
+
import { B as pt } from "../_chunks/button.js";
|
|
9
|
+
import { C as Ce } from "../_chunks/checkbox.js";
|
|
10
|
+
import { Skeleton as Ne } from "./skeleton.js";
|
|
11
|
+
import { c as a } from "../_chunks/utils.js";
|
|
12
|
+
import { DataTableToolbar as bt } from "./data-table-toolbar.js";
|
|
13
|
+
const xt = {
|
|
14
14
|
compact: "py-ds-02",
|
|
15
15
|
standard: "py-ds-05",
|
|
16
16
|
comfortable: "py-ds-07"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
initialValue:
|
|
20
|
-
onSave:
|
|
21
|
-
onCancel:
|
|
18
|
+
function yt({
|
|
19
|
+
initialValue: A,
|
|
20
|
+
onSave: m,
|
|
21
|
+
onCancel: K
|
|
22
22
|
}) {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
var i,
|
|
26
|
-
(i =
|
|
23
|
+
const [I, S] = u(A), h = B(null);
|
|
24
|
+
D(() => {
|
|
25
|
+
var i, E;
|
|
26
|
+
(i = h.current) == null || i.focus(), (E = h.current) == null || E.select();
|
|
27
27
|
}, []);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
return /* @__PURE__ */
|
|
28
|
+
const p = V(() => {
|
|
29
|
+
m(I);
|
|
30
|
+
}, [m, I]);
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
32
|
"input",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: h,
|
|
35
35
|
type: "text",
|
|
36
|
-
value:
|
|
37
|
-
onChange: (i) =>
|
|
38
|
-
onBlur:
|
|
36
|
+
value: I,
|
|
37
|
+
onChange: (i) => S(i.target.value),
|
|
38
|
+
onBlur: p,
|
|
39
39
|
onKeyDown: (i) => {
|
|
40
|
-
i.key === "Enter" ? (i.preventDefault(),
|
|
40
|
+
i.key === "Enter" ? (i.preventDefault(), p()) : i.key === "Escape" && (i.preventDefault(), K());
|
|
41
41
|
},
|
|
42
|
-
className:
|
|
42
|
+
className: a(
|
|
43
43
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
44
44
|
"border border-border-interactive bg-field",
|
|
45
45
|
"px-ds-02 text-ds-sm",
|
|
@@ -50,93 +50,97 @@ function bt({
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
columns:
|
|
56
|
-
data:
|
|
57
|
-
className:
|
|
58
|
-
noResultsText:
|
|
59
|
-
sortable:
|
|
60
|
-
filterable:
|
|
61
|
-
globalFilter:
|
|
53
|
+
const St = 'button, a, input, select, textarea, [role="checkbox"]';
|
|
54
|
+
function Ct({
|
|
55
|
+
columns: A,
|
|
56
|
+
data: m,
|
|
57
|
+
className: K,
|
|
58
|
+
noResultsText: I,
|
|
59
|
+
sortable: S = !1,
|
|
60
|
+
filterable: h = !1,
|
|
61
|
+
globalFilter: p = !1,
|
|
62
62
|
paginated: i = !1,
|
|
63
|
-
pageSize:
|
|
64
|
-
pageSizeOptions:
|
|
65
|
-
selectable:
|
|
66
|
-
onSelectionChange:
|
|
67
|
-
toolbar:
|
|
68
|
-
density:
|
|
69
|
-
columnPinning:
|
|
70
|
-
editable:
|
|
71
|
-
onCellEdit:
|
|
72
|
-
expandable:
|
|
73
|
-
renderExpanded:
|
|
74
|
-
virtualRows:
|
|
75
|
-
virtualRowHeight:
|
|
76
|
-
maxHeight:
|
|
77
|
-
onSort:
|
|
78
|
-
emptyState:
|
|
79
|
-
loading:
|
|
80
|
-
selectedIds:
|
|
81
|
-
selectableFilter:
|
|
82
|
-
getRowId:
|
|
63
|
+
pageSize: E,
|
|
64
|
+
pageSizeOptions: we,
|
|
65
|
+
selectable: C = !1,
|
|
66
|
+
onSelectionChange: G,
|
|
67
|
+
toolbar: te = !1,
|
|
68
|
+
density: ke = "standard",
|
|
69
|
+
columnPinning: N,
|
|
70
|
+
editable: Re = !1,
|
|
71
|
+
onCellEdit: L,
|
|
72
|
+
expandable: j = !1,
|
|
73
|
+
renderExpanded: le,
|
|
74
|
+
virtualRows: b = !1,
|
|
75
|
+
virtualRowHeight: ze = 48,
|
|
76
|
+
maxHeight: De = 600,
|
|
77
|
+
onSort: T,
|
|
78
|
+
emptyState: ne,
|
|
79
|
+
loading: Ie = !1,
|
|
80
|
+
selectedIds: Y,
|
|
81
|
+
selectableFilter: oe,
|
|
82
|
+
getRowId: g,
|
|
83
83
|
pagination: o,
|
|
84
|
-
singleExpand:
|
|
85
|
-
stickyHeader:
|
|
86
|
-
onRowClick:
|
|
87
|
-
bulkActions:
|
|
84
|
+
singleExpand: U = !1,
|
|
85
|
+
stickyHeader: Ee = !1,
|
|
86
|
+
onRowClick: F,
|
|
87
|
+
bulkActions: $
|
|
88
88
|
}) {
|
|
89
|
-
const [
|
|
89
|
+
const [Te, se] = u([]), [Fe, Me] = u([]), [W, X] = u(""), [Ve, q] = u({
|
|
90
90
|
pageIndex: o ? o.page - 1 : 0,
|
|
91
|
-
pageSize: (o == null ? void 0 : o.pageSize) ??
|
|
92
|
-
}), [
|
|
93
|
-
left: (
|
|
94
|
-
right: (
|
|
95
|
-
}), [
|
|
96
|
-
|
|
97
|
-
if (
|
|
91
|
+
pageSize: (o == null ? void 0 : o.pageSize) ?? E ?? 10
|
|
92
|
+
}), [x, ae] = u({}), [je, $e] = u({}), [re, _e] = u({
|
|
93
|
+
left: (N == null ? void 0 : N.left) ?? [],
|
|
94
|
+
right: (N == null ? void 0 : N.right) ?? []
|
|
95
|
+
}), [ce, He] = u(ke), [w, J] = u(null), [Oe, de] = u({}), ie = B(null);
|
|
96
|
+
D(() => {
|
|
97
|
+
if (Y) {
|
|
98
98
|
const e = {};
|
|
99
|
-
|
|
99
|
+
Y.forEach((t) => {
|
|
100
100
|
e[t] = !0;
|
|
101
|
-
}),
|
|
101
|
+
}), ae(e);
|
|
102
102
|
}
|
|
103
|
-
}, [
|
|
104
|
-
o &&
|
|
103
|
+
}, [Y]), D(() => {
|
|
104
|
+
o && q((e) => ({
|
|
105
105
|
...e,
|
|
106
106
|
pageIndex: o.page - 1,
|
|
107
107
|
pageSize: o.pageSize
|
|
108
108
|
}));
|
|
109
109
|
}, [o == null ? void 0 : o.page, o == null ? void 0 : o.pageSize]);
|
|
110
|
-
const
|
|
110
|
+
const Be = V(
|
|
111
111
|
(e) => {
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
return
|
|
112
|
+
se((t) => {
|
|
113
|
+
const l = typeof e == "function" ? e(t) : e;
|
|
114
|
+
return T && (l.length === 0 && t.length > 0 ? T(t[0].id, !1) : l.length > 0 && T(l[0].id, l[0].desc ? "desc" : "asc")), l;
|
|
115
115
|
});
|
|
116
116
|
},
|
|
117
|
-
[
|
|
118
|
-
),
|
|
117
|
+
[T]
|
|
118
|
+
), Ae = V(
|
|
119
119
|
(e) => {
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
123
|
-
const s = typeof t == "object" ? Object.keys(t).filter((
|
|
124
|
-
return
|
|
120
|
+
de((t) => {
|
|
121
|
+
const l = typeof e == "function" ? e(t) : e;
|
|
122
|
+
if (!U || l === !0 || typeof l != "object") return l;
|
|
123
|
+
const s = typeof t == "object" ? Object.keys(t).filter((f) => t[f]) : [], R = Object.keys(l).filter((f) => l[f]).filter((f) => !s.includes(f));
|
|
124
|
+
return R.length > 0 ? { [R[R.length - 1]]: !0 } : l;
|
|
125
125
|
});
|
|
126
126
|
},
|
|
127
|
-
[
|
|
128
|
-
),
|
|
127
|
+
[U]
|
|
128
|
+
), Q = B(o == null ? void 0 : o.onPageChange);
|
|
129
|
+
D(() => {
|
|
130
|
+
Q.current = o == null ? void 0 : o.onPageChange;
|
|
131
|
+
}, [o == null ? void 0 : o.onPageChange]);
|
|
132
|
+
const Ke = V(
|
|
129
133
|
(e) => {
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
return
|
|
134
|
+
q((t) => {
|
|
135
|
+
const l = typeof e == "function" ? e(t) : e;
|
|
136
|
+
return Q.current && l.pageIndex !== t.pageIndex && Q.current(l.pageIndex + 1), l;
|
|
133
137
|
});
|
|
134
138
|
},
|
|
135
|
-
[
|
|
136
|
-
),
|
|
139
|
+
[]
|
|
140
|
+
), Ge = {
|
|
137
141
|
id: "_select",
|
|
138
|
-
header: ({ table: e }) => /* @__PURE__ */
|
|
139
|
-
|
|
142
|
+
header: ({ table: e }) => /* @__PURE__ */ n(
|
|
143
|
+
Ce,
|
|
140
144
|
{
|
|
141
145
|
checked: e.getIsAllPageRowsSelected(),
|
|
142
146
|
indeterminate: e.getIsSomePageRowsSelected(),
|
|
@@ -144,8 +148,8 @@ function yt({
|
|
|
144
148
|
"aria-label": "Select all rows"
|
|
145
149
|
}
|
|
146
150
|
),
|
|
147
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
148
|
-
|
|
151
|
+
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
152
|
+
Ce,
|
|
149
153
|
{
|
|
150
154
|
checked: e.getIsSelected(),
|
|
151
155
|
disabled: !e.getCanSelect(),
|
|
@@ -156,21 +160,21 @@ function yt({
|
|
|
156
160
|
enableSorting: !1,
|
|
157
161
|
enableColumnFilter: !1,
|
|
158
162
|
enableHiding: !1
|
|
159
|
-
},
|
|
163
|
+
}, Le = {
|
|
160
164
|
id: "_expand",
|
|
161
165
|
header: () => null,
|
|
162
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
166
|
+
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
163
167
|
"button",
|
|
164
168
|
{
|
|
165
169
|
type: "button",
|
|
166
170
|
onClick: () => e.toggleExpanded(),
|
|
167
171
|
"aria-label": e.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
168
172
|
className: "flex items-center justify-center p-ds-01 rounded-ds-sm hover:bg-layer-02 transition-colors",
|
|
169
|
-
children: /* @__PURE__ */
|
|
170
|
-
|
|
173
|
+
children: /* @__PURE__ */ n(
|
|
174
|
+
ye,
|
|
171
175
|
{
|
|
172
176
|
size: 16,
|
|
173
|
-
className:
|
|
177
|
+
className: a(
|
|
174
178
|
"transition-transform duration-moderate-02",
|
|
175
179
|
e.getIsExpanded() && "rotate-90"
|
|
176
180
|
),
|
|
@@ -182,125 +186,129 @@ function yt({
|
|
|
182
186
|
enableSorting: !1,
|
|
183
187
|
enableColumnFilter: !1,
|
|
184
188
|
enableHiding: !1
|
|
185
|
-
},
|
|
186
|
-
...
|
|
187
|
-
...
|
|
188
|
-
...
|
|
189
|
-
],
|
|
190
|
-
columnVisibility:
|
|
191
|
-
columnPinning:
|
|
189
|
+
}, k = [
|
|
190
|
+
...C ? [Ge] : [],
|
|
191
|
+
...j ? [Le] : [],
|
|
192
|
+
...A
|
|
193
|
+
], M = !!o, Z = i || M, y = {
|
|
194
|
+
columnVisibility: je,
|
|
195
|
+
columnPinning: re
|
|
192
196
|
};
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
data:
|
|
196
|
-
columns:
|
|
197
|
-
state:
|
|
198
|
-
onColumnVisibilityChange:
|
|
199
|
-
onColumnPinningChange:
|
|
200
|
-
getCoreRowModel:
|
|
201
|
-
...
|
|
202
|
-
onSortingChange:
|
|
203
|
-
...
|
|
197
|
+
S && (y.sorting = Te), (h || p) && (y.columnFilters = Fe, y.globalFilter = W), Z && (y.pagination = Ve), C && (y.rowSelection = x), j && (y.expanded = Oe);
|
|
198
|
+
const ue = S && !!T, r = tt({
|
|
199
|
+
data: m,
|
|
200
|
+
columns: k,
|
|
201
|
+
state: y,
|
|
202
|
+
onColumnVisibilityChange: $e,
|
|
203
|
+
onColumnPinningChange: _e,
|
|
204
|
+
getCoreRowModel: at(),
|
|
205
|
+
...S && {
|
|
206
|
+
onSortingChange: ue ? Be : se,
|
|
207
|
+
...ue ? { manualSorting: !0 } : { getSortedRowModel: st() }
|
|
204
208
|
},
|
|
205
|
-
...(
|
|
206
|
-
onColumnFiltersChange:
|
|
207
|
-
onGlobalFilterChange:
|
|
208
|
-
getFilteredRowModel:
|
|
209
|
+
...(h || p) && {
|
|
210
|
+
onColumnFiltersChange: Me,
|
|
211
|
+
onGlobalFilterChange: X,
|
|
212
|
+
getFilteredRowModel: ot()
|
|
209
213
|
},
|
|
210
|
-
...
|
|
211
|
-
onPaginationChange:
|
|
212
|
-
...
|
|
214
|
+
...Z && {
|
|
215
|
+
onPaginationChange: M ? Ke : q,
|
|
216
|
+
...M ? {
|
|
213
217
|
manualPagination: !0,
|
|
214
218
|
pageCount: Math.ceil(
|
|
215
219
|
o.total / o.pageSize
|
|
216
220
|
)
|
|
217
|
-
} : { getPaginationRowModel:
|
|
221
|
+
} : { getPaginationRowModel: nt() }
|
|
218
222
|
},
|
|
219
|
-
...
|
|
220
|
-
onRowSelectionChange:
|
|
221
|
-
enableRowSelection:
|
|
223
|
+
...C && {
|
|
224
|
+
onRowSelectionChange: ae,
|
|
225
|
+
enableRowSelection: oe ? (e) => oe(e.original) : !0
|
|
222
226
|
},
|
|
223
|
-
...
|
|
224
|
-
onExpandedChange:
|
|
225
|
-
getExpandedRowModel:
|
|
227
|
+
...j && {
|
|
228
|
+
onExpandedChange: U ? Ae : de,
|
|
229
|
+
getExpandedRowModel: lt()
|
|
226
230
|
},
|
|
227
|
-
...
|
|
228
|
-
getRowId: (e) =>
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
_(() => {
|
|
232
|
-
if (B) {
|
|
233
|
-
const e = a.getFilteredSelectedRowModel().rows.map((t) => t.original);
|
|
234
|
-
B(e);
|
|
231
|
+
...g && {
|
|
232
|
+
getRowId: (e) => g(e)
|
|
235
233
|
}
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
|
|
234
|
+
}), v = B(G);
|
|
235
|
+
D(() => {
|
|
236
|
+
v.current = G;
|
|
237
|
+
}, [G]), D(() => {
|
|
238
|
+
if (!v.current) return;
|
|
239
|
+
const e = Object.keys(x).filter((l) => x[l]), t = m.filter((l, s) => {
|
|
240
|
+
const c = g ? g(m[s]) : String(s);
|
|
241
|
+
return e.includes(c);
|
|
242
|
+
});
|
|
243
|
+
v.current(t);
|
|
244
|
+
}, [x, m, g]);
|
|
245
|
+
function me(e) {
|
|
246
|
+
const { left: t = [], right: l = [] } = re, s = t.indexOf(e), c = l.indexOf(e);
|
|
239
247
|
return s !== -1 ? {
|
|
240
248
|
className: "sticky bg-layer-01 z-raised",
|
|
241
249
|
style: { left: 0 }
|
|
242
|
-
} :
|
|
250
|
+
} : c !== -1 ? {
|
|
243
251
|
className: "sticky bg-layer-01 z-raised",
|
|
244
252
|
style: { right: 0 }
|
|
245
253
|
} : { className: "", style: {} };
|
|
246
254
|
}
|
|
247
|
-
function
|
|
248
|
-
if (!
|
|
249
|
-
const t =
|
|
255
|
+
function Ye(e) {
|
|
256
|
+
if (!Re || e === "_select" || e === "_expand") return !1;
|
|
257
|
+
const t = r.getColumn(e);
|
|
250
258
|
if (!t) return !1;
|
|
251
|
-
const
|
|
252
|
-
return (
|
|
259
|
+
const l = t.columnDef.meta;
|
|
260
|
+
return (l == null ? void 0 : l.enableEditing) !== !1;
|
|
253
261
|
}
|
|
254
|
-
const
|
|
255
|
-
count:
|
|
256
|
-
getScrollElement: () =>
|
|
257
|
-
estimateSize: () =>
|
|
262
|
+
const fe = xt[ce], _ = r.getRowModel().rows, ge = rt({
|
|
263
|
+
count: b ? _.length : 0,
|
|
264
|
+
getScrollElement: () => ie.current,
|
|
265
|
+
estimateSize: () => ze,
|
|
258
266
|
overscan: 10
|
|
259
|
-
}),
|
|
267
|
+
}), Ue = (o == null ? void 0 : o.pageSize) ?? E ?? 5, We = k.length, Xe = V(
|
|
260
268
|
(e, t) => {
|
|
261
|
-
!
|
|
269
|
+
!F || t.target.closest(St) || F(e);
|
|
262
270
|
},
|
|
263
|
-
[
|
|
271
|
+
[F]
|
|
264
272
|
);
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
return /* @__PURE__ */
|
|
268
|
-
|
|
273
|
+
function he(e, t) {
|
|
274
|
+
const l = e.getVisibleCells();
|
|
275
|
+
return /* @__PURE__ */ n(
|
|
276
|
+
z,
|
|
269
277
|
{
|
|
270
278
|
"data-state": e.getIsSelected() && "selected",
|
|
271
279
|
style: t,
|
|
272
|
-
className:
|
|
273
|
-
|
|
274
|
-
|
|
280
|
+
className: a(
|
|
281
|
+
b ? "absolute w-full flex" : void 0,
|
|
282
|
+
F && "cursor-pointer"
|
|
275
283
|
),
|
|
276
|
-
onClick:
|
|
277
|
-
children:
|
|
278
|
-
const
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
|
|
284
|
+
onClick: F ? (s) => Xe(e.original, s) : void 0,
|
|
285
|
+
children: l.map((s) => {
|
|
286
|
+
const c = me(s.column.id), R = (w == null ? void 0 : w.rowIndex) === e.index && (w == null ? void 0 : w.columnId) === s.column.id;
|
|
287
|
+
return /* @__PURE__ */ n(
|
|
288
|
+
O,
|
|
281
289
|
{
|
|
282
|
-
className:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
290
|
+
className: a(
|
|
291
|
+
fe,
|
|
292
|
+
c.className,
|
|
293
|
+
b && "flex-1"
|
|
286
294
|
),
|
|
287
|
-
style:
|
|
295
|
+
style: c.style,
|
|
288
296
|
onDoubleClick: () => {
|
|
289
|
-
|
|
297
|
+
Ye(s.column.id) && J({
|
|
290
298
|
rowIndex: e.index,
|
|
291
299
|
columnId: s.column.id
|
|
292
300
|
});
|
|
293
301
|
},
|
|
294
|
-
children:
|
|
295
|
-
|
|
302
|
+
children: R ? /* @__PURE__ */ n(
|
|
303
|
+
yt,
|
|
296
304
|
{
|
|
297
305
|
initialValue: String(s.getValue() ?? ""),
|
|
298
|
-
onSave: (
|
|
299
|
-
|
|
306
|
+
onSave: (f) => {
|
|
307
|
+
L == null || L(e.index, s.column.id, f), J(null);
|
|
300
308
|
},
|
|
301
|
-
onCancel: () =>
|
|
309
|
+
onCancel: () => J(null)
|
|
302
310
|
}
|
|
303
|
-
) :
|
|
311
|
+
) : ee(s.column.columnDef.cell, s.getContext())
|
|
304
312
|
},
|
|
305
313
|
s.id
|
|
306
314
|
);
|
|
@@ -309,105 +317,112 @@ function yt({
|
|
|
309
317
|
e.id
|
|
310
318
|
);
|
|
311
319
|
}
|
|
312
|
-
function
|
|
313
|
-
return !
|
|
314
|
-
|
|
320
|
+
function qe(e, t) {
|
|
321
|
+
return !j || !e.getIsExpanded() || !le ? null : /* @__PURE__ */ n(
|
|
322
|
+
z,
|
|
315
323
|
{
|
|
316
324
|
style: t,
|
|
317
|
-
className:
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
|
|
325
|
+
className: b ? "absolute w-full flex" : void 0,
|
|
326
|
+
children: /* @__PURE__ */ n(
|
|
327
|
+
O,
|
|
320
328
|
{
|
|
321
|
-
colSpan:
|
|
322
|
-
className:
|
|
329
|
+
colSpan: k.length,
|
|
330
|
+
className: a(
|
|
323
331
|
"bg-layer-02 p-ds-05",
|
|
324
|
-
|
|
332
|
+
b && "flex-1"
|
|
325
333
|
),
|
|
326
|
-
children:
|
|
334
|
+
children: le(e.original)
|
|
327
335
|
}
|
|
328
336
|
)
|
|
329
337
|
},
|
|
330
338
|
`${e.id}-expanded`
|
|
331
339
|
);
|
|
332
340
|
}
|
|
333
|
-
function
|
|
341
|
+
function Je() {
|
|
334
342
|
const e = ["w-3/4", "w-1/2", "w-2/3", "w-full"];
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
var
|
|
337
|
-
const
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
|
|
343
|
+
return /* @__PURE__ */ n(H, { children: Array.from({ length: Ue }, (t, l) => /* @__PURE__ */ n(z, { children: Array.from({ length: We }, (s, c) => {
|
|
344
|
+
var be, xe;
|
|
345
|
+
const f = (((be = k[c]) == null ? void 0 : be.id) ?? ((xe = k[c]) == null ? void 0 : xe.header)) === "_select";
|
|
346
|
+
return /* @__PURE__ */ n(
|
|
347
|
+
O,
|
|
340
348
|
{
|
|
341
|
-
className:
|
|
342
|
-
children:
|
|
349
|
+
className: fe,
|
|
350
|
+
children: f ? /* @__PURE__ */ n(Ne, { variant: "text", className: "h-4 w-4", animation: "pulse" }) : /* @__PURE__ */ n(Ne, { variant: "text", className: a("h-4", e[c % e.length]), animation: "pulse" })
|
|
343
351
|
},
|
|
344
|
-
`skeleton-${
|
|
352
|
+
`skeleton-${l}-${c}`
|
|
345
353
|
);
|
|
346
|
-
}) }, `skeleton-${
|
|
354
|
+
}) }, `skeleton-${l}`)) });
|
|
347
355
|
}
|
|
348
|
-
function
|
|
349
|
-
if (
|
|
350
|
-
return
|
|
351
|
-
if (!
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
|
|
356
|
+
function Qe() {
|
|
357
|
+
if (Ie)
|
|
358
|
+
return Je();
|
|
359
|
+
if (!_.length)
|
|
360
|
+
return /* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
|
|
361
|
+
O,
|
|
354
362
|
{
|
|
355
|
-
colSpan:
|
|
356
|
-
className:
|
|
363
|
+
colSpan: k.length,
|
|
364
|
+
className: a(
|
|
357
365
|
"h-24 text-center",
|
|
358
|
-
!
|
|
366
|
+
!ne && "text-text-tertiary"
|
|
359
367
|
),
|
|
360
|
-
children:
|
|
368
|
+
children: ne || I || "No results."
|
|
361
369
|
}
|
|
362
370
|
) }) });
|
|
363
|
-
if (
|
|
364
|
-
const e =
|
|
365
|
-
return /* @__PURE__ */
|
|
366
|
-
|
|
371
|
+
if (b) {
|
|
372
|
+
const e = ge.getVirtualItems(), t = ge.getTotalSize();
|
|
373
|
+
return /* @__PURE__ */ n(
|
|
374
|
+
H,
|
|
367
375
|
{
|
|
368
376
|
style: {
|
|
369
377
|
height: `${t}px`,
|
|
370
378
|
position: "relative"
|
|
371
379
|
},
|
|
372
|
-
children: e.map((
|
|
373
|
-
const s =
|
|
374
|
-
return
|
|
380
|
+
children: e.map((l) => {
|
|
381
|
+
const s = _[l.index];
|
|
382
|
+
return he(s, {
|
|
375
383
|
position: "absolute",
|
|
376
384
|
top: 0,
|
|
377
385
|
left: 0,
|
|
378
386
|
width: "100%",
|
|
379
|
-
height: `${
|
|
380
|
-
transform: `translateY(${
|
|
387
|
+
height: `${l.size}px`,
|
|
388
|
+
transform: `translateY(${l.start}px)`
|
|
381
389
|
});
|
|
382
390
|
})
|
|
383
391
|
}
|
|
384
392
|
);
|
|
385
393
|
}
|
|
386
|
-
return /* @__PURE__ */
|
|
387
|
-
|
|
388
|
-
|
|
394
|
+
return /* @__PURE__ */ n(H, { children: _.map((e) => /* @__PURE__ */ d(Pe.Fragment, { children: [
|
|
395
|
+
he(e),
|
|
396
|
+
qe(e)
|
|
389
397
|
] }, e.id)) });
|
|
390
398
|
}
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
399
|
+
const P = et(() => {
|
|
400
|
+
if (!$ || !C) return [];
|
|
401
|
+
const e = Object.keys(x).filter((t) => x[t]);
|
|
402
|
+
return m.filter((t, l) => {
|
|
403
|
+
const s = g ? g(m[l]) : String(l);
|
|
404
|
+
return e.includes(s);
|
|
405
|
+
});
|
|
406
|
+
}, [$, C, x, m, g]), Ze = P.length > 0, ve = M ? o.total : r.getFilteredRowModel().rows.length, pe = /* @__PURE__ */ d(gt, { children: [
|
|
407
|
+
/* @__PURE__ */ d(
|
|
408
|
+
ht,
|
|
394
409
|
{
|
|
395
|
-
className:
|
|
396
|
-
|
|
410
|
+
className: a(
|
|
411
|
+
Ee && "sticky top-0 z-10 bg-surface"
|
|
397
412
|
),
|
|
398
413
|
children: [
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
|
|
414
|
+
r.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => {
|
|
415
|
+
const l = S && t.column.getCanSort(), s = t.column.getIsSorted(), c = me(t.column.id);
|
|
416
|
+
return /* @__PURE__ */ n(
|
|
417
|
+
Se,
|
|
403
418
|
{
|
|
404
|
-
className:
|
|
405
|
-
style:
|
|
406
|
-
children: t.isPlaceholder ? null :
|
|
419
|
+
className: c.className,
|
|
420
|
+
style: c.style,
|
|
421
|
+
children: t.isPlaceholder ? null : l ? /* @__PURE__ */ d(
|
|
407
422
|
"button",
|
|
408
423
|
{
|
|
409
424
|
type: "button",
|
|
410
|
-
className:
|
|
425
|
+
className: a(
|
|
411
426
|
"flex items-center gap-ds-01 font-medium",
|
|
412
427
|
"cursor-pointer select-none",
|
|
413
428
|
"-ml-ds-01 rounded-ds-sm px-ds-01 py-ds-01",
|
|
@@ -416,24 +431,24 @@ function yt({
|
|
|
416
431
|
onClick: t.column.getToggleSortingHandler(),
|
|
417
432
|
"aria-label": `Sort by ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
418
433
|
children: [
|
|
419
|
-
|
|
434
|
+
ee(
|
|
420
435
|
t.column.columnDef.header,
|
|
421
436
|
t.getContext()
|
|
422
437
|
),
|
|
423
|
-
s === "asc" ? /* @__PURE__ */
|
|
424
|
-
|
|
438
|
+
s === "asc" ? /* @__PURE__ */ n(
|
|
439
|
+
ct,
|
|
425
440
|
{
|
|
426
441
|
className: "h-ico-sm w-ico-sm text-text-secondary",
|
|
427
442
|
"aria-hidden": "true"
|
|
428
443
|
}
|
|
429
|
-
) : s === "desc" ? /* @__PURE__ */
|
|
430
|
-
|
|
444
|
+
) : s === "desc" ? /* @__PURE__ */ n(
|
|
445
|
+
dt,
|
|
431
446
|
{
|
|
432
447
|
className: "h-ico-sm w-ico-sm text-text-secondary",
|
|
433
448
|
"aria-hidden": "true"
|
|
434
449
|
}
|
|
435
|
-
) : /* @__PURE__ */
|
|
436
|
-
|
|
450
|
+
) : /* @__PURE__ */ n(
|
|
451
|
+
it,
|
|
437
452
|
{
|
|
438
453
|
className: "h-ico-sm w-ico-sm text-text-tertiary",
|
|
439
454
|
"aria-hidden": "true"
|
|
@@ -441,7 +456,7 @@ function yt({
|
|
|
441
456
|
)
|
|
442
457
|
]
|
|
443
458
|
}
|
|
444
|
-
) :
|
|
459
|
+
) : ee(
|
|
445
460
|
t.column.columnDef.header,
|
|
446
461
|
t.getContext()
|
|
447
462
|
)
|
|
@@ -449,15 +464,15 @@ function yt({
|
|
|
449
464
|
t.id
|
|
450
465
|
);
|
|
451
466
|
}) }, e.id)),
|
|
452
|
-
|
|
467
|
+
h && r.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => /* @__PURE__ */ n(Se, { className: "py-ds-01", children: t.isPlaceholder || t.column.columnDef.enableColumnFilter === !1 ? null : /* @__PURE__ */ n(
|
|
453
468
|
"input",
|
|
454
469
|
{
|
|
455
470
|
type: "text",
|
|
456
471
|
value: t.column.getFilterValue() ?? "",
|
|
457
|
-
onChange: (
|
|
472
|
+
onChange: (l) => t.column.setFilterValue(l.target.value),
|
|
458
473
|
placeholder: `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : ""}...`,
|
|
459
474
|
"aria-label": `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
460
|
-
className:
|
|
475
|
+
className: a(
|
|
461
476
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
462
477
|
"border border-border bg-field",
|
|
463
478
|
"px-ds-02 text-ds-sm",
|
|
@@ -469,38 +484,38 @@ function yt({
|
|
|
469
484
|
]
|
|
470
485
|
}
|
|
471
486
|
),
|
|
472
|
-
|
|
487
|
+
Qe()
|
|
473
488
|
] });
|
|
474
|
-
return /* @__PURE__ */
|
|
475
|
-
|
|
476
|
-
|
|
489
|
+
return /* @__PURE__ */ d("div", { className: a(K), children: [
|
|
490
|
+
te && /* @__PURE__ */ n(
|
|
491
|
+
bt,
|
|
477
492
|
{
|
|
478
|
-
table:
|
|
479
|
-
globalFilter:
|
|
480
|
-
globalFilterValue:
|
|
481
|
-
onGlobalFilterChange:
|
|
482
|
-
density:
|
|
483
|
-
onDensityChange:
|
|
493
|
+
table: r,
|
|
494
|
+
globalFilter: p,
|
|
495
|
+
globalFilterValue: W,
|
|
496
|
+
onGlobalFilterChange: X,
|
|
497
|
+
density: ce,
|
|
498
|
+
onDensityChange: He
|
|
484
499
|
}
|
|
485
500
|
),
|
|
486
|
-
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
|
|
501
|
+
p && !te && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03 pb-ds-04 border-b border-border-subtle mb-ds-04", children: [
|
|
502
|
+
/* @__PURE__ */ n(
|
|
503
|
+
ut,
|
|
489
504
|
{
|
|
490
505
|
size: 16,
|
|
491
506
|
className: "text-icon-secondary",
|
|
492
507
|
"aria-hidden": "true"
|
|
493
508
|
}
|
|
494
509
|
),
|
|
495
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ n(
|
|
496
511
|
"input",
|
|
497
512
|
{
|
|
498
513
|
type: "text",
|
|
499
|
-
value:
|
|
500
|
-
onChange: (e) =>
|
|
514
|
+
value: W,
|
|
515
|
+
onChange: (e) => X(e.target.value),
|
|
501
516
|
placeholder: "Search all columns...",
|
|
502
517
|
"aria-label": "Search all columns",
|
|
503
|
-
className:
|
|
518
|
+
className: a(
|
|
504
519
|
"flex-1 bg-transparent text-ds-md",
|
|
505
520
|
"text-text-primary placeholder:text-text-placeholder",
|
|
506
521
|
"outline-none"
|
|
@@ -508,87 +523,87 @@ function yt({
|
|
|
508
523
|
}
|
|
509
524
|
)
|
|
510
525
|
] }),
|
|
511
|
-
|
|
526
|
+
b ? /* @__PURE__ */ n(
|
|
512
527
|
"div",
|
|
513
528
|
{
|
|
514
|
-
ref:
|
|
515
|
-
style: { maxHeight: `${
|
|
516
|
-
children:
|
|
529
|
+
ref: ie,
|
|
530
|
+
style: { maxHeight: `${De}px`, overflowY: "auto" },
|
|
531
|
+
children: pe
|
|
517
532
|
}
|
|
518
|
-
) :
|
|
519
|
-
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
|
|
533
|
+
) : pe,
|
|
534
|
+
Z && /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-border-subtle", children: [
|
|
535
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm text-text-secondary", children: [
|
|
536
|
+
ve,
|
|
522
537
|
" total rows"
|
|
523
538
|
] }),
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
!
|
|
539
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
|
|
540
|
+
!M && /* @__PURE__ */ n(
|
|
526
541
|
"select",
|
|
527
542
|
{
|
|
528
|
-
value:
|
|
543
|
+
value: r.getState().pagination.pageSize,
|
|
529
544
|
onChange: (e) => {
|
|
530
|
-
|
|
545
|
+
r.setPageSize(Number(e.target.value));
|
|
531
546
|
},
|
|
532
547
|
"aria-label": "Rows per page",
|
|
533
|
-
className:
|
|
548
|
+
className: a(
|
|
534
549
|
"h-ds-sm rounded-ds-md",
|
|
535
550
|
"border border-border bg-field",
|
|
536
551
|
"px-ds-03 text-ds-sm",
|
|
537
552
|
"text-text-primary"
|
|
538
553
|
),
|
|
539
|
-
children: (
|
|
554
|
+
children: (we ?? [10, 20, 50, 100]).map((e) => /* @__PURE__ */ d("option", { value: e, children: [
|
|
540
555
|
e,
|
|
541
556
|
" rows"
|
|
542
557
|
] }, e))
|
|
543
558
|
}
|
|
544
559
|
),
|
|
545
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ n(
|
|
546
561
|
"button",
|
|
547
562
|
{
|
|
548
563
|
type: "button",
|
|
549
|
-
disabled: !
|
|
550
|
-
onClick: () =>
|
|
564
|
+
disabled: !r.getCanPreviousPage(),
|
|
565
|
+
onClick: () => r.previousPage(),
|
|
551
566
|
"aria-label": "Previous page",
|
|
552
|
-
className:
|
|
567
|
+
className: a(
|
|
553
568
|
"h-ds-sm w-ds-sm flex items-center justify-center",
|
|
554
569
|
"rounded-ds-md border border-border",
|
|
555
570
|
"enabled:hover:bg-layer-02",
|
|
556
571
|
"disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
557
572
|
"transition-colors"
|
|
558
573
|
),
|
|
559
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ n(mt, { size: 16, "aria-hidden": "true" })
|
|
560
575
|
}
|
|
561
576
|
),
|
|
562
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm text-text-secondary", children: [
|
|
563
578
|
"Page ",
|
|
564
|
-
|
|
579
|
+
r.getState().pagination.pageIndex + 1,
|
|
565
580
|
" of",
|
|
566
581
|
" ",
|
|
567
|
-
|
|
582
|
+
r.getPageCount()
|
|
568
583
|
] }),
|
|
569
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ n(
|
|
570
585
|
"button",
|
|
571
586
|
{
|
|
572
587
|
type: "button",
|
|
573
|
-
disabled: !
|
|
574
|
-
onClick: () =>
|
|
588
|
+
disabled: !r.getCanNextPage(),
|
|
589
|
+
onClick: () => r.nextPage(),
|
|
575
590
|
"aria-label": "Next page",
|
|
576
|
-
className:
|
|
591
|
+
className: a(
|
|
577
592
|
"h-ds-sm w-ds-sm flex items-center justify-center",
|
|
578
593
|
"rounded-ds-md border border-border",
|
|
579
594
|
"enabled:hover:bg-layer-02",
|
|
580
595
|
"disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
581
596
|
"transition-colors"
|
|
582
597
|
),
|
|
583
|
-
children: /* @__PURE__ */
|
|
598
|
+
children: /* @__PURE__ */ n(ye, { size: 16, "aria-hidden": "true" })
|
|
584
599
|
}
|
|
585
600
|
)
|
|
586
601
|
] })
|
|
587
602
|
] }),
|
|
588
|
-
|
|
603
|
+
$ && C && Ze && /* @__PURE__ */ d(
|
|
589
604
|
"div",
|
|
590
605
|
{
|
|
591
|
-
className:
|
|
606
|
+
className: a(
|
|
592
607
|
"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",
|
|
593
608
|
"flex items-center gap-ds-04 px-ds-05 py-ds-03",
|
|
594
609
|
"rounded-ds-lg border border-border bg-surface shadow-lg",
|
|
@@ -597,34 +612,34 @@ function yt({
|
|
|
597
612
|
role: "toolbar",
|
|
598
613
|
"aria-label": "Bulk actions",
|
|
599
614
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
|
|
615
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm font-medium text-text-primary whitespace-nowrap", children: [
|
|
616
|
+
P.length,
|
|
602
617
|
" selected"
|
|
603
618
|
] }),
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
|
|
606
|
-
|
|
619
|
+
/* @__PURE__ */ n("div", { className: "h-5 w-px bg-border", "aria-hidden": "true" }),
|
|
620
|
+
$.map((e) => /* @__PURE__ */ n(
|
|
621
|
+
pt,
|
|
607
622
|
{
|
|
608
623
|
size: "sm",
|
|
609
624
|
variant: e.color === "error" ? "destructive" : "outline",
|
|
610
625
|
disabled: e.disabled,
|
|
611
|
-
onClick: () => e.onClick(
|
|
626
|
+
onClick: () => e.onClick(P),
|
|
612
627
|
children: e.label
|
|
613
628
|
},
|
|
614
629
|
e.label
|
|
615
630
|
)),
|
|
616
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ n(
|
|
617
632
|
"button",
|
|
618
633
|
{
|
|
619
634
|
type: "button",
|
|
620
|
-
onClick: () =>
|
|
635
|
+
onClick: () => r.resetRowSelection(),
|
|
621
636
|
"aria-label": "Clear selection",
|
|
622
|
-
className:
|
|
637
|
+
className: a(
|
|
623
638
|
"flex items-center justify-center p-ds-01",
|
|
624
639
|
"rounded-ds-sm hover:bg-layer-02 transition-colors",
|
|
625
640
|
"text-text-secondary hover:text-text-primary"
|
|
626
641
|
),
|
|
627
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ n(ft, { size: 16, "aria-hidden": "true" })
|
|
628
643
|
}
|
|
629
644
|
)
|
|
630
645
|
]
|
|
@@ -632,7 +647,7 @@ function yt({
|
|
|
632
647
|
)
|
|
633
648
|
] });
|
|
634
649
|
}
|
|
635
|
-
|
|
650
|
+
Ct.displayName = "DataTable";
|
|
636
651
|
export {
|
|
637
|
-
|
|
652
|
+
Ct as DataTable
|
|
638
653
|
};
|