@mamrp/components 1.0.21 → 1.0.24
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 +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +111 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +71 -71
package/dist/index.mjs
CHANGED
|
@@ -110,6 +110,12 @@ function LicensePlate({
|
|
|
110
110
|
}
|
|
111
111
|
}, [data]);
|
|
112
112
|
const handleInputChange = (enteredInput, inputName, maxlength, minLength) => {
|
|
113
|
+
if (inputName !== "input2") {
|
|
114
|
+
const englishInput = convertToEnglishDigits(enteredInput);
|
|
115
|
+
if (!/^\d*$/.test(englishInput)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
113
119
|
const newInputValues = {
|
|
114
120
|
...inputValues,
|
|
115
121
|
[inputName]: enteredInput
|
|
@@ -205,7 +211,13 @@ function LicensePlate({
|
|
|
205
211
|
cursor: readOnly || !!data && readOnly ? "" : "text"
|
|
206
212
|
},
|
|
207
213
|
value: convertToPersianDigits(inputValues.input1),
|
|
208
|
-
onChange: (e) =>
|
|
214
|
+
onChange: (e) => {
|
|
215
|
+
const value = e.target.value;
|
|
216
|
+
const englishValue = convertToEnglishDigits(value);
|
|
217
|
+
if (/^\d*$/.test(englishValue)) {
|
|
218
|
+
handleInputChange(value, "input1", 2);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
209
221
|
}
|
|
210
222
|
),
|
|
211
223
|
/* @__PURE__ */ React.createElement(
|
|
@@ -352,7 +364,13 @@ function LicensePlate({
|
|
|
352
364
|
cursor: readOnly || !!data && readOnly ? "" : "text"
|
|
353
365
|
},
|
|
354
366
|
value: convertToPersianDigits(inputValues.input3),
|
|
355
|
-
onChange: (e) =>
|
|
367
|
+
onChange: (e) => {
|
|
368
|
+
const value = e.target.value;
|
|
369
|
+
const englishValue = convertToEnglishDigits(value);
|
|
370
|
+
if (/^\d*$/.test(englishValue)) {
|
|
371
|
+
handleInputChange(value, "input3", 3);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
356
374
|
}
|
|
357
375
|
),
|
|
358
376
|
/* @__PURE__ */ React.createElement(
|
|
@@ -392,7 +410,13 @@ function LicensePlate({
|
|
|
392
410
|
cursor: readOnly || !!data && readOnly ? "" : "text"
|
|
393
411
|
},
|
|
394
412
|
value: convertToPersianDigits(inputValues.input4),
|
|
395
|
-
onChange: (e) =>
|
|
413
|
+
onChange: (e) => {
|
|
414
|
+
const value = e.target.value;
|
|
415
|
+
const englishValue = convertToEnglishDigits(value);
|
|
416
|
+
if (/^\d*$/.test(englishValue)) {
|
|
417
|
+
handleInputChange(value, "input4", 2);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
396
420
|
}
|
|
397
421
|
),
|
|
398
422
|
/* @__PURE__ */ React.createElement(
|
|
@@ -780,28 +804,46 @@ import Dialog2 from "@mui/material/Dialog";
|
|
|
780
804
|
import DialogActions from "@mui/material/DialogActions";
|
|
781
805
|
import DialogContent2 from "@mui/material/DialogContent";
|
|
782
806
|
import DialogTitle2 from "@mui/material/DialogTitle";
|
|
783
|
-
import {
|
|
784
|
-
|
|
807
|
+
import {
|
|
808
|
+
Box as Box5,
|
|
809
|
+
Button as Button3,
|
|
810
|
+
CircularProgress,
|
|
811
|
+
Divider,
|
|
812
|
+
IconButton as IconButton2,
|
|
813
|
+
useMediaQuery
|
|
814
|
+
} from "@mui/material";
|
|
815
|
+
import { FaRegTrashAlt } from "react-icons/fa";
|
|
785
816
|
import { MdClose, MdOutlineCancel } from "react-icons/md";
|
|
786
|
-
import Link from "next/link";
|
|
787
817
|
function ConfirmationDialog({
|
|
788
818
|
open,
|
|
789
819
|
handleClose,
|
|
790
820
|
callback,
|
|
791
821
|
callbackParams,
|
|
792
822
|
headerText,
|
|
793
|
-
bodyText
|
|
823
|
+
bodyText,
|
|
824
|
+
isLoading,
|
|
825
|
+
maxWidth,
|
|
826
|
+
iconColor,
|
|
827
|
+
color,
|
|
828
|
+
actionTitle
|
|
794
829
|
}) {
|
|
795
|
-
|
|
830
|
+
const isMobile = useMediaQuery("(max-width:785px)");
|
|
831
|
+
return /* @__PURE__ */ React7.createElement(Dialog2, { open, onClose: handleClose, fullWidth: true, maxWidth }, /* @__PURE__ */ React7.createElement(Box5, null, /* @__PURE__ */ React7.createElement(
|
|
796
832
|
DialogTitle2,
|
|
797
833
|
{
|
|
798
834
|
fontWeight: 700,
|
|
799
835
|
fontSize: "1.2rem",
|
|
800
836
|
display: "flex",
|
|
801
837
|
alignItems: "center",
|
|
802
|
-
gap:
|
|
838
|
+
gap: 1
|
|
803
839
|
},
|
|
804
|
-
/* @__PURE__ */ React7.createElement(
|
|
840
|
+
/* @__PURE__ */ React7.createElement(
|
|
841
|
+
FaRegTrashAlt,
|
|
842
|
+
{
|
|
843
|
+
style: { color: iconColor },
|
|
844
|
+
size: isMobile ? 18 : 20
|
|
845
|
+
}
|
|
846
|
+
),
|
|
805
847
|
headerText
|
|
806
848
|
), /* @__PURE__ */ React7.createElement(
|
|
807
849
|
IconButton2,
|
|
@@ -816,7 +858,25 @@ function ConfirmationDialog({
|
|
|
816
858
|
}
|
|
817
859
|
},
|
|
818
860
|
/* @__PURE__ */ React7.createElement(MdClose, null)
|
|
819
|
-
), /* @__PURE__ */ React7.createElement(Divider, { sx: { my: "10px" } }), /* @__PURE__ */ React7.createElement(
|
|
861
|
+
), /* @__PURE__ */ React7.createElement(Divider, { sx: { my: "10px" } }), /* @__PURE__ */ React7.createElement(
|
|
862
|
+
DialogContent2,
|
|
863
|
+
{
|
|
864
|
+
sx: {
|
|
865
|
+
px: isMobile ? 2 : 3,
|
|
866
|
+
py: isMobile ? 1.5 : 2,
|
|
867
|
+
"& .MuiTypography-root": {
|
|
868
|
+
fontSize: isMobile ? "0.875rem" : "1rem",
|
|
869
|
+
lineHeight: isMobile ? 1.5 : 1.6,
|
|
870
|
+
gap: isMobile ? "2px" : "4px",
|
|
871
|
+
flexWrap: "wrap",
|
|
872
|
+
wordBreak: "break-word",
|
|
873
|
+
overflowWrap: "break-word",
|
|
874
|
+
whiteSpace: "normal"
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
bodyText
|
|
879
|
+
), /* @__PURE__ */ React7.createElement(
|
|
820
880
|
DialogActions,
|
|
821
881
|
{
|
|
822
882
|
sx: {
|
|
@@ -828,27 +888,27 @@ function ConfirmationDialog({
|
|
|
828
888
|
padding: "2rem"
|
|
829
889
|
}
|
|
830
890
|
},
|
|
831
|
-
/* @__PURE__ */ React7.createElement(
|
|
891
|
+
/* @__PURE__ */ React7.createElement(
|
|
832
892
|
Button3,
|
|
833
893
|
{
|
|
894
|
+
disabled: isLoading,
|
|
834
895
|
onClick: () => {
|
|
835
896
|
callback(callbackParams);
|
|
836
|
-
handleClose();
|
|
837
897
|
},
|
|
838
898
|
variant: "contained",
|
|
839
|
-
color
|
|
840
|
-
|
|
841
|
-
sx: {
|
|
899
|
+
color,
|
|
900
|
+
sx: { minWidth: "120px" },
|
|
901
|
+
startIcon: isLoading ? /* @__PURE__ */ React7.createElement(CircularProgress, { sx: { color: "white" }, size: 20 }) : /* @__PURE__ */ React7.createElement(FaRegTrashAlt, { size: 16 })
|
|
842
902
|
},
|
|
843
|
-
|
|
844
|
-
)
|
|
903
|
+
actionTitle
|
|
904
|
+
),
|
|
845
905
|
/* @__PURE__ */ React7.createElement(
|
|
846
906
|
Button3,
|
|
847
907
|
{
|
|
848
908
|
onClick: handleClose,
|
|
849
909
|
variant: "outlined",
|
|
850
|
-
color
|
|
851
|
-
startIcon: /* @__PURE__ */ React7.createElement(MdOutlineCancel,
|
|
910
|
+
color,
|
|
911
|
+
startIcon: /* @__PURE__ */ React7.createElement(MdOutlineCancel, { size: 15 }),
|
|
852
912
|
sx: { minWidth: "120px" }
|
|
853
913
|
},
|
|
854
914
|
"\u0627\u0646\u0635\u0631\u0627\u0641"
|
|
@@ -1117,7 +1177,7 @@ var TimePickerComponent = ({
|
|
|
1117
1177
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
1118
1178
|
import Button5 from "@mui/material/Button";
|
|
1119
1179
|
import Grid from "@mui/material/Grid2";
|
|
1120
|
-
import { GlobalStyles, useMediaQuery } from "@mui/system";
|
|
1180
|
+
import { GlobalStyles, useMediaQuery as useMediaQuery2 } from "@mui/system";
|
|
1121
1181
|
import moment2 from "moment";
|
|
1122
1182
|
import { useEffect as useEffect3 } from "react";
|
|
1123
1183
|
import { useForm } from "react-hook-form";
|
|
@@ -1126,7 +1186,7 @@ import * as yup from "yup";
|
|
|
1126
1186
|
|
|
1127
1187
|
// src/date-picker/index.tsx
|
|
1128
1188
|
import { Box as Box7, Typography as Typography4 } from "@mui/material";
|
|
1129
|
-
import
|
|
1189
|
+
import CircularProgress2 from "@mui/material/CircularProgress";
|
|
1130
1190
|
import { DatePicker, LocalizationProvider } from "@mui/x-date-pickers";
|
|
1131
1191
|
import { AdapterMomentJalaali } from "@mui/x-date-pickers/AdapterMomentJalaali";
|
|
1132
1192
|
import dayjs from "dayjs";
|
|
@@ -1222,7 +1282,7 @@ var JalaliDatePicker = ({
|
|
|
1222
1282
|
},
|
|
1223
1283
|
InputProps: {
|
|
1224
1284
|
...isLoading && {
|
|
1225
|
-
endAdornment: /* @__PURE__ */ React8.createElement(
|
|
1285
|
+
endAdornment: /* @__PURE__ */ React8.createElement(CircularProgress2, { color: "secondary", size: 20 })
|
|
1226
1286
|
} || disabled && { endAdornment: false },
|
|
1227
1287
|
...field.value && {
|
|
1228
1288
|
value: persian ? `${moment(field.value).format("dddd - jDD/jMMMM/jYYYY")}` : `${moment(field.value).format("jYYYY/jMM/jDD")}`
|
|
@@ -1338,8 +1398,8 @@ var defaultValues = {
|
|
|
1338
1398
|
// تبدیل به ISO بدون تغییر آفست
|
|
1339
1399
|
};
|
|
1340
1400
|
function DateFilterRange({ FromDate, ToDate }) {
|
|
1341
|
-
const isMobile =
|
|
1342
|
-
const isSmMobile =
|
|
1401
|
+
const isMobile = useMediaQuery2("(max-width:900px)");
|
|
1402
|
+
const isSmMobile = useMediaQuery2("(max-width:600px)");
|
|
1343
1403
|
const { control, watch, setValue } = useForm({
|
|
1344
1404
|
defaultValues,
|
|
1345
1405
|
mode: "onChange",
|
|
@@ -1434,7 +1494,7 @@ function DateFilterRange({ FromDate, ToDate }) {
|
|
|
1434
1494
|
import { yupResolver as yupResolver2 } from "@hookform/resolvers/yup";
|
|
1435
1495
|
import Button6 from "@mui/material/Button";
|
|
1436
1496
|
import Grid2 from "@mui/material/Grid2";
|
|
1437
|
-
import { GlobalStyles as GlobalStyles2, useMediaQuery as
|
|
1497
|
+
import { GlobalStyles as GlobalStyles2, useMediaQuery as useMediaQuery3 } from "@mui/system";
|
|
1438
1498
|
import moment3 from "moment";
|
|
1439
1499
|
import React9 from "react";
|
|
1440
1500
|
import { useEffect as useEffect4 } from "react";
|
|
@@ -1449,8 +1509,8 @@ var defaultValues2 = {
|
|
|
1449
1509
|
// تبدیل به ISO بدون تغییر آفست
|
|
1450
1510
|
};
|
|
1451
1511
|
function DateFilter({ setHandler }) {
|
|
1452
|
-
const isMobile =
|
|
1453
|
-
const isSmMobile =
|
|
1512
|
+
const isMobile = useMediaQuery3("(max-width:900px)");
|
|
1513
|
+
const isSmMobile = useMediaQuery3("(max-width:600px)");
|
|
1454
1514
|
const { control, watch, setValue } = useForm2({
|
|
1455
1515
|
defaultValues: defaultValues2,
|
|
1456
1516
|
mode: "onChange",
|
|
@@ -1511,7 +1571,7 @@ function DateFilter({ setHandler }) {
|
|
|
1511
1571
|
|
|
1512
1572
|
// src/date-time-picker/index.tsx
|
|
1513
1573
|
import { Typography as Typography5 } from "@mui/material";
|
|
1514
|
-
import
|
|
1574
|
+
import useMediaQuery4 from "@mui/material/useMediaQuery";
|
|
1515
1575
|
import { Box as Box8 } from "@mui/system";
|
|
1516
1576
|
import { DateTimePicker, LocalizationProvider as LocalizationProvider2 } from "@mui/x-date-pickers";
|
|
1517
1577
|
import { AdapterMomentJalaali as AdapterMomentJalaali2 } from "@mui/x-date-pickers/AdapterMomentJalaali";
|
|
@@ -1531,7 +1591,7 @@ var JalaliDatePicker2 = ({
|
|
|
1531
1591
|
centeredTime = false
|
|
1532
1592
|
}) => {
|
|
1533
1593
|
const today = moment4();
|
|
1534
|
-
const isMobile =
|
|
1594
|
+
const isMobile = useMediaQuery4("(max-width:700px)");
|
|
1535
1595
|
const [open, setOpen] = useState5(false);
|
|
1536
1596
|
const customLocaleText = {
|
|
1537
1597
|
cancelButtonLabel: "\u0644\u063A\u0648",
|
|
@@ -1896,6 +1956,12 @@ function SearchLicensePlate({
|
|
|
1896
1956
|
}
|
|
1897
1957
|
}, [data]);
|
|
1898
1958
|
const handleInputChange = (enteredInput, inputName, maxlength, minLength) => {
|
|
1959
|
+
if (inputName !== "input2") {
|
|
1960
|
+
const englishInput = convertToEnglishDigits2(enteredInput);
|
|
1961
|
+
if (!/^\d*$/.test(englishInput)) {
|
|
1962
|
+
return;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1899
1965
|
const newInputValues = {
|
|
1900
1966
|
...inputValues,
|
|
1901
1967
|
[inputName]: enteredInput
|
|
@@ -2006,7 +2072,13 @@ function SearchLicensePlate({
|
|
|
2006
2072
|
cursor: readOnly || !!data && readOnly ? "" : "text"
|
|
2007
2073
|
},
|
|
2008
2074
|
value: convertToPersianDigits2(inputValues.input1),
|
|
2009
|
-
onChange: (e) =>
|
|
2075
|
+
onChange: (e) => {
|
|
2076
|
+
const value = e.target.value;
|
|
2077
|
+
const englishValue = convertToEnglishDigits2(value);
|
|
2078
|
+
if (/^\d*$/.test(englishValue)) {
|
|
2079
|
+
handleInputChange(value, "input1", 2);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2010
2082
|
}
|
|
2011
2083
|
),
|
|
2012
2084
|
/* @__PURE__ */ React12.createElement(
|
|
@@ -2151,7 +2223,13 @@ function SearchLicensePlate({
|
|
|
2151
2223
|
cursor: readOnly || !!data && readOnly ? "" : "text"
|
|
2152
2224
|
},
|
|
2153
2225
|
value: convertToPersianDigits2(inputValues.input3),
|
|
2154
|
-
onChange: (e) =>
|
|
2226
|
+
onChange: (e) => {
|
|
2227
|
+
const value = e.target.value;
|
|
2228
|
+
const englishValue = convertToEnglishDigits2(value);
|
|
2229
|
+
if (/^\d*$/.test(englishValue)) {
|
|
2230
|
+
handleInputChange(value, "input3", 3);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2155
2233
|
}
|
|
2156
2234
|
),
|
|
2157
2235
|
/* @__PURE__ */ React12.createElement(
|
|
@@ -2190,7 +2268,13 @@ function SearchLicensePlate({
|
|
|
2190
2268
|
cursor: readOnly || !!data && readOnly ? "" : "text"
|
|
2191
2269
|
},
|
|
2192
2270
|
value: convertToPersianDigits2(inputValues.input4),
|
|
2193
|
-
onChange: (e) =>
|
|
2271
|
+
onChange: (e) => {
|
|
2272
|
+
const value = e.target.value;
|
|
2273
|
+
const englishValue = convertToEnglishDigits2(value);
|
|
2274
|
+
if (/^\d*$/.test(englishValue)) {
|
|
2275
|
+
handleInputChange(value, "input4", 2);
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2194
2278
|
}
|
|
2195
2279
|
),
|
|
2196
2280
|
/* @__PURE__ */ React12.createElement(
|
|
@@ -2209,7 +2293,7 @@ function SearchLicensePlate({
|
|
|
2209
2293
|
|
|
2210
2294
|
// src/mobile-date-time-picker/index.tsx
|
|
2211
2295
|
import { Button as Button8, Typography as Typography8 } from "@mui/material";
|
|
2212
|
-
import
|
|
2296
|
+
import useMediaQuery5 from "@mui/material/useMediaQuery";
|
|
2213
2297
|
import { Box as Box11 } from "@mui/system";
|
|
2214
2298
|
import {
|
|
2215
2299
|
MobileDateTimePicker,
|
|
@@ -2228,7 +2312,7 @@ var JalaliDatePicker3 = ({
|
|
|
2228
2312
|
isLoading
|
|
2229
2313
|
}) => {
|
|
2230
2314
|
const today = moment6();
|
|
2231
|
-
const isMobile =
|
|
2315
|
+
const isMobile = useMediaQuery5("(max-width:700px)");
|
|
2232
2316
|
const [open, setOpen] = useState8(false);
|
|
2233
2317
|
const customLocaleText = {
|
|
2234
2318
|
cancelButtonLabel: "\u0644\u063A\u0648",
|
|
@@ -2456,7 +2540,7 @@ import DialogTitle5 from "@mui/material/DialogTitle";
|
|
|
2456
2540
|
import {
|
|
2457
2541
|
Box as Box12,
|
|
2458
2542
|
Button as Button9,
|
|
2459
|
-
CircularProgress as
|
|
2543
|
+
CircularProgress as CircularProgress3,
|
|
2460
2544
|
Divider as Divider3,
|
|
2461
2545
|
IconButton as IconButton5
|
|
2462
2546
|
} from "@mui/material";
|
|
@@ -2518,7 +2602,7 @@ function ConfirmationDialog2({
|
|
|
2518
2602
|
variant: "contained",
|
|
2519
2603
|
color: "error",
|
|
2520
2604
|
sx: { minWidth: "120px" },
|
|
2521
|
-
startIcon: isLoading ? /* @__PURE__ */ React14.createElement(
|
|
2605
|
+
startIcon: isLoading ? /* @__PURE__ */ React14.createElement(CircularProgress3, { sx: { color: "white" }, size: 20 }) : /* @__PURE__ */ React14.createElement(Delete, { size: 16 })
|
|
2522
2606
|
},
|
|
2523
2607
|
"\u062D\u0630\u0641"
|
|
2524
2608
|
),
|
|
@@ -3148,7 +3232,7 @@ import TextField3 from "@mui/material/TextField";
|
|
|
3148
3232
|
import { forwardRef } from "react";
|
|
3149
3233
|
import { Controller as Controller8 } from "react-hook-form";
|
|
3150
3234
|
import { NumericFormat } from "react-number-format";
|
|
3151
|
-
import
|
|
3235
|
+
import CircularProgress4 from "@mui/material/CircularProgress";
|
|
3152
3236
|
import InputAdornment2 from "@mui/material/InputAdornment";
|
|
3153
3237
|
import React22 from "react";
|
|
3154
3238
|
var FormInputNumber = ({
|
|
@@ -3231,7 +3315,7 @@ var FormInputNumber = ({
|
|
|
3231
3315
|
maxLength,
|
|
3232
3316
|
decimalScale
|
|
3233
3317
|
},
|
|
3234
|
-
endAdornment: isLoading ? /* @__PURE__ */ React22.createElement(InputAdornment2, { position: "end" }, /* @__PURE__ */ React22.createElement(
|
|
3318
|
+
endAdornment: isLoading ? /* @__PURE__ */ React22.createElement(InputAdornment2, { position: "end" }, /* @__PURE__ */ React22.createElement(CircularProgress4, { size: 20 })) : endAdornment,
|
|
3235
3319
|
startAdornment
|
|
3236
3320
|
},
|
|
3237
3321
|
...rest
|
|
@@ -3279,7 +3363,7 @@ var NumericFormatCustom = forwardRef(
|
|
|
3279
3363
|
var number_type_default = FormInputNumber;
|
|
3280
3364
|
|
|
3281
3365
|
// src/text-field/text-type/index.tsx
|
|
3282
|
-
import
|
|
3366
|
+
import CircularProgress5 from "@mui/material/CircularProgress";
|
|
3283
3367
|
import InputAdornment3 from "@mui/material/InputAdornment";
|
|
3284
3368
|
import TextField4 from "@mui/material/TextField";
|
|
3285
3369
|
import React23 from "react";
|
|
@@ -3325,7 +3409,7 @@ var FormInputText = ({
|
|
|
3325
3409
|
readOnly
|
|
3326
3410
|
},
|
|
3327
3411
|
InputProps: {
|
|
3328
|
-
endAdornment: isLoading ? /* @__PURE__ */ React23.createElement(InputAdornment3, { position: "end" }, /* @__PURE__ */ React23.createElement(
|
|
3412
|
+
endAdornment: isLoading ? /* @__PURE__ */ React23.createElement(InputAdornment3, { position: "end" }, /* @__PURE__ */ React23.createElement(CircularProgress5, { size: 20 })) : null
|
|
3329
3413
|
},
|
|
3330
3414
|
InputLabelProps: { shrink: true },
|
|
3331
3415
|
inputRef: ref,
|