@smart-factor/gem-ui-components 0.0.42 → 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 p = Hp(), { state: b } = XO(l, p), [h, y] = Xt({
38502
+ const b = Hp(), { state: h } = XO(l, b), [y, v] = Xt({
38502
38503
  page: t.page,
38503
38504
  pageSize: t.size
38504
- }), v = [
38505
+ }), O = [
38505
38506
  {
38506
38507
  field: t.sort.field || "",
38507
38508
  sort: t.sort.direction || "asc"
38508
38509
  }
38509
- ], O = () => {
38510
- const S = p.current.getSortModel();
38511
- o((k) => {
38512
- var P, w;
38510
+ ], C = () => {
38511
+ const k = b.current.getSortModel();
38512
+ o((P) => {
38513
+ var w, F;
38513
38514
  return {
38514
- ...k,
38515
+ ...P,
38515
38516
  sort: {
38516
- field: ((P = S[0]) == null ? void 0 : P.field) || "",
38517
- direction: ((w = S[0]) == null ? void 0 : w.sort) || ""
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
- }, C = (S) => {
38522
- o((k) => ({
38523
- ...k,
38524
- page: S.page,
38525
- size: S.pageSize
38526
- })), y(S);
38527
- }, x = () => {
38528
- var S, k;
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
- ...b,
38531
+ ...h,
38531
38532
  sorting: {
38532
- sortModel: v
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
- ...((S = b == null ? void 0 : b.pinnedColumns) == null ? void 0 : S.left) || [],
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
- ...((k = b == null ? void 0 : b.pinnedColumns) == null ? void 0 : k.right) || [],
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
- }, T = ID(e == null ? void 0 : e.total_elements, 0);
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: p,
38557
+ apiRef: b,
38557
38558
  localeText: RD,
38558
38559
  rows: (e == null ? void 0 : e.content) || [],
38559
38560
  columns: a,
38560
- initialState: x(),
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: p,
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: O,
38578
+ onSortModelChange: C,
38574
38579
  pagination: !0,
38575
38580
  paginationMode: "server",
38576
- rowCount: T,
38577
- paginationModel: h,
38578
- onPaginationModelChange: C,
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.42",
3
+ "version": "0.0.43",
4
4
  "private": false,
5
5
  "description": "Gem UI Components",
6
6
  "type": "module",