@defra/forms-model 3.0.485 → 3.0.487
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-definition/index.js +5 -1
- package/dist/module/form/form-definition/index.js.map +1 -1
- package/dist/module/form/form-editor/__stubs__/preview.js +8 -3
- package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
- package/dist/module/form/form-editor/preview/component-elements.js +10 -2
- package/dist/module/form/form-editor/preview/component-elements.js.map +1 -1
- package/dist/module/form/form-editor/preview/content.js +3 -2
- package/dist/module/form/form-editor/preview/content.js.map +1 -1
- package/dist/module/form/form-editor/preview/controller/page-controller.js +3 -17
- package/dist/module/form/form-editor/preview/controller/page-controller.js.map +1 -1
- package/dist/module/form/form-editor/preview/helpers.js +6 -5
- package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
- package/dist/module/form/form-editor/preview/list.js +3 -2
- package/dist/module/form/form-editor/preview/list.js.map +1 -1
- package/dist/module/form/form-editor/preview/preview.js +12 -3
- package/dist/module/form/form-editor/preview/preview.js.map +1 -1
- package/dist/module/form/form-editor/preview/question.js +2 -2
- package/dist/module/form/form-editor/preview/question.js.map +1 -1
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/types/form/form-definition/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/__stubs__/preview.d.ts +2 -1
- package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/component-elements.d.ts +7 -1
- package/dist/types/form/form-editor/preview/component-elements.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/content.d.ts +2 -1
- package/dist/types/form/form-editor/preview/content.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts +0 -10
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/helpers.d.ts +2 -1
- package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/list.d.ts +2 -1
- package/dist/types/form/form-editor/preview/list.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/preview.d.ts +5 -0
- package/dist/types/form/form-editor/preview/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/question.d.ts +1 -1
- package/dist/types/form/form-editor/preview/question.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/types.d.ts +1 -0
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/form-definition-v2-schema.json +5 -5
- package/src/form/form-definition/index.ts +5 -3
- package/src/form/form-editor/__stubs__/preview.js +15 -4
- package/src/form/form-editor/preview/component-elements.js +10 -2
- package/src/form/form-editor/preview/content.js +3 -2
- package/src/form/form-editor/preview/controller/page-controller.js +8 -17
- package/src/form/form-editor/preview/helpers.js +10 -5
- package/src/form/form-editor/preview/list.js +3 -2
- package/src/form/form-editor/preview/preview.js +15 -3
- package/src/form/form-editor/preview/question.js +2 -2
- package/src/form/form-editor/preview/types.ts +1 -0
@@ -127,7 +127,11 @@ export const conditionWrapperSchemaV2 = Joi.object().description('Container for
|
|
127
127
|
is: Joi.array().min(2),
|
128
128
|
then: Joi.required()
|
129
129
|
}).description('Logical operator connecting this condition with others (AND, OR)'),
|
130
|
-
items: Joi.array().items(Joi.alternatives().
|
130
|
+
items: Joi.array().items(Joi.alternatives().conditional('.componentId', {
|
131
|
+
is: Joi.exist(),
|
132
|
+
then: conditionDataSchemaV2,
|
133
|
+
otherwise: conditionRefDataSchemaV2
|
134
|
+
})).min(1).max(15).description('Array of conditions or condition references')
|
131
135
|
}).description('Condition schema for V2 forms');
|
132
136
|
export const componentSchema = Joi.object().description('Form component definition specifying UI element behavior').keys({
|
133
137
|
id: idSchemaOptional.description('Unique identifier for the component'),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["JoiDate","JoiBase","v4","uuidV4","ComponentType","ConditionType","OperatorName","SchemaVersion","ControllerType","hasComponents","Joi","extend","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","valid","itemId","relativeDateValueDataSchemaV2","period","number","integer","positive","unit","direction","relativeDateValueDataSchema","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","Object","values","any","switch","BooleanValue","StringValue","NumberValue","DateValue","date","format","raw","ListItemRef","RelativeDate","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","min","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","otherwise","allow","hint","options","rows","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","componentPayloadSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","pageSchema","disallow","section","controller","repeat","strip","next","events","view","pageSchemaV2","append","FileUpload","pagePayloadSchemaV2","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","messages","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","V1","feedback","startPage","sections","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import JoiDate from '@joi/date'\nimport JoiBase, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport { ConditionType, OperatorName } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData,\n type RelativeDateValueDataV2\n} from '~/src/conditions/types.js'\nimport {\n SchemaVersion,\n type ConditionWrapper,\n type ConditionWrapperV2,\n type Event,\n type EventOptions,\n type Events,\n type FormDefinition,\n type Item,\n type Link,\n type List,\n type Page,\n type PhaseBanner,\n type Repeat,\n type RepeatOptions,\n type RepeatSchema,\n type Section\n} from '~/src/form/form-definition/types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.filter((list) => list.id).map((list) => list.id)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n listId: Joi.string()\n .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n })\n\nconst relativeDateValueDataSchemaV2 = Joi.object<RelativeDateValueDataV2>()\n .description('Relative date specification for date-based conditions')\n .keys({\n period: Joi.number()\n .integer()\n .positive()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .valid(...Object.values(OperatorName))\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n type: Joi.string()\n .trim()\n .valid(...Object.values(ConditionType))\n .required()\n .description('Type of the condition value'),\n value: Joi.any()\n .required()\n .description('The actual value to compare against')\n .when('type', {\n switch: [\n { is: ConditionType.BooleanValue, then: Joi.boolean() },\n { is: ConditionType.StringValue, then: Joi.string() },\n { is: ConditionType.NumberValue, then: Joi.number() },\n {\n is: ConditionType.DateValue,\n then: Joi.date().format('YYYY-MM-DD').raw()\n },\n {\n is: ConditionType.ListItemRef,\n then: conditionListItemRefDataSchemaV2\n },\n {\n is: ConditionType.RelativeDate,\n then: relativeDateValueDataSchemaV2\n }\n ]\n })\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives()\n .try(conditionDataSchemaV2, conditionRefDataSchemaV2)\n .required()\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('name')\n .unique('id')\n .min(1)\n .max(2)\n .description('Components allowed on Page Upload schema')\n\n/**\n * `/status` is a special route for providing a user's application status.\n * It should not be configured via the designer.\n */\nexport const pageSchema = Joi.object<Page>()\n .description('Form page definition specifying content and behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the page'),\n path: Joi.string()\n .trim()\n .required()\n .disallow('/status')\n .description(\n 'URL path for this page, must not be the reserved \"/status\" path'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().trim().description('Section this page belongs to'),\n controller: Joi.string()\n .trim()\n .optional()\n .description('Custom controller class name for special page behavior'),\n components: Joi.array<ComponentDef>()\n .items(componentSchema)\n .unique('name')\n .description('UI components displayed on this page'),\n repeat: Joi.when('controller', {\n is: Joi.string().trim().valid('RepeatPageController').required(),\n then: pageRepeatSchema\n .required()\n .description(\n 'Configuration for repeatable pages, required when using RepeatPageController'\n ),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional condition that determines if this page is shown'),\n next: Joi.array<Link>()\n .items(nextSchema)\n .default([])\n .description('Possible navigation paths after this page'),\n events: eventsSchema\n .optional()\n .description('Event handlers for page lifecycle events'),\n view: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional custom view template to use for rendering this page'\n )\n })\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema\n .append({\n id: idSchema.description('Unique identifier for the page'),\n title: Joi.string()\n .trim()\n .allow('')\n .required()\n .description(\n 'Page title displayed at the top of the page (with support for empty titles in V2)'\n ),\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n }),\n condition: Joi.string()\n .trim()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .messages({\n 'array.unique':\n 'Each item must have a unique identifier - enter a different identifier for this item.'\n })\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n })\n })\n\n/**\n * V2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: idSchema.description('Unique identifier for the list')\n })\n .description('List schema for V2 forms')\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>()\n .description('Feedback configuration for the form')\n .keys({\n feedbackForm: Joi.boolean()\n .default(false)\n .description('Whether to show the built-in feedback form'),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'URL to an external feedback form when not using built-in feedback'\n )\n }),\n emailAddress: Joi.string()\n .trim()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n .description('Email address where feedback is sent')\n })\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>()\n .description('Phase banner configuration showing development status')\n .keys({\n phase: Joi.string()\n .trim()\n .valid('alpha', 'beta')\n .description('Development phase of the service (alpha or beta)')\n })\n\nconst outputSchema = Joi.object<FormDefinition['output']>()\n .description('Configuration for form submission output')\n .keys({\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier for the output format')\n })\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .description('Complete form definition describing all aspects of a form')\n .required()\n .keys({\n engine: Joi.string()\n .trim()\n .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V1)\n .default(SchemaVersion.V1)\n .description('Form schema version to use (1 or 2)'),\n name: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Unique name identifying the form'),\n feedback: feedbackSchema\n .optional()\n .description('Feedback mechanism configuration'),\n startPage: Joi.string()\n .trim()\n .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .items(pageSchema)\n .description('Pages schema for V1 forms')\n .unique('path'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together'),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic'),\n lists: Joi.array<List>()\n .items(listSchema)\n .unique('name')\n .unique('title')\n .description('Reusable lists of options for select components'),\n metadata: Joi.object({ a: Joi.any() })\n .unknown()\n .optional()\n .description('Custom metadata for the form'),\n declaration: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Declaration text shown on the summary page'),\n skipSummary: Joi.any()\n .strip()\n .description('option to skip the summary page'),\n phaseBanner: phaseBannerSchema\n .optional()\n .description('Phase banner configuration'),\n outputEmail: Joi.string()\n .trim()\n .email({ tlds: { allow: ['uk'] } })\n .optional()\n .description('Email address where form submissions are sent'),\n output: outputSchema\n .optional()\n .description('Configuration for submission output format')\n })\n\nexport const formDefinitionV2Schema = formDefinitionSchema\n .keys({\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V2)\n .description('Form schema version to use (2)'),\n pages: Joi.array<Page>()\n .items(pageSchemaV2)\n .required()\n .unique('path')\n .unique('id')\n .description('Pages schema for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id')\n .description('Lists schema for V2 forms'),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\n })\n .description('Form definition schema for V2')\n\n// Maintain compatibility with legacy named export\n// E.g. `import { Schema } from '@defra/forms-model'`\nexport const Schema = formDefinitionSchema\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiC,KAAK;AACpD,SAASC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CAAC,CACjBC,OAAO,CAAC,CAAC,CACTL,KAAK,CAACrD,aAAa,CAAC0L,EAAE,CAAC,CACvBzJ,WAAW,CAAC,gCAAgC,CAAC;EAChDd,KAAK,EAAEhB,GAAG,CAACuF,KAAK,CAAO,CAAC,CACrB7D,KAAK,CAACyH,YAAY,CAAC,CACnBjH,QAAQ,CAAC,CAAC,CACVuG,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,CAAC,CACZ3G,WAAW,CAAC,2BAA2B,CAAC;EAC3CP,KAAK,EAAEvB,GAAG,CAACuF,KAAK,CAAO,CAAC,CACrB7D,KAAK,CAACoI,YAAY,CAAC,CACnBrB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,CAAC,CACZ3G,WAAW,CAAC,2BAA2B,CAAC;EAC3CnB,UAAU,EAAEX,GAAG,CAACuF,KAAK,CAAqB,CAAC,CACxC7D,KAAK,CAACkE,wBAAwB,CAAC,CAC/B6C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrB3G,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM0J,MAAM,GAAGf,oBAAoB","ignoreList":[]}
|
1
|
+
{"version":3,"file":"index.js","names":["JoiDate","JoiBase","v4","uuidV4","ComponentType","ConditionType","OperatorName","SchemaVersion","ControllerType","hasComponents","Joi","extend","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","valid","itemId","relativeDateValueDataSchemaV2","period","number","integer","positive","unit","direction","relativeDateValueDataSchema","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","Object","values","any","switch","BooleanValue","StringValue","NumberValue","DateValue","date","format","raw","ListItemRef","RelativeDate","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","min","conditional","otherwise","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","allow","hint","options","rows","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","componentPayloadSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","pageSchema","disallow","section","controller","repeat","strip","next","events","view","pageSchemaV2","append","FileUpload","pagePayloadSchemaV2","baseListItemSchema","text","stringListItemSchema","numberListItemSchema","listSchema","messages","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","V1","feedback","startPage","sections","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import JoiDate from '@joi/date'\nimport JoiBase, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport { ConditionType, OperatorName } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData,\n type RelativeDateValueDataV2\n} from '~/src/conditions/types.js'\nimport {\n SchemaVersion,\n type ConditionWrapper,\n type ConditionWrapperV2,\n type Event,\n type EventOptions,\n type Events,\n type FormDefinition,\n type Item,\n type Link,\n type List,\n type Page,\n type PhaseBanner,\n type Repeat,\n type RepeatOptions,\n type RepeatSchema,\n type Section\n} from '~/src/form/form-definition/types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.filter((list) => list.id).map((list) => list.id)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n listId: Joi.string()\n .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n })\n\nconst relativeDateValueDataSchemaV2 = Joi.object<RelativeDateValueDataV2>()\n .description('Relative date specification for date-based conditions')\n .keys({\n period: Joi.number()\n .integer()\n .positive()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .valid(...Object.values(OperatorName))\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n type: Joi.string()\n .trim()\n .valid(...Object.values(ConditionType))\n .required()\n .description('Type of the condition value'),\n value: Joi.any()\n .required()\n .description('The actual value to compare against')\n .when('type', {\n switch: [\n { is: ConditionType.BooleanValue, then: Joi.boolean() },\n { is: ConditionType.StringValue, then: Joi.string() },\n { is: ConditionType.NumberValue, then: Joi.number() },\n {\n is: ConditionType.DateValue,\n then: Joi.date().format('YYYY-MM-DD').raw()\n },\n {\n is: ConditionType.ListItemRef,\n then: conditionListItemRefDataSchemaV2\n },\n {\n is: ConditionType.RelativeDate,\n then: relativeDateValueDataSchemaV2\n }\n ]\n })\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives().conditional('.componentId', {\n is: Joi.exist(),\n then: conditionDataSchemaV2,\n otherwise: conditionRefDataSchemaV2\n })\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('name')\n .unique('id')\n .min(1)\n .max(2)\n .description('Components allowed on Page Upload schema')\n\n/**\n * `/status` is a special route for providing a user's application status.\n * It should not be configured via the designer.\n */\nexport const pageSchema = Joi.object<Page>()\n .description('Form page definition specifying content and behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the page'),\n path: Joi.string()\n .trim()\n .required()\n .disallow('/status')\n .description(\n 'URL path for this page, must not be the reserved \"/status\" path'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().trim().description('Section this page belongs to'),\n controller: Joi.string()\n .trim()\n .optional()\n .description('Custom controller class name for special page behavior'),\n components: Joi.array<ComponentDef>()\n .items(componentSchema)\n .unique('name')\n .description('UI components displayed on this page'),\n repeat: Joi.when('controller', {\n is: Joi.string().trim().valid('RepeatPageController').required(),\n then: pageRepeatSchema\n .required()\n .description(\n 'Configuration for repeatable pages, required when using RepeatPageController'\n ),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional condition that determines if this page is shown'),\n next: Joi.array<Link>()\n .items(nextSchema)\n .default([])\n .description('Possible navigation paths after this page'),\n events: eventsSchema\n .optional()\n .description('Event handlers for page lifecycle events'),\n view: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional custom view template to use for rendering this page'\n )\n })\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema\n .append({\n id: idSchema.description('Unique identifier for the page'),\n title: Joi.string()\n .trim()\n .allow('')\n .required()\n .description(\n 'Page title displayed at the top of the page (with support for empty titles in V2)'\n ),\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n }),\n condition: Joi.string()\n .trim()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .messages({\n 'array.unique':\n 'Each item must have a unique identifier - enter a different identifier for this item.'\n })\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n })\n })\n\n/**\n * V2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: idSchema.description('Unique identifier for the list')\n })\n .description('List schema for V2 forms')\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>()\n .description('Feedback configuration for the form')\n .keys({\n feedbackForm: Joi.boolean()\n .default(false)\n .description('Whether to show the built-in feedback form'),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'URL to an external feedback form when not using built-in feedback'\n )\n }),\n emailAddress: Joi.string()\n .trim()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n .description('Email address where feedback is sent')\n })\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>()\n .description('Phase banner configuration showing development status')\n .keys({\n phase: Joi.string()\n .trim()\n .valid('alpha', 'beta')\n .description('Development phase of the service (alpha or beta)')\n })\n\nconst outputSchema = Joi.object<FormDefinition['output']>()\n .description('Configuration for form submission output')\n .keys({\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier for the output format')\n })\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .description('Complete form definition describing all aspects of a form')\n .required()\n .keys({\n engine: Joi.string()\n .trim()\n .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V1)\n .default(SchemaVersion.V1)\n .description('Form schema version to use (1 or 2)'),\n name: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Unique name identifying the form'),\n feedback: feedbackSchema\n .optional()\n .description('Feedback mechanism configuration'),\n startPage: Joi.string()\n .trim()\n .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .items(pageSchema)\n .description('Pages schema for V1 forms')\n .unique('path'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together'),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic'),\n lists: Joi.array<List>()\n .items(listSchema)\n .unique('name')\n .unique('title')\n .description('Reusable lists of options for select components'),\n metadata: Joi.object({ a: Joi.any() })\n .unknown()\n .optional()\n .description('Custom metadata for the form'),\n declaration: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Declaration text shown on the summary page'),\n skipSummary: Joi.any()\n .strip()\n .description('option to skip the summary page'),\n phaseBanner: phaseBannerSchema\n .optional()\n .description('Phase banner configuration'),\n outputEmail: Joi.string()\n .trim()\n .email({ tlds: { allow: ['uk'] } })\n .optional()\n .description('Email address where form submissions are sent'),\n output: outputSchema\n .optional()\n .description('Configuration for submission output format')\n })\n\nexport const formDefinitionV2Schema = formDefinitionSchema\n .keys({\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V2)\n .description('Form schema version to use (2)'),\n pages: Joi.array<Page>()\n .items(pageSchemaV2)\n .required()\n .unique('path')\n .unique('id')\n .description('Pages schema for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id')\n .description('Lists schema for V2 forms'),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\n })\n .description('Form definition schema for V2')\n\n// Maintain compatibility with legacy named export\n// E.g. `import { Schema } from '@defra/forms-model'`\nexport const Schema = formDefinitionSchema\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiC,KAAK;AACpD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAMtB,SAASC,aAAa,EAAEC,YAAY;AAepC,SACEC,aAAa;AAiBf,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,GAAG,GAAGT,OAAO,CAACU,MAAM,CAACX,OAAO,CAAiB;AAEnD,MAAMY,gBAAgB,GAAGF,GAAG,CAACG,MAAM,CAAC,CAA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B7D,KAAK,CAAC0H,YAAY,CAAC,CACnBlH,QAAQ,CAAC,CAAC,CACVwG,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,CAAC,CACZ5G,WAAW,CAAC,2BAA2B,CAAC;EAC3CP,KAAK,EAAEvB,GAAG,CAACuF,KAAK,CAAO,CAAC,CACrB7D,KAAK,CAACoI,YAAY,CAAC,CACnBpB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,CAAC,CACZ5G,WAAW,CAAC,2BAA2B,CAAC;EAC3CnB,UAAU,EAAEX,GAAG,CAACuF,KAAK,CAAqB,CAAC,CACxC7D,KAAK,CAACkE,wBAAwB,CAAC,CAC/B8C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrB5G,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM0J,MAAM,GAAGf,oBAAoB","ignoreList":[]}
|
@@ -96,6 +96,7 @@ export class QuestionPreviewElements {
|
|
96
96
|
* @private
|
97
97
|
*/
|
98
98
|
_items = [];
|
99
|
+
_largeTitle = true;
|
99
100
|
afterInputsHTML = '<div class="govuk-inset-text">No items added yet.</div>';
|
100
101
|
|
101
102
|
/**
|
@@ -107,7 +108,8 @@ export class QuestionPreviewElements {
|
|
107
108
|
optional,
|
108
109
|
shortDesc,
|
109
110
|
items,
|
110
|
-
content
|
111
|
+
content,
|
112
|
+
largeTitle = true
|
111
113
|
}) {
|
112
114
|
this._question = question;
|
113
115
|
this._hintText = hintText;
|
@@ -115,6 +117,7 @@ export class QuestionPreviewElements {
|
|
115
117
|
this._shortDesc = shortDesc;
|
116
118
|
this._items = items;
|
117
119
|
this._content = content;
|
120
|
+
this._largeTitle = largeTitle;
|
118
121
|
}
|
119
122
|
|
120
123
|
/**
|
@@ -127,7 +130,8 @@ export class QuestionPreviewElements {
|
|
127
130
|
optional: this._optional,
|
128
131
|
shortDesc: this._shortDesc,
|
129
132
|
items: this._items,
|
130
|
-
content: this._content
|
133
|
+
content: this._content,
|
134
|
+
largeTitle: this._largeTitle
|
131
135
|
};
|
132
136
|
}
|
133
137
|
|
@@ -184,7 +188,8 @@ export const baseElements = /** @type {BaseSettings} */{
|
|
184
188
|
question: 'Which quest would you like to pick?',
|
185
189
|
hintText: 'Choose one adventure that best suits you.',
|
186
190
|
shortDesc: '',
|
187
|
-
content: ''
|
191
|
+
content: '',
|
192
|
+
largeTitle: true
|
188
193
|
};
|
189
194
|
const list1Id = '414d82a3-4cab-416a-bd54-6b86fbd51120';
|
190
195
|
const list2Id = '801385a4-81e6-4171-96c3-6c6727d97f22';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"preview.js","names":["Question","QuestionRendererStub","renderMock","constructor","render","questionTemplate","questionBaseModel","buildHTML","_questionTemplate","_renderContext","PageRendererStub","pageTemplate","pagePreviewPanelMacro","QuestionPreviewElements","_question","_hintText","_optional","_shortDesc","_content","_items","afterInputsHTML","question","hintText","optional","shortDesc","items","content","values","setPreviewHTML","_value","setPreviewDOM","AutocompletePreviewElements","autocompleteOptions","elements","PagePreviewElements","guidance","heading","baseElements","list1Id","list2Id","list3Id","list4Id","listElementsBase","label","text","value","id","listElementsStub","buildPreviewShortAnswer","partialBaseElements"],"sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionRenderer}\n */\nexport class QuestionRendererStub {\n /**\n * @type {jest.Mock<void, [string, QuestionBaseModel]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} questionTemplate\n * @param {QuestionBaseModel} questionBaseModel\n */\n render(questionTemplate, questionBaseModel) {\n this.renderMock(questionTemplate, questionBaseModel)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {PageRenderer}\n */\nexport class PageRendererStub {\n /**\n * @type {jest.Mock<void, [string, PagePreviewPanelMacro]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, PagePreviewPanelMacro]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} pageTemplate\n * @param {PagePreviewPanelMacro} pagePreviewPanelMacro\n */\n render(pageTemplate, pagePreviewPanelMacro) {\n this.renderMock(pageTemplate, pagePreviewPanelMacro)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {ListElements}\n */\nexport class QuestionPreviewElements {\n /**\n * @protected\n */\n _question = ''\n /** @protected */\n _hintText = ''\n /** @protected */\n _optional = false\n /**\n * @type {string}\n * @protected\n */\n _shortDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _content = ''\n /**\n *\n * @type {ListElement[]}\n * @private\n */\n _items = []\n\n afterInputsHTML = '<div class=\"govuk-inset-text\">No items added yet.</div>'\n\n /**\n * @param {BaseSettings} baseSettings\n */\n constructor({ question, hintText, optional, shortDesc, items, content }) {\n this._question = question\n this._hintText = hintText\n this._optional = optional\n this._shortDesc = shortDesc\n this._items = items\n this._content = content\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n return {\n question: this._question,\n hintText: this._hintText,\n optional: this._optional,\n shortDesc: this._shortDesc,\n items: this._items,\n content: this._content\n }\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n // Not implemented for server side render\n }\n\n /**\n * @param {HTMLElement} _value\n */\n setPreviewDOM(_value) {\n // Not implemented for server side render\n }\n}\n\n/**\n * @implements {AutocompleteElements}\n */\nexport class AutocompletePreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {autocompleteOptions: string}} elements\n */\n constructor({ autocompleteOptions, ...elements }) {\n super(elements)\n this.autocompleteOptions = autocompleteOptions\n }\n}\n\n/**\n * @implements {PageOverviewElements}\n */\nexport class PagePreviewElements {\n guidance\n heading\n\n /**\n * @param {string} heading\n * @param {string} guidance\n */\n constructor(heading, guidance = '') {\n this.heading = heading\n this.guidance = guidance\n }\n}\n\nexport const baseElements = /** @type {BaseSettings} */ ({\n items: [],\n optional: false,\n question: 'Which quest would you like to pick?',\n hintText: 'Choose one adventure that best suits you.',\n shortDesc: '',\n content: ''\n})\n\nconst list1Id = '414d82a3-4cab-416a-bd54-6b86fbd51120'\nconst list2Id = '801385a4-81e6-4171-96c3-6c6727d97f22'\nconst list3Id = 'e6e3f621-b875-4ca3-a054-cca9149149dd'\nconst list4Id = 'd71b3909-582f-4e90-b6f5-490b89a6eb8f'\n\nconst listElementsBase = /** @type {BaseSettings} */ ({\n ...baseElements,\n items: [\n {\n label: { text: 'Treasure Hunting' },\n text: 'Treasure Hunting',\n value: 'Treasure Hunting',\n id: list1Id\n },\n {\n label: { text: 'Rescuing the princess' },\n text: 'Rescuing the princess',\n value: 'Rescuing the princess',\n id: list2Id\n },\n {\n label: { text: 'Saving a city' },\n text: 'Saving a city',\n value: 'Saving a city',\n id: list3Id\n },\n {\n label: { text: 'Defeating the baron' },\n text: 'Defeating the baron',\n value: 'Defeating the baron',\n id: list4Id\n }\n ]\n})\n\nexport const listElementsStub = {\n list1Id,\n list2Id,\n list3Id,\n list4Id,\n baseElements: listElementsBase\n}\n\n/**\n * @param {Partial<BaseSettings>} partialBaseElements\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n * @returns {Question}\n */\nexport function buildPreviewShortAnswer(partialBaseElements, renderMock) {\n return new Question(\n new QuestionPreviewElements({\n ...baseElements,\n ...partialBaseElements\n }),\n new QuestionRendererStub(renderMock)\n )\n}\n\n/**\n * @import { ListElement } from '~/src/form/form-editor/types.js'\n * @import { PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'\n * @import { BaseSettings, ListElements, RenderContext, QuestionBaseModel, QuestionElements, QuestionRenderer, AutocompleteElements, PageOverviewElements, PageRenderer } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;;AAEjB;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,CAAC;EAChC;AACF;AACA;EACEC,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;EACEE,MAAMA,CAACC,gBAAgB,EAAEC,iBAAiB,EAAE;IAC1C,IAAI,CAACJ,UAAU,CAACG,gBAAgB,EAAEC,iBAAiB,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,SAASA,CAACC,iBAAiB,EAAEC,cAAc,EAAE;IAClD,OAAO,sBAAsB;EAC/B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC5B;AACF;AACA;EACER,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;EACEE,MAAMA,CAACO,YAAY,EAAEC,qBAAqB,EAAE;IAC1C,IAAI,CAACV,UAAU,CAACS,YAAY,EAAEC,qBAAqB,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOL,SAASA,CAACC,iBAAiB,EAAEC,cAAc,EAAE;IAClD,OAAO,sBAAsB;EAC/B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMI,uBAAuB,CAAC;EACnC;AACF;AACA;EACEC,SAAS,GAAG,EAAE;EACd;EACAC,SAAS,GAAG,EAAE;EACd;EACAC,SAAS,GAAG,KAAK;EACjB;AAC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C9BT,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPJ,YAAY,EAAEK;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,uBAAuBA,CAACC,mBAAmB,EAAE/C,UAAU,EAAE;EACvE,OAAO,IAAIF,QAAQ,CACjB,IAAIa,uBAAuB,CAAC;IAC1B,GAAGwB,YAAY;IACf,GAAGY;EACL,CAAC,CAAC,EACF,IAAIhD,oBAAoB,CAACC,UAAU,CACrC,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
1
|
+
{"version":3,"file":"preview.js","names":["Question","QuestionRendererStub","renderMock","constructor","render","questionTemplate","questionBaseModel","buildHTML","_questionTemplate","_renderContext","PageRendererStub","pageTemplate","pagePreviewPanelMacro","QuestionPreviewElements","_question","_hintText","_optional","_shortDesc","_content","_items","_largeTitle","afterInputsHTML","question","hintText","optional","shortDesc","items","content","largeTitle","values","setPreviewHTML","_value","setPreviewDOM","AutocompletePreviewElements","autocompleteOptions","elements","PagePreviewElements","guidance","heading","baseElements","list1Id","list2Id","list3Id","list4Id","listElementsBase","label","text","value","id","listElementsStub","buildPreviewShortAnswer","partialBaseElements"],"sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionRenderer}\n */\nexport class QuestionRendererStub {\n /**\n * @type {jest.Mock<void, [string, QuestionBaseModel]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} questionTemplate\n * @param {QuestionBaseModel} questionBaseModel\n */\n render(questionTemplate, questionBaseModel) {\n this.renderMock(questionTemplate, questionBaseModel)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {PageRenderer}\n */\nexport class PageRendererStub {\n /**\n * @type {jest.Mock<void, [string, PagePreviewPanelMacro]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, PagePreviewPanelMacro]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} pageTemplate\n * @param {PagePreviewPanelMacro} pagePreviewPanelMacro\n */\n render(pageTemplate, pagePreviewPanelMacro) {\n this.renderMock(pageTemplate, pagePreviewPanelMacro)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {ListElements}\n */\nexport class QuestionPreviewElements {\n /**\n * @protected\n */\n _question = ''\n /** @protected */\n _hintText = ''\n /** @protected */\n _optional = false\n /**\n * @type {string}\n * @protected\n */\n _shortDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _content = ''\n /**\n *\n * @type {ListElement[]}\n * @private\n */\n _items = []\n _largeTitle = true\n afterInputsHTML = '<div class=\"govuk-inset-text\">No items added yet.</div>'\n\n /**\n * @param {BaseSettings} baseSettings\n */\n constructor({\n question,\n hintText,\n optional,\n shortDesc,\n items,\n content,\n largeTitle = true\n }) {\n this._question = question\n this._hintText = hintText\n this._optional = optional\n this._shortDesc = shortDesc\n this._items = items\n this._content = content\n this._largeTitle = largeTitle\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n return {\n question: this._question,\n hintText: this._hintText,\n optional: this._optional,\n shortDesc: this._shortDesc,\n items: this._items,\n content: this._content,\n largeTitle: this._largeTitle\n }\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n // Not implemented for server side render\n }\n\n /**\n * @param {HTMLElement} _value\n */\n setPreviewDOM(_value) {\n // Not implemented for server side render\n }\n}\n\n/**\n * @implements {AutocompleteElements}\n */\nexport class AutocompletePreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {autocompleteOptions: string}} elements\n */\n constructor({ autocompleteOptions, ...elements }) {\n super(elements)\n this.autocompleteOptions = autocompleteOptions\n }\n}\n\n/**\n * @implements {PageOverviewElements}\n */\nexport class PagePreviewElements {\n guidance\n heading\n\n /**\n * @param {string} heading\n * @param {string} guidance\n */\n constructor(heading, guidance = '') {\n this.heading = heading\n this.guidance = guidance\n }\n}\n\nexport const baseElements = /** @type {BaseSettings} */ ({\n items: [],\n optional: false,\n question: 'Which quest would you like to pick?',\n hintText: 'Choose one adventure that best suits you.',\n shortDesc: '',\n content: '',\n largeTitle: true\n})\n\nconst list1Id = '414d82a3-4cab-416a-bd54-6b86fbd51120'\nconst list2Id = '801385a4-81e6-4171-96c3-6c6727d97f22'\nconst list3Id = 'e6e3f621-b875-4ca3-a054-cca9149149dd'\nconst list4Id = 'd71b3909-582f-4e90-b6f5-490b89a6eb8f'\n\nconst listElementsBase = /** @type {BaseSettings} */ ({\n ...baseElements,\n items: [\n {\n label: { text: 'Treasure Hunting' },\n text: 'Treasure Hunting',\n value: 'Treasure Hunting',\n id: list1Id\n },\n {\n label: { text: 'Rescuing the princess' },\n text: 'Rescuing the princess',\n value: 'Rescuing the princess',\n id: list2Id\n },\n {\n label: { text: 'Saving a city' },\n text: 'Saving a city',\n value: 'Saving a city',\n id: list3Id\n },\n {\n label: { text: 'Defeating the baron' },\n text: 'Defeating the baron',\n value: 'Defeating the baron',\n id: list4Id\n }\n ]\n})\n\nexport const listElementsStub = {\n list1Id,\n list2Id,\n list3Id,\n list4Id,\n baseElements: listElementsBase\n}\n\n/**\n * @param {Partial<BaseSettings>} partialBaseElements\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n * @returns {Question}\n */\nexport function buildPreviewShortAnswer(partialBaseElements, renderMock) {\n return new Question(\n new QuestionPreviewElements({\n ...baseElements,\n ...partialBaseElements\n }),\n new QuestionRendererStub(renderMock)\n )\n}\n\n/**\n * @import { ListElement } from '~/src/form/form-editor/types.js'\n * @import { PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'\n * @import { BaseSettings, ListElements, RenderContext, QuestionBaseModel, QuestionElements, QuestionRenderer, AutocompleteElements, PageOverviewElements, PageRenderer } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;;AAEjB;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,CAAC;EAChC;AACF;AACA;EACEC,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;EACEE,MAAMA,CAACC,gBAAgB,EAAEC,iBAAiB,EAAE;IAC1C,IAAI,CAACJ,UAAU,CAACG,gBAAgB,EAAEC,iBAAiB,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,SAASA,CAACC,iBAAiB,EAAEC,cAAc,EAAE;IAClD,OAAO,sBAAsB;EAC/B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC5B;AACF;AACA;EACER,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;EACEE,MAAMA,CAACO,YAAY,EAAEC,qBAAqB,EAAE;IAC1C,IAAI,CAACV,UAAU,CAACS,YAAY,EAAEC,qBAAqB,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOL,SAASA,CAACC,iBAAiB,EAAEC,cAAc,EAAE;IAClD,OAAO,sBAAsB;EAC/B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMI,uBAAuB,CAAC;EACnC;AACF;AACA;EACEC,SAAS,GAAG,EAAE;EACd;EACAC,SAAS,GAAG,EAAE;EACd;EACAC,SAAS,GAAG,KAAK;EACjB;AACF;AACA;AACA;EACEC,UAAU,GAAG,E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C,KAAK,EAAE,qBAAqB;IAC5BC,EAAE,EAAEL;EACN,CAAC;AAEL,CAAE;AAEF,OAAO,MAAMM,gBAAgB,GAAG;EAC9BT,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPJ,YAAY,EAAEK;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,uBAAuBA,CAACC,mBAAmB,EAAEjD,UAAU,EAAE;EACvE,OAAO,IAAIF,QAAQ,CACjB,IAAIa,uBAAuB,CAAC;IAC1B,GAAG0B,YAAY;IACf,GAAGY;EACL,CAAC,CAAC,EACF,IAAIlD,oBAAoB,CAACC,UAAU,CACrC,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -7,11 +7,18 @@ export class ComponentElements {
|
|
7
7
|
* @protected
|
8
8
|
*/
|
9
9
|
_component;
|
10
|
+
/**
|
11
|
+
* @type {boolean}
|
12
|
+
* @private
|
13
|
+
*/
|
14
|
+
_largeTitle = true;
|
10
15
|
/**
|
11
16
|
* @param {ComponentDef} component
|
17
|
+
* @param {boolean} [largeTitle]
|
12
18
|
*/
|
13
|
-
constructor(component) {
|
19
|
+
constructor(component, largeTitle = true) {
|
14
20
|
this._component = component;
|
21
|
+
this._largeTitle = largeTitle;
|
15
22
|
}
|
16
23
|
|
17
24
|
/**
|
@@ -26,7 +33,8 @@ export class ComponentElements {
|
|
26
33
|
optional: !required,
|
27
34
|
shortDesc: '',
|
28
35
|
items: [],
|
29
|
-
content: ''
|
36
|
+
content: '',
|
37
|
+
largeTitle: this._largeTitle
|
30
38
|
};
|
31
39
|
}
|
32
40
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component-elements.js","names":["ComponentElements","_component","constructor","component","_getValues","required","options","question","title","hintText","optional","shortDesc","items","content","values","setPreviewDOM","_element","Error","setPreviewHTML","_value"],"sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"sourcesContent":["/**\n * @implements {QuestionElements}\n */\nexport class ComponentElements {\n /**\n * @type {ComponentDef}\n * @protected\n */\n _component\n /**\n * @param {ComponentDef} component\n */\n constructor(component) {\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n const required = this._component.options?.required ?? true\n\n return {\n question: this._component.title,\n hintText: '',\n optional: !required,\n shortDesc: '',\n items: [],\n content: ''\n }\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n const values = this._getValues()\n return values\n }\n\n /**\n * @param {HTMLElement} _element\n */\n setPreviewDOM(_element) {\n throw new Error('Not implemented')\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n throw new Error('Not implemented')\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAC7B;AACF;AACA;AACA;EACEC,UAAU;EACV;AACF;AACA;EACEC,WAAWA,CAACC,SAAS,EAAE;
|
1
|
+
{"version":3,"file":"component-elements.js","names":["ComponentElements","_component","_largeTitle","constructor","component","largeTitle","_getValues","required","options","question","title","hintText","optional","shortDesc","items","content","values","setPreviewDOM","_element","Error","setPreviewHTML","_value"],"sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"sourcesContent":["/**\n * @implements {QuestionElements}\n */\nexport class ComponentElements {\n /**\n * @type {ComponentDef}\n * @protected\n */\n _component\n /**\n * @type {boolean}\n * @private\n */\n _largeTitle = true\n /**\n * @param {ComponentDef} component\n * @param {boolean} [largeTitle]\n */\n constructor(component, largeTitle = true) {\n this._component = component\n this._largeTitle = largeTitle\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n const required = this._component.options?.required ?? true\n\n return {\n question: this._component.title,\n hintText: '',\n optional: !required,\n shortDesc: '',\n items: [],\n content: '',\n largeTitle: this._largeTitle\n }\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n const values = this._getValues()\n return values\n }\n\n /**\n * @param {HTMLElement} _element\n */\n setPreviewDOM(_element) {\n throw new Error('Not implemented')\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n throw new Error('Not implemented')\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAC7B;AACF;AACA;AACA;EACEC,UAAU;EACV;AACF;AACA;AACA;EACEC,WAAW,GAAG,IAAI;EAClB;AACF;AACA;AACA;EACEC,WAAWA,CAACC,SAAS,EAAEC,UAAU,GAAG,IAAI,EAAE;IACxC,IAAI,CAACJ,UAAU,GAAGG,SAAS;IAC3B,IAAI,CAACF,WAAW,GAAGG,UAAU;EAC/B;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,MAAMC,QAAQ,GAAG,IAAI,CAACN,UAAU,CAACO,OAAO,EAAED,QAAQ,IAAI,IAAI;IAE1D,OAAO;MACLE,QAAQ,EAAE,IAAI,CAACR,UAAU,CAACS,KAAK;MAC/BC,QAAQ,EAAE,EAAE;MACZC,QAAQ,EAAE,CAACL,QAAQ;MACnBM,SAAS,EAAE,EAAE;MACbC,KAAK,EAAE,EAAE;MACTC,OAAO,EAAE,EAAE;MACXV,UAAU,EAAE,IAAI,CAACH;IACnB,CAAC;EACH;;EAEA;AACF;AACA;EACE,IAAIc,MAAMA,CAAA,EAAG;IACX,MAAMA,MAAM,GAAG,IAAI,CAACV,UAAU,CAAC,CAAC;IAChC,OAAOU,MAAM;EACf;;EAEA;AACF;AACA;EACEC,aAAaA,CAACC,QAAQ,EAAE;IACtB,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACpC;;EAEA;AACF;AACA;EACEC,cAAcA,CAACC,MAAM,EAAE;IACrB,MAAM,IAAIF,KAAK,CAAC,iBAAiB,CAAC;EACpC;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -12,9 +12,10 @@ export class ContentElements extends ComponentElements {
|
|
12
12
|
_component;
|
13
13
|
/**
|
14
14
|
* @param {Exclude<ContentComponentsDef, ListComponent>} component
|
15
|
+
* @param {boolean} largeTitle
|
15
16
|
*/
|
16
|
-
constructor(component) {
|
17
|
-
super(component);
|
17
|
+
constructor(component, largeTitle = true) {
|
18
|
+
super(component, largeTitle);
|
18
19
|
this._component = component;
|
19
20
|
}
|
20
21
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"content.js","names":["ComponentElements","PreviewComponent","ContentElements","_component","constructor","component","_getValues","content","Content","_content","htmlElements","questionRenderer","values","_renderInput","_setContent","value","render"],"sources":["../../../../../src/form/form-editor/preview/content.js"],"sourcesContent":["import { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class ContentElements extends ComponentElements {\n /**\n * @type {Exclude<ContentComponentsDef, ListComponent>}\n * @protected\n */\n _component\n /**\n * @param {Exclude<ContentComponentsDef, ListComponent>} component\n */\n constructor(component) {\n super(component)\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n content: this._component.content\n }\n }\n}\n\n/**\n * @abstract\n * @class Content\n * @classdesc\n * Base of Content preview classes\n */\nexport class Content extends PreviewComponent {\n /**\n * @type {string}\n * @protected\n */\n _content\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n const { content } = htmlElements.values\n\n this._content = content\n }\n\n /**\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return {\n ...super._renderInput(),\n content: this.content\n }\n }\n\n /**\n * @param {string} value\n * @protected\n */\n _setContent(value) {\n this._content = value\n }\n\n /**\n * @returns {string}\n */\n get content() {\n return this._content\n }\n\n set content(value) {\n this._setContent(value)\n this.render()\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ListComponent, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASF,iBAAiB,CAAC;EACrD;AACF;AACA;AACA;EACEG,UAAU;EACV;AACF;AACA;EACEC,WAAWA,CAACC,SAAS,EAAE;
|
1
|
+
{"version":3,"file":"content.js","names":["ComponentElements","PreviewComponent","ContentElements","_component","constructor","component","largeTitle","_getValues","content","Content","_content","htmlElements","questionRenderer","values","_renderInput","_setContent","value","render"],"sources":["../../../../../src/form/form-editor/preview/content.js"],"sourcesContent":["import { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class ContentElements extends ComponentElements {\n /**\n * @type {Exclude<ContentComponentsDef, ListComponent>}\n * @protected\n */\n _component\n /**\n * @param {Exclude<ContentComponentsDef, ListComponent>} component\n * @param {boolean} largeTitle\n */\n constructor(component, largeTitle = true) {\n super(component, largeTitle)\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n content: this._component.content\n }\n }\n}\n\n/**\n * @abstract\n * @class Content\n * @classdesc\n * Base of Content preview classes\n */\nexport class Content extends PreviewComponent {\n /**\n * @type {string}\n * @protected\n */\n _content\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n const { content } = htmlElements.values\n\n this._content = content\n }\n\n /**\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return {\n ...super._renderInput(),\n content: this.content\n }\n }\n\n /**\n * @param {string} value\n * @protected\n */\n _setContent(value) {\n this._content = value\n }\n\n /**\n * @returns {string}\n */\n get content() {\n return this._content\n }\n\n set content(value) {\n this._setContent(value)\n this.render()\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ListComponent, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASF,iBAAiB,CAAC;EACrD;AACF;AACA;AACA;EACEG,UAAU;EACV;AACF;AACA;AACA;EACEC,WAAWA,CAACC,SAAS,EAAEC,UAAU,GAAG,IAAI,EAAE;IACxC,KAAK,CAACD,SAAS,EAAEC,UAAU,CAAC;IAC5B,IAAI,CAACH,UAAU,GAAGE,SAAS;EAC7B;;EAEA;AACF;AACA;AACA;EACEE,UAAUA,CAAA,EAAG;IACX,OAAO;MACL,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBC,OAAO,EAAE,IAAI,CAACL,UAAU,CAACK;IAC3B,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,SAASR,gBAAgB,CAAC;EAC5C;AACF;AACA;AACA;EACES,QAAQ;;EAER;AACF;AACA;AACA;EACEN,WAAWA,CAACO,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,KAAK,CAACD,YAAY,EAAEC,gBAAgB,CAAC;IACrC,MAAM;MAAEJ;IAAQ,CAAC,GAAGG,YAAY,CAACE,MAAM;IAEvC,IAAI,CAACH,QAAQ,GAAGF,OAAO;EACzB;;EAEA;AACF;AACA;AACA;EACEM,YAAYA,CAAA,EAAG;IACb,OAAO;MACL,GAAG,KAAK,CAACA,YAAY,CAAC,CAAC;MACvBN,OAAO,EAAE,IAAI,CAACA;IAChB,CAAC;EACH;;EAEA;AACF;AACA;AACA;EACEO,WAAWA,CAACC,KAAK,EAAE;IACjB,IAAI,CAACN,QAAQ,GAAGM,KAAK;EACvB;;EAEA;AACF;AACA;EACE,IAAIR,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACE,QAAQ;EACtB;EAEA,IAAIF,OAAOA,CAACQ,KAAK,EAAE;IACjB,IAAI,CAACD,WAAW,CAACC,KAAK,CAAC;IACvB,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -89,12 +89,6 @@ export class PreviewPageController {
|
|
89
89
|
* @protected
|
90
90
|
*/
|
91
91
|
_guidanceComponent;
|
92
|
-
|
93
|
-
/**
|
94
|
-
* @type {boolean}
|
95
|
-
* @private
|
96
|
-
*/
|
97
|
-
_showGuidance = false;
|
98
92
|
/**
|
99
93
|
* @param {ComponentDef[]} components
|
100
94
|
* @param {PageOverviewElements} elements
|
@@ -102,14 +96,14 @@ export class PreviewPageController {
|
|
102
96
|
* @param {PageRenderer} renderer
|
103
97
|
*/
|
104
98
|
constructor(components, elements, definition, renderer) {
|
105
|
-
const questions = components.map(mapComponentToPreviewQuestion(questionRenderer, definition));
|
99
|
+
const questions = components.map(mapComponentToPreviewQuestion(questionRenderer, definition, elements.heading.length > 0));
|
106
100
|
const firstQuestion = /** @type { Markdown | undefined | Question } */
|
107
101
|
questions.shift();
|
108
102
|
this._guidanceComponent = PreviewPageController.getOrCreateGuidanceComponent(firstQuestion);
|
109
103
|
this._guidanceText = elements.guidance;
|
110
104
|
this._components = this.#constructComponents(firstQuestion, questions);
|
111
|
-
this.#title = elements.heading;
|
112
105
|
this.#pageRenderer = renderer;
|
106
|
+
this.#title = elements.heading;
|
113
107
|
}
|
114
108
|
|
115
109
|
/**
|
@@ -160,14 +154,6 @@ export class PreviewPageController {
|
|
160
154
|
};
|
161
155
|
}
|
162
156
|
|
163
|
-
/**
|
164
|
-
* @private
|
165
|
-
* @returns {string}
|
166
|
-
*/
|
167
|
-
_fallBackTitle() {
|
168
|
-
return this._components[0]?.question ?? '';
|
169
|
-
}
|
170
|
-
|
171
157
|
/**
|
172
158
|
* @returns {{ text: string, classes: string }}
|
173
159
|
*/
|
@@ -185,7 +171,7 @@ export class PreviewPageController {
|
|
185
171
|
* @returns {string}
|
186
172
|
*/
|
187
173
|
get title() {
|
188
|
-
return this.#title
|
174
|
+
return this.#title;
|
189
175
|
}
|
190
176
|
|
191
177
|
/**
|