diff --git a/src/formio/components/cosign.ts b/src/formio/components/cosign.ts index f8917de..1a0c721 100644 --- a/src/formio/components/cosign.ts +++ b/src/formio/components/cosign.ts @@ -1,5 +1,4 @@ -import {OFExtensions, StrictComponentSchema} from '..'; -import {EmailInputSchema} from './email'; +import {InputComponentSchema, OFExtensions, StrictComponentSchema} from '..'; type TranslatableKeys = 'label' | 'description'; @@ -43,7 +42,20 @@ export interface CosignV1ComponentSchema extends Omit; /** * The cosign component type, otherwise known as 'Cosign'. @@ -57,9 +69,8 @@ type V2KeysToOmit = 'hideLabel' | 'disabled' | 'placeholder'; * @group Form.io components * @category Concrete types */ -export interface CosignV2ComponentSchema extends Omit { +export interface CosignV2ComponentSchema + extends Omit { type: 'cosign'; - validateOn: 'blur'; - defaultValue?: string; // no multiple support, so must always be a single string - autocomplete?: string; + checkBsn: boolean; } diff --git a/test-d/formio/components/cosign-v2.test-d.ts b/test-d/formio/components/cosign-v2.test-d.ts index b6b9427..6f39fbd 100644 --- a/test-d/formio/components/cosign-v2.test-d.ts +++ b/test-d/formio/components/cosign-v2.test-d.ts @@ -6,16 +6,15 @@ import {CosignV2ComponentSchema} from '../../../lib/'; expectAssignable({ id: 'yejak', type: 'cosign', - validateOn: 'blur', key: 'someCoSign', label: 'Some cosign', + checkBsn: true, }); // full, correct schema expectAssignable({ id: 'yejak', type: 'cosign', - validateOn: 'blur', // basic tab in builder form label: 'Some cosign', key: 'someCoSign', @@ -27,8 +26,11 @@ expectAssignable({ hidden: false, clearOnHide: true, isSensitiveData: true, - defaultValue: '', - autocomplete: 'email', + defaultValue: { + bsn: '', + email: '' + }, + checkBsn: false, // advanced tab in builder form conditional: { show: undefined, @@ -84,7 +86,6 @@ expectNotAssignable({ expectNotAssignable({ id: 'yejak', type: 'cosign' as const, - validateOn: 'blur' as const, key: 'someCoSign', label: 'Some cosign', multiple: true as boolean, @@ -92,7 +93,6 @@ expectNotAssignable({ expectNotAssignable({ id: 'yejak', type: 'cosign' as const, - validateOn: 'blur' as const, key: 'someCoSign', label: 'Some cosign', defaultValue: [], @@ -103,7 +103,6 @@ expectNotAssignable({ expectNotAssignable({ id: 'yejak', type: 'cosign' as const, - validateOn: 'blur' as const, key: 'someCoSign', label: 'Some cosign', confirmationRecipient: true,