@m4l/components 3.1.7 → 3.1.8

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 (201) hide show
  1. package/index.js +183 -340
  2. package/node_modules-CQtkw0uG.js +7350 -0
  3. package/package.json +1 -1
  4. package/vendor-AfIOyqRr.js +24636 -0
  5. package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
  6. package/components/AppBar/index-i0rhG3J1.js +0 -93
  7. package/components/BaseModule/index-CiNNlxzS.js +0 -30
  8. package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
  9. package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
  10. package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
  11. package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
  12. package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
  13. package/components/DataGrid/constants-8L7QgBKi.js +0 -10
  14. package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
  15. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
  16. package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
  17. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
  18. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
  19. package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
  20. package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
  21. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
  22. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
  23. package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
  24. package/components/DataGrid/index-BZ-lbmuU.js +0 -908
  25. package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
  26. package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
  27. package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
  28. package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
  29. package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
  30. package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
  31. package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
  32. package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
  33. package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
  34. package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
  35. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
  36. package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
  37. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
  38. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
  39. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
  40. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
  41. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
  42. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
  43. package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
  44. package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
  45. package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
  46. package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
  47. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
  48. package/components/FieldLabel/index-CI57EizR.js +0 -54
  49. package/components/GridLayout/index-C4HyxNYX.js +0 -1044
  50. package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
  51. package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
  52. package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
  53. package/components/HelperText/index-Crn_XIPF.js +0 -50
  54. package/components/Icon/index-C89MAkeH.js +0 -176
  55. package/components/Image/index-COp8vP0X.js +0 -175
  56. package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
  57. package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
  58. package/components/Loadable/index-BMbi9ISF.js +0 -9
  59. package/components/LoadingError/index-Cf0oGUrL.js +0 -89
  60. package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
  61. package/components/MFLoader/index-BI8vQZSH.js +0 -299
  62. package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
  63. package/components/NavLink/index-D1S_vtFO.js +0 -55
  64. package/components/NoItemSelected/index-B9oM26AX.js +0 -54
  65. package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
  66. package/components/PDFViewer/index-GVN2rfd6.js +0 -51
  67. package/components/Page/index-DZMkYmr4.js +0 -117
  68. package/components/PaperForm/index-DwgAfjci.js +0 -59
  69. package/components/Period/index-2pJG3VmY.js +0 -238
  70. package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
  71. package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
  72. package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
  73. package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
  74. package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
  75. package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
  76. package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
  77. package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
  78. package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
  79. package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
  80. package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
  81. package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
  82. package/components/Resizeable/index-DdP1xfE9.js +0 -20
  83. package/components/ScrollBar/index-f2URPPE2.js +0 -35
  84. package/components/ScrollToTop/index-TxORk5dB.js +0 -12
  85. package/components/SideBar/index-PUBBe0yH.js +0 -758
  86. package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
  87. package/components/ToastContainer/index-DK1d8NNd.js +0 -191
  88. package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
  89. package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
  90. package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
  91. package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
  92. package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
  93. package/components/animate/features-BbnE33u3.js +0 -5
  94. package/components/animate/index-BsWiJfzp.js +0 -89
  95. package/components/animate/variants/bounce-DanQqHAX.js +0 -101
  96. package/components/animate/variants/container-Dmpr6tg5.js +0 -22
  97. package/components/animate/variants/fade-CAOJNn06.js +0 -65
  98. package/components/animate/variants/index-l0sNRNKZ.js +0 -1
  99. package/components/animate/variants/transition-B9W5SWTa.js +0 -20
  100. package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
  101. package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
  102. package/components/areas/components/index-l0sNRNKZ.js +0 -1
  103. package/components/areas/constants-rqODZNZe.js +0 -6
  104. package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
  105. package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
  106. package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
  107. package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
  108. package/components/areas/dictionary-YUsP9beq.js +0 -36
  109. package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
  110. package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
  111. package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
  112. package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
  113. package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
  114. package/components/areas/icons-CwFr-alN.js +0 -24
  115. package/components/areas/index-B_Odny9h.js +0 -22
  116. package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
  117. package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
  118. package/components/commercial/TopBar/index-F1repmti.js +0 -232
  119. package/components/commercial/index-CxDzs6Ax.js +0 -81
  120. package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
  121. package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
  122. package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
  123. package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
  124. package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
  125. package/components/formatters/index-pnJhDYKe.js +0 -109
  126. package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
  127. package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
  128. package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
  129. package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
  130. package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
  131. package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
  132. package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
  133. package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
  134. package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
  135. package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
  136. package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
  137. package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
  138. package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
  139. package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
  140. package/components/maps/index-Ci-7-FHg.js +0 -7
  141. package/components/modal/WindowBase-Gd27v5FU.js +0 -44
  142. package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
  143. package/components/modal/index-CydPIpKZ.js +0 -65
  144. package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
  145. package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
  146. package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
  147. package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
  148. package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
  149. package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
  150. package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
  151. package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
  152. package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
  153. package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
  154. package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
  155. package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
  156. package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
  157. package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
  158. package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
  159. package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
  160. package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
  161. package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
  162. package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
  163. package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
  164. package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
  165. package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
  166. package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
  167. package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
  168. package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
  169. package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
  170. package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
  171. package/components/mui_extended/index-l0sNRNKZ.js +0 -1
  172. package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
  173. package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
  174. package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
  175. package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
  176. package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
  177. package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
  178. package/components/popups/index-l0sNRNKZ.js +0 -1
  179. package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
  180. package/contexts/RHFormContext/index-D_nK759o.js +0 -78
  181. package/hocs/withToggle/index-C1_DMZD3.js +0 -14
  182. package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
  183. package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
  184. package/hooks/useModal/index-BJSQOX3U.js +0 -10
  185. package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
  186. package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
  187. package/hooks/useTab/index-B_GEQFOP.js +0 -12
  188. package/react-data-grid-BfYuZ6AK.js +0 -2606
  189. package/react-draggable-DsCPdgQP.js +0 -811
  190. package/react-json-view-bhqIAaNg.js +0 -2576
  191. package/react-resizable-eBbFl2dX.js +0 -618
  192. package/react-spinners-TpKN9lZg.js +0 -123
  193. package/react-splitter-layout-C-JTsNGs.js +0 -158
  194. package/styles/DynamicFilter-CJFsIegc.js +0 -319
  195. package/styles/MenuActions-lTi-ynPM.js +0 -42
  196. package/styles/index-DKj6m8SL.js +0 -1691
  197. package/test/constants_no_mock-CF-669v-.js +0 -4
  198. package/test/getNameDataTestId-BaBTWhBr.js +0 -10
  199. package/utils/index-DiMrtgIu.js +0 -502
  200. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
  201. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
@@ -1,238 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
3
- import { z as ContainerPeriod } from "../../styles/index-DKj6m8SL.js";
4
- import { generateUtilityClasses, generateUtilityClass, Skeleton, Autocomplete, TextField } from "@mui/material";
5
- import { useState, useMemo } from "react";
6
- import { g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index-CuG1pnXW.js";
7
- import { unstable_composeClasses } from "@mui/base";
8
- import { T as TEST_PROP_ID } from "../../test/constants_no_mock-CF-669v-.js";
9
- import { useResponsiveDesktop } from "@m4l/graphics";
10
- import { T as Typography } from "../mui_extended/Typography/index-Cf_4Zw8f.js";
11
- import { I as IconButton } from "../mui_extended/IconButton/index-CusYFjie.js";
12
- var ETimePeriods = /* @__PURE__ */ ((ETimePeriods2) => {
13
- ETimePeriods2[ETimePeriods2["YEARS"] = 0] = "YEARS";
14
- ETimePeriods2[ETimePeriods2["MONTHS"] = 1] = "MONTHS";
15
- ETimePeriods2[ETimePeriods2["DAYS"] = 2] = "DAYS";
16
- return ETimePeriods2;
17
- })(ETimePeriods || {});
18
- const dictionary = {
19
- LABEL_YEARS: "period.label_years",
20
- LABEL_MONTHS: "period.label_months",
21
- LABEL_DAYS: "period.label_days"
22
- };
23
- function getPeriodComponetsDictionary() {
24
- return ["period"].concat(getCommonActionsDictionary());
25
- }
26
- const componentName = "M4LPeriod";
27
- generateUtilityClasses(componentName, [
28
- /* elements */
29
- "root",
30
- "containerDateLabel",
31
- "containerDateValue",
32
- "skeleton",
33
- "skeletonFieldPrimary",
34
- "skeletonFieldSecondary",
35
- "skeletonFieldSecondary",
36
- /* states or variants of elements */
37
- "stateError",
38
- "stateReadOnly",
39
- "variantMonoperiod",
40
- "variantMultiperiod",
41
- "sizeSmall",
42
- "sizeMedium",
43
- "isFocus"
44
- ]);
45
- function getPeriodUtilityClass(slot) {
46
- return generateUtilityClass(componentName, slot);
47
- }
48
- const periodUtilityClasses = (ownerState) => {
49
- const slots = {
50
- root: [
51
- "root",
52
- ownerState.size === "small" && "sizeSmall",
53
- ownerState.size === "medium" && "sizeMedium",
54
- ownerState.state === "error" && "stateError",
55
- ownerState.state === "success" && "stateSuccess",
56
- ownerState.state === "warning" && "stateWarning",
57
- ownerState.state === "info" && "stateInfo",
58
- ownerState.readOnly && "stateReadOnly",
59
- ownerState.variant === "monoperiod" ? "variantMonoperiod" : null,
60
- ownerState.variant === "multiperiod" ? "variantMultiperiod" : null,
61
- ownerState.focus && "isFocus"
62
- ],
63
- containerDateLabel: ["containerDateLabel"],
64
- containerDateValue: ["containerDateValue"],
65
- skeleton: ["skeleton"],
66
- skeletonFieldPrimary: ["skeletonFieldPrimary"],
67
- skeletonFieldSecondary: ["skeletonFieldSecondary"]
68
- };
69
- const composedClasses = unstable_composeClasses(slots, getPeriodUtilityClass, {});
70
- return {
71
- ...composedClasses
72
- };
73
- };
74
- const PERIOD_PREFIX = "M4LPeriod";
75
- const getNamePeriodDataTestId = (KEY) => {
76
- return `${PERIOD_PREFIX}-${KEY}`;
77
- };
78
- const SkeletonPeriod = (props) => {
79
- const { classes } = props;
80
- return /* @__PURE__ */ jsxs("div", { className: classes.skeleton, children: [
81
- /* @__PURE__ */ jsx("div", { className: classes.skeletonFieldPrimary, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "50%" }) }),
82
- /* @__PURE__ */ jsx("div", { className: classes.skeletonFieldSecondary, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "50%" }) })
83
- ] });
84
- };
85
- const getSelPeriodTime = (period) => {
86
- if (!period) return ETimePeriods.YEARS;
87
- if (period.selPeriodTime) return period.selPeriodTime;
88
- if (period.years && period.years > 0) return ETimePeriods.YEARS;
89
- if (period.months && period.months > 0) return ETimePeriods.MONTHS;
90
- if (period.days && period.days > 0) return ETimePeriods.DAYS;
91
- return ETimePeriods.YEARS;
92
- };
93
- const getSingleValue = (period) => {
94
- if (!period) return "";
95
- if (period.singleValue !== void 0) return period.singleValue;
96
- if (period.years && period.years > 0) return period.years;
97
- if (period.months && period.months > 0) return period.months;
98
- if (period.days && period.days > 0) return period.days;
99
- return "";
100
- };
101
- const Period = (props) => {
102
- const {
103
- value,
104
- onChange,
105
- state,
106
- readOnly = false,
107
- variant = "monoperiod",
108
- size = "small"
109
- } = props;
110
- const { getLabel } = useModuleDictionary();
111
- const [open, setOpen] = useState(false);
112
- const [isFocus, setIsFocus] = useState(false);
113
- const isSkeleton = useModuleSkeleton();
114
- const selPeriodTime = getSelPeriodTime(value);
115
- const singleValue = getSingleValue(value);
116
- const isDesktop = useResponsiveDesktop();
117
- const { host_static_assets, environment_assets } = useEnvironment();
118
- const iconDown = `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/chevronDown.svg`;
119
- const handleFocus = () => {
120
- setIsFocus(true);
121
- };
122
- const handleBlur = () => {
123
- setIsFocus(false);
124
- };
125
- const onTotalChange = (newPeriodTime, newValue) => {
126
- const newPeriod = {
127
- selPeriodTime: newPeriodTime,
128
- singleValue: newValue
129
- };
130
- if (newValue !== "" && newValue > 0) {
131
- newPeriod.years = 0;
132
- newPeriod.months = 0;
133
- newPeriod.days = 0;
134
- if (newPeriodTime === ETimePeriods.YEARS) newPeriod.years = newValue;
135
- if (newPeriodTime === ETimePeriods.MONTHS) newPeriod.months = newValue;
136
- if (newPeriodTime === ETimePeriods.DAYS) newPeriod.days = newValue;
137
- }
138
- onChange(newPeriod);
139
- };
140
- const onChangeTime = (newPeriodTime) => {
141
- if (newPeriodTime) {
142
- onTotalChange(newPeriodTime.id, singleValue);
143
- }
144
- };
145
- const options = useMemo(
146
- () => [
147
- {
148
- id: 0,
149
- label: getLabel(dictionary.LABEL_YEARS)
150
- },
151
- {
152
- id: 1,
153
- label: getLabel(dictionary.LABEL_MONTHS)
154
- },
155
- {
156
- id: 2,
157
- label: getLabel(dictionary.LABEL_DAYS)
158
- }
159
- ],
160
- [getLabel]
161
- );
162
- const ownerState = {
163
- readOnly,
164
- state,
165
- variant,
166
- size: isDesktop ? size : "medium",
167
- focus: isFocus
168
- };
169
- const classes = periodUtilityClasses(ownerState);
170
- return /* @__PURE__ */ jsx(
171
- ContainerPeriod,
172
- {
173
- className: classes.root,
174
- onFocus: handleFocus,
175
- onBlur: handleBlur,
176
- ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNamePeriodDataTestId("root") } : {},
177
- children: !isSkeleton ? readOnly ? /* @__PURE__ */ jsxs(Fragment, { children: [
178
- /* @__PURE__ */ jsx("div", { className: classes.containerDateLabel, children: /* @__PURE__ */ jsx(Typography, { variant: "body", skeletonWidth: "50%", children: value.selPeriodTime === 0 ? getLabel(dictionary.LABEL_YEARS) : value.selPeriodTime === 1 ? getLabel(dictionary.LABEL_MONTHS) : value.selPeriodTime === 2 ? getLabel(dictionary.LABEL_DAYS) : null }) }),
179
- /* @__PURE__ */ jsx("div", { className: classes.containerDateValue, children: /* @__PURE__ */ jsx(Typography, { variant: "body", skeletonWidth: "80%", children: value.singleValue }) })
180
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
181
- /* @__PURE__ */ jsx(
182
- Autocomplete,
183
- {
184
- options,
185
- value: options[selPeriodTime],
186
- disableClearable: true,
187
- open,
188
- onOpen: () => setOpen(true),
189
- onClose: () => setOpen(false),
190
- onChange: (_event, autcValue) => {
191
- onChangeTime(autcValue);
192
- },
193
- renderInput: (params) => {
194
- return /* @__PURE__ */ jsx(
195
- TextField,
196
- {
197
- ...params,
198
- fullWidth: true,
199
- variant: "standard",
200
- SelectProps: { native: true },
201
- InputProps: {
202
- disableUnderline: true,
203
- ...params.InputProps,
204
- endAdornment: /* @__PURE__ */ jsx(
205
- IconButton,
206
- {
207
- src: iconDown,
208
- onClick: () => setOpen((currentOpen) => !currentOpen)
209
- }
210
- )
211
- },
212
- autoComplete: "off"
213
- },
214
- `tx_async_${params.id}`
215
- );
216
- }
217
- }
218
- ),
219
- /* @__PURE__ */ jsx(
220
- TextField,
221
- {
222
- type: "number",
223
- variant: "standard",
224
- value: singleValue,
225
- InputProps: { disableUnderline: true },
226
- onChange: (e) => {
227
- onTotalChange(selPeriodTime, e.target.value === "" ? "" : parseInt(e.target.value));
228
- }
229
- }
230
- )
231
- ] }) : /* @__PURE__ */ jsx(SkeletonPeriod, { classes })
232
- }
233
- );
234
- };
235
- export {
236
- Period as P,
237
- getPeriodComponetsDictionary as g
238
- };
@@ -1,187 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { generateUtilityClasses } from "@mui/material";
3
- import { unstable_composeClasses } from "@mui/base";
4
- import { g as getComponentUtilityClass } from "../../utils/index-DiMrtgIu.js";
5
- import { B as PrintingSystemRoot } from "../../styles/index-DKj6m8SL.js";
6
- import clsx from "clsx";
7
- import { D as DividerNode } from "./subcomponents/DividerNode/index-MpFhE-H0.js";
8
- import { S as SectionNode } from "./subcomponents/SectionNode/index-iYPM3EaS.js";
9
- import { T as TextBoxNode } from "./subcomponents/TextBoxNode/index-DGjXCFKJ.js";
10
- import { H as HeaderNode } from "./subcomponents/HeaderNode/index-Cs8TOOBL.js";
11
- import { a as ImageNode, Q as QRImageNode } from "../Image/index-COp8vP0X.js";
12
- import { B as BodyNode } from "./subcomponents/BodyNode/index-Cv2aoy8S.js";
13
- import { F as FooterNode } from "./subcomponents/FooterNode/index-ZEcWdMSM.js";
14
- import { P as PaperNode } from "./subcomponents/PaperNode/index-DBb25Ecg.js";
15
- import { P as PropertyValueNode } from "./subcomponents/PropertyValueNode/index-CTVn7J9Q.js";
16
- import { G as GridNode } from "./subcomponents/GridNode/index-SsKax2xu.js";
17
- import { C as ChartNode } from "./subcomponents/ChartNode/index-BmJm8v_C.js";
18
- import { P as PagerNode, a as PageRender } from "../Page/index-DZMkYmr4.js";
19
- import { useBase, evaluateWithContext } from "@m4l/core";
20
- import { forwardRef, useRef, useImperativeHandle } from "react";
21
- import { useTheme } from "@mui/material/styles";
22
- const componentName = "M4LPrintingSystem";
23
- const classes = generateUtilityClasses(componentName, [
24
- /* elements */
25
- "root",
26
- "pageNodeRoot",
27
- "sectionNodeRoot",
28
- "dividerNodeRoot",
29
- "dividerNodeVertical",
30
- "dividerNodeHorizontal",
31
- "textBoxNodeVariant",
32
- "textBoxNodeRoot",
33
- "headerNodeRoot",
34
- "imageNodeRoot",
35
- "paperNodeRoot",
36
- "paperNodeTitle",
37
- "paperNodeContent",
38
- "propertyValueNodeRoot",
39
- "propertyValueNodeTitle",
40
- "propertyValueNodeContent",
41
- "propertyValueNodeHorizontal",
42
- "propertyValueNodeVertical",
43
- "gridNodeRoot",
44
- "footerNodeRoot",
45
- "bodyNodeRoot",
46
- "paperNodeContainerTitles",
47
- "paperNodeTitleSecondary",
48
- "pagerNodeRoot",
49
- "gridNodeTh",
50
- "gridNodeTr",
51
- "gridNodeTd",
52
- "chartNodeRoot"
53
- /* states or variants of elements */
54
- ]);
55
- const printingSystemUtilityClasses = () => {
56
- const slots = {
57
- root: ["root"],
58
- pageNodeRoot: ["pageNodeRoot"],
59
- sectionNodeRoot: ["sectionNodeRoot"],
60
- dividerNodeRoot: ["dividerNodeRoot"],
61
- dividerNodeVertical: ["dividerNodeVertical"],
62
- dividerNodeHorizontal: ["dividerNodeHorizontal"],
63
- textBoxNodeVariant: ["textBoxNodeVariant"],
64
- textBoxNodeRoot: ["textBoxNodeRoot"],
65
- headerNodeRoot: ["headerNodeRoot"],
66
- imageNodeRoot: ["imageNodeRoot"],
67
- paperNodeRoot: ["paperNodeRoot"],
68
- paperNodeTitle: ["paperNodeTitle"],
69
- paperNodeContent: ["paperNodeContent"],
70
- propertyValueNodeRoot: ["propertyValueNodeRoot"],
71
- propertyValueNodeTitle: ["propertyValueNodeTitle"],
72
- propertyValueNodeContent: ["propertyValueNodeContent"],
73
- propertyValueNodeHorizontal: ["propertyValueNodeHorizontal"],
74
- propertyValueNodeVertical: ["propertyValueNodeVertical"],
75
- gridNodeRoot: ["gridNodeRoot"],
76
- footerNodeRoot: ["footerNodeRoot"],
77
- bodyNodeRoot: ["bodyNodeRoot"],
78
- paperNodeContainerTitles: ["paperNodeContainerTitles"],
79
- paperNodeTitleSecondary: ["paperNodeTitleSecondary"],
80
- pagerNodeRoot: ["pagerNodeRoot"],
81
- gridNodeTh: ["gridNodeTh"],
82
- gridNodeTr: ["gridNodeTr"],
83
- gridNodeTd: ["gridNodeTd"],
84
- chartNodeRoot: ["chartNodeRoot"]
85
- };
86
- const composedClasses = unstable_composeClasses(slots, getComponentUtilityClass(componentName), {});
87
- return {
88
- ...composedClasses
89
- };
90
- };
91
- const getSize = (value, unitSize) => {
92
- if (typeof value === "number") {
93
- return `${value}${unitSize}`;
94
- } else {
95
- return value;
96
- }
97
- };
98
- const FactoryRender = (props) => {
99
- const { data: parent } = props;
100
- const { children, ...otherProps } = parent || {};
101
- const { sourceData } = useBase();
102
- const strategiesComponents = {
103
- section: SectionNode,
104
- textBox: TextBoxNode,
105
- divider: DividerNode,
106
- image: ImageNode,
107
- header: HeaderNode,
108
- body: BodyNode,
109
- footer: FooterNode,
110
- paper: PaperNode,
111
- propertyValue: PropertyValueNode,
112
- grid: GridNode,
113
- chart: ChartNode,
114
- pager: PagerNode,
115
- qrImage: QRImageNode,
116
- __default__: () => {
117
- throw new Error("Type no defined");
118
- }
119
- };
120
- const Component = strategiesComponents[parent.type] ?? strategiesComponents.__default__;
121
- return /* @__PURE__ */ jsxs(Component, { ...otherProps, children: [
122
- Array.isArray(children) && children.length > 0 ? children.map((subComponent, _id) => {
123
- return /* @__PURE__ */ jsx(
124
- FactoryRender,
125
- {
126
- data: subComponent
127
- },
128
- `${subComponent.key}-${Math.random().toString(36).substring(7)}`
129
- );
130
- }) : null,
131
- typeof children === "string" ? evaluateWithContext(sourceData, children) : null
132
- ] });
133
- };
134
- const PrintingSystem = forwardRef((props, ref) => {
135
- const { templateData: nodeRoot, sourceData, className } = props;
136
- const theme = useTheme();
137
- const classes2 = printingSystemUtilityClasses();
138
- const listPages = Array.isArray(nodeRoot.pages) && nodeRoot.pages.length > 0 ? nodeRoot.pages : [];
139
- const rootRef = useRef(null);
140
- useImperativeHandle(ref, () => ({
141
- GoPrint: async () => {
142
- if (rootRef.current) {
143
- const content = rootRef.current;
144
- const printWindow = window.open("", "_blank");
145
- if (printWindow) {
146
- const printDocument = printWindow.document;
147
- printDocument.write(
148
- "<html><head><title>Contenido a imprimir</title></head><body></body></html>"
149
- );
150
- printDocument.body.appendChild(content.cloneNode(true));
151
- const styleElement = printDocument.createElement("style");
152
- styleElement.textContent = `
153
- ${theme.components?.M4LPrintingSystem?.styleOverrides}
154
- `;
155
- printDocument.head.appendChild(styleElement);
156
- printDocument.close();
157
- printWindow.print();
158
- }
159
- }
160
- }
161
- }));
162
- const Header = () => /* @__PURE__ */ jsx(FactoryRender, { data: nodeRoot.header[0] });
163
- const Footer = () => /* @__PURE__ */ jsx(FactoryRender, { data: nodeRoot.footer[0] });
164
- return /* @__PURE__ */ jsx(PrintingSystemRoot, { className: clsx(classes2.root, className), ref: rootRef, children: listPages.map((page, id) => {
165
- return /* @__PURE__ */ jsx(
166
- PageRender,
167
- {
168
- data: page,
169
- id: id + 1,
170
- unitSize: nodeRoot.unitSizes,
171
- mainColor: nodeRoot.mainColor,
172
- countPages: listPages.length,
173
- HeaderGeneral: Header,
174
- FooterGeneral: Footer,
175
- sourceData,
176
- templateData: nodeRoot
177
- },
178
- page.key
179
- );
180
- }) });
181
- });
182
- export {
183
- FactoryRender as F,
184
- PrintingSystem as P,
185
- classes as c,
186
- getSize as g
187
- };
@@ -1,49 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useBase } from "@m4l/core";
3
- import { c as classes, g as getSize } from "../../index-B2qcnfw0.js";
4
- import clsx from "clsx";
5
- const BodyNode = (props) => {
6
- const {
7
- children,
8
- className,
9
- direction = "row",
10
- gap = "unset",
11
- style,
12
- width = "auto",
13
- height = "auto",
14
- paddingTop = "unset",
15
- paddingRight = "unset",
16
- paddingBottom = "unset",
17
- paddingLeft = "unset",
18
- alignX = "unset",
19
- alignY = "unset",
20
- grow = false
21
- } = props;
22
- const { unitSize } = useBase();
23
- return /* @__PURE__ */ jsx(
24
- "div",
25
- {
26
- className: clsx(classes.bodyNodeRoot, className),
27
- style: {
28
- flexDirection: direction,
29
- gap: getSize(gap, unitSize),
30
- width: getSize(width, unitSize),
31
- height: getSize(height, unitSize),
32
- minWidth: getSize(width, unitSize),
33
- minHeight: getSize(height, unitSize),
34
- paddingTop: getSize(paddingTop, unitSize),
35
- paddingRight: getSize(paddingRight, unitSize),
36
- paddingBottom: getSize(paddingBottom, unitSize),
37
- paddingLeft: getSize(paddingLeft, unitSize),
38
- justifyContent: direction === "row" ? alignX : alignY,
39
- alignItems: direction === "row" ? alignY : alignX,
40
- flex: grow ? 1 : "unset",
41
- ...style
42
- },
43
- children
44
- }
45
- );
46
- };
47
- export {
48
- BodyNode as B
49
- };
@@ -1,105 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { c as classes } from "../../index-B2qcnfw0.js";
3
- import clsx from "clsx";
4
- import { createRef, useEffect } from "react";
5
- import { Chart, registerables } from "chart.js";
6
- import { ScatterWithErrorBarsController, LineWithErrorBarsChart, PointWithErrorBar } from "chartjs-chart-error-bars";
7
- import { useBase, getPropertyByString, evaluateWithContext } from "@m4l/core";
8
- Chart.register(
9
- ScatterWithErrorBarsController,
10
- LineWithErrorBarsChart,
11
- PointWithErrorBar,
12
- ...registerables
13
- );
14
- const ChartNode = (props) => {
15
- const { style = {}, className = "", points, messageX, messageY } = props;
16
- const canvasRef = createRef();
17
- const regexPattern = /\$\{([^{}]+)\}/g;
18
- const { sourceData } = useBase();
19
- const pointsMaybeString = typeof points === "string" && regexPattern.exec(points) || "";
20
- const formatPoints = typeof points === "string" ? getPropertyByString(sourceData, pointsMaybeString[1]) : points;
21
- const adjustedPoints = [];
22
- if (Array.isArray(formatPoints) && formatPoints.length > 0) {
23
- formatPoints.forEach((point, index) => {
24
- adjustedPoints.push(point);
25
- if (index < formatPoints.length - 1) {
26
- const nextPoint = formatPoints[index + 1];
27
- const step = 0.5;
28
- for (let x = point.avg + step; x < nextPoint.avg; x += step) {
29
- adjustedPoints.push({ avg: x, correction: null, uncertainty: null });
30
- }
31
- }
32
- });
33
- }
34
- const data = Array.isArray(adjustedPoints) && adjustedPoints.length > 0 ? adjustedPoints.map((point) => {
35
- return {
36
- x: point.avg,
37
- // Usar el valor promedio como el punto x
38
- y: point.correction,
39
- yMin: point.correction !== null && point.uncertainty !== null ? point.correction - point.uncertainty : 0,
40
- yMax: point.correction !== null && point.uncertainty !== null ? point.correction + point.uncertainty : 0
41
- };
42
- }) : [];
43
- useEffect(() => {
44
- const canvas = canvasRef.current;
45
- if (canvas != null) {
46
- const ctx = canvas.getContext("2d");
47
- if (ctx != null) {
48
- new LineWithErrorBarsChart(ctx, {
49
- data: {
50
- labels: Array.isArray(adjustedPoints) && adjustedPoints.length > 0 ? adjustedPoints.map((point) => point.avg) : [],
51
- datasets: [
52
- {
53
- data,
54
- borderWidth: 0,
55
- pointBorderWidth: 0
56
- }
57
- ]
58
- },
59
- options: {
60
- plugins: {
61
- legend: {
62
- display: false
63
- }
64
- },
65
- elements: {
66
- pointWithErrorBar: {
67
- radius: 5,
68
- backgroundColor: "black"
69
- }
70
- },
71
- scales: {
72
- x: {
73
- title: {
74
- display: true,
75
- text: evaluateWithContext(sourceData, messageX)
76
- },
77
- beginAtZero: false
78
- // No empezar en 0 en el eje x
79
- },
80
- y: {
81
- title: {
82
- display: true,
83
- text: evaluateWithContext(sourceData, messageY)
84
- }
85
- }
86
- }
87
- }
88
- });
89
- }
90
- }
91
- }, [canvasRef, points]);
92
- return /* @__PURE__ */ jsx(
93
- "div",
94
- {
95
- className: clsx(classes.chartNodeRoot, className),
96
- style: {
97
- ...style
98
- },
99
- children: /* @__PURE__ */ jsx("canvas", { ref: canvasRef })
100
- }
101
- );
102
- };
103
- export {
104
- ChartNode as C
105
- };
@@ -1,20 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { c as classes } from "../../index-B2qcnfw0.js";
3
- import clsx from "clsx";
4
- const DividerNode = (props) => {
5
- const { direction = "vertical", className = "", style = {} } = props;
6
- return /* @__PURE__ */ jsx(
7
- "div",
8
- {
9
- className: clsx(
10
- classes.dividerNodeRoot,
11
- className,
12
- direction === "vertical" ? classes.dividerNodeVertical : classes.dividerNodeHorizontal
13
- ),
14
- style: { ...style }
15
- }
16
- );
17
- };
18
- export {
19
- DividerNode as D
20
- };
@@ -1,49 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useBase } from "@m4l/core";
3
- import { c as classes, g as getSize } from "../../index-B2qcnfw0.js";
4
- import clsx from "clsx";
5
- const FooterNode = (props) => {
6
- const {
7
- children,
8
- className,
9
- direction = "row",
10
- gap = "unset",
11
- style,
12
- width = "auto",
13
- height = "auto",
14
- paddingTop = "unset",
15
- paddingRight = "unset",
16
- paddingBottom = "unset",
17
- paddingLeft = "unset",
18
- alignX = "unset",
19
- alignY = "unset",
20
- grow = false
21
- } = props;
22
- const { unitSize } = useBase();
23
- return /* @__PURE__ */ jsx(
24
- "div",
25
- {
26
- className: clsx(classes.footerNodeRoot, className),
27
- style: {
28
- flexDirection: direction,
29
- gap: getSize(gap, unitSize),
30
- width: getSize(width, unitSize),
31
- height: getSize(height, unitSize),
32
- minWidth: getSize(width, unitSize),
33
- minHeight: getSize(height, unitSize),
34
- paddingTop: getSize(paddingTop, unitSize),
35
- paddingRight: getSize(paddingRight, unitSize),
36
- paddingBottom: getSize(paddingBottom, unitSize),
37
- paddingLeft: getSize(paddingLeft, unitSize),
38
- justifyContent: direction === "row" ? alignX : alignY,
39
- alignItems: direction === "row" ? alignY : alignX,
40
- flex: grow ? 1 : "unset",
41
- ...style
42
- },
43
- children
44
- }
45
- );
46
- };
47
- export {
48
- FooterNode as F
49
- };