@m4l/components 0.1.92 → 0.1.93
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.
- package/@types/export.d.ts +12 -15
- package/components/AccountPopover/AccountPopover.d.ts +2 -1
- package/components/AccountPopover/{index.eebea1c5.js → index.2ef0bf6d.js} +20 -31
- package/components/AccountPopover/index.d.ts +0 -1
- package/components/AccountPopover/subcomponents/PopOver/types.d.ts +4 -3
- package/components/AccountPopover/types.d.ts +50 -26
- package/components/AppBar/{index.90cceb7d.js → index.16fe42a1.js} +3 -22
- package/components/CommonActions/components/ActionCancel/{index.54588e5b.js → index.c3e23ad4.js} +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index.7907e6f4.js → index.6da52418.js} +4 -34
- package/components/CommonActions/components/ActionFormIntro/{index.f7cd515b.js → index.c3af6d1d.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.f20cffae.js → index.49631fcb.js} +2 -2
- package/components/CommonActions/components/Actions/{index.7a196c44.js → index.ccf731c1.js} +2 -38
- package/components/DataGrid/classes/index.d.ts +1 -0
- package/components/DataGrid/classes/types.d.ts +1 -0
- package/components/DataGrid/formatters/columnConcatenatedValueFormatter/index.d.ts +2 -2
- package/components/DataGrid/{index.95cea2ca.js → index.abedf2c0.js} +44 -14
- package/components/DataGrid/subcomponents/Actions/{index.5b0b1fbf.js → index.c8408b73.js} +9 -38
- package/components/DraggableWindow/{index.c702d3f2.js → index.8f423ed7.js} +1 -1
- package/components/DynamicFilter/{index.e9192ebd.js → index.cb1402aa.js} +23 -56
- package/components/DynamicFilter/index.d.ts +1 -1
- package/components/GridLayout/classes/index.d.ts +1 -1
- package/components/GridLayout/{index.5e43414d.js → index.1421f0d4.js} +7 -7
- package/components/GridLayout/subcomponents/Griditem/{index.d6f326d2.js → index.b2342897.js} +4 -4
- package/components/GridLayout/subcomponents/Responsive/{index.d41e31ca.js → index.f459804c.js} +2 -2
- package/components/HelperText/{index.191348cc.js → index.7d2afdb3.js} +2 -23
- package/components/Icon/{index.a70c4729.js → index.3211023d.js} +8 -6
- package/components/Image/{index.c18ebf5a.js → index.611cd930.js} +43 -14
- package/components/LanguagePopover/{index.a74f2065.js → index.b6dc03d0.js} +4 -20
- package/components/LinearProgressIndeterminate/{index.60dabc06.js → index.c46da124.js} +1 -1
- package/components/LoadingError/LoadingError.d.ts +3 -0
- package/components/LoadingError/classes/constants.d.ts +1 -0
- package/components/LoadingError/classes/index.d.ts +14 -0
- package/components/LoadingError/classes/types.d.ts +14 -0
- package/components/LoadingError/dictionary.d.ts +1 -0
- package/components/LoadingError/index.96bdc803.js +106 -0
- package/components/LoadingError/index.d.ts +2 -0
- package/components/LoadingError/types.d.ts +10 -0
- package/components/MFLoader/classes/constants.d.ts +1 -0
- package/components/MFLoader/classes/index.d.ts +7 -0
- package/components/MFLoader/classes/types.d.ts +7 -0
- package/components/MFLoader/dictionary.d.ts +1 -0
- package/components/MFLoader/index.caee87dd.js +296 -0
- package/components/MFLoader/index.d.ts +2 -0
- package/components/MFLoader/types.d.ts +7 -0
- package/components/ModalDialog/{index.99745527.js → index.ec55087e.js} +5 -5
- package/components/NavLink/{index.f12bba32.js → index.b75c91e1.js} +2 -22
- package/components/NoItemSelected/{index.1eaf72d8.js → index.3e29c208.js} +1 -1
- package/components/ObjectLogs/{index.9bbac2a0.js → index.38fd657f.js} +12 -38
- package/components/Page/index.c4642a29.js +127 -0
- package/components/PaperForm/{index.e02c772c.js → index.cce9ed39.js} +1 -1
- package/components/Period/{index.ebd5e3b7.js → index.c35c6a6c.js} +5 -37
- package/components/PrintingSystem/PrintingSystem.d.ts +3 -0
- package/components/PrintingSystem/classes/constants.d.ts +1 -0
- package/components/PrintingSystem/classes/index.d.ts +32 -0
- package/components/PrintingSystem/classes/types.d.ts +33 -0
- package/components/PrintingSystem/index.d.ts +2 -0
- package/components/PrintingSystem/index.e18a2fa8.js +634 -0
- package/components/PrintingSystem/subcomponents/BodyNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/BodyNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/ChartNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/ChartNode/types.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/DividerNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/DividerNode/types.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/FooterNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/FooterNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/GridNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/GridNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/HeaderNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/HeaderNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/ImageNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/ImageNode/types.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/PageNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/PageNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/Pager/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/Pager/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/PaperNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/PaperNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/PropertyValueNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/SectionNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/SectionNode/types.d.ts +5 -0
- package/components/PrintingSystem/subcomponents/TextBoxNode/index.d.ts +3 -0
- package/components/PrintingSystem/subcomponents/TextBoxNode/types.d.ts +3 -0
- package/components/PrintingSystem/types.d.ts +214 -0
- package/components/PrintingSystem/utils/FactoryRender/index.d.ts +3 -0
- package/components/PrintingSystem/utils/FactoryRender/types.d.ts +4 -0
- package/components/PrintingSystem/utils/PageRender/index.d.ts +3 -0
- package/components/PrintingSystem/utils/PageRender/types.d.ts +13 -0
- package/components/PrintingSystem/utils/getEvalValue/index.d.ts +1 -0
- package/components/PrintingSystem/utils/getSize/index.d.ts +1 -0
- package/components/PropertyValue/classes/index.d.ts +3 -2
- package/components/PropertyValue/classes/types.d.ts +2 -0
- package/components/PropertyValue/{index.76fa6a12.js → index.3ee95452.js} +25 -9
- package/components/PropertyValue/types.d.ts +4 -0
- package/components/Resizeable/{index.676c96fe.js → index.8c53c1fa.js} +1 -1
- package/components/SideBar/{index.2dfc5445.js → index.5fd648d2.js} +44 -39
- package/components/animate/{index.4e9774a6.js → index.5d4575bc.js} +2 -6
- package/components/areas/components/AreasAdmin/{index.cd054608.js → index.ddb384a1.js} +29 -62
- package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/classes/types.d.ts +2 -8
- package/components/areas/components/AreasViewer/{index.62abf0bb.js → index.625bf23b.js} +68 -437
- package/components/areas/components/index.558684b3.js +1 -0
- package/components/areas/components/index.d.ts +0 -1
- package/components/areas/contexts/AreasContext/{index.d528f6e7.js → index.646f3c8f.js} +9 -7
- package/components/areas/contexts/index.24025b97.js +1 -0
- package/components/areas/contexts/index.d.ts +1 -0
- package/components/areas/hooks/index.d9dc1e21.js +1 -0
- package/components/areas/hooks/useAreas/{index.d417e4b2.js → index.ee66240b.js} +1 -1
- package/components/areas/index.4cc6a221.js +22 -0
- package/components/areas/index.d.ts +1 -1
- package/components/formatters/BooleanFormatter/{index.a013b080.js → index.3c2df7a8.js} +10 -4
- package/components/formatters/FormatterRoot/index.d.ts +3 -0
- package/components/formatters/FormatterRoot/types.d.ts +4 -0
- package/components/formatters/classes/index.d.ts +4 -0
- package/components/formatters/classes/types.d.ts +6 -0
- package/components/formatters/constants.d.ts +1 -0
- package/components/formatters/{index.576922c9.js → index.dc77adb7.js} +25 -8
- package/components/hook-form/RHFAutocomplete/{index.29a4c62c.js → index.52387f0f.js} +7 -22
- package/components/hook-form/RHFAutocompleteAsync/{index.647c3f9c.js → index.638bd2ae.js} +3 -2
- package/components/hook-form/RHFCheckbox/{index.0b89ea5c.js → index.a38715e3.js} +2 -22
- package/components/hook-form/RHFDateTime/{index.1adc88ad.js → index.66e334b0.js} +23 -23
- package/components/hook-form/RHFPeriod/{index.a4476d23.js → index.23099265.js} +2 -2
- package/components/hook-form/RHFTextField/{index.a1a240b1.js → index.25b3627e.js} +6 -8
- package/components/hook-form/RHFUpload/{index.a4582341.js → index.65588e08.js} +5 -22
- package/components/index.d.ts +3 -0
- package/components/modal/{WindowBase.a4752aa1.js → WindowBase.161ec78a.js} +5 -37
- package/components/modal/{WindowConfirm.7a9c12c0.js → WindowConfirm.7eed7c35.js} +8 -40
- package/components/modal/{index.b434146b.js → index.61389369.js} +0 -37
- package/components/mui_extended/Accordion/{index.cdedddba.js → index.92aae1a4.js} +4 -4
- package/components/mui_extended/Button/{index.f79eb74e.js → index.94fec33c.js} +3 -3
- package/components/mui_extended/{CheckBox.38abccd8.js → CheckBox.e662d20c.js} +1 -1
- package/components/mui_extended/IconButton/{index.76624519.js → index.53cd6388.js} +2 -2
- package/components/mui_extended/MenuActions/{index.7669b8af.js → index.dd9f65a2.js} +5 -19
- package/components/mui_extended/Pager/{index.ac2a21f0.js → index.de0bd62c.js} +2 -2
- package/components/mui_extended/Tab/{index.5f09e16a.js → index.1fcabba2.js} +2 -2
- package/components/mui_extended/index.b606cd9d.js +1 -0
- package/contexts/ModalContext/{index.347f6738.js → index.436c2938.js} +1 -1
- package/contexts/RHFormContext/classes/index.d.ts +1 -1
- package/hooks/useFormAddEdit/{index.e8e7f758.js → index.3584a29f.js} +2 -26
- package/hooks/useModal/{index.fa6dfaa1.js → index.05d1821e.js} +1 -1
- package/index.js +196 -187
- package/node_modules.b55d04d9.js +15267 -0
- package/package.json +5 -1
- package/react-data-grid.d46d625e.js +2 -2
- package/react-draggable.e4725f3a.js +630 -0
- package/{react-resizable.ba08699a.js → react-resizable.c07d63fb.js} +2 -2
- package/utils/{index.c43a95f4.js → index.6469f148.js} +75 -107
- package/vendor.71883626.js +104 -0
- package/components/Page/index.4237c241.js +0 -27
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/types.d.ts +0 -8
- package/components/areas/components/AreasViewer/subcomponents/AreasLoadingError/index.d.ts +0 -3
- package/components/areas/components/AreasViewer/subcomponents/AreasLoadingError/types.d.ts +0 -5
- package/components/areas/components/index.ea2f9914.js +0 -31
- package/components/areas/contexts/index.6e9bbc64.js +0 -2
- package/components/areas/hooks/index.0184c6f7.js +0 -4
- package/components/areas/index.8d6d8969.js +0 -54
- package/components/mui_extended/index.fe189e7d.js +0 -24
- package/node_modules.d73a220d.js +0 -363
- package/react-draggable.7abb5d0a.js +0 -962
- package/vendor.e14dec76.js +0 -128
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/index.d.ts → MFLoader/MFLoader.d.ts} +0 -0
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader → MFLoader}/helper.d.ts +0 -0
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader → MFLoader}/subcomponents/ProggessLoadingMF/index.d.ts +0 -0
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader → MFLoader}/subcomponents/ProggessLoadingMF/types.d.ts +0 -0
- package/components/mui_extended/Badge/{index.b09524fe.js → index.09f5aee5.js} +1 -1
- package/components/mui_extended/Popover/{index.9f35d0eb.js → index.b3eca6b1.js} +2 -2
- package/components/mui_extended/Tooltip/{index.5a795dcd.js → index.24a2bc3f.js} +1 -1
- package/components/mui_extended/Typography/{index.443590d6.js → index.379dd374.js} +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PrintingSystemClassesType } from './types';
|
|
2
|
+
export declare const classes: PrintingSystemClassesType;
|
|
3
|
+
export declare const printingSystemUtilityClasses: () => {
|
|
4
|
+
root: string;
|
|
5
|
+
pageNodeRoot: string;
|
|
6
|
+
sectionNodeRoot: string;
|
|
7
|
+
dividerNodeRoot: string;
|
|
8
|
+
dividerNodeVertical: string;
|
|
9
|
+
dividerNodeHorizontal: string;
|
|
10
|
+
textBoxNodeVariant: string;
|
|
11
|
+
textBoxNodeRoot: string;
|
|
12
|
+
headerNodeRoot: string;
|
|
13
|
+
imageNodeRoot: string;
|
|
14
|
+
paperNodeRoot: string;
|
|
15
|
+
paperNodeTitle: string;
|
|
16
|
+
paperNodeContent: string;
|
|
17
|
+
propertyValueNodeRoot: string;
|
|
18
|
+
propertyValueNodeTitle: string;
|
|
19
|
+
propertyValueNodeContent: string;
|
|
20
|
+
propertyValueNodeHorizontal: string;
|
|
21
|
+
propertyValueNodeVertical: string;
|
|
22
|
+
gridNodeRoot: string;
|
|
23
|
+
footerNodeRoot: string;
|
|
24
|
+
bodyNodeRoot: string;
|
|
25
|
+
paperNodeContainerTitles: string;
|
|
26
|
+
paperNodeTitleSecondary: string;
|
|
27
|
+
pagerNodeRoot: string;
|
|
28
|
+
gridNodeTh: string;
|
|
29
|
+
gridNodeTr: string;
|
|
30
|
+
gridNodeTd: string;
|
|
31
|
+
chartNodeRoot: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { printingSystemUtilityClasses } from ".";
|
|
2
|
+
export interface PrintingSystemClassesType {
|
|
3
|
+
root: string;
|
|
4
|
+
pageNodeRoot: string;
|
|
5
|
+
sectionNodeRoot: string;
|
|
6
|
+
dividerNodeRoot: string;
|
|
7
|
+
dividerNodeVertical: string;
|
|
8
|
+
dividerNodeHorizontal: string;
|
|
9
|
+
textBoxNodeVariant: string;
|
|
10
|
+
textBoxNodeRoot: string;
|
|
11
|
+
headerNodeRoot: string;
|
|
12
|
+
imageNodeRoot: string;
|
|
13
|
+
paperNodeRoot: string;
|
|
14
|
+
paperNodeTitle: string;
|
|
15
|
+
paperNodeContent: string;
|
|
16
|
+
propertyValueNodeRoot: string;
|
|
17
|
+
propertyValueNodeTitle: string;
|
|
18
|
+
propertyValueNodeContent: string;
|
|
19
|
+
propertyValueNodeHorizontal: string;
|
|
20
|
+
propertyValueNodeVertical: string;
|
|
21
|
+
gridNodeRoot: string;
|
|
22
|
+
footerNodeRoot: string;
|
|
23
|
+
bodyNodeRoot: string;
|
|
24
|
+
paperNodeContainerTitles: string;
|
|
25
|
+
paperNodeTitleSecondary: string;
|
|
26
|
+
pagerNodeRoot: string;
|
|
27
|
+
gridNodeTh: string;
|
|
28
|
+
gridNodeTr: string;
|
|
29
|
+
gridNodeTd: string;
|
|
30
|
+
chartNodeRoot: string;
|
|
31
|
+
}
|
|
32
|
+
export declare type PrintingSystemClassesKey = keyof PrintingSystemClassesType;
|
|
33
|
+
export declare type Classes = ReturnType<typeof printingSystemUtilityClasses>;
|
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import { generateUtilityClasses } from "@mui/material";
|
|
2
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
+
import { g as getComponentUtilityClass } from "../../utils/index.6469f148.js";
|
|
4
|
+
import { styled, useTheme } from "@mui/material/styles";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useBase, getPropertyByString, evaluateWithContext } from "@m4l/core";
|
|
8
|
+
import { a as ImageNode } from "../Image/index.611cd930.js";
|
|
9
|
+
import { createRef, useEffect, forwardRef, useRef, useImperativeHandle } from "react";
|
|
10
|
+
import { C as Chart, S as ScatterWithErrorBarsController, L as LineWithErrorBarsChart, P as PointWithErrorBar, r as registerables } from "../../node_modules.b55d04d9.js";
|
|
11
|
+
import { P as PagerNode, a as PageRender } from "../Page/index.c4642a29.js";
|
|
12
|
+
const componentName = "M4LPrintingSystem";
|
|
13
|
+
const classes = generateUtilityClasses(componentName, [
|
|
14
|
+
"root",
|
|
15
|
+
"pageNodeRoot",
|
|
16
|
+
"sectionNodeRoot",
|
|
17
|
+
"dividerNodeRoot",
|
|
18
|
+
"dividerNodeVertical",
|
|
19
|
+
"dividerNodeHorizontal",
|
|
20
|
+
"textBoxNodeVariant",
|
|
21
|
+
"textBoxNodeRoot",
|
|
22
|
+
"headerNodeRoot",
|
|
23
|
+
"imageNodeRoot",
|
|
24
|
+
"paperNodeRoot",
|
|
25
|
+
"paperNodeTitle",
|
|
26
|
+
"paperNodeContent",
|
|
27
|
+
"propertyValueNodeRoot",
|
|
28
|
+
"propertyValueNodeTitle",
|
|
29
|
+
"propertyValueNodeContent",
|
|
30
|
+
"propertyValueNodeHorizontal",
|
|
31
|
+
"propertyValueNodeVertical",
|
|
32
|
+
"gridNodeRoot",
|
|
33
|
+
"footerNodeRoot",
|
|
34
|
+
"bodyNodeRoot",
|
|
35
|
+
"paperNodeContainerTitles",
|
|
36
|
+
"paperNodeTitleSecondary",
|
|
37
|
+
"pagerNodeRoot",
|
|
38
|
+
"gridNodeTh",
|
|
39
|
+
"gridNodeTr",
|
|
40
|
+
"gridNodeTd",
|
|
41
|
+
"chartNodeRoot"
|
|
42
|
+
]);
|
|
43
|
+
const printingSystemUtilityClasses = () => {
|
|
44
|
+
const slots = {
|
|
45
|
+
root: ["root"],
|
|
46
|
+
pageNodeRoot: ["pageNodeRoot"],
|
|
47
|
+
sectionNodeRoot: ["sectionNodeRoot"],
|
|
48
|
+
dividerNodeRoot: ["dividerNodeRoot"],
|
|
49
|
+
dividerNodeVertical: ["dividerNodeVertical"],
|
|
50
|
+
dividerNodeHorizontal: ["dividerNodeHorizontal"],
|
|
51
|
+
textBoxNodeVariant: ["textBoxNodeVariant"],
|
|
52
|
+
textBoxNodeRoot: ["textBoxNodeRoot"],
|
|
53
|
+
headerNodeRoot: ["headerNodeRoot"],
|
|
54
|
+
imageNodeRoot: ["imageNodeRoot"],
|
|
55
|
+
paperNodeRoot: ["paperNodeRoot"],
|
|
56
|
+
paperNodeTitle: ["paperNodeTitle"],
|
|
57
|
+
paperNodeContent: ["paperNodeContent"],
|
|
58
|
+
propertyValueNodeRoot: ["propertyValueNodeRoot"],
|
|
59
|
+
propertyValueNodeTitle: ["propertyValueNodeTitle"],
|
|
60
|
+
propertyValueNodeContent: ["propertyValueNodeContent"],
|
|
61
|
+
propertyValueNodeHorizontal: ["propertyValueNodeHorizontal"],
|
|
62
|
+
propertyValueNodeVertical: ["propertyValueNodeVertical"],
|
|
63
|
+
gridNodeRoot: ["gridNodeRoot"],
|
|
64
|
+
footerNodeRoot: ["footerNodeRoot"],
|
|
65
|
+
bodyNodeRoot: ["bodyNodeRoot"],
|
|
66
|
+
paperNodeContainerTitles: ["paperNodeContainerTitles"],
|
|
67
|
+
paperNodeTitleSecondary: ["paperNodeTitleSecondary"],
|
|
68
|
+
pagerNodeRoot: ["pagerNodeRoot"],
|
|
69
|
+
gridNodeTh: ["gridNodeTh"],
|
|
70
|
+
gridNodeTr: ["gridNodeTr"],
|
|
71
|
+
gridNodeTd: ["gridNodeTd"],
|
|
72
|
+
chartNodeRoot: ["chartNodeRoot"]
|
|
73
|
+
};
|
|
74
|
+
const composedClasses = unstable_composeClasses(slots, getComponentUtilityClass(componentName), {});
|
|
75
|
+
return {
|
|
76
|
+
...composedClasses
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const PrintingSystemRoot = styled("div")(({
|
|
80
|
+
theme
|
|
81
|
+
}) => ({
|
|
82
|
+
...theme.components?.M4LPrintingSystem?.styleOverrides
|
|
83
|
+
}));
|
|
84
|
+
const DividerNode = (props) => {
|
|
85
|
+
const {
|
|
86
|
+
direction = "vertical",
|
|
87
|
+
className = "",
|
|
88
|
+
style = {}
|
|
89
|
+
} = props;
|
|
90
|
+
return /* @__PURE__ */ jsx("div", {
|
|
91
|
+
className: clsx(classes.dividerNodeRoot, className, direction === "vertical" ? classes.dividerNodeVertical : classes.dividerNodeHorizontal),
|
|
92
|
+
style: {
|
|
93
|
+
...style
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const getSize = (value, unitSize) => {
|
|
98
|
+
if (typeof value === "number") {
|
|
99
|
+
return `${value}${unitSize}`;
|
|
100
|
+
} else {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const SectionNode = (props) => {
|
|
105
|
+
const {
|
|
106
|
+
children,
|
|
107
|
+
className,
|
|
108
|
+
direction = "row",
|
|
109
|
+
gap = "unset",
|
|
110
|
+
style,
|
|
111
|
+
width = "auto",
|
|
112
|
+
height = "auto",
|
|
113
|
+
paddingTop = "unset",
|
|
114
|
+
paddingRight = "unset",
|
|
115
|
+
paddingBottom = "unset",
|
|
116
|
+
paddingLeft = "unset",
|
|
117
|
+
alignX = "unset",
|
|
118
|
+
alignY = "unset",
|
|
119
|
+
grow = false
|
|
120
|
+
} = props;
|
|
121
|
+
const {
|
|
122
|
+
unitSize
|
|
123
|
+
} = useBase();
|
|
124
|
+
return /* @__PURE__ */ jsx("div", {
|
|
125
|
+
className: clsx(classes.sectionNodeRoot, className),
|
|
126
|
+
style: {
|
|
127
|
+
flexDirection: direction,
|
|
128
|
+
gap: getSize(gap, unitSize),
|
|
129
|
+
width: getSize(width, unitSize),
|
|
130
|
+
height: getSize(height, unitSize),
|
|
131
|
+
minWidth: getSize(width, unitSize),
|
|
132
|
+
minHeight: getSize(height, unitSize),
|
|
133
|
+
paddingTop: getSize(paddingTop, unitSize),
|
|
134
|
+
paddingRight: getSize(paddingRight, unitSize),
|
|
135
|
+
paddingBottom: getSize(paddingBottom, unitSize),
|
|
136
|
+
paddingLeft: getSize(paddingLeft, unitSize),
|
|
137
|
+
justifyContent: direction === "row" ? alignX : alignY,
|
|
138
|
+
alignItems: direction === "row" ? alignY : alignX,
|
|
139
|
+
flex: grow ? 1 : "unset",
|
|
140
|
+
...style
|
|
141
|
+
},
|
|
142
|
+
children
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
const getEvalValue = (sourceData, key) => {
|
|
146
|
+
const regexPattern = /\${([^${}]+(?:\${[^{}]*}[^${}]*)*)}/g;
|
|
147
|
+
if (regexPattern.test(key)) {
|
|
148
|
+
const matches = [];
|
|
149
|
+
let match;
|
|
150
|
+
let localRegex = new RegExp(regexPattern);
|
|
151
|
+
while ((match = localRegex.exec(key)) !== null) {
|
|
152
|
+
matches.push(match[1]);
|
|
153
|
+
}
|
|
154
|
+
const finalValue = new Array();
|
|
155
|
+
matches.map((findMatch) => {
|
|
156
|
+
const nestedRegex = /\${([^${}]+(?:\${[^{}]*}[^${}]*)*)}/g;
|
|
157
|
+
if (nestedRegex.test(findMatch)) {
|
|
158
|
+
const regexKeyReady = /([^ ${]+)/;
|
|
159
|
+
let matchKeyReady = regexKeyReady.exec(findMatch) || "";
|
|
160
|
+
let nestedKey = findMatch.match(regexPattern) || "";
|
|
161
|
+
finalValue.push(getPropertyByString(sourceData, matchKeyReady[1]));
|
|
162
|
+
finalValue.push(getEvalValue(sourceData, nestedKey[0]));
|
|
163
|
+
} else {
|
|
164
|
+
finalValue.push(getPropertyByString(sourceData, findMatch));
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
return finalValue.join(" ");
|
|
168
|
+
} else {
|
|
169
|
+
return key;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const TextBoxNode = (props) => {
|
|
173
|
+
const {
|
|
174
|
+
variant = "body",
|
|
175
|
+
style,
|
|
176
|
+
className,
|
|
177
|
+
textAlign = "start",
|
|
178
|
+
children
|
|
179
|
+
} = props;
|
|
180
|
+
const {
|
|
181
|
+
sourceData
|
|
182
|
+
} = useBase();
|
|
183
|
+
const textFormated = getEvalValue(sourceData, children[1]);
|
|
184
|
+
return /* @__PURE__ */ jsx("span", {
|
|
185
|
+
className: clsx(classes.textBoxNodeRoot, className, `${classes.textBoxNodeVariant}-${variant}`),
|
|
186
|
+
style: {
|
|
187
|
+
textAlign,
|
|
188
|
+
...style
|
|
189
|
+
},
|
|
190
|
+
children: textFormated
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
const HeaderNode = (props) => {
|
|
194
|
+
const {
|
|
195
|
+
children,
|
|
196
|
+
className,
|
|
197
|
+
direction = "row",
|
|
198
|
+
gap = "unset",
|
|
199
|
+
style,
|
|
200
|
+
width = "auto",
|
|
201
|
+
height = "auto",
|
|
202
|
+
paddingTop = "unset",
|
|
203
|
+
paddingRight = "unset",
|
|
204
|
+
paddingBottom = "unset",
|
|
205
|
+
paddingLeft = "unset",
|
|
206
|
+
alignX = "unset",
|
|
207
|
+
alignY = "unset",
|
|
208
|
+
grow = false
|
|
209
|
+
} = props;
|
|
210
|
+
const {
|
|
211
|
+
unitSize
|
|
212
|
+
} = useBase();
|
|
213
|
+
return /* @__PURE__ */ jsx("div", {
|
|
214
|
+
className: clsx(classes.headerNodeRoot, className),
|
|
215
|
+
style: {
|
|
216
|
+
flexDirection: direction,
|
|
217
|
+
gap: getSize(gap, unitSize),
|
|
218
|
+
width: getSize(width, unitSize),
|
|
219
|
+
height: getSize(height, unitSize),
|
|
220
|
+
minWidth: getSize(width, unitSize),
|
|
221
|
+
minHeight: getSize(height, unitSize),
|
|
222
|
+
paddingTop: getSize(paddingTop, unitSize),
|
|
223
|
+
paddingRight: getSize(paddingRight, unitSize),
|
|
224
|
+
paddingBottom: getSize(paddingBottom, unitSize),
|
|
225
|
+
paddingLeft: getSize(paddingLeft, unitSize),
|
|
226
|
+
justifyContent: direction === "row" ? alignX : alignY,
|
|
227
|
+
alignItems: direction === "row" ? alignY : alignX,
|
|
228
|
+
flex: grow ? 1 : "unset",
|
|
229
|
+
...style
|
|
230
|
+
},
|
|
231
|
+
children
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
const BodyNode = (props) => {
|
|
235
|
+
const {
|
|
236
|
+
children,
|
|
237
|
+
className,
|
|
238
|
+
direction = "row",
|
|
239
|
+
gap = "unset",
|
|
240
|
+
style,
|
|
241
|
+
width = "auto",
|
|
242
|
+
height = "auto",
|
|
243
|
+
paddingTop = "unset",
|
|
244
|
+
paddingRight = "unset",
|
|
245
|
+
paddingBottom = "unset",
|
|
246
|
+
paddingLeft = "unset",
|
|
247
|
+
alignX = "unset",
|
|
248
|
+
alignY = "unset",
|
|
249
|
+
grow = false
|
|
250
|
+
} = props;
|
|
251
|
+
const {
|
|
252
|
+
unitSize
|
|
253
|
+
} = useBase();
|
|
254
|
+
return /* @__PURE__ */ jsx("div", {
|
|
255
|
+
className: clsx(classes.bodyNodeRoot, className),
|
|
256
|
+
style: {
|
|
257
|
+
flexDirection: direction,
|
|
258
|
+
gap: getSize(gap, unitSize),
|
|
259
|
+
width: getSize(width, unitSize),
|
|
260
|
+
height: getSize(height, unitSize),
|
|
261
|
+
minWidth: getSize(width, unitSize),
|
|
262
|
+
minHeight: getSize(height, unitSize),
|
|
263
|
+
paddingTop: getSize(paddingTop, unitSize),
|
|
264
|
+
paddingRight: getSize(paddingRight, unitSize),
|
|
265
|
+
paddingBottom: getSize(paddingBottom, unitSize),
|
|
266
|
+
paddingLeft: getSize(paddingLeft, unitSize),
|
|
267
|
+
justifyContent: direction === "row" ? alignX : alignY,
|
|
268
|
+
alignItems: direction === "row" ? alignY : alignX,
|
|
269
|
+
flex: grow ? 1 : "unset",
|
|
270
|
+
...style
|
|
271
|
+
},
|
|
272
|
+
children
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
const FooterNode = (props) => {
|
|
276
|
+
const {
|
|
277
|
+
children,
|
|
278
|
+
className,
|
|
279
|
+
direction = "row",
|
|
280
|
+
gap = "unset",
|
|
281
|
+
style,
|
|
282
|
+
width = "auto",
|
|
283
|
+
height = "auto",
|
|
284
|
+
paddingTop = "unset",
|
|
285
|
+
paddingRight = "unset",
|
|
286
|
+
paddingBottom = "unset",
|
|
287
|
+
paddingLeft = "unset",
|
|
288
|
+
alignX = "unset",
|
|
289
|
+
alignY = "unset",
|
|
290
|
+
grow = false
|
|
291
|
+
} = props;
|
|
292
|
+
const {
|
|
293
|
+
unitSize
|
|
294
|
+
} = useBase();
|
|
295
|
+
return /* @__PURE__ */ jsx("div", {
|
|
296
|
+
className: clsx(classes.footerNodeRoot, className),
|
|
297
|
+
style: {
|
|
298
|
+
flexDirection: direction,
|
|
299
|
+
gap: getSize(gap, unitSize),
|
|
300
|
+
width: getSize(width, unitSize),
|
|
301
|
+
height: getSize(height, unitSize),
|
|
302
|
+
minWidth: getSize(width, unitSize),
|
|
303
|
+
minHeight: getSize(height, unitSize),
|
|
304
|
+
paddingTop: getSize(paddingTop, unitSize),
|
|
305
|
+
paddingRight: getSize(paddingRight, unitSize),
|
|
306
|
+
paddingBottom: getSize(paddingBottom, unitSize),
|
|
307
|
+
paddingLeft: getSize(paddingLeft, unitSize),
|
|
308
|
+
justifyContent: direction === "row" ? alignX : alignY,
|
|
309
|
+
alignItems: direction === "row" ? alignY : alignX,
|
|
310
|
+
flex: grow ? 1 : "unset",
|
|
311
|
+
...style
|
|
312
|
+
},
|
|
313
|
+
children
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
const PaperNode = (props) => {
|
|
317
|
+
const {
|
|
318
|
+
children,
|
|
319
|
+
style = {},
|
|
320
|
+
className = "",
|
|
321
|
+
title,
|
|
322
|
+
titleSecondary
|
|
323
|
+
} = props;
|
|
324
|
+
const {
|
|
325
|
+
mainColor
|
|
326
|
+
} = useBase();
|
|
327
|
+
const {
|
|
328
|
+
sourceData
|
|
329
|
+
} = useBase();
|
|
330
|
+
const titleFormated = getEvalValue(sourceData, title);
|
|
331
|
+
const titleSecondaryFormated = getEvalValue(sourceData, titleSecondary || "");
|
|
332
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
333
|
+
className: clsx(classes.paperNodeRoot, className),
|
|
334
|
+
style: {
|
|
335
|
+
...style
|
|
336
|
+
},
|
|
337
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
338
|
+
className: classes.paperNodeContainerTitles,
|
|
339
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
340
|
+
className: classes.paperNodeTitle,
|
|
341
|
+
children: titleFormated
|
|
342
|
+
}), titleSecondary ? /* @__PURE__ */ jsx("div", {
|
|
343
|
+
className: classes.paperNodeTitleSecondary,
|
|
344
|
+
style: {
|
|
345
|
+
color: mainColor
|
|
346
|
+
},
|
|
347
|
+
children: titleSecondaryFormated
|
|
348
|
+
}) : null]
|
|
349
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
350
|
+
className: classes.paperNodeContent,
|
|
351
|
+
children
|
|
352
|
+
})]
|
|
353
|
+
});
|
|
354
|
+
};
|
|
355
|
+
const PropertyValueNode = (props) => {
|
|
356
|
+
const {
|
|
357
|
+
style = {},
|
|
358
|
+
className = "",
|
|
359
|
+
property,
|
|
360
|
+
value,
|
|
361
|
+
direction,
|
|
362
|
+
propertyWidth = "auto"
|
|
363
|
+
} = props;
|
|
364
|
+
console.log();
|
|
365
|
+
const {
|
|
366
|
+
unitSize,
|
|
367
|
+
mainColor,
|
|
368
|
+
sourceData
|
|
369
|
+
} = useBase();
|
|
370
|
+
const propertyFormated = evaluateWithContext(sourceData, property);
|
|
371
|
+
const valueFormated = evaluateWithContext(sourceData, value);
|
|
372
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
373
|
+
className: clsx(classes.propertyValueNodeRoot, direction === "column" ? classes.propertyValueNodeHorizontal : classes.propertyValueNodeVertical, className),
|
|
374
|
+
style: {
|
|
375
|
+
...style
|
|
376
|
+
},
|
|
377
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
378
|
+
className: classes.propertyValueNodeTitle,
|
|
379
|
+
style: {
|
|
380
|
+
width: getSize(propertyWidth, unitSize),
|
|
381
|
+
minWidth: getSize(propertyWidth, unitSize),
|
|
382
|
+
borderColor: mainColor
|
|
383
|
+
},
|
|
384
|
+
children: propertyFormated
|
|
385
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
386
|
+
className: classes.propertyValueNodeContent,
|
|
387
|
+
children: valueFormated
|
|
388
|
+
})]
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
const GridNode = (props) => {
|
|
392
|
+
const {
|
|
393
|
+
style = {},
|
|
394
|
+
className = "",
|
|
395
|
+
rows,
|
|
396
|
+
columns
|
|
397
|
+
} = props;
|
|
398
|
+
const regexPattern = /\$\{([^{}]+)\}/g;
|
|
399
|
+
const rowMaybeString = typeof rows === "string" && regexPattern.exec(rows) || "";
|
|
400
|
+
const dataColumns = Array.isArray(columns) && columns.length > 0 ? columns : [];
|
|
401
|
+
const {
|
|
402
|
+
unitSize,
|
|
403
|
+
sourceData
|
|
404
|
+
} = useBase();
|
|
405
|
+
const result = getPropertyByString(sourceData, typeof rows === "string" ? rowMaybeString[1] : "");
|
|
406
|
+
console.log("rows", rows);
|
|
407
|
+
console.log("result", result);
|
|
408
|
+
const rowEval = Array.isArray(result) ? result : typeof result === "object" ? [{
|
|
409
|
+
...result
|
|
410
|
+
}] : [];
|
|
411
|
+
console.log("rows", rows);
|
|
412
|
+
console.log("rowEval", rowEval);
|
|
413
|
+
const rowsFormated = typeof rows === "string" ? rowEval : rows;
|
|
414
|
+
if (dataColumns.length > 0) {
|
|
415
|
+
return /* @__PURE__ */ jsxs("table", {
|
|
416
|
+
className: clsx(classes.gridNodeRoot, className),
|
|
417
|
+
style: {
|
|
418
|
+
...style
|
|
419
|
+
},
|
|
420
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
421
|
+
children: /* @__PURE__ */ jsx("tr", {
|
|
422
|
+
className: classes.gridNodeTr,
|
|
423
|
+
children: columns.map((column) => {
|
|
424
|
+
return /* @__PURE__ */ jsx("th", {
|
|
425
|
+
className: classes.gridNodeTh,
|
|
426
|
+
style: {
|
|
427
|
+
minWidth: column.width ? getSize(column.width, unitSize) : "auto",
|
|
428
|
+
maxWidth: column.width ? getSize(column.width, unitSize) : "auto",
|
|
429
|
+
justifyContent: column.alignX ? column.alignX : "center"
|
|
430
|
+
},
|
|
431
|
+
children: getEvalValue(sourceData, column.title)
|
|
432
|
+
}, `th-${Math.random().toString(36).substring(7)}`);
|
|
433
|
+
})
|
|
434
|
+
}, `tr-${Math.random().toString(36).substring(7)}`)
|
|
435
|
+
}), /* @__PURE__ */ jsx("tbody", {
|
|
436
|
+
children: rowsFormated.map((row) => {
|
|
437
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
438
|
+
className: classes.gridNodeTr,
|
|
439
|
+
children: columns.map((cell, id) => {
|
|
440
|
+
const isNested = cell.nestedValue ? true : false;
|
|
441
|
+
return /* @__PURE__ */ jsx("td", {
|
|
442
|
+
className: classes.gridNodeTd,
|
|
443
|
+
style: {
|
|
444
|
+
minWidth: getSize(dataColumns[id].width || "auto", unitSize),
|
|
445
|
+
justifyContent: cell.alignX ? cell.alignX : "center"
|
|
446
|
+
},
|
|
447
|
+
children: isNested ? getPropertyByString(row, dataColumns[id].nestedValue || "") : row[dataColumns[id].key]
|
|
448
|
+
}, `td-${Math.random().toString(36).substring(7)}`);
|
|
449
|
+
})
|
|
450
|
+
}, `tr-${Math.random().toString(36).substring(7)}`);
|
|
451
|
+
})
|
|
452
|
+
})]
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
return null;
|
|
456
|
+
};
|
|
457
|
+
Chart.register(ScatterWithErrorBarsController, LineWithErrorBarsChart, PointWithErrorBar, ...registerables);
|
|
458
|
+
const ChartNode = (props) => {
|
|
459
|
+
const {
|
|
460
|
+
style = {},
|
|
461
|
+
className = "",
|
|
462
|
+
points,
|
|
463
|
+
messageX,
|
|
464
|
+
messageY
|
|
465
|
+
} = props;
|
|
466
|
+
const canvasRef = createRef();
|
|
467
|
+
const regexPattern = /\$\{([^{}]+)\}/g;
|
|
468
|
+
const {
|
|
469
|
+
sourceData
|
|
470
|
+
} = useBase();
|
|
471
|
+
const pointsMaybeString = typeof points === "string" && regexPattern.exec(points) || "";
|
|
472
|
+
const formatPoints = typeof points === "string" ? getPropertyByString(sourceData, pointsMaybeString[1]) : points;
|
|
473
|
+
const data = Array.isArray(formatPoints) && formatPoints.length > 0 ? formatPoints.map((point) => {
|
|
474
|
+
return {
|
|
475
|
+
x: 0,
|
|
476
|
+
xMin: 0,
|
|
477
|
+
xMax: 0,
|
|
478
|
+
y: point.correction,
|
|
479
|
+
yMin: point.correction - point.uncertainty,
|
|
480
|
+
yMax: point.correction + point.uncertainty
|
|
481
|
+
};
|
|
482
|
+
}) : [];
|
|
483
|
+
useEffect(() => {
|
|
484
|
+
const canvas = canvasRef.current;
|
|
485
|
+
if (canvas != null) {
|
|
486
|
+
const ctx = canvas.getContext("2d");
|
|
487
|
+
if (ctx != null) {
|
|
488
|
+
new LineWithErrorBarsChart(ctx, {
|
|
489
|
+
data: {
|
|
490
|
+
labels: Array.isArray(formatPoints) && formatPoints.length > 0 ? formatPoints.map((point) => point.avg) : [],
|
|
491
|
+
datasets: [{
|
|
492
|
+
data,
|
|
493
|
+
borderWidth: 0,
|
|
494
|
+
pointBorderWidth: 0
|
|
495
|
+
}]
|
|
496
|
+
},
|
|
497
|
+
options: {
|
|
498
|
+
plugins: {
|
|
499
|
+
legend: {
|
|
500
|
+
display: false
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
elements: {
|
|
504
|
+
pointWithErrorBar: {
|
|
505
|
+
radius: 5,
|
|
506
|
+
backgroundColor: "black"
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
scales: {
|
|
510
|
+
x: {
|
|
511
|
+
title: {
|
|
512
|
+
display: true,
|
|
513
|
+
text: getEvalValue(sourceData, messageX)
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
y: {
|
|
517
|
+
title: {
|
|
518
|
+
display: true,
|
|
519
|
+
text: getEvalValue(sourceData, messageY)
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}, [canvasRef, points]);
|
|
528
|
+
return /* @__PURE__ */ jsx("div", {
|
|
529
|
+
className: clsx(classes.chartNodeRoot, className),
|
|
530
|
+
style: {
|
|
531
|
+
...style
|
|
532
|
+
},
|
|
533
|
+
children: /* @__PURE__ */ jsx("canvas", {
|
|
534
|
+
ref: canvasRef
|
|
535
|
+
})
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
const FactoryRender = (props) => {
|
|
539
|
+
const {
|
|
540
|
+
data: parent
|
|
541
|
+
} = props;
|
|
542
|
+
const {
|
|
543
|
+
children,
|
|
544
|
+
...otherProps
|
|
545
|
+
} = parent || {};
|
|
546
|
+
const strategiesComponents = {
|
|
547
|
+
section: SectionNode,
|
|
548
|
+
textBox: TextBoxNode,
|
|
549
|
+
divider: DividerNode,
|
|
550
|
+
image: ImageNode,
|
|
551
|
+
header: HeaderNode,
|
|
552
|
+
body: BodyNode,
|
|
553
|
+
footer: FooterNode,
|
|
554
|
+
paper: PaperNode,
|
|
555
|
+
propertyValue: PropertyValueNode,
|
|
556
|
+
grid: GridNode,
|
|
557
|
+
chart: ChartNode,
|
|
558
|
+
pager: PagerNode,
|
|
559
|
+
__default__: () => {
|
|
560
|
+
throw new Error("Type no defined");
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
const Component = strategiesComponents[parent.type] ?? strategiesComponents.__default__;
|
|
564
|
+
return /* @__PURE__ */ jsxs(Component, {
|
|
565
|
+
...otherProps,
|
|
566
|
+
children: [Array.isArray(children) && children.length > 0 ? children.map((subComponent, _id) => {
|
|
567
|
+
return /* @__PURE__ */ jsx(FactoryRender, {
|
|
568
|
+
data: subComponent
|
|
569
|
+
}, `${subComponent.key}-${Math.random().toString(36).substring(7)}`);
|
|
570
|
+
}) : null, typeof children === "string" ? children : null]
|
|
571
|
+
});
|
|
572
|
+
};
|
|
573
|
+
const PrintingSystem = forwardRef((props, ref) => {
|
|
574
|
+
const {
|
|
575
|
+
templateData: nodeRoot,
|
|
576
|
+
sourceData,
|
|
577
|
+
className
|
|
578
|
+
} = props;
|
|
579
|
+
const theme = useTheme();
|
|
580
|
+
console.log("sourceData", sourceData);
|
|
581
|
+
const classes2 = printingSystemUtilityClasses();
|
|
582
|
+
const listPages = Array.isArray(nodeRoot.pages) && nodeRoot.pages.length > 0 ? nodeRoot.pages : [];
|
|
583
|
+
const rootRef = useRef(null);
|
|
584
|
+
useImperativeHandle(ref, () => ({
|
|
585
|
+
GoPrint: async () => {
|
|
586
|
+
if (rootRef.current) {
|
|
587
|
+
const content = rootRef.current;
|
|
588
|
+
const printWindow = window.open("", "_blank");
|
|
589
|
+
if (printWindow) {
|
|
590
|
+
const printDocument = printWindow.document;
|
|
591
|
+
printDocument.write("<html><head><title>Contenido a imprimir</title></head><body></body></html>");
|
|
592
|
+
printDocument.body.appendChild(content.cloneNode(true));
|
|
593
|
+
const styleElement = printDocument.createElement("style");
|
|
594
|
+
styleElement.textContent = `
|
|
595
|
+
${theme.components?.M4LPrintingSystem?.styleOverrides}
|
|
596
|
+
`;
|
|
597
|
+
printDocument.head.appendChild(styleElement);
|
|
598
|
+
printDocument.close();
|
|
599
|
+
printWindow.print();
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}));
|
|
604
|
+
const Header = () => /* @__PURE__ */ jsx(FactoryRender, {
|
|
605
|
+
data: nodeRoot.header[0]
|
|
606
|
+
});
|
|
607
|
+
const Footer = () => /* @__PURE__ */ jsx(FactoryRender, {
|
|
608
|
+
data: nodeRoot.footer[0]
|
|
609
|
+
});
|
|
610
|
+
return /* @__PURE__ */ jsx(PrintingSystemRoot, {
|
|
611
|
+
className: clsx(classes2.root, className),
|
|
612
|
+
ref: rootRef,
|
|
613
|
+
children: listPages.map((page, id) => {
|
|
614
|
+
return /* @__PURE__ */ jsx(PageRender, {
|
|
615
|
+
data: page,
|
|
616
|
+
id: id + 1,
|
|
617
|
+
unitSize: nodeRoot.unitSizes,
|
|
618
|
+
mainColor: nodeRoot.mainColor,
|
|
619
|
+
countPages: listPages.length,
|
|
620
|
+
HeaderGeneral: Header,
|
|
621
|
+
FooterGeneral: Footer,
|
|
622
|
+
sourceData,
|
|
623
|
+
templateData: nodeRoot
|
|
624
|
+
}, page.key);
|
|
625
|
+
})
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
export {
|
|
629
|
+
FactoryRender as F,
|
|
630
|
+
PrintingSystem as P,
|
|
631
|
+
getSize as a,
|
|
632
|
+
classes as c,
|
|
633
|
+
getEvalValue as g
|
|
634
|
+
};
|