@defra/forms-model 3.0.586 → 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.
- package/dist/module/form/form-editor/preview/controller/summary-page-controller.js +27 -1
- package/dist/module/form/form-editor/preview/controller/summary-page-controller.js.map +1 -1
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/types/form/form-editor/preview/controller/summary-page-controller.d.ts +21 -0
- package/dist/types/form/form-editor/preview/controller/summary-page-controller.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/types.d.ts +15 -0
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/form/form-editor/preview/controller/summary-page-controller.js +27 -1
- package/src/form/form-editor/preview/types.ts +10 -0
|
@@ -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;;
|
|
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;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;EACzC;AACF;AACA;AACA;EACEC,SAAS,GAAG,EAAE;EACd;AACF;AACA;AACA;EACEC,gBAAgB,GAAG,EAAE;;EAErB;AACF;AACA;AACA;AACA;EACEC,WAAWA,CAACC,QAAQ,EAAEC,cAAc,EAAEC,QAAQ,EAAE;IAC9C,KAAK,CAACF,QAAQ,EAAEE,QAAQ,CAAC;IACzB,IAAI,CAACT,cAAc,GAAGQ,cAAc,CAACE,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;MAC3D,IAAInB,aAAa,CAACmB,IAAI,CAAC,EAAE;QACvB,OAAOA,IAAI,CAACC,UAAU,CAACC,MAAM,CAACxB,YAAY,CAAC;MAC7C;MACA,OAAO,EAAE;IACX,CAAC,CAAC;IACF,IAAI,CAACW,gBAAgB,GAAGM,QAAQ,CAACQ,WAAW;IAC5C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AACA;AACA;EACE8C,sBAAsBA,CAAA,EAAG;IACvB,IAAI,CAAC,IAAI,CAAClD,gBAAgB,EAAE;MAC1B,OAAO,EAAE;IACX;IACA,OAAO,KAAK,CAACkD,sBAAsB,CAAC,CAAC;EACvC;EAEA,IAAIC,UAAUA,CAAA,EAAG;IACf,OAAO,IAAI,CAACN,eAAe,GAAG,iBAAiB,GAAG,MAAM;EAC1D;EAEAO,wBAAwBA,CAAA,EAAG;IACzB,IAAI,CAACnD,sBAAsB,GAAG,IAAI;IAClC,IAAI,CAAC0C,MAAM,CAAC,CAAC;EACf;EAEAU,0BAA0BA,CAAA,EAAG;IAC3B,IAAI,CAACpD,sBAAsB,GAAG,KAAK;IACnC,IAAI,CAAC0C,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
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 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;
|
|
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.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gDAAgD,CAAA;AAC1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AACrF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gDAAgD,CAAA;AACzF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AAC1E,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kDAAkD,CAAA;AAC7F,OAAO,EAAE,K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AM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,iBAAiB;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
|
@@ -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 =
|