@m4l/components 3.1.6 → 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.
- package/components/mui_extended/IconButton/index.d.ts +1 -1
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +2 -4
- package/index.js +183 -339
- package/node_modules-CQtkw0uG.js +7350 -0
- package/package.json +1 -1
- package/vendor-AfIOyqRr.js +24636 -0
- package/components/AccountPopover/index-BdnzI23R.js +0 -334
- package/components/AppBar/index-Dvrx1jsr.js +0 -93
- package/components/BaseModule/index-BQ2UIUCy.js +0 -30
- package/components/CommonActions/components/ActionCancel/index-DSVEMl41.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index-DMsGH0wx.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index-C8zb7R3W.js +0 -33
- package/components/CommonActions/components/ActionIntro/index-BNIG3KAH.js +0 -25
- package/components/CommonActions/components/Actions/index-90JsZTzb.js +0 -70
- package/components/DataGrid/constants-8L7QgBKi.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index-ZsSxUL_T.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-D-gZpvcm.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-kZGiDU5k.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
- package/components/DataGrid/formatters/index-iKq2iRoa.js +0 -13
- package/components/DataGrid/index-DGHnRo8z.js +0 -908
- package/components/DataGrid/subcomponents/Actions/index-BhBvobKS.js +0 -549
- package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
- package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
- package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
- package/components/DynamicFilter/dictionary-D9Z9YGDb.js +0 -51
- package/components/DynamicFilter/index-CRmtRWlr.js +0 -116
- package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
- package/components/DynamicFilter/slots/dynamicFilterSlots-CQiB8TmY.js +0 -151
- package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
- package/components/DynamicFilter/store/index-DoIifWTk.js +0 -254
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-DQESCg04.js +0 -60
- package/components/DynamicFilter/subcomponents/AppliedFilters/index-CGmflaoY.js +0 -26
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BfH6YHNi.js +0 -40
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-Dv3KjuYK.js +0 -129
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BnhNICK4.js +0 -171
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-CNN6DeHY.js +0 -153
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-C2dNPFtM.js +0 -146
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-B03ahaU6.js +0 -114
- package/components/DynamicFilter/subcomponents/FieldTypes/index-EF7A6WnZ.js +0 -38
- package/components/DynamicFilter/subcomponents/FilterActions/index-CQtA2ELu.js +0 -88
- package/components/DynamicFilter/subcomponents/InputFilter/index-EXbXDSZA.js +0 -188
- package/components/DynamicFilter/subcomponents/PopoverFilter/index-BX8YCh9v.js +0 -158
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DvAYf5-a.js +0 -63
- package/components/FieldLabel/index-C8od8D0w.js +0 -54
- package/components/GridLayout/index-EPw3AYiQ.js +0 -1044
- package/components/GridLayout/subcomponents/Griditem/index-B8Q7iMhr.js +0 -395
- package/components/GridLayout/subcomponents/Responsive/index-D6BbBdVx.js +0 -348
- package/components/GridLayout/subcomponents/SizeProvider/index-OhbtnEN4.js +0 -71
- package/components/HelperText/index-sLK3dYG0.js +0 -50
- package/components/Icon/index-BJF_0F6d.js +0 -176
- package/components/Image/index-BxphCFC7.js +0 -175
- package/components/LanguagePopover/index-CkKie1Ph.js +0 -179
- package/components/LinearProgressIndeterminate/index-CTvXOPRx.js +0 -55
- package/components/Loadable/index-BMbi9ISF.js +0 -9
- package/components/LoadingError/index-BaaPhmyF.js +0 -89
- package/components/MFIsolationApp/index-BfHLGDcN.js +0 -169
- package/components/MFLoader/index-B8FmSpE7.js +0 -299
- package/components/ModalDialog/index-WSVr5sZr.js +0 -77
- package/components/NavLink/index-CKgi5l5M.js +0 -55
- package/components/NoItemSelected/index-BKsZKc_f.js +0 -54
- package/components/ObjectLogs/index-BJkjYQaa.js +0 -233
- package/components/PDFViewer/index-Cnbioqzo.js +0 -51
- package/components/Page/index-DSSwuNSp.js +0 -117
- package/components/PaperForm/index-C1OKDnuY.js +0 -59
- package/components/Period/index-DYE7Bj45.js +0 -238
- package/components/PrintingSystem/index-BkfHXcTV.js +0 -187
- package/components/PrintingSystem/subcomponents/BodyNode/index-Btg2zXVQ.js +0 -49
- package/components/PrintingSystem/subcomponents/ChartNode/index-GLjhqKd2.js +0 -105
- package/components/PrintingSystem/subcomponents/DividerNode/index-D9T1MWQd.js +0 -20
- package/components/PrintingSystem/subcomponents/FooterNode/index-C3LET1ZY.js +0 -49
- package/components/PrintingSystem/subcomponents/GridNode/index-BPz7lGvC.js +0 -74
- package/components/PrintingSystem/subcomponents/HeaderNode/index-DY4Yci1r.js +0 -49
- package/components/PrintingSystem/subcomponents/PaperNode/index-BYoGJll5.js +0 -30
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index-vFZ5Skyl.js +0 -47
- package/components/PrintingSystem/subcomponents/SectionNode/index-BNqGWpcj.js +0 -49
- package/components/PrintingSystem/subcomponents/TextBoxNode/index-wgdfWbfF.js +0 -24
- package/components/PropertyValue/index-dwO3Qo0Y.js +0 -264
- package/components/Resizeable/index-CHseEYjL.js +0 -20
- package/components/ScrollBar/index-BYMy_qJE.js +0 -35
- package/components/ScrollToTop/index-TxORk5dB.js +0 -12
- package/components/SideBar/index-DqKD_S9_.js +0 -758
- package/components/SplitLayout/index-D4lxi0ig.js +0 -89
- package/components/ToastContainer/index-jnQcIcV1.js +0 -191
- package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
- package/components/animate/LoadingScreen/index-CTGGa4Yt.js +0 -70
- package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
- package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
- package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
- package/components/animate/features-BbnE33u3.js +0 -5
- package/components/animate/index-9dC9NmWv.js +0 -89
- package/components/animate/variants/bounce-DanQqHAX.js +0 -101
- package/components/animate/variants/container-Dmpr6tg5.js +0 -22
- package/components/animate/variants/fade-CAOJNn06.js +0 -65
- package/components/animate/variants/index-l0sNRNKZ.js +0 -1
- package/components/animate/variants/transition-B9W5SWTa.js +0 -20
- package/components/areas/components/AreasAdmin/index-BU9AX60_.js +0 -699
- package/components/areas/components/AreasViewer/index-CPlZxIzK.js +0 -805
- package/components/areas/components/index-l0sNRNKZ.js +0 -1
- package/components/areas/constants-rqODZNZe.js +0 -6
- package/components/areas/contexts/AreasContext/index-DGguLxcX.js +0 -1110
- package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
- package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
- package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
- package/components/areas/dictionary-YUsP9beq.js +0 -36
- package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
- package/components/areas/hooks/useAreas/index-DBXtbtIu.js +0 -11
- package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
- package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
- package/components/areas/icons-CwFr-alN.js +0 -24
- package/components/areas/index-B_Odny9h.js +0 -22
- package/components/commercial/AppBarCommercial/index-faX1fxjn.js +0 -28
- package/components/commercial/SectionCommercial/index-Dspd2Hd7.js +0 -56
- package/components/commercial/TopBar/index-zACdM_C0.js +0 -232
- package/components/commercial/index-9P0yOdH4.js +0 -81
- package/components/formatters/BooleanFormatter/index-PoFZ3r_m.js +0 -44
- package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
- package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
- package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
- package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
- package/components/formatters/index-CEJ6VCMb.js +0 -109
- package/components/hook-form/HelperError/index-DRvAkpwm.js +0 -19
- package/components/hook-form/RHFAutocomplete/index-DS57m8AX.js +0 -657
- package/components/hook-form/RHFAutocompleteAsync/index-Bu6NYmG_.js +0 -226
- package/components/hook-form/RHFCheckbox/index-BsB42rRc.js +0 -132
- package/components/hook-form/RHFColorPicker/index-Dox0FPrV.js +0 -191
- package/components/hook-form/RHFDateTime/index-ef19Az1N.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
- package/components/hook-form/RHFPeriod/index-DyRLTD0w.js +0 -98
- package/components/hook-form/RHFRadioGroup/index-pgTLVF9t.js +0 -52
- package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
- package/components/hook-form/RHFTextField/index-BgsElxUF.js +0 -337
- package/components/hook-form/RHFUpload/index-B6m3ypzh.js +0 -253
- package/components/maps/components/GpsTools/index-CeLi75XZ.js +0 -1948
- package/components/maps/components/Map/index-D4B8Lfgv.js +0 -2545
- package/components/maps/index-Ci-7-FHg.js +0 -7
- package/components/modal/WindowBase-CkftshqR.js +0 -44
- package/components/modal/WindowConfirm-C5YnzF-B.js +0 -73
- package/components/modal/index-CydPIpKZ.js +0 -65
- package/components/mui_extended/Accordion/index-jF2uxSmi.js +0 -124
- package/components/mui_extended/Avatar/index-CHmsrmfc.js +0 -64
- package/components/mui_extended/Badge/index-B_BGIjkQ.js +0 -29
- package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
- package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
- package/components/mui_extended/Button/index-CgvCim_g.js +0 -222
- package/components/mui_extended/CheckBox-H73kpinr.js +0 -76
- package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
- package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
- package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
- package/components/mui_extended/IconButton/index-B8lOMybH.js +0 -117
- package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
- package/components/mui_extended/IconButton/types-l0sNRNKZ.js +0 -1
- package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
- package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
- package/components/mui_extended/MenuActions/MenuActions-DA_aS7o5.js +0 -149
- package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
- package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots-BVp0M8fu.js +0 -47
- package/components/mui_extended/Pager/index-Dtk4aUiU.js +0 -257
- package/components/mui_extended/Popover/index-Dl1PwIS2.js +0 -153
- package/components/mui_extended/Stack/index-CRzpVi2a.js +0 -31
- package/components/mui_extended/Tab/index-DmrsMLOq.js +0 -129
- package/components/mui_extended/ToggleButton/index-CAnHC1N-.js +0 -18
- package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
- package/components/mui_extended/Typography/index-DXq1fG8k.js +0 -54
- package/components/mui_extended/index-l0sNRNKZ.js +0 -1
- package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
- package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
- package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
- package/components/popups/PopupsViewer/index-CMI1SK_O.js +0 -172
- package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
- package/components/popups/PopupsViewer/slots/popupsViewerSlots-DOkmuvnx.js +0 -46
- package/components/popups/index-l0sNRNKZ.js +0 -1
- package/contexts/ModalContext/index-Bp_s1qUm.js +0 -39
- package/contexts/RHFormContext/index-BQ0XWrpK.js +0 -78
- package/hocs/withToggle/index-C1_DMZD3.js +0 -14
- package/hooks/useFormAddEdit/index-dLVQB7hC.js +0 -90
- package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
- package/hooks/useModal/index-69rbrQ0v.js +0 -10
- package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
- package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
- package/hooks/useTab/index-DYRxOmMI.js +0 -12
- package/react-data-grid-BfYuZ6AK.js +0 -2606
- package/react-draggable-DsCPdgQP.js +0 -811
- package/react-json-view-bhqIAaNg.js +0 -2576
- package/react-resizable-eBbFl2dX.js +0 -618
- package/react-spinners-TpKN9lZg.js +0 -123
- package/react-splitter-layout-C-JTsNGs.js +0 -158
- package/styles/DynamicFilter-CJFsIegc.js +0 -319
- package/styles/MenuActions-lTi-ynPM.js +0 -42
- package/styles/index-CqpubQQr.js +0 -1691
- package/test/constants_no_mock-CF-669v-.js +0 -4
- package/test/getNameDataTestId-BaBTWhBr.js +0 -10
- package/utils/index-DiMrtgIu.js +0 -502
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { useState, useCallback, useEffect } from "react";
|
|
6
|
-
import { useNetwork, useEnvironment, useHostTools, axiosOperation } from "@m4l/core";
|
|
7
|
-
import { useHostTheme, useFormatter, useLocales, useFirstRender } from "@m4l/graphics";
|
|
8
|
-
import debounce from "lodash/debounce";
|
|
9
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
10
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
11
|
-
import { L as LinearProgress } from "../mui_extended/LinearProgress/index-CGgW8jq2.js";
|
|
12
|
-
import { L as LoadingError } from "../LoadingError/index-BaaPhmyF.js";
|
|
13
|
-
import { M as MFLoaderRoot } from "../../styles/index-CqpubQQr.js";
|
|
14
|
-
const componentName = "M4LMFLoader";
|
|
15
|
-
const mfLoaderClasses = generateUtilityClasses(componentName, [
|
|
16
|
-
/* elements */
|
|
17
|
-
"root",
|
|
18
|
-
"containerLinearProgress"
|
|
19
|
-
/* states or variants of elements */
|
|
20
|
-
]);
|
|
21
|
-
function getMFLoaderUtilityClass(slot) {
|
|
22
|
-
return generateUtilityClass(componentName, slot);
|
|
23
|
-
}
|
|
24
|
-
const mfLoaderUtilityClasses = () => {
|
|
25
|
-
const slots = {
|
|
26
|
-
root: ["root"],
|
|
27
|
-
containerLinearProgress: ["containerLinearProgress"]
|
|
28
|
-
};
|
|
29
|
-
const composedClasses = unstable_composeClasses(slots, getMFLoaderUtilityClass, {});
|
|
30
|
-
return {
|
|
31
|
-
...composedClasses
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
const ProggessLoadingMF = (props) => {
|
|
35
|
-
try {
|
|
36
|
-
const { loadingProgress } = props;
|
|
37
|
-
if (loadingProgress >= 0 && loadingProgress <= 100) {
|
|
38
|
-
return /* @__PURE__ */ jsx("div", { className: mfLoaderClasses.containerLinearProgress, children: /* @__PURE__ */ jsx(LinearProgress, { variant: "determinate", value: loadingProgress }) });
|
|
39
|
-
}
|
|
40
|
-
} catch (error) {
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
};
|
|
44
|
-
class ObservableLoaderMF {
|
|
45
|
-
constructor(host, scriptId, networkOperation, isRemote) {
|
|
46
|
-
__publicField(this, "host");
|
|
47
|
-
__publicField(this, "isRemote");
|
|
48
|
-
__publicField(this, "eventStatus");
|
|
49
|
-
// private prefix: string;
|
|
50
|
-
// private moduleId: string;
|
|
51
|
-
__publicField(this, "scriptId");
|
|
52
|
-
__publicField(this, "networkOperation");
|
|
53
|
-
__publicField(this, "subscribers");
|
|
54
|
-
this.host = host;
|
|
55
|
-
this.subscribers = [];
|
|
56
|
-
this.scriptId = scriptId;
|
|
57
|
-
this.networkOperation = networkOperation;
|
|
58
|
-
this.isRemote = isRemote;
|
|
59
|
-
this.eventStatus = "progress";
|
|
60
|
-
this.start = this.start.bind(this);
|
|
61
|
-
this.subscribe = this.subscribe.bind(this);
|
|
62
|
-
this.unsubscribe = this.unsubscribe.bind(this);
|
|
63
|
-
this.notify = this.notify.bind(this);
|
|
64
|
-
this.tryAgain = this.tryAgain.bind(this);
|
|
65
|
-
setTimeout(this.start, 100);
|
|
66
|
-
}
|
|
67
|
-
tryAgain() {
|
|
68
|
-
if (this.eventStatus === "error") {
|
|
69
|
-
setTimeout(this.start, 100);
|
|
70
|
-
new Promise((resolve) => {
|
|
71
|
-
resolve("ok");
|
|
72
|
-
}).then(() => {
|
|
73
|
-
this.start();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
//Metodo para arrancar la ejecución
|
|
78
|
-
async start() {
|
|
79
|
-
let percentCompleted = 0;
|
|
80
|
-
this.notify("progress", percentCompleted);
|
|
81
|
-
const manifest = await fetch(`${this.host}/manifest.json?rnd=${Math.random()}`).then((res) => res.json()).catch(() => {
|
|
82
|
-
setTimeout(() => this.notify("error", 0), 300);
|
|
83
|
-
return void 0;
|
|
84
|
-
});
|
|
85
|
-
if (!manifest) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
percentCompleted = 10;
|
|
89
|
-
this.notify("progress", percentCompleted);
|
|
90
|
-
const urlFile = `${this.host}/${manifest["src/index.tsx"]["file"]}?rnd=${Math.random()}`;
|
|
91
|
-
const controller = new AbortController();
|
|
92
|
-
const ret = await this.networkOperation({
|
|
93
|
-
method: "GET",
|
|
94
|
-
endPoint: urlFile,
|
|
95
|
-
isRemote: this.isRemote,
|
|
96
|
-
headers: { "Content-Type": "application/json" },
|
|
97
|
-
// La propiedad es un método nativo de axios usado para conocer el estado descarga para una solicitud de red.
|
|
98
|
-
onDownloadProgress: (progressEvent) => {
|
|
99
|
-
try {
|
|
100
|
-
if (progressEvent.lengthComputable) {
|
|
101
|
-
percentCompleted = 10 + Math.round(progressEvent.loaded * 90 / progressEvent.total);
|
|
102
|
-
} else {
|
|
103
|
-
percentCompleted = 10 + progressEvent.loaded / 15e5 * 90;
|
|
104
|
-
if (percentCompleted > 95) percentCompleted = 95;
|
|
105
|
-
}
|
|
106
|
-
} catch (error) {
|
|
107
|
-
}
|
|
108
|
-
this.notify("progress", percentCompleted);
|
|
109
|
-
},
|
|
110
|
-
isExternalUrl: true,
|
|
111
|
-
responseType: "text",
|
|
112
|
-
signal: controller.signal
|
|
113
|
-
}).then(() => {
|
|
114
|
-
return "ok";
|
|
115
|
-
}).catch(() => {
|
|
116
|
-
this.notify("error", 0);
|
|
117
|
-
return "error";
|
|
118
|
-
});
|
|
119
|
-
if (ret == "ok") {
|
|
120
|
-
const script = document.createElement("script");
|
|
121
|
-
const startTime = (/* @__PURE__ */ new Date()).getTime();
|
|
122
|
-
script.id = this.scriptId;
|
|
123
|
-
script.crossOrigin = "";
|
|
124
|
-
script.type = "module";
|
|
125
|
-
script.src = urlFile || "";
|
|
126
|
-
script.onload = () => {
|
|
127
|
-
this.notify("complete", 100);
|
|
128
|
-
};
|
|
129
|
-
document.head.appendChild(script);
|
|
130
|
-
console.debug("Script appened", startTime);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
// Método para suscribirse al objeto observable
|
|
134
|
-
subscribe(subscriber) {
|
|
135
|
-
this.subscribers.push(subscriber);
|
|
136
|
-
this.tryAgain();
|
|
137
|
-
}
|
|
138
|
-
// Método para cancelar la suscripción a objeto observable
|
|
139
|
-
unsubscribe(subscriber) {
|
|
140
|
-
const index = this.subscribers.indexOf(subscriber);
|
|
141
|
-
if (index !== -1) {
|
|
142
|
-
this.subscribers.splice(index, 1);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// Método para notificar a los suscriptores cuando algo cambie
|
|
146
|
-
notify(newEvent, progress) {
|
|
147
|
-
this.eventStatus = newEvent;
|
|
148
|
-
this.subscribers.forEach((subscriber) => {
|
|
149
|
-
setTimeout(() => subscriber(newEvent, progress), 1);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function getDivScritId(prefix, moduleId) {
|
|
154
|
-
const rotational_id = `${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)}_rnd_${Math.round(
|
|
155
|
-
Math.random() * 1e3
|
|
156
|
-
)}`;
|
|
157
|
-
return {
|
|
158
|
-
// Esta propiedad es usada para asociarse al elemento div que retorna el componente MFLoader.
|
|
159
|
-
// Nota: este valor es importante porque cuando se requiera cargar el microfrontend, se utilizará la referencia id del elemento para crear un react render de la aplicación foranea.
|
|
160
|
-
/**
|
|
161
|
-
* Identificador único del contenedor HTML donde se renderizará el microfrontend.
|
|
162
|
-
*/
|
|
163
|
-
divContainerId: `container_${prefix}_${moduleId}_${rotational_id}`,
|
|
164
|
-
/**
|
|
165
|
-
* Identificador único del script HTML asociado al microfrontend.
|
|
166
|
-
*/
|
|
167
|
-
scriptId: `script_${moduleId}_${rotational_id}`,
|
|
168
|
-
/**
|
|
169
|
-
* Identificador único del módulo del microfrontend.
|
|
170
|
-
*/
|
|
171
|
-
moduleId
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function MFLoader(props) {
|
|
175
|
-
const { prefix, moduleId, cache = true, debug_port, dynamicMFStore, windowTools } = props;
|
|
176
|
-
const { hostThemeOptions, fnComponentsOverrides } = useHostTheme();
|
|
177
|
-
const { networkOperation } = useNetwork();
|
|
178
|
-
const environment = useEnvironment();
|
|
179
|
-
const hostTools = useHostTools();
|
|
180
|
-
const formatter = useFormatter();
|
|
181
|
-
const [statusLoader, setStatusLoader] = useState("progress");
|
|
182
|
-
const [loadingProgress, setLoadingProgress] = useState(-1);
|
|
183
|
-
const [divScript, setDivScript] = useState(getDivScritId(prefix, moduleId));
|
|
184
|
-
const { currentLocale } = useLocales();
|
|
185
|
-
const classes = mfLoaderUtilityClasses();
|
|
186
|
-
const isFirstRender = useFirstRender([moduleId]);
|
|
187
|
-
const final_host = environment.isLocalhost ? `https://localhost:${debug_port}` : `https://${window.location.host}/mf/${moduleId}`;
|
|
188
|
-
function cleanUp(dScript) {
|
|
189
|
-
try {
|
|
190
|
-
if (window[`unmount_${prefix}_${dScript.moduleId}`]) {
|
|
191
|
-
window[`unmount_${prefix}_${dScript.moduleId}`](dScript.divContainerId);
|
|
192
|
-
}
|
|
193
|
-
} catch (error) {
|
|
194
|
-
}
|
|
195
|
-
if (!cache) {
|
|
196
|
-
const script = document.getElementById(dScript.scriptId);
|
|
197
|
-
if (script) {
|
|
198
|
-
try {
|
|
199
|
-
document.head.removeChild(script);
|
|
200
|
-
delete window[`render_${prefix}_${dScript.moduleId}`];
|
|
201
|
-
delete window[`unmount_${prefix}_${dScript.moduleId}`];
|
|
202
|
-
} catch (error) {
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
const renderMicroFrontend = useCallback(
|
|
208
|
-
(newDScript) => {
|
|
209
|
-
try {
|
|
210
|
-
window[`render_${prefix}_${newDScript.moduleId}`](
|
|
211
|
-
newDScript.divContainerId,
|
|
212
|
-
{ ...environment, isMicroFrontend: true, mfProps: { moduleId, debugPort: debug_port } },
|
|
213
|
-
hostTools,
|
|
214
|
-
currentLocale,
|
|
215
|
-
{ hostThemeOptions, fnComponentsOverrides },
|
|
216
|
-
axiosOperation,
|
|
217
|
-
formatter,
|
|
218
|
-
dynamicMFStore,
|
|
219
|
-
windowTools
|
|
220
|
-
);
|
|
221
|
-
} catch (error) {
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
[hostThemeOptions, currentLocale, formatter]
|
|
225
|
-
);
|
|
226
|
-
const debouncedSetDivScript = useCallback(
|
|
227
|
-
debounce(
|
|
228
|
-
(newName) => {
|
|
229
|
-
const newDivScript = getDivScritId(prefix, newName);
|
|
230
|
-
if (newName !== divScript.moduleId) {
|
|
231
|
-
setDivScript({ ...newDivScript });
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
200
|
|
235
|
-
),
|
|
236
|
-
[divScript]
|
|
237
|
-
);
|
|
238
|
-
useEffect(() => {
|
|
239
|
-
if (!isFirstRender) {
|
|
240
|
-
debouncedSetDivScript(moduleId + "");
|
|
241
|
-
if (moduleId !== divScript.moduleId) ;
|
|
242
|
-
}
|
|
243
|
-
return () => {
|
|
244
|
-
};
|
|
245
|
-
}, [moduleId]);
|
|
246
|
-
const tryAgainOnError = useCallback(() => {
|
|
247
|
-
window[`observable_${prefix}_${moduleId}`]?.tryAgain();
|
|
248
|
-
}, []);
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
const dsNowScript = { ...divScript };
|
|
251
|
-
const observableDownload = (event, progress) => {
|
|
252
|
-
setLoadingProgress(progress);
|
|
253
|
-
setStatusLoader(event);
|
|
254
|
-
};
|
|
255
|
-
if (!window[`render_${prefix}_${moduleId}`]) {
|
|
256
|
-
let observableLoaderMF;
|
|
257
|
-
if (!window[`observable_${prefix}_${moduleId}`]) {
|
|
258
|
-
observableLoaderMF = new ObservableLoaderMF(
|
|
259
|
-
final_host,
|
|
260
|
-
dsNowScript.scriptId,
|
|
261
|
-
networkOperation,
|
|
262
|
-
!environment.isLocalhost
|
|
263
|
-
);
|
|
264
|
-
window[`observable_${prefix}_${moduleId}`] = observableLoaderMF;
|
|
265
|
-
} else {
|
|
266
|
-
observableLoaderMF = window[`observable_${prefix}_${moduleId}`];
|
|
267
|
-
}
|
|
268
|
-
observableLoaderMF.subscribe(observableDownload);
|
|
269
|
-
} else {
|
|
270
|
-
setStatusLoader("complete");
|
|
271
|
-
}
|
|
272
|
-
return () => {
|
|
273
|
-
window[`observable_${prefix}_${moduleId}`].unsubscribe(observableDownload);
|
|
274
|
-
cleanUp(dsNowScript);
|
|
275
|
-
};
|
|
276
|
-
}, [divScript]);
|
|
277
|
-
useEffect(() => {
|
|
278
|
-
if (statusLoader === "complete") {
|
|
279
|
-
renderMicroFrontend(divScript);
|
|
280
|
-
}
|
|
281
|
-
}, [statusLoader]);
|
|
282
|
-
return /* @__PURE__ */ jsxs(MFLoaderRoot, { id: divScript.divContainerId, className: classes.root, children: [
|
|
283
|
-
statusLoader === "progress" ? /* @__PURE__ */ jsx(ProggessLoadingMF, { loadingProgress }) : (
|
|
284
|
-
// <div>{networkProgress}</div>
|
|
285
|
-
null
|
|
286
|
-
),
|
|
287
|
-
statusLoader === "error" ? /* @__PURE__ */ jsx(LoadingError, { status: statusLoader, action: tryAgainOnError }) : (
|
|
288
|
-
// <div>{networkProgress}</div>
|
|
289
|
-
null
|
|
290
|
-
)
|
|
291
|
-
] });
|
|
292
|
-
}
|
|
293
|
-
function getMFLoaderComponentsDictionary() {
|
|
294
|
-
return ["mf_loader"];
|
|
295
|
-
}
|
|
296
|
-
export {
|
|
297
|
-
MFLoader as M,
|
|
298
|
-
getMFLoaderComponentsDictionary as g
|
|
299
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme, Dialog, Paper } from "@mui/material";
|
|
3
|
-
import { a as Draggable } from "../../react-draggable-DsCPdgQP.js";
|
|
4
|
-
import { u as useModal } from "../../hooks/useModal/index-69rbrQ0v.js";
|
|
5
|
-
import { R as ResizeableWindow } from "../Resizeable/index-CHseEYjL.js";
|
|
6
|
-
import { useIsMobile } from "@m4l/graphics";
|
|
7
|
-
import { m as modalUtilityClasses } from "../modal/index-CydPIpKZ.js";
|
|
8
|
-
import { useState, useEffect } from "react";
|
|
9
|
-
import { g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index-90JsZTzb.js";
|
|
10
|
-
const DragabblePaperComponent = (props) => {
|
|
11
|
-
return /* @__PURE__ */ jsx(Draggable, { handle: ".m4l_draggable_handle", cancel: '[class*="MuiDialogContent-root"]', children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "unset", maxWidth: "unset" }, ...props }) });
|
|
12
|
-
};
|
|
13
|
-
function PaperComponent(props) {
|
|
14
|
-
return /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "unset", maxWidth: "unset", height: "100%" }, ...props });
|
|
15
|
-
}
|
|
16
|
-
const ModalDialog = () => {
|
|
17
|
-
const {
|
|
18
|
-
open,
|
|
19
|
-
initialWidth = 600,
|
|
20
|
-
initialHeigth = 400,
|
|
21
|
-
maxWidth,
|
|
22
|
-
maxHeigth,
|
|
23
|
-
window,
|
|
24
|
-
fullScreen,
|
|
25
|
-
variant
|
|
26
|
-
} = useModal();
|
|
27
|
-
const isMobile = useIsMobile();
|
|
28
|
-
const [fullScreenState, setFullScreenState] = useState(fullScreen);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
setFullScreenState(isMobile);
|
|
31
|
-
}, [isMobile]);
|
|
32
|
-
const theme = useTheme();
|
|
33
|
-
const classes = modalUtilityClasses({ variant });
|
|
34
|
-
const contentComnponent = /* @__PURE__ */ jsx("div", { className: classes.containerWindow, children: typeof window === "function" ? window() : window });
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
36
|
-
Dialog,
|
|
37
|
-
{
|
|
38
|
-
open,
|
|
39
|
-
className: classes.root,
|
|
40
|
-
sx: { ...theme.components?.M4LModalDialog?.styleOverrides },
|
|
41
|
-
"aria-labelledby": "child-modal-title",
|
|
42
|
-
"aria-describedby": "child-modal-description",
|
|
43
|
-
PaperComponent: !isMobile ? DragabblePaperComponent : PaperComponent,
|
|
44
|
-
fullScreen: fullScreenState,
|
|
45
|
-
disableEnforceFocus: true,
|
|
46
|
-
children: !isMobile ? /* @__PURE__ */ jsx(
|
|
47
|
-
ResizeableWindow,
|
|
48
|
-
{
|
|
49
|
-
width: initialWidth,
|
|
50
|
-
height: initialHeigth,
|
|
51
|
-
maxWidth,
|
|
52
|
-
maxHeigth,
|
|
53
|
-
handle: (resizeHandle, ref) => /* @__PURE__ */ jsx(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
ref,
|
|
57
|
-
className: `custom-handle custom-handle-${resizeHandle}`
|
|
58
|
-
},
|
|
59
|
-
resizeHandle
|
|
60
|
-
),
|
|
61
|
-
children: contentComnponent
|
|
62
|
-
}
|
|
63
|
-
) : contentComnponent
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
function getModalDialogComponentsDictionary() {
|
|
68
|
-
return ["modal_dialog"].concat(getCommonActionsDictionary());
|
|
69
|
-
}
|
|
70
|
-
const defaultModalDialogDictionary = {
|
|
71
|
-
modal_dialog: {}
|
|
72
|
-
};
|
|
73
|
-
export {
|
|
74
|
-
ModalDialog as M,
|
|
75
|
-
defaultModalDialogDictionary as d,
|
|
76
|
-
getModalDialogComponentsDictionary as g
|
|
77
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { NavLink as NavLink$1 } from "react-router-dom";
|
|
3
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
4
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
5
|
-
import { N as NavLinkRoot } from "../../styles/index-CqpubQQr.js";
|
|
6
|
-
import { T as TEST_PROP_ID } from "../../test/constants_no_mock-CF-669v-.js";
|
|
7
|
-
import { T as Typography } from "../mui_extended/Typography/index-DXq1fG8k.js";
|
|
8
|
-
const componentName = "M4LNavLink";
|
|
9
|
-
generateUtilityClasses(componentName, [
|
|
10
|
-
/* elements */
|
|
11
|
-
"root"
|
|
12
|
-
/* states or variants of elements */
|
|
13
|
-
]);
|
|
14
|
-
function getNavLinkClassesUtilityClass(slot) {
|
|
15
|
-
return generateUtilityClass(componentName, slot);
|
|
16
|
-
}
|
|
17
|
-
const useUtilityClasses = () => {
|
|
18
|
-
const slots = {
|
|
19
|
-
root: ["root"]
|
|
20
|
-
};
|
|
21
|
-
const composedClasses = unstable_composeClasses(slots, getNavLinkClassesUtilityClass, {});
|
|
22
|
-
return {
|
|
23
|
-
...composedClasses
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
const NAVLINK_PREFIX = "Navlink";
|
|
27
|
-
const getNameDataTestId = (KEY) => {
|
|
28
|
-
return `${NAVLINK_PREFIX}-${KEY}`;
|
|
29
|
-
};
|
|
30
|
-
const NavLink = (props) => {
|
|
31
|
-
const { children, text, skeletonWidth, skeletongHeight, ...others } = props;
|
|
32
|
-
const classes = useUtilityClasses();
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
34
|
-
NavLinkRoot,
|
|
35
|
-
{
|
|
36
|
-
className: classes.root,
|
|
37
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("root") } : {},
|
|
38
|
-
children: /* @__PURE__ */ jsx(NavLink$1, { ...others, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
Typography,
|
|
41
|
-
{
|
|
42
|
-
variant: "action",
|
|
43
|
-
skeletonWidth,
|
|
44
|
-
skeletongHeight,
|
|
45
|
-
children: text
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
children
|
|
49
|
-
] }) })
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
NavLink as N
|
|
55
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
|
-
import { n as WrapperNoItemSelected, o as Label, p as Img, q as WrapperSKTNoItemSelected } from "../../styles/index-CqpubQQr.js";
|
|
4
|
-
import { generateUtilityClasses, generateUtilityClass, Skeleton } from "@mui/material";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
7
|
-
const componentName = "M4LNoItemSelected";
|
|
8
|
-
generateUtilityClasses(
|
|
9
|
-
componentName,
|
|
10
|
-
[
|
|
11
|
-
/* elements */
|
|
12
|
-
"root"
|
|
13
|
-
/* states or variants of elements */
|
|
14
|
-
]
|
|
15
|
-
);
|
|
16
|
-
function getNoItemSelectedUtilityClass(slot) {
|
|
17
|
-
return generateUtilityClass(componentName, slot);
|
|
18
|
-
}
|
|
19
|
-
const useNoItemSelectedUtilityClasses = () => {
|
|
20
|
-
const slots = {
|
|
21
|
-
root: ["root"]
|
|
22
|
-
};
|
|
23
|
-
const composedClasses = unstable_composeClasses(slots, getNoItemSelectedUtilityClass, {});
|
|
24
|
-
return {
|
|
25
|
-
...composedClasses
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
function NoItemSelected(props) {
|
|
29
|
-
const { image, message } = props;
|
|
30
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
31
|
-
const { getLabel } = useModuleDictionary();
|
|
32
|
-
const isSkeleton = useModuleSkeleton();
|
|
33
|
-
const defaultImage = useMemo(() => {
|
|
34
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
|
|
35
|
-
}, []);
|
|
36
|
-
const classes = useNoItemSelectedUtilityClasses();
|
|
37
|
-
return /* @__PURE__ */ jsx(WrapperNoItemSelected, { className: classes.root, children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
-
!message ? /* @__PURE__ */ jsx(Label, { children: getLabel("no_item_selected.message") }) : /* @__PURE__ */ jsx(Label, { children: message }),
|
|
39
|
-
!image ? /* @__PURE__ */ jsx(Img, { src: defaultImage }) : /* @__PURE__ */ jsx(Img, { src: image })
|
|
40
|
-
] }) : /* @__PURE__ */ jsx(WrapperSKTNoItemSelected, { id: "WrapperSKTNoItemSelected", children: /* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", width: "100%", height: "100%" }) }) });
|
|
41
|
-
}
|
|
42
|
-
function getNoItemSelectedComponentsDictionary() {
|
|
43
|
-
return ["no_item_selected"];
|
|
44
|
-
}
|
|
45
|
-
const defaultNoItemSelectedDictionary = {
|
|
46
|
-
no_item_selected: {
|
|
47
|
-
message: "Please select a item to show detail"
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
NoItemSelected as N,
|
|
52
|
-
defaultNoItemSelectedDictionary as d,
|
|
53
|
-
getNoItemSelectedComponentsDictionary as g
|
|
54
|
-
};
|