@m4l/components 0.1.27 → 0.1.28

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 (93) hide show
  1. package/assets/Logo/index.228dcb5a.js +42 -35
  2. package/commonjs.565e6834.js +5 -5
  3. package/components/CommonActions/components/ActionCancel/index.e498eeb2.js +17 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.4ff0ad73.js +64 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +28 -22
  6. package/components/CommonActions/components/ActionIntro/index.60ef7bd7.js +18 -0
  7. package/components/CommonActions/components/Actions/index.0645e30f.js +867 -0
  8. package/components/DataGrid/index.76d8fd25.js +1075 -0
  9. package/components/DynamicFilter/index.342ba5fe.js +1577 -0
  10. package/components/ErrorLabel/index.c8615f16.js +13 -12
  11. package/components/Icon/index.619c31c4.js +65 -53
  12. package/components/Image/index.93d5f37f.js +190 -0
  13. package/components/Loadable/index.f5518558.js +8 -8
  14. package/components/ModalDialog/index.9ea10764.js +184 -0
  15. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  16. package/components/ObjectLogs/index.f941fb79.js +288 -0
  17. package/components/Page/index.4237c241.js +22 -20
  18. package/components/PaperForm/index.ec9cb8c9.js +66 -59
  19. package/components/Period/index.2941fbda.js +249 -0
  20. package/components/PropertyValue/index.dfcfe1ba.js +95 -65
  21. package/components/Resizeable/index.45995d2b.js +19 -19
  22. package/components/ScrollBar/index.39eeb2de.js +26 -21
  23. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  24. package/components/SplitLayout/index.4032673d.js +35 -33
  25. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  26. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  27. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  28. package/components/animate/features.0fbf41e1.js +3 -3
  29. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  30. package/components/animate/variants/container.11f82b76.js +8 -6
  31. package/components/animate/variants/fade.b561c0fc.js +32 -28
  32. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  33. package/components/formatters/BooleanFormatter/index.8da35c9c.js +46 -33
  34. package/components/formatters/DateFormatter/index.1b9baacc.js +49 -37
  35. package/components/formatters/index.689a8086.js +119 -0
  36. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  37. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  38. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  39. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  40. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  41. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  42. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  43. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  44. package/components/hook-form/RHFTextField/index.f9aaaa90.js +110 -93
  45. package/components/hook-form/RHFUpload/{index.ec4d5326.js → index.d5cc7c13.js} +151 -130
  46. package/components/mui_extended/Accordion/index.a02ac6ae.js +73 -69
  47. package/components/mui_extended/Avatar/index.fe06afd7.js +44 -34
  48. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  49. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  50. package/components/mui_extended/Button/index.53b56958.js +178 -0
  51. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  52. package/components/mui_extended/IconButton/index.a321e5cb.js +82 -67
  53. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  54. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  55. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  56. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  57. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  58. package/contexts/ModalContext/index.b92fa565.js +153 -0
  59. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  60. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  61. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  62. package/contexts/RHFormContext/index.b142190a.js +63 -0
  63. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  64. package/hooks/useModal/index.5fee01a3.js +11 -0
  65. package/index.js +153 -153
  66. package/package.json +2 -1
  67. package/react-data-grid.d46d625e.js +2206 -1663
  68. package/react-draggable.20e95c61.js +800 -553
  69. package/react-json-view.f56a7f8e.js +2344 -2340
  70. package/react-resizable.5277deaf.js +470 -298
  71. package/react-splitter-layout.7810ac1b.js +130 -128
  72. package/utils/index.214d9542.js +500 -354
  73. package/components/CommonActions/components/ActionCancel/index.431160ba.js +0 -17
  74. package/components/CommonActions/components/ActionFormCancel/index.6a0f34aa.js +0 -49
  75. package/components/CommonActions/components/ActionIntro/index.85557b90.js +0 -18
  76. package/components/CommonActions/components/Actions/index.edeb05c2.js +0 -742
  77. package/components/DataGrid/index.2ce9da7d.js +0 -894
  78. package/components/DynamicFilter/index.e1d4a948.js +0 -1157
  79. package/components/Image/index.c9da2d5a.js +0 -152
  80. package/components/ModalDialog/index.ad61757f.js +0 -168
  81. package/components/ObjectLogs/index.6ebaec71.js +0 -266
  82. package/components/Period/index.81de7941.js +0 -175
  83. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  84. package/components/formatters/index.c2a9b55d.js +0 -106
  85. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  86. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  87. package/components/hook-form/RHFPeriod/index.e08fb1ab.js +0 -51
  88. package/components/mui_extended/Button/index.51dae0bb.js +0 -144
  89. package/components/mui_extended/Pager/index.1dc45f5e.js +0 -126
  90. package/components/mui_extended/Popover/index.cb2ccc66.js +0 -252
  91. package/contexts/ModalContext/index.9ebc793c.js +0 -136
  92. package/hooks/useModal/index.34f5978e.js +0 -11
  93. package/node_modules.168cb897.js +0 -55
@@ -1,58 +1,68 @@
1
- import { useFormContext as a, Controller as c } from "react-hook-form";
2
- import { styled as m } from "@mui/material/styles";
3
- import { styled as p, Skeleton as d, FormControlLabel as h, Checkbox as x } from "@mui/material";
4
- import { useModuleSkeleton as u } from "@m4l/core";
5
- import { jsx as e, jsxs as f, Fragment as g } from "react/jsx-runtime";
6
- const k = p("div")(() => ({
1
+ import { useFormContext, Controller } from "react-hook-form";
2
+ import { styled as styled$1 } from "@mui/material/styles";
3
+ import { styled, Skeleton, FormControlLabel, Checkbox } from "@mui/material";
4
+ import { useModuleSkeleton } from "@m4l/core";
5
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
6
+ const WrapperSkeletonCheckBox = styled("div")(() => ({
7
7
  display: "flex",
8
8
  justifyContent: "center",
9
9
  alignItems: "center",
10
10
  width: "36px",
11
11
  height: "36px"
12
- })), C = () => /* @__PURE__ */ e(k, {
13
- children: /* @__PURE__ */ e(d, {
14
- variant: "rounded",
15
- width: "18px",
16
- height: "18px"
17
- })
18
- }), y = m("p")(({
19
- theme: t
12
+ }));
13
+ const SkeletonCheckBox = () => {
14
+ return /* @__PURE__ */ jsx(WrapperSkeletonCheckBox, {
15
+ children: /* @__PURE__ */ jsx(Skeleton, {
16
+ variant: "rounded",
17
+ width: "18px",
18
+ height: "18px"
19
+ })
20
+ });
21
+ };
22
+ const ErrorLabel = styled$1("p")(({
23
+ theme
20
24
  }) => ({
21
- ...t.typography.caption,
22
- color: t.palette.error.main,
25
+ ...theme.typography.caption,
26
+ color: theme.palette.error.main,
23
27
  marginRight: 14,
24
28
  marginLeft: 14
25
29
  }));
26
- function L({
27
- name: t,
28
- sizeCheck: n = "small",
29
- ...l
30
+ function RHFCheckbox({
31
+ name,
32
+ sizeCheck = "small",
33
+ ...other
30
34
  }) {
31
35
  const {
32
- control: i
33
- } = a(), s = u();
34
- return /* @__PURE__ */ e(h, {
35
- control: /* @__PURE__ */ e(c, {
36
- name: t,
37
- control: i,
36
+ control
37
+ } = useFormContext();
38
+ const isSkeleton = useModuleSkeleton();
39
+ return /* @__PURE__ */ jsx(FormControlLabel, {
40
+ control: /* @__PURE__ */ jsx(Controller, {
41
+ name,
42
+ control,
38
43
  render: ({
39
- field: o,
44
+ field,
40
45
  fieldState: {
41
- error: r
46
+ error
47
+ }
48
+ }) => {
49
+ if (isSkeleton) {
50
+ return /* @__PURE__ */ jsx(SkeletonCheckBox, {});
42
51
  }
43
- }) => s ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ f(g, {
44
- children: [/* @__PURE__ */ e(x, {
45
- size: n,
46
- ...o,
47
- checked: o.value
48
- }), r?.message && /* @__PURE__ */ e(y, {
49
- children: r?.message + ""
50
- })]
51
- })
52
+ return /* @__PURE__ */ jsxs(Fragment, {
53
+ children: [/* @__PURE__ */ jsx(Checkbox, {
54
+ size: sizeCheck,
55
+ ...field,
56
+ checked: field.value
57
+ }), error?.message && /* @__PURE__ */ jsx(ErrorLabel, {
58
+ children: error?.message + ""
59
+ })]
60
+ });
61
+ }
52
62
  }),
53
- ...l
63
+ ...other
54
64
  });
55
65
  }
56
66
  export {
57
- L as R
67
+ RHFCheckbox as R
58
68
  };
@@ -1,81 +1,94 @@
1
- import { useFormContext as c, Controller as f } from "react-hook-form";
2
- import { Skeleton as s, TextField as x } from "@mui/material";
3
- import { DateTimePicker as g } from "@mui/x-date-pickers";
4
- import { useModuleSkeleton as k, useEnvironment as F } from "@m4l/core";
5
- import { styled as v } from "@mui/material/styles";
6
- import { jsxs as C, jsx as t } from "react/jsx-runtime";
7
- const T = v("div")(({
8
- theme: e
1
+ import { useFormContext, Controller } from "react-hook-form";
2
+ import { Skeleton, TextField } from "@mui/material";
3
+ import { DateTimePicker } from "@mui/x-date-pickers";
4
+ import { useModuleSkeleton, useEnvironment } from "@m4l/core";
5
+ import { styled } from "@mui/material/styles";
6
+ import { jsxs, jsx } from "react/jsx-runtime";
7
+ const SKTRHFWrapperTextField = styled("div")(({
8
+ theme
9
9
  }) => ({
10
10
  display: "flex",
11
11
  width: "100%",
12
12
  height: "42.25px",
13
13
  alignItems: "center",
14
14
  justifyContent: "space-between",
15
- border: `1px solid ${e.palette.divider}`,
15
+ border: `1px solid ${theme.palette.divider}`,
16
16
  padding: "0 14px",
17
- borderRadius: e.spacing(0.5)
18
- })), S = (e) => {
17
+ borderRadius: theme.spacing(0.5)
18
+ }));
19
+ const SkeletonRHFDateTime = (props) => {
19
20
  const {
20
- skeletonWidth: n,
21
- skeletonHeight: r
22
- } = e;
23
- return /* @__PURE__ */ C(T, {
24
- children: [/* @__PURE__ */ t(s, {
21
+ skeletonWidth,
22
+ skeletonHeight
23
+ } = props;
24
+ return /* @__PURE__ */ jsxs(SKTRHFWrapperTextField, {
25
+ children: [/* @__PURE__ */ jsx(Skeleton, {
25
26
  variant: "text",
26
- width: n,
27
- height: r
28
- }), /* @__PURE__ */ t(s, {
27
+ width: skeletonWidth,
28
+ height: skeletonHeight
29
+ }), /* @__PURE__ */ jsx(Skeleton, {
29
30
  variant: "circular",
30
31
  width: "20px",
31
32
  height: "20px"
32
33
  })]
33
34
  });
34
35
  };
35
- function y(e) {
36
+ function RHFDateTime(props) {
37
+ const {
38
+ name,
39
+ autoComplete = "off",
40
+ skeletonWidth = "50%",
41
+ skeletonHeight = 14
42
+ } = props;
43
+ const isSkeleton = useModuleSkeleton();
44
+ const {
45
+ control
46
+ } = useFormContext();
36
47
  const {
37
- name: n,
38
- autoComplete: r = "off",
39
- skeletonWidth: l = "50%",
40
- skeletonHeight: m = 14
41
- } = e, d = k(), {
42
- control: p
43
- } = c(), {
44
48
  dfnsFormat: {
45
- datetime_format: h,
46
- datetime_mask: u
49
+ datetime_format,
50
+ datetime_mask
47
51
  }
48
- } = F();
49
- return d ? /* @__PURE__ */ t(S, {
50
- skeletonWidth: l,
51
- skeletonHeight: m
52
- }) : /* @__PURE__ */ t(f, {
53
- name: n,
54
- control: p,
52
+ } = useEnvironment();
53
+ if (isSkeleton) {
54
+ return /* @__PURE__ */ jsx(SkeletonRHFDateTime, {
55
+ skeletonWidth,
56
+ skeletonHeight
57
+ });
58
+ }
59
+ return /* @__PURE__ */ jsx(Controller, {
60
+ name,
61
+ control,
55
62
  render: ({
56
- field: i,
63
+ field,
57
64
  fieldState: {
58
- error: a
65
+ error
59
66
  }
60
- }) => /* @__PURE__ */ t(g, {
61
- ampm: !1,
62
- inputFormat: h,
63
- mask: u,
64
- label: "",
65
- value: i.value,
66
- onChange: (o) => {
67
- isNaN(o) ? i.onChange(void 0) : i.onChange(o);
68
- },
69
- renderInput: (o) => /* @__PURE__ */ t(x, {
70
- autoComplete: r,
71
- fullWidth: !0,
72
- error: !!a,
73
- helperText: a?.message,
74
- ...o
75
- })
76
- })
67
+ }) => {
68
+ return /* @__PURE__ */ jsx(DateTimePicker, {
69
+ ampm: false,
70
+ inputFormat: datetime_format,
71
+ mask: datetime_mask,
72
+ label: "",
73
+ value: field.value,
74
+ onChange: (value) => {
75
+ if (!isNaN(value)) {
76
+ field.onChange(value);
77
+ } else {
78
+ field.onChange(void 0);
79
+ }
80
+ },
81
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
82
+ autoComplete,
83
+ fullWidth: true,
84
+ error: !!error,
85
+ helperText: error?.message,
86
+ ...params
87
+ })
88
+ });
89
+ }
77
90
  });
78
91
  }
79
92
  export {
80
- y as R
93
+ RHFDateTime as R
81
94
  };
@@ -1,34 +1,34 @@
1
- import { useFormContext as m, Controller as s } from "react-hook-form";
2
- import { FormGroup as C, FormControlLabel as h, Checkbox as x } from "@mui/material";
3
- import { jsx as o } from "react/jsx-runtime";
4
- function k({
5
- name: n,
6
- options: l,
7
- ...c
1
+ import { useFormContext, Controller } from "react-hook-form";
2
+ import { FormGroup, FormControlLabel, Checkbox } from "@mui/material";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function RHFMultiCheckbox({
5
+ name,
6
+ options,
7
+ ...other
8
8
  }) {
9
9
  const {
10
- control: t
11
- } = m();
12
- return /* @__PURE__ */ o(s, {
13
- name: n,
14
- control: t,
10
+ control
11
+ } = useFormContext();
12
+ return /* @__PURE__ */ jsx(Controller, {
13
+ name,
14
+ control,
15
15
  render: ({
16
- field: e
16
+ field
17
17
  }) => {
18
- const u = (r) => e.value.includes(r) ? e.value.filter((a) => a !== r) : [...e.value, r];
19
- return /* @__PURE__ */ o(C, {
20
- children: l.map((r) => /* @__PURE__ */ o(h, {
21
- control: /* @__PURE__ */ o(x, {
22
- checked: e.value.includes(r),
23
- onChange: () => e.onChange(u(r))
18
+ const onSelected = (option) => field.value.includes(option) ? field.value.filter((value) => value !== option) : [...field.value, option];
19
+ return /* @__PURE__ */ jsx(FormGroup, {
20
+ children: options.map((option) => /* @__PURE__ */ jsx(FormControlLabel, {
21
+ control: /* @__PURE__ */ jsx(Checkbox, {
22
+ checked: field.value.includes(option),
23
+ onChange: () => field.onChange(onSelected(option))
24
24
  }),
25
- label: r,
26
- ...c
27
- }, r))
25
+ label: option,
26
+ ...other
27
+ }, option))
28
28
  });
29
29
  }
30
30
  });
31
31
  }
32
32
  export {
33
- k as R
33
+ RHFMultiCheckbox as R
34
34
  };
@@ -0,0 +1,55 @@
1
+ import { styled } from "@mui/material";
2
+ import { useFormContext, Controller } from "react-hook-form";
3
+ import { E as ErrorLabel } from "../../ErrorLabel/index.c8615f16.js";
4
+ import { P as Period } from "../../Period/index.2941fbda.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ const Wrapper = styled("div")(({
7
+ theme
8
+ }) => ({
9
+ width: "100%",
10
+ display: "flex",
11
+ flexDirection: "column",
12
+ justifyContent: "center",
13
+ alignItems: "flex-start",
14
+ gap: theme.spacing(1)
15
+ }));
16
+ const RHFPeriod = (props) => {
17
+ const {
18
+ name,
19
+ readOnly,
20
+ skeletonWidth,
21
+ skeletonHeight
22
+ } = props;
23
+ const {
24
+ control
25
+ } = useFormContext();
26
+ return /* @__PURE__ */ jsx(Controller, {
27
+ name,
28
+ control,
29
+ render: ({
30
+ field: {
31
+ onChange,
32
+ value
33
+ },
34
+ fieldState: {
35
+ error
36
+ }
37
+ }) => {
38
+ return /* @__PURE__ */ jsxs(Wrapper, {
39
+ children: [/* @__PURE__ */ jsx(Period, {
40
+ value,
41
+ onChange,
42
+ error: !!error,
43
+ readOnly,
44
+ skeletonWidth,
45
+ skeletonHeight
46
+ }), error && /* @__PURE__ */ jsx(ErrorLabel, {
47
+ message: error.message || ""
48
+ })]
49
+ });
50
+ }
51
+ });
52
+ };
53
+ export {
54
+ RHFPeriod as R
55
+ };
@@ -1,43 +1,43 @@
1
- import { useFormContext as s, Controller as u } from "react-hook-form";
2
- import { RadioGroup as c, FormControlLabel as x, Radio as p, FormHelperText as f } from "@mui/material";
3
- import { jsx as r, jsxs as R } from "react/jsx-runtime";
4
- function j({
5
- name: l,
6
- options: m,
7
- getOptionLabel: e,
8
- ...n
1
+ import { useFormContext, Controller } from "react-hook-form";
2
+ import { RadioGroup, FormControlLabel, Radio, FormHelperText } from "@mui/material";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ function RHFRadioGroup({
5
+ name,
6
+ options,
7
+ getOptionLabel,
8
+ ...other
9
9
  }) {
10
10
  const {
11
- control: a
12
- } = s();
13
- return /* @__PURE__ */ r(u, {
14
- name: l,
15
- control: a,
11
+ control
12
+ } = useFormContext();
13
+ return /* @__PURE__ */ jsx(Controller, {
14
+ name,
15
+ control,
16
16
  render: ({
17
- field: d,
17
+ field,
18
18
  fieldState: {
19
- error: t
19
+ error
20
20
  }
21
- }) => /* @__PURE__ */ R("div", {
22
- children: [/* @__PURE__ */ r(c, {
23
- ...d,
24
- row: !0,
25
- ...n,
26
- children: m.map((o, i) => /* @__PURE__ */ r(x, {
27
- value: o,
28
- control: /* @__PURE__ */ r(p, {}),
29
- label: e?.length ? e[i] : o
30
- }, o))
31
- }), !!t && /* @__PURE__ */ r(f, {
32
- error: !0,
21
+ }) => /* @__PURE__ */ jsxs("div", {
22
+ children: [/* @__PURE__ */ jsx(RadioGroup, {
23
+ ...field,
24
+ row: true,
25
+ ...other,
26
+ children: options.map((option, index) => /* @__PURE__ */ jsx(FormControlLabel, {
27
+ value: option,
28
+ control: /* @__PURE__ */ jsx(Radio, {}),
29
+ label: getOptionLabel?.length ? getOptionLabel[index] : option
30
+ }, option))
31
+ }), !!error && /* @__PURE__ */ jsx(FormHelperText, {
32
+ error: true,
33
33
  sx: {
34
34
  px: 2
35
35
  },
36
- children: t.message
36
+ children: error.message
37
37
  })]
38
38
  })
39
39
  });
40
40
  }
41
41
  export {
42
- j as R
42
+ RHFRadioGroup as R
43
43
  };
@@ -1,36 +1,36 @@
1
- import { useFormContext as m, Controller as s } from "react-hook-form";
2
- import { TextField as u } from "@mui/material";
3
- import { jsx as t } from "react/jsx-runtime";
4
- function x({
5
- name: r,
6
- children: o,
7
- ...l
1
+ import { useFormContext, Controller } from "react-hook-form";
2
+ import { TextField } from "@mui/material";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function RHFSelect({
5
+ name,
6
+ children,
7
+ ...other
8
8
  }) {
9
9
  const {
10
- control: n
11
- } = m();
12
- return /* @__PURE__ */ t(s, {
13
- name: r,
14
- control: n,
10
+ control
11
+ } = useFormContext();
12
+ return /* @__PURE__ */ jsx(Controller, {
13
+ name,
14
+ control,
15
15
  render: ({
16
- field: i,
16
+ field,
17
17
  fieldState: {
18
- error: e
18
+ error
19
19
  }
20
- }) => /* @__PURE__ */ t(u, {
21
- ...i,
22
- select: !0,
23
- fullWidth: !0,
20
+ }) => /* @__PURE__ */ jsx(TextField, {
21
+ ...field,
22
+ select: true,
23
+ fullWidth: true,
24
24
  SelectProps: {
25
- native: !0
25
+ native: true
26
26
  },
27
- error: !!e,
28
- helperText: e?.message,
29
- ...l,
30
- children: o
27
+ error: !!error,
28
+ helperText: error?.message,
29
+ ...other,
30
+ children
31
31
  })
32
32
  });
33
33
  }
34
34
  export {
35
- x as R
35
+ RHFSelect as R
36
36
  };