@defra/forms-model 3.0.585 → 3.0.587

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.
@@ -329,7 +329,7 @@ export function buildOsGridRefFieldComponent(partialComponent = {}) {
329
329
  id: '4d5e6f7g-8h9i-0j1k-2l3m-4n5o6p7q8r9s',
330
330
  name: 'OsGridRefField',
331
331
  title: 'Ordnance Survey (OS) grid reference',
332
- hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',
332
+ hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',
333
333
  options: {},
334
334
  ...partialComponent,
335
335
  type: ComponentType.OsGridRefField
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","names":["ComponentType","buildTextFieldComponent","partialTextField","id","name","title","hint","options","schema","type","TextField","buildMultilineTextFieldComponent","partialMultilineTextField","MultilineTextField","buildYesNoFieldComponent","partialYesNoField","YesNoField","buildDeclarationFieldComponent","partialDeclarationField","content","DeclarationField","buildMonthYearFieldComponent","partialMonthYearField","MonthYearField","buildSelectFieldComponent","partialSelectField","list","SelectField","buildUkAddressFieldComponent","partialUkAddressField","UkAddressField","buildTelephoneNumberFieldComponent","partialTelephoneNumberField","TelephoneNumberField","buildEmailAddressFieldComponent","partialEmailAddressField","EmailAddressField","buildHtmlComponent","partialHtml","Html","buildInsetTextComponent","partialInsetText","InsetText","buildDetailsComponent","partialDetails","Details","buildListComponent","partialList","List","buildMarkdownComponent","partialMarkdown","Markdown","buildFileUploadComponent","partialFileUploadField","FileUploadField","buildAutoCompleteComponent","partialAutoCompleteField","AutocompleteField","buildRadioComponent","partialListComponent","RadiosField","buildCheckboxComponent","CheckboxesField","buildListItem","partialListItem","text","value","buildList","items","buildNumberFieldComponent","partialComponent","NumberField","buildDateComponent","DatePartsField","buildRadiosComponent","buildEastingNorthingFieldComponent","EastingNorthingField","buildLatLongFieldComponent","LatLongField","buildNationalGridFieldNumberFieldComponent","NationalGridFieldNumberField","buildOsGridRefFieldComponent","OsGridRefField"],"sources":["../../../src/__stubs__/components.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n type AutocompleteFieldComponent,\n type CheckboxesFieldComponent,\n type DatePartsFieldComponent,\n type DeclarationFieldComponent,\n type DetailsComponent,\n type EastingNorthingFieldComponent,\n type EmailAddressFieldComponent,\n type FileUploadFieldComponent,\n type HtmlComponent,\n type InsetTextComponent,\n type LatLongFieldComponent,\n type ListComponent,\n type MarkdownComponent,\n type MonthYearFieldComponent,\n type MultilineTextFieldComponent,\n type NationalGridFieldNumberFieldComponent,\n type NumberFieldComponent,\n type OsGridRefFieldComponent,\n type RadiosFieldComponent,\n type SelectFieldComponent,\n type TelephoneNumberFieldComponent,\n type TextFieldComponent,\n type UkAddressFieldComponent,\n type YesNoFieldComponent\n} from '~/src/components/types.js'\nimport { type Item, type List } from '~/src/form/form-definition/types.js'\n\n/**\n * @param {Partial<TextFieldComponent>} partialTextField\n * @returns {TextFieldComponent}\n */\nexport function buildTextFieldComponent(\n partialTextField: Partial<TextFieldComponent> = {}\n): TextFieldComponent {\n return {\n id: '407dd0d7-cce9-4f43-8e1f-7d89cb698875',\n name: 'TextField',\n title: 'Text field',\n hint: '',\n options: {},\n schema: {},\n ...partialTextField,\n type: ComponentType.TextField\n }\n}\n\nexport function buildMultilineTextFieldComponent(\n partialMultilineTextField: Partial<MultilineTextFieldComponent> = {}\n): MultilineTextFieldComponent {\n return {\n id: '72671f23-552e-4504-a06a-693e240880d5',\n name: 'MuTeCo',\n options: {},\n schema: {},\n title: 'Multiline TextField Component',\n ...partialMultilineTextField,\n type: ComponentType.MultilineTextField\n }\n}\n\nexport function buildYesNoFieldComponent(\n partialYesNoField: Partial<YesNoFieldComponent> = {}\n): YesNoFieldComponent {\n return {\n title: 'YesNo Field Component',\n id: 'be7f849c-47d8-4f1f-ba15-ab939dc70914',\n name: 'YesNoFieldComponent',\n options: {},\n ...partialYesNoField,\n type: ComponentType.YesNoField\n }\n}\n\nexport function buildDeclarationFieldComponent(\n partialDeclarationField: Partial<DeclarationFieldComponent> = {}\n): DeclarationFieldComponent {\n return {\n title: 'Declaration',\n id: 'f2a8c9e1-3d4f-4b5a-8c6d-1e2f3a4b5c6d',\n name: 'DeclarationFieldComponent',\n content: '',\n options: {},\n ...partialDeclarationField,\n type: ComponentType.DeclarationField\n }\n}\nexport function buildMonthYearFieldComponent(\n partialMonthYearField: Partial<MonthYearFieldComponent> = {}\n): MonthYearFieldComponent {\n return {\n id: 'd4e99aca-6d13-4c1a-a623-9e9e5b27d46d',\n title: 'MonthYearFieldComponent',\n name: 'MonthYearFieldComponent',\n options: {},\n ...partialMonthYearField,\n type: ComponentType.MonthYearField\n }\n}\nexport function buildSelectFieldComponent(\n partialSelectField: Partial<SelectFieldComponent> = {}\n): SelectFieldComponent {\n return {\n id: '7f219cf6-3e16-4549-b8df-789506682147',\n list: '',\n name: '',\n options: {},\n title: '',\n ...partialSelectField,\n type: ComponentType.SelectField\n }\n}\nexport function buildUkAddressFieldComponent(\n partialUkAddressField: Partial<UkAddressFieldComponent> = {}\n): UkAddressFieldComponent {\n return {\n id: 'a7cb7440-9095-44cd-9136-2914232722c8',\n title: 'UkAddressFieldComponent',\n name: 'UkAddressFieldComponent',\n options: {},\n ...partialUkAddressField,\n type: ComponentType.UkAddressField\n }\n}\nexport function buildTelephoneNumberFieldComponent(\n partialTelephoneNumberField: Partial<TelephoneNumberFieldComponent> = {}\n): TelephoneNumberFieldComponent {\n return {\n id: '69907916-beac-4faa-b469-656dad5edced',\n title: 'TelephoneNumberFieldComponent',\n name: 'TelephoneNumberFieldComponent',\n options: {},\n ...partialTelephoneNumberField,\n type: ComponentType.TelephoneNumberField\n }\n}\nexport function buildEmailAddressFieldComponent(\n partialEmailAddressField: Partial<EmailAddressFieldComponent> = {}\n): EmailAddressFieldComponent {\n return {\n id: '9dcf0781-bf34-48c8-b13b-d13050dc34d9',\n title: 'EmailAddressFieldComponent',\n name: 'EmailAddressFieldComponent',\n options: {},\n ...partialEmailAddressField,\n type: ComponentType.EmailAddressField\n }\n}\n\nexport function buildHtmlComponent(\n partialHtml: Partial<HtmlComponent> = {}\n): HtmlComponent {\n return {\n id: 'bac683ce-149e-4740-95aa-8289b35bc327',\n title: 'HtmlComponent',\n name: 'HtmlComponent',\n options: {},\n content: '',\n ...partialHtml,\n type: ComponentType.Html\n }\n}\nexport function buildInsetTextComponent(\n partialInsetText: Partial<InsetTextComponent> = {}\n): InsetTextComponent {\n return {\n id: '6b717151-1e86-42b2-97a9-2201b0676e47',\n title: 'InsetText Component',\n name: 'InsetTextComponent',\n content: '',\n options: {},\n ...partialInsetText,\n type: ComponentType.InsetText\n }\n}\nexport function buildDetailsComponent(\n partialDetails: Partial<DetailsComponent> = {}\n): DetailsComponent {\n return {\n id: '245d54df-bb1e-488e-82f6-8f1e42c197e6',\n title: 'Details Component',\n name: 'DetailsComponent',\n content: '',\n options: {},\n ...partialDetails,\n type: ComponentType.Details\n }\n}\nexport function buildListComponent(\n partialList: Partial<ListComponent> = {}\n): ListComponent {\n return {\n id: '62f17168-c2ef-4978-bd42-bdaa5704e25f',\n title: 'List Component',\n name: 'ListComponent',\n list: '',\n options: {},\n ...partialList,\n type: ComponentType.List\n }\n}\nexport function buildMarkdownComponent(\n partialMarkdown: Partial<MarkdownComponent> = {}\n): MarkdownComponent {\n return {\n id: '4a2dc88c-be1a-4277-aff8-04220de2e778',\n title: 'Markdown Component',\n name: 'MarkdownComponent',\n options: {},\n content: '',\n ...partialMarkdown,\n type: ComponentType.Markdown\n }\n}\n\n/**\n * @param {Partial<FileUploadFieldComponent>} partialFileUploadField\n * @returns {FileUploadFieldComponent}\n */\nexport function buildFileUploadComponent(\n partialFileUploadField: Partial<FileUploadFieldComponent> = {}\n): FileUploadFieldComponent {\n return {\n name: 'FileUploadField',\n title: 'File Upload Field',\n options: {},\n schema: {},\n ...partialFileUploadField,\n type: ComponentType.FileUploadField\n }\n}\n\n/**\n *\n * @param {Partial<AutocompleteFieldComponent>} partialAutoCompleteField\n * @returns {AutocompleteFieldComponent}\n */\nexport function buildAutoCompleteComponent(\n partialAutoCompleteField: Partial<AutocompleteFieldComponent> = {}\n): AutocompleteFieldComponent {\n return {\n name: 'AutoCompleteField',\n title: 'What languages do you speak?',\n list: 'AutoCompleteList',\n options: {},\n ...partialAutoCompleteField,\n type: ComponentType.AutocompleteField\n }\n}\n\n/**\n * @param {Partial<RadiosFieldComponent>} partialListComponent\n * @returns {RadiosFieldComponent}\n */\nexport function buildRadioComponent(\n partialListComponent: Partial<RadiosFieldComponent> = {}\n): RadiosFieldComponent {\n return {\n id: '34455d57-df37-4b69-a64f-6c3af0317ebe',\n name: 'RadioField',\n title: 'Which country do you live in?',\n list: 'RadioList',\n options: {},\n ...partialListComponent,\n type: ComponentType.RadiosField\n }\n}\n\n/**\n * @param {Partial<CheckboxesFieldComponent>} partialListComponent\n * @returns {CheckboxesFieldComponent}\n */\nexport function buildCheckboxComponent(\n partialListComponent: Partial<CheckboxesFieldComponent> = {}\n): CheckboxesFieldComponent {\n return {\n name: 'FellowshipOfTheRing',\n title: 'Which are your favourite characters from the fellowship?',\n list: 'CheckboxList',\n options: {},\n ...partialListComponent,\n type: ComponentType.CheckboxesField\n }\n}\n\n/**\n * Builder to create a stub List item\n * @param {Partial<Item>} partialListItem\n * @returns {Item}\n */\nexport function buildListItem(partialListItem: Partial<Item> = {}): Item {\n return {\n text: 'Javascript',\n value: 'javascript',\n ...partialListItem\n }\n}\n\n/**\n * @param {Partial<List>} partialList\n * @returns {List}\n */\nexport function buildList(partialList: Partial<List> = {}): List {\n return {\n title: 'Development language2',\n name: 'YhmNDD',\n type: 'string',\n items: [\n buildListItem({\n text: 'Javascript',\n value: 'javascript'\n }),\n buildListItem({\n text: 'TypeScript',\n value: 'typescript'\n }),\n buildListItem({\n text: 'Python',\n value: 'python'\n }),\n buildListItem({\n text: 'Haskell',\n value: 'haskell'\n }),\n buildListItem({\n text: 'Erlang',\n value: 'erlang'\n }),\n buildListItem({\n text: 'Java',\n value: 'java'\n })\n ],\n ...partialList\n }\n}\n\nexport function buildNumberFieldComponent(\n partialComponent: Partial<NumberFieldComponent> = {}\n): NumberFieldComponent {\n return {\n name: 'year',\n title: 'Year',\n options: {},\n schema: {},\n ...partialComponent,\n type: ComponentType.NumberField\n }\n}\n\nexport function buildDateComponent(\n partialComponent: Partial<DatePartsFieldComponent> = {}\n): DatePartsFieldComponent {\n return {\n name: 'bcdefg',\n title: 'Default title',\n options: {},\n ...partialComponent,\n type: ComponentType.DatePartsField\n }\n}\n\nexport function buildRadiosComponent(\n partialComponent: Partial<RadiosFieldComponent> = {}\n): RadiosFieldComponent {\n return {\n name: 'cdefgh',\n title: 'Default title',\n options: {},\n list: 'Default list Id ref',\n ...partialComponent,\n type: ComponentType.RadiosField\n }\n}\n\nexport function buildEastingNorthingFieldComponent(\n partialComponent: Partial<EastingNorthingFieldComponent> = {}\n): EastingNorthingFieldComponent {\n return {\n id: '1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p',\n name: 'EastingNorthingField',\n title: 'Easting and northing',\n hint: 'For example, Easting: 248741, Northing: 63688',\n options: {},\n schema: {},\n ...partialComponent,\n type: ComponentType.EastingNorthingField\n }\n}\n\nexport function buildLatLongFieldComponent(\n partialComponent: Partial<LatLongFieldComponent> = {}\n): LatLongFieldComponent {\n return {\n id: '2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q',\n name: 'LatLongField',\n title: 'Latitude and longitude',\n hint: 'For example, Latitude: 51.5074, Longitude: -0.1278',\n options: {},\n schema: {},\n ...partialComponent,\n type: ComponentType.LatLongField\n }\n}\n\nexport function buildNationalGridFieldNumberFieldComponent(\n partialComponent: Partial<NationalGridFieldNumberFieldComponent> = {}\n): NationalGridFieldNumberFieldComponent {\n return {\n id: '3c4d5e6f-7g8h-9i0j-1k2l-3m4n5o6p7q8r',\n name: 'NationalGridFieldNumberField',\n title: 'National Grid field number',\n hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589',\n options: {},\n ...partialComponent,\n type: ComponentType.NationalGridFieldNumberField\n }\n}\n\nexport function buildOsGridRefFieldComponent(\n partialComponent: Partial<OsGridRefFieldComponent> = {}\n): OsGridRefFieldComponent {\n return {\n id: '4d5e6f7g-8h9i-0j1k-2l3m-4n5o6p7q8r9s',\n name: 'OsGridRefField',\n title: 'Ordnance Survey (OS) grid reference',\n hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',\n options: {},\n ...partialComponent,\n type: ComponentType.OsGridRefField\n }\n}\n"],"mappings":"AAAA,SAASA,aAAa;AA6BtB;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,gBAA6C,GAAG,CAAC,CAAC,EAC9B;EACpB,OAAO;IACLC,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,WAAW;IACjBC,KAAK,EAAE,YAAY;IACnBC,IAAI,EAAE,EAAE;IACRC,OAAO,EAAE,CAAC,CAAC;IACXC,MAAM,EAAE,CAAC,CAAC;IACV,GAAGN,gBAAgB;IACnBO,IAAI,EAAET,aAAa,CAACU;EACtB,CAAC;AACH;AAEA,OAAO,SAASC,gCAAgCA,CAC9CC,yBAA+D,GAAG,CAAC,CAAC,EACvC;EAC7B,OAAO;IACLT,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,QAAQ;IACdG,OAAO,EAAE,CAAC,CAAC;IACXC,MAAM,EAAE,CAAC,CAAC;IACVH,KAAK,EAAE,+BAA+B;IACtC,GAAGO,yBAAyB;IAC5BH,IAAI,EAAET,aAAa,CAACa;EACtB,CAAC;AACH;AAEA,OAAO,SAASC,wBAAwBA,CACtCC,iBAA+C,GAAG,CAAC,CAAC,EAC/B;EACrB,OAAO;IACLV,KAAK,EAAE,uBAAuB;IAC9BF,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,qBAAqB;IAC3BG,OAAO,EAAE,CAAC,C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AAsB;IAC7BC,IAAI,EAAE,+CAA+C;IACrDC,OAAO,EAAE,CAAC,CAAC;IACXC,MAAM,EAAE,CAAC,CAAC;IACV,GAAG8D,gBAAgB;IACnB7D,IAAI,EAAET,aAAa,CAAC4E;EACtB,CAAC;AACH;AAEA,OAAO,SAASC,0BAA0BA,CACxCP,gBAAgD,GAAG,CAAC,CAAC,EAC9B;EACvB,OAAO;IACLnE,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,cAAc;IACpBC,KAAK,EAAE,wBAAwB;IAC/BC,IAAI,EAAE,oDAAoD;IAC1DC,OAAO,EAAE,CAAC,CAAC;IACXC,MAAM,EAAE,CAAC,CAAC;IACV,GAAG8D,gBAAgB;IACnB7D,IAAI,EAAET,aAAa,CAAC8E;EACtB,CAAC;AACH;AAEA,OAAO,SAASC,0CAA0CA,CACxDT,gBAAgE,GAAG,CAAC,CAAC,EAC9B;EACvC,OAAO;IACLnE,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,8BAA8B;IACpCC,KAAK,EAAE,4BAA4B;IACnCC,IAAI,EAAE,6FAA6F;IACnGC,OAAO,EAAE,CAAC,CAAC;IACX,GAAG+D,gBAAgB;IACnB7D,IAAI,EAAET,aAAa,CAACgF;EACtB,CAAC;AACH;AAEA,OAAO,SAASC,4BAA4BA,CAC1CX,gBAAkD,GAAG,CAAC,CAAC,EAC9B;EACzB,OAAO;IACLnE,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,qCAAqC;IAC5CC,IAAI,EAAE,kGAAkG;IACxGC,OAAO,EAAE,CAAC,CAAC;IACX,GAAG+D,gBAAgB;IACnB7D,IAAI,EAAET,aAAa,CAACkF;EACtB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"components.js","names":["ComponentType","buildTextFieldComponent","partialTextField","id","name","title","hint","options","schema","type","TextField","buildMultilineTextFieldComponent","partialMultilineTextField","MultilineTextField","buildYesNoFieldComponent","partialYesNoField","YesNoField","buildDeclarationFieldComponent","partialDeclarationField","content","DeclarationField","buildMonthYearFieldComponent","partialMonthYearField","MonthYearField","buildSelectFieldComponent","partialSelectField","list","SelectField","buildUkAddressFieldComponent","partialUkAddressField","UkAddressField","buildTelephoneNumberFieldComponent","partialTelephoneNumberField","TelephoneNumberField","buildEmailAddressFieldComponent","partialEmailAddressField","EmailAddressField","buildHtmlComponent","partialHtml","Html","buildInsetTextComponent","partialInsetText","InsetText","buildDetailsComponent","partialDetails","Details","buildListComponent","partialList","List","buildMarkdownComponent","partialMarkdown","Markdown","buildFileUploadComponent","partialFileUploadField","FileUploadField","buildAutoCompleteComponent","partialAutoCompleteField","AutocompleteField","buildRadioComponent","partialListComponent","RadiosField","buildCheckboxComponent","CheckboxesField","buildListItem","partialListItem","text","value","buildList","items","buildNumberFieldComponent","partialComponent","NumberField","buildDateComponent","DatePartsField","buildRadiosComponent","buildEastingNorthingFieldComponent","EastingNorthingField","buildLatLongFieldComponent","LatLongField","buildNationalGridFieldNumberFieldComponent","NationalGridFieldNumberField","buildOsGridRefFieldComponent","OsGridRefField"],"sources":["../../../src/__stubs__/components.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n type AutocompleteFieldComponent,\n type CheckboxesFieldComponent,\n type DatePartsFieldComponent,\n type DeclarationFieldComponent,\n type DetailsComponent,\n type EastingNorthingFieldComponent,\n type EmailAddressFieldComponent,\n type FileUploadFieldComponent,\n type HtmlComponent,\n type InsetTextComponent,\n type LatLongFieldComponent,\n type ListComponent,\n type MarkdownComponent,\n type MonthYearFieldComponent,\n type MultilineTextFieldComponent,\n type NationalGridFieldNumberFieldComponent,\n type NumberFieldComponent,\n type OsGridRefFieldComponent,\n type RadiosFieldComponent,\n type SelectFieldComponent,\n type TelephoneNumberFieldComponent,\n type TextFieldComponent,\n type UkAddressFieldComponent,\n type YesNoFieldComponent\n} from '~/src/components/types.js'\nimport { type Item, type List } from '~/src/form/form-definition/types.js'\n\n/**\n * @param {Partial<TextFieldComponent>} partialTextField\n * @returns {TextFieldComponent}\n */\nexport function buildTextFieldComponent(\n partialTextField: Partial<TextFieldComponent> = {}\n): TextFieldComponent {\n return {\n id: '407dd0d7-cce9-4f43-8e1f-7d89cb698875',\n name: 'TextField',\n title: 'Text field',\n hint: '',\n options: {},\n schema: {},\n ...partialTextField,\n type: ComponentType.TextField\n }\n}\n\nexport function buildMultilineTextFieldComponent(\n partialMultilineTextField: Partial<MultilineTextFieldComponent> = {}\n): MultilineTextFieldComponent {\n return {\n id: '72671f23-552e-4504-a06a-693e240880d5',\n name: 'MuTeCo',\n options: {},\n schema: {},\n title: 'Multiline TextField Component',\n ...partialMultilineTextField,\n type: ComponentType.MultilineTextField\n }\n}\n\nexport function buildYesNoFieldComponent(\n partialYesNoField: Partial<YesNoFieldComponent> = {}\n): YesNoFieldComponent {\n return {\n title: 'YesNo Field Component',\n id: 'be7f849c-47d8-4f1f-ba15-ab939dc70914',\n name: 'YesNoFieldComponent',\n options: {},\n ...partialYesNoField,\n type: ComponentType.YesNoField\n }\n}\n\nexport function buildDeclarationFieldComponent(\n partialDeclarationField: Partial<DeclarationFieldComponent> = {}\n): DeclarationFieldComponent {\n return {\n title: 'Declaration',\n id: 'f2a8c9e1-3d4f-4b5a-8c6d-1e2f3a4b5c6d',\n name: 'DeclarationFieldComponent',\n content: '',\n options: {},\n ...partialDeclarationField,\n type: ComponentType.DeclarationField\n }\n}\nexport function buildMonthYearFieldComponent(\n partialMonthYearField: Partial<MonthYearFieldComponent> = {}\n): MonthYearFieldComponent {\n return {\n id: 'd4e99aca-6d13-4c1a-a623-9e9e5b27d46d',\n title: 'MonthYearFieldComponent',\n name: 'MonthYearFieldComponent',\n options: {},\n ...partialMonthYearField,\n type: ComponentType.MonthYearField\n }\n}\nexport function buildSelectFieldComponent(\n partialSelectField: Partial<SelectFieldComponent> = {}\n): SelectFieldComponent {\n return {\n id: '7f219cf6-3e16-4549-b8df-789506682147',\n list: '',\n name: '',\n options: {},\n title: '',\n ...partialSelectField,\n type: ComponentType.SelectField\n }\n}\nexport function buildUkAddressFieldComponent(\n partialUkAddressField: Partial<UkAddressFieldComponent> = {}\n): UkAddressFieldComponent {\n return {\n id: 'a7cb7440-9095-44cd-9136-2914232722c8',\n title: 'UkAddressFieldComponent',\n name: 'UkAddressFieldComponent',\n options: {},\n ...partialUkAddressField,\n type: ComponentType.UkAddressField\n }\n}\nexport function buildTelephoneNumberFieldComponent(\n partialTelephoneNumberField: Partial<TelephoneNumberFieldComponent> = {}\n): TelephoneNumberFieldComponent {\n return {\n id: '69907916-beac-4faa-b469-656dad5edced',\n title: 'TelephoneNumberFieldComponent',\n name: 'TelephoneNumberFieldComponent',\n options: {},\n ...partialTelephoneNumberField,\n type: ComponentType.TelephoneNumberField\n }\n}\nexport function buildEmailAddressFieldComponent(\n partialEmailAddressField: Partial<EmailAddressFieldComponent> = {}\n): EmailAddressFieldComponent {\n return {\n id: '9dcf0781-bf34-48c8-b13b-d13050dc34d9',\n title: 'EmailAddressFieldComponent',\n name: 'EmailAddressFieldComponent',\n options: {},\n ...partialEmailAddressField,\n type: ComponentType.EmailAddressField\n }\n}\n\nexport function buildHtmlComponent(\n partialHtml: Partial<HtmlComponent> = {}\n): HtmlComponent {\n return {\n id: 'bac683ce-149e-4740-95aa-8289b35bc327',\n title: 'HtmlComponent',\n name: 'HtmlComponent',\n options: {},\n content: '',\n ...partialHtml,\n type: ComponentType.Html\n }\n}\nexport function buildInsetTextComponent(\n partialInsetText: Partial<InsetTextComponent> = {}\n): InsetTextComponent {\n return {\n id: '6b717151-1e86-42b2-97a9-2201b0676e47',\n title: 'InsetText Component',\n name: 'InsetTextComponent',\n content: '',\n options: {},\n ...partialInsetText,\n type: ComponentType.InsetText\n }\n}\nexport function buildDetailsComponent(\n partialDetails: Partial<DetailsComponent> = {}\n): DetailsComponent {\n return {\n id: '245d54df-bb1e-488e-82f6-8f1e42c197e6',\n title: 'Details Component',\n name: 'DetailsComponent',\n content: '',\n options: {},\n ...partialDetails,\n type: ComponentType.Details\n }\n}\nexport function buildListComponent(\n partialList: Partial<ListComponent> = {}\n): ListComponent {\n return {\n id: '62f17168-c2ef-4978-bd42-bdaa5704e25f',\n title: 'List Component',\n name: 'ListComponent',\n list: '',\n options: {},\n ...partialList,\n type: ComponentType.List\n }\n}\nexport function buildMarkdownComponent(\n partialMarkdown: Partial<MarkdownComponent> = {}\n): MarkdownComponent {\n return {\n id: '4a2dc88c-be1a-4277-aff8-04220de2e778',\n title: 'Markdown Component',\n name: 'MarkdownComponent',\n options: {},\n content: '',\n ...partialMarkdown,\n type: ComponentType.Markdown\n }\n}\n\n/**\n * @param {Partial<FileUploadFieldComponent>} partialFileUploadField\n * @returns {FileUploadFieldComponent}\n */\nexport function buildFileUploadComponent(\n partialFileUploadField: Partial<FileUploadFieldComponent> = {}\n): FileUploadFieldComponent {\n return {\n name: 'FileUploadField',\n title: 'File Upload Field',\n options: {},\n schema: {},\n ...partialFileUploadField,\n type: ComponentType.FileUploadField\n }\n}\n\n/**\n *\n * @param {Partial<AutocompleteFieldComponent>} partialAutoCompleteField\n * @returns {AutocompleteFieldComponent}\n */\nexport function buildAutoCompleteComponent(\n partialAutoCompleteField: Partial<AutocompleteFieldComponent> = {}\n): AutocompleteFieldComponent {\n return {\n name: 'AutoCompleteField',\n title: 'What languages do you speak?',\n list: 'AutoCompleteList',\n options: {},\n ...partialAutoCompleteField,\n type: ComponentType.AutocompleteField\n }\n}\n\n/**\n * @param {Partial<RadiosFieldComponent>} partialListComponent\n * @returns {RadiosFieldComponent}\n */\nexport function buildRadioComponent(\n partialListComponent: Partial<RadiosFieldComponent> = {}\n): RadiosFieldComponent {\n return {\n id: '34455d57-df37-4b69-a64f-6c3af0317ebe',\n name: 'RadioField',\n title: 'Which country do you live in?',\n list: 'RadioList',\n options: {},\n ...partialListComponent,\n type: ComponentType.RadiosField\n }\n}\n\n/**\n * @param {Partial<CheckboxesFieldComponent>} partialListComponent\n * @returns {CheckboxesFieldComponent}\n */\nexport function buildCheckboxComponent(\n partialListComponent: Partial<CheckboxesFieldComponent> = {}\n): CheckboxesFieldComponent {\n return {\n name: 'FellowshipOfTheRing',\n title: 'Which are your favourite characters from the fellowship?',\n list: 'CheckboxList',\n options: {},\n ...partialListComponent,\n type: ComponentType.CheckboxesField\n }\n}\n\n/**\n * Builder to create a stub List item\n * @param {Partial<Item>} partialListItem\n * @returns {Item}\n */\nexport function buildListItem(partialListItem: Partial<Item> = {}): Item {\n return {\n text: 'Javascript',\n value: 'javascript',\n ...partialListItem\n }\n}\n\n/**\n * @param {Partial<List>} partialList\n * @returns {List}\n */\nexport function buildList(partialList: Partial<List> = {}): List {\n return {\n title: 'Development language2',\n name: 'YhmNDD',\n type: 'string',\n items: [\n buildListItem({\n text: 'Javascript',\n value: 'javascript'\n }),\n buildListItem({\n text: 'TypeScript',\n value: 'typescript'\n }),\n buildListItem({\n text: 'Python',\n value: 'python'\n }),\n buildListItem({\n text: 'Haskell',\n value: 'haskell'\n }),\n buildListItem({\n text: 'Erlang',\n value: 'erlang'\n }),\n buildListItem({\n text: 'Java',\n value: 'java'\n })\n ],\n ...partialList\n }\n}\n\nexport function buildNumberFieldComponent(\n partialComponent: Partial<NumberFieldComponent> = {}\n): NumberFieldComponent {\n return {\n name: 'year',\n title: 'Year',\n options: {},\n schema: {},\n ...partialComponent,\n type: ComponentType.NumberField\n }\n}\n\nexport function buildDateComponent(\n partialComponent: Partial<DatePartsFieldComponent> = {}\n): DatePartsFieldComponent {\n return {\n name: 'bcdefg',\n title: 'Default title',\n options: {},\n ...partialComponent,\n type: ComponentType.DatePartsField\n }\n}\n\nexport function buildRadiosComponent(\n partialComponent: Partial<RadiosFieldComponent> = {}\n): RadiosFieldComponent {\n return {\n name: 'cdefgh',\n title: 'Default title',\n options: {},\n list: 'Default list Id ref',\n ...partialComponent,\n type: ComponentType.RadiosField\n }\n}\n\nexport function buildEastingNorthingFieldComponent(\n partialComponent: Partial<EastingNorthingFieldComponent> = {}\n): EastingNorthingFieldComponent {\n return {\n id: '1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p',\n name: 'EastingNorthingField',\n title: 'Easting and northing',\n hint: 'For example, Easting: 248741, Northing: 63688',\n options: {},\n schema: {},\n ...partialComponent,\n type: ComponentType.EastingNorthingField\n }\n}\n\nexport function buildLatLongFieldComponent(\n partialComponent: Partial<LatLongFieldComponent> = {}\n): LatLongFieldComponent {\n return {\n id: '2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q',\n name: 'LatLongField',\n title: 'Latitude and longitude',\n hint: 'For example, Latitude: 51.5074, Longitude: -0.1278',\n options: {},\n schema: {},\n ...partialComponent,\n type: ComponentType.LatLongField\n }\n}\n\nexport function buildNationalGridFieldNumberFieldComponent(\n partialComponent: Partial<NationalGridFieldNumberFieldComponent> = {}\n): NationalGridFieldNumberFieldComponent {\n return {\n id: '3c4d5e6f-7g8h-9i0j-1k2l-3m4n5o6p7q8r',\n name: 'NationalGridFieldNumberField',\n title: 'National Grid field number',\n hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589',\n options: {},\n ...partialComponent,\n type: ComponentType.NationalGridFieldNumberField\n }\n}\n\nexport function buildOsGridRefFieldComponent(\n partialComponent: Partial<OsGridRefFieldComponent> = {}\n): OsGridRefFieldComponent {\n return {\n id: '4d5e6f7g-8h9i-0j1k-2l3m-4n5o6p7q8r9s',\n name: 'OsGridRefField',\n title: 'Ordnance Survey (OS) grid reference',\n hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',\n options: {},\n ...partialComponent,\n type: ComponentType.OsGridRefField\n }\n}\n"],"mappings":"AAAA,SAASA,aAAa;AA6BtB;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,gBAA6C,GAAG,CAAC,CAAC,EAC9B;EACpB,OAAO;IACLC,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,WAAW;IACjBC,KAAK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ACLnE,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,8BAA8B;IACpCC,KAAK,EAAE,4BAA4B;IACnCC,IAAI,EAAE,6FAA6F;IACnGC,OAAO,EAAE,CAAC,CAAC;IACX,GAAG+D,gBAAgB;IACnB7D,IAAI,EAAET,aAAa,CAACgF;EACtB,CAAC;AACH;AAEA,OAAO,SAASC,4BAA4BA,CAC1CX,gBAAkD,GAAG,CAAC,CAAC,EAC9B;EACzB,OAAO;IACLnE,EAAE,EAAE,sCAAsC;IAC1CC,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,qCAAqC;IAC5CC,IAAI,EAAE,kHAAkH;IACxHC,OAAO,EAAE,CAAC,CAAC;IACX,GAAG+D,gBAAgB;IACnB7D,IAAI,EAAET,aAAa,CAACkF;EACtB,CAAC;AACH","ignoreList":[]}
@@ -139,7 +139,7 @@ export const ComponentTypes = Object.freeze([{
139
139
  name: 'OsGridRefField',
140
140
  title: 'Ordnance Survey (OS) grid reference',
141
141
  type: ComponentType.OsGridRefField,
142
- hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',
142
+ hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',
143
143
  options: {}
144
144
  }, {
145
145
  name: 'NationalGridFieldNumberField',
@@ -1 +1 @@
1
- {"version":3,"file":"component-types.js","names":["ComponentType","ComponentTypes","Object","freeze","name","title","type","TextField","hint","options","schema","MultilineTextField","YesNoField","DatePartsField","MonthYearField","SelectField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","FileUploadField","Html","content","InsetText","Markdown","Details","List","DeclarationField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","HiddenField"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\n/**\n * Defaults for creating new components\n */\nexport const ComponentTypes: readonly ComponentDef[] = Object.freeze([\n {\n name: 'TextField',\n title: 'Text field',\n type: ComponentType.TextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n title: 'Multiline text field',\n type: ComponentType.MultilineTextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n title: 'Yes/No field',\n type: ComponentType.YesNoField,\n hint: '',\n options: {}\n },\n {\n name: 'DatePartsField',\n title: 'Date field',\n type: ComponentType.DatePartsField,\n hint: '',\n options: {}\n },\n {\n name: 'MonthYearField',\n title: 'Month & year field',\n type: ComponentType.MonthYearField,\n hint: '',\n options: {}\n },\n {\n name: 'SelectField',\n title: 'Select field',\n type: ComponentType.SelectField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'AutocompleteField',\n title: 'Autocomplete field',\n type: ComponentType.AutocompleteField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'RadiosField',\n title: 'Radios field',\n type: ComponentType.RadiosField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'CheckboxesField',\n title: 'Checkboxes field',\n type: ComponentType.CheckboxesField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'NumberField',\n title: 'Number field',\n type: ComponentType.NumberField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n title: 'UK address field',\n type: ComponentType.UkAddressField,\n hint: '',\n options: {}\n },\n {\n name: 'TelephoneNumberField',\n title: 'Telephone number field',\n type: ComponentType.TelephoneNumberField,\n hint: '',\n options: {}\n },\n {\n name: 'EmailAddressField',\n title: 'Email address field',\n type: ComponentType.EmailAddressField,\n hint: 'For example, ‘name@example.com’',\n options: {}\n },\n {\n name: 'FileUploadField',\n title: 'File upload field',\n type: ComponentType.FileUploadField,\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n title: 'Html',\n type: ComponentType.Html,\n content: '',\n options: {}\n },\n {\n name: 'InsetText',\n title: 'Inset text',\n type: ComponentType.InsetText,\n content: ''\n },\n {\n name: 'Markdown',\n title: 'Markdown',\n type: ComponentType.Markdown,\n content: '',\n options: {}\n },\n {\n name: 'Details',\n title: 'Details',\n type: ComponentType.Details,\n content: '',\n options: {}\n },\n {\n name: 'List',\n title: 'List',\n type: ComponentType.List,\n list: '',\n options: {}\n },\n {\n name: 'DeclarationField',\n title: 'Declaration',\n type: ComponentType.DeclarationField,\n hint: '',\n content: '',\n options: {}\n },\n {\n name: 'EastingNorthingField',\n title: 'Easting and northing',\n type: ComponentType.EastingNorthingField,\n hint: 'For example, Easting: 248741, Northing: 63688',\n options: {}\n },\n {\n name: 'OsGridRefField',\n title: 'Ordnance Survey (OS) grid reference',\n type: ComponentType.OsGridRefField,\n hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',\n options: {}\n },\n {\n name: 'NationalGridFieldNumberField',\n title: 'National Grid field number',\n type: ComponentType.NationalGridFieldNumberField,\n hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589',\n options: {}\n },\n {\n name: 'LatLongField',\n title: 'Latitude and longitude',\n type: ComponentType.LatLongField,\n hint: 'For Great Britain, the latitude will be a number between 49.850 and 60.859. The longitude will be a number between -13.687 and 1.767',\n options: {}\n },\n {\n name: 'HiddenField',\n title: 'Hidden field',\n type: ComponentType.HiddenField,\n hint: '',\n options: {},\n schema: {}\n }\n])\n"],"mappings":"AAAA,SAASA,aAAa;AAGtB;AACA;AACA;AACA,OAAO,MAAMC,cAAuC,GAAGC,MAAM,CAACC,MAAM,CAAC,CACnE;EACEC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAEN,aAAa,CAACO,SAAS;EAC7BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,IAAI,EAAEN,aAAa,CAACW,kBAAkB;EACtCH,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AE,sIAAsI;EAC5IC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACoC,WAAW;EAC/B5B,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"component-types.js","names":["ComponentType","ComponentTypes","Object","freeze","name","title","type","TextField","hint","options","schema","MultilineTextField","YesNoField","DatePartsField","MonthYearField","SelectField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","FileUploadField","Html","content","InsetText","Markdown","Details","List","DeclarationField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","HiddenField"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\n/**\n * Defaults for creating new components\n */\nexport const ComponentTypes: readonly ComponentDef[] = Object.freeze([\n {\n name: 'TextField',\n title: 'Text field',\n type: ComponentType.TextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n title: 'Multiline text field',\n type: ComponentType.MultilineTextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n title: 'Yes/No field',\n type: ComponentType.YesNoField,\n hint: '',\n options: {}\n },\n {\n name: 'DatePartsField',\n title: 'Date field',\n type: ComponentType.DatePartsField,\n hint: '',\n options: {}\n },\n {\n name: 'MonthYearField',\n title: 'Month & year field',\n type: ComponentType.MonthYearField,\n hint: '',\n options: {}\n },\n {\n name: 'SelectField',\n title: 'Select field',\n type: ComponentType.SelectField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'AutocompleteField',\n title: 'Autocomplete field',\n type: ComponentType.AutocompleteField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'RadiosField',\n title: 'Radios field',\n type: ComponentType.RadiosField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'CheckboxesField',\n title: 'Checkboxes field',\n type: ComponentType.CheckboxesField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'NumberField',\n title: 'Number field',\n type: ComponentType.NumberField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n title: 'UK address field',\n type: ComponentType.UkAddressField,\n hint: '',\n options: {}\n },\n {\n name: 'TelephoneNumberField',\n title: 'Telephone number field',\n type: ComponentType.TelephoneNumberField,\n hint: '',\n options: {}\n },\n {\n name: 'EmailAddressField',\n title: 'Email address field',\n type: ComponentType.EmailAddressField,\n hint: 'For example, ‘name@example.com’',\n options: {}\n },\n {\n name: 'FileUploadField',\n title: 'File upload field',\n type: ComponentType.FileUploadField,\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n title: 'Html',\n type: ComponentType.Html,\n content: '',\n options: {}\n },\n {\n name: 'InsetText',\n title: 'Inset text',\n type: ComponentType.InsetText,\n content: ''\n },\n {\n name: 'Markdown',\n title: 'Markdown',\n type: ComponentType.Markdown,\n content: '',\n options: {}\n },\n {\n name: 'Details',\n title: 'Details',\n type: ComponentType.Details,\n content: '',\n options: {}\n },\n {\n name: 'List',\n title: 'List',\n type: ComponentType.List,\n list: '',\n options: {}\n },\n {\n name: 'DeclarationField',\n title: 'Declaration',\n type: ComponentType.DeclarationField,\n hint: '',\n content: '',\n options: {}\n },\n {\n name: 'EastingNorthingField',\n title: 'Easting and northing',\n type: ComponentType.EastingNorthingField,\n hint: 'For example, Easting: 248741, Northing: 63688',\n options: {}\n },\n {\n name: 'OsGridRefField',\n title: 'Ordnance Survey (OS) grid reference',\n type: ComponentType.OsGridRefField,\n hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',\n options: {}\n },\n {\n name: 'NationalGridFieldNumberField',\n title: 'National Grid field number',\n type: ComponentType.NationalGridFieldNumberField,\n hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589',\n options: {}\n },\n {\n name: 'LatLongField',\n title: 'Latitude and longitude',\n type: ComponentType.LatLongField,\n hint: 'For Great Britain, the latitude will be a number between 49.850 and 60.859. The longitude will be a number between -13.687 and 1.767',\n options: {}\n },\n {\n name: 'HiddenField',\n title: 'Hidden field',\n type: ComponentType.HiddenField,\n hint: '',\n options: {},\n schema: {}\n }\n])\n"],"mappings":"AAAA,SAASA,aAAa;AAGtB;AACA;AACA;AACA,OAAO,MAAMC,cAAuC,GAAGC,MAAM,CAACC,MAAM,CAAC,CACnE;EACEC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAEN,aAAa,CAACO,SAAS;EAC7BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,IAAI,EAAEN,aAAa,CAACW,kBAAkB;EACtCH,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACY,UAAU;EAC9BJ,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAEN,aAAa,CAACa,cAAc;EAClCL,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,oBAAoB;EAC3BC,IAAI,EAAEN,aAAa,CAACc,cAAc;EAClCN,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;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AAO,EAAE,EAAE;EACXjB,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAE,sBAAsB;EAC7BC,IAAI,EAAEN,aAAa,CAACgC,oBAAoB;EACxCxB,IAAI,EAAE,+CAA+C;EACrDC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,qCAAqC;EAC5CC,IAAI,EAAEN,aAAa,CAACiC,cAAc;EAClCzB,IAAI,EAAE,kHAAkH;EACxHC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,8BAA8B;EACpCC,KAAK,EAAE,4BAA4B;EACnCC,IAAI,EAAEN,aAAa,CAACkC,4BAA4B;EAChD1B,IAAI,EAAE,6FAA6F;EACnGC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,wBAAwB;EAC/BC,IAAI,EAAEN,aAAa,CAACmC,YAAY;EAChC3B,IAAI,EAAE,sIAAsI;EAC5IC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACoC,WAAW;EAC/B5B,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF,CAAC","ignoreList":[]}
@@ -34,6 +34,16 @@ export class SummaryPageController extends PreviewPageControllerBase {
34
34
  * @private
35
35
  */
36
36
  _isConfirmationEmailSettingsPanel = false;
37
+ /**
38
+ * @type {SectionForPreview[]}
39
+ * @private
40
+ */
41
+ _sections = [];
42
+ /**
43
+ * @type {Array<{ title: string }>}
44
+ * @private
45
+ */
46
+ _unassignedPages = [];
37
47
 
38
48
  /**
39
49
  * @param {SummaryPageElements} elements
@@ -52,6 +62,8 @@ export class SummaryPageController extends PreviewPageControllerBase {
52
62
  this._showConfirmationEmail = elements.showConfirmationEmail;
53
63
  this._guidanceComponent.content = elements.guidance;
54
64
  this._isConfirmationEmailSettingsPanel = elements.isConfirmationEmailSettingsPanel;
65
+ this._sections = elements.sections ?? [];
66
+ this._unassignedPages = elements.unassignedPages ?? [];
55
67
  }
56
68
 
57
69
  /**
@@ -145,6 +157,20 @@ export class SummaryPageController extends PreviewPageControllerBase {
145
157
  return this._showConfirmationEmail;
146
158
  }
147
159
 
160
+ /**
161
+ * @returns {SectionForPreview[]}
162
+ */
163
+ get sections() {
164
+ return this._sections;
165
+ }
166
+
167
+ /**
168
+ * @returns {Array<{ title: string }>}
169
+ */
170
+ get unassignedPages() {
171
+ return this._unassignedPages;
172
+ }
173
+
148
174
  /**
149
175
  * @returns {Markdown[]}
150
176
  * @protected
@@ -171,7 +197,7 @@ export class SummaryPageController extends PreviewPageControllerBase {
171
197
  /**
172
198
  * @import { ComponentDef, ContentComponentsDef, ListComponent, FormComponentsDef } from '~/src/components/types.js'
173
199
  * @import { FormDefinition } from '~/src/form/form-definition/types.js'
174
- * @import { PageRenderer, PagePreviewBaseElements, SummaryPageElements } from '~/src/form/form-editor/preview/types.js'
200
+ * @import { PageRenderer, PagePreviewBaseElements, SummaryPageElements, SectionForPreview } from '~/src/form/form-editor/preview/types.js'
175
201
  * @import { SummaryRowActionItem, SummaryRow } from '~/src/form/form-editor/macros/types.js'
176
202
  * @import { Markdown } from '~/src/form/form-editor/preview/markdown.js'
177
203
  */
@@ -1 +1 @@
1
- {"version":3,"file":"summary-page-controller.js","names":["hasFormField","HIGHLIGHT_CLASS","PreviewPageControllerBase","hasComponents","EXAMPLE_TEXT","SummaryPageController","_pageTemplate","PATH","_guidanceComponent","createGuidanceComponent","_componentDefs","_makeDeclaration","_showConfirmationEmail","_isConfirmationEmailSettingsPanel","constructor","elements","formDefinition","renderer","pages","flatMap","page","components","filter","declaration","showConfirmationEmail","content","guidance","isConfirmationEmailSettingsPanel","componentRows","rows","map","component","summaryRowHeading","shortDescription","key","text","value","actions","items","href","visuallyHiddenText","pageTitle","classes","guidanceHighlighted","_highlighted","_guidanceText","length","declarationText","guidanceText","setMakeDeclaration","render","unsetMakeDeclaration","makeDeclaration","highlightDeclaration","highlightGuidance","unhighlightDeclaration","clearHighlight","_getGuidanceComponents","buttonText","setShowConfirmationEmail","unsetShowConfirmationEmail"],"sources":["../../../../../../src/form/form-editor/preview/controller/summary-page-controller.js"],"sourcesContent":["import { hasFormField } from '~/src/components/helpers.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { PreviewPageControllerBase } from '~/src/form/form-editor/preview/controller/page-controller-base.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst EXAMPLE_TEXT = 'Answer goes here'\n\nexport class SummaryPageController extends PreviewPageControllerBase {\n /**\n * @type {string}\n * @protected\n */\n _pageTemplate = PreviewPageControllerBase.PATH + 'summary-controller.njk'\n /**\n * @type {Markdown}\n * @protected\n */\n _guidanceComponent = PreviewPageControllerBase.createGuidanceComponent(false)\n /**\n * @type {FormComponentsDef[]}\n * @private\n */\n _componentDefs = []\n /**\n * @type {boolean}\n * @private\n */\n _makeDeclaration = false\n /**\n * @type {boolean}\n * @private\n */\n _showConfirmationEmail = false\n /**\n * @type {boolean}\n * @private\n */\n _isConfirmationEmailSettingsPanel = false\n\n /**\n * @param {SummaryPageElements} elements\n * @param {FormDefinition} formDefinition\n * @param {PageRenderer} renderer\n */\n constructor(elements, formDefinition, renderer) {\n super(elements, renderer)\n this._componentDefs = formDefinition.pages.flatMap((page) => {\n if (hasComponents(page)) {\n return page.components.filter(hasFormField)\n }\n return []\n })\n this._makeDeclaration = elements.declaration\n this._showConfirmationEmail = elements.showConfirmationEmail\n this._guidanceComponent.content = elements.guidance\n this._isConfirmationEmailSettingsPanel =\n elements.isConfirmationEmailSettingsPanel\n }\n\n /**\n * @returns {{ rows: SummaryRow[] }}\n */\n get componentRows() {\n const rows = this._componentDefs.map((component) => {\n const summaryRowHeading = component.shortDescription ?? ''\n return {\n key: { text: summaryRowHeading },\n value: { text: EXAMPLE_TEXT },\n actions: {\n items: [\n { href: '#', text: 'Change', visuallyHiddenText: summaryRowHeading }\n ]\n }\n }\n })\n return {\n rows\n }\n }\n\n /**\n * @returns {{ text: string; classes: string }}\n */\n get pageTitle() {\n return {\n text: 'Check your answers before sending your form',\n classes: ''\n }\n }\n\n get guidance() {\n if (!this._makeDeclaration) {\n return {\n classes: '',\n text: ''\n }\n }\n const guidanceHighlighted = this._highlighted === 'guidance'\n const classes = guidanceHighlighted ? HIGHLIGHT_CLASS : ''\n let text = this._guidanceText.length ? this._guidanceText : ''\n\n if (!text.length && guidanceHighlighted) {\n text = 'Declaration text'\n }\n return {\n text,\n classes\n }\n }\n\n /**\n * @param {string} declarationText\n */\n set declarationText(declarationText) {\n this.guidanceText = declarationText\n }\n\n get declarationText() {\n return this.guidanceText\n }\n\n get declaration() {\n return this.guidance\n }\n\n get isConfirmationEmailSettingsPanel() {\n return this._isConfirmationEmailSettingsPanel\n }\n\n setMakeDeclaration() {\n this._makeDeclaration = true\n this.render()\n }\n\n unsetMakeDeclaration() {\n this._makeDeclaration = false\n this.render()\n }\n\n get makeDeclaration() {\n return this._makeDeclaration\n }\n\n highlightDeclaration() {\n this.highlightGuidance()\n }\n\n unhighlightDeclaration() {\n this.clearHighlight()\n }\n\n get showConfirmationEmail() {\n return this._showConfirmationEmail\n }\n\n /**\n * @returns {Markdown[]}\n * @protected\n */\n _getGuidanceComponents() {\n if (!this._makeDeclaration) {\n return []\n }\n return super._getGuidanceComponents()\n }\n\n get buttonText() {\n return this.makeDeclaration ? 'Accept and send' : 'Send'\n }\n\n setShowConfirmationEmail() {\n this._showConfirmationEmail = true\n this.render()\n }\n\n unsetShowConfirmationEmail() {\n this._showConfirmationEmail = false\n this.render()\n }\n}\n\n/**\n * @import { ComponentDef, ContentComponentsDef, ListComponent, FormComponentsDef } from '~/src/components/types.js'\n * @import { FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { PageRenderer, PagePreviewBaseElements, SummaryPageElements } from '~/src/form/form-editor/preview/types.js'\n * @import { SummaryRowActionItem, SummaryRow } from '~/src/form/form-editor/macros/types.js'\n * @import { Markdown } from '~/src/form/form-editor/preview/markdown.js'\n */\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SAASC,eAAe;AACxB,SAASC,yBAAyB;AAClC,SAASC,aAAa;AAEtB,MAAMC,YAAY,GAAG,kBAAkB;AAEvC,OAAO,MAAMC,qBAAqB,SAASH,yBAAyB,CAAC;EACnE;AACF;AACA;AACA;EACEI,aAAa,GAAGJ,yBAAyB,CAACK,IAAI,GAAG,wBAAwB;EACzE;AACF;AACA;AACA;EACEC,kBAAkB,GAAGN,yBAAyB,CAACO,uBAAuB,CAAC,KAAK,CAAC;EAC7E;AACF;AACA;AACA;EACEC,cAAc,GAAG,EAAE;EACnB;AACF;AACA;AACA;EACEC,gBAAgB,GAAG,KAAK;EACxB;AACF;AACA;AACA;EACEC,sBAAsB,GAAG,KAAK;EAC9B;AACF;AACA;AACA;EACEC,iCAAiC,GAAG,KAAK;;EAEzC;AACF;AACA;AACA;AACA;EACEC,WAAWA,CAACC,QAAQ,EAAEC,cAAc,EAAEC,QAAQ,EAAE;IAC9C,KAAK,CAACF,QAAQ,EAAEE,QAAQ,CAAC;IACzB,IAAI,CAACP,cAAc,GAAGM,cAAc,CAACE,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;MAC3D,IAAIjB,aAAa,CAACiB,IAAI,CAAC,EAAE;QACvB,OAAOA,IAAI,CAACC,UAAU,CAACC,MAAM,CAACtB,YAAY,CAAC;MAC7C;MACA,OAAO,EAAE;IACX,CAAC,CAAC;IACF,IAAI,CAACW,gBAAgB,GAAGI,QAAQ,CAACQ,WAAW;IAC5C,IAAI,CAACX,sBAAsB,GAAGG,QAAQ,CAACS,qBAAqB;IAC5D,IAAI,CAAChB,kBAAkB,CAACiB,OAAO,GAAGV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CAAChD,sBAAsB,GAAG,KAAK;IACnC,IAAI,CAACsC,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"summary-page-controller.js","names":["hasFormField","HIGHLIGHT_CLASS","PreviewPageControllerBase","hasComponents","EXAMPLE_TEXT","SummaryPageController","_pageTemplate","PATH","_guidanceComponent","createGuidanceComponent","_componentDefs","_makeDeclaration","_showConfirmationEmail","_isConfirmationEmailSettingsPanel","_sections","_unassignedPages","constructor","elements","formDefinition","renderer","pages","flatMap","page","components","filter","declaration","showConfirmationEmail","content","guidance","isConfirmationEmailSettingsPanel","sections","unassignedPages","componentRows","rows","map","component","summaryRowHeading","shortDescription","key","text","value","actions","items","href","visuallyHiddenText","pageTitle","classes","guidanceHighlighted","_highlighted","_guidanceText","length","declarationText","guidanceText","setMakeDeclaration","render","unsetMakeDeclaration","makeDeclaration","highlightDeclaration","highlightGuidance","unhighlightDeclaration","clearHighlight","_getGuidanceComponents","buttonText","setShowConfirmationEmail","unsetShowConfirmationEmail"],"sources":["../../../../../../src/form/form-editor/preview/controller/summary-page-controller.js"],"sourcesContent":["import { hasFormField } from '~/src/components/helpers.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { PreviewPageControllerBase } from '~/src/form/form-editor/preview/controller/page-controller-base.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst EXAMPLE_TEXT = 'Answer goes here'\n\nexport class SummaryPageController extends PreviewPageControllerBase {\n /**\n * @type {string}\n * @protected\n */\n _pageTemplate = PreviewPageControllerBase.PATH + 'summary-controller.njk'\n /**\n * @type {Markdown}\n * @protected\n */\n _guidanceComponent = PreviewPageControllerBase.createGuidanceComponent(false)\n /**\n * @type {FormComponentsDef[]}\n * @private\n */\n _componentDefs = []\n /**\n * @type {boolean}\n * @private\n */\n _makeDeclaration = false\n /**\n * @type {boolean}\n * @private\n */\n _showConfirmationEmail = false\n /**\n * @type {boolean}\n * @private\n */\n _isConfirmationEmailSettingsPanel = false\n /**\n * @type {SectionForPreview[]}\n * @private\n */\n _sections = []\n /**\n * @type {Array<{ title: string }>}\n * @private\n */\n _unassignedPages = []\n\n /**\n * @param {SummaryPageElements} elements\n * @param {FormDefinition} formDefinition\n * @param {PageRenderer} renderer\n */\n constructor(elements, formDefinition, renderer) {\n super(elements, renderer)\n this._componentDefs = formDefinition.pages.flatMap((page) => {\n if (hasComponents(page)) {\n return page.components.filter(hasFormField)\n }\n return []\n })\n this._makeDeclaration = elements.declaration\n this._showConfirmationEmail = elements.showConfirmationEmail\n this._guidanceComponent.content = elements.guidance\n this._isConfirmationEmailSettingsPanel =\n elements.isConfirmationEmailSettingsPanel\n this._sections = elements.sections ?? []\n this._unassignedPages = elements.unassignedPages ?? []\n }\n\n /**\n * @returns {{ rows: SummaryRow[] }}\n */\n get componentRows() {\n const rows = this._componentDefs.map((component) => {\n const summaryRowHeading = component.shortDescription ?? ''\n return {\n key: { text: summaryRowHeading },\n value: { text: EXAMPLE_TEXT },\n actions: {\n items: [\n { href: '#', text: 'Change', visuallyHiddenText: summaryRowHeading }\n ]\n }\n }\n })\n return {\n rows\n }\n }\n\n /**\n * @returns {{ text: string; classes: string }}\n */\n get pageTitle() {\n return {\n text: 'Check your answers before sending your form',\n classes: ''\n }\n }\n\n get guidance() {\n if (!this._makeDeclaration) {\n return {\n classes: '',\n text: ''\n }\n }\n const guidanceHighlighted = this._highlighted === 'guidance'\n const classes = guidanceHighlighted ? HIGHLIGHT_CLASS : ''\n let text = this._guidanceText.length ? this._guidanceText : ''\n\n if (!text.length && guidanceHighlighted) {\n text = 'Declaration text'\n }\n return {\n text,\n classes\n }\n }\n\n /**\n * @param {string} declarationText\n */\n set declarationText(declarationText) {\n this.guidanceText = declarationText\n }\n\n get declarationText() {\n return this.guidanceText\n }\n\n get declaration() {\n return this.guidance\n }\n\n get isConfirmationEmailSettingsPanel() {\n return this._isConfirmationEmailSettingsPanel\n }\n\n setMakeDeclaration() {\n this._makeDeclaration = true\n this.render()\n }\n\n unsetMakeDeclaration() {\n this._makeDeclaration = false\n this.render()\n }\n\n get makeDeclaration() {\n return this._makeDeclaration\n }\n\n highlightDeclaration() {\n this.highlightGuidance()\n }\n\n unhighlightDeclaration() {\n this.clearHighlight()\n }\n\n get showConfirmationEmail() {\n return this._showConfirmationEmail\n }\n\n /**\n * @returns {SectionForPreview[]}\n */\n get sections() {\n return this._sections\n }\n\n /**\n * @returns {Array<{ title: string }>}\n */\n get unassignedPages() {\n return this._unassignedPages\n }\n\n /**\n * @returns {Markdown[]}\n * @protected\n */\n _getGuidanceComponents() {\n if (!this._makeDeclaration) {\n return []\n }\n return super._getGuidanceComponents()\n }\n\n get buttonText() {\n return this.makeDeclaration ? 'Accept and send' : 'Send'\n }\n\n setShowConfirmationEmail() {\n this._showConfirmationEmail = true\n this.render()\n }\n\n unsetShowConfirmationEmail() {\n this._showConfirmationEmail = false\n this.render()\n }\n}\n\n/**\n * @import { ComponentDef, ContentComponentsDef, ListComponent, FormComponentsDef } from '~/src/components/types.js'\n * @import { FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { PageRenderer, PagePreviewBaseElements, SummaryPageElements, SectionForPreview } from '~/src/form/form-editor/preview/types.js'\n * @import { SummaryRowActionItem, SummaryRow } from '~/src/form/form-editor/macros/types.js'\n * @import { Markdown } from '~/src/form/form-editor/preview/markdown.js'\n */\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SAASC,eAAe;AACxB,SAASC,yBAAyB;AAClC,SAASC,aAAa;AAEtB,MAAMC,YAAY,GAAG,kBAAkB;AAEvC,OAAO,MAAMC,qBAAqB,SAASH,yBAAyB,CAAC;EACnE;AACF;AACA;AACA;EACEI,aAAa,GAAGJ,yBAAyB,CAACK,IAAI,GAAG,wBAAwB;EACzE;AACF;AACA;AACA;EACEC,kBAAkB,GAAGN,yBAAyB,CAACO,uBAAuB,CAAC,KAAK,CAAC;EAC7E;AACF;AACA;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
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type PagePreviewPanelMacro,\n type QuestionBaseModel\n} from '~/src/form/form-editor/macros/types.js'\nimport { type AutocompleteQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type SelectSortableQuestion } from '~/src/form/form-editor/preview/select-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { type ListElement } from '~/src/form/form-editor/types.js'\nexport { type QuestionBaseModel } from '~/src/form/form-editor/macros/types.js'\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n userClasses: string\n items: ListElement[]\n content: string\n attributes?: Record<string, string>\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n isPageHeading?: boolean\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | HTMLTextAreaElement | null,\n (target: HTMLInputElement | HTMLTextAreaElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface DomElementsBase {\n readonly values?: BaseSettings\n autocompleteOptions?: string\n setPreviewHTML(value: string): void\n setPreviewDOM(element: HTMLElement): void\n}\n\nexport interface QuestionElements extends DomElementsBase {\n readonly values: BaseSettings\n}\n\nexport interface AutocompleteElements extends QuestionElements {\n autocompleteOptions: string\n}\n\nexport interface NumberSettings extends BaseSettings {\n prefix: string\n suffix: string\n}\n\nexport interface DeclarationSettings extends BaseSettings {\n declarationText: string\n}\n\nexport interface DeclarationElements extends DomElementsBase {\n readonly values: DeclarationSettings\n}\n\nexport interface UkAddressSettings extends BaseSettings {\n usePostcodeLookup?: boolean\n}\n\nexport interface UkAddressElements extends DomElementsBase {\n readonly values: UkAddressSettings\n}\n\nexport interface NumberElements extends DomElementsBase {\n readonly values: NumberSettings\n}\n\nexport interface LocationSettings extends BaseSettings {\n instructionText: string\n}\n\nexport interface LocationElements extends DomElementsBase {\n readonly values: LocationSettings\n}\n\nexport interface LocationFieldModel extends QuestionBaseModel {\n userClasses: string\n fieldset: {\n legend: {\n text: string\n classes: string\n }\n }\n instructionText: string\n details: {\n classes: string\n }\n}\n\nexport interface RenderBase {\n render(questionTemplate: string, renderContext: RenderContext): void\n}\n\nexport interface QuestionRenderContext {\n model: QuestionBaseModel\n}\n\nexport interface PageRenderContext {\n params: PagePreviewPanelMacro\n}\n\nexport type RenderContext = QuestionRenderContext | PageRenderContext\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface PageRenderer {\n render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void\n}\n\nexport type Renderer = QuestionRenderer | PageRenderer\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport interface PagePreviewBaseElements {\n heading: string\n guidance: string\n}\n\nexport interface PageOverviewElements extends PagePreviewBaseElements {\n addHeading: boolean\n repeatQuestion: string | undefined\n hasRepeater: boolean\n}\n\nexport interface SummaryPageElements extends PagePreviewBaseElements {\n declaration: boolean\n showConfirmationEmail: boolean\n isConfirmationEmailSettingsPanel: boolean\n}\n\nexport interface SummaryPageInitialState {\n showConfirmationEmail: boolean\n declarationText: string\n needDeclaration: boolean\n isConfirmationEmailSettingsPanel: boolean\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | SelectSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n | AutocompleteQuestion\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type PagePreviewPanelMacro,\n type QuestionBaseModel\n} from '~/src/form/form-editor/macros/types.js'\nimport { type AutocompleteQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type SelectSortableQuestion } from '~/src/form/form-editor/preview/select-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { type ListElement } from '~/src/form/form-editor/types.js'\nexport { type QuestionBaseModel } from '~/src/form/form-editor/macros/types.js'\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n userClasses: string\n items: ListElement[]\n content: string\n attributes?: Record<string, string>\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n isPageHeading?: boolean\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | HTMLTextAreaElement | null,\n (target: HTMLInputElement | HTMLTextAreaElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface DomElementsBase {\n readonly values?: BaseSettings\n autocompleteOptions?: string\n setPreviewHTML(value: string): void\n setPreviewDOM(element: HTMLElement): void\n}\n\nexport interface QuestionElements extends DomElementsBase {\n readonly values: BaseSettings\n}\n\nexport interface AutocompleteElements extends QuestionElements {\n autocompleteOptions: string\n}\n\nexport interface NumberSettings extends BaseSettings {\n prefix: string\n suffix: string\n}\n\nexport interface DeclarationSettings extends BaseSettings {\n declarationText: string\n}\n\nexport interface DeclarationElements extends DomElementsBase {\n readonly values: DeclarationSettings\n}\n\nexport interface UkAddressSettings extends BaseSettings {\n usePostcodeLookup?: boolean\n}\n\nexport interface UkAddressElements extends DomElementsBase {\n readonly values: UkAddressSettings\n}\n\nexport interface NumberElements extends DomElementsBase {\n readonly values: NumberSettings\n}\n\nexport interface LocationSettings extends BaseSettings {\n instructionText: string\n}\n\nexport interface LocationElements extends DomElementsBase {\n readonly values: LocationSettings\n}\n\nexport interface LocationFieldModel extends QuestionBaseModel {\n userClasses: string\n fieldset: {\n legend: {\n text: string\n classes: string\n }\n }\n instructionText: string\n details: {\n classes: string\n }\n}\n\nexport interface RenderBase {\n render(questionTemplate: string, renderContext: RenderContext): void\n}\n\nexport interface QuestionRenderContext {\n model: QuestionBaseModel\n}\n\nexport interface PageRenderContext {\n params: PagePreviewPanelMacro\n}\n\nexport type RenderContext = QuestionRenderContext | PageRenderContext\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface PageRenderer {\n render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void\n}\n\nexport type Renderer = QuestionRenderer | PageRenderer\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport interface PagePreviewBaseElements {\n heading: string\n guidance: string\n}\n\nexport interface PageOverviewElements extends PagePreviewBaseElements {\n addHeading: boolean\n repeatQuestion: string | undefined\n hasRepeater: boolean\n}\n\nexport interface SectionForPreview {\n name: string\n title: string\n pages: { title: string }[]\n}\n\nexport interface SummaryPageElements extends PagePreviewBaseElements {\n declaration: boolean\n showConfirmationEmail: boolean\n isConfirmationEmailSettingsPanel: boolean\n sections?: SectionForPreview[]\n unassignedPages?: { title: string }[]\n}\n\nexport interface SummaryPageInitialState {\n showConfirmationEmail: boolean\n declarationText: string\n needDeclaration: boolean\n isConfirmationEmailSettingsPanel: boolean\n sections?: SectionForPreview[]\n unassignedPages?: { title: string }[]\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | SelectSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n | AutocompleteQuestion\n"],"mappings":"","ignoreList":[]}
@@ -25,6 +25,16 @@ export class SummaryPageController extends PreviewPageControllerBase {
25
25
  * @private
26
26
  */
27
27
  private _isConfirmationEmailSettingsPanel;
28
+ /**
29
+ * @type {SectionForPreview[]}
30
+ * @private
31
+ */
32
+ private _sections;
33
+ /**
34
+ * @type {Array<{ title: string }>}
35
+ * @private
36
+ */
37
+ private _unassignedPages;
28
38
  /**
29
39
  * @returns {{ rows: SummaryRow[] }}
30
40
  */
@@ -47,12 +57,23 @@ export class SummaryPageController extends PreviewPageControllerBase {
47
57
  highlightDeclaration(): void;
48
58
  unhighlightDeclaration(): void;
49
59
  get showConfirmationEmail(): boolean;
60
+ /**
61
+ * @returns {SectionForPreview[]}
62
+ */
63
+ get sections(): SectionForPreview[];
64
+ /**
65
+ * @returns {Array<{ title: string }>}
66
+ */
67
+ get unassignedPages(): Array<{
68
+ title: string;
69
+ }>;
50
70
  get buttonText(): "Accept and send" | "Send";
51
71
  setShowConfirmationEmail(): void;
52
72
  unsetShowConfirmationEmail(): void;
53
73
  }
54
74
  import { PreviewPageControllerBase } from '../../../../form/form-editor/preview/controller/page-controller-base.js';
55
75
  import type { SummaryRow } from '../../../../form/form-editor/macros/types.js';
76
+ import type { SectionForPreview } from '../../../../form/form-editor/preview/types.js';
56
77
  import type { SummaryPageElements } from '../../../../form/form-editor/preview/types.js';
57
78
  import type { FormDefinition } from '../../../../form/form-definition/types.js';
58
79
  import type { PageRenderer } from '../../../../form/form-editor/preview/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"summary-page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/summary-page-controller.js"],"names":[],"mappings":"AAOA;IAgCE;;;;OAIG;IACH,sBAJW,mBAAmB,kBACnB,cAAc,YACd,YAAY,EAetB;IAvCD;;;OAGG;IACH,uBAAmB;IACnB;;;OAGG;IACH,yBAAwB;IACxB;;;OAGG;IACH,+BAA8B;IAC9B;;;OAGG;IACH,0CAAyC;IAsBzC;;OAEG;IACH,qBAFa;QAAE,IAAI,EAAE,UAAU,EAAE,CAAA;KAAE,CAkBlC;IAgCD;;OAEG;IACH,qCAFW,MAAM,EAIhB;IAED,uBANW,MAAM,CAQhB;IAED;;;MAEC;IAED,gDAEC;IAED,2BAGC;IAED,6BAGC;IAED,+BAEC;IAED,6BAEC;IAED,+BAEC;IAED,qCAEC;IAaD,6CAEC;IAED,iCAGC;IAED,mCAGC;CACF;0CAjLyC,mEAAmE;gCAuLxD,wCAAwC;yCADd,yCAAyC;oCADrF,qCAAqC;kCACO,yCAAyC"}
1
+ {"version":3,"file":"summary-page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/summary-page-controller.js"],"names":[],"mappings":"AAOA;IA0CE;;;;OAIG;IACH,sBAJW,mBAAmB,kBACnB,cAAc,YACd,YAAY,EAiBtB;IAnDD;;;OAGG;IACH,uBAAmB;IACnB;;;OAGG;IACH,yBAAwB;IACxB;;;OAGG;IACH,+BAA8B;IAC9B;;;OAGG;IACH,0CAAyC;IACzC;;;OAGG;IACH,kBAAc;IACd;;;OAGG;IACH,yBAAqB;IAwBrB;;OAEG;IACH,qBAFa;QAAE,IAAI,EAAE,UAAU,EAAE,CAAA;KAAE,CAkBlC;IAgCD;;OAEG;IACH,qCAFW,MAAM,EAIhB;IAED,uBANW,MAAM,CAQhB;IAED;;;MAEC;IAED,gDAEC;IAED,2BAGC;IAED,6BAGC;IAED,+BAEC;IAED,6BAEC;IAED,+BAEC;IAED,qCAEC;IAED;;OAEG;IACH,gBAFa,iBAAiB,EAAE,CAI/B;IAED;;OAEG;IACH,uBAFa,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAIpC;IAaD,6CAEC;IAED,iCAGC;IAED,mCAGC;CACF;0CA3MyC,mEAAmE;gCAiNxD,wCAAwC;uCADK,yCAAyC;yCAAzC,yCAAyC;oCADxG,qCAAqC;kCAC0B,yCAAyC"}
@@ -118,16 +118,31 @@ export interface PageOverviewElements extends PagePreviewBaseElements {
118
118
  repeatQuestion: string | undefined;
119
119
  hasRepeater: boolean;
120
120
  }
121
+ export interface SectionForPreview {
122
+ name: string;
123
+ title: string;
124
+ pages: {
125
+ title: string;
126
+ }[];
127
+ }
121
128
  export interface SummaryPageElements extends PagePreviewBaseElements {
122
129
  declaration: boolean;
123
130
  showConfirmationEmail: boolean;
124
131
  isConfirmationEmailSettingsPanel: boolean;
132
+ sections?: SectionForPreview[];
133
+ unassignedPages?: {
134
+ title: string;
135
+ }[];
125
136
  }
126
137
  export interface SummaryPageInitialState {
127
138
  showConfirmationEmail: boolean;
128
139
  declarationText: string;
129
140
  needDeclaration: boolean;
130
141
  isConfirmationEmailSettingsPanel: boolean;
142
+ sections?: SectionForPreview[];
143
+ unassignedPages?: {
144
+ title: string;
145
+ }[];
131
146
  }
132
147
  export type PreviewQuestion = DateInputQuestion | EmailAddressQuestion | ListSortableQuestion | LongAnswerQuestion | PhoneNumberQuestion | Question | RadioSortableQuestion | SelectSortableQuestion | ShortAnswerQuestion | UkAddressQuestion | AutocompleteQuestion;
133
148
  //# sourceMappingURL=types.d.ts.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BAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,mBAAoB,SAAQ,uBAAuB;IAClE,WAAW,EAAE,OAAO,CAAA;IACpB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,gCAAgC,EAAE,OAAO,CAAA;IACzC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,qBAAqB,EAAE,OAAO,CAAA;IAC9B,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,OAAO,CAAA;IACxB,gCAAgC,EAAE,OAAO,CAAA;IACzC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACtC;AAED,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.585",
3
+ "version": "3.0.587",
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
  "types": "dist/types/index.d.ts",
@@ -425,7 +425,7 @@ export function buildOsGridRefFieldComponent(
425
425
  id: '4d5e6f7g-8h9i-0j1k-2l3m-4n5o6p7q8r9s',
426
426
  name: 'OsGridRefField',
427
427
  title: 'Ordnance Survey (OS) grid reference',
428
- hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',
428
+ hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',
429
429
  options: {},
430
430
  ...partialComponent,
431
431
  type: ComponentType.OsGridRefField
@@ -163,7 +163,7 @@ export const ComponentTypes: readonly ComponentDef[] = Object.freeze([
163
163
  name: 'OsGridRefField',
164
164
  title: 'Ordnance Survey (OS) grid reference',
165
165
  type: ComponentType.OsGridRefField,
166
- hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',
166
+ hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',
167
167
  options: {}
168
168
  },
169
169
  {
@@ -36,6 +36,16 @@ export class SummaryPageController extends PreviewPageControllerBase {
36
36
  * @private
37
37
  */
38
38
  _isConfirmationEmailSettingsPanel = false
39
+ /**
40
+ * @type {SectionForPreview[]}
41
+ * @private
42
+ */
43
+ _sections = []
44
+ /**
45
+ * @type {Array<{ title: string }>}
46
+ * @private
47
+ */
48
+ _unassignedPages = []
39
49
 
40
50
  /**
41
51
  * @param {SummaryPageElements} elements
@@ -55,6 +65,8 @@ export class SummaryPageController extends PreviewPageControllerBase {
55
65
  this._guidanceComponent.content = elements.guidance
56
66
  this._isConfirmationEmailSettingsPanel =
57
67
  elements.isConfirmationEmailSettingsPanel
68
+ this._sections = elements.sections ?? []
69
+ this._unassignedPages = elements.unassignedPages ?? []
58
70
  }
59
71
 
60
72
  /**
@@ -153,6 +165,20 @@ export class SummaryPageController extends PreviewPageControllerBase {
153
165
  return this._showConfirmationEmail
154
166
  }
155
167
 
168
+ /**
169
+ * @returns {SectionForPreview[]}
170
+ */
171
+ get sections() {
172
+ return this._sections
173
+ }
174
+
175
+ /**
176
+ * @returns {Array<{ title: string }>}
177
+ */
178
+ get unassignedPages() {
179
+ return this._unassignedPages
180
+ }
181
+
156
182
  /**
157
183
  * @returns {Markdown[]}
158
184
  * @protected
@@ -182,7 +208,7 @@ export class SummaryPageController extends PreviewPageControllerBase {
182
208
  /**
183
209
  * @import { ComponentDef, ContentComponentsDef, ListComponent, FormComponentsDef } from '~/src/components/types.js'
184
210
  * @import { FormDefinition } from '~/src/form/form-definition/types.js'
185
- * @import { PageRenderer, PagePreviewBaseElements, SummaryPageElements } from '~/src/form/form-editor/preview/types.js'
211
+ * @import { PageRenderer, PagePreviewBaseElements, SummaryPageElements, SectionForPreview } from '~/src/form/form-editor/preview/types.js'
186
212
  * @import { SummaryRowActionItem, SummaryRow } from '~/src/form/form-editor/macros/types.js'
187
213
  * @import { Markdown } from '~/src/form/form-editor/preview/markdown.js'
188
214
  */
@@ -148,10 +148,18 @@ export interface PageOverviewElements extends PagePreviewBaseElements {
148
148
  hasRepeater: boolean
149
149
  }
150
150
 
151
+ export interface SectionForPreview {
152
+ name: string
153
+ title: string
154
+ pages: { title: string }[]
155
+ }
156
+
151
157
  export interface SummaryPageElements extends PagePreviewBaseElements {
152
158
  declaration: boolean
153
159
  showConfirmationEmail: boolean
154
160
  isConfirmationEmailSettingsPanel: boolean
161
+ sections?: SectionForPreview[]
162
+ unassignedPages?: { title: string }[]
155
163
  }
156
164
 
157
165
  export interface SummaryPageInitialState {
@@ -159,6 +167,8 @@ export interface SummaryPageInitialState {
159
167
  declarationText: string
160
168
  needDeclaration: boolean
161
169
  isConfirmationEmailSettingsPanel: boolean
170
+ sections?: SectionForPreview[]
171
+ unassignedPages?: { title: string }[]
162
172
  }
163
173
 
164
174
  export type PreviewQuestion =