math-main-components 0.0.158 → 0.0.159
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,10 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
|
-
export
|
3
|
-
|
4
|
-
|
5
|
-
}
|
6
|
-
export declare function Dialog({ data, text, onClose, onSubmit, children }: {
|
7
|
-
data?: DialogData;
|
2
|
+
export declare function Dialog({ data, enabled, text, onClose, onSubmit, children }: {
|
3
|
+
data?: unknown;
|
4
|
+
enabled?: boolean;
|
8
5
|
text?: any;
|
9
6
|
onClose?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, data?: any | undefined) => void;
|
10
7
|
onSubmit?: (event: React.MouseEvent<HTMLButtonElement>, data?: any | undefined) => void;
|
package/dist/index.cjs.js
CHANGED
@@ -148,21 +148,21 @@ var css_248z$o = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
|
|
148
148
|
var styles$o = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M","cancel_button":"styles-module_cancel_button__KhwLS","submit_button":"styles-module_submit_button__xLzux"};
|
149
149
|
styleInject(css_248z$o);
|
150
150
|
|
151
|
-
function Dialog({ data, text, onClose, onSubmit, children }) {
|
151
|
+
function Dialog({ data, enabled, text, onClose, onSubmit = () => { }, children }) {
|
152
152
|
function onClick(event) {
|
153
153
|
const element = event.target;
|
154
154
|
const id = element.id;
|
155
155
|
if (["dialog-backdrop", "cancel-button"].includes(id)) {
|
156
156
|
if (onClose)
|
157
|
-
onClose(event, data
|
157
|
+
onClose(event, data);
|
158
158
|
}
|
159
159
|
}
|
160
|
-
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${
|
160
|
+
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${enabled ? styles$o.active : styles$o.disabled}`, onClick: onClick },
|
161
161
|
React__default["default"].createElement("div", { className: styles$o.dialog_window },
|
162
162
|
children,
|
163
163
|
text && React__default["default"].createElement("h1", null, text),
|
164
164
|
React__default["default"].createElement("button", { className: styles$o.cancel_button, id: "cancel-button", onClick: onClick }, "Abbrechen"),
|
165
|
-
React__default["default"].createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit
|
165
|
+
React__default["default"].createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit(event, data) }, "Best\u00E4tigen"))));
|
166
166
|
}
|
167
167
|
|
168
168
|
var css_248z$n = ".styles-module_card__hT9fw {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 20px;\n padding: 100px 0px;\n}\n.styles-module_card__hT9fw h1 {\n margin: 0;\n font-size: 22px;\n font-weight: 500;\n}\n.styles-module_card__hT9fw p {\n margin: 0;\n font-size: 16px;\n}";
|
package/dist/index.esm.js
CHANGED
@@ -140,21 +140,21 @@ var css_248z$o = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
|
|
140
140
|
var styles$o = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M","cancel_button":"styles-module_cancel_button__KhwLS","submit_button":"styles-module_submit_button__xLzux"};
|
141
141
|
styleInject(css_248z$o);
|
142
142
|
|
143
|
-
function Dialog({ data, text, onClose, onSubmit, children }) {
|
143
|
+
function Dialog({ data, enabled, text, onClose, onSubmit = () => { }, children }) {
|
144
144
|
function onClick(event) {
|
145
145
|
const element = event.target;
|
146
146
|
const id = element.id;
|
147
147
|
if (["dialog-backdrop", "cancel-button"].includes(id)) {
|
148
148
|
if (onClose)
|
149
|
-
onClose(event, data
|
149
|
+
onClose(event, data);
|
150
150
|
}
|
151
151
|
}
|
152
|
-
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${
|
152
|
+
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${enabled ? styles$o.active : styles$o.disabled}`, onClick: onClick },
|
153
153
|
React.createElement("div", { className: styles$o.dialog_window },
|
154
154
|
children,
|
155
155
|
text && React.createElement("h1", null, text),
|
156
156
|
React.createElement("button", { className: styles$o.cancel_button, id: "cancel-button", onClick: onClick }, "Abbrechen"),
|
157
|
-
React.createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit
|
157
|
+
React.createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit(event, data) }, "Best\u00E4tigen"))));
|
158
158
|
}
|
159
159
|
|
160
160
|
var css_248z$n = ".styles-module_card__hT9fw {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 20px;\n padding: 100px 0px;\n}\n.styles-module_card__hT9fw h1 {\n margin: 0;\n font-size: 22px;\n font-weight: 500;\n}\n.styles-module_card__hT9fw p {\n margin: 0;\n font-size: 16px;\n}";
|