@m4l/components 0.1.13 → 0.1.15
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/assets/Logo/index.js +91 -0
- package/commonjs.js +9 -0
- package/components/CommonActions/components/ActionCancel/index.js +15 -0
- package/components/CommonActions/components/ActionFormCancel/index.js +62 -0
- package/components/CommonActions/components/ActionFormIntro/index.js +35 -0
- package/components/CommonActions/components/ActionIntro/index.js +16 -0
- package/components/CommonActions/components/Actions/index.js +859 -0
- package/components/CompanyLogo/{index.f81c179c.js → index.js} +48 -42
- package/components/DataGrid/index.js +1067 -0
- package/components/DynamicFilter/index.js +1573 -0
- package/components/ErrorLabel/index.js +18 -0
- package/components/Icon/index.js +80 -0
- package/components/Image/index.js +128 -0
- package/components/LanguagePopover/index.js +93 -0
- package/components/Loadable/index.js +13 -0
- package/components/ModalDialog/index.js +180 -0
- package/components/NoItemSelected/{index.12f0ca67.js → index.js} +50 -43
- package/components/ObjectLogs/index.js +284 -0
- package/components/Page/index.js +36 -0
- package/components/PaperForm/index.js +110 -0
- package/components/Period/index.js +230 -0
- package/components/PropertyValue/index.js +142 -0
- package/components/Resizeable/{index.45995d2b.js → index.js} +19 -21
- package/components/ScrollBar/index.js +52 -0
- package/components/ScrollToTop/index.js +10 -0
- package/components/SplitLayout/{index.4032673d.js → index.js} +35 -35
- package/components/animate/LoadingScreen/{index.f1cec7db.js → index.js} +27 -29
- package/components/animate/MotionContainer/index.js +31 -0
- package/components/animate/MotionLazyContainer/index.js +13 -0
- package/components/animate/features.js +2 -0
- package/components/animate/variants/{bounce.784aaaaa.js → bounce.js} +16 -15
- package/components/animate/variants/container.js +20 -0
- package/components/animate/variants/fade.js +61 -0
- package/components/animate/variants/{index.7a912140.js → index.js} +0 -0
- package/components/animate/variants/transition.js +16 -0
- package/components/formatters/BooleanFormatter/index.js +52 -0
- package/components/formatters/DateFormatter/index.js +66 -0
- package/components/formatters/index.js +112 -0
- package/components/hook-form/FormProvider/index.js +61 -0
- package/components/hook-form/RHFAutocomplete/index.js +144 -0
- package/components/hook-form/RHFAutocompleteAsync/index.js +191 -0
- package/components/hook-form/RHFCheckbox/index.js +65 -0
- package/components/hook-form/RHFDateTime/index.js +79 -0
- package/components/hook-form/RHFMultiCheckbox/index.js +32 -0
- package/components/hook-form/RHFPeriod/index.js +47 -0
- package/components/hook-form/RHFRadioGroup/index.js +41 -0
- package/components/hook-form/RHFSelect/index.js +34 -0
- package/components/hook-form/RHFTextField/index.js +87 -0
- package/components/hook-form/RHFUpload/index.js +255 -0
- package/components/mui_extended/Accordion/index.js +105 -0
- package/components/mui_extended/Avatar/index.js +33 -0
- package/components/mui_extended/BoxIcon/index.js +20 -0
- package/components/mui_extended/Breadcrumbs/index.js +92 -0
- package/components/mui_extended/Button/index.js +131 -0
- package/components/mui_extended/IconButton/index.js +108 -0
- package/components/mui_extended/LinkWithRoute/index.js +30 -0
- package/components/mui_extended/MenuPopover/index.js +135 -0
- package/components/mui_extended/Pager/index.js +137 -0
- package/components/mui_extended/Tab/index.js +30 -0
- package/components/mui_extended/Typography/index.js +21 -0
- package/contexts/ModalContext/index.js +165 -0
- package/hooks/useFormAddEdit/index.js +42 -0
- package/hooks/useModal/index.js +4 -0
- package/index.js +70 -162
- package/lodash.js +62 -0
- package/node_modules.js +54 -0
- package/package.json +2 -1
- package/react-data-grid.js +2652 -0
- package/react-draggable.js +960 -0
- package/react-json-view.js +2764 -0
- package/react-lazy-load-image-component.js +792 -0
- package/react-resizable.js +541 -0
- package/react-splitter-layout.js +165 -0
- package/utils/index.js +572 -0
- package/assets/Logo/index.228dcb5a.js +0 -86
- package/commonjs.565e6834.js +0 -12
- package/components/CommonActions/components/ActionCancel/index.cba1b460.js +0 -17
- package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +0 -49
- package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +0 -31
- package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +0 -18
- package/components/CommonActions/components/Actions/index.e8148d98.js +0 -743
- package/components/DataGrid/index.b688877d.js +0 -894
- package/components/DynamicFilter/index.82ce857e.js +0 -1158
- package/components/ErrorLabel/index.c8615f16.js +0 -19
- package/components/Icon/index.cbca79b0.js +0 -70
- package/components/Image/index.e790b50b.js +0 -122
- package/components/LanguagePopover/index.3d9611cb.js +0 -87
- package/components/Loadable/index.f5518558.js +0 -15
- package/components/ModalDialog/index.3850c053.js +0 -168
- package/components/ObjectLogs/index.27ef875d.js +0 -266
- package/components/Page/index.6d69977e.js +0 -35
- package/components/PaperForm/index.d7c74064.js +0 -105
- package/components/Period/index.5e68286a.js +0 -160
- package/components/PropertyValue/index.ab3dd7e9.js +0 -116
- package/components/ScrollBar/index.39eeb2de.js +0 -49
- package/components/ScrollToTop/index.e06f98f6.js +0 -11
- package/components/animate/MotionContainer/index.8d9f9d80.js +0 -30
- package/components/animate/MotionLazyContainer/index.572dd012.js +0 -15
- package/components/animate/features.0fbf41e1.js +0 -5
- package/components/animate/variants/container.11f82b76.js +0 -20
- package/components/animate/variants/fade.b561c0fc.js +0 -59
- package/components/animate/variants/transition.bd46b9ce.js +0 -15
- package/components/formatters/BooleanFormatter/index.cca53b7f.js +0 -42
- package/components/formatters/DateFormatter/index.ad8d9b8e.js +0 -57
- package/components/formatters/index.55856d65.js +0 -106
- package/components/hook-form/FormProvider/index.257acd9f.js +0 -55
- package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +0 -122
- package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +0 -153
- package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +0 -59
- package/components/hook-form/RHFDateTime/index.fc5cbafe.js +0 -68
- package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +0 -34
- package/components/hook-form/RHFPeriod/index.23c254e9.js +0 -45
- package/components/hook-form/RHFRadioGroup/index.b3335e13.js +0 -43
- package/components/hook-form/RHFSelect/index.b6ca8bb2.js +0 -36
- package/components/hook-form/RHFTextField/index.4c455f75.js +0 -77
- package/components/hook-form/RHFUpload/index.ed3d739f.js +0 -244
- package/components/mui_extended/Accordion/index.2116e423.js +0 -103
- package/components/mui_extended/Avatar/index.0a2a4523.js +0 -32
- package/components/mui_extended/BoxIcon/index.e638ecc8.js +0 -22
- package/components/mui_extended/Breadcrumbs/index.5e37d903.js +0 -89
- package/components/mui_extended/Button/index.84d8898c.js +0 -110
- package/components/mui_extended/IconButton/index.88f3aadb.js +0 -98
- package/components/mui_extended/LinkWithRoute/index.d4b263de.js +0 -28
- package/components/mui_extended/MenuPopover/index.488fc536.js +0 -131
- package/components/mui_extended/Pager/index.0576814f.js +0 -126
- package/components/mui_extended/Tab/index.e0653a0a.js +0 -28
- package/components/mui_extended/Typography/index.0c4604b3.js +0 -22
- package/contexts/ModalContext/index.2188b69e.js +0 -150
- package/hooks/useFormAddEdit/index.d4845f1a.js +0 -26
- package/hooks/useModal/index.6571d2d9.js +0 -6
- package/lodash.e09401f0.js +0 -32
- package/node_modules.168cb897.js +0 -55
- package/react-data-grid.d46d625e.js +0 -2115
- package/react-draggable.20e95c61.js +0 -714
- package/react-json-view.f56a7f8e.js +0 -2762
- package/react-lazy-load-image-component.45b56650.js +0 -784
- package/react-resizable.5277deaf.js +0 -371
- package/react-splitter-layout.7810ac1b.js +0 -165
- package/utils/index.214d9542.js +0 -435
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Skeleton, Accordion as Accordion$1, AccordionSummary, AccordionDetails } from "@mui/material";
|
|
2
|
+
import { I as IconButton } from "../IconButton/index.js";
|
|
3
|
+
import { useEnvironment, useModuleSkeleton } from "@m4l/core";
|
|
4
|
+
import { I as Icon } from "../../Icon/index.js";
|
|
5
|
+
import { styled } from "@mui/material/styles";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
styled("div")(({
|
|
8
|
+
theme
|
|
9
|
+
}) => ({
|
|
10
|
+
display: "flex",
|
|
11
|
+
justifyContent: "space-between",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
borderRadius: theme.spacing(0.5),
|
|
14
|
+
height: theme.spacing(4.5),
|
|
15
|
+
minHeight: theme.spacing(4.5),
|
|
16
|
+
backgroundColor: theme.palette.background.header,
|
|
17
|
+
paddingLeft: theme.spacing(2),
|
|
18
|
+
paddingRight: theme.spacing(2),
|
|
19
|
+
marginBottom: "0px"
|
|
20
|
+
}));
|
|
21
|
+
const WrapperAccordionLabel = styled("div")(({
|
|
22
|
+
theme
|
|
23
|
+
}) => ({
|
|
24
|
+
display: "flex",
|
|
25
|
+
justifyContent: "flex-start",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
gap: theme.spacing(2)
|
|
28
|
+
}));
|
|
29
|
+
const Label = styled("span")(({
|
|
30
|
+
theme
|
|
31
|
+
}) => ({
|
|
32
|
+
...theme.typography.subtitle2
|
|
33
|
+
}));
|
|
34
|
+
const AccordionLabel = (props) => {
|
|
35
|
+
const {
|
|
36
|
+
isSkeleton,
|
|
37
|
+
label,
|
|
38
|
+
SKTWidht,
|
|
39
|
+
SKTHeight,
|
|
40
|
+
labelIcon
|
|
41
|
+
} = props;
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
children: isSkeleton ? /* @__PURE__ */ jsxs(WrapperAccordionLabel, {
|
|
44
|
+
children: [labelIcon && /* @__PURE__ */ jsx(Skeleton, {
|
|
45
|
+
variant: "circular",
|
|
46
|
+
width: "16px",
|
|
47
|
+
height: "16px"
|
|
48
|
+
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
49
|
+
variant: "text",
|
|
50
|
+
width: SKTWidht,
|
|
51
|
+
height: SKTHeight
|
|
52
|
+
})]
|
|
53
|
+
}) : /* @__PURE__ */ jsxs(WrapperAccordionLabel, {
|
|
54
|
+
children: [labelIcon && /* @__PURE__ */ jsx(Icon, {
|
|
55
|
+
src: labelIcon
|
|
56
|
+
}), /* @__PURE__ */ jsx(Label, {
|
|
57
|
+
children: label
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
function Accordion(props) {
|
|
63
|
+
const {
|
|
64
|
+
label,
|
|
65
|
+
SKTWidht,
|
|
66
|
+
SKTHeight,
|
|
67
|
+
children,
|
|
68
|
+
accordionProps,
|
|
69
|
+
summaryProps,
|
|
70
|
+
labelIcon
|
|
71
|
+
} = props;
|
|
72
|
+
const {
|
|
73
|
+
host_static_assets,
|
|
74
|
+
environment_assets
|
|
75
|
+
} = useEnvironment();
|
|
76
|
+
const isSkeleton = useModuleSkeleton();
|
|
77
|
+
return /* @__PURE__ */ jsxs(Accordion$1, {
|
|
78
|
+
variant: "outlined",
|
|
79
|
+
square: true,
|
|
80
|
+
TransitionProps: {
|
|
81
|
+
unmountOnExit: true
|
|
82
|
+
},
|
|
83
|
+
defaultExpanded: true,
|
|
84
|
+
...accordionProps,
|
|
85
|
+
children: [/* @__PURE__ */ jsx(AccordionSummary, {
|
|
86
|
+
"aria-controls": "expanded-content",
|
|
87
|
+
disableTouchRipple: false,
|
|
88
|
+
expandIcon: /* @__PURE__ */ jsx(IconButton, {
|
|
89
|
+
"aria-label": "settings",
|
|
90
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/accordion/assets/icons/expanded.svg`
|
|
91
|
+
}),
|
|
92
|
+
...summaryProps,
|
|
93
|
+
children: /* @__PURE__ */ jsx(AccordionLabel, {
|
|
94
|
+
isSkeleton,
|
|
95
|
+
label,
|
|
96
|
+
SKTWidht,
|
|
97
|
+
SKTHeight,
|
|
98
|
+
labelIcon
|
|
99
|
+
})
|
|
100
|
+
}), /* @__PURE__ */ jsx(AccordionDetails, {
|
|
101
|
+
children
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export { Accordion as A };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { useTheme } from "@mui/material/styles";
|
|
3
|
+
import { Avatar as Avatar$1 } from "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
const Avatar = forwardRef(({
|
|
6
|
+
color = "default",
|
|
7
|
+
children,
|
|
8
|
+
sx,
|
|
9
|
+
...other
|
|
10
|
+
}, ref) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
if (color === "default") {
|
|
13
|
+
return /* @__PURE__ */ jsx(Avatar$1, {
|
|
14
|
+
ref,
|
|
15
|
+
sx,
|
|
16
|
+
...other,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(Avatar$1, {
|
|
21
|
+
ref,
|
|
22
|
+
sx: {
|
|
23
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
24
|
+
color: theme.palette[color].contrastText,
|
|
25
|
+
backgroundColor: theme.palette[color].main,
|
|
26
|
+
...sx
|
|
27
|
+
},
|
|
28
|
+
...other,
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
Avatar.displayName = "Avatar";
|
|
33
|
+
export { Avatar as A };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Box } from "@mui/material";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function BoxIcon({
|
|
4
|
+
src,
|
|
5
|
+
sx
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
8
|
+
component: "span",
|
|
9
|
+
sx: {
|
|
10
|
+
width: 20,
|
|
11
|
+
height: 20,
|
|
12
|
+
display: "inline-block",
|
|
13
|
+
bgcolor: "currentColor",
|
|
14
|
+
mask: `url(${src}) no-repeat center / contain`,
|
|
15
|
+
WebkitMask: `url(${src}) no-repeat center / contain`,
|
|
16
|
+
...sx
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export { BoxIcon as B };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
3
|
+
import { Link, Box, Typography, Breadcrumbs as Breadcrumbs$1 } from "@mui/material";
|
|
4
|
+
import { Link as Link$1 } from "react-router-dom";
|
|
5
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
6
|
+
function LinkItem({
|
|
7
|
+
link
|
|
8
|
+
}) {
|
|
9
|
+
const {
|
|
10
|
+
href,
|
|
11
|
+
name,
|
|
12
|
+
icon,
|
|
13
|
+
dictionaryField: dictionaryDescription
|
|
14
|
+
} = link;
|
|
15
|
+
const {
|
|
16
|
+
getLabel
|
|
17
|
+
} = useModuleDictionary();
|
|
18
|
+
return /* @__PURE__ */ jsxs(Link, {
|
|
19
|
+
variant: "body2",
|
|
20
|
+
component: Link$1,
|
|
21
|
+
to: href || "#",
|
|
22
|
+
sx: {
|
|
23
|
+
lineHeight: 2,
|
|
24
|
+
display: "flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
color: "text.primary",
|
|
27
|
+
"& > div": {
|
|
28
|
+
display: "inherit"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
children: [icon && /* @__PURE__ */ jsx(Box, {
|
|
32
|
+
sx: {
|
|
33
|
+
mr: 1,
|
|
34
|
+
"& svg": {
|
|
35
|
+
width: 20,
|
|
36
|
+
height: 20
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
children: icon
|
|
40
|
+
}), dictionaryDescription !== void 0 && getLabel ? getLabel(dictionaryDescription) : name]
|
|
41
|
+
}, name);
|
|
42
|
+
}
|
|
43
|
+
function Breadcrumbs(props) {
|
|
44
|
+
const {
|
|
45
|
+
links,
|
|
46
|
+
activeLast = false,
|
|
47
|
+
...other
|
|
48
|
+
} = props;
|
|
49
|
+
const {
|
|
50
|
+
getLabel
|
|
51
|
+
} = useModuleDictionary();
|
|
52
|
+
const currentLink = useMemo(() => {
|
|
53
|
+
if (links.length === 0)
|
|
54
|
+
return "";
|
|
55
|
+
const {
|
|
56
|
+
dictionaryField
|
|
57
|
+
} = links[links.length - 1];
|
|
58
|
+
return getLabel(dictionaryField);
|
|
59
|
+
}, [getLabel, links]);
|
|
60
|
+
const listDefault = useMemo(() => links.map((link) => /* @__PURE__ */ jsx(LinkItem, {
|
|
61
|
+
link
|
|
62
|
+
}, link.name)), [links]);
|
|
63
|
+
const listActiveLast = useMemo(() => links.map((link) => link.name !== currentLink ? /* @__PURE__ */ jsx(LinkItem, {
|
|
64
|
+
link
|
|
65
|
+
}, link.name) : /* @__PURE__ */ jsx(Typography, {
|
|
66
|
+
variant: "body2",
|
|
67
|
+
sx: {
|
|
68
|
+
maxWidth: 260,
|
|
69
|
+
overflow: "hidden",
|
|
70
|
+
whiteSpace: "nowrap",
|
|
71
|
+
color: "text.disabled",
|
|
72
|
+
textOverflow: "ellipsis"
|
|
73
|
+
},
|
|
74
|
+
children: currentLink
|
|
75
|
+
}, link.name)), [currentLink, links]);
|
|
76
|
+
return /* @__PURE__ */ jsx(Breadcrumbs$1, {
|
|
77
|
+
id: "MUIBreadcrumbs",
|
|
78
|
+
separator: /* @__PURE__ */ jsx(Box, {
|
|
79
|
+
component: "span",
|
|
80
|
+
sx: {
|
|
81
|
+
width: 4,
|
|
82
|
+
height: 4,
|
|
83
|
+
mx: 0.5,
|
|
84
|
+
borderRadius: "50%",
|
|
85
|
+
bgcolor: "text.disabled"
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
...other,
|
|
89
|
+
children: activeLast ? listDefault : listActiveLast
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
export { Breadcrumbs as B };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
2
|
+
import MuiButton from "@mui/material/Button";
|
|
3
|
+
import { styled, Skeleton } from "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { LoadingButton as LoadingButton$1 } from "@mui/lab";
|
|
6
|
+
import { styled as styled$1, alpha } from "@mui/material/styles";
|
|
7
|
+
import { I as IconButton } from "../IconButton/index.js";
|
|
8
|
+
import { u as useBase } from "../../DynamicFilter/index.js";
|
|
9
|
+
import { useMemo } from "react";
|
|
10
|
+
const SKTButton = styled(Skeleton)(({
|
|
11
|
+
theme
|
|
12
|
+
}) => ({
|
|
13
|
+
borderRadius: theme.spacing(0.5)
|
|
14
|
+
}));
|
|
15
|
+
const Button = (props) => {
|
|
16
|
+
const isSkeleton = useModuleSkeleton();
|
|
17
|
+
if (isSkeleton) {
|
|
18
|
+
return /* @__PURE__ */ jsx(SKTButton, {
|
|
19
|
+
variant: "rectangular",
|
|
20
|
+
width: "100px",
|
|
21
|
+
height: "36px"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(MuiButton, {
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const WrapperSKTLoadingButton = styled$1("div")(({
|
|
29
|
+
theme
|
|
30
|
+
}) => ({
|
|
31
|
+
display: "flex",
|
|
32
|
+
width: "100%",
|
|
33
|
+
borderRadius: theme.spacing(1),
|
|
34
|
+
overflow: "hidden"
|
|
35
|
+
}));
|
|
36
|
+
const SKTLoadingButton = () => /* @__PURE__ */ jsx(WrapperSKTLoadingButton, {
|
|
37
|
+
id: "WrapperSKTLoadingButton",
|
|
38
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
39
|
+
variant: "rectangular",
|
|
40
|
+
width: "100%",
|
|
41
|
+
height: "48px"
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
const LoadingButton = (props) => {
|
|
45
|
+
const {
|
|
46
|
+
isSkeleton,
|
|
47
|
+
children,
|
|
48
|
+
...other
|
|
49
|
+
} = props;
|
|
50
|
+
if (isSkeleton) {
|
|
51
|
+
return /* @__PURE__ */ jsx(SKTLoadingButton, {});
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ jsx(LoadingButton$1, {
|
|
54
|
+
...other,
|
|
55
|
+
children
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const SKTWrapperFilterButton = styled$1("div")(({
|
|
59
|
+
theme
|
|
60
|
+
}) => ({
|
|
61
|
+
display: "flex",
|
|
62
|
+
justifyContent: "center",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
minWidth: theme.spacing(3.75),
|
|
65
|
+
height: theme.spacing(3.75),
|
|
66
|
+
background: alpha(theme.palette.primary.main, 0.3)
|
|
67
|
+
}));
|
|
68
|
+
const WrapperFilterButton = styled$1("div")(() => ({
|
|
69
|
+
"&.isDirty": {
|
|
70
|
+
animationName: "dirtyEffect",
|
|
71
|
+
animationDuration: "1s",
|
|
72
|
+
animationFillMode: "both",
|
|
73
|
+
animationIterationCount: "infinite",
|
|
74
|
+
transition: "all .3s",
|
|
75
|
+
"@keyframes dirtyEffect": {
|
|
76
|
+
"20%": {
|
|
77
|
+
opacity: 1
|
|
78
|
+
},
|
|
79
|
+
"50%": {
|
|
80
|
+
opacity: 0.5
|
|
81
|
+
},
|
|
82
|
+
"100%": {
|
|
83
|
+
opacity: 1
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"&.isDirtyError": {}
|
|
88
|
+
}));
|
|
89
|
+
function FilterButton() {
|
|
90
|
+
const {
|
|
91
|
+
isSkeleton,
|
|
92
|
+
fireOnChangeFilters,
|
|
93
|
+
automatic,
|
|
94
|
+
isDirty,
|
|
95
|
+
isValid
|
|
96
|
+
} = useBase();
|
|
97
|
+
const {
|
|
98
|
+
host_static_assets,
|
|
99
|
+
environment_assets
|
|
100
|
+
} = useEnvironment();
|
|
101
|
+
if (isSkeleton) {
|
|
102
|
+
return /* @__PURE__ */ jsx(SKTWrapperFilterButton, {
|
|
103
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
104
|
+
variant: "circular",
|
|
105
|
+
width: 20,
|
|
106
|
+
height: 20
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
const color = useMemo(() => {
|
|
111
|
+
if (automatic || !isDirty) {
|
|
112
|
+
return "action.active";
|
|
113
|
+
}
|
|
114
|
+
if (!isValid) {
|
|
115
|
+
return "error.main";
|
|
116
|
+
}
|
|
117
|
+
return "primary.main";
|
|
118
|
+
}, [automatic, isValid, isDirty]);
|
|
119
|
+
return /* @__PURE__ */ jsx(WrapperFilterButton, {
|
|
120
|
+
id: "WrapperFilterButton",
|
|
121
|
+
className: isDirty && isValid ? "isDirty" : "",
|
|
122
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
123
|
+
bgColor: color,
|
|
124
|
+
dictionaryTooltip: "dynamic_filter.filter_tooltip",
|
|
125
|
+
onClick: () => fireOnChangeFilters(),
|
|
126
|
+
"aria-label": "settings",
|
|
127
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/${automatic ? "refresh" : "search"}.svg`
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
export { Button as B, FilterButton as F, LoadingButton as L };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { m } from "framer-motion";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { IconButton as IconButton$1, Box, Skeleton, Tooltip } from "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
6
|
+
import { I as Icon } from "../../Icon/index.js";
|
|
7
|
+
const varSmall = {
|
|
8
|
+
hover: {
|
|
9
|
+
scale: 1.1
|
|
10
|
+
},
|
|
11
|
+
tap: {
|
|
12
|
+
scale: 0.95
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const varMedium = {
|
|
16
|
+
hover: {
|
|
17
|
+
scale: 1.09
|
|
18
|
+
},
|
|
19
|
+
tap: {
|
|
20
|
+
scale: 0.97
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const varLarge = {
|
|
24
|
+
hover: {
|
|
25
|
+
scale: 1.08
|
|
26
|
+
},
|
|
27
|
+
tap: {
|
|
28
|
+
scale: 0.99
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
function AnimateWrap({
|
|
32
|
+
size,
|
|
33
|
+
children
|
|
34
|
+
}) {
|
|
35
|
+
const isSmall = size === "small";
|
|
36
|
+
const isLarge = size === "large";
|
|
37
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
38
|
+
component: m.div,
|
|
39
|
+
whileTap: "tap",
|
|
40
|
+
whileHover: "hover",
|
|
41
|
+
variants: isSmall && varSmall || isLarge && varLarge || varMedium,
|
|
42
|
+
sx: {
|
|
43
|
+
display: "inline-flex"
|
|
44
|
+
},
|
|
45
|
+
children
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const IconButtonAnimate = forwardRef(({
|
|
49
|
+
children,
|
|
50
|
+
size = "medium",
|
|
51
|
+
...other
|
|
52
|
+
}, ref) => /* @__PURE__ */ jsx(AnimateWrap, {
|
|
53
|
+
size,
|
|
54
|
+
children: /* @__PURE__ */ jsx(IconButton$1, {
|
|
55
|
+
size,
|
|
56
|
+
ref,
|
|
57
|
+
...other,
|
|
58
|
+
children
|
|
59
|
+
})
|
|
60
|
+
}));
|
|
61
|
+
IconButtonAnimate.displayName = "IconButtonAnimate";
|
|
62
|
+
function IconButton({
|
|
63
|
+
src,
|
|
64
|
+
tooltip,
|
|
65
|
+
size = "small",
|
|
66
|
+
dictionaryTooltip,
|
|
67
|
+
bgColor = "primary.active",
|
|
68
|
+
...other
|
|
69
|
+
}) {
|
|
70
|
+
const {
|
|
71
|
+
getLabel
|
|
72
|
+
} = useModuleDictionary();
|
|
73
|
+
const isSkeleton = useModuleSkeleton();
|
|
74
|
+
const finalTooltip = useMemo(() => {
|
|
75
|
+
if (dictionaryTooltip && getLabel) {
|
|
76
|
+
return getLabel(dictionaryTooltip);
|
|
77
|
+
}
|
|
78
|
+
return tooltip;
|
|
79
|
+
}, [dictionaryTooltip, getLabel]);
|
|
80
|
+
if (isSkeleton) {
|
|
81
|
+
return /* @__PURE__ */ jsx(Skeleton, {
|
|
82
|
+
variant: "circular",
|
|
83
|
+
width: "30px",
|
|
84
|
+
height: "30px"
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return finalTooltip ? /* @__PURE__ */ jsx(Tooltip, {
|
|
88
|
+
title: finalTooltip || "",
|
|
89
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
90
|
+
children: /* @__PURE__ */ jsx(IconButton$1, {
|
|
91
|
+
size,
|
|
92
|
+
...other,
|
|
93
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
94
|
+
src,
|
|
95
|
+
bgColor: other.disabled ? "action.disabled" : bgColor
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
}) : /* @__PURE__ */ jsx(IconButton$1, {
|
|
100
|
+
size,
|
|
101
|
+
...other,
|
|
102
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
103
|
+
src,
|
|
104
|
+
bgColor: other.disabled ? "action.disabled" : bgColor
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export { IconButton as I, IconButtonAnimate as a };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Link as Link$1 } from "react-router-dom";
|
|
2
|
+
import { Skeleton, Link } from "@mui/material";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
const LinkWithRoute = (props) => {
|
|
5
|
+
const {
|
|
6
|
+
to,
|
|
7
|
+
children,
|
|
8
|
+
skeletonProps = {},
|
|
9
|
+
...other
|
|
10
|
+
} = props;
|
|
11
|
+
const {
|
|
12
|
+
isSkeleton = false,
|
|
13
|
+
width = "100%",
|
|
14
|
+
height = "14px"
|
|
15
|
+
} = skeletonProps;
|
|
16
|
+
if (isSkeleton) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Skeleton, {
|
|
18
|
+
variant: "text",
|
|
19
|
+
width,
|
|
20
|
+
height
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
24
|
+
component: Link$1,
|
|
25
|
+
to,
|
|
26
|
+
...other,
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export { LinkWithRoute as L };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { Popover } from "@mui/material";
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
const ArrowStyle = styled("span")(({
|
|
5
|
+
arrow,
|
|
6
|
+
theme
|
|
7
|
+
}) => {
|
|
8
|
+
const SIZE = 12;
|
|
9
|
+
const POSITION = -(SIZE / 2);
|
|
10
|
+
const borderStyle = `solid 1px ${theme.palette.grey[50012]}`;
|
|
11
|
+
const topStyle = {
|
|
12
|
+
borderRadius: "0 0 3px 0",
|
|
13
|
+
top: POSITION,
|
|
14
|
+
borderBottom: borderStyle,
|
|
15
|
+
borderRight: borderStyle
|
|
16
|
+
};
|
|
17
|
+
const bottomStyle = {
|
|
18
|
+
borderRadius: "3px 0 0 0",
|
|
19
|
+
bottom: POSITION,
|
|
20
|
+
borderTop: borderStyle,
|
|
21
|
+
borderLeft: borderStyle
|
|
22
|
+
};
|
|
23
|
+
const leftStyle = {
|
|
24
|
+
borderRadius: "0 3px 0 0",
|
|
25
|
+
left: POSITION,
|
|
26
|
+
borderTop: borderStyle,
|
|
27
|
+
borderRight: borderStyle
|
|
28
|
+
};
|
|
29
|
+
const rightStyle = {
|
|
30
|
+
borderRadius: "0 0 0 3px",
|
|
31
|
+
right: POSITION,
|
|
32
|
+
borderBottom: borderStyle,
|
|
33
|
+
borderLeft: borderStyle
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
display: "none",
|
|
37
|
+
[theme.breakpoints.up("sm")]: {
|
|
38
|
+
zIndex: 1,
|
|
39
|
+
width: SIZE,
|
|
40
|
+
height: SIZE,
|
|
41
|
+
content: "''",
|
|
42
|
+
position: "absolute",
|
|
43
|
+
display: "block",
|
|
44
|
+
transform: "rotate(-135deg)",
|
|
45
|
+
background: theme.palette.background.paper
|
|
46
|
+
},
|
|
47
|
+
...arrow === "top-left" && {
|
|
48
|
+
...topStyle,
|
|
49
|
+
left: 20
|
|
50
|
+
},
|
|
51
|
+
...arrow === "top-center" && {
|
|
52
|
+
...topStyle,
|
|
53
|
+
left: 0,
|
|
54
|
+
right: 0,
|
|
55
|
+
margin: "auto"
|
|
56
|
+
},
|
|
57
|
+
...arrow === "top-right" && {
|
|
58
|
+
...topStyle,
|
|
59
|
+
right: 20
|
|
60
|
+
},
|
|
61
|
+
...arrow === "bottom-left" && {
|
|
62
|
+
...bottomStyle,
|
|
63
|
+
left: 20
|
|
64
|
+
},
|
|
65
|
+
...arrow === "bottom-center" && {
|
|
66
|
+
...bottomStyle,
|
|
67
|
+
left: 0,
|
|
68
|
+
right: 0,
|
|
69
|
+
margin: "auto"
|
|
70
|
+
},
|
|
71
|
+
...arrow === "bottom-right" && {
|
|
72
|
+
...bottomStyle,
|
|
73
|
+
right: 20
|
|
74
|
+
},
|
|
75
|
+
...arrow === "left-top" && {
|
|
76
|
+
...leftStyle,
|
|
77
|
+
top: 20
|
|
78
|
+
},
|
|
79
|
+
...arrow === "left-center" && {
|
|
80
|
+
...leftStyle,
|
|
81
|
+
top: 0,
|
|
82
|
+
bottom: 0,
|
|
83
|
+
margin: "auto"
|
|
84
|
+
},
|
|
85
|
+
...arrow === "left-bottom" && {
|
|
86
|
+
...leftStyle,
|
|
87
|
+
bottom: 20
|
|
88
|
+
},
|
|
89
|
+
...arrow === "right-top" && {
|
|
90
|
+
...rightStyle,
|
|
91
|
+
top: 20
|
|
92
|
+
},
|
|
93
|
+
...arrow === "right-center" && {
|
|
94
|
+
...rightStyle,
|
|
95
|
+
top: 0,
|
|
96
|
+
bottom: 0,
|
|
97
|
+
margin: "auto"
|
|
98
|
+
},
|
|
99
|
+
...arrow === "right-bottom" && {
|
|
100
|
+
...rightStyle,
|
|
101
|
+
bottom: 20
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
function MenuPopover({
|
|
106
|
+
children,
|
|
107
|
+
arrow = "top-right",
|
|
108
|
+
disabledArrow,
|
|
109
|
+
sx,
|
|
110
|
+
...other
|
|
111
|
+
}) {
|
|
112
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
113
|
+
anchorOrigin: {
|
|
114
|
+
vertical: "bottom",
|
|
115
|
+
horizontal: "right"
|
|
116
|
+
},
|
|
117
|
+
transformOrigin: {
|
|
118
|
+
vertical: "top",
|
|
119
|
+
horizontal: "right"
|
|
120
|
+
},
|
|
121
|
+
PaperProps: {
|
|
122
|
+
sx: {
|
|
123
|
+
p: 1,
|
|
124
|
+
width: 200,
|
|
125
|
+
overflow: "inherit",
|
|
126
|
+
...sx
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
...other,
|
|
130
|
+
children: [!disabledArrow && /* @__PURE__ */ jsx(ArrowStyle, {
|
|
131
|
+
arrow
|
|
132
|
+
}), children]
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
export { MenuPopover as M };
|