@smart-factor/gem-ui-components 0.0.42 → 0.0.44

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.
@@ -6,4 +6,4 @@ export type SimpleInputProps<T extends SelectInputProps['value']> = {
6
6
  onChange(newValue: T): void;
7
7
  errorMessage?: string | null;
8
8
  } & TextFieldProps;
9
- export declare const SimpleInput: <T extends unknown>({ id, value, label, onChange, type, sx, errorMessage, }: SimpleInputProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const SimpleInput: <T extends unknown>({ id, value, label, onChange, type, sx, errorMessage, disabled, }: SimpleInputProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -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
@@ -31303,7 +31303,8 @@ const mM = A(yr)`
31303
31303
  onChange: n,
31304
31304
  type: a,
31305
31305
  sx: i,
31306
- errorMessage: l
31306
+ errorMessage: l,
31307
+ disabled: s
31307
31308
  }) => /* @__PURE__ */ g(yr, { variant: "standard", children: /* @__PURE__ */ g(
31308
31309
  jd,
31309
31310
  {
@@ -31312,7 +31313,8 @@ const mM = A(yr)`
31312
31313
  type: a,
31313
31314
  value: t,
31314
31315
  sx: i,
31315
- onChange: (s) => n(s.target.value),
31316
+ disabled: s,
31317
+ onChange: (c) => n(c.target.value),
31316
31318
  label: o,
31317
31319
  error: !!l,
31318
31320
  helperText: l
@@ -38496,40 +38498,41 @@ const AD = (e) => {
38496
38498
  filterModel: s,
38497
38499
  onFilterModelChange: c,
38498
38500
  pinnedColumns: u,
38499
- exportDataAsExcel: d
38501
+ exportDataAsExcel: d,
38502
+ showPaginationFirstAndLastButtons: p = !1
38500
38503
  }) => {
38501
- const p = Hp(), { state: b } = XO(l, p), [h, y] = Xt({
38504
+ const b = Hp(), { state: h } = XO(l, b), [y, v] = Xt({
38502
38505
  page: t.page,
38503
38506
  pageSize: t.size
38504
- }), v = [
38507
+ }), O = [
38505
38508
  {
38506
38509
  field: t.sort.field || "",
38507
38510
  sort: t.sort.direction || "asc"
38508
38511
  }
38509
- ], O = () => {
38510
- const S = p.current.getSortModel();
38511
- o((k) => {
38512
- var P, w;
38512
+ ], C = () => {
38513
+ const k = b.current.getSortModel();
38514
+ o((P) => {
38515
+ var w, F;
38513
38516
  return {
38514
- ...k,
38517
+ ...P,
38515
38518
  sort: {
38516
- field: ((P = S[0]) == null ? void 0 : P.field) || "",
38517
- direction: ((w = S[0]) == null ? void 0 : w.sort) || ""
38519
+ field: ((w = k[0]) == null ? void 0 : w.field) || "",
38520
+ direction: ((F = k[0]) == null ? void 0 : F.sort) || ""
38518
38521
  }
38519
38522
  };
38520
38523
  });
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;
38524
+ }, x = (k) => {
38525
+ o((P) => ({
38526
+ ...P,
38527
+ page: k.page,
38528
+ size: k.pageSize
38529
+ })), v(k);
38530
+ }, T = () => {
38531
+ var k, P;
38529
38532
  return {
38530
- ...b,
38533
+ ...h,
38531
38534
  sorting: {
38532
- sortModel: v
38535
+ sortModel: O
38533
38536
  },
38534
38537
  pagination: {
38535
38538
  paginationModel: {
@@ -38539,43 +38542,49 @@ const AD = (e) => {
38539
38542
  },
38540
38543
  pinnedColumns: {
38541
38544
  left: [
38542
- ...((S = b == null ? void 0 : b.pinnedColumns) == null ? void 0 : S.left) || [],
38545
+ ...((k = h == null ? void 0 : h.pinnedColumns) == null ? void 0 : k.left) || [],
38543
38546
  ...(u == null ? void 0 : u.left) || []
38544
38547
  ],
38545
38548
  right: [
38546
- ...((k = b == null ? void 0 : b.pinnedColumns) == null ? void 0 : k.right) || [],
38549
+ ...((P = h == null ? void 0 : h.pinnedColumns) == null ? void 0 : P.right) || [],
38547
38550
  ...(u == null ? void 0 : u.right) || []
38548
38551
  ]
38549
38552
  }
38550
38553
  };
38551
- }, T = ID(e == null ? void 0 : e.total_elements, 0);
38554
+ }, S = ID(e == null ? void 0 : e.total_elements, 0);
38552
38555
  return /* @__PURE__ */ g(VD, { offset: i, children: /* @__PURE__ */ g(
38553
38556
  Wp,
38554
38557
  {
38555
38558
  loading: n,
38556
- apiRef: p,
38559
+ apiRef: b,
38557
38560
  localeText: RD,
38558
38561
  rows: (e == null ? void 0 : e.content) || [],
38559
38562
  columns: a,
38560
- initialState: x(),
38563
+ initialState: T(),
38561
38564
  slots: {
38562
38565
  // @ts-expect-error missing props passed below
38563
38566
  toolbar: jD
38564
38567
  },
38565
38568
  slotProps: {
38566
38569
  toolbar: {
38567
- gridApiRef: p,
38570
+ gridApiRef: b,
38568
38571
  exportDataAsExcel: d,
38569
38572
  isFilterActive: !!s
38573
+ },
38574
+ pagination: {
38575
+ showFirstButton: p,
38576
+ showLastButton: p
38570
38577
  }
38571
38578
  },
38572
38579
  sortingMode: "server",
38573
- onSortModelChange: O,
38580
+ onSortModelChange: C,
38574
38581
  pagination: !0,
38575
38582
  paginationMode: "server",
38576
- rowCount: T,
38577
- paginationModel: h,
38578
- onPaginationModelChange: C,
38583
+ rowCount: S,
38584
+ paginationModel: y,
38585
+ showFirstButton: !0,
38586
+ showLastButton: !0,
38587
+ onPaginationModelChange: x,
38579
38588
  pageSizeOptions: [10, 20, 30, 40, 50],
38580
38589
  filterMode: "server",
38581
38590
  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.44",
4
4
  "private": false,
5
5
  "description": "Gem UI Components",
6
6
  "type": "module",