Skip to content

Commit

Permalink
✨ [#2] Implement types for npFamilyMembers
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Nov 10, 2023
1 parent 17777fa commit 45845c0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/formio/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export * from './phonenumber';
export * from './postcode';
export * from './iban';
export * from './licenseplate';
export * from './npFamilyMembers';
export * from './number';
export * from './checkbox';
export * from './selectboxes';
Expand Down
27 changes: 27 additions & 0 deletions src/formio/components/npFamilyMembers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {InputComponentSchema, MultipleCapable} from '..';

type Validator = 'required';
type TranslatableKeys = 'label' | 'description' | 'tooltip';

export type NpFamilyMembersInputSchema = InputComponentSchema<
Record<string, boolean>,
Validator,
TranslatableKeys
>;

/**
* @group Form.io components
* @category Base types
*/
export interface BaseNpFamilyMembersComponentSchema
extends Omit<NpFamilyMembersInputSchema, 'hideLabel' | 'disabled'> {
type: 'npFamilyMembers';
includePartners: boolean;
includeChildren: boolean;
}

/**
* @group Form.io components
* @category Concrete types
*/
export type NpFamilyMembersComponentSchema = MultipleCapable<BaseNpFamilyMembersComponentSchema>;
2 changes: 2 additions & 0 deletions src/formio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
FileComponentSchema,
IbanComponentSchema,
LicensePlateComponentSchema,
NpFamilyMembersComponentSchema,
NumberComponentSchema,
PhoneNumberComponentSchema,
PostcodeComponentSchema,
Expand Down Expand Up @@ -58,6 +59,7 @@ export type AnyComponentSchema =
// special types
| IbanComponentSchema
| LicensePlateComponentSchema
| NpFamilyMembersComponentSchema
// layout
| ContentComponentSchema;

Expand Down

0 comments on commit 45845c0

Please sign in to comment.