@defra/forms-model 3.0.639 → 3.0.640
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 +3 -3
- package/dist/module/form/form-editor/index.js.map +1 -1
- package/dist/module/form/form-editor/preview/geospatial.js +29 -0
- package/dist/module/form/form-editor/preview/geospatial.js.map +1 -0
- package/dist/module/form/form-editor/preview/helpers.js +4 -1
- package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
- package/dist/module/form/form-editor/preview/index.js +1 -0
- package/dist/module/form/form-editor/preview/index.js.map +1 -1
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/geospatial.d.ts +11 -0
- package/dist/types/form/form-editor/preview/geospatial.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/index.d.ts +1 -0
- package/package.json +1 -1
- package/schemas/form-editor-input-page-schema.json +2 -1
- package/schemas/question-type-full-schema.json +2 -1
- package/schemas/question-type-schema.json +2 -1
- package/src/form/form-editor/index.ts +6 -3
- package/src/form/form-editor/preview/geospatial.js +32 -0
- package/src/form/form-editor/preview/helpers.js +4 -1
- package/src/form/form-editor/preview/index.js +1 -0
|
@@ -10,12 +10,12 @@ export let QuestionTypeSubGroup = /*#__PURE__*/function (QuestionTypeSubGroup) {
|
|
|
10
10
|
return QuestionTypeSubGroup;
|
|
11
11
|
}({});
|
|
12
12
|
export const pageTypeSchema = Joi.string().required().valid('question', 'guidance').description('Type of page - either a question page or guidance page');
|
|
13
|
-
export const questionTypeSchema = Joi.string().required().valid(QuestionTypeSubGroup.WrittenAnswerSubGroup, QuestionTypeSubGroup.DateSubGroup, QuestionTypeSubGroup.LocationSubGroup, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, ComponentType.DeclarationField, QuestionTypeSubGroup.ListSubGroup, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField, ComponentType.PaymentField).description('The high-level type of question, including grouped types');
|
|
14
|
-
export const questionTypeFullSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.DatePartsField, ComponentType.MonthYearField, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, ComponentType.DeclarationField, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField, ComponentType.SelectField, ComponentType.EastingNorthingField, ComponentType.OsGridRefField, ComponentType.NationalGridFieldNumberField, ComponentType.LatLongField, ComponentType.PaymentField).description('The specific component type to use for this question');
|
|
13
|
+
export const questionTypeSchema = Joi.string().required().valid(QuestionTypeSubGroup.WrittenAnswerSubGroup, QuestionTypeSubGroup.DateSubGroup, QuestionTypeSubGroup.LocationSubGroup, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, ComponentType.DeclarationField, QuestionTypeSubGroup.ListSubGroup, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField, ComponentType.PaymentField, ComponentType.GeospatialField).description('The high-level type of question, including grouped types');
|
|
14
|
+
export const questionTypeFullSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.DatePartsField, ComponentType.MonthYearField, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, ComponentType.DeclarationField, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField, ComponentType.SelectField, ComponentType.EastingNorthingField, ComponentType.OsGridRefField, ComponentType.NationalGridFieldNumberField, ComponentType.LatLongField, ComponentType.PaymentField, ComponentType.GeospatialField).description('The specific component type to use for this question');
|
|
15
15
|
export const writtenAnswerSubSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField).description('Subtype for written answer questions');
|
|
16
16
|
export const dateSubSchema = Joi.string().required().valid(ComponentType.DatePartsField, ComponentType.MonthYearField).description('Subtype for date-related questions');
|
|
17
17
|
export const listSubSchema = Joi.string().required().valid(ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField, ComponentType.SelectField).description('Subtype for list-related questions');
|
|
18
|
-
export const locationSubSchema = Joi.string().required().valid(ComponentType.UkAddressField, ComponentType.EastingNorthingField, ComponentType.OsGridRefField, ComponentType.NationalGridFieldNumberField, ComponentType.LatLongField).description('Subtype for location-related questions');
|
|
18
|
+
export const locationSubSchema = Joi.string().required().valid(ComponentType.UkAddressField, ComponentType.EastingNorthingField, ComponentType.OsGridRefField, ComponentType.NationalGridFieldNumberField, ComponentType.LatLongField, ComponentType.GeospatialField).description('Subtype for location-related questions');
|
|
19
19
|
export const nameSchema = Joi.string().trim().required().description('Unique identifier for the field');
|
|
20
20
|
export const questionSchema = Joi.string().trim().required().description('The question text displayed to the user');
|
|
21
21
|
export const hintTextSchema = Joi.string().trim().optional().allow('').description('Optional guidance text displayed below the question');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Joi","rtrimOnly","ComponentType","MAX_NUMBER_OF_REPEAT_ITEMS","MIN_NUMBER_OF_REPEAT_ITEMS","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","description","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","LocationSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","DeclarationField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","PaymentField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","SelectField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","locationSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","instructionTextSchema","questionOptionalSchema","listForQuestionSchema","listItemCountSchema","number","listItemsDataSchema","exactFilesSchema","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioTextSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","custom","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","exitPageSchema","boolean","repeaterSchema","minItemsSchema","maxItemsSchema","questionSetNameSchema","needDeclarationSchema","declarationTextSchema","disableConfirmationEmailSchema","enableReferenceNumberSchema","disableUserFeedbackSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","jsEnabledSchema","usePostcodeLookupSchema","paymentDescriptionSchema","paymentAmountSchema","paymentApiKeySchema","customValidator","extend","joi","type","base","messages","coerce","from","method","value","helpers","rowSeparatorRule","schema","$_getRule","colSeparatorRule","keysRule","rowSeparator","args","rows","split","map","v","filter","Boolean","colSeparator","keys","coercedValue","row","reduce","acc","col","idx","_err","console","error","errors","rules","convert","alias","$_addRule","name","ref","assert","RegExp","message","Array","isArray","every","k","autoCompleteOptionsSchema","dsv","object","text","disallow","parent","unique","ignoreUndefined","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema","govukFieldValueIsString","govukField","includes","govukFieldIsChecked","checkedValue","checked","allowedErrorTemplateFunctions"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { rtrimOnly } from '~/src/common/rtrim-only.js'\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n MAX_NUMBER_OF_REPEAT_ITEMS,\n MIN_NUMBER_OF_REPEAT_ITEMS\n} from '~/src/form/form-definition/index.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion,\n type GovukField,\n type GovukFieldQuestionOptional,\n type GovukFieldUsePostcodeLookup,\n type GovukStringField\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub',\n LocationSubGroup = 'locationSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\n .description('Type of page - either a question page or guidance page')\n\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n QuestionTypeSubGroup.LocationSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.DeclarationField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.PaymentField\n )\n .description('The high-level type of question, including grouped types')\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.DeclarationField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.PaymentField\n )\n .description('The specific component type to use for this question')\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\n .description('Subtype for written answer questions')\n\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\n .description('Subtype for date-related questions')\n\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField\n )\n .description('Subtype for list-related questions')\n\nexport const locationSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.UkAddressField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField\n )\n .description('Subtype for location-related questions')\n\nexport const nameSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the field')\n\nexport const questionSchema = Joi.string()\n .trim()\n .required()\n .description('The question text displayed to the user')\n\nexport const hintTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Optional guidance text displayed below the question')\n\nexport const instructionTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional instruction text with markdown support to help users answer the question'\n )\n\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a question is optional. Empty string or \"true\" values are accepted.'\n )\n\nexport const listForQuestionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for the list used by the field')\n\nexport const listItemCountSchema = Joi.number()\n .optional()\n .description('Number of list items in the list used by the field')\n\nexport const listItemsDataSchema = Joi.string()\n .allow('')\n .description('List items in JSON format, such as for radios or checkboxes.')\n\nexport const exactFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Specifies the exact number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const minFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const maxFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Maximum number of files allowed for upload. Must be between 1 and 25.'\n )\n\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed file types. Can be provided as a single value or an array.'\n )\n\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed document types. Can be provided as a single value or an array.'\n )\n\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed image types. Can be provided as a single value or an array.'\n )\n\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n\nexport const enhancedActionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Action field that can include enhanced functionality')\n\nexport const radioIdSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for radio options')\n\nexport const radioTextSchema = Joi.string()\n .trim()\n .required()\n .description('The visible text shown next to radio options')\n\nexport const radioHintSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional hint text displayed with radio buttons to provide additional guidance'\n )\n\nexport const radioValueSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Array of allowed tabular data types. Can be provided as a single value or an array.'\n )\n\nexport const shortDescriptionSchema = Joi.string()\n .custom(rtrimOnly)\n .required()\n .description('Brief description of the question for internal use')\n\nexport const pageHeadingAndGuidanceSchema = Joi.string()\n .trim()\n .optional()\n .description('Combined heading and guidance for the page')\n\nexport const pageHeadingSchema = Joi.string()\n .trim()\n .required()\n .description('Main heading displayed at the top of the page')\n\nexport const guidanceTextSchema = Joi.string()\n .trim()\n .description('Guidance text to assist users in completing the page')\n\nexport const exitPageSchema = Joi.boolean()\n .default(false)\n .optional()\n .description('Determines if page is set as an Exit Page')\n\nexport const repeaterSchema = Joi.string()\n .trim()\n .optional()\n .description(\n 'Combined min/max items and question set name for the repeater page'\n )\n\nexport const minItemsSchema = Joi.number()\n .empty('')\n .min(MIN_NUMBER_OF_REPEAT_ITEMS)\n .description('The minimum number of repeater items')\n\nexport const maxItemsSchema = Joi.number()\n .empty('')\n .max(MAX_NUMBER_OF_REPEAT_ITEMS)\n .description('The maximum number of repeater items')\n\nexport const questionSetNameSchema = Joi.string()\n .trim()\n .description('The repeater question set name')\n\nexport const needDeclarationSchema = Joi.string()\n .trim()\n .required()\n .description('Whether a declaration is needed')\n\nexport const declarationTextSchema = Joi.string()\n .trim()\n .required()\n .description('Text of the declaration that users must agree to')\n\nexport const disableConfirmationEmailSchema = Joi.boolean()\n .valid(true)\n .description('Whether confirmation emails should be disabled')\n\nexport const enableReferenceNumberSchema = Joi.boolean()\n .valid(true)\n .description('Whether reference number should be enabled')\n\nexport const disableUserFeedbackSchema = Joi.boolean()\n .valid(true)\n .description('Whether user feedback should be disabled')\n\nexport const minSchema = Joi.number()\n .empty('')\n .integer()\n .description('Minimum value for numeric inputs')\n\nexport const maxSchema = Joi.number()\n .empty('')\n .integer()\n .description('Maximum value for numeric inputs')\n\nexport const minLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum character length for text inputs')\n\nexport const maxLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum character length for text inputs')\n\nexport const maxFutureSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Decimal precision for numeric inputs')\n\nexport const prefixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display before the input (e.g., £)')\n\nexport const regexSchema = Joi.string()\n .optional()\n .allow('')\n .description('Regular expression pattern for validation')\n\nexport const rowsSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Number of rows for multiline text fields')\n\nexport const suffixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display after the input (e.g., kg)')\n\nexport const classesSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Custom CSS classes to apply to the component')\n\nexport const jsEnabledSchema = Joi.string()\n .trim()\n .optional()\n .allow('false', 'true')\n .description('Flag to show if Javascript is enabled or not')\n\nexport const usePostcodeLookupSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a UK address component supports postcode lookup. Empty string or \"true\" values are accepted.'\n )\n\nexport const paymentDescriptionSchema = Joi.string()\n .trim()\n .max(230)\n .required()\n .description('Description of payment - appears in payment providers pages')\n\nexport const paymentAmountSchema = Joi.number()\n .empty('')\n .min(0.3)\n .max(100000)\n .description('Amount of payment in pounds')\n\nexport const paymentApiKeySchema = Joi.string()\n .trim()\n .description('API key for payment configuration')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<TSchema = Record<string, unknown>[]>\n extends ArraySchema<TSchema> {\n rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>\n row: (rowSep: string | RegExp) => DSLSchema<TSchema>\n colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>\n col: (colSep: string | RegExp) => DSLSchema<TSchema>\n keys: (keys: string[]) => DSLSchema<TSchema>\n}\n\ninterface CustomValidator extends Joi.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: Joi.Root) => {\n return {\n type: 'dsv',\n base: joi.array(),\n messages: {\n 'dsv.invalid': 'Invalid parse string'\n },\n coerce: {\n from: 'string',\n method(value: string, helpers) {\n try {\n // Only called when prefs.convert is true\n // Rules\n const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator') as\n | undefined\n | GenericRuleOptions<'rowSeparator', string | RegExp>\n const colSeparatorRule = helpers.schema.$_getRule('colSeparator') as\n | undefined\n | GenericRuleOptions<'colSeparator', string | RegExp>\n const keysRule = helpers.schema.$_getRule('keys') as\n | undefined\n | GenericRuleOptions<'keys', string[]>\n\n // Rows\n const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\\r?\\n/\n const rows = value\n .split(rowSeparator)\n .map((v) => v.trim())\n .filter(Boolean)\n\n // Columns\n const colSeparator = colSeparatorRule?.args.colSeparator ?? ','\n const keys = keysRule?.args.keys ?? ['key', 'value']\n\n const coercedValue = rows.map((row) => {\n return row\n .split(colSeparator)\n .reduce<Record<string, string>>((acc, col, idx) => {\n return {\n ...acc,\n [keys[idx]]: col.trim()\n }\n }, {})\n })\n return { value: coercedValue }\n } catch (_err) {\n // eslint-disable-next-line no-console\n console.error(_err)\n return { value, errors: [helpers.error('dsv.invalid')] }\n }\n }\n },\n rules: {\n rowSeparator: {\n convert: true,\n alias: 'row',\n method(rowSeparator: string) {\n return this.$_addRule({\n name: 'rowSeparator',\n args: { rowSeparator }\n })\n },\n args: [\n {\n name: 'rowSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n colSeparator: {\n convert: true,\n alias: 'col',\n method(colSeparator: string) {\n return this.$_addRule({\n name: 'colSeparator',\n args: { colSeparator }\n })\n },\n args: [\n {\n name: 'colSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n keys: {\n convert: true,\n method(keys: string[]) {\n return this.$_addRule({ name: 'keys', args: { keys } })\n },\n args: [\n {\n name: 'keys',\n ref: true,\n assert: (value) =>\n Array.isArray(value) && value.every((k) => typeof k === 'string'),\n message: 'must be an array of strings'\n }\n ]\n }\n }\n }\n}) as CustomValidator\n\nexport const autoCompleteOptionsSchema = customValidator\n .dsv<{ text: string; value: string }[]>()\n .row(/\\r?\\n/)\n .col(':')\n .keys(['text', 'value'])\n .items(\n customValidator.object({\n text: customValidator.string().min(1).disallow('').required(),\n value: customValidator\n .string()\n .default((parent: { text: string; value?: string }) => parent.text)\n .min(1)\n .disallow('')\n })\n )\n .min(1)\n .unique('text')\n .unique('value', { ignoreUndefined: true })\n .required()\n\nexport const questionDetailsFullSchema = {\n autoCompleteOptionsSchema,\n classesSchema,\n declarationTextSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n instructionTextSchema,\n jsEnabledSchema,\n listForQuestionSchema,\n listItemCountSchema,\n listItemsDataSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n paymentAmountSchema,\n paymentApiKeySchema,\n paymentDescriptionSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioTextSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema,\n usePostcodeLookupSchema\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 .description('Input schema for creating a new page in the form editor')\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 .description('Configuration for the check-answers page')\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 .description(\n 'Input schema for creating or updating a question in the form editor'\n )\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 .description('Settings for page content and display in the form editor')\n\nexport function govukFieldValueIsString(\n govukField: GovukField\n): govukField is GovukStringField {\n return [\n 'question',\n 'hintText',\n 'shortDescription',\n 'autoCompleteOptions',\n 'classes',\n 'prefix',\n 'suffix',\n 'paymentAmount',\n 'paymentDescription'\n ].includes(`${govukField.name}`)\n}\n\nexport function govukFieldIsChecked(\n govukField: GovukField\n): govukField is GovukFieldQuestionOptional | GovukFieldUsePostcodeLookup {\n if (\n govukField.name !== 'questionOptional' &&\n govukField.name !== 'usePostcodeLookup'\n ) {\n return false\n }\n const checkedValue = govukField.items?.[0].checked\n return typeof checkedValue === 'boolean'\n}\n\n// A list of allowed template funtions for use within error message templates\nexport const allowedErrorTemplateFunctions = ['lowerFirst', 'capitalise']\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiD,KAAK;AAEhE,SAASC,SAAS;AAClB,SAASC,aAAa;AACtB,SACEC,0BAA0B,EAC1BC,0BAA0B;AAa5B,WAAY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AAmBA,CACjCF,UAAsB,EACkD;EACxE,IACEA,UAAU,CAACrC,IAAI,KAAK,kBAAkB,IACtCqC,UAAU,CAACrC,IAAI,KAAK,mBAAmB,EACvC;IACA,OAAO,KAAK;EACd;EACA,MAAMwC,YAAY,GAAGH,UAAU,CAACzH,KAAK,GAAG,CAAC,CAAC,CAAC6H,OAAO;EAClD,OAAO,OAAOD,YAAY,KAAK,SAAS;AAC1C;;AAEA;AACA,OAAO,MAAME,6BAA6B,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Joi","rtrimOnly","ComponentType","MAX_NUMBER_OF_REPEAT_ITEMS","MIN_NUMBER_OF_REPEAT_ITEMS","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","description","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","LocationSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","DeclarationField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","PaymentField","GeospatialField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","SelectField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","locationSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","instructionTextSchema","questionOptionalSchema","listForQuestionSchema","listItemCountSchema","number","listItemsDataSchema","exactFilesSchema","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioTextSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","custom","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","exitPageSchema","boolean","repeaterSchema","minItemsSchema","maxItemsSchema","questionSetNameSchema","needDeclarationSchema","declarationTextSchema","disableConfirmationEmailSchema","enableReferenceNumberSchema","disableUserFeedbackSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","jsEnabledSchema","usePostcodeLookupSchema","paymentDescriptionSchema","paymentAmountSchema","paymentApiKeySchema","customValidator","extend","joi","type","base","messages","coerce","from","method","value","helpers","rowSeparatorRule","schema","$_getRule","colSeparatorRule","keysRule","rowSeparator","args","rows","split","map","v","filter","Boolean","colSeparator","keys","coercedValue","row","reduce","acc","col","idx","_err","console","error","errors","rules","convert","alias","$_addRule","name","ref","assert","RegExp","message","Array","isArray","every","k","autoCompleteOptionsSchema","dsv","object","text","disallow","parent","unique","ignoreUndefined","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema","govukFieldValueIsString","govukField","includes","govukFieldIsChecked","checkedValue","checked","allowedErrorTemplateFunctions"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { rtrimOnly } from '~/src/common/rtrim-only.js'\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n MAX_NUMBER_OF_REPEAT_ITEMS,\n MIN_NUMBER_OF_REPEAT_ITEMS\n} from '~/src/form/form-definition/index.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion,\n type GovukField,\n type GovukFieldQuestionOptional,\n type GovukFieldUsePostcodeLookup,\n type GovukStringField\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub',\n LocationSubGroup = 'locationSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\n .description('Type of page - either a question page or guidance page')\n\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n QuestionTypeSubGroup.LocationSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.DeclarationField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.PaymentField,\n ComponentType.GeospatialField\n )\n .description('The high-level type of question, including grouped types')\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.DeclarationField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.PaymentField,\n ComponentType.GeospatialField\n )\n .description('The specific component type to use for this question')\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\n .description('Subtype for written answer questions')\n\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\n .description('Subtype for date-related questions')\n\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField\n )\n .description('Subtype for list-related questions')\n\nexport const locationSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.UkAddressField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.GeospatialField\n )\n .description('Subtype for location-related questions')\n\nexport const nameSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the field')\n\nexport const questionSchema = Joi.string()\n .trim()\n .required()\n .description('The question text displayed to the user')\n\nexport const hintTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Optional guidance text displayed below the question')\n\nexport const instructionTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional instruction text with markdown support to help users answer the question'\n )\n\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a question is optional. Empty string or \"true\" values are accepted.'\n )\n\nexport const listForQuestionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for the list used by the field')\n\nexport const listItemCountSchema = Joi.number()\n .optional()\n .description('Number of list items in the list used by the field')\n\nexport const listItemsDataSchema = Joi.string()\n .allow('')\n .description('List items in JSON format, such as for radios or checkboxes.')\n\nexport const exactFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Specifies the exact number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const minFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const maxFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Maximum number of files allowed for upload. Must be between 1 and 25.'\n )\n\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed file types. Can be provided as a single value or an array.'\n )\n\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed document types. Can be provided as a single value or an array.'\n )\n\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed image types. Can be provided as a single value or an array.'\n )\n\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n\nexport const enhancedActionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Action field that can include enhanced functionality')\n\nexport const radioIdSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for radio options')\n\nexport const radioTextSchema = Joi.string()\n .trim()\n .required()\n .description('The visible text shown next to radio options')\n\nexport const radioHintSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional hint text displayed with radio buttons to provide additional guidance'\n )\n\nexport const radioValueSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Array of allowed tabular data types. Can be provided as a single value or an array.'\n )\n\nexport const shortDescriptionSchema = Joi.string()\n .custom(rtrimOnly)\n .required()\n .description('Brief description of the question for internal use')\n\nexport const pageHeadingAndGuidanceSchema = Joi.string()\n .trim()\n .optional()\n .description('Combined heading and guidance for the page')\n\nexport const pageHeadingSchema = Joi.string()\n .trim()\n .required()\n .description('Main heading displayed at the top of the page')\n\nexport const guidanceTextSchema = Joi.string()\n .trim()\n .description('Guidance text to assist users in completing the page')\n\nexport const exitPageSchema = Joi.boolean()\n .default(false)\n .optional()\n .description('Determines if page is set as an Exit Page')\n\nexport const repeaterSchema = Joi.string()\n .trim()\n .optional()\n .description(\n 'Combined min/max items and question set name for the repeater page'\n )\n\nexport const minItemsSchema = Joi.number()\n .empty('')\n .min(MIN_NUMBER_OF_REPEAT_ITEMS)\n .description('The minimum number of repeater items')\n\nexport const maxItemsSchema = Joi.number()\n .empty('')\n .max(MAX_NUMBER_OF_REPEAT_ITEMS)\n .description('The maximum number of repeater items')\n\nexport const questionSetNameSchema = Joi.string()\n .trim()\n .description('The repeater question set name')\n\nexport const needDeclarationSchema = Joi.string()\n .trim()\n .required()\n .description('Whether a declaration is needed')\n\nexport const declarationTextSchema = Joi.string()\n .trim()\n .required()\n .description('Text of the declaration that users must agree to')\n\nexport const disableConfirmationEmailSchema = Joi.boolean()\n .valid(true)\n .description('Whether confirmation emails should be disabled')\n\nexport const enableReferenceNumberSchema = Joi.boolean()\n .valid(true)\n .description('Whether reference number should be enabled')\n\nexport const disableUserFeedbackSchema = Joi.boolean()\n .valid(true)\n .description('Whether user feedback should be disabled')\n\nexport const minSchema = Joi.number()\n .empty('')\n .integer()\n .description('Minimum value for numeric inputs')\n\nexport const maxSchema = Joi.number()\n .empty('')\n .integer()\n .description('Maximum value for numeric inputs')\n\nexport const minLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum character length for text inputs')\n\nexport const maxLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum character length for text inputs')\n\nexport const maxFutureSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Decimal precision for numeric inputs')\n\nexport const prefixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display before the input (e.g., £)')\n\nexport const regexSchema = Joi.string()\n .optional()\n .allow('')\n .description('Regular expression pattern for validation')\n\nexport const rowsSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Number of rows for multiline text fields')\n\nexport const suffixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display after the input (e.g., kg)')\n\nexport const classesSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Custom CSS classes to apply to the component')\n\nexport const jsEnabledSchema = Joi.string()\n .trim()\n .optional()\n .allow('false', 'true')\n .description('Flag to show if Javascript is enabled or not')\n\nexport const usePostcodeLookupSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a UK address component supports postcode lookup. Empty string or \"true\" values are accepted.'\n )\n\nexport const paymentDescriptionSchema = Joi.string()\n .trim()\n .max(230)\n .required()\n .description('Description of payment - appears in payment providers pages')\n\nexport const paymentAmountSchema = Joi.number()\n .empty('')\n .min(0.3)\n .max(100000)\n .description('Amount of payment in pounds')\n\nexport const paymentApiKeySchema = Joi.string()\n .trim()\n .description('API key for payment configuration')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<TSchema = Record<string, unknown>[]>\n extends ArraySchema<TSchema> {\n rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>\n row: (rowSep: string | RegExp) => DSLSchema<TSchema>\n colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>\n col: (colSep: string | RegExp) => DSLSchema<TSchema>\n keys: (keys: string[]) => DSLSchema<TSchema>\n}\n\ninterface CustomValidator extends Joi.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: Joi.Root) => {\n return {\n type: 'dsv',\n base: joi.array(),\n messages: {\n 'dsv.invalid': 'Invalid parse string'\n },\n coerce: {\n from: 'string',\n method(value: string, helpers) {\n try {\n // Only called when prefs.convert is true\n // Rules\n const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator') as\n | undefined\n | GenericRuleOptions<'rowSeparator', string | RegExp>\n const colSeparatorRule = helpers.schema.$_getRule('colSeparator') as\n | undefined\n | GenericRuleOptions<'colSeparator', string | RegExp>\n const keysRule = helpers.schema.$_getRule('keys') as\n | undefined\n | GenericRuleOptions<'keys', string[]>\n\n // Rows\n const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\\r?\\n/\n const rows = value\n .split(rowSeparator)\n .map((v) => v.trim())\n .filter(Boolean)\n\n // Columns\n const colSeparator = colSeparatorRule?.args.colSeparator ?? ','\n const keys = keysRule?.args.keys ?? ['key', 'value']\n\n const coercedValue = rows.map((row) => {\n return row\n .split(colSeparator)\n .reduce<Record<string, string>>((acc, col, idx) => {\n return {\n ...acc,\n [keys[idx]]: col.trim()\n }\n }, {})\n })\n return { value: coercedValue }\n } catch (_err) {\n // eslint-disable-next-line no-console\n console.error(_err)\n return { value, errors: [helpers.error('dsv.invalid')] }\n }\n }\n },\n rules: {\n rowSeparator: {\n convert: true,\n alias: 'row',\n method(rowSeparator: string) {\n return this.$_addRule({\n name: 'rowSeparator',\n args: { rowSeparator }\n })\n },\n args: [\n {\n name: 'rowSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n colSeparator: {\n convert: true,\n alias: 'col',\n method(colSeparator: string) {\n return this.$_addRule({\n name: 'colSeparator',\n args: { colSeparator }\n })\n },\n args: [\n {\n name: 'colSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n keys: {\n convert: true,\n method(keys: string[]) {\n return this.$_addRule({ name: 'keys', args: { keys } })\n },\n args: [\n {\n name: 'keys',\n ref: true,\n assert: (value) =>\n Array.isArray(value) && value.every((k) => typeof k === 'string'),\n message: 'must be an array of strings'\n }\n ]\n }\n }\n }\n}) as CustomValidator\n\nexport const autoCompleteOptionsSchema = customValidator\n .dsv<{ text: string; value: string }[]>()\n .row(/\\r?\\n/)\n .col(':')\n .keys(['text', 'value'])\n .items(\n customValidator.object({\n text: customValidator.string().min(1).disallow('').required(),\n value: customValidator\n .string()\n .default((parent: { text: string; value?: string }) => parent.text)\n .min(1)\n .disallow('')\n })\n )\n .min(1)\n .unique('text')\n .unique('value', { ignoreUndefined: true })\n .required()\n\nexport const questionDetailsFullSchema = {\n autoCompleteOptionsSchema,\n classesSchema,\n declarationTextSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n instructionTextSchema,\n jsEnabledSchema,\n listForQuestionSchema,\n listItemCountSchema,\n listItemsDataSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n paymentAmountSchema,\n paymentApiKeySchema,\n paymentDescriptionSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioTextSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema,\n usePostcodeLookupSchema\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 .description('Input schema for creating a new page in the form editor')\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 .description('Configuration for the check-answers page')\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 .description(\n 'Input schema for creating or updating a question in the form editor'\n )\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 .description('Settings for page content and display in the form editor')\n\nexport function govukFieldValueIsString(\n govukField: GovukField\n): govukField is GovukStringField {\n return [\n 'question',\n 'hintText',\n 'shortDescription',\n 'autoCompleteOptions',\n 'classes',\n 'prefix',\n 'suffix',\n 'paymentAmount',\n 'paymentDescription'\n ].includes(`${govukField.name}`)\n}\n\nexport function govukFieldIsChecked(\n govukField: GovukField\n): govukField is GovukFieldQuestionOptional | GovukFieldUsePostcodeLookup {\n if (\n govukField.name !== 'questionOptional' &&\n govukField.name !== 'usePostcodeLookup'\n ) {\n return false\n }\n const checkedValue = govukField.items?.[0].checked\n return typeof checkedValue === 'boolean'\n}\n\n// A list of allowed template funtions for use within error message templates\nexport const allowedErrorTemplateFunctions = ['lowerFirst', 'capitalise']\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiD,KAAK;AAEhE,SAASC,SAAS;AAClB,SAASC,aAAa;AACtB,SACEC,0BAA0B,EAC1BC,0BAA0B;AAa5B,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAOhC,OAAO,MAAMC,cAAc,GAAGN,GAAG,CAACO,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC7BC,WAAW,CAAC,wDAAwD,CAAC;AAExE,OAAO,MAAMC,kBAAkB,GAAGX,GAAG,CAACO,MAAM,CAAC,CAAC,CAC3CC,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AAO,MAAME,6BAA6B,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentType } from "../../../components/enums.js";
|
|
2
|
+
import { PreviewComponent } from "./preview.js";
|
|
3
|
+
import { Question, QuestionComponentElements } from "./question.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @implements {QuestionElements}
|
|
7
|
+
*/
|
|
8
|
+
export class GeospatialFieldComponentPreviewElements extends QuestionComponentElements {}
|
|
9
|
+
export class GeospatialQuestion extends Question {
|
|
10
|
+
/**
|
|
11
|
+
* @type {ComponentType}
|
|
12
|
+
*/
|
|
13
|
+
componentType = ComponentType.GeospatialField;
|
|
14
|
+
/**
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
18
|
+
_questionTemplate = PreviewComponent.PATH + 'geospatialfield.njk';
|
|
19
|
+
/**
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @protected
|
|
22
|
+
*/
|
|
23
|
+
_fieldName = 'geospatialField';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @import { QuestionElements } from '~/src/form/form-editor/preview/types.js'
|
|
28
|
+
*/
|
|
29
|
+
//# sourceMappingURL=geospatial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geospatial.js","names":["ComponentType","PreviewComponent","Question","QuestionComponentElements","GeospatialFieldComponentPreviewElements","GeospatialQuestion","componentType","GeospatialField","_questionTemplate","PATH","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/geospatial.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\nimport {\n Question,\n QuestionComponentElements\n} from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class GeospatialFieldComponentPreviewElements extends QuestionComponentElements {}\n\nexport class GeospatialQuestion extends Question {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.GeospatialField\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'geospatialfield.njk'\n /**\n * @type {string}\n * @protected\n */\n _fieldName = 'geospatialField'\n}\n\n/**\n * @import { QuestionElements } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SACEC,QAAQ,EACRC,yBAAyB;;AAG3B;AACA;AACA;AACA,OAAO,MAAMC,uCAAuC,SAASD,yBAAyB,CAAC;AAEvF,OAAO,MAAME,kBAAkB,SAASH,QAAQ,CAAC;EAC/C;AACF;AACA;EACEI,aAAa,GAAGN,aAAa,CAACO,eAAe;EAC7C;AACF;AACA;AACA;EACEC,iBAAiB,GAAGP,gBAAgB,CAACQ,IAAI,GAAG,qBAAqB;EACjE;AACF;AACA;AACA;EACEC,UAAU,GAAG,iBAAiB;AAChC;;AAEA;AACA;AACA","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ import { DateInputQuestion } from "./date-input.js";
|
|
|
8
8
|
import { DeclarationComponentPreviewElements, DeclarationQuestion } from "./declaration.js";
|
|
9
9
|
import { EastingNorthingComponentPreviewElements, EastingNorthingQuestion } from "./easting-northing.js";
|
|
10
10
|
import { EmailAddressQuestion } from "./email-address.js";
|
|
11
|
+
import { GeospatialQuestion } from "./geospatial.js";
|
|
11
12
|
import { HiddenQuestion } from "./hidden.js";
|
|
12
13
|
import { LatLongComponentPreviewElements, LatLongQuestion } from "./lat-long.js";
|
|
13
14
|
import { ListComponentElements, ListQuestion, SelectComponentElements } from "./list.js";
|
|
@@ -28,6 +29,7 @@ import { UkAddressComponentPreviewElements, UkAddressQuestion } from "./uk-addre
|
|
|
28
29
|
import { UnsupportedQuestion } from "./unsupported-question.js";
|
|
29
30
|
import { YesNoQuestion } from "./yes-no.js";
|
|
30
31
|
import { findDefinitionListFromComponent } from "../../utils/list.js";
|
|
32
|
+
|
|
31
33
|
/**
|
|
32
34
|
* @type {typeof PreviewComponent}
|
|
33
35
|
*/
|
|
@@ -62,7 +64,8 @@ const InputFieldComponentDictionary = {
|
|
|
62
64
|
[ComponentType.NationalGridFieldNumberField]: NationalGridQuestion,
|
|
63
65
|
[ComponentType.LatLongField]: LatLongQuestion,
|
|
64
66
|
[ComponentType.HiddenField]: HiddenQuestion,
|
|
65
|
-
[ComponentType.PaymentField]: PaymentQuestion
|
|
67
|
+
[ComponentType.PaymentField]: PaymentQuestion,
|
|
68
|
+
[ComponentType.GeospatialField]: GeospatialQuestion
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["ComponentType","hasContentField","hasInputField","hasListField","hasSelectionFields","AutocompleteListQuestion","CheckboxQuestion","ComponentElements","ContentElements","DateInputQuestion","DeclarationComponentPreviewElements","DeclarationQuestion","EastingNorthingComponentPreviewElements","EastingNorthingQuestion","EmailAddressQuestion","HiddenQuestion","LatLongComponentPreviewElements","LatLongQuestion","ListComponentElements","ListQuestion","SelectComponentElements","LongAnswerQuestion","MultilineTextFieldComponentPreviewElements","Markdown","MonthYearQuestion","NationalGridComponentPreviewElements","NationalGridQuestion","NumberComponentPreviewElements","NumberOnlyQuestion","OsGridRefComponentPreviewElements","OsGridRefQuestion","PaymentComponentPreviewElements","PaymentQuestion","PhoneNumberQuestion","QuestionComponentElements","RadioQuestion","SelectQuestion","ShortAnswerQuestion","SupportingEvidenceQuestion","UkAddressComponentPreviewElements","UkAddressQuestion","UnsupportedQuestion","YesNoQuestion","findDefinitionListFromComponent","InvalidFieldComponent","InputFieldComponentDictionary","TextField","Details","InsetText","Html","List","EmailAddressField","NumberField","MultilineTextField","TelephoneNumberField","MonthYearField","DatePartsField","UkAddressField","AutocompleteField","RadiosField","CheckboxesField","SelectField","YesNoField","DeclarationField","FileUploadField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","HiddenField","PaymentField","ComponentToPreviewQuestion","component","definition","componentCoerced","list","_definition","mapComponentToPreviewQuestion","questionRenderer","questionElements","getQuestionElementsFunc","type","QuestionConstructor","previewComponent","id"],"sources":["../../../../../src/form/form-editor/preview/helpers.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n hasContentField,\n hasInputField,\n hasListField,\n hasSelectionFields\n} from '~/src/components/helpers.js'\nimport { AutocompleteListQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { CheckboxQuestion } from '~/src/form/form-editor/preview/checkbox.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { ContentElements } from '~/src/form/form-editor/preview/content.js'\nimport { DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport {\n DeclarationComponentPreviewElements,\n DeclarationQuestion\n} from '~/src/form/form-editor/preview/declaration.js'\nimport {\n EastingNorthingComponentPreviewElements,\n EastingNorthingQuestion\n} from '~/src/form/form-editor/preview/easting-northing.js'\nimport { EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { HiddenQuestion } from '~/src/form/form-editor/preview/hidden.js'\nimport {\n LatLongComponentPreviewElements,\n LatLongQuestion\n} from '~/src/form/form-editor/preview/lat-long.js'\nimport {\n ListComponentElements,\n ListQuestion,\n SelectComponentElements\n} from '~/src/form/form-editor/preview/list.js'\nimport {\n LongAnswerQuestion,\n MultilineTextFieldComponentPreviewElements\n} from '~/src/form/form-editor/preview/long-answer.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { MonthYearQuestion } from '~/src/form/form-editor/preview/month-year.js'\nimport {\n NationalGridComponentPreviewElements,\n NationalGridQuestion\n} from '~/src/form/form-editor/preview/national-grid.js'\nimport {\n NumberComponentPreviewElements,\n NumberOnlyQuestion\n} from '~/src/form/form-editor/preview/number-only.js'\nimport {\n OsGridRefComponentPreviewElements,\n OsGridRefQuestion\n} from '~/src/form/form-editor/preview/os-grid-ref.js'\nimport {\n PaymentComponentPreviewElements,\n PaymentQuestion\n} from '~/src/form/form-editor/preview/payment.js'\nimport { PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { QuestionComponentElements } from '~/src/form/form-editor/preview/question.js'\nimport { RadioQuestion } from '~/src/form/form-editor/preview/radio.js'\nimport { SelectQuestion } from '~/src/form/form-editor/preview/select.js'\nimport { ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { SupportingEvidenceQuestion } from '~/src/form/form-editor/preview/supporting-evidence.js'\nimport {\n UkAddressComponentPreviewElements,\n UkAddressQuestion\n} from '~/src/form/form-editor/preview/uk-address.js'\nimport { UnsupportedQuestion } from '~/src/form/form-editor/preview/unsupported-question.js'\nimport { YesNoQuestion } from '~/src/form/form-editor/preview/yes-no.js'\nimport { findDefinitionListFromComponent } from '~/src/form/utils/list.js'\n/**\n * @type {typeof PreviewComponent}\n */\nconst InvalidFieldComponent = UnsupportedQuestion\n\n/**\n * @type {Partial<Record<ComponentType, typeof PreviewComponent>>}\n */\nconst InputFieldComponentDictionary = {\n [ComponentType.TextField]: ShortAnswerQuestion,\n [ComponentType.Details]: ShortAnswerQuestion,\n [ComponentType.InsetText]: ShortAnswerQuestion,\n [ComponentType.Html]: ShortAnswerQuestion,\n [ComponentType.Markdown]: Markdown,\n [ComponentType.List]: ListQuestion,\n [ComponentType.EmailAddressField]: EmailAddressQuestion,\n [ComponentType.NumberField]: NumberOnlyQuestion,\n [ComponentType.MultilineTextField]: LongAnswerQuestion,\n [ComponentType.TelephoneNumberField]: PhoneNumberQuestion,\n [ComponentType.MonthYearField]: MonthYearQuestion,\n [ComponentType.DatePartsField]: DateInputQuestion,\n [ComponentType.UkAddressField]: UkAddressQuestion,\n [ComponentType.AutocompleteField]: AutocompleteListQuestion,\n [ComponentType.RadiosField]: RadioQuestion,\n [ComponentType.CheckboxesField]: CheckboxQuestion,\n [ComponentType.SelectField]: SelectQuestion,\n [ComponentType.YesNoField]: YesNoQuestion,\n [ComponentType.DeclarationField]: DeclarationQuestion,\n [ComponentType.FileUploadField]: SupportingEvidenceQuestion,\n [ComponentType.EastingNorthingField]: EastingNorthingQuestion,\n [ComponentType.OsGridRefField]: OsGridRefQuestion,\n [ComponentType.NationalGridFieldNumberField]: NationalGridQuestion,\n [ComponentType.LatLongField]: LatLongQuestion,\n [ComponentType.HiddenField]: HiddenQuestion,\n [ComponentType.PaymentField]: PaymentQuestion\n}\n\n/**\n * @type {Partial<Record<ComponentType, (component: ComponentDef, definition: FormDefinition ) => QuestionElements>>}\n */\nconst ComponentToPreviewQuestion = {\n [ComponentType.AutocompleteField]: (component, definition) => {\n const componentCoerced = /** @type {AutocompleteFieldComponent} */ (\n component\n )\n const list = findDefinitionListFromComponent(componentCoerced, definition)\n return new SelectComponentElements(componentCoerced, list)\n },\n [ComponentType.SelectField]: (component, definition) => {\n const componentCoerced = /** @type {SelectFieldComponent} */ (component)\n const list = findDefinitionListFromComponent(componentCoerced, definition)\n return new SelectComponentElements(componentCoerced, list)\n },\n [ComponentType.MultilineTextField]: (component, _definition) => {\n const componentCoerced = /** @type {MultilineTextFieldComponent} */ (\n component\n )\n return new MultilineTextFieldComponentPreviewElements(componentCoerced)\n },\n [ComponentType.UkAddressField]: (component, _definition) => {\n const componentCoerced = /** @type {UkAddressFieldComponent} */ (component)\n return new UkAddressComponentPreviewElements(componentCoerced)\n },\n [ComponentType.NumberField]: (component, _definition) => {\n const componentCoerced = /** @type {NumberFieldComponent} */ (component)\n return new NumberComponentPreviewElements(componentCoerced)\n },\n [ComponentType.DeclarationField]: (component, _definition) => {\n const componentCoerced = /** @type {DeclarationFieldComponent} */ (\n component\n )\n return new DeclarationComponentPreviewElements(componentCoerced)\n },\n [ComponentType.YesNoField]: (component, _definition) => {\n const componentCoerced = /** @type {YesNoFieldComponent} */ (component)\n return new QuestionComponentElements(componentCoerced)\n },\n [ComponentType.EastingNorthingField]: (component, _definition) => {\n const componentCoerced = /** @type {EastingNorthingFieldComponent} */ (\n component\n )\n return new EastingNorthingComponentPreviewElements(componentCoerced)\n },\n [ComponentType.OsGridRefField]: (component, _definition) => {\n const componentCoerced = /** @type {OsGridRefFieldComponent} */ (component)\n return new OsGridRefComponentPreviewElements(componentCoerced)\n },\n [ComponentType.NationalGridFieldNumberField]: (component, _definition) => {\n const componentCoerced =\n /** @type {NationalGridFieldNumberFieldComponent} */ (component)\n return new NationalGridComponentPreviewElements(componentCoerced)\n },\n [ComponentType.LatLongField]: (component, _definition) => {\n const componentCoerced = /** @type {LatLongFieldComponent} */ (component)\n return new LatLongComponentPreviewElements(componentCoerced)\n },\n [ComponentType.PaymentField]: (component, _definition) => {\n const componentCoerced = /** @type {PaymentFieldComponent} */ (component)\n return new PaymentComponentPreviewElements(componentCoerced)\n }\n}\n\n/**\n * @param {QuestionRenderer} questionRenderer\n * @param {FormDefinition} definition\n * @returns {(component: ComponentDef) => Question}\n */\nexport function mapComponentToPreviewQuestion(questionRenderer, definition) {\n return /** @type {(component: ComponentDef) => Question} */ (\n (component) => {\n /**\n * @type {QuestionElements}\n */\n let questionElements\n\n // Look for one-to-one mapping first, then fallback if not found\n const getQuestionElementsFunc = ComponentToPreviewQuestion[component.type]\n if (getQuestionElementsFunc) {\n questionElements = getQuestionElementsFunc(component, definition)\n } else if (hasSelectionFields(component) && hasListField(component)) {\n const list = findDefinitionListFromComponent(component, definition)\n questionElements = new ListComponentElements(component, list)\n } else if (hasInputField(component)) {\n questionElements = new QuestionComponentElements(component)\n } else if (hasContentField(component)) {\n questionElements = new ContentElements(component)\n } else {\n questionElements = new ComponentElements(component)\n }\n\n const QuestionConstructor =\n InputFieldComponentDictionary[component.type] ?? InvalidFieldComponent\n const previewComponent = new QuestionConstructor(\n questionElements,\n questionRenderer\n )\n previewComponent.id = component.id\n return previewComponent\n }\n )\n}\n\n/**\n * @import { QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { Question } from '~/src/form/form-editor/preview/question.js'\n * @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n * @import { FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { AutocompleteFieldComponent, ComponentDef, DeclarationFieldComponent, EastingNorthingFieldComponent, LatLongFieldComponent, MultilineTextFieldComponent, NationalGridFieldNumberFieldComponent, NumberFieldComponent, OsGridRefFieldComponent, PaymentFieldComponent, SelectFieldComponent, UkAddressFieldComponent, YesNoFieldComponent } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,kBAAkB;AAEpB,SAASC,wBAAwB;AACjC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SACEC,mCAAmC,EACnCC,mBAAmB;AAErB,SACEC,uCAAuC,EACvCC,uBAAuB;AAEzB,SAASC,oBAAoB;AAC7B,SAASC,cAAc;AACvB,SACEC,+BAA+B,EAC/BC,eAAe;AAEjB,SACEC,qBAAqB,EACrBC,YAAY,EACZC,uBAAuB;AAEzB,SACEC,kBAAkB,EAClBC,0CAA0C;AAE5C,SAASC,QAAQ;AACjB,SAASC,iBAAiB;AAC1B,SACEC,oCAAoC,EACpCC,oBAAoB;AAEtB,SACEC,8BAA8B,EAC9BC,kBAAkB;AAEpB,SACEC,iCAAiC,EACjCC,iBAAiB;AAEnB,SACEC,+BAA+B,EAC/BC,eAAe;AAEjB,SAASC,mBAAmB;AAC5B,SAASC,yBAAyB;AAClC,SAASC,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SACEC,iCAAiC,EACjCC,iBAAiB;AAEnB,SAASC,mBAAmB;AAC5B,SAASC,aAAa;AACtB,SAASC,+BAA+B;AACxC;AACA;AACA;AACA,MAAMC,qBAAqB,GAAGH,mBAAmB;;AAEjD;AACA;AACA;AACA,MAAMI,6BAA6B,GAAG;EACpC,CAAC7C,aAAa,CAAC8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,UAAU,EAAE;EAC1E,OAAO,oDACJD,SAAS,IAAK;IACb;AACN;AACA;IACM,IAAIO,gBAAgB;;IAEpB;IACA,MAAMC,uBAAuB,GAAGT,0BAA0B,CAACC,SAAS,CAACS,IAAI,CAAC;IAC1E,IAAID,uBAAuB,EAAE;MAC3BD,gBAAgB,GAAGC,uBAAuB,CAACR,SAAS,EAAEC,UAAU,CAAC;IACnE,CAAC,MAAM,IAAIrE,kBAAkB,CAACoE,SAAS,CAAC,IAAIrE,YAAY,CAACqE,SAAS,CAAC,EAAE;MACnE,MAAMG,IAAI,GAAGhC,+BAA+B,CAAC6B,SAAS,EAAEC,UAAU,CAAC;MACnEM,gBAAgB,GAAG,IAAI7D,qBAAqB,CAACsD,SAAS,EAAEG,IAAI,CAAC;IAC/D,CAAC,MAAM,IAAIzE,aAAa,CAACsE,SAAS,CAAC,EAAE;MACnCO,gBAAgB,GAAG,IAAI7C,yBAAyB,CAACsC,SAAS,CAAC;IAC7D,CAAC,MAAM,IAAIvE,eAAe,CAACuE,SAAS,CAAC,EAAE;MACrCO,gBAAgB,GAAG,IAAIvE,eAAe,CAACgE,SAAS,CAAC;IACnD,CAAC,MAAM;MACLO,gBAAgB,GAAG,IAAIxE,iBAAiB,CAACiE,SAAS,CAAC;IACrD;IAEA,MAAMU,mBAAmB,GACvBrC,6BAA6B,CAAC2B,SAAS,CAACS,IAAI,CAAC,IAAIrC,qBAAqB;IACxE,MAAMuC,gBAAgB,GAAG,IAAID,mBAAmB,CAC9CH,gBAAgB,EAChBD,gBACF,CAAC;IACDK,gBAAgB,CAACC,EAAE,GAAGZ,SAAS,CAACY,EAAE;IAClC,OAAOD,gBAAgB;EACzB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["ComponentType","hasContentField","hasInputField","hasListField","hasSelectionFields","AutocompleteListQuestion","CheckboxQuestion","ComponentElements","ContentElements","DateInputQuestion","DeclarationComponentPreviewElements","DeclarationQuestion","EastingNorthingComponentPreviewElements","EastingNorthingQuestion","EmailAddressQuestion","GeospatialQuestion","HiddenQuestion","LatLongComponentPreviewElements","LatLongQuestion","ListComponentElements","ListQuestion","SelectComponentElements","LongAnswerQuestion","MultilineTextFieldComponentPreviewElements","Markdown","MonthYearQuestion","NationalGridComponentPreviewElements","NationalGridQuestion","NumberComponentPreviewElements","NumberOnlyQuestion","OsGridRefComponentPreviewElements","OsGridRefQuestion","PaymentComponentPreviewElements","PaymentQuestion","PhoneNumberQuestion","QuestionComponentElements","RadioQuestion","SelectQuestion","ShortAnswerQuestion","SupportingEvidenceQuestion","UkAddressComponentPreviewElements","UkAddressQuestion","UnsupportedQuestion","YesNoQuestion","findDefinitionListFromComponent","InvalidFieldComponent","InputFieldComponentDictionary","TextField","Details","InsetText","Html","List","EmailAddressField","NumberField","MultilineTextField","TelephoneNumberField","MonthYearField","DatePartsField","UkAddressField","AutocompleteField","RadiosField","CheckboxesField","SelectField","YesNoField","DeclarationField","FileUploadField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","HiddenField","PaymentField","GeospatialField","ComponentToPreviewQuestion","component","definition","componentCoerced","list","_definition","mapComponentToPreviewQuestion","questionRenderer","questionElements","getQuestionElementsFunc","type","QuestionConstructor","previewComponent","id"],"sources":["../../../../../src/form/form-editor/preview/helpers.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n hasContentField,\n hasInputField,\n hasListField,\n hasSelectionFields\n} from '~/src/components/helpers.js'\nimport { AutocompleteListQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { CheckboxQuestion } from '~/src/form/form-editor/preview/checkbox.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { ContentElements } from '~/src/form/form-editor/preview/content.js'\nimport { DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport {\n DeclarationComponentPreviewElements,\n DeclarationQuestion\n} from '~/src/form/form-editor/preview/declaration.js'\nimport {\n EastingNorthingComponentPreviewElements,\n EastingNorthingQuestion\n} from '~/src/form/form-editor/preview/easting-northing.js'\nimport { EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { GeospatialQuestion } from '~/src/form/form-editor/preview/geospatial.js'\nimport { HiddenQuestion } from '~/src/form/form-editor/preview/hidden.js'\nimport {\n LatLongComponentPreviewElements,\n LatLongQuestion\n} from '~/src/form/form-editor/preview/lat-long.js'\nimport {\n ListComponentElements,\n ListQuestion,\n SelectComponentElements\n} from '~/src/form/form-editor/preview/list.js'\nimport {\n LongAnswerQuestion,\n MultilineTextFieldComponentPreviewElements\n} from '~/src/form/form-editor/preview/long-answer.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { MonthYearQuestion } from '~/src/form/form-editor/preview/month-year.js'\nimport {\n NationalGridComponentPreviewElements,\n NationalGridQuestion\n} from '~/src/form/form-editor/preview/national-grid.js'\nimport {\n NumberComponentPreviewElements,\n NumberOnlyQuestion\n} from '~/src/form/form-editor/preview/number-only.js'\nimport {\n OsGridRefComponentPreviewElements,\n OsGridRefQuestion\n} from '~/src/form/form-editor/preview/os-grid-ref.js'\nimport {\n PaymentComponentPreviewElements,\n PaymentQuestion\n} from '~/src/form/form-editor/preview/payment.js'\nimport { PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { QuestionComponentElements } from '~/src/form/form-editor/preview/question.js'\nimport { RadioQuestion } from '~/src/form/form-editor/preview/radio.js'\nimport { SelectQuestion } from '~/src/form/form-editor/preview/select.js'\nimport { ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { SupportingEvidenceQuestion } from '~/src/form/form-editor/preview/supporting-evidence.js'\nimport {\n UkAddressComponentPreviewElements,\n UkAddressQuestion\n} from '~/src/form/form-editor/preview/uk-address.js'\nimport { UnsupportedQuestion } from '~/src/form/form-editor/preview/unsupported-question.js'\nimport { YesNoQuestion } from '~/src/form/form-editor/preview/yes-no.js'\nimport { findDefinitionListFromComponent } from '~/src/form/utils/list.js'\n\n/**\n * @type {typeof PreviewComponent}\n */\nconst InvalidFieldComponent = UnsupportedQuestion\n\n/**\n * @type {Partial<Record<ComponentType, typeof PreviewComponent>>}\n */\nconst InputFieldComponentDictionary = {\n [ComponentType.TextField]: ShortAnswerQuestion,\n [ComponentType.Details]: ShortAnswerQuestion,\n [ComponentType.InsetText]: ShortAnswerQuestion,\n [ComponentType.Html]: ShortAnswerQuestion,\n [ComponentType.Markdown]: Markdown,\n [ComponentType.List]: ListQuestion,\n [ComponentType.EmailAddressField]: EmailAddressQuestion,\n [ComponentType.NumberField]: NumberOnlyQuestion,\n [ComponentType.MultilineTextField]: LongAnswerQuestion,\n [ComponentType.TelephoneNumberField]: PhoneNumberQuestion,\n [ComponentType.MonthYearField]: MonthYearQuestion,\n [ComponentType.DatePartsField]: DateInputQuestion,\n [ComponentType.UkAddressField]: UkAddressQuestion,\n [ComponentType.AutocompleteField]: AutocompleteListQuestion,\n [ComponentType.RadiosField]: RadioQuestion,\n [ComponentType.CheckboxesField]: CheckboxQuestion,\n [ComponentType.SelectField]: SelectQuestion,\n [ComponentType.YesNoField]: YesNoQuestion,\n [ComponentType.DeclarationField]: DeclarationQuestion,\n [ComponentType.FileUploadField]: SupportingEvidenceQuestion,\n [ComponentType.EastingNorthingField]: EastingNorthingQuestion,\n [ComponentType.OsGridRefField]: OsGridRefQuestion,\n [ComponentType.NationalGridFieldNumberField]: NationalGridQuestion,\n [ComponentType.LatLongField]: LatLongQuestion,\n [ComponentType.HiddenField]: HiddenQuestion,\n [ComponentType.PaymentField]: PaymentQuestion,\n [ComponentType.GeospatialField]: GeospatialQuestion\n}\n\n/**\n * @type {Partial<Record<ComponentType, (component: ComponentDef, definition: FormDefinition ) => QuestionElements>>}\n */\nconst ComponentToPreviewQuestion = {\n [ComponentType.AutocompleteField]: (component, definition) => {\n const componentCoerced = /** @type {AutocompleteFieldComponent} */ (\n component\n )\n const list = findDefinitionListFromComponent(componentCoerced, definition)\n return new SelectComponentElements(componentCoerced, list)\n },\n [ComponentType.SelectField]: (component, definition) => {\n const componentCoerced = /** @type {SelectFieldComponent} */ (component)\n const list = findDefinitionListFromComponent(componentCoerced, definition)\n return new SelectComponentElements(componentCoerced, list)\n },\n [ComponentType.MultilineTextField]: (component, _definition) => {\n const componentCoerced = /** @type {MultilineTextFieldComponent} */ (\n component\n )\n return new MultilineTextFieldComponentPreviewElements(componentCoerced)\n },\n [ComponentType.UkAddressField]: (component, _definition) => {\n const componentCoerced = /** @type {UkAddressFieldComponent} */ (component)\n return new UkAddressComponentPreviewElements(componentCoerced)\n },\n [ComponentType.NumberField]: (component, _definition) => {\n const componentCoerced = /** @type {NumberFieldComponent} */ (component)\n return new NumberComponentPreviewElements(componentCoerced)\n },\n [ComponentType.DeclarationField]: (component, _definition) => {\n const componentCoerced = /** @type {DeclarationFieldComponent} */ (\n component\n )\n return new DeclarationComponentPreviewElements(componentCoerced)\n },\n [ComponentType.YesNoField]: (component, _definition) => {\n const componentCoerced = /** @type {YesNoFieldComponent} */ (component)\n return new QuestionComponentElements(componentCoerced)\n },\n [ComponentType.EastingNorthingField]: (component, _definition) => {\n const componentCoerced = /** @type {EastingNorthingFieldComponent} */ (\n component\n )\n return new EastingNorthingComponentPreviewElements(componentCoerced)\n },\n [ComponentType.OsGridRefField]: (component, _definition) => {\n const componentCoerced = /** @type {OsGridRefFieldComponent} */ (component)\n return new OsGridRefComponentPreviewElements(componentCoerced)\n },\n [ComponentType.NationalGridFieldNumberField]: (component, _definition) => {\n const componentCoerced =\n /** @type {NationalGridFieldNumberFieldComponent} */ (component)\n return new NationalGridComponentPreviewElements(componentCoerced)\n },\n [ComponentType.LatLongField]: (component, _definition) => {\n const componentCoerced = /** @type {LatLongFieldComponent} */ (component)\n return new LatLongComponentPreviewElements(componentCoerced)\n },\n [ComponentType.PaymentField]: (component, _definition) => {\n const componentCoerced = /** @type {PaymentFieldComponent} */ (component)\n return new PaymentComponentPreviewElements(componentCoerced)\n }\n}\n\n/**\n * @param {QuestionRenderer} questionRenderer\n * @param {FormDefinition} definition\n * @returns {(component: ComponentDef) => Question}\n */\nexport function mapComponentToPreviewQuestion(questionRenderer, definition) {\n return /** @type {(component: ComponentDef) => Question} */ (\n (component) => {\n /**\n * @type {QuestionElements}\n */\n let questionElements\n\n // Look for one-to-one mapping first, then fallback if not found\n const getQuestionElementsFunc = ComponentToPreviewQuestion[component.type]\n if (getQuestionElementsFunc) {\n questionElements = getQuestionElementsFunc(component, definition)\n } else if (hasSelectionFields(component) && hasListField(component)) {\n const list = findDefinitionListFromComponent(component, definition)\n questionElements = new ListComponentElements(component, list)\n } else if (hasInputField(component)) {\n questionElements = new QuestionComponentElements(component)\n } else if (hasContentField(component)) {\n questionElements = new ContentElements(component)\n } else {\n questionElements = new ComponentElements(component)\n }\n\n const QuestionConstructor =\n InputFieldComponentDictionary[component.type] ?? InvalidFieldComponent\n const previewComponent = new QuestionConstructor(\n questionElements,\n questionRenderer\n )\n previewComponent.id = component.id\n return previewComponent\n }\n )\n}\n\n/**\n * @import { QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { Question } from '~/src/form/form-editor/preview/question.js'\n * @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n * @import { FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { AutocompleteFieldComponent, ComponentDef, DeclarationFieldComponent, EastingNorthingFieldComponent, LatLongFieldComponent, MultilineTextFieldComponent, NationalGridFieldNumberFieldComponent, NumberFieldComponent, OsGridRefFieldComponent, PaymentFieldComponent, SelectFieldComponent, UkAddressFieldComponent, YesNoFieldComponent } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,kBAAkB;AAEpB,SAASC,wBAAwB;AACjC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AACxB,SAASC,iBA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AEC,UAAU,CAAC;MACnEM,gBAAgB,GAAG,IAAI9D,qBAAqB,CAACuD,SAAS,EAAEG,IAAI,CAAC;IAC/D,CAAC,MAAM,IAAI3E,aAAa,CAACwE,SAAS,CAAC,EAAE;MACnCO,gBAAgB,GAAG,IAAI9C,yBAAyB,CAACuC,SAAS,CAAC;IAC7D,CAAC,MAAM,IAAIzE,eAAe,CAACyE,SAAS,CAAC,EAAE;MACrCO,gBAAgB,GAAG,IAAIzE,eAAe,CAACkE,SAAS,CAAC;IACnD,CAAC,MAAM;MACLO,gBAAgB,GAAG,IAAI1E,iBAAiB,CAACmE,SAAS,CAAC;IACrD;IAEA,MAAMU,mBAAmB,GACvBtC,6BAA6B,CAAC4B,SAAS,CAACS,IAAI,CAAC,IAAItC,qBAAqB;IACxE,MAAMwC,gBAAgB,GAAG,IAAID,mBAAmB,CAC9CH,gBAAgB,EAChBD,gBACF,CAAC;IACDK,gBAAgB,CAACC,EAAE,GAAGZ,SAAS,CAACY,EAAE;IAClC,OAAOD,gBAAgB;EACzB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -28,6 +28,7 @@ export * from "./unsupported-question.js";
|
|
|
28
28
|
export * from "./yes-no.js";
|
|
29
29
|
export * from "./hidden.js";
|
|
30
30
|
export * from "./payment.js";
|
|
31
|
+
export * from "./geospatial.js";
|
|
31
32
|
export * from "./controller/page-controller-base.js";
|
|
32
33
|
export * from "./controller/page-controller.js";
|
|
33
34
|
export * from "./controller/guidance-page-controller.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/autocomplete.js'\nexport * from '~/src/form/form-editor/preview/checkbox.js'\nexport * from '~/src/form/form-editor/preview/checkbox-sortable.js'\nexport * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/declaration.js'\nexport * from '~/src/form/form-editor/preview/easting-northing.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/lat-long.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/markdown.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/national-grid.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/os-grid-ref.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/select.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/supporting-evidence.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\nexport * from '~/src/form/form-editor/preview/unsupported-question.js'\nexport * from '~/src/form/form-editor/preview/yes-no.js'\nexport * from '~/src/form/form-editor/preview/hidden.js'\nexport * from '~/src/form/form-editor/preview/payment.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/guidance-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/summary-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/reorder-questions-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/autocomplete.js'\nexport * from '~/src/form/form-editor/preview/checkbox.js'\nexport * from '~/src/form/form-editor/preview/checkbox-sortable.js'\nexport * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/declaration.js'\nexport * from '~/src/form/form-editor/preview/easting-northing.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/lat-long.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/markdown.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/national-grid.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/os-grid-ref.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/select.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/supporting-evidence.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\nexport * from '~/src/form/form-editor/preview/unsupported-question.js'\nexport * from '~/src/form/form-editor/preview/yes-no.js'\nexport * from '~/src/form/form-editor/preview/hidden.js'\nexport * from '~/src/form/form-editor/preview/payment.js'\nexport * from '~/src/form/form-editor/preview/geospatial.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/guidance-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/summary-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/reorder-questions-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,KAAK,WAAW,EAAuB,MAAM,KAAK,CAAA;AAQhE,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AAExC,oBAAY,oBAAoB;IAC9B,qBAAqB,qBAAqB;IAC1C,YAAY,YAAY;IACxB,YAAY,YAAY;IACxB,gBAAgB,gBAAgB;CACjC;AAED,eAAO,MAAM,cAAc,0BAG6C,CAAA;AAExE,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,KAAK,WAAW,EAAuB,MAAM,KAAK,CAAA;AAQhE,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B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L,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAI8B,CAAA;AAE5E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,gBAAgB,CAYhC;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,0BAA0B,GAAG,2BAA2B,CASxE;AAGD,eAAO,MAAM,6BAA6B,UAA+B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @implements {QuestionElements}
|
|
3
|
+
*/
|
|
4
|
+
export class GeospatialFieldComponentPreviewElements extends QuestionComponentElements implements QuestionElements {
|
|
5
|
+
}
|
|
6
|
+
export class GeospatialQuestion extends Question {
|
|
7
|
+
}
|
|
8
|
+
import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
|
|
9
|
+
import { QuestionComponentElements } from '../../../form/form-editor/preview/question.js';
|
|
10
|
+
import { Question } from '../../../form/form-editor/preview/question.js';
|
|
11
|
+
//# sourceMappingURL=geospatial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geospatial.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/geospatial.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;CAAyF;AAEzF;CAeC;sCAGoC,yCAAyC;0CAzBvE,4CAA4C;yBAA5C,4CAA4C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AA2KA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CAmCjD;sCAGsD,yCAAyC;oCAG7D,qCAAqC;kCACoR,2BAA2B;8BAH1V,4CAA4C"}
|
|
@@ -28,6 +28,7 @@ export * from "../../../form/form-editor/preview/unsupported-question.js";
|
|
|
28
28
|
export * from "../../../form/form-editor/preview/yes-no.js";
|
|
29
29
|
export * from "../../../form/form-editor/preview/hidden.js";
|
|
30
30
|
export * from "../../../form/form-editor/preview/payment.js";
|
|
31
|
+
export * from "../../../form/form-editor/preview/geospatial.js";
|
|
31
32
|
export * from "../../../form/form-editor/preview/controller/page-controller-base.js";
|
|
32
33
|
export * from "../../../form/form-editor/preview/controller/page-controller.js";
|
|
33
34
|
export * from "../../../form/form-editor/preview/controller/guidance-page-controller.js";
|
package/package.json
CHANGED
|
@@ -45,7 +45,8 @@ export const questionTypeSchema = Joi.string()
|
|
|
45
45
|
ComponentType.CheckboxesField,
|
|
46
46
|
ComponentType.RadiosField,
|
|
47
47
|
ComponentType.AutocompleteField,
|
|
48
|
-
ComponentType.PaymentField
|
|
48
|
+
ComponentType.PaymentField,
|
|
49
|
+
ComponentType.GeospatialField
|
|
49
50
|
)
|
|
50
51
|
.description('The high-level type of question, including grouped types')
|
|
51
52
|
|
|
@@ -71,7 +72,8 @@ export const questionTypeFullSchema = Joi.string()
|
|
|
71
72
|
ComponentType.OsGridRefField,
|
|
72
73
|
ComponentType.NationalGridFieldNumberField,
|
|
73
74
|
ComponentType.LatLongField,
|
|
74
|
-
ComponentType.PaymentField
|
|
75
|
+
ComponentType.PaymentField,
|
|
76
|
+
ComponentType.GeospatialField
|
|
75
77
|
)
|
|
76
78
|
.description('The specific component type to use for this question')
|
|
77
79
|
|
|
@@ -107,7 +109,8 @@ export const locationSubSchema = Joi.string()
|
|
|
107
109
|
ComponentType.EastingNorthingField,
|
|
108
110
|
ComponentType.OsGridRefField,
|
|
109
111
|
ComponentType.NationalGridFieldNumberField,
|
|
110
|
-
ComponentType.LatLongField
|
|
112
|
+
ComponentType.LatLongField,
|
|
113
|
+
ComponentType.GeospatialField
|
|
111
114
|
)
|
|
112
115
|
.description('Subtype for location-related questions')
|
|
113
116
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentType } from '~/src/components/enums.js'
|
|
2
|
+
import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'
|
|
3
|
+
import {
|
|
4
|
+
Question,
|
|
5
|
+
QuestionComponentElements
|
|
6
|
+
} from '~/src/form/form-editor/preview/question.js'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @implements {QuestionElements}
|
|
10
|
+
*/
|
|
11
|
+
export class GeospatialFieldComponentPreviewElements extends QuestionComponentElements {}
|
|
12
|
+
|
|
13
|
+
export class GeospatialQuestion extends Question {
|
|
14
|
+
/**
|
|
15
|
+
* @type {ComponentType}
|
|
16
|
+
*/
|
|
17
|
+
componentType = ComponentType.GeospatialField
|
|
18
|
+
/**
|
|
19
|
+
* @type {string}
|
|
20
|
+
* @protected
|
|
21
|
+
*/
|
|
22
|
+
_questionTemplate = PreviewComponent.PATH + 'geospatialfield.njk'
|
|
23
|
+
/**
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @protected
|
|
26
|
+
*/
|
|
27
|
+
_fieldName = 'geospatialField'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @import { QuestionElements } from '~/src/form/form-editor/preview/types.js'
|
|
32
|
+
*/
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
EastingNorthingQuestion
|
|
20
20
|
} from '~/src/form/form-editor/preview/easting-northing.js'
|
|
21
21
|
import { EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'
|
|
22
|
+
import { GeospatialQuestion } from '~/src/form/form-editor/preview/geospatial.js'
|
|
22
23
|
import { HiddenQuestion } from '~/src/form/form-editor/preview/hidden.js'
|
|
23
24
|
import {
|
|
24
25
|
LatLongComponentPreviewElements,
|
|
@@ -64,6 +65,7 @@ import {
|
|
|
64
65
|
import { UnsupportedQuestion } from '~/src/form/form-editor/preview/unsupported-question.js'
|
|
65
66
|
import { YesNoQuestion } from '~/src/form/form-editor/preview/yes-no.js'
|
|
66
67
|
import { findDefinitionListFromComponent } from '~/src/form/utils/list.js'
|
|
68
|
+
|
|
67
69
|
/**
|
|
68
70
|
* @type {typeof PreviewComponent}
|
|
69
71
|
*/
|
|
@@ -98,7 +100,8 @@ const InputFieldComponentDictionary = {
|
|
|
98
100
|
[ComponentType.NationalGridFieldNumberField]: NationalGridQuestion,
|
|
99
101
|
[ComponentType.LatLongField]: LatLongQuestion,
|
|
100
102
|
[ComponentType.HiddenField]: HiddenQuestion,
|
|
101
|
-
[ComponentType.PaymentField]: PaymentQuestion
|
|
103
|
+
[ComponentType.PaymentField]: PaymentQuestion,
|
|
104
|
+
[ComponentType.GeospatialField]: GeospatialQuestion
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
/**
|
|
@@ -28,6 +28,7 @@ export * from '~/src/form/form-editor/preview/unsupported-question.js'
|
|
|
28
28
|
export * from '~/src/form/form-editor/preview/yes-no.js'
|
|
29
29
|
export * from '~/src/form/form-editor/preview/hidden.js'
|
|
30
30
|
export * from '~/src/form/form-editor/preview/payment.js'
|
|
31
|
+
export * from '~/src/form/form-editor/preview/geospatial.js'
|
|
31
32
|
export * from '~/src/form/form-editor/preview/controller/page-controller-base.js'
|
|
32
33
|
export * from '~/src/form/form-editor/preview/controller/page-controller.js'
|
|
33
34
|
export * from '~/src/form/form-editor/preview/controller/guidance-page-controller.js'
|