Compare commits
2 Commits
00facf8758
...
30d56ce778
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30d56ce778 | ||
|
|
3ec32756c8 |
@@ -17,6 +17,12 @@
|
|||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
export let label = "";
|
export let label = "";
|
||||||
|
|
||||||
|
/** @type {string} */
|
||||||
|
export let otherPasswordValue = "";
|
||||||
|
|
||||||
|
/** @type {boolean} */
|
||||||
|
export let toUpperCase = false;
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,7 +32,11 @@
|
|||||||
const target = event.target;
|
const target = event.target;
|
||||||
|
|
||||||
if (target instanceof HTMLInputElement) {
|
if (target instanceof HTMLInputElement) {
|
||||||
const inputValue = target.value;
|
let inputValue = target.value;
|
||||||
|
if (toUpperCase) {
|
||||||
|
inputValue = inputValue.toUpperCase();
|
||||||
|
target.value = inputValue; // Update the input field value
|
||||||
|
}
|
||||||
value = inputValue;
|
value = inputValue;
|
||||||
// dispatch("input", { name, value: inputValue });
|
// dispatch("input", { name, value: inputValue });
|
||||||
}
|
}
|
||||||
@@ -42,16 +52,40 @@
|
|||||||
switch (name) {
|
switch (name) {
|
||||||
case "first_name":
|
case "first_name":
|
||||||
case "last_name":
|
case "last_name":
|
||||||
|
case "address":
|
||||||
|
case "city":
|
||||||
|
case "account_holder_name":
|
||||||
|
case "bank":
|
||||||
return value.trim() ? null : $t("required");
|
return value.trim() ? null : $t("required");
|
||||||
|
case "birth_date":
|
||||||
|
case "membership_start_date":
|
||||||
|
return value.trim() ? null : $t("required_date");
|
||||||
case "email":
|
case "email":
|
||||||
return /^\S+@\S+\.\S+$/.test(value) ? null : $t("invalid_email");
|
return /^\S+@\S+\.\S+$/.test(value) ? null : $t("invalid_email");
|
||||||
case "password":
|
case "password":
|
||||||
return !value.trim() || value.length >= 8
|
case "password2":
|
||||||
|
if (!value.trim()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (value.length < 8) {
|
||||||
|
return $t("required_password");
|
||||||
|
}
|
||||||
|
if (otherPasswordValue && value !== otherPasswordValue) {
|
||||||
|
return $t("required_password_match");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
case "phone":
|
||||||
|
return /^\+?[0-9\s()-]{7,}$/.test(value) ? null : $t("invalid_phone");
|
||||||
|
case "zip_code":
|
||||||
|
return /^\d{5}$/.test(value) ? null : $t("invalid_zip_code");
|
||||||
|
case "iban":
|
||||||
|
return /^[A-Z]{2}\d{2}[A-Z0-9]{1,30}$/.test(value)
|
||||||
? null
|
? null
|
||||||
: $t("required_password");
|
: $t("invalid_iban");
|
||||||
// case "password2":
|
case "bic":
|
||||||
// // Note: This case might need special handling as it depends on another field
|
return /^[A-Z]{6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3})?$/.test(value)
|
||||||
// return $t("required_password_match");
|
? null
|
||||||
|
: $t("invalid_bic");
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,21 +30,39 @@ export default {
|
|||||||
profile: "Profil",
|
profile: "Profil",
|
||||||
membership: "Mitgliedschaft",
|
membership: "Mitgliedschaft",
|
||||||
bankaccount: "Kontodaten",
|
bankaccount: "Kontodaten",
|
||||||
|
first_name: "Vorname",
|
||||||
|
last_name: "Nachname",
|
||||||
|
phone: "Telefonnummer",
|
||||||
|
birth_date: "Geburtstag",
|
||||||
|
placeholder_first_name: "Vornamen eingeben...",
|
||||||
|
placeholder_last_name: "Nachnamen eingeben...",
|
||||||
|
invalid_email: "Ungültige Emailadresse",
|
||||||
|
placeholder_phone: "Telefonnummer eingeben...",
|
||||||
|
placeholder_address: "Straße und Hausnummer eingeben...",
|
||||||
|
placeholder_zip_code: "Postleitzahl eingeben...",
|
||||||
|
placeholder_city: "Wohnort eingeben...",
|
||||||
|
placeholder_bank_name: "Namen der Bank eingeben...",
|
||||||
status: "Status",
|
status: "Status",
|
||||||
start: "Beginn",
|
start: "Beginn",
|
||||||
end: "Ende",
|
end: "Ende",
|
||||||
parent_member_id: "Hauptmitgliedsnr.",
|
parent_member_id: "Hauptmitgliedsnr.",
|
||||||
placeholder_parent_member_id: "Mitgliedsnr des Hauptmitglieds eingeben...",
|
placeholder_parent_member_id: "Mitgliedsnr des Hauptmitglieds eingeben...",
|
||||||
bank_account_holder: "Kontoinhaber",
|
bank_account_holder: "Kontoinhaber",
|
||||||
bank_name: "Name der Bank",
|
bank_name: "Bank",
|
||||||
iban: "IBAN",
|
iban: "IBAN",
|
||||||
bic: "BIC",
|
bic: "BIC",
|
||||||
mandate_reference: "SEPA Mandat",
|
mandate_reference: "SEPA Mandat",
|
||||||
placeholder_bank_account_holder: "Namen eingeben...",
|
placeholder_bank_account_holder: "Namen eingeben...",
|
||||||
placeholder_iban: "IBAN eingeben..",
|
placeholder_iban: "IBAN eingeben..",
|
||||||
placeholder_bic: "BIC eingeben(optional)...",
|
placeholder_bic: "BIC eingeben(Bei nicht deutschen Konten)...",
|
||||||
placeholder_mandate_reference: "SEPA Mandatsreferenz eingeben..",
|
placeholder_mandate_reference: "SEPA Mandatsreferenz eingeben..",
|
||||||
required: "Eingabe benötigt",
|
required: "Eingabe benötigt",
|
||||||
required_password: "Password zu kurz, mindestens 8 Zeichen",
|
required_password: "Password zu kurz, mindestens 8 Zeichen",
|
||||||
required_password_match: "Passwörter stimmen nicht überein!",
|
required_password_match: "Passwörter stimmen nicht überein!",
|
||||||
|
invalid_phone: "Ungültiges Format(+491738762387 oder 0173850698)",
|
||||||
|
invalid_zip_code:
|
||||||
|
"Ungültige Postleitzahl(Nur deutsche Wohnorte sind zulässig)",
|
||||||
|
invalid_bic: "Ungültige BIC",
|
||||||
|
invalid_iban: "Ungültige IBAN",
|
||||||
|
required_date: "Bitte geben Sie ein Datum ein",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user