ehscan-react-components 0.1.13 → 0.1.14
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/Components.d.ts +1 -0
- package/dist/Components.js +1 -0
- package/dist/Window.d.ts +2 -2
- package/dist/Window.js +2 -2
- package/package.json +1 -1
package/dist/Components.d.ts
CHANGED
package/dist/Components.js
CHANGED
package/dist/Window.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface Props {
|
|
3
3
|
trackMove?: (args?: any) => void;
|
|
4
4
|
open: boolean;
|
|
5
5
|
initialPosition?: {
|
|
@@ -13,4 +13,4 @@ export interface WindowProps {
|
|
|
13
13
|
footer?: React.ReactNode;
|
|
14
14
|
onClose?: () => void;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export declare const Window: React.FC<Props>;
|
package/dist/Window.js
CHANGED
|
@@ -82,7 +82,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
82
82
|
// }
|
|
83
83
|
import { useRef, useEffect, useState } from "react";
|
|
84
84
|
import { useDraggable } from "./tools/useDraggable"; // adjust path as needed
|
|
85
|
-
export
|
|
85
|
+
export const Window = ({ trackMove, open, initialPosition = { x: 600, y: 100 }, initialWidth = 400, initialBodyPadding = 20, header, body, footer, onClose, }) => {
|
|
86
86
|
const targetRef = useRef(null);
|
|
87
87
|
const headerRef = useRef(null);
|
|
88
88
|
const resizeHandleRef = useRef(null);
|
|
@@ -113,4 +113,4 @@ export default function Window({ trackMove, open, initialPosition = { x: 600, y:
|
|
|
113
113
|
if (!open)
|
|
114
114
|
return null;
|
|
115
115
|
return (_jsxs("div", { ref: targetRef, className: `ext-window${fadeIn ? ' fadein' : ''}`, style: { left: `${initialPosition.x}px`, top: `${initialPosition.y}px`, minWidth: `${windowWidth}px` }, children: [_jsx("div", { ref: headerRef, className: "ext-window-header", children: header !== null && header !== void 0 ? header : (_jsxs(_Fragment, { children: [_jsx("div", { className: "ext-window-drag-handle", children: "||" }), _jsx("div", { className: "ext-window-header-title", children: "Header" }), _jsx("div", { onClick: onClose, children: "close" })] })) }), _jsx("div", { ref: bodyRef, className: "ext-window-body _ewb", style: { padding: `${bodyPadding}px` }, children: body !== null && body !== void 0 ? body : _jsx(_Fragment, { children: "Body" }) }), footer && (_jsx("div", { ref: footerRef, className: "ext-window-footer", children: footer })), _jsx("div", { className: "resize-handle", ref: resizeHandleRef })] }));
|
|
116
|
-
}
|
|
116
|
+
};
|