@defra/forms-model 3.0.459 → 3.0.461
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/dist/module/conditions/migration.js +97 -0
- package/dist/module/conditions/migration.js.map +1 -0
- package/dist/module/conditions/types.js.map +1 -1
- package/dist/module/form/form-definition/index.js.map +1 -1
- package/dist/module/form/form-definition/types.js.map +1 -1
- package/dist/module/form/form-editor/index.js +3 -0
- package/dist/module/form/form-editor/index.js.map +1 -1
- package/dist/module/form/form-editor/types.js.map +1 -1
- package/dist/types/conditions/migration.d.ts +8 -0
- package/dist/types/conditions/migration.d.ts.map +1 -0
- package/dist/types/conditions/types.d.ts +6 -6
- package/dist/types/conditions/types.d.ts.map +1 -1
- package/dist/types/form/form-definition/index.d.ts +2 -2
- package/dist/types/form/form-definition/index.d.ts.map +1 -1
- package/dist/types/form/form-definition/types.d.ts +4 -4
- package/dist/types/form/form-definition/types.d.ts.map +1 -1
- package/dist/types/form/form-editor/index.d.ts +1 -0
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/types.d.ts +13 -0
- package/dist/types/form/form-editor/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/conditions/migration.ts +176 -0
- package/src/conditions/types.ts +7 -7
- package/src/form/form-definition/index.ts +14 -14
- package/src/form/form-definition/types.ts +4 -4
- package/src/form/form-editor/index.ts +3 -0
- package/src/form/form-editor/types.ts +14 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioText?: string\n\n /**\n * The hint of the radio item\n */\n radioHint?: string\n\n /**\n * The value of the radio item\n */\n radioValue?: string\n\n /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: string | boolean\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: string | boolean\n label?: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: string | boolean\n readonly label?: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: string | boolean\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioText?: string\n\n /**\n * The hint of the radio item\n */\n radioHint?: string\n\n /**\n * The value of the radio item\n */\n radioValue?: string\n\n /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: string | boolean\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: string | boolean\n label?: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: string | boolean\n readonly label?: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: string | boolean\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n\nexport type AdvancedFieldMappingsType = Record<\n ComponentType,\n Record<string, string>\n>\n\nexport type HTMLElementOrNull = HTMLElement | null\n\nexport type HTMLInputElementOrNull = HTMLInputElement | null\n\nexport interface ErrorPreviewFieldMappingDef {\n min?: { fieldName: string; placeholder: string }\n max?: { fieldName: string; placeholder: string }\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { type ComponentDef } from '../components/types.js';
|
2
|
+
import { type ConditionWrapper, type ConditionWrapperV2, type List } from '../form/form-definition/types.js';
|
3
|
+
export declare function convertConditionWrapperFromV2(conditionWrapper: ConditionWrapperV2, model: RuntimeFormModel): ConditionWrapper;
|
4
|
+
export interface RuntimeFormModel {
|
5
|
+
getListById: (listId: string) => List | undefined;
|
6
|
+
getComponentById: (componentId: string) => ComponentDef | undefined;
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=migration.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/conditions/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,2BAA2B,CAAA;AAYlC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACV,MAAM,qCAAqC,CAAA;AAmH5C,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,kBAAkB,EACpC,KAAK,EAAE,gBAAgB,GACtB,gBAAgB,CAiClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAAA;IACjD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAA;CACpE"}
|
@@ -6,11 +6,11 @@ export interface ConditionValueData {
|
|
6
6
|
value: string;
|
7
7
|
display: string;
|
8
8
|
}
|
9
|
-
export interface
|
9
|
+
export interface ConditionStringValueDataV2 {
|
10
10
|
type: ConditionType.StringValue;
|
11
11
|
value: string;
|
12
12
|
}
|
13
|
-
export interface
|
13
|
+
export interface ConditionListItemRefValueDataV2 {
|
14
14
|
type: ConditionType.ListItemRef;
|
15
15
|
listId: string;
|
16
16
|
itemId: string;
|
@@ -32,25 +32,25 @@ export interface ConditionData {
|
|
32
32
|
value: ConditionValueData | RelativeDateValueData;
|
33
33
|
coordinator?: Coordinator;
|
34
34
|
}
|
35
|
-
export interface
|
35
|
+
export interface ConditionDataV2 {
|
36
36
|
id: string;
|
37
37
|
componentId: string;
|
38
38
|
operator: OperatorName;
|
39
|
-
value:
|
39
|
+
value: ConditionListItemRefValueDataV2 | ConditionStringValueDataV2 | RelativeDateValueData;
|
40
40
|
}
|
41
41
|
export interface ConditionRefData {
|
42
42
|
conditionName: string;
|
43
43
|
conditionDisplayName: string;
|
44
44
|
coordinator?: Coordinator;
|
45
45
|
}
|
46
|
-
export interface
|
46
|
+
export interface ConditionRefDataV2 {
|
47
47
|
id: string;
|
48
48
|
conditionId: string;
|
49
49
|
}
|
50
50
|
export interface ConditionGroupData {
|
51
51
|
conditions: (ConditionData | ConditionRefData | ConditionGroupData)[];
|
52
52
|
}
|
53
|
-
export type
|
53
|
+
export type ConditionGroupDataV2 = (ConditionDataV2 | ConditionRefDataV2)[];
|
54
54
|
export interface ConditionsModelData extends ConditionGroupData {
|
55
55
|
name: string;
|
56
56
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conditions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAA;AAElC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC,KAAK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,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EACD,+BAA+B,GAC/B,0BAA0B,GAC1B,qBAAqB,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,CAAC,aAAa,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,EAAE,CAAA;CACtE;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,eAAe,GAAG,kBAAkB,CAAC,EAAE,CAAA;AAE3E,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,CACV,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,EAC9C,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,KAC/B,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAA"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import Joi from 'joi';
|
2
2
|
import { type ComponentDef } from '../../components/types.js';
|
3
|
-
import { type
|
4
|
-
export declare const conditionWrapperSchemaV2: Joi.ObjectSchema<
|
3
|
+
import { type ConditionWrapperV2, type FormDefinition, type List, type Page, type Repeat } from '../../form/form-definition/types.js';
|
4
|
+
export declare const conditionWrapperSchemaV2: Joi.ObjectSchema<ConditionWrapperV2>;
|
5
5
|
export declare const componentSchema: Joi.ObjectSchema<ComponentDef>;
|
6
6
|
export declare const componentSchemaV2: Joi.ObjectSchema<ComponentDef>;
|
7
7
|
export declare const pageRepeatSchema: Joi.ObjectSchema<Repeat>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAA8B,MAAM,KAAK,CAAA;AAIhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAe7D,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAA8B,MAAM,KAAK,CAAA;AAIhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAe7D,OAAO,EAEL,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAET,KAAK,MAAM,EAIZ,MAAM,qCAAqC,CAAA;AA0R5C,eAAO,MAAM,wBAAwB,sCAoBU,CAAA;AAE/C,eAAO,MAAM,eAAe,gCAkGZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAUiB,CAAA;AAoD/C,eAAO,MAAM,gBAAgB,0BASzB,CAAA;AAyCJ;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAmDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAqBiB,CAAA;AAwD1C,eAAO,MAAM,UAAU,wBAkCnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAIiB,CAAA;AAsD1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kCAiE7B,CAAA;AAEJ,eAAO,MAAM,sBAAsB,kCAoBY,CAAA;AAI/C,eAAO,MAAM,MAAM,kCAAuB,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type ComponentDef } from '../../components/types.js';
|
2
2
|
import { type Coordinator } from '../../conditions/enums.js';
|
3
|
-
import { type
|
3
|
+
import { type ConditionGroupDataV2, type ConditionsModelData } from '../../conditions/types.js';
|
4
4
|
import { type ControllerPath, type ControllerType } from '../../pages/enums.js';
|
5
5
|
export declare enum Engine {
|
6
6
|
V1 = "V1",
|
@@ -129,11 +129,11 @@ export interface ConditionWrapper {
|
|
129
129
|
displayName: string;
|
130
130
|
value: ConditionsModelData;
|
131
131
|
}
|
132
|
-
export interface
|
132
|
+
export interface ConditionWrapperV2 {
|
133
133
|
name: string;
|
134
134
|
displayName: string;
|
135
135
|
coordinator?: Coordinator;
|
136
|
-
conditions:
|
136
|
+
conditions: ConditionGroupDataV2;
|
137
137
|
}
|
138
138
|
/**
|
139
139
|
* Interface for `formDefinitionSchema` Joi schema
|
@@ -141,7 +141,7 @@ export interface Condition2Wrapper {
|
|
141
141
|
export interface FormDefinition {
|
142
142
|
engine?: Engine;
|
143
143
|
pages: Page[];
|
144
|
-
conditions: (ConditionWrapper |
|
144
|
+
conditions: (ConditionWrapper | ConditionWrapperV2)[];
|
145
145
|
lists: List[];
|
146
146
|
sections: Section[];
|
147
147
|
startPage?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EACL,KAAK,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,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;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,mBAAmB,CAAA;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,EAAE,oBAAoB,CAAA;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,UAAU,EAAE,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,EAAE,CAAA;IACrD,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;QAC7B,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"}
|
@@ -148,5 +148,6 @@ export declare const formEditorInputPageSettingsKeys: {
|
|
148
148
|
export declare const formEditorInputPageSettingsSchema: Joi.ObjectSchema<FormEditorInputPageSettings>;
|
149
149
|
export declare function govukFieldValueIsString(govukField: GovukField): govukField is GovukStringField;
|
150
150
|
export declare function govukFieldIsQuestionOptional(govukField: GovukField): govukField is GovukFieldQuestionOptional;
|
151
|
+
export declare const allowedErrorTemplateFunctions: string[];
|
151
152
|
export {};
|
152
153
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,KAAK,WAAW,EAAuB,MAAM,KAAK,CAAA;AAGhE,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AAExC,oBAAY,oBAAoB;IAC9B,qBAAqB,qBAAqB;IAC1C,YAAY,YAAY;IACxB,YAAY,YAAY;CACzB;AAED,eAAO,MAAM,cAAc,0BAG6C,CAAA;AAExE,eAAO,MAAM,kBAAkB,0BAe2C,CAAA;AAE1E,eAAO,MAAM,sBAAsB,0BAiBmC,CAAA;AAEtE,eAAO,MAAM,sBAAsB,0BAOmB,CAAA;AAEtD,eAAO,MAAM,aAAa,0BAE0C,CAAA;AACpE,eAAO,MAAM,aAAa,0BAQ0B,CAAA;AAEpD,eAAO,MAAM,UAAU,0BAG0B,CAAA;AAEjD,eAAO,MAAM,cAAc,0BAG8B,CAAA;AAEzD,eAAO,MAAM,cAAc,0BAI0C,CAAA;AAErE,eAAO,MAAM,sBAAsB,0BAMhC,CAAA;AAEH,eAAO,MAAM,qBAAqB,0BAIgC,CAAA;AAElE,eAAO,MAAM,mBAAmB,0BAEoC,CAAA;AAEpE,eAAO,MAAM,mBAAmB,0BAE8C,CAAA;AAE9E,eAAO,MAAM,gBAAgB,0BAO1B,CAAA;AAEH,eAAO,MAAM,cAAc,0BAOxB,CAAA;AAEH,eAAO,MAAM,cAAc,0BAOxB,CAAA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5D,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2CAMrC,CAAA;AAEL,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAI8B,CAAA;AAE5E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,gBAAgB,CAOhC;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,0BAA0B,CAM1C;AAGD,eAAO,MAAM,6BAA6B,UAAiB,CAAA"}
|
@@ -326,4 +326,17 @@ export interface FormEditorCheckbox {
|
|
326
326
|
value?: string;
|
327
327
|
};
|
328
328
|
}
|
329
|
+
export type AdvancedFieldMappingsType = Record<ComponentType, Record<string, string>>;
|
330
|
+
export type HTMLElementOrNull = HTMLElement | null;
|
331
|
+
export type HTMLInputElementOrNull = HTMLInputElement | null;
|
332
|
+
export interface ErrorPreviewFieldMappingDef {
|
333
|
+
min?: {
|
334
|
+
fieldName: string;
|
335
|
+
placeholder: string;
|
336
|
+
};
|
337
|
+
max?: {
|
338
|
+
fieldName: string;
|
339
|
+
placeholder: string;
|
340
|
+
};
|
341
|
+
}
|
329
342
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;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CAAA;CACjD"}
|
package/package.json
CHANGED
@@ -0,0 +1,176 @@
|
|
1
|
+
import {
|
2
|
+
type ComponentDef,
|
3
|
+
type ConditionalComponentType
|
4
|
+
} from '~/src/components/types.js'
|
5
|
+
import { ConditionType, type Coordinator } from '~/src/conditions/enums.js'
|
6
|
+
import {
|
7
|
+
type ConditionData,
|
8
|
+
type ConditionDataV2,
|
9
|
+
type ConditionListItemRefValueDataV2,
|
10
|
+
type ConditionRefData,
|
11
|
+
type ConditionRefDataV2,
|
12
|
+
type ConditionStringValueDataV2,
|
13
|
+
type ConditionValueData,
|
14
|
+
type RelativeDateValueData
|
15
|
+
} from '~/src/conditions/types.js'
|
16
|
+
import {
|
17
|
+
type ConditionWrapper,
|
18
|
+
type ConditionWrapperV2,
|
19
|
+
type List
|
20
|
+
} from '~/src/form/form-definition/types.js'
|
21
|
+
|
22
|
+
function isConditionListItemRefValueDataV2(
|
23
|
+
value:
|
24
|
+
| ConditionListItemRefValueDataV2
|
25
|
+
| ConditionStringValueDataV2
|
26
|
+
| RelativeDateValueData
|
27
|
+
): value is ConditionListItemRefValueDataV2 {
|
28
|
+
return value.type === ConditionType.ListItemRef
|
29
|
+
}
|
30
|
+
|
31
|
+
function isConditionStringValueDataV2(
|
32
|
+
value:
|
33
|
+
| ConditionListItemRefValueDataV2
|
34
|
+
| ConditionStringValueDataV2
|
35
|
+
| RelativeDateValueData
|
36
|
+
): value is ConditionStringValueDataV2 {
|
37
|
+
return value.type === ConditionType.StringValue
|
38
|
+
}
|
39
|
+
|
40
|
+
function getListItem(model: RuntimeFormModel, listId: string, itemId: string) {
|
41
|
+
const foundList = model.getListById(listId)
|
42
|
+
|
43
|
+
if (!foundList) {
|
44
|
+
throw Error('List not found')
|
45
|
+
}
|
46
|
+
|
47
|
+
const item = foundList.items.find((item) => item.id === itemId)
|
48
|
+
|
49
|
+
if (!item) {
|
50
|
+
throw Error('List item not found')
|
51
|
+
}
|
52
|
+
|
53
|
+
return item
|
54
|
+
}
|
55
|
+
|
56
|
+
function createConditionValueDataFromListItemRefV2(
|
57
|
+
value: ConditionListItemRefValueDataV2,
|
58
|
+
model: RuntimeFormModel
|
59
|
+
): ConditionValueData {
|
60
|
+
const refValue = getListItem(model, value.listId, value.itemId)
|
61
|
+
|
62
|
+
return {
|
63
|
+
display: refValue.text,
|
64
|
+
type: ConditionType.Value,
|
65
|
+
value: refValue.value.toString()
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
function createConditionValueDataFromStringValueDataV2(
|
70
|
+
value: ConditionStringValueDataV2
|
71
|
+
): ConditionValueData {
|
72
|
+
return {
|
73
|
+
type: ConditionType.Value,
|
74
|
+
value: value.value,
|
75
|
+
display: `Condition value: ${value.value}`
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
function isConditionDataV2(
|
80
|
+
condition: ConditionDataV2 | ConditionRefDataV2
|
81
|
+
): condition is ConditionDataV2 {
|
82
|
+
return 'componentId' in condition
|
83
|
+
}
|
84
|
+
|
85
|
+
function convertConditionDataV2(
|
86
|
+
model: RuntimeFormModel,
|
87
|
+
condition: ConditionDataV2,
|
88
|
+
coordinator: Coordinator | undefined
|
89
|
+
): ConditionData {
|
90
|
+
const component = model.getComponentById(condition.componentId)
|
91
|
+
|
92
|
+
if (!component) {
|
93
|
+
throw Error('Component not found')
|
94
|
+
}
|
95
|
+
|
96
|
+
let newValue
|
97
|
+
if (isConditionListItemRefValueDataV2(condition.value)) {
|
98
|
+
newValue = createConditionValueDataFromListItemRefV2(condition.value, model)
|
99
|
+
} else if (isConditionStringValueDataV2(condition.value)) {
|
100
|
+
newValue = createConditionValueDataFromStringValueDataV2(condition.value)
|
101
|
+
} else {
|
102
|
+
newValue = condition.value
|
103
|
+
}
|
104
|
+
|
105
|
+
return {
|
106
|
+
field: {
|
107
|
+
name: component.name,
|
108
|
+
type: component.type as ConditionalComponentType /** @todo fix this */,
|
109
|
+
display: component.title
|
110
|
+
},
|
111
|
+
operator: condition.operator,
|
112
|
+
value: newValue,
|
113
|
+
coordinator
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
function convertConditionRefDataFromV2(
|
118
|
+
model: RuntimeFormModel,
|
119
|
+
condition: ConditionRefDataV2,
|
120
|
+
coordinator: Coordinator | undefined
|
121
|
+
): ConditionRefData {
|
122
|
+
const component = model.getComponentById(condition.conditionId)
|
123
|
+
|
124
|
+
if (!component) {
|
125
|
+
throw Error('Component not found')
|
126
|
+
}
|
127
|
+
|
128
|
+
return {
|
129
|
+
conditionName: component.name,
|
130
|
+
conditionDisplayName: component.title,
|
131
|
+
coordinator
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
export function convertConditionWrapperFromV2(
|
136
|
+
conditionWrapper: ConditionWrapperV2,
|
137
|
+
model: RuntimeFormModel
|
138
|
+
): ConditionWrapper {
|
139
|
+
let coordinator
|
140
|
+
|
141
|
+
if (conditionWrapper.conditions.length > 1 && !conditionWrapper.coordinator) {
|
142
|
+
throw new Error('Coordinator is required for multiple conditions')
|
143
|
+
} else {
|
144
|
+
coordinator = conditionWrapper.coordinator
|
145
|
+
}
|
146
|
+
|
147
|
+
const newConditionWrapper: ConditionWrapper = {
|
148
|
+
name: conditionWrapper.name,
|
149
|
+
displayName: conditionWrapper.displayName,
|
150
|
+
value: {
|
151
|
+
name: conditionWrapper.name,
|
152
|
+
conditions: conditionWrapper.conditions.map((condition) => {
|
153
|
+
let newCondition: ConditionData | ConditionRefData
|
154
|
+
|
155
|
+
if (isConditionDataV2(condition)) {
|
156
|
+
newCondition = convertConditionDataV2(model, condition, coordinator)
|
157
|
+
} else {
|
158
|
+
newCondition = convertConditionRefDataFromV2(
|
159
|
+
model,
|
160
|
+
condition,
|
161
|
+
coordinator
|
162
|
+
)
|
163
|
+
}
|
164
|
+
|
165
|
+
return newCondition
|
166
|
+
})
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
return newConditionWrapper
|
171
|
+
}
|
172
|
+
|
173
|
+
export interface RuntimeFormModel {
|
174
|
+
getListById: (listId: string) => List | undefined
|
175
|
+
getComponentById: (componentId: string) => ComponentDef | undefined
|
176
|
+
}
|
package/src/conditions/types.ts
CHANGED
@@ -17,12 +17,12 @@ export interface ConditionValueData {
|
|
17
17
|
display: string
|
18
18
|
}
|
19
19
|
|
20
|
-
export interface
|
20
|
+
export interface ConditionStringValueDataV2 {
|
21
21
|
type: ConditionType.StringValue
|
22
22
|
value: string
|
23
23
|
}
|
24
24
|
|
25
|
-
export interface
|
25
|
+
export interface ConditionListItemRefValueDataV2 {
|
26
26
|
type: ConditionType.ListItemRef
|
27
27
|
listId: string
|
28
28
|
itemId: string
|
@@ -48,13 +48,13 @@ export interface ConditionData {
|
|
48
48
|
coordinator?: Coordinator
|
49
49
|
}
|
50
50
|
|
51
|
-
export interface
|
51
|
+
export interface ConditionDataV2 {
|
52
52
|
id: string
|
53
53
|
componentId: string
|
54
54
|
operator: OperatorName
|
55
55
|
value:
|
56
|
-
|
|
57
|
-
|
|
56
|
+
| ConditionListItemRefValueDataV2
|
57
|
+
| ConditionStringValueDataV2
|
58
58
|
| RelativeDateValueData
|
59
59
|
}
|
60
60
|
|
@@ -64,7 +64,7 @@ export interface ConditionRefData {
|
|
64
64
|
coordinator?: Coordinator
|
65
65
|
}
|
66
66
|
|
67
|
-
export interface
|
67
|
+
export interface ConditionRefDataV2 {
|
68
68
|
id: string
|
69
69
|
conditionId: string
|
70
70
|
}
|
@@ -73,7 +73,7 @@ export interface ConditionGroupData {
|
|
73
73
|
conditions: (ConditionData | ConditionRefData | ConditionGroupData)[]
|
74
74
|
}
|
75
75
|
|
76
|
-
export type
|
76
|
+
export type ConditionGroupDataV2 = (ConditionDataV2 | ConditionRefDataV2)[]
|
77
77
|
|
78
78
|
export interface ConditionsModelData extends ConditionGroupData {
|
79
79
|
name: string
|
@@ -4,22 +4,22 @@ import { v4 as uuidV4 } from 'uuid'
|
|
4
4
|
import { ComponentType } from '~/src/components/enums.js'
|
5
5
|
import { type ComponentDef } from '~/src/components/types.js'
|
6
6
|
import {
|
7
|
-
type Condition2Data,
|
8
|
-
type Condition2GroupData,
|
9
|
-
type Condition2ListItemRefValueData,
|
10
|
-
type Condition2RefData,
|
11
|
-
type Condition2StringValueData,
|
12
7
|
type ConditionData,
|
8
|
+
type ConditionDataV2,
|
13
9
|
type ConditionFieldData,
|
14
10
|
type ConditionGroupData,
|
11
|
+
type ConditionGroupDataV2,
|
12
|
+
type ConditionListItemRefValueDataV2,
|
15
13
|
type ConditionRefData,
|
14
|
+
type ConditionRefDataV2,
|
15
|
+
type ConditionStringValueDataV2,
|
16
16
|
type ConditionValueData,
|
17
17
|
type ConditionsModelData,
|
18
18
|
type RelativeDateValueData
|
19
19
|
} from '~/src/conditions/types.js'
|
20
20
|
import {
|
21
|
-
type Condition2Wrapper,
|
22
21
|
type ConditionWrapper,
|
22
|
+
type ConditionWrapperV2,
|
23
23
|
type Event,
|
24
24
|
type EventOptions,
|
25
25
|
type Events,
|
@@ -42,7 +42,7 @@ const idSchema = idSchemaOptional.default(() => uuidV4())
|
|
42
42
|
|
43
43
|
const conditionIdRef = Joi.ref('/conditions', {
|
44
44
|
in: true,
|
45
|
-
adjust: (conditions:
|
45
|
+
adjust: (conditions: ConditionWrapperV2[]) =>
|
46
46
|
conditions.map((condition) => condition.name)
|
47
47
|
})
|
48
48
|
|
@@ -127,7 +127,7 @@ const conditionValueSchema = Joi.object<ConditionValueData>()
|
|
127
127
|
.description('Human-readable version of the value for display purposes')
|
128
128
|
})
|
129
129
|
|
130
|
-
const condition2StringValueDataSchema = Joi.object<
|
130
|
+
const condition2StringValueDataSchema = Joi.object<ConditionStringValueDataV2>()
|
131
131
|
.description('String value specification for a condition')
|
132
132
|
.keys({
|
133
133
|
type: Joi.string()
|
@@ -142,7 +142,7 @@ const condition2StringValueDataSchema = Joi.object<Condition2StringValueData>()
|
|
142
142
|
})
|
143
143
|
|
144
144
|
const condition2ListItemRefDataSchema =
|
145
|
-
Joi.object<
|
145
|
+
Joi.object<ConditionListItemRefValueDataV2>()
|
146
146
|
.description('List item ref specification for a condition')
|
147
147
|
.keys({
|
148
148
|
type: Joi.string()
|
@@ -203,7 +203,7 @@ const conditionRefSchema = Joi.object<ConditionRefData>()
|
|
203
203
|
)
|
204
204
|
})
|
205
205
|
|
206
|
-
const condition2RefDataSchema = Joi.object<
|
206
|
+
const condition2RefDataSchema = Joi.object<ConditionRefDataV2>()
|
207
207
|
.description('Reference to a named condition defined elsewhere')
|
208
208
|
.keys({
|
209
209
|
id: idSchema.description('Unique identifier for the referenced condition'),
|
@@ -237,7 +237,7 @@ const conditionSchema = Joi.object<ConditionData>()
|
|
237
237
|
)
|
238
238
|
})
|
239
239
|
|
240
|
-
const condition2DataSchema = Joi.object<
|
240
|
+
const condition2DataSchema = Joi.object<ConditionDataV2>()
|
241
241
|
.description('Condition definition')
|
242
242
|
.keys({
|
243
243
|
id: idSchema.description(
|
@@ -315,7 +315,7 @@ const conditionWrapperSchema = Joi.object<ConditionWrapper>()
|
|
315
315
|
.description('The complete condition definition')
|
316
316
|
})
|
317
317
|
|
318
|
-
export const conditionWrapperSchemaV2 = Joi.object<
|
318
|
+
export const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()
|
319
319
|
.description('Container for a named condition with its definition')
|
320
320
|
.keys({
|
321
321
|
name: Joi.string()
|
@@ -329,7 +329,7 @@ export const conditionWrapperSchemaV2 = Joi.object<Condition2Wrapper>()
|
|
329
329
|
.description(
|
330
330
|
'Logical operator connecting this condition with others (AND, OR)'
|
331
331
|
),
|
332
|
-
conditions: Joi.array<
|
332
|
+
conditions: Joi.array<ConditionGroupDataV2>()
|
333
333
|
.items(
|
334
334
|
Joi.alternatives().try(condition2DataSchema, condition2RefDataSchema)
|
335
335
|
)
|
@@ -868,7 +868,7 @@ export const formDefinitionV2Schema = formDefinitionSchema
|
|
868
868
|
.unique('title')
|
869
869
|
.unique('id')
|
870
870
|
.description('Lists schema for V2 forms'),
|
871
|
-
conditions: Joi.array<
|
871
|
+
conditions: Joi.array<ConditionWrapperV2>()
|
872
872
|
.items(conditionWrapperSchemaV2)
|
873
873
|
.unique('name')
|
874
874
|
.unique('displayName')
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { type ComponentDef } from '~/src/components/types.js'
|
2
2
|
import { type Coordinator } from '~/src/conditions/enums.js'
|
3
3
|
import {
|
4
|
-
type
|
4
|
+
type ConditionGroupDataV2,
|
5
5
|
type ConditionsModelData
|
6
6
|
} from '~/src/conditions/types.js'
|
7
7
|
import { type ControllerPath, type ControllerType } from '~/src/pages/enums.js'
|
@@ -162,11 +162,11 @@ export interface ConditionWrapper {
|
|
162
162
|
value: ConditionsModelData
|
163
163
|
}
|
164
164
|
|
165
|
-
export interface
|
165
|
+
export interface ConditionWrapperV2 {
|
166
166
|
name: string
|
167
167
|
displayName: string
|
168
168
|
coordinator?: Coordinator
|
169
|
-
conditions:
|
169
|
+
conditions: ConditionGroupDataV2
|
170
170
|
}
|
171
171
|
|
172
172
|
/**
|
@@ -175,7 +175,7 @@ export interface Condition2Wrapper {
|
|
175
175
|
export interface FormDefinition {
|
176
176
|
engine?: Engine
|
177
177
|
pages: Page[]
|
178
|
-
conditions: (ConditionWrapper |
|
178
|
+
conditions: (ConditionWrapper | ConditionWrapperV2)[]
|
179
179
|
lists: List[]
|
180
180
|
sections: Section[]
|
181
181
|
startPage?: string
|
@@ -604,3 +604,6 @@ export function govukFieldIsQuestionOptional(
|
|
604
604
|
const checkedValue = govukField.items?.[0].checked
|
605
605
|
return typeof checkedValue === 'boolean'
|
606
606
|
}
|
607
|
+
|
608
|
+
// A list of allowed template funtions for use within error message templates
|
609
|
+
export const allowedErrorTemplateFunctions = ['lowerFirst']
|