@defra/forms-model 3.0.424 → 3.0.425

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.
@@ -15,6 +15,8 @@ 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 minFilesSchema = Joi.number().empty('').integer().min(0);
19
+ export const maxFilesSchema = Joi.number().empty('').integer().min(1);
18
20
  export const minSchema = Joi.number().empty('').integer();
19
21
  export const maxSchema = Joi.number().empty('').integer();
20
22
  export const minLengthSchema = Joi.number().empty('').integer().min(1);
@@ -27,6 +29,10 @@ export const regexSchema = Joi.string().optional().allow('');
27
29
  export const rowsSchema = Joi.number().empty('').integer().min(1);
28
30
  export const suffixSchema = Joi.string().trim().optional().allow('');
29
31
  export const classesSchema = Joi.string().trim().optional().allow('');
32
+ export const fileTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
33
+ export const documentTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
34
+ export const imageTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
35
+ export const tabularDataTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
30
36
  export const formEditorInputPageKeys = {
31
37
  pageType: pageTypeSchema,
32
38
  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,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EACzCC,QAAQ,EAAErC,cAAc;EACxBsC,gBAAgB,EAAEjC,sBAAsB;EACxCkC,QAAQ,EAAEtC,cAAc;EACxBuC,gBAAgB,EAAEpC;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMqC,6BAA6B,GACxC/D,GAAG,CAACqD,MAAM,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","minFilesSchema","number","empty","integer","min","maxFilesSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","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 minFilesSchema = Joi.number().empty('').integer().min(0)\nexport const maxFilesSchema = Joi.number().empty('').integer().min(1)\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 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;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ACzCC,QAAQ,EAAE/C,cAAc;EACxBgD,gBAAgB,EAAE3C,sBAAsB;EACxC4C,QAAQ,EAAEhD,cAAc;EACxBiD,gBAAgB,EAAE9C;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAM+C,6BAA6B,GACxCzE,GAAG,CAAC+D,MAAM,CAA0B,CAAC,CAClCC,IAAI,CAACI,2BAA2B,CAAC,CACjChE,QAAQ,CAAC,CAAC;AAEf,OAAO,MAAMsE,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAE/C,4BAA4B;EACpDgD,WAAW,EAAE/C,iBAAiB;EAC9BgD,YAAY,EAAE/C;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMgD,iCAAiC,GAC5C9E,GAAG,CAAC+D,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrCtE,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 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 | '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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B,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,8 @@ 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 minFilesSchema: Joi.NumberSchema<number>;
19
+ export declare const maxFilesSchema: Joi.NumberSchema<number>;
18
20
  export declare const minSchema: Joi.NumberSchema<number>;
19
21
  export declare const maxSchema: Joi.NumberSchema<number>;
20
22
  export declare const minLengthSchema: Joi.NumberSchema<number>;
@@ -27,6 +29,10 @@ export declare const regexSchema: Joi.StringSchema<string>;
27
29
  export declare const rowsSchema: Joi.NumberSchema<number>;
28
30
  export declare const suffixSchema: Joi.StringSchema<string>;
29
31
  export declare const classesSchema: Joi.StringSchema<string>;
32
+ export declare const fileTypesSchema: Joi.ArraySchema<any[]>;
33
+ export declare const documentTypesSchema: Joi.ArraySchema<any[]>;
34
+ export declare const imageTypesSchema: Joi.ArraySchema<any[]>;
35
+ export declare const tabularDataTypesSchema: Joi.ArraySchema<any[]>;
30
36
  export declare const formEditorInputPageKeys: {
31
37
  pageType: Joi.StringSchema<string>;
32
38
  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,4BAA4B,0BAAiC,CAAA;AAC1E,eAAO,MAAM,iBAAiB,0BAAiC,CAAA;AAC/D,eAAO,MAAM,kBAAkB,0BAAsB,CAAA;AACrD,eAAO,MAAM,qBAAqB,0BAAiC,CAAA;AACnE,eAAO,MAAM,qBAAqB,0BAAiC,CAAA;AACnE,eAAO,MAAM,SAAS,0BAAmC,CAAA;AACzD,eAAO,MAAM,SAAS,0BAAmC,CAAA;AACzD,eAAO,MAAM,eAAe,0BAA0C,CAAA;AACtE,eAAO,MAAM,eAAe,0BAA0C,CAAA;AACtE,eAAO,MAAM,eAAe,0BAA0C,CAAA;AACtE,eAAO,MAA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O,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAG/B,CAAA"}
@@ -106,17 +106,48 @@ 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 minimum number of files to upload
111
+ */
112
+ minFiles: string;
113
+ /**
114
+ * The maximum number of files to upload
115
+ */
116
+ maxFiles: string;
117
+ /**
118
+ * The type of files for upload
119
+ */
120
+ fileTypes: string[];
121
+ /**
122
+ * The types of document files for upload
123
+ */
124
+ documentTypes: string[];
125
+ /**
126
+ * The types of image files for upload
127
+ */
128
+ imageTypes: string[];
129
+ /**
130
+ * The types of tabular data files for upload
131
+ */
132
+ tabularDataTypes: string[];
109
133
  }
110
134
  export type FormEditorInputPage = Pick<FormEditor, 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub'>;
111
135
  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'>;
136
+ export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes'>;
113
137
  export type FormEditorInputPageSettings = Pick<FormEditor, 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'>;
114
138
  export type FormEditorInputGuidancePage = Pick<FormEditor, 'pageHeading' | 'guidanceText'>;
115
139
  export interface GovukField {
116
140
  id?: string;
117
141
  name?: string;
118
142
  idPrefix?: string;
119
- value?: string | boolean | number;
143
+ fieldset?: {
144
+ legend?: {
145
+ text?: string;
146
+ isPageHeading?: boolean;
147
+ classes?: string;
148
+ };
149
+ };
150
+ value?: string | boolean | number | string[];
120
151
  classes?: string;
121
152
  label?: {
122
153
  text?: string;
@@ -131,7 +162,8 @@ export interface GovukField {
131
162
  items?: {
132
163
  text?: string;
133
164
  value?: string;
134
- };
165
+ checked?: boolean;
166
+ }[];
135
167
  rows?: number;
136
168
  type?: string;
137
169
  }
@@ -140,8 +172,24 @@ export interface FormEditorGovukField {
140
172
  hintText?: GovukField;
141
173
  questionOptional?: GovukField;
142
174
  shortDescription?: GovukField;
175
+ fileTypes?: GovukField;
176
+ documentTypes?: GovukField;
177
+ imageTypes?: GovukField;
178
+ tabularDataTypes?: GovukField;
143
179
  errorMessage?: {
144
180
  text: string;
145
181
  };
146
182
  }
183
+ export interface FormEditorCheckbox {
184
+ text?: string;
185
+ hint?: {
186
+ text?: string;
187
+ };
188
+ value?: string;
189
+ divider?: {
190
+ text?: string;
191
+ hint?: string;
192
+ value?: string;
193
+ };
194
+ }
147
195
  //# 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;;OAE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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.424",
3
+ "version": "3.0.425",
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.6",
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.10"
32
+ "tsc-alias": "^1.8.11"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "joi": "^17.0.0"
@@ -62,6 +62,8 @@ 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 minFilesSchema = Joi.number().empty('').integer().min(0)
66
+ export const maxFilesSchema = Joi.number().empty('').integer().min(1)
65
67
  export const minSchema = Joi.number().empty('').integer()
66
68
  export const maxSchema = Joi.number().empty('').integer()
67
69
  export const minLengthSchema = Joi.number().empty('').integer().min(1)
@@ -74,6 +76,26 @@ export const regexSchema = Joi.string().optional().allow('')
74
76
  export const rowsSchema = Joi.number().empty('').integer().min(1)
75
77
  export const suffixSchema = Joi.string().trim().optional().allow('')
76
78
  export const classesSchema = Joi.string().trim().optional().allow('')
79
+ export const fileTypesSchema = Joi.array()
80
+ .items(Joi.string())
81
+ .single()
82
+ .empty(null)
83
+ .default([])
84
+ export const documentTypesSchema = Joi.array()
85
+ .items(Joi.string())
86
+ .single()
87
+ .empty(null)
88
+ .default([])
89
+ export const imageTypesSchema = Joi.array()
90
+ .items(Joi.string())
91
+ .single()
92
+ .empty(null)
93
+ .default([])
94
+ export const tabularDataTypesSchema = Joi.array()
95
+ .items(Joi.string())
96
+ .single()
97
+ .empty(null)
98
+ .default([])
77
99
 
78
100
  export const formEditorInputPageKeys = {
79
101
  pageType: pageTypeSchema,
@@ -131,6 +131,36 @@ 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 minimum number of files to upload
137
+ */
138
+ minFiles: string
139
+
140
+ /**
141
+ * The maximum number of files to upload
142
+ */
143
+ maxFiles: string
144
+
145
+ /**
146
+ * The type of files for upload
147
+ */
148
+ fileTypes: string[]
149
+
150
+ /**
151
+ * The types of document files for upload
152
+ */
153
+ documentTypes: string[]
154
+
155
+ /**
156
+ * The types of image files for upload
157
+ */
158
+ imageTypes: string[]
159
+
160
+ /**
161
+ * The types of tabular data files for upload
162
+ */
163
+ tabularDataTypes: string[]
134
164
  }
135
165
 
136
166
  export type FormEditorInputPage = Pick<
@@ -163,6 +193,12 @@ export type FormEditorInputQuestion = Pick<
163
193
  | 'max'
164
194
  | 'maxFuture'
165
195
  | 'maxPast'
196
+ | 'minFiles'
197
+ | 'maxFiles'
198
+ | 'fileTypes'
199
+ | 'documentTypes'
200
+ | 'imageTypes'
201
+ | 'tabularDataTypes'
166
202
  >
167
203
 
168
204
  export type FormEditorInputPageSettings = Pick<
@@ -179,11 +215,14 @@ export interface GovukField {
179
215
  id?: string
180
216
  name?: string
181
217
  idPrefix?: string
182
- value?: string | boolean | number
218
+ fieldset?: {
219
+ legend?: { text?: string; isPageHeading?: boolean; classes?: string }
220
+ }
221
+ value?: string | boolean | number | string[]
183
222
  classes?: string
184
223
  label?: { text?: string; html?: string; classes?: string }
185
224
  hint?: { text?: string; html?: string; classes?: string }
186
- items?: { text?: string; value?: string }
225
+ items?: { text?: string; value?: string; checked?: boolean }[]
187
226
  rows?: number
188
227
  type?: string
189
228
  }
@@ -193,5 +232,22 @@ export interface FormEditorGovukField {
193
232
  hintText?: GovukField
194
233
  questionOptional?: GovukField
195
234
  shortDescription?: GovukField
235
+ fileTypes?: GovukField
236
+ documentTypes?: GovukField
237
+ imageTypes?: GovukField
238
+ tabularDataTypes?: GovukField
196
239
  errorMessage?: { text: string }
197
240
  }
241
+
242
+ export interface FormEditorCheckbox {
243
+ text?: string
244
+ hint?: {
245
+ text?: string
246
+ }
247
+ value?: string
248
+ divider?: {
249
+ text?: string
250
+ hint?: string
251
+ value?: string
252
+ }
253
+ }