dry-ux 1.85.0 → 1.86.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/dist/ui-utils/Modal.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export type ModalProps = {
|
|
|
31
31
|
* If true, centers the modal vertically.
|
|
32
32
|
*/
|
|
33
33
|
centered?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If true, modals with a title bar can be dragged.
|
|
36
|
+
*/
|
|
37
|
+
draggable?: boolean;
|
|
34
38
|
/**
|
|
35
39
|
* Callback function to be called when the modal is opened.
|
|
36
40
|
*/
|
package/dist/ui-utils/Modal.js
CHANGED
|
@@ -12,9 +12,9 @@ const useDraggable_1 = require("./useDraggable");
|
|
|
12
12
|
* @param {ModalProps} props - The props for the Modal component.
|
|
13
13
|
* @returns {JSX.Element} The Modal component.
|
|
14
14
|
*/
|
|
15
|
-
const Modal = ({ id, instance: { handleClose, toggleOverlay, shown, overlay, options: { content, footerContent, cssClass = "", closeBtn, title, width, onClose, titleCloseBtn = true, centered, trackingId, draggable, actions = [], }, }, config: { defaultModalStyles = false, styles = {}, centered: globalCentered, onOpen, onClose: globalOnClose }, providerId, debug, }) => {
|
|
15
|
+
const Modal = ({ id, instance: { handleClose, toggleOverlay, shown, overlay, options: { content, footerContent, cssClass = "", closeBtn, title, width, onClose, titleCloseBtn = true, centered, trackingId, draggable, actions = [], }, }, config: { defaultModalStyles = false, styles = {}, centered: globalCentered, draggable: globalDraggable, onOpen, onClose: globalOnClose, }, providerId, debug, }) => {
|
|
16
16
|
const isCentered = centered !== null && centered !== void 0 ? centered : globalCentered;
|
|
17
|
-
const isDraggable = !!draggable && !!title;
|
|
17
|
+
const isDraggable = !!(draggable !== null && draggable !== void 0 ? draggable : globalDraggable) && !!title;
|
|
18
18
|
const draggableClass = isDraggable ? `dry-ux-draggable-${id}` : "";
|
|
19
19
|
(0, useDraggable_1.useDraggable)(isDraggable, shown, `dry-ux-draggable-${id}`);
|
|
20
20
|
const applyStyles = React.useCallback(() => {
|