@defra/forms-model 3.0.428 → 3.0.430

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.
@@ -41,9 +41,15 @@ export const fileTypesSchema = Joi.array().items(Joi.string()).single().empty(nu
41
41
  export const documentTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
42
42
  export const imageTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
43
43
  export const tabularDataTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
44
+ export const enhancedActionSchema = Joi.string().trim().optional().allow('');
45
+ export const radioIdSchema = Joi.string().trim().optional().allow('');
46
+ export const radioLabelSchema = Joi.string().trim().required();
47
+ export const radioHintSchema = Joi.string().trim().optional().allow('');
48
+ export const radioValueSchema = Joi.string().trim().optional().allow('');
44
49
  export const questionDetailsFullSchema = {
45
50
  classesSchema,
46
51
  documentTypesSchema,
52
+ enhancedActionSchema,
47
53
  exactFilesSchema,
48
54
  fileTypesSchema,
49
55
  hintTextSchema,
@@ -62,6 +68,10 @@ export const questionDetailsFullSchema = {
62
68
  questionOptionalSchema,
63
69
  questionSchema,
64
70
  questionTypeFullSchema,
71
+ radioHintSchema,
72
+ radioIdSchema,
73
+ radioLabelSchema,
74
+ radioValueSchema,
65
75
  regexSchema,
66
76
  rowsSchema,
67
77
  shortDescriptionSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","ComponentType","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","exactFilesSchema","number","empty","integer","min","max","minFilesSchema","maxFilesSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","object","keys","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const questionTypeFullSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.DatePartsField,\n ComponentType.MonthYearField,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const nameSchema = Joi.string().trim().required()\nexport const questionSchema = Joi.string().trim().required()\nexport const hintTextSchema = Joi.string().trim().optional().allow('')\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\nexport const shortDescriptionSchema = Joi.string().trim().required()\nexport const pageHeadingAndGuidanceSchema = Joi.string().trim().optional()\nexport const pageHeadingSchema = Joi.string().trim().required()\nexport const guidanceTextSchema = Joi.string().trim()\nexport const needDeclarationSchema = Joi.string().trim().required()\nexport const declarationTextSchema = Joi.string().trim().required()\nexport const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25)\nexport const minFilesSchema = Joi.number().empty('').integer().min(0).max(25)\nexport const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25)\nexport const minSchema = Joi.number().empty('').integer()\nexport const maxSchema = Joi.number().empty('').integer()\nexport const minLengthSchema = Joi.number().empty('').integer().min(1)\nexport const maxLengthSchema = Joi.number().empty('').integer().min(1)\nexport const maxFutureSchema = Joi.number().empty('').integer().min(0)\nexport const maxPastSchema = Joi.number().empty('').integer().min(0)\nexport const precisionSchema = Joi.number().empty('').integer().min(0).max(5)\nexport const prefixSchema = Joi.string().trim().optional().allow('')\nexport const regexSchema = Joi.string().optional().allow('')\nexport const rowsSchema = Joi.number().empty('').integer().min(1)\nexport const suffixSchema = Joi.string().trim().optional().allow('')\nexport const classesSchema = Joi.string().trim().optional().allow('')\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n\nexport const questionDetailsFullSchema = {\n classesSchema,\n documentTypesSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema\n}\n\nexport const formEditorInputPageKeys = {\n pageType: pageTypeSchema,\n questionType: questionTypeSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPage` interface\n * @see {@link FormEditorInputPage}\n */\nexport const formEditorInputPageSchema = Joi.object<FormEditorInputPage>()\n .keys(formEditorInputPageKeys)\n .required()\n\nexport const formEditorInputheckAnswersSettingsKeys = {\n declarationText: shortDescriptionSchema\n}\n\n/**\n * Joi schema for `FormEditorInputCheckAnswersSettings` interface\n * @see {@link FormEditorInputCheckAnswersSettings}\n */\nexport const formEditorInputCheckAnswersSettingSchema =\n Joi.object<FormEditorInputCheckAnswersSettings>()\n .keys(formEditorInputheckAnswersSettingsKeys)\n .required()\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n hintText: hintTextSchema,\n questionOptional: questionOptionalSchema\n}\n\n/**\n * Joi schema for `FormEditorInputQuestion` interface\n * @see {@link FormEditorInputQuestion}\n */\nexport const formEditorInputQuestionSchema =\n Joi.object<FormEditorInputQuestion>()\n .keys(formEditorInputQuestionKeys)\n .required()\n\nexport const formEditorInputPageSettingsKeys = {\n pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,\n pageHeading: pageHeadingSchema,\n guidanceText: guidanceTextSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPageSettings` interface\n * @see {@link FormEditorInputPageSettings}\n */\nexport const formEditorInputPageSettingsSchema =\n Joi.object<FormEditorInputPageSettings>()\n .keys(formEditorInputPageSettingsKeys)\n .required()\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,aAAa;AAQtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,OAAO,MAAMC,cAAc,GAAGH,GAAG,CAACI,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC;AAChC,OAAO,MAAMC,kBAAkB,GAAGP,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,oBAAoB,CAACM,qBAAqB,EAC1CN,oBAAoB,CAACO,YAAY,EACjCR,aAAa,CAACS,cAAc,EAC5BT,aAAa,CAACU,oBAAoB,EAClCV,aAAa,CAACW,eAAe,EAC7BX,aAAa,CAACY,iBAAiB,EAC/BX,oBAAoB,CAACY,YAAY,EACjCb,aAAa,CAACc,UAAU,EACxBd,aAAa,CAACe,eAAe,EAC7Bf,aAAa,CAACgB,WAAW,EACzBhB,aAAa,CAACiB,iBAChB,CAAC;AAEH,OAAO,MAAMC,sBAAsB,GAAGnB,GAAG,CAACI,MAAM,CAAC,CAAC,CAC/CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJL,aAAa,CAACmB,SAAS,EACvBnB,aAAa,CAACoB,kBAAkB,EAChCpB,aAAa,CA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,EAAE9C,sBAAsB;EACxC+C,QAAQ,EAAEnD,cAAc;EACxBoD,gBAAgB,EAAEjD;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMkD,6BAA6B,GACxCpF,GAAG,CAAC0E,MAAM,CAA0B,CAAC,CAClCC,IAAI,CAACI,2BAA2B,CAAC,CACjC1E,QAAQ,CAAC,CAAC;AAEf,OAAO,MAAMgF,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAElD,4BAA4B;EACpDmD,WAAW,EAAElD,iBAAiB;EAC9BmD,YAAY,EAAElD;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMmD,iCAAiC,GAC5CzF,GAAG,CAAC0E,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrChF,QAAQ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","ComponentType","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","exactFilesSchema","number","empty","integer","min","max","minFilesSchema","maxFilesSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioLabelSchema","radioHintSchema","radioValueSchema","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","object","keys","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const questionTypeFullSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.DatePartsField,\n ComponentType.MonthYearField,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const nameSchema = Joi.string().trim().required()\nexport const questionSchema = Joi.string().trim().required()\nexport const hintTextSchema = Joi.string().trim().optional().allow('')\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\nexport const shortDescriptionSchema = Joi.string().trim().required()\nexport const pageHeadingAndGuidanceSchema = Joi.string().trim().optional()\nexport const pageHeadingSchema = Joi.string().trim().required()\nexport const guidanceTextSchema = Joi.string().trim()\nexport const needDeclarationSchema = Joi.string().trim().required()\nexport const declarationTextSchema = Joi.string().trim().required()\nexport const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25)\nexport const minFilesSchema = Joi.number().empty('').integer().min(0).max(25)\nexport const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25)\nexport const minSchema = Joi.number().empty('').integer()\nexport const maxSchema = Joi.number().empty('').integer()\nexport const minLengthSchema = Joi.number().empty('').integer().min(1)\nexport const maxLengthSchema = Joi.number().empty('').integer().min(1)\nexport const maxFutureSchema = Joi.number().empty('').integer().min(0)\nexport const maxPastSchema = Joi.number().empty('').integer().min(0)\nexport const precisionSchema = Joi.number().empty('').integer().min(0).max(5)\nexport const prefixSchema = Joi.string().trim().optional().allow('')\nexport const regexSchema = Joi.string().optional().allow('')\nexport const rowsSchema = Joi.number().empty('').integer().min(1)\nexport const suffixSchema = Joi.string().trim().optional().allow('')\nexport const classesSchema = Joi.string().trim().optional().allow('')\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const enhancedActionSchema = Joi.string().trim().optional().allow('')\nexport const radioIdSchema = Joi.string().trim().optional().allow('')\nexport const radioLabelSchema = Joi.string().trim().required()\nexport const radioHintSchema = Joi.string().trim().optional().allow('')\nexport const radioValueSchema = Joi.string().trim().optional().allow('')\n\nexport const questionDetailsFullSchema = {\n classesSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioLabelSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema\n}\n\nexport const formEditorInputPageKeys = {\n pageType: pageTypeSchema,\n questionType: questionTypeSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPage` interface\n * @see {@link FormEditorInputPage}\n */\nexport const formEditorInputPageSchema = Joi.object<FormEditorInputPage>()\n .keys(formEditorInputPageKeys)\n .required()\n\nexport const formEditorInputheckAnswersSettingsKeys = {\n declarationText: shortDescriptionSchema\n}\n\n/**\n * Joi schema for `FormEditorInputCheckAnswersSettings` interface\n * @see {@link FormEditorInputCheckAnswersSettings}\n */\nexport const formEditorInputCheckAnswersSettingSchema =\n Joi.object<FormEditorInputCheckAnswersSettings>()\n .keys(formEditorInputheckAnswersSettingsKeys)\n .required()\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n hintText: hintTextSchema,\n questionOptional: questionOptionalSchema\n}\n\n/**\n * Joi schema for `FormEditorInputQuestion` interface\n * @see {@link FormEditorInputQuestion}\n */\nexport const formEditorInputQuestionSchema =\n Joi.object<FormEditorInputQuestion>()\n .keys(formEditorInputQuestionKeys)\n .required()\n\nexport const formEditorInputPageSettingsKeys = {\n pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,\n pageHeading: pageHeadingSchema,\n guidanceText: guidanceTextSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPageSettings` interface\n * @see {@link FormEditorInputPageSettings}\n */\nexport const formEditorInputPageSettingsSchema =\n Joi.object<FormEditorInputPageSettings>()\n .keys(formEditorInputPageSettingsKeys)\n .required()\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,aAAa;AAQtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,OAAO,MAAMC,cAAc,GAAGH,GAAG,CAACI,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC;AAChC,OAAO,MAAMC,kBAAkB,GAAGP,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,oBAAoB,CAACM,qBAAqB,EAC1CN,oBAAoB,CAACO,YAAY,EACjCR,aAAa,CAACS,cAAc,EAC5BT,aAAa,CAACU,oBAAoB,EAClCV,aAAa,CAACW,eAAe,EAC7BX,aAAa,CAACY,iBAAiB,EAC/BX,oBAAoB,CAACY,YAAY,EACjCb,aAAa,CAACc,UAAU,EACxBd,aAAa,CAACe,eAAe,EAC7Bf,aAAa,CAACgB,WAAW,EACzBhB,aAAa,CAACiB,iBAChB,CAAC;AAEH,OAAO,MAAMC,sBAAsB,GAAGnB,GAAG,CAACI,MAAM,CAAC,CAAC,CAC/CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJL,aAAa,CAACmB,SAAS,EACvBnB,aAAa,CAACoB,kBAAkB,EAChCpB,aAAa,CAACqB,WAAW,EACzBrB,aAAa,CAACsB,cAAc,EAC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AC,CACrCrF,QAAQ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["/**\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 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\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>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\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[]\n classes?: string\n label?: { text?: string; html?: string; classes?: string }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n}\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 errorMessage?: { text: string }\n}\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.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 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 radioLabel: 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\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 | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'\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 | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport interface EnhancedActionState {\n questionDetails: Partial<ComponentDef>\n state: {\n radioId?: string\n radioLabel?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems: { label?: string; hint?: string; value?: string; id?: string }[]\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[]\n classes?: string\n label?: { text?: string; html?: string; classes?: string }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n customTemplate?: string\n}\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 errorMessage?: { text: string }\n}\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Page } from '~/src/index.js'\n\nexport type PatchPageFields = Partial<Pick<Page, 'title' | 'path'>>\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Page } from '~/src/index.js'\n\nexport type PatchPageFields = Partial<\n Pick<Page, 'title' | 'path' | 'controller'>\n>\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n"],"mappings":"","ignoreList":[]}
@@ -40,9 +40,15 @@ export declare const fileTypesSchema: Joi.ArraySchema<any[]>;
40
40
  export declare const documentTypesSchema: Joi.ArraySchema<any[]>;
41
41
  export declare const imageTypesSchema: Joi.ArraySchema<any[]>;
42
42
  export declare const tabularDataTypesSchema: Joi.ArraySchema<any[]>;
43
+ export declare const enhancedActionSchema: Joi.StringSchema<string>;
44
+ export declare const radioIdSchema: Joi.StringSchema<string>;
45
+ export declare const radioLabelSchema: Joi.StringSchema<string>;
46
+ export declare const radioHintSchema: Joi.StringSchema<string>;
47
+ export declare const radioValueSchema: Joi.StringSchema<string>;
43
48
  export declare const questionDetailsFullSchema: {
44
49
  classesSchema: Joi.StringSchema<string>;
45
50
  documentTypesSchema: Joi.ArraySchema<any[]>;
51
+ enhancedActionSchema: Joi.StringSchema<string>;
46
52
  exactFilesSchema: Joi.NumberSchema<number>;
47
53
  fileTypesSchema: Joi.ArraySchema<any[]>;
48
54
  hintTextSchema: Joi.StringSchema<string>;
@@ -61,6 +67,10 @@ export declare const questionDetailsFullSchema: {
61
67
  questionOptionalSchema: Joi.StringSchema<string>;
62
68
  questionSchema: Joi.StringSchema<string>;
63
69
  questionTypeFullSchema: Joi.StringSchema<string>;
70
+ radioHintSchema: Joi.StringSchema<string>;
71
+ radioIdSchema: Joi.StringSchema<string>;
72
+ radioLabelSchema: Joi.StringSchema<string>;
73
+ radioValueSchema: Joi.StringSchema<string>;
64
74
  regexSchema: Joi.StringSchema<string>;
65
75
  rowsSchema: Joi.NumberSchema<number>;
66
76
  shortDescriptionSchema: Joi.StringSchema<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAA;AAExC,oBAAY,oBAAoB;IAC9B,qBAAqB,q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AAiC,CAAA;AAC9D,eAAO,MAAM,eAAe,0BAA2C,CAAA;AACvE,eAAO,MAAM,gBAAgB,0BAA2C,CAAA;AAExE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BrC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;CAGnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uCAEzB,CAAA;AAEb,eAAO,MAAM,sCAAsC;;CAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wCAAwC,uDAGtC,CAAA;AAEf,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2CAG3B,CAAA;AAEf,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAG/B,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { type ComponentDef } from '../../components/types.js';
1
2
  /**
2
3
  * Interface for `FormEditor` Joi schema
3
4
  */
@@ -138,12 +139,53 @@ export interface FormEditor {
138
139
  * The types of tabular data files for upload
139
140
  */
140
141
  tabularDataTypes: string[];
142
+ /**
143
+ * The action required from within a sub-section
144
+ */
145
+ enhancedAction: string;
146
+ /**
147
+ * Placeholder for inserted section to handle adding/editing radios or checkboxes
148
+ */
149
+ radiosOrCheckboxes: string;
150
+ /**
151
+ * The unique id of the radio item
152
+ */
153
+ radioId: string;
154
+ /**
155
+ * The display text of the radio item
156
+ */
157
+ radioLabel: string;
158
+ /**
159
+ * The hint of the radio item
160
+ */
161
+ radioHint: string;
162
+ /**
163
+ * The value of the radio item
164
+ */
165
+ radioValue: string;
141
166
  }
142
167
  export type FormEditorInputPage = Pick<FormEditor, 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'>;
143
168
  export type FormEditorInputCheckAnswersSettings = Pick<FormEditor, 'needDeclaration' | 'declarationText'>;
144
- export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'exactFiles' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes'>;
169
+ export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'exactFiles' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'enhancedAction' | 'radioId' | 'radioLabel' | 'radioHint' | 'radioValue'>;
145
170
  export type FormEditorInputPageSettings = Pick<FormEditor, 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'>;
146
171
  export type FormEditorInputGuidancePage = Pick<FormEditor, 'pageHeading' | 'guidanceText'>;
172
+ export type FormEditorInputQuestionDetails = Pick<FormEditorInputQuestion, 'question' | 'hintText' | 'shortDescription' | 'questionOptional' | 'questionType' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'enhancedAction' | 'radioId' | 'radioLabel' | 'radioHint' | 'radioValue'>;
173
+ export interface EnhancedActionState {
174
+ questionDetails: Partial<ComponentDef>;
175
+ state: {
176
+ radioId?: string;
177
+ radioLabel?: string;
178
+ radioHint?: string;
179
+ radioValue?: string;
180
+ expanded?: boolean;
181
+ };
182
+ listItems: {
183
+ label?: string;
184
+ hint?: string;
185
+ value?: string;
186
+ id?: string;
187
+ }[];
188
+ }
147
189
  export interface GovukField {
148
190
  id?: string;
149
191
  name?: string;
@@ -174,6 +216,7 @@ export interface GovukField {
174
216
  }[];
175
217
  rows?: number;
176
218
  type?: string;
219
+ customTemplate?: string;
177
220
  }
178
221
  export interface FormEditorGovukField {
179
222
  question?: GovukField;
@@ -184,6 +227,7 @@ export interface FormEditorGovukField {
184
227
  documentTypes?: GovukField;
185
228
  imageTypes?: GovukField;
186
229
  tabularDataTypes?: GovukField;
230
+ radiosOrCheckboxes?: GovukField;
187
231
  errorMessage?: {
188
232
  text: string;
189
233
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/types.ts"],"names":[],"mappings":"AAAA;;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,MAAM,CAAA;IAExB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OA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CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,gBAAgB,CAAC,EAAE,UAAU,CAAA;IAC7B,gBAAgB,CAAC,EAAE,UAAU,CAAA;IAC7B,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,gBAAgB,CAAC,EAAE,UAAU,CAAA;IAC7B,kBAAkB,CAAC,EAAE,UAAU,CAAA;IAC/B,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAChC;AAED,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"}
@@ -1,3 +1,3 @@
1
1
  import Joi from 'joi';
2
- export declare const patchPageSchema: Joi.ObjectSchema<Partial<Pick<import("../../index.js").Page, "title" | "path">>>;
2
+ export declare const patchPageSchema: Joi.ObjectSchema<Partial<Pick<import("../../index.js").Page, "title" | "path" | "controller">>>;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,eAAe,kFAMnB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,eAAe,iGAMnB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { type Page } from '../../index.js';
2
- export type PatchPageFields = Partial<Pick<Page, 'title' | 'path'>>;
2
+ export type PatchPageFields = Partial<Pick<Page, 'title' | 'path' | 'controller'>>;
3
3
  export interface AddComponentQueryOptions {
4
4
  prepend?: boolean;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,CAAA;AAEnE,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC,CAC5C,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.428",
3
+ "version": "3.0.430",
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
  "repository": {
@@ -118,10 +118,16 @@ export const tabularDataTypesSchema = Joi.array()
118
118
  .single()
119
119
  .empty(null)
120
120
  .default([])
121
+ export const enhancedActionSchema = Joi.string().trim().optional().allow('')
122
+ export const radioIdSchema = Joi.string().trim().optional().allow('')
123
+ export const radioLabelSchema = Joi.string().trim().required()
124
+ export const radioHintSchema = Joi.string().trim().optional().allow('')
125
+ export const radioValueSchema = Joi.string().trim().optional().allow('')
121
126
 
122
127
  export const questionDetailsFullSchema = {
123
128
  classesSchema,
124
129
  documentTypesSchema,
130
+ enhancedActionSchema,
125
131
  exactFilesSchema,
126
132
  fileTypesSchema,
127
133
  hintTextSchema,
@@ -140,6 +146,10 @@ export const questionDetailsFullSchema = {
140
146
  questionOptionalSchema,
141
147
  questionSchema,
142
148
  questionTypeFullSchema,
149
+ radioHintSchema,
150
+ radioIdSchema,
151
+ radioLabelSchema,
152
+ radioValueSchema,
143
153
  regexSchema,
144
154
  rowsSchema,
145
155
  shortDescriptionSchema,
@@ -1,3 +1,5 @@
1
+ import { type ComponentDef } from '~/src/components/types.js'
2
+
1
3
  /**
2
4
  * Interface for `FormEditor` Joi schema
3
5
  */
@@ -171,6 +173,36 @@ export interface FormEditor {
171
173
  * The types of tabular data files for upload
172
174
  */
173
175
  tabularDataTypes: string[]
176
+
177
+ /**
178
+ * The action required from within a sub-section
179
+ */
180
+ enhancedAction: string
181
+
182
+ /**
183
+ * Placeholder for inserted section to handle adding/editing radios or checkboxes
184
+ */
185
+ radiosOrCheckboxes: string
186
+
187
+ /**
188
+ * The unique id of the radio item
189
+ */
190
+ radioId: string
191
+
192
+ /**
193
+ * The display text of the radio item
194
+ */
195
+ radioLabel: string
196
+
197
+ /**
198
+ * The hint of the radio item
199
+ */
200
+ radioHint: string
201
+
202
+ /**
203
+ * The value of the radio item
204
+ */
205
+ radioValue: string
174
206
  }
175
207
 
176
208
  export type FormEditorInputPage = Pick<
@@ -210,6 +242,11 @@ export type FormEditorInputQuestion = Pick<
210
242
  | 'documentTypes'
211
243
  | 'imageTypes'
212
244
  | 'tabularDataTypes'
245
+ | 'enhancedAction'
246
+ | 'radioId'
247
+ | 'radioLabel'
248
+ | 'radioHint'
249
+ | 'radioValue'
213
250
  >
214
251
 
215
252
  export type FormEditorInputPageSettings = Pick<
@@ -222,6 +259,36 @@ export type FormEditorInputGuidancePage = Pick<
222
259
  'pageHeading' | 'guidanceText'
223
260
  >
224
261
 
262
+ export type FormEditorInputQuestionDetails = Pick<
263
+ FormEditorInputQuestion,
264
+ | 'question'
265
+ | 'hintText'
266
+ | 'shortDescription'
267
+ | 'questionOptional'
268
+ | 'questionType'
269
+ | 'fileTypes'
270
+ | 'documentTypes'
271
+ | 'imageTypes'
272
+ | 'tabularDataTypes'
273
+ | 'enhancedAction'
274
+ | 'radioId'
275
+ | 'radioLabel'
276
+ | 'radioHint'
277
+ | 'radioValue'
278
+ >
279
+
280
+ export interface EnhancedActionState {
281
+ questionDetails: Partial<ComponentDef>
282
+ state: {
283
+ radioId?: string
284
+ radioLabel?: string
285
+ radioHint?: string
286
+ radioValue?: string
287
+ expanded?: boolean
288
+ }
289
+ listItems: { label?: string; hint?: string; value?: string; id?: string }[]
290
+ }
291
+
225
292
  export interface GovukField {
226
293
  id?: string
227
294
  name?: string
@@ -236,6 +303,7 @@ export interface GovukField {
236
303
  items?: { text?: string; value?: string; checked?: boolean }[]
237
304
  rows?: number
238
305
  type?: string
306
+ customTemplate?: string
239
307
  }
240
308
 
241
309
  export interface FormEditorGovukField {
@@ -247,6 +315,7 @@ export interface FormEditorGovukField {
247
315
  documentTypes?: GovukField
248
316
  imageTypes?: GovukField
249
317
  tabularDataTypes?: GovukField
318
+ radiosOrCheckboxes?: GovukField
250
319
  errorMessage?: { text: string }
251
320
  }
252
321
 
@@ -1,6 +1,8 @@
1
1
  import { type Page } from '~/src/index.js'
2
2
 
3
- export type PatchPageFields = Partial<Pick<Page, 'title' | 'path'>>
3
+ export type PatchPageFields = Partial<
4
+ Pick<Page, 'title' | 'path' | 'controller'>
5
+ >
4
6
 
5
7
  export interface AddComponentQueryOptions {
6
8
  prepend?: boolean