@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 +25 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2460,7 +2460,7 @@ import {
|
|
|
2460
2460
|
Divider as Divider3,
|
|
2461
2461
|
IconButton as IconButton5
|
|
2462
2462
|
} from "@mui/material";
|
|
2463
|
-
import {
|
|
2463
|
+
import { Delete } from "@mamrp/icons/common";
|
|
2464
2464
|
import { MdClose as MdClose3, MdOutlineCancel as MdOutlineCancel2 } from "react-icons/md";
|
|
2465
2465
|
function ConfirmationDialog2({
|
|
2466
2466
|
open,
|
|
@@ -2480,7 +2480,7 @@ function ConfirmationDialog2({
|
|
|
2480
2480
|
alignItems: "center",
|
|
2481
2481
|
gap: 1
|
|
2482
2482
|
},
|
|
2483
|
-
/* @__PURE__ */ React14.createElement(
|
|
2483
|
+
/* @__PURE__ */ React14.createElement(Delete, { style: { color: "red" }, size: 18 }),
|
|
2484
2484
|
headerText
|
|
2485
2485
|
), /* @__PURE__ */ React14.createElement(
|
|
2486
2486
|
IconButton5,
|
|
@@ -2518,7 +2518,7 @@ function ConfirmationDialog2({
|
|
|
2518
2518
|
variant: "contained",
|
|
2519
2519
|
color: "error",
|
|
2520
2520
|
sx: { minWidth: "120px" },
|
|
2521
|
-
startIcon: isLoading ? /* @__PURE__ */ React14.createElement(CircularProgress2, { sx: { color: "white" }, size: 20 }) : /* @__PURE__ */ React14.createElement(
|
|
2521
|
+
startIcon: isLoading ? /* @__PURE__ */ React14.createElement(CircularProgress2, { sx: { color: "white" }, size: 20 }) : /* @__PURE__ */ React14.createElement(Delete, { size: 16 })
|
|
2522
2522
|
},
|
|
2523
2523
|
"\u062D\u0630\u0641"
|
|
2524
2524
|
),
|
|
@@ -3035,19 +3035,20 @@ var Table = ({
|
|
|
3035
3035
|
},
|
|
3036
3036
|
[]
|
|
3037
3037
|
);
|
|
3038
|
+
const shouldShowPagination = !!(paginationModel && setPaginationModel);
|
|
3038
3039
|
const option = {
|
|
3039
3040
|
...!!setsortQuery && {
|
|
3040
3041
|
sortingMode: "server",
|
|
3041
3042
|
onSortModelChange: handleSortModelChange,
|
|
3042
3043
|
sortModel
|
|
3043
3044
|
},
|
|
3044
|
-
|
|
3045
|
-
...pagingmode == "client" && { paginationMode: "client" },
|
|
3046
|
-
|
|
3045
|
+
...shouldShowPagination && !pagingmode && { paginationMode: "server" },
|
|
3046
|
+
...shouldShowPagination && pagingmode == "client" && { paginationMode: "client" },
|
|
3047
|
+
...shouldShowPagination && !pagingmode && {
|
|
3047
3048
|
onPaginationModelChange: setPaginationModel,
|
|
3048
3049
|
paginationModel
|
|
3049
3050
|
},
|
|
3050
|
-
...pagingmode == "client" && {
|
|
3051
|
+
...shouldShowPagination && pagingmode == "client" && {
|
|
3051
3052
|
initialState: {
|
|
3052
3053
|
pagination: {
|
|
3053
3054
|
paginationModel: {
|
|
@@ -3059,7 +3060,7 @@ var Table = ({
|
|
|
3059
3060
|
}
|
|
3060
3061
|
}
|
|
3061
3062
|
},
|
|
3062
|
-
...pagingmode == "client" && {
|
|
3063
|
+
...shouldShowPagination && pagingmode == "client" && {
|
|
3063
3064
|
paginationModel
|
|
3064
3065
|
// Connect paginationModel to DataGrid
|
|
3065
3066
|
}
|
|
@@ -3070,7 +3071,7 @@ var Table = ({
|
|
|
3070
3071
|
rows,
|
|
3071
3072
|
columns: columns.map((column) => ({ ...column })),
|
|
3072
3073
|
disableRowSelectionOnClick: true,
|
|
3073
|
-
pagination: true,
|
|
3074
|
+
...shouldShowPagination ? { pagination: true } : { hideFooter: true },
|
|
3074
3075
|
sx: {
|
|
3075
3076
|
fontSize: fontSize ?? "0.875rem",
|
|
3076
3077
|
"& .MuiDataGrid-columnHeaders": {
|
|
@@ -3091,15 +3092,21 @@ var Table = ({
|
|
|
3091
3092
|
}
|
|
3092
3093
|
},
|
|
3093
3094
|
...option,
|
|
3094
|
-
|
|
3095
|
+
...shouldShowPagination && {
|
|
3096
|
+
onPaginationModelChange: setPaginationModel
|
|
3097
|
+
},
|
|
3095
3098
|
getRowId: rowId,
|
|
3096
3099
|
disableColumnResize: true,
|
|
3097
3100
|
autoHeight: true,
|
|
3098
|
-
rowCount: totalRows,
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3101
|
+
...shouldShowPagination && { rowCount: totalRows },
|
|
3102
|
+
...shouldShowPagination && {
|
|
3103
|
+
pageSizeOptions: [5, 10, 25, 50, 75, 100]
|
|
3104
|
+
},
|
|
3105
|
+
...shouldShowPagination && {
|
|
3106
|
+
slotProps: {
|
|
3107
|
+
pagination: {
|
|
3108
|
+
labelRowsPerPage: "\u062A\u0639\u062F\u0627\u062F \u062F\u0631 \u0647\u0631 \u0635\u0641\u062D\u0647"
|
|
3109
|
+
}
|
|
3103
3110
|
}
|
|
3104
3111
|
},
|
|
3105
3112
|
disableColumnMenu: true,
|