@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.
Files changed (55) hide show
  1. package/dist/commonjs.js +1 -1
  2. package/dist/components/CommonActions/components/ActionCancel/index.d.ts +3 -0
  3. package/dist/components/CommonActions/components/ActionCancel/index.js +15 -0
  4. package/dist/components/CommonActions/components/ActionFormCancel/index.d.ts +3 -0
  5. package/dist/components/CommonActions/components/ActionFormCancel/index.js +62 -0
  6. package/dist/components/CommonActions/components/ActionFormCancel/types.d.ts +6 -0
  7. package/dist/components/CommonActions/components/ActionFormIntro/index.d.ts +3 -0
  8. package/dist/components/CommonActions/components/ActionFormIntro/index.js +35 -0
  9. package/dist/components/CommonActions/components/ActionIntro/index.d.ts +3 -0
  10. package/dist/components/CommonActions/components/ActionIntro/index.js +16 -0
  11. package/dist/components/CommonActions/components/Actions/index.d.ts +3 -0
  12. package/dist/components/CommonActions/components/Actions/index.js +857 -0
  13. package/dist/components/CommonActions/components/Actions/styles.d.ts +2 -0
  14. package/dist/components/CommonActions/components/Actions/types.d.ts +4 -0
  15. package/dist/components/{FormActions → CommonActions}/dictionary.d.ts +1 -1
  16. package/dist/components/CommonActions/index.d.ts +6 -0
  17. package/dist/components/DataGrid/index.js +8 -648
  18. package/dist/components/DynamicFilter/components/fieldstypes/DateTimeFilter/index.d.ts +2 -1
  19. package/dist/components/DynamicFilter/components/fieldstypes/factory.d.ts +2 -1
  20. package/dist/components/DynamicFilter/index.js +23 -23
  21. package/dist/components/Icon/index.js +14 -12
  22. package/dist/components/ModalDialog/components/Header/types.d.ts +2 -2
  23. package/dist/components/ModalDialog/index.js +20 -20
  24. package/dist/components/ModalDialog/types.d.ts +2 -2
  25. package/dist/components/ObjectLogs/index.js +0 -3
  26. package/dist/components/SplitLayout/index.js +0 -1
  27. package/dist/components/formatters/DateFormatter/index.js +10 -8
  28. package/dist/components/hook-form/FormProvider/index.js +8 -124
  29. package/dist/components/hook-form/FormProvider/types.d.ts +0 -2
  30. package/dist/components/hook-form/RHFTextField/index.d.ts +1 -1
  31. package/dist/components/index.d.ts +2 -2
  32. package/dist/components/mui_extended/Button/index.d.ts +3 -0
  33. package/dist/components/mui_extended/Button/styles.d.ts +12 -0
  34. package/dist/components/mui_extended/Button/types.d.ts +2 -0
  35. package/dist/components/mui_extended/IconButton/index.d.ts +0 -1
  36. package/dist/components/mui_extended/IconButton/index.js +23 -16
  37. package/dist/components/mui_extended/Pager/index.js +1 -66
  38. package/dist/contexts/ModalContext/components/ContentConfirm/types.d.ts +3 -3
  39. package/dist/contexts/ModalContext/index.js +12 -9
  40. package/dist/contexts/ModalContext/types.d.ts +5 -6
  41. package/dist/index.js +8 -5
  42. package/dist/react-lazy-load-image-component.js +197 -173
  43. package/dist/utils/index.d.ts +3 -3
  44. package/dist/utils/types.d.ts +1 -0
  45. package/dist/vendor.js +55 -34
  46. package/package.json +4 -5
  47. package/dist/components/FormActions/index.d.ts +0 -3
  48. package/dist/components/FormActions/index.js +0 -51
  49. package/dist/components/FormActions/styles.d.ts +0 -2
  50. package/dist/components/FormActions/types.d.ts +0 -7
  51. package/dist/components/hook-form/FormProvider/components/FormActions/index.d.ts +0 -3
  52. package/dist/components/hook-form/FormProvider/components/FormActions/skeleton.d.ts +0 -2
  53. package/dist/components/hook-form/FormProvider/components/FormActions/styles.d.ts +0 -3
  54. package/dist/components/hook-form/FormProvider/components/FormActions/types.d.ts +0 -4
  55. 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,3 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '@mui/material';
3
+ export declare const ActionCancel: (props: ButtonProps) => JSX.Element;
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ import type { ActionFormCancelProps } from './types';
3
+ export declare function ActionFormCancel(props: ActionFormCancelProps): JSX.Element;
@@ -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,6 @@
1
+ import { ButtonProps } from '@mui/material';
2
+ import { NavigateOptions, To } from 'react-router-dom';
3
+ export interface ActionFormCancelProps extends ButtonProps {
4
+ to: To;
5
+ navigateOptions?: NavigateOptions;
6
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { LoadingButtonProps } from '@mui/lab';
3
+ export declare function ActionFormIntro(props: LoadingButtonProps): JSX.Element;
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '@mui/material';
3
+ export declare const ActionIntro: (props: ButtonProps) => JSX.Element;
@@ -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 };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { StandardActionsProps } from './types';
3
+ export declare const Actions: (props: StandardActionsProps) => JSX.Element;