@defra/forms-model 3.0.491 → 3.0.492
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/__stubs__/preview.js +6 -7
- package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
- package/dist/module/form/form-editor/preview/component-elements.js +2 -10
- package/dist/module/form/form-editor/preview/component-elements.js.map +1 -1
- package/dist/module/form/form-editor/preview/content.js +2 -3
- package/dist/module/form/form-editor/preview/content.js.map +1 -1
- package/dist/module/form/form-editor/preview/controller/page-controller.js +91 -6
- package/dist/module/form/form-editor/preview/controller/page-controller.js.map +1 -1
- package/dist/module/form/form-editor/preview/helpers.js +5 -6
- package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
- package/dist/module/form/form-editor/preview/list.js +2 -3
- package/dist/module/form/form-editor/preview/list.js.map +1 -1
- package/dist/module/form/form-editor/preview/preview.js +3 -8
- package/dist/module/form/form-editor/preview/preview.js.map +1 -1
- package/dist/module/form/form-editor/preview/question.js +2 -2
- package/dist/module/form/form-editor/preview/question.js.map +1 -1
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/module/stubs.js +3 -0
- package/dist/module/stubs.js.map +1 -1
- package/dist/types/form/form-editor/__stubs__/preview.d.ts +4 -3
- package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/component-elements.d.ts +1 -7
- package/dist/types/form/form-editor/preview/component-elements.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/content.d.ts +1 -2
- package/dist/types/form/form-editor/preview/content.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts +27 -0
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/helpers.d.ts +1 -2
- package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/list.d.ts +1 -2
- package/dist/types/form/form-editor/preview/list.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/preview.d.ts +4 -5
- package/dist/types/form/form-editor/preview/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/question.d.ts +1 -1
- package/dist/types/form/form-editor/preview/question.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/types.d.ts +13 -4
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/dist/types/stubs.d.ts +3 -0
- package/dist/types/stubs.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/form/form-editor/__stubs__/preview.js +6 -14
- package/src/form/form-editor/preview/component-elements.js +2 -10
- package/src/form/form-editor/preview/content.js +2 -3
- package/src/form/form-editor/preview/controller/page-controller.js +109 -10
- package/src/form/form-editor/preview/helpers.js +5 -10
- package/src/form/form-editor/preview/list.js +2 -3
- package/src/form/form-editor/preview/preview.js +3 -11
- package/src/form/form-editor/preview/question.js +2 -2
- package/src/form/form-editor/preview/types.ts +18 -4
- package/src/stubs.ts +3 -0
|
@@ -48,7 +48,6 @@ export class PreviewComponent {
|
|
|
48
48
|
* @type {boolean}
|
|
49
49
|
* @protected
|
|
50
50
|
*/
|
|
51
|
-
_largeTitle = true;
|
|
52
51
|
|
|
53
52
|
/**
|
|
54
53
|
* @param {QuestionElements} htmlElements
|
|
@@ -57,8 +56,7 @@ export class PreviewComponent {
|
|
|
57
56
|
constructor(htmlElements, questionRenderer) {
|
|
58
57
|
const {
|
|
59
58
|
question,
|
|
60
|
-
optional
|
|
61
|
-
largeTitle
|
|
59
|
+
optional
|
|
62
60
|
} = htmlElements.values;
|
|
63
61
|
|
|
64
62
|
/**
|
|
@@ -82,7 +80,6 @@ export class PreviewComponent {
|
|
|
82
80
|
* @protected
|
|
83
81
|
*/
|
|
84
82
|
this._questionRenderer = questionRenderer;
|
|
85
|
-
this._largeTitle = largeTitle;
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
/**
|
|
@@ -103,10 +100,9 @@ export class PreviewComponent {
|
|
|
103
100
|
* @type {DefaultComponent}
|
|
104
101
|
*/
|
|
105
102
|
get label() {
|
|
106
|
-
const titleClass = this._largeTitle ? 'govuk-label--l' : 'govuk-label--m';
|
|
107
103
|
return {
|
|
108
104
|
text: this.titleText,
|
|
109
|
-
classes:
|
|
105
|
+
classes: 'govuk-label--l' + this.getHighlight('question')
|
|
110
106
|
};
|
|
111
107
|
}
|
|
112
108
|
|
|
@@ -115,11 +111,10 @@ export class PreviewComponent {
|
|
|
115
111
|
* @type {GovukFieldset}
|
|
116
112
|
*/
|
|
117
113
|
get fieldSet() {
|
|
118
|
-
const titleClass = this._largeTitle ? 'govuk-fieldset__legend--l' : 'govuk-fieldset__legend--m';
|
|
119
114
|
return {
|
|
120
115
|
legend: {
|
|
121
116
|
text: this.titleText,
|
|
122
|
-
classes:
|
|
117
|
+
classes: 'govuk-fieldset__legend--l' + this.getHighlight('question')
|
|
123
118
|
}
|
|
124
119
|
};
|
|
125
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","names":["ComponentType","HIGHLIGHT_CLASS","PreviewComponent","PATH","componentType","Details","_questionTemplate","_highlight","_fieldName","_questionRenderer","_htmlElements","_highlighted","
|
|
1
|
+
{"version":3,"file":"preview.js","names":["ComponentType","HIGHLIGHT_CLASS","PreviewComponent","PATH","componentType","Details","_questionTemplate","_highlight","_fieldName","_questionRenderer","_htmlElements","_highlighted","constructor","htmlElements","questionRenderer","question","optional","values","_question","_optional","getHighlight","element","titleText","optionalText","label","text","classes","fieldSet","legend","customRenderFields","_renderInput","id","name","renderInput","render","value","highlight","highlightContent","unHighlightContent"],"sources":["../../../../../src/form/form-editor/preview/preview.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\n\n/**\n * @abstract\n */\nexport class PreviewComponent {\n static PATH = 'preview-components/'\n /**\n * @abstract\n * @type {ComponentType}\n */\n componentType = ComponentType.Details\n /**\n * @abstract\n * @type {string}\n * @protected\n */\n _questionTemplate = ''\n /**\n * @type { string|null }\n * @protected\n */\n _highlight = null\n /**\n * @abstract\n * @type {string}\n * @protected\n */\n _fieldName = ''\n /**\n * @type {QuestionRenderer}\n * @protected\n */\n _questionRenderer\n\n /**\n * @type {QuestionElements}\n * @protected\n */\n _htmlElements\n /**\n * @type {boolean}\n * @protected\n */\n _highlighted = false\n /**\n * @type {boolean}\n * @protected\n */\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n const { question, optional } = htmlElements.values\n\n /**\n * @type {QuestionElements}\n * @protected\n */\n this._htmlElements = htmlElements\n /**\n * @type {string}\n * @private\n */\n this._question = question\n /**\n * @type {boolean}\n * @private\n */\n this._optional = optional\n /**\n *\n * @type {QuestionRenderer}\n * @protected\n */\n this._questionRenderer = questionRenderer\n }\n\n /**\n * @param {string} element\n * @returns {string}\n * @protected\n */\n getHighlight(element) {\n return this._highlight === element ? ' highlight' : ''\n }\n\n get titleText() {\n const optionalText = this._optional ? ' (optional)' : ''\n return (!this._question ? 'Question' : this._question) + optionalText\n }\n\n /**\n * @protected\n * @type {DefaultComponent}\n */\n get label() {\n return {\n text: this.titleText,\n classes: 'govuk-label--l' + this.getHighlight('question')\n }\n }\n\n /**\n * @protected\n * @type {GovukFieldset}\n */\n get fieldSet() {\n return {\n legend: {\n text: this.titleText,\n classes: 'govuk-fieldset__legend--l' + this.getHighlight('question')\n }\n }\n }\n\n /**\n * @returns {Partial<QuestionBaseModel>}\n */\n get customRenderFields() {\n return {}\n }\n\n /**\n *\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n classes: this._highlighted ? HIGHLIGHT_CLASS : ''\n }\n }\n\n /**\n * @type {QuestionBaseModel}\n */\n get renderInput() {\n return {\n ...this._renderInput(),\n ...this.customRenderFields\n }\n }\n\n render() {\n this._questionRenderer.render(this._questionTemplate, this.renderInput)\n }\n\n /**\n * @type {string}\n */\n get question() {\n return this._question\n }\n\n /**\n * @param {string} value\n */\n set question(value) {\n this._question = value\n this.render()\n }\n\n get optional() {\n return this._optional\n }\n\n /**\n * @param {boolean} value\n */\n set optional(value) {\n this._optional = value\n this.render()\n }\n\n /**\n * @type {string | null}\n */\n get highlight() {\n return this._highlight\n }\n\n /**\n * @param {string | null} value\n */\n set highlight(value) {\n this._highlight = value\n this.render()\n }\n\n /**\n * no render\n */\n highlightContent() {\n this._highlighted = true\n }\n\n /**\n * no render\n */\n unHighlightContent() {\n this._highlighted = false\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAOC,IAAI,GAAG,qBAAqB;EACnC;AACF;AACA;AACA;EACEC,aAAa,GAAGJ,aAAa,CAACK,OAAO;EACrC;AACF;AACA;AACA;AACA;EACEC,iBAAiB,GAAG,EAAE;EACtB;AACF;AACA;AACA;EACEC,UAAU,GAAG,IAAI;EACjB;AACF;AACA;AACA;AACA;EACEC,UAAU,GAAG,EAAE;EACf;AACF;AACA;AACA;EACEC,iBAAiB;;EAEjB;AACF;AACA;AACA;EACEC,aAAa;EACb;AACF;AACA;AACA;EACEC,YAAY,GAAG,KAAK;EACpB;AACF;AACA;AACA;;EAEE;AACF;AACA;AACA;EACEC,WAAWA,CAACC,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,MAAM;MAAEC,QAAQ;MAAEC;IAAS,CAAC,GAAGH,YAAY,CAACI,MAAM;;IAElD;AACJ;AACA;AACA;IACI,I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EA;AACF;AACA;EACE,IAAIgC,WAAWA,CAAA,EAAG;IAChB,OAAO;MACL,GAAG,IAAI,CAACH,YAAY,CAAC,CAAC;MACtB,GAAG,IAAI,CAACD;IACV,CAAC;EACH;EAEAK,MAAMA,CAAA,EAAG;IACP,IAAI,CAACzB,iBAAiB,CAACyB,MAAM,CAAC,IAAI,CAAC5B,iBAAiB,EAAE,IAAI,CAAC2B,WAAW,CAAC;EACzE;;EAEA;AACF;AACA;EACE,IAAIlB,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACG,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIH,QAAQA,CAACoB,KAAK,EAAE;IAClB,IAAI,CAACjB,SAAS,GAAGiB,KAAK;IACtB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;EAEA,IAAIlB,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACG,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIH,QAAQA,CAACmB,KAAK,EAAE;IAClB,IAAI,CAAChB,SAAS,GAAGgB,KAAK;IACtB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;EACE,IAAIE,SAASA,CAAA,EAAG;IACd,OAAO,IAAI,CAAC7B,UAAU;EACxB;;EAEA;AACF;AACA;EACE,IAAI6B,SAASA,CAACD,KAAK,EAAE;IACnB,IAAI,CAAC5B,UAAU,GAAG4B,KAAK;IACvB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;EACEG,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAAC1B,YAAY,GAAG,IAAI;EAC1B;;EAEA;AACF;AACA;EACE2B,kBAAkBA,CAAA,EAAG;IACnB,IAAI,CAAC3B,YAAY,GAAG,KAAK;EAC3B;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -14,8 +14,8 @@ export class QuestionComponentElements extends ComponentElements {
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {FormComponentsDef} component
|
|
16
16
|
*/
|
|
17
|
-
constructor(component
|
|
18
|
-
super(component
|
|
17
|
+
constructor(component) {
|
|
18
|
+
super(component);
|
|
19
19
|
this._component = component;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.js","names":["ComponentType","ComponentElements","PreviewComponent","QuestionComponentElements","_component","constructor","component","
|
|
1
|
+
{"version":3,"file":"question.js","names":["ComponentType","ComponentElements","PreviewComponent","QuestionComponentElements","_component","constructor","component","_getValues","hintText","hint","shortDesc","shortDescription","Question","componentType","TextField","_questionTemplate","PATH","_fieldName","htmlElements","questionRenderer","values","_hintText","text","_highlight","length","classes","getHighlight","_renderInput","label","value","render"],"sources":["../../../../../src/form/form-editor/preview/question.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class QuestionComponentElements extends ComponentElements {\n /**\n * @type {FormComponentsDef}\n * @protected\n */\n _component\n /**\n * @param {FormComponentsDef} component\n */\n constructor(component) {\n super(component)\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n hintText: this._component.hint ?? '',\n shortDesc: this._component.shortDescription ?? ''\n }\n }\n}\n\n/**\n * @class Question\n * @classdesc\n * A data object that has access to the underlying data via the QuestionElements object interface\n * and the templating mechanism to render the HTML for the data.\n *\n * It does not have access to the DOM, but has access to QuestionElements.setPreviewHTML to update\n * the HTML. Question classes should only be responsible for data and rendering as are reused in the\n * server side.\n */\nexport class Question extends PreviewComponent {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.TextField\n\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'textfield.njk'\n /**\n * @type {string}\n * @protected\n */\n _fieldName = 'inputField'\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n const { hintText } = htmlElements.values\n /**\n * @type {string}\n * @private\n */\n this._hintText = hintText\n }\n\n /**\n * @type {DefaultComponent}\n * @protected\n */\n get hint() {\n const text =\n this._highlight === 'hintText' && !this._hintText.length\n ? 'Hint text'\n : this._hintText\n\n return {\n text,\n classes: this.getHighlight('hintText')\n }\n }\n\n /**\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return { ...super._renderInput(), label: this.label, hint: this.hint }\n }\n\n /**\n * @type {string}\n */\n get hintText() {\n return this._hintText\n }\n\n /**\n * @param {string} value\n */\n set hintText(value) {\n this._hintText = value\n this.render()\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,SAASF,iBAAiB,CAAC;EAC/D;AACF;AACA;AACA;EACEG,UAAU;EACV;AACF;AACA;EACEC,WAAWA,CAACC,SAAS,EAAE;IACrB,KAAK,CAACA,SAAS,CAAC;IAChB,IAAI,CAACF,UAAU,GAAGE,SAAS;EAC7B;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,OAAO;MACL,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBC,QAAQ,EAAE,IAAI,CAACJ,UAAU,CAACK,IAAI,IAAI,EAAE;MACpCC,SAAS,EAAE,IAAI,CAACN,UAAU,CAACO,gBAAgB,IAAI;IACjD,CAAC;EACH;AACF;;AAEA;AACA;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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
|
|
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 items: ListElement[]\n content: string\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, 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 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 PageOverviewElements {\n heading: string\n guidance: string\n addHeading: 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":[]}
|
package/dist/module/stubs.js
CHANGED
|
@@ -11,4 +11,7 @@ export { buildFileUploadPage } from "./__stubs__/pages.js";
|
|
|
11
11
|
export { buildSummaryPage } from "./__stubs__/pages.js";
|
|
12
12
|
export { buildQuestionPage } from "./__stubs__/pages.js";
|
|
13
13
|
export { buildMarkdownComponent } from "./__stubs__/components.js";
|
|
14
|
+
export { QuestionRendererStub } from "./form/form-editor/__stubs__/preview.js";
|
|
15
|
+
export { PageRendererStub } from "./form/form-editor/__stubs__/preview.js";
|
|
16
|
+
export { QuestionPreviewElements } from "./form/form-editor/__stubs__/preview.js";
|
|
14
17
|
//# sourceMappingURL=stubs.js.map
|
package/dist/module/stubs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.js","names":["buildList","buildListItem","buildCheckboxComponent","buildRadioComponent","buildAutoCompleteComponent","buildFileUploadComponent","buildTextFieldComponent","buildRepeaterPage","buildFileUploadPage","buildSummaryPage","buildQuestionPage","buildMarkdownComponent"],"sources":["../../src/stubs.ts"],"sourcesContent":["export * from '~/src/__stubs__/form-definition.js'\nexport { buildList } from '~/src/__stubs__/components.js'\nexport { buildListItem } from '~/src/__stubs__/components.js'\nexport { buildCheckboxComponent } from '~/src/__stubs__/components.js'\nexport { buildRadioComponent } from '~/src/__stubs__/components.js'\nexport { buildAutoCompleteComponent } from '~/src/__stubs__/components.js'\nexport { buildFileUploadComponent } from '~/src/__stubs__/components.js'\nexport { buildTextFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildRepeaterPage } from '~/src/__stubs__/pages.js'\nexport { buildFileUploadPage } from '~/src/__stubs__/pages.js'\nexport { buildSummaryPage } from '~/src/__stubs__/pages.js'\nexport { buildQuestionPage } from '~/src/__stubs__/pages.js'\nexport { buildMarkdownComponent } from '~/src/__stubs__/components.js'\n"],"mappings":"AAAA;AACA,SAASA,SAAS;AAClB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,wBAAwB;AACjC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"stubs.js","names":["buildList","buildListItem","buildCheckboxComponent","buildRadioComponent","buildAutoCompleteComponent","buildFileUploadComponent","buildTextFieldComponent","buildRepeaterPage","buildFileUploadPage","buildSummaryPage","buildQuestionPage","buildMarkdownComponent","QuestionRendererStub","PageRendererStub","QuestionPreviewElements"],"sources":["../../src/stubs.ts"],"sourcesContent":["export * from '~/src/__stubs__/form-definition.js'\nexport { buildList } from '~/src/__stubs__/components.js'\nexport { buildListItem } from '~/src/__stubs__/components.js'\nexport { buildCheckboxComponent } from '~/src/__stubs__/components.js'\nexport { buildRadioComponent } from '~/src/__stubs__/components.js'\nexport { buildAutoCompleteComponent } from '~/src/__stubs__/components.js'\nexport { buildFileUploadComponent } from '~/src/__stubs__/components.js'\nexport { buildTextFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildRepeaterPage } from '~/src/__stubs__/pages.js'\nexport { buildFileUploadPage } from '~/src/__stubs__/pages.js'\nexport { buildSummaryPage } from '~/src/__stubs__/pages.js'\nexport { buildQuestionPage } from '~/src/__stubs__/pages.js'\nexport { buildMarkdownComponent } from '~/src/__stubs__/components.js'\nexport { QuestionRendererStub } from '~/src/form/form-editor/__stubs__/preview.js'\nexport { PageRendererStub } from '~/src/form/form-editor/__stubs__/preview.js'\nexport { QuestionPreviewElements } from '~/src/form/form-editor/__stubs__/preview.js'\n"],"mappings":"AAAA;AACA,SAASA,SAAS;AAClB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,wBAAwB;AACjC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AACzB,SAASC,uBAAuB","ignoreList":[]}
|
|
@@ -59,7 +59,7 @@ export class QuestionPreviewElements implements ListElements {
|
|
|
59
59
|
/**
|
|
60
60
|
* @param {BaseSettings} baseSettings
|
|
61
61
|
*/
|
|
62
|
-
constructor({ question, hintText, optional, shortDesc, items, content
|
|
62
|
+
constructor({ question, hintText, optional, shortDesc, items, content }: BaseSettings);
|
|
63
63
|
/**
|
|
64
64
|
* @protected
|
|
65
65
|
*/
|
|
@@ -84,7 +84,6 @@ export class QuestionPreviewElements implements ListElements {
|
|
|
84
84
|
* @private
|
|
85
85
|
*/
|
|
86
86
|
private _items;
|
|
87
|
-
_largeTitle: boolean;
|
|
88
87
|
afterInputsHTML: string;
|
|
89
88
|
/**
|
|
90
89
|
* @returns {BaseSettings}
|
|
@@ -118,10 +117,12 @@ export class PagePreviewElements implements PageOverviewElements {
|
|
|
118
117
|
/**
|
|
119
118
|
* @param {string} heading
|
|
120
119
|
* @param {string} guidance
|
|
120
|
+
* @param {boolean} [addHeading]
|
|
121
121
|
*/
|
|
122
|
-
constructor(heading: string, guidance?: string);
|
|
122
|
+
constructor(heading: string, guidance?: string, addHeading?: boolean);
|
|
123
123
|
guidance: string;
|
|
124
124
|
heading: string;
|
|
125
|
+
addHeading: boolean;
|
|
125
126
|
}
|
|
126
127
|
export const baseElements: BaseSettings;
|
|
127
128
|
export namespace listElementsStub {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src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AED;;OAEG;IACH,sBAFW,WAAW,QAIrB;CACF;AAED;;GAEG;AACH;IACE;;OAEG;IACH,kDAFW,YAAY,GAAG;QAAC,mBAAmB,EAAE,MAAM,CAAA;KAAC,EAKtD;IADC,4BAA8C;CAEjD;AAED;;GAEG;AACH;IAKE;;;;OAIG;IACH,qBAJW,MAAM,aACN,MAAM,eACN,OAAO,EAMjB;IAbD,iBAAQ;IACR,gBAAO;IACP,oBAAU;CAYX;AAED,2BAAuC,YAAY,CAQjD;;;;;;;;kCA+D8K,yCAAyC;uCAAzC,yCAAyC;yBArPhM,4CAA4C;sCAqP2G,yCAAyC;mCAAzC,yCAAyC;kCAAzC,yCAAyC;2CAD/K,wCAAwC;kCAC8F,yCAAyC;0CAAzC,yCAAyC;0CAAzC,yCAAyC;AA7DzN,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AAEtD,gCAAoC,YAAY,CA4B9C"}
|
|
@@ -4,19 +4,13 @@
|
|
|
4
4
|
export class ComponentElements implements QuestionElements {
|
|
5
5
|
/**
|
|
6
6
|
* @param {ComponentDef} component
|
|
7
|
-
* @param {boolean} [largeTitle]
|
|
8
7
|
*/
|
|
9
|
-
constructor(component: ComponentDef
|
|
8
|
+
constructor(component: ComponentDef);
|
|
10
9
|
/**
|
|
11
10
|
* @type {ComponentDef}
|
|
12
11
|
* @protected
|
|
13
12
|
*/
|
|
14
13
|
protected _component: ComponentDef;
|
|
15
|
-
/**
|
|
16
|
-
* @type {boolean}
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
private _largeTitle;
|
|
20
14
|
/**
|
|
21
15
|
* @protected
|
|
22
16
|
* @returns {BaseSettings}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-elements.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"component-elements.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,YAAY,EAItB;IAVD;;;OAGG;IACH,sBAHU,YAAY,CAGZ;IAQV;;;OAGG;IACH,wBAFa,YAAY,CAaxB;IAED;;OAEG;IACH,cAFa,YAAY,CAKxB;IAED;;OAEG;IACH,wBAFW,WAAW,QAIrB;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;CACF;sCAGqI,yCAAyC;kCACrG,2BAA2B;kCADiC,yCAAyC"}
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
export class ContentElements extends ComponentElements implements QuestionElements {
|
|
5
5
|
/**
|
|
6
6
|
* @param {Exclude<ContentComponentsDef, ListComponent>} component
|
|
7
|
-
* @param {boolean} largeTitle
|
|
8
7
|
*/
|
|
9
|
-
constructor(component: Exclude<ContentComponentsDef, ListComponent
|
|
8
|
+
constructor(component: Exclude<ContentComponentsDef, ListComponent>);
|
|
10
9
|
/**
|
|
11
10
|
* @type {Exclude<ContentComponentsDef, ListComponent>}
|
|
12
11
|
* @protected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/content.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAME
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/content.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,OAAO,CAAC,oBAAoB,EAAE,aAAa,CAAC,EAKtD;IAXD;;;OAGG;IACH,sBAHU,OAAO,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAG5C;CAmBX;AAED;;;;;GAKG;AACH;IACE;;;OAGG;IACH,oBAHU,MAAM,CAGR;IAwBR;;;OAGG;IACH,6BAHW,MAAM,QAKhB;IASD,mBANa,MAAM,EASlB;IAVD;;OAEG;IACH,eAFa,MAAM,CAIlB;CAMF;sCAGqI,yCAAyC;kCAzF7I,sDAAsD;0CA0FC,2BAA2B;mCAA3B,2BAA2B;iCAzFnF,2CAA2C"}
|
|
@@ -13,6 +13,7 @@ export class PagePreviewElements implements PageOverviewElements {
|
|
|
13
13
|
private _page;
|
|
14
14
|
get heading(): string;
|
|
15
15
|
get guidance(): string;
|
|
16
|
+
get addHeading(): boolean;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* @implements {PagePreviewPanelMacro}
|
|
@@ -70,6 +71,11 @@ export class PreviewPageController implements PagePreviewPanelMacro {
|
|
|
70
71
|
* @protected
|
|
71
72
|
*/
|
|
72
73
|
protected _guidanceComponent: Markdown;
|
|
74
|
+
/**
|
|
75
|
+
* @type {boolean}
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
private _showTitle;
|
|
73
79
|
/**
|
|
74
80
|
* @returns {Markdown[]}
|
|
75
81
|
* @private
|
|
@@ -79,8 +85,23 @@ export class PreviewPageController implements PagePreviewPanelMacro {
|
|
|
79
85
|
* @returns {PagePreviewComponent[]}
|
|
80
86
|
*/
|
|
81
87
|
get components(): PagePreviewComponent[];
|
|
88
|
+
/**
|
|
89
|
+
* @returns {boolean}
|
|
90
|
+
*/
|
|
91
|
+
get showLargeTitle(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* @param {PreviewComponent} component
|
|
94
|
+
* @returns {QuestionBaseModel}
|
|
95
|
+
*/
|
|
96
|
+
_overrideComponentHeading(component: PreviewComponent): QuestionBaseModel;
|
|
82
97
|
set guidanceText(text: string);
|
|
83
98
|
get guidanceText(): string;
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param {boolean} showTitle
|
|
102
|
+
*/
|
|
103
|
+
set showTitle(showTitle: boolean);
|
|
104
|
+
get showTitle(): boolean;
|
|
84
105
|
get guidance(): {
|
|
85
106
|
text: string;
|
|
86
107
|
classes: string;
|
|
@@ -93,6 +114,10 @@ export class PreviewPageController implements PagePreviewPanelMacro {
|
|
|
93
114
|
classes: string;
|
|
94
115
|
};
|
|
95
116
|
render(): void;
|
|
117
|
+
/**
|
|
118
|
+
* @returns {boolean}
|
|
119
|
+
*/
|
|
120
|
+
get titleAndFirstTitleSame(): boolean;
|
|
96
121
|
/**
|
|
97
122
|
* @param {string} value
|
|
98
123
|
*/
|
|
@@ -116,6 +141,8 @@ import type { PagePreviewPanelMacro } from '../../../../form/form-editor/macros/
|
|
|
116
141
|
import type { Question } from '../../../../form/form-editor/preview/question.js';
|
|
117
142
|
import { Markdown } from '../../../../form/form-editor/preview/markdown.js';
|
|
118
143
|
import type { PagePreviewComponent } from '../../../../form/form-editor/macros/types.js';
|
|
144
|
+
import type { PreviewComponent } from '../../../../form/form-editor/preview/preview.js';
|
|
145
|
+
import type { QuestionBaseModel } from '../../../../form/form-editor/preview/types.js';
|
|
119
146
|
import type { ComponentDef } from '../../../../components/types.js';
|
|
120
147
|
import type { FormDefinition } from '../../../../form/form-definition/types.js';
|
|
121
148
|
import type { PageRenderer } from '../../../../form/form-editor/preview/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH;IAOE;;OAEG;IACH,kBAFW,IAAI,EAId;IAXD;;;OAGG;IACH,cAAK;IASL,sBAEC;IAED,uBAUC;IAED,0BAEC;CACF;AAED;;GAEG;AACH;IACE,oBAAoC;IA2PpC;;;;OAIG;IACH,kCAFa,QAAQ,CAepB;IAED;;;;;OAKG;IACH,4CAKC;IA5OD;;;;;OAKG;IACH,wBALW,YAAY,EAAE,YACd,oBAAoB,cACpB,cAAc,YACd,YAAY,EAkBtB;IAnED;;;OAGG;IACH,yBAHU,MAAM,CAGkD;IAClE;;;OAGG;IACH,uBAFU,QAAQ,EAAE,CAEJ;IAUhB;;;OAGG;IACH,wBAHW,SAAS,GAAG,OAAO,GAAG,UAAU,CAGnB;IACxB;;;OAGG;IACH,sBAAkB;IAClB;;;OAGG;IACH,uBAAgE;IAChE;;;;OAIG;IACH,8BAHU,QAAQ,CAGA;IAClB;;;OAGG;IACH,mBAAiB;IAoCjB;;;OAGG;IACH,kCAQC;IAED;;OAEG;IACH,kBAFa,oBAAoB,EAAE,CAclC;IAED;;OAEG;IACH,sBAFa,OAAO,CAgBnB;IAED;;;OAGG;IACH,qCAHW,gBAAgB,GACd,iBAAiB,CAgC7B;IAED,+BAIC;IAED,2BAKC;IAED;;;OAGG;IACH,yBAFW,OAAO,EAKjB;IAED,iBAPW,OAAO,CASjB;IAED;;;MAKC;IAED;;OAEG;IACH,iBAFa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAO7C;IAED,eAEC;IAED;;OAEG;IACH,8BAFa,OAAO,CASnB;IAeD;;OAEG;IACH,iBAFW,MAAM,EAKhB;IAnBD;;OAEG;IACH,aAFa,MAAM,CAUlB;IAUD,uBAEC;IAmCD,0BAGC;IAED;;OAEG;IACH,iCAFW,OAAO,GAAC,UAAU,QAK5B;IAED,uBAKC;;CACF;0CAG2F,yCAAyC;0BAG5F,qCAAqC;2CAEd,wCAAwC;8BAJ3E,4CAA4C;yBA5WhD,4CAA4C;0CAgXL,wCAAwC;sCAHnE,2CAA2C;uCAFY,yCAAyC;kCAIjF,2BAA2B;oCADtC,qCAAqC;kCAHc,yCAAyC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {QuestionRenderer} questionRenderer
|
|
3
3
|
* @param {FormDefinition} definition
|
|
4
|
-
* @param {boolean} hasTitle
|
|
5
4
|
* @returns {(component: ComponentDef) => Question}
|
|
6
5
|
*/
|
|
7
|
-
export function mapComponentToPreviewQuestion(questionRenderer: QuestionRenderer, definition: FormDefinition
|
|
6
|
+
export function mapComponentToPreviewQuestion(questionRenderer: QuestionRenderer, definition: FormDefinition): (component: ComponentDef) => Question;
|
|
8
7
|
import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
|
|
9
8
|
import type { FormDefinition } from '../../../form/form-definition/types.js';
|
|
10
9
|
import type { ComponentDef } from '../../../components/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AAsDA
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AAsDA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CA6BjD;sCAGsD,yCAAyC;oCAGvD,qCAAqC;kCAC1B,2BAA2B;8BAHlD,4CAA4C"}
|
|
@@ -21,9 +21,8 @@ export class ListComponentElements extends QuestionComponentElements implements
|
|
|
21
21
|
/**
|
|
22
22
|
* @param {SelectionComponentsDef} component
|
|
23
23
|
* @param {List} list
|
|
24
|
-
* @param {boolean} largeTitle
|
|
25
24
|
*/
|
|
26
|
-
constructor(component: SelectionComponentsDef, list: List
|
|
25
|
+
constructor(component: SelectionComponentsDef, list: List);
|
|
27
26
|
/**
|
|
28
27
|
* @type {List}
|
|
29
28
|
* @protected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/list.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,4CAHW,WAAW,GACT,CAAC,MAAM,EAAE,WAAW,CAAC,CAIjC;AAED;;;;GAIG;AACH,gDAHY,WAAW,EAAE,GAAE,SAAS,GACvB,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAKpC;AAED;;;GAGG;AACH,4CAHW,IAAI,GACF,WAAW,CAavB;AAED;;GAEG;AACH;IAOE
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/list.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,4CAHW,WAAW,GACT,CAAC,MAAM,EAAE,WAAW,CAAC,CAIjC;AAED;;;;GAIG;AACH,gDAHY,WAAW,EAAE,GAAE,SAAS,GACvB,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAKpC;AAED;;;GAGG;AACH,4CAHW,IAAI,GACF,WAAW,CAavB;AAED;;GAEG;AACH;IAOE;;;OAGG;IACH,uBAHW,sBAAsB,QACtB,IAAI,EAKd;IAbD;;;OAGG;IACH,iBAHU,IAAI,CAGT;CAqBN;AAED;IAqBE;;;OAGG;IACH,0BAHW,YAAY,oBACZ,gBAAgB,EAQ1B;IArBD,2BAA2B;IAC3B,eADW,YAAY,CACV;IACb,qBAAqC;IACrC,uBAA4C;IAE5C;;;OAGG;IACH,iBAHU,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAG7B;IAcL;;;;;;;;;OASG;IACH,mBATa;QACT,SAAS,CAAC,EAAE;YAAC,WAAW,EAAE;gBAAC,IAAI,EAAE,MAAM,CAAA;aAAC,CAAA;SAAC,CAAC;QAC1C,IAAI,EAAE,gBAAgB,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,gBAAgB,EAAE,CAAA;KACzB,CAwBH;IAED;;;OAGG;IACH,kBAFW,WAAW,QAKrB;IAED;;OAEG;IACH,YAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,qCAHW,WAAW,EAAE,GACX,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAKpC;IAED;;OAEG;IACH,YAFa,gBAAgB,EAAE,CAiC9B;IAED;;;;OAIG;IACH,eAHW,MAAM,GAAG,SAAS,QAClB,MAAM,QAYhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GAAG,SAAS,QAClB,MAAM,QAehB;IAED;;;OAGG;IACH,gBAHW,MAAM,GAAG,SAAS,SAClB,MAAM,QAYhB;CACF;iCAGiD,iCAAiC;0BAEpD,qCAAqC;sCACgD,yCAAyC;0CAvQtJ,4CAA4C;0BAsQpB,qCAAqC;4CADN,2BAA2B;yBArQlF,4CAA4C;kCAuQiE,yCAAyC;sCAAzC,yCAAyC;mCAAzC,yCAAyC;sCAH3G,iCAAiC;sCAGiC,yCAAyC"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export class PreviewComponent {
|
|
5
5
|
static PATH: string;
|
|
6
|
+
/**
|
|
7
|
+
* @type {boolean}
|
|
8
|
+
* @protected
|
|
9
|
+
*/
|
|
6
10
|
/**
|
|
7
11
|
* @param {QuestionElements} htmlElements
|
|
8
12
|
* @param {QuestionRenderer} questionRenderer
|
|
@@ -45,11 +49,6 @@ export class PreviewComponent {
|
|
|
45
49
|
* @protected
|
|
46
50
|
*/
|
|
47
51
|
protected _highlighted: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* @type {boolean}
|
|
50
|
-
* @protected
|
|
51
|
-
*/
|
|
52
|
-
protected _largeTitle: boolean;
|
|
53
52
|
/**
|
|
54
53
|
* @type {string}
|
|
55
54
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/preview.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IACE,oBAAmC;
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/preview.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IACE,oBAAmC;IAuCnC;;;OAGG;IAEH;;;OAGG;IACH,0BAHW,gBAAgB,oBAChB,gBAAgB,EA0B1B;IAvED;;;OAGG;IACH,eAFU,aAAa,CAEc;IACrC;;;;OAIG;IACH,6BAHU,MAAM,CAGM;IACtB;;;OAGG;IACH,sBAHW,MAAM,GAAC,IAAI,CAGL;IACjB;;;;OAIG;IACH,sBAHU,MAAM,CAGD;IACf;;;OAGG;IACH,6BAHU,gBAAgB,CAGT;IAEjB;;;OAGG;IACH,yBAHU,gBAAgB,CAGb;IACb;;;OAGG;IACH,wBAHU,OAAO,CAGG;IAkBlB;;;OAGG;IACH,kBAAyB;IACzB;;;OAGG;IACH,kBAAyB;IAS3B;;;;OAIG;IACH,gCAJW,MAAM,GACJ,MAAM,CAKlB;IAED,wBAGC;IAED;;;OAGG;IACH,uBAFU,gBAAgB,CAOzB;IAED;;;OAGG;IACH,0BAFU,aAAa,CAStB;IAED;;OAEG;IACH,0BAFa,OAAO,CAAC,iBAAiB,CAAC,CAItC;IAED;;;;OAIG;IACH,0BAHa,iBAAiB,CAS7B;IAED;;OAEG;IACH,mBAFU,iBAAiB,CAO1B;IAED,eAEC;IASD;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,gBAFU,MAAM,CAIf;IAcD;;OAEG;IACH,oBAFW,OAAO,EAKjB;IAVD,gBAKW,OAAO,CAHjB;IAiBD;;OAEG;IACH,qBAFW,MAAM,GAAG,IAAI,EAKvB;IAbD;;OAEG;IACH,iBAFU,MAAM,GAAG,IAAI,CAItB;IAUD;;OAEG;IACH,yBAEC;IAED;;OAEG;IACH,2BAEC;CACF;8BAhN6B,2BAA2B;sCAmN6E,yCAAyC;sCAAzC,yCAAyC;sCAAzC,yCAAyC;mCAAzC,yCAAyC;uCAAzC,yCAAyC"}
|
|
@@ -5,7 +5,7 @@ export class QuestionComponentElements extends ComponentElements implements Ques
|
|
|
5
5
|
/**
|
|
6
6
|
* @param {FormComponentsDef} component
|
|
7
7
|
*/
|
|
8
|
-
constructor(component: FormComponentsDef
|
|
8
|
+
constructor(component: FormComponentsDef);
|
|
9
9
|
/**
|
|
10
10
|
* @type {FormComponentsDef}
|
|
11
11
|
* @protected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/question.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,iBAAiB,
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/question.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,iBAAiB,EAK3B;IAXD;;;OAGG;IACH,sBAHU,iBAAiB,CAGjB;CAoBX;AAED;;;;;;;;;GASG;AACH;IAwBI;;;OAGG;IACH,kBAAyB;IAG3B;;;OAGG;IACH,sBAHU,gBAAgB,CAazB;IAiBD;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,gBAFU,MAAM,CAIf;CASF;sCAGqI,yCAAyC;kCAnH7I,sDAAsD;uCAoHd,2BAA2B;iCAnHpE,2CAA2C;sCAkH0D,yCAAyC"}
|
|
@@ -13,7 +13,6 @@ import { type UkAddressQuestion } from '../../../form/form-editor/preview/uk-add
|
|
|
13
13
|
import { type ListElement } from '../../../form/form-editor/types.js';
|
|
14
14
|
export { type QuestionBaseModel } from '../../../form/form-editor/macros/types.js';
|
|
15
15
|
export interface BaseSettings {
|
|
16
|
-
largeTitle: boolean;
|
|
17
16
|
question: string;
|
|
18
17
|
hintText: string;
|
|
19
18
|
optional: boolean;
|
|
@@ -34,17 +33,25 @@ export type ListenerRow = [
|
|
|
34
33
|
(target: HTMLInputElement, e: Event) => void,
|
|
35
34
|
keyof HTMLElementEventMap
|
|
36
35
|
];
|
|
37
|
-
export interface
|
|
38
|
-
readonly values
|
|
36
|
+
export interface DomElementsBase {
|
|
37
|
+
readonly values?: BaseSettings;
|
|
38
|
+
autocompleteOptions?: string;
|
|
39
39
|
setPreviewHTML(value: string): void;
|
|
40
40
|
setPreviewDOM(element: HTMLElement): void;
|
|
41
41
|
}
|
|
42
|
+
export interface QuestionElements extends DomElementsBase {
|
|
43
|
+
readonly values: BaseSettings;
|
|
44
|
+
}
|
|
42
45
|
export interface AutocompleteElements extends QuestionElements {
|
|
43
46
|
autocompleteOptions: string;
|
|
44
47
|
}
|
|
45
|
-
export interface
|
|
48
|
+
export interface QuestionRenderContext {
|
|
46
49
|
model: QuestionBaseModel;
|
|
47
50
|
}
|
|
51
|
+
export interface PageRenderContext {
|
|
52
|
+
params: PagePreviewPanelMacro;
|
|
53
|
+
}
|
|
54
|
+
export type RenderContext = QuestionRenderContext | PageRenderContext;
|
|
48
55
|
export interface HTMLBuilder {
|
|
49
56
|
buildHTML(questionTemplate: string, renderContext: RenderContext): string;
|
|
50
57
|
}
|
|
@@ -54,12 +61,14 @@ export interface QuestionRenderer {
|
|
|
54
61
|
export interface PageRenderer {
|
|
55
62
|
render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void;
|
|
56
63
|
}
|
|
64
|
+
export type Renderer = QuestionRenderer | PageRenderer;
|
|
57
65
|
export interface ListElements extends QuestionElements {
|
|
58
66
|
afterInputsHTML: string;
|
|
59
67
|
}
|
|
60
68
|
export interface PageOverviewElements {
|
|
61
69
|
heading: string;
|
|
62
70
|
guidance: string;
|
|
71
|
+
addHeading: boolean;
|
|
63
72
|
}
|
|
64
73
|
export type PreviewQuestion = DateInputQuestion | EmailAddressQuestion | ListSortableQuestion | LongAnswerQuestion | PhoneNumberQuestion | Question | RadioSortableQuestion | SelectSortableQuestion | ShortAnswerQuestion | UkAddressQuestion | AutocompleteQuestion;
|
|
65
74
|
//# 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,E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,oBAAoB,CAAA"}
|
package/dist/types/stubs.d.ts
CHANGED
|
@@ -11,4 +11,7 @@ export { buildFileUploadPage } from './__stubs__/pages.js';
|
|
|
11
11
|
export { buildSummaryPage } from './__stubs__/pages.js';
|
|
12
12
|
export { buildQuestionPage } from './__stubs__/pages.js';
|
|
13
13
|
export { buildMarkdownComponent } from './__stubs__/components.js';
|
|
14
|
+
export { QuestionRendererStub } from './form/form-editor/__stubs__/preview.js';
|
|
15
|
+
export { PageRendererStub } from './form/form-editor/__stubs__/preview.js';
|
|
16
|
+
export { QuestionPreviewElements } from './form/form-editor/__stubs__/preview.js';
|
|
14
17
|
//# sourceMappingURL=stubs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/stubs.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA"}
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/stubs.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAA"}
|
package/package.json
CHANGED
|
@@ -96,28 +96,18 @@ export class QuestionPreviewElements {
|
|
|
96
96
|
* @private
|
|
97
97
|
*/
|
|
98
98
|
_items = []
|
|
99
|
-
_largeTitle = true
|
|
100
99
|
afterInputsHTML = '<div class="govuk-inset-text">No items added yet.</div>'
|
|
101
100
|
|
|
102
101
|
/**
|
|
103
102
|
* @param {BaseSettings} baseSettings
|
|
104
103
|
*/
|
|
105
|
-
constructor({
|
|
106
|
-
question,
|
|
107
|
-
hintText,
|
|
108
|
-
optional,
|
|
109
|
-
shortDesc,
|
|
110
|
-
items,
|
|
111
|
-
content,
|
|
112
|
-
largeTitle = true
|
|
113
|
-
}) {
|
|
104
|
+
constructor({ question, hintText, optional, shortDesc, items, content }) {
|
|
114
105
|
this._question = question
|
|
115
106
|
this._hintText = hintText
|
|
116
107
|
this._optional = optional
|
|
117
108
|
this._shortDesc = shortDesc
|
|
118
109
|
this._items = items
|
|
119
110
|
this._content = content
|
|
120
|
-
this._largeTitle = largeTitle
|
|
121
111
|
}
|
|
122
112
|
|
|
123
113
|
/**
|
|
@@ -130,8 +120,7 @@ export class QuestionPreviewElements {
|
|
|
130
120
|
optional: this._optional,
|
|
131
121
|
shortDesc: this._shortDesc,
|
|
132
122
|
items: this._items,
|
|
133
|
-
content: this._content
|
|
134
|
-
largeTitle: this._largeTitle
|
|
123
|
+
content: this._content
|
|
135
124
|
}
|
|
136
125
|
}
|
|
137
126
|
|
|
@@ -169,14 +158,17 @@ export class AutocompletePreviewElements extends QuestionPreviewElements {
|
|
|
169
158
|
export class PagePreviewElements {
|
|
170
159
|
guidance
|
|
171
160
|
heading
|
|
161
|
+
addHeading
|
|
172
162
|
|
|
173
163
|
/**
|
|
174
164
|
* @param {string} heading
|
|
175
165
|
* @param {string} guidance
|
|
166
|
+
* @param {boolean} [addHeading]
|
|
176
167
|
*/
|
|
177
|
-
constructor(heading, guidance = '') {
|
|
168
|
+
constructor(heading, guidance = '', addHeading = undefined) {
|
|
178
169
|
this.heading = heading
|
|
179
170
|
this.guidance = guidance
|
|
171
|
+
this.addHeading = addHeading ?? heading.length > 0
|
|
180
172
|
}
|
|
181
173
|
}
|
|
182
174
|
|
|
@@ -7,18 +7,11 @@ export class ComponentElements {
|
|
|
7
7
|
* @protected
|
|
8
8
|
*/
|
|
9
9
|
_component
|
|
10
|
-
/**
|
|
11
|
-
* @type {boolean}
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
_largeTitle = true
|
|
15
10
|
/**
|
|
16
11
|
* @param {ComponentDef} component
|
|
17
|
-
* @param {boolean} [largeTitle]
|
|
18
12
|
*/
|
|
19
|
-
constructor(component
|
|
13
|
+
constructor(component) {
|
|
20
14
|
this._component = component
|
|
21
|
-
this._largeTitle = largeTitle
|
|
22
15
|
}
|
|
23
16
|
|
|
24
17
|
/**
|
|
@@ -34,8 +27,7 @@ export class ComponentElements {
|
|
|
34
27
|
optional: !required,
|
|
35
28
|
shortDesc: '',
|
|
36
29
|
items: [],
|
|
37
|
-
content: ''
|
|
38
|
-
largeTitle: this._largeTitle
|
|
30
|
+
content: ''
|
|
39
31
|
}
|
|
40
32
|
}
|
|
41
33
|
|