wenay-react2 1.0.9 → 1.0.10
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.
|
@@ -14,10 +14,10 @@ export function InputPage({ callback, name = "", txt = "" }) {
|
|
|
14
14
|
} }), _jsx("div", { style: { marginTop: 20 }, className: "msTradeAlt msTradeActive", onClick: () => { callback(txtName.current); }, children: "send" })] });
|
|
15
15
|
}
|
|
16
16
|
export function InputPageModal({ callback, name, outClick, keyForSave = "InputPage2", txt }) {
|
|
17
|
-
return _jsx(ModalWrapper, { outClick: outClick, keyForSave: keyForSave, size: { height: 150, width: 300 }, position: { y: -150, x: -250 }, children: InputPage
|
|
17
|
+
return _jsx(ModalWrapper, { outClick: outClick, keyForSave: keyForSave, size: { height: 150, width: 300 }, position: { y: -150, x: -250 }, children: _jsx(InputPage, { callback: callback, name: name, txt: txt }) });
|
|
18
18
|
}
|
|
19
19
|
export function InputFileModal({ callback, name, outClick, keyForSave = "InputFile2" }) {
|
|
20
|
-
return _jsx(ModalWrapper, { outClick: outClick, keyForSave: keyForSave, size: { height: 150, width: 300 }, position: { y: -150, x: -250 }, children: InputFile
|
|
20
|
+
return _jsx(ModalWrapper, { outClick: outClick, keyForSave: keyForSave, size: { height: 150, width: 300 }, position: { y: -150, x: -250 }, children: _jsx(InputFile, { callback: callback, name: name }) });
|
|
21
21
|
}
|
|
22
22
|
export function InputFile({ callback, name = "" }) {
|
|
23
23
|
let file = null;
|
|
@@ -33,8 +33,8 @@ export declare const DivOutsideClick2: React.ForwardRefExoticComponent<React.HTM
|
|
|
33
33
|
status?: boolean;
|
|
34
34
|
zIndex?: number;
|
|
35
35
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
-
export declare function Button({ keySave, statusDef, outClick, ...data }: tButton):
|
|
36
|
+
export declare function Button({ keySave, statusDef, outClick, ...data }: tButton): import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
export declare function ButtonHover(props: tButtonBase): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
export declare const ButtonOutClick: typeof Button;
|
|
39
|
-
export declare function ButtonAbs(
|
|
39
|
+
export declare function ButtonAbs(props: Parameters<typeof Button>[0]): import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
export {};
|
|
@@ -42,16 +42,12 @@ export function Button({ keySave, statusDef, outClick, ...data }) {
|
|
|
42
42
|
if (keySave && saveStatus[keySave])
|
|
43
43
|
statusDef = saveStatus[keySave];
|
|
44
44
|
const state = useState(statusDef ?? false);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
outClick();
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
: ButtonBase({ ...data, state });
|
|
45
|
+
const handleOutsideClick = () => {
|
|
46
|
+
state[1](false);
|
|
47
|
+
if (typeof outClick == "function")
|
|
48
|
+
outClick();
|
|
49
|
+
};
|
|
50
|
+
return outClick ? (_jsx(DivOutsideClick, { status: state[0], outsideClick: handleOutsideClick, children: _jsx(ButtonBase, { ...data, state: state }) })) : (_jsx(ButtonBase, { ...data, state: state }));
|
|
55
51
|
}
|
|
56
52
|
export function ButtonHover(props) {
|
|
57
53
|
const [hover, setHover] = useState(false);
|
|
@@ -59,10 +55,10 @@ export function ButtonHover(props) {
|
|
|
59
55
|
_jsx("div", { style: { position: "absolute" }, children: typeof props.children == "function" ? props.children({ onClose: () => setHover(false) }) : props.children })] });
|
|
60
56
|
}
|
|
61
57
|
export const ButtonOutClick = ({ outClick = true, ...a }) => Button({ ...a, outClick });
|
|
62
|
-
export function ButtonAbs(
|
|
58
|
+
export function ButtonAbs(props) {
|
|
63
59
|
const children = (api) => _jsx("div", { style: { position: "relative" }, children: _jsx("div", { style: {
|
|
64
60
|
position: "absolute",
|
|
65
|
-
zIndex:
|
|
66
|
-
}, children: typeof
|
|
67
|
-
return Button
|
|
61
|
+
zIndex: props.zIndex ?? 9
|
|
62
|
+
}, children: typeof props.children == "function" ? props.children(api) : props.children }) });
|
|
63
|
+
return _jsx(Button, { ...props, children: children });
|
|
68
64
|
}
|