@mamrp/components 1.7.61 → 1.7.62

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.mjs CHANGED
@@ -16,8 +16,8 @@ import { useState } from "react";
16
16
  function Page({
17
17
  data
18
18
  }) {
19
- const Accordion = styled((props) => /* @__PURE__ */ React.createElement(MuiAccordion, { disableGutters: true, elevation: 0, square: true, ...props }))(({ theme: theme3 }) => ({
20
- border: `1px solid ${theme3.palette.divider}`,
19
+ const Accordion = styled((props) => /* @__PURE__ */ React.createElement(MuiAccordion, { disableGutters: true, elevation: 0, square: true, ...props }))(({ theme: theme4 }) => ({
20
+ border: `1px solid ${theme4.palette.divider}`,
21
21
  "&:not(:last-child)": {
22
22
  borderBottom: 0
23
23
  },
@@ -25,21 +25,21 @@ function Page({
25
25
  display: "none"
26
26
  }
27
27
  }));
28
- const AccordionSummary = styled((props) => /* @__PURE__ */ React.createElement(MuiAccordionSummary, { expandIcon: /* @__PURE__ */ React.createElement(IoIosArrowForward, null), ...props }))(({ theme: theme3 }) => ({
28
+ const AccordionSummary = styled((props) => /* @__PURE__ */ React.createElement(MuiAccordionSummary, { expandIcon: /* @__PURE__ */ React.createElement(IoIosArrowForward, null), ...props }))(({ theme: theme4 }) => ({
29
29
  backgroundColor: "rgba(0, 0, 0, .03)",
30
30
  flexDirection: "row-reverse",
31
31
  [`& .${accordionSummaryClasses.expandIconWrapper}.${accordionSummaryClasses.expanded}`]: {
32
32
  transform: "rotate(90deg)"
33
33
  },
34
34
  [`& .${accordionSummaryClasses.content}`]: {
35
- marginLeft: theme3.spacing(1)
35
+ marginLeft: theme4.spacing(1)
36
36
  },
37
- ...theme3.applyStyles("dark", {
37
+ ...theme4.applyStyles("dark", {
38
38
  backgroundColor: "rgba(255, 255, 255, .05)"
39
39
  })
40
40
  }));
41
- const AccordionDetails = styled(MuiAccordionDetails)(({ theme: theme3 }) => ({
42
- padding: theme3.spacing(2),
41
+ const AccordionDetails = styled(MuiAccordionDetails)(({ theme: theme4 }) => ({
42
+ padding: theme4.spacing(2),
43
43
  borderTop: "1px solid rgba(0, 0, 0, .125)"
44
44
  }));
45
45
  const [expanded, setExpanded] = useState("");
@@ -148,7 +148,7 @@ function LicensePlate({
148
148
  readOnly = true,
149
149
  size
150
150
  }) {
151
- const theme3 = useTheme();
151
+ const theme4 = useTheme();
152
152
  const [open, setOpen] = useState2(false);
153
153
  const [inputValues, setInputValues] = useState2({
154
154
  input1: "",
@@ -200,7 +200,7 @@ function LicensePlate({
200
200
  }
201
201
  };
202
202
  const inputStyle = {
203
- color: theme3.palette.text.primary,
203
+ color: theme4.palette.text.primary,
204
204
  width: "30px",
205
205
  textAlign: "center",
206
206
  backgroundColor: "transparent",
@@ -739,8 +739,8 @@ function AdvancedSearchButton({
739
739
  backgroundColor,
740
740
  border = false
741
741
  }) {
742
- const theme3 = useTheme2();
743
- const isDarkMode = theme3.palette.mode === "dark";
742
+ const theme4 = useTheme2();
743
+ const isDarkMode = theme4.palette.mode === "dark";
744
744
  return /* @__PURE__ */ React5.createElement(
745
745
  Button3,
746
746
  {
@@ -750,7 +750,7 @@ function AdvancedSearchButton({
750
750
  },
751
751
  startIcon: /* @__PURE__ */ React5.createElement(AnimatedIcon, { isShowFilter }),
752
752
  sx: {
753
- color: theme3.palette.text.primary ?? color,
753
+ color: theme4.palette.text.primary ?? color,
754
754
  borderRadius: borderRadius ?? 2,
755
755
  paddingY,
756
756
  fontSize,
@@ -907,7 +907,7 @@ function ConfirmationDialog({
907
907
  position: "absolute",
908
908
  right: 8,
909
909
  top: 8,
910
- color: (theme3) => theme3.palette.grey[500]
910
+ color: (theme4) => theme4.palette.grey[500]
911
911
  }
912
912
  },
913
913
  /* @__PURE__ */ React8.createElement(MdClose, null)
@@ -1098,7 +1098,7 @@ var DateTimePickerComponent = ({
1098
1098
  clearable = false,
1099
1099
  variant = "outlined"
1100
1100
  }) => {
1101
- const theme3 = useTheme3();
1101
+ const theme4 = useTheme3();
1102
1102
  const [isOpen, setIsOpen] = useState5(false);
1103
1103
  const [hasUserInteracted, setHasUserInteracted] = useState5(false);
1104
1104
  const hourInputRef = useRef4(null);
@@ -1671,7 +1671,7 @@ var DateTimePickerComponent = ({
1671
1671
  fontWeight: isSelected(day) ? 700 : 400,
1672
1672
  bgcolor: isSelected(day) ? "primary.main" : isToday(day) ? "primary.lighter" : "transparent",
1673
1673
  color: isSelected(day) ? "primary.contrastText" : isToday(day) ? "primary.main" : index % 7 === 6 ? "error.main" : "text.primary",
1674
- border: isToday(day) && !isSelected(day) ? `2px solid ${theme3.palette.primary.main}` : "none",
1674
+ border: isToday(day) && !isSelected(day) ? `2px solid ${theme4.palette.primary.main}` : "none",
1675
1675
  transition: "all 0.15s ease",
1676
1676
  "&:hover": day ? {
1677
1677
  bgcolor: isSelected(day) ? "primary.dark" : "action.hover"
@@ -1742,7 +1742,7 @@ function CustomDialog({
1742
1742
  {
1743
1743
  alignItems: "center",
1744
1744
  sx: {
1745
- color: iconColor ? (theme3) => {
1745
+ color: iconColor ? (theme4) => {
1746
1746
  const paletteColors = [
1747
1747
  "primary",
1748
1748
  "secondary",
@@ -1761,11 +1761,11 @@ function CustomDialog({
1761
1761
  "customRed"
1762
1762
  ];
1763
1763
  if (paletteColors.includes(iconColor)) {
1764
- const palette = theme3.palette;
1764
+ const palette = theme4.palette;
1765
1765
  return palette[iconColor]?.main || iconColor;
1766
1766
  }
1767
1767
  return iconColor;
1768
- } : (theme3) => theme3.palette.info.main,
1768
+ } : (theme4) => theme4.palette.info.main,
1769
1769
  pr: 0.5
1770
1770
  }
1771
1771
  },
@@ -1781,7 +1781,7 @@ function CustomDialog({
1781
1781
  position: "absolute",
1782
1782
  right: 8,
1783
1783
  top: 8,
1784
- color: (theme3) => theme3.palette.grey[500]
1784
+ color: (theme4) => theme4.palette.grey[500]
1785
1785
  },
1786
1786
  disabled: isSubmiting
1787
1787
  },
@@ -1856,7 +1856,7 @@ var TimePickerComponent = ({
1856
1856
  disabled = false,
1857
1857
  variant = "outlined"
1858
1858
  }) => {
1859
- const theme3 = useTheme4();
1859
+ const theme4 = useTheme4();
1860
1860
  const initialHour = value ? parseInt(value.split(":")[0]) : null;
1861
1861
  const initialMinute = value ? parseInt(value.split(":")[1]) : null;
1862
1862
  const [isModalOpen, setIsModalOpen] = useState6(false);
@@ -1958,7 +1958,7 @@ var TimePickerComponent = ({
1958
1958
  },
1959
1959
  InputProps: {
1960
1960
  ...!disabled && {
1961
- endAdornment: /* @__PURE__ */ React.createElement(InputAdornment2, { position: "end" }, /* @__PURE__ */ React.createElement(Tooltip3, { title: "\u0627\u0646\u062A\u062E\u0627\u0628 \u0632\u0645\u0627\u0646" }, /* @__PURE__ */ React.createElement(IconButton5, { onClick: () => setIsModalOpen(true) }, /* @__PURE__ */ React.createElement(Clock, { size: 22, color: theme3.palette.text.primary }))))
1961
+ endAdornment: /* @__PURE__ */ React.createElement(InputAdornment2, { position: "end" }, /* @__PURE__ */ React.createElement(Tooltip3, { title: "\u0627\u0646\u062A\u062E\u0627\u0628 \u0632\u0645\u0627\u0646" }, /* @__PURE__ */ React.createElement(IconButton5, { onClick: () => setIsModalOpen(true) }, /* @__PURE__ */ React.createElement(Clock, { size: 22, color: theme4.palette.text.primary }))))
1962
1962
  }
1963
1963
  },
1964
1964
  sx: {
@@ -2025,7 +2025,7 @@ var TimePickerComponent = ({
2025
2025
  position: "absolute",
2026
2026
  right: 8,
2027
2027
  top: 8,
2028
- color: (theme4) => theme4.palette.grey[500]
2028
+ color: (theme5) => theme5.palette.grey[500]
2029
2029
  }
2030
2030
  },
2031
2031
  /* @__PURE__ */ React.createElement(MdClose4, null)
@@ -4340,7 +4340,7 @@ function SearchLicensePlate({
4340
4340
  readOnly = true,
4341
4341
  size = "small"
4342
4342
  }) {
4343
- const theme3 = useTheme5();
4343
+ const theme4 = useTheme5();
4344
4344
  const [open, setOpen] = useState13(false);
4345
4345
  const [inputValues, setInputValues] = useState13({
4346
4346
  input1: "",
@@ -4355,7 +4355,7 @@ function SearchLicensePlate({
4355
4355
  input4: useRef7(null)
4356
4356
  };
4357
4357
  const inputStyle = {
4358
- color: theme3.palette.text.primary,
4358
+ color: theme4.palette.text.primary,
4359
4359
  width: "30px",
4360
4360
  textAlign: "center",
4361
4361
  backgroundColor: "transparent",
@@ -4902,7 +4902,7 @@ function ConfirmationDialog2({
4902
4902
  position: "absolute",
4903
4903
  right: 8,
4904
4904
  top: 8,
4905
- color: (theme3) => theme3.palette.grey[500]
4905
+ color: (theme4) => theme4.palette.grey[500]
4906
4906
  }
4907
4907
  },
4908
4908
  /* @__PURE__ */ React15.createElement(MdClose7, null)
@@ -4960,7 +4960,7 @@ function NoResult({
4960
4960
  description,
4961
4961
  sx = {}
4962
4962
  }) {
4963
- const theme3 = useTheme6();
4963
+ const theme4 = useTheme6();
4964
4964
  return /* @__PURE__ */ React16.createElement(
4965
4965
  Card2,
4966
4966
  {
@@ -4968,7 +4968,7 @@ function NoResult({
4968
4968
  width: "100%",
4969
4969
  minWidth: 300,
4970
4970
  borderRadius: "12px",
4971
- border: `1px solid ${theme3.palette.secondary.light}`
4971
+ border: `1px solid ${theme4.palette.secondary.light}`
4972
4972
  }
4973
4973
  },
4974
4974
  /* @__PURE__ */ React16.createElement(
@@ -5427,11 +5427,11 @@ var SwitchButton = ({
5427
5427
  iconChecked,
5428
5428
  iconUnchecked
5429
5429
  }) => {
5430
- const theme3 = useTheme8();
5431
- const isDarkMode = theme3.palette.mode === "dark";
5432
- const CustomSwitch = styled3(Switch)(({ theme: theme4 }) => ({
5430
+ const theme4 = useTheme8();
5431
+ const isDarkMode = theme4.palette.mode === "dark";
5432
+ const CustomSwitch = styled3(Switch)(({ theme: theme5 }) => ({
5433
5433
  "& .MuiSwitch-switchBase.Mui-checked": {
5434
- color: theme4.palette.primary.main
5434
+ color: theme5.palette.primary.main
5435
5435
  },
5436
5436
  "& .MuiSwitch-switchBase": {
5437
5437
  color: isDarkMode ? "rgba(220,220,220,1)" : "rgba(188,188,188,1)"
@@ -5442,16 +5442,16 @@ var SwitchButton = ({
5442
5442
  border: isDarkMode ? "2px solid white" : "2px solid rgba(80,80,80, 1)"
5443
5443
  }
5444
5444
  }));
5445
- const BoxContainer = styled3(Box25)(({ theme: theme4 }) => ({
5445
+ const BoxContainer = styled3(Box25)(({ theme: theme5 }) => ({
5446
5446
  display: "flex",
5447
5447
  alignItems: "center",
5448
5448
  backgroundColor: "rgba(188,188,188, 0.1)",
5449
5449
  border: "2px solid rgba(200,200,200, 1)",
5450
5450
  borderRadius: 10,
5451
5451
  transition: "all 0.3s ease",
5452
- paddingTop: theme4.spacing(0.1),
5453
- paddingBottom: theme4.spacing(0.1),
5454
- paddingLeft: theme4.spacing(1)
5452
+ paddingTop: theme5.spacing(0.1),
5453
+ paddingBottom: theme5.spacing(0.1),
5454
+ paddingLeft: theme5.spacing(1)
5455
5455
  }));
5456
5456
  const LabelContainer = styled3("div")({
5457
5457
  transition: "all 0.2s ease",
@@ -6213,8 +6213,8 @@ function MapLocationPicker({
6213
6213
  minZoom = 10,
6214
6214
  maxZoom = 19
6215
6215
  }) {
6216
- const theme3 = useTheme9();
6217
- const isDarkMode = theme3.palette.mode === "dark";
6216
+ const theme4 = useTheme9();
6217
+ const isDarkMode = theme4.palette.mode === "dark";
6218
6218
  const { field: latField, fieldState: latState } = useController({
6219
6219
  name: nameLat,
6220
6220
  control
@@ -6563,7 +6563,7 @@ function MapLocationPicker({
6563
6563
  onClick: handleClearLocation,
6564
6564
  sx: {
6565
6565
  backgroundColor: isDarkMode ? "#1e1e1e" : "white",
6566
- color: theme3.palette.error.main,
6566
+ color: theme4.palette.error.main,
6567
6567
  boxShadow: 2,
6568
6568
  "&:hover": {
6569
6569
  backgroundColor: isDarkMode ? "#2a2a2a" : "#f5f5f5"
@@ -6603,9 +6603,117 @@ function MapLocationPicker({
6603
6603
  helperText
6604
6604
  ));
6605
6605
  }
6606
+
6607
+ // src/checkbox-group/index.tsx
6608
+ import * as React28 from "react";
6609
+ import { Controller as Controller15 } from "react-hook-form";
6610
+ import Checkbox3 from "@mui/material/Checkbox";
6611
+ import FormControlLabel4 from "@mui/material/FormControlLabel";
6612
+ import FormControl3 from "@mui/material/FormControl";
6613
+ import FormLabel2 from "@mui/material/FormLabel";
6614
+ import { Typography as Typography20 } from "@mui/material";
6615
+ import { Box as Box28 } from "@mui/system";
6616
+ import theme3 from "@mamrp/layout/theme";
6617
+ function CheckBoxGroup({
6618
+ name,
6619
+ label,
6620
+ options,
6621
+ control,
6622
+ align = "start",
6623
+ disabledBoarder,
6624
+ direction = "row"
6625
+ }) {
6626
+ const normalize = (v) => typeof v === "string" && !isNaN(Number(v)) ? Number(v) : v;
6627
+ return /* @__PURE__ */ React28.createElement(
6628
+ FormControl3,
6629
+ {
6630
+ sx: {
6631
+ display: "flex",
6632
+ flexDirection: direction,
6633
+ alignItems: "center",
6634
+ justifyContent: "start"
6635
+ }
6636
+ },
6637
+ /* @__PURE__ */ React28.createElement(
6638
+ Controller15,
6639
+ {
6640
+ name,
6641
+ control,
6642
+ defaultValue: [],
6643
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ React28.createElement(Box28, { display: "flex", width: "100%", flexDirection: "column" }, label && /* @__PURE__ */ React28.createElement(
6644
+ FormLabel2,
6645
+ {
6646
+ sx: {
6647
+ position: "absolute",
6648
+ top: -10,
6649
+ left: 15,
6650
+ px: 0.5,
6651
+ backgroundColor: "background.paper",
6652
+ color: error?.message ? theme3.CustomComponents.RadioButton.errorColor : theme3.CustomComponents.RadioButton.textColor,
6653
+ fontSize: 15,
6654
+ zIndex: 1
6655
+ }
6656
+ },
6657
+ label
6658
+ ), /* @__PURE__ */ React28.createElement(
6659
+ Box28,
6660
+ {
6661
+ sx: {
6662
+ width: "100%",
6663
+ p: 0.8,
6664
+ px: 1,
6665
+ borderRadius: 3,
6666
+ display: "flex",
6667
+ justifyContent: align,
6668
+ flexDirection: "row",
6669
+ border: disabledBoarder ? "" : `${theme3.CustomComponents.RadioButton.borderSize}px solid`,
6670
+ borderColor: error?.message ? theme3.CustomComponents.RadioButton.errorColor : theme3.CustomComponents.RadioButton.borderColor
6671
+ }
6672
+ },
6673
+ options.map((option) => /* @__PURE__ */ React28.createElement(
6674
+ FormControlLabel4,
6675
+ {
6676
+ key: option.value,
6677
+ label: option.name,
6678
+ control: /* @__PURE__ */ React28.createElement(
6679
+ Checkbox3,
6680
+ {
6681
+ checked: Array.isArray(field.value) && field.value.includes(normalize(option.value)),
6682
+ onChange: (e) => {
6683
+ const checked = e.target.checked;
6684
+ const value = normalize(option.value);
6685
+ const currentValue = Array.isArray(field.value) ? field.value.map(normalize) : [];
6686
+ if (checked) {
6687
+ if (!currentValue.includes(value)) {
6688
+ field.onChange([...currentValue, value]);
6689
+ }
6690
+ } else {
6691
+ field.onChange(
6692
+ currentValue.filter((v) => v !== value)
6693
+ );
6694
+ }
6695
+ }
6696
+ }
6697
+ )
6698
+ }
6699
+ ))
6700
+ ), error?.message && /* @__PURE__ */ React28.createElement(
6701
+ Typography20,
6702
+ {
6703
+ color: "error",
6704
+ fontSize: theme3.CustomComponents.RadioButton.errorFontSize,
6705
+ ml: 2
6706
+ },
6707
+ error?.message
6708
+ ))
6709
+ }
6710
+ )
6711
+ );
6712
+ }
6606
6713
  export {
6607
6714
  Page as Accordion,
6608
6715
  AdvancedSearchButton,
6716
+ CheckBoxGroup,
6609
6717
  ConfirmationDialog,
6610
6718
  bascule_connection_button_default as ConnectToBasculeButton,
6611
6719
  CustomCheckbox,