@mamrp/components 1.0.12 → 1.0.13

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/index.js CHANGED
@@ -3062,19 +3062,20 @@ var Table = ({
3062
3062
  },
3063
3063
  []
3064
3064
  );
3065
+ const shouldShowPagination = !!(paginationModel && setPaginationModel);
3065
3066
  const option = {
3066
3067
  ...!!setsortQuery && {
3067
3068
  sortingMode: "server",
3068
3069
  onSortModelChange: handleSortModelChange,
3069
3070
  sortModel
3070
3071
  },
3071
- ...!pagingmode && { paginationMode: "server" },
3072
- ...pagingmode == "client" && { paginationMode: "client" },
3073
- ...!pagingmode && {
3072
+ ...shouldShowPagination && !pagingmode && { paginationMode: "server" },
3073
+ ...shouldShowPagination && pagingmode == "client" && { paginationMode: "client" },
3074
+ ...shouldShowPagination && !pagingmode && {
3074
3075
  onPaginationModelChange: setPaginationModel,
3075
3076
  paginationModel
3076
3077
  },
3077
- ...pagingmode == "client" && {
3078
+ ...shouldShowPagination && pagingmode == "client" && {
3078
3079
  initialState: {
3079
3080
  pagination: {
3080
3081
  paginationModel: {
@@ -3086,7 +3087,7 @@ var Table = ({
3086
3087
  }
3087
3088
  }
3088
3089
  },
3089
- ...pagingmode == "client" && {
3090
+ ...shouldShowPagination && pagingmode == "client" && {
3090
3091
  paginationModel
3091
3092
  // Connect paginationModel to DataGrid
3092
3093
  }
@@ -3097,7 +3098,7 @@ var Table = ({
3097
3098
  rows,
3098
3099
  columns: columns.map((column) => ({ ...column })),
3099
3100
  disableRowSelectionOnClick: true,
3100
- pagination: true,
3101
+ ...shouldShowPagination ? { pagination: true } : { hideFooter: true },
3101
3102
  sx: {
3102
3103
  fontSize: fontSize ?? "0.875rem",
3103
3104
  "& .MuiDataGrid-columnHeaders": {
@@ -3118,15 +3119,21 @@ var Table = ({
3118
3119
  }
3119
3120
  },
3120
3121
  ...option,
3121
- onPaginationModelChange: setPaginationModel,
3122
+ ...shouldShowPagination && {
3123
+ onPaginationModelChange: setPaginationModel
3124
+ },
3122
3125
  getRowId: rowId,
3123
3126
  disableColumnResize: true,
3124
3127
  autoHeight: true,
3125
- rowCount: totalRows,
3126
- pageSizeOptions: [5, 10, 25, 50, 75, 100],
3127
- slotProps: {
3128
- pagination: {
3129
- labelRowsPerPage: "\u062A\u0639\u062F\u0627\u062F \u062F\u0631 \u0647\u0631 \u0635\u0641\u062D\u0647"
3128
+ ...shouldShowPagination && { rowCount: totalRows },
3129
+ ...shouldShowPagination && {
3130
+ pageSizeOptions: [5, 10, 25, 50, 75, 100]
3131
+ },
3132
+ ...shouldShowPagination && {
3133
+ slotProps: {
3134
+ pagination: {
3135
+ labelRowsPerPage: "\u062A\u0639\u062F\u0627\u062F \u062F\u0631 \u0647\u0631 \u0635\u0641\u062D\u0647"
3136
+ }
3130
3137
  }
3131
3138
  },
3132
3139
  disableColumnMenu: true,