@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,16 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { forwardRef, useState, useRef,
|
|
2
|
+
import React, { forwardRef, useState, useMemo, useRef, useImperativeHandle, useCallback } from "react";
|
|
3
3
|
import { DraggableCore } from "react-draggable";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { d as dragResizeWindowClasses } from "./classes/index.js";
|
|
6
6
|
import { D as DEFAULT_TRANSFORM_SCALE } from "./constants.js";
|
|
7
7
|
import { s as setTransform } from "./utils.js";
|
|
8
8
|
import { useForkRef } from "@mui/material";
|
|
9
|
-
import { g as getInitialSize } from "./helpers/index.js";
|
|
10
9
|
import { u as useDragOptions } from "./hooks/useDragOptions.js";
|
|
11
10
|
import { u as useResizeOptions } from "./hooks/useResizeOptions.js";
|
|
12
11
|
import { u as useDimensionEffects } from "./hooks/useDimensionEffects.js";
|
|
13
12
|
import { R as RootStyled } from "./slots/DragResizeWindowSlots.js";
|
|
13
|
+
import { g as getInitialSize } from "./helpers/getInitialSize.js";
|
|
14
14
|
import { R as Resizable } from "../extended/React-Resizable/Resizable/Resizable.js";
|
|
15
15
|
const DragResizeWindow = forwardRef((props, ref) => {
|
|
16
16
|
const {
|
|
@@ -20,7 +20,7 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
20
20
|
children,
|
|
21
21
|
defaultPosition = { vertical: { top: 0, height: 100 }, horizontal: { left: 0, width: 100 } },
|
|
22
22
|
containerElement,
|
|
23
|
-
containerSize,
|
|
23
|
+
containerSize = { containerWidth: 200, containerHeight: 200 },
|
|
24
24
|
transformScale = DEFAULT_TRANSFORM_SCALE,
|
|
25
25
|
bounds = { left: 5, top: 5, right: -5, bottom: -5 },
|
|
26
26
|
minWindowWidth = 200,
|
|
@@ -41,12 +41,16 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
41
41
|
onResize,
|
|
42
42
|
onResizeStop,
|
|
43
43
|
hidden,
|
|
44
|
+
allowHeightResizeContainer = false,
|
|
45
|
+
allowWidthResizeContainer = false,
|
|
46
|
+
windowRef,
|
|
44
47
|
//Otras
|
|
45
48
|
...others
|
|
46
49
|
} = props;
|
|
47
50
|
const [currentState, setCurrentState] = useState(
|
|
48
|
-
getInitialSize(containerSize, defaultPosition)
|
|
51
|
+
() => getInitialSize(containerSize, defaultPosition, containerElement)
|
|
49
52
|
);
|
|
53
|
+
const minConstraints = useMemo(() => [minWindowWidth, minWindowHeight], [minWindowWidth, minWindowHeight]);
|
|
50
54
|
const stateRef = useRef({
|
|
51
55
|
bounds,
|
|
52
56
|
data: void 0,
|
|
@@ -55,11 +59,60 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
55
59
|
left: currentState.left,
|
|
56
60
|
top: currentState.top,
|
|
57
61
|
width: currentState.width,
|
|
58
|
-
height: currentState.height
|
|
62
|
+
height: currentState.height,
|
|
63
|
+
minConstraints
|
|
59
64
|
});
|
|
60
65
|
const wrapperRef = useRef(null);
|
|
61
|
-
|
|
66
|
+
useImperativeHandle(ref, () => ({
|
|
67
|
+
/**
|
|
68
|
+
* "ensureVisible" enfoca la ventana para que esté visible, cuando se requiere desde afuera ubicarla en el contenedor padre
|
|
69
|
+
*/
|
|
70
|
+
ensureVisible: () => {
|
|
71
|
+
if (!wrapperRef.current || !containerElement) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const containerRect = containerElement.getBoundingClientRect();
|
|
75
|
+
const elementRect = wrapperRef.current.getBoundingClientRect();
|
|
76
|
+
const elementHeight = elementRect.height;
|
|
77
|
+
const elementWidth = elementRect.width;
|
|
78
|
+
const relativeTop = elementRect.top - containerRect.top + containerElement.scrollTop;
|
|
79
|
+
const relativeLeft = elementRect.left - containerRect.left + containerElement.scrollLeft;
|
|
80
|
+
const relativeBottom = relativeTop + elementHeight;
|
|
81
|
+
const relativeRight = relativeLeft + elementWidth;
|
|
82
|
+
const containerViewportHeight = containerElement.clientHeight;
|
|
83
|
+
const containerViewportWidth = containerElement.clientWidth;
|
|
84
|
+
const containerRelativeBottom = containerElement.scrollTop + containerViewportHeight;
|
|
85
|
+
const tolerance = 0.5;
|
|
86
|
+
const isInViewportVertically = relativeTop >= containerElement.scrollTop - tolerance && relativeBottom <= containerRelativeBottom + tolerance;
|
|
87
|
+
const isInViewportHorizontally = relativeLeft >= containerElement.scrollLeft - tolerance && relativeRight <= containerElement.scrollLeft + containerViewportWidth + tolerance;
|
|
88
|
+
if (!isInViewportVertically || !isInViewportHorizontally) {
|
|
89
|
+
let newScrollTop, newScrollLeft;
|
|
90
|
+
if (elementHeight > containerViewportHeight) {
|
|
91
|
+
newScrollTop = relativeTop;
|
|
92
|
+
} else {
|
|
93
|
+
newScrollTop = relativeTop - containerViewportHeight / 2 + elementHeight / 2;
|
|
94
|
+
}
|
|
95
|
+
if (elementWidth > containerViewportWidth) {
|
|
96
|
+
newScrollLeft = relativeLeft;
|
|
97
|
+
} else {
|
|
98
|
+
newScrollLeft = relativeLeft - containerViewportWidth / 2 + elementWidth / 2;
|
|
99
|
+
}
|
|
100
|
+
containerElement.scrollTo({
|
|
101
|
+
top: Math.max(0, newScrollTop),
|
|
102
|
+
left: Math.max(0, newScrollLeft),
|
|
103
|
+
behavior: "smooth"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* "current" devuelve el elemento DOM de la ventana
|
|
109
|
+
*/
|
|
110
|
+
current: wrapperRef.current
|
|
111
|
+
}), [containerElement]);
|
|
112
|
+
const handleAllRefs = useForkRef(wrapperRef, windowRef);
|
|
62
113
|
const { localOnDragStart, localOnDrag, localOnDragStop } = useDragOptions({
|
|
114
|
+
allowHeightResizeContainer,
|
|
115
|
+
allowWidthResizeContainer,
|
|
63
116
|
containerElement,
|
|
64
117
|
transformScale,
|
|
65
118
|
onDragStart,
|
|
@@ -69,6 +122,9 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
69
122
|
setCurrentState
|
|
70
123
|
});
|
|
71
124
|
const { localOnResize, localOnResizeStart, localOnResizeStop } = useResizeOptions({
|
|
125
|
+
allowHeightResizeContainer,
|
|
126
|
+
allowWidthResizeContainer,
|
|
127
|
+
containerElement,
|
|
72
128
|
onResizeStart,
|
|
73
129
|
onResize,
|
|
74
130
|
onResizeStop,
|
|
@@ -84,11 +140,12 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
84
140
|
minWindowWidth,
|
|
85
141
|
minWindowHeight,
|
|
86
142
|
wrapperRef,
|
|
87
|
-
currentState
|
|
143
|
+
currentState,
|
|
144
|
+
allowHeightResizeContainer,
|
|
145
|
+
allowWidthResizeContainer
|
|
88
146
|
});
|
|
89
147
|
const mixinResizable = useCallback(
|
|
90
148
|
(child, position) => {
|
|
91
|
-
const minConstraints = [minWindowWidth, minWindowHeight];
|
|
92
149
|
return /* @__PURE__ */ jsx(
|
|
93
150
|
Resizable,
|
|
94
151
|
{
|
|
@@ -109,8 +166,7 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
109
166
|
}
|
|
110
167
|
);
|
|
111
168
|
},
|
|
112
|
-
|
|
113
|
-
[resizable, transformScale]
|
|
169
|
+
[resizable, minConstraints, localOnResizeStop, localOnResizeStart, localOnResize, transformScale, resizeHandles, resizeHandle]
|
|
114
170
|
);
|
|
115
171
|
const mixinDraggable = useCallback(
|
|
116
172
|
(child) => {
|
|
@@ -136,7 +192,9 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
136
192
|
const classNameFinal = clsx(className, {
|
|
137
193
|
"react-draggable": draggable,
|
|
138
194
|
//Requerido para el componente Draggable
|
|
139
|
-
[dragResizeWindowClasses.hidden]: hidden
|
|
195
|
+
[dragResizeWindowClasses.hidden]: hidden,
|
|
196
|
+
[dragResizeWindowClasses.dragging]: currentState.dragging,
|
|
197
|
+
[dragResizeWindowClasses.resizing]: currentState.resizing
|
|
140
198
|
// dropping: Boolean(droppingPosition),
|
|
141
199
|
});
|
|
142
200
|
const styleFinal = {
|
|
@@ -17,7 +17,6 @@ const dragResizeWindowStyles = {
|
|
|
17
17
|
width: "0px",
|
|
18
18
|
height: "0px",
|
|
19
19
|
backgroundColor: theme.vars.palette.background.default,
|
|
20
|
-
prop2: 1,
|
|
21
20
|
...ownerState?.hidden ? {
|
|
22
21
|
visibility: "hidden",
|
|
23
22
|
pointerEvents: "none"
|
|
@@ -40,7 +39,6 @@ const dragResizeWindowStyles = {
|
|
|
40
39
|
width: "0px",
|
|
41
40
|
height: "0px",
|
|
42
41
|
backgroundColor: "gray",
|
|
43
|
-
prop2: 1,
|
|
44
42
|
cursor: "default"
|
|
45
43
|
})
|
|
46
44
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CurrentState, DraggableWindowBounds, StateRef } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* "draggingOrResizingWindow": Encargada de garantizar las medidas cuando se hace dragging o cuando se hace resizig
|
|
4
|
+
* no desborden en el contenedor padre.
|
|
5
|
+
* @deprecated NO USAR ESTA FUNCION, ya que los controles se estan haciendo directamente en los handlers onResize y onDrag
|
|
6
|
+
*/
|
|
7
|
+
export declare const draggingOrResizingWindow: (stateRef: React.MutableRefObject<StateRef>, newState: CurrentState, _currentState: CurrentState, containerDimension: number, _divRoot: HTMLDivElement, dimension: "Width" | "Height", allowResizeContainer?: boolean, bounds?: DraggableWindowBounds) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CurrentState, DraggableWindowBounds } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* "expandingParentContainer": Encargada de manejar la expansión de la ventana padre
|
|
4
|
+
* 1. Si el ancho y alto fue compactado, los recupera si es el contenedor padre volvió a crecer
|
|
5
|
+
* 2. Si el left o top fue desplazado, recupera de nuevo las posiciones donde estaban.
|
|
6
|
+
*
|
|
7
|
+
* Consideraciones:
|
|
8
|
+
* Si por alguna razón el cliente mueve o redimensiona la ventana,
|
|
9
|
+
* se borran los flags que indican que hay que recuperar el ancho y alto, o el left y top.
|
|
10
|
+
* (shrinkLeftTopAt, overflowDimensionAt)
|
|
11
|
+
*/
|
|
12
|
+
export declare const expandingParentContainer: (newState: CurrentState, _currentState: CurrentState, containerDimension: number, _divRoot: HTMLDivElement, dimension: "Width" | "Height", bounds?: DraggableWindowBounds) => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const expandingParentContainer = (newState, _currentState, containerDimension, _divRoot, dimension, bounds) => {
|
|
2
|
+
const lDimension = dimension === "Width" ? "width" : "height";
|
|
3
|
+
const leftTop = dimension === "Width" ? "left" : "top";
|
|
4
|
+
const shrinkLeftTopAt = dimension === "Width" ? "shrinkLeftAt" : "shrinkTopAt";
|
|
5
|
+
const overflowDimensionAt = dimension === "Width" ? "overflowWidthAt" : "overflowHeightAt";
|
|
6
|
+
const boundsLefTop = dimension === "Width" ? 0 : 0;
|
|
7
|
+
const initialPosition = dimension === "Width" ? 0 : 0;
|
|
8
|
+
const maxDimensionElement = containerDimension - boundsLefTop + initialPosition;
|
|
9
|
+
const valOverflowDimensionAt = newState[overflowDimensionAt];
|
|
10
|
+
if (valOverflowDimensionAt) {
|
|
11
|
+
if (valOverflowDimensionAt > maxDimensionElement) {
|
|
12
|
+
newState[lDimension] = maxDimensionElement;
|
|
13
|
+
} else {
|
|
14
|
+
newState[lDimension] = valOverflowDimensionAt;
|
|
15
|
+
newState[overflowDimensionAt] = void 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const valShrinkLeftTopAt = newState[shrinkLeftTopAt];
|
|
19
|
+
if (valShrinkLeftTopAt && !newState[overflowDimensionAt]) {
|
|
20
|
+
const dimensionAvailable = containerDimension - boundsLefTop - newState[lDimension] + initialPosition;
|
|
21
|
+
if (valShrinkLeftTopAt <= dimensionAvailable) {
|
|
22
|
+
newState[leftTop] = valShrinkLeftTopAt;
|
|
23
|
+
newState[shrinkLeftTopAt] = void 0;
|
|
24
|
+
} else {
|
|
25
|
+
newState[leftTop] = dimensionAvailable;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
expandingParentContainer as e
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContainerSize } from '../../../utils/types';
|
|
2
|
+
import { CurrentState, DefaultPosition } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the initial size and position of an element based on the provided container size
|
|
5
|
+
* and default position values.
|
|
6
|
+
*
|
|
7
|
+
* This function returns an object with `top`, `left`, `width`, and `height` properties,
|
|
8
|
+
* which specify the initial position and size of the element. If values for `right` or `bottom`
|
|
9
|
+
* are provided instead of `top` and `left`, the function calculates the starting position based
|
|
10
|
+
* on the container dimensions, ensuring that the element is correctly positioned.
|
|
11
|
+
* @param {ContainerSize | undefined} containerSize - Object containing `containerHeight` and `containerWidth`. Defaults to 200 for both if not provided.
|
|
12
|
+
* @param {DefaultPosition} defaultPosition - Object defining the default vertical and horizontal positions (`top`, `bottom`, `height`, `left`, `right`, `width`).
|
|
13
|
+
* @returns {CurrentState} - The initial size and position of the element with `top`, `left`, `width`, and `height` properties.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getInitialSize: (containerSize: ContainerSize | undefined, defaultPosition: DefaultPosition, containerElement: HTMLElement | undefined) => CurrentState;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const getInitialSize = (containerSize, defaultPosition, containerElement) => {
|
|
2
|
+
let top;
|
|
3
|
+
let bottom;
|
|
4
|
+
let height;
|
|
5
|
+
let left;
|
|
6
|
+
let right;
|
|
7
|
+
let width;
|
|
8
|
+
const containerHeight = containerSize?.containerHeight || 200;
|
|
9
|
+
const containerWidth = containerSize?.containerWidth || 200;
|
|
10
|
+
const scrollTop = containerElement?.scrollTop || 0;
|
|
11
|
+
const scrollLeft = containerElement?.scrollLeft || 0;
|
|
12
|
+
if ("top" in defaultPosition.vertical) {
|
|
13
|
+
top = defaultPosition.vertical.top;
|
|
14
|
+
}
|
|
15
|
+
if ("bottom" in defaultPosition.vertical) {
|
|
16
|
+
bottom = defaultPosition.vertical.bottom;
|
|
17
|
+
}
|
|
18
|
+
if ("height" in defaultPosition.vertical) {
|
|
19
|
+
height = defaultPosition.vertical.height;
|
|
20
|
+
}
|
|
21
|
+
if ("left" in defaultPosition.horizontal) {
|
|
22
|
+
left = defaultPosition.horizontal.left;
|
|
23
|
+
}
|
|
24
|
+
if ("right" in defaultPosition.horizontal) {
|
|
25
|
+
right = defaultPosition.horizontal.right;
|
|
26
|
+
}
|
|
27
|
+
if ("width" in defaultPosition.horizontal) {
|
|
28
|
+
width = defaultPosition.horizontal.width;
|
|
29
|
+
if (!("left" in defaultPosition.horizontal)) {
|
|
30
|
+
left = scrollLeft + (containerWidth - width) / 2;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if ("height" in defaultPosition.vertical) {
|
|
34
|
+
height = defaultPosition.vertical.height;
|
|
35
|
+
if (!("top" in defaultPosition.vertical)) {
|
|
36
|
+
top = scrollTop + (containerHeight - height) / 2;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if ("percent" in defaultPosition.vertical) {
|
|
40
|
+
height = containerHeight * defaultPosition.vertical.percent;
|
|
41
|
+
top = (containerHeight - height) / 2;
|
|
42
|
+
}
|
|
43
|
+
if ("percent" in defaultPosition.horizontal) {
|
|
44
|
+
width = containerWidth * defaultPosition.horizontal.percent;
|
|
45
|
+
left = (containerWidth - width) / 2;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
top: top ?? (bottom ? containerHeight - bottom - (height || 0) : 0),
|
|
49
|
+
height: height ?? containerHeight - (top || 0) - (bottom || 0),
|
|
50
|
+
left: left ?? (right ? containerWidth - right - (width || 0) : 0),
|
|
51
|
+
width: width ?? containerWidth - (left || 0) - (right || 0)
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
getInitialSize as g
|
|
56
|
+
};
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This function returns an object with `top`, `left`, `width`, and `height` properties,
|
|
8
|
-
* which specify the initial position and size of the element. If values for `right` or `bottom`
|
|
9
|
-
* are provided instead of `top` and `left`, the function calculates the starting position based
|
|
10
|
-
* on the container dimensions, ensuring that the element is correctly positioned.
|
|
11
|
-
* @param {ContainerSize | undefined} containerSize - Object containing `containerHeight` and `containerWidth`. Defaults to 200 for both if not provided.
|
|
12
|
-
* @param {DefaultPosition} defaultPosition - Object defining the default vertical and horizontal positions (`top`, `bottom`, `height`, `left`, `right`, `width`).
|
|
13
|
-
* @returns {CurrentState} - The initial size and position of the element with `top`, `left`, `width`, and `height` properties.
|
|
14
|
-
*/
|
|
15
|
-
export declare const getInitialSize: (containerSize: ContainerSize | undefined, defaultPosition: DefaultPosition) => CurrentState;
|
|
1
|
+
export * from './draggingOrResizingWindow';
|
|
2
|
+
export * from './expandingParentContainer';
|
|
3
|
+
export * from './isElmentInViewport';
|
|
4
|
+
export * from './pointPosition';
|
|
5
|
+
export * from './shrinkingParentContainer';
|
|
6
|
+
export * from './getInitialSize';
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
let top;
|
|
3
|
-
let bottom;
|
|
4
|
-
let height;
|
|
5
|
-
let left;
|
|
6
|
-
let right;
|
|
7
|
-
let width;
|
|
8
|
-
if ("top" in defaultPosition.vertical) {
|
|
9
|
-
top = defaultPosition.vertical.top;
|
|
10
|
-
}
|
|
11
|
-
if ("bottom" in defaultPosition.vertical) {
|
|
12
|
-
bottom = defaultPosition.vertical.bottom;
|
|
13
|
-
}
|
|
14
|
-
if ("height" in defaultPosition.vertical) {
|
|
15
|
-
height = defaultPosition.vertical.height;
|
|
16
|
-
}
|
|
17
|
-
if ("left" in defaultPosition.horizontal) {
|
|
18
|
-
left = defaultPosition.horizontal.left;
|
|
19
|
-
}
|
|
20
|
-
if ("right" in defaultPosition.horizontal) {
|
|
21
|
-
right = defaultPosition.horizontal.right;
|
|
22
|
-
}
|
|
23
|
-
if ("width" in defaultPosition.horizontal) {
|
|
24
|
-
width = defaultPosition.horizontal.width;
|
|
25
|
-
}
|
|
26
|
-
const containerHeight = containerSize?.containerHeight || 200;
|
|
27
|
-
const containerWidth = containerSize?.containerWidth || 200;
|
|
28
|
-
return {
|
|
29
|
-
top: top ?? (bottom ? containerHeight - bottom - (height || 0) : 0),
|
|
30
|
-
height: height ?? containerHeight - (top || 0) - (bottom || 0),
|
|
31
|
-
left: left ?? (right ? containerWidth - right - (width || 0) : 0),
|
|
32
|
-
width: width ?? containerWidth - (left || 0) - (right || 0)
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
getInitialSize as g
|
|
37
|
-
};
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determina si un elemento está visible dentro del viewport de un contenedor
|
|
3
|
+
* @param element - El elemento a verificar
|
|
4
|
+
* @param container - El contenedor que define el viewport
|
|
5
|
+
* @param options - Opciones adicionales
|
|
6
|
+
* @returns Un objeto con información sobre la visibilidad horizontal y vertical
|
|
7
|
+
*/
|
|
8
|
+
export declare const isElementInViewport: (element: HTMLElement, container: HTMLElement, options?: {
|
|
9
|
+
tolerance: number;
|
|
10
|
+
}) => {
|
|
11
|
+
isVisibleVertically: boolean;
|
|
12
|
+
isVisibleHorizontally: boolean;
|
|
13
|
+
isFullyVisible: boolean;
|
|
14
|
+
visiblePercentage: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DraggableWindowBounds } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Verifica si el punto está dentro del rectángulo del contenedor
|
|
4
|
+
*/
|
|
5
|
+
export declare function isPointInsideContainer(e: React.MouseEvent<HTMLElement, MouseEvent>, container?: HTMLElement, bounds?: DraggableWindowBounds): boolean[];
|
|
6
|
+
/**
|
|
7
|
+
* Resultado extendido que indica la posición del punto respecto al contenedor.
|
|
8
|
+
*/
|
|
9
|
+
export interface PointPosition {
|
|
10
|
+
isInside: boolean;
|
|
11
|
+
isLeft: boolean;
|
|
12
|
+
isRight: boolean;
|
|
13
|
+
isAbove: boolean;
|
|
14
|
+
isBelow: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Versión extendida que proporciona información detallada sobre la posición.
|
|
18
|
+
* Esta función se puede usar junto con la original cuando se necesite información adicional.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getDetailedPointPosition(e: React.MouseEvent<HTMLElement, MouseEvent> | React.TouchEvent<HTMLElement>, element?: HTMLElement, bounds?: DraggableWindowBounds): [PointPosition, PointPosition];
|
|
21
|
+
/**
|
|
22
|
+
* Resultado que indica si el punto está en la franja de arrastre en cada eje
|
|
23
|
+
*/
|
|
24
|
+
export interface DragStripPosition {
|
|
25
|
+
isInside: boolean;
|
|
26
|
+
isInStrip: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Verifica si un punto está dentro de las franjas de arrastre de un elemento
|
|
30
|
+
* y devuelve información detallada para los ejes X e Y
|
|
31
|
+
* @param e - Evento del mouse o touch
|
|
32
|
+
* @param element - Elemento a verificar
|
|
33
|
+
* @param stripWidth - Ancho de las franjas de arrastre (en píxeles)
|
|
34
|
+
* @returns - Tupla con información para el eje X y el eje Y
|
|
35
|
+
*/
|
|
36
|
+
export declare function isPointInDragStrip(e: React.MouseEvent<HTMLElement, MouseEvent> | React.TouchEvent<HTMLElement>, element?: HTMLElement, stripWidth?: number): [DragStripPosition, DragStripPosition];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function getDetailedPointPosition(e, element, bounds = { left: 0, top: 0, right: 0, bottom: 0 }) {
|
|
2
|
+
if (!element) {
|
|
3
|
+
return [
|
|
4
|
+
{ isInside: false, isLeft: false, isRight: false, isAbove: false, isBelow: false },
|
|
5
|
+
{ isInside: false, isLeft: false, isRight: false, isAbove: false, isBelow: false }
|
|
6
|
+
];
|
|
7
|
+
}
|
|
8
|
+
let clientX, clientY;
|
|
9
|
+
if ("touches" in e) {
|
|
10
|
+
if (e.touches.length === 0) {
|
|
11
|
+
return [
|
|
12
|
+
{ isInside: false, isLeft: false, isRight: false, isAbove: false, isBelow: false },
|
|
13
|
+
{ isInside: false, isLeft: false, isRight: false, isAbove: false, isBelow: false }
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
clientX = e.touches[0].clientX;
|
|
17
|
+
clientY = e.touches[0].clientY;
|
|
18
|
+
} else {
|
|
19
|
+
clientX = e.clientX;
|
|
20
|
+
clientY = e.clientY;
|
|
21
|
+
}
|
|
22
|
+
const rect = element.getBoundingClientRect();
|
|
23
|
+
const leftBound = rect.left + (bounds.left || 0);
|
|
24
|
+
const rightBound = rect.left + element.clientWidth + (bounds.right || 0);
|
|
25
|
+
const topBound = rect.top + (bounds.top || 0);
|
|
26
|
+
const bottomBound = rect.top + element.clientHeight + (bounds.bottom || 0);
|
|
27
|
+
const xPosition = {
|
|
28
|
+
isInside: clientX >= leftBound && clientX <= rightBound,
|
|
29
|
+
isLeft: clientX < leftBound,
|
|
30
|
+
isRight: clientX > rightBound,
|
|
31
|
+
isAbove: false,
|
|
32
|
+
isBelow: false
|
|
33
|
+
};
|
|
34
|
+
const yPosition = {
|
|
35
|
+
isInside: clientY >= topBound && clientY <= bottomBound,
|
|
36
|
+
isLeft: false,
|
|
37
|
+
isRight: false,
|
|
38
|
+
isAbove: clientY < topBound,
|
|
39
|
+
isBelow: clientY > bottomBound
|
|
40
|
+
};
|
|
41
|
+
return [xPosition, yPosition];
|
|
42
|
+
}
|
|
43
|
+
function isPointInDragStrip(e, element, stripWidth = 1) {
|
|
44
|
+
const defaultResult = {
|
|
45
|
+
isInside: false,
|
|
46
|
+
isInStrip: false
|
|
47
|
+
};
|
|
48
|
+
if (!element) {
|
|
49
|
+
return [{ ...defaultResult }, { ...defaultResult }];
|
|
50
|
+
}
|
|
51
|
+
let clientX, clientY;
|
|
52
|
+
if ("touches" in e) {
|
|
53
|
+
if (e.touches.length === 0) {
|
|
54
|
+
return [{ ...defaultResult }, { ...defaultResult }];
|
|
55
|
+
}
|
|
56
|
+
clientX = e.touches[0].clientX;
|
|
57
|
+
clientY = e.touches[0].clientY;
|
|
58
|
+
} else {
|
|
59
|
+
clientX = e.clientX;
|
|
60
|
+
clientY = e.clientY;
|
|
61
|
+
}
|
|
62
|
+
const rect = element.getBoundingClientRect();
|
|
63
|
+
const isInsideX = clientX >= rect.left && clientX <= rect.right;
|
|
64
|
+
const isInsideY = clientY >= rect.top && clientY <= rect.bottom;
|
|
65
|
+
const stripBoundLeft = rect.left - stripWidth;
|
|
66
|
+
const stripBoundRight = rect.right + stripWidth;
|
|
67
|
+
const stripBoundTop = rect.top - stripWidth;
|
|
68
|
+
const stripBoundBottom = rect.bottom + stripWidth;
|
|
69
|
+
const xPosition = {
|
|
70
|
+
isInside: isInsideX,
|
|
71
|
+
isInStrip: clientX >= stripBoundLeft && clientX <= stripBoundRight
|
|
72
|
+
};
|
|
73
|
+
const yPosition = {
|
|
74
|
+
isInside: isInsideY,
|
|
75
|
+
isInStrip: clientY >= stripBoundTop && clientY <= stripBoundBottom
|
|
76
|
+
};
|
|
77
|
+
return [xPosition, yPosition];
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
getDetailedPointPosition as g,
|
|
81
|
+
isPointInDragStrip as i
|
|
82
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CurrentState, DraggableWindowBounds } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* "shrinkingParentContainer": Encargada de manejar la contracción de la ventana padre
|
|
4
|
+
* 1. Si el ancho o alto de la ventana cuando se va compactando toca
|
|
5
|
+
*/
|
|
6
|
+
export declare const shrinkingParentContainer: (newState: CurrentState, cState: CurrentState, containerDimension: number, divRoot: HTMLDivElement, dimension: "Width" | "Height", allowResizeContainer: boolean | undefined, minWindowWidth: number, minWindowHeight: number, bounds?: DraggableWindowBounds) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const shrinkingParentContainer = (newState, cState, containerDimension, divRoot, dimension, allowResizeContainer = false, minWindowWidth, minWindowHeight, bounds) => {
|
|
2
|
+
const lDimension = dimension === "Width" ? "width" : "height";
|
|
3
|
+
const leftTop = dimension === "Width" ? "left" : "top";
|
|
4
|
+
const shrinkLeftTopAt = dimension === "Width" ? "shrinkLeftAt" : "shrinkTopAt";
|
|
5
|
+
const overflowDimensionAt = dimension === "Width" ? "overflowWidthAt" : "overflowHeightAt";
|
|
6
|
+
const boundsLefTop = dimension === "Width" ? bounds?.left || 0 : bounds?.top || 0;
|
|
7
|
+
const boundsRightBottom = dimension === "Width" ? bounds?.right || 0 : bounds?.bottom || 0;
|
|
8
|
+
const minWindowDimension = dimension === "Width" ? minWindowWidth : minWindowHeight;
|
|
9
|
+
const minDimension = containerDimension - boundsLefTop + boundsRightBottom > minWindowDimension ? containerDimension - boundsLefTop + boundsRightBottom : minWindowDimension;
|
|
10
|
+
let maxDimensionElement = containerDimension - cState[leftTop] + boundsRightBottom;
|
|
11
|
+
if (divRoot[`client${dimension}`] > maxDimensionElement && !allowResizeContainer) {
|
|
12
|
+
const shrunkenPixels = divRoot[`client${dimension}`] - maxDimensionElement;
|
|
13
|
+
if (shrunkenPixels < cState[leftTop] - boundsLefTop) {
|
|
14
|
+
newState[leftTop] = newState[leftTop] - shrunkenPixels;
|
|
15
|
+
newState[shrinkLeftTopAt] = newState[shrinkLeftTopAt] || cState[leftTop];
|
|
16
|
+
} else if (shrunkenPixels > cState[leftTop] - boundsLefTop) {
|
|
17
|
+
newState[leftTop] = boundsLefTop;
|
|
18
|
+
newState[shrinkLeftTopAt] = newState[shrinkLeftTopAt] || cState[leftTop];
|
|
19
|
+
maxDimensionElement = containerDimension - boundsLefTop + boundsRightBottom;
|
|
20
|
+
if (divRoot[`client${dimension}`] > maxDimensionElement) {
|
|
21
|
+
newState[lDimension] = maxDimensionElement;
|
|
22
|
+
newState[overflowDimensionAt] = newState[overflowDimensionAt] || cState[lDimension];
|
|
23
|
+
if (newState[lDimension] < minDimension) {
|
|
24
|
+
newState[lDimension] = minDimension;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
shrinkingParentContainer as s
|
|
34
|
+
};
|
|
@@ -11,6 +11,8 @@ type useOnDragStartProps = {
|
|
|
11
11
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
12
12
|
currentState: CurrentState;
|
|
13
13
|
setCurrentState: React.Dispatch<React.SetStateAction<CurrentState>>;
|
|
14
|
+
allowHeightResizeContainer?: boolean;
|
|
15
|
+
allowWidthResizeContainer?: boolean;
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* "useDimensionEffects" Redimensiona la ventana si el contenedor padre es desbordado por ella.
|