@mamrp/components 1.7.16 → 1.7.18
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 +22 -3
- package/dist/index.d.ts +22 -3
- package/dist/index.js +317 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +331 -67
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -331,8 +331,9 @@ type UploadImageProps$1<T extends FieldValues> = {
|
|
|
331
331
|
height?: string;
|
|
332
332
|
allowGallery?: boolean;
|
|
333
333
|
imageFit?: "contain" | "cover";
|
|
334
|
+
disableCamera?: boolean;
|
|
334
335
|
};
|
|
335
|
-
declare const UploadImage$1: <T extends FieldValues>({ placeholder, name, selectedImage, setSelectedImage, control, errors, setValue, height, allowGallery, imageFit, }: UploadImageProps$1<T>) => React__default.JSX.Element;
|
|
336
|
+
declare const UploadImage$1: <T extends FieldValues>({ placeholder, name, selectedImage, setSelectedImage, control, errors, setValue, height, allowGallery, imageFit, disableCamera, }: UploadImageProps$1<T>) => React__default.JSX.Element;
|
|
336
337
|
|
|
337
338
|
type UploadImageProps<T extends FieldValues> = {
|
|
338
339
|
placeholder: string;
|
|
@@ -610,6 +611,18 @@ type DataTableProps<T extends Record<string, any>> = {
|
|
|
610
611
|
*/
|
|
611
612
|
declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, showColumnFilters, onShowColumnFiltersChange, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, enableColumnVirtualization, columnVirtualizerOptions, enableColumnResizing, }: DataTableProps<T>) => React$1.JSX.Element;
|
|
612
613
|
|
|
614
|
+
declare function imgViewer({ open, handleClose, src, isLoading, title, noResetBtn, noRotate, noZoom, unoptimized, }: {
|
|
615
|
+
open: boolean;
|
|
616
|
+
handleClose: () => void;
|
|
617
|
+
isLoading: boolean;
|
|
618
|
+
src: string | undefined;
|
|
619
|
+
title?: string;
|
|
620
|
+
unoptimized?: boolean;
|
|
621
|
+
noResetBtn?: boolean;
|
|
622
|
+
noRotate?: boolean;
|
|
623
|
+
noZoom?: boolean;
|
|
624
|
+
}): React$1.JSX.Element;
|
|
625
|
+
|
|
613
626
|
type PaletteColor = "primary" | "secondary" | "error" | "warning" | "info" | "success" | "tertiary" | "accent" | "successLight" | "orange" | "indigo" | "teal" | "pinkLight" | "aqua" | "customRed";
|
|
614
627
|
interface CustomDialogProps {
|
|
615
628
|
title: string;
|
|
@@ -619,10 +632,16 @@ interface CustomDialogProps {
|
|
|
619
632
|
onClose: () => void;
|
|
620
633
|
maxWidth?: DialogProps["maxWidth"];
|
|
621
634
|
fullWidth?: boolean;
|
|
635
|
+
fullScreen?: boolean;
|
|
622
636
|
children: ReactNode;
|
|
623
637
|
actions?: ReactNode;
|
|
624
638
|
isSubmiting?: boolean;
|
|
639
|
+
sx?: SxProps<Theme>;
|
|
640
|
+
paperSx?: SxProps<Theme>;
|
|
641
|
+
contentSx?: SxProps<Theme>;
|
|
642
|
+
titleSx?: SxProps<Theme>;
|
|
643
|
+
actionsSx?: SxProps<Theme>;
|
|
625
644
|
}
|
|
626
|
-
declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, children, actions, isSubmiting, }: CustomDialogProps): React$1.JSX.Element;
|
|
645
|
+
declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, fullScreen, children, actions, isSubmiting, sx, paperSx, contentSx, titleSx, actionsSx, }: CustomDialogProps): React$1.JSX.Element;
|
|
627
646
|
|
|
628
|
-
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, type CustomDialogProps, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, type PaletteColor, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
|
|
647
|
+
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, type CustomDialogProps, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, imgViewer as ImgViewer, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, type PaletteColor, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
|
package/dist/index.d.ts
CHANGED
|
@@ -331,8 +331,9 @@ type UploadImageProps$1<T extends FieldValues> = {
|
|
|
331
331
|
height?: string;
|
|
332
332
|
allowGallery?: boolean;
|
|
333
333
|
imageFit?: "contain" | "cover";
|
|
334
|
+
disableCamera?: boolean;
|
|
334
335
|
};
|
|
335
|
-
declare const UploadImage$1: <T extends FieldValues>({ placeholder, name, selectedImage, setSelectedImage, control, errors, setValue, height, allowGallery, imageFit, }: UploadImageProps$1<T>) => React__default.JSX.Element;
|
|
336
|
+
declare const UploadImage$1: <T extends FieldValues>({ placeholder, name, selectedImage, setSelectedImage, control, errors, setValue, height, allowGallery, imageFit, disableCamera, }: UploadImageProps$1<T>) => React__default.JSX.Element;
|
|
336
337
|
|
|
337
338
|
type UploadImageProps<T extends FieldValues> = {
|
|
338
339
|
placeholder: string;
|
|
@@ -610,6 +611,18 @@ type DataTableProps<T extends Record<string, any>> = {
|
|
|
610
611
|
*/
|
|
611
612
|
declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, showColumnFilters, onShowColumnFiltersChange, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, enableColumnVirtualization, columnVirtualizerOptions, enableColumnResizing, }: DataTableProps<T>) => React$1.JSX.Element;
|
|
612
613
|
|
|
614
|
+
declare function imgViewer({ open, handleClose, src, isLoading, title, noResetBtn, noRotate, noZoom, unoptimized, }: {
|
|
615
|
+
open: boolean;
|
|
616
|
+
handleClose: () => void;
|
|
617
|
+
isLoading: boolean;
|
|
618
|
+
src: string | undefined;
|
|
619
|
+
title?: string;
|
|
620
|
+
unoptimized?: boolean;
|
|
621
|
+
noResetBtn?: boolean;
|
|
622
|
+
noRotate?: boolean;
|
|
623
|
+
noZoom?: boolean;
|
|
624
|
+
}): React$1.JSX.Element;
|
|
625
|
+
|
|
613
626
|
type PaletteColor = "primary" | "secondary" | "error" | "warning" | "info" | "success" | "tertiary" | "accent" | "successLight" | "orange" | "indigo" | "teal" | "pinkLight" | "aqua" | "customRed";
|
|
614
627
|
interface CustomDialogProps {
|
|
615
628
|
title: string;
|
|
@@ -619,10 +632,16 @@ interface CustomDialogProps {
|
|
|
619
632
|
onClose: () => void;
|
|
620
633
|
maxWidth?: DialogProps["maxWidth"];
|
|
621
634
|
fullWidth?: boolean;
|
|
635
|
+
fullScreen?: boolean;
|
|
622
636
|
children: ReactNode;
|
|
623
637
|
actions?: ReactNode;
|
|
624
638
|
isSubmiting?: boolean;
|
|
639
|
+
sx?: SxProps<Theme>;
|
|
640
|
+
paperSx?: SxProps<Theme>;
|
|
641
|
+
contentSx?: SxProps<Theme>;
|
|
642
|
+
titleSx?: SxProps<Theme>;
|
|
643
|
+
actionsSx?: SxProps<Theme>;
|
|
625
644
|
}
|
|
626
|
-
declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, children, actions, isSubmiting, }: CustomDialogProps): React$1.JSX.Element;
|
|
645
|
+
declare function CustomDialog({ title, icon: Icon, iconColor, open, onClose, maxWidth, fullWidth, fullScreen, children, actions, isSubmiting, sx, paperSx, contentSx, titleSx, actionsSx, }: CustomDialogProps): React$1.JSX.Element;
|
|
627
646
|
|
|
628
|
-
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, type CustomDialogProps, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, type PaletteColor, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
|
|
647
|
+
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomDialog, type CustomDialogProps, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, imgViewer as ImgViewer, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, type PaletteColor, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage };
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ __export(src_exports, {
|
|
|
49
49
|
FormInputNumber: () => number_type_default,
|
|
50
50
|
FormInputText: () => text_type_default,
|
|
51
51
|
HorizontalStepper: () => HorizontalStepper,
|
|
52
|
+
ImgViewer: () => imgViewer,
|
|
52
53
|
LicensePlate: () => LicensePlate,
|
|
53
54
|
MobileDateTimePicker: () => mobile_date_time_picker_default,
|
|
54
55
|
Modal: () => ConfirmationDialog2,
|
|
@@ -3919,7 +3920,8 @@ var UploadImage = ({
|
|
|
3919
3920
|
setValue,
|
|
3920
3921
|
height,
|
|
3921
3922
|
allowGallery = false,
|
|
3922
|
-
imageFit = "cover"
|
|
3923
|
+
imageFit = "cover",
|
|
3924
|
+
disableCamera = false
|
|
3923
3925
|
}) => {
|
|
3924
3926
|
const compressImage = (file, quality = 0.8, maxWidth = 800, maxHeight = 800) => {
|
|
3925
3927
|
return new Promise((resolve) => {
|
|
@@ -4030,7 +4032,7 @@ var UploadImage = ({
|
|
|
4030
4032
|
/* @__PURE__ */ import_react23.default.createElement(import_material22.Box, { sx: { paddingBottom: "0.5rem" } }, /* @__PURE__ */ import_react23.default.createElement(import_gr.GrUpload, null)),
|
|
4031
4033
|
placeholder
|
|
4032
4034
|
),
|
|
4033
|
-
allowGallery && /* @__PURE__ */ import_react23.default.createElement(import_material22.Stack, { spacing: 1.5 }, /* @__PURE__ */ import_react23.default.createElement(
|
|
4035
|
+
allowGallery && /* @__PURE__ */ import_react23.default.createElement(import_material22.Stack, { spacing: 1.5 }, !disableCamera && /* @__PURE__ */ import_react23.default.createElement(
|
|
4034
4036
|
import_material22.Button,
|
|
4035
4037
|
{
|
|
4036
4038
|
sx: { width: "9rem" },
|
|
@@ -5053,9 +5055,176 @@ var DataTable = ({
|
|
|
5053
5055
|
};
|
|
5054
5056
|
var data_table_default = DataTable;
|
|
5055
5057
|
|
|
5056
|
-
// src/
|
|
5058
|
+
// src/img-viewer/index.tsx
|
|
5057
5059
|
var import_material31 = require("@mui/material");
|
|
5058
5060
|
var import_md9 = require("react-icons/md");
|
|
5061
|
+
var import_image6 = __toESM(require("next/image"));
|
|
5062
|
+
var import_react31 = require("react");
|
|
5063
|
+
function imgViewer({
|
|
5064
|
+
open,
|
|
5065
|
+
handleClose,
|
|
5066
|
+
src,
|
|
5067
|
+
isLoading,
|
|
5068
|
+
title = "",
|
|
5069
|
+
noResetBtn = false,
|
|
5070
|
+
noRotate = false,
|
|
5071
|
+
noZoom = false,
|
|
5072
|
+
unoptimized = false
|
|
5073
|
+
}) {
|
|
5074
|
+
const [zoom, setZoom] = (0, import_react31.useState)(1);
|
|
5075
|
+
const [rotate, setRotate] = (0, import_react31.useState)(0);
|
|
5076
|
+
const [loading, setLoading] = (0, import_react31.useState)(true);
|
|
5077
|
+
const [position, setPosition] = (0, import_react31.useState)({ x: 0, y: 0 });
|
|
5078
|
+
const [dragging, setDragging] = (0, import_react31.useState)(false);
|
|
5079
|
+
const [startMouse, setStartMouse] = (0, import_react31.useState)({ x: 0, y: 0 });
|
|
5080
|
+
const [startOffset, setStartOffset] = (0, import_react31.useState)({ x: 0, y: 0 });
|
|
5081
|
+
const reset = () => {
|
|
5082
|
+
setZoom(1);
|
|
5083
|
+
setRotate(0);
|
|
5084
|
+
setPosition({ x: 0, y: 0 });
|
|
5085
|
+
};
|
|
5086
|
+
const handleWheel = (0, import_react31.useCallback)((e) => {
|
|
5087
|
+
e.preventDefault();
|
|
5088
|
+
const delta = -e.deltaY * 1e-3;
|
|
5089
|
+
setZoom((z) => Math.min(5, Math.max(0.2, z + delta)));
|
|
5090
|
+
}, []);
|
|
5091
|
+
const handleMouseDown = (e) => {
|
|
5092
|
+
setDragging(true);
|
|
5093
|
+
setStartMouse({ x: e.clientX, y: e.clientY });
|
|
5094
|
+
setStartOffset({ ...position });
|
|
5095
|
+
};
|
|
5096
|
+
const handleMouseMove = (e) => {
|
|
5097
|
+
if (!dragging) return;
|
|
5098
|
+
const dx = e.clientX - startMouse.x;
|
|
5099
|
+
const dy = e.clientY - startMouse.y;
|
|
5100
|
+
setPosition({
|
|
5101
|
+
x: startOffset.x - dx,
|
|
5102
|
+
y: startOffset.y + dy
|
|
5103
|
+
});
|
|
5104
|
+
};
|
|
5105
|
+
const handleMouseUp = () => setDragging(false);
|
|
5106
|
+
(0, import_react31.useEffect)(() => {
|
|
5107
|
+
if (dragging) {
|
|
5108
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
5109
|
+
window.addEventListener("mouseup", handleMouseUp);
|
|
5110
|
+
} else {
|
|
5111
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
5112
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
5113
|
+
}
|
|
5114
|
+
return () => {
|
|
5115
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
5116
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
5117
|
+
};
|
|
5118
|
+
}, [dragging, startMouse, startOffset]);
|
|
5119
|
+
(0, import_react31.useEffect)(() => {
|
|
5120
|
+
if (open) reset();
|
|
5121
|
+
}, [open]);
|
|
5122
|
+
return /* @__PURE__ */ React.createElement(
|
|
5123
|
+
import_material31.Dialog,
|
|
5124
|
+
{
|
|
5125
|
+
open,
|
|
5126
|
+
onClose: handleClose,
|
|
5127
|
+
maxWidth: "xl",
|
|
5128
|
+
fullWidth: true,
|
|
5129
|
+
sx: {
|
|
5130
|
+
"& .MuiPaper-root": {
|
|
5131
|
+
borderRadius: 3,
|
|
5132
|
+
backgroundColor: "transparent"
|
|
5133
|
+
}
|
|
5134
|
+
}
|
|
5135
|
+
},
|
|
5136
|
+
/* @__PURE__ */ React.createElement(
|
|
5137
|
+
import_material31.Box,
|
|
5138
|
+
{
|
|
5139
|
+
sx: {
|
|
5140
|
+
position: "relative",
|
|
5141
|
+
width: "100%",
|
|
5142
|
+
height: "90vh",
|
|
5143
|
+
bgcolor: "rgba(17,17,17,0.9)",
|
|
5144
|
+
overflow: "hidden",
|
|
5145
|
+
display: "flex",
|
|
5146
|
+
justifyContent: "center",
|
|
5147
|
+
alignItems: "center"
|
|
5148
|
+
},
|
|
5149
|
+
onWheel: handleWheel
|
|
5150
|
+
},
|
|
5151
|
+
/* @__PURE__ */ React.createElement(
|
|
5152
|
+
import_material31.Box,
|
|
5153
|
+
{
|
|
5154
|
+
sx: {
|
|
5155
|
+
position: "absolute",
|
|
5156
|
+
top: 10,
|
|
5157
|
+
left: 10,
|
|
5158
|
+
zIndex: 20,
|
|
5159
|
+
display: "flex",
|
|
5160
|
+
gap: 1,
|
|
5161
|
+
alignItems: "center"
|
|
5162
|
+
}
|
|
5163
|
+
},
|
|
5164
|
+
/* @__PURE__ */ React.createElement(import_material31.IconButton, { onClick: handleClose }, /* @__PURE__ */ React.createElement(import_md9.MdClose, { color: "white" })),
|
|
5165
|
+
!noResetBtn && /* @__PURE__ */ React.createElement(import_material31.IconButton, { onClick: reset }, /* @__PURE__ */ React.createElement("span", { style: { color: "white", fontSize: "0.9rem" } }, "\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC")),
|
|
5166
|
+
!noRotate && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_material31.IconButton, { onClick: () => setRotate((r) => r - 90) }, /* @__PURE__ */ React.createElement(import_md9.MdRotateLeft, { color: "white" })), /* @__PURE__ */ React.createElement(import_material31.IconButton, { onClick: () => setRotate((r) => r + 90) }, /* @__PURE__ */ React.createElement(import_md9.MdRotateRight, { color: "white" }))),
|
|
5167
|
+
!noZoom && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_material31.IconButton, { onClick: () => setZoom((z) => z + 0.2) }, /* @__PURE__ */ React.createElement(import_md9.MdZoomIn, { color: "white" })), /* @__PURE__ */ React.createElement(
|
|
5168
|
+
import_material31.IconButton,
|
|
5169
|
+
{
|
|
5170
|
+
onClick: () => setZoom((z) => Math.max(0.2, z - 0.2))
|
|
5171
|
+
},
|
|
5172
|
+
/* @__PURE__ */ React.createElement(import_md9.MdZoomOut, { color: "white" })
|
|
5173
|
+
)),
|
|
5174
|
+
/* @__PURE__ */ React.createElement(import_material31.Typography, { color: "white" }, title)
|
|
5175
|
+
),
|
|
5176
|
+
(isLoading || loading) && /* @__PURE__ */ React.createElement(
|
|
5177
|
+
import_material31.Box,
|
|
5178
|
+
{
|
|
5179
|
+
sx: {
|
|
5180
|
+
position: "absolute",
|
|
5181
|
+
zIndex: 10,
|
|
5182
|
+
top: "50%",
|
|
5183
|
+
left: "50%",
|
|
5184
|
+
transform: "translate(-50%, -50%)",
|
|
5185
|
+
color: "white"
|
|
5186
|
+
}
|
|
5187
|
+
},
|
|
5188
|
+
/* @__PURE__ */ React.createElement(import_material31.CircularProgress, { color: "inherit" })
|
|
5189
|
+
),
|
|
5190
|
+
/* @__PURE__ */ React.createElement(
|
|
5191
|
+
import_material31.Box,
|
|
5192
|
+
{
|
|
5193
|
+
onMouseDown: handleMouseDown,
|
|
5194
|
+
sx: {
|
|
5195
|
+
position: "relative",
|
|
5196
|
+
cursor: dragging ? "grabbing" : "grab",
|
|
5197
|
+
transform: `translate(${position.x}px, ${position.y}px) scale(${zoom}) rotate(${rotate}deg)`,
|
|
5198
|
+
transition: dragging ? "none" : "transform 0.3s ease",
|
|
5199
|
+
zIndex: 5
|
|
5200
|
+
}
|
|
5201
|
+
},
|
|
5202
|
+
src && !isLoading && /* @__PURE__ */ React.createElement(
|
|
5203
|
+
import_image6.default,
|
|
5204
|
+
{
|
|
5205
|
+
src,
|
|
5206
|
+
alt: title,
|
|
5207
|
+
width: 1e3,
|
|
5208
|
+
height: 800,
|
|
5209
|
+
onLoad: () => setLoading(false),
|
|
5210
|
+
onError: () => setLoading(false),
|
|
5211
|
+
style: {
|
|
5212
|
+
objectFit: "contain",
|
|
5213
|
+
userSelect: "none",
|
|
5214
|
+
pointerEvents: "none"
|
|
5215
|
+
},
|
|
5216
|
+
unoptimized,
|
|
5217
|
+
...unoptimized ? { loader: ({ src: src2 }) => src2 } : { loader: void 0 }
|
|
5218
|
+
}
|
|
5219
|
+
)
|
|
5220
|
+
)
|
|
5221
|
+
)
|
|
5222
|
+
);
|
|
5223
|
+
}
|
|
5224
|
+
|
|
5225
|
+
// src/custom-dialog/index.tsx
|
|
5226
|
+
var import_material32 = require("@mui/material");
|
|
5227
|
+
var import_md10 = require("react-icons/md");
|
|
5059
5228
|
function CustomDialog({
|
|
5060
5229
|
title,
|
|
5061
5230
|
icon: Icon,
|
|
@@ -5064,9 +5233,15 @@ function CustomDialog({
|
|
|
5064
5233
|
onClose,
|
|
5065
5234
|
maxWidth = "sm",
|
|
5066
5235
|
fullWidth = true,
|
|
5236
|
+
fullScreen = false,
|
|
5067
5237
|
children,
|
|
5068
5238
|
actions,
|
|
5069
|
-
isSubmiting = false
|
|
5239
|
+
isSubmiting = false,
|
|
5240
|
+
sx,
|
|
5241
|
+
paperSx,
|
|
5242
|
+
contentSx,
|
|
5243
|
+
titleSx,
|
|
5244
|
+
actionsSx
|
|
5070
5245
|
}) {
|
|
5071
5246
|
const handleClose = (event, reason) => {
|
|
5072
5247
|
if (isSubmiting) {
|
|
@@ -5075,79 +5250,156 @@ function CustomDialog({
|
|
|
5075
5250
|
onClose();
|
|
5076
5251
|
};
|
|
5077
5252
|
return /* @__PURE__ */ React.createElement(
|
|
5078
|
-
|
|
5253
|
+
import_material32.Dialog,
|
|
5079
5254
|
{
|
|
5080
5255
|
open,
|
|
5081
5256
|
onClose: handleClose,
|
|
5082
5257
|
maxWidth,
|
|
5083
5258
|
fullWidth,
|
|
5084
|
-
|
|
5085
|
-
|
|
5259
|
+
fullScreen,
|
|
5260
|
+
PaperComponent: fullScreen ? void 0 : DraggablePaper,
|
|
5261
|
+
disableScrollLock: true,
|
|
5262
|
+
sx: [
|
|
5263
|
+
fullScreen ? {
|
|
5264
|
+
"& .MuiDialog-container": {
|
|
5265
|
+
alignItems: "flex-start"
|
|
5266
|
+
}
|
|
5267
|
+
} : {},
|
|
5268
|
+
...Array.isArray(sx) ? sx : [sx]
|
|
5269
|
+
],
|
|
5270
|
+
PaperProps: {
|
|
5271
|
+
sx: [
|
|
5272
|
+
fullScreen ? {
|
|
5273
|
+
height: "100vh",
|
|
5274
|
+
maxHeight: "100vh",
|
|
5275
|
+
width: "100%",
|
|
5276
|
+
maxWidth: "100%",
|
|
5277
|
+
margin: 0,
|
|
5278
|
+
borderRadius: 0,
|
|
5279
|
+
overflow: "hidden"
|
|
5280
|
+
} : {
|
|
5281
|
+
maxHeight: "calc(100vh - 64px)"
|
|
5282
|
+
},
|
|
5283
|
+
...Array.isArray(paperSx) ? paperSx : [paperSx]
|
|
5284
|
+
]
|
|
5285
|
+
}
|
|
5086
5286
|
},
|
|
5087
5287
|
/* @__PURE__ */ React.createElement(
|
|
5088
|
-
|
|
5288
|
+
import_material32.Box,
|
|
5089
5289
|
{
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
sx: { cursor: "move" },
|
|
5096
|
-
id: "draggable-dialog"
|
|
5290
|
+
sx: {
|
|
5291
|
+
display: "flex",
|
|
5292
|
+
flexDirection: "column",
|
|
5293
|
+
height: fullScreen ? "100%" : "auto"
|
|
5294
|
+
}
|
|
5097
5295
|
},
|
|
5098
|
-
/* @__PURE__ */ React.createElement(
|
|
5099
|
-
|
|
5296
|
+
/* @__PURE__ */ React.createElement(
|
|
5297
|
+
import_material32.DialogTitle,
|
|
5100
5298
|
{
|
|
5299
|
+
fontWeight: 700,
|
|
5300
|
+
fontSize: "1.2rem",
|
|
5301
|
+
display: "flex",
|
|
5101
5302
|
alignItems: "center",
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
"successLight",
|
|
5114
|
-
"orange",
|
|
5115
|
-
"indigo",
|
|
5116
|
-
"teal",
|
|
5117
|
-
"pinkLight",
|
|
5118
|
-
"aqua",
|
|
5119
|
-
"customRed"
|
|
5120
|
-
];
|
|
5121
|
-
if (paletteColors.includes(iconColor)) {
|
|
5122
|
-
const palette = theme3.palette;
|
|
5123
|
-
return palette[iconColor]?.main || iconColor;
|
|
5124
|
-
}
|
|
5125
|
-
return iconColor;
|
|
5126
|
-
} : (theme3) => theme3.palette.info.main,
|
|
5127
|
-
pr: 0.5
|
|
5128
|
-
}
|
|
5303
|
+
gap: "4px",
|
|
5304
|
+
sx: [
|
|
5305
|
+
fullScreen ? { cursor: "default" } : { cursor: "move" },
|
|
5306
|
+
{
|
|
5307
|
+
flexShrink: 0,
|
|
5308
|
+
py: 2,
|
|
5309
|
+
px: 3
|
|
5310
|
+
},
|
|
5311
|
+
...Array.isArray(titleSx) ? titleSx : [titleSx]
|
|
5312
|
+
],
|
|
5313
|
+
id: fullScreen ? void 0 : "draggable-dialog"
|
|
5129
5314
|
},
|
|
5130
|
-
/* @__PURE__ */ React.createElement(
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5315
|
+
/* @__PURE__ */ React.createElement(import_material32.Stack, { direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React.createElement(import_material32.Box, null, Icon && /* @__PURE__ */ React.createElement(
|
|
5316
|
+
import_material32.Stack,
|
|
5317
|
+
{
|
|
5318
|
+
alignItems: "center",
|
|
5319
|
+
sx: {
|
|
5320
|
+
color: iconColor ? (theme3) => {
|
|
5321
|
+
const paletteColors = [
|
|
5322
|
+
"primary",
|
|
5323
|
+
"secondary",
|
|
5324
|
+
"error",
|
|
5325
|
+
"warning",
|
|
5326
|
+
"info",
|
|
5327
|
+
"success",
|
|
5328
|
+
"tertiary",
|
|
5329
|
+
"accent",
|
|
5330
|
+
"successLight",
|
|
5331
|
+
"orange",
|
|
5332
|
+
"indigo",
|
|
5333
|
+
"teal",
|
|
5334
|
+
"pinkLight",
|
|
5335
|
+
"aqua",
|
|
5336
|
+
"customRed"
|
|
5337
|
+
];
|
|
5338
|
+
if (paletteColors.includes(iconColor)) {
|
|
5339
|
+
const palette = theme3.palette;
|
|
5340
|
+
return palette[iconColor]?.main || iconColor;
|
|
5341
|
+
}
|
|
5342
|
+
return iconColor;
|
|
5343
|
+
} : (theme3) => theme3.palette.info.main,
|
|
5344
|
+
pr: 0.5
|
|
5345
|
+
}
|
|
5346
|
+
},
|
|
5347
|
+
/* @__PURE__ */ React.createElement(Icon, { size: 20 })
|
|
5348
|
+
)), /* @__PURE__ */ React.createElement(import_material32.Box, null, title))
|
|
5349
|
+
),
|
|
5350
|
+
/* @__PURE__ */ React.createElement(import_material32.Tooltip, { title: "\u0628\u0633\u062A\u0646" }, /* @__PURE__ */ React.createElement(
|
|
5351
|
+
import_material32.IconButton,
|
|
5352
|
+
{
|
|
5353
|
+
"aria-label": "close",
|
|
5354
|
+
onClick: onClose,
|
|
5355
|
+
sx: [
|
|
5356
|
+
{
|
|
5357
|
+
position: "absolute",
|
|
5358
|
+
right: 8,
|
|
5359
|
+
top: 8,
|
|
5360
|
+
color: (theme3) => theme3.palette.grey[500]
|
|
5361
|
+
},
|
|
5362
|
+
fullScreen && {
|
|
5363
|
+
top: 12,
|
|
5364
|
+
right: 12
|
|
5365
|
+
}
|
|
5366
|
+
],
|
|
5367
|
+
disabled: isSubmiting
|
|
5143
5368
|
},
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
/* @__PURE__ */ React.createElement(
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5369
|
+
/* @__PURE__ */ React.createElement(import_md10.MdClose, null)
|
|
5370
|
+
)),
|
|
5371
|
+
/* @__PURE__ */ React.createElement(import_material32.Divider, { sx: { flexShrink: 0 } }),
|
|
5372
|
+
/* @__PURE__ */ React.createElement(
|
|
5373
|
+
import_material32.DialogContent,
|
|
5374
|
+
{
|
|
5375
|
+
sx: [
|
|
5376
|
+
{
|
|
5377
|
+
flex: 1,
|
|
5378
|
+
display: "flex",
|
|
5379
|
+
flexDirection: "column",
|
|
5380
|
+
overflow: "auto",
|
|
5381
|
+
p: 0
|
|
5382
|
+
},
|
|
5383
|
+
...Array.isArray(contentSx) ? contentSx : [contentSx]
|
|
5384
|
+
]
|
|
5385
|
+
},
|
|
5386
|
+
/* @__PURE__ */ React.createElement(import_material32.Box, { sx: { p: fullScreen ? 3 : 2, flex: 1, overflow: "auto" } }, children)
|
|
5387
|
+
),
|
|
5388
|
+
actions && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5389
|
+
import_material32.DialogActions,
|
|
5390
|
+
{
|
|
5391
|
+
sx: [
|
|
5392
|
+
{
|
|
5393
|
+
flexShrink: 0,
|
|
5394
|
+
py: 2,
|
|
5395
|
+
px: 3
|
|
5396
|
+
},
|
|
5397
|
+
...Array.isArray(actionsSx) ? actionsSx : [actionsSx]
|
|
5398
|
+
]
|
|
5399
|
+
},
|
|
5400
|
+
actions
|
|
5401
|
+
))
|
|
5402
|
+
)
|
|
5151
5403
|
);
|
|
5152
5404
|
}
|
|
5153
5405
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -5171,6 +5423,7 @@ function CustomDialog({
|
|
|
5171
5423
|
FormInputNumber,
|
|
5172
5424
|
FormInputText,
|
|
5173
5425
|
HorizontalStepper,
|
|
5426
|
+
ImgViewer,
|
|
5174
5427
|
LicensePlate,
|
|
5175
5428
|
MobileDateTimePicker,
|
|
5176
5429
|
Modal,
|