@smart-factor/gem-ui-components 0.0.41 → 0.0.43
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GridValidRowModel } from '@mui/x-data-grid-pro';
|
|
2
2
|
import { TableWithPaginationProps } from './types';
|
|
3
3
|
|
|
4
|
-
export declare const TableWithPagination: <T extends GridValidRowModel>({ rowsData, paginationAndSortState, setPaginationAndSortState, isLoading, columns, offset, tableKey, filterModel, onFilterModelChange, pinnedColumns, exportDataAsExcel, }: TableWithPaginationProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const TableWithPagination: <T extends GridValidRowModel>({ rowsData, paginationAndSortState, setPaginationAndSortState, isLoading, columns, offset, tableKey, filterModel, onFilterModelChange, pinnedColumns, exportDataAsExcel, showPaginationFirstAndLastButtons, }: TableWithPaginationProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -48,5 +48,6 @@ export interface TableWithPaginationProps<T extends GridValidRowModel> {
|
|
|
48
48
|
filterModel?: GridFilterModel;
|
|
49
49
|
onFilterModelChange?: (model: GridFilterModel, details: GridCallbackDetails<'filter'>) => void;
|
|
50
50
|
exportDataAsExcel?: (gridApiRef: React.MutableRefObject<GridApiPro>) => void;
|
|
51
|
+
showPaginationFirstAndLastButtons?: boolean;
|
|
51
52
|
}
|
|
52
53
|
export {};
|
package/dist/main.js
CHANGED
|
@@ -38496,40 +38496,41 @@ const AD = (e) => {
|
|
|
38496
38496
|
filterModel: s,
|
|
38497
38497
|
onFilterModelChange: c,
|
|
38498
38498
|
pinnedColumns: u,
|
|
38499
|
-
exportDataAsExcel: d
|
|
38499
|
+
exportDataAsExcel: d,
|
|
38500
|
+
showPaginationFirstAndLastButtons: p = !1
|
|
38500
38501
|
}) => {
|
|
38501
|
-
const
|
|
38502
|
+
const b = Hp(), { state: h } = XO(l, b), [y, v] = Xt({
|
|
38502
38503
|
page: t.page,
|
|
38503
38504
|
pageSize: t.size
|
|
38504
|
-
}),
|
|
38505
|
+
}), O = [
|
|
38505
38506
|
{
|
|
38506
38507
|
field: t.sort.field || "",
|
|
38507
38508
|
sort: t.sort.direction || "asc"
|
|
38508
38509
|
}
|
|
38509
|
-
],
|
|
38510
|
-
const
|
|
38511
|
-
o((
|
|
38512
|
-
var
|
|
38510
|
+
], C = () => {
|
|
38511
|
+
const k = b.current.getSortModel();
|
|
38512
|
+
o((P) => {
|
|
38513
|
+
var w, F;
|
|
38513
38514
|
return {
|
|
38514
|
-
...
|
|
38515
|
+
...P,
|
|
38515
38516
|
sort: {
|
|
38516
|
-
field: ((
|
|
38517
|
-
direction: ((
|
|
38517
|
+
field: ((w = k[0]) == null ? void 0 : w.field) || "",
|
|
38518
|
+
direction: ((F = k[0]) == null ? void 0 : F.sort) || ""
|
|
38518
38519
|
}
|
|
38519
38520
|
};
|
|
38520
38521
|
});
|
|
38521
|
-
},
|
|
38522
|
-
o((
|
|
38523
|
-
...
|
|
38524
|
-
page:
|
|
38525
|
-
size:
|
|
38526
|
-
})),
|
|
38527
|
-
},
|
|
38528
|
-
var
|
|
38522
|
+
}, x = (k) => {
|
|
38523
|
+
o((P) => ({
|
|
38524
|
+
...P,
|
|
38525
|
+
page: k.page,
|
|
38526
|
+
size: k.pageSize
|
|
38527
|
+
})), v(k);
|
|
38528
|
+
}, T = () => {
|
|
38529
|
+
var k, P;
|
|
38529
38530
|
return {
|
|
38530
|
-
...
|
|
38531
|
+
...h,
|
|
38531
38532
|
sorting: {
|
|
38532
|
-
sortModel:
|
|
38533
|
+
sortModel: O
|
|
38533
38534
|
},
|
|
38534
38535
|
pagination: {
|
|
38535
38536
|
paginationModel: {
|
|
@@ -38539,43 +38540,49 @@ const AD = (e) => {
|
|
|
38539
38540
|
},
|
|
38540
38541
|
pinnedColumns: {
|
|
38541
38542
|
left: [
|
|
38542
|
-
...((
|
|
38543
|
+
...((k = h == null ? void 0 : h.pinnedColumns) == null ? void 0 : k.left) || [],
|
|
38543
38544
|
...(u == null ? void 0 : u.left) || []
|
|
38544
38545
|
],
|
|
38545
38546
|
right: [
|
|
38546
|
-
...((
|
|
38547
|
+
...((P = h == null ? void 0 : h.pinnedColumns) == null ? void 0 : P.right) || [],
|
|
38547
38548
|
...(u == null ? void 0 : u.right) || []
|
|
38548
38549
|
]
|
|
38549
38550
|
}
|
|
38550
38551
|
};
|
|
38551
|
-
},
|
|
38552
|
+
}, S = ID(e == null ? void 0 : e.total_elements, 0);
|
|
38552
38553
|
return /* @__PURE__ */ g(VD, { offset: i, children: /* @__PURE__ */ g(
|
|
38553
38554
|
Wp,
|
|
38554
38555
|
{
|
|
38555
38556
|
loading: n,
|
|
38556
|
-
apiRef:
|
|
38557
|
+
apiRef: b,
|
|
38557
38558
|
localeText: RD,
|
|
38558
38559
|
rows: (e == null ? void 0 : e.content) || [],
|
|
38559
38560
|
columns: a,
|
|
38560
|
-
initialState:
|
|
38561
|
+
initialState: T(),
|
|
38561
38562
|
slots: {
|
|
38562
38563
|
// @ts-expect-error missing props passed below
|
|
38563
38564
|
toolbar: jD
|
|
38564
38565
|
},
|
|
38565
38566
|
slotProps: {
|
|
38566
38567
|
toolbar: {
|
|
38567
|
-
gridApiRef:
|
|
38568
|
+
gridApiRef: b,
|
|
38568
38569
|
exportDataAsExcel: d,
|
|
38569
38570
|
isFilterActive: !!s
|
|
38571
|
+
},
|
|
38572
|
+
pagination: {
|
|
38573
|
+
showFirstButton: p,
|
|
38574
|
+
showLastButton: p
|
|
38570
38575
|
}
|
|
38571
38576
|
},
|
|
38572
38577
|
sortingMode: "server",
|
|
38573
|
-
onSortModelChange:
|
|
38578
|
+
onSortModelChange: C,
|
|
38574
38579
|
pagination: !0,
|
|
38575
38580
|
paginationMode: "server",
|
|
38576
|
-
rowCount:
|
|
38577
|
-
paginationModel:
|
|
38578
|
-
|
|
38581
|
+
rowCount: S,
|
|
38582
|
+
paginationModel: y,
|
|
38583
|
+
showFirstButton: !0,
|
|
38584
|
+
showLastButton: !0,
|
|
38585
|
+
onPaginationModelChange: x,
|
|
38579
38586
|
pageSizeOptions: [10, 20, 30, 40, 50],
|
|
38580
38587
|
filterMode: "server",
|
|
38581
38588
|
filterModel: s,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-factor/gem-ui-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Gem UI Components",
|
|
6
6
|
"type": "module",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@mui/x-data-grid-pro": "7.16.0",
|
|
29
29
|
"react": "^18.3.1",
|
|
30
30
|
"react-dom": "^18.3.1",
|
|
31
|
+
"react-hook-form": "^7.53.0",
|
|
31
32
|
"react-router-dom": "^6.26.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"lint-staged": "^15.2.8",
|
|
82
83
|
"lodash-es": "^4.17.21",
|
|
83
84
|
"react-dropzone": "^14.2.3",
|
|
84
|
-
"react-hook-form": "^7.
|
|
85
|
+
"react-hook-form": "^7.53.0",
|
|
85
86
|
"react-hot-toast": "^2.4.1",
|
|
86
87
|
"react-intersection-observer": "^9.13.1",
|
|
87
88
|
"react-router-dom": "^6.26.0"
|