@m4l/components 0.1.42 → 0.1.45
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/types.d.ts +117 -0
- package/components/CmpDisenoTest/index.d.ts +4 -0
- package/components/CmpDisenoTest/types.d.ts +20 -0
- package/components/CommonActions/components/ActionCancel/{index.9230c57b.js → index.a81752ef.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.ab514bd9.js → index.7870abce.js} +25 -9
- package/components/CommonActions/components/ActionIntro/{index.a0a341c7.js → index.d567aebb.js} +1 -1
- package/components/CommonActions/components/Actions/{index.d3e1f36e.js → index.a5f70d5d.js} +19 -8
- package/components/DataGrid/formatters/columnConcatenatedValueFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/columnConcatenatedValueFormatter/types.d.ts +6 -0
- package/components/DataGrid/formatters/index.d.ts +1 -0
- package/components/DataGrid/{index.67260455.js → index.8333ea44.js} +42 -15
- package/components/DynamicFilter/contexts/BaseContext/types.d.ts +3 -0
- package/components/DynamicFilter/{index.071aa795.js → index.93dfa3e0.js} +208 -110
- package/components/DynamicFilter/index.d.ts +4 -1
- package/components/DynamicFilter/styles.d.ts +4 -6
- package/components/DynamicFilter/subcomponents/PopupEditFilter/styles.d.ts +7 -0
- package/components/DynamicFilter/types.d.ts +4 -0
- package/components/DynamicFilter/utils/Clases/index.d.ts +20 -0
- package/components/DynamicFilter/utils/Clases/types.d.ts +17 -0
- package/components/ErrorLabel/index.73f9362c.js +65 -0
- package/components/ErrorLabel/index.d.ts +8 -1
- package/components/ErrorLabel/styles.d.ts +1 -1
- package/components/ErrorLabel/types.d.ts +2 -1
- package/components/ErrorLabel/utils/Clases/index.d.ts +6 -0
- package/components/ErrorLabel/utils/Clases/types.d.ts +3 -0
- package/components/Icon/Icon.d.ts +8 -0
- package/components/Icon/classes/constants.d.ts +1 -0
- package/components/Icon/classes/index.d.ts +9 -0
- package/components/Icon/classes/types.d.ts +17 -0
- package/components/Icon/index.d.ts +2 -3
- package/components/Icon/{index.8d754623.js → index.f6e8d810.js} +58 -11
- package/components/Icon/styles.d.ts +1 -1
- package/components/Icon/types.d.ts +5 -0
- package/components/Image/Image.d.ts +9 -0
- package/components/Image/{index.93d5f37f.js → index.aa24e982.js} +107 -43
- package/components/Image/index.d.ts +2 -4
- package/components/Image/styles.d.ts +2 -2
- package/components/Image/subcomponents/LazyLoadComponent/index.d.ts +5 -0
- package/components/Image/subcomponents/LazyLoadComponent/styles.d.ts +2 -0
- package/components/Image/types.d.ts +17 -1
- package/components/Image/utils/classes/constant.d.ts +1 -0
- package/components/Image/utils/classes/index.d.ts +12 -0
- package/components/Image/utils/classes/types.d.ts +9 -0
- package/components/LanguagePopover/LanguagePopover.d.ts +8 -0
- package/components/LanguagePopover/classes/constants.d.ts +1 -0
- package/components/LanguagePopover/classes/index.d.ts +9 -0
- package/components/LanguagePopover/classes/types.d.ts +7 -0
- package/components/LanguagePopover/{index.cbc4b282.js → index.26b694ef.js} +57 -16
- package/components/LanguagePopover/index.d.ts +2 -2
- package/components/LanguagePopover/styles.d.ts +1 -0
- package/components/LanguagePopover/types.d.ts +9 -0
- package/components/ModalDialog/{index.a684827f.js → index.c72a6e31.js} +5 -5
- package/components/NoItemSelected/{index.46d2f632.js → index.9636ec8a.js} +1 -1
- package/components/NoItemSelected/styles.d.ts +1 -1
- package/components/ObjectLogs/{index.4a859658.js → index.239e5877.js} +22 -11
- package/components/PaperForm/{index.c5948756.js → index.0114aa9b.js} +1 -1
- package/components/Period/{index.abe445bd.js → index.10dc7de1.js} +20 -9
- package/components/Resizeable/{index.c96c0f09.js → index.8a442a8b.js} +1 -1
- package/components/areas/components/Area/types.d.ts +24 -12
- package/components/areas/components/AreasAdmin/{index.6794b22f.js → index.01739b1f.js} +24 -15
- package/components/areas/components/AreasContainer/{index.a2f8899b.js → index.41fb511e.js} +9 -10
- package/components/areas/components/GridLayout/{index.b9c1e846.js → index.d11ecdd8.js} +28 -18
- package/components/areas/components/Window/{index.252fbf4e.js → index.61f87e9d.js} +105 -85
- package/components/areas/components/Window/styles.d.ts +5 -2
- package/components/areas/components/Window/subcomponents/InnerForHooks/index.d.ts +4 -0
- package/components/areas/components/Window/subcomponents/InnerForHooks/styles.d.ts +2 -0
- package/components/areas/components/Window/subcomponents/{Component → InnerForHooks/subcomponents/Component}/index.d.ts +4 -3
- package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/index.d.ts +1 -1
- package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/index.d.ts +1 -1
- package/components/areas/components/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +8 -0
- package/components/areas/components/WindowPopUp/index.d.ts +2 -1
- package/components/areas/components/WindowPopUp/index.f5fa6cce.js +117 -0
- package/components/areas/components/index.d.ts +2 -1
- package/components/areas/components/{index.7d6cd649.js → index.e9971ebf.js} +18 -13
- package/components/areas/contexts/AreaContext/helper.d.ts +12 -0
- package/components/areas/contexts/AreaContext/index.cb686ae0.js +392 -0
- package/components/areas/contexts/AreaContext/index.d.ts +2 -2
- package/components/areas/contexts/AreaContext/store.d.ts +49 -0
- package/components/areas/contexts/AreaContext/types.d.ts +8 -16
- package/components/areas/contexts/AreasContext/index.1b624579.js +204 -0
- package/components/areas/contexts/AreasContext/index.d.ts +10 -2
- package/components/areas/contexts/AreasContext/store.d.ts +38 -0
- package/components/areas/contexts/AreasContext/types.d.ts +1 -13
- package/components/areas/contexts/DynamicMFParmsContext/index.c19cb8cc.js +43 -0
- package/components/areas/contexts/DynamicMFParmsContext/index.d.ts +13 -4
- package/components/areas/contexts/DynamicMFParmsContext/store.d.ts +20 -0
- package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +4 -16
- package/components/areas/contexts/WindowContext/helper.d.ts +1 -0
- package/components/areas/contexts/WindowContext/index.d.ts +13 -0
- package/components/areas/contexts/WindowContext/store.d.ts +31 -0
- package/components/areas/contexts/WindowContext/types.d.ts +5 -0
- package/components/areas/contexts/WindowToolsMFContext/index.d.ts +6 -0
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +21 -0
- package/components/areas/contexts/index.9c342ce6.js +203 -0
- package/components/areas/contexts/index.d.ts +4 -1
- package/components/areas/hooks/index.4e59c40f.js +27 -0
- package/components/areas/hooks/index.d.ts +2 -0
- package/components/areas/hooks/useArea/index.d.ts +2 -0
- package/components/areas/hooks/useArea/index.df7c7169.js +20 -0
- package/components/areas/hooks/useAreas/index.d.ts +11 -1
- package/components/areas/hooks/useDynamicMFParameters/index.041a666b.js +14 -0
- package/components/areas/hooks/useDynamicMFParameters/index.d.ts +11 -1
- package/components/areas/hooks/useWindow/index.d.ts +11 -0
- package/components/areas/hooks/useWindowToolsMF/index.d.ts +1 -0
- package/components/areas/index.7b430c19.js +21 -0
- package/components/areas/index.d.ts +1 -0
- package/components/formatters/BooleanFormatter/{index.3a9b16c8.js → index.b3fb8a75.js} +1 -1
- package/components/formatters/ConcatenatedFormatter/index.d.ts +8 -0
- package/components/formatters/ConcatenatedFormatter/types.d.ts +11 -0
- package/components/formatters/PeriodFormatter/index.d.ts +8 -0
- package/components/formatters/PeriodFormatter/types.d.ts +13 -0
- package/components/formatters/dictionary.d.ts +9 -0
- package/components/formatters/index.0368bab3.js +127 -0
- package/components/formatters/index.d.ts +2 -0
- package/components/hook-form/RHFAutocomplete/{index.de93fe01.js → index.74add0d0.js} +1 -1
- package/components/hook-form/RHFAutocompleteAsync/{index.ca696cce.js → index.0aa3c224.js} +1 -1
- package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +8 -0
- package/components/hook-form/RHFCheckbox/classes/index.d.ts +7 -0
- package/components/hook-form/RHFCheckbox/classes/types.d.ts +5 -0
- package/components/hook-form/RHFCheckbox/index.ebfe1e3c.js +110 -0
- package/components/hook-form/RHFCheckbox/styles.d.ts +14 -0
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/index.d.ts +2 -1
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/types.d.ts +3 -0
- package/components/hook-form/RHFPeriod/{index.3772295b.js → index.10c4501a.js} +2 -2
- package/components/hook-form/RHFTextField/RHFTextField.d.ts +8 -0
- package/components/hook-form/RHFTextField/classes/constants.d.ts +1 -0
- package/components/hook-form/RHFTextField/classes/index.d.ts +7 -0
- package/components/hook-form/RHFTextField/classes/types.d.ts +10 -0
- package/components/hook-form/RHFTextField/index.57f138f7.js +219 -0
- package/components/hook-form/RHFTextField/index.d.ts +2 -3
- package/components/hook-form/RHFTextField/styles.d.ts +3 -0
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +6 -1
- package/components/hook-form/RHFTextField/types.d.ts +0 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.d.ts +9 -0
- package/components/hook-form/RHFTextFieldPassword/classes/index.d.ts +6 -0
- package/components/hook-form/RHFTextFieldPassword/classes/types.d.ts +4 -0
- package/components/hook-form/RHFTextFieldPassword/index.d.ts +2 -3
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +2 -0
- package/components/hook-form/RHFUpload/{index.d5cc7c13.js → index.7fdff30f.js} +1 -1
- package/components/hook-form/index.d.ts +3 -3
- package/components/index.d.ts +3 -2
- package/components/modal/{WindowBase.04439b8e.js → WindowBase.bed2458c.js} +3 -4
- package/components/modal/{WindowConfirm.0b8a6818.js → WindowConfirm.bde6242f.js} +22 -11
- package/components/modal/index.cb75ce72.js +29 -0
- package/components/mui_extended/Accordion/{index.a541c71c.js → index.1d513477.js} +2 -2
- package/components/mui_extended/Button/Button.d.ts +8 -0
- package/components/mui_extended/Button/classes/constants.d.ts +1 -0
- package/components/mui_extended/Button/classes/index.d.ts +7 -0
- package/components/mui_extended/Button/classes/types.d.ts +5 -0
- package/components/mui_extended/Button/index.8406ed5b.js +150 -0
- package/components/mui_extended/Button/index.d.ts +2 -3
- package/components/mui_extended/Button/styles.d.ts +13 -0
- package/components/mui_extended/IconButton/IconButton.d.ts +9 -0
- package/components/mui_extended/IconButton/classes/constants.d.ts +1 -0
- package/components/mui_extended/IconButton/classes/index.d.ts +7 -0
- package/components/mui_extended/IconButton/classes/types.d.ts +5 -0
- package/components/mui_extended/IconButton/index.1318a283.js +100 -0
- package/components/mui_extended/IconButton/index.d.ts +2 -4
- package/components/mui_extended/IconButton/styles.d.ts +2 -0
- package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/index.d.ts +2 -1
- package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/types.d.ts +3 -0
- package/components/mui_extended/ImageButton/ImageButton.d.ts +6 -0
- package/components/mui_extended/ImageButton/styles.d.ts +2 -0
- package/components/mui_extended/ImageButton/types.d.ts +0 -2
- package/components/mui_extended/ImageButton/utils/Clases/constants.d.ts +1 -0
- package/components/mui_extended/ImageButton/utils/Clases/index.d.ts +6 -0
- package/components/mui_extended/ImageButton/utils/Clases/types.d.ts +3 -0
- package/components/mui_extended/MenuActions/{index.ee17bddd.js → index.1261168c.js} +2 -2
- package/components/mui_extended/Pager/{index.74d3f5fc.js → index.80ccec47.js} +1 -1
- package/components/mui_extended/Popover/Popover.d.ts +9 -0
- package/components/mui_extended/Popover/classes/index.d.ts +8 -0
- package/components/mui_extended/Popover/classes/types.d.ts +17 -0
- package/components/mui_extended/Popover/{index.53c77d23.js → index.58c49cc0.js} +55 -13
- package/components/mui_extended/Popover/styles.d.ts +1 -0
- package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +3 -0
- package/components/mui_extended/Popover/types.d.ts +1 -1
- package/components/mui_extended/Typography/index.be3a279a.js +63 -0
- package/components/mui_extended/Typography/index.d.ts +3 -0
- package/components/mui_extended/Typography/styles.d.ts +2 -0
- package/components/mui_extended/Typography/utils/Clases/index.d.ts +6 -0
- package/components/mui_extended/Typography/utils/Clases/types.d.ts +3 -0
- package/components/mui_extended/index.3106c913.js +19 -0
- package/components/mui_extended/index.d.ts +5 -4
- package/contexts/ModalContext/{index.b90eec94.js → index.c8212291.js} +1 -1
- package/contexts/RHFormContext/{index.d88e6e27.js → index.828b60ad.js} +1 -1
- package/contexts/index.d.ts +1 -1
- package/hooks/index.d.ts +0 -1
- package/hooks/useFormAddEdit/{index.d4845f1a.js → index.15de3ba8.js} +5 -0
- package/hooks/useModal/{index.d14edee3.js → index.19172e70.js} +1 -1
- package/index.js +165 -109
- package/package.json +13 -8
- package/{react-draggable.84d6b038.js → react-draggable.0eef011c.js} +1 -1
- package/{react-resizable.1d00271d.js → react-resizable.bb58c8fc.js} +103 -67
- package/utils/{index.899eb67b.js → index.e882b264.js} +26 -18
- package/vite-env.d.ts +2 -1
- package/components/DynamicFilter/components/PopupEditFilter/styles.d.ts +0 -6
- package/components/ErrorLabel/index.c8615f16.js +0 -20
- package/components/areas/components/Window/contexts/WindowContext/index.d.ts +0 -5
- package/components/areas/components/Window/contexts/WindowContext/types.d.ts +0 -13
- package/components/areas/components/Window/hooks/useWindow/index.d.ts +0 -1
- package/components/areas/components/WindowPopUp/index.214cf099.js +0 -120
- package/components/areas/components/WindowPopUp/styles.d.ts +0 -2
- package/components/areas/contexts/AreaContext/index.4894cf23.js +0 -286
- package/components/areas/contexts/AreasContext/index.cd8e4bee.js +0 -158
- package/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +0 -17
- package/components/areas/contexts/index.f9196fb2.js +0 -1
- package/components/areas/hooks/useArea/index.9b85ce24.js +0 -19
- package/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +0 -11
- package/components/areas/index.d1bf612c.js +0 -16
- package/components/formatters/dicctionary.d.ts +0 -3
- package/components/formatters/index.0b5f95d0.js +0 -21
- package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +0 -68
- package/components/hook-form/RHFCheckbox/index.d.ts +0 -4
- package/components/hook-form/RHFTextField/index.b17d68f4.js +0 -146
- package/components/modal/index.8387e90e.js +0 -18
- package/components/mui_extended/Button/index.86a155a2.js +0 -101
- package/components/mui_extended/IconButton/index.82f16572.js +0 -63
- package/components/mui_extended/ImageButton/index.d.ts +0 -3
- package/components/mui_extended/Popover/index.d.ts +0 -4
- package/components/mui_extended/Typography/index.e5494696.js +0 -35
- package/components/mui_extended/index.85dfadf1.js +0 -16
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/components/ApplyedFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/components/ApplyedFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ApplyedFilters/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ClearFilters/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/ClearFilters/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/FilterButton/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/FilterButton/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/InputFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/InputFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/PopupEditFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/BooleanFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/BooleanFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/DateTimeFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/DateTimeFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/NumberFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/NumberFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/StringFilter/index.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/StringFilter/styles.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/factory.d.ts +0 -0
- /package/components/DynamicFilter/{components → subcomponents}/fieldstypes/validations.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{Header → InnerForHooks/subcomponents/Header}/index.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{Header → InnerForHooks/subcomponents/Header}/skeleton.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{Header → InnerForHooks/subcomponents/Header}/styles.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -0
- /package/components/areas/components/Window/subcomponents/{MicroFrontend → InnerForHooks/subcomponents/MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -0
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import React__default, { createContext, forwardRef, useState, useRef, useImperativeHandle, useCallback, useEffect } from "react";
|
|
2
|
-
import isEqual from "lodash/isEqual";
|
|
3
|
-
import debounce from "lodash/debounce";
|
|
4
|
-
import { W as Window } from "../../components/Window/index.252fbf4e.js";
|
|
5
|
-
import { u as useModal } from "../../../../hooks/useModal/index.d14edee3.js";
|
|
6
|
-
import { useNetwork } from "@m4l/core";
|
|
7
|
-
import { u as useAreas } from "../../hooks/useArea/index.9b85ce24.js";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
const AreaContext = createContext(null);
|
|
10
|
-
const getParmsFromValue = (key, data) => {
|
|
11
|
-
try {
|
|
12
|
-
if (Array.isArray(data)) {
|
|
13
|
-
let ob = data.find((f) => f.id === key);
|
|
14
|
-
if (ob) {
|
|
15
|
-
ob = JSON.parse(ob.value);
|
|
16
|
-
}
|
|
17
|
-
return ob;
|
|
18
|
-
}
|
|
19
|
-
} catch (error) {
|
|
20
|
-
}
|
|
21
|
-
return void 0;
|
|
22
|
-
};
|
|
23
|
-
const AreaProvider = forwardRef((props, ref) => {
|
|
24
|
-
const {
|
|
25
|
-
children,
|
|
26
|
-
id,
|
|
27
|
-
active
|
|
28
|
-
} = props;
|
|
29
|
-
const {
|
|
30
|
-
networkOperation
|
|
31
|
-
} = useNetwork();
|
|
32
|
-
const [status, setStatus] = useState("init");
|
|
33
|
-
const [layouts, setLayouts] = useState([]);
|
|
34
|
-
const [allLayouts, setAllLayouts] = useState({});
|
|
35
|
-
const [hashWindowsLayouts, setHashhWindowsLayouts] = useState({});
|
|
36
|
-
const windowsLayoutsBack = useRef({});
|
|
37
|
-
const [windowsPopUps, setWindowsPopUps] = useState([]);
|
|
38
|
-
const [, setSelectedWindow] = useState("");
|
|
39
|
-
const {
|
|
40
|
-
openModal,
|
|
41
|
-
closeModal
|
|
42
|
-
} = useModal();
|
|
43
|
-
const {
|
|
44
|
-
activeAreasNetwork
|
|
45
|
-
} = useAreas();
|
|
46
|
-
useImperativeHandle(ref, () => ({
|
|
47
|
-
addWindow
|
|
48
|
-
}), []);
|
|
49
|
-
const WindowPopUpZindex = useRef(999);
|
|
50
|
-
const getWindowPopUpZindex = useCallback(() => {
|
|
51
|
-
WindowPopUpZindex.current++;
|
|
52
|
-
return WindowPopUpZindex.current;
|
|
53
|
-
}, []);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
console.log("useEffect AreaProvider");
|
|
56
|
-
return () => {
|
|
57
|
-
console.log("useEffect cluanUp AreaProvider****");
|
|
58
|
-
};
|
|
59
|
-
}, []);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (active && status === "init") {
|
|
62
|
-
setStatus("load");
|
|
63
|
-
}
|
|
64
|
-
}, [active]);
|
|
65
|
-
console.log("Rendeer AreaProvider status", status, activeAreasNetwork);
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
let mounted = true;
|
|
68
|
-
if (status === "load") {
|
|
69
|
-
if (activeAreasNetwork) {
|
|
70
|
-
console.log("useEffect Load Cargarcokies");
|
|
71
|
-
networkOperation({
|
|
72
|
-
method: "GET",
|
|
73
|
-
endPoint: `cookies`,
|
|
74
|
-
parms: {
|
|
75
|
-
f: [{
|
|
76
|
-
n: "container_id",
|
|
77
|
-
o: "c",
|
|
78
|
-
o1: id
|
|
79
|
-
}]
|
|
80
|
-
},
|
|
81
|
-
toastSuccess: false,
|
|
82
|
-
toastError: false
|
|
83
|
-
}).then((_response) => {
|
|
84
|
-
if (mounted) {
|
|
85
|
-
const layoutParms = getParmsFromValue("layout_parms", _response.data);
|
|
86
|
-
const windows = getParmsFromValue("windows", _response.data);
|
|
87
|
-
if (layoutParms) {
|
|
88
|
-
setAllLayouts(layoutParms);
|
|
89
|
-
}
|
|
90
|
-
if (windows) {
|
|
91
|
-
const newLayouts = [];
|
|
92
|
-
const newHashLayouts = {};
|
|
93
|
-
for (const key in windows) {
|
|
94
|
-
const element = windows[key];
|
|
95
|
-
if (element && element["layoutProps"] && element["mfProps"] && element["emergeType"] === "layout" && element["winType"] === "microfrontend") {
|
|
96
|
-
element["layoutProps"].i = key;
|
|
97
|
-
newLayouts.push(element["layoutProps"]);
|
|
98
|
-
newHashLayouts[key] = {
|
|
99
|
-
...element,
|
|
100
|
-
container_id: key,
|
|
101
|
-
emergeType: "layout",
|
|
102
|
-
onClose: onCloseWindowLayout
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
console.log("GET cookies", layoutParms, newHashLayouts);
|
|
107
|
-
setLayouts(newLayouts);
|
|
108
|
-
setHashhWindowsLayouts(newHashLayouts);
|
|
109
|
-
}
|
|
110
|
-
setStatus("loaded");
|
|
111
|
-
}
|
|
112
|
-
}).catch((_response) => {
|
|
113
|
-
setStatus("loaded");
|
|
114
|
-
});
|
|
115
|
-
} else {
|
|
116
|
-
setStatus("loaded");
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return () => {
|
|
120
|
-
mounted = false;
|
|
121
|
-
};
|
|
122
|
-
}, [status]);
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
console.log("useEffect SaveWindow", status, hashWindowsLayouts);
|
|
125
|
-
if (status === "loaded") {
|
|
126
|
-
let nrKeys = 0;
|
|
127
|
-
const saveObjetc = {};
|
|
128
|
-
for (const key in hashWindowsLayouts) {
|
|
129
|
-
const element = hashWindowsLayouts[key];
|
|
130
|
-
const newElement = {
|
|
131
|
-
...element
|
|
132
|
-
};
|
|
133
|
-
delete newElement.onClose;
|
|
134
|
-
if (element.winType === "microfrontend") {
|
|
135
|
-
saveObjetc[key] = newElement;
|
|
136
|
-
nrKeys++;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
console.log("saveWindows", nrKeys, saveObjetc, JSON.stringify(saveObjetc));
|
|
140
|
-
if (activeAreasNetwork && nrKeys > 0) {
|
|
141
|
-
networkOperation({
|
|
142
|
-
method: "PUT",
|
|
143
|
-
endPoint: `cookies/windows/${id}/nomodule`,
|
|
144
|
-
data: {
|
|
145
|
-
value: JSON.stringify(saveObjetc)
|
|
146
|
-
},
|
|
147
|
-
toastSuccess: false,
|
|
148
|
-
toastError: false
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}, [hashWindowsLayouts]);
|
|
153
|
-
const debouncedLayoutChange = useCallback(debounce((currentLayouts, newAllLayouts) => {
|
|
154
|
-
currentLayouts.forEach((layout) => {
|
|
155
|
-
const {
|
|
156
|
-
i
|
|
157
|
-
} = layout;
|
|
158
|
-
if (i === "none")
|
|
159
|
-
return;
|
|
160
|
-
if (isEqual(layout, windowsLayoutsBack.current[i]))
|
|
161
|
-
return;
|
|
162
|
-
});
|
|
163
|
-
setAllLayouts(newAllLayouts);
|
|
164
|
-
if (activeAreasNetwork) {
|
|
165
|
-
networkOperation({
|
|
166
|
-
method: "PUT",
|
|
167
|
-
endPoint: `cookies/layout_parms/${id}/nomodule`,
|
|
168
|
-
data: {
|
|
169
|
-
value: JSON.stringify(newAllLayouts)
|
|
170
|
-
},
|
|
171
|
-
toastSuccess: false,
|
|
172
|
-
toastError: false
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}, 2e3), [layouts]);
|
|
176
|
-
const onLayoutChange = useCallback((currentLayouts, newAllLayouts) => {
|
|
177
|
-
debouncedLayoutChange(currentLayouts, newAllLayouts);
|
|
178
|
-
}, [debouncedLayoutChange]);
|
|
179
|
-
const onCloseWindowLayout = useCallback((removeLayoutId) => {
|
|
180
|
-
setHashhWindowsLayouts((lastHashhWL) => {
|
|
181
|
-
const newLayouts = {
|
|
182
|
-
...lastHashhWL
|
|
183
|
-
};
|
|
184
|
-
delete newLayouts[removeLayoutId];
|
|
185
|
-
return newLayouts;
|
|
186
|
-
});
|
|
187
|
-
delete windowsLayoutsBack.current[removeLayoutId];
|
|
188
|
-
}, []);
|
|
189
|
-
const onCloseWindowPopUp = useCallback((removePopUpId) => {
|
|
190
|
-
setWindowsPopUps((lastPopUpsMfs) => {
|
|
191
|
-
const newPopUps = [...lastPopUpsMfs];
|
|
192
|
-
return newPopUps.filter((p) => p.container_id !== removePopUpId);
|
|
193
|
-
});
|
|
194
|
-
}, []);
|
|
195
|
-
const onCloseWindowModal = useCallback((_removePopUpId) => {
|
|
196
|
-
closeModal();
|
|
197
|
-
}, []);
|
|
198
|
-
const addWindowPopUp = useCallback((container_id, newWindowPopupProps) => {
|
|
199
|
-
setWindowsPopUps((lastPopUpsMfs) => {
|
|
200
|
-
return [{
|
|
201
|
-
...newWindowPopupProps,
|
|
202
|
-
emergeType: "popup",
|
|
203
|
-
container_id,
|
|
204
|
-
onClose: onCloseWindowPopUp
|
|
205
|
-
}, ...lastPopUpsMfs];
|
|
206
|
-
});
|
|
207
|
-
}, []);
|
|
208
|
-
const addWindowModal = useCallback((container_id, newWindowProps) => {
|
|
209
|
-
openModal({
|
|
210
|
-
window: /* @__PURE__ */ jsx(Window, {
|
|
211
|
-
...newWindowProps,
|
|
212
|
-
container_id,
|
|
213
|
-
onClose: onCloseWindowModal
|
|
214
|
-
})
|
|
215
|
-
});
|
|
216
|
-
}, []);
|
|
217
|
-
const addWindowLayout = useCallback((container_id, newWindow) => {
|
|
218
|
-
const newLayout = {
|
|
219
|
-
...newWindow.layoutProps,
|
|
220
|
-
i: container_id,
|
|
221
|
-
isDraggable: true,
|
|
222
|
-
isResizable: true,
|
|
223
|
-
winType: newWindow.winType
|
|
224
|
-
};
|
|
225
|
-
setLayouts((lastLayout) => [...lastLayout, newLayout]);
|
|
226
|
-
setHashhWindowsLayouts((lastHashWindowsLayouts) => {
|
|
227
|
-
return {
|
|
228
|
-
...lastHashWindowsLayouts,
|
|
229
|
-
[container_id]: {
|
|
230
|
-
...newWindow,
|
|
231
|
-
container_id,
|
|
232
|
-
emergeType: "layout",
|
|
233
|
-
onClose: onCloseWindowLayout
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
});
|
|
237
|
-
windowsLayoutsBack.current[container_id] = {
|
|
238
|
-
...newLayout
|
|
239
|
-
};
|
|
240
|
-
}, []);
|
|
241
|
-
const addWindow = useCallback((newWindow) => {
|
|
242
|
-
const newId = `${id}_window_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
243
|
-
console.log("addWindow", newWindow.winType, newWindow.emergeType, newId);
|
|
244
|
-
if (newWindow.emergeType === "layout") {
|
|
245
|
-
addWindowLayout(newId, newWindow);
|
|
246
|
-
} else if (newWindow.emergeType === "popup") {
|
|
247
|
-
addWindowPopUp(newId, newWindow);
|
|
248
|
-
} else if (newWindow.emergeType === "modal") {
|
|
249
|
-
addWindowModal(newId, newWindow);
|
|
250
|
-
}
|
|
251
|
-
return newId;
|
|
252
|
-
}, []);
|
|
253
|
-
const isWindowSelected = useCallback((lookForThisId) => {
|
|
254
|
-
if (windowsPopUps.findIndex((wp) => wp.container_id === lookForThisId) > -1) {
|
|
255
|
-
return true;
|
|
256
|
-
}
|
|
257
|
-
return false;
|
|
258
|
-
}, [hashWindowsLayouts, windowsPopUps]);
|
|
259
|
-
const selectWindow = useCallback((newSeletectedId) => {
|
|
260
|
-
setSelectedWindow(newSeletectedId);
|
|
261
|
-
}, []);
|
|
262
|
-
return /* @__PURE__ */ jsx(AreaContext.Provider, {
|
|
263
|
-
value: {
|
|
264
|
-
id,
|
|
265
|
-
status,
|
|
266
|
-
isWindowSelected,
|
|
267
|
-
selectWindow,
|
|
268
|
-
getWindowPopUpZindex,
|
|
269
|
-
allLayouts,
|
|
270
|
-
layouts,
|
|
271
|
-
hashWindowsLayouts,
|
|
272
|
-
addWindow,
|
|
273
|
-
onCloseWindowLayout,
|
|
274
|
-
onLayoutChange,
|
|
275
|
-
windowsPopUps,
|
|
276
|
-
onCloseWindowPopUp
|
|
277
|
-
},
|
|
278
|
-
children
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
AreaProvider.displayName = "AreaProvider";
|
|
282
|
-
React__default.memo(AreaProvider);
|
|
283
|
-
export {
|
|
284
|
-
AreaProvider as A,
|
|
285
|
-
AreaContext as a
|
|
286
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { createContext, useState, useRef, useCallback, useEffect } from "react";
|
|
2
|
-
import { useHostTools, useModuleDictionary, useNetwork, EmitEvents } from "@m4l/core";
|
|
3
|
-
import { L as LABEL_NEW_AREA } from "../../index.d1bf612c.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
const AreasContext = createContext(null);
|
|
6
|
-
function AreasProvider(props) {
|
|
7
|
-
const {
|
|
8
|
-
children,
|
|
9
|
-
activeAreasNetwork,
|
|
10
|
-
onLoad
|
|
11
|
-
} = props;
|
|
12
|
-
const [areas, setAreas] = useState([]);
|
|
13
|
-
const {
|
|
14
|
-
events_add_listener,
|
|
15
|
-
events_remove_listener
|
|
16
|
-
} = useHostTools();
|
|
17
|
-
const {
|
|
18
|
-
getLabel
|
|
19
|
-
} = useModuleDictionary();
|
|
20
|
-
const [status, setStatus] = useState("init");
|
|
21
|
-
const {
|
|
22
|
-
networkOperation
|
|
23
|
-
} = useNetwork();
|
|
24
|
-
const [currentArea, setCurrentArea] = useState(areas.length > 0 ? areas[0].id : "");
|
|
25
|
-
const currentAreaRef = useRef(areas.length > 0 ? areas[0].id : "");
|
|
26
|
-
const areaRefs = useRef({});
|
|
27
|
-
const addWindow = useCallback((newWindow) => {
|
|
28
|
-
let current;
|
|
29
|
-
console.log("addWindow raw");
|
|
30
|
-
if (areaRefs.current && areaRefs.current[currentAreaRef.current]) {
|
|
31
|
-
current = areaRefs.current[currentAreaRef.current];
|
|
32
|
-
}
|
|
33
|
-
if (current && current.addWindow) {
|
|
34
|
-
current.addWindow(newWindow);
|
|
35
|
-
}
|
|
36
|
-
}, []);
|
|
37
|
-
const addArea = useCallback(() => {
|
|
38
|
-
const newId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
39
|
-
const newName = `${getLabel(LABEL_NEW_AREA)} ${areas.length + 1}`;
|
|
40
|
-
setAreas((lastAreas) => [...lastAreas, {
|
|
41
|
-
id: newId,
|
|
42
|
-
url_icon: "",
|
|
43
|
-
name: newName,
|
|
44
|
-
loadWindows: false
|
|
45
|
-
}]);
|
|
46
|
-
selectArea(newId);
|
|
47
|
-
if (activeAreasNetwork) {
|
|
48
|
-
networkOperation({
|
|
49
|
-
method: "POST",
|
|
50
|
-
endPoint: `areas`,
|
|
51
|
-
data: {
|
|
52
|
-
id: newId,
|
|
53
|
-
name: newName
|
|
54
|
-
},
|
|
55
|
-
toastSuccess: false,
|
|
56
|
-
toastError: false
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return newId;
|
|
60
|
-
}, [getLabel]);
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
events_add_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
|
|
63
|
-
console.log("useEffect AreasProvider Emmiter");
|
|
64
|
-
return () => {
|
|
65
|
-
events_remove_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
|
|
66
|
-
};
|
|
67
|
-
}, []);
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
let mounted = true;
|
|
70
|
-
if (status === "init") {
|
|
71
|
-
if (activeAreasNetwork) {
|
|
72
|
-
setStatus("loading");
|
|
73
|
-
networkOperation({
|
|
74
|
-
method: "GET",
|
|
75
|
-
endPoint: `areas`,
|
|
76
|
-
parms: {},
|
|
77
|
-
toastSuccess: false
|
|
78
|
-
}).then((response) => {
|
|
79
|
-
if (mounted) {
|
|
80
|
-
if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
|
|
81
|
-
setAreas(response.data);
|
|
82
|
-
selectArea(response.data[0].id);
|
|
83
|
-
} else {
|
|
84
|
-
addArea();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}).finally(() => {
|
|
88
|
-
setStatus("loaded");
|
|
89
|
-
});
|
|
90
|
-
} else {
|
|
91
|
-
addArea();
|
|
92
|
-
setStatus("loaded");
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
console.log("useEffect AreasProvider");
|
|
96
|
-
return () => {
|
|
97
|
-
console.log("useEffect cluanUp AreasProvider *** no deber\xEDa darse");
|
|
98
|
-
mounted = false;
|
|
99
|
-
};
|
|
100
|
-
}, []);
|
|
101
|
-
useEffect(() => {
|
|
102
|
-
if (status === "loaded") {
|
|
103
|
-
console.log("useEffect Areas loaded");
|
|
104
|
-
onLoad && onLoad();
|
|
105
|
-
}
|
|
106
|
-
}, [status]);
|
|
107
|
-
const selectArea = (newId) => {
|
|
108
|
-
currentAreaRef.current = newId;
|
|
109
|
-
setCurrentArea(newId);
|
|
110
|
-
};
|
|
111
|
-
const deleteArea = (areaId) => {
|
|
112
|
-
let newAreas = [];
|
|
113
|
-
setAreas((lastAreas) => {
|
|
114
|
-
newAreas = [...lastAreas];
|
|
115
|
-
newAreas = lastAreas.filter((area) => area.id !== areaId);
|
|
116
|
-
return newAreas;
|
|
117
|
-
});
|
|
118
|
-
if (currentAreaRef.current === areaId) {
|
|
119
|
-
if (newAreas.length > 0) {
|
|
120
|
-
selectArea(newAreas[0].id);
|
|
121
|
-
} else {
|
|
122
|
-
selectArea("");
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (activeAreasNetwork) {
|
|
126
|
-
networkOperation({
|
|
127
|
-
method: "DELETE",
|
|
128
|
-
endPoint: `areas/${areaId}`,
|
|
129
|
-
parms: {},
|
|
130
|
-
toastSuccess: false,
|
|
131
|
-
toastError: false
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const setAreaRef = (areaId, ref) => {
|
|
136
|
-
console.log("setAreaRef", areaRefs.current[areaId] === ref, areaRefs.current[areaId]?.addWindow === ref?.addWindow, JSON.stringify(areaRefs.current[areaId]) === JSON.stringify(ref), areaRefs.current[areaId], ref);
|
|
137
|
-
if (areaRefs.current[areaId] !== ref) {
|
|
138
|
-
areaRefs.current[areaId] = ref;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
return /* @__PURE__ */ jsx(AreasContext.Provider, {
|
|
142
|
-
value: {
|
|
143
|
-
status,
|
|
144
|
-
activeAreasNetwork,
|
|
145
|
-
areas,
|
|
146
|
-
currentArea,
|
|
147
|
-
addArea,
|
|
148
|
-
deleteArea,
|
|
149
|
-
selectArea,
|
|
150
|
-
setAreaRef
|
|
151
|
-
},
|
|
152
|
-
children
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
export {
|
|
156
|
-
AreasContext as A,
|
|
157
|
-
AreasProvider as a
|
|
158
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
const DynamicMFParmsContext = createContext(null);
|
|
4
|
-
function DynamicMFParmsProvider(props) {
|
|
5
|
-
const {
|
|
6
|
-
children,
|
|
7
|
-
...other
|
|
8
|
-
} = props;
|
|
9
|
-
return /* @__PURE__ */ jsx(DynamicMFParmsContext.Provider, {
|
|
10
|
-
value: other,
|
|
11
|
-
children
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
DynamicMFParmsProvider as D,
|
|
16
|
-
DynamicMFParmsContext as a
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./AreasContext/index.cd8e4bee.js";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { A as AreasContext } from "../../contexts/AreasContext/index.cd8e4bee.js";
|
|
3
|
-
import { a as AreaContext } from "../../contexts/AreaContext/index.4894cf23.js";
|
|
4
|
-
function useAreas() {
|
|
5
|
-
const context = useContext(AreasContext);
|
|
6
|
-
if (!context)
|
|
7
|
-
throw new Error("useAreas context must be use inside AreasContext");
|
|
8
|
-
return context;
|
|
9
|
-
}
|
|
10
|
-
const useArea = () => {
|
|
11
|
-
const context = useContext(AreaContext);
|
|
12
|
-
if (!context)
|
|
13
|
-
throw new Error("useArea context must be use inside AreaContext");
|
|
14
|
-
return context;
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
useArea as a,
|
|
18
|
-
useAreas as u
|
|
19
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { a as DynamicMFParmsContext } from "../../contexts/DynamicMFParmsContext/index.668bc2e2.js";
|
|
3
|
-
const useDynamicMFParameters = () => {
|
|
4
|
-
const context = useContext(DynamicMFParmsContext);
|
|
5
|
-
if (!context)
|
|
6
|
-
throw new Error("useDynamicMFParameters context must be use inside DynamicMFParmsContext");
|
|
7
|
-
return context;
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
useDynamicMFParameters as u
|
|
11
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "./components/index.7d6cd649.js";
|
|
2
|
-
import "./components/AreasAdmin/index.6794b22f.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "@m4l/core";
|
|
5
|
-
import "@mui/material";
|
|
6
|
-
import "../Icon/index.8d754623.js";
|
|
7
|
-
import "@mui/material/styles";
|
|
8
|
-
import "react/jsx-runtime";
|
|
9
|
-
import "./contexts/AreasContext/index.cd8e4bee.js";
|
|
10
|
-
import "./components/AreasContainer/index.a2f8899b.js";
|
|
11
|
-
import "react-grid-layout/css/styles.css";
|
|
12
|
-
import "../../react-resizable.1d00271d.js";
|
|
13
|
-
const LABEL_NEW_AREA = "label_new_area";
|
|
14
|
-
export {
|
|
15
|
-
LABEL_NEW_AREA as L
|
|
16
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import "@m4l/core";
|
|
3
|
-
import "../Icon/index.8d754623.js";
|
|
4
|
-
import "@mui/material/styles";
|
|
5
|
-
import "react/jsx-runtime";
|
|
6
|
-
import "@m4l/graphics";
|
|
7
|
-
function getFormattersComponentsDictionary() {
|
|
8
|
-
return ["formatters"];
|
|
9
|
-
}
|
|
10
|
-
const defaultFormattersDictionary = {
|
|
11
|
-
pager: {
|
|
12
|
-
boolean_yes: "Yes",
|
|
13
|
-
boolean_no: "No",
|
|
14
|
-
boolean_true: "True",
|
|
15
|
-
boolean_false: "False"
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
defaultFormattersDictionary as d,
|
|
20
|
-
getFormattersComponentsDictionary as g
|
|
21
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
2
|
-
import { styled as styled$1 } from "@mui/material/styles";
|
|
3
|
-
import { styled, Skeleton, FormControlLabel, Checkbox } from "@mui/material";
|
|
4
|
-
import { useModuleSkeleton } from "@m4l/core";
|
|
5
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
6
|
-
const WrapperSkeletonCheckBox = styled("div")(() => ({
|
|
7
|
-
display: "flex",
|
|
8
|
-
justifyContent: "center",
|
|
9
|
-
alignItems: "center",
|
|
10
|
-
width: "36px",
|
|
11
|
-
height: "36px"
|
|
12
|
-
}));
|
|
13
|
-
const SkeletonCheckBox = () => {
|
|
14
|
-
return /* @__PURE__ */ jsx(WrapperSkeletonCheckBox, {
|
|
15
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
16
|
-
variant: "rounded",
|
|
17
|
-
width: "18px",
|
|
18
|
-
height: "18px"
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const ErrorLabel = styled$1("p")(({
|
|
23
|
-
theme
|
|
24
|
-
}) => ({
|
|
25
|
-
...theme.typography.caption,
|
|
26
|
-
color: theme.palette.error.main,
|
|
27
|
-
marginRight: 14,
|
|
28
|
-
marginLeft: 14
|
|
29
|
-
}));
|
|
30
|
-
function RHFCheckbox({
|
|
31
|
-
name,
|
|
32
|
-
sizeCheck = "small",
|
|
33
|
-
...other
|
|
34
|
-
}) {
|
|
35
|
-
const {
|
|
36
|
-
control
|
|
37
|
-
} = useFormContext();
|
|
38
|
-
const isSkeleton = useModuleSkeleton();
|
|
39
|
-
return /* @__PURE__ */ jsx(FormControlLabel, {
|
|
40
|
-
control: /* @__PURE__ */ jsx(Controller, {
|
|
41
|
-
name,
|
|
42
|
-
control,
|
|
43
|
-
render: ({
|
|
44
|
-
field,
|
|
45
|
-
fieldState: {
|
|
46
|
-
error
|
|
47
|
-
}
|
|
48
|
-
}) => {
|
|
49
|
-
if (isSkeleton) {
|
|
50
|
-
return /* @__PURE__ */ jsx(SkeletonCheckBox, {});
|
|
51
|
-
}
|
|
52
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
53
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
54
|
-
size: sizeCheck,
|
|
55
|
-
...field,
|
|
56
|
-
checked: field.value
|
|
57
|
-
}), error?.message && /* @__PURE__ */ jsx(ErrorLabel, {
|
|
58
|
-
children: error?.message + ""
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
|
-
...other
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
RHFCheckbox as R
|
|
68
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { RHFCheckboxProps } from './types';
|
|
3
|
-
export declare const ErrorLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
4
|
-
export declare function RHFCheckbox({ name, sizeCheck, ...other }: RHFCheckboxProps): JSX.Element;
|