@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.
Files changed (139) hide show
  1. package/assets/Logo/index.js +91 -0
  2. package/commonjs.js +9 -0
  3. package/components/CommonActions/components/ActionCancel/index.js +15 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.js +62 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.js +35 -0
  6. package/components/CommonActions/components/ActionIntro/index.js +16 -0
  7. package/components/CommonActions/components/Actions/index.js +859 -0
  8. package/components/CompanyLogo/{index.f81c179c.js → index.js} +48 -42
  9. package/components/DataGrid/index.js +1067 -0
  10. package/components/DynamicFilter/index.js +1573 -0
  11. package/components/ErrorLabel/index.js +18 -0
  12. package/components/Icon/index.js +80 -0
  13. package/components/Image/index.js +128 -0
  14. package/components/LanguagePopover/index.js +93 -0
  15. package/components/Loadable/index.js +13 -0
  16. package/components/ModalDialog/index.js +180 -0
  17. package/components/NoItemSelected/{index.12f0ca67.js → index.js} +50 -43
  18. package/components/ObjectLogs/index.js +284 -0
  19. package/components/Page/index.js +36 -0
  20. package/components/PaperForm/index.js +110 -0
  21. package/components/Period/index.js +230 -0
  22. package/components/PropertyValue/index.js +142 -0
  23. package/components/Resizeable/{index.45995d2b.js → index.js} +19 -21
  24. package/components/ScrollBar/index.js +52 -0
  25. package/components/ScrollToTop/index.js +10 -0
  26. package/components/SplitLayout/{index.4032673d.js → index.js} +35 -35
  27. package/components/animate/LoadingScreen/{index.f1cec7db.js → index.js} +27 -29
  28. package/components/animate/MotionContainer/index.js +31 -0
  29. package/components/animate/MotionLazyContainer/index.js +13 -0
  30. package/components/animate/features.js +2 -0
  31. package/components/animate/variants/{bounce.784aaaaa.js → bounce.js} +16 -15
  32. package/components/animate/variants/container.js +20 -0
  33. package/components/animate/variants/fade.js +61 -0
  34. package/components/animate/variants/{index.7a912140.js → index.js} +0 -0
  35. package/components/animate/variants/transition.js +16 -0
  36. package/components/formatters/BooleanFormatter/index.js +52 -0
  37. package/components/formatters/DateFormatter/index.js +66 -0
  38. package/components/formatters/index.js +112 -0
  39. package/components/hook-form/FormProvider/index.js +61 -0
  40. package/components/hook-form/RHFAutocomplete/index.js +144 -0
  41. package/components/hook-form/RHFAutocompleteAsync/index.js +191 -0
  42. package/components/hook-form/RHFCheckbox/index.js +65 -0
  43. package/components/hook-form/RHFDateTime/index.js +79 -0
  44. package/components/hook-form/RHFMultiCheckbox/index.js +32 -0
  45. package/components/hook-form/RHFPeriod/index.js +47 -0
  46. package/components/hook-form/RHFRadioGroup/index.js +41 -0
  47. package/components/hook-form/RHFSelect/index.js +34 -0
  48. package/components/hook-form/RHFTextField/index.js +87 -0
  49. package/components/hook-form/RHFUpload/index.js +255 -0
  50. package/components/mui_extended/Accordion/index.js +105 -0
  51. package/components/mui_extended/Avatar/index.js +33 -0
  52. package/components/mui_extended/BoxIcon/index.js +20 -0
  53. package/components/mui_extended/Breadcrumbs/index.js +92 -0
  54. package/components/mui_extended/Button/index.js +131 -0
  55. package/components/mui_extended/IconButton/index.js +108 -0
  56. package/components/mui_extended/LinkWithRoute/index.js +30 -0
  57. package/components/mui_extended/MenuPopover/index.js +135 -0
  58. package/components/mui_extended/Pager/index.js +137 -0
  59. package/components/mui_extended/Tab/index.js +30 -0
  60. package/components/mui_extended/Typography/index.js +21 -0
  61. package/contexts/ModalContext/index.js +165 -0
  62. package/hooks/useFormAddEdit/index.js +42 -0
  63. package/hooks/useModal/index.js +4 -0
  64. package/index.js +70 -162
  65. package/lodash.js +62 -0
  66. package/node_modules.js +54 -0
  67. package/package.json +2 -1
  68. package/react-data-grid.js +2652 -0
  69. package/react-draggable.js +960 -0
  70. package/react-json-view.js +2764 -0
  71. package/react-lazy-load-image-component.js +792 -0
  72. package/react-resizable.js +541 -0
  73. package/react-splitter-layout.js +165 -0
  74. package/utils/index.js +572 -0
  75. package/assets/Logo/index.228dcb5a.js +0 -86
  76. package/commonjs.565e6834.js +0 -12
  77. package/components/CommonActions/components/ActionCancel/index.cba1b460.js +0 -17
  78. package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +0 -49
  79. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +0 -31
  80. package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +0 -18
  81. package/components/CommonActions/components/Actions/index.e8148d98.js +0 -743
  82. package/components/DataGrid/index.b688877d.js +0 -894
  83. package/components/DynamicFilter/index.82ce857e.js +0 -1158
  84. package/components/ErrorLabel/index.c8615f16.js +0 -19
  85. package/components/Icon/index.cbca79b0.js +0 -70
  86. package/components/Image/index.e790b50b.js +0 -122
  87. package/components/LanguagePopover/index.3d9611cb.js +0 -87
  88. package/components/Loadable/index.f5518558.js +0 -15
  89. package/components/ModalDialog/index.3850c053.js +0 -168
  90. package/components/ObjectLogs/index.27ef875d.js +0 -266
  91. package/components/Page/index.6d69977e.js +0 -35
  92. package/components/PaperForm/index.d7c74064.js +0 -105
  93. package/components/Period/index.5e68286a.js +0 -160
  94. package/components/PropertyValue/index.ab3dd7e9.js +0 -116
  95. package/components/ScrollBar/index.39eeb2de.js +0 -49
  96. package/components/ScrollToTop/index.e06f98f6.js +0 -11
  97. package/components/animate/MotionContainer/index.8d9f9d80.js +0 -30
  98. package/components/animate/MotionLazyContainer/index.572dd012.js +0 -15
  99. package/components/animate/features.0fbf41e1.js +0 -5
  100. package/components/animate/variants/container.11f82b76.js +0 -20
  101. package/components/animate/variants/fade.b561c0fc.js +0 -59
  102. package/components/animate/variants/transition.bd46b9ce.js +0 -15
  103. package/components/formatters/BooleanFormatter/index.cca53b7f.js +0 -42
  104. package/components/formatters/DateFormatter/index.ad8d9b8e.js +0 -57
  105. package/components/formatters/index.55856d65.js +0 -106
  106. package/components/hook-form/FormProvider/index.257acd9f.js +0 -55
  107. package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +0 -122
  108. package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +0 -153
  109. package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +0 -59
  110. package/components/hook-form/RHFDateTime/index.fc5cbafe.js +0 -68
  111. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +0 -34
  112. package/components/hook-form/RHFPeriod/index.23c254e9.js +0 -45
  113. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +0 -43
  114. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +0 -36
  115. package/components/hook-form/RHFTextField/index.4c455f75.js +0 -77
  116. package/components/hook-form/RHFUpload/index.ed3d739f.js +0 -244
  117. package/components/mui_extended/Accordion/index.2116e423.js +0 -103
  118. package/components/mui_extended/Avatar/index.0a2a4523.js +0 -32
  119. package/components/mui_extended/BoxIcon/index.e638ecc8.js +0 -22
  120. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +0 -89
  121. package/components/mui_extended/Button/index.84d8898c.js +0 -110
  122. package/components/mui_extended/IconButton/index.88f3aadb.js +0 -98
  123. package/components/mui_extended/LinkWithRoute/index.d4b263de.js +0 -28
  124. package/components/mui_extended/MenuPopover/index.488fc536.js +0 -131
  125. package/components/mui_extended/Pager/index.0576814f.js +0 -126
  126. package/components/mui_extended/Tab/index.e0653a0a.js +0 -28
  127. package/components/mui_extended/Typography/index.0c4604b3.js +0 -22
  128. package/contexts/ModalContext/index.2188b69e.js +0 -150
  129. package/hooks/useFormAddEdit/index.d4845f1a.js +0 -26
  130. package/hooks/useModal/index.6571d2d9.js +0 -6
  131. package/lodash.e09401f0.js +0 -32
  132. package/node_modules.168cb897.js +0 -55
  133. package/react-data-grid.d46d625e.js +0 -2115
  134. package/react-draggable.20e95c61.js +0 -714
  135. package/react-json-view.f56a7f8e.js +0 -2762
  136. package/react-lazy-load-image-component.45b56650.js +0 -784
  137. package/react-resizable.5277deaf.js +0 -371
  138. package/react-splitter-layout.7810ac1b.js +0 -165
  139. package/utils/index.214d9542.js +0 -435
@@ -0,0 +1,91 @@
1
+ import { Link } from "react-router-dom";
2
+ import { useTheme } from "@mui/material/styles";
3
+ import { Box } from "@mui/material";
4
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
+ function Logo({
6
+ disabledLink = false,
7
+ sx
8
+ }) {
9
+ const theme = useTheme();
10
+ const PRIMARY_LIGHT = theme.palette.primary.light;
11
+ const PRIMARY_MAIN = theme.palette.primary.main;
12
+ const PRIMARY_DARK = theme.palette.primary.dark;
13
+ const logo = /* @__PURE__ */ jsx(Box, {
14
+ sx: {
15
+ width: 40,
16
+ height: 40,
17
+ ...sx
18
+ },
19
+ children: /* @__PURE__ */ jsxs("svg", {
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ width: "100%",
22
+ height: "100%",
23
+ viewBox: "0 0 512 512",
24
+ children: [/* @__PURE__ */ jsxs("defs", {
25
+ children: [/* @__PURE__ */ jsxs("linearGradient", {
26
+ id: "BG1",
27
+ x1: "100%",
28
+ x2: "50%",
29
+ y1: "9.946%",
30
+ y2: "50%",
31
+ children: [/* @__PURE__ */ jsx("stop", {
32
+ offset: "0%",
33
+ stopColor: PRIMARY_DARK
34
+ }), /* @__PURE__ */ jsx("stop", {
35
+ offset: "100%",
36
+ stopColor: PRIMARY_MAIN
37
+ })]
38
+ }), /* @__PURE__ */ jsxs("linearGradient", {
39
+ id: "BG2",
40
+ x1: "50%",
41
+ x2: "50%",
42
+ y1: "0%",
43
+ y2: "100%",
44
+ children: [/* @__PURE__ */ jsx("stop", {
45
+ offset: "0%",
46
+ stopColor: PRIMARY_LIGHT
47
+ }), /* @__PURE__ */ jsx("stop", {
48
+ offset: "100%",
49
+ stopColor: PRIMARY_MAIN
50
+ })]
51
+ }), /* @__PURE__ */ jsxs("linearGradient", {
52
+ id: "BG3",
53
+ x1: "50%",
54
+ x2: "50%",
55
+ y1: "0%",
56
+ y2: "100%",
57
+ children: [/* @__PURE__ */ jsx("stop", {
58
+ offset: "0%",
59
+ stopColor: PRIMARY_LIGHT
60
+ }), /* @__PURE__ */ jsx("stop", {
61
+ offset: "100%",
62
+ stopColor: PRIMARY_MAIN
63
+ })]
64
+ })]
65
+ }), /* @__PURE__ */ jsxs("g", {
66
+ fillRule: "evenodd",
67
+ clipRule: "evenodd",
68
+ children: [/* @__PURE__ */ jsx("path", {
69
+ fill: "url(#BG1)",
70
+ d: "m1.9 136.9 208.3 120.3v240.5L1.9 377.5z"
71
+ }), /* @__PURE__ */ jsx("path", {
72
+ fill: "url(#BG2)",
73
+ d: "m226.8 257.2 208.5-120.3v240.6L226.8 497.8z"
74
+ }), /* @__PURE__ */ jsx("path", {
75
+ fill: "url(#BG3)",
76
+ d: "M218.6 242.8 10.2 122.5 218.6 2.2 427 122.5z"
77
+ })]
78
+ })]
79
+ })
80
+ });
81
+ if (disabledLink) {
82
+ return /* @__PURE__ */ jsx(Fragment, {
83
+ children: logo
84
+ });
85
+ }
86
+ return /* @__PURE__ */ jsx(Link, {
87
+ to: "/",
88
+ children: logo
89
+ });
90
+ }
91
+ export { Logo as L };
package/commonjs.js ADDED
@@ -0,0 +1,9 @@
1
+ import "react";
2
+ import "prop-types";
3
+ import "react-dom";
4
+ import "clsx";
5
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
6
+ function getDefaultExportFromCjs(x) {
7
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
8
+ }
9
+ export { commonjsGlobal as c, getDefaultExportFromCjs as g };
@@ -0,0 +1,15 @@
1
+ import { useModuleDictionary } from "@m4l/core";
2
+ import { B as Button } from "../../../mui_extended/Button/index.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ const ActionCancel = (props) => {
5
+ const {
6
+ getLabel
7
+ } = useModuleDictionary();
8
+ return /* @__PURE__ */ jsx(Button, {
9
+ variant: "outlined",
10
+ color: "inherit",
11
+ ...props,
12
+ children: getLabel("common_actions.cancel")
13
+ });
14
+ };
15
+ export { ActionCancel as A };
@@ -0,0 +1,62 @@
1
+ import { useFormContext, useFormState } from "react-hook-form";
2
+ import { useNavigate } from "react-router-dom";
3
+ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
4
+ import { Skeleton } from "@mui/material";
5
+ import { B as Button } from "../../../mui_extended/Button/index.js";
6
+ import { useCallback } from "react";
7
+ import { u as useModal } from "../../../../hooks/useModal/index.js";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function ActionFormCancel(props) {
10
+ const {
11
+ to,
12
+ navigateOptions = {
13
+ replace: false
14
+ }
15
+ } = props;
16
+ const {
17
+ getLabel
18
+ } = useModuleDictionary();
19
+ const isSkeleton = useModuleSkeleton();
20
+ const {
21
+ openModalConfirm
22
+ } = useModal();
23
+ const navigate = useNavigate();
24
+ const {
25
+ control
26
+ } = useFormContext();
27
+ const {
28
+ isDirty
29
+ } = useFormState({
30
+ control
31
+ });
32
+ const onConfirmCancel = () => {
33
+ navigate(to, navigateOptions);
34
+ };
35
+ const onClickCancel = useCallback(() => {
36
+ if (isDirty) {
37
+ openModalConfirm({
38
+ variant: "warning",
39
+ title: getLabel("common_actions.confirm_quit_title"),
40
+ msg: getLabel("common_actions.confirm_quit_msg"),
41
+ onClickIntro: onConfirmCancel
42
+ });
43
+ } else {
44
+ onConfirmCancel();
45
+ }
46
+ }, [getLabel, isDirty, onConfirmCancel, openModalConfirm]);
47
+ if (isSkeleton) {
48
+ return /* @__PURE__ */ jsx(Skeleton, {
49
+ variant: "text",
50
+ width: 57,
51
+ height: 30
52
+ });
53
+ }
54
+ return /* @__PURE__ */ jsx(Button, {
55
+ variant: "outlined",
56
+ color: "inherit",
57
+ onClick: onClickCancel,
58
+ ...props,
59
+ children: getLabel("common_actions.cancel")
60
+ });
61
+ }
62
+ export { ActionFormCancel as A };
@@ -0,0 +1,35 @@
1
+ import { useFormContext, useFormState } from "react-hook-form";
2
+ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
3
+ import { LoadingButton } from "@mui/lab";
4
+ import { Skeleton } from "@mui/material";
5
+ import { jsx } from "react/jsx-runtime";
6
+ function ActionFormIntro(props) {
7
+ const {
8
+ getLabel
9
+ } = useModuleDictionary();
10
+ const isSkeleton = useModuleSkeleton();
11
+ const {
12
+ control
13
+ } = useFormContext();
14
+ const {
15
+ isSubmitting
16
+ } = useFormState({
17
+ control
18
+ });
19
+ if (isSkeleton) {
20
+ return /* @__PURE__ */ jsx(Skeleton, {
21
+ variant: "text",
22
+ width: 57,
23
+ height: 30
24
+ });
25
+ }
26
+ return /* @__PURE__ */ jsx(LoadingButton, {
27
+ variant: "contained",
28
+ type: "submit",
29
+ color: "primary",
30
+ loading: isSubmitting,
31
+ ...props,
32
+ children: getLabel("common_actions.intro")
33
+ });
34
+ }
35
+ export { ActionFormIntro as A };
@@ -0,0 +1,16 @@
1
+ import { useModuleDictionary } from "@m4l/core";
2
+ import { B as Button } from "../../../mui_extended/Button/index.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ const ActionIntro = (props) => {
5
+ const {
6
+ getLabel
7
+ } = useModuleDictionary();
8
+ return /* @__PURE__ */ jsx(Button, {
9
+ variant: "contained",
10
+ type: "submit",
11
+ color: "primary",
12
+ ...props,
13
+ children: getLabel("common_actions.intro")
14
+ });
15
+ };
16
+ export { ActionIntro as A };