@m4l/components 0.0.46 → 0.0.49
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/dist/commonjs.js +1 -1
- package/dist/components/CommonActions/components/ActionCancel/index.d.ts +3 -0
- package/dist/components/CommonActions/components/ActionCancel/index.js +15 -0
- package/dist/components/CommonActions/components/ActionFormCancel/index.d.ts +3 -0
- package/dist/components/CommonActions/components/ActionFormCancel/index.js +62 -0
- package/dist/components/CommonActions/components/ActionFormCancel/types.d.ts +6 -0
- package/dist/components/CommonActions/components/ActionFormIntro/index.d.ts +3 -0
- package/dist/components/CommonActions/components/ActionFormIntro/index.js +35 -0
- package/dist/components/CommonActions/components/ActionIntro/index.d.ts +3 -0
- package/dist/components/CommonActions/components/ActionIntro/index.js +16 -0
- package/dist/components/CommonActions/components/Actions/index.d.ts +3 -0
- package/dist/components/CommonActions/components/Actions/index.js +857 -0
- package/dist/components/CommonActions/components/Actions/styles.d.ts +2 -0
- package/dist/components/CommonActions/components/Actions/types.d.ts +4 -0
- package/dist/components/{FormActions → CommonActions}/dictionary.d.ts +1 -1
- package/dist/components/CommonActions/index.d.ts +6 -0
- package/dist/components/DataGrid/index.js +8 -648
- package/dist/components/DynamicFilter/components/fieldstypes/DateTimeFilter/index.d.ts +2 -1
- package/dist/components/DynamicFilter/components/fieldstypes/factory.d.ts +2 -1
- package/dist/components/DynamicFilter/index.js +23 -23
- package/dist/components/Icon/index.js +14 -12
- package/dist/components/ModalDialog/components/Header/types.d.ts +2 -2
- package/dist/components/ModalDialog/index.js +20 -20
- package/dist/components/ModalDialog/types.d.ts +2 -2
- package/dist/components/ObjectLogs/index.js +0 -3
- package/dist/components/SplitLayout/index.js +0 -1
- package/dist/components/formatters/DateFormatter/index.js +10 -8
- package/dist/components/hook-form/FormProvider/index.js +8 -124
- package/dist/components/hook-form/FormProvider/types.d.ts +0 -2
- package/dist/components/hook-form/RHFTextField/index.d.ts +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/mui_extended/Button/index.d.ts +3 -0
- package/dist/components/mui_extended/Button/styles.d.ts +12 -0
- package/dist/components/mui_extended/Button/types.d.ts +2 -0
- package/dist/components/mui_extended/IconButton/index.d.ts +0 -1
- package/dist/components/mui_extended/IconButton/index.js +23 -16
- package/dist/components/mui_extended/Pager/index.js +1 -66
- package/dist/contexts/ModalContext/components/ContentConfirm/types.d.ts +3 -3
- package/dist/contexts/ModalContext/index.js +12 -9
- package/dist/contexts/ModalContext/types.d.ts +5 -6
- package/dist/index.js +8 -5
- package/dist/react-lazy-load-image-component.js +197 -173
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/types.d.ts +1 -0
- package/dist/vendor.js +55 -34
- package/package.json +4 -5
- package/dist/components/FormActions/index.d.ts +0 -3
- package/dist/components/FormActions/index.js +0 -51
- package/dist/components/FormActions/styles.d.ts +0 -2
- package/dist/components/FormActions/types.d.ts +0 -7
- package/dist/components/hook-form/FormProvider/components/FormActions/index.d.ts +0 -3
- package/dist/components/hook-form/FormProvider/components/FormActions/skeleton.d.ts +0 -2
- package/dist/components/hook-form/FormProvider/components/FormActions/styles.d.ts +0 -3
- package/dist/components/hook-form/FormProvider/components/FormActions/types.d.ts +0 -4
- package/dist/components/mui_extended/MenuActions/index.js +0 -111
package/dist/commonjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import "prop-types";
|
|
3
2
|
import "react-dom";
|
|
3
|
+
import "prop-types";
|
|
4
4
|
import "clsx";
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6
6
|
function getDefaultExportFromCjs(x) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
+
import { B as Button } from "../../../../vendor.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 "../../../../vendor.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
|
+
if (isSkeleton) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Skeleton, {
|
|
34
|
+
variant: "text",
|
|
35
|
+
width: 57,
|
|
36
|
+
height: 30
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const onConfirmCancel = () => {
|
|
40
|
+
navigate(to, navigateOptions);
|
|
41
|
+
};
|
|
42
|
+
const onClickCancel = useCallback(() => {
|
|
43
|
+
if (isDirty) {
|
|
44
|
+
openModalConfirm({
|
|
45
|
+
variant: "warning",
|
|
46
|
+
title: getLabel("form_provider.confirm_quit_title"),
|
|
47
|
+
msg: getLabel("form_provider.confirm_quit_msg"),
|
|
48
|
+
onClickIntro: onConfirmCancel
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
onConfirmCancel();
|
|
52
|
+
}
|
|
53
|
+
}, [getLabel, isDirty, onConfirmCancel, openModalConfirm]);
|
|
54
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
55
|
+
variant: "outlined",
|
|
56
|
+
color: "inherit",
|
|
57
|
+
onClick: onClickCancel,
|
|
58
|
+
...props,
|
|
59
|
+
children: getLabel("actions.action_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 "../../../../vendor.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 };
|