@mamrp/components 1.0.11 → 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
@@ -2505,7 +2505,7 @@ var import_DialogActions3 = __toESM(require("@mui/material/DialogActions"));
2505
2505
  var import_DialogContent5 = __toESM(require("@mui/material/DialogContent"));
2506
2506
  var import_DialogTitle5 = __toESM(require("@mui/material/DialogTitle"));
2507
2507
  var import_material14 = require("@mui/material");
2508
- var import_fa5 = require("react-icons/fa");
2508
+ var import_common2 = require("@mamrp/icons/common");
2509
2509
  var import_md3 = require("react-icons/md");
2510
2510
  function ConfirmationDialog2({
2511
2511
  open,
@@ -2525,7 +2525,7 @@ function ConfirmationDialog2({
2525
2525
  alignItems: "center",
2526
2526
  gap: 1
2527
2527
  },
2528
- /* @__PURE__ */ React14.createElement(import_fa5.FaRegTrashAlt, { style: { color: "red" }, size: 18 }),
2528
+ /* @__PURE__ */ React14.createElement(import_common2.Delete, { style: { color: "red" }, size: 18 }),
2529
2529
  headerText
2530
2530
  ), /* @__PURE__ */ React14.createElement(
2531
2531
  import_material14.IconButton,
@@ -2563,7 +2563,7 @@ function ConfirmationDialog2({
2563
2563
  variant: "contained",
2564
2564
  color: "error",
2565
2565
  sx: { minWidth: "120px" },
2566
- startIcon: isLoading ? /* @__PURE__ */ React14.createElement(import_material14.CircularProgress, { sx: { color: "white" }, size: 20 }) : /* @__PURE__ */ React14.createElement(import_fa5.FaRegTrashAlt, { size: 16 })
2566
+ startIcon: isLoading ? /* @__PURE__ */ React14.createElement(import_material14.CircularProgress, { sx: { color: "white" }, size: 20 }) : /* @__PURE__ */ React14.createElement(import_common2.Delete, { size: 16 })
2567
2567
  },
2568
2568
  "\u062D\u0630\u0641"
2569
2569
  ),
@@ -2630,7 +2630,7 @@ var import_material16 = require("@mui/material");
2630
2630
  var import_Stack = __toESM(require("@mui/material/Stack"));
2631
2631
  var import_system5 = require("@mui/system");
2632
2632
  var React16 = __toESM(require("react"));
2633
- var import_fa6 = require("react-icons/fa");
2633
+ var import_fa5 = require("react-icons/fa");
2634
2634
  function PaginationList({
2635
2635
  currentPage,
2636
2636
  setCurrentPage,
@@ -2674,7 +2674,7 @@ function PaginationList({
2674
2674
  justifyContent: "center"
2675
2675
  },
2676
2676
  size: "large",
2677
- startIcon: /* @__PURE__ */ React16.createElement(import_fa6.FaChevronRight, null)
2677
+ startIcon: /* @__PURE__ */ React16.createElement(import_fa5.FaChevronRight, null)
2678
2678
  },
2679
2679
  "\u0642\u0628\u0644\u06CC",
2680
2680
  " "
@@ -2715,7 +2715,7 @@ function PaginationList({
2715
2715
  justifyContent: "center"
2716
2716
  },
2717
2717
  size: "large",
2718
- endIcon: /* @__PURE__ */ React16.createElement(import_fa6.FaChevronLeft, null)
2718
+ endIcon: /* @__PURE__ */ React16.createElement(import_fa5.FaChevronLeft, null)
2719
2719
  },
2720
2720
  "\u0628\u0639\u062F\u06CC",
2721
2721
  " "
@@ -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,