@m4l/components 0.2.26 → 0.2.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 (117) hide show
  1. package/components/AccountPopover/{index.e31fc908.js → index.7b7f3962.js} +1 -1
  2. package/components/AppBar/{index.4945897e.js → index.cb2f1763.js} +2 -2
  3. package/components/CommonActions/components/ActionCancel/{index.33a748be.js → index.e03455db.js} +2 -2
  4. package/components/CommonActions/components/ActionFormCancel/{index.9a965204.js → index.9120552e.js} +4 -4
  5. package/components/CommonActions/components/ActionFormIntro/{index.7add0125.js → index.48e7d28a.js} +2 -2
  6. package/components/CommonActions/components/ActionIntro/{index.ac7cd0ee.js → index.5ba2ef5f.js} +2 -2
  7. package/components/DataGrid/formatters/ColumnBooleanFormatter/{index.f731d23f.js → index.ce8c7b9c.js} +1 -1
  8. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/{index.ad82747c.js → index.3a1ae54f.js} +1 -1
  9. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/{index.64854fdd.js → index.de32e830.js} +1 -1
  10. package/components/DataGrid/{index.1c695ed3.js → index.690184a8.js} +3 -3
  11. package/components/DataGrid/subcomponents/Actions/{index.4a402633.js → index.339ccf42.js} +10 -10
  12. package/components/DragResizeWindow/{index.f84451f8.js → index.be2fc1e0.js} +1 -1
  13. package/components/DynamicFilter/{index.22ba3195.js → index.ad2460cf.js} +12 -10
  14. package/components/FieldLabel/{index.1da2a28d.js → index.61d55577.js} +1 -1
  15. package/components/GridLayout/subcomponents/Responsive/{index.0fd1b7f8.js → index.d2ec9ddb.js} +1 -0
  16. package/components/HamburgerMenu/{index.1663edef.js → index.9f99b7c1.js} +2 -2
  17. package/components/Icon/{index.8c744412.js → index.1976cb37.js} +8 -48
  18. package/components/Icon/types.d.ts +0 -5
  19. package/components/Image/classes/index.d.ts +7 -0
  20. package/components/Image/{utils/classes → classes}/types.d.ts +0 -5
  21. package/components/Image/index.fd6f2c5f.js +203 -0
  22. package/components/Image/tests/utils.d.ts +1 -1
  23. package/components/Image/types.d.ts +3 -43
  24. package/components/LanguagePopover/{index.80896e49.js → index.f90fd1dc.js} +2 -3
  25. package/components/LoadingError/{index.9c64680a.js → index.2aa5daba.js} +2 -2
  26. package/components/MFLoader/{index.7cd7c372.js → index.1e56a845.js} +1 -1
  27. package/components/ModalDialog/{index.ce0f4d16.js → index.86de725b.js} +2 -2
  28. package/components/NoItemSelected/{index.ffba558b.js → index.16ff4e09.js} +1 -1
  29. package/components/ObjectLogs/{index.dd6a5009.js → index.d200ba38.js} +5 -5
  30. package/components/PDFViewer/{index.093ddd35.js → index.3bffbae3.js} +1 -1
  31. package/components/Page/{index.1b20a73e.js → index.026d463c.js} +1 -1
  32. package/components/PaperForm/{index.42e78a24.js → index.fe630839.js} +1 -1
  33. package/components/Period/{index.6e8d92dc.js → index.b6fa6ce6.js} +2 -2
  34. package/components/PrintingSystem/{index.c2d21657.js → index.02517f9c.js} +12 -12
  35. package/components/PrintingSystem/subcomponents/BodyNode/{index.c7b59f3f.js → index.0abc77a8.js} +1 -1
  36. package/components/PrintingSystem/subcomponents/ChartNode/{index.263f02f0.js → index.293e44cd.js} +1 -1
  37. package/components/PrintingSystem/subcomponents/DividerNode/{index.f00c44f3.js → index.3a2363d4.js} +1 -1
  38. package/components/PrintingSystem/subcomponents/FooterNode/{index.fb323704.js → index.fc1466e0.js} +1 -1
  39. package/components/PrintingSystem/subcomponents/GridNode/{index.1ed935be.js → index.ca2cc635.js} +1 -1
  40. package/components/PrintingSystem/subcomponents/HeaderNode/{index.5173c74a.js → index.5ae4e58e.js} +1 -1
  41. package/components/PrintingSystem/subcomponents/PaperNode/{index.fad64696.js → index.251d9664.js} +1 -1
  42. package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.3a3e5fd0.js → index.45054100.js} +1 -1
  43. package/components/PrintingSystem/subcomponents/SectionNode/{index.2890fc12.js → index.cfd21ea3.js} +1 -1
  44. package/components/PrintingSystem/subcomponents/TextBoxNode/{index.148708e6.js → index.0f22f144.js} +1 -1
  45. package/components/PropertyValue/{index.4ea5af0f.js → index.041a0585.js} +1 -1
  46. package/components/SideBar/classes/index.d.ts +1 -0
  47. package/components/SideBar/classes/types.d.ts +1 -0
  48. package/components/SideBar/{index.141dac10.js → index.3ea827ea.js} +13 -29
  49. package/components/SideBar/subcomponents/ContentGroups/index.d.ts +1 -1
  50. package/components/ToastContainer/{index.98c4873e.js → index.ee15bfce.js} +2 -2
  51. package/components/areas/components/AreasAdmin/{index.debe3e3d.js → index.01ea7058.js} +13 -13
  52. package/components/areas/components/AreasViewer/{index.82a22acb.js → index.71038f0e.js} +75 -189
  53. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/index.d.ts +2 -0
  54. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/types.d.ts +3 -0
  55. package/components/areas/contexts/AreasContext/helper.d.ts +2 -2
  56. package/components/areas/contexts/AreasContext/{index.0dc69929.js → index.cc89c1a7.js} +5 -5
  57. package/components/areas/hooks/useAreas/{index.ca15a4b6.js → index.32c7a909.js} +1 -1
  58. package/components/commercial/TopBar/{index.32a332c4.js → index.6493e8ab.js} +3 -3
  59. package/components/formatters/BooleanFormatter/{index.0703a256.js → index.477c6419.js} +2 -2
  60. package/components/formatters/{index.94be7098.js → index.ac0a547b.js} +1 -1
  61. package/components/hook-form/RHFAutocomplete/classes/types.d.ts +1 -0
  62. package/components/hook-form/RHFAutocomplete/{index.993794f8.js → index.24e4387c.js} +22 -15
  63. package/components/hook-form/RHFAutocomplete/types.d.ts +2 -1
  64. package/components/hook-form/RHFAutocompleteAsync/{index.924c6473.js → index.0cc78417.js} +1 -1
  65. package/components/hook-form/RHFCheckbox/classes/types.d.ts +2 -0
  66. package/components/hook-form/RHFCheckbox/{index.f1fd5789.js → index.22648b5a.js} +20 -3
  67. package/components/hook-form/RHFCheckbox/types.d.ts +2 -0
  68. package/components/hook-form/RHFColorPicker/classes/types.d.ts +2 -0
  69. package/components/hook-form/RHFColorPicker/{index.60b50052.js → index.d02de5ee.js} +24 -6
  70. package/components/hook-form/RHFColorPicker/types.d.ts +2 -0
  71. package/components/hook-form/RHFDateTime/classes/types.d.ts +1 -0
  72. package/components/hook-form/RHFDateTime/{index.2396ea4a.js → index.f02f1122.js} +19 -12
  73. package/components/hook-form/RHFDateTime/types.d.ts +2 -1
  74. package/components/hook-form/RHFPeriod/classes/index.d.ts +2 -1
  75. package/components/hook-form/RHFPeriod/classes/types.d.ts +2 -0
  76. package/components/hook-form/RHFPeriod/index.5ca467ac.js +112 -0
  77. package/components/hook-form/RHFPeriod/types.d.ts +4 -0
  78. package/components/hook-form/RHFTextField/classes/types.d.ts +1 -0
  79. package/components/hook-form/RHFTextField/{index.fb0d1cac.js → index.81c4b52b.js} +21 -15
  80. package/components/hook-form/RHFTextField/types.d.ts +2 -1
  81. package/components/hook-form/RHFUpload/{index.e5f734b8.js → index.f6c5027f.js} +2 -2
  82. package/components/modal/{WindowBase.dd1d2d7b.js → WindowBase.f38260ec.js} +3 -3
  83. package/components/modal/{WindowConfirm.4501497a.js → WindowConfirm.67ee36e9.js} +6 -6
  84. package/components/mui_extended/Accordion/{index.4393eca9.js → index.a55875a5.js} +2 -2
  85. package/components/mui_extended/Button/{index.93389adb.js → index.c6befaeb.js} +3 -7
  86. package/components/mui_extended/{CheckBox.840a443f.js → CheckBox.d676424c.js} +1 -1
  87. package/components/mui_extended/IconButton/classes/types.d.ts +0 -1
  88. package/components/mui_extended/IconButton/{index.383f5496.js → index.63a9d74c.js} +2 -5
  89. package/components/mui_extended/IconButton/types.d.ts +1 -1
  90. package/components/mui_extended/ImageButton/ImageButton.d.ts +1 -1
  91. package/components/mui_extended/MenuActions/{index.e6e3aac8.js → index.bca14ad9.js} +2 -2
  92. package/components/mui_extended/Pager/{index.5791276c.js → index.a024f67b.js} +1 -1
  93. package/components/mui_extended/ToggleButton/{index.4ac1f974.js → index.3f8bcf51.js} +1 -1
  94. package/components/mui_extended/ToggleIconButton/{index.8ca0114f.js → index.04375093.js} +1 -1
  95. package/contexts/ModalContext/{index.dde4e35a.js → index.e748f329.js} +1 -1
  96. package/hooks/index.d.ts +1 -0
  97. package/hooks/useFormAddEdit/{index.7fdad61d.js → index.649004a5.js} +2 -2
  98. package/hooks/useFormFocus/index.d.ts +7 -0
  99. package/hooks/useFormFocus/types.d.ts +8 -0
  100. package/hooks/useModal/{index.2f1d6a07.js → index.66a0c82e.js} +1 -1
  101. package/index.js +78 -77
  102. package/{node_modules.585eab0e.js → node_modules.4d80a09c.js} +1 -1
  103. package/package.json +1 -1
  104. package/{vendor.173d0b89.js → vendor.aa97e825.js} +79 -60
  105. package/components/Image/index.39b3b9d9.js +0 -387
  106. package/components/Image/subcomponents/BasicIntersectComponent/index.d.ts +0 -3
  107. package/components/Image/subcomponents/LazyLoadComponent/index.d.ts +0 -7
  108. package/components/Image/subcomponents/Skeleton/index.d.ts +0 -2
  109. package/components/Image/subcomponents/Skeleton/types.d.ts +0 -6
  110. package/components/Image/utils/classes/index.d.ts +0 -12
  111. package/components/Image/utils/isIntersectionObserverAvailable.d.ts +0 -1
  112. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/skeleton.d.ts +0 -1
  113. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +0 -2
  114. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/types.d.ts +0 -2
  115. package/components/hook-form/RHFPeriod/index.011965ef.js +0 -90
  116. package/components/CommonActions/components/Actions/{index.389f9b28.js → index.16946bfd.js} +11 -11
  117. /package/components/Image/{utils/classes → classes}/constant.d.ts +0 -0
@@ -1,387 +0,0 @@
1
- import { useBase, useModuleSkeleton, BaseProvider, useEnvironment, evaluateWithContext } from "@m4l/core";
2
- import { forwardRef, useState, useRef, useImperativeHandle, useEffect, useMemo } from "react";
3
- import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
4
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
5
- import { styled, Skeleton as Skeleton$1, generateUtilityClasses, generateUtilityClass } from "@mui/material";
6
- import { unstable_composeClasses } from "@mui/base";
7
- import clsx from "clsx";
8
- import { c as classes, g as getSize } from "../PrintingSystem/index.c2d21657.js";
9
- import { Q as QRCode } from "../../node_modules.585eab0e.js";
10
- function isIntersectionObserverAvailable() {
11
- return typeof window !== "undefined" && "IntersectionObserver" in window && "IntersectionObserverEntry" in window;
12
- }
13
- const IMAGE_PREFIX = "Image";
14
- const getNameDataTestId = (KEY) => {
15
- return `${IMAGE_PREFIX}-${KEY}`;
16
- };
17
- const checkIntersections = (entries) => {
18
- entries.forEach((entry) => {
19
- if (entry.isIntersecting) {
20
- entry.target?.setIsVisible(true);
21
- }
22
- });
23
- };
24
- const LAZY_LOAD_OBSERVERS = {};
25
- const getObserver = (threshold) => {
26
- LAZY_LOAD_OBSERVERS[threshold] = LAZY_LOAD_OBSERVERS[threshold] || new IntersectionObserver(checkIntersections, {
27
- rootMargin: threshold + "px"
28
- });
29
- return LAZY_LOAD_OBSERVERS[threshold];
30
- };
31
- const BasicIntersectComponent = forwardRef((props, ref) => {
32
- const {
33
- height,
34
- width,
35
- setIsVisible,
36
- threshold
37
- } = props;
38
- const {
39
- classes: classes2
40
- } = useBase();
41
- const [observer] = useState(getObserver(threshold));
42
- const intersectComponentRef = useRef(null);
43
- useImperativeHandle(ref, () => intersectComponentRef.current);
44
- useEffect(() => {
45
- if (observer && intersectComponentRef.current) {
46
- intersectComponentRef.current.setIsVisible = setIsVisible;
47
- observer.observe(intersectComponentRef.current);
48
- }
49
- return () => {
50
- if (observer && intersectComponentRef.current) {
51
- observer.unobserve(intersectComponentRef.current);
52
- }
53
- };
54
- }, []);
55
- const styleProp = {
56
- display: "inline-block"
57
- };
58
- if (typeof width !== "undefined") {
59
- styleProp.width = width;
60
- }
61
- if (typeof height !== "undefined") {
62
- styleProp.height = height;
63
- styleProp.minHeight = height;
64
- }
65
- return /* @__PURE__ */ jsx("span", {
66
- className: classes2.span,
67
- ref: intersectComponentRef,
68
- style: styleProp,
69
- ...process.env.NODE_ENV !== "production" ? {
70
- [TEST_PROP_ID]: getNameDataTestId("span")
71
- } : {}
72
- });
73
- });
74
- BasicIntersectComponent.displayName = "IntersectComponent";
75
- function LazyLoadComponent(props) {
76
- const {
77
- children,
78
- useIntersectionObserver,
79
- testingProps,
80
- ...other
81
- } = props;
82
- const [isVisible, setIsVisible] = useState(testingProps?.isVisible || !(useIntersectionObserver && isIntersectionObserverAvailable()));
83
- const {
84
- classes: classes2
85
- } = useBase();
86
- return /* @__PURE__ */ jsx("div", {
87
- className: classes2.lazyLoad,
88
- ...process.env.NODE_ENV !== "production" ? {
89
- [TEST_PROP_ID]: getNameDataTestId("lazyLoad")
90
- } : {},
91
- children: isVisible ? /* @__PURE__ */ jsx(Fragment, {
92
- children
93
- }) : /* @__PURE__ */ jsx(BasicIntersectComponent, {
94
- useIntersectionObserver,
95
- setIsVisible,
96
- ...other
97
- })
98
- });
99
- }
100
- const ImageRoot = styled("div")(({
101
- theme
102
- }) => ({
103
- ...theme.components?.M4LImage?.styleOverrides
104
- }));
105
- const WrapperSkeletonImage = styled("div")(() => ({
106
- mask: `url("data:image/svg+xml,%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 70 70' style='enable-background:new 0 0 70 70%3B' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M45 8.7c1.4-1.5 3.4-2.3 5.4-2.3s3.9 0.8 5.4 2.3s2.4 3.5 2.5 5.7c0 2.2-0.9 4.2-2.4 5.7s-3.5 2.3-5.5 2.2c-2.1 0.1-4-0.7-5.5-2.2c-1.4-1.5-2.3-3.5-2.4-5.7C42.6 12.2 43.5 10.2 45 8.7z'/%3E%3Cpath d='M68.4 62.1c-0.3 0.5-0.7 0.8-1.2 1.1s-1 0.4-1.6 0.4H4.3c-0.6 0-1.1-0.1-1.6-0.4s-0.9-0.6-1.2-1.1c-0.2-0.5-0.4-1-0.4-1.5s0.1-1.1 0.4-1.5l23-36.4c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l11.5 18.2c0.2 0.3 0.5 0.5 0.8 0.7c0.3 0.2 0.6 0.3 1 0.3c0.3 0 0.7-0.1 1-0.3c0.3-0.2 0.6-0.4 0.8-0.7l3.1-4.9c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l14.6 23.1c0.3 0.5 0.3 1 0.3 1.5S68.7 61.7 68.4 62.1z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain`,
107
- WebkitMask: `url("data:image/svg+xml,%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 70 70' style='enable-background:new 0 0 70 70%3B' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M45 8.7c1.4-1.5 3.4-2.3 5.4-2.3s3.9 0.8 5.4 2.3s2.4 3.5 2.5 5.7c0 2.2-0.9 4.2-2.4 5.7s-3.5 2.3-5.5 2.2c-2.1 0.1-4-0.7-5.5-2.2c-1.4-1.5-2.3-3.5-2.4-5.7C42.6 12.2 43.5 10.2 45 8.7z'/%3E%3Cpath d='M68.4 62.1c-0.3 0.5-0.7 0.8-1.2 1.1s-1 0.4-1.6 0.4H4.3c-0.6 0-1.1-0.1-1.6-0.4s-0.9-0.6-1.2-1.1c-0.2-0.5-0.4-1-0.4-1.5s0.1-1.1 0.4-1.5l23-36.4c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l11.5 18.2c0.2 0.3 0.5 0.5 0.8 0.7c0.3 0.2 0.6 0.3 1 0.3c0.3 0 0.7-0.1 1-0.3c0.3-0.2 0.6-0.4 0.8-0.7l3.1-4.9c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l14.6 23.1c0.3 0.5 0.3 1 0.3 1.5S68.7 61.7 68.4 62.1z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain`,
108
- height: "100%",
109
- width: "100%",
110
- display: "flex",
111
- alignItems: "center",
112
- justifyContent: "center"
113
- }));
114
- const Skeleton = (props) => {
115
- const {
116
- skeletonVariant,
117
- width,
118
- height
119
- } = props;
120
- const {
121
- classes: classes2
122
- } = useBase();
123
- return skeletonVariant === "image" ? /* @__PURE__ */ jsx(WrapperSkeletonImage, {
124
- className: classes2.skeletonImage,
125
- ...process.env.NODE_ENV !== "production" ? {
126
- [TEST_PROP_ID]: getNameDataTestId("skeletonImage")
127
- } : {},
128
- style: {
129
- width,
130
- height
131
- },
132
- children: /* @__PURE__ */ jsx(Skeleton$1, {
133
- variant: "rectangular",
134
- width: "100%",
135
- height: "100%"
136
- })
137
- }) : /* @__PURE__ */ jsx(Skeleton$1, {
138
- variant: "circular",
139
- width: "100%",
140
- height: "100%",
141
- className: classes2.skeletonCircle,
142
- ...process.env.NODE_ENV !== "production" ? {
143
- [TEST_PROP_ID]: getNameDataTestId("skeletonCircle")
144
- } : {}
145
- });
146
- };
147
- const componentName = "M4LImage";
148
- generateUtilityClasses(componentName, [
149
- "root",
150
- "lazyLoad",
151
- "img",
152
- "span",
153
- "skeletonImage",
154
- "skeletonCircle",
155
- "loaded"
156
- ]);
157
- function getImagenClassesUtilityClass(slot) {
158
- return generateUtilityClass(componentName, slot);
159
- }
160
- const useUtilityClasses = (ownerState) => {
161
- const slots = {
162
- root: ["root", ownerState.isImageLoaded == true && "loaded"],
163
- lazyLoad: ["lazyLoad"],
164
- img: ["img"],
165
- intersectComponent: ["intersectComponent"],
166
- skeletonImage: ["skeletonImage"],
167
- skeletonCircle: ["skeletonCircle"]
168
- };
169
- const composedClasses = unstable_composeClasses(slots, getImagenClassesUtilityClass, {});
170
- return {
171
- ...composedClasses
172
- };
173
- };
174
- const ratioOptions = {
175
- "1.168:1": {
176
- width: 1.168,
177
- height: 1
178
- },
179
- "16:9": {
180
- width: 16,
181
- height: 9
182
- },
183
- "1:1": {
184
- width: 1,
185
- height: 1
186
- },
187
- "1:1.168": {
188
- width: 1,
189
- height: 1.168
190
- },
191
- "2:1": {
192
- width: 2,
193
- height: 1
194
- },
195
- "2:3": {
196
- width: 2,
197
- height: 3
198
- },
199
- "3:1": {
200
- width: 3,
201
- height: 1
202
- },
203
- "3:2": {
204
- width: 3,
205
- height: 2
206
- },
207
- "3:4": {
208
- width: 3,
209
- height: 4
210
- },
211
- "4:3": {
212
- width: 4,
213
- height: 3
214
- },
215
- "5:2": {
216
- width: 5,
217
- height: 2
218
- }
219
- };
220
- const getRatioValues = (ratio) => {
221
- const numType = ratioOptions[ratio];
222
- const numRef = numType.width / numType.height;
223
- if (numRef >= 1) {
224
- return {
225
- width: "100%",
226
- height: `${Math.trunc(numRef * 100)}%`
227
- };
228
- } else {
229
- return {
230
- width: `${Math.trunc(numRef * 100)}%`,
231
- height: "100%"
232
- };
233
- }
234
- };
235
- function Image(props) {
236
- const {
237
- src,
238
- alt,
239
- useIntersectionObserver = true,
240
- threshold = 100,
241
- skeletonVariant = "image",
242
- testingProps,
243
- width,
244
- height,
245
- ratio = "1:1",
246
- className
247
- } = props;
248
- const ratioImage = getRatioValues(ratio);
249
- const isSKeleton = useModuleSkeleton();
250
- const [statusLoad, setStatusLoad] = useState(testingProps?.statusLoad || "initial");
251
- useEffect(() => {
252
- let timer;
253
- if (statusLoad === "loaded" && !isSKeleton) {
254
- timer = setTimeout(() => {
255
- setStatusLoad("removed");
256
- }, 3e3);
257
- }
258
- return () => {
259
- if (timer) {
260
- clearTimeout(timer);
261
- }
262
- };
263
- }, [statusLoad, isSKeleton]);
264
- const onLoad = () => {
265
- setStatusLoad("loaded");
266
- };
267
- const isImageLoaded = !isSKeleton && statusLoad !== "initial";
268
- const ownerState = {
269
- isImageLoaded
270
- };
271
- const classes2 = useUtilityClasses(ownerState);
272
- const lazyLoadComponent = useMemo(() => {
273
- return /* @__PURE__ */ jsx(ImageRoot, {
274
- className: clsx(classes2.root, className),
275
- ...process.env.NODE_ENV !== "production" ? {
276
- [TEST_PROP_ID]: getNameDataTestId("root")
277
- } : {},
278
- style: width && height ? {
279
- minWidth: width,
280
- minHeight: height,
281
- width,
282
- height
283
- } : {
284
- width: "100%",
285
- height: "100%"
286
- },
287
- children: /* @__PURE__ */ jsxs(LazyLoadComponent, {
288
- width: "100%",
289
- height: "100%",
290
- useIntersectionObserver,
291
- threshold,
292
- testingProps,
293
- children: [statusLoad !== "removed" ? /* @__PURE__ */ jsx(Skeleton, {
294
- skeletonVariant,
295
- width: !width ? "100%" : ratioImage.width,
296
- height: !height ? "100%" : ratioImage.height
297
- }) : null, /* @__PURE__ */ jsx("img", {
298
- alt,
299
- src,
300
- onLoad,
301
- className: classes2.img,
302
- width: !width ? "100%" : ratioImage.width,
303
- height: !height ? "100%" : ratioImage.height,
304
- ...process.env.NODE_ENV !== "production" ? {
305
- [TEST_PROP_ID]: getNameDataTestId("img")
306
- } : {}
307
- })]
308
- })
309
- });
310
- }, [statusLoad, isSKeleton, src]);
311
- return /* @__PURE__ */ jsx(BaseProvider, {
312
- value: {
313
- classes: classes2
314
- },
315
- children: lazyLoadComponent
316
- });
317
- }
318
- const ImageNode = (props) => {
319
- const {
320
- className,
321
- style,
322
- src,
323
- width = "100%",
324
- height = "100%"
325
- } = props;
326
- const {
327
- unitSize,
328
- sourceData
329
- } = useBase();
330
- const {
331
- host_static_assets,
332
- environment_assets
333
- } = useEnvironment();
334
- const resourceImg = evaluateWithContext(sourceData, src);
335
- return /* @__PURE__ */ jsx("img", {
336
- src: `${host_static_assets}/${environment_assets}/${resourceImg}`,
337
- className: clsx(classes.imageNodeRoot, className),
338
- style: {
339
- width: getSize(width, unitSize),
340
- height: getSize(height, unitSize),
341
- ...style
342
- }
343
- });
344
- };
345
- const convertToPx = (size, magnitud) => {
346
- if (isNaN(size)) {
347
- return 0;
348
- }
349
- if (magnitud === "px") {
350
- return size;
351
- }
352
- switch (magnitud) {
353
- case "cm":
354
- return size * 37.8;
355
- case "mm":
356
- return size * 3.78;
357
- case "in":
358
- return size * 96;
359
- case "pt":
360
- return size * 1.33;
361
- case "pc":
362
- return size * 16;
363
- default:
364
- return 100;
365
- }
366
- };
367
- const QRImageNode = (props) => {
368
- const {
369
- url,
370
- size = 8,
371
- color
372
- } = props;
373
- const {
374
- unitSize
375
- } = useBase();
376
- return /* @__PURE__ */ jsx(QRCode, {
377
- value: url,
378
- size: convertToPx(size, unitSize),
379
- fgColor: color,
380
- renderAs: "canvas"
381
- });
382
- };
383
- export {
384
- Image as I,
385
- QRImageNode as Q,
386
- ImageNode as a
387
- };
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { IntersectComponentProps } from '../../types';
3
- export declare const BasicIntersectComponent: import("react").ForwardRefExoticComponent<IntersectComponentProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -1,7 +0,0 @@
1
- import { LazyLoadComponentProps } from '../../types';
2
- /**
3
- * Sub-componente encargado de validar y condicionar la funcionalidad del intersection observer.
4
- * @param props
5
- * @returns
6
- */
7
- export declare function LazyLoadComponent(props: LazyLoadComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { SkeletonProps } from './types';
2
- export declare const Skeleton: (props: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { SkeletonVariant } from '../../types';
2
- export interface SkeletonProps {
3
- skeletonVariant: SkeletonVariant;
4
- width: string;
5
- height: string;
6
- }
@@ -1,12 +0,0 @@
1
- import { ImageClassesType } from './types';
2
- import { OwnerState } from '../../types';
3
- export declare const imageClasses: ImageClassesType;
4
- export declare function getImagenClassesUtilityClass(slot: string): string;
5
- export declare const useUtilityClasses: (ownerState: OwnerState) => {
6
- img: string;
7
- root: string;
8
- lazyLoad: string;
9
- intersectComponent: string;
10
- skeletonImage: string;
11
- skeletonCircle: string;
12
- };
@@ -1 +0,0 @@
1
- export declare function isIntersectionObserverAvailable(): boolean;
@@ -1 +0,0 @@
1
- export declare function SKTModuleHeader(): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { WindowPopUpsListProps } from './types';
2
- export declare const WindowPopUpsList: (props: WindowPopUpsListProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +0,0 @@
1
- import { HeaderProps } from "../../types";
2
- export declare type WindowPopUpsListProps = Pick<HeaderProps, 'windowId' | 'areaId'>;
@@ -1,90 +0,0 @@
1
- import { styled, generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
- import { useFormContext, Controller } from "react-hook-form";
3
- import { H as HelperText } from "../../HelperText/index.7d2afdb3.js";
4
- import { unstable_composeClasses } from "@mui/base";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import { F as FieldLabel } from "../../FieldLabel/index.1da2a28d.js";
7
- import { P as Period } from "../../Period/index.6e8d92dc.js";
8
- const RHFPeriodRoot = styled("div")(({
9
- theme
10
- }) => ({
11
- width: "100%",
12
- display: "flex",
13
- flexDirection: "column",
14
- justifyContent: "center",
15
- alignItems: "flex-start",
16
- gap: theme.spacing(1),
17
- ...theme.components?.M4LRHFPeriod?.styleOverrides
18
- }));
19
- const componentName = "M4LRHFPeriod";
20
- generateUtilityClasses(componentName, [
21
- "root"
22
- ]);
23
- function getRHFPeriodUtilityClass(slot) {
24
- return generateUtilityClass(componentName, slot);
25
- }
26
- const RHFPeriodUtilityClasses = () => {
27
- const slots = {
28
- root: ["root"]
29
- };
30
- const composedClasses = unstable_composeClasses(slots, getRHFPeriodUtilityClass, {});
31
- return {
32
- ...composedClasses
33
- };
34
- };
35
- const RHFPeriod = (props) => {
36
- const {
37
- name,
38
- readOnly,
39
- skeletonWidth,
40
- skeletonHeight,
41
- state,
42
- label,
43
- mandatory,
44
- mandatoryMessage,
45
- helperMessage,
46
- size
47
- } = props;
48
- const {
49
- control
50
- } = useFormContext();
51
- const classes = RHFPeriodUtilityClasses();
52
- return /* @__PURE__ */ jsx(Controller, {
53
- name,
54
- control,
55
- render: ({
56
- field: {
57
- onChange,
58
- value
59
- },
60
- fieldState: {
61
- error
62
- }
63
- }) => {
64
- console.log("value RHFPeriod", value);
65
- return /* @__PURE__ */ jsxs(RHFPeriodRoot, {
66
- className: classes.root,
67
- children: [label && /* @__PURE__ */ jsx(FieldLabel, {
68
- label,
69
- mandatory,
70
- mandatoryMessage,
71
- helperMessage
72
- }), /* @__PURE__ */ jsx(Period, {
73
- value,
74
- onChange,
75
- state: !!error === true ? "error" : state,
76
- readOnly,
77
- skeletonWidth,
78
- skeletonHeight,
79
- size
80
- }), error && /* @__PURE__ */ jsx(HelperText, {
81
- variant: "error",
82
- message: error.message || ""
83
- })]
84
- });
85
- }
86
- });
87
- };
88
- export {
89
- RHFPeriod as R
90
- };
@@ -3,6 +3,17 @@ import { generateUtilityClasses, styled } from "@mui/material";
3
3
  import { unstable_composeClasses } from "@mui/base";
4
4
  import { g as getComponentUtilityClass } from "../../../../utils/index.de903261.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
+ function getCommonActionsDictionary() {
7
+ return ["common_actions"];
8
+ }
9
+ const defaultCommonActionsDictionary = {
10
+ common_actions: {
11
+ cancel: "Cancel",
12
+ intro: "Intro",
13
+ confirm_quit_title: "Confirm",
14
+ confirm_quit_msg: "Are your sure exit?"
15
+ }
16
+ };
6
17
  const componentName = "M4LCommonActions";
7
18
  generateUtilityClasses(componentName, [
8
19
  "root",
@@ -54,17 +65,6 @@ const Actions = (props) => {
54
65
  children
55
66
  });
56
67
  };
57
- function getCommonActionsDictionary() {
58
- return ["common_actions"];
59
- }
60
- const defaultCommonActionsDictionary = {
61
- common_actions: {
62
- cancel: "Cancel",
63
- intro: "Intro",
64
- confirm_quit_title: "Confirm",
65
- confirm_quit_msg: "Are your sure exit?"
66
- }
67
- };
68
68
  export {
69
69
  Actions as A,
70
70
  defaultCommonActionsDictionary as d,