@m4l/components 9.84.1 → 9.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CheckableList/CheckableList.d.ts.map +1 -1
- package/components/CheckableList/CheckableList.js +250 -219
- package/components/CheckableList/CheckableList.styles.d.ts.map +1 -1
- package/components/CheckableList/CheckableList.styles.js +12 -0
- package/components/CheckableList/constants.d.ts +1 -1
- package/components/CheckableList/constants.d.ts.map +1 -1
- package/components/CheckableList/dictionary.d.ts +4 -2
- package/components/CheckableList/dictionary.d.ts.map +1 -1
- package/components/CheckableList/dictionary.js +6 -1
- package/components/CheckableList/dictionaryDefaults.d.ts +26 -0
- package/components/CheckableList/dictionaryDefaults.d.ts.map +1 -0
- package/components/CheckableList/dictionaryDefaults.js +31 -0
- package/components/CheckableList/hooks/types.d.ts +9 -0
- package/components/CheckableList/hooks/types.d.ts.map +1 -1
- package/components/CheckableList/hooks/useCheckableListHandlers.d.ts +2 -1
- package/components/CheckableList/hooks/useCheckableListHandlers.d.ts.map +1 -1
- package/components/CheckableList/hooks/useCheckableListHandlers.js +54 -40
- package/components/CheckableList/hooks/useCheckableListValue.d.ts +4 -0
- package/components/CheckableList/hooks/useCheckableListValue.d.ts.map +1 -0
- package/components/CheckableList/hooks/useCheckableListValue.js +28 -0
- package/components/CheckableList/index.d.ts +2 -0
- package/components/CheckableList/index.d.ts.map +1 -1
- package/components/CheckableList/slots/slots.d.ts +1 -0
- package/components/CheckableList/slots/slots.d.ts.map +1 -1
- package/components/CheckableList/slots/slots.js +1 -1
- package/components/CheckableList/slots/styled.d.ts +3 -0
- package/components/CheckableList/slots/styled.d.ts.map +1 -1
- package/components/CheckableList/slots/styled.js +62 -58
- package/components/CheckableList/types.d.ts +4 -0
- package/components/CheckableList/types.d.ts.map +1 -1
- package/components/DragResizeWindowRND/DragResizeWindowRND.d.ts.map +1 -1
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +132 -118
- package/components/DragResizeWindowRND/constants.d.ts +1 -0
- package/components/DragResizeWindowRND/constants.d.ts.map +1 -1
- package/components/DragResizeWindowRND/constants.js +3 -2
- package/components/DragResizeWindowRND/hooks/types.d.ts +15 -0
- package/components/DragResizeWindowRND/hooks/types.d.ts.map +1 -0
- package/components/DragResizeWindowRND/hooks/useRNDCollapse.d.ts +4 -0
- package/components/DragResizeWindowRND/hooks/useRNDCollapse.d.ts.map +1 -0
- package/components/DragResizeWindowRND/hooks/useRNDCollapse.js +41 -0
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.d.ts +1 -0
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.d.ts.map +1 -1
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.js +21 -19
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.d.ts +2 -0
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.d.ts.map +1 -1
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.js +55 -54
- package/components/DragResizeWindowRND/types.d.ts +4 -0
- package/components/DragResizeWindowRND/types.d.ts.map +1 -1
- package/components/Label/Label.d.ts +2 -5
- package/components/Label/Label.d.ts.map +1 -1
- package/components/Label/Label.js +34 -35
- package/components/SortableList/dictionaryDefaults.d.ts +7 -0
- package/components/SortableList/dictionaryDefaults.d.ts.map +1 -0
- package/components/SortableList/dictionaryDefaults.js +34 -0
- package/components/SortableList/index.d.ts +1 -0
- package/components/SortableList/index.d.ts.map +1 -1
- package/components/Stepper/helpers/focusFirstErrorField/index.d.ts +1 -1
- package/components/Stepper/helpers/focusFirstErrorField/index.d.ts.map +1 -1
- package/components/Stepper/helpers/focusFirstErrorField/index.js +29 -14
- package/components/Stepper/helpers/getStepFocusTargets/constants.d.ts +4 -0
- package/components/Stepper/helpers/getStepFocusTargets/constants.d.ts.map +1 -0
- package/components/Stepper/helpers/getStepFocusTargets/constants.js +32 -0
- package/components/Stepper/helpers/getStepFocusTargets/index.d.ts +10 -0
- package/components/Stepper/helpers/getStepFocusTargets/index.d.ts.map +1 -0
- package/components/Stepper/helpers/getStepFocusTargets/index.js +34 -0
- package/components/Stepper/helpers/getStepFocusTargets/types.d.ts +6 -0
- package/components/Stepper/helpers/getStepFocusTargets/types.d.ts.map +1 -0
- package/components/Stepper/hooks/useStepEntryFocus/index.d.ts +4 -0
- package/components/Stepper/hooks/useStepEntryFocus/index.d.ts.map +1 -0
- package/components/Stepper/hooks/useStepEntryFocus/index.js +59 -0
- package/components/Stepper/hooks/useStepEntryFocus/types.d.ts +9 -0
- package/components/Stepper/hooks/useStepEntryFocus/types.d.ts.map +1 -0
- package/components/Stepper/hooks/useStepperActions/index.d.ts.map +1 -1
- package/components/Stepper/hooks/useStepperActions/index.js +53 -43
- package/components/Stepper/index.d.ts +1 -0
- package/components/Stepper/index.d.ts.map +1 -1
- package/components/Stepper/store/StepperContext/index.d.ts.map +1 -1
- package/components/Stepper/store/StepperContext/index.js +37 -35
- package/components/Stepper/store/StepperFocusContext/index.d.ts +5 -0
- package/components/Stepper/store/StepperFocusContext/index.d.ts.map +1 -0
- package/components/Stepper/store/StepperFocusContext/index.js +9 -0
- package/components/Stepper/store/StepperFocusContext/types.d.ts +8 -0
- package/components/Stepper/store/StepperFocusContext/types.d.ts.map +1 -0
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +74 -57
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +21 -6
- package/components/Stepper/tests/focus/fixtures.d.ts +8 -0
- package/components/Stepper/tests/focus/fixtures.d.ts.map +1 -0
- package/components/Stepper/tests/focus/types.d.ts +63 -0
- package/components/Stepper/tests/focus/types.d.ts.map +1 -0
- package/components/Stepper/types.d.ts +8 -0
- package/components/Stepper/types.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.js +74 -64
- package/components/WindowBase/WindowBase.styles.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.styles.js +16 -5
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +59 -58
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/Header/types.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/useButtonActions.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +13 -12
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.js +5 -5
- package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts +2 -0
- package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts.map +1 -1
- package/components/WindowBase/types.d.ts +7 -1
- package/components/WindowBase/types.d.ts.map +1 -1
- package/components/areas/types.d.ts +1 -1
- package/components/areas/types.d.ts.map +1 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +2 -2
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.d.ts +2 -1
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.js +65 -58
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.d.ts +1 -1
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.js +51 -51
- package/components/extended/mui/Autocomplete/tests/keyboard/AutocompleteKeyboardFixture.d.ts +5 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/AutocompleteKeyboardFixture.d.ts.map +1 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/constants.d.ts +3 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/constants.d.ts.map +1 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/types.d.ts +17 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/types.d.ts.map +1 -0
- package/components/extended/mui/Select/Select.d.ts.map +1 -1
- package/components/extended/mui/Select/Select.js +99 -94
- package/components/extended/mui/Select/Select.styles.d.ts.map +1 -1
- package/components/extended/mui/Select/Select.styles.js +48 -39
- package/components/extended/mui/Select/tests/keyboard/SelectKeyboardFixture.d.ts +4 -0
- package/components/extended/mui/Select/tests/keyboard/SelectKeyboardFixture.d.ts.map +1 -0
- package/components/extended/mui/Select/tests/keyboard/types.d.ts +6 -0
- package/components/extended/mui/Select/tests/keyboard/types.d.ts.map +1 -0
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.d.ts +2 -6
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js +18 -17
- package/components/formatters/DistanceToNowFormatter/dictionary.d.ts +18 -0
- package/components/formatters/DistanceToNowFormatter/dictionary.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/dictionary.js +19 -1
- package/components/formatters/DistanceToNowFormatter/dictionaryDefaults.d.ts +96 -0
- package/components/formatters/DistanceToNowFormatter/dictionaryDefaults.d.ts.map +1 -0
- package/components/formatters/DistanceToNowFormatter/dictionaryDefaults.js +101 -0
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.d.ts +4 -9
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.js +41 -15
- package/components/formatters/DistanceToNowFormatter/index.d.ts +1 -0
- package/components/formatters/DistanceToNowFormatter/index.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/types.d.ts +10 -3
- package/components/formatters/DistanceToNowFormatter/types.d.ts.map +1 -1
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.d.ts.map +1 -1
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.js +43 -40
- package/components/hook-form/RHFCheckableList/RHFCheckableList.d.ts.map +1 -1
- package/components/hook-form/RHFCheckableList/RHFCheckableList.js +82 -73
- package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts.map +1 -1
- package/components/hook-form/RHFCheckbox/RHFCheckbox.js +62 -53
- package/components/hook-form/RHFDatePicker/RHFDatePicker.d.ts.map +1 -1
- package/components/hook-form/RHFDatePicker/RHFDatePicker.js +35 -32
- package/components/hook-form/RHFDateTime/RHFDateTime.d.ts.map +1 -1
- package/components/hook-form/RHFDateTime/RHFDateTime.js +42 -39
- package/components/hook-form/RHFMultiCheckbox/index.d.ts.map +1 -1
- package/components/hook-form/RHFMultiCheckbox/index.js +20 -17
- package/components/hook-form/RHFNumberInput/RHFNumberInput.d.ts.map +1 -1
- package/components/hook-form/RHFNumberInput/RHFNumberInput.js +46 -43
- package/components/hook-form/RHFPeriod/RHFPeriod.d.ts.map +1 -1
- package/components/hook-form/RHFPeriod/RHFPeriod.js +41 -39
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.d.ts.map +1 -1
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.js +62 -59
- package/components/hook-form/RHFSelect/RHFSelect.d.ts.map +1 -1
- package/components/hook-form/RHFSelect/RHFSelect.js +89 -73
- package/components/hook-form/RHFSelect/test/focus/SelectFocusFixture.d.ts +4 -0
- package/components/hook-form/RHFSelect/test/focus/SelectFocusFixture.d.ts.map +1 -0
- package/components/hook-form/RHFSelect/test/focus/constants.d.ts +3 -0
- package/components/hook-form/RHFSelect/test/focus/constants.d.ts.map +1 -0
- package/components/hook-form/RHFSelect/test/focus/types.d.ts +13 -0
- package/components/hook-form/RHFSelect/test/focus/types.d.ts.map +1 -0
- package/components/hook-form/RHFSelect/types.d.ts +5 -0
- package/components/hook-form/RHFSelect/types.d.ts.map +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.d.ts.map +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +55 -52
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.d.ts.map +1 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js +93 -85
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/components/UploadMultiple/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/components/UploadMultiple/index.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/index.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/types.d.ts +2 -0
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/types.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js +74 -66
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.js +52 -32
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.js +1 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.d.ts +4 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.d.ts.map +1 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/types.d.ts +13 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/types.d.ts.map +1 -0
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +34 -32
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/subcomponents/UploadSingleFile/index.js +13 -13
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.d.ts.map +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +16 -16
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +4 -2
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts.map +1 -1
- package/components/popups/components/PopupsProvider/hooks/types.d.ts +5 -0
- package/components/popups/components/PopupsProvider/hooks/types.d.ts.map +1 -0
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.d.ts +3 -14
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.d.ts.map +1 -1
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.js +34 -33
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.d.ts.map +1 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +125 -118
- package/components/popups/components/PopupsViewer/subcomponents/Popup/usePopupHeaderHeight.d.ts +3 -0
- package/components/popups/components/PopupsViewer/subcomponents/Popup/usePopupHeaderHeight.d.ts.map +1 -0
- package/components/popups/components/PopupsViewer/subcomponents/Popup/usePopupHeaderHeight.js +21 -0
- package/components/popups/dictionaryDefaults.d.ts +4 -0
- package/components/popups/dictionaryDefaults.d.ts.map +1 -0
- package/components/popups/dictionaryDefaults.js +16 -0
- package/components/popups/index.d.ts +1 -0
- package/components/popups/index.d.ts.map +1 -1
- package/hocs/withRHFController/index.d.ts.map +1 -1
- package/hocs/withRHFController/index.js +71 -61
- package/index.js +823 -813
- package/package.json +12 -12
- package/test/mocks/dictionary-mock.d.ts +71 -23
- package/test/mocks/dictionary-mock.d.ts.map +1 -1
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts +2 -2
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts.map +1 -1
- package/utils/formatDistanceToNow/formatDistanteToNow.js +40 -23
- package/utils/formatDistanceToNow/index.d.ts +1 -1
- package/utils/formatDistanceToNow/index.d.ts.map +1 -1
- package/utils/formatDistanceToNow/types.d.ts +12 -6
- package/utils/formatDistanceToNow/types.d.ts.map +1 -1
|
@@ -1,57 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { dragResizeWindowRNDClasses as
|
|
5
|
-
import { DEFAULT_TRANSFORM_SCALE as
|
|
6
|
-
import { useDragOptions as
|
|
7
|
-
import { useResizeOptions as
|
|
8
|
-
import { useRNDDimensionEffects as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { jsx as we } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as De, useState as be, useMemo as g, useRef as P, useImperativeHandle as Ce } from "react";
|
|
3
|
+
import We from "clsx";
|
|
4
|
+
import { dragResizeWindowRNDClasses as r } from "./classes/index.js";
|
|
5
|
+
import { DEFAULT_TRANSFORM_SCALE as ye, DEFAULT_COLLAPSED_HEIGHT as B } from "./constants.js";
|
|
6
|
+
import { useDragOptions as ve } from "./hooks/useRNDDragOptions.js";
|
|
7
|
+
import { useResizeOptions as xe } from "./hooks/useRNDReResizeOptions.js";
|
|
8
|
+
import { useRNDDimensionEffects as Le } from "./hooks/useRNDDimensionEffects.js";
|
|
9
|
+
import { useRNDCollapse as Ne } from "./hooks/useRNDCollapse.js";
|
|
10
|
+
import { RndStyled as Oe } from "./slots/DragResizeWindowRNDSlots.js";
|
|
11
|
+
import { getInitialSize as Te } from "./helpers/getInitialSize.js";
|
|
12
|
+
import { buildEnableResizing as Ee, buildDefaultResizeHandleStyles as Ae, buildDefaultResizeHandleClasses as Pe } from "./helpers/resizeHandles.js";
|
|
13
|
+
const Ke = De((M, V) => {
|
|
13
14
|
const {
|
|
14
15
|
//Comunes
|
|
15
|
-
style:
|
|
16
|
-
className:
|
|
17
|
-
children:
|
|
18
|
-
defaultPosition:
|
|
16
|
+
style: F,
|
|
17
|
+
className: I,
|
|
18
|
+
children: y,
|
|
19
|
+
defaultPosition: _ = { vertical: { top: 0, height: 100 }, horizontal: { left: 0, width: 100 } },
|
|
19
20
|
containerElement: t,
|
|
20
21
|
containerSize: i,
|
|
21
|
-
transformScale:
|
|
22
|
-
bounds:
|
|
23
|
-
minWidth:
|
|
24
|
-
minHeight:
|
|
25
|
-
minWindowWidth:
|
|
26
|
-
minWindowHeight:
|
|
27
|
-
resizeHandles:
|
|
28
|
-
resizeHandleStyles:
|
|
29
|
-
resizeHandleClasses:
|
|
22
|
+
transformScale: U = ye,
|
|
23
|
+
bounds: s = { left: 5, top: 5, right: -5, bottom: -5 },
|
|
24
|
+
minWidth: $ = 200,
|
|
25
|
+
minHeight: j = 100,
|
|
26
|
+
minWindowWidth: k,
|
|
27
|
+
minWindowHeight: G,
|
|
28
|
+
resizeHandles: v,
|
|
29
|
+
resizeHandleStyles: x,
|
|
30
|
+
resizeHandleClasses: L,
|
|
30
31
|
// maxWidth = 1000,
|
|
31
32
|
// maxHeight = 1000,
|
|
32
33
|
//Draggable
|
|
33
|
-
draggableHandle:
|
|
34
|
-
draggableCancel:
|
|
35
|
-
draggable:
|
|
36
|
-
onDragStart:
|
|
37
|
-
onDrag:
|
|
38
|
-
onDragStop:
|
|
39
|
-
onMouseDown:
|
|
34
|
+
draggableHandle: q = `${r.draggableHandle}`,
|
|
35
|
+
draggableCancel: J = `.${r.draggableCancel}`,
|
|
36
|
+
draggable: K = !0,
|
|
37
|
+
onDragStart: Q,
|
|
38
|
+
onDrag: X,
|
|
39
|
+
onDragStop: Y,
|
|
40
|
+
onMouseDown: Z,
|
|
40
41
|
//resizable
|
|
41
|
-
resizable:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
resizable: N = !0,
|
|
43
|
+
collapsed: o = !1,
|
|
44
|
+
collapsedHeight: S = B,
|
|
45
|
+
onResizeStart: ee,
|
|
46
|
+
onResize: te,
|
|
47
|
+
onResizeStop: ie,
|
|
45
48
|
hidden: O,
|
|
46
|
-
allowHeightResizeContainer:
|
|
47
|
-
allowWidthResizeContainer:
|
|
48
|
-
windowRef:
|
|
49
|
+
allowHeightResizeContainer: a = !1,
|
|
50
|
+
allowWidthResizeContainer: d = !1,
|
|
51
|
+
windowRef: Be,
|
|
49
52
|
//Otras
|
|
50
|
-
...
|
|
51
|
-
} =
|
|
52
|
-
() =>
|
|
53
|
-
),
|
|
54
|
-
bounds:
|
|
53
|
+
...ne
|
|
54
|
+
} = M, h = k ?? $, T = G ?? j, E = Number.isFinite(S) && S > 0 ? S : B, m = o ? E : T, [e, p] = be(
|
|
55
|
+
() => Te(i, s, _, t, a, d)
|
|
56
|
+
), A = g(() => [h, m], [h, m]), n = P({
|
|
57
|
+
bounds: s,
|
|
55
58
|
data: void 0,
|
|
56
59
|
dragging: void 0,
|
|
57
60
|
containerSize: i ? { ...i } : void 0,
|
|
@@ -59,25 +62,25 @@ const _e = ue((T, L) => {
|
|
|
59
62
|
y: e.y,
|
|
60
63
|
width: e.width,
|
|
61
64
|
height: e.height,
|
|
62
|
-
minConstraints:
|
|
65
|
+
minConstraints: A,
|
|
63
66
|
magnetizeRight: e.magnetizeRight,
|
|
64
67
|
magnetizeBottom: e.magnetizeBottom
|
|
65
68
|
});
|
|
66
|
-
i && (n.current.containerSize?.containerWidth !== i.containerWidth || n.current.containerSize?.containerHeight !== i.containerHeight) && (n.current.containerSize = { ...i });
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
+
i && (n.current.containerSize?.containerWidth !== i.containerWidth || n.current.containerSize?.containerHeight !== i.containerHeight) && (n.current.containerSize = { ...i }), n.current.bounds = s, n.current.minConstraints = A;
|
|
70
|
+
const l = P(null);
|
|
71
|
+
Ce(V, () => ({
|
|
69
72
|
/**
|
|
70
73
|
* "ensureVisible" enfoca la ventana para que esté visible, cuando se requiere desde afuera ubicarla en el contenedor padre
|
|
71
74
|
*/
|
|
72
75
|
ensureVisible: () => {
|
|
73
|
-
if (!
|
|
76
|
+
if (!l.current || !t)
|
|
74
77
|
return;
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
top: Math.max(0,
|
|
80
|
-
left: Math.max(0,
|
|
78
|
+
const c = t.getBoundingClientRect(), u = l.current.getBoundingClientRect(), H = u.height, w = u.width, f = u.top - c.top + t.scrollTop, z = u.left - c.left + t.scrollLeft, fe = f + H, ze = z + w, D = t.clientHeight, b = t.clientWidth, Re = t.scrollTop + D, R = 0.5, Se = f >= t.scrollTop - R && fe <= Re + R, He = z >= t.scrollLeft - R && ze <= t.scrollLeft + b + R;
|
|
79
|
+
if (!Se || !He) {
|
|
80
|
+
let C, W;
|
|
81
|
+
H > D ? C = f : C = f - D / 2 + H / 2, w > b ? W = z : W = z - b / 2 + w / 2, t.scrollTo({
|
|
82
|
+
top: Math.max(0, C),
|
|
83
|
+
left: Math.max(0, W),
|
|
81
84
|
behavior: "smooth"
|
|
82
85
|
});
|
|
83
86
|
}
|
|
@@ -85,41 +88,52 @@ const _e = ue((T, L) => {
|
|
|
85
88
|
/**
|
|
86
89
|
* "current" devuelve el elemento DOM de la ventana
|
|
87
90
|
*/
|
|
88
|
-
current:
|
|
91
|
+
current: l.current
|
|
89
92
|
}), [t]);
|
|
90
|
-
const { localOnDragStart:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
const { localOnDragStart: oe, localOnDrag: re, localOnDragStop: se } = ve({
|
|
94
|
+
preserveResizeRecovery: o,
|
|
95
|
+
allowHeightResizeContainer: a,
|
|
96
|
+
allowWidthResizeContainer: d,
|
|
93
97
|
containerElement: t,
|
|
94
|
-
transformScale:
|
|
95
|
-
onDragStart:
|
|
96
|
-
onDrag:
|
|
97
|
-
onDragStop:
|
|
98
|
+
transformScale: U,
|
|
99
|
+
onDragStart: Q,
|
|
100
|
+
onDrag: X,
|
|
101
|
+
onDragStop: Y,
|
|
98
102
|
stateRef: n,
|
|
99
|
-
setCurrentState:
|
|
100
|
-
}), { localOnResize:
|
|
101
|
-
allowHeightResizeContainer:
|
|
102
|
-
allowWidthResizeContainer:
|
|
103
|
+
setCurrentState: p
|
|
104
|
+
}), { localOnResize: ae, localOnResizeStart: le, localOnResizeStop: ce } = xe({
|
|
105
|
+
allowHeightResizeContainer: a,
|
|
106
|
+
allowWidthResizeContainer: d,
|
|
103
107
|
containerElement: t,
|
|
104
|
-
onResizeStart:
|
|
105
|
-
onResize:
|
|
106
|
-
onResizeStop:
|
|
108
|
+
onResizeStart: ee,
|
|
109
|
+
onResize: te,
|
|
110
|
+
onResizeStop: ie,
|
|
107
111
|
stateRef: n,
|
|
108
|
-
setCurrentState:
|
|
112
|
+
setCurrentState: p
|
|
109
113
|
});
|
|
110
|
-
|
|
114
|
+
Ne({
|
|
115
|
+
collapsed: o,
|
|
116
|
+
collapsedHeight: E,
|
|
117
|
+
containerSize: i,
|
|
118
|
+
bounds: s,
|
|
119
|
+
minWindowHeight: T,
|
|
120
|
+
allowHeightResizeContainer: a,
|
|
121
|
+
stateRef: n,
|
|
122
|
+
setCurrentState: p
|
|
123
|
+
}), Le({
|
|
111
124
|
containerElement: t,
|
|
112
|
-
bounds:
|
|
125
|
+
bounds: s,
|
|
113
126
|
containerSize: i,
|
|
114
|
-
setCurrentState:
|
|
127
|
+
setCurrentState: p,
|
|
115
128
|
stateRef: n,
|
|
116
|
-
minWindowWidth:
|
|
117
|
-
minWindowHeight:
|
|
118
|
-
wrapperRef:
|
|
119
|
-
allowHeightResizeContainer:
|
|
120
|
-
allowWidthResizeContainer:
|
|
129
|
+
minWindowWidth: h,
|
|
130
|
+
minWindowHeight: m,
|
|
131
|
+
wrapperRef: l,
|
|
132
|
+
allowHeightResizeContainer: a,
|
|
133
|
+
allowWidthResizeContainer: d,
|
|
134
|
+
collapsed: o
|
|
121
135
|
});
|
|
122
|
-
const
|
|
136
|
+
const ge = {
|
|
123
137
|
hidden: O,
|
|
124
138
|
dragging: !!e.dragging,
|
|
125
139
|
resizing: !!e.resizing,
|
|
@@ -128,53 +142,53 @@ const _e = ue((T, L) => {
|
|
|
128
142
|
y: e.y,
|
|
129
143
|
width: e.width,
|
|
130
144
|
height: e.height
|
|
131
|
-
},
|
|
145
|
+
}, de = We(I, {
|
|
132
146
|
//Requerido para el componente Draggable
|
|
133
|
-
[
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
[
|
|
147
|
+
[r.hidden]: O,
|
|
148
|
+
[r.dragging]: !!e.dragging,
|
|
149
|
+
[r.resizing]: !!e.resizing,
|
|
150
|
+
[r.draggingActive]: !!e.dragging
|
|
137
151
|
// dropping: Boolean(droppingPosition),
|
|
138
|
-
}),
|
|
139
|
-
...
|
|
140
|
-
...
|
|
141
|
-
}), [
|
|
142
|
-
...
|
|
143
|
-
...
|
|
144
|
-
}), [
|
|
145
|
-
return t ? /* @__PURE__ */
|
|
146
|
-
|
|
152
|
+
}), he = g(() => Ee(N && !o, v), [N, v, o]), me = g(() => ({
|
|
153
|
+
...Ae(),
|
|
154
|
+
...x
|
|
155
|
+
}), [x]), pe = g(() => ({
|
|
156
|
+
...Pe(),
|
|
157
|
+
...L
|
|
158
|
+
}), [L]), ue = g(() => y, [y]);
|
|
159
|
+
return t ? /* @__PURE__ */ we(
|
|
160
|
+
Oe,
|
|
147
161
|
{
|
|
148
|
-
ownerState:
|
|
149
|
-
...
|
|
150
|
-
onMouseDown:
|
|
151
|
-
ref: (
|
|
152
|
-
|
|
162
|
+
ownerState: ge,
|
|
163
|
+
...ne,
|
|
164
|
+
onMouseDown: Z,
|
|
165
|
+
ref: (c) => {
|
|
166
|
+
c && (l.current = c.resizableElement.current);
|
|
153
167
|
},
|
|
154
|
-
style: { ...
|
|
155
|
-
dragHandleClassName:
|
|
156
|
-
enableResizing:
|
|
157
|
-
disableDragging:
|
|
158
|
-
minWidth:
|
|
159
|
-
minHeight:
|
|
160
|
-
cancel:
|
|
161
|
-
className:
|
|
168
|
+
style: { ...F },
|
|
169
|
+
dragHandleClassName: q,
|
|
170
|
+
enableResizing: he,
|
|
171
|
+
disableDragging: !K,
|
|
172
|
+
minWidth: h,
|
|
173
|
+
minHeight: m,
|
|
174
|
+
cancel: J,
|
|
175
|
+
className: de,
|
|
162
176
|
enableUserSelectHack: !0,
|
|
163
|
-
resizeHandleStyles:
|
|
164
|
-
resizeHandleClasses:
|
|
177
|
+
resizeHandleStyles: me,
|
|
178
|
+
resizeHandleClasses: pe,
|
|
165
179
|
size: { width: e.width, height: e.height },
|
|
166
180
|
position: { x: e.x, y: e.y },
|
|
167
|
-
onDragStart:
|
|
168
|
-
onDrag:
|
|
169
|
-
onDragStop:
|
|
170
|
-
onResizeStart:
|
|
171
|
-
onResize:
|
|
172
|
-
onResizeStop:
|
|
173
|
-
children:
|
|
181
|
+
onDragStart: oe,
|
|
182
|
+
onDrag: re,
|
|
183
|
+
onDragStop: se,
|
|
184
|
+
onResizeStart: le,
|
|
185
|
+
onResize: ae,
|
|
186
|
+
onResizeStop: ce,
|
|
187
|
+
children: ue
|
|
174
188
|
}
|
|
175
189
|
) : null;
|
|
176
190
|
});
|
|
177
191
|
export {
|
|
178
|
-
|
|
179
|
-
|
|
192
|
+
Ke as DragResizeWindowRND,
|
|
193
|
+
Ke as default
|
|
180
194
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const COMPONENT_TEST_ID = "M4LDragResizeWindowRND";
|
|
2
2
|
export declare const COMPONENT_KEY_COMPONENT = "M4LDragResizeWindowRND";
|
|
3
3
|
export declare const DEFAULT_TRANSFORM_SCALE = 1;
|
|
4
|
+
export declare const DEFAULT_COLLAPSED_HEIGHT = 32;
|
|
4
5
|
export declare const WINDOW_SIZES: {
|
|
5
6
|
horizontal: {
|
|
6
7
|
large: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DragResizeWindowRND/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAC1D,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DragResizeWindowRND/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAC1D,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const h = "M4LDragResizeWindowRND", i = 1, t = {
|
|
1
|
+
const h = "M4LDragResizeWindowRND", i = 1, t = 32, e = {
|
|
2
2
|
horizontal: {
|
|
3
3
|
large: {
|
|
4
4
|
width: 1e3,
|
|
@@ -44,6 +44,7 @@ const h = "M4LDragResizeWindowRND", i = 1, t = {
|
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
46
|
h as COMPONENT_KEY_COMPONENT,
|
|
47
|
+
t as DEFAULT_COLLAPSED_HEIGHT,
|
|
47
48
|
i as DEFAULT_TRANSFORM_SCALE,
|
|
48
|
-
|
|
49
|
+
e as WINDOW_SIZES
|
|
49
50
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
+
import { ContainerSize } from '../../../utils/types';
|
|
3
|
+
import { CurrentState, DraggableWindowBounds, StateRef } from '../types';
|
|
4
|
+
export interface RNDCollapseOptions {
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
collapsedHeight: number;
|
|
7
|
+
containerSize?: ContainerSize;
|
|
8
|
+
bounds?: DraggableWindowBounds;
|
|
9
|
+
minWindowHeight: number;
|
|
10
|
+
allowHeightResizeContainer: boolean;
|
|
11
|
+
stateRef: MutableRefObject<StateRef>;
|
|
12
|
+
setCurrentState: Dispatch<SetStateAction<CurrentState>>;
|
|
13
|
+
}
|
|
14
|
+
export type ExpandedHeightSnapshot = Pick<CurrentState, 'height' | 'overflowHeightAt'>;
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DragResizeWindowRND/hooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9E,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,OAAO,CAAC;IACpC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RNDCollapseOptions } from './types';
|
|
2
|
+
/** Keep drag geometry consistent with a collapsed header without discarding its expanded height. */
|
|
3
|
+
export declare function useRNDCollapse({ collapsed, collapsedHeight, containerSize, bounds, minWindowHeight, allowHeightResizeContainer, stateRef, setCurrentState, }: RNDCollapseOptions): void;
|
|
4
|
+
//# sourceMappingURL=useRNDCollapse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRNDCollapse.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DragResizeWindowRND/hooks/useRNDCollapse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA0B,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE1E,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,eAAe,EACf,aAAa,EACb,MAAM,EACN,eAAe,EACf,0BAA0B,EAC1B,QAAQ,EACR,eAAe,GAChB,EAAE,kBAAkB,QA+CpB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useRef as x, useLayoutEffect as d } from "react";
|
|
2
|
+
function y({
|
|
3
|
+
collapsed: n,
|
|
4
|
+
collapsedHeight: f,
|
|
5
|
+
containerSize: s,
|
|
6
|
+
bounds: h,
|
|
7
|
+
minWindowHeight: c,
|
|
8
|
+
allowHeightResizeContainer: g,
|
|
9
|
+
stateRef: v,
|
|
10
|
+
setCurrentState: A
|
|
11
|
+
}) {
|
|
12
|
+
const e = x(void 0);
|
|
13
|
+
d(() => {
|
|
14
|
+
if (!n && !e.current)
|
|
15
|
+
return;
|
|
16
|
+
const o = v.current, a = h?.top ?? 0, m = h?.bottom ?? 0, i = s?.containerHeight, u = i !== void 0 && i > 0, H = u ? Math.max(0, i + m - a) : void 0, t = { ...o };
|
|
17
|
+
if (n)
|
|
18
|
+
e.current ??= {
|
|
19
|
+
height: o.height,
|
|
20
|
+
overflowHeightAt: o.overflowHeightAt
|
|
21
|
+
}, t.height = f, t.overflowHeightAt = void 0, t.shrinkTopAt = void 0;
|
|
22
|
+
else {
|
|
23
|
+
const p = e.current, r = p.overflowHeightAt ?? p.height;
|
|
24
|
+
t.height = !g && H !== void 0 ? Math.max(c, Math.min(r, H)) : Math.max(c, r), t.overflowHeightAt = t.height < r ? r : void 0, t.shrinkTopAt = void 0, e.current = void 0;
|
|
25
|
+
}
|
|
26
|
+
!g && u && (t.y = Math.max(a, Math.min(t.y, i + m - t.height))), (t.height !== o.height || t.y !== o.y || t.overflowHeightAt !== o.overflowHeightAt || t.shrinkTopAt !== o.shrinkTopAt) && (v.current = t, A(t));
|
|
27
|
+
}, [
|
|
28
|
+
n,
|
|
29
|
+
f,
|
|
30
|
+
s?.containerHeight,
|
|
31
|
+
h?.top,
|
|
32
|
+
h?.bottom,
|
|
33
|
+
c,
|
|
34
|
+
g,
|
|
35
|
+
v,
|
|
36
|
+
A
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
y as useRNDCollapse
|
|
41
|
+
};
|
|
@@ -13,6 +13,7 @@ type useOnDragStartProps = {
|
|
|
13
13
|
setCurrentState: React.Dispatch<React.SetStateAction<CurrentState>>;
|
|
14
14
|
allowHeightResizeContainer?: boolean;
|
|
15
15
|
allowWidthResizeContainer?: boolean;
|
|
16
|
+
collapsed?: boolean;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* "useDimensionEffects" Redimensiona la ventana si el contenedor padre es desbordado por ella.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRNDDimensionEffects.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,KAAK,mBAAmB,GAAG;IACzB,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,yBAAyB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useRNDDimensionEffects.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,KAAK,mBAAmB,GAAG;IACzB,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,mBAAmB,SAuJhE,CAAC"}
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { expandingParentContainer as
|
|
3
|
-
import { shrinkingParentContainer as
|
|
4
|
-
const
|
|
1
|
+
import { useRef as S, useEffect as v } from "react";
|
|
2
|
+
import { expandingParentContainer as C } from "../helpers/expandingParentContainer.js";
|
|
3
|
+
import { shrinkingParentContainer as H } from "../helpers/shrinkingParentContainer.js";
|
|
4
|
+
const y = (g) => {
|
|
5
5
|
const {
|
|
6
6
|
containerElement: f,
|
|
7
7
|
containerSize: t,
|
|
8
8
|
bounds: n,
|
|
9
|
-
minWindowWidth:
|
|
10
|
-
minWindowHeight:
|
|
9
|
+
minWindowWidth: d,
|
|
10
|
+
minWindowHeight: p,
|
|
11
11
|
stateRef: e,
|
|
12
12
|
wrapperRef: c,
|
|
13
13
|
setCurrentState: w,
|
|
14
|
-
allowHeightResizeContainer:
|
|
15
|
-
allowWidthResizeContainer:
|
|
16
|
-
|
|
17
|
-
S(
|
|
14
|
+
allowHeightResizeContainer: m,
|
|
15
|
+
allowWidthResizeContainer: z,
|
|
16
|
+
collapsed: s
|
|
17
|
+
} = g, o = S(void 0);
|
|
18
|
+
v(() => {
|
|
18
19
|
if (!f || !t || !c.current || e.current?.dragging || e.current?.resizing || t.containerHeight === 0 && t.containerWidth === 0)
|
|
19
20
|
return;
|
|
20
21
|
o.current || (o.current = { ...t });
|
|
21
|
-
const r = { ...e.current }, h = (a,
|
|
22
|
+
const r = { ...e.current }, h = (a, W = !1, A) => {
|
|
22
23
|
if (e.current?.containerSize && c.current) {
|
|
23
|
-
const
|
|
24
|
-
i > u ?
|
|
24
|
+
const l = `container${a}`, i = t[l], u = A[l];
|
|
25
|
+
i > u ? C(
|
|
25
26
|
r,
|
|
26
27
|
i,
|
|
27
28
|
a,
|
|
28
29
|
i - u,
|
|
29
30
|
n
|
|
30
|
-
) : i < u &&
|
|
31
|
+
) : i < u && H(
|
|
31
32
|
r,
|
|
32
33
|
e.current,
|
|
33
34
|
i,
|
|
34
35
|
c.current,
|
|
35
36
|
a,
|
|
36
|
-
|
|
37
|
-
l,
|
|
37
|
+
W,
|
|
38
38
|
d,
|
|
39
|
+
p,
|
|
39
40
|
i - u,
|
|
40
41
|
n
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
|
-
h("Width",
|
|
45
|
+
h("Width", z, o.current), s || h("Height", m, o.current), (r.x !== e.current.x || r.y !== e.current.y || r.width !== e.current.width || r.height !== e.current.height || r.shrinkLeftAt !== e.current.shrinkLeftAt || r.shrinkTopAt !== e.current.shrinkTopAt || r.overflowWidthAt !== e.current.overflowWidthAt || r.overflowHeightAt !== e.current.overflowHeightAt) && (e.current = {
|
|
45
46
|
...e.current,
|
|
46
47
|
...r
|
|
47
48
|
}, w(r)), o.current = { ...t };
|
|
@@ -53,9 +54,10 @@ const x = (g) => {
|
|
|
53
54
|
n?.right,
|
|
54
55
|
n?.bottom,
|
|
55
56
|
t?.containerWidth,
|
|
56
|
-
t?.containerHeight
|
|
57
|
+
t?.containerHeight,
|
|
58
|
+
s
|
|
57
59
|
]);
|
|
58
60
|
};
|
|
59
61
|
export {
|
|
60
|
-
|
|
62
|
+
y as useRNDDimensionEffects
|
|
61
63
|
};
|
|
@@ -4,6 +4,8 @@ import { CurrentState, StateRef } from '../types';
|
|
|
4
4
|
type useDragOptionsProps = {
|
|
5
5
|
allowHeightResizeContainer?: boolean;
|
|
6
6
|
allowWidthResizeContainer?: boolean;
|
|
7
|
+
/** Keep expanded-width recovery while dragging a compact window. */
|
|
8
|
+
preserveResizeRecovery?: boolean;
|
|
7
9
|
containerElement?: HTMLElement;
|
|
8
10
|
onDragStart?: (e: DraggableEvent, draggableData: DraggableData) => boolean | void;
|
|
9
11
|
onDrag?: (e: DraggableEvent, draggableData: DraggableData) => boolean | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRNDDragOptions.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DragResizeWindowRND/hooks/useRNDDragOptions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKhE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAY,MAAM,UAAU,CAAC;AAIjE,KAAK,mBAAmB,GAAG;IACzB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,gBAAgB,CAAC,EAAE,WAAW,CAAE;IAChC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,KAAK,OAAO,GAAG,IAAI,CAAC;IAClF,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,KAAK,OAAO,GAAG,IAAI,CAAC;IAC7E,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,KAAK,OAAO,GAAG,IAAI,CAAC;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAEpE,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACL,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB;
|
|
1
|
+
{"version":3,"file":"useRNDDragOptions.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DragResizeWindowRND/hooks/useRNDDragOptions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKhE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAY,MAAM,UAAU,CAAC;AAIjE,KAAK,mBAAmB,GAAG;IACzB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,WAAW,CAAE;IAChC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,KAAK,OAAO,GAAG,IAAI,CAAC;IAClF,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,KAAK,OAAO,GAAG,IAAI,CAAC;IAC7E,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,KAAK,OAAO,GAAG,IAAI,CAAC;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAEpE,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACL,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB;0BAmBjD,cAAc,iBAAiB,aAAa;qBAsDd,cAAc,iBAAiB,aAAa;;CAgSjF,CAAC"}
|