@defra/forms-model 3.0.472 → 3.0.474

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.
Files changed (35) hide show
  1. package/dist/module/components/index.js +1 -0
  2. package/dist/module/components/index.js.map +1 -1
  3. package/dist/module/components/yes-no-helper.js +23 -0
  4. package/dist/module/components/yes-no-helper.js.map +1 -0
  5. package/dist/module/conditions/helpers.js +8 -0
  6. package/dist/module/conditions/helpers.js.map +1 -1
  7. package/dist/module/conditions/index.js +1 -1
  8. package/dist/module/conditions/index.js.map +1 -1
  9. package/dist/module/conditions/migration.js +1 -1
  10. package/dist/module/conditions/migration.js.map +1 -1
  11. package/dist/module/form/form-definition/index.js +13 -5
  12. package/dist/module/form/form-definition/index.js.map +1 -1
  13. package/dist/module/form/form-editor/types.js.map +1 -1
  14. package/dist/types/components/index.d.ts +1 -0
  15. package/dist/types/components/index.d.ts.map +1 -1
  16. package/dist/types/components/yes-no-helper.d.ts +7 -0
  17. package/dist/types/components/yes-no-helper.d.ts.map +1 -0
  18. package/dist/types/conditions/helpers.d.ts +2 -1
  19. package/dist/types/conditions/helpers.d.ts.map +1 -1
  20. package/dist/types/conditions/index.d.ts +1 -1
  21. package/dist/types/conditions/index.d.ts.map +1 -1
  22. package/dist/types/conditions/migration.d.ts.map +1 -1
  23. package/dist/types/form/form-definition/index.d.ts +2 -0
  24. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  25. package/dist/types/form/form-editor/types.d.ts +22 -1
  26. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/schemas/form-definition-v2-schema.json +16 -6
  29. package/src/components/index.ts +7 -0
  30. package/src/components/yes-no-helper.ts +27 -0
  31. package/src/conditions/helpers.ts +20 -1
  32. package/src/conditions/index.ts +1 -0
  33. package/src/conditions/migration.ts +5 -1
  34. package/src/form/form-definition/index.ts +24 -7
  35. package/src/form/form-editor/types.ts +32 -1
@@ -1,5 +1,6 @@
1
1
  export { ComponentTypes } from "./component-types.js";
2
2
  export { getComponentDefaults, hasConditionSupport, hasContent, hasContentField, hasFormField, hasHint, hasInputField, hasListField, hasSelectionFields, hasTitle, isConditionalType, isContentType, isFormType, isListType } from "./helpers.js";
3
3
  export { allDocumentTypes, allImageTypes, allTabularDataTypes } from "./file-types.js";
4
+ export { getYesNoList, yesNoListId, yesNoListName, yesNoListNoItemId, yesNoListYesItemId } from "./yes-no-helper.js";
4
5
  export { ComponentType } from "./enums.js";
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentTypes","getComponentDefaults","hasConditionSupport","hasContent","hasContentField","hasFormField","hasHint","hasInputField","hasListField","hasSelectionFields","hasTitle","isConditionalType","isContentType","isFormType","isListType","allDocumentTypes","allImageTypes","allTabularDataTypes","ComponentType"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types.js'\nexport {\n getComponentDefaults,\n hasConditionSupport,\n hasContent,\n hasContentField,\n hasFormField,\n hasHint,\n hasInputField,\n hasListField,\n hasSelectionFields,\n hasTitle,\n isConditionalType,\n isContentType,\n isFormType,\n isListType\n} from '~/src/components/helpers.js'\nexport {\n allDocumentTypes,\n allImageTypes,\n allTabularDataTypes\n} from '~/src/components/file-types.js'\nexport { ComponentType } from '~/src/components/enums.js'\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,OAAO,EACPC,aAAa,EACbC,YAAY,EACZC,kBAAkB,EAClBC,QAAQ,EACRC,iBAAiB,EACjBC,aAAa,EACbC,UAAU,EACVC,UAAU;AAEZ,SACEC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB;AAErB,SAASC,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ComponentTypes","getComponentDefaults","hasConditionSupport","hasContent","hasContentField","hasFormField","hasHint","hasInputField","hasListField","hasSelectionFields","hasTitle","isConditionalType","isContentType","isFormType","isListType","allDocumentTypes","allImageTypes","allTabularDataTypes","getYesNoList","yesNoListId","yesNoListName","yesNoListNoItemId","yesNoListYesItemId","ComponentType"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types.js'\nexport {\n getComponentDefaults,\n hasConditionSupport,\n hasContent,\n hasContentField,\n hasFormField,\n hasHint,\n hasInputField,\n hasListField,\n hasSelectionFields,\n hasTitle,\n isConditionalType,\n isContentType,\n isFormType,\n isListType\n} from '~/src/components/helpers.js'\nexport {\n allDocumentTypes,\n allImageTypes,\n allTabularDataTypes\n} from '~/src/components/file-types.js'\nexport {\n getYesNoList,\n yesNoListId,\n yesNoListName,\n yesNoListNoItemId,\n yesNoListYesItemId\n} from '~/src/components/yes-no-helper.js'\nexport { ComponentType } from '~/src/components/enums.js'\n"],"mappings":"AAAA,SAASA,cAAc;AACvB,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,OAAO,EACPC,aAAa,EACbC,YAAY,EACZC,kBAAkB,EAClBC,QAAQ,EACRC,iBAAiB,EACjBC,aAAa,EACbC,UAAU,EACVC,UAAU;AAEZ,SACEC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB;AAErB,SACEC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB;AAEpB,SAASC,aAAa","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import { SchemaVersion } from "../form/form-definition/types.js";
2
+ export const yesNoListId = '3167ecb5-61f9-4918-b7d0-6793b56aa814';
3
+ export const yesNoListName = '__yesNo';
4
+ export const yesNoListYesItemId = '02900d42-83d1-4c72-a719-c4e8228952fa';
5
+ export const yesNoListNoItemId = 'f39000eb-c51b-4019-8f82-bbda0423f04d';
6
+ export function getYesNoList(schemaVersion = SchemaVersion.V2) {
7
+ return {
8
+ id: schemaVersion === SchemaVersion.V1 ? yesNoListName : yesNoListId,
9
+ name: '__yesNo',
10
+ title: 'Yes/No',
11
+ type: 'boolean',
12
+ items: [{
13
+ id: yesNoListYesItemId,
14
+ text: 'Yes',
15
+ value: true
16
+ }, {
17
+ id: yesNoListNoItemId,
18
+ text: 'No',
19
+ value: false
20
+ }]
21
+ };
22
+ }
23
+ //# sourceMappingURL=yes-no-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yes-no-helper.js","names":["SchemaVersion","yesNoListId","yesNoListName","yesNoListYesItemId","yesNoListNoItemId","getYesNoList","schemaVersion","V2","id","V1","name","title","type","items","text","value"],"sources":["../../../src/components/yes-no-helper.ts"],"sourcesContent":["import { SchemaVersion, type List } from '~/src/form/form-definition/types.js'\n\nexport const yesNoListId = '3167ecb5-61f9-4918-b7d0-6793b56aa814'\nexport const yesNoListName = '__yesNo'\nexport const yesNoListYesItemId = '02900d42-83d1-4c72-a719-c4e8228952fa'\nexport const yesNoListNoItemId = 'f39000eb-c51b-4019-8f82-bbda0423f04d'\n\nexport function getYesNoList(schemaVersion: SchemaVersion = SchemaVersion.V2) {\n return {\n id: schemaVersion === SchemaVersion.V1 ? yesNoListName : yesNoListId,\n name: '__yesNo',\n title: 'Yes/No',\n type: 'boolean',\n items: [\n {\n id: yesNoListYesItemId,\n text: 'Yes',\n value: true\n },\n {\n id: yesNoListNoItemId,\n text: 'No',\n value: false\n }\n ]\n } as List\n}\n"],"mappings":"AAAA,SAASA,aAAa;AAEtB,OAAO,MAAMC,WAAW,GAAG,sCAAsC;AACjE,OAAO,MAAMC,aAAa,GAAG,SAAS;AACtC,OAAO,MAAMC,kBAAkB,GAAG,sCAAsC;AACxE,OAAO,MAAMC,iBAAiB,GAAG,sCAAsC;AAEvE,OAAO,SAASC,YAAYA,CAACC,aAA4B,GAAGN,aAAa,CAACO,EAAE,EAAE;EAC5E,OAAO;IACLC,EAAE,EAAEF,aAAa,KAAKN,aAAa,CAACS,EAAE,GAAGP,aAAa,GAAGD,WAAW;IACpES,IAAI,EAAE,SAAS;IACfC,KAAK,EAAE,QAAQ;IACfC,IAAI,EAAE,SAAS;IACfC,KAAK,EAAE,CACL;MACEL,EAAE,EAAEL,kBAAkB;MACtBW,IAAI,EAAE,KAAK;MACXC,KAAK,EAAE;IACT,CAAC,EACD;MACEP,EAAE,EAAEJ,iBAAiB;MACrBU,IAAI,EAAE,IAAI;MACVC,KAAK,EAAE;IACT,CAAC;EAEL,CAAC;AACH","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ import { isConditionWrapperV2 } from "./migration.js";
1
2
  export function toPresentationString(condition) {
2
3
  return `${condition.coordinatorString()}${condition.conditionString()}`;
3
4
  }
@@ -22,4 +23,11 @@ export const hasNestedCondition = condition => {
22
23
  export const isDuplicateCondition = (conditions, conditionName) => {
23
24
  return conditions.some(condition => condition.name === conditionName);
24
25
  };
26
+ export const getConditionV2 = (definition, conditionId) => {
27
+ const condition = definition.conditions.filter(isConditionWrapperV2).find(condition => condition.id === conditionId);
28
+ if (!condition) {
29
+ throw new Error(`Condition '${conditionId}' not found in form`);
30
+ }
31
+ return condition;
32
+ };
25
33
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["toPresentationString","condition","coordinatorString","conditionString","toPresentationHtml","coordinatorHtml","toExpression","conditionExpression","hasConditionField","hasConditionGroup","hasConditionName","hasNestedCondition","value","conditions","some","isDuplicateCondition","conditionName","name"],"sources":["../../../src/conditions/helpers.ts"],"sourcesContent":["import { type ConditionGroup } from '~/src/conditions/condition-group.js'\nimport { type ConditionRef } from '~/src/conditions/condition-ref.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport {\n type ConditionData,\n type ConditionGroupData,\n type ConditionRefData\n} from '~/src/conditions/types.js'\nimport { type ConditionWrapper } from '~/src/form/form-definition/types.js'\n\ntype ConditionType = Condition | ConditionRef | ConditionGroup\ntype ConditionDataType = ConditionGroupData | ConditionData | ConditionRefData\n\nexport function toPresentationString(condition: ConditionType) {\n return `${condition.coordinatorString()}${condition.conditionString()}`\n}\n\nexport function toPresentationHtml(condition: ConditionType) {\n return `${condition.coordinatorHtml()}${condition.conditionString()}`\n}\n\nexport function toExpression(condition: ConditionType) {\n return `${condition.coordinatorString()}${condition.conditionExpression()}`\n}\n\nexport const hasConditionField = (\n condition?: ConditionDataType\n): condition is ConditionData => {\n return !!condition && 'field' in condition\n}\n\nexport const hasConditionGroup = (\n condition?: ConditionDataType\n): condition is ConditionGroupData => {\n return !!condition && 'conditions' in condition\n}\n\nexport const hasConditionName = (\n condition?: ConditionDataType\n): condition is ConditionRefData => {\n return !!condition && 'conditionName' in condition\n}\n\nexport const hasNestedCondition = (condition?: ConditionWrapper) => {\n return !!condition?.value.conditions.some(hasConditionName)\n}\n\nexport const isDuplicateCondition = (\n conditions: ConditionWrapper[],\n conditionName: string\n) => {\n return conditions.some((condition) => condition.name === conditionName)\n}\n"],"mappings":"AAaA,OAAO,SAASA,oBAAoBA,CAACC,SAAwB,EAAE;EAC7D,OAAO,GAAGA,SAAS,CAACC,iBAAiB,CAAC,CAAC,GAAGD,SAAS,CAACE,eAAe,CAAC,CAAC,EAAE;AACzE;AAEA,OAAO,SAASC,kBAAkBA,CAACH,SAAwB,EAAE;EAC3D,OAAO,GAAGA,SAAS,CAACI,eAAe,CAAC,CAAC,GAAGJ,SAAS,CAACE,eAAe,CAAC,CAAC,EAAE;AACvE;AAEA,OAAO,SAASG,YAAYA,CAACL,SAAwB,EAAE;EACrD,OAAO,GAAGA,SAAS,CAACC,iBAAiB,CAAC,CAAC,GAAGD,SAAS,CAACM,mBAAmB,CAAC,CAAC,EAAE;AAC7E;AAEA,OAAO,MAAMC,iBAAiB,GAC5BP,SAA6B,IACE;EAC/B,OAAO,CAAC,CAACA,SAAS,IAAI,OAAO,IAAIA,SAAS;AAC5C,CAAC;AAED,OAAO,MAAMQ,iBAAiB,GAC5BR,SAA6B,IACO;EACpC,OAAO,CAAC,CAACA,SAAS,IAAI,YAAY,IAAIA,SAAS;AACjD,CAAC;AAED,OAAO,MAAMS,gBAAgB,GAC3BT,SAA6B,IACK;EAClC,OAAO,CAAC,CAACA,SAAS,IAAI,eAAe,IAAIA,SAAS;AACpD,CAAC;AAED,OAAO,MAAMU,kBAAkB,GAAIV,SAA4B,IAAK;EAClE,OAAO,CAAC,CAACA,SAAS,EAAEW,KAAK,CAACC,UAAU,CAACC,IAAI,CAACJ,gBAAgB,CAAC;AAC7D,CAAC;AAED,OAAO,MAAMK,oBAAoB,GAAGA,CAClCF,UAA8B,EAC9BG,aAAqB,KAClB;EACH,OAAOH,UAAU,CAACC,IAAI,CAAEb,SAAS,IAAKA,SAAS,CAACgB,IAAI,KAAKD,aAAa,CAAC;AACzE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"helpers.js","names":["isConditionWrapperV2","toPresentationString","condition","coordinatorString","conditionString","toPresentationHtml","coordinatorHtml","toExpression","conditionExpression","hasConditionField","hasConditionGroup","hasConditionName","hasNestedCondition","value","conditions","some","isDuplicateCondition","conditionName","name","getConditionV2","definition","conditionId","filter","find","id","Error"],"sources":["../../../src/conditions/helpers.ts"],"sourcesContent":["import { type ConditionGroup } from '~/src/conditions/condition-group.js'\nimport { type ConditionRef } from '~/src/conditions/condition-ref.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport { isConditionWrapperV2 } from '~/src/conditions/migration.js'\nimport {\n type ConditionData,\n type ConditionGroupData,\n type ConditionRefData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\n type FormDefinition\n} from '~/src/form/form-definition/types.js'\n\ntype ConditionType = Condition | ConditionRef | ConditionGroup\ntype ConditionDataType = ConditionGroupData | ConditionData | ConditionRefData\n\nexport function toPresentationString(condition: ConditionType) {\n return `${condition.coordinatorString()}${condition.conditionString()}`\n}\n\nexport function toPresentationHtml(condition: ConditionType) {\n return `${condition.coordinatorHtml()}${condition.conditionString()}`\n}\n\nexport function toExpression(condition: ConditionType) {\n return `${condition.coordinatorString()}${condition.conditionExpression()}`\n}\n\nexport const hasConditionField = (\n condition?: ConditionDataType\n): condition is ConditionData => {\n return !!condition && 'field' in condition\n}\n\nexport const hasConditionGroup = (\n condition?: ConditionDataType\n): condition is ConditionGroupData => {\n return !!condition && 'conditions' in condition\n}\n\nexport const hasConditionName = (\n condition?: ConditionDataType\n): condition is ConditionRefData => {\n return !!condition && 'conditionName' in condition\n}\n\nexport const hasNestedCondition = (condition?: ConditionWrapper) => {\n return !!condition?.value.conditions.some(hasConditionName)\n}\n\nexport const isDuplicateCondition = (\n conditions: ConditionWrapper[],\n conditionName: string\n) => {\n return conditions.some((condition) => condition.name === conditionName)\n}\n\nexport const getConditionV2 = (\n definition: FormDefinition,\n conditionId: string\n) => {\n const condition = definition.conditions\n .filter(isConditionWrapperV2)\n .find((condition) => condition.id === conditionId)\n\n if (!condition) {\n throw new Error(`Condition '${conditionId}' not found in form`)\n }\n\n return condition\n}\n"],"mappings":"AAGA,SAASA,oBAAoB;AAc7B,OAAO,SAASC,oBAAoBA,CAACC,SAAwB,EAAE;EAC7D,OAAO,GAAGA,SAAS,CAACC,iBAAiB,CAAC,CAAC,GAAGD,SAAS,CAACE,eAAe,CAAC,CAAC,EAAE;AACzE;AAEA,OAAO,SAASC,kBAAkBA,CAACH,SAAwB,EAAE;EAC3D,OAAO,GAAGA,SAAS,CAACI,eAAe,CAAC,CAAC,GAAGJ,SAAS,CAACE,eAAe,CAAC,CAAC,EAAE;AACvE;AAEA,OAAO,SAASG,YAAYA,CAACL,SAAwB,EAAE;EACrD,OAAO,GAAGA,SAAS,CAACC,iBAAiB,CAAC,CAAC,GAAGD,SAAS,CAACM,mBAAmB,CAAC,CAAC,EAAE;AAC7E;AAEA,OAAO,MAAMC,iBAAiB,GAC5BP,SAA6B,IACE;EAC/B,OAAO,CAAC,CAACA,SAAS,IAAI,OAAO,IAAIA,SAAS;AAC5C,CAAC;AAED,OAAO,MAAMQ,iBAAiB,GAC5BR,SAA6B,IACO;EACpC,OAAO,CAAC,CAACA,SAAS,IAAI,YAAY,IAAIA,SAAS;AACjD,CAAC;AAED,OAAO,MAAMS,gBAAgB,GAC3BT,SAA6B,IACK;EAClC,OAAO,CAAC,CAACA,SAAS,IAAI,eAAe,IAAIA,SAAS;AACpD,CAAC;AAED,OAAO,MAAMU,kBAAkB,GAAIV,SAA4B,IAAK;EAClE,OAAO,CAAC,CAACA,SAAS,EAAEW,KAAK,CAACC,UAAU,CAACC,IAAI,CAACJ,gBAAgB,CAAC;AAC7D,CAAC;AAED,OAAO,MAAMK,oBAAoB,GAAGA,CAClCF,UAA8B,EAC9BG,aAAqB,KAClB;EACH,OAAOH,UAAU,CAACC,IAAI,CAAEb,SAAS,IAAKA,SAAS,CAACgB,IAAI,KAAKD,aAAa,CAAC;AACzE,CAAC;AAED,OAAO,MAAME,cAAc,GAAGA,CAC5BC,UAA0B,EAC1BC,WAAmB,KAChB;EACH,MAAMnB,SAAS,GAAGkB,UAAU,CAACN,UAAU,CACpCQ,MAAM,CAACtB,oBAAoB,CAAC,CAC5BuB,IAAI,CAAErB,SAAS,IAAKA,SAAS,CAACsB,EAAE,KAAKH,WAAW,CAAC;EAEpD,IAAI,CAACnB,SAAS,EAAE;IACd,MAAM,IAAIuB,KAAK,CAAC,cAAcJ,WAAW,qBAAqB,CAAC;EACjE;EAEA,OAAOnB,SAAS;AAClB,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@ export { ConditionRef } from "./condition-ref.js";
6
6
  export { ConditionGroup } from "./condition-group.js";
7
7
  export { ConditionsModel } from "./condition-model.js";
8
8
  export { ConditionGroupDef } from "./condition-group-def.js";
9
- export { hasConditionField, hasConditionGroup, hasConditionName, hasNestedCondition, isDuplicateCondition, toExpression, toPresentationString } from "./helpers.js";
9
+ export { getConditionV2, hasConditionField, hasConditionGroup, hasConditionName, hasNestedCondition, isDuplicateCondition, toExpression, toPresentationString } from "./helpers.js";
10
10
  export { convertConditionWrapperFromV2, isConditionWrapper, isConditionWrapperV2 } from "./migration.js";
11
11
  export { ConditionType, Coordinator, DateDirections, DateUnits, Operator, OperatorName } from "./enums.js";
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["absoluteDateOperatorNames","getExpression","getOperatorNames","relativeDateOperatorNames","ConditionValue","RelativeDateValue","conditionValueFrom","ConditionField","Condition","ConditionRef","ConditionGroup","ConditionsModel","ConditionGroupDef","hasConditionField","hasConditionGroup","hasConditionName","hasNestedCondition","isDuplicateCondition","toExpression","toPresentationString","convertConditionWrapperFromV2","isConditionWrapper","isConditionWrapperV2","ConditionType","Coordinator","DateDirections","DateUnits","Operator","OperatorName"],"sources":["../../../src/conditions/index.ts"],"sourcesContent":["export {\n absoluteDateOperatorNames,\n getExpression,\n getOperatorNames,\n relativeDateOperatorNames\n} from '~/src/conditions/condition-operators.js'\n\nexport {\n ConditionValue,\n RelativeDateValue,\n conditionValueFrom\n} from '~/src/conditions/condition-values.js'\n\nexport { ConditionField } from '~/src/conditions/condition-field.js'\nexport { Condition } from '~/src/conditions/condition.js'\nexport { ConditionRef } from '~/src/conditions/condition-ref.js'\nexport { ConditionGroup } from '~/src/conditions/condition-group.js'\nexport { ConditionsModel } from '~/src/conditions/condition-model.js'\nexport { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'\nexport {\n hasConditionField,\n hasConditionGroup,\n hasConditionName,\n hasNestedCondition,\n isDuplicateCondition,\n toExpression,\n toPresentationString\n} from '~/src/conditions/helpers.js'\n\nexport {\n convertConditionWrapperFromV2,\n isConditionWrapper,\n isConditionWrapperV2,\n type RuntimeFormModel\n} from '~/src/conditions/migration.js'\n\nexport {\n ConditionType,\n Coordinator,\n DateDirections,\n DateUnits,\n Operator,\n OperatorName\n} from '~/src/conditions/enums.js'\n"],"mappings":"AAAA,SACEA,yBAAyB,EACzBC,aAAa,EACbC,gBAAgB,EAChBC,yBAAyB;AAG3B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB;AAGpB,SAASC,cAAc;AACvB,SAASC,SAAS;AAClB,SAASC,YAAY;AACrB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,oBAAoB,EACpBC,YAAY,EACZC,oBAAoB;AAGtB,SACEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,oBAAoB;AAItB,SACEC,aAAa,EACbC,WAAW,EACXC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["absoluteDateOperatorNames","getExpression","getOperatorNames","relativeDateOperatorNames","ConditionValue","RelativeDateValue","conditionValueFrom","ConditionField","Condition","ConditionRef","ConditionGroup","ConditionsModel","ConditionGroupDef","getConditionV2","hasConditionField","hasConditionGroup","hasConditionName","hasNestedCondition","isDuplicateCondition","toExpression","toPresentationString","convertConditionWrapperFromV2","isConditionWrapper","isConditionWrapperV2","ConditionType","Coordinator","DateDirections","DateUnits","Operator","OperatorName"],"sources":["../../../src/conditions/index.ts"],"sourcesContent":["export {\n absoluteDateOperatorNames,\n getExpression,\n getOperatorNames,\n relativeDateOperatorNames\n} from '~/src/conditions/condition-operators.js'\n\nexport {\n ConditionValue,\n RelativeDateValue,\n conditionValueFrom\n} from '~/src/conditions/condition-values.js'\n\nexport { ConditionField } from '~/src/conditions/condition-field.js'\nexport { Condition } from '~/src/conditions/condition.js'\nexport { ConditionRef } from '~/src/conditions/condition-ref.js'\nexport { ConditionGroup } from '~/src/conditions/condition-group.js'\nexport { ConditionsModel } from '~/src/conditions/condition-model.js'\nexport { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'\nexport {\n getConditionV2,\n hasConditionField,\n hasConditionGroup,\n hasConditionName,\n hasNestedCondition,\n isDuplicateCondition,\n toExpression,\n toPresentationString\n} from '~/src/conditions/helpers.js'\n\nexport {\n convertConditionWrapperFromV2,\n isConditionWrapper,\n isConditionWrapperV2,\n type RuntimeFormModel\n} from '~/src/conditions/migration.js'\n\nexport {\n ConditionType,\n Coordinator,\n DateDirections,\n DateUnits,\n Operator,\n OperatorName\n} from '~/src/conditions/enums.js'\n"],"mappings":"AAAA,SACEA,yBAAyB,EACzBC,aAAa,EACbC,gBAAgB,EAChBC,yBAAyB;AAG3B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB;AAGpB,SAASC,cAAc;AACvB,SAASC,SAAS;AAClB,SAASC,YAAY;AACrB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,oBAAoB,EACpBC,YAAY,EACZC,oBAAoB;AAGtB,SACEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,oBAAoB;AAItB,SACEC,aAAa,EACbC,WAAW,EACXC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,YAAY","ignoreList":[]}
@@ -90,7 +90,7 @@ export function convertConditionWrapperFromV2(conditionWrapper, model) {
90
90
  conditions: conditionWrapper.items.map((condition, index) => {
91
91
  let newCondition;
92
92
  if (isConditionDataV2(condition)) {
93
- newCondition = convertConditionDataV2(model, condition, coordinator);
93
+ newCondition = convertConditionDataV2(model, condition, index > 0 ? coordinator : undefined);
94
94
  } else {
95
95
  newCondition = convertConditionRefDataFromV2(model, condition, index > 0 ? coordinator : undefined);
96
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"migration.js","names":["ConditionType","isConditionListItemRefValueDataV2","value","type","ListItemRef","isConditionStringValueDataV2","StringValue","getListItem","model","listId","itemId","foundList","getListById","Error","item","items","find","id","createConditionValueDataFromListItemRefV2","refValue","display","text","Value","toString","createConditionValueDataFromStringValueDataV2","isConditionDataV2","condition","convertConditionDataV2","coordinator","component","getComponentById","componentId","newValue","field","name","title","operator","convertConditionRefDataFromV2","refCondition","getConditionById","conditionId","conditionName","conditionDisplayName","displayName","isConditionWrapperV2","wrapper","Array","isArray","isConditionWrapper","convertConditionWrapperFromV2","conditionWrapper","length","newConditionWrapper","conditions","map","index","newCondition","undefined"],"sources":["../../../src/conditions/migration.ts"],"sourcesContent":["import {\n type ComponentDef,\n type ConditionalComponentType\n} from '~/src/components/types.js'\nimport { ConditionType, type Coordinator } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\n type ConditionWrapperV2,\n type List\n} from '~/src/form/form-definition/types.js'\n\nfunction isConditionListItemRefValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionListItemRefValueDataV2 {\n return value.type === ConditionType.ListItemRef\n}\n\nfunction isConditionStringValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionStringValueDataV2 {\n return value.type === ConditionType.StringValue\n}\n\nfunction getListItem(model: RuntimeFormModel, listId: string, itemId: string) {\n const foundList = model.getListById(listId)\n\n if (!foundList) {\n throw Error('List not found')\n }\n\n const item = foundList.items.find((item) => item.id === itemId)\n\n if (!item) {\n throw Error('List item not found')\n }\n\n return item\n}\n\nfunction createConditionValueDataFromListItemRefV2(\n value: ConditionListItemRefValueDataV2,\n model: RuntimeFormModel\n): ConditionValueData {\n const refValue = getListItem(model, value.listId, value.itemId)\n\n return {\n display: refValue.text,\n type: ConditionType.Value,\n value: refValue.value.toString()\n }\n}\n\nfunction createConditionValueDataFromStringValueDataV2(\n value: ConditionStringValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value,\n display: value.value\n }\n}\n\nfunction isConditionDataV2(\n condition: ConditionDataV2 | ConditionRefDataV2\n): condition is ConditionDataV2 {\n return 'componentId' in condition\n}\n\nfunction convertConditionDataV2(\n model: RuntimeFormModel,\n condition: ConditionDataV2,\n coordinator: Coordinator | undefined\n): ConditionData {\n const component = model.getComponentById(condition.componentId)\n\n if (!component) {\n throw Error('Component not found')\n }\n\n let newValue\n if (isConditionListItemRefValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromListItemRefV2(condition.value, model)\n } else if (isConditionStringValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromStringValueDataV2(condition.value)\n } else {\n newValue = condition.value\n }\n\n return {\n field: {\n name: component.name,\n type: component.type as ConditionalComponentType /** @todo fix this */,\n display: component.title\n },\n operator: condition.operator,\n value: newValue,\n coordinator\n }\n}\n\nfunction convertConditionRefDataFromV2(\n model: RuntimeFormModel,\n condition: ConditionRefDataV2,\n coordinator: Coordinator | undefined\n): ConditionRefData {\n const refCondition = model.getConditionById(condition.conditionId)\n\n if (!refCondition) {\n throw Error('Component not found')\n }\n\n return {\n conditionName: refCondition.id,\n conditionDisplayName: refCondition.displayName,\n coordinator\n }\n}\n\nexport function isConditionWrapperV2(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapperV2 {\n return Array.isArray((wrapper as ConditionWrapperV2).items)\n}\n\nexport function isConditionWrapper(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapper {\n return !isConditionWrapperV2(wrapper)\n}\n\nexport function convertConditionWrapperFromV2(\n conditionWrapper: ConditionWrapperV2,\n model: RuntimeFormModel\n): ConditionWrapper {\n let coordinator\n\n if (conditionWrapper.items.length > 1 && !conditionWrapper.coordinator) {\n throw new Error('Coordinator is required for multiple conditions')\n } else {\n coordinator = conditionWrapper.coordinator\n }\n\n const newConditionWrapper: ConditionWrapper = {\n name: conditionWrapper.id,\n displayName: conditionWrapper.displayName,\n value: {\n name: conditionWrapper.id,\n conditions: conditionWrapper.items.map((condition, index) => {\n let newCondition: ConditionData | ConditionRefData\n\n if (isConditionDataV2(condition)) {\n newCondition = convertConditionDataV2(model, condition, coordinator)\n } else {\n newCondition = convertConditionRefDataFromV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\n }\n\n return newCondition\n })\n }\n }\n\n return newConditionWrapper\n}\n\nexport interface RuntimeFormModel {\n getListById: (listId: string) => List | undefined\n getComponentById: (componentId: string) => ComponentDef | undefined\n getConditionById: (conditionId: string) => ConditionWrapperV2 | undefined\n}\n"],"mappings":"AAIA,SAASA,aAAa;AAiBtB,SAASC,iCAAiCA,CACxCC,KAGyB,EACiB;EAC1C,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACI,WAAW;AACjD;AAEA,SAASC,4BAA4BA,CACnCH,KAGyB,EACY;EACrC,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACM,WAAW;AACjD;AAEA,SAASC,WAAWA,CAACC,KAAuB,EAAEC,MAAc,EAAEC,MAAc,EAAE;EAC5E,MAAMC,SAAS,GAAGH,KAAK,CAACI,WAAW,CAACH,MAAM,CAAC;EAE3C,IAAI,CAACE,SAAS,EAAE;IACd,MAAME,KAAK,CAAC,gBAAgB,CAAC;EAC/B;EAEA,MAAMC,IAAI,GAAGH,SAAS,CAACI,KAAK,CAACC,IAAI,CAAEF,IAAI,IAAKA,IAAI,CAACG,EAAE,KAAKP,MAAM,CAAC;EAE/D,IAAI,CAACI,IAAI,EAAE;IACT,MAAMD,KAAK,CAAC,qBAAqB,CAAC;EACpC;EAEA,OAAOC,IAAI;AACb;AAEA,SAASI,yCAAyCA,CAChDhB,KAAsC,EACtCM,KAAuB,EACH;EACpB,MAAMW,QAAQ,GAAGZ,WAAW,CAACC,KAAK,EAAEN,KAAK,CAACO,MAAM,EAAEP,KAAK,CAACQ,MAAM,CAAC;EAE/D,OAAO;IACLU,OAAO,EAAED,QAAQ,CAACE,IAAI;IACtBlB,IAAI,EAAEH,aAAa,CAACsB,KAAK;IACzBpB,KAAK,EAAEiB,QAAQ,CAACjB,KAAK,CAACqB,QAAQ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L4B,YAAY,GAAGnB,6BAA6B,CAC1C7B,KAAK,EACLkB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH;QAEA,OAAOD,YAAY;MACrB,CAAC;IACH;EACF,CAAC;EAED,OAAOJ,mBAAmB;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"migration.js","names":["ConditionType","isConditionListItemRefValueDataV2","value","type","ListItemRef","isConditionStringValueDataV2","StringValue","getListItem","model","listId","itemId","foundList","getListById","Error","item","items","find","id","createConditionValueDataFromListItemRefV2","refValue","display","text","Value","toString","createConditionValueDataFromStringValueDataV2","isConditionDataV2","condition","convertConditionDataV2","coordinator","component","getComponentById","componentId","newValue","field","name","title","operator","convertConditionRefDataFromV2","refCondition","getConditionById","conditionId","conditionName","conditionDisplayName","displayName","isConditionWrapperV2","wrapper","Array","isArray","isConditionWrapper","convertConditionWrapperFromV2","conditionWrapper","length","newConditionWrapper","conditions","map","index","newCondition","undefined"],"sources":["../../../src/conditions/migration.ts"],"sourcesContent":["import {\n type ComponentDef,\n type ConditionalComponentType\n} from '~/src/components/types.js'\nimport { ConditionType, type Coordinator } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\n type ConditionWrapperV2,\n type List\n} from '~/src/form/form-definition/types.js'\n\nfunction isConditionListItemRefValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionListItemRefValueDataV2 {\n return value.type === ConditionType.ListItemRef\n}\n\nfunction isConditionStringValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionStringValueDataV2 {\n return value.type === ConditionType.StringValue\n}\n\nfunction getListItem(model: RuntimeFormModel, listId: string, itemId: string) {\n const foundList = model.getListById(listId)\n\n if (!foundList) {\n throw Error('List not found')\n }\n\n const item = foundList.items.find((item) => item.id === itemId)\n\n if (!item) {\n throw Error('List item not found')\n }\n\n return item\n}\n\nfunction createConditionValueDataFromListItemRefV2(\n value: ConditionListItemRefValueDataV2,\n model: RuntimeFormModel\n): ConditionValueData {\n const refValue = getListItem(model, value.listId, value.itemId)\n\n return {\n display: refValue.text,\n type: ConditionType.Value,\n value: refValue.value.toString()\n }\n}\n\nfunction createConditionValueDataFromStringValueDataV2(\n value: ConditionStringValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value,\n display: value.value\n }\n}\n\nfunction isConditionDataV2(\n condition: ConditionDataV2 | ConditionRefDataV2\n): condition is ConditionDataV2 {\n return 'componentId' in condition\n}\n\nfunction convertConditionDataV2(\n model: RuntimeFormModel,\n condition: ConditionDataV2,\n coordinator: Coordinator | undefined\n): ConditionData {\n const component = model.getComponentById(condition.componentId)\n\n if (!component) {\n throw Error('Component not found')\n }\n\n let newValue\n if (isConditionListItemRefValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromListItemRefV2(condition.value, model)\n } else if (isConditionStringValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromStringValueDataV2(condition.value)\n } else {\n newValue = condition.value\n }\n\n return {\n field: {\n name: component.name,\n type: component.type as ConditionalComponentType /** @todo fix this */,\n display: component.title\n },\n operator: condition.operator,\n value: newValue,\n coordinator\n }\n}\n\nfunction convertConditionRefDataFromV2(\n model: RuntimeFormModel,\n condition: ConditionRefDataV2,\n coordinator: Coordinator | undefined\n): ConditionRefData {\n const refCondition = model.getConditionById(condition.conditionId)\n\n if (!refCondition) {\n throw Error('Component not found')\n }\n\n return {\n conditionName: refCondition.id,\n conditionDisplayName: refCondition.displayName,\n coordinator\n }\n}\n\nexport function isConditionWrapperV2(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapperV2 {\n return Array.isArray((wrapper as ConditionWrapperV2).items)\n}\n\nexport function isConditionWrapper(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapper {\n return !isConditionWrapperV2(wrapper)\n}\n\nexport function convertConditionWrapperFromV2(\n conditionWrapper: ConditionWrapperV2,\n model: RuntimeFormModel\n): ConditionWrapper {\n let coordinator\n\n if (conditionWrapper.items.length > 1 && !conditionWrapper.coordinator) {\n throw new Error('Coordinator is required for multiple conditions')\n } else {\n coordinator = conditionWrapper.coordinator\n }\n\n const newConditionWrapper: ConditionWrapper = {\n name: conditionWrapper.id,\n displayName: conditionWrapper.displayName,\n value: {\n name: conditionWrapper.id,\n conditions: conditionWrapper.items.map((condition, index) => {\n let newCondition: ConditionData | ConditionRefData\n\n if (isConditionDataV2(condition)) {\n newCondition = convertConditionDataV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\n } else {\n newCondition = convertConditionRefDataFromV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\n }\n\n return newCondition\n })\n }\n }\n\n return newConditionWrapper\n}\n\nexport interface RuntimeFormModel {\n getListById: (listId: string) => List | undefined\n getComponentById: (componentId: string) => ComponentDef | undefined\n getConditionById: (conditionId: string) => ConditionWrapperV2 | undefined\n}\n"],"mappings":"AAIA,SAASA,aAAa;AAiBtB,SAASC,iCAAiCA,CACxCC,KAGyB,EACiB;EAC1C,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACI,WAAW;AACjD;AAEA,SAASC,4BAA4BA,CACnCH,KAGyB,EACY;EACrC,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACM,WAAW;AACjD;AAEA,SAASC,WAAWA,CAACC,KAAuB,EAAEC,MAAc,EAAEC,MAAc,EAAE;EAC5E,MAAMC,SAAS,GAAGH,KAAK,CAACI,WAAW,CAACH,MAAM,CAAC;EAE3C,IAAI,CAACE,SAAS,EAAE;IACd,MAAME,KAAK,CAAC,gBAAgB,CAAC;EAC/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AAiD,CAAC;EACpE,CAAC,MAAM;IACLe,WAAW,GAAGsB,gBAAgB,CAACtB,WAAW;EAC5C;EAEA,MAAMwB,mBAAqC,GAAG;IAC5ClB,IAAI,EAAEgB,gBAAgB,CAACjC,EAAE;IACzB0B,WAAW,EAAEO,gBAAgB,CAACP,WAAW;IACzCzC,KAAK,EAAE;MACLgC,IAAI,EAAEgB,gBAAgB,CAACjC,EAAE;MACzBoC,UAAU,EAAEH,gBAAgB,CAACnC,KAAK,CAACuC,GAAG,CAAC,CAAC5B,SAAS,EAAE6B,KAAK,KAAK;QAC3D,IAAIC,YAA8C;QAElD,IAAI/B,iBAAiB,CAACC,SAAS,CAAC,EAAE;UAChC8B,YAAY,GAAG7B,sBAAsB,CACnCnB,KAAK,EACLkB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH,CAAC,MAAM;UACLD,YAAY,GAAGnB,6BAA6B,CAC1C7B,KAAK,EACLkB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH;QAEA,OAAOD,YAAY;MACrB,CAAC;IACH;EACF,CAAC;EAED,OAAOJ,mBAAmB;AAC5B","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  import Joi from 'joi';
2
2
  import { v4 as uuidV4 } from 'uuid';
3
3
  import { ComponentType } from "../../components/enums.js";
4
+ import { yesNoListId, yesNoListNoItemId, yesNoListYesItemId } from "../../components/yes-no-helper.js";
4
5
  import { SchemaVersion } from "./types.js";
5
6
  import { ControllerType } from "../../pages/enums.js";
6
7
  import { hasComponents } from "../../pages/helpers.js";
@@ -17,10 +18,14 @@ const componentIdRefSchema = Joi.ref('/pages', {
17
18
  const listIdRef = Joi.ref('/lists', {
18
19
  in: true,
19
20
  adjust: lists => lists.filter(list => list.id).map(list => list.id)
21
+ // To allow YesNo list to be valid even though the virtual list may not exist explicitly in the form definition
22
+ .concat(yesNoListId)
20
23
  });
21
24
  const listItemIdRef = Joi.ref('/lists', {
22
25
  in: true,
23
26
  adjust: lists => lists.flatMap(list => list.items.filter(item => item.id).map(item => item.id))
27
+ // To allow YesNo list items to be valid even though the virtual list may not exist explicitly in the form definition
28
+ .concat([yesNoListYesItemId, yesNoListNoItemId])
24
29
  });
25
30
  const sectionsSchema = Joi.object().description('A form section grouping related pages together').keys({
26
31
  name: Joi.string().trim().required().description('Unique identifier for the section, used in code and page references'),
@@ -76,14 +81,14 @@ const conditionSchema = Joi.object().description('Condition definition specifyin
76
81
  value: Joi.alternatives().try(conditionValueSchema, relativeDateValueDataSchema).description('Value to compare the field against, either fixed or relative date'),
77
82
  coordinator: Joi.string().trim().optional().description('Logical operator connecting this condition with others (AND, OR)')
78
83
  });
79
- const conditionDataSchemaV2 = Joi.object().description('Condition definition').keys({
84
+ export const conditionDataSchemaV2 = Joi.object().description('Condition definition').keys({
80
85
  id: idSchema.description('Unique identifier used to reference this condition'),
81
- componentId: Joi.string().trim().valid().required().when('/pages', {
86
+ componentId: Joi.string().trim().required().when('/pages', {
82
87
  is: Joi.exist(),
83
88
  then: Joi.valid(componentIdRefSchema)
84
89
  }).description('Reference to the component id being evaluated in this condition'),
85
90
  operator: Joi.string().trim().required().description('Comparison operator (equals, greaterThan, contains, etc.)'),
86
- value: Joi.alternatives().try(conditionStringValueDataSchemaV2, conditionListItemRefDataSchemaV2, relativeDateValueDataSchema).description('Value to compare the field against, either fixed or relative date')
91
+ value: Joi.alternatives().try(conditionStringValueDataSchemaV2, conditionListItemRefDataSchemaV2, relativeDateValueDataSchema).required().description('Value to compare the field against, either fixed or relative date')
87
92
  });
88
93
  const conditionGroupSchema = Joi.object().description('Group of conditions combined with logical operators').keys({
89
94
  conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, Joi.link('#conditionGroupSchema'))).description('Array of conditions or condition references in this group')
@@ -100,8 +105,11 @@ const conditionWrapperSchema = Joi.object().description('Container for a named c
100
105
  export const conditionWrapperSchemaV2 = Joi.object().description('Container for a named condition with its definition').keys({
101
106
  id: idSchema.description('Unique identifier for the condition'),
102
107
  displayName: Joi.string().trim().description('Human-readable name for display in the UI'),
103
- coordinator: Joi.string().optional().description('Logical operator connecting this condition with others (AND, OR)'),
104
- items: Joi.array().items(Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2)).description('Array of conditions or condition references')
108
+ coordinator: Joi.string().optional().when('items', {
109
+ is: Joi.array().min(2),
110
+ then: Joi.required()
111
+ }).description('Logical operator connecting this condition with others (AND, OR)'),
112
+ items: Joi.array().items(Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2).required()).min(1).max(15).description('Array of conditions or condition references')
105
113
  }).description('Condition schema for V2 forms');
106
114
  export const componentSchema = Joi.object().description('Form component definition specifying UI element behavior').keys({
107
115
  id: idSchemaOptional.description('Unique identifier for the component'),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","SchemaVersion","ControllerType","hasComponents","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionStringValueDataSchemaV2","valid","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","itemId","relativeDateValueDataSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","componentSchemaV2","componentPayloadSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","pageSchema","disallow","section","controller","repeat","any","strip","next","events","view","pageSchemaV2","append","switch","FileUpload","pagePayloadSchemaV2","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","messages","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","integer","V1","feedback","startPage","sections","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import Joi, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n SchemaVersion,\n type ConditionWrapper,\n type ConditionWrapperV2,\n type Event,\n type EventOptions,\n type Events,\n type FormDefinition,\n type Item,\n type Link,\n type List,\n type Page,\n type PhaseBanner,\n type Repeat,\n type RepeatOptions,\n type RepeatSchema,\n type Section\n} from '~/src/form/form-definition/types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.filter((list) => list.id).map((list) => list.id)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst conditionStringValueDataSchemaV2 =\n Joi.object<ConditionStringValueDataV2>()\n .description('String value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('StringValue')\n .required()\n .description('Type of the condition value, should be \"StringValue\"'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('ListItemRef')\n .required()\n .description('Type of the condition value, should be \"ListItemRef\"'),\n listId: Joi.string()\n .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .trim()\n .valid('RelativeDate')\n .required()\n .description('Type of the condition value, should be \"RelativeDate\"'),\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .valid()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(\n conditionStringValueDataSchemaV2,\n conditionListItemRefDataSchemaV2,\n relativeDateValueDataSchema\n )\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2)\n )\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('name')\n .unique('id')\n .min(1)\n .max(2)\n .description('Components allowed on Page Upload schema')\n\n/**\n * `/status` is a special route for providing a user's application status.\n * It should not be configured via the designer.\n */\nexport const pageSchema = Joi.object<Page>()\n .description('Form page definition specifying content and behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the page'),\n path: Joi.string()\n .trim()\n .required()\n .disallow('/status')\n .description(\n 'URL path for this page, must not be the reserved \"/status\" path'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().trim().description('Section this page belongs to'),\n controller: Joi.string()\n .trim()\n .optional()\n .description('Custom controller class name for special page behavior'),\n components: Joi.array<ComponentDef>()\n .items(componentSchema)\n .unique('name')\n .description('UI components displayed on this page'),\n repeat: Joi.when('controller', {\n is: Joi.string().trim().valid('RepeatPageController').required(),\n then: pageRepeatSchema\n .required()\n .description(\n 'Configuration for repeatable pages, required when using RepeatPageController'\n ),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional condition that determines if this page is shown'),\n next: Joi.array<Link>()\n .items(nextSchema)\n .default([])\n .description('Possible navigation paths after this page'),\n events: eventsSchema\n .optional()\n .description('Event handlers for page lifecycle events'),\n view: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional custom view template to use for rendering this page'\n )\n })\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema\n .append({\n id: idSchema.description('Unique identifier for the page'),\n title: Joi.string()\n .trim()\n .allow('')\n .required()\n .description(\n 'Page title displayed at the top of the page (with support for empty titles in V2)'\n ),\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n }),\n condition: Joi.string()\n .trim()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('text')\n .unique('value')\n .messages({\n 'array.unique':\n 'Each item must have a unique identifier - enter a different identifier for this item.'\n })\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n })\n })\n\n/**\n * V2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: idSchema.description('Unique identifier for the list')\n })\n .description('List schema for V2 forms')\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>()\n .description('Feedback configuration for the form')\n .keys({\n feedbackForm: Joi.boolean()\n .default(false)\n .description('Whether to show the built-in feedback form'),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'URL to an external feedback form when not using built-in feedback'\n )\n }),\n emailAddress: Joi.string()\n .trim()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n .description('Email address where feedback is sent')\n })\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>()\n .description('Phase banner configuration showing development status')\n .keys({\n phase: Joi.string()\n .trim()\n .valid('alpha', 'beta')\n .description('Development phase of the service (alpha or beta)')\n })\n\nconst outputSchema = Joi.object<FormDefinition['output']>()\n .description('Configuration for form submission output')\n .keys({\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier for the output format')\n })\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .description('Complete form definition describing all aspects of a form')\n .required()\n .keys({\n engine: Joi.string()\n .trim()\n .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V1)\n .default(SchemaVersion.V1)\n .description('Form schema version to use (1 or 2)'),\n name: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Unique name identifying the form'),\n feedback: feedbackSchema\n .optional()\n .description('Feedback mechanism configuration'),\n startPage: Joi.string()\n .trim()\n .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .items(pageSchema)\n .description('Pages schema for V1 forms')\n .unique('path'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together'),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic'),\n lists: Joi.array<List>()\n .items(listSchema)\n .unique('name')\n .unique('title')\n .description('Reusable lists of options for select components'),\n metadata: Joi.object({ a: Joi.any() })\n .unknown()\n .optional()\n .description('Custom metadata for the form'),\n declaration: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Declaration text shown on the summary page'),\n skipSummary: Joi.any()\n .strip()\n .description('option to skip the summary page'),\n phaseBanner: phaseBannerSchema\n .optional()\n .description('Phase banner configuration'),\n outputEmail: Joi.string()\n .trim()\n .email({ tlds: { allow: ['uk'] } })\n .optional()\n .description('Email address where form submissions are sent'),\n output: outputSchema\n .optional()\n .description('Configuration for submission output format')\n })\n\nexport const formDefinitionV2Schema = formDefinitionSchema\n .keys({\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V2)\n .description('Form schema version to use (2)'),\n pages: Joi.array<Page>()\n .items(pageSchemaV2)\n .required()\n .unique('path')\n .unique('id')\n .description('Pages schema for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id')\n .description('Lists schema for V2 forms'),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\n })\n .description('Form definition schema for V2')\n\n// Maintain compatibility with legacy named export\n// E.g. `import { Schema } from '@defra/forms-model'`\nexport const Schema = formDefinitionSchema\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAoBtB,SACEC,aAAa;AAiBf,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,gBAAgB,GAAGP,GAAG,CAACQ,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC;AAE5C,MAAMC,QAAQ,GAAGH,gBAAgB,CAACI,OAAO,CAAC,MAAMT,MAAM,CAAC,CAAC,CAAC;AAEzD,MAAMU,cAAc,GAAGZ,GAAG,CAACa,GAAG,CAAC,aAAa,EAAE;EAC5CC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGC,UAAgC,IACvCA,UAAU,CAACC,GAAG,CAAEC,SAAS,IAAKA,SAAS,CAACC,EAAE;AAC9C,CAAC,CAAC;AAEF,MAAMC,oBAAoB,GAAGpB,GAAG,CAACa,GAAG,CAAC,QAAQ,EAAE;EAC7CC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGM,KAAa,IACpBA,KAAK,CAACC,OAAO,CAAEC,IAAI,IACjBjB,aAAa,CAACiB,IAAI,CAAC,GACfA,IAAI,CAACC,UAAU,CACZC,MAAM,CAAEC,SAAS,IAAKA,SAAS,CAACP,EAAE,CAAC,CACnCF,GAAG,CAAES,SAAS,IAAKA,SAAS,CAACP,EAAE,CAAC,GACnC,EACN;AACJ,CAAC,CAAC;AAEF,MAAMQ,SAAS,GAAG3B,GAAG,CAACa,GAAG,CAAC,QAAQ,EAAE;EAClCC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGa,KAAa,IACpBA,KAAK,CAACH,MAAM,CAAEI,IAAI,IAAKA,IAAI,CAACV,EAAE,CAAC,CAACF,GAAG,CAAEY,IAAI,IAAKA,IAAI,CAACV,EAAE;AACzD,CAAC,CAAC;AAEF,MAAMW,aAAa,GAAG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C,CAAC,CACVR,WAAW,CAAC,4CAA4C;AAC7D,CAAC,CAAC;AAEJ,OAAO,MAAM4I,sBAAsB,GAAGd,oBAAoB,CACvD7H,IAAI,CAAC;EACJkE,MAAM,EAAEtG,GAAG,CAAC8F,MAAM,CAAC,CAAC,CACjBqE,OAAO,CAAC,CAAC,CACTjH,KAAK,CAAC9C,aAAa,CAAC4K,EAAE,CAAC,CACvB7I,WAAW,CAAC,gCAAgC,CAAC;EAChDd,KAAK,EAAErB,GAAG,CAAC4E,KAAK,CAAO,CAAC,CACrB7C,KAAK,CAAC2G,YAAY,CAAC,CACnBnG,QAAQ,CAAC,CAAC,CACVwF,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,CAAC,CACZ5F,WAAW,CAAC,2BAA2B,CAAC;EAC3CP,KAAK,EAAE5B,GAAG,CAAC4E,KAAK,CAAO,CAAC,CACrB7C,KAAK,CAACuH,YAAY,CAAC,CACnBvB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,CAAC,CACZ5F,WAAW,CAAC,2BAA2B,CAAC;EAC3CnB,UAAU,EAAEhB,GAAG,CAAC4E,KAAK,CAAqB,CAAC,CACxC7C,KAAK,CAACkD,wBAAwB,CAAC,CAC/B8C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrB5F,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM8I,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","yesNoListId","yesNoListNoItemId","yesNoListYesItemId","SchemaVersion","ControllerType","hasComponents","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","concat","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionStringValueDataSchemaV2","valid","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","itemId","relativeDateValueDataSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","min","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","componentPayloadSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","pageSchema","disallow","section","controller","repeat","any","strip","next","events","view","pageSchemaV2","append","switch","FileUpload","pagePayloadSchemaV2","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","messages","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","integer","V1","feedback","startPage","sections","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import Joi, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport {\n yesNoListId,\n yesNoListNoItemId,\n yesNoListYesItemId\n} from '~/src/components/yes-no-helper.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n SchemaVersion,\n type ConditionWrapper,\n type ConditionWrapperV2,\n type Event,\n type EventOptions,\n type Events,\n type FormDefinition,\n type Item,\n type Link,\n type List,\n type Page,\n type PhaseBanner,\n type Repeat,\n type RepeatOptions,\n type RepeatSchema,\n type Section\n} from '~/src/form/form-definition/types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists\n .filter((list) => list.id)\n .map((list) => list.id)\n // To allow YesNo list to be valid even though the virtual list may not exist explicitly in the form definition\n .concat(yesNoListId)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists\n .flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n // To allow YesNo list items to be valid even though the virtual list may not exist explicitly in the form definition\n .concat([yesNoListYesItemId, yesNoListNoItemId])\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst conditionStringValueDataSchemaV2 =\n Joi.object<ConditionStringValueDataV2>()\n .description('String value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('StringValue')\n .required()\n .description('Type of the condition value, should be \"StringValue\"'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('ListItemRef')\n .required()\n .description('Type of the condition value, should be \"ListItemRef\"'),\n listId: Joi.string()\n .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .trim()\n .valid('RelativeDate')\n .required()\n .description('Type of the condition value, should be \"RelativeDate\"'),\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(\n conditionStringValueDataSchemaV2,\n conditionListItemRefDataSchemaV2,\n relativeDateValueDataSchema\n )\n .required()\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives()\n .try(conditionDataSchemaV2, conditionRefDataSchemaV2)\n .required()\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('name')\n .unique('id')\n .min(1)\n .max(2)\n .description('Components allowed on Page Upload schema')\n\n/**\n * `/status` is a special route for providing a user's application status.\n * It should not be configured via the designer.\n */\nexport const pageSchema = Joi.object<Page>()\n .description('Form page definition specifying content and behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the page'),\n path: Joi.string()\n .trim()\n .required()\n .disallow('/status')\n .description(\n 'URL path for this page, must not be the reserved \"/status\" path'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().trim().description('Section this page belongs to'),\n controller: Joi.string()\n .trim()\n .optional()\n .description('Custom controller class name for special page behavior'),\n components: Joi.array<ComponentDef>()\n .items(componentSchema)\n .unique('name')\n .description('UI components displayed on this page'),\n repeat: Joi.when('controller', {\n is: Joi.string().trim().valid('RepeatPageController').required(),\n then: pageRepeatSchema\n .required()\n .description(\n 'Configuration for repeatable pages, required when using RepeatPageController'\n ),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional condition that determines if this page is shown'),\n next: Joi.array<Link>()\n .items(nextSchema)\n .default([])\n .description('Possible navigation paths after this page'),\n events: eventsSchema\n .optional()\n .description('Event handlers for page lifecycle events'),\n view: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional custom view template to use for rendering this page'\n )\n })\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema\n .append({\n id: idSchema.description('Unique identifier for the page'),\n title: Joi.string()\n .trim()\n .allow('')\n .required()\n .description(\n 'Page title displayed at the top of the page (with support for empty titles in V2)'\n ),\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n }),\n condition: Joi.string()\n .trim()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('text')\n .unique('value')\n .messages({\n 'array.unique':\n 'Each item must have a unique identifier - enter a different identifier for this item.'\n })\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n })\n })\n\n/**\n * V2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: idSchema.description('Unique identifier for the list')\n })\n .description('List schema for V2 forms')\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>()\n .description('Feedback configuration for the form')\n .keys({\n feedbackForm: Joi.boolean()\n .default(false)\n .description('Whether to show the built-in feedback form'),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'URL to an external feedback form when not using built-in feedback'\n )\n }),\n emailAddress: Joi.string()\n .trim()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n .description('Email address where feedback is sent')\n })\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>()\n .description('Phase banner configuration showing development status')\n .keys({\n phase: Joi.string()\n .trim()\n .valid('alpha', 'beta')\n .description('Development phase of the service (alpha or beta)')\n })\n\nconst outputSchema = Joi.object<FormDefinition['output']>()\n .description('Configuration for form submission output')\n .keys({\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier for the output format')\n })\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .description('Complete form definition describing all aspects of a form')\n .required()\n .keys({\n engine: Joi.string()\n .trim()\n .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V1)\n .default(SchemaVersion.V1)\n .description('Form schema version to use (1 or 2)'),\n name: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Unique name identifying the form'),\n feedback: feedbackSchema\n .optional()\n .description('Feedback mechanism configuration'),\n startPage: Joi.string()\n .trim()\n .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .items(pageSchema)\n .description('Pages schema for V1 forms')\n .unique('path'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together'),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic'),\n lists: Joi.array<List>()\n .items(listSchema)\n .unique('name')\n .unique('title')\n .description('Reusable lists of options for select components'),\n metadata: Joi.object({ a: Joi.any() })\n .unknown()\n .optional()\n .description('Custom metadata for the form'),\n declaration: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Declaration text shown on the summary page'),\n skipSummary: Joi.any()\n .strip()\n .description('option to skip the summary page'),\n phaseBanner: phaseBannerSchema\n .optional()\n .description('Phase banner configuration'),\n outputEmail: Joi.string()\n .trim()\n .email({ tlds: { allow: ['uk'] } })\n .optional()\n .description('Email address where form submissions are sent'),\n output: outputSchema\n .optional()\n .description('Configuration for submission output format')\n })\n\nexport const formDefinitionV2Schema = formDefinitionSchema\n .keys({\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V2)\n .description('Form schema version to use (2)'),\n pages: Joi.array<Page>()\n .items(pageSchemaV2)\n .required()\n .unique('path')\n .unique('id')\n .description('Pages schema for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id')\n .description('Lists schema for V2 forms'),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\n })\n .description('Form definition schema for V2')\n\n// Maintain compatibility with legacy named export\n// E.g. `import { Schema } from '@defra/forms-model'`\nexport const Schema = formDefinitionSchema\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAMtB,SACEC,WAAW,EACXC,iBAAiB,EACjBC,kBAAkB;AAgBpB,SACEC,aAAa;AAiBf,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,gBAAgB,GAAGV,GAAG,CAACW,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC;AAE5C,MAAMC,QAAQ,GAAGH,gBAAgB,CAACI,OAAO,CAAC,MAAMZ,MAAM,CAAC,CAAC,CAAC;AAEzD,MAA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BAAoB,CACvD7H,IAAI,CAAC;EACJoE,MAAM,EAAE5G,GAAG,CAACoG,MAAM,CAAC,CAAC,CACjBmE,OAAO,CAAC,CAAC,CACTjH,KAAK,CAAC/C,aAAa,CAAC6K,EAAE,CAAC,CACvB7I,WAAW,CAAC,gCAAgC,CAAC;EAChDf,KAAK,EAAExB,GAAG,CAACgF,KAAK,CAAO,CAAC,CACrB7C,KAAK,CAAC2G,YAAY,CAAC,CACnBnG,QAAQ,CAAC,CAAC,CACVwF,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,CAAC,CACZ5F,WAAW,CAAC,2BAA2B,CAAC;EAC3CR,KAAK,EAAE/B,GAAG,CAACgF,KAAK,CAAO,CAAC,CACrB7C,KAAK,CAACuH,YAAY,CAAC,CACnBvB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,CAAC,CACZ5F,WAAW,CAAC,2BAA2B,CAAC;EAC3CpB,UAAU,EAAEnB,GAAG,CAACgF,KAAK,CAAqB,CAAC,CACxC7C,KAAK,CAACkD,wBAAwB,CAAC,CAC/B8C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrB5F,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM8I,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
@@ -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\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":[]}
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 {\n type ConditionWrapperV2,\n type DateDirections,\n type DateUnits,\n type Item\n} 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 /**\n * List item id for conditions\n */\n itemId: string\n\n /**\n * Relative date period for conditions\n */\n period: string\n\n /**\n * Relative date unit for conditions\n */\n unit: DateUnits\n\n /**\n * Relative date direction for conditions\n */\n direction: DateDirections\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 ConditionSessionState {\n id?: string\n stateId?: string\n conditionWrapper?: ConditionWrapperV2\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":[]}
@@ -1,5 +1,6 @@
1
1
  export { ComponentTypes } from '../components/component-types.js';
2
2
  export { getComponentDefaults, hasConditionSupport, hasContent, hasContentField, hasFormField, hasHint, hasInputField, hasListField, hasSelectionFields, hasTitle, isConditionalType, isContentType, isFormType, isListType } from '../components/helpers.js';
3
3
  export { allDocumentTypes, allImageTypes, allTabularDataTypes } from '../components/file-types.js';
4
+ export { getYesNoList, yesNoListId, yesNoListName, yesNoListNoItemId, yesNoListYesItemId } from '../components/yes-no-helper.js';
4
5
  export { ComponentType } from '../components/enums.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACX,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACX,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { SchemaVersion, type List } from '../form/form-definition/types.js';
2
+ export declare const yesNoListId = "3167ecb5-61f9-4918-b7d0-6793b56aa814";
3
+ export declare const yesNoListName = "__yesNo";
4
+ export declare const yesNoListYesItemId = "02900d42-83d1-4c72-a719-c4e8228952fa";
5
+ export declare const yesNoListNoItemId = "f39000eb-c51b-4019-8f82-bbda0423f04d";
6
+ export declare function getYesNoList(schemaVersion?: SchemaVersion): List;
7
+ //# sourceMappingURL=yes-no-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yes-no-helper.d.ts","sourceRoot":"","sources":["../../../src/components/yes-no-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,MAAM,qCAAqC,CAAA;AAE9E,eAAO,MAAM,WAAW,yCAAyC,CAAA;AACjE,eAAO,MAAM,aAAa,YAAY,CAAA;AACtC,eAAO,MAAM,kBAAkB,yCAAyC,CAAA;AACxE,eAAO,MAAM,iBAAiB,yCAAyC,CAAA;AAEvE,wBAAgB,YAAY,CAAC,aAAa,GAAE,aAAgC,GAkBrE,IAAI,CACV"}
@@ -2,7 +2,7 @@ import { type ConditionGroup } from '../conditions/condition-group.js';
2
2
  import { type ConditionRef } from '../conditions/condition-ref.js';
3
3
  import { type Condition } from '../conditions/condition.js';
4
4
  import { type ConditionData, type ConditionGroupData, type ConditionRefData } from '../conditions/types.js';
5
- import { type ConditionWrapper } from '../form/form-definition/types.js';
5
+ import { type ConditionWrapper, type FormDefinition } from '../form/form-definition/types.js';
6
6
  type ConditionType = Condition | ConditionRef | ConditionGroup;
7
7
  type ConditionDataType = ConditionGroupData | ConditionData | ConditionRefData;
8
8
  export declare function toPresentationString(condition: ConditionType): string;
@@ -13,5 +13,6 @@ export declare const hasConditionGroup: (condition?: ConditionDataType) => condi
13
13
  export declare const hasConditionName: (condition?: ConditionDataType) => condition is ConditionRefData;
14
14
  export declare const hasNestedCondition: (condition?: ConditionWrapper) => boolean;
15
15
  export declare const isDuplicateCondition: (conditions: ConditionWrapper[], conditionName: string) => boolean;
16
+ export declare const getConditionV2: (definition: FormDefinition, conditionId: string) => import("../form/form-definition/types.js").ConditionWrapperV2;
16
17
  export {};
17
18
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/conditions/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D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AqC,CAAA;AAE5C,KAAK,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,CAAA;AAC9D,KAAK,iBAAiB,GAAG,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAE9E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,aAAa,UAE5D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,aAAa,UAE1D;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,aAAa,UAEpD;AAED,eAAO,MAAM,iBAAiB,GAC5B,YAAY,iBAAiB,KAC5B,SAAS,IAAI,aAEf,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,YAAY,iBAAiB,KAC5B,SAAS,IAAI,kBAEf,CAAA;AAED,eAAO,MAAM,gBAAgB,GAC3B,YAAY,iBAAiB,KAC5B,SAAS,IAAI,gBAEf,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,YAAY,gBAAgB,YAE9D,CAAA;AAED,eAAO,MAAM,oBAAoB,GAC/B,YAAY,gBAAgB,EAAE,EAC9B,eAAe,MAAM,YAGtB,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,YAAY,cAAc,EAC1B,aAAa,MAAM,qEAWpB,CAAA"}
@@ -6,7 +6,7 @@ export { ConditionRef } from '../conditions/condition-ref.js';
6
6
  export { ConditionGroup } from '../conditions/condition-group.js';
7
7
  export { ConditionsModel } from '../conditions/condition-model.js';
8
8
  export { ConditionGroupDef } from '../conditions/condition-group-def.js';
9
- export { hasConditionField, hasConditionGroup, hasConditionName, hasNestedCondition, isDuplicateCondition, toExpression, toPresentationString } from '../conditions/helpers.js';
9
+ export { getConditionV2, hasConditionField, hasConditionGroup, hasConditionName, hasNestedCondition, isDuplicateCondition, toExpression, toPresentationString } from '../conditions/helpers.js';
10
10
  export { convertConditionWrapperFromV2, isConditionWrapper, isConditionWrapperV2, type RuntimeFormModel } from '../conditions/migration.js';
11
11
  export { ConditionType, Coordinator, DateDirections, DateUnits, Operator, OperatorName } from '../conditions/enums.js';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/conditions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACrB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,aAAa,EACb,WAAW,EACX,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACb,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/conditions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACrB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,aAAa,EACb,WAAW,EACX,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACb,MAAM,2BAA2B,CAAA"}
@@ -1 +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,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,kBAAkB,CAE/B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,gBAAgB,CAE7B;AAED,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;IACnE,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAA;CAC1E"}
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,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,kBAAkB,CAE/B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,gBAAgB,CAE7B;AAED,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,kBAAkB,EACpC,KAAK,EAAE,gBAAgB,GACtB,gBAAgB,CAqClB;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;IACnE,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAA;CAC1E"}
@@ -1,6 +1,8 @@
1
1
  import Joi from 'joi';
2
2
  import { type ComponentDef, type ContentComponentsDef, type FileUploadFieldComponent } from '../../components/types.js';
3
+ import { type ConditionDataV2 } from '../../conditions/types.js';
3
4
  import { type ConditionWrapperV2, type FormDefinition, type List, type Page, type Repeat } from '../../form/form-definition/types.js';
5
+ export declare const conditionDataSchemaV2: Joi.ObjectSchema<ConditionDataV2>;
4
6
  export declare const conditionWrapperSchemaV2: Joi.ObjectSchema<ConditionWrapperV2>;
5
7
  export declare const componentSchema: Joi.ObjectSchema<ComponentDef>;
6
8
  export declare const componentSchemaV2: Joi.ObjectSchema<ComponentDef>;
@@ -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,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAA;AAelC,OAAO,EAGL,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAET,KAAK,MAAM,EAIZ,MAAM,qCAAqC,CAAA;AAyS5C,eAAO,MAAM,wBAAwB,sCAkBU,CAAA;AAE/C,eAAO,MAAM,eAAe,gCAkGZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAaiB,CAAA;AAE/C,eAAO,MAAM,wBAAwB,gCASsB,CAAA;AAE3D,eAAO,MAAM,yBAAyB,gCAMpC,CAAA;AAEF,eAAO,MAAM,sBAAsB,gCAUjC,CAAA;AAoDF,eAAO,MAAM,gBAAgB,0BASzB,CAAA;AAyCJ,eAAO,MAAM,0BAA0B,kEAWmB,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAmDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAgCiB,CAAA;AAE1C,eAAO,MAAM,mBAAmB,wBAgBkB,CAAA;AAwDlD,eAAO,MAAM,UAAU,wBAkCnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAIiB,CAAA;AAsD1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kCAsE7B,CAAA;AAEJ,eAAO,MAAM,sBAAsB,kCAwBY,CAAA;AAI/C,eAAO,MAAM,MAAM,kCAAuB,CAAA"}
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,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAA;AAMlC,OAAO,EAEL,KAAK,eAAe,EAWrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAET,KAAK,MAAM,EAIZ,MAAM,qCAAqC,CAAA;AA8N5C,eAAO,MAAM,qBAAqB,mCA8B9B,CAAA;AAoDJ,eAAO,MAAM,wBAAwB,sCAuBU,CAAA;AAE/C,eAAO,MAAM,eAAe,gCAkGZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAaiB,CAAA;AAE/C,eAAO,MAAM,wBAAwB,gCASsB,CAAA;AAE3D,eAAO,MAAM,yBAAyB,gCAMpC,CAAA;AAEF,eAAO,MAAM,sBAAsB,gCAUjC,CAAA;AAoDF,eAAO,MAAM,gBAAgB,0BASzB,CAAA;AAyCJ,eAAO,MAAM,0BAA0B,kEAWmB,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAmDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAgCiB,CAAA;AAE1C,eAAO,MAAM,mBAAmB,wBAgBkB,CAAA;AAwDlD,eAAO,MAAM,UAAU,wBAkCnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAIiB,CAAA;AAsD1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kCAsE7B,CAAA;AAEJ,eAAO,MAAM,sBAAsB,kCAwBY,CAAA;AAI/C,eAAO,MAAM,MAAM,kCAAuB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { type ComponentType } from '../../components/enums.js';
2
2
  import { type ComponentDef } from '../../components/types.js';
3
- import { type Item } from '../../index.js';
3
+ import { type ConditionWrapperV2, type DateDirections, type DateUnits, type Item } from '../../index.js';
4
4
  /**
5
5
  * Interface for `FormEditor` Joi schema
6
6
  */
@@ -197,6 +197,22 @@ export interface FormEditor {
197
197
  * Set to 'true' is Javascript is enabled
198
198
  */
199
199
  jsEnabled: string;
200
+ /**
201
+ * List item id for conditions
202
+ */
203
+ itemId: string;
204
+ /**
205
+ * Relative date period for conditions
206
+ */
207
+ period: string;
208
+ /**
209
+ * Relative date unit for conditions
210
+ */
211
+ unit: DateUnits;
212
+ /**
213
+ * Relative date direction for conditions
214
+ */
215
+ direction: DateDirections;
200
216
  }
201
217
  export type FormEditorInputPage = Pick<FormEditor, 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'>;
202
218
  export type FormEditorInputCheckAnswersSettings = Pick<FormEditor, 'needDeclaration' | 'declarationText'>;
@@ -250,6 +266,11 @@ export interface QuestionSessionState {
250
266
  lastMovedId?: string;
251
267
  lastMoveDirection?: string;
252
268
  }
269
+ export interface ConditionSessionState {
270
+ id?: string;
271
+ stateId?: string;
272
+ conditionWrapper?: ConditionWrapperV2;
273
+ }
253
274
  export interface GovukFieldItem {
254
275
  text?: string;
255
276
  value?: string;
@@ -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;IAEhC;;OAEG;IACH,gBAAgB,EAAE,MAA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GAAG,MAAM,wBAAwB,CAAA;AAEzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,aAAa,EACb,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACvB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,IAAI,CAAA;AAElD,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,IAAI,CAAA;AAE5D,MAAM,WAAW,2BAA2B;IAC1C,GAAG,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,GAAG,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.472",
3
+ "version": "3.0.474",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "types": "dist/types/index.d.ts",
@@ -1529,14 +1529,11 @@
1529
1529
  "description": "Human-readable name for display in the UI",
1530
1530
  "title": "Display Name"
1531
1531
  },
1532
- "coordinator": {
1533
- "type": "string",
1534
- "description": "Logical operator connecting this condition with others (AND, OR)",
1535
- "title": "Coordinator"
1536
- },
1537
1532
  "items": {
1538
1533
  "type": "array",
1539
1534
  "description": "Array of conditions or condition references\n\nElements can be direct conditions, references to named conditions, or nested condition groups. This structure allows building complex logical expressions with AND/OR operators.",
1535
+ "minItems": 1,
1536
+ "maxItems": 15,
1540
1537
  "items": {
1541
1538
  "anyOf": [
1542
1539
  {
@@ -1580,7 +1577,8 @@
1580
1577
  },
1581
1578
  "required": [
1582
1579
  "componentId",
1583
- "operator"
1580
+ "operator",
1581
+ "value"
1584
1582
  ],
1585
1583
  "additionalProperties": false,
1586
1584
  "title": "Unknown Condition Item Type"
@@ -1624,6 +1622,18 @@
1624
1622
  ]
1625
1623
  },
1626
1624
  "title": "Items"
1625
+ },
1626
+ "coordinator": {
1627
+ "type": [
1628
+ "array",
1629
+ "boolean",
1630
+ "number",
1631
+ "object",
1632
+ "string",
1633
+ "null"
1634
+ ],
1635
+ "description": "Logical operator connecting this condition with others (AND, OR)",
1636
+ "title": "Coordinator"
1627
1637
  }
1628
1638
  },
1629
1639
  "additionalProperties": false,
@@ -20,4 +20,11 @@ export {
20
20
  allImageTypes,
21
21
  allTabularDataTypes
22
22
  } from '~/src/components/file-types.js'
23
+ export {
24
+ getYesNoList,
25
+ yesNoListId,
26
+ yesNoListName,
27
+ yesNoListNoItemId,
28
+ yesNoListYesItemId
29
+ } from '~/src/components/yes-no-helper.js'
23
30
  export { ComponentType } from '~/src/components/enums.js'
@@ -0,0 +1,27 @@
1
+ import { SchemaVersion, type List } from '~/src/form/form-definition/types.js'
2
+
3
+ export const yesNoListId = '3167ecb5-61f9-4918-b7d0-6793b56aa814'
4
+ export const yesNoListName = '__yesNo'
5
+ export const yesNoListYesItemId = '02900d42-83d1-4c72-a719-c4e8228952fa'
6
+ export const yesNoListNoItemId = 'f39000eb-c51b-4019-8f82-bbda0423f04d'
7
+
8
+ export function getYesNoList(schemaVersion: SchemaVersion = SchemaVersion.V2) {
9
+ return {
10
+ id: schemaVersion === SchemaVersion.V1 ? yesNoListName : yesNoListId,
11
+ name: '__yesNo',
12
+ title: 'Yes/No',
13
+ type: 'boolean',
14
+ items: [
15
+ {
16
+ id: yesNoListYesItemId,
17
+ text: 'Yes',
18
+ value: true
19
+ },
20
+ {
21
+ id: yesNoListNoItemId,
22
+ text: 'No',
23
+ value: false
24
+ }
25
+ ]
26
+ } as List
27
+ }
@@ -1,12 +1,16 @@
1
1
  import { type ConditionGroup } from '~/src/conditions/condition-group.js'
2
2
  import { type ConditionRef } from '~/src/conditions/condition-ref.js'
3
3
  import { type Condition } from '~/src/conditions/condition.js'
4
+ import { isConditionWrapperV2 } from '~/src/conditions/migration.js'
4
5
  import {
5
6
  type ConditionData,
6
7
  type ConditionGroupData,
7
8
  type ConditionRefData
8
9
  } from '~/src/conditions/types.js'
9
- import { type ConditionWrapper } from '~/src/form/form-definition/types.js'
10
+ import {
11
+ type ConditionWrapper,
12
+ type FormDefinition
13
+ } from '~/src/form/form-definition/types.js'
10
14
 
11
15
  type ConditionType = Condition | ConditionRef | ConditionGroup
12
16
  type ConditionDataType = ConditionGroupData | ConditionData | ConditionRefData
@@ -51,3 +55,18 @@ export const isDuplicateCondition = (
51
55
  ) => {
52
56
  return conditions.some((condition) => condition.name === conditionName)
53
57
  }
58
+
59
+ export const getConditionV2 = (
60
+ definition: FormDefinition,
61
+ conditionId: string
62
+ ) => {
63
+ const condition = definition.conditions
64
+ .filter(isConditionWrapperV2)
65
+ .find((condition) => condition.id === conditionId)
66
+
67
+ if (!condition) {
68
+ throw new Error(`Condition '${conditionId}' not found in form`)
69
+ }
70
+
71
+ return condition
72
+ }
@@ -18,6 +18,7 @@ export { ConditionGroup } from '~/src/conditions/condition-group.js'
18
18
  export { ConditionsModel } from '~/src/conditions/condition-model.js'
19
19
  export { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'
20
20
  export {
21
+ getConditionV2,
21
22
  hasConditionField,
22
23
  hasConditionGroup,
23
24
  hasConditionName,
@@ -165,7 +165,11 @@ export function convertConditionWrapperFromV2(
165
165
  let newCondition: ConditionData | ConditionRefData
166
166
 
167
167
  if (isConditionDataV2(condition)) {
168
- newCondition = convertConditionDataV2(model, condition, coordinator)
168
+ newCondition = convertConditionDataV2(
169
+ model,
170
+ condition,
171
+ index > 0 ? coordinator : undefined
172
+ )
169
173
  } else {
170
174
  newCondition = convertConditionRefDataFromV2(
171
175
  model,
@@ -7,6 +7,11 @@ import {
7
7
  type ContentComponentsDef,
8
8
  type FileUploadFieldComponent
9
9
  } from '~/src/components/types.js'
10
+ import {
11
+ yesNoListId,
12
+ yesNoListNoItemId,
13
+ yesNoListYesItemId
14
+ } from '~/src/components/yes-no-helper.js'
10
15
  import {
11
16
  type ConditionData,
12
17
  type ConditionDataV2,
@@ -67,15 +72,22 @@ const componentIdRefSchema = Joi.ref('/pages', {
67
72
  const listIdRef = Joi.ref('/lists', {
68
73
  in: true,
69
74
  adjust: (lists: List[]) =>
70
- lists.filter((list) => list.id).map((list) => list.id)
75
+ lists
76
+ .filter((list) => list.id)
77
+ .map((list) => list.id)
78
+ // To allow YesNo list to be valid even though the virtual list may not exist explicitly in the form definition
79
+ .concat(yesNoListId)
71
80
  })
72
81
 
73
82
  const listItemIdRef = Joi.ref('/lists', {
74
83
  in: true,
75
84
  adjust: (lists: List[]) =>
76
- lists.flatMap((list) =>
77
- list.items.filter((item) => item.id).map((item) => item.id)
78
- )
85
+ lists
86
+ .flatMap((list) =>
87
+ list.items.filter((item) => item.id).map((item) => item.id)
88
+ )
89
+ // To allow YesNo list items to be valid even though the virtual list may not exist explicitly in the form definition
90
+ .concat([yesNoListYesItemId, yesNoListNoItemId])
79
91
  })
80
92
 
81
93
  const sectionsSchema = Joi.object<Section>()
@@ -253,7 +265,7 @@ const conditionSchema = Joi.object<ConditionData>()
253
265
  )
254
266
  })
255
267
 
256
- const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()
268
+ export const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()
257
269
  .description('Condition definition')
258
270
  .keys({
259
271
  id: idSchema.description(
@@ -261,7 +273,6 @@ const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()
261
273
  ),
262
274
  componentId: Joi.string()
263
275
  .trim()
264
- .valid()
265
276
  .required()
266
277
  .when('/pages', {
267
278
  is: Joi.exist(),
@@ -280,6 +291,7 @@ const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()
280
291
  conditionListItemRefDataSchemaV2,
281
292
  relativeDateValueDataSchema
282
293
  )
294
+ .required()
283
295
  .description(
284
296
  'Value to compare the field against, either fixed or relative date'
285
297
  )
@@ -344,13 +356,18 @@ export const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()
344
356
  .description('Human-readable name for display in the UI'),
345
357
  coordinator: Joi.string()
346
358
  .optional()
359
+ .when('items', { is: Joi.array().min(2), then: Joi.required() })
347
360
  .description(
348
361
  'Logical operator connecting this condition with others (AND, OR)'
349
362
  ),
350
363
  items: Joi.array<ConditionGroupDataV2>()
351
364
  .items(
352
- Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2)
365
+ Joi.alternatives()
366
+ .try(conditionDataSchemaV2, conditionRefDataSchemaV2)
367
+ .required()
353
368
  )
369
+ .min(1)
370
+ .max(15)
354
371
  .description('Array of conditions or condition references')
355
372
  })
356
373
  .description('Condition schema for V2 forms')
@@ -1,6 +1,11 @@
1
1
  import { type ComponentType } from '~/src/components/enums.js'
2
2
  import { type ComponentDef } from '~/src/components/types.js'
3
- import { type Item } from '~/src/index.js'
3
+ import {
4
+ type ConditionWrapperV2,
5
+ type DateDirections,
6
+ type DateUnits,
7
+ type Item
8
+ } from '~/src/index.js'
4
9
 
5
10
  /**
6
11
  * Interface for `FormEditor` Joi schema
@@ -245,6 +250,26 @@ export interface FormEditor {
245
250
  * Set to 'true' is Javascript is enabled
246
251
  */
247
252
  jsEnabled: string
253
+
254
+ /**
255
+ * List item id for conditions
256
+ */
257
+ itemId: string
258
+
259
+ /**
260
+ * Relative date period for conditions
261
+ */
262
+ period: string
263
+
264
+ /**
265
+ * Relative date unit for conditions
266
+ */
267
+ unit: DateUnits
268
+
269
+ /**
270
+ * Relative date direction for conditions
271
+ */
272
+ direction: DateDirections
248
273
  }
249
274
 
250
275
  export type FormEditorInputPage = Pick<
@@ -385,6 +410,12 @@ export interface QuestionSessionState {
385
410
  lastMoveDirection?: string
386
411
  }
387
412
 
413
+ export interface ConditionSessionState {
414
+ id?: string
415
+ stateId?: string
416
+ conditionWrapper?: ConditionWrapperV2
417
+ }
418
+
388
419
  export interface GovukFieldItem {
389
420
  text?: string
390
421
  value?: string