@m4l/components 0.1.4 → 0.1.5

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 (44) hide show
  1. package/assets/Logo/index.js +91 -0
  2. package/assets/Logo.d.ts +7 -0
  3. package/components/CommonActions/components/ActionCancel/index.js +1 -1
  4. package/components/CommonActions/components/ActionFormCancel/index.js +1 -1
  5. package/components/CommonActions/components/ActionIntro/index.js +1 -1
  6. package/components/CommonActions/components/Actions/index.js +1 -1
  7. package/components/DynamicFilter/index.js +6 -78
  8. package/components/Icon/index.js +1 -1
  9. package/components/LanguagePopover/index.js +2 -1
  10. package/components/ModalDialog/index.js +1 -1
  11. package/components/Page/index.d.ts +1 -1
  12. package/components/ScrollToTop/index.d.ts +1 -0
  13. package/components/ScrollToTop/index.js +10 -0
  14. package/components/animate/IconButtonAnimate/index.d.ts +1 -1
  15. package/components/animate/LoadingScreen/index.d.ts +8 -0
  16. package/components/animate/LoadingScreen/index.js +91 -0
  17. package/components/animate/index.d.ts +1 -0
  18. package/components/animate/variants/bounce.d.ts +9 -9
  19. package/components/animate/variants/fade.d.ts +20 -20
  20. package/components/animate/variants/transition.d.ts +3 -3
  21. package/components/hook-form/RHFAutocomplete/index.js +142 -0
  22. package/components/hook-form/{RHFDateTime.js → RHFDateTime/index.js} +0 -0
  23. package/components/hook-form/{RHFRadioGroup.js → RHFRadioGroup/index.js} +0 -0
  24. package/components/hook-form/{RHFSelect.js → RHFSelect/index.js} +0 -0
  25. package/components/hook-form/RHFTextField/index.d.ts +1 -1
  26. package/components/hook-form/{RHFUpload.js → RHFUpload/index.js} +3 -3
  27. package/components/index.d.ts +1 -0
  28. package/components/mui_extended/Avatar/index.d.ts +4 -0
  29. package/components/mui_extended/Avatar/index.js +33 -0
  30. package/components/mui_extended/Avatar/types.d.ts +6 -0
  31. package/components/mui_extended/Button/index.js +131 -0
  32. package/components/mui_extended/Button/styles.d.ts +1 -1
  33. package/components/mui_extended/MenuActions/styles.d.ts +3 -3
  34. package/components/mui_extended/index.d.ts +2 -0
  35. package/contexts/ModalContext/index.js +1 -1
  36. package/index.d.ts +1 -0
  37. package/index.js +59 -54
  38. package/juggle.js +5 -191
  39. package/package.json +1 -1
  40. package/react-draggable.js +14 -489
  41. package/react-resizable.js +1 -54
  42. package/utils/index.js +761 -0
  43. package/components/mui_extended/LoadingButton/index.js +0 -35
  44. package/vendor.js +0 -268
@@ -1,35 +0,0 @@
1
- import { LoadingButton as LoadingButton$1 } from "@mui/lab";
2
- import { Skeleton } from "@mui/material";
3
- import { styled } from "@mui/material/styles";
4
- import { jsx } from "react/jsx-runtime";
5
- const WrapperSKTLoadingButton = styled("div")(({
6
- theme
7
- }) => ({
8
- display: "flex",
9
- width: "100%",
10
- borderRadius: theme.spacing(1),
11
- overflow: "hidden"
12
- }));
13
- const SKTLoadingButton = () => /* @__PURE__ */ jsx(WrapperSKTLoadingButton, {
14
- id: "WrapperSKTLoadingButton",
15
- children: /* @__PURE__ */ jsx(Skeleton, {
16
- variant: "rectangular",
17
- width: "100%",
18
- height: "48px"
19
- })
20
- });
21
- const LoadingButton = (props) => {
22
- const {
23
- isSkeleton,
24
- children,
25
- ...other
26
- } = props;
27
- if (isSkeleton) {
28
- return /* @__PURE__ */ jsx(SKTLoadingButton, {});
29
- }
30
- return /* @__PURE__ */ jsx(LoadingButton$1, {
31
- ...other,
32
- children
33
- });
34
- };
35
- export { LoadingButton as L };
package/vendor.js DELETED
@@ -1,268 +0,0 @@
1
- import "./components/mui_extended/IconButton/index.js";
2
- import "framer-motion";
3
- import { Skeleton, Autocomplete, TextField, styled as styled$1 } from "@mui/material";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import "react";
6
- import { useFormContext, Controller } from "react-hook-form";
7
- import "./components/hook-form/FormProvider/index.js";
8
- import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
9
- import "./components/hook-form/RHFAutocompleteAsync/index.js";
10
- import "./components/hook-form/RHFCheckbox/index.js";
11
- import "./components/hook-form/RHFDateTime.js";
12
- import "@mui/x-date-pickers";
13
- import "./components/hook-form/RHFTextField/index.js";
14
- import "./lodash.js";
15
- import "react-dropzone";
16
- import { styled } from "@mui/material/styles";
17
- import "./react-lazy-load-image-component.js";
18
- import "./components/Image/index.js";
19
- import "./components/hook-form/RHFUpload.js";
20
- import "./components/Icon/index.js";
21
- import "react-router-dom";
22
- import "@mui/lab";
23
- import "./components/mui_extended/LoadingButton/index.js";
24
- import "./components/mui_extended/MenuPopover/index.js";
25
- import "./components/CommonActions/components/Actions/index.js";
26
- import "./components/mui_extended/Pager/index.js";
27
- import "./components/mui_extended/Tab/index.js";
28
- import MuiButton from "@mui/material/Button";
29
- import "@m4l/graphics";
30
- import "./components/CompanyLogo/index.js";
31
- import "./components/DataGrid/index.js";
32
- import "react-dnd";
33
- import "react-dnd-html5-backend";
34
- import "./contexts/ModalContext/index.js";
35
- import "./components/ScrollBar/index.js";
36
- import "./components/DynamicFilter/index.js";
37
- import "./simplebar.js";
38
- import "./react-draggable.js";
39
- import "./components/ModalDialog/index.js";
40
- import "./components/Resizeable/index.js";
41
- import "./components/NoItemSelected/index.js";
42
- import "./components/ObjectLogs/index.js";
43
- import "./react-json-view.js";
44
- import "./components/PaperForm/index.js";
45
- import "./components/Page/index.js";
46
- import "./components/PropertyValue/index.js";
47
- import "./react-splitter-layout.js";
48
- import "./components/SplitLayout/index.js";
49
- import "./components/animate/variants/fade.js";
50
- import "./components/animate/variants/bounce.js";
51
- import "./components/animate/variants/container.js";
52
- import "./components/animate/variants/transition.js";
53
- import "./components/animate/MotionContainer/index.js";
54
- import "./components/animate/MotionLazyContainer/index.js";
55
- import "./components/hook-form/RHFMultiCheckbox/index.js";
56
- import "./components/hook-form/RHFSelect.js";
57
- import "./components/hook-form/RHFRadioGroup.js";
58
- import "./components/mui_extended/Accordion/index.js";
59
- import "./components/mui_extended/BoxIcon/index.js";
60
- import "./components/mui_extended/Breadcrumbs/index.js";
61
- import "./components/mui_extended/LinkWithRoute/index.js";
62
- import "./components/mui_extended/Typography/index.js";
63
- import "./components/formatters/BooleanFormatter/index.js";
64
- import "./components/formatters/DateFormatter/index.js";
65
- import "./components/formatters/index.js";
66
- import "./components/CommonActions/components/ActionCancel/index.js";
67
- import "./components/CommonActions/components/ActionIntro/index.js";
68
- import "./components/CommonActions/components/ActionFormCancel/index.js";
69
- import "./components/CommonActions/components/ActionFormIntro/index.js";
70
- import "./components/LanguagePopover/index.js";
71
- import "./components/Loadable/index.js";
72
- import "./hooks/useModal/index.js";
73
- const SKTRHFAutocompleteWrapper = styled("div")(() => ({
74
- display: "flex",
75
- width: "100%",
76
- flexDirection: "column"
77
- }));
78
- styled("div")(({
79
- theme
80
- }) => ({
81
- display: "flex",
82
- justifyContent: "flex-end",
83
- paddingRight: `${theme.spacing(2)}`,
84
- [theme.breakpoints.down("md")]: {
85
- justifyContent: "flex-start"
86
- }
87
- }));
88
- const SKTInputText = styled("div")(({
89
- theme
90
- }) => ({
91
- width: "100%",
92
- display: "grid",
93
- gridTemplateColumns: "1fr auto",
94
- gridGap: theme.spacing(2),
95
- alignItems: "center",
96
- height: `${theme.spacing(4.5)}`,
97
- border: `1px solid ${theme.palette.divider}`,
98
- borderRadius: `${theme.spacing(1)}`,
99
- padding: `0 ${theme.spacing(2)}`,
100
- [theme.breakpoints.down("md")]: {
101
- width: "100%"
102
- }
103
- }));
104
- styled("div")(() => ({
105
- display: "flex",
106
- width: "100%",
107
- "& .MuiAutocomplete-root": {
108
- width: "100%"
109
- }
110
- }));
111
- function RHFAutocomplete(props) {
112
- const {
113
- name,
114
- getOptionLabel,
115
- isOptionEqualToValue,
116
- label,
117
- skeletonProps = {},
118
- options,
119
- ...other
120
- } = props;
121
- const {
122
- isSkeleton = false,
123
- width = 100,
124
- height = "18px"
125
- } = skeletonProps;
126
- const {
127
- getLabel
128
- } = useModuleDictionary();
129
- const {
130
- control,
131
- getValues
132
- } = useFormContext();
133
- const initialValue = getValues(name);
134
- const getOptionLabelLocal = (option) => {
135
- if (option === void 0 || option === null) {
136
- return "";
137
- }
138
- return getOptionLabel(option);
139
- };
140
- const isOptionEqualToValueLocal = (option, value) => {
141
- if (value === void 0 || value === null || option === null) {
142
- return false;
143
- }
144
- return isOptionEqualToValue(option, value);
145
- };
146
- if (isSkeleton) {
147
- return /* @__PURE__ */ jsx(SKTRHFAutocompleteWrapper, {
148
- children: /* @__PURE__ */ jsxs(SKTInputText, {
149
- children: [/* @__PURE__ */ jsx(Skeleton, {
150
- variant: "text",
151
- width,
152
- height
153
- }, "sk1"), /* @__PURE__ */ jsx(Skeleton, {
154
- variant: "circular",
155
- width: 16,
156
- height: 16
157
- }, "sk2")]
158
- })
159
- });
160
- }
161
- return /* @__PURE__ */ jsx(Controller, {
162
- name,
163
- control,
164
- render: ({
165
- field: {
166
- onChange,
167
- value
168
- },
169
- fieldState: {
170
- error
171
- }
172
- }) => {
173
- return /* @__PURE__ */ jsx(
174
- Autocomplete,
175
- {
176
- options,
177
- getOptionLabel: getOptionLabelLocal,
178
- defaultValue: initialValue,
179
- isOptionEqualToValue: isOptionEqualToValueLocal,
180
- disableClearable: true,
181
- value: value || null,
182
- onChange: (_e, val) => {
183
- onChange(val);
184
- },
185
- loadingText: "",
186
- noOptionsText: getLabel("rhf_autocomplete.component_no_options"),
187
- renderInput: (params) => {
188
- return /* @__PURE__ */ jsx(TextField, {
189
- ...params,
190
- label,
191
- fullWidth: true,
192
- SelectProps: {
193
- native: true
194
- },
195
- InputProps: {
196
- ...params.InputProps
197
- },
198
- autoComplete: "off",
199
- error: !!error,
200
- helperText: error?.message,
201
- ...other
202
- }, `tx_async_${params.id}`);
203
- }
204
- }
205
- );
206
- }
207
- });
208
- }
209
- const getPaletteColor = function(palette, s) {
210
- s = s.replace(/\[(\w+)\]/g, ".$1");
211
- s = s.replace(/^\./, "");
212
- let o = palette;
213
- const a = s.split(".");
214
- console.log();
215
- for (let i = 0, n = a.length; i < n; ++i) {
216
- const k = a[i];
217
- if (k in o) {
218
- o = o[k];
219
- } else {
220
- return palette.action.active;
221
- }
222
- }
223
- return o;
224
- };
225
- const getVariantColor = (variant) => {
226
- switch (variant) {
227
- case "warning":
228
- return "warning";
229
- case "delete":
230
- return "error";
231
- case "info":
232
- return "info";
233
- }
234
- return "primary";
235
- };
236
- const getThemeVariantColor = (theme, variant) => {
237
- switch (variant) {
238
- case "warning":
239
- theme.palette.warning.main;
240
- break;
241
- case "delete":
242
- theme.palette.error.main;
243
- break;
244
- case "info":
245
- theme.palette.info.main;
246
- break;
247
- }
248
- return theme.palette.text.primary;
249
- };
250
- const SKTButton = styled$1(Skeleton)(({
251
- theme
252
- }) => ({
253
- borderRadius: theme.spacing(0.5)
254
- }));
255
- const Button = (props) => {
256
- const isSkeleton = useModuleSkeleton();
257
- if (isSkeleton) {
258
- return /* @__PURE__ */ jsx(SKTButton, {
259
- variant: "rectangular",
260
- width: "100px",
261
- height: "36px"
262
- });
263
- }
264
- return /* @__PURE__ */ jsx(MuiButton, {
265
- ...props
266
- });
267
- };
268
- export { Button as B, RHFAutocomplete as R, getThemeVariantColor as a, getVariantColor as b, getPaletteColor as g };