@defra/forms-model 3.0.502 → 3.0.503
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/__stubs__/pages.js +14 -1
- package/dist/module/__stubs__/pages.js.map +1 -1
- package/dist/module/form/form-editor/preview/controller/guidance-page-controller.js +58 -0
- package/dist/module/form/form-editor/preview/controller/guidance-page-controller.js.map +1 -0
- package/dist/module/form/form-editor/preview/controller/page-controller-base.js +363 -0
- package/dist/module/form/form-editor/preview/controller/page-controller-base.js.map +1 -0
- package/dist/module/form/form-editor/preview/controller/page-controller.js +26 -265
- package/dist/module/form/form-editor/preview/controller/page-controller.js.map +1 -1
- package/dist/module/form/form-editor/preview/index.js +2 -0
- package/dist/module/form/form-editor/preview/index.js.map +1 -1
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/module/pages/helpers.js +2 -1
- package/dist/module/pages/helpers.js.map +1 -1
- package/dist/types/__stubs__/pages.d.ts +14 -0
- package/dist/types/__stubs__/pages.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/controller/guidance-page-controller.d.ts +10 -0
- package/dist/types/form/form-editor/preview/controller/guidance-page-controller.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/controller/page-controller-base.d.ts +198 -0
- package/dist/types/form/form-editor/preview/controller/page-controller-base.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts +3 -150
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/index.d.ts +2 -0
- package/dist/types/form/form-editor/preview/types.d.ts +3 -1
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/dist/types/pages/helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__stubs__/pages.ts +20 -1
- package/src/form/form-editor/preview/controller/guidance-page-controller.js +64 -0
- package/src/form/form-editor/preview/controller/page-controller-base.js +388 -0
- package/src/form/form-editor/preview/controller/page-controller.js +28 -288
- package/src/form/form-editor/preview/index.js +2 -0
- package/src/form/form-editor/preview/types.ts +4 -1
- package/src/pages/helpers.ts +2 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { buildFileUploadComponent } from "./components.js";
|
1
|
+
import { buildFileUploadComponent, buildMarkdownComponent } from "./components.js";
|
2
2
|
import { ComponentType } from "../components/enums.js";
|
3
3
|
import { ControllerPath, ControllerType } from "../pages/enums.js";
|
4
4
|
|
@@ -17,6 +17,19 @@ export function buildQuestionPage(partialPage) {
|
|
17
17
|
...partialPage
|
18
18
|
};
|
19
19
|
}
|
20
|
+
export const GUIDANCE_PAGE_CONTENT = 'Lorem ipsum dolar sit amet';
|
21
|
+
export function buildGuidancePage(partialPage) {
|
22
|
+
return {
|
23
|
+
id: 'a3fc003b-d380-43e8-9b87-9ca48ac8447f',
|
24
|
+
title: 'Guidance page',
|
25
|
+
path: '/guidance-page',
|
26
|
+
next: [],
|
27
|
+
components: [buildMarkdownComponent({
|
28
|
+
content: 'Lorem ipsum dolar sit amet'
|
29
|
+
})],
|
30
|
+
...partialPage
|
31
|
+
};
|
32
|
+
}
|
20
33
|
|
21
34
|
/**
|
22
35
|
* Stub builder for a Summary page
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pages.js","names":["buildFileUploadComponent","ComponentType","ControllerPath","ControllerType","buildQuestionPage","partialPage","id","title","path","next","components","buildSummaryPage","partialSummaryPage","Summary","controller","buildFileUploadPage","partialFileUploadPage","type","FileUploadField","name","shortDescription","hint","options","required","accept","FileUpload","buildRepeaterPage","partialRepeaterPage","TextField","schema","repeat","min","max","Repeat"],"sources":["../../../src/__stubs__/pages.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"file":"pages.js","names":["buildFileUploadComponent","buildMarkdownComponent","ComponentType","ControllerPath","ControllerType","buildQuestionPage","partialPage","id","title","path","next","components","GUIDANCE_PAGE_CONTENT","buildGuidancePage","content","buildSummaryPage","partialSummaryPage","Summary","controller","buildFileUploadPage","partialFileUploadPage","type","FileUploadField","name","shortDescription","hint","options","required","accept","FileUpload","buildRepeaterPage","partialRepeaterPage","TextField","schema","repeat","min","max","Repeat"],"sources":["../../../src/__stubs__/pages.ts"],"sourcesContent":["import {\n buildFileUploadComponent,\n buildMarkdownComponent\n} from '~/src/__stubs__/components.js'\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type PageFileUpload,\n type PageQuestion,\n type PageRepeat,\n type PageSummary\n} from '~/src/form/form-definition/types.js'\nimport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n\n/**\n * Stub builder for a question page\n * @param {Partial<PageQuestion>} [partialPage]\n * @returns {PageQuestion}\n */\nexport function buildQuestionPage(\n partialPage: Partial<PageQuestion>\n): PageQuestion {\n return {\n id: 'ffefd409-f3f4-49fe-882e-6e89f44631b1',\n title: 'Page One',\n path: '/page-one',\n next: [],\n components: [],\n ...partialPage\n }\n}\n\nexport const GUIDANCE_PAGE_CONTENT = 'Lorem ipsum dolar sit amet'\nexport function buildGuidancePage(partialPage: Partial<PageQuestion>) {\n return {\n id: 'a3fc003b-d380-43e8-9b87-9ca48ac8447f',\n title: 'Guidance page',\n path: '/guidance-page',\n next: [],\n components: [\n buildMarkdownComponent({\n content: 'Lorem ipsum dolar sit amet'\n })\n ],\n ...partialPage\n }\n}\n\n/**\n * Stub builder for a Summary page\n * @param {Partial<PageSummary>} [partialSummaryPage]\n */\nexport function buildSummaryPage(\n partialSummaryPage: Partial<PageSummary> = {}\n): PageSummary {\n return {\n id: '449a45f6-4541-4a46-91bd-8b8931b07b50',\n title: 'Summary page',\n ...partialSummaryPage,\n path: ControllerPath.Summary,\n controller: ControllerType.Summary\n }\n}\n\n/**\n *\n * @param {Partial<PageFileUpload>} partialFileUploadPage\n * @returns {PageFileUpload}\n */\nexport function buildFileUploadPage(\n partialFileUploadPage: Partial<PageFileUpload> = {}\n): PageFileUpload {\n return {\n id: '85e5c8da-88f5-4009-a821-7d7de1364318',\n title: '',\n path: '/supporting-evidence',\n components: [\n buildFileUploadComponent({\n type: ComponentType.FileUploadField,\n title: 'Supporting Evidence',\n name: 'yBpZQO',\n shortDescription: 'Supporting evidence',\n hint: '',\n options: {\n required: true,\n accept:\n 'application/pdf,application/msword,image/jpeg,application/vnd.ms-excel,text/csv'\n },\n id: '4189b8a1-1a04-4f74-a7a0-dd23012a0ee0'\n })\n ],\n next: [],\n ...partialFileUploadPage,\n controller: ControllerType.FileUpload\n }\n}\n\n/**\n *\n * @param {Partial<PageRepeat>} partialRepeaterPage\n * @returns {PageRepeat}\n */\nexport function buildRepeaterPage(\n partialRepeaterPage: Partial<PageRepeat> = {}\n): PageRepeat {\n return {\n title: 'Repeater Page',\n path: '/repeater-page',\n components: [\n {\n type: ComponentType.TextField,\n title: 'Simple text field',\n name: 'IHAIzC',\n shortDescription: 'Your simple text field',\n hint: '',\n options: {},\n schema: {},\n id: 'ee83413e-31b6-4158-98e0-4611479582ce'\n }\n ],\n next: [],\n id: '32888028-61db-40fc-b255-80bc67829d31',\n repeat: {\n options: { name: 'fawfed', title: 'Simple question responses' },\n schema: { min: 1, max: 3 }\n },\n ...partialRepeaterPage,\n controller: ControllerType.Repeat\n }\n}\n"],"mappings":"AAAA,SACEA,wBAAwB,EACxBC,sBAAsB;AAExB,SAASC,aAAa;AAOtB,SAASC,cAAc,EAAEC,cAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,WAAkC,EACpB;EACd,OAAO;IACLC,EAAE,EAAE,sCAAsC;IAC1CC,KAAK,EAAE,UAAU;IACjBC,IAAI,EAAE,WAAW;IACjBC,IAAI,EAAE,EAAE;IACRC,UAAU,EAAE,EAAE;IACd,GAAGL;EACL,CAAC;AACH;AAEA,OAAO,MAAMM,qBAAqB,GAAG,4BAA4B;AACjE,OAAO,SAASC,iBAAiBA,CAACP,WAAkC,EAAE;EACpE,OAAO;IACLC,EAAE,EAAE,sCAAsC;IAC1CC,KAAK,EAAE,eAAe;IACtBC,IAAI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B,KAAK,EAAE,mBAAmB;MAC1Be,IAAI,EAAE,QAAQ;MACdC,gBAAgB,EAAE,wBAAwB;MAC1CC,IAAI,EAAE,EAAE;MACRC,OAAO,EAAE,CAAC,CAAC;MACXO,MAAM,EAAE,CAAC,CAAC;MACV1B,EAAE,EAAE;IACN,CAAC,CACF;IACDG,IAAI,EAAE,EAAE;IACRH,EAAE,EAAE,sCAAsC;IAC1C2B,MAAM,EAAE;MACNR,OAAO,EAAE;QAAEH,IAAI,EAAE,QAAQ;QAAEf,KAAK,EAAE;MAA4B,CAAC;MAC/DyB,MAAM,EAAE;QAAEE,GAAG,EAAE,CAAC;QAAEC,GAAG,EAAE;MAAE;IAC3B,CAAC;IACD,GAAGL,mBAAmB;IACtBb,UAAU,EAAEd,cAAc,CAACiC;EAC7B,CAAC;AACH","ignoreList":[]}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { PreviewPageControllerBase } from "./page-controller-base.js";
|
2
|
+
const FALLBACK_GUIDANCE_TEXT = 'Guidance text';
|
3
|
+
export class GuidancePageController extends PreviewPageControllerBase {
|
4
|
+
/**
|
5
|
+
* @type {Markdown}
|
6
|
+
* @protected
|
7
|
+
*/
|
8
|
+
_unhighlightedEmptyGuidance = PreviewPageControllerBase.createGuidanceComponent(false);
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @type {Markdown}
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
_guidanceComponent = PreviewPageControllerBase.createGuidanceComponent(false);
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @param {PagePreviewBaseElements} elements
|
18
|
+
* @param {PageRenderer} renderer
|
19
|
+
*/
|
20
|
+
constructor(elements, renderer) {
|
21
|
+
super(elements, renderer);
|
22
|
+
if (elements.guidance.length) {
|
23
|
+
this._guidanceComponent.content = elements.guidance;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* @returns {Markdown[]}
|
29
|
+
* @protected
|
30
|
+
*/
|
31
|
+
_getGuidanceComponents() {
|
32
|
+
if (this._guidanceText.length) {
|
33
|
+
return [this._guidanceComponent];
|
34
|
+
}
|
35
|
+
if (this._isHighlighted(PreviewPageControllerBase.HighlightClass.GUIDANCE)) {
|
36
|
+
return [this._emptyGuidance];
|
37
|
+
}
|
38
|
+
return [this._unhighlightedEmptyGuidance];
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* @returns {string}
|
43
|
+
* @protected
|
44
|
+
*/
|
45
|
+
_getGuidanceText() {
|
46
|
+
const guidanceText = super._getGuidanceText();
|
47
|
+
if (!guidanceText.length) {
|
48
|
+
return FALLBACK_GUIDANCE_TEXT;
|
49
|
+
}
|
50
|
+
return super._getGuidanceText();
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @import { Markdown } from '~/src/form/form-editor/preview/markdown.js'
|
56
|
+
* @import { PageRenderer, PagePreviewBaseElements } from '~/src/form/form-editor/preview/types.js'
|
57
|
+
*/
|
58
|
+
//# sourceMappingURL=guidance-page-controller.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"guidance-page-controller.js","names":["PreviewPageControllerBase","FALLBACK_GUIDANCE_TEXT","GuidancePageController","_unhighlightedEmptyGuidance","createGuidanceComponent","_guidanceComponent","constructor","elements","renderer","guidance","length","content","_getGuidanceComponents","_guidanceText","_isHighlighted","HighlightClass","GUIDANCE","_emptyGuidance","_getGuidanceText","guidanceText"],"sources":["../../../../../../src/form/form-editor/preview/controller/guidance-page-controller.js"],"sourcesContent":["import { PreviewPageControllerBase } from '~/src/form/form-editor/preview/controller/page-controller-base.js'\n\nconst FALLBACK_GUIDANCE_TEXT = 'Guidance text'\n\nexport class GuidancePageController extends PreviewPageControllerBase {\n /**\n * @type {Markdown}\n * @protected\n */\n _unhighlightedEmptyGuidance =\n PreviewPageControllerBase.createGuidanceComponent(false)\n\n /**\n * @type {Markdown}\n * @protected\n */\n _guidanceComponent = PreviewPageControllerBase.createGuidanceComponent(false)\n\n /**\n * @param {PagePreviewBaseElements} elements\n * @param {PageRenderer} renderer\n */\n constructor(elements, renderer) {\n super(elements, renderer)\n if (elements.guidance.length) {\n this._guidanceComponent.content = elements.guidance\n }\n }\n\n /**\n * @returns {Markdown[]}\n * @protected\n */\n _getGuidanceComponents() {\n if (this._guidanceText.length) {\n return [this._guidanceComponent]\n }\n\n if (\n this._isHighlighted(PreviewPageControllerBase.HighlightClass.GUIDANCE)\n ) {\n return [this._emptyGuidance]\n }\n\n return [this._unhighlightedEmptyGuidance]\n }\n\n /**\n * @returns {string}\n * @protected\n */\n _getGuidanceText() {\n const guidanceText = super._getGuidanceText()\n if (!guidanceText.length) {\n return FALLBACK_GUIDANCE_TEXT\n }\n return super._getGuidanceText()\n }\n}\n\n/**\n * @import { Markdown } from '~/src/form/form-editor/preview/markdown.js'\n * @import { PageRenderer, PagePreviewBaseElements } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,yBAAyB;AAElC,MAAMC,sBAAsB,GAAG,eAAe;AAE9C,OAAO,MAAMC,sBAAsB,SAASF,yBAAyB,CAAC;EACpE;AACF;AACA;AACA;EACEG,2BAA2B,GACzBH,yBAAyB,CAACI,uBAAuB,CAAC,KAAK,CAAC;;EAE1D;AACF;AACA;AACA;EACEC,kBAAkB,GAAGL,yBAAyB,CAACI,uBAAuB,CAAC,KAAK,CAAC;;EAE7E;AACF;AACA;AACA;EACEE,WAAWA,CAACC,QAAQ,EAAEC,QAAQ,EAAE;IAC9B,KAAK,CAACD,QAAQ,EAAEC,QAAQ,CAAC;IACzB,IAAID,QAAQ,CAACE,QAAQ,CAACC,MAAM,EAAE;MAC5B,IAAI,CAACL,kBAAkB,CAACM,OAAO,GAAGJ,QAAQ,CAACE,QAAQ;IACrD;EACF;;EAEA;AACF;AACA;AACA;EACEG,sBAAsBA,CAAA,EAAG;IACvB,IAAI,IAAI,CAACC,aAAa,CAACH,MAAM,EAAE;MAC7B,OAAO,CAAC,IAAI,CAACL,kBAAkB,CAAC;IAClC;IAEA,IACE,IAAI,CAACS,cAAc,CAACd,yBAAyB,CAACe,cAAc,CAACC,QAAQ,CAAC,EACtE;MACA,OAAO,CAAC,IAAI,CAACC,cAAc,CAAC;IAC9B;IAEA,OAAO,CAAC,IAAI,CAACd,2BAA2B,CAAC;EAC3C;;EAEA;AACF;AACA;AACA;EACEe,gBAAgBA,CAAA,EAAG;IACjB,MAAMC,YAAY,GAAG,KAAK,CAACD,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAACC,YAAY,CAACT,MAAM,EAAE;MACxB,OAAOT,sBAAsB;IAC/B;IACA,OAAO,KAAK,CAACiB,gBAAgB,CAAC,CAAC;EACjC;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -0,0 +1,363 @@
|
|
1
|
+
import { ComponentType } from "../../../../components/enums.js";
|
2
|
+
import { HIGHLIGHT_CLASS } from "../constants.js";
|
3
|
+
import { ContentElements } from "../content.js";
|
4
|
+
import { Markdown } from "../markdown.js";
|
5
|
+
import { hasComponents, hasRepeater } from "../../../../pages/helpers.js";
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @type {QuestionRenderer}
|
9
|
+
*/
|
10
|
+
const questionRenderer = {
|
11
|
+
/**
|
12
|
+
* @param {string} _questionTemplate
|
13
|
+
* @param {QuestionBaseModel} _questionBaseModel
|
14
|
+
*/
|
15
|
+
render(_questionTemplate, _questionBaseModel) {
|
16
|
+
//
|
17
|
+
}
|
18
|
+
};
|
19
|
+
/**
|
20
|
+
* Enum for Highlight classes
|
21
|
+
* @readonly
|
22
|
+
* @enum {string}
|
23
|
+
*/
|
24
|
+
const HighlightClass = {
|
25
|
+
TITLE: 'title',
|
26
|
+
GUIDANCE: 'guidance',
|
27
|
+
REPEATER: 'repeater'
|
28
|
+
};
|
29
|
+
|
30
|
+
/**
|
31
|
+
* @implements {PageOverviewElements}
|
32
|
+
*/
|
33
|
+
export class PagePreviewElements {
|
34
|
+
/**
|
35
|
+
* @type {Page | { title: string }}
|
36
|
+
* @private
|
37
|
+
*/
|
38
|
+
_page = {
|
39
|
+
title: ''
|
40
|
+
};
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @param {Page|undefined} page
|
44
|
+
*/
|
45
|
+
constructor(page) {
|
46
|
+
if (page !== undefined) {
|
47
|
+
this._page = page;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
get heading() {
|
51
|
+
return this._page.title;
|
52
|
+
}
|
53
|
+
get guidance() {
|
54
|
+
if (!hasComponents(this._page) || !this._page.components.length) {
|
55
|
+
return '';
|
56
|
+
}
|
57
|
+
const [possibleGuidanceComponent] = this._page.components;
|
58
|
+
return possibleGuidanceComponent.type === ComponentType.Markdown ? possibleGuidanceComponent.content : '';
|
59
|
+
}
|
60
|
+
get addHeading() {
|
61
|
+
return this._page.title.length > 0;
|
62
|
+
}
|
63
|
+
get repeatQuestion() {
|
64
|
+
if (hasRepeater(this._page)) {
|
65
|
+
return this._page.repeat.options.title;
|
66
|
+
}
|
67
|
+
return undefined;
|
68
|
+
}
|
69
|
+
get hasRepeater() {
|
70
|
+
return hasRepeater(this._page);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* @abstract
|
76
|
+
* @implements {PagePreviewPanelMacro}
|
77
|
+
*/
|
78
|
+
export class PreviewPageControllerBase {
|
79
|
+
static PATH = 'preview-controllers/';
|
80
|
+
/**
|
81
|
+
* @type {string}
|
82
|
+
* @protected
|
83
|
+
*/
|
84
|
+
_pageTemplate = PreviewPageControllerBase.PATH + 'page-controller.njk';
|
85
|
+
/**
|
86
|
+
* @protected
|
87
|
+
* @type {Question[]}
|
88
|
+
*/
|
89
|
+
_components = [];
|
90
|
+
/**
|
91
|
+
* @type {boolean}
|
92
|
+
* @protected
|
93
|
+
*/
|
94
|
+
_showTitle = true;
|
95
|
+
/**
|
96
|
+
* @protected
|
97
|
+
* @type {string}
|
98
|
+
*/
|
99
|
+
_title = '';
|
100
|
+
/**
|
101
|
+
*
|
102
|
+
* @type {PageRenderer}
|
103
|
+
*/
|
104
|
+
#pageRenderer;
|
105
|
+
/**
|
106
|
+
* @type { undefined | HighlightClass }
|
107
|
+
* @protected
|
108
|
+
*/
|
109
|
+
_highlighted = undefined;
|
110
|
+
/**
|
111
|
+
* @type {string}
|
112
|
+
* @protected
|
113
|
+
*/
|
114
|
+
_guidanceText = '';
|
115
|
+
/**
|
116
|
+
* @type { string }
|
117
|
+
* @protected
|
118
|
+
*/
|
119
|
+
_sectionTitle = '';
|
120
|
+
/**
|
121
|
+
* @type {Markdown}
|
122
|
+
* @protected
|
123
|
+
*/
|
124
|
+
_emptyGuidance = PreviewPageControllerBase.createGuidanceComponent();
|
125
|
+
/**
|
126
|
+
* @type {Markdown}
|
127
|
+
* @protected
|
128
|
+
*/
|
129
|
+
_guidanceComponent = PreviewPageControllerBase.createGuidanceComponent();
|
130
|
+
/**
|
131
|
+
* @protected
|
132
|
+
* @type {boolean}
|
133
|
+
*/
|
134
|
+
_isRepeater = false;
|
135
|
+
|
136
|
+
/**
|
137
|
+
* @param {PagePreviewBaseElements} elements
|
138
|
+
* @param {PageRenderer} renderer
|
139
|
+
*/
|
140
|
+
constructor(elements, renderer) {
|
141
|
+
this._guidanceText = elements.guidance;
|
142
|
+
this.#pageRenderer = renderer;
|
143
|
+
this._title = elements.heading;
|
144
|
+
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* @type {typeof HighlightClass}
|
148
|
+
*/
|
149
|
+
static HighlightClass = HighlightClass;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* @returns {Markdown[]}
|
153
|
+
* @protected
|
154
|
+
*/
|
155
|
+
_getGuidanceComponents() {
|
156
|
+
if (this._guidanceText.length) {
|
157
|
+
return [this._guidanceComponent];
|
158
|
+
}
|
159
|
+
if (this._highlighted === 'guidance') {
|
160
|
+
return [this._emptyGuidance];
|
161
|
+
}
|
162
|
+
return [];
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* @returns {Markdown[]}
|
167
|
+
* @protected
|
168
|
+
*/
|
169
|
+
get _guidanceComponents() {
|
170
|
+
return this._getGuidanceComponents();
|
171
|
+
}
|
172
|
+
|
173
|
+
/**
|
174
|
+
* @returns {PagePreviewComponent[]}
|
175
|
+
*/
|
176
|
+
get components() {
|
177
|
+
const componentsWithGuidance = /** @type {Question[]} */[...this._guidanceComponents, ...this._components];
|
178
|
+
return componentsWithGuidance.map(component => {
|
179
|
+
return {
|
180
|
+
model: component.renderInput,
|
181
|
+
questionType: component.componentType
|
182
|
+
};
|
183
|
+
});
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* @returns {string}
|
188
|
+
* @protected
|
189
|
+
*/
|
190
|
+
_getGuidanceText() {
|
191
|
+
return this._guidanceText;
|
192
|
+
}
|
193
|
+
set guidanceText(text) {
|
194
|
+
this._guidanceText = text;
|
195
|
+
this._guidanceComponent.content = text;
|
196
|
+
this.render();
|
197
|
+
}
|
198
|
+
|
199
|
+
/**
|
200
|
+
* @returns {string}
|
201
|
+
*/
|
202
|
+
get guidanceText() {
|
203
|
+
return this._getGuidanceText();
|
204
|
+
}
|
205
|
+
get guidance() {
|
206
|
+
return {
|
207
|
+
text: this.guidanceText,
|
208
|
+
classes: this._isHighlighted(HighlightClass.GUIDANCE)
|
209
|
+
};
|
210
|
+
}
|
211
|
+
|
212
|
+
/**
|
213
|
+
* @param {boolean} showTitle
|
214
|
+
*/
|
215
|
+
set showTitle(showTitle) {
|
216
|
+
this._showTitle = showTitle;
|
217
|
+
this.render();
|
218
|
+
}
|
219
|
+
get showTitle() {
|
220
|
+
return this._showTitle;
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* @returns {{ text: string, classes: string }}
|
225
|
+
*/
|
226
|
+
get pageTitle() {
|
227
|
+
return {
|
228
|
+
text: this.title,
|
229
|
+
classes: this._isHighlighted(HighlightClass.TITLE)
|
230
|
+
};
|
231
|
+
}
|
232
|
+
setRepeater() {
|
233
|
+
this._isRepeater = true;
|
234
|
+
this.render();
|
235
|
+
}
|
236
|
+
unsetRepeater() {
|
237
|
+
this._isRepeater = false;
|
238
|
+
this.render();
|
239
|
+
}
|
240
|
+
get isRepeater() {
|
241
|
+
return this._isRepeater;
|
242
|
+
}
|
243
|
+
render() {
|
244
|
+
this.#pageRenderer.render(this._pageTemplate, this);
|
245
|
+
}
|
246
|
+
|
247
|
+
/**
|
248
|
+
* @returns {string}
|
249
|
+
* @protected
|
250
|
+
*/
|
251
|
+
_getTitle() {
|
252
|
+
if (this._title.length) {
|
253
|
+
return this._title;
|
254
|
+
}
|
255
|
+
return 'Page heading';
|
256
|
+
}
|
257
|
+
|
258
|
+
/**
|
259
|
+
* @returns {string}
|
260
|
+
*/
|
261
|
+
get title() {
|
262
|
+
return this._getTitle();
|
263
|
+
}
|
264
|
+
|
265
|
+
/**
|
266
|
+
* @param {string} value
|
267
|
+
*/
|
268
|
+
set title(value) {
|
269
|
+
this._title = value;
|
270
|
+
this.render();
|
271
|
+
}
|
272
|
+
highlightTitle() {
|
273
|
+
this.setHighLighted(HighlightClass.TITLE);
|
274
|
+
}
|
275
|
+
|
276
|
+
/**
|
277
|
+
* @returns {{classes: string, text: string} | undefined}
|
278
|
+
*/
|
279
|
+
get sectionTitle() {
|
280
|
+
if (this.sectionTitleText === undefined) {
|
281
|
+
return undefined;
|
282
|
+
}
|
283
|
+
return {
|
284
|
+
classes: this._isHighlighted(HighlightClass.REPEATER),
|
285
|
+
text: this.sectionTitleText
|
286
|
+
};
|
287
|
+
}
|
288
|
+
|
289
|
+
/**
|
290
|
+
* @returns {string|undefined}
|
291
|
+
* @protected
|
292
|
+
*/
|
293
|
+
_getSectionTitleText() {
|
294
|
+
return this._sectionTitle;
|
295
|
+
}
|
296
|
+
|
297
|
+
/**
|
298
|
+
* @param {string | undefined} val
|
299
|
+
*/
|
300
|
+
set sectionTitleText(val) {
|
301
|
+
this._sectionTitle = val ?? '';
|
302
|
+
this.render();
|
303
|
+
}
|
304
|
+
get sectionTitleText() {
|
305
|
+
return this._getSectionTitleText();
|
306
|
+
}
|
307
|
+
|
308
|
+
/**
|
309
|
+
* Creates a dummy component for when guidance is highlighted
|
310
|
+
* but no guidance text exists
|
311
|
+
* @returns {Markdown}
|
312
|
+
*/
|
313
|
+
static createGuidanceComponent(highlight = true) {
|
314
|
+
const guidanceElement = new ContentElements({
|
315
|
+
type: ComponentType.Markdown,
|
316
|
+
title: 'Guidance component',
|
317
|
+
name: 'guidanceComponent',
|
318
|
+
content: 'Guidance text',
|
319
|
+
options: {}
|
320
|
+
});
|
321
|
+
const guidanceComponent = new Markdown(guidanceElement, questionRenderer);
|
322
|
+
if (highlight) {
|
323
|
+
guidanceComponent.highlightContent();
|
324
|
+
}
|
325
|
+
return guidanceComponent;
|
326
|
+
}
|
327
|
+
highlightGuidance() {
|
328
|
+
this._guidanceComponent.highlightContent();
|
329
|
+
this.setHighLighted(HighlightClass.GUIDANCE);
|
330
|
+
}
|
331
|
+
|
332
|
+
/**
|
333
|
+
* @param {HighlightClass} highlightSection
|
334
|
+
*/
|
335
|
+
setHighLighted(highlightSection) {
|
336
|
+
this._highlighted = highlightSection;
|
337
|
+
this.render();
|
338
|
+
}
|
339
|
+
clearHighlight() {
|
340
|
+
this._highlighted = undefined;
|
341
|
+
this._guidanceComponent.unHighlightContent();
|
342
|
+
this.render();
|
343
|
+
}
|
344
|
+
|
345
|
+
/**
|
346
|
+
* @param {string} field
|
347
|
+
* @protected
|
348
|
+
* @returns {string}
|
349
|
+
*/
|
350
|
+
_isHighlighted(field) {
|
351
|
+
return this._highlighted === field ? HIGHLIGHT_CLASS : '';
|
352
|
+
}
|
353
|
+
}
|
354
|
+
|
355
|
+
/**
|
356
|
+
* @import { PageRenderer, PageOverviewElements, PagePreviewBaseElements, QuestionRenderer, QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'
|
357
|
+
* @import { Question } from '~/src/form/form-editor/preview/question.js'
|
358
|
+
* @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'
|
359
|
+
* @import { FormDefinition, Page } from '~/src/form/form-definition/types.js'
|
360
|
+
* @import { ComponentDef, MarkdownComponent } from '~/src/components/types.js'
|
361
|
+
* @import { PagePreviewComponent, PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'
|
362
|
+
*/
|
363
|
+
//# sourceMappingURL=page-controller-base.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"page-controller-base.js","names":["ComponentType","HIGHLIGHT_CLASS","ContentElements","Markdown","hasComponents","hasRepeater","questionRenderer","render","_questionTemplate","_questionBaseModel","HighlightClass","TITLE","GUIDANCE","REPEATER","PagePreviewElements","_page","title","constructor","page","undefined","heading","guidance","components","length","possibleGuidanceComponent","type","content","addHeading","repeatQuestion","repeat","options","PreviewPageControllerBase","PATH","_pageTemplate","_components","_showTitle","_title","pageRenderer","_highlighted","_guidanceText","_sectionTitle","_emptyGuidance","createGuidanceComponent","_guidanceComponent","_isRepeater","elements","renderer","_getGuidanceComponents","_guidanceComponents","componentsWithGuidance","map","component","model","renderInput","questionType","componentType","_getGuidanceText","guidanceText","text","classes","_isHighlighted","showTitle","pageTitle","setRepeater","unsetRepeater","isRepeater","_getTitle","value","highlightTitle","setHighLighted","sectionTitle","sectionTitleText","_getSectionTitleText","val","highlight","guidanceElement","name","guidanceComponent","highlightContent","highlightGuidance","highlightSection","clearHighlight","unHighlightContent","field"],"sources":["../../../../../../src/form/form-editor/preview/controller/page-controller-base.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { ContentElements } from '~/src/form/form-editor/preview/content.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { hasComponents, hasRepeater } from '~/src/pages/helpers.js'\n\n/**\n * @type {QuestionRenderer}\n */\nconst questionRenderer = {\n /**\n * @param {string} _questionTemplate\n * @param {QuestionBaseModel} _questionBaseModel\n */\n render(_questionTemplate, _questionBaseModel) {\n //\n }\n}\n/**\n * Enum for Highlight classes\n * @readonly\n * @enum {string}\n */\nconst HighlightClass = {\n TITLE: 'title',\n GUIDANCE: 'guidance',\n REPEATER: 'repeater'\n}\n\n/**\n * @implements {PageOverviewElements}\n */\nexport class PagePreviewElements {\n /**\n * @type {Page | { title: string }}\n * @private\n */\n _page = {\n title: ''\n }\n\n /**\n * @param {Page|undefined} page\n */\n constructor(page) {\n if (page !== undefined) {\n this._page = page\n }\n }\n\n get heading() {\n return this._page.title\n }\n\n get guidance() {\n if (!hasComponents(this._page) || !this._page.components.length) {\n return ''\n }\n\n const [possibleGuidanceComponent] = this._page.components\n\n return possibleGuidanceComponent.type === ComponentType.Markdown\n ? possibleGuidanceComponent.content\n : ''\n }\n\n get addHeading() {\n return this._page.title.length > 0\n }\n\n get repeatQuestion() {\n if (hasRepeater(this._page)) {\n return this._page.repeat.options.title\n }\n return undefined\n }\n\n get hasRepeater() {\n return hasRepeater(this._page)\n }\n}\n\n/**\n * @abstract\n * @implements {PagePreviewPanelMacro}\n */\nexport class PreviewPageControllerBase {\n static PATH = 'preview-controllers/'\n /**\n * @type {string}\n * @protected\n */\n _pageTemplate = PreviewPageControllerBase.PATH + 'page-controller.njk'\n /**\n * @protected\n * @type {Question[]}\n */\n _components = []\n /**\n * @type {boolean}\n * @protected\n */\n _showTitle = true\n /**\n * @protected\n * @type {string}\n */\n _title = ''\n /**\n *\n * @type {PageRenderer}\n */\n #pageRenderer\n /**\n * @type { undefined | HighlightClass }\n * @protected\n */\n _highlighted = undefined\n /**\n * @type {string}\n * @protected\n */\n _guidanceText = ''\n /**\n * @type { string }\n * @protected\n */\n _sectionTitle = ''\n /**\n * @type {Markdown}\n * @protected\n */\n _emptyGuidance = PreviewPageControllerBase.createGuidanceComponent()\n /**\n * @type {Markdown}\n * @protected\n */\n _guidanceComponent = PreviewPageControllerBase.createGuidanceComponent()\n /**\n * @protected\n * @type {boolean}\n */\n _isRepeater = false\n\n /**\n * @param {PagePreviewBaseElements} elements\n * @param {PageRenderer} renderer\n */\n constructor(elements, renderer) {\n this._guidanceText = elements.guidance\n this.#pageRenderer = renderer\n this._title = elements.heading\n }\n\n /**\n * @type {typeof HighlightClass}\n */\n static HighlightClass = HighlightClass\n\n /**\n * @returns {Markdown[]}\n * @protected\n */\n _getGuidanceComponents() {\n if (this._guidanceText.length) {\n return [this._guidanceComponent]\n }\n if (this._highlighted === 'guidance') {\n return [this._emptyGuidance]\n }\n return []\n }\n\n /**\n * @returns {Markdown[]}\n * @protected\n */\n get _guidanceComponents() {\n return this._getGuidanceComponents()\n }\n\n /**\n * @returns {PagePreviewComponent[]}\n */\n get components() {\n const componentsWithGuidance = /** @type {Question[]} */ ([\n ...this._guidanceComponents,\n ...this._components\n ])\n\n return componentsWithGuidance.map((component) => {\n return {\n model: component.renderInput,\n questionType: component.componentType\n }\n })\n }\n\n /**\n * @returns {string}\n * @protected\n */\n _getGuidanceText() {\n return this._guidanceText\n }\n\n set guidanceText(text) {\n this._guidanceText = text\n this._guidanceComponent.content = text\n this.render()\n }\n\n /**\n * @returns {string}\n */\n get guidanceText() {\n return this._getGuidanceText()\n }\n\n get guidance() {\n return {\n text: this.guidanceText,\n classes: this._isHighlighted(HighlightClass.GUIDANCE)\n }\n }\n\n /**\n * @param {boolean} showTitle\n */\n set showTitle(showTitle) {\n this._showTitle = showTitle\n this.render()\n }\n\n get showTitle() {\n return this._showTitle\n }\n\n /**\n * @returns {{ text: string, classes: string }}\n */\n get pageTitle() {\n return {\n text: this.title,\n classes: this._isHighlighted(HighlightClass.TITLE)\n }\n }\n\n setRepeater() {\n this._isRepeater = true\n this.render()\n }\n\n unsetRepeater() {\n this._isRepeater = false\n this.render()\n }\n\n get isRepeater() {\n return this._isRepeater\n }\n\n render() {\n this.#pageRenderer.render(this._pageTemplate, this)\n }\n\n /**\n * @returns {string}\n * @protected\n */\n _getTitle() {\n if (this._title.length) {\n return this._title\n }\n return 'Page heading'\n }\n\n /**\n * @returns {string}\n */\n get title() {\n return this._getTitle()\n }\n\n /**\n * @param {string} value\n */\n set title(value) {\n this._title = value\n this.render()\n }\n\n highlightTitle() {\n this.setHighLighted(HighlightClass.TITLE)\n }\n\n /**\n * @returns {{classes: string, text: string} | undefined}\n */\n get sectionTitle() {\n if (this.sectionTitleText === undefined) {\n return undefined\n }\n return {\n classes: this._isHighlighted(HighlightClass.REPEATER),\n text: this.sectionTitleText\n }\n }\n\n /**\n * @returns {string|undefined}\n * @protected\n */\n _getSectionTitleText() {\n return this._sectionTitle\n }\n\n /**\n * @param {string | undefined} val\n */\n set sectionTitleText(val) {\n this._sectionTitle = val ?? ''\n this.render()\n }\n\n get sectionTitleText() {\n return this._getSectionTitleText()\n }\n\n /**\n * Creates a dummy component for when guidance is highlighted\n * but no guidance text exists\n * @returns {Markdown}\n */\n static createGuidanceComponent(highlight = true) {\n const guidanceElement = new ContentElements({\n type: ComponentType.Markdown,\n title: 'Guidance component',\n name: 'guidanceComponent',\n content: 'Guidance text',\n options: {}\n })\n const guidanceComponent = new Markdown(guidanceElement, questionRenderer)\n\n if (highlight) {\n guidanceComponent.highlightContent()\n }\n return guidanceComponent\n }\n\n highlightGuidance() {\n this._guidanceComponent.highlightContent()\n this.setHighLighted(HighlightClass.GUIDANCE)\n }\n\n /**\n * @param {HighlightClass} highlightSection\n */\n setHighLighted(highlightSection) {\n this._highlighted = highlightSection\n this.render()\n }\n\n clearHighlight() {\n this._highlighted = undefined\n\n this._guidanceComponent.unHighlightContent()\n this.render()\n }\n\n /**\n * @param {string} field\n * @protected\n * @returns {string}\n */\n _isHighlighted(field) {\n return this._highlighted === field ? HIGHLIGHT_CLASS : ''\n }\n}\n\n/**\n * @import { PageRenderer, PageOverviewElements, PagePreviewBaseElements, QuestionRenderer, QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'\n * @import { Question } from '~/src/form/form-editor/preview/question.js'\n * @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n * @import { FormDefinition, Page } from '~/src/form/form-definition/types.js'\n * @import { ComponentDef, MarkdownComponent } from '~/src/components/types.js'\n * @import { PagePreviewComponent, PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,eAAe;AACxB,SAASC,QAAQ;AACjB,SAASC,aAAa,EAAEC,WAAW;;AAEnC;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACvB;AACF;AACA;AACA;EACEC,MAAMA,CAACC,iBAAiB,EAAEC,kBAAkB,EAAE;IAC5C;EAAA;AAEJ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG;EACrBC,KAAK,EAAE,OAAO;EACdC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAC;EAC/B;AACF;AACA;AACA;EACEC,KAAK,GAAG;IACNC,KAAK,EAAE;EACT,CAAC;;EAED;AACF;AACA;EACEC,WAAWA,CAACC,IAAI,EAAE;IAChB,IAAIA,IAAI,KAAKC,SAAS,EAAE;MACtB,IAAI,CAACJ,KAAK,GAAGG,IAAI;IACnB;EACF;EAEA,IAAIE,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACL,KAAK,CAACC,KAAK;EACzB;EAEA,IAAIK,QAAQA,CAAA,EAAG;IACb,IAAI,CAACjB,aAAa,CAAC,IAAI,CAACW,KAAK,CAAC,IAAI,CAAC,IAAI,CAACA,KAAK,CAACO,UAAU,CAACC,MAAM,EAAE;MAC/D,OAAO,EAAE;IACX;IAEA,MAAM,CAACC,yBAAyB,CAAC,GAAG,IAAI,CAACT,KAAK,CAACO,UAAU;IAEzD,OAAOE,yBAAyB,CAACC,IAAI,KAAKzB,aAAa,CAACG,QAAQ,GAC5DqB,yBAAyB,CAACE,OAAO,GACjC,EAAE;EACR;EAEA,IAAIC,UAAUA,CAAA,EAAG;IACf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