math-main-components 0.0.20 → 0.0.22
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,12 @@
|
|
1
1
|
import React from "react";
|
2
|
-
|
3
|
-
|
2
|
+
export interface DialogData {
|
3
|
+
isActive: boolean;
|
4
|
+
data?: any;
|
5
|
+
}
|
6
|
+
export declare function Dialog({ data, text, onClose, onSubmit, children }: {
|
7
|
+
data?: DialogData;
|
8
|
+
text?: any;
|
9
|
+
onClose?: (event: React.MouseEventHandler<HTMLDivElement>, data: any) => void;
|
10
|
+
onSubmit?: (event: React.MouseEventHandler<HTMLButtonElement>, data: any) => void;
|
11
|
+
children: any;
|
12
|
+
}): 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
@@ -131,18 +131,23 @@ function CopyCode({ code, style, onCopy = () => { } }) {
|
|
131
131
|
React__default["default"].createElement("input", { type: "hidden", name: "code", value: code })));
|
132
132
|
}
|
133
133
|
|
134
|
-
var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n height: 100vh;\n width: 100vw;\n background: rgba(255, 255, 255, 0.659);\n backdrop-filter: blur(10px) brightness(70%);\n left: 0;\n top: 0;\n z-index: 10000;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.styles-module_container__9-1MH.styles-module_active__AXoyo {\n opacity: 1;\n}\n.styles-module_container__9-1MH.styles-module_disabled__sELpy {\n pointer-events: none;\n opacity: 0;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M {\n background: white;\n border-radius: 20px;\n padding: 20px;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n cursor: auto;\n}";
|
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"};
|
134
|
+
var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n height: 100vh;\n width: 100vw;\n background: rgba(255, 255, 255, 0.659);\n backdrop-filter: blur(10px) brightness(70%);\n left: 0;\n top: 0;\n z-index: 10000;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.styles-module_container__9-1MH.styles-module_active__AXoyo {\n opacity: 1;\n}\n.styles-module_container__9-1MH.styles-module_disabled__sELpy {\n pointer-events: none;\n opacity: 0;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M {\n background: white;\n border-radius: 20px;\n padding: 50px;\n width: 450px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n max-width: 100%;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n cursor: auto;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M h1 {\n font-size: 22px;\n font-weight: 500;\n line-height: 1.5;\n margin-top: 20px;\n margin-bottom: 20px;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M .styles-module_cancel_button__KhwLS {\n border-radius: 19px;\n background: #DADADA;\n padding: 0px 8px;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M .styles-module_submit_button__xLzux {\n border-radius: 19px;\n color: white;\n background: #0075FF;\n padding: 0px 8px;\n}";
|
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","cancel_button":"styles-module_cancel_button__KhwLS","submit_button":"styles-module_submit_button__xLzux"};
|
136
136
|
styleInject(css_248z$m);
|
137
137
|
|
138
|
-
function Dialog({
|
138
|
+
function Dialog({ data, text, onClose = (event, data) => { }, onSubmit = (event, data) => { }, children = null }) {
|
139
139
|
function onClick(event) {
|
140
|
-
if (event.target.id == 'dialog-backdrop') {
|
141
|
-
|
140
|
+
if (event.target.id == 'dialog-backdrop' || event.target.id == 'cancel-button') {
|
141
|
+
if (data)
|
142
|
+
onClose(event, data.data);
|
142
143
|
}
|
143
144
|
}
|
144
|
-
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${
|
145
|
-
React__default["default"].createElement("div", { className: styles$m.dialog_window },
|
145
|
+
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
|
146
|
+
React__default["default"].createElement("div", { className: styles$m.dialog_window },
|
147
|
+
children,
|
148
|
+
React__default["default"].createElement("h1", null, text),
|
149
|
+
React__default["default"].createElement("button", { className: styles$m.cancel_button, id: "cancel-button", onClick: onClick }, "Abbrechen"),
|
150
|
+
React__default["default"].createElement("button", { className: styles$m.submit_button, id: "submit-button", onClick: (event) => onSubmit(event, data?.data) }, "Best\u00E4tigen"))));
|
146
151
|
}
|
147
152
|
|
148
153
|
var css_248z$l = ".styles-module_container__HOoBj {\n margin-bottom: 30px;\n}\n.styles-module_container__HOoBj button {\n padding: 12px 18px;\n border-radius: 40px;\n border: none;\n color: white;\n font-size: 16px;\n background: #0075FF;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n align-items: center;\n}";
|
package/dist/index.esm.js
CHANGED
@@ -123,18 +123,23 @@ function CopyCode({ code, style, onCopy = () => { } }) {
|
|
123
123
|
React.createElement("input", { type: "hidden", name: "code", value: code })));
|
124
124
|
}
|
125
125
|
|
126
|
-
var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n height: 100vh;\n width: 100vw;\n background: rgba(255, 255, 255, 0.659);\n backdrop-filter: blur(10px) brightness(70%);\n left: 0;\n top: 0;\n z-index: 10000;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.styles-module_container__9-1MH.styles-module_active__AXoyo {\n opacity: 1;\n}\n.styles-module_container__9-1MH.styles-module_disabled__sELpy {\n pointer-events: none;\n opacity: 0;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M {\n background: white;\n border-radius: 20px;\n padding: 20px;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n cursor: auto;\n}";
|
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"};
|
126
|
+
var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n height: 100vh;\n width: 100vw;\n background: rgba(255, 255, 255, 0.659);\n backdrop-filter: blur(10px) brightness(70%);\n left: 0;\n top: 0;\n z-index: 10000;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.styles-module_container__9-1MH.styles-module_active__AXoyo {\n opacity: 1;\n}\n.styles-module_container__9-1MH.styles-module_disabled__sELpy {\n pointer-events: none;\n opacity: 0;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M {\n background: white;\n border-radius: 20px;\n padding: 50px;\n width: 450px;\n display: flex;\n flex-direction: column;\n gap: 20px;\n max-width: 100%;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n cursor: auto;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M h1 {\n font-size: 22px;\n font-weight: 500;\n line-height: 1.5;\n margin-top: 20px;\n margin-bottom: 20px;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M .styles-module_cancel_button__KhwLS {\n border-radius: 19px;\n background: #DADADA;\n padding: 0px 8px;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M .styles-module_submit_button__xLzux {\n border-radius: 19px;\n color: white;\n background: #0075FF;\n padding: 0px 8px;\n}";
|
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","cancel_button":"styles-module_cancel_button__KhwLS","submit_button":"styles-module_submit_button__xLzux"};
|
128
128
|
styleInject(css_248z$m);
|
129
129
|
|
130
|
-
function Dialog({
|
130
|
+
function Dialog({ data, text, onClose = (event, data) => { }, onSubmit = (event, data) => { }, children = null }) {
|
131
131
|
function onClick(event) {
|
132
|
-
if (event.target.id == 'dialog-backdrop') {
|
133
|
-
|
132
|
+
if (event.target.id == 'dialog-backdrop' || event.target.id == 'cancel-button') {
|
133
|
+
if (data)
|
134
|
+
onClose(event, data.data);
|
134
135
|
}
|
135
136
|
}
|
136
|
-
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${
|
137
|
-
React.createElement("div", { className: styles$m.dialog_window },
|
137
|
+
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
|
138
|
+
React.createElement("div", { className: styles$m.dialog_window },
|
139
|
+
children,
|
140
|
+
React.createElement("h1", null, text),
|
141
|
+
React.createElement("button", { className: styles$m.cancel_button, id: "cancel-button", onClick: onClick }, "Abbrechen"),
|
142
|
+
React.createElement("button", { className: styles$m.submit_button, id: "submit-button", onClick: (event) => onSubmit(event, data?.data) }, "Best\u00E4tigen"))));
|
138
143
|
}
|
139
144
|
|
140
145
|
var css_248z$l = ".styles-module_container__HOoBj {\n margin-bottom: 30px;\n}\n.styles-module_container__HOoBj button {\n padding: 12px 18px;\n border-radius: 40px;\n border: none;\n color: white;\n font-size: 16px;\n background: #0075FF;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n align-items: center;\n}";
|
package/package.json
CHANGED