@m4l/components 9.1.3 → 9.1.5
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/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
- package/components/ControlIncrement/slots/ControltrolIncrementSlots.d.ts +1 -1
- package/components/DragResizeWindow/DragResizeWindow.d.ts +9 -5
- package/components/DragResizeWindow/DragResizeWindow.js +7 -6
- package/components/DragResizeWindow/DragResizeWindow.styles.d.ts +4 -0
- package/components/DragResizeWindow/DragResizeWindow.styles.js +20 -3
- package/components/DragResizeWindow/classes/index.js +2 -2
- package/components/DragResizeWindow/constants.d.ts +1 -1
- package/components/DragResizeWindow/constants.js +2 -2
- package/components/DragResizeWindow/helpers/index.d.ts +14 -1
- package/components/DragResizeWindow/helpers/index.js +0 -2
- package/components/DragResizeWindow/hooks/useDimensionEffects.d.ts +4 -0
- package/components/DragResizeWindow/hooks/useDimensionEffects.js +128 -50
- package/components/DragResizeWindow/hooks/useDragOptions.d.ts +3 -3
- package/components/DragResizeWindow/hooks/useResizeOptions.d.ts +20 -1
- package/components/DragResizeWindow/hooks/useResizeOptions.js +1 -1
- package/components/DragResizeWindow/slots/DragResizeWindowSlots.js +3 -3
- package/components/DragResizeWindow/tests/DragResizeWindow.test.d.ts +1 -0
- package/components/DragResizeWindow/types.d.ts +85 -13
- package/components/DragResizeWindow/utils.d.ts +12 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +1 -1
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +1 -1
- package/components/GridLayout/subcomponents/GridItem/index.js +1 -1
- package/components/Label/slots/LabelSlots.d.ts +1 -1
- package/components/areas/components/AreasViewer/styles.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/index.js +1 -1
- package/components/extended/{react-resizable → React-Resizable}/Resizable/Resizable.d.ts +4 -0
- package/components/extended/React-Resizable/Resizable/Resizable.js +20 -0
- package/components/extended/{react-resizable → React-Resizable}/Resizable/Resizeable.styles.d.ts +1 -1
- package/components/extended/{react-resizable → React-Resizable}/Resizable/constants.d.ts +1 -0
- package/components/extended/React-Resizable/Resizable/constants.js +6 -0
- package/components/extended/{react-resizable → React-Resizable}/Resizable/slots/ResizableSlots.js +1 -1
- package/components/extended/{react-resizable → React-Resizable}/ResizableBox/ResizableBox.d.ts +6 -2
- package/components/extended/React-Resizable/ResizableBox/ResizableBox.js +41 -0
- package/components/extended/React-Resizable/ResizableBox/ResizeableBox.styles.js +17 -0
- package/components/extended/{react-resizable → React-Resizable}/ResizableBox/slots/ResizableBoxSlots.js +1 -1
- package/components/extended/React-Resizable/ResizableBox/tests/ResizableBox.integration.test.d.ts +1 -0
- package/components/extended/React-Resizable/ResizableBox/tests/ResizableBox.test.d.ts +1 -0
- package/components/extended/React-Resizable/ResizableBox/types.d.ts +46 -0
- package/components/extended/React-Resizable/helpers.d.ts +197 -0
- package/components/extended/React-Resizable/helpers.js +112 -0
- package/components/extended/React-Resizable/hooks/useResizable.d.ts +16 -0
- package/components/extended/React-Resizable/hooks/useResizable.js +24 -0
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/index.d.ts +1 -1
- package/components/modal/ModalDialog/index.d.ts +4 -0
- package/components/modal/ModalDialog/index.js +3 -3
- package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +1 -1
- package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +2 -2
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +63 -2
- package/components/popups/components/PopupsViewer/slots/popupsViewerSlots.d.ts +1 -1
- package/contexts/ModalContext/index.d.ts +4 -0
- package/contexts/ModalContext/types.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/storybook/components/DragResizeWindow/stories/DragResizeWindow.stories.d.ts +7 -0
- package/storybook/components/DragResizeWindow/stories/subcomponents/ContentExample.d.ts +8 -0
- package/{components → storybook/components}/DragResizeWindow/stories/subcomponents/WithExtendedContainer.d.ts +4 -0
- package/{components → storybook/components}/DragResizeWindow/stories/types.d.ts +1 -1
- package/storybook/components/extended/react-resizable/ResizableBox/resizableBox.stories.d.ts +13 -0
- package/components/DragResizeWindow/stories/basic.stories.d.ts +0 -13
- package/components/DragResizeWindow/stories/dictionary.d.ts +0 -0
- package/components/DragResizeWindow/stories/subcomponents/ContentExample.d.ts +0 -4
- package/components/extended/react-resizable/Resizable/Resizable.js +0 -8
- package/components/extended/react-resizable/Resizable/constants.js +0 -4
- package/components/extended/react-resizable/Resizable/stories/basic.stories.d.ts +0 -9
- package/components/extended/react-resizable/ResizableBox/ResizableBox.js +0 -29
- package/components/extended/react-resizable/ResizableBox/ResizeableBox.styles.js +0 -13
- package/components/extended/react-resizable/ResizableBox/stories/basic.stories.d.ts +0 -9
- package/components/extended/react-resizable/ResizableBox/types.d.ts +0 -15
- package/components/extended/react-resizable/helpers.d.ts +0 -80
- package/components/extended/react-resizable/helpers.js +0 -91
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/index.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/index.js +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/slots/ResizableSlots.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/slots/slots.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/slots/slots.js +0 -0
- /package/components/{DragResizeWindow → extended/React-Resizable/Resizable}/stories/constants.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/stories/types.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/Resizable/types.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/ResizeableBox.styles.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/constants.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/constants.js +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/index.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/index.js +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/slots/ResizableBoxSlots.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/slots/slots.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/slots/slots.js +0 -0
- /package/components/extended/{react-resizable/Resizable → React-Resizable/ResizableBox}/stories/constants.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/ResizableBox/stories/types.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/index.d.ts +0 -0
- /package/components/extended/{react-resizable → React-Resizable}/index.js +0 -0
- /package/{components/extended/react-resizable/ResizableBox → storybook/components/DragResizeWindow}/stories/constants.d.ts +0 -0
package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const ActionsContainerRoot: import('@emotion/styled').StyledComponent<Pick<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
-
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>>, "title" | "id" | "hidden" | "content" | "style" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "
|
|
3
|
+
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>>, "title" | "id" | "hidden" | "content" | "style" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
|
|
4
4
|
export { ActionsContainerRoot };
|
|
@@ -9,6 +9,6 @@ export declare const IconButtonDownStyles: import('@emotion/styled').StyledCompo
|
|
|
9
9
|
}, {}, {}>;
|
|
10
10
|
export declare const ControlIncrementSkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
11
11
|
ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
12
|
-
}, "children" | "style" | "variant" | "width" | "height" | "animation" | "sx" | "classes" | "className">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "width" | "height" | "translate" | "animation" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "
|
|
12
|
+
}, "children" | "style" | "variant" | "width" | "height" | "animation" | "sx" | "classes" | "className">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "width" | "height" | "translate" | "animation" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown> & {
|
|
13
13
|
ownerState: Partial<import('../types').ControlIncrementOwnerState> & Record<string, unknown>;
|
|
14
14
|
}, {}, {}>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DragResizeWindowProps } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* Este component es un wrapper o ventana draggable y
|
|
5
|
-
*
|
|
4
|
+
* Este component es un wrapper o ventana draggable y resizable al children.
|
|
5
|
+
* Características
|
|
6
6
|
* - Permite definir bounds para que la ventana no se salga del contenedor padre.
|
|
7
|
-
* - Es
|
|
7
|
+
* - Es obligarlo pasarle como props el containerElement (HTMLElement) del padre.
|
|
8
8
|
* - Reajusta el Resizable para que los handlers n, w, crezcan en la dirección correcta.
|
|
9
9
|
* Funcionamiento interno:
|
|
10
10
|
* - DraggableCore clona el children y le agrega un handle para poder arrastrar la ventana
|
|
@@ -15,6 +15,10 @@ import { DraggableWindowProps } from './types';
|
|
|
15
15
|
* Consideraciones:
|
|
16
16
|
* @param props
|
|
17
17
|
* @returns
|
|
18
|
+
* @author cesar - automatic
|
|
19
|
+
* @createdAt 2024-11-07 08:06:15 - automatic
|
|
20
|
+
* @updatedAt 2024-11-13 10:42:04 - automatic
|
|
21
|
+
* @updatedUser cesar - automatic
|
|
18
22
|
*/
|
|
19
|
-
export declare const DragResizeWindow: React.ForwardRefExoticComponent<
|
|
23
|
+
export declare const DragResizeWindow: React.ForwardRefExoticComponent<DragResizeWindowProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
24
|
export default DragResizeWindow;
|
|
@@ -11,7 +11,7 @@ import { u as useDragOptions } from "./hooks/useDragOptions.js";
|
|
|
11
11
|
import { u as useResizeOptions } from "./hooks/useResizeOptions.js";
|
|
12
12
|
import { u as useDimensionEffects } from "./hooks/useDimensionEffects.js";
|
|
13
13
|
import { R as RootStyled } from "./slots/DragResizeWindowSlots.js";
|
|
14
|
-
import { R as Resizable } from "../extended/
|
|
14
|
+
import { R as Resizable } from "../extended/React-Resizable/Resizable/Resizable.js";
|
|
15
15
|
const DragResizeWindow = forwardRef((props, ref) => {
|
|
16
16
|
const {
|
|
17
17
|
//Comunes
|
|
@@ -33,8 +33,8 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
33
33
|
onDrag,
|
|
34
34
|
onDragStop,
|
|
35
35
|
onMouseDown,
|
|
36
|
-
//
|
|
37
|
-
|
|
36
|
+
//resizable
|
|
37
|
+
resizable = true,
|
|
38
38
|
resizeHandles = ["se", "nw"],
|
|
39
39
|
resizeHandle,
|
|
40
40
|
onResizeStart,
|
|
@@ -77,6 +77,7 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
77
77
|
});
|
|
78
78
|
useDimensionEffects({
|
|
79
79
|
containerElement,
|
|
80
|
+
bounds,
|
|
80
81
|
containerSize,
|
|
81
82
|
setCurrentState,
|
|
82
83
|
stateRef,
|
|
@@ -92,9 +93,9 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
92
93
|
Resizable,
|
|
93
94
|
{
|
|
94
95
|
draggableOpts: {
|
|
95
|
-
disabled: !
|
|
96
|
+
disabled: !resizable
|
|
96
97
|
},
|
|
97
|
-
className:
|
|
98
|
+
className: resizable ? void 0 : "react-resizable-hide",
|
|
98
99
|
width: position.width,
|
|
99
100
|
height: position.height,
|
|
100
101
|
minConstraints,
|
|
@@ -109,7 +110,7 @@ const DragResizeWindow = forwardRef((props, ref) => {
|
|
|
109
110
|
);
|
|
110
111
|
},
|
|
111
112
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
112
|
-
[
|
|
113
|
+
[resizable, transformScale]
|
|
113
114
|
);
|
|
114
115
|
const mixinDraggable = useCallback(
|
|
115
116
|
(child) => {
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
const CONTAINER_QUERY_NAME = "window_root";
|
|
2
2
|
const dragResizeWindowStyles = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Styles for the root container of the DragResizeWindow component.
|
|
5
|
+
* @param {Object} params - Object containing theme and ownerState properties.
|
|
6
|
+
* @param {Object} params.theme - Theme object for accessing theme variables.
|
|
7
|
+
* @param {Object} params.ownerState - Object holding the component's current state.
|
|
8
|
+
* @param {boolean} [params.ownerState.hidden] - Controls visibility; if true, sets the component to be hidden and disables pointer events.
|
|
9
|
+
* @returns {Object} - Style object for the root container.
|
|
10
|
+
* @author cesar - automatic
|
|
11
|
+
* @createdAt 2024-11-08 12:13:10 - automatic
|
|
12
|
+
* @updatedAt 2024-11-08 12:13:10 - automatic
|
|
13
|
+
* @updatedUser cesar - automatic
|
|
5
14
|
*/
|
|
6
15
|
root: ({ theme, ownerState }) => ({
|
|
7
16
|
containerName: CONTAINER_QUERY_NAME,
|
|
@@ -19,7 +28,16 @@ const dragResizeWindowStyles = {
|
|
|
19
28
|
} : {}
|
|
20
29
|
}),
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
31
|
+
* Styles for the icon formatter container in the DragResizeWindow component.
|
|
32
|
+
*
|
|
33
|
+
* This container serves as the base for resize icons, setting up initial styles
|
|
34
|
+
* like position, size, and default background color. Adjustments for cursor style
|
|
35
|
+
* and additional customization are also defined here.
|
|
36
|
+
* @returns {Object} - Style object for the icon formatter container.
|
|
37
|
+
* @author cesar - automatic
|
|
38
|
+
* @createdAt 2024-11-08 12:13:10 - automatic
|
|
39
|
+
* @updatedAt 2024-11-08 12:13:10 - automatic
|
|
40
|
+
* @updatedUser cesar - automatic
|
|
23
41
|
*/
|
|
24
42
|
iconResizeFormatterRoot: () => ({
|
|
25
43
|
containerName: CONTAINER_QUERY_NAME,
|
|
@@ -32,7 +50,6 @@ const dragResizeWindowStyles = {
|
|
|
32
50
|
backgroundColor: "gray",
|
|
33
51
|
prop2: 1,
|
|
34
52
|
cursor: "default"
|
|
35
|
-
// zIndex: ownerState.baseZindex || 0,
|
|
36
53
|
})
|
|
37
54
|
};
|
|
38
55
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { generateUtilityClasses } from "@mui/material";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as COMPONENT_KEY_COMPONENT } from "../constants.js";
|
|
3
3
|
const dragResizeWindowClasses = generateUtilityClasses(
|
|
4
|
-
|
|
4
|
+
COMPONENT_KEY_COMPONENT,
|
|
5
5
|
[
|
|
6
6
|
/* elements */
|
|
7
7
|
"draggableHandle",
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { ContainerSize } from '../../../utils/types';
|
|
2
2
|
import { CurrentState, DefaultPosition } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
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
|
+
* @author cesar - automatic
|
|
15
|
+
* @createdAt 2024-11-08 12:13:10 - automatic
|
|
16
|
+
* @updatedAt 2024-11-08 12:13:10 - automatic
|
|
17
|
+
* @updatedUser cesar - automatic
|
|
5
18
|
*/
|
|
6
19
|
export declare const getInitialSize: (containerSize: ContainerSize | undefined, defaultPosition: DefaultPosition) => CurrentState;
|
|
@@ -28,8 +28,6 @@ const getInitialSize = (containerSize, defaultPosition) => {
|
|
|
28
28
|
return {
|
|
29
29
|
top: top ?? (bottom ? containerHeight - bottom - (height || 0) : 0),
|
|
30
30
|
height: height ?? containerHeight - (top || 0) - (bottom || 0),
|
|
31
|
-
// top: top || 0,
|
|
32
|
-
// height: height ?? containerHeight - (top || 0) - (bottom || 0),
|
|
33
31
|
left: left ?? (right ? containerWidth - right - (width || 0) : 0),
|
|
34
32
|
width: width ?? containerWidth - (left || 0) - (right || 0)
|
|
35
33
|
};
|
|
@@ -16,6 +16,10 @@ type useOnDragStartProps = {
|
|
|
16
16
|
* "useDimensionEffects" Redimensiona la ventana si el contenedor padre es desbordado por ella.
|
|
17
17
|
* Guarda las posiciones de la ventana cuando se encoge el contenedor padre, para recuperarlas cuando se expanda.
|
|
18
18
|
* @param props
|
|
19
|
+
* @author cesar - automatic
|
|
20
|
+
* @createdAt 2024-11-12 08:41:21 - automatic
|
|
21
|
+
* @updatedAt 2024-11-13 14:48:00 - automatic
|
|
22
|
+
* @updatedUser cesar - automatic
|
|
19
23
|
*/
|
|
20
24
|
export declare const useDimensionEffects: (props: useOnDragStartProps) => void;
|
|
21
25
|
export {};
|
|
@@ -11,26 +11,26 @@ const useDimensionEffects = (props) => {
|
|
|
11
11
|
currentState,
|
|
12
12
|
setCurrentState
|
|
13
13
|
} = props;
|
|
14
|
-
const
|
|
14
|
+
const shrinkingParentContainer = useCallback(
|
|
15
15
|
(newState, cState, containerDimension, divRoot, dimension) => {
|
|
16
16
|
const lDimension = dimension === "Width" ? "width" : "height";
|
|
17
17
|
const leftTop = dimension === "Width" ? "left" : "top";
|
|
18
18
|
const shrinkLeftTopAt = dimension === "Width" ? "shrinkLeftAt" : "shrinkTopAt";
|
|
19
19
|
const overflowDimensionAt = dimension === "Width" ? "overflowWidthAt" : "overflowHeightAt";
|
|
20
20
|
const boundsLefTop = dimension === "Width" ? bounds?.left || 0 : bounds?.top || 0;
|
|
21
|
-
const
|
|
21
|
+
const boundsRightBottom = dimension === "Width" ? bounds?.right || 0 : bounds?.bottom || 0;
|
|
22
22
|
const minWindowDimension = dimension === "Width" ? minWindowWidth : minWindowHeight;
|
|
23
|
-
const minDimension = containerDimension - boundsLefTop +
|
|
24
|
-
let maxDimensionElement = containerDimension - cState[leftTop] +
|
|
23
|
+
const minDimension = containerDimension - boundsLefTop + boundsRightBottom > minWindowDimension ? containerDimension - boundsLefTop + boundsRightBottom : minWindowDimension;
|
|
24
|
+
let maxDimensionElement = containerDimension - cState[leftTop] + boundsRightBottom;
|
|
25
25
|
if (divRoot[`client${dimension}`] > maxDimensionElement) {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
newState[leftTop] = newState[leftTop] -
|
|
26
|
+
const shrunkenPixels = divRoot[`client${dimension}`] - maxDimensionElement;
|
|
27
|
+
if (shrunkenPixels < cState[leftTop] - boundsLefTop) {
|
|
28
|
+
newState[leftTop] = newState[leftTop] - shrunkenPixels;
|
|
29
29
|
newState[shrinkLeftTopAt] = newState[shrinkLeftTopAt] || cState[leftTop];
|
|
30
|
-
} else if (
|
|
30
|
+
} else if (shrunkenPixels > cState[leftTop] - boundsLefTop) {
|
|
31
31
|
newState[leftTop] = boundsLefTop;
|
|
32
32
|
newState[shrinkLeftTopAt] = newState[shrinkLeftTopAt] || cState[leftTop];
|
|
33
|
-
maxDimensionElement = containerDimension - boundsLefTop +
|
|
33
|
+
maxDimensionElement = containerDimension - boundsLefTop + boundsRightBottom;
|
|
34
34
|
if (divRoot[`client${dimension}`] > maxDimensionElement) {
|
|
35
35
|
newState[lDimension] = maxDimensionElement;
|
|
36
36
|
newState[overflowDimensionAt] = newState[overflowDimensionAt] || cState[lDimension];
|
|
@@ -53,8 +53,8 @@ const useDimensionEffects = (props) => {
|
|
|
53
53
|
const shrinkLeftTopAt = dimension === "Width" ? "shrinkLeftAt" : "shrinkTopAt";
|
|
54
54
|
const overflowDimensionAt = dimension === "Width" ? "overflowWidthAt" : "overflowHeightAt";
|
|
55
55
|
const boundsLefTop = dimension === "Width" ? bounds?.left || 0 : bounds?.top || 0;
|
|
56
|
-
const
|
|
57
|
-
const maxDimensionElement = containerDimension - boundsLefTop +
|
|
56
|
+
const initialPosition = dimension === "Width" ? bounds?.right || 0 : bounds?.bottom || 0;
|
|
57
|
+
const maxDimensionElement = containerDimension - boundsLefTop + initialPosition;
|
|
58
58
|
const valOverflowDimensionAt = newState[overflowDimensionAt];
|
|
59
59
|
if (valOverflowDimensionAt) {
|
|
60
60
|
if (valOverflowDimensionAt > maxDimensionElement) {
|
|
@@ -66,7 +66,7 @@ const useDimensionEffects = (props) => {
|
|
|
66
66
|
}
|
|
67
67
|
const valShrinkLeftTopAt = newState[shrinkLeftTopAt];
|
|
68
68
|
if (valShrinkLeftTopAt && !newState[overflowDimensionAt]) {
|
|
69
|
-
const dimensionAvailable = containerDimension - boundsLefTop - newState[lDimension] +
|
|
69
|
+
const dimensionAvailable = containerDimension - boundsLefTop - newState[lDimension] + initialPosition;
|
|
70
70
|
if (valShrinkLeftTopAt <= dimensionAvailable) {
|
|
71
71
|
newState[leftTop] = valShrinkLeftTopAt;
|
|
72
72
|
newState[shrinkLeftTopAt] = void 0;
|
|
@@ -79,59 +79,137 @@ const useDimensionEffects = (props) => {
|
|
|
79
79
|
[]
|
|
80
80
|
);
|
|
81
81
|
const draggingOrResizingWindow = useCallback(
|
|
82
|
-
(newState, _currentState, containerDimension,
|
|
82
|
+
(newState, _currentState, containerDimension, _divRoot, dimension) => {
|
|
83
83
|
const lDimension = dimension === "Width" ? "width" : "height";
|
|
84
84
|
const leftTop = dimension === "Width" ? "left" : "top";
|
|
85
|
+
const boundsRightBottom = dimension === "Width" ? bounds?.right || 0 : bounds?.bottom || 0;
|
|
85
86
|
const boundsLefTop = dimension === "Width" ? bounds?.left || 0 : bounds?.top || 0;
|
|
86
|
-
const
|
|
87
|
-
const maxDimensionWithoutBounds = containerDimension - boundsLefTop +
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
const boundsTop = dimension === "Height" ? bounds?.top || 0 : bounds?.top || 0;
|
|
88
|
+
const maxDimensionWithoutBounds = containerDimension - boundsLefTop + boundsRightBottom;
|
|
89
|
+
const rightBottomBoundary = containerDimension - newState[lDimension] + boundsRightBottom;
|
|
90
|
+
const adjustDimension = () => {
|
|
91
|
+
if (newState[lDimension] > maxDimensionWithoutBounds) {
|
|
92
|
+
newState[lDimension] = maxDimensionWithoutBounds;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const adjustLeftTop = () => {
|
|
96
|
+
if (newState[leftTop] < boundsLefTop) {
|
|
97
|
+
newState[leftTop] = boundsLefTop;
|
|
98
|
+
}
|
|
99
|
+
if (newState[leftTop] > rightBottomBoundary) {
|
|
100
|
+
newState[leftTop] = rightBottomBoundary;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
if (newState.resizing && stateRef.current.initialPosition) {
|
|
104
|
+
if (newState.resizing.handle !== "w") {
|
|
105
|
+
if (newState[leftTop] + newState[lDimension] > containerDimension + boundsRightBottom) {
|
|
106
|
+
newState[lDimension] = containerDimension - newState[leftTop] + boundsRightBottom;
|
|
94
107
|
}
|
|
95
108
|
} else {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
const dimensionDiff = newState[lDimension] - stateRef.current.initialPosition[lDimension];
|
|
110
|
+
if (dimensionDiff > 0) {
|
|
111
|
+
if (newState[leftTop] - dimensionDiff >= boundsLefTop) {
|
|
112
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + dimensionDiff;
|
|
113
|
+
newState[leftTop] -= dimensionDiff;
|
|
114
|
+
} else {
|
|
115
|
+
newState[leftTop] = boundsLefTop;
|
|
116
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension];
|
|
117
|
+
}
|
|
118
|
+
} else if (dimensionDiff < 0) {
|
|
119
|
+
newState[leftTop] -= dimensionDiff;
|
|
120
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + dimensionDiff;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (newState.resizing.handle === "sw") {
|
|
124
|
+
const difWidth = newState[lDimension] - stateRef.current.initialPosition[lDimension];
|
|
125
|
+
if (dimension === "Width") {
|
|
126
|
+
if (difWidth > 0) {
|
|
127
|
+
if (newState[leftTop] - difWidth >= boundsLefTop) {
|
|
128
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop] - difWidth;
|
|
129
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difWidth;
|
|
105
130
|
} else {
|
|
106
131
|
newState[leftTop] = boundsLefTop;
|
|
107
|
-
newState[lDimension] = stateRef.current.
|
|
132
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + (stateRef.current.initialPosition[leftTop] - boundsLefTop);
|
|
108
133
|
}
|
|
109
|
-
} else if (
|
|
110
|
-
newState[leftTop]
|
|
111
|
-
newState[lDimension] = stateRef.current.
|
|
134
|
+
} else if (difWidth < 0) {
|
|
135
|
+
newState[leftTop] -= difWidth;
|
|
136
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difWidth;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (dimension === "Height") {
|
|
140
|
+
if (difWidth > 0) {
|
|
141
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difWidth;
|
|
142
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop];
|
|
143
|
+
} else if (difWidth < 0) {
|
|
144
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difWidth;
|
|
145
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop];
|
|
112
146
|
}
|
|
113
147
|
}
|
|
114
148
|
}
|
|
149
|
+
if (newState.resizing.handle === "nw") {
|
|
150
|
+
const difWidth = newState[lDimension] - stateRef.current.initialPosition[lDimension];
|
|
151
|
+
const difHeight = newState[lDimension] - stateRef.current.initialPosition[lDimension];
|
|
152
|
+
if (dimension === "Width") {
|
|
153
|
+
if (difWidth > 0) {
|
|
154
|
+
if (newState[leftTop] - difWidth >= boundsLefTop) {
|
|
155
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop] - difWidth;
|
|
156
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difWidth;
|
|
157
|
+
} else {
|
|
158
|
+
newState[leftTop] = boundsLefTop;
|
|
159
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + (stateRef.current.initialPosition[leftTop] - boundsLefTop);
|
|
160
|
+
}
|
|
161
|
+
} else if (difWidth < 0) {
|
|
162
|
+
newState[leftTop] -= difWidth;
|
|
163
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difWidth;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (dimension === "Height") {
|
|
167
|
+
if (difHeight < 0) {
|
|
168
|
+
if (newState[leftTop] - difHeight >= boundsTop) {
|
|
169
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop] - difHeight;
|
|
170
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difHeight;
|
|
171
|
+
} else {
|
|
172
|
+
newState[leftTop] = boundsTop;
|
|
173
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + (stateRef.current.initialPosition[leftTop] - boundsTop);
|
|
174
|
+
}
|
|
175
|
+
} else if (difHeight > 0) {
|
|
176
|
+
newState[leftTop] -= difHeight;
|
|
177
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difHeight;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (newState.resizing.handle === "ne") {
|
|
182
|
+
const difHeight = newState[lDimension] - stateRef.current.initialPosition[lDimension];
|
|
183
|
+
if (dimension === "Height") {
|
|
184
|
+
if (difHeight > 0) {
|
|
185
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difHeight;
|
|
186
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop] - difHeight;
|
|
187
|
+
}
|
|
188
|
+
if (difHeight < 0) {
|
|
189
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difHeight;
|
|
190
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop] - difHeight;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (newState.resizing.handle === "n") {
|
|
195
|
+
const difHeight = newState[lDimension] - stateRef.current.initialPosition[lDimension];
|
|
196
|
+
if (dimension === "Height") {
|
|
197
|
+
newState[lDimension] = stateRef.current.initialPosition[lDimension] + difHeight;
|
|
198
|
+
newState[leftTop] = stateRef.current.initialPosition[leftTop] - difHeight;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
115
201
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
newState[leftTop] = boundsLefTop;
|
|
121
|
-
}
|
|
122
|
-
rightBottomBoundary = containerDimension + boundsRigthBottom;
|
|
123
|
-
if (newState[leftTop] > rightBottomBoundary) {
|
|
124
|
-
newState[leftTop] = rightBottomBoundary;
|
|
125
|
-
}
|
|
126
|
-
if (!newState.resizing && newState[leftTop] + newState[lDimension] > containerDimension + boundsRigthBottom) {
|
|
127
|
-
const outWidthHeight = newState[leftTop] + newState[lDimension] - (containerDimension + boundsRigthBottom);
|
|
202
|
+
adjustDimension();
|
|
203
|
+
adjustLeftTop();
|
|
204
|
+
if (!newState.resizing && newState[leftTop] + newState[lDimension] > containerDimension + boundsRightBottom) {
|
|
205
|
+
const outWidthHeight = newState[leftTop] + newState[lDimension] - (containerDimension + boundsRightBottom);
|
|
128
206
|
if (newState[leftTop] - boundsLefTop > outWidthHeight) {
|
|
129
207
|
newState[leftTop] = newState[leftTop] - outWidthHeight;
|
|
130
208
|
}
|
|
131
209
|
}
|
|
132
|
-
if (newState.resizing && stateRef.current.
|
|
133
|
-
stateRef.current.
|
|
134
|
-
stateRef.current.
|
|
210
|
+
if (newState.resizing && stateRef.current.initialPosition) {
|
|
211
|
+
stateRef.current.initialPosition[lDimension] = newState[lDimension];
|
|
212
|
+
stateRef.current.initialPosition[leftTop] = newState[leftTop];
|
|
135
213
|
}
|
|
136
214
|
},
|
|
137
215
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -165,7 +243,7 @@ const useDimensionEffects = (props) => {
|
|
|
165
243
|
dimension
|
|
166
244
|
);
|
|
167
245
|
} else if (containerSizeValue < previousContainerSizeValue) {
|
|
168
|
-
|
|
246
|
+
shrinkingParentContainer(
|
|
169
247
|
newState,
|
|
170
248
|
currentState,
|
|
171
249
|
containerSizeValue,
|
|
@@ -11,11 +11,11 @@ type useDragOptionsProps = {
|
|
|
11
11
|
setCurrentState: React.Dispatch<React.SetStateAction<CurrentState>>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* "useDragOptions" hook que maneja las opciones de
|
|
14
|
+
* "useDragOptions" hook que maneja las opciones de dragging
|
|
15
15
|
* @author Juan Escobar - automatic
|
|
16
16
|
* @createdAt 2024-10-07 16:10:36 - automatic
|
|
17
|
-
* @updatedAt 2024-
|
|
18
|
-
* @updatedUser
|
|
17
|
+
* @updatedAt 2024-11-13 10:42:04 - automatic
|
|
18
|
+
* @updatedUser cesar - automatic
|
|
19
19
|
*/
|
|
20
20
|
export declare const useDragOptions: (props: useDragOptionsProps) => {
|
|
21
21
|
localOnDragStart: (e: DraggableEvent, draggableData: DraggableData) => false | undefined;
|
|
@@ -9,7 +9,26 @@ type useResizeOptionsProps = {
|
|
|
9
9
|
setCurrentState: React.Dispatch<React.SetStateAction<CurrentState>>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* `useResizeOptions` provides a set of handler functions for managing
|
|
13
|
+
* resizing events (start, resize, and stop) on a component. This hook
|
|
14
|
+
* centralizes the resize logic and coordinates state updates, including
|
|
15
|
+
* calculating position changes and applying constraints.
|
|
16
|
+
* @param props - The options required to configure the resize behavior,
|
|
17
|
+
* including callbacks, references, and state setters.
|
|
18
|
+
* @returns An object containing `localOnResize`, `localOnResizeStart`,
|
|
19
|
+
* and `localOnResizeStop` handlers.
|
|
20
|
+
* @example
|
|
21
|
+
* const { localOnResize, localOnResizeStart, localOnResizeStop } = useResizeOptions({
|
|
22
|
+
* onResizeStart: handleResizeStart,
|
|
23
|
+
* onResize: handleResize,
|
|
24
|
+
* onResizeStop: handleResizeStop,
|
|
25
|
+
* stateRef,
|
|
26
|
+
* setCurrentState,
|
|
27
|
+
* });
|
|
28
|
+
* @author cesar - automatic
|
|
29
|
+
* @createdAt 2024-11-07 15:30:05 - automatic
|
|
30
|
+
* @updatedAt 2024-11-13 10:42:04 - automatic
|
|
31
|
+
* @updatedUser cesar - automatic
|
|
13
32
|
*/
|
|
14
33
|
export declare const useResizeOptions: (props: useResizeOptionsProps) => {
|
|
15
34
|
localOnResize: (e: SyntheticEvent, callbackData: ResizeCallbackData) => void;
|
|
@@ -9,7 +9,7 @@ const useResizeOptions = (props) => {
|
|
|
9
9
|
handler(e, data);
|
|
10
10
|
}
|
|
11
11
|
if (handlerName === "onResizeStart") {
|
|
12
|
-
stateRef.current.
|
|
12
|
+
stateRef.current.initialPosition = {
|
|
13
13
|
left: stateRef.current.left,
|
|
14
14
|
top: stateRef.current.top,
|
|
15
15
|
width: stateRef.current.width,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as COMPONENT_KEY_COMPONENT } from "../constants.js";
|
|
3
3
|
import { d as dragResizeWindowStyles } from "../DragResizeWindow.styles.js";
|
|
4
4
|
import { D as DragResizeWindowSlots } from "./slots.js";
|
|
5
|
-
const RootStyled = styled("div", { name:
|
|
5
|
+
const RootStyled = styled("div", { name: COMPONENT_KEY_COMPONENT, slot: DragResizeWindowSlots.root })(
|
|
6
6
|
dragResizeWindowStyles?.root
|
|
7
7
|
);
|
|
8
8
|
styled("div", {
|
|
9
|
-
name:
|
|
9
|
+
name: COMPONENT_KEY_COMPONENT,
|
|
10
10
|
slot: DragResizeWindowSlots.iconResizeFormatterRoot
|
|
11
11
|
})(dragResizeWindowStyles?.iconResizeFormatterRoot);
|
|
12
12
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|