diff --git a/src/formio/components/checkbox.ts b/src/formio/components/checkbox.ts new file mode 100644 index 0000000..8f92dc7 --- /dev/null +++ b/src/formio/components/checkbox.ts @@ -0,0 +1,15 @@ +import {InputComponentSchema} from '..'; + +type Validator = 'required'; +type TranslatableKeys = 'label' | 'description' | 'tooltip'; + +export type CheckboxInputSchema = InputComponentSchema; + +/** + * @group Form.io components + * @category Concrete types + */ +export interface CheckboxComponentSchema + extends Omit { + type: 'checkbox'; +} diff --git a/src/formio/components/index.ts b/src/formio/components/index.ts index 54aa360..0b1ff52 100644 --- a/src/formio/components/index.ts +++ b/src/formio/components/index.ts @@ -1,4 +1,5 @@ // Input components +export * from './checkbox'; export * from './textfield'; export * from './email'; export * from './date'; @@ -6,6 +7,7 @@ export * from './datetime'; export * from './time'; export * from './phonenumber'; export * from './postcode'; +export * from './selectboxes'; export * from './number'; export * from './file'; diff --git a/src/formio/components/selectboxes.ts b/src/formio/components/selectboxes.ts new file mode 100644 index 0000000..0149295 --- /dev/null +++ b/src/formio/components/selectboxes.ts @@ -0,0 +1,18 @@ +import {InputComponentSchema} from '..'; + +type Validator = 'required'; +type TranslatableKeys = 'label' | 'description' | 'tooltip'; + +export type SelectboxesInputSchema = InputComponentSchema; + +/** + * @group Form.io components + * @category Concrete types + */ +export interface SelectboxesComponentSchema + extends Omit { + type: 'selectboxes'; + // OF custom properties + dataSrc: 'manual' | 'variable'; + itemsExpression?: string; +} diff --git a/src/formio/index.ts b/src/formio/index.ts index a7e6e6a..d7a814d 100644 --- a/src/formio/index.ts +++ b/src/formio/index.ts @@ -1,4 +1,5 @@ import { + CheckboxComponentSchema, ContentComponentSchema, DateComponentSchema, DateTimeComponentSchema, @@ -7,6 +8,7 @@ import { NumberComponentSchema, PhoneNumberComponentSchema, PostcodeComponentSchema, + SelectboxesComponentSchema, TextFieldComponentSchema, TimeComponentSchema, } from './components'; @@ -37,12 +39,14 @@ export * from './components'; export type AnyComponentSchema = // inputs | TextFieldComponentSchema + | CheckboxComponentSchema | EmailComponentSchema | DateComponentSchema | DateTimeComponentSchema | TimeComponentSchema | PhoneNumberComponentSchema | PostcodeComponentSchema + | SelectboxesComponentSchema | FileComponentSchema | NumberComponentSchema // layout