@tap-payments/os-micro-frontend-shared 0.1.255 → 0.1.256
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material';
|
|
2
3
|
import { DragControls } from 'framer-motion';
|
|
3
|
-
interface WindowWrapperProps {
|
|
4
|
+
interface WindowWrapperProps extends BoxProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
id: string;
|
|
6
7
|
onResize?: (element: HTMLElement) => void;
|
|
@@ -20,6 +21,6 @@ interface WindowWrapperProps {
|
|
|
20
21
|
};
|
|
21
22
|
sandboxMode?: boolean;
|
|
22
23
|
}
|
|
23
|
-
declare function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragControls, onClick, options: { width, height, minHeight, minWidth, maxHeight, maxWidth, order, openOrder }, sandboxMode, }: Readonly<WindowWrapperProps>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragControls, onClick, options: { width, height, minHeight, minWidth, maxHeight, maxWidth, order, openOrder }, sandboxMode, sx, }: Readonly<WindowWrapperProps>): import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
declare const _default: import("react").MemoExoticComponent<typeof WindowWrapper>;
|
|
25
26
|
export default _default;
|
|
@@ -5,7 +5,7 @@ import { motion } from 'framer-motion';
|
|
|
5
5
|
import { Resizable } from 're-resizable';
|
|
6
6
|
import { APP_WINDOW_Z_INDEX, FOOTER_HEIGHT, HEADER_HEIGHT } from '../../constants/index.js';
|
|
7
7
|
import { contentStyle, ContentWrapper, initalStyle, resizableMainStyle, AppContainerWrapper, AppContainerContainer } from './style';
|
|
8
|
-
function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragControls, onClick, options: { width, height, minHeight, minWidth, maxHeight, maxWidth, order, openOrder = 1 }, sandboxMode = false, }) {
|
|
8
|
+
function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragControls, onClick, options: { width, height, minHeight, minWidth, maxHeight, maxWidth, order, openOrder = 1 }, sandboxMode = false, sx, }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const [isDrag, setIsDrag] = useState(true);
|
|
11
11
|
const modalRef = useRef(null);
|
|
@@ -28,13 +28,13 @@ function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragC
|
|
|
28
28
|
height: isMaximized ? '100vh' : '100%',
|
|
29
29
|
});
|
|
30
30
|
}, [isMaximized, width]);
|
|
31
|
-
return (_jsx(AppContainerWrapper, Object.assign({ id: "app-container-wrapper", "data-testid": "AppContainerWrapper" }, { children: _jsx(AppContainerContainer, Object.assign({ "data-testid": "AppContainerContainer" }, { children: _jsx(motion.div, Object.assign({ id: "app-content", "data-add-id": id, "data-testid": "AppContent", ref: constraintsRef, initial: initalStyle }, { children: _jsx(ContentWrapper, Object.assign({ id: "content-wrapper", drag: !isMaximized && isDrag, dragMomentum: false, dragConstraints: false, onDragStart: onClick, onDragEnter: onClick, onClick: onClick, dragControls: dragControls, dragListener: false, style: Object.assign(Object.assign(Object.assign({}, (order && {
|
|
31
|
+
return (_jsx(AppContainerWrapper, Object.assign({ id: "app-container-wrapper", "data-testid": "AppContainerWrapper", sx: sx }, { children: _jsx(AppContainerContainer, Object.assign({ "data-testid": "AppContainerContainer" }, { children: _jsx(motion.div, Object.assign({ id: "app-content", "data-add-id": id, "data-testid": "AppContent", ref: constraintsRef, initial: initalStyle }, { children: _jsx(ContentWrapper, Object.assign({ id: "content-wrapper", drag: !isMaximized && isDrag, dragMomentum: false, dragConstraints: false, onDragStart: onClick, onDragEnter: onClick, onClick: onClick, dragControls: dragControls, dragListener: false, style: Object.assign(Object.assign(Object.assign({}, (order && {
|
|
32
32
|
zIndex: Number(order) + APP_WINDOW_Z_INDEX,
|
|
33
33
|
})), contentStyle), { height }), initial: Object.assign({ marginInline: 'auto', scale: 0, left: 0 }, (!isMaximized && {
|
|
34
34
|
left: 48 * (openOrder - 1),
|
|
35
35
|
})), animate: Object.assign(Object.assign({ width }, (isMaximized && {
|
|
36
36
|
width: '100vw',
|
|
37
|
-
})), { scale: Number(!isMinimized), top: isMaximized ? 0 : HEADER_HEIGHT + FOOTER_HEIGHT * (openOrder - 1), left: isMaximized ? 0 : 48 * (openOrder - 1) }), ref: modalRef, maximized: isMaximized, transition: { duration: isMaximized ? 0.3 : 0 } }, { children: _jsx(Resizable, Object.assign({ ref: (c) => {
|
|
37
|
+
})), { scale: Number(!isMinimized), top: isMaximized ? 0 : HEADER_HEIGHT + FOOTER_HEIGHT * (openOrder - 1), left: isMaximized ? 0 : 48 * (openOrder - 1) }), ref: modalRef, maximized: isMaximized, transition: { duration: isMaximized ? 0.3 : 0 } }, { children: _jsx(Resizable, Object.assign({ "data-id": id, ref: (c) => {
|
|
38
38
|
resizableRef.current = c;
|
|
39
39
|
}, style: resizableStyle, minHeight: minHeight, minWidth: minWidth, maxHeight: maxHeight, maxWidth: maxWidth, onResizeStart: onResizeStart, onResizeStop: onResizeStop, onResize: (_, __, element) => {
|
|
40
40
|
onResize === null || onResize === void 0 ? void 0 : onResize(element);
|
package/package.json
CHANGED