@m4l/components 0.1.42 → 0.1.44
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.82569769.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.c8754d33.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.fd736623.js} +42 -15
- package/components/DynamicFilter/contexts/BaseContext/types.d.ts +3 -0
- package/components/DynamicFilter/{index.071aa795.js → index.4c43cc99.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.d605b574.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.91d29e9e.js} +22 -11
- package/components/PaperForm/{index.c5948756.js → index.0114aa9b.js} +1 -1
- package/components/Period/{index.abe445bd.js → index.c439d1ed.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.7a526b73.js} +24 -15
- package/components/areas/components/AreasContainer/{index.a2f8899b.js → index.ca690110.js} +9 -10
- package/components/areas/components/GridLayout/{index.b9c1e846.js → index.4fb84fff.js} +28 -18
- package/components/areas/components/Window/{index.252fbf4e.js → index.76143c30.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.33bc0a5a.js +117 -0
- package/components/areas/components/WindowPopUp/index.d.ts +2 -1
- package/components/areas/components/{index.7d6cd649.js → index.4b828081.js} +18 -13
- package/components/areas/components/index.d.ts +2 -1
- package/components/areas/contexts/AreaContext/helper.d.ts +12 -0
- package/components/areas/contexts/AreaContext/index.d.ts +2 -2
- package/components/areas/contexts/AreaContext/index.ec85aee7.js +392 -0
- 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.d.ts +10 -2
- package/components/areas/contexts/AreasContext/index.e65fd347.js +204 -0
- 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.137257b8.js +203 -0
- package/components/areas/contexts/index.d.ts +4 -1
- package/components/areas/hooks/index.b8c93059.js +27 -0
- package/components/areas/hooks/index.d.ts +2 -0
- package/components/areas/hooks/useArea/index.89306f6a.js +20 -0
- package/components/areas/hooks/useArea/index.d.ts +2 -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.a2586fb3.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.3c5e5fb7.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.ff74f597.js} +3 -4
- package/components/modal/{WindowConfirm.0b8a6818.js → WindowConfirm.f2cc1072.js} +22 -11
- package/components/modal/index.f62c55c7.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.4442afd9.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.2f5abe84.js} +1 -1
- package/index.js +165 -109
- package/package.json +12 -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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AreaProviderRef } from '../AreaContext/types';
|
|
2
|
+
import { AreaType } from '../../components/Area/types';
|
|
3
|
+
import { GetLabelType, NetworkProps } from '@m4l/core';
|
|
4
|
+
import { WritableDraft } from 'immer/dist/internal';
|
|
5
|
+
export declare type AreasStatus = 'init' | 'loading' | 'loaded' | 'error';
|
|
6
|
+
export interface AreasState {
|
|
7
|
+
networkOperation: (props: NetworkProps) => Promise<any>;
|
|
8
|
+
getLabel: GetLabelType;
|
|
9
|
+
loadAreasFromNetwork: boolean;
|
|
10
|
+
currentArea: string;
|
|
11
|
+
status: AreasStatus;
|
|
12
|
+
areas: AreaType[];
|
|
13
|
+
}
|
|
14
|
+
export interface AreasStateWithActions extends AreasState {
|
|
15
|
+
actions: {
|
|
16
|
+
addArea: () => string;
|
|
17
|
+
deleteArea: (areaId: string) => void;
|
|
18
|
+
selectArea: (newAreaId: string) => void;
|
|
19
|
+
};
|
|
20
|
+
internalActions: {
|
|
21
|
+
setHandlerGetLabel: (newHandler: GetLabelType) => void;
|
|
22
|
+
loadFromApi: () => void;
|
|
23
|
+
setAreaRef: (areaId: string, ref: AreaProviderRef) => void;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
declare type DefaultStoreProps = Omit<AreasState, 'currentArea'>;
|
|
27
|
+
declare type InitialStoreProps = Pick<AreasState, 'networkOperation' | 'loadAreasFromNetwork' | 'getLabel'> & Partial<DefaultStoreProps>;
|
|
28
|
+
export declare const createAreasStore: (initProps: InitialStoreProps) => Omit<Omit<import("zustand").StoreApi<AreasStateWithActions>, "setState"> & {
|
|
29
|
+
setState<A extends string | {
|
|
30
|
+
type: unknown;
|
|
31
|
+
}>(partial: AreasStateWithActions | Partial<AreasStateWithActions> | ((state: AreasStateWithActions) => AreasStateWithActions | Partial<AreasStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
32
|
+
}, "setState"> & {
|
|
33
|
+
setState(nextStateOrUpdater: AreasStateWithActions | Partial<AreasStateWithActions> | ((state: WritableDraft<AreasStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
34
|
+
type: unknown;
|
|
35
|
+
} | undefined): void;
|
|
36
|
+
};
|
|
37
|
+
export declare type AreasStore = ReturnType<typeof createAreasStore>;
|
|
38
|
+
export {};
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { AreaType } from '../../components/Area/types';
|
|
3
|
-
import { AreaProviderRef } from '../AreaContext/types';
|
|
4
|
-
export declare type AreasStatus = 'init' | 'loading' | 'loaded' | 'error';
|
|
5
2
|
export interface AreasProviderProps {
|
|
6
3
|
children: ReactNode;
|
|
7
|
-
|
|
4
|
+
loadAreasFromNetwork: boolean;
|
|
8
5
|
onLoad?: () => void;
|
|
9
6
|
}
|
|
10
|
-
export interface AreasContextProps extends Omit<AreasProviderProps, 'children' | 'onLoad'> {
|
|
11
|
-
currentArea: string;
|
|
12
|
-
status: AreasStatus;
|
|
13
|
-
addArea: () => string;
|
|
14
|
-
deleteArea: (areaId: string) => void;
|
|
15
|
-
selectArea: (newAreaId: string) => void;
|
|
16
|
-
areas: AreaType[];
|
|
17
|
-
setAreaRef: (areaId: string, ref: AreaProviderRef) => void;
|
|
18
|
-
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createStore } from "zustand";
|
|
2
|
+
import { devtools } from "zustand/middleware";
|
|
3
|
+
import { immer } from "zustand/middleware/immer";
|
|
4
|
+
import React__default, { createContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
const createDynamicMFStore = (initProps) => {
|
|
7
|
+
const startProps = {
|
|
8
|
+
...initProps
|
|
9
|
+
};
|
|
10
|
+
return createStore(
|
|
11
|
+
devtools(
|
|
12
|
+
immer((set, _get) => ({
|
|
13
|
+
...startProps,
|
|
14
|
+
actions: {
|
|
15
|
+
changeData: (newDynamicMFState) => {
|
|
16
|
+
set((state) => {
|
|
17
|
+
state.dynamicMFParameters = newDynamicMFState;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
})),
|
|
22
|
+
{ name: `dyamic store ${initProps.windowId}` }
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
const DynamicMFParmsContext = createContext(null);
|
|
27
|
+
function DynamicMFParmsProvider(props) {
|
|
28
|
+
const {
|
|
29
|
+
children,
|
|
30
|
+
store
|
|
31
|
+
} = props;
|
|
32
|
+
return /* @__PURE__ */ jsx(DynamicMFParmsContext.Provider, {
|
|
33
|
+
value: store,
|
|
34
|
+
children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const MemonizedDynamicMFParmsProvider = React__default.memo(DynamicMFParmsProvider);
|
|
38
|
+
export {
|
|
39
|
+
DynamicMFParmsProvider as D,
|
|
40
|
+
MemonizedDynamicMFParmsProvider as M,
|
|
41
|
+
DynamicMFParmsContext as a,
|
|
42
|
+
createDynamicMFStore as c
|
|
43
|
+
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
declare const DynamicMFParmsContext: import("
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DynamicMFParmsProviderProps } from './types';
|
|
3
|
+
declare const DynamicMFParmsContext: React.Context<(Omit<Omit<import("zustand").StoreApi<import("./store").DynamicMFStateWithActions>, "setState"> & {
|
|
4
|
+
setState<A extends string | {
|
|
5
|
+
type: unknown;
|
|
6
|
+
}>(partial: import("./store").DynamicMFStateWithActions | Partial<import("./store").DynamicMFStateWithActions> | ((state: import("./store").DynamicMFStateWithActions) => import("./store").DynamicMFStateWithActions | Partial<import("./store").DynamicMFStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
7
|
+
}, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: import("./store").DynamicMFStateWithActions | Partial<import("./store").DynamicMFStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./store").DynamicMFStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
} | undefined): void;
|
|
11
|
+
}) | null>;
|
|
4
12
|
declare function DynamicMFParmsProvider(props: DynamicMFParmsProviderProps): JSX.Element;
|
|
5
|
-
|
|
13
|
+
declare const MemonizedDynamicMFParmsProvider: React.MemoExoticComponent<typeof DynamicMFParmsProvider>;
|
|
14
|
+
export { DynamicMFParmsProvider, DynamicMFParmsContext, MemonizedDynamicMFParmsProvider };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DynamicMFParameters } from '..';
|
|
2
|
+
export interface DynamicMFState {
|
|
3
|
+
dynamicMFParameters: DynamicMFParameters;
|
|
4
|
+
windowId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DynamicMFStateWithActions extends DynamicMFState {
|
|
7
|
+
actions: {
|
|
8
|
+
changeData: (newDynamicMFState: DynamicMFParameters) => void;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const createDynamicMFStore: (initProps: DynamicMFState) => Omit<Omit<import("zustand").StoreApi<DynamicMFStateWithActions>, "setState"> & {
|
|
12
|
+
setState<A extends string | {
|
|
13
|
+
type: unknown;
|
|
14
|
+
}>(partial: DynamicMFStateWithActions | Partial<DynamicMFStateWithActions> | ((state: DynamicMFStateWithActions) => DynamicMFStateWithActions | Partial<DynamicMFStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
15
|
+
}, "setState"> & {
|
|
16
|
+
setState(nextStateOrUpdater: DynamicMFStateWithActions | Partial<DynamicMFStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<DynamicMFStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
17
|
+
type: unknown;
|
|
18
|
+
} | undefined): void;
|
|
19
|
+
};
|
|
20
|
+
export declare type DynamicMFStore = ReturnType<typeof createDynamicMFStore>;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare type
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
tag?: any;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare type IsolationDynamicMFParameters = Record<string, any>;
|
|
10
|
-
export interface DynamicMFParameters extends IsolationDynamicMFParameters {
|
|
11
|
-
setModuleActions: (newActions: ModuleAction[]) => void;
|
|
12
|
-
}
|
|
13
|
-
export interface DynamicMFParameters extends IsolationDynamicMFParameters {
|
|
14
|
-
setModuleActions: (newActions: ModuleAction[]) => void;
|
|
15
|
-
}
|
|
16
|
-
export interface DynamicMFParmsProviderProps extends DynamicMFParameters {
|
|
2
|
+
import { DynamicMFStore } from './store';
|
|
3
|
+
export declare type DynamicMFParameters = Record<string, any>;
|
|
4
|
+
export interface DynamicMFParmsProviderProps {
|
|
5
|
+
store: DynamicMFStore;
|
|
17
6
|
children: ReactNode;
|
|
18
7
|
}
|
|
19
|
-
export declare type DynamicMFParmsContextProps = Omit<DynamicMFParmsProviderProps, 'children'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCookiesContainer(data: any, containerId: string): Record<string, any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WindowProviderProps } from './types';
|
|
3
|
+
declare const WindowContext: import("react").Context<(Omit<Omit<import("zustand").StoreApi<import("./store").WindowStateWithActions>, "setState"> & {
|
|
4
|
+
setState<A extends string | {
|
|
5
|
+
type: unknown;
|
|
6
|
+
}>(partial: import("./store").WindowStateWithActions | Partial<import("./store").WindowStateWithActions> | ((state: import("./store").WindowStateWithActions) => import("./store").WindowStateWithActions | Partial<import("./store").WindowStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
7
|
+
}, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: import("./store").WindowStateWithActions | Partial<import("./store").WindowStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./store").WindowStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
} | undefined): void;
|
|
11
|
+
}) | null>;
|
|
12
|
+
declare function WindowMFProvider(props: WindowProviderProps): JSX.Element;
|
|
13
|
+
export { WindowMFProvider, WindowContext };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ModuleAction, WindowToolsMF } from '..';
|
|
2
|
+
import { Cookies, WindowBaseProps } from '../../components/Area/types';
|
|
3
|
+
import { NetworkProps } from '@m4l/core';
|
|
4
|
+
import { DynamicMFStore } from '../DynamicMFParmsContext/store';
|
|
5
|
+
export declare type WindowStatus = 'init' | 'loaded' | 'error';
|
|
6
|
+
export interface WindowState extends WindowBaseProps {
|
|
7
|
+
status: WindowStatus;
|
|
8
|
+
dynamicMFStore: DynamicMFStore;
|
|
9
|
+
moduleActions: ModuleAction[];
|
|
10
|
+
networkOperation: (props: NetworkProps) => Promise<any>;
|
|
11
|
+
cookies: Cookies;
|
|
12
|
+
}
|
|
13
|
+
export interface WindowStateWithActions extends WindowState {
|
|
14
|
+
actions: WindowToolsMF;
|
|
15
|
+
internalActions: {
|
|
16
|
+
loadCookiesFromApi: () => void;
|
|
17
|
+
saveModuleCookies: () => void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare type InitialStoreProps = Omit<WindowState, 'moduleActions' | 'cookies' | 'status'>;
|
|
21
|
+
export declare const createWindowStore: (initProps: InitialStoreProps) => Omit<Omit<import("zustand").StoreApi<WindowStateWithActions>, "setState"> & {
|
|
22
|
+
setState<A extends string | {
|
|
23
|
+
type: unknown;
|
|
24
|
+
}>(partial: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: WindowStateWithActions) => WindowStateWithActions | Partial<WindowStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
25
|
+
}, "setState"> & {
|
|
26
|
+
setState(nextStateOrUpdater: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<WindowStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
27
|
+
type: unknown;
|
|
28
|
+
} | undefined): void;
|
|
29
|
+
};
|
|
30
|
+
export declare type WindowStore = ReturnType<typeof createWindowStore>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WindowToolsMFContextProps, WindowToolsMFProviderProps } from './types';
|
|
3
|
+
declare const WindowToolsMFContext: React.Context<WindowToolsMFContextProps | null>;
|
|
4
|
+
declare function WindowToolsMFProvider(props: WindowToolsMFProviderProps): JSX.Element;
|
|
5
|
+
declare const MemonizedWindowToolsMFContext: React.MemoExoticComponent<typeof WindowToolsMFProvider>;
|
|
6
|
+
export { WindowToolsMFProvider, WindowToolsMFContext, MemonizedWindowToolsMFContext };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MenuAction } from '../../../mui_extended';
|
|
3
|
+
import { CookieType } from '../../components/Area/types';
|
|
4
|
+
export declare type WindowActionType = 'main' | 'allways' | 'normal';
|
|
5
|
+
export interface ModuleAction extends MenuAction {
|
|
6
|
+
visibility: WindowActionType;
|
|
7
|
+
tag?: any;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WindowToolsMF {
|
|
11
|
+
getCookie: (id: string) => Record<string, any> | undefined;
|
|
12
|
+
getWindowId: () => string;
|
|
13
|
+
getCookies: (type: CookieType) => Record<string, any>;
|
|
14
|
+
setActions: (newActions: ModuleAction[]) => void;
|
|
15
|
+
setCookie: (id: string, type: CookieType, cookie: Record<string, any>) => void;
|
|
16
|
+
close: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface WindowToolsMFProviderProps extends WindowToolsMF {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare type WindowToolsMFContextProps = Omit<WindowToolsMFProviderProps, 'children'>;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { useNetwork } from "@m4l/core";
|
|
2
|
+
import React__default, { createContext, useRef, useEffect } from "react";
|
|
3
|
+
import { c as createDynamicMFStore } from "./DynamicMFParmsContext/index.c19cb8cc.js";
|
|
4
|
+
import { createStore } from "zustand";
|
|
5
|
+
import { devtools } from "zustand/middleware";
|
|
6
|
+
import { immer } from "zustand/middleware/immer";
|
|
7
|
+
import cloneDeep from "lodash/clonedeep";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import "./AreasContext/index.e65fd347.js";
|
|
10
|
+
function getCookiesContainer(data, containerId) {
|
|
11
|
+
const cookies = {};
|
|
12
|
+
try {
|
|
13
|
+
if (Array.isArray(data)) {
|
|
14
|
+
for (let i = 0; i < data.length; i++) {
|
|
15
|
+
if (data[i]?.container_id === containerId && data[i]?.id) {
|
|
16
|
+
cookies[data[i]?.id] = JSON.parse(data[i].value);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
} catch (error) {
|
|
21
|
+
}
|
|
22
|
+
return cookies;
|
|
23
|
+
}
|
|
24
|
+
const createWindowStore = (initProps) => {
|
|
25
|
+
const startProps = {
|
|
26
|
+
status: "init",
|
|
27
|
+
moduleActions: [],
|
|
28
|
+
cookies: initProps.devCookies || { moduleCookies: {}, windowCookies: {} },
|
|
29
|
+
...initProps
|
|
30
|
+
};
|
|
31
|
+
delete startProps.devCookies;
|
|
32
|
+
return createStore(
|
|
33
|
+
devtools(
|
|
34
|
+
immer((set, get) => ({
|
|
35
|
+
...startProps,
|
|
36
|
+
actions: {
|
|
37
|
+
setActions: (newActions) => {
|
|
38
|
+
set((state) => {
|
|
39
|
+
state.moduleActions = cloneDeep(newActions);
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
close: () => {
|
|
43
|
+
const onClose = get().onClose;
|
|
44
|
+
if (onClose) {
|
|
45
|
+
onClose(get().windowId);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
getWindowId: () => {
|
|
49
|
+
return get().windowId;
|
|
50
|
+
},
|
|
51
|
+
getCookie: (id) => {
|
|
52
|
+
return get().cookies.windowCookies[id] || get().cookies.moduleCookies[id];
|
|
53
|
+
},
|
|
54
|
+
getCookies: (type) => {
|
|
55
|
+
if (type === "window") {
|
|
56
|
+
return get().cookies.windowCookies;
|
|
57
|
+
} else {
|
|
58
|
+
return get().cookies.moduleCookies;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
setCookie: (id, type, cookie) => {
|
|
62
|
+
get().networkOperation({
|
|
63
|
+
method: "PUT",
|
|
64
|
+
endPoint: `cookies/${type === "module" ? get().moduleId : get().windowId}/${id}`,
|
|
65
|
+
data: {
|
|
66
|
+
value: JSON.stringify(cookie)
|
|
67
|
+
},
|
|
68
|
+
toastSuccess: false,
|
|
69
|
+
toastError: false
|
|
70
|
+
});
|
|
71
|
+
set((state) => {
|
|
72
|
+
if (type === "window") {
|
|
73
|
+
state.cookies.windowCookies[id] = cookie;
|
|
74
|
+
} else {
|
|
75
|
+
state.cookies.moduleCookies[id] = cookie;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
internalActions: {
|
|
81
|
+
loadCookiesFromApi: () => {
|
|
82
|
+
console.log("loadCookiesFromApi start");
|
|
83
|
+
if (get().status === "init") {
|
|
84
|
+
get().networkOperation({
|
|
85
|
+
method: "GET",
|
|
86
|
+
endPoint: `cookies`,
|
|
87
|
+
parms: {
|
|
88
|
+
f: [
|
|
89
|
+
{ n: "container_id", o: "e", o1: get().windowId },
|
|
90
|
+
{ n: "container_id", o: "e", o1: get().moduleId }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
toastSuccess: false,
|
|
94
|
+
toastError: false
|
|
95
|
+
}).then((response) => {
|
|
96
|
+
set((state) => {
|
|
97
|
+
state.cookies.moduleCookies = getCookiesContainer(
|
|
98
|
+
response.data,
|
|
99
|
+
state.moduleId
|
|
100
|
+
);
|
|
101
|
+
state.cookies.windowCookies = getCookiesContainer(
|
|
102
|
+
response.data,
|
|
103
|
+
state.windowId
|
|
104
|
+
);
|
|
105
|
+
console.log(
|
|
106
|
+
"loadCookiesFromApi end",
|
|
107
|
+
state.cookies.moduleCookies
|
|
108
|
+
);
|
|
109
|
+
state.status = "loaded";
|
|
110
|
+
});
|
|
111
|
+
}).catch((_response) => {
|
|
112
|
+
set((state) => {
|
|
113
|
+
state.status = "loaded";
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
saveModuleCookies: () => {
|
|
119
|
+
console.log("saveModuleCookies end", get().cookies.moduleCookies);
|
|
120
|
+
for (const key in get().cookies.windowCookies) {
|
|
121
|
+
const cookie = get().cookies.windowCookies[key];
|
|
122
|
+
get().networkOperation({
|
|
123
|
+
method: "PUT",
|
|
124
|
+
endPoint: `cookies/${get().moduleId}/${key}`,
|
|
125
|
+
data: {
|
|
126
|
+
value: JSON.stringify(cookie)
|
|
127
|
+
},
|
|
128
|
+
toastSuccess: false,
|
|
129
|
+
toastError: false
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
})),
|
|
135
|
+
{ name: `window store ${initProps.windowId}` }
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
const WindowContext = createContext(null);
|
|
140
|
+
function WindowMFProvider(props) {
|
|
141
|
+
const {
|
|
142
|
+
children,
|
|
143
|
+
...other
|
|
144
|
+
} = props;
|
|
145
|
+
const {
|
|
146
|
+
networkOperation
|
|
147
|
+
} = useNetwork();
|
|
148
|
+
const windowStoreRef = useRef();
|
|
149
|
+
const dynamicMFStoreRef = useRef();
|
|
150
|
+
if (!dynamicMFStoreRef.current) {
|
|
151
|
+
dynamicMFStoreRef.current = createDynamicMFStore({
|
|
152
|
+
dynamicMFParameters: props.dynamicParams,
|
|
153
|
+
windowId: props.windowId
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (!windowStoreRef.current) {
|
|
157
|
+
windowStoreRef.current = createWindowStore({
|
|
158
|
+
...other,
|
|
159
|
+
dynamicMFStore: dynamicMFStoreRef.current,
|
|
160
|
+
networkOperation
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
windowStoreRef.current?.getState().internalActions.loadCookiesFromApi();
|
|
165
|
+
}, []);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (windowStoreRef.current?.getState().status === "loaded") {
|
|
168
|
+
console.log("useEffect Reemplazo de ventan");
|
|
169
|
+
dynamicMFStoreRef.current?.getState().actions.changeData(props.dynamicParams);
|
|
170
|
+
}
|
|
171
|
+
}, [props.dynamicParams]);
|
|
172
|
+
console.log("Render WindowProvider");
|
|
173
|
+
return /* @__PURE__ */ jsx(WindowContext.Provider, {
|
|
174
|
+
value: windowStoreRef.current,
|
|
175
|
+
children
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const WindowToolsMFContext = createContext(null);
|
|
179
|
+
function WindowToolsMFProvider(props) {
|
|
180
|
+
const {
|
|
181
|
+
children,
|
|
182
|
+
setActions,
|
|
183
|
+
...other
|
|
184
|
+
} = props;
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
console.log("useEffect {DynamicMFParmsProvider}", other);
|
|
187
|
+
}, []);
|
|
188
|
+
console.log("Render WindowToolsMFProvider", other);
|
|
189
|
+
return /* @__PURE__ */ jsx(WindowToolsMFContext.Provider, {
|
|
190
|
+
value: {
|
|
191
|
+
setActions,
|
|
192
|
+
...other
|
|
193
|
+
},
|
|
194
|
+
children
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
React__default.memo(WindowToolsMFProvider);
|
|
198
|
+
export {
|
|
199
|
+
WindowToolsMFProvider as W,
|
|
200
|
+
WindowMFProvider as a,
|
|
201
|
+
WindowContext as b,
|
|
202
|
+
WindowToolsMFContext as c
|
|
203
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export * from './AreasContext';
|
|
2
|
-
export type { DynamicMFParameters
|
|
2
|
+
export type { DynamicMFParameters } from './DynamicMFParmsContext/types';
|
|
3
|
+
export type { DynamicMFStore } from './DynamicMFParmsContext/store';
|
|
4
|
+
export { WindowToolsMFProvider, WindowToolsMFContext } from './WindowToolsMFContext';
|
|
5
|
+
export type { WindowToolsMF, ModuleAction } from './WindowToolsMFContext/types';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useStore } from "zustand";
|
|
3
|
+
import { b as WindowContext, c as WindowToolsMFContext } from "../contexts/index.137257b8.js";
|
|
4
|
+
import "../contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
5
|
+
const useWindow = () => {
|
|
6
|
+
const context = useContext(WindowContext);
|
|
7
|
+
if (!context)
|
|
8
|
+
throw new Error("useWindow context must be use inside WindowContext");
|
|
9
|
+
return context;
|
|
10
|
+
};
|
|
11
|
+
function useWindowStore(selector, equalityFn) {
|
|
12
|
+
const store = useContext(WindowContext);
|
|
13
|
+
if (!store)
|
|
14
|
+
throw new Error("useWindow context must be use inside WindowContext");
|
|
15
|
+
return useStore(store, selector, equalityFn);
|
|
16
|
+
}
|
|
17
|
+
const useWindowToolsMF = () => {
|
|
18
|
+
const context = useContext(WindowToolsMFContext);
|
|
19
|
+
if (!context)
|
|
20
|
+
throw new Error("useWindowToolsMF context must be use inside WindowToolsMFContext");
|
|
21
|
+
return context;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
useWindow as a,
|
|
25
|
+
useWindowStore as b,
|
|
26
|
+
useWindowToolsMF as u
|
|
27
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useStore } from "zustand";
|
|
3
|
+
import { a as AreaContext } from "../../contexts/AreaContext/index.ec85aee7.js";
|
|
4
|
+
import { A as AreasContext } from "../../contexts/AreasContext/index.e65fd347.js";
|
|
5
|
+
function useAreaStore(selector, equalityFn) {
|
|
6
|
+
const context = useContext(AreaContext);
|
|
7
|
+
if (!context)
|
|
8
|
+
throw new Error("useAreaStore context must be use inside AreaContext");
|
|
9
|
+
return useStore(context.store, selector, equalityFn);
|
|
10
|
+
}
|
|
11
|
+
function useAreasStore(selector, equalityFn) {
|
|
12
|
+
const context = useContext(AreasContext);
|
|
13
|
+
if (!context)
|
|
14
|
+
throw new Error("useAreasStore context must be use inside AreasContext");
|
|
15
|
+
return useStore(context, selector, equalityFn);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
useAreaStore as a,
|
|
19
|
+
useAreasStore as u
|
|
20
|
+
};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
+
import { AreaStateWithActions } from '../../contexts/AreaContext/store';
|
|
1
2
|
export declare const useArea: () => import("../../contexts/AreaContext/types").AreaContextProps;
|
|
3
|
+
export declare function useAreaStore<T>(selector: (state: AreaStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { AreasStateWithActions } from '../../contexts/AreasContext/store';
|
|
2
|
+
export declare function useAreas(): Omit<Omit<import("zustand").StoreApi<AreasStateWithActions>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: unknown;
|
|
5
|
+
}>(partial: AreasStateWithActions | Partial<AreasStateWithActions> | ((state: AreasStateWithActions) => AreasStateWithActions | Partial<AreasStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "setState"> & {
|
|
7
|
+
setState(nextStateOrUpdater: AreasStateWithActions | Partial<AreasStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<AreasStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
+
type: unknown;
|
|
9
|
+
} | undefined): void;
|
|
10
|
+
};
|
|
11
|
+
export declare function useAreasStore<T>(selector: (state: AreasStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
2
12
|
export default useAreas;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { useStore } from "zustand";
|
|
3
|
+
import { a as DynamicMFParmsContext } from "../../contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
4
|
+
function useDynamicMFParametersStore(selector, equalityFn) {
|
|
5
|
+
const store = useContext(DynamicMFParmsContext);
|
|
6
|
+
if (!store)
|
|
7
|
+
throw new Error(
|
|
8
|
+
"useDynamicMFParametersStore context must be use inside DynamicMFParmsContext"
|
|
9
|
+
);
|
|
10
|
+
return useStore(store, selector, equalityFn);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
useDynamicMFParametersStore as u
|
|
14
|
+
};
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { DynamicMFState } from '../../contexts/DynamicMFParmsContext/store';
|
|
2
|
+
export declare const useDynamicMFParameters: () => Omit<Omit<import("zustand").StoreApi<import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: unknown;
|
|
5
|
+
}>(partial: import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions | Partial<import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions> | ((state: import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions) => import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions | Partial<import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "setState"> & {
|
|
7
|
+
setState(nextStateOrUpdater: import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions | Partial<import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("../../contexts/DynamicMFParmsContext/store").DynamicMFStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
+
type: unknown;
|
|
9
|
+
} | undefined): void;
|
|
10
|
+
};
|
|
11
|
+
export declare function useDynamicMFParametersStore<T>(selector: (state: DynamicMFState) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WindowStateWithActions } from '../../contexts/WindowContext/store';
|
|
2
|
+
export declare const useWindow: () => Omit<Omit<import("zustand").StoreApi<WindowStateWithActions>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: unknown;
|
|
5
|
+
}>(partial: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: WindowStateWithActions) => WindowStateWithActions | Partial<WindowStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "setState"> & {
|
|
7
|
+
setState(nextStateOrUpdater: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<WindowStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
+
type: unknown;
|
|
9
|
+
} | undefined): void;
|
|
10
|
+
};
|
|
11
|
+
export declare function useWindowStore<T>(selector: (state: WindowStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useWindowToolsMF: () => import("../../contexts/WindowToolsMFContext/types").WindowToolsMFContextProps;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./components/index.4b828081.js";
|
|
2
|
+
import "./components/AreasAdmin/index.7a526b73.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "@m4l/core";
|
|
5
|
+
import "@mui/material";
|
|
6
|
+
import "../Icon/index.f6e8d810.js";
|
|
7
|
+
import "@mui/material/styles";
|
|
8
|
+
import "react/jsx-runtime";
|
|
9
|
+
import "../mui_extended/IconButton/index.1318a283.js";
|
|
10
|
+
import "zustand";
|
|
11
|
+
import "./contexts/AreasContext/index.e65fd347.js";
|
|
12
|
+
import "zustand/shallow";
|
|
13
|
+
import "./components/AreasContainer/index.ca690110.js";
|
|
14
|
+
import "react-grid-layout/css/styles.css";
|
|
15
|
+
import "../../react-resizable.bb58c8fc.js";
|
|
16
|
+
import "./contexts/index.137257b8.js";
|
|
17
|
+
import "./contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
18
|
+
const LABEL_NEW_AREA = "label_new_area";
|
|
19
|
+
export {
|
|
20
|
+
LABEL_NEW_AREA as L
|
|
21
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
|
-
import { I as Icon } from "../../Icon/index.
|
|
3
|
+
import { I as Icon } from "../../Icon/index.f6e8d810.js";
|
|
4
4
|
import { W as WrapperComponent } from "../../WrapperComponent/index.5e872594.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function BooleanFormatter(props) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ConcatenatedFormatterProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Concatena un arrays de strings y/o numbers
|
|
5
|
+
* @param props {values: Array<string> Valores a concatenar, separator: string Separador entre valores concatenados, Component: ElementType Componente que abraza la respuesta}
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function ConcatenatedFormatter(props: ConcatenatedFormatterProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Component: Tipo de componente HTML que "abraza" el resultado
|
|
4
|
+
* Values: Array de strings a concatenar
|
|
5
|
+
* Separator: String usado para concatenar el array de strings
|
|
6
|
+
*/
|
|
7
|
+
export interface ConcatenatedFormatterProps {
|
|
8
|
+
values: Array<string | number>;
|
|
9
|
+
separator?: string | number;
|
|
10
|
+
Component?: ElementType;
|
|
11
|
+
}
|