math-main-components 0.0.157 → 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;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import React, { ChangeEvent } from 'react';
|
2
|
-
export declare function InputText({ id, title, name, placeholder, defaultValue, autoFocus, type, width, marginBottom, available, onInput }: {
|
2
|
+
export declare function InputText({ id, title, name, placeholder, defaultValue, autoFocus, type, width, marginBottom, autoComplete, available, onInput }: {
|
3
3
|
id?: string;
|
4
4
|
title: string;
|
5
5
|
name: string;
|
6
6
|
placeholder?: string;
|
7
7
|
defaultValue?: string;
|
8
8
|
autoFocus?: boolean;
|
9
|
+
autoComplete?: string;
|
9
10
|
type?: string;
|
10
11
|
width?: string;
|
11
12
|
marginBottom?: string;
|
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}";
|
@@ -309,7 +309,7 @@ function InputPassword({ id, placeholder = "", title = "Passwort", name, isVisib
|
|
309
309
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
310
310
|
React__default["default"].createElement("div", { className: `${styles$f.container} ${isVisible ? styles$f.visible : styles$f.hidden}`, style: { width: width } },
|
311
311
|
React__default["default"].createElement("div", { className: styles$f.form },
|
312
|
-
React__default["default"].createElement("input", { className: `${styles$f.input} ${title != undefined ? styles$f.with_title : styles$f.without_title} ${value.length > 0 ? styles$f.valid : styles$f.not_valid}`, name: name, minLength: minLength, autoComplete: autoComplete, placeholder: placeholder, type: hidePassword ? "password" : "text", onInput: (event) => setValue(event.target.value) }),
|
312
|
+
React__default["default"].createElement("input", { className: `${styles$f.input} ${title != undefined ? styles$f.with_title : styles$f.without_title} ${value.length > 0 ? styles$f.valid : styles$f.not_valid}`, name: name, id: id, minLength: minLength, autoComplete: autoComplete, placeholder: placeholder, type: hidePassword ? "password" : "text", onInput: (event) => setValue(event.target.value) }),
|
313
313
|
React__default["default"].createElement("label", { htmlFor: "text", className: styles$f.label },
|
314
314
|
React__default["default"].createElement("span", { className: styles$f.label_text }, title)),
|
315
315
|
React__default["default"].createElement("button", { title: hidePassword ? "Passwort anzeigen" : "Passwort verstecken", className: styles$f.hideButton, onClick: () => setHidePassword(!hidePassword), type: "button" },
|
@@ -401,7 +401,7 @@ var css_248z$d = ".styles-module_container__zcXGF {\n display: flex;\n width:
|
|
401
401
|
var styles$d = {"container":"styles-module_container__zcXGF","input":"styles-module_input__Tpth8","not_available":"styles-module_not_available__CRXjB","label":"styles-module_label__appHO","label_text":"styles-module_label_text__-sKjY","with_title":"styles-module_with_title__L3eGj","valid":"styles-module_valid__zWcOz"};
|
402
402
|
styleInject(css_248z$d);
|
403
403
|
|
404
|
-
function InputText({ id, title, name, placeholder = "", defaultValue = "", autoFocus = false, type = "text", width = "100%", marginBottom, available = true, onInput = (event) => { } }) {
|
404
|
+
function InputText({ id, title, name, placeholder = "", defaultValue = "", autoFocus = false, type = "text", width = "100%", marginBottom, autoComplete = "off", available = true, onInput = (event) => { } }) {
|
405
405
|
const [value, setValue] = React.useState(defaultValue);
|
406
406
|
const inputElement = React.useCallback((element) => {
|
407
407
|
if (element && autoFocus)
|
@@ -409,7 +409,7 @@ function InputText({ id, title, name, placeholder = "", defaultValue = "", autoF
|
|
409
409
|
}, [autoFocus]);
|
410
410
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
411
411
|
React__default["default"].createElement("div", { className: styles$d.container, style: { width, marginBottom } },
|
412
|
-
React__default["default"].createElement("input", { className: `${styles$d.input} ${title != undefined ? styles$d.with_title : styles$d.without_title} ${value.length > 0 || defaultValue.length > 0 ? styles$d.valid : styles$d.not_valid} ${available ? styles$d.available : styles$d.not_available}`, name: name, id: id, type: type, placeholder: placeholder, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
412
|
+
React__default["default"].createElement("input", { className: `${styles$d.input} ${title != undefined ? styles$d.with_title : styles$d.without_title} ${value.length > 0 || defaultValue.length > 0 ? styles$d.valid : styles$d.not_valid} ${available ? styles$d.available : styles$d.not_available}`, name: name, id: id, type: type, placeholder: placeholder, autoComplete: autoComplete, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
413
413
|
setValue(event.target.value);
|
414
414
|
if (onInput)
|
415
415
|
onInput(event);
|
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}";
|
@@ -301,7 +301,7 @@ function InputPassword({ id, placeholder = "", title = "Passwort", name, isVisib
|
|
301
301
|
return (React.createElement(React.Fragment, null,
|
302
302
|
React.createElement("div", { className: `${styles$f.container} ${isVisible ? styles$f.visible : styles$f.hidden}`, style: { width: width } },
|
303
303
|
React.createElement("div", { className: styles$f.form },
|
304
|
-
React.createElement("input", { className: `${styles$f.input} ${title != undefined ? styles$f.with_title : styles$f.without_title} ${value.length > 0 ? styles$f.valid : styles$f.not_valid}`, name: name, minLength: minLength, autoComplete: autoComplete, placeholder: placeholder, type: hidePassword ? "password" : "text", onInput: (event) => setValue(event.target.value) }),
|
304
|
+
React.createElement("input", { className: `${styles$f.input} ${title != undefined ? styles$f.with_title : styles$f.without_title} ${value.length > 0 ? styles$f.valid : styles$f.not_valid}`, name: name, id: id, minLength: minLength, autoComplete: autoComplete, placeholder: placeholder, type: hidePassword ? "password" : "text", onInput: (event) => setValue(event.target.value) }),
|
305
305
|
React.createElement("label", { htmlFor: "text", className: styles$f.label },
|
306
306
|
React.createElement("span", { className: styles$f.label_text }, title)),
|
307
307
|
React.createElement("button", { title: hidePassword ? "Passwort anzeigen" : "Passwort verstecken", className: styles$f.hideButton, onClick: () => setHidePassword(!hidePassword), type: "button" },
|
@@ -393,7 +393,7 @@ var css_248z$d = ".styles-module_container__zcXGF {\n display: flex;\n width:
|
|
393
393
|
var styles$d = {"container":"styles-module_container__zcXGF","input":"styles-module_input__Tpth8","not_available":"styles-module_not_available__CRXjB","label":"styles-module_label__appHO","label_text":"styles-module_label_text__-sKjY","with_title":"styles-module_with_title__L3eGj","valid":"styles-module_valid__zWcOz"};
|
394
394
|
styleInject(css_248z$d);
|
395
395
|
|
396
|
-
function InputText({ id, title, name, placeholder = "", defaultValue = "", autoFocus = false, type = "text", width = "100%", marginBottom, available = true, onInput = (event) => { } }) {
|
396
|
+
function InputText({ id, title, name, placeholder = "", defaultValue = "", autoFocus = false, type = "text", width = "100%", marginBottom, autoComplete = "off", available = true, onInput = (event) => { } }) {
|
397
397
|
const [value, setValue] = useState(defaultValue);
|
398
398
|
const inputElement = useCallback((element) => {
|
399
399
|
if (element && autoFocus)
|
@@ -401,7 +401,7 @@ function InputText({ id, title, name, placeholder = "", defaultValue = "", autoF
|
|
401
401
|
}, [autoFocus]);
|
402
402
|
return (React.createElement(React.Fragment, null,
|
403
403
|
React.createElement("div", { className: styles$d.container, style: { width, marginBottom } },
|
404
|
-
React.createElement("input", { className: `${styles$d.input} ${title != undefined ? styles$d.with_title : styles$d.without_title} ${value.length > 0 || defaultValue.length > 0 ? styles$d.valid : styles$d.not_valid} ${available ? styles$d.available : styles$d.not_available}`, name: name, id: id, type: type, placeholder: placeholder, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
404
|
+
React.createElement("input", { className: `${styles$d.input} ${title != undefined ? styles$d.with_title : styles$d.without_title} ${value.length > 0 || defaultValue.length > 0 ? styles$d.valid : styles$d.not_valid} ${available ? styles$d.available : styles$d.not_available}`, name: name, id: id, type: type, placeholder: placeholder, autoComplete: autoComplete, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
405
405
|
setValue(event.target.value);
|
406
406
|
if (onInput)
|
407
407
|
onInput(event);
|