lizaui 9.0.58 → 9.0.61
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/components/table/header/table-header-column.d.ts.map +1 -1
- package/dist/components/table/hook/use-table.d.ts +2 -2
- package/dist/components/table/hook/use-table.d.ts.map +1 -1
- package/dist/components/table/interface/table.interface.d.ts +2 -2
- package/dist/components/table/interface/table.interface.d.ts.map +1 -1
- package/dist/table/index.cjs.js +156 -197
- package/dist/table/index.cjs.js.map +1 -1
- package/dist/table/index.es.js +156 -197
- package/dist/table/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header-column.d.ts","sourceRoot":"","sources":["../../../../src/components/table/header/table-header-column.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"table-header-column.d.ts","sourceRoot":"","sources":["../../../../src/components/table/header/table-header-column.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAO1E,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAwIzD,CAAC"}
|
|
@@ -4,9 +4,9 @@ interface TableProps {
|
|
|
4
4
|
initialSelectKey?: TableKeyCurrent[];
|
|
5
5
|
initialDisabledKeys?: string[];
|
|
6
6
|
initialValueSearch?: TableValueSearchProps;
|
|
7
|
-
|
|
7
|
+
initialSortDescriptor?: SortDescriptor | null;
|
|
8
8
|
initialColumnWidths?: ColumnWidths;
|
|
9
9
|
}
|
|
10
|
-
export declare const useTable: ({ initialDisabledKeys, initialSelectKey, initialValueSearch,
|
|
10
|
+
export declare const useTable: ({ initialDisabledKeys, initialSelectKey, initialValueSearch, initialSortDescriptor, initialColumnWidths, }: TableProps) => TableHookProps;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=use-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-table.d.ts","sourceRoot":"","sources":["../../../../src/components/table/hook/use-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE3G,UAAU,UAAU;IACnB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IAC3C,
|
|
1
|
+
{"version":3,"file":"use-table.d.ts","sourceRoot":"","sources":["../../../../src/components/table/hook/use-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE3G,UAAU,UAAU;IACnB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;IAC3C,qBAAqB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9C,mBAAmB,CAAC,EAAE,YAAY,CAAC;CACnC;AAED,eAAO,MAAM,QAAQ,GAAI,4GAMtB,UAAU,KAAG,cA4Ff,CAAC"}
|
|
@@ -11,7 +11,7 @@ export interface TableHookProps {
|
|
|
11
11
|
selectKeys: TableKeyCurrent[];
|
|
12
12
|
disabledKeys: string[];
|
|
13
13
|
valueSearch: TableValueSearchProps;
|
|
14
|
-
|
|
14
|
+
sortDescriptor: SortDescriptor | null;
|
|
15
15
|
columnWidths: ColumnWidths;
|
|
16
16
|
handleSelectKey: (parameter: TableKeyCurrent) => void;
|
|
17
17
|
handleSelectKeys: (parameter: TableKeyCurrent[]) => void;
|
|
@@ -29,7 +29,7 @@ export interface TableShareProps {
|
|
|
29
29
|
disabledKeys?: string[];
|
|
30
30
|
isActions?: boolean;
|
|
31
31
|
widthAction?: number;
|
|
32
|
-
|
|
32
|
+
sortDescriptor?: SortDescriptor | null;
|
|
33
33
|
onSortChange?: (column: string) => void;
|
|
34
34
|
columnWidths?: ColumnWidths;
|
|
35
35
|
onColumnResize?: (columnId: string, width: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.interface.d.ts","sourceRoot":"","sources":["../../../../src/components/table/interface/table.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,qBAAqB,CAAC;IACnC,
|
|
1
|
+
{"version":3,"file":"table.interface.d.ts","sourceRoot":"","sources":["../../../../src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
111
|
-
|
|
111
|
+
sortDescriptor: null,
|
|
112
112
|
onSortChange: () => {
|
|
113
113
|
},
|
|
114
114
|
columnWidths: {},
|
|
@@ -324,7 +324,7 @@ const ResizeHandle = React.memo((t0) => {
|
|
|
324
324
|
});
|
|
325
325
|
ResizeHandle.displayName = "ResizeHandle";
|
|
326
326
|
const TableHeaderColumn = React.memo((t0) => {
|
|
327
|
-
const $ = compilerRuntime.c(
|
|
327
|
+
const $ = compilerRuntime.c(54);
|
|
328
328
|
const {
|
|
329
329
|
children,
|
|
330
330
|
className,
|
|
@@ -353,7 +353,7 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
353
353
|
const text = t3 === void 0 ? "" : t3;
|
|
354
354
|
const colspan = t4 === void 0 ? void 0 : t4;
|
|
355
355
|
const {
|
|
356
|
-
|
|
356
|
+
sortDescriptor,
|
|
357
357
|
onSortChange,
|
|
358
358
|
columnWidths,
|
|
359
359
|
onColumnResize,
|
|
@@ -452,87 +452,58 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
452
452
|
const isChildrenEmpty = t13;
|
|
453
453
|
const isSortable = header?.sort;
|
|
454
454
|
header?.id;
|
|
455
|
+
const isCurrentlySorted = sortDescriptor?.column === header?.id;
|
|
455
456
|
let t14;
|
|
456
|
-
if ($[23] !== header
|
|
457
|
-
t14 =
|
|
458
|
-
$[23] = header?.id;
|
|
459
|
-
$[24] = sortDescriptors;
|
|
460
|
-
$[25] = t14;
|
|
461
|
-
} else {
|
|
462
|
-
t14 = $[25];
|
|
463
|
-
}
|
|
464
|
-
const currentSort = t14;
|
|
465
|
-
let t15;
|
|
466
|
-
if ($[26] !== currentSort || $[27] !== header?.id || $[28] !== sortDescriptors) {
|
|
467
|
-
t15 = () => {
|
|
468
|
-
if (!sortDescriptors || sortDescriptors.length <= 1 || !currentSort) {
|
|
469
|
-
return null;
|
|
470
|
-
}
|
|
471
|
-
return sortDescriptors.findIndex((d_0) => d_0.column === header?.id) + 1;
|
|
472
|
-
};
|
|
473
|
-
$[26] = currentSort;
|
|
474
|
-
$[27] = header?.id;
|
|
475
|
-
$[28] = sortDescriptors;
|
|
476
|
-
$[29] = t15;
|
|
477
|
-
} else {
|
|
478
|
-
t15 = $[29];
|
|
479
|
-
}
|
|
480
|
-
header?.id;
|
|
481
|
-
const sortOrderIndex = t15();
|
|
482
|
-
let t16;
|
|
483
|
-
if ($[30] !== header || $[31] !== isSortable || $[32] !== onSortChange) {
|
|
484
|
-
t16 = () => {
|
|
457
|
+
if ($[23] !== header || $[24] !== isSortable || $[25] !== onSortChange) {
|
|
458
|
+
t14 = () => {
|
|
485
459
|
if (isSortable && onSortChange && header?.id) {
|
|
486
460
|
onSortChange(header.id);
|
|
487
461
|
}
|
|
488
462
|
};
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
463
|
+
$[23] = header;
|
|
464
|
+
$[24] = isSortable;
|
|
465
|
+
$[25] = onSortChange;
|
|
466
|
+
$[26] = t14;
|
|
493
467
|
} else {
|
|
494
|
-
|
|
468
|
+
t14 = $[26];
|
|
495
469
|
}
|
|
496
|
-
const handleSort =
|
|
497
|
-
let
|
|
498
|
-
if ($[
|
|
499
|
-
|
|
470
|
+
const handleSort = t14;
|
|
471
|
+
let t15;
|
|
472
|
+
if ($[27] !== icon || $[28] !== isCurrentlySorted || $[29] !== isSortable || $[30] !== sortDescriptor) {
|
|
473
|
+
t15 = () => {
|
|
500
474
|
if (!isSortable) {
|
|
501
475
|
return icon;
|
|
502
476
|
}
|
|
503
|
-
if (
|
|
504
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
505
|
-
sortOrderIndex && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-default-400", children: sortOrderIndex }),
|
|
506
|
-
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" })
|
|
507
|
-
] });
|
|
477
|
+
if (isCurrentlySorted && sortDescriptor) {
|
|
478
|
+
return sortDescriptor.direction === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(chevronUp.ChevronUp, { className: "h-4 w-4 text-foreground-500 dark:text-foreground-500" }) : /* @__PURE__ */ jsxRuntime.jsx(chevronDown.ChevronDown, { className: "h-4 w-4 text-foreground-500 dark:text-foreground-500" });
|
|
508
479
|
}
|
|
509
480
|
return /* @__PURE__ */ jsxRuntime.jsx(ChevronsUpDown, { className: "h-4 w-4 text-default-300" });
|
|
510
481
|
};
|
|
511
|
-
$[
|
|
512
|
-
$[
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
516
|
-
} else {
|
|
517
|
-
|
|
518
|
-
}
|
|
519
|
-
const renderSortIcon =
|
|
520
|
-
const
|
|
521
|
-
const
|
|
522
|
-
const
|
|
523
|
-
let
|
|
524
|
-
if ($[
|
|
525
|
-
|
|
526
|
-
$[
|
|
527
|
-
$[
|
|
528
|
-
$[
|
|
529
|
-
$[
|
|
530
|
-
} else {
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
let
|
|
534
|
-
if ($[
|
|
535
|
-
|
|
482
|
+
$[27] = icon;
|
|
483
|
+
$[28] = isCurrentlySorted;
|
|
484
|
+
$[29] = isSortable;
|
|
485
|
+
$[30] = sortDescriptor;
|
|
486
|
+
$[31] = t15;
|
|
487
|
+
} else {
|
|
488
|
+
t15 = $[31];
|
|
489
|
+
}
|
|
490
|
+
const renderSortIcon = t15;
|
|
491
|
+
const t16 = isResizable ? columnRef : void 0;
|
|
492
|
+
const t17 = isSortable ? "cursor-pointer transition-colors" : "";
|
|
493
|
+
const t18 = isResizing && "select-none";
|
|
494
|
+
let t19;
|
|
495
|
+
if ($[32] !== mergedClass || $[33] !== t17 || $[34] !== t18) {
|
|
496
|
+
t19 = tailwindMerge.twMerge(mergedClass, t17, t18);
|
|
497
|
+
$[32] = mergedClass;
|
|
498
|
+
$[33] = t17;
|
|
499
|
+
$[34] = t18;
|
|
500
|
+
$[35] = t19;
|
|
501
|
+
} else {
|
|
502
|
+
t19 = $[35];
|
|
503
|
+
}
|
|
504
|
+
let t20;
|
|
505
|
+
if ($[36] !== children || $[37] !== header?.information || $[38] !== isChildrenEmpty || $[39] !== renderSortIcon || $[40] !== text) {
|
|
506
|
+
t20 = isChildrenEmpty ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center gap-x-2 font-medium", children: [
|
|
536
507
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
537
508
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-1 text-xs text-foreground-500 dark:text-foreground-500 text-left", children: text }),
|
|
538
509
|
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: [
|
|
@@ -543,43 +514,43 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
543
514
|
] }),
|
|
544
515
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex justify-end", children: renderSortIcon() })
|
|
545
516
|
] }) : children;
|
|
546
|
-
$[
|
|
547
|
-
$[
|
|
548
|
-
$[
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
} else {
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
let
|
|
556
|
-
if ($[
|
|
557
|
-
|
|
558
|
-
$[
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
561
|
-
$[
|
|
562
|
-
} else {
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
let
|
|
566
|
-
if ($[
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
517
|
+
$[36] = children;
|
|
518
|
+
$[37] = header?.information;
|
|
519
|
+
$[38] = isChildrenEmpty;
|
|
520
|
+
$[39] = renderSortIcon;
|
|
521
|
+
$[40] = text;
|
|
522
|
+
$[41] = t20;
|
|
523
|
+
} else {
|
|
524
|
+
t20 = $[41];
|
|
525
|
+
}
|
|
526
|
+
let t21;
|
|
527
|
+
if ($[42] !== handlePointerDown || $[43] !== isResizable || $[44] !== isResizing) {
|
|
528
|
+
t21 = isResizable && /* @__PURE__ */ jsxRuntime.jsx(ResizeHandle, { onPointerDown: handlePointerDown, isResizing });
|
|
529
|
+
$[42] = handlePointerDown;
|
|
530
|
+
$[43] = isResizable;
|
|
531
|
+
$[44] = isResizing;
|
|
532
|
+
$[45] = t21;
|
|
533
|
+
} else {
|
|
534
|
+
t21 = $[45];
|
|
535
|
+
}
|
|
536
|
+
let t22;
|
|
537
|
+
if ($[46] !== colspan || $[47] !== handleSort || $[48] !== mergedStyle || $[49] !== t16 || $[50] !== t19 || $[51] !== t20 || $[52] !== t21) {
|
|
538
|
+
t22 = /* @__PURE__ */ jsxRuntime.jsxs("th", { ref: t16, className: t19, style: mergedStyle, colSpan: colspan, onClick: handleSort, children: [
|
|
539
|
+
t20,
|
|
540
|
+
t21
|
|
570
541
|
] });
|
|
571
|
-
$[
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
} else {
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
return
|
|
542
|
+
$[46] = colspan;
|
|
543
|
+
$[47] = handleSort;
|
|
544
|
+
$[48] = mergedStyle;
|
|
545
|
+
$[49] = t16;
|
|
546
|
+
$[50] = t19;
|
|
547
|
+
$[51] = t20;
|
|
548
|
+
$[52] = t21;
|
|
549
|
+
$[53] = t22;
|
|
550
|
+
} else {
|
|
551
|
+
t22 = $[53];
|
|
552
|
+
}
|
|
553
|
+
return t22;
|
|
583
554
|
});
|
|
584
555
|
TableHeaderColumn.displayName = "TableHeaderColumn";
|
|
585
556
|
const TableEmptyState = React.memo((t0) => {
|
|
@@ -1351,7 +1322,7 @@ const TableHOC = ({
|
|
|
1351
1322
|
isActions = true,
|
|
1352
1323
|
widthAction = 100,
|
|
1353
1324
|
dataHeader,
|
|
1354
|
-
|
|
1325
|
+
sortDescriptor,
|
|
1355
1326
|
onSortChange,
|
|
1356
1327
|
columnWidths = {},
|
|
1357
1328
|
onColumnResize,
|
|
@@ -1368,7 +1339,7 @@ const TableHOC = ({
|
|
|
1368
1339
|
isActions,
|
|
1369
1340
|
widthAction,
|
|
1370
1341
|
totalColumn: dataHeader?.length || 0,
|
|
1371
|
-
|
|
1342
|
+
sortDescriptor,
|
|
1372
1343
|
onSortChange,
|
|
1373
1344
|
columnWidths,
|
|
1374
1345
|
onColumnResize,
|
|
@@ -1389,12 +1360,12 @@ const Table = Object.assign(TableHOC, {
|
|
|
1389
1360
|
BodyColumn: TableBodyColumn
|
|
1390
1361
|
});
|
|
1391
1362
|
const useTable = (t0) => {
|
|
1392
|
-
const $ = compilerRuntime.c(
|
|
1363
|
+
const $ = compilerRuntime.c(22);
|
|
1393
1364
|
const {
|
|
1394
1365
|
initialDisabledKeys: t1,
|
|
1395
1366
|
initialSelectKey: t2,
|
|
1396
1367
|
initialValueSearch: t3,
|
|
1397
|
-
|
|
1368
|
+
initialSortDescriptor: t4,
|
|
1398
1369
|
initialColumnWidths: t5
|
|
1399
1370
|
} = t0;
|
|
1400
1371
|
let t6;
|
|
@@ -1424,32 +1395,24 @@ const useTable = (t0) => {
|
|
|
1424
1395
|
t8 = $[5];
|
|
1425
1396
|
}
|
|
1426
1397
|
const initialValueSearch = t8;
|
|
1398
|
+
const initialSortDescriptor = t4 === void 0 ? null : t4;
|
|
1427
1399
|
let t9;
|
|
1428
|
-
if ($[6] !==
|
|
1429
|
-
t9 =
|
|
1430
|
-
$[6] =
|
|
1400
|
+
if ($[6] !== t5) {
|
|
1401
|
+
t9 = t5 === void 0 ? {} : t5;
|
|
1402
|
+
$[6] = t5;
|
|
1431
1403
|
$[7] = t9;
|
|
1432
1404
|
} else {
|
|
1433
1405
|
t9 = $[7];
|
|
1434
1406
|
}
|
|
1435
|
-
const
|
|
1436
|
-
let t10;
|
|
1437
|
-
if ($[8] !== t5) {
|
|
1438
|
-
t10 = t5 === void 0 ? {} : t5;
|
|
1439
|
-
$[8] = t5;
|
|
1440
|
-
$[9] = t10;
|
|
1441
|
-
} else {
|
|
1442
|
-
t10 = $[9];
|
|
1443
|
-
}
|
|
1444
|
-
const initialColumnWidths = t10;
|
|
1407
|
+
const initialColumnWidths = t9;
|
|
1445
1408
|
const [selectKeys, setSelectKeys] = React.useState(initialSelectKey);
|
|
1446
1409
|
const [disabledKeys, setDisabledKeys] = React.useState(initialDisabledKeys);
|
|
1447
1410
|
const [valueSearch, setValueSearch] = React.useState(initialValueSearch);
|
|
1448
|
-
const [
|
|
1411
|
+
const [sortDescriptor, setSortDescriptor] = React.useState(initialSortDescriptor);
|
|
1449
1412
|
const [columnWidths, setColumnWidths] = React.useState(initialColumnWidths);
|
|
1450
|
-
let
|
|
1451
|
-
if ($[
|
|
1452
|
-
|
|
1413
|
+
let t10;
|
|
1414
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1415
|
+
t10 = (value) => {
|
|
1453
1416
|
setSelectKeys((prev) => {
|
|
1454
1417
|
const exists = prev.some((el) => el.id === value.id);
|
|
1455
1418
|
if (exists) {
|
|
@@ -1458,44 +1421,44 @@ const useTable = (t0) => {
|
|
|
1458
1421
|
return [...prev, value];
|
|
1459
1422
|
});
|
|
1460
1423
|
};
|
|
1461
|
-
$[
|
|
1424
|
+
$[8] = t10;
|
|
1462
1425
|
} else {
|
|
1463
|
-
|
|
1426
|
+
t10 = $[8];
|
|
1464
1427
|
}
|
|
1465
|
-
const handleSelectKey =
|
|
1466
|
-
let
|
|
1467
|
-
if ($[
|
|
1468
|
-
|
|
1428
|
+
const handleSelectKey = t10;
|
|
1429
|
+
let t11;
|
|
1430
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1431
|
+
t11 = (value_0) => {
|
|
1469
1432
|
setSelectKeys(value_0);
|
|
1470
1433
|
};
|
|
1471
|
-
$[
|
|
1434
|
+
$[9] = t11;
|
|
1472
1435
|
} else {
|
|
1473
|
-
|
|
1436
|
+
t11 = $[9];
|
|
1474
1437
|
}
|
|
1475
|
-
const handleSelectKeys =
|
|
1476
|
-
let
|
|
1477
|
-
if ($[
|
|
1478
|
-
|
|
1438
|
+
const handleSelectKeys = t11;
|
|
1439
|
+
let t12;
|
|
1440
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1441
|
+
t12 = (value_1) => {
|
|
1479
1442
|
setDisabledKeys(value_1);
|
|
1480
1443
|
};
|
|
1481
|
-
$[
|
|
1444
|
+
$[10] = t12;
|
|
1482
1445
|
} else {
|
|
1483
|
-
|
|
1446
|
+
t12 = $[10];
|
|
1484
1447
|
}
|
|
1485
|
-
const handleDisabledKeys =
|
|
1486
|
-
let
|
|
1487
|
-
if ($[
|
|
1488
|
-
|
|
1448
|
+
const handleDisabledKeys = t12;
|
|
1449
|
+
let t13;
|
|
1450
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1451
|
+
t13 = () => {
|
|
1489
1452
|
setSelectKeys([]);
|
|
1490
1453
|
};
|
|
1491
|
-
$[
|
|
1454
|
+
$[11] = t13;
|
|
1492
1455
|
} else {
|
|
1493
|
-
|
|
1456
|
+
t13 = $[11];
|
|
1494
1457
|
}
|
|
1495
|
-
const handleResetSelectKeys =
|
|
1496
|
-
let
|
|
1497
|
-
if ($[
|
|
1498
|
-
|
|
1458
|
+
const handleResetSelectKeys = t13;
|
|
1459
|
+
let t14;
|
|
1460
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1461
|
+
t14 = (key, value_2) => {
|
|
1499
1462
|
setValueSearch((prev_0) => {
|
|
1500
1463
|
if (prev_0[key] === value_2) {
|
|
1501
1464
|
return prev_0;
|
|
@@ -1511,73 +1474,69 @@ const useTable = (t0) => {
|
|
|
1511
1474
|
return newState;
|
|
1512
1475
|
});
|
|
1513
1476
|
};
|
|
1514
|
-
$[
|
|
1477
|
+
$[12] = t14;
|
|
1515
1478
|
} else {
|
|
1516
|
-
|
|
1479
|
+
t14 = $[12];
|
|
1517
1480
|
}
|
|
1518
|
-
const handleSetValueSearch =
|
|
1519
|
-
let
|
|
1520
|
-
if ($[
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
const newSorts = [...prev_1];
|
|
1528
|
-
newSorts[existingIndex] = {
|
|
1529
|
-
...existing,
|
|
1481
|
+
const handleSetValueSearch = t14;
|
|
1482
|
+
let t15;
|
|
1483
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1484
|
+
t15 = (column) => {
|
|
1485
|
+
setSortDescriptor((prev_1) => {
|
|
1486
|
+
if (prev_1?.column === column) {
|
|
1487
|
+
if (prev_1.direction === "asc") {
|
|
1488
|
+
return {
|
|
1489
|
+
column,
|
|
1530
1490
|
direction: "desc"
|
|
1531
1491
|
};
|
|
1532
|
-
return newSorts;
|
|
1533
1492
|
} else {
|
|
1534
|
-
return
|
|
1493
|
+
return null;
|
|
1535
1494
|
}
|
|
1536
1495
|
}
|
|
1537
|
-
return
|
|
1496
|
+
return {
|
|
1538
1497
|
column,
|
|
1539
1498
|
direction: "asc"
|
|
1540
|
-
}
|
|
1499
|
+
};
|
|
1541
1500
|
});
|
|
1542
1501
|
};
|
|
1543
|
-
$[
|
|
1502
|
+
$[13] = t15;
|
|
1544
1503
|
} else {
|
|
1545
|
-
|
|
1504
|
+
t15 = $[13];
|
|
1546
1505
|
}
|
|
1547
|
-
const handleSort =
|
|
1548
|
-
let
|
|
1549
|
-
if ($[
|
|
1550
|
-
|
|
1506
|
+
const handleSort = t15;
|
|
1507
|
+
let t16;
|
|
1508
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1509
|
+
t16 = (columnId, width) => {
|
|
1551
1510
|
setColumnWidths((prev_2) => ({
|
|
1552
1511
|
...prev_2,
|
|
1553
1512
|
[columnId]: width
|
|
1554
1513
|
}));
|
|
1555
1514
|
};
|
|
1556
|
-
$[
|
|
1515
|
+
$[14] = t16;
|
|
1557
1516
|
} else {
|
|
1558
|
-
|
|
1517
|
+
t16 = $[14];
|
|
1559
1518
|
}
|
|
1560
|
-
const handleColumnResize =
|
|
1561
|
-
let
|
|
1562
|
-
if ($[
|
|
1563
|
-
|
|
1519
|
+
const handleColumnResize = t16;
|
|
1520
|
+
let t17;
|
|
1521
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1522
|
+
t17 = (columnId_0, width_0) => {
|
|
1564
1523
|
setColumnWidths((prev_3) => ({
|
|
1565
1524
|
...prev_3,
|
|
1566
1525
|
[columnId_0]: width_0
|
|
1567
1526
|
}));
|
|
1568
1527
|
};
|
|
1569
|
-
$[
|
|
1528
|
+
$[15] = t17;
|
|
1570
1529
|
} else {
|
|
1571
|
-
|
|
1530
|
+
t17 = $[15];
|
|
1572
1531
|
}
|
|
1573
|
-
const handleColumnResizeEnd =
|
|
1574
|
-
let
|
|
1575
|
-
if ($[
|
|
1576
|
-
|
|
1532
|
+
const handleColumnResizeEnd = t17;
|
|
1533
|
+
let t18;
|
|
1534
|
+
if ($[16] !== columnWidths || $[17] !== disabledKeys || $[18] !== selectKeys || $[19] !== sortDescriptor || $[20] !== valueSearch) {
|
|
1535
|
+
t18 = {
|
|
1577
1536
|
selectKeys,
|
|
1578
1537
|
disabledKeys,
|
|
1579
1538
|
valueSearch,
|
|
1580
|
-
|
|
1539
|
+
sortDescriptor,
|
|
1581
1540
|
columnWidths,
|
|
1582
1541
|
handleSelectKeys,
|
|
1583
1542
|
handleSelectKey,
|
|
@@ -1588,16 +1547,16 @@ const useTable = (t0) => {
|
|
|
1588
1547
|
handleColumnResize,
|
|
1589
1548
|
handleColumnResizeEnd
|
|
1590
1549
|
};
|
|
1591
|
-
$[
|
|
1592
|
-
$[
|
|
1593
|
-
$[
|
|
1594
|
-
$[
|
|
1595
|
-
$[
|
|
1596
|
-
$[
|
|
1550
|
+
$[16] = columnWidths;
|
|
1551
|
+
$[17] = disabledKeys;
|
|
1552
|
+
$[18] = selectKeys;
|
|
1553
|
+
$[19] = sortDescriptor;
|
|
1554
|
+
$[20] = valueSearch;
|
|
1555
|
+
$[21] = t18;
|
|
1597
1556
|
} else {
|
|
1598
|
-
|
|
1557
|
+
t18 = $[21];
|
|
1599
1558
|
}
|
|
1600
|
-
return
|
|
1559
|
+
return t18;
|
|
1601
1560
|
};
|
|
1602
1561
|
exports.Table = Table;
|
|
1603
1562
|
exports.TableHOC = TableHOC;
|