@brilo/base-blocks 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/.tsbuildinfo +1 -1
- package/build/blocks/form/form-field/SelectOptionsRepeater.d.ts +10 -0
- package/build/blocks/form/form-field/SelectOptionsRepeater.d.ts.map +1 -0
- package/build/blocks/form/form-field/SelectOptionsRepeater.js +20 -0
- package/build/blocks/form/form-field/constants.d.ts +8 -0
- package/build/blocks/form/form-field/constants.d.ts.map +1 -1
- package/build/blocks/form/form-field/constants.js +5 -0
- package/build/blocks/form/form-field/edit.d.ts.map +1 -1
- package/build/blocks/form/form-field/edit.js +20 -11
- package/build/blocks/form/form-field/factory.d.ts.map +1 -1
- package/build/blocks/form/form-field/factory.js +1 -0
- package/build/blocks/form/form-field/normalizeOptions.d.ts +18 -0
- package/build/blocks/form/form-field/normalizeOptions.d.ts.map +1 -0
- package/build/blocks/form/form-field/normalizeOptions.js +39 -0
- package/build/blocks/form/form-field/types.d.ts +9 -2
- package/build/blocks/form/form-field/types.d.ts.map +1 -1
- package/build/blocks/signpost/signpost-group/constants.d.ts +1 -1
- package/build/blocks/signpost/signpost-group/constants.d.ts.map +1 -1
- package/build/blocks/signpost/signpost-group/constants.js +1 -1
- package/package.json +5 -2
- package/src/blocks/form/form-field/SelectOptionsRepeater.tsx +111 -0
- package/src/blocks/form/form-field/constants.ts +7 -0
- package/src/blocks/form/form-field/edit.tsx +42 -16
- package/src/blocks/form/form-field/editor.scss +28 -0
- package/src/blocks/form/form-field/factory.tsx +1 -0
- package/src/blocks/form/form-field/normalizeOptions.ts +58 -0
- package/src/blocks/form/form-field/types.ts +6 -2
- package/src/blocks/signpost/signpost-group/constants.ts +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {FIELD_TEXT_TYPES, FIELD_TEXT_TYPE_VALUES, FIELD_TYPE_VALUES} from './constants'
|
|
1
|
+
import {FIELD_SELECT_MODE_VALUES, FIELD_TEXT_TYPES, FIELD_TEXT_TYPE_VALUES, FIELD_TYPE_VALUES} from './constants'
|
|
2
2
|
import type {BriloBlockType} from '~/types'
|
|
3
3
|
|
|
4
4
|
export type FormFieldType = (typeof FIELD_TYPE_VALUES)[number]
|
|
5
5
|
export type FormFieldTextType = (typeof FIELD_TEXT_TYPE_VALUES)[number]
|
|
6
|
+
export type FormFieldSelectMode = (typeof FIELD_SELECT_MODE_VALUES)[number]
|
|
7
|
+
|
|
8
|
+
export type FormFieldOption = string | {label?: string; value?: string; email?: string}
|
|
6
9
|
|
|
7
10
|
export interface FormFieldAttributes extends Record<string, unknown> {
|
|
8
11
|
type: FormFieldType
|
|
@@ -12,7 +15,8 @@ export interface FormFieldAttributes extends Record<string, unknown> {
|
|
|
12
15
|
name: string
|
|
13
16
|
placeholder: string
|
|
14
17
|
required: boolean
|
|
15
|
-
options:
|
|
18
|
+
options: FormFieldOption[]
|
|
19
|
+
selectMode: FormFieldSelectMode
|
|
16
20
|
defaultValue: string
|
|
17
21
|
value: string
|
|
18
22
|
}
|