@defra/forms-model 3.0.432 → 3.0.434

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.
@@ -144,12 +144,14 @@ export const pageSchemaPayloadV2 = pageSchemaV2.keys({
144
144
  }).description('Components with auto-generated IDs')
145
145
  }).description('Page schema for payload data with auto-generated IDs for pages and components');
146
146
  const baseListItemSchema = Joi.object().description('Base schema for list items with common properties').keys({
147
+ id: Joi.string().uuid().default(() => uuidV4()),
147
148
  text: Joi.string().allow('').description('Display text shown to the user'),
148
149
  description: Joi.string().allow('').optional().description('Optional additional descriptive text for the item'),
149
150
  conditional: Joi.object().description('Optional components to show when this item is selected').keys({
150
151
  components: Joi.array().required().items(componentSchema.unknown(true)).unique('name').description('Components to display conditionally')
151
152
  }).optional(),
152
- condition: Joi.string().allow('').optional().description('Condition that determines if this item is shown')
153
+ condition: Joi.string().allow('').optional().description('Condition that determines if this item is shown'),
154
+ hint: Joi.string().allow('').optional().description('Optional hint text to be shown on list item')
153
155
  });
154
156
  const stringListItemSchema = baseListItemSchema.append({
155
157
  value: Joi.string().required().description('String value stored when this item is selected')
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","sectionsSchema","object","description","keys","name","string","required","title","hideTitle","boolean","optional","default","conditionFieldSchema","type","display","conditionValueSchema","value","relativeDateValueSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionSchema","field","operator","alternatives","try","conditionGroupSchema","conditions","array","items","link","id","conditionsModelSchema","conditionWrapperSchema","displayName","componentSchema","uuid","shortDescription","when","is","valid","Details","Html","InsetText","Markdown","then","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","list","componentSchemaV2","nextSchema","path","condition","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageSchema","disallow","section","controller","components","unique","repeat","any","strip","next","events","view","pageSchemaV2","append","pageSchemaPayloadV2","ignoreUndefined","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","feedback","startPage","pages","sections","lists","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","trim","output","formDefinitionV2PayloadSchema","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import Joi, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n type ConditionData,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionRefData,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\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'\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\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 .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\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 .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst relativeDateValueSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .required()\n .description('Data type identifier, should be \"RelativeDate\"'),\n period: Joi.string()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .required()\n .description('Time unit (e.g., days, weeks, months, years)'),\n direction: Joi.string()\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 .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\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 .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\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 .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 .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string().description(\n 'Human-readable name for display in the UI'\n ),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\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 .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\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 .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\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 .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 .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: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the component')\n })\n .description('Enhanced component schema for V2 forms with auto-generated IDs')\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 .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\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 .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\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\nconst 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 .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 .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\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\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: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the page'),\n path: Joi.string()\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 .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().description('Section this page belongs to'),\n controller: Joi.string()\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().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 .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 .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 title: Joi.string()\n .allow('')\n .required()\n .description('Page title with enhanced support for empty titles in V2')\n })\n .description(\n 'Enhanced page schema for V2 forms with support for empty titles'\n )\n\nexport const pageSchemaPayloadV2 = pageSchemaV2\n .keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the page'),\n components: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id', { ignoreUndefined: true })\n .description('Components with auto-generated IDs')\n })\n .description(\n 'Page schema for payload data with auto-generated IDs for pages and components'\n )\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n text: Joi.string().allow('').description('Display text shown to the user'),\n description: Joi.string()\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 .allow('')\n .optional()\n .description('Condition that determines if this item is shown')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\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: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the list'),\n name: Joi.string()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\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('text')\n .unique('value')\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\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: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the list')\n })\n .description('Enhanced list schema for V2 forms with auto-generated IDs')\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 .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 .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 .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 .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\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 .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n name: Joi.string()\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 .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .when('engine', {\n is: 'V2',\n then: Joi.array<Page>()\n .items(pageSchemaV2)\n .description('Pages using V2 schema with enhanced features'),\n otherwise: Joi.array<Page>()\n .items(pageSchema)\n .description('Pages using standard V1 schema')\n })\n .unique('path')\n .unique('id', { ignoreUndefined: true })\n .description('All pages within the form'),\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 .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 .email({ tlds: { allow: ['uk'] } })\n .trim()\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 formDefinitionV2PayloadSchema = formDefinitionSchema\n .keys({\n pages: Joi.array<Page>()\n .items(pageSchemaPayloadV2)\n .required()\n .unique('path')\n .unique('id', { ignoreUndefined: true })\n .description('Pages with auto-generated IDs for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id', { ignoreUndefined: true })\n .description('Lists with auto-generated IDs for V2 forms')\n })\n .description(\n 'Enhanced form definition schema for V2 payloads with auto-generated IDs'\n )\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,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AA4BtB,MAAMC,cAAc,GAAGJ,GAAG,CAACK,MAAM,CAAU,CAA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AAI,EAAE;IAAEU,eAAe,EAAE;EAAK,CAAC,CAAC,CACvClG,WAAW,CAAC,4CAA4C,CAAC;EAC5D0H,KAAK,EAAEhI,GAAG,CAACoC,KAAK,CAAO,CAAC,CACrBC,KAAK,CAAC0E,YAAY,CAAC,CACnBjB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,EAAE;IAAEU,eAAe,EAAE;EAAK,CAAC,CAAC,CACvClG,WAAW,CAAC,4CAA4C;AAC7D,CAAC,CAAC,CACDA,WAAW,CACV,yEACF,CAAC;;AAEH;AACA;AACA,OAAO,MAAMoI,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","sectionsSchema","object","description","keys","name","string","required","title","hideTitle","boolean","optional","default","conditionFieldSchema","type","display","conditionValueSchema","value","relativeDateValueSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionSchema","field","operator","alternatives","try","conditionGroupSchema","conditions","array","items","link","id","conditionsModelSchema","conditionWrapperSchema","displayName","componentSchema","uuid","shortDescription","when","is","valid","Details","Html","InsetText","Markdown","then","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","list","componentSchemaV2","nextSchema","path","condition","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageSchema","disallow","section","controller","components","unique","repeat","any","strip","next","events","view","pageSchemaV2","append","pageSchemaPayloadV2","ignoreUndefined","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","feedback","startPage","pages","sections","lists","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","trim","output","formDefinitionV2PayloadSchema","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import Joi, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n type ConditionData,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionRefData,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\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'\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\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 .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\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 .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst relativeDateValueSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .required()\n .description('Data type identifier, should be \"RelativeDate\"'),\n period: Joi.string()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .required()\n .description('Time unit (e.g., days, weeks, months, years)'),\n direction: Joi.string()\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 .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\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 .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\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 .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 .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string().description(\n 'Human-readable name for display in the UI'\n ),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\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 .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\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 .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\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 .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 .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: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the component')\n })\n .description('Enhanced component schema for V2 forms with auto-generated IDs')\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 .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\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 .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\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\nconst 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 .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 .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\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\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: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the page'),\n path: Joi.string()\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 .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().description('Section this page belongs to'),\n controller: Joi.string()\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().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 .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 .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 title: Joi.string()\n .allow('')\n .required()\n .description('Page title with enhanced support for empty titles in V2')\n })\n .description(\n 'Enhanced page schema for V2 forms with support for empty titles'\n )\n\nexport const pageSchemaPayloadV2 = pageSchemaV2\n .keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the page'),\n components: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id', { ignoreUndefined: true })\n .description('Components with auto-generated IDs')\n })\n .description(\n 'Page schema for payload data with auto-generated IDs for pages and components'\n )\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4()),\n text: Joi.string().allow('').description('Display text shown to the user'),\n description: Joi.string()\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 .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.string()\n .allow('')\n .optional()\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\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: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the list'),\n name: Joi.string()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\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('text')\n .unique('value')\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\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: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the list')\n })\n .description('Enhanced list schema for V2 forms with auto-generated IDs')\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 .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 .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 .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 .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\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 .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n name: Joi.string()\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 .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .when('engine', {\n is: 'V2',\n then: Joi.array<Page>()\n .items(pageSchemaV2)\n .description('Pages using V2 schema with enhanced features'),\n otherwise: Joi.array<Page>()\n .items(pageSchema)\n .description('Pages using standard V1 schema')\n })\n .unique('path')\n .unique('id', { ignoreUndefined: true })\n .description('All pages within the form'),\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 .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 .email({ tlds: { allow: ['uk'] } })\n .trim()\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 formDefinitionV2PayloadSchema = formDefinitionSchema\n .keys({\n pages: Joi.array<Page>()\n .items(pageSchemaPayloadV2)\n .required()\n .unique('path')\n .unique('id', { ignoreUndefined: true })\n .description('Pages with auto-generated IDs for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id', { ignoreUndefined: true })\n .description('Lists with auto-generated IDs for V2 forms')\n })\n .description(\n 'Enhanced form definition schema for V2 payloads with auto-generated IDs'\n )\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,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AA4BtB,MAAMC,cAAc,GAAGJ,GAAG,CAACK,MAAM,CAAU,CAAC,CACzCC,WAAW,CAAC,gDAAgD,CAAC,CAC7DC,IAAI,CAAC;EACJC,IAAI,EAAER,GAAG,CAACS,MAAM,CAAC,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVJ,WAAW,CACV,qEACF,CAAC;EACHK,KAAK,EAAEX,GAAG,CAACS,M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C,CAC1B7F,QAAQ,CAAC,CAAC,CACVoF,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,EAAE;IAAEU,eAAe,EAAE;EAAK,CAAC,CAAC,CACvClG,WAAW,CAAC,4CAA4C,CAAC;EAC5D0H,KAAK,EAAEhI,GAAG,CAACoC,KAAK,CAAO,CAAC,CACrBC,KAAK,CAAC0E,YAAY,CAAC,CACnBjB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,EAAE;IAAEU,eAAe,EAAE;EAAK,CAAC,CAAC,CACvClG,WAAW,CAAC,4CAA4C;AAC7D,CAAC,CAAC,CACDA,WAAW,CACV,yEACF,CAAC;;AAEH;AACA;AACA,OAAO,MAAMoI,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["Engine"],"sources":["../../../../src/form/form-definition/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type ConditionsModelData } from '~/src/conditions/types.js'\nimport { formDefinitionSchema } from '~/src/form/form-definition/index.js'\nimport { type ControllerPath, type ControllerType } from '~/src/pages/enums.js'\n\nexport enum Engine {\n V1 = 'V1',\n V2 = 'V2'\n}\n\nexport interface Link {\n path: string\n condition?: string\n redirect?: string\n}\n\nexport interface EventOptions {\n method: string\n url: string\n}\n\nexport interface Event {\n type: string\n options: EventOptions\n}\n\nexport interface Events {\n onLoad?: Event\n onSave?: Event\n}\n\nexport interface PageBase {\n id?: string\n title: string\n path: string\n condition?: string\n events?: Events\n view?: string\n}\n\nexport interface RepeatOptions {\n name: string\n title: string\n}\n\nexport interface RepeatSchema {\n min: number\n max: number\n}\n\nexport interface Repeat {\n options: RepeatOptions\n schema: RepeatSchema\n}\n\nexport interface PageStart extends PageBase {\n path: ControllerPath.Start | string\n controller: ControllerType.Start\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageQuestion extends PageBase {\n controller?: ControllerType.Page\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageTerminal extends PageBase {\n controller?: ControllerType.Terminal\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageRepeat extends PageBase {\n controller: ControllerType.Repeat\n repeat: Repeat\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageFileUpload extends PageBase {\n controller: ControllerType.FileUpload\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageSummary extends PageBase {\n path: ControllerPath.Summary | string\n controller: ControllerType.Summary\n section?: undefined\n components?: ComponentDef[]\n}\n\nexport interface PageStatus extends PageBase {\n path: ControllerPath.Status | string\n controller: ControllerType.Status\n section?: undefined\n}\n\nexport type Page =\n | PageStart\n | PageQuestion\n | PageTerminal\n | PageFileUpload\n | PageRepeat\n | PageSummary\n | PageStatus\n\nexport interface Section {\n name: string\n title: string\n hideTitle?: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n conditional?: { components: ComponentDef[] }\n condition?: string\n}\n\nexport interface List {\n id?: string\n name: string\n title: string\n type: ListTypeContent\n items: Item[]\n}\n\nexport type ListTypeOption = 'bulleted' | 'numbered'\nexport type ListTypeContent = 'string' | 'number' | 'boolean'\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport interface PhaseBanner {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport interface ConditionWrapper {\n name: string\n displayName: string\n value: ConditionsModelData\n}\n\n/**\n * Interface for `formDefinitionSchema` Joi schema\n * @see {@link formDefinitionSchema}\n */\nexport interface FormDefinition {\n engine?: Engine\n pages: Page[]\n conditions: ConditionWrapper[]\n lists: List[]\n sections: Section[]\n startPage?: string\n name?: string\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n declaration?: string // Deprecated in v2\n skipSummary?: never\n metadata?: Record<string, unknown>\n outputEmail?: string\n output?: {\n audience: 'human' | 'machine'\n version: string\n }\n}\n"],"mappings":"AAKA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;;AAuJlB;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["Engine"],"sources":["../../../../src/form/form-definition/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type ConditionsModelData } from '~/src/conditions/types.js'\nimport { formDefinitionSchema } from '~/src/form/form-definition/index.js'\nimport { type ControllerPath, type ControllerType } from '~/src/pages/enums.js'\n\nexport enum Engine {\n V1 = 'V1',\n V2 = 'V2'\n}\n\nexport interface Link {\n path: string\n condition?: string\n redirect?: string\n}\n\nexport interface EventOptions {\n method: string\n url: string\n}\n\nexport interface Event {\n type: string\n options: EventOptions\n}\n\nexport interface Events {\n onLoad?: Event\n onSave?: Event\n}\n\nexport interface PageBase {\n id?: string\n title: string\n path: string\n condition?: string\n events?: Events\n view?: string\n}\n\nexport interface RepeatOptions {\n name: string\n title: string\n}\n\nexport interface RepeatSchema {\n min: number\n max: number\n}\n\nexport interface Repeat {\n options: RepeatOptions\n schema: RepeatSchema\n}\n\nexport interface PageStart extends PageBase {\n path: ControllerPath.Start | string\n controller: ControllerType.Start\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageQuestion extends PageBase {\n controller?: ControllerType.Page\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageTerminal extends PageBase {\n controller?: ControllerType.Terminal\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageRepeat extends PageBase {\n controller: ControllerType.Repeat\n repeat: Repeat\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageFileUpload extends PageBase {\n controller: ControllerType.FileUpload\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageSummary extends PageBase {\n path: ControllerPath.Summary | string\n controller: ControllerType.Summary\n section?: undefined\n components?: ComponentDef[]\n}\n\nexport interface PageStatus extends PageBase {\n path: ControllerPath.Status | string\n controller: ControllerType.Status\n section?: undefined\n}\n\nexport type Page =\n | PageStart\n | PageQuestion\n | PageTerminal\n | PageFileUpload\n | PageRepeat\n | PageSummary\n | PageStatus\n\nexport interface Section {\n name: string\n title: string\n hideTitle?: boolean\n}\n\nexport interface Item {\n id?: string\n text: string\n value: string | number | boolean\n description?: string\n conditional?: { components: ComponentDef[] }\n condition?: string\n hint?: string\n}\n\nexport interface List {\n id?: string\n name: string\n title: string\n type: ListTypeContent\n items: Item[]\n}\n\nexport type ListTypeOption = 'bulleted' | 'numbered'\nexport type ListTypeContent = 'string' | 'number' | 'boolean'\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport interface PhaseBanner {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport interface ConditionWrapper {\n name: string\n displayName: string\n value: ConditionsModelData\n}\n\n/**\n * Interface for `formDefinitionSchema` Joi schema\n * @see {@link formDefinitionSchema}\n */\nexport interface FormDefinition {\n engine?: Engine\n pages: Page[]\n conditions: ConditionWrapper[]\n lists: List[]\n sections: Section[]\n startPage?: string\n name?: string\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n declaration?: string // Deprecated in v2\n skipSummary?: never\n metadata?: Record<string, unknown>\n outputEmail?: string\n output?: {\n audience: 'human' | 'machine'\n version: string\n }\n}\n"],"mappings":"AAKA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;;AAyJlB;AACA;AACA;AACA","ignoreList":[]}
@@ -46,7 +46,114 @@ export const regexSchema = Joi.string().optional().allow('').description('Regula
46
46
  export const rowsSchema = Joi.number().empty('').integer().min(1).description('Number of rows for multiline text fields');
47
47
  export const suffixSchema = Joi.string().trim().optional().allow('').description('Text to display after the input (e.g., kg)');
48
48
  export const classesSchema = Joi.string().trim().optional().allow('').description('Custom CSS classes to apply to the component');
49
+ export const customValidator = Joi.extend(joi => {
50
+ return {
51
+ type: 'dsv',
52
+ base: joi.array(),
53
+ messages: {
54
+ 'dsv.invalid': 'Invalid parse string'
55
+ },
56
+ coerce: {
57
+ from: 'string',
58
+ method(value, helpers) {
59
+ try {
60
+ // Only called when prefs.convert is true
61
+ // Rules
62
+ const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator');
63
+ const colSeparatorRule = helpers.schema.$_getRule('colSeparator');
64
+ const keysRule = helpers.schema.$_getRule('keys');
65
+
66
+ // Rows
67
+ const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\r?\n/;
68
+ const rows = value.split(rowSeparator).map(v => v.trim()).filter(Boolean);
69
+
70
+ // Columns
71
+ const colSeparator = colSeparatorRule?.args.colSeparator ?? ',';
72
+ const keys = keysRule?.args.keys ?? ['key', 'value'];
73
+ const coercedValue = rows.map(row => {
74
+ return row.split(colSeparator).reduce((acc, col, idx) => {
75
+ return {
76
+ ...acc,
77
+ [keys[idx]]: col.trim()
78
+ };
79
+ }, {});
80
+ });
81
+ return {
82
+ value: coercedValue
83
+ };
84
+ } catch (_err) {
85
+ // eslint-disable-next-line no-console
86
+ console.error(_err);
87
+ return {
88
+ value,
89
+ errors: [helpers.error('dsv.invalid')]
90
+ };
91
+ }
92
+ }
93
+ },
94
+ rules: {
95
+ rowSeparator: {
96
+ convert: true,
97
+ alias: 'row',
98
+ method(rowSeparator) {
99
+ return this.$_addRule({
100
+ name: 'rowSeparator',
101
+ args: {
102
+ rowSeparator
103
+ }
104
+ });
105
+ },
106
+ args: [{
107
+ name: 'rowSeparator',
108
+ ref: true,
109
+ assert: value => typeof value === 'string' || value instanceof RegExp,
110
+ message: 'must be a string or regex'
111
+ }]
112
+ },
113
+ colSeparator: {
114
+ convert: true,
115
+ alias: 'col',
116
+ method(colSeparator) {
117
+ return this.$_addRule({
118
+ name: 'colSeparator',
119
+ args: {
120
+ colSeparator
121
+ }
122
+ });
123
+ },
124
+ args: [{
125
+ name: 'colSeparator',
126
+ ref: true,
127
+ assert: value => typeof value === 'string' || value instanceof RegExp,
128
+ message: 'must be a string or regex'
129
+ }]
130
+ },
131
+ keys: {
132
+ convert: true,
133
+ method(keys) {
134
+ return this.$_addRule({
135
+ name: 'keys',
136
+ args: {
137
+ keys
138
+ }
139
+ });
140
+ },
141
+ args: [{
142
+ name: 'keys',
143
+ ref: true,
144
+ assert: value => Array.isArray(value) && value.every(k => typeof k === 'string'),
145
+ message: 'must be an array of strings'
146
+ }]
147
+ }
148
+ }
149
+ };
150
+ });
151
+ export const autoCompleteOptionsSchema = customValidator.dsv().row(/\r?\n/).col(':').keys(['text', 'value']).items(customValidator.object({
152
+ text: customValidator.string().min(1).disallow('').required(),
153
+ value: customValidator.string().default(parent => parent.text).min(1).disallow('')
154
+ })).min(1).required();
49
155
  export const questionDetailsFullSchema = {
156
+ autoCompleteOptionsSchema,
50
157
  classesSchema,
51
158
  documentTypesSchema,
52
159
  enhancedActionSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","ComponentType","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","description","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","exactFilesSchema","number","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioLabelSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","object","keys","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\n .description('Type of page - either a question page or guidance page')\n\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('The high-level type of question, including grouped types')\n\nexport const questionTypeFullSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.DatePartsField,\n ComponentType.MonthYearField,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('The specific component type to use for this question')\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\n .description('Subtype for written answer questions')\n\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('Subtype for date-related questions')\n\nexport const nameSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the field')\n\nexport const questionSchema = Joi.string()\n .trim()\n .required()\n .description('The question text displayed to the user')\n\nexport const hintTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Optional guidance text displayed below the question')\n\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a question is optional. Empty string or \"true\" values are accepted.'\n )\n\nexport const exactFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Specifies the exact number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const minFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 0 and 25.'\n )\n\nexport const maxFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Maximum number of files allowed for upload. Must be between 1 and 25.'\n )\n\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed file types. Can be provided as a single value or an array.'\n )\n\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed document types. Can be provided as a single value or an array.'\n )\n\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed image types. Can be provided as a single value or an array.'\n )\n\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const enhancedActionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Action field that can include enhanced functionality')\n\nexport const radioIdSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for radio options')\n\nexport const radioLabelSchema = Joi.string()\n .trim()\n .required()\n .description('The visible text shown next to radio options')\n\nexport const radioHintSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional hint text displayed with radio buttons to provide additional guidance'\n )\n\nexport const radioValueSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Array of allowed tabular data types. Can be provided as a single value or an array.'\n )\n\nexport const shortDescriptionSchema = Joi.string()\n .trim()\n .required()\n .description('Brief description of the question for internal use')\n\nexport const pageHeadingAndGuidanceSchema = Joi.string()\n .trim()\n .optional()\n .description('Combined heading and guidance for the page')\n\nexport const pageHeadingSchema = Joi.string()\n .trim()\n .required()\n .description('Main heading displayed at the top of the page')\n\nexport const guidanceTextSchema = Joi.string()\n .trim()\n .description('Guidance text to assist users in completing the page')\n\nexport const needDeclarationSchema = Joi.string()\n .trim()\n .required()\n .description('Whether a declaration is needed')\n\nexport const declarationTextSchema = Joi.string()\n .trim()\n .required()\n .description('Text of the declaration that users must agree to')\n\nexport const minSchema = Joi.number()\n .empty('')\n .integer()\n .description('Minimum value for numeric inputs')\n\nexport const maxSchema = Joi.number()\n .empty('')\n .integer()\n .description('Maximum value for numeric inputs')\n\nexport const minLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum character length for text inputs')\n\nexport const maxLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum character length for text inputs')\n\nexport const maxFutureSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Decimal precision for numeric inputs')\n\nexport const prefixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display before the input (e.g., £)')\n\nexport const regexSchema = Joi.string()\n .optional()\n .allow('')\n .description('Regular expression pattern for validation')\n\nexport const rowsSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Number of rows for multiline text fields')\n\nexport const suffixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display after the input (e.g., kg)')\n\nexport const classesSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Custom CSS classes to apply to the component')\n\nexport const questionDetailsFullSchema = {\n classesSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioLabelSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema\n}\n\nexport const formEditorInputPageKeys = {\n pageType: pageTypeSchema,\n questionType: questionTypeSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPage` interface\n * @see {@link FormEditorInputPage}\n */\nexport const formEditorInputPageSchema = Joi.object<FormEditorInputPage>()\n .keys(formEditorInputPageKeys)\n .required()\n .description('Input schema for creating a new page in the form editor')\n\nexport const formEditorInputheckAnswersSettingsKeys = {\n declarationText: shortDescriptionSchema\n}\n\n/**\n * Joi schema for `FormEditorInputCheckAnswersSettings` interface\n * @see {@link FormEditorInputCheckAnswersSettings}\n */\nexport const formEditorInputCheckAnswersSettingSchema =\n Joi.object<FormEditorInputCheckAnswersSettings>()\n .keys(formEditorInputheckAnswersSettingsKeys)\n .required()\n .description('Configuration for the check-answers page')\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n hintText: hintTextSchema,\n questionOptional: questionOptionalSchema\n}\n\n/**\n * Joi schema for `FormEditorInputQuestion` interface\n * @see {@link FormEditorInputQuestion}\n */\nexport const formEditorInputQuestionSchema =\n Joi.object<FormEditorInputQuestion>()\n .keys(formEditorInputQuestionKeys)\n .required()\n .description(\n 'Input schema for creating or updating a question in the form editor'\n )\n\nexport const formEditorInputPageSettingsKeys = {\n pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,\n pageHeading: pageHeadingSchema,\n guidanceText: guidanceTextSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPageSettings` interface\n * @see {@link FormEditorInputPageSettings}\n */\nexport const formEditorInputPageSettingsSchema =\n Joi.object<FormEditorInputPageSettings>()\n .keys(formEditorInputPageSettingsKeys)\n .required()\n .description('Settings for page content and display in the form editor')\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,aAAa;AAQtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,OAAO,MAAMC,cAAc,GAAGH,GAAG,CAACI,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC7BC,WAAW,CAAC,wDAAwD,CAAC;AAExE,OAAO,MAAMC,kBAAkB,GAAGR,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,oBAAoB,CAACO,qBAAqB,EAC1CP,oBAAoB,CAACQ,YAAY,EACjCT,aAAa,CAACU,cAAc,EAC5BV,aAAa,CA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EACxBwD,gBAAgB,EAAE9B,sBAAsB;EACxC+B,QAAQ,EAAExD,cAAc;EACxByD,gBAAgB,EAAEtD;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMuD,6BAA6B,GACxC1F,GAAG,CAACgF,MAAM,CAA0B,CAAC,CAClCC,IAAI,CAACI,2BAA2B,CAAC,CACjChF,QAAQ,CAAC,CAAC,CACVE,WAAW,CACV,qEACF,CAAC;AAEL,OAAO,MAAMoF,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAElC,4BAA4B;EACpDmC,WAAW,EAAElC,iBAAiB;EAC9BmC,YAAY,EAAElC;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMmC,iCAAiC,GAC5C/F,GAAG,CAACgF,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrCtF,QAAQ,CAAC,CAAC,CACVE,WAAW,CAAC,0DAA0D,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","ComponentType","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","description","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","exactFilesSchema","number","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioLabelSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","customValidator","extend","joi","type","base","messages","coerce","from","method","value","helpers","rowSeparatorRule","schema","$_getRule","colSeparatorRule","keysRule","rowSeparator","args","rows","split","map","v","filter","Boolean","colSeparator","keys","coercedValue","row","reduce","acc","col","idx","_err","console","error","errors","rules","convert","alias","$_addRule","name","ref","assert","RegExp","message","Array","isArray","every","k","autoCompleteOptionsSchema","dsv","object","text","disallow","parent","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\n .description('Type of page - either a question page or guidance page')\n\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('The high-level type of question, including grouped types')\n\nexport const questionTypeFullSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.DatePartsField,\n ComponentType.MonthYearField,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('The specific component type to use for this question')\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\n .description('Subtype for written answer questions')\n\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('Subtype for date-related questions')\n\nexport const nameSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the field')\n\nexport const questionSchema = Joi.string()\n .trim()\n .required()\n .description('The question text displayed to the user')\n\nexport const hintTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Optional guidance text displayed below the question')\n\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a question is optional. Empty string or \"true\" values are accepted.'\n )\n\nexport const exactFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Specifies the exact number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const minFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 0 and 25.'\n )\n\nexport const maxFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Maximum number of files allowed for upload. Must be between 1 and 25.'\n )\n\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed file types. Can be provided as a single value or an array.'\n )\n\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed document types. Can be provided as a single value or an array.'\n )\n\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed image types. Can be provided as a single value or an array.'\n )\n\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const enhancedActionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Action field that can include enhanced functionality')\n\nexport const radioIdSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for radio options')\n\nexport const radioLabelSchema = Joi.string()\n .trim()\n .required()\n .description('The visible text shown next to radio options')\n\nexport const radioHintSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional hint text displayed with radio buttons to provide additional guidance'\n )\n\nexport const radioValueSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Array of allowed tabular data types. Can be provided as a single value or an array.'\n )\n\nexport const shortDescriptionSchema = Joi.string()\n .trim()\n .required()\n .description('Brief description of the question for internal use')\n\nexport const pageHeadingAndGuidanceSchema = Joi.string()\n .trim()\n .optional()\n .description('Combined heading and guidance for the page')\n\nexport const pageHeadingSchema = Joi.string()\n .trim()\n .required()\n .description('Main heading displayed at the top of the page')\n\nexport const guidanceTextSchema = Joi.string()\n .trim()\n .description('Guidance text to assist users in completing the page')\n\nexport const needDeclarationSchema = Joi.string()\n .trim()\n .required()\n .description('Whether a declaration is needed')\n\nexport const declarationTextSchema = Joi.string()\n .trim()\n .required()\n .description('Text of the declaration that users must agree to')\n\nexport const minSchema = Joi.number()\n .empty('')\n .integer()\n .description('Minimum value for numeric inputs')\n\nexport const maxSchema = Joi.number()\n .empty('')\n .integer()\n .description('Maximum value for numeric inputs')\n\nexport const minLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum character length for text inputs')\n\nexport const maxLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum character length for text inputs')\n\nexport const maxFutureSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Decimal precision for numeric inputs')\n\nexport const prefixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display before the input (e.g., £)')\n\nexport const regexSchema = Joi.string()\n .optional()\n .allow('')\n .description('Regular expression pattern for validation')\n\nexport const rowsSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Number of rows for multiline text fields')\n\nexport const suffixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display after the input (e.g., kg)')\n\nexport const classesSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Custom CSS classes to apply to the component')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<TSchema = Record<string, unknown>[]>\n extends ArraySchema<TSchema> {\n rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>\n row: (rowSep: string | RegExp) => DSLSchema<TSchema>\n colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>\n col: (colSep: string | RegExp) => DSLSchema<TSchema>\n keys: (keys: string[]) => DSLSchema<TSchema>\n}\n\ninterface CustomValidator extends Joi.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: Joi.Root) => {\n return {\n type: 'dsv',\n base: joi.array(),\n messages: {\n 'dsv.invalid': 'Invalid parse string'\n },\n coerce: {\n from: 'string',\n method(value: string, helpers) {\n try {\n // Only called when prefs.convert is true\n // Rules\n const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator') as\n | undefined\n | GenericRuleOptions<'rowSeparator', string | RegExp>\n const colSeparatorRule = helpers.schema.$_getRule('colSeparator') as\n | undefined\n | GenericRuleOptions<'colSeparator', string | RegExp>\n const keysRule = helpers.schema.$_getRule('keys') as\n | undefined\n | GenericRuleOptions<'keys', string[]>\n\n // Rows\n const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\\r?\\n/\n const rows = value\n .split(rowSeparator)\n .map((v) => v.trim())\n .filter(Boolean)\n\n // Columns\n const colSeparator = colSeparatorRule?.args.colSeparator ?? ','\n const keys = keysRule?.args.keys ?? ['key', 'value']\n\n const coercedValue = rows.map((row) => {\n return row\n .split(colSeparator)\n .reduce<Record<string, string>>((acc, col, idx) => {\n return {\n ...acc,\n [keys[idx]]: col.trim()\n }\n }, {})\n })\n return { value: coercedValue }\n } catch (_err) {\n // eslint-disable-next-line no-console\n console.error(_err)\n return { value, errors: [helpers.error('dsv.invalid')] }\n }\n }\n },\n rules: {\n rowSeparator: {\n convert: true,\n alias: 'row',\n method(rowSeparator: string) {\n return this.$_addRule({\n name: 'rowSeparator',\n args: { rowSeparator }\n })\n },\n args: [\n {\n name: 'rowSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n colSeparator: {\n convert: true,\n alias: 'col',\n method(colSeparator: string) {\n return this.$_addRule({\n name: 'colSeparator',\n args: { colSeparator }\n })\n },\n args: [\n {\n name: 'colSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n keys: {\n convert: true,\n method(keys: string[]) {\n return this.$_addRule({ name: 'keys', args: { keys } })\n },\n args: [\n {\n name: 'keys',\n ref: true,\n assert: (value) =>\n Array.isArray(value) && value.every((k) => typeof k === 'string'),\n message: 'must be an array of strings'\n }\n ]\n }\n }\n }\n}) as CustomValidator\n\nexport const autoCompleteOptionsSchema = customValidator\n .dsv<{ text: string; value: string }>()\n .row(/\\r?\\n/)\n .col(':')\n .keys(['text', 'value'])\n .items(\n customValidator.object({\n text: customValidator.string().min(1).disallow('').required(),\n value: customValidator\n .string()\n .default((parent: { text: string; value?: string }) => parent.text)\n .min(1)\n .disallow('')\n })\n )\n .min(1)\n .required()\n\nexport const questionDetailsFullSchema = {\n autoCompleteOptionsSchema,\n classesSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioLabelSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema\n}\n\nexport const formEditorInputPageKeys = {\n pageType: pageTypeSchema,\n questionType: questionTypeSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPage` interface\n * @see {@link FormEditorInputPage}\n */\nexport const formEditorInputPageSchema = Joi.object<FormEditorInputPage>()\n .keys(formEditorInputPageKeys)\n .required()\n .description('Input schema for creating a new page in the form editor')\n\nexport const formEditorInputheckAnswersSettingsKeys = {\n declarationText: shortDescriptionSchema\n}\n\n/**\n * Joi schema for `FormEditorInputCheckAnswersSettings` interface\n * @see {@link FormEditorInputCheckAnswersSettings}\n */\nexport const formEditorInputCheckAnswersSettingSchema =\n Joi.object<FormEditorInputCheckAnswersSettings>()\n .keys(formEditorInputheckAnswersSettingsKeys)\n .required()\n .description('Configuration for the check-answers page')\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n hintText: hintTextSchema,\n questionOptional: questionOptionalSchema\n}\n\n/**\n * Joi schema for `FormEditorInputQuestion` interface\n * @see {@link FormEditorInputQuestion}\n */\nexport const formEditorInputQuestionSchema =\n Joi.object<FormEditorInputQuestion>()\n .keys(formEditorInputQuestionKeys)\n .required()\n .description(\n 'Input schema for creating or updating a question in the form editor'\n )\n\nexport const formEditorInputPageSettingsKeys = {\n pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,\n pageHeading: pageHeadingSchema,\n guidanceText: guidanceTextSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPageSettings` interface\n * @see {@link FormEditorInputPageSettings}\n */\nexport const formEditorInputPageSettingsSchema =\n Joi.object<FormEditorInputPageSettings>()\n .keys(formEditorInputPageSettingsKeys)\n .required()\n .description('Settings for page content and display in the form editor')\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiD,KAAK;AAEhE,SAASC,aAAa;AAQtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,OAAO,MAAMC,cAAc,GAAGH,GAAG,CAACI,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC7BC,WAAW,CAAC,wDAAwD,CAAC;AAExE,OAAO,MAAMC,kBAAkB,GAAGR,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,oBAAoB,CAACO,qBAAqB,EAC1CP,oBAAoB,CAACQ,YAAY,EACjCT,aAAa,CAACU,cAAc,EAC5BV,aAAa,CAACW,oBAAoB,EAClCX,aAAa,CAACY,eAAe,EAC7BZ,aAAa,CAACa,iBAAiB,EAC/BZ,oBAAoB,CAACa,YAAY,EACjCd,aAAa,CAACe,UAAU,EACxBf,aAAa,CAACgB,eAAe,EAC7BhB,aAAa,CAACiB,WAAW,EACzBjB,aAAa,CAACkB,iBAChB,CAAC,CACAZ,WAAW,CAAC,0DAA0D,CAAC;AAE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EAAEvF,4BAA4B;EACpDwF,WAAW,EAAEvF,iBAAiB;EAC9BwF,YAAY,EAAEvF;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMwF,iCAAiC,GAC5CpJ,GAAG,CAAC8H,MAAM,CAA8B,CAAC,CACtC1B,IAAI,CAAC4C,+BAA+B,CAAC,CACrC3I,QAAQ,CAAC,CAAC,CACVE,WAAW,CAAC,0DAA0D,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioLabel: string\n\n /**\n * The hint of the radio item\n */\n radioHint: string\n\n /**\n * The value of the radio item\n */\n radioValue: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport interface EnhancedActionState {\n questionDetails: Partial<ComponentDef>\n state: {\n radioId?: string\n radioLabel?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems: { label?: string; hint?: string; value?: string; id?: string }[]\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[]\n classes?: string\n label?: { text?: string; html?: string; classes?: string }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n errorMessage?: { text: string }\n}\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioLabel: string\n\n /**\n * The hint of the radio item\n */\n radioHint: string\n\n /**\n * The value of the radio item\n */\n radioValue: string\n\n autoCompleteOptions: Item[]\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport interface EnhancedActionState {\n questionDetails: Partial<ComponentDef>\n state: {\n radioId?: string\n radioLabel?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems: { label?: string; hint?: string; value?: string; id?: string }[]\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import Joi from 'joi';
2
- import { pageSchema } from "../../index.js";
2
+ import { pageSchema } from "../form-definition/index.js";
3
3
  export const patchPageSchema = Joi.object().keys({
4
4
  title: pageSchema.extract('title').optional().description('New title to set for the page'),
5
5
  path: pageSchema.extract('path').optional().description('New URL path to set for the page')
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","pageSchema","patchPageSchema","object","keys","title","extract","optional","description","path","required","min"],"sources":["../../../../src/form/form-manager/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type PatchPageFields } from '~/src/form/form-manager/types.js'\nimport { pageSchema } from '~/src/index.js'\n\nexport const patchPageSchema = Joi.object<PatchPageFields>()\n .keys({\n title: pageSchema\n .extract('title')\n .optional()\n .description('New title to set for the page'),\n path: pageSchema\n .extract('path')\n .optional()\n .description('New URL path to set for the page')\n })\n .required()\n .min(1)\n .description(\n 'Schema for partially updating a page, requiring at least one field to be provided'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAGrB,SAASC,UAAU;AAEnB,OAAO,MAAMC,eAAe,GAAGF,GAAG,CAACG,MAAM,CAAkB,CAAC,CACzDC,IAAI,CAAC;EACJC,KAAK,EAAEJ,UAAU,CACdK,OAAO,CAAC,OAAO,CAAC,CAChBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,+BAA+B,CAAC;EAC/CC,IAAI,EAAER,UAAU,CACbK,OAAO,CAAC,MAAM,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,kCAAkC;AACnD,CAAC,CAAC,CACDE,QAAQ,CAAC,CAAC,CACVC,GAAG,CAAC,CAAC,CAAC,CACNH,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","pageSchema","patchPageSchema","object","keys","title","extract","optional","description","path","required","min"],"sources":["../../../../src/form/form-manager/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { pageSchema } from '~/src/form/form-definition/index.js'\nimport { type PatchPageFields } from '~/src/form/form-manager/types.js'\n\nexport const patchPageSchema = Joi.object<PatchPageFields>()\n .keys({\n title: pageSchema\n .extract('title')\n .optional()\n .description('New title to set for the page'),\n path: pageSchema\n .extract('path')\n .optional()\n .description('New URL path to set for the page')\n })\n .required()\n .min(1)\n .description(\n 'Schema for partially updating a page, requiring at least one field to be provided'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,UAAU;AAGnB,OAAO,MAAMC,eAAe,GAAGF,GAAG,CAACG,MAAM,CAAkB,CAAC,CACzDC,IAAI,CAAC;EACJC,KAAK,EAAEJ,UAAU,CACdK,OAAO,CAAC,OAAO,CAAC,CAChBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,+BAA+B,CAAC;EAC/CC,IAAI,EAAER,UAAU,CACbK,OAAO,CAAC,MAAM,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,kCAAkC;AACnD,CAAC,CAAC,CACDE,QAAQ,CAAC,CAAC,CACVC,GAAG,CAAC,CAAC,CAAC,CACNH,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAA8B,MAAM,KAAK,CAAA;AAIhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAU7D,OAAO,EAKL,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAMV,MAAM,qCAAqC,CAAA;AAuJ5C,eAAO,MAAM,eAAe,gCA4FZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAOkD,CAAA;AA8FhF;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAiDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAStB,CAAA;AAEH,eAAO,MAAM,mBAAmB,wBAc7B,CAAA;AA0CH,eAAO,MAAM,UAAU,wBA8BnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAOkD,CAAA;AAiD3E;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kCAsE7B,CAAA;AAEJ,eAAO,MAAM,6BAA6B,kCAiBvC,CAAA;AAIH,eAAO,MAAM,MAAM,kCAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAA8B,MAAM,KAAK,CAAA;AAIhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAU7D,OAAO,EAKL,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAMV,MAAM,qCAAqC,CAAA;AAuJ5C,eAAO,MAAM,eAAe,gCA4FZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAOkD,CAAA;AA8FhF;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAiDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAStB,CAAA;AAEH,eAAO,MAAM,mBAAmB,wBAc7B,CAAA;AAiDH,eAAO,MAAM,UAAU,wBA8BnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,wBAOkD,CAAA;AAiD3E;;;GAGG;AACH,eAAO,MAAM,oBAAoB,kCAsE7B,CAAA;AAEJ,eAAO,MAAM,6BAA6B,kCAiBvC,CAAA;AAIH,eAAO,MAAM,MAAM,kCAAuB,CAAA"}
@@ -92,6 +92,7 @@ export interface Section {
92
92
  hideTitle?: boolean;
93
93
  }
94
94
  export interface Item {
95
+ id?: string;
95
96
  text: string;
96
97
  value: string | number | boolean;
97
98
  description?: string;
@@ -99,6 +100,7 @@ export interface Item {
99
100
  components: ComponentDef[];
100
101
  };
101
102
  condition?: string;
103
+ hint?: string;
102
104
  }
103
105
  export interface List {
104
106
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE/E,oBAAY,MAAM;IAChB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;A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Q,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;QAC7B,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"}
@@ -1,4 +1,4 @@
1
- import Joi from 'joi';
1
+ import Joi, { type ArraySchema } from 'joi';
2
2
  import { type FormEditorInputCheckAnswersSettings, type FormEditorInputPage, type FormEditorInputPageSettings, type FormEditorInputQuestion } from '../../form/form-editor/types.js';
3
3
  export declare enum QuestionTypeSubGroup {
4
4
  WrittenAnswerSubGroup = "writtenAnswerSub",
@@ -45,7 +45,26 @@ export declare const regexSchema: Joi.StringSchema<string>;
45
45
  export declare const rowsSchema: Joi.NumberSchema<number>;
46
46
  export declare const suffixSchema: Joi.StringSchema<string>;
47
47
  export declare const classesSchema: Joi.StringSchema<string>;
48
+ interface DSLSchema<TSchema = Record<string, unknown>[]> extends ArraySchema<TSchema> {
49
+ rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>;
50
+ row: (rowSep: string | RegExp) => DSLSchema<TSchema>;
51
+ colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>;
52
+ col: (colSep: string | RegExp) => DSLSchema<TSchema>;
53
+ keys: (keys: string[]) => DSLSchema<TSchema>;
54
+ }
55
+ interface CustomValidator extends Joi.Root {
56
+ dsv<TSchema>(): DSLSchema<TSchema>;
57
+ }
58
+ export declare const customValidator: CustomValidator;
59
+ export declare const autoCompleteOptionsSchema: DSLSchema<{
60
+ text: string;
61
+ value: string;
62
+ }>;
48
63
  export declare const questionDetailsFullSchema: {
64
+ autoCompleteOptionsSchema: DSLSchema<{
65
+ text: string;
66
+ value: string;
67
+ }>;
49
68
  classesSchema: Joi.StringSchema<string>;
50
69
  documentTypesSchema: Joi.ArraySchema<any[]>;
51
70
  enhancedActionSchema: Joi.StringSchema<string>;
@@ -115,4 +134,5 @@ export declare const formEditorInputPageSettingsKeys: {
115
134
  * @see {@link FormEditorInputPageSettings}
116
135
  */
117
136
  export declare const formEditorInputPageSettingsSchema: Joi.ObjectSchema<FormEditorInputPageSettings>;
137
+ export {};
118
138
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAA;AAExC,oBAAY,oBAAoB;IAC9B,qBAAqB,qBAAqB;IAC1C,YAAY,YAAY;IACxB,YAAY,YAAY;CACzB;AAED,eAAO,MAAM,cAAc,0BAG6C,CAAA;AAExE,eAAO,MAAM,kBAAkB,0BAe2C,CAAA;AAE1E,eAAO,MAAM,sBAAsB,0BAiBmC,CAAA;AAEtE,eAAO,MAAM,sBAAsB,0BAOmB,CAAA;AAEtD,eAAO,MAAM,aAAa,0BAE0C,CAAA;AACpE,eAAO,MAAM,aAAa,0BAQ0B,CAAA;AAEpD,eAAO,MAAM,UAAU,0BAG0B,CAAA;AAEjD,eAAO,MAAM,cAAc,0BAG8B,CAAA;AAEzD,eAAO,MAAM,cAAc,0BAI0C,CAAA;AAErE,eAAO,MAAM,sBAAsB,0BAMhC,CAAA;AAEH,eAAO,MAAM,gBAAgB,0BAO1B,CAAA;AAEH,eAAO,MAAM,cAAc,0BAOxB,CAAA;AAEH,eAAO,MAAM,cAAc,0BAOxB,CAAA;AAEH,eAAO,MAAM,eAAe,wBAOzB,CAAA;AAEH,eAAO,MAAM,mBAAmB,wBAO7B,CAAA;AAEH,eAAO,MAAM,gBAAgB,wBAO1B,CAAA;AAEH,eAAO,MAAM,sBAAsB,wBAIrB,CAAA;AACd,eAAO,MAAM,oBAAoB,0BAIqC,CA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D,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA;IACpD,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA;CAC7C;AAED,UAAU,eAAgB,SAAQ,GAAG,CAAC,IAAI;IACxC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA;CACnC;AAED,eAAO,MAAM,eAAe,EA4GtB,eAAe,CAAA;AAErB,eAAO,MAAM,yBAAyB;UACvB,MAAM;WAAS,MAAM;EAevB,CAAA;AAEb,eAAO,MAAM,yBAAyB;;cAjBvB,MAAM;eAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDnC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;CAGnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uCAGmC,CAAA;AAEzE,eAAO,MAAM,sCAAsC;;CAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wCAAwC,uDAIO,CAAA;AAE5D,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2CAMrC,CAAA;AAEL,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAI8B,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { type ComponentDef } from '../../components/types.js';
2
+ import { type Item } from '../../index.js';
2
3
  /**
3
4
  * Interface for `FormEditor` Joi schema
4
5
  */
@@ -163,10 +164,11 @@ export interface FormEditor {
163
164
  * The value of the radio item
164
165
  */
165
166
  radioValue: string;
167
+ autoCompleteOptions: Item[];
166
168
  }
167
169
  export type FormEditorInputPage = Pick<FormEditor, 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'>;
168
170
  export type FormEditorInputCheckAnswersSettings = Pick<FormEditor, 'needDeclaration' | 'declarationText'>;
169
- export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'exactFiles' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'enhancedAction' | 'radioId' | 'radioLabel' | 'radioHint' | 'radioValue'>;
171
+ export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'exactFiles' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'autoCompleteOptions' | 'enhancedAction' | 'radioId' | 'radioLabel' | 'radioHint' | 'radioValue'>;
170
172
  export type FormEditorInputPageSettings = Pick<FormEditor, 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'>;
171
173
  export type FormEditorInputGuidancePage = Pick<FormEditor, 'pageHeading' | 'guidanceText'>;
172
174
  export type FormEditorInputQuestionDetails = Pick<FormEditorInputQuestion, 'question' | 'hintText' | 'shortDescription' | 'questionOptional' | 'questionType' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'enhancedAction' | 'radioId' | 'radioLabel' | 'radioHint' | 'radioValue'>;
@@ -197,12 +199,13 @@ export interface GovukField {
197
199
  classes?: string;
198
200
  };
199
201
  };
200
- value?: string | boolean | number | string[];
202
+ value?: string | boolean | number | string[] | Item[];
201
203
  classes?: string;
202
204
  label?: {
203
205
  text?: string;
204
206
  html?: string;
205
207
  classes?: string;
208
+ isPageHeading?: boolean;
206
209
  };
207
210
  hint?: {
208
211
  text?: string;
@@ -228,10 +231,13 @@ export interface FormEditorGovukField {
228
231
  imageTypes?: GovukField;
229
232
  tabularDataTypes?: GovukField;
230
233
  radiosOrCheckboxes?: GovukField;
234
+ autoCompleteOptions?: GovukField;
231
235
  errorMessage?: {
232
236
  text: string;
233
237
  };
234
238
  }
239
+ export type FormEditorGovukFieldBase = Omit<FormEditorGovukField, 'errorMessage'>;
240
+ export type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase;
235
241
  export interface FormEditorCheckbox {
236
242
  text?: string;
237
243
  hint?: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAEhC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IA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const patchPageSchema: Joi.ObjectSchema<Partial<Pick<import("../../index.js").Page, "title" | "path" | "controller">>>;
2
+ export declare const patchPageSchema: Joi.ObjectSchema<Partial<Pick<import("../form-definition/types.js").Page, "title" | "path" | "controller">>>;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,eAAe,iGAezB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,eAAe,8GAezB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.432",
3
+ "version": "3.0.434",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "repository": {
@@ -1161,6 +1161,12 @@
1161
1161
  "type": "object",
1162
1162
  "description": "List item with string value",
1163
1163
  "properties": {
1164
+ "id": {
1165
+ "type": "string",
1166
+ "format": "uuid",
1167
+ "title": "Id",
1168
+ "description": "The id value."
1169
+ },
1164
1170
  "text": {
1165
1171
  "type": "string",
1166
1172
  "description": "Display text shown to the user",
@@ -1353,6 +1359,11 @@
1353
1359
  "description": "Condition that determines if this item is shown",
1354
1360
  "title": "Condition"
1355
1361
  },
1362
+ "hint": {
1363
+ "type": "string",
1364
+ "description": "Optional hint text to be shown on list item",
1365
+ "title": "Hint"
1366
+ },
1356
1367
  "value": {
1357
1368
  "type": "string",
1358
1369
  "description": "String value stored when this item is selected",
@@ -1375,6 +1386,12 @@
1375
1386
  "type": "object",
1376
1387
  "description": "List item with numeric value",
1377
1388
  "properties": {
1389
+ "id": {
1390
+ "type": "string",
1391
+ "format": "uuid",
1392
+ "title": "Id",
1393
+ "description": "The id value."
1394
+ },
1378
1395
  "text": {
1379
1396
  "type": "string",
1380
1397
  "description": "Display text shown to the user",
@@ -1567,6 +1584,11 @@
1567
1584
  "description": "Condition that determines if this item is shown",
1568
1585
  "title": "Condition"
1569
1586
  },
1587
+ "hint": {
1588
+ "type": "string",
1589
+ "description": "Optional hint text to be shown on list item",
1590
+ "title": "Hint"
1591
+ },
1570
1592
  "value": {
1571
1593
  "type": "number",
1572
1594
  "description": "Numeric value stored when this item is selected",
@@ -824,6 +824,12 @@
824
824
  "type": "object",
825
825
  "description": "List item with string value",
826
826
  "properties": {
827
+ "id": {
828
+ "type": "string",
829
+ "format": "uuid",
830
+ "title": "Id",
831
+ "description": "The id value."
832
+ },
827
833
  "text": {
828
834
  "type": "string",
829
835
  "description": "Display text shown to the user",
@@ -1016,6 +1022,11 @@
1016
1022
  "description": "Condition that determines if this item is shown",
1017
1023
  "title": "Condition"
1018
1024
  },
1025
+ "hint": {
1026
+ "type": "string",
1027
+ "description": "Optional hint text to be shown on list item",
1028
+ "title": "Hint"
1029
+ },
1019
1030
  "value": {
1020
1031
  "type": "string",
1021
1032
  "description": "String value stored when this item is selected",
@@ -1038,6 +1049,12 @@
1038
1049
  "type": "object",
1039
1050
  "description": "List item with numeric value",
1040
1051
  "properties": {
1052
+ "id": {
1053
+ "type": "string",
1054
+ "format": "uuid",
1055
+ "title": "Id",
1056
+ "description": "The id value."
1057
+ },
1041
1058
  "text": {
1042
1059
  "type": "string",
1043
1060
  "description": "Display text shown to the user",
@@ -1230,6 +1247,11 @@
1230
1247
  "description": "Condition that determines if this item is shown",
1231
1248
  "title": "Condition"
1232
1249
  },
1250
+ "hint": {
1251
+ "type": "string",
1252
+ "description": "Optional hint text to be shown on list item",
1253
+ "title": "Hint"
1254
+ },
1233
1255
  "value": {
1234
1256
  "type": "number",
1235
1257
  "description": "Numeric value stored when this item is selected",
@@ -39,6 +39,12 @@
39
39
  "type": "object",
40
40
  "description": "List item with string value",
41
41
  "properties": {
42
+ "id": {
43
+ "type": "string",
44
+ "format": "uuid",
45
+ "title": "Id",
46
+ "description": "The id value."
47
+ },
42
48
  "text": {
43
49
  "type": "string",
44
50
  "description": "Display text shown to the user",
@@ -231,6 +237,11 @@
231
237
  "description": "Condition that determines if this item is shown",
232
238
  "title": "Condition"
233
239
  },
240
+ "hint": {
241
+ "type": "string",
242
+ "description": "Optional hint text to be shown on list item",
243
+ "title": "Hint"
244
+ },
234
245
  "value": {
235
246
  "type": "string",
236
247
  "description": "String value stored when this item is selected",
@@ -253,6 +264,12 @@
253
264
  "type": "object",
254
265
  "description": "List item with numeric value",
255
266
  "properties": {
267
+ "id": {
268
+ "type": "string",
269
+ "format": "uuid",
270
+ "title": "Id",
271
+ "description": "The id value."
272
+ },
256
273
  "text": {
257
274
  "type": "string",
258
275
  "description": "Display text shown to the user",
@@ -445,6 +462,11 @@
445
462
  "description": "Condition that determines if this item is shown",
446
463
  "title": "Condition"
447
464
  },
465
+ "hint": {
466
+ "type": "string",
467
+ "description": "Optional hint text to be shown on list item",
468
+ "title": "Hint"
469
+ },
448
470
  "value": {
449
471
  "type": "number",
450
472
  "description": "Numeric value stored when this item is selected",
@@ -45,6 +45,12 @@
45
45
  "type": "object",
46
46
  "description": "List item with string value",
47
47
  "properties": {
48
+ "id": {
49
+ "type": "string",
50
+ "format": "uuid",
51
+ "title": "Id",
52
+ "description": "The id value."
53
+ },
48
54
  "text": {
49
55
  "type": "string",
50
56
  "description": "Display text shown to the user",
@@ -237,6 +243,11 @@
237
243
  "description": "Condition that determines if this item is shown",
238
244
  "title": "Condition"
239
245
  },
246
+ "hint": {
247
+ "type": "string",
248
+ "description": "Optional hint text to be shown on list item",
249
+ "title": "Hint"
250
+ },
240
251
  "value": {
241
252
  "type": "string",
242
253
  "description": "String value stored when this item is selected",
@@ -259,6 +270,12 @@
259
270
  "type": "object",
260
271
  "description": "List item with numeric value",
261
272
  "properties": {
273
+ "id": {
274
+ "type": "string",
275
+ "format": "uuid",
276
+ "title": "Id",
277
+ "description": "The id value."
278
+ },
262
279
  "text": {
263
280
  "type": "string",
264
281
  "description": "Display text shown to the user",
@@ -451,6 +468,11 @@
451
468
  "description": "Condition that determines if this item is shown",
452
469
  "title": "Condition"
453
470
  },
471
+ "hint": {
472
+ "type": "string",
473
+ "description": "Optional hint text to be shown on list item",
474
+ "title": "Hint"
475
+ },
454
476
  "value": {
455
477
  "type": "number",
456
478
  "description": "Numeric value stored when this item is selected",
@@ -461,6 +461,9 @@ export const pageSchemaPayloadV2 = pageSchemaV2
461
461
  const baseListItemSchema = Joi.object<Item>()
462
462
  .description('Base schema for list items with common properties')
463
463
  .keys({
464
+ id: Joi.string()
465
+ .uuid()
466
+ .default(() => uuidV4()),
464
467
  text: Joi.string().allow('').description('Display text shown to the user'),
465
468
  description: Joi.string()
466
469
  .allow('')
@@ -479,7 +482,11 @@ const baseListItemSchema = Joi.object<Item>()
479
482
  condition: Joi.string()
480
483
  .allow('')
481
484
  .optional()
482
- .description('Condition that determines if this item is shown')
485
+ .description('Condition that determines if this item is shown'),
486
+ hint: Joi.string()
487
+ .allow('')
488
+ .optional()
489
+ .description('Optional hint text to be shown on list item')
483
490
  })
484
491
 
485
492
  const stringListItemSchema = baseListItemSchema
@@ -119,11 +119,13 @@ export interface Section {
119
119
  }
120
120
 
121
121
  export interface Item {
122
+ id?: string
122
123
  text: string
123
124
  value: string | number | boolean
124
125
  description?: string
125
126
  conditional?: { components: ComponentDef[] }
126
127
  condition?: string
128
+ hint?: string
127
129
  }
128
130
 
129
131
  export interface List {
@@ -1,4 +1,4 @@
1
- import Joi from 'joi'
1
+ import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'
2
2
 
3
3
  import { ComponentType } from '~/src/components/enums.js'
4
4
  import {
@@ -291,7 +291,153 @@ export const classesSchema = Joi.string()
291
291
  .allow('')
292
292
  .description('Custom CSS classes to apply to the component')
293
293
 
294
+ type GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {
295
+ args: Record<K, T>
296
+ }
297
+
298
+ interface DSLSchema<TSchema = Record<string, unknown>[]>
299
+ extends ArraySchema<TSchema> {
300
+ rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>
301
+ row: (rowSep: string | RegExp) => DSLSchema<TSchema>
302
+ colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>
303
+ col: (colSep: string | RegExp) => DSLSchema<TSchema>
304
+ keys: (keys: string[]) => DSLSchema<TSchema>
305
+ }
306
+
307
+ interface CustomValidator extends Joi.Root {
308
+ dsv<TSchema>(): DSLSchema<TSchema>
309
+ }
310
+
311
+ export const customValidator = Joi.extend((joi: Joi.Root) => {
312
+ return {
313
+ type: 'dsv',
314
+ base: joi.array(),
315
+ messages: {
316
+ 'dsv.invalid': 'Invalid parse string'
317
+ },
318
+ coerce: {
319
+ from: 'string',
320
+ method(value: string, helpers) {
321
+ try {
322
+ // Only called when prefs.convert is true
323
+ // Rules
324
+ const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator') as
325
+ | undefined
326
+ | GenericRuleOptions<'rowSeparator', string | RegExp>
327
+ const colSeparatorRule = helpers.schema.$_getRule('colSeparator') as
328
+ | undefined
329
+ | GenericRuleOptions<'colSeparator', string | RegExp>
330
+ const keysRule = helpers.schema.$_getRule('keys') as
331
+ | undefined
332
+ | GenericRuleOptions<'keys', string[]>
333
+
334
+ // Rows
335
+ const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\r?\n/
336
+ const rows = value
337
+ .split(rowSeparator)
338
+ .map((v) => v.trim())
339
+ .filter(Boolean)
340
+
341
+ // Columns
342
+ const colSeparator = colSeparatorRule?.args.colSeparator ?? ','
343
+ const keys = keysRule?.args.keys ?? ['key', 'value']
344
+
345
+ const coercedValue = rows.map((row) => {
346
+ return row
347
+ .split(colSeparator)
348
+ .reduce<Record<string, string>>((acc, col, idx) => {
349
+ return {
350
+ ...acc,
351
+ [keys[idx]]: col.trim()
352
+ }
353
+ }, {})
354
+ })
355
+ return { value: coercedValue }
356
+ } catch (_err) {
357
+ // eslint-disable-next-line no-console
358
+ console.error(_err)
359
+ return { value, errors: [helpers.error('dsv.invalid')] }
360
+ }
361
+ }
362
+ },
363
+ rules: {
364
+ rowSeparator: {
365
+ convert: true,
366
+ alias: 'row',
367
+ method(rowSeparator: string) {
368
+ return this.$_addRule({
369
+ name: 'rowSeparator',
370
+ args: { rowSeparator }
371
+ })
372
+ },
373
+ args: [
374
+ {
375
+ name: 'rowSeparator',
376
+ ref: true,
377
+ assert: (value) =>
378
+ typeof value === 'string' || value instanceof RegExp,
379
+ message: 'must be a string or regex'
380
+ }
381
+ ]
382
+ },
383
+ colSeparator: {
384
+ convert: true,
385
+ alias: 'col',
386
+ method(colSeparator: string) {
387
+ return this.$_addRule({
388
+ name: 'colSeparator',
389
+ args: { colSeparator }
390
+ })
391
+ },
392
+ args: [
393
+ {
394
+ name: 'colSeparator',
395
+ ref: true,
396
+ assert: (value) =>
397
+ typeof value === 'string' || value instanceof RegExp,
398
+ message: 'must be a string or regex'
399
+ }
400
+ ]
401
+ },
402
+ keys: {
403
+ convert: true,
404
+ method(keys: string[]) {
405
+ return this.$_addRule({ name: 'keys', args: { keys } })
406
+ },
407
+ args: [
408
+ {
409
+ name: 'keys',
410
+ ref: true,
411
+ assert: (value) =>
412
+ Array.isArray(value) && value.every((k) => typeof k === 'string'),
413
+ message: 'must be an array of strings'
414
+ }
415
+ ]
416
+ }
417
+ }
418
+ }
419
+ }) as CustomValidator
420
+
421
+ export const autoCompleteOptionsSchema = customValidator
422
+ .dsv<{ text: string; value: string }>()
423
+ .row(/\r?\n/)
424
+ .col(':')
425
+ .keys(['text', 'value'])
426
+ .items(
427
+ customValidator.object({
428
+ text: customValidator.string().min(1).disallow('').required(),
429
+ value: customValidator
430
+ .string()
431
+ .default((parent: { text: string; value?: string }) => parent.text)
432
+ .min(1)
433
+ .disallow('')
434
+ })
435
+ )
436
+ .min(1)
437
+ .required()
438
+
294
439
  export const questionDetailsFullSchema = {
440
+ autoCompleteOptionsSchema,
295
441
  classesSchema,
296
442
  documentTypesSchema,
297
443
  enhancedActionSchema,
@@ -1,4 +1,5 @@
1
1
  import { type ComponentDef } from '~/src/components/types.js'
2
+ import { type Item } from '~/src/index.js'
2
3
 
3
4
  /**
4
5
  * Interface for `FormEditor` Joi schema
@@ -203,6 +204,8 @@ export interface FormEditor {
203
204
  * The value of the radio item
204
205
  */
205
206
  radioValue: string
207
+
208
+ autoCompleteOptions: Item[]
206
209
  }
207
210
 
208
211
  export type FormEditorInputPage = Pick<
@@ -242,6 +245,7 @@ export type FormEditorInputQuestion = Pick<
242
245
  | 'documentTypes'
243
246
  | 'imageTypes'
244
247
  | 'tabularDataTypes'
248
+ | 'autoCompleteOptions'
245
249
  | 'enhancedAction'
246
250
  | 'radioId'
247
251
  | 'radioLabel'
@@ -296,9 +300,14 @@ export interface GovukField {
296
300
  fieldset?: {
297
301
  legend?: { text?: string; isPageHeading?: boolean; classes?: string }
298
302
  }
299
- value?: string | boolean | number | string[]
303
+ value?: string | boolean | number | string[] | Item[]
300
304
  classes?: string
301
- label?: { text?: string; html?: string; classes?: string }
305
+ label?: {
306
+ text?: string
307
+ html?: string
308
+ classes?: string
309
+ isPageHeading?: boolean
310
+ }
302
311
  hint?: { text?: string; html?: string; classes?: string }
303
312
  items?: { text?: string; value?: string; checked?: boolean }[]
304
313
  rows?: number
@@ -316,9 +325,17 @@ export interface FormEditorGovukField {
316
325
  imageTypes?: GovukField
317
326
  tabularDataTypes?: GovukField
318
327
  radiosOrCheckboxes?: GovukField
328
+ autoCompleteOptions?: GovukField
319
329
  errorMessage?: { text: string }
320
330
  }
321
331
 
332
+ export type FormEditorGovukFieldBase = Omit<
333
+ FormEditorGovukField,
334
+ 'errorMessage'
335
+ >
336
+
337
+ export type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase
338
+
322
339
  export interface FormEditorCheckbox {
323
340
  text?: string
324
341
  hint?: {
@@ -1,7 +1,7 @@
1
1
  import Joi from 'joi'
2
2
 
3
+ import { pageSchema } from '~/src/form/form-definition/index.js'
3
4
  import { type PatchPageFields } from '~/src/form/form-manager/types.js'
4
- import { pageSchema } from '~/src/index.js'
5
5
 
6
6
  export const patchPageSchema = Joi.object<PatchPageFields>()
7
7
  .keys({