@mamrp/components 1.7.24 → 1.7.26
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.d.mts +81 -5
- package/dist/index.d.ts +81 -5
- package/dist/index.js +42 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -2
package/dist/index.mjs
CHANGED
|
@@ -4916,13 +4916,14 @@ function DraggablePaper({
|
|
|
4916
4916
|
|
|
4917
4917
|
// src/data-table/index.tsx
|
|
4918
4918
|
import ClearIcon from "@mui/icons-material/Clear";
|
|
4919
|
-
import { Box as Box23, Button as Button13 } from "@mui/material";
|
|
4919
|
+
import { Box as Box23, Button as Button13, IconButton as IconButton10, Tooltip as Tooltip4 } from "@mui/material";
|
|
4920
4920
|
import {
|
|
4921
4921
|
MaterialReactTable,
|
|
4922
4922
|
useMaterialReactTable
|
|
4923
4923
|
} from "material-react-table";
|
|
4924
4924
|
import { MRT_Localization_FA } from "material-react-table/locales/fa";
|
|
4925
4925
|
import { useMemo, useRef as useRef6 } from "react";
|
|
4926
|
+
import { MdOutlineRefresh } from "react-icons/md";
|
|
4926
4927
|
var customLocalization = {
|
|
4927
4928
|
...MRT_Localization_FA,
|
|
4928
4929
|
mrt_columns_showHide_resetOrder: "\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC \u062A\u0631\u062A\u06CC\u0628"
|
|
@@ -4936,6 +4937,7 @@ var DataTable = ({
|
|
|
4936
4937
|
onPaginationChange,
|
|
4937
4938
|
totalRows,
|
|
4938
4939
|
manualPagination = true,
|
|
4940
|
+
disablePagination = false,
|
|
4939
4941
|
columnFilters = [],
|
|
4940
4942
|
onColumnFiltersChange,
|
|
4941
4943
|
manualFiltering = true,
|
|
@@ -4963,22 +4965,26 @@ var DataTable = ({
|
|
|
4963
4965
|
localization = customLocalization,
|
|
4964
4966
|
enableColumnVirtualization = false,
|
|
4965
4967
|
columnVirtualizerOptions = { overscan: 10 },
|
|
4966
|
-
enableColumnResizing = false
|
|
4968
|
+
enableColumnResizing = false,
|
|
4969
|
+
layoutMode = "semantic",
|
|
4970
|
+
renderDetailPanel,
|
|
4971
|
+
refetch
|
|
4967
4972
|
}) => {
|
|
4968
4973
|
const memoizedColumns = useMemo(() => columns, [columns]);
|
|
4969
4974
|
const memoizedData = useMemo(() => data, [data]);
|
|
4970
4975
|
const defaultRenderTopToolbarCustomActions = ({ table: table2 }) => {
|
|
4971
4976
|
const currentShowFilters = showColumnFilters !== void 0 ? showColumnFilters : table2.getState().showColumnFilters;
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
return /* @__PURE__ */ React.createElement(Box23, { sx: { width: "100%" } }, /* @__PURE__ */ React.createElement(
|
|
4977
|
+
const showClearButton = currentShowFilters && showClearFiltersButton && onClearFilters;
|
|
4978
|
+
return /* @__PURE__ */ React.createElement(
|
|
4975
4979
|
Box23,
|
|
4976
4980
|
{
|
|
4977
4981
|
display: "flex",
|
|
4978
4982
|
alignItems: "center",
|
|
4979
|
-
justifyContent: "flex-start"
|
|
4983
|
+
justifyContent: "flex-start",
|
|
4984
|
+
gap: 1
|
|
4980
4985
|
},
|
|
4981
|
-
/* @__PURE__ */ React.createElement(
|
|
4986
|
+
refetch && /* @__PURE__ */ React.createElement(Tooltip4, { arrow: true, title: "\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC" }, /* @__PURE__ */ React.createElement(IconButton10, { onClick: () => refetch() }, /* @__PURE__ */ React.createElement(MdOutlineRefresh, null))),
|
|
4987
|
+
showClearButton && /* @__PURE__ */ React.createElement(
|
|
4982
4988
|
Button13,
|
|
4983
4989
|
{
|
|
4984
4990
|
color: "secondary",
|
|
@@ -4987,21 +4993,24 @@ var DataTable = ({
|
|
|
4987
4993
|
},
|
|
4988
4994
|
"\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC \u0641\u06CC\u0644\u062A\u0631\u0647\u0627"
|
|
4989
4995
|
)
|
|
4990
|
-
)
|
|
4996
|
+
);
|
|
4991
4997
|
};
|
|
4992
4998
|
const columnVirtualizerInstanceRef = useRef6(null);
|
|
4993
4999
|
const table = useMaterialReactTable({
|
|
4994
5000
|
columns: memoizedColumns,
|
|
4995
5001
|
data: memoizedData,
|
|
4996
5002
|
localization,
|
|
4997
|
-
enableColumnResizing
|
|
5003
|
+
enableColumnResizing,
|
|
5004
|
+
layoutMode,
|
|
4998
5005
|
enableColumnVirtualization,
|
|
4999
5006
|
columnVirtualizerInstanceRef,
|
|
5000
5007
|
columnVirtualizerOptions,
|
|
5008
|
+
enableKeyboardShortcuts: false,
|
|
5001
5009
|
// === صفحهبندی ===
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5010
|
+
enablePagination: !disablePagination,
|
|
5011
|
+
manualPagination: disablePagination ? false : manualPagination,
|
|
5012
|
+
onPaginationChange: disablePagination ? void 0 : onPaginationChange,
|
|
5013
|
+
pageCount: !disablePagination && manualPagination ? Math.ceil(totalRows / pagination.pageSize) : void 0,
|
|
5005
5014
|
rowCount: totalRows ?? 0,
|
|
5006
5015
|
// === فیلترینگ ===
|
|
5007
5016
|
manualFiltering,
|
|
@@ -5031,12 +5040,22 @@ var DataTable = ({
|
|
|
5031
5040
|
...onShowColumnFiltersChange && { onShowColumnFiltersChange },
|
|
5032
5041
|
...onColumnOrderChange && { onColumnOrderChange },
|
|
5033
5042
|
// === استایلدهی ===
|
|
5034
|
-
|
|
5035
|
-
muiTableBodyCellProps: {
|
|
5043
|
+
columnResizeDirection: "ltr",
|
|
5044
|
+
muiTableBodyCellProps: {
|
|
5045
|
+
sx: {
|
|
5046
|
+
textAlign: "center",
|
|
5047
|
+
"&:focus": {
|
|
5048
|
+
outline: "none"
|
|
5049
|
+
}
|
|
5050
|
+
}
|
|
5051
|
+
},
|
|
5036
5052
|
muiTableHeadCellProps: {
|
|
5037
5053
|
sx: {
|
|
5054
|
+
"&:focus": {
|
|
5055
|
+
outline: "none"
|
|
5056
|
+
},
|
|
5038
5057
|
"& .Mui-TableHeadCell-Content": {
|
|
5039
|
-
flexDirection: "row
|
|
5058
|
+
flexDirection: "row",
|
|
5040
5059
|
justifyContent: "center"
|
|
5041
5060
|
}
|
|
5042
5061
|
}
|
|
@@ -5050,6 +5069,8 @@ var DataTable = ({
|
|
|
5050
5069
|
initialState: {
|
|
5051
5070
|
density
|
|
5052
5071
|
},
|
|
5072
|
+
// === قابلیتها ===
|
|
5073
|
+
renderDetailPanel: renderDetailPanel ? ({ row, table: table2 }) => renderDetailPanel({ row, table: table2 }) : void 0,
|
|
5053
5074
|
// === تولبارهای سفارشی ===
|
|
5054
5075
|
renderTopToolbarCustomActions: renderTopToolbarCustomActions || defaultRenderTopToolbarCustomActions,
|
|
5055
5076
|
renderBottomToolbarCustomActions,
|
|
@@ -5063,7 +5084,7 @@ var data_table_default = DataTable;
|
|
|
5063
5084
|
// src/img-viewer/index.tsx
|
|
5064
5085
|
import {
|
|
5065
5086
|
Dialog as Dialog7,
|
|
5066
|
-
IconButton as
|
|
5087
|
+
IconButton as IconButton11,
|
|
5067
5088
|
CircularProgress as CircularProgress10,
|
|
5068
5089
|
Box as Box24,
|
|
5069
5090
|
Typography as Typography17
|
|
@@ -5178,11 +5199,11 @@ function imgViewer({
|
|
|
5178
5199
|
alignItems: "center"
|
|
5179
5200
|
}
|
|
5180
5201
|
},
|
|
5181
|
-
/* @__PURE__ */ React.createElement(
|
|
5182
|
-
!noResetBtn && /* @__PURE__ */ React.createElement(
|
|
5183
|
-
!noRotate && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5184
|
-
!noZoom && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5185
|
-
|
|
5202
|
+
/* @__PURE__ */ React.createElement(IconButton11, { onClick: handleClose }, /* @__PURE__ */ React.createElement(MdClose5, { color: "white" })),
|
|
5203
|
+
!noResetBtn && /* @__PURE__ */ React.createElement(IconButton11, { onClick: reset }, /* @__PURE__ */ React.createElement("span", { style: { color: "white", fontSize: "0.9rem" } }, "\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC")),
|
|
5204
|
+
!noRotate && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconButton11, { onClick: () => setRotate((r) => r - 90) }, /* @__PURE__ */ React.createElement(MdRotateLeft2, { color: "white" })), /* @__PURE__ */ React.createElement(IconButton11, { onClick: () => setRotate((r) => r + 90) }, /* @__PURE__ */ React.createElement(MdRotateRight2, { color: "white" }))),
|
|
5205
|
+
!noZoom && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconButton11, { onClick: () => setZoom((z) => z + 0.2) }, /* @__PURE__ */ React.createElement(MdZoomIn2, { color: "white" })), /* @__PURE__ */ React.createElement(
|
|
5206
|
+
IconButton11,
|
|
5186
5207
|
{
|
|
5187
5208
|
onClick: () => setZoom((z) => Math.max(0.2, z - 0.2))
|
|
5188
5209
|
},
|
|
@@ -5247,9 +5268,9 @@ import {
|
|
|
5247
5268
|
DialogContent as DialogContent6,
|
|
5248
5269
|
DialogTitle as DialogTitle6,
|
|
5249
5270
|
Divider as Divider4,
|
|
5250
|
-
IconButton as
|
|
5271
|
+
IconButton as IconButton12,
|
|
5251
5272
|
Stack as Stack7,
|
|
5252
|
-
Tooltip as
|
|
5273
|
+
Tooltip as Tooltip5
|
|
5253
5274
|
} from "@mui/material";
|
|
5254
5275
|
import { MdClose as MdClose6 } from "react-icons/md";
|
|
5255
5276
|
function CustomDialog({
|
|
@@ -5326,8 +5347,8 @@ function CustomDialog({
|
|
|
5326
5347
|
/* @__PURE__ */ React.createElement(Icon, { size: 20 })
|
|
5327
5348
|
)), /* @__PURE__ */ React.createElement(Box25, null, title))
|
|
5328
5349
|
),
|
|
5329
|
-
/* @__PURE__ */ React.createElement(
|
|
5330
|
-
|
|
5350
|
+
/* @__PURE__ */ React.createElement(Tooltip5, { title: "\u0628\u0633\u062A\u0646" }, /* @__PURE__ */ React.createElement(
|
|
5351
|
+
IconButton12,
|
|
5331
5352
|
{
|
|
5332
5353
|
"aria-label": "close",
|
|
5333
5354
|
onClick: onClose,
|