@defra/forms-model 3.0.424 → 3.0.426
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/form/form-editor/index.js +34 -0
- package/dist/module/form/form-editor/index.js.map +1 -1
- package/dist/module/form/form-editor/types.js.map +1 -1
- package/dist/types/conditions/helpers.d.ts.map +1 -1
- package/dist/types/form/form-editor/index.d.ts +34 -0
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/types.d.ts +55 -3
- package/dist/types/form/form-editor/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/form/form-editor/index.ts +51 -0
- package/src/form/form-editor/types.ts +64 -2
@@ -15,6 +15,9 @@ export const pageHeadingSchema = Joi.string().trim().required();
|
|
15
15
|
export const guidanceTextSchema = Joi.string().trim();
|
16
16
|
export const needDeclarationSchema = Joi.string().trim().required();
|
17
17
|
export const declarationTextSchema = Joi.string().trim().required();
|
18
|
+
export const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25);
|
19
|
+
export const minFilesSchema = Joi.number().empty('').integer().min(0).max(25);
|
20
|
+
export const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25);
|
18
21
|
export const minSchema = Joi.number().empty('').integer();
|
19
22
|
export const maxSchema = Joi.number().empty('').integer();
|
20
23
|
export const minLengthSchema = Joi.number().empty('').integer().min(1);
|
@@ -27,6 +30,37 @@ export const regexSchema = Joi.string().optional().allow('');
|
|
27
30
|
export const rowsSchema = Joi.number().empty('').integer().min(1);
|
28
31
|
export const suffixSchema = Joi.string().trim().optional().allow('');
|
29
32
|
export const classesSchema = Joi.string().trim().optional().allow('');
|
33
|
+
export const fileTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
|
34
|
+
export const documentTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
|
35
|
+
export const imageTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
|
36
|
+
export const tabularDataTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
|
37
|
+
export const questionDetailsFullSchema = {
|
38
|
+
classesSchema,
|
39
|
+
documentTypesSchema,
|
40
|
+
exactFilesSchema,
|
41
|
+
fileTypesSchema,
|
42
|
+
hintTextSchema,
|
43
|
+
imageTypesSchema,
|
44
|
+
maxFilesSchema,
|
45
|
+
maxFutureSchema,
|
46
|
+
maxLengthSchema,
|
47
|
+
maxPastSchema,
|
48
|
+
maxSchema,
|
49
|
+
minFilesSchema,
|
50
|
+
minLengthSchema,
|
51
|
+
minSchema,
|
52
|
+
nameSchema,
|
53
|
+
precisionSchema,
|
54
|
+
prefixSchema,
|
55
|
+
questionOptionalSchema,
|
56
|
+
questionSchema,
|
57
|
+
questionTypeFullSchema,
|
58
|
+
regexSchema,
|
59
|
+
rowsSchema,
|
60
|
+
shortDescriptionSchema,
|
61
|
+
suffixSchema,
|
62
|
+
tabularDataTypesSchema
|
63
|
+
};
|
30
64
|
export const formEditorInputPageKeys = {
|
31
65
|
pageType: pageTypeSchema,
|
32
66
|
questionType: questionTypeSchema
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["Joi","ComponentType","pageTypeSchema","string","required","valid","questionTypeSchema","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","SelectField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","minSchema","number","empty","integer","maxSchema","minLengthSchema","min","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","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 const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n 'written-answer-group',\n 'date-group',\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.SelectField\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.SelectField\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)\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 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(1)\nexport const maxPastSchema = Joi.number().empty('').integer().min(1)\nexport const precisionSchema = Joi.number().empty('').integer().min(1)\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('')\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,OAAO,MAAMC,cAAc,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC;AAChC,OAAO,MAAMC,kBAAkB,GAAGN,GAAG,CAACG,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJ,sBAAsB,EACtB,YAAY,EACZJ,aAAa,CAACM,cAAc,EAC5BN,aAAa,CAACO,oBAAoB,EAClCP,aAAa,CAACQ,eAAe,EAC7BR,aAAa,CAACS,iBAAiB,EAC/BT,aAAa,CAACU,WAChB,CAAC;AAEH,OAAO,MAAMC,sBAAsB,GAAGZ,GAAG,CAACG,MAAM,CAAC,CAAC,CAC/CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,aAAa,CAACY,SAAS,EACvBZ,aAAa,CAACa,kBAAkB,EAChCb,aAAa,CAACc,WAAW,EACzBd,aAAa,CAACe,cAAc,EAC5Bf,aAAa,CAACgB,cAAc,EAC5BhB,aAAa,CAACM,cAAc,EAC5BN,aAAa,CAACO,oBAAoB,EAClCP,aAAa,CAACQ,eAAe,EAC7BR,aAAa,CAACS,iBAAiB,EAC/BT,aAAa,CAACU,WAChB,CAAC;AAEH,OAAO,MAAMO,sBAAsB,GAAGlB,GAAG,CAACG,MAAM,CAAC,CAAC,CAC/CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,aAAa,CAACY,SAAS,EACvBZ,aAAa,CAACa,kBAAkB,EAChCb,aAAa,CAACc,WAChB,CAAC;AACH,OAAO,MAAMI,aAAa,GAAGnB,GAAG,CAACG,MAAM,CAAC,CAAC,CACtCC,QAAQ,CAAC,CAAC,CACV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M,CAA0B,CAAC,CAClCC,IAAI,CAACI,2BAA2B,CAAC,CACjCtD,QAAQ,CAAC,CAAC;AAEf,OAAO,MAAM4D,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAErC,4BAA4B;EACpDsC,WAAW,EAAErC,iBAAiB;EAC9BsC,YAAY,EAAErC;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMsC,iCAAiC,GAC5CpE,GAAG,CAACqD,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrC5D,QAAQ,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"index.js","names":["Joi","ComponentType","pageTypeSchema","string","required","valid","questionTypeSchema","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","SelectField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","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 const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n 'written-answer-group',\n 'date-group',\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.SelectField\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.SelectField\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)\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(1)\nexport const maxPastSchema = Joi.number().empty('').integer().min(1)\nexport const precisionSchema = Joi.number().empty('').integer().min(1)\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,OAAO,MAAMC,cAAc,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC;AAChC,OAAO,MAAMC,kBAAkB,GAAGN,GAAG,CAACG,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJ,sBAAsB,EACtB,YAAY,EACZJ,aAAa,CAACM,cAAc,EAC5BN,aAAa,CAACO,oBAAoB,EAClCP,aAAa,CAACQ,eAAe,EAC7BR,aAAa,CAACS,iBAAiB,EAC/BT,aAAa,CAACU,WAChB,CAAC;AAEH,OAAO,MAAMC,sBAAsB,GAAGZ,GAAG,CAACG,MAAM,CAAC,CAAC,CAC/CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,aAAa,CAACY,SAAS,EACvBZ,aAAa,CAACa,kBAAkB,EAChCb,aAAa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B,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMmD,iCAAiC,GAC5CjF,GAAG,CAACkE,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrCzE,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 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\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub'\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>\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 value?: string | boolean | number\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 }\n rows?: number\n type?: string\n}\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n errorMessage?: { text: string }\n}\n"],"mappings":"","ignoreList":[]}
|
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 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'\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 +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,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAE3E,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,GAAG,YAAY,GAAG,cAAc,UAGrD;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,GAAG,YAAY,GAAG,cAAc,UAGrD;AAED,eAAO,MAAM,iBAAiB,
|
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,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAE3E,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,GAAG,YAAY,GAAG,cAAc,UAGrD;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,GAAG,YAAY,GAAG,cAAc,UAGrD;AAED,eAAO,MAAM,iBAAiB,GAC5B,YAAY,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,KAChE,SAAS,IAAI,aAEf,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,YAAY,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,KAChE,SAAS,IAAI,kBAEf,CAAA;AAED,eAAO,MAAM,gBAAgB,GAC3B,YAAY,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,KAChE,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"}
|
@@ -15,6 +15,9 @@ export declare const pageHeadingSchema: Joi.StringSchema<string>;
|
|
15
15
|
export declare const guidanceTextSchema: Joi.StringSchema<string>;
|
16
16
|
export declare const needDeclarationSchema: Joi.StringSchema<string>;
|
17
17
|
export declare const declarationTextSchema: Joi.StringSchema<string>;
|
18
|
+
export declare const exactFilesSchema: Joi.NumberSchema<number>;
|
19
|
+
export declare const minFilesSchema: Joi.NumberSchema<number>;
|
20
|
+
export declare const maxFilesSchema: Joi.NumberSchema<number>;
|
18
21
|
export declare const minSchema: Joi.NumberSchema<number>;
|
19
22
|
export declare const maxSchema: Joi.NumberSchema<number>;
|
20
23
|
export declare const minLengthSchema: Joi.NumberSchema<number>;
|
@@ -27,6 +30,37 @@ export declare const regexSchema: Joi.StringSchema<string>;
|
|
27
30
|
export declare const rowsSchema: Joi.NumberSchema<number>;
|
28
31
|
export declare const suffixSchema: Joi.StringSchema<string>;
|
29
32
|
export declare const classesSchema: Joi.StringSchema<string>;
|
33
|
+
export declare const fileTypesSchema: Joi.ArraySchema<any[]>;
|
34
|
+
export declare const documentTypesSchema: Joi.ArraySchema<any[]>;
|
35
|
+
export declare const imageTypesSchema: Joi.ArraySchema<any[]>;
|
36
|
+
export declare const tabularDataTypesSchema: Joi.ArraySchema<any[]>;
|
37
|
+
export declare const questionDetailsFullSchema: {
|
38
|
+
classesSchema: Joi.StringSchema<string>;
|
39
|
+
documentTypesSchema: Joi.ArraySchema<any[]>;
|
40
|
+
exactFilesSchema: Joi.NumberSchema<number>;
|
41
|
+
fileTypesSchema: Joi.ArraySchema<any[]>;
|
42
|
+
hintTextSchema: Joi.StringSchema<string>;
|
43
|
+
imageTypesSchema: Joi.ArraySchema<any[]>;
|
44
|
+
maxFilesSchema: Joi.NumberSchema<number>;
|
45
|
+
maxFutureSchema: Joi.NumberSchema<number>;
|
46
|
+
maxLengthSchema: Joi.NumberSchema<number>;
|
47
|
+
maxPastSchema: Joi.NumberSchema<number>;
|
48
|
+
maxSchema: Joi.NumberSchema<number>;
|
49
|
+
minFilesSchema: Joi.NumberSchema<number>;
|
50
|
+
minLengthSchema: Joi.NumberSchema<number>;
|
51
|
+
minSchema: Joi.NumberSchema<number>;
|
52
|
+
nameSchema: Joi.StringSchema<string>;
|
53
|
+
precisionSchema: Joi.NumberSchema<number>;
|
54
|
+
prefixSchema: Joi.StringSchema<string>;
|
55
|
+
questionOptionalSchema: Joi.StringSchema<string>;
|
56
|
+
questionSchema: Joi.StringSchema<string>;
|
57
|
+
questionTypeFullSchema: Joi.StringSchema<string>;
|
58
|
+
regexSchema: Joi.StringSchema<string>;
|
59
|
+
rowsSchema: Joi.NumberSchema<number>;
|
60
|
+
shortDescriptionSchema: Joi.StringSchema<string>;
|
61
|
+
suffixSchema: Joi.StringSchema<string>;
|
62
|
+
tabularDataTypesSchema: Joi.ArraySchema<any[]>;
|
63
|
+
};
|
30
64
|
export declare const formEditorInputPageKeys: {
|
31
65
|
pageType: Joi.StringSchema<string>;
|
32
66
|
questionType: 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,eAAO,MAAM,cAAc,0BAEK,CAAA;AAChC,eAAO,MAAM,kBAAkB,0BAU5B,CAAA;AAEH,eAAO,MAAM,sBAAsB,0BAahC,CAAA;AAEH,eAAO,MAAM,sBAAsB,0BAMhC,CAAA;AACH,eAAO,MAAM,aAAa,0BAE0C,CAAA;AAEpE,eAAO,MAAM,UAAU,0BAAiC,CAAA;AACxD,eAAO,MAAM,cAAc,0BAAiC,CAAA;AAC5D,eAAO,MAAM,cAAc,0BAA2C,CAAA;AACtE,eAAO,MAAM,sBAAsB,0BAGf,CAAA;AACpB,eAAO,MAAM,sBAAsB,0BAAiC,CAAA;AACpE,eAAO,MAAM,4BA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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"}
|
@@ -106,17 +106,52 @@ export interface FormEditor {
|
|
106
106
|
* The maximum days in the past to allow for a date
|
107
107
|
*/
|
108
108
|
maxPast: string;
|
109
|
+
/**
|
110
|
+
* The exact number of files to upload
|
111
|
+
*/
|
112
|
+
exactFiles: string;
|
113
|
+
/**
|
114
|
+
* The minimum number of files to upload
|
115
|
+
*/
|
116
|
+
minFiles: string;
|
117
|
+
/**
|
118
|
+
* The maximum number of files to upload
|
119
|
+
*/
|
120
|
+
maxFiles: string;
|
121
|
+
/**
|
122
|
+
* The type of files for upload
|
123
|
+
*/
|
124
|
+
fileTypes: string[];
|
125
|
+
/**
|
126
|
+
* The types of document files for upload
|
127
|
+
*/
|
128
|
+
documentTypes: string[];
|
129
|
+
/**
|
130
|
+
* The types of image files for upload
|
131
|
+
*/
|
132
|
+
imageTypes: string[];
|
133
|
+
/**
|
134
|
+
* The types of tabular data files for upload
|
135
|
+
*/
|
136
|
+
tabularDataTypes: string[];
|
109
137
|
}
|
110
138
|
export type FormEditorInputPage = Pick<FormEditor, 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub'>;
|
111
139
|
export type FormEditorInputCheckAnswersSettings = Pick<FormEditor, 'needDeclaration' | 'declarationText'>;
|
112
|
-
export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast'>;
|
140
|
+
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'>;
|
113
141
|
export type FormEditorInputPageSettings = Pick<FormEditor, 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'>;
|
114
142
|
export type FormEditorInputGuidancePage = Pick<FormEditor, 'pageHeading' | 'guidanceText'>;
|
115
143
|
export interface GovukField {
|
116
144
|
id?: string;
|
117
145
|
name?: string;
|
118
146
|
idPrefix?: string;
|
119
|
-
|
147
|
+
fieldset?: {
|
148
|
+
legend?: {
|
149
|
+
text?: string;
|
150
|
+
isPageHeading?: boolean;
|
151
|
+
classes?: string;
|
152
|
+
};
|
153
|
+
};
|
154
|
+
value?: string | boolean | number | string[];
|
120
155
|
classes?: string;
|
121
156
|
label?: {
|
122
157
|
text?: string;
|
@@ -131,7 +166,8 @@ export interface GovukField {
|
|
131
166
|
items?: {
|
132
167
|
text?: string;
|
133
168
|
value?: string;
|
134
|
-
|
169
|
+
checked?: boolean;
|
170
|
+
}[];
|
135
171
|
rows?: number;
|
136
172
|
type?: string;
|
137
173
|
}
|
@@ -140,8 +176,24 @@ export interface FormEditorGovukField {
|
|
140
176
|
hintText?: GovukField;
|
141
177
|
questionOptional?: GovukField;
|
142
178
|
shortDescription?: GovukField;
|
179
|
+
fileTypes?: GovukField;
|
180
|
+
documentTypes?: GovukField;
|
181
|
+
imageTypes?: GovukField;
|
182
|
+
tabularDataTypes?: GovukField;
|
143
183
|
errorMessage?: {
|
144
184
|
text: string;
|
145
185
|
};
|
146
186
|
}
|
187
|
+
export interface FormEditorCheckbox {
|
188
|
+
text?: string;
|
189
|
+
hint?: {
|
190
|
+
text?: string;
|
191
|
+
};
|
192
|
+
value?: string;
|
193
|
+
divider?: {
|
194
|
+
text?: string;
|
195
|
+
hint?: string;
|
196
|
+
value?: string;
|
197
|
+
};
|
198
|
+
}
|
147
199
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/types.ts"],"names":[],"mappings":"AAAA;;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,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;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;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AAgB,CAAC,EAAE,UAAU,CAAA;IAC7B,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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@defra/forms-model",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.426",
|
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": {
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"test:watch": "jest --color --watch"
|
22
22
|
},
|
23
23
|
"dependencies": {
|
24
|
-
"marked": "^15.0.
|
24
|
+
"marked": "^15.0.7",
|
25
25
|
"slug": "^10.0.0",
|
26
26
|
"uuid": "^11.1.0",
|
27
27
|
"nanoid": "^5.0.7"
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"devDependencies": {
|
30
30
|
"@types/slug": "^5.0.9",
|
31
31
|
"joi": "^17.13.3",
|
32
|
-
"tsc-alias": "^1.8.
|
32
|
+
"tsc-alias": "^1.8.11"
|
33
33
|
},
|
34
34
|
"peerDependencies": {
|
35
35
|
"joi": "^17.0.0"
|
@@ -62,6 +62,9 @@ export const pageHeadingSchema = Joi.string().trim().required()
|
|
62
62
|
export const guidanceTextSchema = Joi.string().trim()
|
63
63
|
export const needDeclarationSchema = Joi.string().trim().required()
|
64
64
|
export const declarationTextSchema = Joi.string().trim().required()
|
65
|
+
export const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25)
|
66
|
+
export const minFilesSchema = Joi.number().empty('').integer().min(0).max(25)
|
67
|
+
export const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25)
|
65
68
|
export const minSchema = Joi.number().empty('').integer()
|
66
69
|
export const maxSchema = Joi.number().empty('').integer()
|
67
70
|
export const minLengthSchema = Joi.number().empty('').integer().min(1)
|
@@ -74,6 +77,54 @@ export const regexSchema = Joi.string().optional().allow('')
|
|
74
77
|
export const rowsSchema = Joi.number().empty('').integer().min(1)
|
75
78
|
export const suffixSchema = Joi.string().trim().optional().allow('')
|
76
79
|
export const classesSchema = Joi.string().trim().optional().allow('')
|
80
|
+
export const fileTypesSchema = Joi.array()
|
81
|
+
.items(Joi.string())
|
82
|
+
.single()
|
83
|
+
.empty(null)
|
84
|
+
.default([])
|
85
|
+
export const documentTypesSchema = Joi.array()
|
86
|
+
.items(Joi.string())
|
87
|
+
.single()
|
88
|
+
.empty(null)
|
89
|
+
.default([])
|
90
|
+
export const imageTypesSchema = Joi.array()
|
91
|
+
.items(Joi.string())
|
92
|
+
.single()
|
93
|
+
.empty(null)
|
94
|
+
.default([])
|
95
|
+
export const tabularDataTypesSchema = Joi.array()
|
96
|
+
.items(Joi.string())
|
97
|
+
.single()
|
98
|
+
.empty(null)
|
99
|
+
.default([])
|
100
|
+
|
101
|
+
export const questionDetailsFullSchema = {
|
102
|
+
classesSchema,
|
103
|
+
documentTypesSchema,
|
104
|
+
exactFilesSchema,
|
105
|
+
fileTypesSchema,
|
106
|
+
hintTextSchema,
|
107
|
+
imageTypesSchema,
|
108
|
+
maxFilesSchema,
|
109
|
+
maxFutureSchema,
|
110
|
+
maxLengthSchema,
|
111
|
+
maxPastSchema,
|
112
|
+
maxSchema,
|
113
|
+
minFilesSchema,
|
114
|
+
minLengthSchema,
|
115
|
+
minSchema,
|
116
|
+
nameSchema,
|
117
|
+
precisionSchema,
|
118
|
+
prefixSchema,
|
119
|
+
questionOptionalSchema,
|
120
|
+
questionSchema,
|
121
|
+
questionTypeFullSchema,
|
122
|
+
regexSchema,
|
123
|
+
rowsSchema,
|
124
|
+
shortDescriptionSchema,
|
125
|
+
suffixSchema,
|
126
|
+
tabularDataTypesSchema
|
127
|
+
}
|
77
128
|
|
78
129
|
export const formEditorInputPageKeys = {
|
79
130
|
pageType: pageTypeSchema,
|
@@ -131,6 +131,41 @@ export interface FormEditor {
|
|
131
131
|
* The maximum days in the past to allow for a date
|
132
132
|
*/
|
133
133
|
maxPast: string
|
134
|
+
|
135
|
+
/**
|
136
|
+
* The exact number of files to upload
|
137
|
+
*/
|
138
|
+
exactFiles: string
|
139
|
+
|
140
|
+
/**
|
141
|
+
* The minimum number of files to upload
|
142
|
+
*/
|
143
|
+
minFiles: string
|
144
|
+
|
145
|
+
/**
|
146
|
+
* The maximum number of files to upload
|
147
|
+
*/
|
148
|
+
maxFiles: string
|
149
|
+
|
150
|
+
/**
|
151
|
+
* The type of files for upload
|
152
|
+
*/
|
153
|
+
fileTypes: string[]
|
154
|
+
|
155
|
+
/**
|
156
|
+
* The types of document files for upload
|
157
|
+
*/
|
158
|
+
documentTypes: string[]
|
159
|
+
|
160
|
+
/**
|
161
|
+
* The types of image files for upload
|
162
|
+
*/
|
163
|
+
imageTypes: string[]
|
164
|
+
|
165
|
+
/**
|
166
|
+
* The types of tabular data files for upload
|
167
|
+
*/
|
168
|
+
tabularDataTypes: string[]
|
134
169
|
}
|
135
170
|
|
136
171
|
export type FormEditorInputPage = Pick<
|
@@ -163,6 +198,13 @@ export type FormEditorInputQuestion = Pick<
|
|
163
198
|
| 'max'
|
164
199
|
| 'maxFuture'
|
165
200
|
| 'maxPast'
|
201
|
+
| 'exactFiles'
|
202
|
+
| 'minFiles'
|
203
|
+
| 'maxFiles'
|
204
|
+
| 'fileTypes'
|
205
|
+
| 'documentTypes'
|
206
|
+
| 'imageTypes'
|
207
|
+
| 'tabularDataTypes'
|
166
208
|
>
|
167
209
|
|
168
210
|
export type FormEditorInputPageSettings = Pick<
|
@@ -179,11 +221,14 @@ export interface GovukField {
|
|
179
221
|
id?: string
|
180
222
|
name?: string
|
181
223
|
idPrefix?: string
|
182
|
-
|
224
|
+
fieldset?: {
|
225
|
+
legend?: { text?: string; isPageHeading?: boolean; classes?: string }
|
226
|
+
}
|
227
|
+
value?: string | boolean | number | string[]
|
183
228
|
classes?: string
|
184
229
|
label?: { text?: string; html?: string; classes?: string }
|
185
230
|
hint?: { text?: string; html?: string; classes?: string }
|
186
|
-
items?: { text?: string; value?: string }
|
231
|
+
items?: { text?: string; value?: string; checked?: boolean }[]
|
187
232
|
rows?: number
|
188
233
|
type?: string
|
189
234
|
}
|
@@ -193,5 +238,22 @@ export interface FormEditorGovukField {
|
|
193
238
|
hintText?: GovukField
|
194
239
|
questionOptional?: GovukField
|
195
240
|
shortDescription?: GovukField
|
241
|
+
fileTypes?: GovukField
|
242
|
+
documentTypes?: GovukField
|
243
|
+
imageTypes?: GovukField
|
244
|
+
tabularDataTypes?: GovukField
|
196
245
|
errorMessage?: { text: string }
|
197
246
|
}
|
247
|
+
|
248
|
+
export interface FormEditorCheckbox {
|
249
|
+
text?: string
|
250
|
+
hint?: {
|
251
|
+
text?: string
|
252
|
+
}
|
253
|
+
value?: string
|
254
|
+
divider?: {
|
255
|
+
text?: string
|
256
|
+
hint?: string
|
257
|
+
value?: string
|
258
|
+
}
|
259
|
+
}
|