@m4l/components 1.0.0 → 1.0.2

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.
Files changed (95) hide show
  1. package/components/AccountPopover/{index.efc74d5c.js → index.ec031003.js} +5 -3
  2. package/components/AppBar/{index.fc126a22.js → index.1499770b.js} +4 -4
  3. package/components/DragResizeWindow/{index.46b380e1.js → index.5e316291.js} +3 -3
  4. package/components/DynamicFilter/{index.d9168c12.js → index.05e15fb8.js} +28 -211
  5. package/components/FieldLabel/{index.f9cdcc27.js → index.400a46e0.js} +4 -4
  6. package/components/GridLayout/{index.bb3b7769.js → index.7156fbc9.js} +2 -2
  7. package/components/GridLayout/subcomponents/Griditem/{index.bb23f651.js → index.8946f18e.js} +4 -4
  8. package/components/GridLayout/subcomponents/Responsive/{index.b8a2a121.js → index.3c68f0cb.js} +2 -2
  9. package/components/GridLayout/subcomponents/SizeProvider/{index.094bc6b5.js → index.a5b2190d.js} +1 -1
  10. package/components/HamburgerMenu/{index.5997af31.js → index.d57bca4c.js} +3 -3
  11. package/components/HelperText/{index.be949cdf.js → index.651a9b4b.js} +1 -1
  12. package/components/Icon/index.2e8ec5a1.js +209 -0
  13. package/components/Image/index.0d32558e.js +168 -0
  14. package/components/LoadingError/{index.9f00c83c.js → index.d137be81.js} +5 -4
  15. package/components/MFLoader/{index.402c1acc.js → index.2038aa6c.js} +3 -3
  16. package/components/ModalDialog/{index.ea9189c3.js → index.85d30f10.js} +4 -4
  17. package/components/NavLink/{index.4e548cee.js → index.badec599.js} +2 -2
  18. package/components/NoItemSelected/{index.418c8316.js → index.008154ce.js} +2 -2
  19. package/components/ObjectLogs/{index.bfa7dad3.js → index.65a6b1bc.js} +8 -7
  20. package/components/PDFViewer/{index.bb2eca5a.js → index.9677b02a.js} +2 -2
  21. package/components/Page/index.7482cf60.js +98 -0
  22. package/components/PaperForm/{index.8121e3da.js → index.e04f9f1f.js} +2 -2
  23. package/components/Period/{index.5233694b.js → index.3d695534.js} +8 -103
  24. package/components/PrintingSystem/{index.fb176a93.js → index.89493ad6.js} +15 -14
  25. package/components/PrintingSystem/subcomponents/BodyNode/{index.c1d61038.js → index.fdd8cebb.js} +1 -1
  26. package/components/PrintingSystem/subcomponents/ChartNode/{index.18bd9bad.js → index.12293a60.js} +1 -1
  27. package/components/PrintingSystem/subcomponents/DividerNode/{index.67d9f1b4.js → index.7fdad1df.js} +1 -1
  28. package/components/PrintingSystem/subcomponents/FooterNode/{index.eaee152a.js → index.fcaf9b2f.js} +1 -1
  29. package/components/PrintingSystem/subcomponents/GridNode/{index.f5f63a2a.js → index.03148990.js} +1 -1
  30. package/components/PrintingSystem/subcomponents/HeaderNode/{index.7de4e411.js → index.691b5c38.js} +1 -1
  31. package/components/PrintingSystem/subcomponents/PaperNode/{index.f9ccf22b.js → index.3699b685.js} +1 -1
  32. package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.f2f2e903.js → index.bcc87da8.js} +1 -1
  33. package/components/PrintingSystem/subcomponents/SectionNode/{index.540a4b19.js → index.659f28e5.js} +1 -1
  34. package/components/PrintingSystem/subcomponents/TextBoxNode/{index.41e7fcb0.js → index.137ebb7a.js} +1 -1
  35. package/components/PropertyValue/{index.9572c347.js → index.e31d4282.js} +3 -3
  36. package/components/Resizeable/{index.1f0c1359.js → index.8c72e36a.js} +1 -1
  37. package/components/ScrollBar/{index.adf0eade.js → index.9bfcc74f.js} +1 -1
  38. package/components/SideBar/{index.629ba840.js → index.004a2de1.js} +7 -31
  39. package/components/SplitLayout/{index.74091a81.js → index.aed78a1f.js} +1 -1
  40. package/components/ToastContainer/{index.f9b507b9.js → index.586b1194.js} +3 -3
  41. package/components/areas/constants.630a4f42.js +293 -0
  42. package/components/areas/contexts/AreasContext/{index.bb316000.js → index.81b748ec.js} +4 -4
  43. package/components/areas/{dictionary.7e74022a.js → dictionary.19b25583.js} +26 -34
  44. package/components/areas/hooks/useAreas/{index.e24bd74d.js → index.b02d5bdc.js} +1 -1
  45. package/components/hook-form/HelperError/index.fd10c3ab.js +19 -0
  46. package/components/hook-form/RHFAutocompleteAsync/index.ea3ba7a7.js +160 -0
  47. package/components/hook-form/RHFCheckbox/index.9ac452cc.js +143 -0
  48. package/components/hook-form/RHFColorPicker/index.25e4e643.js +191 -0
  49. package/components/hook-form/RHFDateTime/index.31a0537d.js +190 -0
  50. package/components/hook-form/RHFMultiCheckbox/index.437e6ba3.js +34 -0
  51. package/components/hook-form/RHFPeriod/index.c8868100.js +105 -0
  52. package/components/hook-form/RHFRadioGroup/index.11c0add8.js +35 -0
  53. package/components/hook-form/RHFSelect/index.c6c60ecc.js +29 -0
  54. package/components/hook-form/RHFTextField/index.2ae1f130.js +326 -0
  55. package/components/{Image/index.36a3d440.js → hook-form/RHFUpload/index.9eeaee0f.js} +32 -232
  56. package/components/maps/components/GpsTools/index.ef751d28.js +251 -0
  57. package/components/maps/{index.8ec46ce4.js → index.ba1ccfad.js} +21 -555
  58. package/components/modal/{WindowBase.a3ac7adc.js → WindowBase.c1e879e4.js} +4 -3
  59. package/components/modal/{WindowConfirm.e35da619.js → WindowConfirm.1a123368.js} +6 -6
  60. package/components/modal/{index.a0e30c8b.js → index.7ca17f55.js} +1 -1
  61. package/components/mui_extended/Accordion/index.391679d1.js +143 -0
  62. package/components/mui_extended/Avatar/index.3ba36655.js +63 -0
  63. package/components/mui_extended/Badge/index.3465d7fb.js +31 -0
  64. package/components/mui_extended/BoxIcon/index.d61e7ac5.js +22 -0
  65. package/components/mui_extended/Breadcrumbs/index.4a44883c.js +87 -0
  66. package/components/mui_extended/Button/index.a7dc6ef0.js +289 -0
  67. package/components/mui_extended/CheckBox/index.c5c8721c.js +76 -0
  68. package/components/mui_extended/CircularProgress/index.967e70b7.js +8 -0
  69. package/components/mui_extended/IconButton/index.87f4726c.js +120 -0
  70. package/components/{LinearProgressIndeterminate/index.de9d447c.js → mui_extended/LinearProgress/index.52edc848.js} +11 -4
  71. package/components/mui_extended/LinkWithRoute/index.288c51f3.js +15 -0
  72. package/components/{Page/index.fdf04592.js → mui_extended/Pager/index.46aec921.js} +9 -98
  73. package/components/mui_extended/Popover/index.8e5ac765.js +1041 -0
  74. package/components/mui_extended/Stack/index.fe363ca5.js +31 -0
  75. package/components/{maps/components/GpsTools/index.75880ce0.js → mui_extended/Tab/index.ad88441e.js} +674 -239
  76. package/components/mui_extended/ToggleButton/index.38ca2330.js +18 -0
  77. package/components/mui_extended/ToggleIconButton/index.7fbece74.js +24 -0
  78. package/components/mui_extended/Tooltip/index.49bb5ee1.js +40 -0
  79. package/components/mui_extended/Typography/index.2a1c68f8.js +55 -0
  80. package/components/popups/PopupsProvider/{index.18669fb4.js → index.3b43e55f.js} +1 -1
  81. package/components/popups/PopupsViewer/{index.ba354267.js → index.fb3f0c48.js} +5 -4
  82. package/contexts/ModalContext/{index.cf02e6bd.js → index.82f61407.js} +1 -1
  83. package/contexts/RHFormContext/{index.dc955a09.js → index.e942a298.js} +1 -1
  84. package/hooks/useFormAddEdit/{index.f156a2cd.js → index.fa430551.js} +2 -2
  85. package/hooks/useModal/{index.ef54bcf2.js → index.9fe41bde.js} +3 -3
  86. package/index.js +266 -239
  87. package/package.json +1 -1
  88. package/{react-draggable.5331add7.js → react-draggable.2df3b71a.js} +1 -1
  89. package/{react-resizable.37bfb965.js → react-resizable.c60f3843.js} +2 -2
  90. package/utils/{index.9ee4c99a.js → index.0660ee9c.js} +9 -62
  91. package/{vendor.a1ce6777.js → vendor.3eadfa16.js} +746 -3011
  92. package/components/Icon/index.d5fed418.js +0 -420
  93. package/components/LanguagePopover/index.e6fa2336.js +0 -184
  94. package/components/areas/constants.5387d83e.js +0 -412
  95. package/hooks/useTab/index.bce8b99e.js +0 -12
@@ -0,0 +1,143 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { generateUtilityClasses, generateUtilityClass, Accordion as Accordion$1, AccordionSummary, AccordionDetails } from "@mui/material";
3
+ import { I as IconButton } from "../IconButton/index.87f4726c.js";
4
+ import { useEnvironment } from "@m4l/core";
5
+ import { unstable_composeClasses } from "@mui/base";
6
+ import { styled } from "@mui/material/styles";
7
+ import clsx from "clsx";
8
+ import { T as TEST_PROP_ID } from "../../areas/constants.630a4f42.js";
9
+ import { a as getNameDataTestId } from "../../../test/getNameDataTestId.aee44365.js";
10
+ import { I as Icon } from "../../Icon/index.2e8ec5a1.js";
11
+ import { T as Typography } from "../Typography/index.2a1c68f8.js";
12
+ const componentName = "M4LAccordion";
13
+ generateUtilityClasses(componentName, [
14
+ "root",
15
+ "endIcon",
16
+ "labelIcon",
17
+ "label",
18
+ "content"
19
+ ]);
20
+ function getAccordionUtilityClass(slot) {
21
+ return generateUtilityClass(componentName, slot);
22
+ }
23
+ const accordionUtilityClasses = () => {
24
+ const slots = {
25
+ root: ["root"],
26
+ endIcon: ["endIcon"],
27
+ labelIcon: ["labelIcon"],
28
+ label: ["label"],
29
+ content: ["content"]
30
+ };
31
+ const composedClasses = unstable_composeClasses(slots, getAccordionUtilityClass, {});
32
+ return {
33
+ ...composedClasses
34
+ };
35
+ };
36
+ styled("div")(({ theme }) => ({
37
+ display: "flex",
38
+ justifyContent: "space-between",
39
+ alignItems: "center",
40
+ borderRadius: theme.spacing(0.5),
41
+ height: theme.spacing(4.5),
42
+ minHeight: theme.spacing(4.5),
43
+ backgroundColor: theme.vars.palette.background.header,
44
+ paddingLeft: theme.spacing(2),
45
+ paddingRight: theme.spacing(2),
46
+ marginBottom: "0px"
47
+ }));
48
+ styled("div")(({ theme }) => ({
49
+ display: "flex",
50
+ justifyContent: "flex-start",
51
+ alignItems: "center",
52
+ gap: theme.spacing(2)
53
+ }));
54
+ const AccordionRoot = styled("div")(({ theme }) => ({
55
+ ...theme.components?.M4LAccordion?.styleOverrides
56
+ }));
57
+ const COMPONENT_PREFIX = "m4l-accordion";
58
+ function Accordion(props) {
59
+ const {
60
+ label,
61
+ SKTWidht,
62
+ SKTHeight,
63
+ children,
64
+ accordionProps,
65
+ summaryProps,
66
+ labelIcon,
67
+ className,
68
+ dataTestId = ""
69
+ } = props;
70
+ const { host_static_assets, environment_assets } = useEnvironment();
71
+ const classes = accordionUtilityClasses();
72
+ return /* @__PURE__ */ jsx(
73
+ AccordionRoot,
74
+ {
75
+ className: clsx(classes.root, className),
76
+ ...process.env.NODE_ENV !== "production" ? {
77
+ [TEST_PROP_ID]: getNameDataTestId(
78
+ COMPONENT_PREFIX,
79
+ "root",
80
+ dataTestId
81
+ )
82
+ } : {},
83
+ children: /* @__PURE__ */ jsxs(
84
+ Accordion$1,
85
+ {
86
+ variant: "outlined",
87
+ square: true,
88
+ TransitionProps: { unmountOnExit: true },
89
+ defaultExpanded: true,
90
+ ...accordionProps,
91
+ children: [
92
+ /* @__PURE__ */ jsx(
93
+ AccordionSummary,
94
+ {
95
+ "aria-controls": "expanded-content",
96
+ disableTouchRipple: false,
97
+ expandIcon: /* @__PURE__ */ jsx(
98
+ IconButton,
99
+ {
100
+ "aria-label": "settings",
101
+ src: `${host_static_assets}/${environment_assets}/frontend/components/accordion/assets/icons/expanded.svg`,
102
+ className: classes.endIcon
103
+ }
104
+ ),
105
+ ...summaryProps,
106
+ children: /* @__PURE__ */ jsxs(
107
+ "div",
108
+ {
109
+ className: classes.labelIcon,
110
+ ...process.env.NODE_ENV !== "production" ? {
111
+ [TEST_PROP_ID]: getNameDataTestId(
112
+ COMPONENT_PREFIX,
113
+ "labelIcon",
114
+ dataTestId
115
+ )
116
+ } : {},
117
+ children: [
118
+ labelIcon && /* @__PURE__ */ jsx(Icon, { src: labelIcon }),
119
+ /* @__PURE__ */ jsx(
120
+ Typography,
121
+ {
122
+ className: classes.label,
123
+ variant: "subtitle",
124
+ skeletonWidth: SKTWidht,
125
+ skeletongHeight: SKTHeight,
126
+ children: label
127
+ }
128
+ )
129
+ ]
130
+ }
131
+ )
132
+ }
133
+ ),
134
+ /* @__PURE__ */ jsx(AccordionDetails, { className: classes.content, children })
135
+ ]
136
+ }
137
+ )
138
+ }
139
+ );
140
+ }
141
+ export {
142
+ Accordion as A
143
+ };
@@ -0,0 +1,63 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Skeleton, generateUtilityClasses, generateUtilityClass, styled, Avatar as Avatar$1 } from "@mui/material";
4
+ import { useModuleSkeleton } from "@m4l/core";
5
+ import { T as TEST_PROP_ID } from "../../areas/constants.630a4f42.js";
6
+ import { unstable_composeClasses } from "@mui/base";
7
+ import clsx from "clsx";
8
+ const AVATAR_PREFIX = "M4LAvatar";
9
+ const getNameAvatarDataTestId = (KEY) => {
10
+ return `${AVATAR_PREFIX}-${KEY}`;
11
+ };
12
+ const SkeletonAvatar = (props) => {
13
+ const { className } = props;
14
+ return /* @__PURE__ */ jsx(
15
+ Skeleton,
16
+ {
17
+ variant: "circular",
18
+ width: "32px",
19
+ height: "32px",
20
+ className,
21
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameAvatarDataTestId("skeleton") } : {}
22
+ }
23
+ );
24
+ };
25
+ const componentName = "M4LAvatar";
26
+ generateUtilityClasses(componentName, [
27
+ "root",
28
+ "skeleton"
29
+ ]);
30
+ function getAvatarUtilityClass(slot) {
31
+ return generateUtilityClass(componentName, slot);
32
+ }
33
+ const useAvatarUtilityClasses = () => {
34
+ const slots = {
35
+ root: ["root"],
36
+ skeleton: ["skeleton"]
37
+ };
38
+ const composedClasses = unstable_composeClasses(slots, getAvatarUtilityClass, {});
39
+ return {
40
+ ...composedClasses
41
+ };
42
+ };
43
+ const AvatarRoot = styled("div")(({ theme }) => ({
44
+ ...theme.components?.M4LAvatar?.styleOverrides
45
+ }));
46
+ const Avatar = forwardRef(
47
+ ({ color = "default", sx, className, ...other }, ref) => {
48
+ const isSkeleton = useModuleSkeleton();
49
+ const classes = useAvatarUtilityClasses();
50
+ return /* @__PURE__ */ jsx(
51
+ AvatarRoot,
52
+ {
53
+ className: clsx(classes.root, className),
54
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameAvatarDataTestId("root") } : {},
55
+ children: !isSkeleton ? /* @__PURE__ */ jsx(Avatar$1, { ref, ...other }) : /* @__PURE__ */ jsx(SkeletonAvatar, { className: classes.skeleton })
56
+ }
57
+ );
58
+ }
59
+ );
60
+ Avatar.displayName = "Avatar";
61
+ export {
62
+ Avatar as A
63
+ };
@@ -0,0 +1,31 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { generateUtilityClasses, Badge as Badge$1 } from "@mui/material";
3
+ import "@mui/base";
4
+ import { styled } from "@mui/material/styles";
5
+ import { T as TEST_PROP_ID } from "../../areas/constants.630a4f42.js";
6
+ const componentName = "M4LBadge";
7
+ const badgeClasses = generateUtilityClasses(componentName, [
8
+ "root"
9
+ ]);
10
+ const BadgeRoot = styled("div")(({ theme }) => ({
11
+ display: "flex",
12
+ ...theme.components?.M4LBadge?.styleOverrides
13
+ }));
14
+ const BADGE_PREFIX = "M4LBadge";
15
+ const getNameBadgeDataTestId = (ELEMENTKEY, ID) => {
16
+ return `${BADGE_PREFIX}-${ELEMENTKEY}-${ID}`;
17
+ };
18
+ const Badge = (props) => {
19
+ const { children, dataTestId = "", ...others } = props;
20
+ return /* @__PURE__ */ jsx(
21
+ BadgeRoot,
22
+ {
23
+ className: badgeClasses.root,
24
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameBadgeDataTestId("root", dataTestId) } : {},
25
+ children: /* @__PURE__ */ jsx(Badge$1, { ...others, children })
26
+ }
27
+ );
28
+ };
29
+ export {
30
+ Badge as B
31
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Box } from "@mui/material";
3
+ function BoxIcon({ src, sx }) {
4
+ return /* @__PURE__ */ jsx(
5
+ Box,
6
+ {
7
+ component: "span",
8
+ sx: {
9
+ width: 20,
10
+ height: 20,
11
+ display: "inline-block",
12
+ bgcolor: "currentColor",
13
+ mask: `url(${src}) no-repeat center / contain`,
14
+ WebkitMask: `url(${src}) no-repeat center / contain`,
15
+ ...sx
16
+ }
17
+ }
18
+ );
19
+ }
20
+ export {
21
+ BoxIcon as B
22
+ };
@@ -0,0 +1,87 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useModuleDictionary } from "@m4l/core";
4
+ import { Link, Box, Typography, Breadcrumbs as Breadcrumbs$1 } from "@mui/material";
5
+ import { Link as Link$1 } from "react-router-dom";
6
+ function LinkItem({ link }) {
7
+ const { href, name, icon, dictionaryField: dictionaryDescription } = link;
8
+ const { getLabel } = useModuleDictionary();
9
+ return /* @__PURE__ */ jsxs(
10
+ Link,
11
+ {
12
+ variant: "body2",
13
+ component: Link$1,
14
+ to: href || "#",
15
+ sx: {
16
+ lineHeight: 2,
17
+ display: "flex",
18
+ alignItems: "center",
19
+ color: "text.primary",
20
+ "& > div": { display: "inherit" }
21
+ },
22
+ children: [
23
+ icon && /* @__PURE__ */ jsx(Box, { sx: { mr: 1, "& svg": { width: 20, height: 20 } }, children: icon }),
24
+ dictionaryDescription !== void 0 && getLabel ? getLabel(dictionaryDescription) : name
25
+ ]
26
+ },
27
+ name
28
+ );
29
+ }
30
+ function Breadcrumbs(props) {
31
+ const { links, activeLast = false, ...other } = props;
32
+ const { getLabel } = useModuleDictionary();
33
+ const currentLink = useMemo(() => {
34
+ if (links.length === 0)
35
+ return "";
36
+ const { dictionaryField } = links[links.length - 1];
37
+ return getLabel(dictionaryField);
38
+ }, [getLabel, links]);
39
+ const listDefault = useMemo(
40
+ () => links.map((link) => /* @__PURE__ */ jsx(LinkItem, { link }, link.name)),
41
+ [links]
42
+ );
43
+ const listActiveLast = useMemo(
44
+ () => links.map(
45
+ (link) => link.name !== currentLink ? /* @__PURE__ */ jsx(LinkItem, { link }, link.name) : /* @__PURE__ */ jsx(
46
+ Typography,
47
+ {
48
+ variant: "body2",
49
+ sx: {
50
+ maxWidth: 260,
51
+ overflow: "hidden",
52
+ whiteSpace: "nowrap",
53
+ color: "text.disabled",
54
+ textOverflow: "ellipsis"
55
+ },
56
+ children: currentLink
57
+ },
58
+ link.name
59
+ )
60
+ ),
61
+ [currentLink, links]
62
+ );
63
+ return /* @__PURE__ */ jsx(
64
+ Breadcrumbs$1,
65
+ {
66
+ id: "MUIBreadcrumbs",
67
+ separator: /* @__PURE__ */ jsx(
68
+ Box,
69
+ {
70
+ component: "span",
71
+ sx: {
72
+ width: 4,
73
+ height: 4,
74
+ mx: 0.5,
75
+ borderRadius: "50%",
76
+ bgcolor: "text.disabled"
77
+ }
78
+ }
79
+ ),
80
+ ...other,
81
+ children: activeLast ? listDefault : listActiveLast
82
+ }
83
+ );
84
+ }
85
+ export {
86
+ Breadcrumbs as B
87
+ };
@@ -0,0 +1,289 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useModuleSkeleton, useEnvironment } from "@m4l/core";
3
+ import { Skeleton, generateUtilityClasses, generateUtilityClass, IconButton, Tooltip, styled as styled$1 } from "@mui/material";
4
+ import MuiButton from "@mui/material/Button";
5
+ import { styled } from "@mui/material/styles";
6
+ import { unstable_composeClasses } from "@mui/base";
7
+ import clsx from "clsx";
8
+ import { useMemo, useState, useEffect } from "react";
9
+ import { I as Image } from "../../Image/index.0d32558e.js";
10
+ import { T as TEST_PROP_ID } from "../../areas/constants.630a4f42.js";
11
+ import { LoadingButton as LoadingButton$1 } from "@mui/lab";
12
+ import { T as Typography } from "../Typography/index.2a1c68f8.js";
13
+ import { useMap } from "react-leaflet";
14
+ import { M as MAP_ICONS } from "../../areas/icons.504ec098.js";
15
+ import { m as mapClasses } from "../../maps/index.ba1ccfad.js";
16
+ import { I as IconButton$1 } from "../IconButton/index.87f4726c.js";
17
+ import { u as useSideBar, g as getNameDataTestId$2 } from "../../SideBar/index.004a2de1.js";
18
+ const ButtonRoot = styled("div")(({ theme }) => ({
19
+ ...theme.components?.M4LButton?.styleOverrides
20
+ }));
21
+ styled(Skeleton)(({ theme }) => ({
22
+ borderRadius: theme.spacing(0.5)
23
+ }));
24
+ const componentName$2 = "M4LButton";
25
+ const buttonClasses = generateUtilityClasses(componentName$2, [
26
+ "root",
27
+ "skeleton",
28
+ "sizeSmall",
29
+ "sizeMedium",
30
+ "variantOutlined",
31
+ "variantContained",
32
+ "variantText",
33
+ "isDisabled",
34
+ "colorError",
35
+ "colorSuccess",
36
+ "colorWarning",
37
+ "togglePressed",
38
+ "toggleNotPressed"
39
+ ]);
40
+ function getButtonUtilityClass(slot) {
41
+ return generateUtilityClass(componentName$2, slot);
42
+ }
43
+ const useUtilityClasses$2 = (onwerState) => {
44
+ const slots = {
45
+ root: [
46
+ "root",
47
+ onwerState.size === "small" && "sizeSmall",
48
+ onwerState.size === "medium" && "sizeMedium",
49
+ onwerState.variant === "outlined" && "variantOutlined",
50
+ onwerState.variant === "contained" && "variantContained",
51
+ onwerState.variant === "text" && "variantText",
52
+ onwerState.isDisabled && "isDisabled",
53
+ onwerState.colorState === "error" && "colorError",
54
+ onwerState.colorState === "success" && "colorSuccess",
55
+ onwerState.colorState === "warning" && "colorWarning"
56
+ ],
57
+ skeleton: ["skeleton"]
58
+ };
59
+ const composedClasses = unstable_composeClasses(slots, getButtonUtilityClass, {});
60
+ return {
61
+ ...composedClasses
62
+ };
63
+ };
64
+ const Button = (props) => {
65
+ const {
66
+ size = "small",
67
+ variant = "contained",
68
+ className,
69
+ disabled,
70
+ skeletonWidth = "100px",
71
+ skeletonHeight = "28px",
72
+ colorState,
73
+ ...others
74
+ } = props;
75
+ const isSkeleton = useModuleSkeleton();
76
+ const ownerState = {
77
+ size,
78
+ variant,
79
+ isDisabled: disabled,
80
+ colorState
81
+ };
82
+ const classes = useUtilityClasses$2(ownerState);
83
+ return /* @__PURE__ */ jsx(ButtonRoot, { className: clsx(classes.root, className), "data-testid": "ButtonRoot", children: !isSkeleton ? /* @__PURE__ */ jsx(MuiButton, { ...others, variant, size, disableRipple: true, disabled }) : /* @__PURE__ */ jsx(
84
+ Skeleton,
85
+ {
86
+ className: classes.skeleton,
87
+ "data-testid": "MuiSkeleton",
88
+ variant: "rectangular",
89
+ width: skeletonWidth
90
+ }
91
+ ) });
92
+ };
93
+ const WrapperImageButton = styled("div")(({ theme }) => ({
94
+ ...theme.components?.M4LImageButton?.styleOverrides
95
+ }));
96
+ const componentName$1 = "M4LImageButton";
97
+ generateUtilityClasses(componentName$1, [
98
+ "root"
99
+ ]);
100
+ function getImageButtonUtilityClass(slot) {
101
+ return generateUtilityClass(componentName$1, slot);
102
+ }
103
+ const useUtilityClasses$1 = () => {
104
+ const slots = {
105
+ root: ["root"]
106
+ };
107
+ const composedClasses = unstable_composeClasses(slots, getImageButtonUtilityClass, {});
108
+ return {
109
+ ...composedClasses
110
+ };
111
+ };
112
+ const IMAGEBUTTON_PREFIX = "ImageButton";
113
+ const getNameDataTestId$1 = (KEY) => {
114
+ return `${IMAGEBUTTON_PREFIX}-${KEY}`;
115
+ };
116
+ function ImageButton({
117
+ src,
118
+ width,
119
+ height,
120
+ tooltip,
121
+ sx = { width, height },
122
+ ...other
123
+ }) {
124
+ const finalTooltip = tooltip;
125
+ const classes = useUtilityClasses$1();
126
+ const imageButton = useMemo(() => {
127
+ return /* @__PURE__ */ jsx(IconButton, { sx, ...other, children: /* @__PURE__ */ jsx(Image, { src }) });
128
+ }, [src, width, height, sx]);
129
+ return /* @__PURE__ */ jsx(
130
+ WrapperImageButton,
131
+ {
132
+ className: classes.root,
133
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId$1("root") } : {},
134
+ children: finalTooltip ? /* @__PURE__ */ jsx(Tooltip, { title: finalTooltip || "", children: imageButton }) : imageButton
135
+ }
136
+ );
137
+ }
138
+ const componentName = "M4LLoadingButton";
139
+ generateUtilityClasses(
140
+ componentName,
141
+ [
142
+ "root",
143
+ "skeleton",
144
+ "sizeSmall",
145
+ "sizeMedium",
146
+ "variantOutlined",
147
+ "variantContained",
148
+ "variantText",
149
+ "isDisabled"
150
+ ]
151
+ );
152
+ function getLoadingButtonUtilityClass(slot) {
153
+ return generateUtilityClass(componentName, slot);
154
+ }
155
+ const useUtilityClasses = (onwerState) => {
156
+ const slots = {
157
+ root: [
158
+ "root",
159
+ onwerState.size === "small" && "sizeSmall",
160
+ onwerState.size === "medium" && "sizeMedium",
161
+ onwerState.variant === "outlined" && "variantOutlined",
162
+ onwerState.variant === "contained" && "variantContained",
163
+ onwerState.variant === "text" && "variantText",
164
+ onwerState.isDisabled && "isDisabled"
165
+ ],
166
+ skeleton: ["skeleton"]
167
+ };
168
+ const composedClasses = unstable_composeClasses(slots, getLoadingButtonUtilityClass, {});
169
+ return {
170
+ ...composedClasses
171
+ };
172
+ };
173
+ const LoadingButtonRoot = styled$1("div")(({ theme }) => ({
174
+ ...theme.components?.M4LLoadingButton?.styleOverrides
175
+ }));
176
+ const LOADINGBUTTON_PREFIX = "M4LoadingButton";
177
+ const getNameDataTestId = (KEY) => {
178
+ return `${LOADINGBUTTON_PREFIX}-${KEY}`;
179
+ };
180
+ const LoadingButton = (props) => {
181
+ const {
182
+ children,
183
+ skeletonWidth = "100%",
184
+ size = "small",
185
+ variant = "contained",
186
+ disabled,
187
+ className,
188
+ ...other
189
+ } = props;
190
+ const isSkeleton = useModuleSkeleton();
191
+ const ownerState = {
192
+ size,
193
+ variant,
194
+ isDisabled: disabled
195
+ };
196
+ const classes = useUtilityClasses(ownerState);
197
+ return /* @__PURE__ */ jsx(
198
+ LoadingButtonRoot,
199
+ {
200
+ className: clsx(classes.root, className),
201
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("root") } : {},
202
+ children: !isSkeleton ? /* @__PURE__ */ jsx(LoadingButton$1, { ...other, variant, size, children: /* @__PURE__ */ jsx(Typography, { variant: "action", children }) }) : /* @__PURE__ */ jsx(
203
+ Skeleton,
204
+ {
205
+ className: classes.skeleton,
206
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("skeleton") } : {},
207
+ variant: "rectangular",
208
+ width: skeletonWidth
209
+ }
210
+ )
211
+ }
212
+ );
213
+ };
214
+ function ZoomButtons() {
215
+ const map = useMap();
216
+ const { host_static_assets, environment_assets } = useEnvironment();
217
+ const [, setZoomInDisabled] = useState(false);
218
+ const [, setZoomOutDisabled] = useState(false);
219
+ useEffect(() => {
220
+ const updateButtonState = () => {
221
+ const currentZoom = map.getZoom();
222
+ const maxZoom = map.getMaxZoom();
223
+ const minZoom = map.getMinZoom();
224
+ setZoomInDisabled(currentZoom === maxZoom);
225
+ setZoomOutDisabled(currentZoom === minZoom);
226
+ };
227
+ map.on("zoomend", updateButtonState);
228
+ updateButtonState();
229
+ return () => {
230
+ map.off("zoomend", updateButtonState);
231
+ };
232
+ }, [map]);
233
+ const handleZoomIn = () => {
234
+ map.zoomIn();
235
+ };
236
+ const handleZoomOut = () => {
237
+ map.zoomOut();
238
+ };
239
+ return /* @__PURE__ */ jsxs("div", { className: mapClasses.zoomButtons, children: [
240
+ /* @__PURE__ */ jsx(
241
+ IconButton$1,
242
+ {
243
+ onClick: handleZoomIn,
244
+ src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_IN}`
245
+ }
246
+ ),
247
+ /* @__PURE__ */ jsx(
248
+ IconButton$1,
249
+ {
250
+ onClick: handleZoomOut,
251
+ src: `${host_static_assets}/${environment_assets}/frontend/components/map/assets/icons/${MAP_ICONS.MAP_ZOOM_OUT}`
252
+ }
253
+ )
254
+ ] });
255
+ }
256
+ const CollapseButtonRoot = styled$1("div")(() => ({
257
+ display: "flex"
258
+ }));
259
+ styled$1("div")(() => ({
260
+ display: "flex"
261
+ }));
262
+ function FooterSidebar(_props) {
263
+ const { classes, companyLogoNormalUrl } = useSideBar();
264
+ return /* @__PURE__ */ jsx(
265
+ CollapseButtonRoot,
266
+ {
267
+ className: classes.footer,
268
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId$2("footer") } : {},
269
+ children: /* @__PURE__ */ jsx("div", { className: classes.wrapperLogoFooter, children: /* @__PURE__ */ jsx("div", { className: classes.containerLogoButtonLogo, children: /* @__PURE__ */ jsx(
270
+ Image,
271
+ {
272
+ width: "192px",
273
+ height: "28px",
274
+ src: companyLogoNormalUrl || "",
275
+ alt: "logo"
276
+ },
277
+ "Logo"
278
+ ) }) })
279
+ }
280
+ );
281
+ }
282
+ export {
283
+ Button as B,
284
+ FooterSidebar as F,
285
+ ImageButton as I,
286
+ LoadingButton as L,
287
+ ZoomButtons as Z,
288
+ buttonClasses as b
289
+ };