-
-
+
+
+
+
+
+
-
+
+ select {
+ @apply h-full pl-3 pr-3 border-1 w-2/5 rounded;
+ @apply hover:border-sspsBlue rounded-lg border border-2 bg-[#f8fafb] p-3 text-xl shadow-lg outline-none transition-colors duration-300;
+ }
+ .inputWrapper {
+ @apply w-full relative;
+ }
+ .inputWrapper span {
+ @apply absolute right-0 top-1 bottom-0 my-auto flex bg-transparent p-3;
+ }
+ .wrapper :global(.basic-tel-input) {
+ /* height: 32px;
+ padding-left: 12px;
+ padding-right: 12px;
+ border-radius: 6px;
+ border: 1px solid;
+ outline: none;
+ width: 100%; */
+ /* @apply h-full pl-3 pr-3 border-1 w-full rounded; */
+ @apply hover:border-sspsBlue w-full rounded-lg border border-2 bg-[#f8fafb] p-3 text-xl shadow-lg outline-none transition-colors duration-300;
+ }
+
+ .wrapper :global(.invalid) {
+ /* border-color: red; */
+ @apply border-red-700;
+ }
+
\ No newline at end of file
diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
index 7e0382d..af56e7b 100644
--- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
+++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
@@ -18,7 +18,7 @@
import { SvelteToast, toast } from '@zerodevx/svelte-toast';
import { createForm } from 'svelte-forms-lib';
- import type { Writable } from 'svelte/store';
+ import { writable, type Writable } from 'svelte/store';
import * as yup from 'yup';
import type { CandidateData } from '$lib/stores/candidate';
import AccountLinkCheckBox from '$lib/components/checkbox/AccountLinkCheckBox.svelte';
@@ -46,7 +46,19 @@
export let data: PageData;
let details = data.candidate;
let baseCandidateDetails = data.whoami;
-
+ let componentErrors = writable( {
+ candidate: {
+ telephone: false,
+ },
+ parents: [
+ {
+ telephone: false,
+ },
+ {
+ telephone: false,
+ }
+ ]
+ });
let personalIdBirthdateMatch = true;
const formInitialValues = {
gdpr: false,
@@ -106,8 +118,7 @@
email: yup.string().email().required(),
telephone: yup
.string()
- .required()
- .matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/),
+ .required(), // already validated by the 'TelephoneField' component
birthplace: yup.string().required(),
birthdate: yup
.string()
@@ -286,7 +297,7 @@
onSubmit: async (values: CandidateData) => onSubmit(values)
});
-
+ $: console.log($componentErrors['candidate']['telephone'])
const isPageInvalid = (index: number): boolean => {
switch (index) {
case 0:
@@ -311,7 +322,8 @@
$typedErrors['candidate']['name'] ||
$typedErrors['candidate']['surname'] ||
$typedErrors['candidate']['email'] ||
- $typedErrors['candidate']['telephone'] ||
+ // $typedErrors['candidate']['telephone'] ||
+ $componentErrors['candidate']['telephone'] ||
$typedErrors['candidate']['city'] ||
$typedErrors['candidate']['street'] ||
$typedErrors['candidate']['houseNumber'] ||
@@ -341,7 +353,8 @@
$typedErrors['parents'][0]['name'] ||
$typedErrors['parents'][0]['surname'] ||
$typedErrors['parents'][0]['email'] ||
- $typedErrors['parents'][0]['telephone']
+ // $typedErrors['parents'][0]['telephone']
+ $componentErrors['parents'][0]['telephone']
) {
return true;
}
@@ -351,7 +364,8 @@
$typedErrors['parents'][1]['name'] ||
$typedErrors['parents'][1]['surname'] ||
$typedErrors['parents'][1]['email'] ||
- $typedErrors['parents'][1]['telephone']
+ // $typedErrors['parents'][1]['telephone']
+ $componentErrors['parents'][1]['telephone']
) {
return true;
}
@@ -511,6 +525,14 @@
/>
+
+
+
+
@@ -675,7 +691,7 @@
@@ -704,7 +720,7 @@