math-main-components 0.0.20 → 0.0.21
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,3 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { DialogProps } from "./Dialog.types";
|
3
|
-
export
|
3
|
+
export interface DialogData {
|
4
|
+
isActive: boolean;
|
5
|
+
data: any;
|
6
|
+
}
|
7
|
+
export declare function Dialog({ data, onClose, children }: DialogProps): React.JSX.Element;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { DialogData } from "./Dialog";
|
2
3
|
export interface DialogProps {
|
3
|
-
|
4
|
-
onClose?: (event: React.MouseEventHandler<HTMLDivElement
|
4
|
+
data?: DialogData;
|
5
|
+
onClose?: (event: React.MouseEventHandler<HTMLDivElement>, data: any) => void;
|
5
6
|
children: any;
|
6
7
|
}
|
package/dist/index.cjs.js
CHANGED
@@ -135,13 +135,13 @@ var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
|
|
135
135
|
var styles$m = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M"};
|
136
136
|
styleInject(css_248z$m);
|
137
137
|
|
138
|
-
function Dialog({
|
138
|
+
function Dialog({ data, onClose = (event, data) => { }, children = null }) {
|
139
139
|
function onClick(event) {
|
140
|
-
if (event.target.id == 'dialog-backdrop') {
|
141
|
-
onClose(event);
|
140
|
+
if (event.target.id == 'dialog-backdrop' && data) {
|
141
|
+
onClose(event, data.data);
|
142
142
|
}
|
143
143
|
}
|
144
|
-
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${
|
144
|
+
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
|
145
145
|
React__default["default"].createElement("div", { className: styles$m.dialog_window }, children)));
|
146
146
|
}
|
147
147
|
|
package/dist/index.esm.js
CHANGED
@@ -127,13 +127,13 @@ var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
|
|
127
127
|
var styles$m = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M"};
|
128
128
|
styleInject(css_248z$m);
|
129
129
|
|
130
|
-
function Dialog({
|
130
|
+
function Dialog({ data, onClose = (event, data) => { }, children = null }) {
|
131
131
|
function onClick(event) {
|
132
|
-
if (event.target.id == 'dialog-backdrop') {
|
133
|
-
onClose(event);
|
132
|
+
if (event.target.id == 'dialog-backdrop' && data) {
|
133
|
+
onClose(event, data.data);
|
134
134
|
}
|
135
135
|
}
|
136
|
-
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${
|
136
|
+
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
|
137
137
|
React.createElement("div", { className: styles$m.dialog_window }, children)));
|
138
138
|
}
|
139
139
|
|