lizaui 9.0.52 → 9.0.54
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/chunks/chevron-down-BTrLI_vJ.js +6 -0
- package/dist/chunks/chevron-down-BTrLI_vJ.js.map +1 -0
- package/dist/chunks/chevron-down-D-14pIT_.js +7 -0
- package/dist/chunks/chevron-down-D-14pIT_.js.map +1 -0
- package/dist/chunks/chevron-up-BBd-SipB.js +7 -0
- package/dist/chunks/chevron-up-BBd-SipB.js.map +1 -0
- package/dist/chunks/chevron-up-egHdliKz.js +6 -0
- package/dist/chunks/chevron-up-egHdliKz.js.map +1 -0
- package/dist/chunks/{index--Lp5VMoT.js → index-Cqht2FCn.js} +3 -6
- package/dist/chunks/index-Cqht2FCn.js.map +1 -0
- package/dist/chunks/{index-xVewW5kR.js → index-D6rBzjZf.js} +3 -6
- package/dist/chunks/index-D6rBzjZf.js.map +1 -0
- package/dist/chunks/{scroll-area-DTgVLYwQ.js → scroll-area-DDEg3_oz.js} +2 -2
- package/dist/chunks/{scroll-area-DTgVLYwQ.js.map → scroll-area-DDEg3_oz.js.map} +1 -1
- package/dist/chunks/{scroll-area-Bv006UzS.js → scroll-area-_ap_QsnE.js} +2 -2
- package/dist/chunks/{scroll-area-Bv006UzS.js.map → scroll-area-_ap_QsnE.js.map} +1 -1
- package/dist/chunks/{select-JfY1UjKe.js → select-BROp3S0I.js} +4 -5
- package/dist/chunks/select-BROp3S0I.js.map +1 -0
- package/dist/chunks/{select-Bm7MENHi.js → select-CqltFRiu.js} +7 -8
- package/dist/chunks/select-CqltFRiu.js.map +1 -0
- package/dist/components/table/body/table-body.d.ts.map +1 -1
- package/dist/components/table/context/table.context.d.ts.map +1 -1
- package/dist/components/table/header/table-header-column.d.ts.map +1 -1
- package/dist/components/table/hook/use-table.d.ts +3 -2
- package/dist/components/table/hook/use-table.d.ts.map +1 -1
- package/dist/components/table/interface/table.interface.d.ts +9 -0
- package/dist/components/table/interface/table.interface.d.ts.map +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/pagination/index.cjs.js +1 -1
- package/dist/pagination/index.es.js +1 -1
- package/dist/phone-input/index.cjs.js +4 -3
- package/dist/phone-input/index.cjs.js.map +1 -1
- package/dist/phone-input/index.es.js +3 -2
- package/dist/phone-input/index.es.js.map +1 -1
- package/dist/table/index.cjs.js +333 -179
- package/dist/table/index.cjs.js.map +1 -1
- package/dist/table/index.es.js +333 -179
- package/dist/table/index.es.js.map +1 -1
- package/dist/ui/index.cjs.js +6 -5
- package/dist/ui/index.cjs.js.map +1 -1
- package/dist/ui/index.es.js +6 -5
- package/dist/ui/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/index--Lp5VMoT.js.map +0 -1
- package/dist/chunks/index-xVewW5kR.js.map +0 -1
- package/dist/chunks/select-Bm7MENHi.js.map +0 -1
- package/dist/chunks/select-JfY1UjKe.js.map +0 -1
package/dist/table/index.cjs.js
CHANGED
|
@@ -27,10 +27,18 @@ const compilerRuntime = require("react/compiler-runtime");
|
|
|
27
27
|
const React = require("react");
|
|
28
28
|
const tailwindMerge = require("tailwind-merge");
|
|
29
29
|
const tooltip = require("../chunks/tooltip-hhxclHkr.js");
|
|
30
|
+
const chevronUp = require("../chunks/chevron-up-egHdliKz.js");
|
|
31
|
+
const chevronDown = require("../chunks/chevron-down-BTrLI_vJ.js");
|
|
32
|
+
const createLucideIcon = require("../chunks/createLucideIcon-Bxsl-Fn_.js");
|
|
30
33
|
const loaderCircle = require("../chunks/loader-circle-DVLrRYRP.js");
|
|
31
34
|
const clsx = require("clsx");
|
|
32
35
|
const checkbox = require("../chunks/checkbox-tCMzL33G.js");
|
|
33
36
|
const framerMotion = require("framer-motion");
|
|
37
|
+
const __iconNode = [
|
|
38
|
+
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
39
|
+
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
40
|
+
];
|
|
41
|
+
const ChevronsUpDown = createLucideIcon.createLucideIcon("chevrons-up-down", __iconNode);
|
|
34
42
|
const TableHeader = React.memo((t0) => {
|
|
35
43
|
const $ = compilerRuntime.c(14);
|
|
36
44
|
let children;
|
|
@@ -92,8 +100,24 @@ const TableHeader = React.memo((t0) => {
|
|
|
92
100
|
return t3;
|
|
93
101
|
});
|
|
94
102
|
TableHeader.displayName = "TableHeader";
|
|
103
|
+
const initialValues = {
|
|
104
|
+
color: "primary",
|
|
105
|
+
disabledKeys: [],
|
|
106
|
+
isChecks: true,
|
|
107
|
+
selectKeys: [],
|
|
108
|
+
isActions: true,
|
|
109
|
+
widthAction: 100,
|
|
110
|
+
totalColumn: 0,
|
|
111
|
+
sortDescriptors: [],
|
|
112
|
+
onSortChange: () => {
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const TableContext = React.createContext(initialValues);
|
|
116
|
+
const useTableContext = () => {
|
|
117
|
+
return React.useContext(TableContext);
|
|
118
|
+
};
|
|
95
119
|
const TableHeaderColumn = React.memo((t0) => {
|
|
96
|
-
const $ = compilerRuntime.c(
|
|
120
|
+
const $ = compilerRuntime.c(41);
|
|
97
121
|
const {
|
|
98
122
|
children,
|
|
99
123
|
className,
|
|
@@ -116,6 +140,10 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
116
140
|
const icon = t2 === void 0 ? null : t2;
|
|
117
141
|
const text = t3 === void 0 ? "" : t3;
|
|
118
142
|
const colspan = t4 === void 0 ? void 0 : t4;
|
|
143
|
+
const {
|
|
144
|
+
sortDescriptors,
|
|
145
|
+
onSortChange
|
|
146
|
+
} = useTableContext();
|
|
119
147
|
let t6;
|
|
120
148
|
if ($[2] !== className) {
|
|
121
149
|
t6 = tailwindMerge.twMerge("px-2 border-b border-divider", className);
|
|
@@ -151,9 +179,86 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
151
179
|
t10 = $[9];
|
|
152
180
|
}
|
|
153
181
|
const isChildrenEmpty = t10;
|
|
182
|
+
const isSortable = header?.sort;
|
|
183
|
+
header?.id;
|
|
154
184
|
let t11;
|
|
155
|
-
if ($[10] !==
|
|
156
|
-
t11 =
|
|
185
|
+
if ($[10] !== header?.id || $[11] !== sortDescriptors) {
|
|
186
|
+
t11 = sortDescriptors?.find((d) => d.column === header?.id);
|
|
187
|
+
$[10] = header?.id;
|
|
188
|
+
$[11] = sortDescriptors;
|
|
189
|
+
$[12] = t11;
|
|
190
|
+
} else {
|
|
191
|
+
t11 = $[12];
|
|
192
|
+
}
|
|
193
|
+
const currentSort = t11;
|
|
194
|
+
let t12;
|
|
195
|
+
if ($[13] !== currentSort || $[14] !== header?.id || $[15] !== sortDescriptors) {
|
|
196
|
+
t12 = () => {
|
|
197
|
+
if (!sortDescriptors || sortDescriptors.length <= 1 || !currentSort) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
return sortDescriptors.findIndex((d_0) => d_0.column === header?.id) + 1;
|
|
201
|
+
};
|
|
202
|
+
$[13] = currentSort;
|
|
203
|
+
$[14] = header?.id;
|
|
204
|
+
$[15] = sortDescriptors;
|
|
205
|
+
$[16] = t12;
|
|
206
|
+
} else {
|
|
207
|
+
t12 = $[16];
|
|
208
|
+
}
|
|
209
|
+
header?.id;
|
|
210
|
+
const sortOrderIndex = t12();
|
|
211
|
+
let t13;
|
|
212
|
+
if ($[17] !== header || $[18] !== isSortable || $[19] !== onSortChange) {
|
|
213
|
+
t13 = () => {
|
|
214
|
+
if (isSortable && onSortChange && header?.id) {
|
|
215
|
+
onSortChange(header.id);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
$[17] = header;
|
|
219
|
+
$[18] = isSortable;
|
|
220
|
+
$[19] = onSortChange;
|
|
221
|
+
$[20] = t13;
|
|
222
|
+
} else {
|
|
223
|
+
t13 = $[20];
|
|
224
|
+
}
|
|
225
|
+
const handleSort = t13;
|
|
226
|
+
let t14;
|
|
227
|
+
if ($[21] !== currentSort || $[22] !== icon || $[23] !== isSortable || $[24] !== sortOrderIndex) {
|
|
228
|
+
t14 = () => {
|
|
229
|
+
if (!isSortable) {
|
|
230
|
+
return icon;
|
|
231
|
+
}
|
|
232
|
+
if (currentSort) {
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
234
|
+
sortOrderIndex && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-default-400", children: sortOrderIndex }),
|
|
235
|
+
currentSort.direction === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(chevronUp.ChevronUp, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ jsxRuntime.jsx(chevronDown.ChevronDown, { className: "h-4 w-4 text-primary" })
|
|
236
|
+
] });
|
|
237
|
+
}
|
|
238
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ChevronsUpDown, { className: "h-4 w-4 text-default-300" });
|
|
239
|
+
};
|
|
240
|
+
$[21] = currentSort;
|
|
241
|
+
$[22] = icon;
|
|
242
|
+
$[23] = isSortable;
|
|
243
|
+
$[24] = sortOrderIndex;
|
|
244
|
+
$[25] = t14;
|
|
245
|
+
} else {
|
|
246
|
+
t14 = $[25];
|
|
247
|
+
}
|
|
248
|
+
const renderSortIcon = t14;
|
|
249
|
+
const t15 = isSortable ? "cursor-pointer hover:bg-default-100 transition-colors" : "";
|
|
250
|
+
let t16;
|
|
251
|
+
if ($[26] !== mergedClass || $[27] !== t15) {
|
|
252
|
+
t16 = tailwindMerge.twMerge(mergedClass, t15);
|
|
253
|
+
$[26] = mergedClass;
|
|
254
|
+
$[27] = t15;
|
|
255
|
+
$[28] = t16;
|
|
256
|
+
} else {
|
|
257
|
+
t16 = $[28];
|
|
258
|
+
}
|
|
259
|
+
let t17;
|
|
260
|
+
if ($[29] !== children || $[30] !== header?.information || $[31] !== isChildrenEmpty || $[32] !== renderSortIcon || $[33] !== text) {
|
|
261
|
+
t17 = isChildrenEmpty ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center gap-x-2 font-medium", children: [
|
|
157
262
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
158
263
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-1 text-xs text-foreground-500 dark:text-foreground-500 text-left", children: text }),
|
|
159
264
|
header?.information && /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip, { content: header?.information || "", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", role: "img", className: "text-default-300 cursor-pointer dark:text-foreground-500", width: 16, height: 16, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
|
|
@@ -162,44 +267,32 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
162
267
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 1, cy: 1, r: 1, fill: "currentColor", transform: "matrix(1 0 0 -1 11 9)" })
|
|
163
268
|
] }) }) })
|
|
164
269
|
] }),
|
|
165
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex", children:
|
|
270
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex justify-end", children: renderSortIcon() })
|
|
166
271
|
] }) : children;
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
272
|
+
$[29] = children;
|
|
273
|
+
$[30] = header?.information;
|
|
274
|
+
$[31] = isChildrenEmpty;
|
|
275
|
+
$[32] = renderSortIcon;
|
|
276
|
+
$[33] = text;
|
|
277
|
+
$[34] = t17;
|
|
173
278
|
} else {
|
|
174
|
-
|
|
279
|
+
t17 = $[34];
|
|
175
280
|
}
|
|
176
|
-
let
|
|
177
|
-
if ($[
|
|
178
|
-
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
281
|
+
let t18;
|
|
282
|
+
if ($[35] !== colspan || $[36] !== handleSort || $[37] !== mergedStyle || $[38] !== t16 || $[39] !== t17) {
|
|
283
|
+
t18 = /* @__PURE__ */ jsxRuntime.jsx("th", { className: t16, style: mergedStyle, colSpan: colspan, onClick: handleSort, children: t17 });
|
|
284
|
+
$[35] = colspan;
|
|
285
|
+
$[36] = handleSort;
|
|
286
|
+
$[37] = mergedStyle;
|
|
287
|
+
$[38] = t16;
|
|
288
|
+
$[39] = t17;
|
|
289
|
+
$[40] = t18;
|
|
184
290
|
} else {
|
|
185
|
-
|
|
291
|
+
t18 = $[40];
|
|
186
292
|
}
|
|
187
|
-
return
|
|
293
|
+
return t18;
|
|
188
294
|
});
|
|
189
295
|
TableHeaderColumn.displayName = "TableHeaderColumn";
|
|
190
|
-
const initialValues = {
|
|
191
|
-
color: "primary",
|
|
192
|
-
disabledKeys: [],
|
|
193
|
-
isChecks: true,
|
|
194
|
-
selectKeys: [],
|
|
195
|
-
isActions: true,
|
|
196
|
-
widthAction: 100,
|
|
197
|
-
totalColumn: 0
|
|
198
|
-
};
|
|
199
|
-
const TableContext = React.createContext(initialValues);
|
|
200
|
-
const useTableContext = () => {
|
|
201
|
-
return React.useContext(TableContext);
|
|
202
|
-
};
|
|
203
296
|
const TableEmptyState = React.memo((t0) => {
|
|
204
297
|
const $ = compilerRuntime.c(3);
|
|
205
298
|
const {
|
|
@@ -228,7 +321,7 @@ const TableEmptyState = React.memo((t0) => {
|
|
|
228
321
|
});
|
|
229
322
|
TableEmptyState.displayName = "TableEmptyState";
|
|
230
323
|
function TableBodyComponent(t0) {
|
|
231
|
-
const $ = compilerRuntime.c(
|
|
324
|
+
const $ = compilerRuntime.c(45);
|
|
232
325
|
let children;
|
|
233
326
|
let className;
|
|
234
327
|
let props;
|
|
@@ -285,27 +378,39 @@ function TableBodyComponent(t0) {
|
|
|
285
378
|
isChecks
|
|
286
379
|
} = useTableContext();
|
|
287
380
|
const total = Number(totalColumn) + Number(isActions) + Number(isChecks);
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
381
|
+
const t6 = props;
|
|
382
|
+
let domProps;
|
|
383
|
+
if ($[11] !== t6) {
|
|
384
|
+
domProps = {
|
|
385
|
+
...t6
|
|
386
|
+
};
|
|
387
|
+
delete domProps.dataHeader;
|
|
388
|
+
$[11] = t6;
|
|
389
|
+
$[12] = domProps;
|
|
293
390
|
} else {
|
|
294
|
-
|
|
391
|
+
domProps = $[12];
|
|
295
392
|
}
|
|
296
|
-
const mergedClass = t6;
|
|
297
393
|
let t7;
|
|
394
|
+
if ($[13] !== className) {
|
|
395
|
+
t7 = tailwindMerge.twMerge(className);
|
|
396
|
+
$[13] = className;
|
|
397
|
+
$[14] = t7;
|
|
398
|
+
} else {
|
|
399
|
+
t7 = $[14];
|
|
400
|
+
}
|
|
401
|
+
const mergedClass = t7;
|
|
402
|
+
let t8;
|
|
298
403
|
bb0: {
|
|
299
404
|
if (!data || data.length === 0) {
|
|
300
|
-
|
|
405
|
+
t8 = null;
|
|
301
406
|
break bb0;
|
|
302
407
|
}
|
|
303
408
|
if (typeof children === "function") {
|
|
304
|
-
let
|
|
305
|
-
if ($[
|
|
306
|
-
let
|
|
307
|
-
if ($[
|
|
308
|
-
|
|
409
|
+
let t92;
|
|
410
|
+
if ($[15] !== children || $[16] !== data || $[17] !== rowKey) {
|
|
411
|
+
let t10;
|
|
412
|
+
if ($[19] !== children || $[20] !== rowKey) {
|
|
413
|
+
t10 = (el, index) => {
|
|
309
414
|
const child = children({
|
|
310
415
|
item: el,
|
|
311
416
|
index
|
|
@@ -315,114 +420,114 @@ function TableBodyComponent(t0) {
|
|
|
315
420
|
key: keyValue
|
|
316
421
|
}) : null;
|
|
317
422
|
};
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
423
|
+
$[19] = children;
|
|
424
|
+
$[20] = rowKey;
|
|
425
|
+
$[21] = t10;
|
|
321
426
|
} else {
|
|
322
|
-
|
|
427
|
+
t10 = $[21];
|
|
323
428
|
}
|
|
324
|
-
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
429
|
+
t92 = data.map(t10);
|
|
430
|
+
$[15] = children;
|
|
431
|
+
$[16] = data;
|
|
432
|
+
$[17] = rowKey;
|
|
433
|
+
$[18] = t92;
|
|
329
434
|
} else {
|
|
330
|
-
|
|
435
|
+
t92 = $[18];
|
|
331
436
|
}
|
|
332
|
-
|
|
437
|
+
t8 = t92;
|
|
333
438
|
} else {
|
|
334
|
-
let
|
|
335
|
-
if ($[
|
|
336
|
-
let
|
|
337
|
-
if ($[
|
|
338
|
-
|
|
439
|
+
let t92;
|
|
440
|
+
if ($[22] !== children || $[23] !== data || $[24] !== rowKey) {
|
|
441
|
+
let t10;
|
|
442
|
+
if ($[26] !== data || $[27] !== rowKey) {
|
|
443
|
+
t10 = (child_0, index_0) => React.isValidElement(child_0) ? React.cloneElement(child_0, {
|
|
339
444
|
key: rowKey ? rowKey(data[index_0], index_0) : index_0
|
|
340
445
|
}) : child_0;
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
446
|
+
$[26] = data;
|
|
447
|
+
$[27] = rowKey;
|
|
448
|
+
$[28] = t10;
|
|
344
449
|
} else {
|
|
345
|
-
|
|
450
|
+
t10 = $[28];
|
|
346
451
|
}
|
|
347
|
-
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
452
|
+
t92 = React.Children.map(children, t10);
|
|
453
|
+
$[22] = children;
|
|
454
|
+
$[23] = data;
|
|
455
|
+
$[24] = rowKey;
|
|
456
|
+
$[25] = t92;
|
|
352
457
|
} else {
|
|
353
|
-
|
|
458
|
+
t92 = $[25];
|
|
354
459
|
}
|
|
355
|
-
|
|
460
|
+
t8 = t92;
|
|
356
461
|
}
|
|
357
462
|
}
|
|
358
|
-
const renderedRows =
|
|
463
|
+
const renderedRows = t8;
|
|
359
464
|
let fallbackContent = null;
|
|
360
465
|
if (isLoading) {
|
|
361
|
-
let
|
|
362
|
-
if ($[
|
|
363
|
-
|
|
364
|
-
$[
|
|
466
|
+
let t92;
|
|
467
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
468
|
+
t92 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3.5", children: /* @__PURE__ */ jsxRuntime.jsx(loaderCircle.LoaderCircle, { size: 45 }) });
|
|
469
|
+
$[29] = t92;
|
|
365
470
|
} else {
|
|
366
|
-
|
|
471
|
+
t92 = $[29];
|
|
367
472
|
}
|
|
368
|
-
let
|
|
369
|
-
if ($[
|
|
370
|
-
|
|
371
|
-
|
|
473
|
+
let t10;
|
|
474
|
+
if ($[30] !== loadingLabel) {
|
|
475
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center relative", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center items-center gap-2", children: [
|
|
476
|
+
t92,
|
|
372
477
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-1 text-sm text-default-800", children: loadingLabel }) })
|
|
373
478
|
] }) });
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
479
|
+
$[30] = loadingLabel;
|
|
480
|
+
$[31] = t10;
|
|
376
481
|
} else {
|
|
377
|
-
|
|
482
|
+
t10 = $[31];
|
|
378
483
|
}
|
|
379
|
-
let
|
|
380
|
-
if ($[
|
|
381
|
-
|
|
382
|
-
$[30] = t9;
|
|
383
|
-
$[31] = total;
|
|
484
|
+
let t11;
|
|
485
|
+
if ($[32] !== t10 || $[33] !== total) {
|
|
486
|
+
t11 = /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-divider", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-2.5 w-full", colSpan: total, children: t10 }) });
|
|
384
487
|
$[32] = t10;
|
|
488
|
+
$[33] = total;
|
|
489
|
+
$[34] = t11;
|
|
385
490
|
} else {
|
|
386
|
-
|
|
491
|
+
t11 = $[34];
|
|
387
492
|
}
|
|
388
|
-
fallbackContent =
|
|
493
|
+
fallbackContent = t11;
|
|
389
494
|
} else {
|
|
390
495
|
if (data.length === 0) {
|
|
391
|
-
let
|
|
392
|
-
if ($[
|
|
393
|
-
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
496
|
+
let t92;
|
|
497
|
+
if ($[35] !== emptyText) {
|
|
498
|
+
t92 = /* @__PURE__ */ jsxRuntime.jsx(TableEmptyState, { text: emptyText });
|
|
499
|
+
$[35] = emptyText;
|
|
500
|
+
$[36] = t92;
|
|
396
501
|
} else {
|
|
397
|
-
|
|
502
|
+
t92 = $[36];
|
|
398
503
|
}
|
|
399
|
-
let
|
|
400
|
-
if ($[
|
|
401
|
-
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
504
|
+
let t10;
|
|
505
|
+
if ($[37] !== t92 || $[38] !== total) {
|
|
506
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-divider", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-10 w-full", colSpan: total, children: t92 }) });
|
|
507
|
+
$[37] = t92;
|
|
508
|
+
$[38] = total;
|
|
509
|
+
$[39] = t10;
|
|
405
510
|
} else {
|
|
406
|
-
|
|
511
|
+
t10 = $[39];
|
|
407
512
|
}
|
|
408
|
-
fallbackContent =
|
|
513
|
+
fallbackContent = t10;
|
|
409
514
|
}
|
|
410
515
|
}
|
|
411
|
-
let
|
|
412
|
-
if ($[
|
|
413
|
-
|
|
516
|
+
let t9;
|
|
517
|
+
if ($[40] !== domProps || $[41] !== fallbackContent || $[42] !== mergedClass || $[43] !== renderedRows) {
|
|
518
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: mergedClass, ...domProps, children: [
|
|
414
519
|
renderedRows,
|
|
415
520
|
fallbackContent
|
|
416
521
|
] });
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
522
|
+
$[40] = domProps;
|
|
523
|
+
$[41] = fallbackContent;
|
|
524
|
+
$[42] = mergedClass;
|
|
525
|
+
$[43] = renderedRows;
|
|
526
|
+
$[44] = t9;
|
|
422
527
|
} else {
|
|
423
|
-
|
|
528
|
+
t9 = $[44];
|
|
424
529
|
}
|
|
425
|
-
return
|
|
530
|
+
return t9;
|
|
426
531
|
}
|
|
427
532
|
const TableBody = React.memo((props) => {
|
|
428
533
|
const $ = compilerRuntime.c(2);
|
|
@@ -956,7 +1061,10 @@ const TableHOC = ({
|
|
|
956
1061
|
selectKeys = [],
|
|
957
1062
|
isActions = true,
|
|
958
1063
|
widthAction = 100,
|
|
959
|
-
dataHeader
|
|
1064
|
+
dataHeader,
|
|
1065
|
+
sortDescriptors,
|
|
1066
|
+
onSortChange,
|
|
1067
|
+
...otherProps
|
|
960
1068
|
} = props;
|
|
961
1069
|
const tableClass = React.useMemo(() => tailwindMerge.twMerge("table-main-container w-full border-collapse table-auto", className), [className]);
|
|
962
1070
|
const containerClass = React.useMemo(() => tailwindMerge.twMerge("max-w-full overflow-x-auto overflow-y-auto bg-content1", classNameContainer), [classNameContainer]);
|
|
@@ -967,9 +1075,12 @@ const TableHOC = ({
|
|
|
967
1075
|
selectKeys,
|
|
968
1076
|
isActions,
|
|
969
1077
|
widthAction,
|
|
970
|
-
totalColumn: dataHeader?.length || 0
|
|
1078
|
+
totalColumn: dataHeader?.length || 0,
|
|
1079
|
+
sortDescriptors,
|
|
1080
|
+
onSortChange
|
|
971
1081
|
}, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerClass, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.LazyMotion, { features: () => import("framer-motion").then((res) => res.domAnimation), children: /* @__PURE__ */ jsxRuntime.jsx("table", { className: tableClass, children: React.Children.map(children, (child) => React.isValidElement(child) ? React.cloneElement(child, {
|
|
972
|
-
|
|
1082
|
+
dataHeader,
|
|
1083
|
+
...otherProps
|
|
973
1084
|
}) : child) }) }) }) }) });
|
|
974
1085
|
};
|
|
975
1086
|
const Table = Object.assign(TableHOC, {
|
|
@@ -983,45 +1094,56 @@ const Table = Object.assign(TableHOC, {
|
|
|
983
1094
|
BodyColumn: TableBodyColumn
|
|
984
1095
|
});
|
|
985
1096
|
const useTable = (t0) => {
|
|
986
|
-
const $ = compilerRuntime.c(
|
|
1097
|
+
const $ = compilerRuntime.c(19);
|
|
987
1098
|
const {
|
|
988
1099
|
initialDisabledKeys: t1,
|
|
989
1100
|
initialSelectKey: t2,
|
|
990
|
-
initialValueSearch: t3
|
|
1101
|
+
initialValueSearch: t3,
|
|
1102
|
+
initialSortDescriptors: t4
|
|
991
1103
|
} = t0;
|
|
992
|
-
let
|
|
1104
|
+
let t5;
|
|
993
1105
|
if ($[0] !== t1) {
|
|
994
|
-
|
|
1106
|
+
t5 = t1 === void 0 ? [] : t1;
|
|
995
1107
|
$[0] = t1;
|
|
996
|
-
$[1] =
|
|
1108
|
+
$[1] = t5;
|
|
997
1109
|
} else {
|
|
998
|
-
|
|
1110
|
+
t5 = $[1];
|
|
999
1111
|
}
|
|
1000
|
-
const initialDisabledKeys =
|
|
1001
|
-
let
|
|
1112
|
+
const initialDisabledKeys = t5;
|
|
1113
|
+
let t6;
|
|
1002
1114
|
if ($[2] !== t2) {
|
|
1003
|
-
|
|
1115
|
+
t6 = t2 === void 0 ? [] : t2;
|
|
1004
1116
|
$[2] = t2;
|
|
1005
|
-
$[3] =
|
|
1117
|
+
$[3] = t6;
|
|
1006
1118
|
} else {
|
|
1007
|
-
|
|
1119
|
+
t6 = $[3];
|
|
1008
1120
|
}
|
|
1009
|
-
const initialSelectKey =
|
|
1010
|
-
let
|
|
1121
|
+
const initialSelectKey = t6;
|
|
1122
|
+
let t7;
|
|
1011
1123
|
if ($[4] !== t3) {
|
|
1012
|
-
|
|
1124
|
+
t7 = t3 === void 0 ? {} : t3;
|
|
1013
1125
|
$[4] = t3;
|
|
1014
|
-
$[5] =
|
|
1126
|
+
$[5] = t7;
|
|
1015
1127
|
} else {
|
|
1016
|
-
|
|
1128
|
+
t7 = $[5];
|
|
1129
|
+
}
|
|
1130
|
+
const initialValueSearch = t7;
|
|
1131
|
+
let t8;
|
|
1132
|
+
if ($[6] !== t4) {
|
|
1133
|
+
t8 = t4 === void 0 ? [] : t4;
|
|
1134
|
+
$[6] = t4;
|
|
1135
|
+
$[7] = t8;
|
|
1136
|
+
} else {
|
|
1137
|
+
t8 = $[7];
|
|
1017
1138
|
}
|
|
1018
|
-
const
|
|
1139
|
+
const initialSortDescriptors = t8;
|
|
1019
1140
|
const [selectKeys, setSelectKeys] = React.useState(initialSelectKey);
|
|
1020
1141
|
const [disabledKeys, setDisabledKeys] = React.useState(initialDisabledKeys);
|
|
1021
1142
|
const [valueSearch, setValueSearch] = React.useState(initialValueSearch);
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1143
|
+
const [sortDescriptors, setSortDescriptors] = React.useState(initialSortDescriptors);
|
|
1144
|
+
let t9;
|
|
1145
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1146
|
+
t9 = (value) => {
|
|
1025
1147
|
setSelectKeys((prev) => {
|
|
1026
1148
|
const exists = prev.some((el) => el.id === value.id);
|
|
1027
1149
|
if (exists) {
|
|
@@ -1030,44 +1152,44 @@ const useTable = (t0) => {
|
|
|
1030
1152
|
return [...prev, value];
|
|
1031
1153
|
});
|
|
1032
1154
|
};
|
|
1033
|
-
$[
|
|
1155
|
+
$[8] = t9;
|
|
1034
1156
|
} else {
|
|
1035
|
-
|
|
1157
|
+
t9 = $[8];
|
|
1036
1158
|
}
|
|
1037
|
-
const handleSelectKey =
|
|
1038
|
-
let
|
|
1039
|
-
if ($[
|
|
1040
|
-
|
|
1159
|
+
const handleSelectKey = t9;
|
|
1160
|
+
let t10;
|
|
1161
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1162
|
+
t10 = (value_0) => {
|
|
1041
1163
|
setSelectKeys(value_0);
|
|
1042
1164
|
};
|
|
1043
|
-
$[
|
|
1165
|
+
$[9] = t10;
|
|
1044
1166
|
} else {
|
|
1045
|
-
|
|
1167
|
+
t10 = $[9];
|
|
1046
1168
|
}
|
|
1047
|
-
const handleSelectKeys =
|
|
1048
|
-
let
|
|
1049
|
-
if ($[
|
|
1050
|
-
|
|
1169
|
+
const handleSelectKeys = t10;
|
|
1170
|
+
let t11;
|
|
1171
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1172
|
+
t11 = (value_1) => {
|
|
1051
1173
|
setDisabledKeys(value_1);
|
|
1052
1174
|
};
|
|
1053
|
-
$[
|
|
1175
|
+
$[10] = t11;
|
|
1054
1176
|
} else {
|
|
1055
|
-
|
|
1177
|
+
t11 = $[10];
|
|
1056
1178
|
}
|
|
1057
|
-
const handleDisabledKeys =
|
|
1058
|
-
let
|
|
1059
|
-
if ($[
|
|
1060
|
-
|
|
1179
|
+
const handleDisabledKeys = t11;
|
|
1180
|
+
let t12;
|
|
1181
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1182
|
+
t12 = () => {
|
|
1061
1183
|
setSelectKeys([]);
|
|
1062
1184
|
};
|
|
1063
|
-
$[
|
|
1185
|
+
$[11] = t12;
|
|
1064
1186
|
} else {
|
|
1065
|
-
|
|
1187
|
+
t12 = $[11];
|
|
1066
1188
|
}
|
|
1067
|
-
const handleResetSelectKeys =
|
|
1068
|
-
let
|
|
1069
|
-
if ($[
|
|
1070
|
-
|
|
1189
|
+
const handleResetSelectKeys = t12;
|
|
1190
|
+
let t13;
|
|
1191
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1192
|
+
t13 = (key, value_2) => {
|
|
1071
1193
|
setValueSearch((prev_0) => {
|
|
1072
1194
|
if (prev_0[key] === value_2) {
|
|
1073
1195
|
return prev_0;
|
|
@@ -1083,31 +1205,63 @@ const useTable = (t0) => {
|
|
|
1083
1205
|
return newState;
|
|
1084
1206
|
});
|
|
1085
1207
|
};
|
|
1086
|
-
$[
|
|
1208
|
+
$[12] = t13;
|
|
1087
1209
|
} else {
|
|
1088
|
-
|
|
1210
|
+
t13 = $[12];
|
|
1089
1211
|
}
|
|
1090
|
-
const handleSetValueSearch =
|
|
1091
|
-
let
|
|
1092
|
-
if ($[
|
|
1093
|
-
|
|
1212
|
+
const handleSetValueSearch = t13;
|
|
1213
|
+
let t14;
|
|
1214
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1215
|
+
t14 = (column) => {
|
|
1216
|
+
setSortDescriptors((prev_1) => {
|
|
1217
|
+
const existingIndex = prev_1.findIndex((s) => s.column === column);
|
|
1218
|
+
if (existingIndex !== -1) {
|
|
1219
|
+
const existing = prev_1[existingIndex];
|
|
1220
|
+
if (existing.direction === "asc") {
|
|
1221
|
+
const newSorts = [...prev_1];
|
|
1222
|
+
newSorts[existingIndex] = {
|
|
1223
|
+
...existing,
|
|
1224
|
+
direction: "desc"
|
|
1225
|
+
};
|
|
1226
|
+
return newSorts;
|
|
1227
|
+
} else {
|
|
1228
|
+
return prev_1.filter((s_0) => s_0.column !== column);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
return [...prev_1, {
|
|
1232
|
+
column,
|
|
1233
|
+
direction: "asc"
|
|
1234
|
+
}];
|
|
1235
|
+
});
|
|
1236
|
+
};
|
|
1237
|
+
$[13] = t14;
|
|
1238
|
+
} else {
|
|
1239
|
+
t14 = $[13];
|
|
1240
|
+
}
|
|
1241
|
+
const handleSort = t14;
|
|
1242
|
+
let t15;
|
|
1243
|
+
if ($[14] !== disabledKeys || $[15] !== selectKeys || $[16] !== sortDescriptors || $[17] !== valueSearch) {
|
|
1244
|
+
t15 = {
|
|
1094
1245
|
selectKeys,
|
|
1095
1246
|
disabledKeys,
|
|
1096
1247
|
valueSearch,
|
|
1248
|
+
sortDescriptors,
|
|
1097
1249
|
handleSelectKeys,
|
|
1098
1250
|
handleSelectKey,
|
|
1099
1251
|
handleDisabledKeys,
|
|
1100
1252
|
handleSetValueSearch,
|
|
1101
|
-
handleResetSelectKeys
|
|
1253
|
+
handleResetSelectKeys,
|
|
1254
|
+
handleSort
|
|
1102
1255
|
};
|
|
1103
|
-
$[
|
|
1104
|
-
$[
|
|
1105
|
-
$[
|
|
1106
|
-
$[
|
|
1256
|
+
$[14] = disabledKeys;
|
|
1257
|
+
$[15] = selectKeys;
|
|
1258
|
+
$[16] = sortDescriptors;
|
|
1259
|
+
$[17] = valueSearch;
|
|
1260
|
+
$[18] = t15;
|
|
1107
1261
|
} else {
|
|
1108
|
-
|
|
1262
|
+
t15 = $[18];
|
|
1109
1263
|
}
|
|
1110
|
-
return
|
|
1264
|
+
return t15;
|
|
1111
1265
|
};
|
|
1112
1266
|
exports.Table = Table;
|
|
1113
1267
|
exports.TableHOC = TableHOC;
|