Skip to content

Commit

Permalink
🚧 TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Feb 6, 2024
1 parent 610e66d commit b5d3381
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/formio/components/cosign.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {OFExtensions, StrictComponentSchema} from '..';
import {EmailInputSchema} from './email';
import {InputComponentSchema, OFExtensions, StrictComponentSchema} from '..';

type TranslatableKeys = 'label' | 'description';

Expand Down Expand Up @@ -43,7 +42,14 @@ export interface CosignV1ComponentSchema extends Omit<CosignV1InputSchema, KeysT
authPlugin: string; // plugin identifiers in the backend are dynamic
}

type V2KeysToOmit = 'hideLabel' | 'disabled' | 'placeholder';
type Validator = 'required';

export interface CosignData {
email: string;
bsn?: string;
}

export type CosignV2InputSchema = InputComponentSchema<CosignData, Validator, TranslatableKeys>;

/**
* The cosign component type, otherwise known as 'Cosign'.
Expand All @@ -57,9 +63,7 @@ type V2KeysToOmit = 'hideLabel' | 'disabled' | 'placeholder';
* @group Form.io components
* @category Concrete types
*/
export interface CosignV2ComponentSchema extends Omit<EmailInputSchema, V2KeysToOmit> {
export interface CosignV2ComponentSchema extends Omit<CosignV2InputSchema, 'hideLabel' | 'placeholder' | 'disabled' | 'validateOn'> {
type: 'cosign';
validateOn: 'blur';
defaultValue?: string; // no multiple support, so must always be a single string
autocomplete?: string;
checkBsn: boolean;
}
1 change: 1 addition & 0 deletions test-d/formio/components/cosign-v2.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ expectAssignable<CosignV2ComponentSchema>({
isSensitiveData: true,
defaultValue: '',
autocomplete: 'email',
checkBsn: false,
// advanced tab in builder form
conditional: {
show: undefined,
Expand Down

0 comments on commit b5d3381

Please sign in to comment.