Skip to content

Commit

Permalink
Merge pull request #30 from open-formulieren/feature/29-address
Browse files Browse the repository at this point in the history
[#29] Add `address` type
  • Loading branch information
sergei-maertens authored Nov 30, 2023
2 parents c90192c + 8079f19 commit 04040ff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/formio/components/address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {InputComponentSchema} from '..';

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

export interface AddressData {
postcode: string;
houseNumber: string;
houseLetter: string;
houseNumberAddition: string;
}

export type AddressInputSchema = InputComponentSchema<AddressData, Validator, TranslatableKeys>;

/**
* @group Form.io components
* @category Concrete types
*/
export interface AddressComponentSchema
extends Omit<AddressInputSchema, 'hideLabel' | 'placeholder' | 'disabled' | 'validateOn'> {
type: 'address';
}
1 change: 1 addition & 0 deletions src/formio/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export * from './checkbox';
export * from './selectboxes';
export * from './file';
export * from './radio';
export * from './address';

// Layout components
export * from './content';
2 changes: 2 additions & 0 deletions src/formio/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
AddressComponentSchema,
BsnComponentSchema,
CheckboxComponentSchema,
ContentComponentSchema,
Expand Down Expand Up @@ -66,6 +67,7 @@ export type AnyComponentSchema =
| LicensePlateComponentSchema
| BsnComponentSchema
| NpFamilyMembersComponentSchema
| AddressComponentSchema
// layout
| ContentComponentSchema;

Expand Down

0 comments on commit 04040ff

Please sign in to comment.