lizaui 9.0.60 → 9.0.62
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/resize-handle.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 +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 +167 -197
- package/dist/table/index.cjs.js.map +1 -1
- package/dist/table/index.es.js +167 -197
- package/dist/table/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/table/header/resize-handle.tsx"],"names":[],"mappings":"AAGA,UAAU,iBAAiB;IAC1B,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,iFAAmD,iBAAiB,
|
|
1
|
+
{"version":3,"file":"resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/table/header/resize-handle.tsx"],"names":[],"mappings":"AAGA,UAAU,iBAAiB;IAC1B,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,iFAAmD,iBAAiB,6CA6B3F,CAAC"}
|
|
@@ -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,CA4IzD,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/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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Aa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB,CAAC,KAAK;IAC5C,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;IACjC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC7B,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACnC,YAAY,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACzC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACnC,YAAY,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACzC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAChC,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAC/B,UAAU,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC;CACrC"}
|
package/dist/table/index.cjs.js
CHANGED
|
@@ -108,7 +108,7 @@ const initialValues = {
|
|
|
108
108
|
isActions: true,
|
|
109
109
|
widthAction: 100,
|
|
110
110
|
totalColumn: 0,
|
|
111
|
-
|
|
111
|
+
sortDescriptor: null,
|
|
112
112
|
onSortChange: () => {
|
|
113
113
|
},
|
|
114
114
|
columnWidths: {},
|
|
@@ -309,7 +309,7 @@ const ResizeHandle = React.memo((t0) => {
|
|
|
309
309
|
}
|
|
310
310
|
let t7;
|
|
311
311
|
if ($[8] !== onPointerDown || $[9] !== t2 || $[10] !== t6) {
|
|
312
|
-
t7 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t2, onPointerDown, role: "separator", "aria-orientation": "vertical", "aria-label": "Resize column", children: [
|
|
312
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t2, onPointerDown, onClick: _temp, onDoubleClick: _temp2, role: "separator", "aria-orientation": "vertical", "aria-label": "Resize column", children: [
|
|
313
313
|
t3,
|
|
314
314
|
t6
|
|
315
315
|
] });
|
|
@@ -323,8 +323,14 @@ const ResizeHandle = React.memo((t0) => {
|
|
|
323
323
|
return t7;
|
|
324
324
|
});
|
|
325
325
|
ResizeHandle.displayName = "ResizeHandle";
|
|
326
|
+
function _temp(e) {
|
|
327
|
+
return e.stopPropagation();
|
|
328
|
+
}
|
|
329
|
+
function _temp2(e_0) {
|
|
330
|
+
return e_0.stopPropagation();
|
|
331
|
+
}
|
|
326
332
|
const TableHeaderColumn = React.memo((t0) => {
|
|
327
|
-
const $ = compilerRuntime.c(
|
|
333
|
+
const $ = compilerRuntime.c(55);
|
|
328
334
|
const {
|
|
329
335
|
children,
|
|
330
336
|
className,
|
|
@@ -353,7 +359,7 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
353
359
|
const text = t3 === void 0 ? "" : t3;
|
|
354
360
|
const colspan = t4 === void 0 ? void 0 : t4;
|
|
355
361
|
const {
|
|
356
|
-
|
|
362
|
+
sortDescriptor,
|
|
357
363
|
onSortChange,
|
|
358
364
|
columnWidths,
|
|
359
365
|
onColumnResize,
|
|
@@ -452,87 +458,63 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
452
458
|
const isChildrenEmpty = t13;
|
|
453
459
|
const isSortable = header?.sort;
|
|
454
460
|
header?.id;
|
|
461
|
+
const isCurrentlySorted = sortDescriptor?.column === header?.id;
|
|
455
462
|
let t14;
|
|
456
|
-
if ($[23] !== header
|
|
457
|
-
t14 =
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
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;
|
|
463
|
+
if ($[23] !== header || $[24] !== isResizing || $[25] !== isSortable || $[26] !== onSortChange) {
|
|
464
|
+
t14 = (e) => {
|
|
465
|
+
if (isResizing) {
|
|
466
|
+
e.preventDefault();
|
|
467
|
+
return;
|
|
470
468
|
}
|
|
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 = () => {
|
|
485
469
|
if (isSortable && onSortChange && header?.id) {
|
|
486
470
|
onSortChange(header.id);
|
|
487
471
|
}
|
|
488
472
|
};
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
473
|
+
$[23] = header;
|
|
474
|
+
$[24] = isResizing;
|
|
475
|
+
$[25] = isSortable;
|
|
476
|
+
$[26] = onSortChange;
|
|
477
|
+
$[27] = t14;
|
|
493
478
|
} else {
|
|
494
|
-
|
|
479
|
+
t14 = $[27];
|
|
495
480
|
}
|
|
496
|
-
const handleSort =
|
|
497
|
-
let
|
|
498
|
-
if ($[
|
|
499
|
-
|
|
481
|
+
const handleSort = t14;
|
|
482
|
+
let t15;
|
|
483
|
+
if ($[28] !== icon || $[29] !== isCurrentlySorted || $[30] !== isSortable || $[31] !== sortDescriptor) {
|
|
484
|
+
t15 = () => {
|
|
500
485
|
if (!isSortable) {
|
|
501
486
|
return icon;
|
|
502
487
|
}
|
|
503
|
-
if (
|
|
504
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
505
|
-
sortOrderIndex && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-foreground-500 dark:text-foreground-500", children: sortOrderIndex }),
|
|
506
|
-
currentSort.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" })
|
|
507
|
-
] });
|
|
488
|
+
if (isCurrentlySorted && sortDescriptor) {
|
|
489
|
+
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
490
|
}
|
|
509
491
|
return /* @__PURE__ */ jsxRuntime.jsx(ChevronsUpDown, { className: "h-4 w-4 text-default-300" });
|
|
510
492
|
};
|
|
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
|
-
|
|
493
|
+
$[28] = icon;
|
|
494
|
+
$[29] = isCurrentlySorted;
|
|
495
|
+
$[30] = isSortable;
|
|
496
|
+
$[31] = sortDescriptor;
|
|
497
|
+
$[32] = t15;
|
|
498
|
+
} else {
|
|
499
|
+
t15 = $[32];
|
|
500
|
+
}
|
|
501
|
+
const renderSortIcon = t15;
|
|
502
|
+
const t16 = isResizable ? columnRef : void 0;
|
|
503
|
+
const t17 = isSortable ? "cursor-pointer transition-colors" : "";
|
|
504
|
+
const t18 = isResizing && "select-none";
|
|
505
|
+
let t19;
|
|
506
|
+
if ($[33] !== mergedClass || $[34] !== t17 || $[35] !== t18) {
|
|
507
|
+
t19 = tailwindMerge.twMerge(mergedClass, t17, t18);
|
|
508
|
+
$[33] = mergedClass;
|
|
509
|
+
$[34] = t17;
|
|
510
|
+
$[35] = t18;
|
|
511
|
+
$[36] = t19;
|
|
512
|
+
} else {
|
|
513
|
+
t19 = $[36];
|
|
514
|
+
}
|
|
515
|
+
let t20;
|
|
516
|
+
if ($[37] !== children || $[38] !== header?.information || $[39] !== isChildrenEmpty || $[40] !== renderSortIcon || $[41] !== text) {
|
|
517
|
+
t20 = isChildrenEmpty ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center gap-x-2 font-medium", children: [
|
|
536
518
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
537
519
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-1 text-xs text-foreground-500 dark:text-foreground-500 text-left", children: text }),
|
|
538
520
|
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 +525,43 @@ const TableHeaderColumn = React.memo((t0) => {
|
|
|
543
525
|
] }),
|
|
544
526
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex justify-end", children: renderSortIcon() })
|
|
545
527
|
] }) : 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
|
-
|
|
528
|
+
$[37] = children;
|
|
529
|
+
$[38] = header?.information;
|
|
530
|
+
$[39] = isChildrenEmpty;
|
|
531
|
+
$[40] = renderSortIcon;
|
|
532
|
+
$[41] = text;
|
|
533
|
+
$[42] = t20;
|
|
534
|
+
} else {
|
|
535
|
+
t20 = $[42];
|
|
536
|
+
}
|
|
537
|
+
let t21;
|
|
538
|
+
if ($[43] !== handlePointerDown || $[44] !== isResizable || $[45] !== isResizing) {
|
|
539
|
+
t21 = isResizable && /* @__PURE__ */ jsxRuntime.jsx(ResizeHandle, { onPointerDown: handlePointerDown, isResizing });
|
|
540
|
+
$[43] = handlePointerDown;
|
|
541
|
+
$[44] = isResizable;
|
|
542
|
+
$[45] = isResizing;
|
|
543
|
+
$[46] = t21;
|
|
544
|
+
} else {
|
|
545
|
+
t21 = $[46];
|
|
546
|
+
}
|
|
547
|
+
let t22;
|
|
548
|
+
if ($[47] !== colspan || $[48] !== handleSort || $[49] !== mergedStyle || $[50] !== t16 || $[51] !== t19 || $[52] !== t20 || $[53] !== t21) {
|
|
549
|
+
t22 = /* @__PURE__ */ jsxRuntime.jsxs("th", { ref: t16, className: t19, style: mergedStyle, colSpan: colspan, onClick: handleSort, children: [
|
|
550
|
+
t20,
|
|
551
|
+
t21
|
|
570
552
|
] });
|
|
571
|
-
$[
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
} else {
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
return
|
|
553
|
+
$[47] = colspan;
|
|
554
|
+
$[48] = handleSort;
|
|
555
|
+
$[49] = mergedStyle;
|
|
556
|
+
$[50] = t16;
|
|
557
|
+
$[51] = t19;
|
|
558
|
+
$[52] = t20;
|
|
559
|
+
$[53] = t21;
|
|
560
|
+
$[54] = t22;
|
|
561
|
+
} else {
|
|
562
|
+
t22 = $[54];
|
|
563
|
+
}
|
|
564
|
+
return t22;
|
|
583
565
|
});
|
|
584
566
|
TableHeaderColumn.displayName = "TableHeaderColumn";
|
|
585
567
|
const TableEmptyState = React.memo((t0) => {
|
|
@@ -1351,7 +1333,7 @@ const TableHOC = ({
|
|
|
1351
1333
|
isActions = true,
|
|
1352
1334
|
widthAction = 100,
|
|
1353
1335
|
dataHeader,
|
|
1354
|
-
|
|
1336
|
+
sortDescriptor,
|
|
1355
1337
|
onSortChange,
|
|
1356
1338
|
columnWidths = {},
|
|
1357
1339
|
onColumnResize,
|
|
@@ -1368,7 +1350,7 @@ const TableHOC = ({
|
|
|
1368
1350
|
isActions,
|
|
1369
1351
|
widthAction,
|
|
1370
1352
|
totalColumn: dataHeader?.length || 0,
|
|
1371
|
-
|
|
1353
|
+
sortDescriptor,
|
|
1372
1354
|
onSortChange,
|
|
1373
1355
|
columnWidths,
|
|
1374
1356
|
onColumnResize,
|
|
@@ -1389,12 +1371,12 @@ const Table = Object.assign(TableHOC, {
|
|
|
1389
1371
|
BodyColumn: TableBodyColumn
|
|
1390
1372
|
});
|
|
1391
1373
|
const useTable = (t0) => {
|
|
1392
|
-
const $ = compilerRuntime.c(
|
|
1374
|
+
const $ = compilerRuntime.c(22);
|
|
1393
1375
|
const {
|
|
1394
1376
|
initialDisabledKeys: t1,
|
|
1395
1377
|
initialSelectKey: t2,
|
|
1396
1378
|
initialValueSearch: t3,
|
|
1397
|
-
|
|
1379
|
+
initialSortDescriptor: t4,
|
|
1398
1380
|
initialColumnWidths: t5
|
|
1399
1381
|
} = t0;
|
|
1400
1382
|
let t6;
|
|
@@ -1424,32 +1406,24 @@ const useTable = (t0) => {
|
|
|
1424
1406
|
t8 = $[5];
|
|
1425
1407
|
}
|
|
1426
1408
|
const initialValueSearch = t8;
|
|
1409
|
+
const initialSortDescriptor = t4 === void 0 ? null : t4;
|
|
1427
1410
|
let t9;
|
|
1428
|
-
if ($[6] !==
|
|
1429
|
-
t9 =
|
|
1430
|
-
$[6] =
|
|
1411
|
+
if ($[6] !== t5) {
|
|
1412
|
+
t9 = t5 === void 0 ? {} : t5;
|
|
1413
|
+
$[6] = t5;
|
|
1431
1414
|
$[7] = t9;
|
|
1432
1415
|
} else {
|
|
1433
1416
|
t9 = $[7];
|
|
1434
1417
|
}
|
|
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;
|
|
1418
|
+
const initialColumnWidths = t9;
|
|
1445
1419
|
const [selectKeys, setSelectKeys] = React.useState(initialSelectKey);
|
|
1446
1420
|
const [disabledKeys, setDisabledKeys] = React.useState(initialDisabledKeys);
|
|
1447
1421
|
const [valueSearch, setValueSearch] = React.useState(initialValueSearch);
|
|
1448
|
-
const [
|
|
1422
|
+
const [sortDescriptor, setSortDescriptor] = React.useState(initialSortDescriptor);
|
|
1449
1423
|
const [columnWidths, setColumnWidths] = React.useState(initialColumnWidths);
|
|
1450
|
-
let
|
|
1451
|
-
if ($[
|
|
1452
|
-
|
|
1424
|
+
let t10;
|
|
1425
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1426
|
+
t10 = (value) => {
|
|
1453
1427
|
setSelectKeys((prev) => {
|
|
1454
1428
|
const exists = prev.some((el) => el.id === value.id);
|
|
1455
1429
|
if (exists) {
|
|
@@ -1458,44 +1432,44 @@ const useTable = (t0) => {
|
|
|
1458
1432
|
return [...prev, value];
|
|
1459
1433
|
});
|
|
1460
1434
|
};
|
|
1461
|
-
$[
|
|
1435
|
+
$[8] = t10;
|
|
1462
1436
|
} else {
|
|
1463
|
-
|
|
1437
|
+
t10 = $[8];
|
|
1464
1438
|
}
|
|
1465
|
-
const handleSelectKey =
|
|
1466
|
-
let
|
|
1467
|
-
if ($[
|
|
1468
|
-
|
|
1439
|
+
const handleSelectKey = t10;
|
|
1440
|
+
let t11;
|
|
1441
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1442
|
+
t11 = (value_0) => {
|
|
1469
1443
|
setSelectKeys(value_0);
|
|
1470
1444
|
};
|
|
1471
|
-
$[
|
|
1445
|
+
$[9] = t11;
|
|
1472
1446
|
} else {
|
|
1473
|
-
|
|
1447
|
+
t11 = $[9];
|
|
1474
1448
|
}
|
|
1475
|
-
const handleSelectKeys =
|
|
1476
|
-
let
|
|
1477
|
-
if ($[
|
|
1478
|
-
|
|
1449
|
+
const handleSelectKeys = t11;
|
|
1450
|
+
let t12;
|
|
1451
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1452
|
+
t12 = (value_1) => {
|
|
1479
1453
|
setDisabledKeys(value_1);
|
|
1480
1454
|
};
|
|
1481
|
-
$[
|
|
1455
|
+
$[10] = t12;
|
|
1482
1456
|
} else {
|
|
1483
|
-
|
|
1457
|
+
t12 = $[10];
|
|
1484
1458
|
}
|
|
1485
|
-
const handleDisabledKeys =
|
|
1486
|
-
let
|
|
1487
|
-
if ($[
|
|
1488
|
-
|
|
1459
|
+
const handleDisabledKeys = t12;
|
|
1460
|
+
let t13;
|
|
1461
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1462
|
+
t13 = () => {
|
|
1489
1463
|
setSelectKeys([]);
|
|
1490
1464
|
};
|
|
1491
|
-
$[
|
|
1465
|
+
$[11] = t13;
|
|
1492
1466
|
} else {
|
|
1493
|
-
|
|
1467
|
+
t13 = $[11];
|
|
1494
1468
|
}
|
|
1495
|
-
const handleResetSelectKeys =
|
|
1496
|
-
let
|
|
1497
|
-
if ($[
|
|
1498
|
-
|
|
1469
|
+
const handleResetSelectKeys = t13;
|
|
1470
|
+
let t14;
|
|
1471
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1472
|
+
t14 = (key, value_2) => {
|
|
1499
1473
|
setValueSearch((prev_0) => {
|
|
1500
1474
|
if (prev_0[key] === value_2) {
|
|
1501
1475
|
return prev_0;
|
|
@@ -1511,73 +1485,69 @@ const useTable = (t0) => {
|
|
|
1511
1485
|
return newState;
|
|
1512
1486
|
});
|
|
1513
1487
|
};
|
|
1514
|
-
$[
|
|
1488
|
+
$[12] = t14;
|
|
1515
1489
|
} else {
|
|
1516
|
-
|
|
1490
|
+
t14 = $[12];
|
|
1517
1491
|
}
|
|
1518
|
-
const handleSetValueSearch =
|
|
1519
|
-
let
|
|
1520
|
-
if ($[
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
const newSorts = [...prev_1];
|
|
1528
|
-
newSorts[existingIndex] = {
|
|
1529
|
-
...existing,
|
|
1492
|
+
const handleSetValueSearch = t14;
|
|
1493
|
+
let t15;
|
|
1494
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1495
|
+
t15 = (column) => {
|
|
1496
|
+
setSortDescriptor((prev_1) => {
|
|
1497
|
+
if (prev_1?.column === column) {
|
|
1498
|
+
if (prev_1.direction === "asc") {
|
|
1499
|
+
return {
|
|
1500
|
+
column,
|
|
1530
1501
|
direction: "desc"
|
|
1531
1502
|
};
|
|
1532
|
-
return newSorts;
|
|
1533
1503
|
} else {
|
|
1534
|
-
return
|
|
1504
|
+
return null;
|
|
1535
1505
|
}
|
|
1536
1506
|
}
|
|
1537
|
-
return
|
|
1507
|
+
return {
|
|
1538
1508
|
column,
|
|
1539
1509
|
direction: "asc"
|
|
1540
|
-
}
|
|
1510
|
+
};
|
|
1541
1511
|
});
|
|
1542
1512
|
};
|
|
1543
|
-
$[
|
|
1513
|
+
$[13] = t15;
|
|
1544
1514
|
} else {
|
|
1545
|
-
|
|
1515
|
+
t15 = $[13];
|
|
1546
1516
|
}
|
|
1547
|
-
const handleSort =
|
|
1548
|
-
let
|
|
1549
|
-
if ($[
|
|
1550
|
-
|
|
1517
|
+
const handleSort = t15;
|
|
1518
|
+
let t16;
|
|
1519
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1520
|
+
t16 = (columnId, width) => {
|
|
1551
1521
|
setColumnWidths((prev_2) => ({
|
|
1552
1522
|
...prev_2,
|
|
1553
1523
|
[columnId]: width
|
|
1554
1524
|
}));
|
|
1555
1525
|
};
|
|
1556
|
-
$[
|
|
1526
|
+
$[14] = t16;
|
|
1557
1527
|
} else {
|
|
1558
|
-
|
|
1528
|
+
t16 = $[14];
|
|
1559
1529
|
}
|
|
1560
|
-
const handleColumnResize =
|
|
1561
|
-
let
|
|
1562
|
-
if ($[
|
|
1563
|
-
|
|
1530
|
+
const handleColumnResize = t16;
|
|
1531
|
+
let t17;
|
|
1532
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1533
|
+
t17 = (columnId_0, width_0) => {
|
|
1564
1534
|
setColumnWidths((prev_3) => ({
|
|
1565
1535
|
...prev_3,
|
|
1566
1536
|
[columnId_0]: width_0
|
|
1567
1537
|
}));
|
|
1568
1538
|
};
|
|
1569
|
-
$[
|
|
1539
|
+
$[15] = t17;
|
|
1570
1540
|
} else {
|
|
1571
|
-
|
|
1541
|
+
t17 = $[15];
|
|
1572
1542
|
}
|
|
1573
|
-
const handleColumnResizeEnd =
|
|
1574
|
-
let
|
|
1575
|
-
if ($[
|
|
1576
|
-
|
|
1543
|
+
const handleColumnResizeEnd = t17;
|
|
1544
|
+
let t18;
|
|
1545
|
+
if ($[16] !== columnWidths || $[17] !== disabledKeys || $[18] !== selectKeys || $[19] !== sortDescriptor || $[20] !== valueSearch) {
|
|
1546
|
+
t18 = {
|
|
1577
1547
|
selectKeys,
|
|
1578
1548
|
disabledKeys,
|
|
1579
1549
|
valueSearch,
|
|
1580
|
-
|
|
1550
|
+
sortDescriptor,
|
|
1581
1551
|
columnWidths,
|
|
1582
1552
|
handleSelectKeys,
|
|
1583
1553
|
handleSelectKey,
|
|
@@ -1588,16 +1558,16 @@ const useTable = (t0) => {
|
|
|
1588
1558
|
handleColumnResize,
|
|
1589
1559
|
handleColumnResizeEnd
|
|
1590
1560
|
};
|
|
1591
|
-
$[
|
|
1592
|
-
$[
|
|
1593
|
-
$[
|
|
1594
|
-
$[
|
|
1595
|
-
$[
|
|
1596
|
-
$[
|
|
1561
|
+
$[16] = columnWidths;
|
|
1562
|
+
$[17] = disabledKeys;
|
|
1563
|
+
$[18] = selectKeys;
|
|
1564
|
+
$[19] = sortDescriptor;
|
|
1565
|
+
$[20] = valueSearch;
|
|
1566
|
+
$[21] = t18;
|
|
1597
1567
|
} else {
|
|
1598
|
-
|
|
1568
|
+
t18 = $[21];
|
|
1599
1569
|
}
|
|
1600
|
-
return
|
|
1570
|
+
return t18;
|
|
1601
1571
|
};
|
|
1602
1572
|
exports.Table = Table;
|
|
1603
1573
|
exports.TableHOC = TableHOC;
|