@m4l/components 0.1.11 → 0.1.13

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 (144) hide show
  1. package/assets/Logo/index.228dcb5a.js +86 -0
  2. package/commonjs.565e6834.js +12 -0
  3. package/components/CommonActions/components/ActionCancel/index.cba1b460.js +17 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +49 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +31 -0
  6. package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +18 -0
  7. package/components/CommonActions/components/Actions/index.e8148d98.js +743 -0
  8. package/components/CompanyLogo/{index.js → index.f81c179c.js} +42 -48
  9. package/components/DataGrid/index.b688877d.js +894 -0
  10. package/components/DataGrid/types.d.ts +1 -1
  11. package/components/DynamicFilter/index.82ce857e.js +1158 -0
  12. package/components/ErrorLabel/index.c8615f16.js +19 -0
  13. package/components/Icon/index.cbca79b0.js +70 -0
  14. package/components/Image/index.e790b50b.js +122 -0
  15. package/components/LanguagePopover/index.3d9611cb.js +87 -0
  16. package/components/Loadable/index.f5518558.js +15 -0
  17. package/components/ModalDialog/index.3850c053.js +168 -0
  18. package/components/NoItemSelected/{index.js → index.12f0ca67.js} +43 -50
  19. package/components/ObjectLogs/index.27ef875d.js +266 -0
  20. package/components/Page/index.6d69977e.js +35 -0
  21. package/components/Page/index.d.ts +1 -1
  22. package/components/PaperForm/index.d7c74064.js +105 -0
  23. package/components/Period/index.5e68286a.js +160 -0
  24. package/components/PropertyValue/index.ab3dd7e9.js +116 -0
  25. package/components/Resizeable/{index.js → index.45995d2b.js} +21 -19
  26. package/components/ScrollBar/index.39eeb2de.js +49 -0
  27. package/components/ScrollToTop/index.e06f98f6.js +11 -0
  28. package/components/SplitLayout/{index.js → index.4032673d.js} +35 -35
  29. package/components/animate/IconButtonAnimate/index.d.ts +1 -1
  30. package/components/animate/LoadingScreen/{index.js → index.f1cec7db.js} +29 -27
  31. package/components/animate/MotionContainer/index.8d9f9d80.js +30 -0
  32. package/components/animate/MotionLazyContainer/index.572dd012.js +15 -0
  33. package/components/animate/features.0fbf41e1.js +5 -0
  34. package/components/animate/variants/{bounce.js → bounce.784aaaaa.js} +15 -16
  35. package/components/animate/variants/container.11f82b76.js +20 -0
  36. package/components/animate/variants/fade.b561c0fc.js +59 -0
  37. package/components/animate/variants/{index.js → index.7a912140.js} +0 -0
  38. package/components/animate/variants/transition.bd46b9ce.js +15 -0
  39. package/components/formatters/BooleanFormatter/index.cca53b7f.js +42 -0
  40. package/components/formatters/DateFormatter/index.ad8d9b8e.js +57 -0
  41. package/components/formatters/index.55856d65.js +106 -0
  42. package/components/hook-form/FormProvider/index.257acd9f.js +55 -0
  43. package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +122 -0
  44. package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +153 -0
  45. package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +59 -0
  46. package/components/hook-form/RHFDateTime/index.fc5cbafe.js +68 -0
  47. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +34 -0
  48. package/components/hook-form/RHFPeriod/index.23c254e9.js +45 -0
  49. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +43 -0
  50. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +36 -0
  51. package/components/hook-form/RHFTextField/index.4c455f75.js +77 -0
  52. package/components/hook-form/RHFTextField/index.d.ts +1 -1
  53. package/components/hook-form/RHFUpload/index.ed3d739f.js +244 -0
  54. package/components/mui_extended/Accordion/index.2116e423.js +103 -0
  55. package/components/mui_extended/Avatar/index.0a2a4523.js +32 -0
  56. package/components/mui_extended/Avatar/index.d.ts +1 -1
  57. package/components/mui_extended/BoxIcon/index.e638ecc8.js +22 -0
  58. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +89 -0
  59. package/components/mui_extended/Button/index.84d8898c.js +110 -0
  60. package/components/mui_extended/IconButton/index.88f3aadb.js +98 -0
  61. package/components/mui_extended/LinkWithRoute/index.d4b263de.js +28 -0
  62. package/components/mui_extended/MenuPopover/index.488fc536.js +131 -0
  63. package/components/mui_extended/Pager/index.0576814f.js +126 -0
  64. package/components/mui_extended/Tab/index.e0653a0a.js +28 -0
  65. package/components/mui_extended/Typography/index.0c4604b3.js +22 -0
  66. package/contexts/ModalContext/index.2188b69e.js +150 -0
  67. package/hooks/useFormAddEdit/index.d4845f1a.js +26 -0
  68. package/hooks/useModal/index.6571d2d9.js +6 -0
  69. package/index.js +162 -70
  70. package/lodash.e09401f0.js +32 -0
  71. package/node_modules.168cb897.js +55 -0
  72. package/package.json +1 -1
  73. package/react-data-grid.d46d625e.js +2115 -0
  74. package/react-draggable.20e95c61.js +714 -0
  75. package/react-json-view.f56a7f8e.js +2762 -0
  76. package/react-lazy-load-image-component.45b56650.js +784 -0
  77. package/react-resizable.5277deaf.js +371 -0
  78. package/react-splitter-layout.7810ac1b.js +165 -0
  79. package/utils/index.214d9542.js +435 -0
  80. package/assets/Logo/index.js +0 -91
  81. package/commonjs.js +0 -9
  82. package/components/CommonActions/components/ActionCancel/index.js +0 -15
  83. package/components/CommonActions/components/ActionFormCancel/index.js +0 -62
  84. package/components/CommonActions/components/ActionFormIntro/index.js +0 -35
  85. package/components/CommonActions/components/ActionIntro/index.js +0 -16
  86. package/components/CommonActions/components/Actions/index.js +0 -859
  87. package/components/DataGrid/index.js +0 -1067
  88. package/components/DynamicFilter/index.js +0 -1573
  89. package/components/ErrorLabel/index.js +0 -18
  90. package/components/Icon/index.js +0 -80
  91. package/components/Image/index.js +0 -128
  92. package/components/LanguagePopover/index.js +0 -93
  93. package/components/Loadable/index.js +0 -13
  94. package/components/ModalDialog/index.js +0 -180
  95. package/components/ObjectLogs/index.js +0 -284
  96. package/components/Page/index.js +0 -36
  97. package/components/PaperForm/index.js +0 -110
  98. package/components/Period/index.js +0 -230
  99. package/components/PropertyValue/index.js +0 -142
  100. package/components/ScrollBar/index.js +0 -52
  101. package/components/ScrollToTop/index.js +0 -10
  102. package/components/animate/MotionContainer/index.js +0 -31
  103. package/components/animate/MotionLazyContainer/index.js +0 -13
  104. package/components/animate/features.js +0 -2
  105. package/components/animate/variants/container.js +0 -20
  106. package/components/animate/variants/fade.js +0 -61
  107. package/components/animate/variants/transition.js +0 -16
  108. package/components/formatters/BooleanFormatter/index.js +0 -52
  109. package/components/formatters/DateFormatter/index.js +0 -66
  110. package/components/formatters/index.js +0 -112
  111. package/components/hook-form/FormProvider/index.js +0 -61
  112. package/components/hook-form/RHFAutocomplete/index.js +0 -144
  113. package/components/hook-form/RHFAutocompleteAsync/index.js +0 -191
  114. package/components/hook-form/RHFCheckbox/index.js +0 -65
  115. package/components/hook-form/RHFDateTime/index.js +0 -79
  116. package/components/hook-form/RHFMultiCheckbox/index.js +0 -32
  117. package/components/hook-form/RHFPeriod/index.js +0 -47
  118. package/components/hook-form/RHFRadioGroup/index.js +0 -41
  119. package/components/hook-form/RHFSelect/index.js +0 -34
  120. package/components/hook-form/RHFTextField/index.js +0 -87
  121. package/components/hook-form/RHFUpload/index.js +0 -255
  122. package/components/mui_extended/Accordion/index.js +0 -105
  123. package/components/mui_extended/Avatar/index.js +0 -33
  124. package/components/mui_extended/BoxIcon/index.js +0 -20
  125. package/components/mui_extended/Breadcrumbs/index.js +0 -92
  126. package/components/mui_extended/Button/index.js +0 -131
  127. package/components/mui_extended/IconButton/index.js +0 -108
  128. package/components/mui_extended/LinkWithRoute/index.js +0 -30
  129. package/components/mui_extended/MenuPopover/index.js +0 -135
  130. package/components/mui_extended/Pager/index.js +0 -137
  131. package/components/mui_extended/Tab/index.js +0 -30
  132. package/components/mui_extended/Typography/index.js +0 -21
  133. package/contexts/ModalContext/index.js +0 -165
  134. package/hooks/useFormAddEdit/index.js +0 -42
  135. package/hooks/useModal/index.js +0 -4
  136. package/lodash.js +0 -62
  137. package/node_modules.js +0 -54
  138. package/react-data-grid.js +0 -2652
  139. package/react-draggable.js +0 -960
  140. package/react-json-view.js +0 -2764
  141. package/react-lazy-load-image-component.js +0 -792
  142. package/react-resizable.js +0 -541
  143. package/react-splitter-layout.js +0 -165
  144. package/utils/index.js +0 -572
@@ -1,87 +0,0 @@
1
- import { useFormContext, Controller } from "react-hook-form";
2
- import { Skeleton, TextField } from "@mui/material";
3
- import { styled } from "@mui/material/styles";
4
- import { forwardRef } from "react";
5
- import { useModuleSkeleton } from "@m4l/core";
6
- import { jsx } from "react/jsx-runtime";
7
- const SKTRHFWrapperTextField = styled("div")(({
8
- theme
9
- }) => ({
10
- display: "flex",
11
- width: "100%",
12
- alignItems: "center",
13
- border: `1px solid ${theme.palette.divider}`,
14
- padding: "12px 14px",
15
- borderRadius: theme.spacing(1)
16
- }));
17
- const RHFTextField = forwardRef((props, inputRef) => {
18
- const {
19
- name: nameRHF,
20
- autoComplete = "off",
21
- skeletonProps: skeletoProps = {},
22
- type,
23
- ...other
24
- } = props;
25
- const {
26
- width = "100%",
27
- height = 14
28
- } = skeletoProps;
29
- const isSkeleton = useModuleSkeleton();
30
- const {
31
- control
32
- } = useFormContext();
33
- if (isSkeleton) {
34
- return /* @__PURE__ */ jsx(SKTRHFWrapperTextField, {
35
- children: /* @__PURE__ */ jsx(Skeleton, {
36
- variant: "text",
37
- width,
38
- height
39
- })
40
- });
41
- }
42
- return /* @__PURE__ */ jsx(Controller, {
43
- name: nameRHF,
44
- control,
45
- render: ({
46
- field: {
47
- onChange,
48
- onBlur,
49
- value,
50
- name,
51
- ref
52
- },
53
- fieldState: {
54
- error
55
- }
56
- }) => {
57
- const onInternalChange = (event) => {
58
- if (type === "number") {
59
- if (event.target.value) {
60
- onChange(Number(event.target.value));
61
- return;
62
- }
63
- }
64
- onChange(event);
65
- };
66
- return /* @__PURE__ */ jsx(
67
- TextField,
68
- {
69
- inputRef,
70
- autoComplete,
71
- onChange: onInternalChange,
72
- onBlur,
73
- value,
74
- name,
75
- ref,
76
- fullWidth: true,
77
- error: !!error,
78
- helperText: error?.message,
79
- type,
80
- ...other
81
- }
82
- );
83
- }
84
- });
85
- });
86
- RHFTextField.displayName = "RHFTextField";
87
- export { RHFTextField as R };
@@ -1,255 +0,0 @@
1
- import { styled as styled$1, FormHelperText } from "@mui/material";
2
- import { useCallback } from "react";
3
- import { useFormContext, Controller } from "react-hook-form";
4
- import { i as isString_1 } from "../../../lodash.js";
5
- import { useDropzone } from "react-dropzone";
6
- import { styled, alpha } from "@mui/material/styles";
7
- import { I as Image } from "../../Image/index.js";
8
- import { useEnvironment, useModuleDictionary } from "@m4l/core";
9
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
10
- import "../../../react-lazy-load-image-component.js";
11
- const RootStyle = styled("div")(({
12
- theme
13
- }) => ({
14
- width: "inherit",
15
- height: "100%",
16
- minWidth: theme.spacing(20),
17
- margin: "auto",
18
- borderRadius: theme.spacing(1),
19
- padding: theme.spacing(1),
20
- border: `1px dashed ${theme.palette.grey[50032]}`
21
- }));
22
- const DropZoneStyle = styled("div")(({
23
- theme
24
- }) => ({
25
- zIndex: 0,
26
- width: "100%",
27
- height: "100%",
28
- outline: "none",
29
- display: "flex",
30
- overflow: "hidden",
31
- borderRadius: theme.spacing(1),
32
- position: "relative",
33
- alignItems: "center",
34
- justifyContent: "center",
35
- "& > *": {
36
- width: "100%",
37
- height: "100%"
38
- },
39
- "&:hover": {
40
- cursor: "pointer",
41
- "& .placeholder": {
42
- zIndex: 9
43
- }
44
- }
45
- }));
46
- const PlaceholderStyle = styled("div")(({
47
- theme
48
- }) => ({
49
- "&:hover": {
50
- opacity: 1
51
- },
52
- display: "flex",
53
- justifyContent: "center",
54
- position: "absolute",
55
- zIndex: "2",
56
- inset: "0",
57
- transition: theme.transitions.create("opacity", {
58
- easing: theme.transitions.easing.easeInOut,
59
- duration: theme.transitions.duration.shorter
60
- }),
61
- overflow: "auto"
62
- }));
63
- const ContainerUploadBody = styled("div")(({
64
- theme
65
- }) => ({
66
- padding: theme.spacing(3, 5),
67
- display: "flex",
68
- flexWrap: "wrap",
69
- justifyContent: "center",
70
- width: "100%",
71
- height: "100%",
72
- gap: theme.spacing(3)
73
- }));
74
- const Containermessage = styled("div")(({
75
- theme
76
- }) => ({
77
- display: "flex",
78
- justifyContent: "center",
79
- flexDirection: "column",
80
- gap: theme.spacing(3)
81
- }));
82
- const ContainerTitle = styled("span")(({
83
- theme
84
- }) => ({
85
- ...theme.typography.subtitle2,
86
- width: "fit-content"
87
- }));
88
- const ContainerDescription = styled("span")(({
89
- theme
90
- }) => ({
91
- ...theme.typography.body2,
92
- minWidth: theme.spacing(20)
93
- }));
94
- const ContainerConditions = styled("span")(({
95
- theme
96
- }) => ({
97
- ...theme.typography.caption,
98
- width: "fit-content"
99
- }));
100
- const WrapperImage = styled("div")(({
101
- theme
102
- }) => ({
103
- display: "flex",
104
- alignItems: "center",
105
- maxWidth: theme.spacing(20)
106
- }));
107
- styled("div")(() => ({
108
- width: "100%",
109
- height: "100%",
110
- position: "absolute",
111
- inset: "0",
112
- display: "flex",
113
- justifyContent: "center",
114
- alignItems: "center"
115
- }));
116
- function UploadImage({
117
- error,
118
- file,
119
- helperText,
120
- sx,
121
- ...other
122
- }) {
123
- const {
124
- getRootProps,
125
- getInputProps,
126
- isDragActive,
127
- isDragReject
128
- } = useDropzone({
129
- multiple: false,
130
- ...other
131
- });
132
- const {
133
- host_static_assets,
134
- environment_assets
135
- } = useEnvironment();
136
- const {
137
- getLabel
138
- } = useModuleDictionary();
139
- return /* @__PURE__ */ jsxs(Fragment, {
140
- children: [/* @__PURE__ */ jsx(RootStyle, {
141
- id: "RootStyle",
142
- sx: {
143
- ...(isDragReject || error) && {
144
- borderColor: "error.light"
145
- },
146
- ...sx
147
- },
148
- children: /* @__PURE__ */ jsxs(DropZoneStyle, {
149
- id: "DropZoneStyle",
150
- ...getRootProps(),
151
- sx: {
152
- ...isDragActive && {
153
- opacity: 0.72
154
- }
155
- },
156
- children: [/* @__PURE__ */ jsx("input", {
157
- ...getInputProps()
158
- }), file && /* @__PURE__ */ jsx(Image, {
159
- alt: "avatar",
160
- src: isString_1(file) ? file : file.preview,
161
- sx: {
162
- zIndex: 8
163
- }
164
- }), /* @__PURE__ */ jsx(PlaceholderStyle, {
165
- id: "PlaceholderStyle",
166
- className: "placeholder",
167
- sx: {
168
- ...file ? {
169
- bgcolor: alpha("#161C24", 0.72),
170
- color: "common.white",
171
- opacity: 0
172
- } : {
173
- opacity: 1
174
- },
175
- ...(isDragReject || error) && {
176
- bgcolor: "error.lighter",
177
- borderColor: "error.light",
178
- color: "error.main"
179
- }
180
- },
181
- children: /* @__PURE__ */ jsxs(ContainerUploadBody, {
182
- className: "ContainerUploadBody",
183
- children: [/* @__PURE__ */ jsx(WrapperImage, {
184
- children: /* @__PURE__ */ jsx(Image, {
185
- src: `${host_static_assets}/${environment_assets}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
186
- effect: "opacity",
187
- width: "100%",
188
- height: "auto",
189
- mb: 1
190
- })
191
- }), /* @__PURE__ */ jsxs(Containermessage, {
192
- children: [/* @__PURE__ */ jsx(ContainerTitle, {
193
- children: file ? getLabel("upload_image.title_update") : getLabel("upload_image.title_upload")
194
- }), /* @__PURE__ */ jsx(ContainerDescription, {
195
- children: getLabel("upload_image.description")
196
- }), /* @__PURE__ */ jsx(ContainerConditions, {
197
- children: getLabel("upload_image.conditions")
198
- })]
199
- })]
200
- })
201
- })]
202
- })
203
- }), helperText && helperText]
204
- });
205
- }
206
- const WrapperRHFUploadImage = styled$1("div")(() => ({
207
- width: "inherit",
208
- height: "inherit",
209
- padding: "1px"
210
- }));
211
- function RHFUploadImage({
212
- name,
213
- ...other
214
- }) {
215
- const {
216
- control,
217
- setValue
218
- } = useFormContext();
219
- const handleDrop = useCallback((acceptedFiles) => {
220
- const file = acceptedFiles[0];
221
- if (file) {
222
- setValue(name, Object.assign(file, {
223
- preview: URL.createObjectURL(file)
224
- }));
225
- }
226
- }, [setValue]);
227
- return /* @__PURE__ */ jsx(Controller, {
228
- name,
229
- control,
230
- render: ({
231
- field,
232
- fieldState: {
233
- error
234
- }
235
- }) => {
236
- const checkError = !!error && !field.value;
237
- return /* @__PURE__ */ jsxs(WrapperRHFUploadImage, {
238
- children: [/* @__PURE__ */ jsx(UploadImage, {
239
- onDrop: handleDrop,
240
- error: checkError,
241
- ...other,
242
- file: field.value
243
- }), checkError && /* @__PURE__ */ jsx(FormHelperText, {
244
- error: true,
245
- sx: {
246
- px: 2,
247
- textAlign: "center"
248
- },
249
- children: error.message
250
- })]
251
- });
252
- }
253
- });
254
- }
255
- export { RHFUploadImage as R };
@@ -1,105 +0,0 @@
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 };
@@ -1,33 +0,0 @@
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 };
@@ -1,20 +0,0 @@
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 };
@@ -1,92 +0,0 @@
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 };