@m4l/components 9.2.0 → 9.2.2
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/.storybook/decorators/WithPopupsProvider/WithPopupsProvider.d.ts +6 -1
- package/.storybook/decorators/WithWindowsContainerSizer/WithWindowsContainerSizer.d.ts +5 -0
- package/@types/types.d.ts +11 -0
- package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +3 -3
- package/components/AppBar/slots/AppBarSlots.d.ts +2 -2
- package/components/Chip/slots/ChipSlots.d.ts +1 -1
- package/components/Color/slots/ColorSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +1 -1
- package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
- package/components/DragResizeWindow/DragResizeWindow.d.ts +2 -2
- package/components/DragResizeWindow/DragResizeWindow.js +69 -11
- package/components/DragResizeWindow/DragResizeWindow.styles.js +0 -2
- package/components/DragResizeWindow/classes/index.js +1 -0
- package/components/DragResizeWindow/classes/types.d.ts +1 -0
- package/components/DragResizeWindow/helpers/draggingOrResizingWindow.d.ts +7 -0
- package/components/DragResizeWindow/helpers/draggingOrResizingWindow.js +1 -0
- package/components/DragResizeWindow/helpers/expandingParentContainer.d.ts +12 -0
- package/components/DragResizeWindow/helpers/expandingParentContainer.js +31 -0
- package/components/DragResizeWindow/helpers/getInitialSize.d.ts +15 -0
- package/components/DragResizeWindow/helpers/getInitialSize.js +56 -0
- package/components/DragResizeWindow/helpers/index.d.ts +6 -15
- package/components/DragResizeWindow/helpers/index.js +1 -37
- package/components/DragResizeWindow/helpers/isElmentInViewport.d.ts +15 -0
- package/components/DragResizeWindow/helpers/isElmentInViewport.js +1 -0
- package/components/DragResizeWindow/helpers/pointPosition.d.ts +36 -0
- package/components/DragResizeWindow/helpers/pointPosition.js +82 -0
- package/components/DragResizeWindow/helpers/shrinkingParentContainer.d.ts +6 -0
- package/components/DragResizeWindow/helpers/shrinkingParentContainer.js +34 -0
- package/components/DragResizeWindow/hooks/useDimensionEffects.d.ts +2 -0
- package/components/DragResizeWindow/hooks/useDimensionEffects.js +20 -223
- package/components/DragResizeWindow/hooks/useDragOptions.d.ts +8 -1
- package/components/DragResizeWindow/hooks/useDragOptions.js +79 -6
- package/components/DragResizeWindow/hooks/useResizeOptions.d.ts +11 -0
- package/components/DragResizeWindow/hooks/useResizeOptions.js +164 -19
- package/components/DragResizeWindow/slots/DragResizeWindowSlots.d.ts +2 -2
- package/components/DragResizeWindow/types.d.ts +53 -4
- package/components/DragResizeWindow/utils.d.ts +5 -2
- package/components/DragResizeWindow/utils.js +32 -13
- package/components/DragResizeWindowRND/DragResizeWindowRND.d.ts +19 -0
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +224 -0
- package/components/DragResizeWindowRND/DragResizeWindowRND.styles.d.ts +5 -0
- package/components/DragResizeWindowRND/DragResizeWindowRND.styles.js +75 -0
- package/components/DragResizeWindowRND/classes/index.d.ts +2 -0
- package/components/DragResizeWindowRND/classes/index.js +18 -0
- package/components/DragResizeWindowRND/classes/types.d.ts +9 -0
- package/components/DragResizeWindowRND/constants.d.ts +3 -0
- package/components/DragResizeWindowRND/constants.js +6 -0
- package/components/DragResizeWindowRND/helpers/expandingParentContainer.d.ts +12 -0
- package/components/DragResizeWindowRND/helpers/expandingParentContainer.js +31 -0
- package/components/DragResizeWindowRND/helpers/getInitialSize.d.ts +15 -0
- package/components/DragResizeWindowRND/helpers/getInitialSize.js +56 -0
- package/components/DragResizeWindowRND/helpers/index.d.ts +5 -0
- package/components/DragResizeWindowRND/helpers/index.js +1 -0
- package/components/DragResizeWindowRND/helpers/isElmentInViewport.d.ts +15 -0
- package/components/DragResizeWindowRND/helpers/isElmentInViewport.js +1 -0
- package/components/DragResizeWindowRND/helpers/pointPosition.d.ts +36 -0
- package/components/DragResizeWindowRND/helpers/pointPosition.js +1 -0
- package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.d.ts +6 -0
- package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.js +34 -0
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.d.ts +23 -0
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.js +90 -0
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.d.ts +28 -0
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.js +220 -0
- package/components/DragResizeWindowRND/hooks/useRNDReResizeOptions.d.ts +45 -0
- package/components/DragResizeWindowRND/hooks/useRNDReResizeOptions.js +173 -0
- package/components/DragResizeWindowRND/icons.d.ts +3 -0
- package/components/DragResizeWindowRND/index.d.ts +2 -0
- package/components/DragResizeWindowRND/index.js +1 -0
- package/components/DragResizeWindowRND/slots/DragResizeWindowRNDSlots.d.ts +12 -0
- package/components/DragResizeWindowRND/slots/DragResizeWindowRNDSlots.js +19 -0
- package/components/DragResizeWindowRND/slots/slots.d.ts +5 -0
- package/components/DragResizeWindowRND/slots/slots.js +9 -0
- package/components/DragResizeWindowRND/types.d.ts +295 -0
- package/components/DragResizeWindowRND/utils.d.ts +15 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +4 -4
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/GridLayout/GridLayout.d.ts +2 -1
- package/components/GridLayout/GridLayout.js +10 -5
- package/components/GridLayout/classes/index.d.ts +1 -1
- package/components/GridLayout/subcomponents/Responsive/index.d.ts +1 -1
- package/components/GridLayout/subcomponents/Responsive/index.js +4 -3
- package/components/GridLayout/subcomponents/Responsive/types.d.ts +4 -0
- package/components/GridLayout/subcomponents/withSizeProvider/index.d.ts +3 -1
- package/components/GridLayout/subcomponents/withSizeProvider/index.js +11 -15
- package/components/GridLayout/types.d.ts +4 -0
- package/components/Label/slots/LabelSlots.d.ts +1 -1
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +24 -11
- package/components/MFIsolationApp/types.d.ts +8 -1
- package/components/MFLoader/styles.js +17 -2
- package/components/MFLoader/types.d.ts +19 -2
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
- package/components/ModalDialog/ModalDialog.js +2 -2
- package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
- package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +2 -2
- package/components/ToastContainer/slots/toastContainerSlots.js +1 -1
- package/components/WindowBase/WindowBase.js +3 -5
- package/components/WindowBase/WindowBase.styles.js +26 -17
- package/components/{areas/contexts/DynamicMFParmsContext/index.js → WindowBase/contexts/DynamicMFParmsContext/DynamicMFParmsContext.js} +2 -2
- package/components/WindowBase/contexts/DynamicMFParmsContext/index.d.ts +4 -0
- package/components/WindowBase/contexts/DynamicMFParmsContext/index.js +1 -0
- package/components/{areas → WindowBase}/contexts/DynamicMFParmsContext/store.d.ts +0 -1
- package/components/{areas/contexts/WindowToolsMFContext/index.js → WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js} +4 -3
- package/components/WindowBase/contexts/WindowToolsMFContext/index.d.ts +2 -0
- package/components/WindowBase/contexts/WindowToolsMFContext/index.js +1 -0
- package/components/{areas → WindowBase}/contexts/WindowToolsMFContext/types.d.ts +3 -2
- package/components/WindowBase/contexts/index.d.ts +2 -0
- package/components/WindowBase/helpers.d.ts +22 -0
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/helper.js → WindowBase/helpers.js} +17 -13
- package/components/{areas → WindowBase}/hooks/useDynamicMFParameters/index.js +9 -1
- package/components/{areas → WindowBase}/hooks/useWindowToolsMF/index.js +1 -1
- package/components/WindowBase/index.d.ts +5 -0
- package/components/WindowBase/slots/WindowBaseEnum.d.ts +2 -1
- package/components/WindowBase/slots/WindowBaseEnum.js +1 -0
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +45 -14
- package/components/WindowBase/slots/WindowBaseSlots.js +10 -5
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window → WindowBase}/subcomponents/Component/index.d.ts +1 -1
- package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window → WindowBase}/subcomponents/Component/index.js +6 -6
- package/components/WindowBase/subcomponents/Component/types.d.ts +9 -0
- package/components/WindowBase/subcomponents/EditionInfo/EditionInfo.js +1 -1
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +52 -24
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -38
- package/components/WindowBase/subcomponents/MicroFrontend/MicroFrontend.d.ts +8 -0
- package/components/WindowBase/subcomponents/MicroFrontend/MicroFrontend.js +10 -0
- package/components/WindowBase/subcomponents/MicroFrontend/types.d.ts +8 -0
- package/components/WindowBase/types.d.ts +52 -18
- package/components/WindowConfirm/WindowConfirm.js +1 -1
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +2 -2
- package/components/areas/components/AreasViewer/AreasViewer.d.ts +1 -1
- package/components/areas/components/AreasViewer/AreasViewer.js +7 -9
- package/components/areas/components/AreasViewer/AreasViewer.styles.js +12 -11
- package/components/areas/components/AreasViewer/slots/AreasViewerEnum.d.ts +2 -2
- package/components/areas/components/AreasViewer/slots/AreasViewerEnum.js +1 -1
- package/components/areas/components/AreasViewer/slots/AreasViewerSlots.d.ts +3 -3
- package/components/areas/components/AreasViewer/slots/AreasViewerSlots.js +6 -5
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +44 -4
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.d.ts +7 -5
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +9 -9
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions.d.ts +12 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions.js +58 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.d.ts +6 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +88 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/{useWindow/useWindow.d.ts → useWindow.d.ts} +7 -7
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/{useWindow/useWindow.js → useWindow.js} +13 -11
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +7 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/WindowModal.d.ts +5 -4
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/WindowModal.js +25 -25
- package/components/areas/components/AreasViewer/types.d.ts +3 -1
- package/components/areas/components/index.d.ts +1 -1
- package/components/areas/constants.d.ts +1 -0
- package/components/areas/constants.js +3 -1
- package/components/areas/contexts/AreasContext/helpers/generateModuleCount.d.ts +2 -2
- package/components/areas/contexts/AreasContext/helpers/getWindowForAreaTest.d.ts +2 -2
- package/components/areas/contexts/AreasContext/helpers/helper.d.ts +4 -4
- package/components/areas/contexts/AreasContext/helpers/helper.js +6 -8
- package/components/areas/contexts/AreasContext/helpers/selectLayout.d.ts +6 -0
- package/components/areas/contexts/AreasContext/helpers/selectLayout.js +27 -0
- package/components/areas/contexts/AreasContext/index.d.ts +4 -4
- package/components/areas/contexts/AreasContext/index.js +24 -4
- package/components/areas/contexts/AreasContext/store.d.ts +4 -4
- package/components/areas/contexts/AreasContext/store.js +128 -86
- package/components/areas/contexts/AreasContext/types.d.ts +142 -31
- package/components/areas/contexts/index.d.ts +0 -6
- package/components/areas/hooks/index.d.ts +0 -2
- package/components/areas/hooks/useAreas/index.d.ts +5 -5
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle.js +2 -2
- package/components/areas/types.d.ts +109 -100
- package/components/extended/React-Resizable/Resizable/Resizable.js +2 -1
- package/components/extended/React-Resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
- package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
- package/components/extended/React-Resizable/helpers.d.ts +6 -1
- package/components/extended/React-Resizable/helpers.js +11 -2
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +2 -2
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +2 -2
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +4 -4
- package/components/mui_extended/Avatar/slots/AvatarSlots.d.ts +1 -1
- package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
- package/components/mui_extended/Button/slots/ButtonSlots.d.ts +1 -1
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +1 -1
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
- package/components/mui_extended/Divider/slots/DividerSlots.d.ts +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
- package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/types.d.ts +1 -1
- package/components/mui_extended/Popper/slots/PopperStlots.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +2 -2
- package/components/mui_extended/Select/slots/SelectSlots.js +1 -1
- package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
- package/components/mui_extended/Stack/slots/StackSlot.d.ts +1 -1
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +1 -1
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
- package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +3 -3
- package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.d.ts +8 -2
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js +6 -24
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.d.ts +9 -3
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +278 -211
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/tests/PopupContext.test.d.ts +1 -0
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/tests/PopusContext.store.test.d.ts +1 -0
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/tests/__mocks__/storeMock.d.ts +29 -0
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +183 -79
- package/components/popups/components/PopupsProvider/hooks/{useHeaderActionsPopups/useHeaderActionsPopups.d.ts → useHeaderActionsPopups.d.ts} +2 -8
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.js +60 -0
- package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +43 -0
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +138 -0
- package/components/popups/components/PopupsProvider/hooks/usePopupsStore.d.ts +5 -0
- package/components/popups/components/PopupsProvider/hooks/{usePopupsStore/index.js → usePopupsStore.js} +1 -1
- package/components/popups/components/PopupsViewer/PopupsViewer.d.ts +13 -4
- package/components/popups/components/PopupsViewer/PopupsViewer.js +27 -6
- package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +3 -11
- package/components/popups/components/PopupsViewer/slots/popupsViewerSlots.d.ts +7 -10
- package/components/popups/components/PopupsViewer/slots/popupsViewerSlots.js +3 -8
- package/components/popups/components/PopupsViewer/slots/slots.d.ts +1 -2
- package/components/popups/components/PopupsViewer/slots/slots.js +0 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.d.ts +1 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +69 -53
- package/components/popups/components/PopupsViewer/subcomponents/Popup/types.d.ts +16 -0
- package/components/popups/components/PopupsViewer/tests/PopupsViewer.integration.test.d.ts +1 -0
- package/components/popups/components/PopupsViewer/types.d.ts +13 -5
- package/contexts/AppearanceComponentContext/AppearanceComponentContext.d.ts +8 -0
- package/contexts/AppearanceComponentContext/AppearanceComponentContext.js +4 -3
- package/contexts/AppearanceComponentContext/AppearanceComponentStore.d.ts +8 -1
- package/contexts/AppearanceComponentContext/AppearanceComponentStore.js +10 -3
- package/contexts/index.d.ts +1 -1
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +4 -4
- package/hooks/useDynamicFilterAndSort/types.d.ts +1 -1
- package/hooks/useSizeContainer/index.js +2 -2
- package/index.js +91 -85
- package/not_recognized/index.js +1280 -0
- package/package.json +2 -1
- package/storybook/components/Areas/AreasViewer/{AreasViewr.stories.d.ts → AreasViewer.stories.d.ts} +2 -2
- package/storybook/components/Areas/AreasViewer/hooks/useWindowsActions.d.ts +4 -0
- package/storybook/components/Areas/AreasViewer/subcomponents/AreasViewerRender.d.ts +4 -0
- package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/Launcher.d.ts +5 -0
- package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/PopupButton.d.ts +21 -0
- package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/PopupContentExample.d.ts +4 -0
- package/storybook/components/Areas/AreasViewer/subcomponents/layouts/ClientsLayout.d.ts +4 -0
- package/storybook/components/Areas/AreasViewer/subcomponents/layouts/UsersLayout.d.ts +4 -0
- package/storybook/components/DragResizeWindowRND/stories/DragResizeWindowRND.stories.d.ts +8 -0
- package/storybook/components/DragResizeWindowRND/stories/constants.d.ts +3 -0
- package/storybook/components/DragResizeWindowRND/stories/subcomponents/ContentExample.d.ts +4 -0
- package/storybook/components/DragResizeWindowRND/stories/subcomponents/RNDWindowsContainer/RNDWindowsContainer.d.ts +5 -0
- package/storybook/components/DragResizeWindowRND/stories/subcomponents/RNDWindowsContainer/index.d.ts +1 -0
- package/storybook/components/DragResizeWindowRND/stories/subcomponents/RNDWindowsContainer/types.d.ts +4 -0
- package/storybook/components/{Areas/AreasViewer → DragResizeWindowRND/stories}/subcomponents/WithExtendedContainer.d.ts +1 -1
- package/storybook/components/DragResizeWindowRND/stories/types.d.ts +3 -0
- package/storybook/components/PopupsViewer/basic.stories.d.ts +12 -2
- package/storybook/components/PopupsViewer/subcomponents/PopupActions.d.ts +3 -1
- package/storybook/components/PopupsViewer/subcomponents/PopupContentExample.d.ts +2 -1
- package/storybook/components/PopupsViewer/subcomponents/initialPopups.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/helper.d.ts +0 -22
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.d.ts +0 -28
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.js +0 -155
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/types.d.ts +0 -10
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/MicroFrontend.d.ts +0 -8
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/MicroFrontend.js +0 -10
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/types.d.ts +0 -8
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups/helper.d.ts +0 -28
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups/helper.js +0 -44
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups/useHeaderActionsPopups.js +0 -157
- package/components/popups/components/PopupsProvider/hooks/usePopops/usePopups.d.ts +0 -28
- package/components/popups/components/PopupsProvider/hooks/usePopops/usePopups.js +0 -117
- package/components/popups/components/PopupsProvider/hooks/usePopupsStore/index.d.ts +0 -6
- package/storybook/components/Areas/AreasViewer/subcomponents/ClientsHeaderActions.d.ts +0 -4
- package/storybook/components/Areas/AreasViewer/subcomponents/UsersHeaderActions.d.ts +0 -4
- /package/components/{popups/components/PopupsProvider/tests/PopupsProvider.test.d.ts → DragResizeWindowRND/tests/DragResizeWindow.test.d.ts} +0 -0
- /package/components/{areas/contexts/DynamicMFParmsContext/index.d.ts → WindowBase/contexts/DynamicMFParmsContext/DynamicMFParmsContext.d.ts} +0 -0
- /package/components/{areas → WindowBase}/contexts/DynamicMFParmsContext/store.js +0 -0
- /package/components/{areas → WindowBase}/contexts/DynamicMFParmsContext/types.d.ts +0 -0
- /package/components/{areas/contexts/WindowToolsMFContext/index.d.ts → WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.d.ts} +0 -0
- /package/components/{areas → WindowBase}/hooks/useDynamicMFParameters/index.d.ts +0 -0
- /package/components/{areas → WindowBase}/hooks/useWindowToolsMF/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createDynamicMFStore } from "
|
|
1
|
+
import { c as createDynamicMFStore } from "../../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
|
|
2
2
|
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../dictionary.js";
|
|
3
3
|
import { c as addLayoutItemToBreakPointIfNoExists } from "../../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
4
4
|
const PADDING_GRIDLAYOUT = 11;
|
|
@@ -28,7 +28,6 @@ const DEFAULT_AREA = {
|
|
|
28
28
|
// windowsLayoutIds: [],
|
|
29
29
|
layoutItemsIds: [],
|
|
30
30
|
currentLayoutId: "",
|
|
31
|
-
currentPopUpId: "",
|
|
32
31
|
breakpoints: BREAKPOINT_SIZES,
|
|
33
32
|
cols: NORMALIZED_COLS,
|
|
34
33
|
loadWindows: false
|
|
@@ -140,8 +139,7 @@ function getDataFromResponse(data, state, areaId) {
|
|
|
140
139
|
emergeType: "layout",
|
|
141
140
|
areaId,
|
|
142
141
|
dynamicMFStore: createDynamicMFStore({
|
|
143
|
-
dynamicMFParameters: element.dynamicParams
|
|
144
|
-
windowId: key
|
|
142
|
+
dynamicMFParameters: element.dynamicParams
|
|
145
143
|
}),
|
|
146
144
|
onClose: () => onClose(areaId, key)
|
|
147
145
|
};
|
|
@@ -193,16 +191,16 @@ function getSelectedAreaIdFromCookies(cookiesResponse) {
|
|
|
193
191
|
return typeof cookiesResponse?.data?.[0]?.value === "string" && JSON.parse(cookiesResponse?.data?.[0]?.value || "{}")?.selectedAreaId;
|
|
194
192
|
}
|
|
195
193
|
export {
|
|
196
|
-
|
|
194
|
+
COOKIE_WINDOW_SELECTED as C,
|
|
197
195
|
DEFAULT_AREA as D,
|
|
198
196
|
MARGIN_GRIDLAYOUT as M,
|
|
199
197
|
NORMALIZED_COLS as N,
|
|
200
198
|
PADDING_GRIDLAYOUT as P,
|
|
201
199
|
RESPONSIVE_COLAPSED_HEIGHTS as R,
|
|
202
200
|
RESPONSIVE_ROW_HEIGHTS as a,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
COOKIE_AREAS_ADMIN_CONTAINER_ID as b,
|
|
202
|
+
COOKIE_AREAS_ADMIN_ID as c,
|
|
203
|
+
addArea as d,
|
|
206
204
|
DEFAULT_WINDOW as e,
|
|
207
205
|
deleteLayoutFromBreakPoints as f,
|
|
208
206
|
getSelectedAreaIdFromCookies as g,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WritableDraft } from 'immer/dist/internal';
|
|
2
|
+
import { AreasStoreStateWithActions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: Documentar
|
|
5
|
+
*/
|
|
6
|
+
export declare function helperSelectLayout(state: WritableDraft<AreasStoreStateWithActions>, areaId: string, layoutId: string, saveCookie?: boolean): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { C as COOKIE_WINDOW_SELECTED } from "./helper.js";
|
|
2
|
+
import { s as setCookie, d as deleteCookie } from "../../../../../helpers/cookies/cookies.js";
|
|
3
|
+
function helperSelectLayout(state, areaId, layoutId, saveCookie = true) {
|
|
4
|
+
const area = state.hashAreas[areaId];
|
|
5
|
+
area.currentLayoutId = layoutId;
|
|
6
|
+
if (layoutId !== "" && state.hashWindows[layoutId]) {
|
|
7
|
+
state.currentModuleId = state.hashWindows[layoutId].moduleId;
|
|
8
|
+
if (saveCookie) {
|
|
9
|
+
setCookie({
|
|
10
|
+
networkOperation: state.networkOperation,
|
|
11
|
+
endPoint: `${area.id}/${COOKIE_WINDOW_SELECTED}`,
|
|
12
|
+
value: { currentLayoutId: layoutId }
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
state.currentModuleId = "";
|
|
17
|
+
if (saveCookie) {
|
|
18
|
+
deleteCookie({
|
|
19
|
+
networkOperation: state.networkOperation,
|
|
20
|
+
data: { f: [{ n: "id", o: "e", o1: COOKIE_WINDOW_SELECTED }] }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
helperSelectLayout as h
|
|
27
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AreasProviderProps } from './types';
|
|
2
|
-
declare const AreasContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').
|
|
2
|
+
declare const AreasContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').AreasStoreStateWithActions>, "setState"> & {
|
|
3
3
|
setState<A extends string | {
|
|
4
4
|
type: unknown;
|
|
5
|
-
}>(partial: import('./types').
|
|
5
|
+
}>(partial: import('./types').AreasStoreStateWithActions | Partial<import('./types').AreasStoreStateWithActions> | ((state: import('./types').AreasStoreStateWithActions) => import('./types').AreasStoreStateWithActions | Partial<import('./types').AreasStoreStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
6
|
}, "setState"> & {
|
|
7
|
-
setState(nextStateOrUpdater: import('./types').
|
|
7
|
+
setState(nextStateOrUpdater: import('./types').AreasStoreStateWithActions | Partial<import('./types').AreasStoreStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').AreasStoreStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
8
|
type: unknown;
|
|
9
9
|
} | undefined): void;
|
|
10
10
|
}) | null>;
|
|
@@ -15,7 +15,7 @@ declare const AreasContext: import('react').Context<(Omit<Omit<import('zustand')
|
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
|
-
* Proveedor
|
|
18
|
+
* Proveedor de áreas de trabajo
|
|
19
19
|
*/
|
|
20
20
|
declare function AreasProvider(props: AreasProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export { AreasProvider, AreasContext };
|
|
@@ -5,27 +5,47 @@ import { shallow } from "zustand/shallow";
|
|
|
5
5
|
import { useFirstRender } from "@m4l/graphics";
|
|
6
6
|
import { useHostTools, useModuleDictionary, useNetwork, useFlagsStore, CommonFlags, EmitEvents } from "@m4l/core";
|
|
7
7
|
import { c as createAreasStore } from "./store.js";
|
|
8
|
+
import { u as usePopupsStore } from "../../../popups/components/PopupsProvider/hooks/usePopupsStore.js";
|
|
8
9
|
const AreasContext = createContext(null);
|
|
9
10
|
function AreasProvider(props) {
|
|
10
|
-
const { children, loadAreasFromNetwork, loadCookiesFromNetwork, onLoad, onSelectLayout } = props;
|
|
11
|
+
const { children, loadAreasFromNetwork, loadCookiesFromNetwork, onLoad, onSelectLayout, storeId, storeDevtoolsEnabled } = props;
|
|
11
12
|
const { events_add_listener, events_remove_listener } = useHostTools();
|
|
12
13
|
const { getLabel } = useModuleDictionary();
|
|
13
14
|
const { networkOperation } = useNetwork();
|
|
14
15
|
const isFirstRender = useFirstRender([getLabel]);
|
|
15
16
|
const { addFlag } = useFlagsStore((state) => state.flagsActions);
|
|
16
17
|
const areasStoreRef = useRef();
|
|
18
|
+
const {
|
|
19
|
+
addPopup,
|
|
20
|
+
removePopup,
|
|
21
|
+
closePopupsByGroupId: removePopupsByGroupId,
|
|
22
|
+
bringPopupOnFront,
|
|
23
|
+
closeAllPopupsByParentId,
|
|
24
|
+
setSelectedPopupId
|
|
25
|
+
} = usePopupsStore(
|
|
26
|
+
(state) => state.popupsActions,
|
|
27
|
+
shallow
|
|
28
|
+
);
|
|
17
29
|
if (!areasStoreRef.current) {
|
|
18
30
|
areasStoreRef.current = createAreasStore({
|
|
31
|
+
storeId,
|
|
19
32
|
getLabel,
|
|
20
33
|
loadAreasFromNetwork,
|
|
21
34
|
loadCookiesFromNetwork,
|
|
22
35
|
networkOperation,
|
|
23
36
|
ownerState: {
|
|
24
37
|
status: "init",
|
|
25
|
-
readyForHooks: false
|
|
26
|
-
|
|
38
|
+
readyForHooks: false
|
|
39
|
+
},
|
|
40
|
+
popupsProviderMethods: {
|
|
41
|
+
addPopup,
|
|
42
|
+
removePopup,
|
|
43
|
+
removePopupsByGroupId,
|
|
44
|
+
bringPopupOnFront,
|
|
45
|
+
closeAllPopupsByParentId,
|
|
46
|
+
setSelectedPopupId
|
|
27
47
|
}
|
|
28
|
-
});
|
|
48
|
+
}, storeDevtoolsEnabled);
|
|
29
49
|
areasStoreRef.current?.getState().areasActions.init();
|
|
30
50
|
}
|
|
31
51
|
const status = useStore(areasStoreRef.current, (state) => state.ownerState.status, shallow);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AreasStoreStateWithActions, InitialAreasStoreProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Crea el Store, por defecto inicia en estado 'init'
|
|
4
4
|
* @param initProps propiedades iniciales del store
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export declare const createAreasStore: (initProps: InitialAreasStoreProps) => Omit<Omit<import('zustand').StoreApi<
|
|
7
|
+
export declare const createAreasStore: (initProps: InitialAreasStoreProps, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<AreasStoreStateWithActions>, "setState"> & {
|
|
8
8
|
setState<A extends string | {
|
|
9
9
|
type: unknown;
|
|
10
|
-
}>(partial:
|
|
10
|
+
}>(partial: AreasStoreStateWithActions | Partial<AreasStoreStateWithActions> | ((state: AreasStoreStateWithActions) => AreasStoreStateWithActions | Partial<AreasStoreStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
11
11
|
}, "setState"> & {
|
|
12
|
-
setState(nextStateOrUpdater:
|
|
12
|
+
setState(nextStateOrUpdater: AreasStoreStateWithActions | Partial<AreasStoreStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<AreasStoreStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
13
13
|
type: unknown;
|
|
14
14
|
} | undefined): void;
|
|
15
15
|
};
|
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
import { createStore } from "zustand";
|
|
2
2
|
import { devtools } from "zustand/middleware";
|
|
3
3
|
import { immer } from "zustand/middleware/immer";
|
|
4
|
-
import {
|
|
5
|
-
import { c as createDynamicMFStore } from "
|
|
4
|
+
import { b as COOKIE_AREAS_ADMIN_CONTAINER_ID, c as COOKIE_AREAS_ADMIN_ID, D as DEFAULT_AREA, d as addArea, g as getSelectedAreaIdFromCookies, e as DEFAULT_WINDOW, a as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, N as NORMALIZED_COLS, f as deleteLayoutFromBreakPoints, h as COOKIE_WINDOWS, i as COOKIE_BREAKPOINT_LAYOUTS, j as DEBOUCED_SAVE_TIME, s as setColapsedLayoutBreakPoints, k as getDataFromResponse, l as getParmsFromValue, m as getCookiesContainer, C as COOKIE_WINDOW_SELECTED } from "./helpers/helper.js";
|
|
5
|
+
import { c as createDynamicMFStore } from "../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
|
|
6
6
|
import cloneDeep from "lodash-es/cloneDeep";
|
|
7
7
|
import debounce from "lodash-es/debounce";
|
|
8
8
|
import { g as generateModuleCount } from "./helpers/generateModuleCount.js";
|
|
9
|
+
import { a as AREAS_STORE_ID } from "../../constants.js";
|
|
10
|
+
import { h as helperSelectLayout } from "./helpers/selectLayout.js";
|
|
9
11
|
import { g as getCookie, d as deleteCookie, s as setCookie } from "../../../../helpers/cookies/cookies.js";
|
|
10
12
|
import { d as addLayoutItemToBreakPoints, e as cloneLayouts } from "../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
11
13
|
import { k as isEqualLayouts } from "../../../GridLayout/utils.js";
|
|
12
|
-
const
|
|
14
|
+
const createDevtools = (immerMiddlewere, config) => {
|
|
15
|
+
const { enabled = false } = config;
|
|
16
|
+
if (enabled && process.env.NODE_ENV === "development") {
|
|
17
|
+
return devtools(immerMiddlewere, config);
|
|
18
|
+
}
|
|
19
|
+
return immerMiddlewere;
|
|
20
|
+
};
|
|
21
|
+
const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
13
22
|
const startProps = {
|
|
14
23
|
currentAreaId: "",
|
|
15
24
|
currentModuleId: "",
|
|
16
25
|
areasIds: [],
|
|
17
26
|
hashAreas: {},
|
|
18
27
|
hashWindows: {},
|
|
19
|
-
|
|
20
|
-
windowsModals: [],
|
|
28
|
+
windowsModalsIds: [],
|
|
21
29
|
...initProps
|
|
22
30
|
};
|
|
23
31
|
return createStore(
|
|
24
|
-
|
|
32
|
+
createDevtools(
|
|
25
33
|
immer((set, get) => ({
|
|
26
34
|
...startProps,
|
|
27
35
|
areasActions: {
|
|
@@ -215,23 +223,20 @@ const createAreasStore = (initProps) => {
|
|
|
215
223
|
*/
|
|
216
224
|
addWindow: (newWindowProps) => {
|
|
217
225
|
const windowId = `${get().currentAreaId}_window_${(/* @__PURE__ */ new Date()).getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
218
|
-
if (newWindowProps.emergeType === "layout"
|
|
226
|
+
if (newWindowProps.emergeType === "layout") {
|
|
219
227
|
get().areaActions.addLayout(get().currentAreaId, windowId, newWindowProps);
|
|
228
|
+
} else if (newWindowProps.emergeType === "popup") {
|
|
229
|
+
get().areaActions.addPopup(get().currentAreaId, windowId, newWindowProps);
|
|
220
230
|
} else if (newWindowProps.emergeType === "modal") {
|
|
221
231
|
get().areaActions.addWindowModal(get().currentAreaId, windowId, newWindowProps);
|
|
222
232
|
}
|
|
223
|
-
setCookie({
|
|
224
|
-
networkOperation: get().networkOperation,
|
|
225
|
-
endPoint: `${get().currentAreaId}/${COOKIE_WINDOW_SELECTED}`,
|
|
226
|
-
value: { currentLayoutId: windowId }
|
|
227
|
-
});
|
|
228
233
|
},
|
|
229
234
|
/**
|
|
230
235
|
* addLayout store
|
|
231
236
|
*/
|
|
232
237
|
addLayout: (areaId, windowId, newWindowProps) => {
|
|
233
238
|
let previousId = windowId;
|
|
234
|
-
const freeMove =
|
|
239
|
+
const freeMove = false;
|
|
235
240
|
const moduleCount = generateModuleCount(get().currentAreaId, newWindowProps.moduleId, get().hashWindows);
|
|
236
241
|
const newLayoutItem = {
|
|
237
242
|
...newWindowProps.layoutProps,
|
|
@@ -258,8 +263,7 @@ const createAreasStore = (initProps) => {
|
|
|
258
263
|
}
|
|
259
264
|
if (previousId === windowId) {
|
|
260
265
|
const dynamicMFStore = createDynamicMFStore({
|
|
261
|
-
dynamicMFParameters: newWindowProps.dynamicParams
|
|
262
|
-
windowId
|
|
266
|
+
dynamicMFParameters: newWindowProps.dynamicParams
|
|
263
267
|
});
|
|
264
268
|
state.hashWindows[windowId] = {
|
|
265
269
|
...newWindowProps,
|
|
@@ -273,11 +277,6 @@ const createAreasStore = (initProps) => {
|
|
|
273
277
|
moduleCount
|
|
274
278
|
};
|
|
275
279
|
area.layoutItemsIds.push(windowId);
|
|
276
|
-
if (newWindowProps.emergeType === "layout") {
|
|
277
|
-
area.currentLayoutId = windowId;
|
|
278
|
-
} else {
|
|
279
|
-
area.currentPopUpId = windowId;
|
|
280
|
-
}
|
|
281
280
|
if (area.maximizedId) {
|
|
282
281
|
area.maximizedId = windowId;
|
|
283
282
|
}
|
|
@@ -294,6 +293,8 @@ const createAreasStore = (initProps) => {
|
|
|
294
293
|
if (area.currentBreakpoint === "xxs") {
|
|
295
294
|
area.maximizedId = windowId;
|
|
296
295
|
}
|
|
296
|
+
helperSelectLayout(state, areaId, windowId, true);
|
|
297
|
+
get().popupsProviderMethods.setSelectedPopupId(areaId, void 0);
|
|
297
298
|
}
|
|
298
299
|
});
|
|
299
300
|
get().areaActions.saveLayouts(areaId);
|
|
@@ -314,6 +315,9 @@ const createAreasStore = (initProps) => {
|
|
|
314
315
|
}
|
|
315
316
|
deleteLayoutFromBreakPoints(area, removeLayoutId);
|
|
316
317
|
delete state.hashWindows[removeLayoutId];
|
|
318
|
+
if (state.hashAreas[areaId].currentLayoutId === removeLayoutId) {
|
|
319
|
+
helperSelectLayout(state, areaId, "");
|
|
320
|
+
}
|
|
317
321
|
});
|
|
318
322
|
get().areaActions.saveLayouts(areaId);
|
|
319
323
|
if (get().hashAreas[areaId].maximizedId === removeLayoutId) {
|
|
@@ -322,16 +326,11 @@ const createAreasStore = (initProps) => {
|
|
|
322
326
|
for (let index = 0; index < get().hashAreas[areaId].layoutItemsIds.length; index++) {
|
|
323
327
|
const layoutItemId = get().hashAreas[areaId].layoutItemsIds[index];
|
|
324
328
|
const layoutItem = get().hashWindows[layoutItemId];
|
|
325
|
-
if (layoutItem.
|
|
329
|
+
if (layoutItem.parentId === removeLayoutId) {
|
|
326
330
|
get().areaActions.closeLayout(areaId, layoutItem.windowId);
|
|
327
331
|
}
|
|
328
332
|
}
|
|
329
|
-
|
|
330
|
-
deleteCookie({
|
|
331
|
-
networkOperation: get().networkOperation,
|
|
332
|
-
data: { f: [{ n: "id", o: "e", o1: COOKIE_WINDOW_SELECTED }] }
|
|
333
|
-
});
|
|
334
|
-
}
|
|
333
|
+
get().popupsProviderMethods.closeAllPopupsByParentId(removeLayoutId);
|
|
335
334
|
},
|
|
336
335
|
/**
|
|
337
336
|
* saveLayouts
|
|
@@ -379,17 +378,98 @@ const createAreasStore = (initProps) => {
|
|
|
379
378
|
});
|
|
380
379
|
}
|
|
381
380
|
},
|
|
381
|
+
/**
|
|
382
|
+
* addPopup store
|
|
383
|
+
*/
|
|
384
|
+
addPopup: (areaId, windowId, newWindowProps) => {
|
|
385
|
+
let previousId = windowId;
|
|
386
|
+
set((state) => {
|
|
387
|
+
const area = state.hashAreas[areaId];
|
|
388
|
+
if (!area) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (newWindowProps.replaceMeId) {
|
|
392
|
+
for (const key in state.hashWindows) {
|
|
393
|
+
if (state.hashWindows[key].replaceMeId === newWindowProps.replaceMeId) {
|
|
394
|
+
const WindoPopUp = state.hashWindows[key];
|
|
395
|
+
previousId = key;
|
|
396
|
+
WindoPopUp.dynamicMFStore.getState().actions.changeData(newWindowProps.dynamicParams);
|
|
397
|
+
get().popupsProviderMethods.bringPopupOnFront(key, true);
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
if (previousId === windowId) {
|
|
403
|
+
const dynamicMFStore = createDynamicMFStore({
|
|
404
|
+
dynamicMFParameters: newWindowProps.dynamicParams
|
|
405
|
+
});
|
|
406
|
+
state.hashWindows[windowId] = {
|
|
407
|
+
...newWindowProps,
|
|
408
|
+
...DEFAULT_WINDOW,
|
|
409
|
+
areaId,
|
|
410
|
+
windowId,
|
|
411
|
+
onClose: (removeLayoutId) => {
|
|
412
|
+
get().areaActions.closeLayout(areaId, removeLayoutId);
|
|
413
|
+
},
|
|
414
|
+
dynamicMFStore
|
|
415
|
+
};
|
|
416
|
+
const { emergeType, popupProps, ...newWindowPropsExact } = newWindowProps;
|
|
417
|
+
const onSelectedPopupIdChange = (groupId, _popupId, reason) => {
|
|
418
|
+
if (parentId) {
|
|
419
|
+
if (reason === "select") {
|
|
420
|
+
get().areaActions.selectLayout(groupId, parentId);
|
|
421
|
+
}
|
|
422
|
+
} else {
|
|
423
|
+
get().areaActions.selectLayout(groupId, "");
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
const parentId = newWindowProps?.parentId;
|
|
427
|
+
get().popupsProviderMethods.addPopup({
|
|
428
|
+
...newWindowPropsExact,
|
|
429
|
+
...newWindowProps.popupProps,
|
|
430
|
+
popupId: windowId,
|
|
431
|
+
groupId: areaId,
|
|
432
|
+
dynamicMFStore,
|
|
433
|
+
dynamicParams: newWindowProps.dynamicParams,
|
|
434
|
+
onRemove: () => get().areaActions.closePopup(areaId, windowId),
|
|
435
|
+
/**
|
|
436
|
+
*
|
|
437
|
+
*/
|
|
438
|
+
onSelectedPopupIdChange,
|
|
439
|
+
allowHeightResizeContainer: true,
|
|
440
|
+
allowWidthResizeContainer: false,
|
|
441
|
+
bounds: {
|
|
442
|
+
left: MARGIN_GRIDLAYOUT,
|
|
443
|
+
top: MARGIN_GRIDLAYOUT,
|
|
444
|
+
right: -MARGIN_GRIDLAYOUT,
|
|
445
|
+
bottom: -MARGIN_GRIDLAYOUT
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
},
|
|
451
|
+
/**
|
|
452
|
+
* closePopup
|
|
453
|
+
*/
|
|
454
|
+
closePopup: (areaId, windowId) => {
|
|
455
|
+
set((state) => {
|
|
456
|
+
const area = state.hashAreas[areaId];
|
|
457
|
+
if (!area) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
delete state.hashWindows[windowId];
|
|
461
|
+
});
|
|
462
|
+
},
|
|
382
463
|
/**
|
|
383
464
|
* closeWindowModal
|
|
384
465
|
*/
|
|
385
466
|
closeWindowModal: (removeModalId) => {
|
|
386
467
|
set((state) => {
|
|
387
|
-
const removeIndex = state.
|
|
468
|
+
const removeIndex = state.windowsModalsIds.findIndex((w) => w === removeModalId);
|
|
388
469
|
if (removeIndex > -1) {
|
|
389
|
-
state.
|
|
470
|
+
state.windowsModalsIds.splice(removeIndex, 1);
|
|
390
471
|
}
|
|
391
472
|
delete state.hashWindows[removeModalId];
|
|
392
|
-
delete state.hashWindowsModals[removeModalId];
|
|
393
473
|
});
|
|
394
474
|
},
|
|
395
475
|
/**
|
|
@@ -398,12 +478,11 @@ const createAreasStore = (initProps) => {
|
|
|
398
478
|
addWindowModal: (areaId, windowId, newWindowModalProps) => {
|
|
399
479
|
set((state) => {
|
|
400
480
|
const dynamicMFStore = createDynamicMFStore({
|
|
401
|
-
dynamicMFParameters: newWindowModalProps.dynamicParams
|
|
402
|
-
windowId
|
|
481
|
+
dynamicMFParameters: newWindowModalProps.dynamicParams
|
|
403
482
|
});
|
|
404
|
-
state.
|
|
483
|
+
state.windowsModalsIds.push(windowId);
|
|
405
484
|
const moduleCount = generateModuleCount(get().currentAreaId, newWindowModalProps.moduleId, get().hashWindows);
|
|
406
|
-
state.
|
|
485
|
+
state.hashWindows[windowId] = {
|
|
407
486
|
...newWindowModalProps,
|
|
408
487
|
areaId,
|
|
409
488
|
windowId,
|
|
@@ -412,7 +491,6 @@ const createAreasStore = (initProps) => {
|
|
|
412
491
|
dynamicMFStore,
|
|
413
492
|
moduleCount
|
|
414
493
|
};
|
|
415
|
-
state.hashWindows[windowId] = state.hashWindowsModals[windowId];
|
|
416
494
|
});
|
|
417
495
|
},
|
|
418
496
|
bouncedSaveBreakpointsLayouts: debounce(
|
|
@@ -476,32 +554,11 @@ const createAreasStore = (initProps) => {
|
|
|
476
554
|
* selectLayout
|
|
477
555
|
*/
|
|
478
556
|
selectLayout: (areaId, layoutId) => {
|
|
557
|
+
if (get().hashAreas[areaId].currentLayoutId === layoutId) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
479
560
|
set((state) => {
|
|
480
|
-
|
|
481
|
-
if (state.hashWindows[layoutId].emergeType === "layout") {
|
|
482
|
-
area.currentLayoutId = layoutId;
|
|
483
|
-
state.currentModuleId = state.hashWindows[layoutId].moduleId;
|
|
484
|
-
if (area.currentPopUpId !== "" && state.hashWindows[area.currentPopUpId]) {
|
|
485
|
-
if (state.hashWindows[area.currentPopUpId].parentLayoutId !== layoutId) {
|
|
486
|
-
area.currentPopUpId = "";
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
} else {
|
|
490
|
-
state.hashAreas[areaId].currentPopUpId = layoutId;
|
|
491
|
-
const parentLayoutId = state.hashWindows[layoutId]?.parentLayoutId;
|
|
492
|
-
if (parentLayoutId && state.hashWindows[parentLayoutId]) {
|
|
493
|
-
area.currentLayoutId = parentLayoutId;
|
|
494
|
-
state.currentModuleId = state.hashWindows[parentLayoutId].moduleId;
|
|
495
|
-
} else {
|
|
496
|
-
area.currentLayoutId = "";
|
|
497
|
-
state.currentModuleId = "";
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
setCookie({
|
|
501
|
-
networkOperation: get().networkOperation,
|
|
502
|
-
endPoint: `${area.id}/${COOKIE_WINDOW_SELECTED}`,
|
|
503
|
-
value: { currentLayoutId: layoutId }
|
|
504
|
-
});
|
|
561
|
+
helperSelectLayout(state, areaId, layoutId);
|
|
505
562
|
});
|
|
506
563
|
},
|
|
507
564
|
/**
|
|
@@ -532,11 +589,6 @@ const createAreasStore = (initProps) => {
|
|
|
532
589
|
return;
|
|
533
590
|
}
|
|
534
591
|
area.maximizedId = layoutId;
|
|
535
|
-
const index = area.layouts["xxs"]?.findIndex((li) => li.i === area.maximizedId);
|
|
536
|
-
if (index !== void 0 && index > -1 && layoutId && state.hashWindows[layoutId].emergeType === "popup") {
|
|
537
|
-
area.layouts["xxs"][index].visible = true;
|
|
538
|
-
area.layouts["xxs"][index].colapsed = false;
|
|
539
|
-
}
|
|
540
592
|
});
|
|
541
593
|
if (layoutId) {
|
|
542
594
|
get().areaActions.selectLayout(areaId, layoutId);
|
|
@@ -551,12 +603,6 @@ const createAreasStore = (initProps) => {
|
|
|
551
603
|
if (!area) {
|
|
552
604
|
return;
|
|
553
605
|
}
|
|
554
|
-
if (area.maximizedId) {
|
|
555
|
-
const index = area.layouts["xxs"]?.findIndex((li) => li.i === area.maximizedId);
|
|
556
|
-
if (index !== void 0 && index > -1 && state.hashWindows[area.maximizedId].emergeType === "popup") {
|
|
557
|
-
area.layouts["xxs"][index].visible = false;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
606
|
area.maximizedId = void 0;
|
|
561
607
|
});
|
|
562
608
|
},
|
|
@@ -599,17 +645,23 @@ const createAreasStore = (initProps) => {
|
|
|
599
645
|
area3.layouts = newBreakPointsLayouts;
|
|
600
646
|
area3.layoutItemsIds = newHashLayoutItems;
|
|
601
647
|
area3.status = "loaded";
|
|
648
|
+
const layoutSelected = getParmsFromValue(COOKIE_WINDOW_SELECTED, dataResponse) || "";
|
|
649
|
+
helperSelectLayout(state, areaId, layoutSelected, false);
|
|
602
650
|
});
|
|
603
|
-
const layoutSelected = getParmsFromValue(COOKIE_WINDOW_SELECTED, dataResponse);
|
|
604
|
-
if (layoutSelected) {
|
|
605
|
-
get().areaActions.selectLayout(areaId, layoutSelected.currentLayoutId);
|
|
606
|
-
}
|
|
607
651
|
}).catch((_response) => {
|
|
608
652
|
set((state) => {
|
|
609
653
|
state.hashAreas[areaId].status = "loaded";
|
|
610
654
|
});
|
|
611
655
|
});
|
|
612
656
|
}
|
|
657
|
+
// /**
|
|
658
|
+
// * setIsDraggingResizingPopup
|
|
659
|
+
// */
|
|
660
|
+
// setIsDraggingResizingPopup: (areaId: string, newIsDraggingResizingPopup: boolean) => {
|
|
661
|
+
// set(state => {
|
|
662
|
+
// state.hashAreas[areaId].isDraggingResizingPopup = newIsDraggingResizingPopup;
|
|
663
|
+
// });
|
|
664
|
+
// },
|
|
613
665
|
},
|
|
614
666
|
windowActions: {
|
|
615
667
|
/**
|
|
@@ -789,19 +841,9 @@ const createAreasStore = (initProps) => {
|
|
|
789
841
|
state.hashWindows[windowId].title = title;
|
|
790
842
|
});
|
|
791
843
|
}
|
|
792
|
-
},
|
|
793
|
-
areaAdminActions: {
|
|
794
|
-
/**
|
|
795
|
-
* setFocus
|
|
796
|
-
*/
|
|
797
|
-
setFocus: (newValue) => {
|
|
798
|
-
set((state) => {
|
|
799
|
-
state.ownerState = { ...state.ownerState, focus: newValue };
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
844
|
}
|
|
803
845
|
})),
|
|
804
|
-
{ name:
|
|
846
|
+
{ name: `${AREAS_STORE_ID}: ${initProps.storeId}`, enabled: storeDevtoolsEnabled }
|
|
805
847
|
)
|
|
806
848
|
);
|
|
807
849
|
};
|