math-main-components 0.0.42 → 0.0.44
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.
- package/dist/components/AuthButton/AuthButton.d.ts +2 -2
- package/dist/components/CardButton/CardButton.d.ts +2 -2
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/OptionFieldHorizontal/OptionFieldHorizontal.d.ts +2 -2
- package/dist/components/RadioButtons/RadioButtons.d.ts +2 -2
- package/dist/components/SvgIcon/SvgIcon.types.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +3 -3
- package/dist/index.cjs.js +24 -22
- package/dist/index.esm.js +24 -22
- package/package.json +1 -1
@@ -1,9 +1,9 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { MouseEvent } from 'react';
|
2
2
|
export declare function AuthButton({ text, type, theme, iconName, isVisible, onClick }: {
|
3
3
|
text: string | undefined;
|
4
4
|
type?: 'submit' | 'reset' | 'button' | undefined;
|
5
5
|
theme?: 'primary' | 'secondary' | undefined;
|
6
6
|
iconName?: string;
|
7
7
|
isVisible?: boolean;
|
8
|
-
onClick?:
|
8
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
9
9
|
}): React.JSX.Element;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { MouseEvent } from 'react';
|
2
2
|
export declare function CardButton({ title, iconName, onClick, }: {
|
3
3
|
title: string;
|
4
4
|
iconName: string;
|
5
|
-
onClick?: (event:
|
5
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => {};
|
6
6
|
}): React.JSX.Element;
|
@@ -6,7 +6,7 @@ export interface DialogData {
|
|
6
6
|
export declare function Dialog({ data, text, onClose, onSubmit, children }: {
|
7
7
|
data?: DialogData;
|
8
8
|
text?: any;
|
9
|
-
onClose?: (event: React.
|
10
|
-
onSubmit?: (event: React.
|
9
|
+
onClose?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, data?: any | undefined) => void;
|
10
|
+
onSubmit?: (event: React.MouseEvent<HTMLButtonElement>, data?: any | undefined) => void;
|
11
11
|
children: any;
|
12
12
|
}): React.JSX.Element;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { MouseEvent } from 'react';
|
2
2
|
export declare function OptionFieldHorizontal({ title, iconName, onClick, preselected }: {
|
3
3
|
title: string;
|
4
4
|
iconName?: string;
|
5
|
-
onClick?: (event:
|
5
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
6
6
|
preselected?: boolean;
|
7
7
|
}): React.JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { MouseEvent } from 'react';
|
2
2
|
export declare class RadioOption {
|
3
3
|
text: string;
|
4
4
|
name: string;
|
@@ -8,6 +8,6 @@ export declare function RadioButtons({ options, group, selected, onClick, width
|
|
8
8
|
options: RadioOption[];
|
9
9
|
group: string;
|
10
10
|
selected?: string;
|
11
|
-
onClick?: (event:
|
11
|
+
onClick?: (event: MouseEvent<HTMLInputElement>) => void;
|
12
12
|
width?: string;
|
13
13
|
}): React.JSX.Element;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { MouseEvent } from "react";
|
2
2
|
export interface SvgIconProps {
|
3
3
|
iconName?: string;
|
4
4
|
size?: string;
|
5
5
|
fill?: string;
|
6
6
|
className?: string;
|
7
|
-
onClick?:
|
7
|
+
onClick?: (event: MouseEvent<HTMLSpanElement>) => void;
|
8
8
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { MouseEvent } from 'react';
|
2
2
|
export declare enum TableActionType {
|
3
3
|
red = 0,
|
4
4
|
default = 1
|
@@ -14,9 +14,9 @@ export declare class TableItem {
|
|
14
14
|
export declare class TableItemAction {
|
15
15
|
title: string;
|
16
16
|
iconName: string;
|
17
|
-
onClick: (event:
|
17
|
+
onClick: (event: MouseEvent<HTMLDivElement>, item: TableItem, index: number) => void;
|
18
18
|
type: TableActionType;
|
19
|
-
constructor(title: string, iconName: string, type: TableActionType, onClick?: (event:
|
19
|
+
constructor(title: string, iconName: string, type: TableActionType, onClick?: (event: MouseEvent<HTMLDivElement>, item: TableItem, index: number) => void);
|
20
20
|
}
|
21
21
|
export declare function Table({ items, title, actions, moreActions }: {
|
22
22
|
items: TableItem[];
|
package/dist/index.cjs.js
CHANGED
@@ -57,12 +57,11 @@ var css_248z$r = ".styles-module_container__4978M {\n max-width: 100%;\n width
|
|
57
57
|
var styles$r = {"container":"styles-module_container__4978M","visible":"styles-module_visible__uvQwq","hidden":"styles-module_hidden__Oruyx","rotate":"styles-module_rotate__mmYPQ","button":"styles-module_button__BWOOi","secondary":"styles-module_secondary__Eoik3"};
|
58
58
|
styleInject(css_248z$r);
|
59
59
|
|
60
|
-
function AuthButton({ text, type = "submit", theme = "primary", iconName = "arrow_forward", isVisible = true, onClick
|
61
|
-
return (React__default["default"].createElement(
|
62
|
-
React__default["default"].createElement("
|
63
|
-
|
64
|
-
|
65
|
-
React__default["default"].createElement(SvgIcon, { iconName: iconName })))));
|
60
|
+
function AuthButton({ text, type = "submit", theme = "primary", iconName = "arrow_forward", isVisible = true, onClick }) {
|
61
|
+
return (React__default["default"].createElement("div", { className: [styles$r.container, isVisible ? styles$r.visible : styles$r.hidden, ["arrow_forward"].includes(iconName) ? styles$r.rotate : null].join(" ") },
|
62
|
+
React__default["default"].createElement("button", { type: type, className: `${styles$r.button} ${styles$r[theme]}`, onClick: onClick },
|
63
|
+
text,
|
64
|
+
React__default["default"].createElement(SvgIcon, { iconName: iconName }))));
|
66
65
|
}
|
67
66
|
|
68
67
|
var css_248z$q = ".styles-module_card__bOd85 {\n background: #F4F4F4;\n border: 1px solid #B1B1B1;\n border-radius: 18px;\n transition: 0.2s ease;\n padding: 18px 14px;\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);\n cursor: pointer;\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n padding-top: 30px;\n}\n.styles-module_card__bOd85 span {\n color: grey;\n}\n.styles-module_card__bOd85:hover {\n transform: scale(1.01);\n box-shadow: none;\n background: none;\n}\n.styles-module_card__bOd85 h2 {\n margin-top: 0;\n color: grey;\n font-weight: 400;\n font-size: 18px;\n}";
|
@@ -135,11 +134,11 @@ var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
|
|
135
134
|
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
135
|
styleInject(css_248z$m);
|
137
136
|
|
138
|
-
function Dialog({ data, text, onClose
|
137
|
+
function Dialog({ data, text, onClose, onSubmit, children }) {
|
139
138
|
function onClick(event) {
|
140
|
-
if (event.
|
141
|
-
if (
|
142
|
-
onClose(event, data
|
139
|
+
if (event.currentTarget.id == 'dialog-backdrop' || event.currentTarget.id == 'cancel-button') {
|
140
|
+
if (onClose)
|
141
|
+
onClose(event, data?.data);
|
143
142
|
}
|
144
143
|
}
|
145
144
|
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
|
@@ -147,7 +146,7 @@ function Dialog({ data, text, onClose = (event, data) => { }, onSubmit = (event,
|
|
147
146
|
children,
|
148
147
|
text && React__default["default"].createElement("h1", null, text),
|
149
148
|
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"))));
|
149
|
+
React__default["default"].createElement("button", { className: styles$m.submit_button, id: "submit-button", onClick: (event) => onSubmit && onSubmit(event, data?.data) }, "Best\u00E4tigen"))));
|
151
150
|
}
|
152
151
|
|
153
152
|
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}";
|
@@ -198,7 +197,7 @@ function InputMail({ placeholder = "E-Mail-Adresse", title = "E-Mail-Adresse", n
|
|
198
197
|
const [value, setValue] = React.useState("");
|
199
198
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
200
199
|
React__default["default"].createElement("div", { className: styles$i.container, style: { width: width } },
|
201
|
-
React__default["default"].createElement("input", { className: `${styles$i.input} ${title != undefined ? styles$i.with_title : styles$i.without_title} ${value.length > 0 ? styles$i.valid : styles$i.not_valid} ${available ? styles$i.available : styles$i.not_available}`, name: name, placeholder: placeholder, type: "email", onInput: (event) => setValue(event.
|
200
|
+
React__default["default"].createElement("input", { className: `${styles$i.input} ${title != undefined ? styles$i.with_title : styles$i.without_title} ${value.length > 0 ? styles$i.valid : styles$i.not_valid} ${available ? styles$i.available : styles$i.not_available}`, name: name, placeholder: placeholder, type: "email", onInput: (event) => setValue(event.currentTarget.value) }),
|
202
201
|
React__default["default"].createElement("label", { htmlFor: "text", className: styles$i.label },
|
203
202
|
React__default["default"].createElement("span", { className: styles$i.label_text }, title)))));
|
204
203
|
}
|
@@ -211,12 +210,12 @@ function InputNames({ width = "100%", placeholder = { firstName: "", lastName: "
|
|
211
210
|
const [value1, setValue1] = React.useState(defaultValue.firstName ? defaultValue.firstName : "");
|
212
211
|
const [value2, setValue2] = React.useState(defaultValue.lastName ? defaultValue.lastName : "");
|
213
212
|
function onInput1(event) {
|
214
|
-
setValue1(event.
|
213
|
+
setValue1(event.currentTarget.value);
|
215
214
|
onInputFirstName(event);
|
216
215
|
onInput("firstName", event);
|
217
216
|
}
|
218
217
|
function onInput2(event) {
|
219
|
-
setValue2(event.
|
218
|
+
setValue2(event.currentTarget.value);
|
220
219
|
onInputLastName(event);
|
221
220
|
onInput("lastName", event);
|
222
221
|
}
|
@@ -244,7 +243,7 @@ function InputNumber({ title, name, placeholder = "", defaultValue = "", autoFoc
|
|
244
243
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
245
244
|
React__default["default"].createElement("div", { className: styles$g.container, style: { width } },
|
246
245
|
React__default["default"].createElement("input", { className: `${styles$g.input} ${title != undefined ? styles$g.with_title : styles$g.without_title} ${value.length > 0 || defaultValue.length > 0 ? styles$g.valid : styles$g.not_valid} ${available ? styles$g.available : styles$g.not_available}`, name: name, type: type, placeholder: placeholder, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
247
|
-
setValue(event.
|
246
|
+
setValue(event.currentTarget.value);
|
248
247
|
onInput(event);
|
249
248
|
} }),
|
250
249
|
React__default["default"].createElement("label", { htmlFor: "text", className: styles$g.label },
|
@@ -261,7 +260,7 @@ function InputPassword({ placeholder = "", title = "Passwort", name, isVisible =
|
|
261
260
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
262
261
|
React__default["default"].createElement("div", { className: `${styles$f.container} ${isVisible ? styles$f.visible : styles$f.hidden}`, style: { width: width } },
|
263
262
|
React__default["default"].createElement("div", { className: styles$f.form },
|
264
|
-
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.
|
263
|
+
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.currentTarget.value) }),
|
265
264
|
React__default["default"].createElement("label", { htmlFor: "text", className: styles$f.label },
|
266
265
|
React__default["default"].createElement("span", { className: styles$f.label_text }, title)),
|
267
266
|
React__default["default"].createElement("button", { title: hidePassword ? "Passwort anzeigen" : "Passwort verstecken", className: styles$f.hideButton, onClick: () => setHidePassword(!hidePassword), type: "button" },
|
@@ -280,7 +279,7 @@ function InputPin({ name, length, onFinished = () => { } }) {
|
|
280
279
|
fieldRefs.current = [...Array(length)].map((_, i) => fieldRefs.current[i] ?? React.createRef());
|
281
280
|
function onChange(event, position) {
|
282
281
|
const regex = /[0-9]+/;
|
283
|
-
const value = event.
|
282
|
+
const value = event.currentTarget.value ? event.currentTarget.value.replace(" ", "") : "";
|
284
283
|
if (value == '' || !regex.test(value))
|
285
284
|
return;
|
286
285
|
const digitCountBefore = state[position] == undefined ? 0 : String(state[position]).length;
|
@@ -350,7 +349,7 @@ function InputText({ title, name, placeholder = "", defaultValue = "", autoFocus
|
|
350
349
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
351
350
|
React__default["default"].createElement("div", { className: styles$d.container, style: { width, marginBottom } },
|
352
351
|
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, type: type, placeholder: placeholder, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
353
|
-
setValue(event.
|
352
|
+
setValue(event.currentTarget.value);
|
354
353
|
onInput(event);
|
355
354
|
} }),
|
356
355
|
React__default["default"].createElement("label", { htmlFor: "text", className: styles$d.label },
|
@@ -427,7 +426,7 @@ class RadioOption {
|
|
427
426
|
function RadioButtons({ options, group, selected, onClick, width = "100%" }) {
|
428
427
|
const [selectedOption, setSelected] = React.useState(selected);
|
429
428
|
function onUpdateSelected(event) {
|
430
|
-
setSelected(event.
|
429
|
+
setSelected(event.currentTarget.value);
|
431
430
|
if (onClick)
|
432
431
|
onClick(event);
|
433
432
|
}
|
@@ -505,17 +504,20 @@ function Searchbar({ placeholder, title = "Suchen", showNoResults = false, error
|
|
505
504
|
const [inputFocused, setFocused] = React.useState(false);
|
506
505
|
const [searchResults, setSearchResults] = React.useState(results);
|
507
506
|
function onInputChanged(event) {
|
508
|
-
|
507
|
+
event.preventDefault();
|
508
|
+
setValue(event.currentTarget.value);
|
509
509
|
updateSearch(event);
|
510
510
|
onInput(event);
|
511
511
|
}
|
512
512
|
function updateSearch(event) {
|
513
|
-
|
513
|
+
event.preventDefault();
|
514
|
+
const value = event.currentTarget.value;
|
515
|
+
if (value == '' || value == undefined || value == null) {
|
514
516
|
setSearchResults(results);
|
515
517
|
}
|
516
518
|
else {
|
517
519
|
setSearchResults(results.filter((result) => {
|
518
|
-
return result.title.includes(event.
|
520
|
+
return result.title.includes(event.currentTarget.value);
|
519
521
|
}));
|
520
522
|
}
|
521
523
|
}
|
package/dist/index.esm.js
CHANGED
@@ -49,12 +49,11 @@ var css_248z$r = ".styles-module_container__4978M {\n max-width: 100%;\n width
|
|
49
49
|
var styles$r = {"container":"styles-module_container__4978M","visible":"styles-module_visible__uvQwq","hidden":"styles-module_hidden__Oruyx","rotate":"styles-module_rotate__mmYPQ","button":"styles-module_button__BWOOi","secondary":"styles-module_secondary__Eoik3"};
|
50
50
|
styleInject(css_248z$r);
|
51
51
|
|
52
|
-
function AuthButton({ text, type = "submit", theme = "primary", iconName = "arrow_forward", isVisible = true, onClick
|
53
|
-
return (React.createElement(
|
54
|
-
React.createElement("
|
55
|
-
|
56
|
-
|
57
|
-
React.createElement(SvgIcon, { iconName: iconName })))));
|
52
|
+
function AuthButton({ text, type = "submit", theme = "primary", iconName = "arrow_forward", isVisible = true, onClick }) {
|
53
|
+
return (React.createElement("div", { className: [styles$r.container, isVisible ? styles$r.visible : styles$r.hidden, ["arrow_forward"].includes(iconName) ? styles$r.rotate : null].join(" ") },
|
54
|
+
React.createElement("button", { type: type, className: `${styles$r.button} ${styles$r[theme]}`, onClick: onClick },
|
55
|
+
text,
|
56
|
+
React.createElement(SvgIcon, { iconName: iconName }))));
|
58
57
|
}
|
59
58
|
|
60
59
|
var css_248z$q = ".styles-module_card__bOd85 {\n background: #F4F4F4;\n border: 1px solid #B1B1B1;\n border-radius: 18px;\n transition: 0.2s ease;\n padding: 18px 14px;\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);\n cursor: pointer;\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n padding-top: 30px;\n}\n.styles-module_card__bOd85 span {\n color: grey;\n}\n.styles-module_card__bOd85:hover {\n transform: scale(1.01);\n box-shadow: none;\n background: none;\n}\n.styles-module_card__bOd85 h2 {\n margin-top: 0;\n color: grey;\n font-weight: 400;\n font-size: 18px;\n}";
|
@@ -127,11 +126,11 @@ var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
|
|
127
126
|
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
127
|
styleInject(css_248z$m);
|
129
128
|
|
130
|
-
function Dialog({ data, text, onClose
|
129
|
+
function Dialog({ data, text, onClose, onSubmit, children }) {
|
131
130
|
function onClick(event) {
|
132
|
-
if (event.
|
133
|
-
if (
|
134
|
-
onClose(event, data
|
131
|
+
if (event.currentTarget.id == 'dialog-backdrop' || event.currentTarget.id == 'cancel-button') {
|
132
|
+
if (onClose)
|
133
|
+
onClose(event, data?.data);
|
135
134
|
}
|
136
135
|
}
|
137
136
|
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
|
@@ -139,7 +138,7 @@ function Dialog({ data, text, onClose = (event, data) => { }, onSubmit = (event,
|
|
139
138
|
children,
|
140
139
|
text && React.createElement("h1", null, text),
|
141
140
|
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"))));
|
141
|
+
React.createElement("button", { className: styles$m.submit_button, id: "submit-button", onClick: (event) => onSubmit && onSubmit(event, data?.data) }, "Best\u00E4tigen"))));
|
143
142
|
}
|
144
143
|
|
145
144
|
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}";
|
@@ -190,7 +189,7 @@ function InputMail({ placeholder = "E-Mail-Adresse", title = "E-Mail-Adresse", n
|
|
190
189
|
const [value, setValue] = useState("");
|
191
190
|
return (React.createElement(React.Fragment, null,
|
192
191
|
React.createElement("div", { className: styles$i.container, style: { width: width } },
|
193
|
-
React.createElement("input", { className: `${styles$i.input} ${title != undefined ? styles$i.with_title : styles$i.without_title} ${value.length > 0 ? styles$i.valid : styles$i.not_valid} ${available ? styles$i.available : styles$i.not_available}`, name: name, placeholder: placeholder, type: "email", onInput: (event) => setValue(event.
|
192
|
+
React.createElement("input", { className: `${styles$i.input} ${title != undefined ? styles$i.with_title : styles$i.without_title} ${value.length > 0 ? styles$i.valid : styles$i.not_valid} ${available ? styles$i.available : styles$i.not_available}`, name: name, placeholder: placeholder, type: "email", onInput: (event) => setValue(event.currentTarget.value) }),
|
194
193
|
React.createElement("label", { htmlFor: "text", className: styles$i.label },
|
195
194
|
React.createElement("span", { className: styles$i.label_text }, title)))));
|
196
195
|
}
|
@@ -203,12 +202,12 @@ function InputNames({ width = "100%", placeholder = { firstName: "", lastName: "
|
|
203
202
|
const [value1, setValue1] = useState(defaultValue.firstName ? defaultValue.firstName : "");
|
204
203
|
const [value2, setValue2] = useState(defaultValue.lastName ? defaultValue.lastName : "");
|
205
204
|
function onInput1(event) {
|
206
|
-
setValue1(event.
|
205
|
+
setValue1(event.currentTarget.value);
|
207
206
|
onInputFirstName(event);
|
208
207
|
onInput("firstName", event);
|
209
208
|
}
|
210
209
|
function onInput2(event) {
|
211
|
-
setValue2(event.
|
210
|
+
setValue2(event.currentTarget.value);
|
212
211
|
onInputLastName(event);
|
213
212
|
onInput("lastName", event);
|
214
213
|
}
|
@@ -236,7 +235,7 @@ function InputNumber({ title, name, placeholder = "", defaultValue = "", autoFoc
|
|
236
235
|
return (React.createElement(React.Fragment, null,
|
237
236
|
React.createElement("div", { className: styles$g.container, style: { width } },
|
238
237
|
React.createElement("input", { className: `${styles$g.input} ${title != undefined ? styles$g.with_title : styles$g.without_title} ${value.length > 0 || defaultValue.length > 0 ? styles$g.valid : styles$g.not_valid} ${available ? styles$g.available : styles$g.not_available}`, name: name, type: type, placeholder: placeholder, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
239
|
-
setValue(event.
|
238
|
+
setValue(event.currentTarget.value);
|
240
239
|
onInput(event);
|
241
240
|
} }),
|
242
241
|
React.createElement("label", { htmlFor: "text", className: styles$g.label },
|
@@ -253,7 +252,7 @@ function InputPassword({ placeholder = "", title = "Passwort", name, isVisible =
|
|
253
252
|
return (React.createElement(React.Fragment, null,
|
254
253
|
React.createElement("div", { className: `${styles$f.container} ${isVisible ? styles$f.visible : styles$f.hidden}`, style: { width: width } },
|
255
254
|
React.createElement("div", { className: styles$f.form },
|
256
|
-
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.
|
255
|
+
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.currentTarget.value) }),
|
257
256
|
React.createElement("label", { htmlFor: "text", className: styles$f.label },
|
258
257
|
React.createElement("span", { className: styles$f.label_text }, title)),
|
259
258
|
React.createElement("button", { title: hidePassword ? "Passwort anzeigen" : "Passwort verstecken", className: styles$f.hideButton, onClick: () => setHidePassword(!hidePassword), type: "button" },
|
@@ -272,7 +271,7 @@ function InputPin({ name, length, onFinished = () => { } }) {
|
|
272
271
|
fieldRefs.current = [...Array(length)].map((_, i) => fieldRefs.current[i] ?? createRef());
|
273
272
|
function onChange(event, position) {
|
274
273
|
const regex = /[0-9]+/;
|
275
|
-
const value = event.
|
274
|
+
const value = event.currentTarget.value ? event.currentTarget.value.replace(" ", "") : "";
|
276
275
|
if (value == '' || !regex.test(value))
|
277
276
|
return;
|
278
277
|
const digitCountBefore = state[position] == undefined ? 0 : String(state[position]).length;
|
@@ -342,7 +341,7 @@ function InputText({ title, name, placeholder = "", defaultValue = "", autoFocus
|
|
342
341
|
return (React.createElement(React.Fragment, null,
|
343
342
|
React.createElement("div", { className: styles$d.container, style: { width, marginBottom } },
|
344
343
|
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, type: type, placeholder: placeholder, ref: inputElement, defaultValue: defaultValue, onInput: (event) => {
|
345
|
-
setValue(event.
|
344
|
+
setValue(event.currentTarget.value);
|
346
345
|
onInput(event);
|
347
346
|
} }),
|
348
347
|
React.createElement("label", { htmlFor: "text", className: styles$d.label },
|
@@ -419,7 +418,7 @@ class RadioOption {
|
|
419
418
|
function RadioButtons({ options, group, selected, onClick, width = "100%" }) {
|
420
419
|
const [selectedOption, setSelected] = useState(selected);
|
421
420
|
function onUpdateSelected(event) {
|
422
|
-
setSelected(event.
|
421
|
+
setSelected(event.currentTarget.value);
|
423
422
|
if (onClick)
|
424
423
|
onClick(event);
|
425
424
|
}
|
@@ -497,17 +496,20 @@ function Searchbar({ placeholder, title = "Suchen", showNoResults = false, error
|
|
497
496
|
const [inputFocused, setFocused] = useState(false);
|
498
497
|
const [searchResults, setSearchResults] = useState(results);
|
499
498
|
function onInputChanged(event) {
|
500
|
-
|
499
|
+
event.preventDefault();
|
500
|
+
setValue(event.currentTarget.value);
|
501
501
|
updateSearch(event);
|
502
502
|
onInput(event);
|
503
503
|
}
|
504
504
|
function updateSearch(event) {
|
505
|
-
|
505
|
+
event.preventDefault();
|
506
|
+
const value = event.currentTarget.value;
|
507
|
+
if (value == '' || value == undefined || value == null) {
|
506
508
|
setSearchResults(results);
|
507
509
|
}
|
508
510
|
else {
|
509
511
|
setSearchResults(results.filter((result) => {
|
510
|
-
return result.title.includes(event.
|
512
|
+
return result.title.includes(event.currentTarget.value);
|
511
513
|
}));
|
512
514
|
}
|
513
515
|
}
|