@m4l/components 0.2.15 → 0.2.16

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 (133) hide show
  1. package/@types/export.d.ts +16 -4
  2. package/{commonjs.565e6834.js → commonjs.333e55c7.js} +5 -0
  3. package/components/AccountPopover/{index.da84c424.js → index.34362031.js} +2 -4
  4. package/components/AccountPopover/index.d.ts +1 -0
  5. package/components/AppBar/AppBar.d.ts +24 -0
  6. package/components/AppBar/classes/index.d.ts +2 -0
  7. package/components/AppBar/classes/types.d.ts +2 -0
  8. package/components/AppBar/{index.46f2db0a.js → index.c64b66ee.js} +26 -5
  9. package/components/AppBar/types.d.ts +14 -0
  10. package/components/CommonActions/components/ActionCancel/{index.06365996.js → index.106c5327.js} +1 -1
  11. package/components/CommonActions/components/ActionFormCancel/{index.2c1fff45.js → index.6d00f737.js} +4 -13
  12. package/components/CommonActions/components/ActionFormIntro/{index.885f49af.js → index.9ee7df17.js} +1 -1
  13. package/components/CommonActions/components/ActionIntro/{index.b97cfeec.js → index.bd2a14b2.js} +1 -1
  14. package/components/DataGrid/formatters/columnPointsFormatter/{index.5e645334.js → index.a19b7b90.js} +1 -1
  15. package/components/DataGrid/{index.e127cac8.js → index.e5b552a2.js} +7 -7
  16. package/components/DataGrid/subcomponents/Actions/{index.5947f820.js → index.2f58e034.js} +8 -8
  17. package/components/DragResizeWindow/{index.67aa1e22.js → index.b5206081.js} +4 -4
  18. package/components/DynamicFilter/classes/index.d.ts +1 -1
  19. package/components/DynamicFilter/classes/types.d.ts +1 -0
  20. package/components/DynamicFilter/{index.068ca09c.js → index.73258cb8.js} +14 -10
  21. package/components/GridLayout/{index.367e44f9.js → index.4d26c328.js} +2 -2
  22. package/components/GridLayout/subcomponents/Griditem/{index.b3c79b77.js → index.25e9f332.js} +3 -3
  23. package/components/GridLayout/subcomponents/Responsive/{index.4234d9f3.js → index.3839890b.js} +1 -1
  24. package/components/GridLayout/subcomponents/SizeProvider/{index.0676f896.js → index.a751962f.js} +1 -1
  25. package/components/Icon/index.282c5b58.js +248 -0
  26. package/components/Icon/types.d.ts +1 -0
  27. package/components/Image/{index.d5fed0ab.js → index.8915f577.js} +46 -4
  28. package/components/Image/types.d.ts +2 -2
  29. package/components/LanguagePopover/{index.02987c68.js → index.5e1d85a9.js} +2 -2
  30. package/components/LoadingError/{index.991393ca.js → index.d95e6efb.js} +2 -2
  31. package/components/MFLoader/{index.b928e361.js → index.cc563716.js} +1 -1
  32. package/components/ModalDialog/{index.a30831c9.js → index.690c82a4.js} +3 -3
  33. package/components/NoItemSelected/{index.1ddc6a38.js → index.5246b204.js} +1 -1
  34. package/components/ObjectLogs/{index.546bf5bf.js → index.f2b5f7d9.js} +7 -7
  35. package/components/PDFViewer/PDFViewer.d.ts +2 -0
  36. package/components/PDFViewer/classes/constants.d.ts +1 -0
  37. package/components/PDFViewer/classes/index.d.ts +7 -0
  38. package/components/PDFViewer/classes/types.d.ts +7 -0
  39. package/components/PDFViewer/index.51e4f1b2.js +63 -0
  40. package/components/PDFViewer/index.d.ts +1 -0
  41. package/components/PDFViewer/types.d.ts +3 -0
  42. package/components/Page/{index.c3767243.js → index.f4aedd2d.js} +1 -1
  43. package/components/PaperForm/{index.27dafbcc.js → index.30f68f0f.js} +1 -1
  44. package/components/Period/{index.288a0ec2.js → index.8e118051.js} +1 -1
  45. package/components/PopupsProvider/{index.ae1bd010.js → index.c9400f03.js} +1 -1
  46. package/components/PrintingSystem/{index.b69edc07.js → index.9dc25af9.js} +14 -42
  47. package/components/PrintingSystem/subcomponents/BodyNode/{index.81da2c9c.js → index.6c1cf8f5.js} +1 -1
  48. package/components/PrintingSystem/subcomponents/ChartNode/{index.1863bcf1.js → index.fdb01c74.js} +4 -4
  49. package/components/PrintingSystem/subcomponents/DividerNode/{index.0e6e76ad.js → index.46c5eb9e.js} +1 -1
  50. package/components/PrintingSystem/subcomponents/FooterNode/{index.5af68fd5.js → index.18aa1ddd.js} +1 -1
  51. package/components/PrintingSystem/subcomponents/GridNode/{index.07d4f9a4.js → index.f4b4ffca.js} +4 -4
  52. package/components/PrintingSystem/subcomponents/HeaderNode/{index.dbf08ab4.js → index.9afcd686.js} +1 -1
  53. package/components/PrintingSystem/subcomponents/PaperNode/{index.d81d2f30.js → index.a3967d23.js} +4 -4
  54. package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.4c20215d.js → index.e1c05641.js} +1 -1
  55. package/components/PrintingSystem/subcomponents/QRImageNode/index.d.ts +2 -0
  56. package/components/PrintingSystem/subcomponents/QRImageNode/types.d.ts +3 -0
  57. package/components/PrintingSystem/subcomponents/SectionNode/{index.72cb64b8.js → index.c5588090.js} +1 -1
  58. package/components/PrintingSystem/subcomponents/TextBoxNode/{index.41c261f4.js → index.7792384b.js} +3 -3
  59. package/components/PrintingSystem/types.d.ts +10 -1
  60. package/components/PropertyValue/classes/index.d.ts +1 -1
  61. package/components/PropertyValue/classes/types.d.ts +4 -1
  62. package/components/PropertyValue/index.d61c943c.js +206 -0
  63. package/components/PropertyValue/types.d.ts +5 -7
  64. package/components/Resizeable/{index.e4f47710.js → index.18c86aff.js} +1 -1
  65. package/components/ScrollBar/{index.65bb2930.js → index.010f1b9d.js} +5 -1
  66. package/components/SideBar/classes/index.d.ts +1 -1
  67. package/components/SideBar/{index.e4d2ee53.js → index.f5aecd41.js} +11 -11
  68. package/components/SideBar/types.d.ts +3 -3
  69. package/components/SplitLayout/{index.9ef430f6.js → index.30fd5861.js} +1 -1
  70. package/components/ToastContainer/ToastContainer.d.ts +2 -0
  71. package/components/ToastContainer/classes/constants.d.ts +1 -0
  72. package/components/ToastContainer/classes/index.d.ts +8 -0
  73. package/components/ToastContainer/classes/types.d.ts +9 -0
  74. package/components/ToastContainer/index.83304f62.js +87 -0
  75. package/components/ToastContainer/index.d.ts +2 -0
  76. package/components/ToastContainer/subcomponents/ToastMessage/index.d.ts +2 -0
  77. package/components/ToastContainer/subcomponents/ToastMessage/types.d.ts +5 -0
  78. package/components/ToastContainer/types.d.ts +4 -0
  79. package/components/areas/components/AreasAdmin/{index.8426755c.js → index.c55d5c24.js} +10 -10
  80. package/components/areas/components/AreasViewer/{index.6b310068.js → index.2bec316e.js} +12 -12
  81. package/components/areas/contexts/AreasContext/{index.1e3974e1.js → index.827ee1e5.js} +4 -4
  82. package/components/areas/hooks/useAreas/{index.21fa4ab1.js → index.71bc8f19.js} +1 -1
  83. package/components/formatters/BooleanFormatter/{index.fcc47dfd.js → index.b21353a5.js} +2 -2
  84. package/components/formatters/PointsFormatter/{index.80a4e414.js → index.5c94c5e8.js} +2 -2
  85. package/components/formatters/PointsFormatter/index.d.ts +1 -1
  86. package/components/formatters/{index.7d5cbac9.js → index.7b216229.js} +1 -1
  87. package/components/hook-form/RHFAutocomplete/classes/types.d.ts +2 -0
  88. package/components/hook-form/RHFAutocomplete/{index.ea720b8f.js → index.210ee73f.js} +26 -35
  89. package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/index.d.ts +1 -1
  90. package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/types.d.ts +1 -2
  91. package/components/hook-form/RHFAutocomplete/types.d.ts +8 -3
  92. package/components/hook-form/RHFAutocompleteAsync/{index.1609eaf0.js → index.e5935f63.js} +1 -1
  93. package/components/hook-form/RHFColorPicker/classes/constants.d.ts +1 -0
  94. package/components/hook-form/RHFColorPicker/classes/index.d.ts +11 -0
  95. package/components/hook-form/RHFColorPicker/classes/types.d.ts +11 -0
  96. package/components/hook-form/RHFColorPicker/index.bcc1eced.js +150 -0
  97. package/components/hook-form/RHFColorPicker/index.d.ts +6 -0
  98. package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/indext.d.ts +1 -0
  99. package/components/hook-form/RHFColorPicker/types.d.ts +5 -0
  100. package/components/hook-form/RHFDateTime/{index.8bd9e41e.js → index.fa80a8cb.js} +1 -1
  101. package/components/hook-form/RHFDateTime/types.d.ts +0 -1
  102. package/components/hook-form/RHFPeriod/{index.89bebd60.js → index.d320e56f.js} +1 -1
  103. package/components/hook-form/RHFTextField/{index.2c8d4613.js → index.ab689d7d.js} +1 -1
  104. package/components/hook-form/RHFUpload/{index.55e495bb.js → index.e251c9b6.js} +4 -4
  105. package/components/index.d.ts +2 -0
  106. package/components/maps/components/GpsTools/{index.1b6d82bc.js → index.03998a42.js} +14 -14
  107. package/components/maps/components/Map/{index.f38df83e.js → index.b79ceae4.js} +3 -3
  108. package/components/modal/{WindowBase.a4534b0b.js → WindowBase.779aa7a5.js} +3 -3
  109. package/components/modal/{WindowConfirm.7a79bfa5.js → WindowConfirm.ec73ba4f.js} +5 -5
  110. package/components/mui_extended/Accordion/{index.f1289de0.js → index.e15e10d9.js} +2 -2
  111. package/components/mui_extended/Button/classes/types.d.ts +2 -0
  112. package/components/mui_extended/Button/{index.007f5a6e.js → index.5c68764a.js} +3 -3
  113. package/components/mui_extended/IconButton/{index.b705c196.js → index.a719445f.js} +1 -1
  114. package/components/mui_extended/LoadingButton/classes/constants.d.ts +1 -1
  115. package/components/mui_extended/MenuActions/{index.aa43c4f2.js → index.62359120.js} +2 -2
  116. package/components/mui_extended/Pager/{index.9928807e.js → index.fa5f5ded.js} +1 -1
  117. package/components/mui_extended/ToggleButton/{index.b053aa70.js → index.5aa6ea58.js} +1 -1
  118. package/components/mui_extended/ToggleIconButton/{index.80d38bf4.js → index.47ddefd4.js} +1 -1
  119. package/contexts/ModalContext/{index.054af5d8.js → index.6085b148.js} +1 -1
  120. package/hooks/useFormAddEdit/{index.b4348b6a.js → index.59821a33.js} +2 -2
  121. package/hooks/useModal/{index.acc61361.js → index.1c88654a.js} +1 -1
  122. package/index.js +95 -80
  123. package/node_modules.bb836860.js +6921 -0
  124. package/package.json +5 -1
  125. package/{react-draggable.2bc0e647.js → react-draggable.312ab17d.js} +3 -3
  126. package/{react-json-view.57125fcf.js → react-json-view.5636414a.js} +1 -1
  127. package/{react-resizable.53094455.js → react-resizable.f2c58a4c.js} +4 -4
  128. package/{react-splitter-layout.8b1655c8.js → react-splitter-layout.c5d98bf7.js} +3 -3
  129. package/components/Icon/index.aa9949f0.js +0 -147
  130. package/components/PrintingSystem/utils/getEvalValue/index.d.ts +0 -1
  131. package/components/PropertyValue/index.92ccdf7a.js +0 -220
  132. package/components/PropertyValue/skeleton.d.ts +0 -2
  133. package/components/hook-form/RHFColorPicker/index.259b6f38.js +0 -61
@@ -0,0 +1,248 @@
1
+ import React__default, { useState, useEffect } from "react";
2
+ import { useEnvironment } from "@m4l/core";
3
+ import { styled, generateUtilityClasses, generateUtilityClass, Skeleton } from "@mui/material";
4
+ import { u as useSideBar, g as getNameDataTestId$1 } from "../SideBar/index.f5aecd41.js";
5
+ import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { unstable_composeClasses } from "@mui/base";
8
+ import clsx from "clsx";
9
+ import { useResponsiveDesktop } from "@m4l/graphics";
10
+ const IconRoot = styled("div")(({
11
+ theme
12
+ }) => ({
13
+ ...theme.components?.M4LIcon?.styleOverrides
14
+ }));
15
+ const DivIcon = styled("div", {
16
+ shouldForwardProp: (props) => props !== "src" && props !== "rotationAngle"
17
+ })(({
18
+ src,
19
+ rotationAngle
20
+ }) => ({
21
+ maskPosition: "center",
22
+ maskRepeat: "no-repeat",
23
+ maskSize: "cover",
24
+ WebkitMaskRepeat: "no-repeat",
25
+ mask: `url('data:image/svg+xml;base64,${src}')`,
26
+ WebkitMask: `url('data:image/svg+xml;base64,${src}')`,
27
+ WebkitMaskSize: "cover",
28
+ ...rotationAngle && {
29
+ transform: `rotate(${rotationAngle}deg)`
30
+ }
31
+ }));
32
+ const componentName = "M4LIcon";
33
+ generateUtilityClasses(componentName, [
34
+ "root",
35
+ "icon",
36
+ "variantSkeleton",
37
+ "sizeExtraSmall",
38
+ "sizeSmall",
39
+ "sizeMedium",
40
+ "sizeLarge",
41
+ "sizeExtraLarge",
42
+ "rotationAngle"
43
+ ]);
44
+ function getIconClassesUtilityClass(slot) {
45
+ return generateUtilityClass(componentName, slot);
46
+ }
47
+ const useUtilityClasses = (ownerState) => {
48
+ const slots = {
49
+ root: ["root"],
50
+ icon: ["icon", ownerState.size === "extraSmall" && "sizeExtraSmall", ownerState.size === "small" && "sizeSmall", ownerState.size === "medium" && "sizeMedium", ownerState.size === "large" && "sizeLarge", ownerState.size === "extraLarge" && "sizeExtraLarge", ownerState.rotationAngle ? "rotationAngle" : ""],
51
+ variantSkeleton: ["variantSkeleton", ownerState.size === "extraSmall" && "sizeExtraSmall", ownerState.size === "small" && "sizeSmall", ownerState.size === "medium" && "sizeMedium", ownerState.size === "large" && "sizeLarge", ownerState.size === "extraLarge" && "sizeExtraLarge"]
52
+ };
53
+ const composedClasses = unstable_composeClasses(slots, getIconClassesUtilityClass, {});
54
+ return {
55
+ ...composedClasses
56
+ };
57
+ };
58
+ const ICON_PREFIX = "Icon";
59
+ const getNameDataTestId = (KEY) => {
60
+ return `${ICON_PREFIX}-${KEY}`;
61
+ };
62
+ function Icon(props) {
63
+ const {
64
+ src,
65
+ size = "small",
66
+ rotationAngle,
67
+ testingProps,
68
+ className,
69
+ memorizeResource = true
70
+ } = props;
71
+ const [resource, setResource] = useState(testingProps?.resource || void 0);
72
+ const isDesktop = useResponsiveDesktop();
73
+ if (memorizeResource) {
74
+ useEffect(() => {
75
+ let mounted = true;
76
+ (async function networkOperation() {
77
+ await fetch(src).then((response) => {
78
+ return response.text() || "";
79
+ }).then((xml) => {
80
+ xml = xml.match(
81
+ /(<svg\b[^>]*\s*(viewBox="(\b[^"]*)").*?>([\s\S]*?)<\/svg>|<svg>([\s\S]*?)<\/svg>)/g
82
+ )?.toString() || "";
83
+ if (mounted) {
84
+ setResource(window.btoa(xml));
85
+ }
86
+ }).catch((_err) => {
87
+ });
88
+ })();
89
+ return function clenUp() {
90
+ mounted = false;
91
+ };
92
+ }, [src]);
93
+ }
94
+ const ownerState = {
95
+ size: isDesktop ? size : "medium",
96
+ rotationAngle
97
+ };
98
+ const classes = useUtilityClasses(ownerState);
99
+ if (!memorizeResource) {
100
+ return /* @__PURE__ */ jsx(IconRoot, {
101
+ className: clsx(classes.root, className),
102
+ children: /* @__PURE__ */ jsx("img", {
103
+ src,
104
+ alt: src,
105
+ className: ""
106
+ })
107
+ });
108
+ }
109
+ return /* @__PURE__ */ jsx(IconRoot, {
110
+ className: clsx(classes.root, className),
111
+ ...process.env.NODE_ENV !== "production" ? {
112
+ [TEST_PROP_ID]: getNameDataTestId("root")
113
+ } : {},
114
+ children: resource ? /* @__PURE__ */ jsx(DivIcon, {
115
+ className: classes.icon,
116
+ src: resource,
117
+ rotationAngle,
118
+ ...process.env.NODE_ENV !== "production" ? {
119
+ [TEST_PROP_ID]: getNameDataTestId("icon")
120
+ } : {}
121
+ }) : /* @__PURE__ */ jsx(Skeleton, {
122
+ variant: "rectangular",
123
+ className: classes.variantSkeleton,
124
+ ...process.env.NODE_ENV !== "production" ? {
125
+ [TEST_PROP_ID]: getNameDataTestId("variantSkeleton")
126
+ } : {}
127
+ })
128
+ });
129
+ }
130
+ var UnfoldMoreHorizontalIcon = {};
131
+ Object.defineProperty(UnfoldMoreHorizontalIcon, "__esModule", {
132
+ value: true
133
+ });
134
+ var _extends$1 = Object.assign || function(target) {
135
+ for (var i = 1; i < arguments.length; i++) {
136
+ var source = arguments[i];
137
+ for (var key in source) {
138
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
139
+ target[key] = source[key];
140
+ }
141
+ }
142
+ }
143
+ return target;
144
+ };
145
+ var _react$1 = React__default;
146
+ var _react2$1 = _interopRequireDefault$1(_react$1);
147
+ function _interopRequireDefault$1(obj) {
148
+ return obj && obj.__esModule ? obj : { default: obj };
149
+ }
150
+ function _objectWithoutProperties$1(obj, keys) {
151
+ var target = {};
152
+ for (var i in obj) {
153
+ if (keys.indexOf(i) >= 0)
154
+ continue;
155
+ if (!Object.prototype.hasOwnProperty.call(obj, i))
156
+ continue;
157
+ target[i] = obj[i];
158
+ }
159
+ return target;
160
+ }
161
+ var DEFAULT_SIZE$1 = 24;
162
+ var _default$1 = UnfoldMoreHorizontalIcon.default = function(_ref) {
163
+ var _ref$fill = _ref.fill, fill = _ref$fill === void 0 ? "currentColor" : _ref$fill, _ref$width = _ref.width, width = _ref$width === void 0 ? DEFAULT_SIZE$1 : _ref$width, _ref$height = _ref.height, height = _ref$height === void 0 ? DEFAULT_SIZE$1 : _ref$height, _ref$style = _ref.style, style = _ref$style === void 0 ? {} : _ref$style, props = _objectWithoutProperties$1(_ref, ["fill", "width", "height", "style"]);
164
+ return _react2$1.default.createElement(
165
+ "svg",
166
+ _extends$1({
167
+ viewBox: "0 0 " + DEFAULT_SIZE$1 + " " + DEFAULT_SIZE$1,
168
+ style: _extends$1({ fill, width, height }, style)
169
+ }, props),
170
+ _react2$1.default.createElement("path", { d: "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z" })
171
+ );
172
+ };
173
+ var CheckIcon = {};
174
+ Object.defineProperty(CheckIcon, "__esModule", {
175
+ value: true
176
+ });
177
+ var _extends = Object.assign || function(target) {
178
+ for (var i = 1; i < arguments.length; i++) {
179
+ var source = arguments[i];
180
+ for (var key in source) {
181
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
182
+ target[key] = source[key];
183
+ }
184
+ }
185
+ }
186
+ return target;
187
+ };
188
+ var _react = React__default;
189
+ var _react2 = _interopRequireDefault(_react);
190
+ function _interopRequireDefault(obj) {
191
+ return obj && obj.__esModule ? obj : { default: obj };
192
+ }
193
+ function _objectWithoutProperties(obj, keys) {
194
+ var target = {};
195
+ for (var i in obj) {
196
+ if (keys.indexOf(i) >= 0)
197
+ continue;
198
+ if (!Object.prototype.hasOwnProperty.call(obj, i))
199
+ continue;
200
+ target[i] = obj[i];
201
+ }
202
+ return target;
203
+ }
204
+ var DEFAULT_SIZE = 24;
205
+ var _default = CheckIcon.default = function(_ref) {
206
+ var _ref$fill = _ref.fill, fill = _ref$fill === void 0 ? "currentColor" : _ref$fill, _ref$width = _ref.width, width = _ref$width === void 0 ? DEFAULT_SIZE : _ref$width, _ref$height = _ref.height, height = _ref$height === void 0 ? DEFAULT_SIZE : _ref$height, _ref$style = _ref.style, style = _ref$style === void 0 ? {} : _ref$style, props = _objectWithoutProperties(_ref, ["fill", "width", "height", "style"]);
207
+ return _react2.default.createElement(
208
+ "svg",
209
+ _extends({
210
+ viewBox: "0 0 " + DEFAULT_SIZE + " " + DEFAULT_SIZE,
211
+ style: _extends({ fill, width, height }, style)
212
+ }, props),
213
+ _react2.default.createElement("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
214
+ );
215
+ };
216
+ const ArrowIconRoot = styled("div")(() => ({
217
+ display: "flex",
218
+ alignSelf: "center",
219
+ lineHeight: 0
220
+ }));
221
+ function ArrowIcon(props) {
222
+ const {
223
+ openState
224
+ } = props;
225
+ const {
226
+ host_static_assets,
227
+ environment_assets
228
+ } = useEnvironment();
229
+ const {
230
+ classes
231
+ } = useSideBar();
232
+ return /* @__PURE__ */ jsx(ArrowIconRoot, {
233
+ className: classes.arrowIconRoot,
234
+ ...process.env.NODE_ENV !== "production" ? {
235
+ [TEST_PROP_ID]: getNameDataTestId$1("arrowIconRoot")
236
+ } : {},
237
+ children: /* @__PURE__ */ jsx(Icon, {
238
+ src: `${host_static_assets}/${environment_assets}/frontend/components/sidebar/assets/icons/ChevronRight.svg`,
239
+ rotationAngle: openState ? 90 : 0
240
+ })
241
+ });
242
+ }
243
+ export {
244
+ ArrowIcon as A,
245
+ Icon as I,
246
+ _default$1 as _,
247
+ _default as a
248
+ };
@@ -8,6 +8,7 @@ export interface IconProps {
8
8
  rotationAngle?: number;
9
9
  testingProps?: TestingProps;
10
10
  className?: string;
11
+ memorizeResource?: boolean;
11
12
  }
12
13
  export declare type DivIconProps = Pick<IconProps, 'src' | 'rotationAngle'>;
13
14
  export declare type WrapperPlaceHolderProps = {
@@ -1,11 +1,12 @@
1
- import { useBase, useModuleSkeleton, BaseProvider, useEnvironment } from "@m4l/core";
1
+ import { useBase, useModuleSkeleton, BaseProvider, useEnvironment, evaluateWithContext } from "@m4l/core";
2
2
  import { forwardRef, useState, useRef, useImperativeHandle, useEffect, useMemo } from "react";
3
3
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
4
4
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
5
5
  import { styled, Skeleton as Skeleton$1, generateUtilityClasses, generateUtilityClass } from "@mui/material";
6
6
  import { unstable_composeClasses } from "@mui/base";
7
7
  import clsx from "clsx";
8
- import { g as getEvalValue, c as classes, a as getSize } from "../PrintingSystem/index.b69edc07.js";
8
+ import { c as classes, g as getSize } from "../PrintingSystem/index.9dc25af9.js";
9
+ import { Q as QRCode } from "../../node_modules.bb836860.js";
9
10
  function isIntersectionObserverAvailable() {
10
11
  return typeof window !== "undefined" && "IntersectionObserver" in window && "IntersectionObserverEntry" in window;
11
12
  }
@@ -278,7 +279,9 @@ function Image(props) {
278
279
  ...width && height ? {
279
280
  style: {
280
281
  minWidth: width,
281
- minHeight: height
282
+ minHeight: height,
283
+ width,
284
+ height
282
285
  }
283
286
  } : {
284
287
  sx: {
@@ -333,7 +336,7 @@ const ImageNode = (props) => {
333
336
  host_static_assets,
334
337
  environment_assets
335
338
  } = useEnvironment();
336
- const resourceImg = getEvalValue(sourceData, src);
339
+ const resourceImg = evaluateWithContext(sourceData, src);
337
340
  return /* @__PURE__ */ jsx("img", {
338
341
  src: `${host_static_assets}/${environment_assets}/${resourceImg}`,
339
342
  className: clsx(classes.imageNodeRoot, className),
@@ -344,7 +347,46 @@ const ImageNode = (props) => {
344
347
  }
345
348
  });
346
349
  };
350
+ const convertToPx = (size, magnitud) => {
351
+ if (isNaN(size)) {
352
+ return 0;
353
+ }
354
+ if (magnitud === "px") {
355
+ return size;
356
+ }
357
+ switch (magnitud) {
358
+ case "cm":
359
+ return size * 37.8;
360
+ case "mm":
361
+ return size * 3.78;
362
+ case "in":
363
+ return size * 96;
364
+ case "pt":
365
+ return size * 1.33;
366
+ case "pc":
367
+ return size * 16;
368
+ default:
369
+ return 100;
370
+ }
371
+ };
372
+ const QRImageNode = (props) => {
373
+ const {
374
+ url,
375
+ size = 8,
376
+ color
377
+ } = props;
378
+ const {
379
+ unitSize
380
+ } = useBase();
381
+ return /* @__PURE__ */ jsx(QRCode, {
382
+ value: url,
383
+ size: convertToPx(size, unitSize),
384
+ fgColor: color,
385
+ renderAs: "canvas"
386
+ });
387
+ };
347
388
  export {
348
389
  Image as I,
390
+ QRImageNode as Q,
349
391
  ImageNode as a
350
392
  };
@@ -12,8 +12,8 @@ export interface TestingProps {
12
12
  isVisible?: boolean;
13
13
  }
14
14
  export interface BaseImageProps {
15
- width?: string;
16
- height?: string;
15
+ width?: string | number;
16
+ height?: string | number;
17
17
  }
18
18
  export interface IntersectComponentProps extends BaseImageProps {
19
19
  setIsVisible: (visible: boolean) => void;
@@ -1,8 +1,8 @@
1
1
  import { useState, useEffect } from "react";
2
2
  import { styled, generateUtilityClasses, generateUtilityClass, Stack, MenuItem } from "@mui/material";
3
- import { I as Image } from "../Image/index.d5fed0ab.js";
3
+ import { I as Image } from "../Image/index.8915f577.js";
4
4
  import { useLocales } from "@m4l/graphics";
5
- import { I as ImageButton } from "../mui_extended/Button/index.007f5a6e.js";
5
+ import { I as ImageButton } from "../mui_extended/Button/index.5c68764a.js";
6
6
  import { useEnvironment, useNetwork } from "@m4l/core";
7
7
  import { unstable_composeClasses } from "@mui/base";
8
8
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
@@ -4,9 +4,9 @@ import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/mater
4
4
  import { unstable_composeClasses } from "@mui/base";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { L as LinearProgressIndeterminate } from "../LinearProgressIndeterminate/index.2d53ade4.js";
7
- import { I as Icon } from "../Icon/index.aa9949f0.js";
7
+ import { I as Icon } from "../Icon/index.282c5b58.js";
8
8
  import { T as Typography } from "../mui_extended/Typography/index.379dd374.js";
9
- import { B as Button } from "../mui_extended/Button/index.007f5a6e.js";
9
+ import { B as Button } from "../mui_extended/Button/index.5c68764a.js";
10
10
  const componentName = "M4LoadingError";
11
11
  generateUtilityClasses(componentName, [
12
12
  "root",
@@ -12,7 +12,7 @@ import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/mater
12
12
  import { unstable_composeClasses } from "@mui/base";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  import { L as LinearProgress } from "../mui_extended/LinearProgress/index.c92b9ba9.js";
15
- import { L as LoadingError } from "../LoadingError/index.991393ca.js";
15
+ import { L as LoadingError } from "../LoadingError/index.d95e6efb.js";
16
16
  const componentName = "M4LMFLoader";
17
17
  const mfLoaderClasses = generateUtilityClasses(componentName, [
18
18
  "root",
@@ -1,7 +1,7 @@
1
1
  import { useTheme, Dialog, Paper } from "@mui/material";
2
- import { c as cjs } from "../../react-draggable.2bc0e647.js";
3
- import { u as useModal } from "../../hooks/useModal/index.acc61361.js";
4
- import { R as ResizeableWindow } from "../Resizeable/index.e4f47710.js";
2
+ import { c as cjs } from "../../react-draggable.312ab17d.js";
3
+ import { u as useModal } from "../../hooks/useModal/index.1c88654a.js";
4
+ import { R as ResizeableWindow } from "../Resizeable/index.18c86aff.js";
5
5
  import { useResponsiveDesktop } from "@m4l/graphics";
6
6
  import { m as modalUtilityClasses } from "../modal/index.61389369.js";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
2
2
  import { styled } from "@mui/material/styles";
3
- import { I as Image } from "../Image/index.d5fed0ab.js";
3
+ import { I as Image } from "../Image/index.8915f577.js";
4
4
  import { generateUtilityClasses, generateUtilityClass, Skeleton } from "@mui/material";
5
5
  import { useMemo } from "react";
6
6
  import { unstable_composeClasses } from "@mui/base";
@@ -1,18 +1,18 @@
1
1
  import { useState, useEffect, useCallback, useMemo } from "react";
2
2
  import { useNetwork, useModuleDictionary, useEnvironment, usePaginate } from "@m4l/core";
3
3
  import { styled } from "@mui/material/styles";
4
- import { c as DataGrid, g as getDataGridComponentsDictionary } from "../DataGrid/index.e127cac8.js";
4
+ import { c as DataGrid, g as getDataGridComponentsDictionary } from "../DataGrid/index.e5b552a2.js";
5
5
  import { D as DateFormatter } from "../formatters/DateFormatter/index.578a9f53.js";
6
6
  import { Tooltip, IconButton } from "@mui/material";
7
7
  import { useHostTheme, useResponsiveDesktop } from "@m4l/graphics";
8
- import { R as ReactJson } from "../../react-json-view.57125fcf.js";
9
- import { S as ScrollBar } from "../ScrollBar/index.65bb2930.js";
8
+ import { R as ReactJson } from "../../react-json-view.5636414a.js";
9
+ import { S as ScrollBar } from "../ScrollBar/index.010f1b9d.js";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
- import { u as useModal } from "../../hooks/useModal/index.acc61361.js";
12
- import { I as Icon } from "../Icon/index.aa9949f0.js";
11
+ import { u as useModal } from "../../hooks/useModal/index.1c88654a.js";
12
+ import { I as Icon } from "../Icon/index.282c5b58.js";
13
13
  import { S as Stack } from "../mui_extended/Stack/index.0e53197c.js";
14
- import { W as WindowBase } from "../modal/WindowBase.a4534b0b.js";
15
- import { D as DynamicFilter, g as getDynamicFilterComponentsDictionary } from "../DynamicFilter/index.068ca09c.js";
14
+ import { W as WindowBase } from "../modal/WindowBase.779aa7a5.js";
15
+ import { D as DynamicFilter, g as getDynamicFilterComponentsDictionary } from "../DynamicFilter/index.73258cb8.js";
16
16
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
17
17
  const Container = styled("div")(() => ({
18
18
  height: "100%",
@@ -0,0 +1,2 @@
1
+ import { PDFViewerPros } from './types';
2
+ export declare const PDFViewer: (props: PDFViewerPros) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const componentName = "M4LPDFViewer";
@@ -0,0 +1,7 @@
1
+ import { PDFViewerClassesType } from './types';
2
+ export declare const pdfViewerClasses: PDFViewerClassesType;
3
+ export declare function getPDFViewerUtilityClass(slot: string): string;
4
+ export declare const pdfviewerUtilityClasses: () => {
5
+ root: string;
6
+ buttonDownload: string;
7
+ };
@@ -0,0 +1,7 @@
1
+ import { pdfviewerUtilityClasses } from ".";
2
+ export interface PDFViewerClassesType {
3
+ root: string;
4
+ buttonDownload: string;
5
+ }
6
+ export declare type PDFViewerClassesKey = keyof PDFViewerClassesType;
7
+ export declare type Classes = ReturnType<typeof pdfviewerUtilityClasses>;
@@ -0,0 +1,63 @@
1
+ import { styled, generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
+ import { unstable_composeClasses } from "@mui/base";
3
+ import { jsxs, jsx } from "react/jsx-runtime";
4
+ import { B as Button } from "../mui_extended/Button/index.5c68764a.js";
5
+ const PDFVeiwerRoot = styled("div")(({ theme }) => ({
6
+ ...theme.components?.M4LPDFViewer?.styleOverrides
7
+ }));
8
+ const componentName = "M4LPDFViewer";
9
+ generateUtilityClasses(componentName, [
10
+ "root",
11
+ "buttonDownload"
12
+ ]);
13
+ function getPDFViewerUtilityClass(slot) {
14
+ return generateUtilityClass(componentName, slot);
15
+ }
16
+ const pdfviewerUtilityClasses = () => {
17
+ const slots = {
18
+ root: ["root"],
19
+ buttonDownload: ["buttonDownload"]
20
+ };
21
+ const composedClasses = unstable_composeClasses(slots, getPDFViewerUtilityClass, {});
22
+ return {
23
+ ...composedClasses
24
+ };
25
+ };
26
+ const PDFViewer = (props) => {
27
+ const {
28
+ pdfUrl
29
+ } = props;
30
+ console.log("pdfUrl", pdfUrl);
31
+ const handleDownload = async () => {
32
+ try {
33
+ const response = await fetch(pdfUrl);
34
+ const blob = await response.blob();
35
+ const url = window.URL.createObjectURL(new Blob([blob]));
36
+ const link = document.createElement("a");
37
+ link.href = url;
38
+ link.download = pdfUrl.substring(pdfUrl.lastIndexOf("/") + 1);
39
+ document.body.appendChild(link);
40
+ link.click();
41
+ document.body.removeChild(link);
42
+ } catch (error) {
43
+ console.error("Error al descargar el PDF:", error);
44
+ }
45
+ };
46
+ const classes = pdfviewerUtilityClasses();
47
+ return /* @__PURE__ */ jsxs(PDFVeiwerRoot, {
48
+ className: classes.root,
49
+ children: [/* @__PURE__ */ jsx("embed", {
50
+ src: pdfUrl,
51
+ type: "application/pdf",
52
+ width: "100%",
53
+ height: "100%"
54
+ }), /* @__PURE__ */ jsx(Button, {
55
+ onClick: handleDownload,
56
+ variant: "contained",
57
+ children: "Descargar PDF"
58
+ })]
59
+ });
60
+ };
61
+ export {
62
+ PDFViewer as P
63
+ };
@@ -0,0 +1 @@
1
+ export { PDFViewer } from '../PDFViewer/PDFViewer';
@@ -0,0 +1,3 @@
1
+ export interface PDFViewerPros {
2
+ pdfUrl: string;
3
+ }
@@ -1,5 +1,5 @@
1
1
  import { useBase, BaseProvider, useModuleSkeleton } from "@m4l/core";
2
- import { c as classes, a as getSize, F as FactoryRender } from "../PrintingSystem/index.b69edc07.js";
2
+ import { c as classes, g as getSize, F as FactoryRender } from "../PrintingSystem/index.9dc25af9.js";
3
3
  import clsx from "clsx";
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import React__default from "react";
@@ -1,7 +1,7 @@
1
1
  import { styled } from "@mui/material/styles";
2
2
  import { useModuleSkeleton } from "@m4l/core";
3
3
  import { Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
4
- import { I as Icon } from "../Icon/index.aa9949f0.js";
4
+ import { I as Icon } from "../Icon/index.282c5b58.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { unstable_composeClasses } from "@mui/base";
7
7
  const PaperFormRoot = styled("div")(({
@@ -1,7 +1,7 @@
1
1
  import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
2
2
  import { styled, generateUtilityClasses, generateUtilityClass, Autocomplete, TextField, Skeleton } from "@mui/material";
3
3
  import { useMemo } from "react";
4
- import { I as Icon } from "../Icon/index.aa9949f0.js";
4
+ import { I as Icon } from "../Icon/index.282c5b58.js";
5
5
  import { g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.8368ac0f.js";
6
6
  import { unstable_composeClasses } from "@mui/base";
7
7
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
@@ -11,7 +11,7 @@ import { cloneDeep } from "lodash";
11
11
  import clsx from "clsx";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import { styled } from "@mui/material/styles";
14
- import { D as DragResizeWindow, d as draggableWindowClasses } from "../DragResizeWindow/index.67aa1e22.js";
14
+ import { D as DragResizeWindow, d as draggableWindowClasses } from "../DragResizeWindow/index.b5206081.js";
15
15
  import { useMap } from "react-leaflet";
16
16
  import { u as useSizeContainer } from "../../hooks/useSizeContainer/index.62b4e0c4.js";
17
17
  const COMPONENT_CLASS_NAME = "M4LPopupsProvider";
@@ -1,21 +1,20 @@
1
- import { getPropertyByString } from "@m4l/core";
2
1
  import { generateUtilityClasses } from "@mui/material";
3
2
  import { unstable_composeClasses } from "@mui/base";
4
3
  import { g as getComponentUtilityClass } from "../../utils/index.9ad3909a.js";
5
4
  import { styled, useTheme } from "@mui/material/styles";
6
5
  import clsx from "clsx";
7
- import { D as DividerNode } from "./subcomponents/DividerNode/index.0e6e76ad.js";
8
- import { S as SectionNode } from "./subcomponents/SectionNode/index.72cb64b8.js";
9
- import { T as TextBoxNode } from "./subcomponents/TextBoxNode/index.41c261f4.js";
10
- import { H as HeaderNode } from "./subcomponents/HeaderNode/index.dbf08ab4.js";
11
- import { a as ImageNode } from "../Image/index.d5fed0ab.js";
12
- import { B as BodyNode } from "./subcomponents/BodyNode/index.81da2c9c.js";
13
- import { F as FooterNode } from "./subcomponents/FooterNode/index.5af68fd5.js";
14
- import { P as PaperNode } from "./subcomponents/PaperNode/index.d81d2f30.js";
15
- import { P as PropertyValueNode } from "./subcomponents/PropertyValueNode/index.4c20215d.js";
16
- import { G as GridNode } from "./subcomponents/GridNode/index.07d4f9a4.js";
17
- import { C as ChartNode } from "./subcomponents/ChartNode/index.1863bcf1.js";
18
- import { P as PagerNode, a as PageRender } from "../Page/index.c3767243.js";
6
+ import { D as DividerNode } from "./subcomponents/DividerNode/index.46c5eb9e.js";
7
+ import { S as SectionNode } from "./subcomponents/SectionNode/index.c5588090.js";
8
+ import { T as TextBoxNode } from "./subcomponents/TextBoxNode/index.7792384b.js";
9
+ import { H as HeaderNode } from "./subcomponents/HeaderNode/index.9afcd686.js";
10
+ import { a as ImageNode, Q as QRImageNode } from "../Image/index.8915f577.js";
11
+ import { B as BodyNode } from "./subcomponents/BodyNode/index.6c1cf8f5.js";
12
+ import { F as FooterNode } from "./subcomponents/FooterNode/index.18aa1ddd.js";
13
+ import { P as PaperNode } from "./subcomponents/PaperNode/index.a3967d23.js";
14
+ import { P as PropertyValueNode } from "./subcomponents/PropertyValueNode/index.e1c05641.js";
15
+ import { G as GridNode } from "./subcomponents/GridNode/index.f4b4ffca.js";
16
+ import { C as ChartNode } from "./subcomponents/ChartNode/index.fdb01c74.js";
17
+ import { P as PagerNode, a as PageRender } from "../Page/index.f4aedd2d.js";
19
18
  import { jsxs, jsx } from "react/jsx-runtime";
20
19
  import { forwardRef, useRef, useImperativeHandle } from "react";
21
20
  const componentName = "M4LPrintingSystem";
@@ -97,33 +96,6 @@ const getSize = (value, unitSize) => {
97
96
  return value;
98
97
  }
99
98
  };
100
- const getEvalValue = (sourceData, key) => {
101
- const regexPattern = /\${([^${}]+(?:\${[^{}]*}[^${}]*)*)}/g;
102
- if (regexPattern.test(key)) {
103
- const matches = [];
104
- let match;
105
- let localRegex = new RegExp(regexPattern);
106
- while ((match = localRegex.exec(key)) !== null) {
107
- matches.push(match[1]);
108
- }
109
- const finalValue = new Array();
110
- matches.map((findMatch) => {
111
- const nestedRegex = /\${([^${}]+(?:\${[^{}]*}[^${}]*)*)}/g;
112
- if (nestedRegex.test(findMatch)) {
113
- const regexKeyReady = /([^ ${]+)/;
114
- let matchKeyReady = regexKeyReady.exec(findMatch) || "";
115
- let nestedKey = findMatch.match(regexPattern) || "";
116
- finalValue.push(getPropertyByString(sourceData, matchKeyReady[1]));
117
- finalValue.push(getEvalValue(sourceData, nestedKey[0]));
118
- } else {
119
- finalValue.push(getPropertyByString(sourceData, findMatch));
120
- }
121
- });
122
- return finalValue.join(" ");
123
- } else {
124
- return key;
125
- }
126
- };
127
99
  const FactoryRender = (props) => {
128
100
  const {
129
101
  data: parent
@@ -145,6 +117,7 @@ const FactoryRender = (props) => {
145
117
  grid: GridNode,
146
118
  chart: ChartNode,
147
119
  pager: PagerNode,
120
+ qrImage: QRImageNode,
148
121
  __default__: () => {
149
122
  throw new Error("Type no defined");
150
123
  }
@@ -217,7 +190,6 @@ const PrintingSystem = forwardRef((props, ref) => {
217
190
  export {
218
191
  FactoryRender as F,
219
192
  PrintingSystem as P,
220
- getSize as a,
221
193
  classes as c,
222
- getEvalValue as g
194
+ getSize as g
223
195
  };