@m4l/components 0.1.26 → 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 (112) 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 +96 -0
  12. package/components/Icon/types.d.ts +2 -1
  13. package/components/Image/index.93d5f37f.js +190 -0
  14. package/components/Loadable/index.f5518558.js +8 -8
  15. package/components/ModalDialog/index.9ea10764.js +184 -0
  16. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  17. package/components/ObjectLogs/index.f941fb79.js +288 -0
  18. package/components/Page/index.4237c241.js +22 -20
  19. package/components/PaperForm/index.ec9cb8c9.js +112 -0
  20. package/components/Period/index.2941fbda.js +249 -0
  21. package/components/PropertyValue/index.dfcfe1ba.js +147 -0
  22. package/components/PropertyValue/styles.d.ts +2 -1
  23. package/components/PropertyValue/types.d.ts +3 -3
  24. package/components/Resizeable/index.45995d2b.js +19 -19
  25. package/components/ScrollBar/index.39eeb2de.js +26 -21
  26. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  27. package/components/SplitLayout/index.4032673d.js +35 -33
  28. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  29. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  30. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  31. package/components/animate/features.0fbf41e1.js +3 -3
  32. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  33. package/components/animate/variants/container.11f82b76.js +8 -6
  34. package/components/animate/variants/fade.b561c0fc.js +32 -28
  35. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  36. package/components/formatters/BooleanFormatter/index.8da35c9c.js +55 -0
  37. package/components/formatters/DateFormatter/index.1b9baacc.js +69 -0
  38. package/components/formatters/index.689a8086.js +119 -0
  39. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  40. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  41. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  42. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  43. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  44. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  45. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  46. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  47. package/components/hook-form/RHFTextField/index.f9aaaa90.js +146 -0
  48. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/index.d.ts +0 -0
  49. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/styles.d.ts +4 -3
  50. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/index.d.ts +0 -0
  51. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -0
  52. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/types.d.ts +0 -0
  53. package/components/hook-form/RHFUpload/index.d5cc7c13.js +285 -0
  54. package/components/mui_extended/Accordion/index.a02ac6ae.js +107 -0
  55. package/components/mui_extended/Avatar/index.fe06afd7.js +51 -0
  56. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  57. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  58. package/components/mui_extended/Button/index.53b56958.js +178 -0
  59. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  60. package/components/mui_extended/IconButton/index.a321e5cb.js +120 -0
  61. package/components/mui_extended/IconButton/index.d.ts +1 -1
  62. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  63. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  64. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  65. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  66. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  67. package/contexts/ModalContext/index.b92fa565.js +153 -0
  68. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  69. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  70. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  71. package/contexts/RHFormContext/index.b142190a.js +63 -0
  72. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  73. package/hooks/useModal/index.5fee01a3.js +11 -0
  74. package/index.js +153 -153
  75. package/package.json +2 -1
  76. package/react-data-grid.d46d625e.js +2206 -1663
  77. package/react-draggable.20e95c61.js +800 -553
  78. package/react-json-view.f56a7f8e.js +2344 -2340
  79. package/react-resizable.5277deaf.js +470 -298
  80. package/react-splitter-layout.7810ac1b.js +130 -128
  81. package/utils/index.214d9542.js +500 -354
  82. package/components/CommonActions/components/ActionCancel/index.6736b782.js +0 -17
  83. package/components/CommonActions/components/ActionFormCancel/index.281ee166.js +0 -49
  84. package/components/CommonActions/components/ActionIntro/index.4665a611.js +0 -18
  85. package/components/CommonActions/components/Actions/index.cd7b2671.js +0 -742
  86. package/components/DataGrid/index.2caf6231.js +0 -894
  87. package/components/DynamicFilter/index.f2377369.js +0 -1157
  88. package/components/Icon/index.f569765b.js +0 -82
  89. package/components/Image/index.c9da2d5a.js +0 -152
  90. package/components/ModalDialog/index.bee344a5.js +0 -168
  91. package/components/ObjectLogs/index.6b6f95e6.js +0 -266
  92. package/components/PaperForm/index.3f8c7ef2.js +0 -105
  93. package/components/Period/index.a112ce37.js +0 -175
  94. package/components/PropertyValue/index.ab3dd7e9.js +0 -116
  95. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  96. package/components/formatters/BooleanFormatter/index.3ec56305.js +0 -42
  97. package/components/formatters/DateFormatter/index.08d8823b.js +0 -57
  98. package/components/formatters/index.6959c2de.js +0 -106
  99. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  100. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  101. package/components/hook-form/RHFPeriod/index.979d0898.js +0 -51
  102. package/components/hook-form/RHFTextField/index.ba2a8f67.js +0 -129
  103. package/components/hook-form/RHFUpload/index.6347159a.js +0 -258
  104. package/components/mui_extended/Accordion/index.49f5df8e.js +0 -103
  105. package/components/mui_extended/Avatar/index.dadb0528.js +0 -37
  106. package/components/mui_extended/Button/index.52d18aea.js +0 -144
  107. package/components/mui_extended/IconButton/index.4b5ce8b5.js +0 -103
  108. package/components/mui_extended/Pager/index.951b6975.js +0 -126
  109. package/components/mui_extended/Popover/index.4da8587a.js +0 -252
  110. package/contexts/ModalContext/index.5388dfd5.js +0 -136
  111. package/hooks/useModal/index.3b1ff084.js +0 -11
  112. package/node_modules.168cb897.js +0 -55
@@ -1,13 +1,16 @@
1
- import { v as i, a as c } from "./transition.bd46b9ce.js";
2
- const r = (n) => {
3
- const a = n?.durationIn, e = n?.durationOut, t = n?.easeIn, o = n?.easeOut;
1
+ import { v as varTranEnter, a as varTranExit } from "./transition.bd46b9ce.js";
2
+ const varBounce = (props) => {
3
+ const durationIn = props?.durationIn;
4
+ const durationOut = props?.durationOut;
5
+ const easeIn = props?.easeIn;
6
+ const easeOut = props?.easeOut;
4
7
  return {
5
8
  in: {
6
9
  initial: {},
7
10
  animate: {
8
11
  scale: [0.3, 1.1, 0.9, 1.03, 0.97, 1],
9
12
  opacity: [0, 1, 1, 1, 1, 1],
10
- transition: i({ durationIn: a, easeIn: t })
13
+ transition: varTranEnter({ durationIn, easeIn })
11
14
  },
12
15
  exit: {
13
16
  scale: [0.9, 1.1, 0.3],
@@ -20,13 +23,13 @@ const r = (n) => {
20
23
  y: [720, -24, 12, -4, 0],
21
24
  scaleY: [4, 0.9, 0.95, 0.985, 1],
22
25
  opacity: [0, 1, 1, 1, 1],
23
- transition: { ...i({ durationIn: a, easeIn: t }) }
26
+ transition: { ...varTranEnter({ durationIn, easeIn }) }
24
27
  },
25
28
  exit: {
26
29
  y: [12, -24, 720],
27
30
  scaleY: [0.985, 0.9, 3],
28
31
  opacity: [1, 1, 0],
29
- transition: c({ durationOut: e, easeOut: o })
32
+ transition: varTranExit({ durationOut, easeOut })
30
33
  }
31
34
  },
32
35
  inDown: {
@@ -35,13 +38,13 @@ const r = (n) => {
35
38
  y: [-720, 24, -12, 4, 0],
36
39
  scaleY: [4, 0.9, 0.95, 0.985, 1],
37
40
  opacity: [0, 1, 1, 1, 1],
38
- transition: i({ durationIn: a, easeIn: t })
41
+ transition: varTranEnter({ durationIn, easeIn })
39
42
  },
40
43
  exit: {
41
44
  y: [-12, 24, -720],
42
45
  scaleY: [0.985, 0.9, 3],
43
46
  opacity: [1, 1, 0],
44
- transition: c({ durationOut: e, easeOut: o })
47
+ transition: varTranExit({ durationOut, easeOut })
45
48
  }
46
49
  },
47
50
  inLeft: {
@@ -50,13 +53,13 @@ const r = (n) => {
50
53
  x: [-720, 24, -12, 4, 0],
51
54
  scaleX: [3, 1, 0.98, 0.995, 1],
52
55
  opacity: [0, 1, 1, 1, 1],
53
- transition: i({ durationIn: a, easeIn: t })
56
+ transition: varTranEnter({ durationIn, easeIn })
54
57
  },
55
58
  exit: {
56
59
  x: [0, 24, -720],
57
60
  scaleX: [1, 0.9, 2],
58
61
  opacity: [1, 1, 0],
59
- transition: c({ durationOut: e, easeOut: o })
62
+ transition: varTranExit({ durationOut, easeOut })
60
63
  }
61
64
  },
62
65
  inRight: {
@@ -65,13 +68,13 @@ const r = (n) => {
65
68
  x: [720, -24, 12, -4, 0],
66
69
  scaleX: [3, 1, 0.98, 0.995, 1],
67
70
  opacity: [0, 1, 1, 1, 1],
68
- transition: i({ durationIn: a, easeIn: t })
71
+ transition: varTranEnter({ durationIn, easeIn })
69
72
  },
70
73
  exit: {
71
74
  x: [0, -24, 720],
72
75
  scaleX: [1, 0.9, 2],
73
76
  opacity: [1, 1, 0],
74
- transition: c({ durationOut: e, easeOut: o })
77
+ transition: varTranExit({ durationOut, easeOut })
75
78
  }
76
79
  },
77
80
  out: {
@@ -92,5 +95,5 @@ const r = (n) => {
92
95
  };
93
96
  };
94
97
  export {
95
- r as v
98
+ varBounce as v
96
99
  };
@@ -1,20 +1,22 @@
1
- const r = (t) => {
2
- const n = t?.staggerIn || 0.05, e = t?.staggerIn || 0.05, a = t?.staggerIn || 0.05;
1
+ const varContainer = (props) => {
2
+ const staggerIn = props?.staggerIn || 0.05;
3
+ const delayIn = props?.staggerIn || 0.05;
4
+ const staggerOut = props?.staggerIn || 0.05;
3
5
  return {
4
6
  animate: {
5
7
  transition: {
6
- staggerChildren: n,
7
- delayChildren: e
8
+ staggerChildren: staggerIn,
9
+ delayChildren: delayIn
8
10
  }
9
11
  },
10
12
  exit: {
11
13
  transition: {
12
- staggerChildren: a,
14
+ staggerChildren: staggerOut,
13
15
  staggerDirection: -1
14
16
  }
15
17
  }
16
18
  };
17
19
  };
18
20
  export {
19
- r as v
21
+ varContainer as v
20
22
  };
@@ -1,59 +1,63 @@
1
- import { v as t, a } from "./transition.bd46b9ce.js";
2
- const s = (e) => {
3
- const i = e?.distance || 120, n = e?.durationIn, o = e?.durationOut, y = e?.easeIn, c = e?.easeOut;
1
+ import { v as varTranEnter, a as varTranExit } from "./transition.bd46b9ce.js";
2
+ const varFade = (props) => {
3
+ const distance = props?.distance || 120;
4
+ const durationIn = props?.durationIn;
5
+ const durationOut = props?.durationOut;
6
+ const easeIn = props?.easeIn;
7
+ const easeOut = props?.easeOut;
4
8
  return {
5
9
  in: {
6
10
  initial: { opacity: 0 },
7
- animate: { opacity: 1, transition: t },
8
- exit: { opacity: 0, transition: a }
11
+ animate: { opacity: 1, transition: varTranEnter },
12
+ exit: { opacity: 0, transition: varTranExit }
9
13
  },
10
14
  inUp: {
11
- initial: { y: i, opacity: 0 },
12
- animate: { y: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
13
- exit: { y: i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
15
+ initial: { y: distance, opacity: 0 },
16
+ animate: { y: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
17
+ exit: { y: distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
14
18
  },
15
19
  inDown: {
16
- initial: { y: -i, opacity: 0 },
17
- animate: { y: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
18
- exit: { y: -i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
20
+ initial: { y: -distance, opacity: 0 },
21
+ animate: { y: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
22
+ exit: { y: -distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
19
23
  },
20
24
  inLeft: {
21
- initial: { x: -i, opacity: 0 },
22
- animate: { x: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
23
- exit: { x: -i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
25
+ initial: { x: -distance, opacity: 0 },
26
+ animate: { x: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
27
+ exit: { x: -distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
24
28
  },
25
29
  inRight: {
26
- initial: { x: i, opacity: 0 },
27
- animate: { x: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
28
- exit: { x: i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
30
+ initial: { x: distance, opacity: 0 },
31
+ animate: { x: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
32
+ exit: { x: distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
29
33
  },
30
34
  out: {
31
35
  initial: { opacity: 1 },
32
- animate: { opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
33
- exit: { opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
36
+ animate: { opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
37
+ exit: { opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
34
38
  },
35
39
  outUp: {
36
40
  initial: { y: 0, opacity: 1 },
37
- animate: { y: -i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
38
- exit: { y: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
41
+ animate: { y: -distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
42
+ exit: { y: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
39
43
  },
40
44
  outDown: {
41
45
  initial: { y: 0, opacity: 1 },
42
- animate: { y: i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
43
- exit: { y: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
46
+ animate: { y: distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
47
+ exit: { y: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
44
48
  },
45
49
  outLeft: {
46
50
  initial: { x: 0, opacity: 1 },
47
- animate: { x: -i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
48
- exit: { x: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
51
+ animate: { x: -distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
52
+ exit: { x: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
49
53
  },
50
54
  outRight: {
51
55
  initial: { x: 0, opacity: 1 },
52
- animate: { x: i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
53
- exit: { x: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
56
+ animate: { x: distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
57
+ exit: { x: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
54
58
  }
55
59
  };
56
60
  };
57
61
  export {
58
- s as v
62
+ varFade as v
59
63
  };
@@ -1,15 +1,20 @@
1
- const e = (n) => {
2
- const t = n?.duration || 0.32, a = n?.ease || [0.43, 0.13, 0.23, 0.96];
3
- return { duration: t, ease: a };
4
- }, r = (n) => {
5
- const t = n?.durationIn || 0.64, a = n?.easeIn || [0.43, 0.13, 0.23, 0.96];
6
- return { duration: t, ease: a };
7
- }, s = (n) => {
8
- const t = n?.durationOut || 0.48, a = n?.easeOut || [0.43, 0.13, 0.23, 0.96];
9
- return { duration: t, ease: a };
1
+ const varTranHover = (props) => {
2
+ const duration = props?.duration || 0.32;
3
+ const ease = props?.ease || [0.43, 0.13, 0.23, 0.96];
4
+ return { duration, ease };
5
+ };
6
+ const varTranEnter = (props) => {
7
+ const duration = props?.durationIn || 0.64;
8
+ const ease = props?.easeIn || [0.43, 0.13, 0.23, 0.96];
9
+ return { duration, ease };
10
+ };
11
+ const varTranExit = (props) => {
12
+ const duration = props?.durationOut || 0.48;
13
+ const ease = props?.easeOut || [0.43, 0.13, 0.23, 0.96];
14
+ return { duration, ease };
10
15
  };
11
16
  export {
12
- s as a,
13
- e as b,
14
- r as v
17
+ varTranExit as a,
18
+ varTranHover as b,
19
+ varTranEnter as v
15
20
  };
@@ -0,0 +1,55 @@
1
+ import { useModuleDictionary, useEnvironment, getPropertyByString } from "@m4l/core";
2
+ import React from "react";
3
+ import { I as Icon } from "../../Icon/index.619c31c4.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function BooleanFormatter(props) {
6
+ const {
7
+ presentationType,
8
+ value,
9
+ Component = React.Fragment
10
+ } = props;
11
+ const {
12
+ getLabel
13
+ } = useModuleDictionary();
14
+ const {
15
+ host_static_assets,
16
+ environment_assets
17
+ } = useEnvironment();
18
+ const final_value = value ?? false;
19
+ const srcCheckTrue = `${host_static_assets}/${environment_assets}/frontend/components/data_grid/components/boolean_formatter/assets/icons/check_true.svg`;
20
+ const srcCheckFalse = `${host_static_assets}/${environment_assets}/frontend/components/data_grid/components/boolean_formatter/assets/icons/check_false.svg`;
21
+ if (presentationType === "string_yes_no") {
22
+ return /* @__PURE__ */ jsx(Component, {
23
+ children: final_value ? getLabel("formatters.boolean_yes") : getLabel("formatters.boolean_no")
24
+ });
25
+ }
26
+ if (presentationType === "string_true_false") {
27
+ return /* @__PURE__ */ jsx(Component, {
28
+ children: final_value ? getLabel("formatters.boolean_true") : getLabel("formatters.boolean_false")
29
+ });
30
+ }
31
+ return /* @__PURE__ */ jsx(Component, {
32
+ children: /* @__PURE__ */ jsx(Icon, {
33
+ src: final_value ? srcCheckTrue : srcCheckFalse,
34
+ bgColor: "action.disabled"
35
+ })
36
+ });
37
+ }
38
+ function columnBooleanFormatter(props) {
39
+ const {
40
+ fieldValue,
41
+ presentationType,
42
+ Component = React.Fragment
43
+ } = props;
44
+ return (obProps) => {
45
+ return /* @__PURE__ */ jsx(BooleanFormatter, {
46
+ presentationType,
47
+ value: getPropertyByString(obProps, fieldValue),
48
+ Component
49
+ });
50
+ };
51
+ }
52
+ export {
53
+ BooleanFormatter as B,
54
+ columnBooleanFormatter as c
55
+ };
@@ -0,0 +1,69 @@
1
+ import React from "react";
2
+ import { useEnvironment, useHostTools, getPropertyByString } from "@m4l/core";
3
+ import "../../Icon/index.619c31c4.js";
4
+ import "@mui/material/styles";
5
+ import { jsx, Fragment } from "react/jsx-runtime";
6
+ function DateFormatter(props) {
7
+ const {
8
+ presentationType,
9
+ value,
10
+ format,
11
+ Component = React.Fragment
12
+ } = props;
13
+ const {
14
+ dfnsFormat
15
+ } = useEnvironment();
16
+ const {
17
+ formatDate
18
+ } = useHostTools();
19
+ let finalFormat = format || dfnsFormat.datetime_format;
20
+ let result;
21
+ let resultDate;
22
+ if (value === void 0 || value === null) {
23
+ return /* @__PURE__ */ jsx(Fragment, {
24
+ children: "-"
25
+ });
26
+ }
27
+ switch (presentationType) {
28
+ case "datetime":
29
+ finalFormat = format || dfnsFormat.datetime_format;
30
+ break;
31
+ case "date":
32
+ finalFormat = format || dfnsFormat.date_format;
33
+ break;
34
+ case "time":
35
+ finalFormat = format || dfnsFormat.time_format;
36
+ break;
37
+ }
38
+ try {
39
+ if (typeof value === "number" || typeof value === "string") {
40
+ resultDate = new Date(value);
41
+ } else {
42
+ resultDate = value;
43
+ }
44
+ result = formatDate(resultDate, finalFormat);
45
+ } catch (e) {
46
+ result = "err_typing";
47
+ }
48
+ return /* @__PURE__ */ jsx(Component, {
49
+ children: result
50
+ });
51
+ }
52
+ function columnDateFormatter(props) {
53
+ const {
54
+ fieldValue,
55
+ presentationType,
56
+ Component = React.Fragment
57
+ } = props;
58
+ return (obProps) => {
59
+ return /* @__PURE__ */ jsx(DateFormatter, {
60
+ presentationType,
61
+ value: getPropertyByString(obProps, fieldValue),
62
+ Component
63
+ });
64
+ };
65
+ }
66
+ export {
67
+ DateFormatter as D,
68
+ columnDateFormatter as c
69
+ };
@@ -0,0 +1,119 @@
1
+ import React from "react";
2
+ import { jsx, Fragment } from "react/jsx-runtime";
3
+ import { getPropertyByString } from "@m4l/core";
4
+ import "../Icon/index.619c31c4.js";
5
+ import "@mui/material/styles";
6
+ function UncertaintyFormatter(props) {
7
+ const {
8
+ value,
9
+ unit,
10
+ symbol,
11
+ Component = React.Fragment
12
+ } = props;
13
+ if (value === void 0 || value === null || !Array.isArray(value)) {
14
+ return /* @__PURE__ */ jsx(Fragment, {
15
+ children: ""
16
+ });
17
+ }
18
+ let result = "";
19
+ value.map((obj, idx) => {
20
+ const cmc_min_closed = obj.cmc_min_closed != true ? "<" : "\u2264";
21
+ const cmc_max_closed = obj.cmc_max_closed != true ? "<" : "\u2264";
22
+ result = result.concat(`${idx > 0 ? " " : ""}`, obj.cmc_min !== obj.cmc_max ? `[${obj.cmc_min}${unit} ${cmc_min_closed} ${symbol} ${cmc_max_closed} ${obj.cmc_max}${unit} \xB1 ${obj.cmc_uncertainty}]` : `[${obj.cmc_min}${unit} \xB1 ${obj.cmc_uncertainty}]`);
23
+ });
24
+ return /* @__PURE__ */ jsx(Component, {
25
+ children: result
26
+ });
27
+ }
28
+ function PointsFormatter(props) {
29
+ const {
30
+ value,
31
+ unit,
32
+ Component = React.Fragment
33
+ } = props;
34
+ if (value === void 0 || value === null || !Array.isArray(value)) {
35
+ return /* @__PURE__ */ jsx(Fragment, {
36
+ children: "[]"
37
+ });
38
+ }
39
+ let result = "";
40
+ value.map((point) => {
41
+ if (point) {
42
+ result = result.concat(`[${point}${unit}]`);
43
+ }
44
+ });
45
+ return /* @__PURE__ */ jsx(Component, {
46
+ children: result
47
+ });
48
+ }
49
+ function PriceFormatter(props) {
50
+ const {
51
+ value,
52
+ Component = React.Fragment
53
+ } = props;
54
+ return /* @__PURE__ */ jsx(Component, {
55
+ children: `${value}$Cop`
56
+ });
57
+ }
58
+ function getFormattersComponentsDictionary() {
59
+ return ["formatters"];
60
+ }
61
+ const defaultFormattersDictionary = {
62
+ pager: {
63
+ boolean_yes: "Yes",
64
+ boolean_no: "No",
65
+ boolean_true: "True",
66
+ boolean_false: "False"
67
+ }
68
+ };
69
+ function columnUncertaintyFormatter(props) {
70
+ const {
71
+ fieldUnit,
72
+ fieldValue,
73
+ fieldSymbol,
74
+ Component
75
+ } = props;
76
+ return (obProps) => {
77
+ return /* @__PURE__ */ jsx(UncertaintyFormatter, {
78
+ Component,
79
+ value: getPropertyByString(obProps, fieldValue),
80
+ unit: getPropertyByString(obProps, fieldUnit),
81
+ symbol: getPropertyByString(obProps, fieldSymbol)
82
+ });
83
+ };
84
+ }
85
+ function columnPointsFormatter(props) {
86
+ const {
87
+ fieldUnit,
88
+ fieldValue,
89
+ Component
90
+ } = props;
91
+ return (obProps) => {
92
+ return /* @__PURE__ */ jsx(PointsFormatter, {
93
+ Component,
94
+ value: getPropertyByString(obProps, fieldValue),
95
+ unit: getPropertyByString(obProps, fieldUnit)
96
+ });
97
+ };
98
+ }
99
+ function columnNestedValueFormatter(props) {
100
+ const {
101
+ fieldValue,
102
+ Component = React.Fragment
103
+ } = props;
104
+ return (obProps) => {
105
+ return /* @__PURE__ */ jsx(Component, {
106
+ children: getPropertyByString(obProps, fieldValue) + ""
107
+ });
108
+ };
109
+ }
110
+ export {
111
+ PointsFormatter as P,
112
+ UncertaintyFormatter as U,
113
+ PriceFormatter as a,
114
+ columnPointsFormatter as b,
115
+ columnUncertaintyFormatter as c,
116
+ defaultFormattersDictionary as d,
117
+ columnNestedValueFormatter as e,
118
+ getFormattersComponentsDictionary as g
119
+ };