@defra/forms-model 3.0.480 → 3.0.482
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 +83 -4
- package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
- package/dist/module/form/form-editor/index.js +2 -2
- package/dist/module/form/form-editor/index.js.map +1 -1
- package/dist/module/form/form-editor/macros/types.js +2 -0
- package/dist/module/form/form-editor/macros/types.js.map +1 -0
- package/dist/module/form/form-editor/preview/autocomplete.js +20 -4
- package/dist/module/form/form-editor/preview/autocomplete.js.map +1 -1
- package/dist/module/form/form-editor/preview/checkbox-sortable.js +7 -2
- package/dist/module/form/form-editor/preview/checkbox-sortable.js.map +1 -1
- package/dist/module/form/form-editor/preview/checkbox.js +17 -0
- package/dist/module/form/form-editor/preview/checkbox.js.map +1 -0
- package/dist/module/form/form-editor/preview/component-elements.js +61 -0
- package/dist/module/form/form-editor/preview/component-elements.js.map +1 -0
- package/dist/module/form/form-editor/preview/constants.js +2 -0
- package/dist/module/form/form-editor/preview/constants.js.map +1 -0
- package/dist/module/form/form-editor/preview/content.js +94 -0
- package/dist/module/form/form-editor/preview/content.js.map +1 -0
- package/dist/module/form/form-editor/preview/controller/page-controller.js +260 -0
- package/dist/module/form/form-editor/preview/controller/page-controller.js.map +1 -0
- package/dist/module/form/form-editor/preview/date-input.js +7 -2
- package/dist/module/form/form-editor/preview/date-input.js.map +1 -1
- package/dist/module/form/form-editor/preview/email-address.js +7 -1
- package/dist/module/form/form-editor/preview/email-address.js.map +1 -1
- package/dist/module/form/form-editor/preview/fieldset-question.js +5 -0
- package/dist/module/form/form-editor/preview/fieldset-question.js.map +1 -1
- package/dist/module/form/form-editor/preview/helpers.js +81 -0
- package/dist/module/form/form-editor/preview/helpers.js.map +1 -0
- package/dist/module/form/form-editor/preview/index.js +6 -0
- package/dist/module/form/form-editor/preview/index.js.map +1 -1
- package/dist/module/form/form-editor/preview/list.js +59 -3
- package/dist/module/form/form-editor/preview/list.js.map +1 -1
- package/dist/module/form/form-editor/preview/long-answer.js +7 -1
- package/dist/module/form/form-editor/preview/long-answer.js.map +1 -1
- package/dist/module/form/form-editor/preview/markdown.js +53 -0
- package/dist/module/form/form-editor/preview/markdown.js.map +1 -0
- package/dist/module/form/form-editor/preview/month-year.js +7 -2
- package/dist/module/form/form-editor/preview/month-year.js.map +1 -1
- package/dist/module/form/form-editor/preview/number-only.js +5 -0
- package/dist/module/form/form-editor/preview/number-only.js.map +1 -1
- package/dist/module/form/form-editor/preview/phone-number.js +7 -1
- package/dist/module/form/form-editor/preview/phone-number.js.map +1 -1
- package/dist/module/form/form-editor/preview/preview.js +212 -0
- package/dist/module/form/form-editor/preview/preview.js.map +1 -0
- package/dist/module/form/form-editor/preview/question.js +48 -138
- package/dist/module/form/form-editor/preview/question.js.map +1 -1
- package/dist/module/form/form-editor/preview/radio-sortable.js +7 -2
- package/dist/module/form/form-editor/preview/radio-sortable.js.map +1 -1
- package/dist/module/form/form-editor/preview/radio.js +7 -2
- package/dist/module/form/form-editor/preview/radio.js.map +1 -1
- package/dist/module/form/form-editor/preview/select-sortable.js +38 -0
- package/dist/module/form/form-editor/preview/select-sortable.js.map +1 -0
- package/dist/module/form/form-editor/preview/select.js +11 -0
- package/dist/module/form/form-editor/preview/select.js.map +1 -0
- package/dist/module/form/form-editor/preview/short-answer.js +7 -1
- package/dist/module/form/form-editor/preview/short-answer.js.map +1 -1
- package/dist/module/form/form-editor/preview/supporting-evidence.js +7 -1
- package/dist/module/form/form-editor/preview/supporting-evidence.js.map +1 -1
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/module/form/form-editor/preview/uk-address.js +7 -2
- package/dist/module/form/form-editor/preview/uk-address.js.map +1 -1
- package/dist/module/form/form-editor/preview/yes-no.js +7 -2
- package/dist/module/form/form-editor/preview/yes-no.js.map +1 -1
- package/dist/module/form/form-editor/types.js.map +1 -1
- package/dist/module/form/form-metadata/index.js +1 -5
- package/dist/module/form/form-metadata/index.js.map +1 -1
- package/dist/module/form/utils/index.js +1 -0
- package/dist/module/form/utils/index.js.map +1 -1
- package/dist/module/form/utils/list.js +15 -0
- package/dist/module/form/utils/list.js.map +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/stubs.js +1 -0
- package/dist/module/stubs.js.map +1 -1
- package/dist/types/form/form-editor/__stubs__/preview.d.ts +58 -11
- package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/macros/types.d.ts +62 -0
- package/dist/types/form/form-editor/macros/types.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/autocomplete.d.ts +3 -1
- package/dist/types/form/form-editor/preview/autocomplete.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/checkbox-sortable.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/checkbox.d.ts +4 -0
- package/dist/types/form/form-editor/preview/checkbox.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/component-elements.d.ts +35 -0
- package/dist/types/form/form-editor/preview/component-elements.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/constants.d.ts +2 -0
- package/dist/types/form/form-editor/preview/constants.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/content.d.ts +43 -0
- package/dist/types/form/form-editor/preview/content.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts +132 -0
- package/dist/types/form/form-editor/preview/controller/page-controller.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/date-input.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/email-address.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/fieldset-question.d.ts +2 -0
- package/dist/types/form/form-editor/preview/fieldset-question.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/helpers.d.ts +11 -0
- package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/index.d.ts +6 -0
- package/dist/types/form/form-editor/preview/list-sortable.d.ts +1 -1
- package/dist/types/form/form-editor/preview/list.d.ts +25 -0
- package/dist/types/form/form-editor/preview/list.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/long-answer.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/markdown.d.ts +9 -0
- package/dist/types/form/form-editor/preview/markdown.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/month-year.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/number-only.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/phone-number.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/preview.d.ts +126 -0
- package/dist/types/form/form-editor/preview/preview.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/question.d.ts +19 -93
- package/dist/types/form/form-editor/preview/question.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/radio-sortable.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/radio.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/select-sortable.d.ts +18 -0
- package/dist/types/form/form-editor/preview/select-sortable.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/select.d.ts +4 -0
- package/dist/types/form/form-editor/preview/select.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/short-answer.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/supporting-evidence.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/types.d.ts +13 -17
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/yes-no.d.ts.map +1 -1
- package/dist/types/form/form-editor/types.d.ts +6 -4
- package/dist/types/form/form-editor/types.d.ts.map +1 -1
- package/dist/types/form/form-metadata/index.d.ts.map +1 -1
- package/dist/types/form/utils/index.d.ts +1 -0
- package/dist/types/form/utils/index.d.ts.map +1 -1
- package/dist/types/form/utils/list.d.ts +10 -0
- package/dist/types/form/utils/list.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/stubs.d.ts +1 -0
- package/dist/types/stubs.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/form-metadata-input-schema.json +1 -2
- package/schemas/form-metadata-schema.json +1 -2
- package/schemas/question-type-full-schema.json +2 -1
- package/src/form/form-editor/__stubs__/preview.js +84 -4
- package/src/form/form-editor/index.ts +4 -2
- package/src/form/form-editor/macros/types.ts +65 -0
- package/src/form/form-editor/preview/autocomplete.js +21 -4
- package/src/form/form-editor/preview/checkbox-sortable.js +7 -2
- package/src/form/form-editor/preview/checkbox.js +17 -0
- package/src/form/form-editor/preview/component-elements.js +61 -0
- package/src/form/form-editor/preview/constants.js +1 -0
- package/src/form/form-editor/preview/content.js +93 -0
- package/src/form/form-editor/preview/controller/page-controller.js +284 -0
- package/src/form/form-editor/preview/date-input.js +8 -2
- package/src/form/form-editor/preview/email-address.js +7 -1
- package/src/form/form-editor/preview/fieldset-question.js +6 -0
- package/src/form/form-editor/preview/helpers.js +95 -0
- package/src/form/form-editor/preview/index.js +6 -0
- package/src/form/form-editor/preview/list.js +62 -3
- package/src/form/form-editor/preview/long-answer.js +7 -1
- package/src/form/form-editor/preview/markdown.js +50 -0
- package/src/form/form-editor/preview/month-year.js +7 -2
- package/src/form/form-editor/preview/number-only.js +5 -0
- package/src/form/form-editor/preview/phone-number.js +7 -1
- package/src/form/form-editor/preview/preview.js +211 -0
- package/src/form/form-editor/preview/question.js +47 -142
- package/src/form/form-editor/preview/radio-sortable.js +7 -2
- package/src/form/form-editor/preview/radio.js +7 -2
- package/src/form/form-editor/preview/select-sortable.js +43 -0
- package/src/form/form-editor/preview/select.js +11 -0
- package/src/form/form-editor/preview/short-answer.js +7 -1
- package/src/form/form-editor/preview/supporting-evidence.js +7 -1
- package/src/form/form-editor/preview/types.ts +18 -18
- package/src/form/form-editor/preview/uk-address.js +7 -2
- package/src/form/form-editor/preview/yes-no.js +7 -2
- package/src/form/form-editor/types.ts +6 -4
- package/src/form/form-metadata/index.ts +2 -5
- package/src/form/utils/index.ts +1 -0
- package/src/form/utils/list.ts +25 -0
- package/src/index.ts +1 -0
- package/src/stubs.ts +1 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
import { ComponentElements } from "./component-elements.js";
|
2
|
+
import { PreviewComponent } from "./preview.js";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @implements {QuestionElements}
|
6
|
+
*/
|
7
|
+
export class ContentElements extends ComponentElements {
|
8
|
+
/**
|
9
|
+
* @type {Exclude<ContentComponentsDef, ListComponent>}
|
10
|
+
* @protected
|
11
|
+
*/
|
12
|
+
_component;
|
13
|
+
/**
|
14
|
+
* @param {Exclude<ContentComponentsDef, ListComponent>} component
|
15
|
+
*/
|
16
|
+
constructor(component) {
|
17
|
+
super(component);
|
18
|
+
this._component = component;
|
19
|
+
}
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @protected
|
23
|
+
* @returns {BaseSettings}
|
24
|
+
*/
|
25
|
+
_getValues() {
|
26
|
+
return {
|
27
|
+
...super._getValues(),
|
28
|
+
content: this._component.content
|
29
|
+
};
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* @abstract
|
35
|
+
* @class Content
|
36
|
+
* @classdesc
|
37
|
+
* Base of Content preview classes
|
38
|
+
*/
|
39
|
+
export class Content extends PreviewComponent {
|
40
|
+
/**
|
41
|
+
* @type {string}
|
42
|
+
* @protected
|
43
|
+
*/
|
44
|
+
_content;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @param {QuestionElements} htmlElements
|
48
|
+
* @param {QuestionRenderer} questionRenderer
|
49
|
+
*/
|
50
|
+
constructor(htmlElements, questionRenderer) {
|
51
|
+
super(htmlElements, questionRenderer);
|
52
|
+
const {
|
53
|
+
content
|
54
|
+
} = htmlElements.values;
|
55
|
+
this._content = content;
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* @returns {QuestionBaseModel}
|
60
|
+
* @protected
|
61
|
+
*/
|
62
|
+
_renderInput() {
|
63
|
+
return {
|
64
|
+
...super._renderInput(),
|
65
|
+
content: this.content
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* @param {string} value
|
71
|
+
* @protected
|
72
|
+
*/
|
73
|
+
_setContent(value) {
|
74
|
+
this._content = value;
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @returns {string}
|
79
|
+
*/
|
80
|
+
get content() {
|
81
|
+
return this._content;
|
82
|
+
}
|
83
|
+
set content(value) {
|
84
|
+
this._setContent(value);
|
85
|
+
this.render();
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
/**
|
90
|
+
* @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
|
91
|
+
* @import { FormComponentsDef, ListComponent, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'
|
92
|
+
* @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'
|
93
|
+
*/
|
94
|
+
//# sourceMappingURL=content.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"content.js","names":["ComponentElements","PreviewComponent","ContentElements","_component","constructor","component","_getValues","content","Content","_content","htmlElements","questionRenderer","values","_renderInput","_setContent","value","render"],"sources":["../../../../../src/form/form-editor/preview/content.js"],"sourcesContent":["import { 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 ContentElements extends ComponentElements {\n /**\n * @type {Exclude<ContentComponentsDef, ListComponent>}\n * @protected\n */\n _component\n /**\n * @param {Exclude<ContentComponentsDef, ListComponent>} 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 content: this._component.content\n }\n }\n}\n\n/**\n * @abstract\n * @class Content\n * @classdesc\n * Base of Content preview classes\n */\nexport class Content extends PreviewComponent {\n /**\n * @type {string}\n * @protected\n */\n _content\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n const { content } = htmlElements.values\n\n this._content = content\n }\n\n /**\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return {\n ...super._renderInput(),\n content: this.content\n }\n }\n\n /**\n * @param {string} value\n * @protected\n */\n _setContent(value) {\n this._content = value\n }\n\n /**\n * @returns {string}\n */\n get content() {\n return this._content\n }\n\n set content(value) {\n this._setContent(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, ListComponent, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASF,iBAAiB,CAAC;EACrD;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,OAAO,EAAE,IAAI,CAACJ,UAAU,CAACI;IAC3B,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,SAASP,gBAAgB,CAAC;EAC5C;AACF;AACA;AACA;EACEQ,QAAQ;;EAER;AACF;AACA;AACA;EACEL,WAAWA,CAACM,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,KAAK,CAACD,YAAY,EAAEC,gBAAgB,CAAC;IACrC,MAAM;MAAEJ;IAAQ,CAAC,GAAGG,YAAY,CAACE,MAAM;IAEvC,IAAI,CAACH,QAAQ,GAAGF,OAAO;EACzB;;EAEA;AACF;AACA;AACA;EACEM,YAAYA,CAAA,EAAG;IACb,OAAO;MACL,GAAG,KAAK,CAACA,YAAY,CAAC,CAAC;MACvBN,OAAO,EAAE,IAAI,CAACA;IAChB,CAAC;EACH;;EAEA;AACF;AACA;AACA;EACEO,WAAWA,CAACC,KAAK,EAAE;IACjB,IAAI,CAACN,QAAQ,GAAGM,KAAK;EACvB;;EAEA;AACF;AACA;EACE,IAAIR,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACE,QAAQ;EACtB;EAEA,IAAIF,OAAOA,CAACQ,KAAK,EAAE;IACjB,IAAI,CAACD,WAAW,CAACC,KAAK,CAAC;IACvB,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -0,0 +1,260 @@
|
|
1
|
+
import { ComponentType } from "../../../../components/enums.js";
|
2
|
+
import { HIGHLIGHT_CLASS } from "../constants.js";
|
3
|
+
import { ContentElements } from "../content.js";
|
4
|
+
import { mapComponentToPreviewQuestion } from "../helpers.js";
|
5
|
+
import { Markdown } from "../markdown.js";
|
6
|
+
import { hasComponents } from "../../../../pages/helpers.js";
|
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
|
+
/**
|
21
|
+
* @implements {PageOverviewElements}
|
22
|
+
*/
|
23
|
+
export class PagePreviewElements {
|
24
|
+
/**
|
25
|
+
* @type {Page}
|
26
|
+
* @private
|
27
|
+
*/
|
28
|
+
_page;
|
29
|
+
/**
|
30
|
+
* @param {Page} page
|
31
|
+
*/
|
32
|
+
constructor(page) {
|
33
|
+
this._page = page;
|
34
|
+
}
|
35
|
+
get heading() {
|
36
|
+
return this._page.title;
|
37
|
+
}
|
38
|
+
get guidance() {
|
39
|
+
if (!hasComponents(this._page) || !this._page.components.length) {
|
40
|
+
return '';
|
41
|
+
}
|
42
|
+
const [possibleGuidanceComponent] = this._page.components;
|
43
|
+
return possibleGuidanceComponent.type === ComponentType.Markdown ? possibleGuidanceComponent.content : '';
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @implements {PagePreviewPanelMacro}
|
49
|
+
*/
|
50
|
+
export class PreviewPageController {
|
51
|
+
static PATH = 'preview-controllers/';
|
52
|
+
/**
|
53
|
+
* @type {string}
|
54
|
+
* @protected
|
55
|
+
*/
|
56
|
+
_pageTemplate = PreviewPageController.PATH + 'page-controller.njk';
|
57
|
+
/**
|
58
|
+
* @protected
|
59
|
+
* @type {Question[]}
|
60
|
+
*/
|
61
|
+
_components = [];
|
62
|
+
/**
|
63
|
+
* @type {string}
|
64
|
+
*/
|
65
|
+
#title = '';
|
66
|
+
/**
|
67
|
+
*
|
68
|
+
* @type {PageRenderer}
|
69
|
+
*/
|
70
|
+
#pageRenderer;
|
71
|
+
/**
|
72
|
+
* @type { undefined | 'title' | 'guidance'}
|
73
|
+
* @protected
|
74
|
+
*/
|
75
|
+
_highlighted = undefined;
|
76
|
+
/**
|
77
|
+
* @type {string}
|
78
|
+
* @private
|
79
|
+
*/
|
80
|
+
_guidanceText = '';
|
81
|
+
/**
|
82
|
+
* @type {Markdown}
|
83
|
+
* @private
|
84
|
+
*/
|
85
|
+
_emptyGuidance = PreviewPageController.createGuidanceComponent();
|
86
|
+
/**
|
87
|
+
*
|
88
|
+
* @type {Markdown}
|
89
|
+
* @protected
|
90
|
+
*/
|
91
|
+
_guidanceComponent;
|
92
|
+
|
93
|
+
/**
|
94
|
+
* @type {boolean}
|
95
|
+
* @private
|
96
|
+
*/
|
97
|
+
_showGuidance = false;
|
98
|
+
/**
|
99
|
+
* @param {ComponentDef[]} components
|
100
|
+
* @param {PageOverviewElements} elements
|
101
|
+
* @param {FormDefinition} definition
|
102
|
+
* @param {PageRenderer} renderer
|
103
|
+
*/
|
104
|
+
constructor(components, elements, definition, renderer) {
|
105
|
+
const questions = components.map(mapComponentToPreviewQuestion(questionRenderer, definition));
|
106
|
+
const firstQuestion = /** @type { Markdown | undefined | Question } */
|
107
|
+
questions.shift();
|
108
|
+
this._guidanceComponent = PreviewPageController.getOrCreateGuidanceComponent(firstQuestion);
|
109
|
+
this._guidanceText = elements.guidance;
|
110
|
+
this._components = this.#constructComponents(firstQuestion, questions);
|
111
|
+
this.#title = elements.heading;
|
112
|
+
this.#pageRenderer = renderer;
|
113
|
+
}
|
114
|
+
|
115
|
+
/**
|
116
|
+
* @param { Question | Markdown | undefined} firstQuestion
|
117
|
+
* @param {Question[]} questions
|
118
|
+
* @returns {Question[]}
|
119
|
+
*/
|
120
|
+
#constructComponents(firstQuestion, questions) {
|
121
|
+
return firstQuestion instanceof Markdown || firstQuestion === undefined ? questions : [firstQuestion, ...questions];
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* @returns {Markdown[]}
|
126
|
+
* @private
|
127
|
+
*/
|
128
|
+
get _guidanceComponents() {
|
129
|
+
if (this._guidanceText.length) {
|
130
|
+
return [this._guidanceComponent];
|
131
|
+
}
|
132
|
+
if (this._highlighted === 'guidance') {
|
133
|
+
return [this._emptyGuidance];
|
134
|
+
}
|
135
|
+
return [];
|
136
|
+
}
|
137
|
+
|
138
|
+
/**
|
139
|
+
* @returns {PagePreviewComponent[]}
|
140
|
+
*/
|
141
|
+
get components() {
|
142
|
+
const componentsWithGuidance = /** @type {Question[]} */[...this._guidanceComponents, ...this._components];
|
143
|
+
return componentsWithGuidance.map(component => ({
|
144
|
+
model: component.renderInput,
|
145
|
+
questionType: component.componentType
|
146
|
+
}));
|
147
|
+
}
|
148
|
+
set guidanceText(text) {
|
149
|
+
this._guidanceText = text;
|
150
|
+
this._guidanceComponent.content = text;
|
151
|
+
this.render();
|
152
|
+
}
|
153
|
+
get guidanceText() {
|
154
|
+
return this._guidanceText;
|
155
|
+
}
|
156
|
+
get guidance() {
|
157
|
+
return {
|
158
|
+
text: this.guidanceText,
|
159
|
+
classes: this._highlighted === 'guidance' ? 'highlight' : ''
|
160
|
+
};
|
161
|
+
}
|
162
|
+
|
163
|
+
/**
|
164
|
+
* @private
|
165
|
+
* @returns {string}
|
166
|
+
*/
|
167
|
+
_fallBackTitle() {
|
168
|
+
return this._components[0]?.question ?? '';
|
169
|
+
}
|
170
|
+
|
171
|
+
/**
|
172
|
+
* @returns {{ text: string, classes: string }}
|
173
|
+
*/
|
174
|
+
get pageTitle() {
|
175
|
+
return {
|
176
|
+
text: this.title,
|
177
|
+
classes: this._highlighted === 'title' ? HIGHLIGHT_CLASS : ''
|
178
|
+
};
|
179
|
+
}
|
180
|
+
render() {
|
181
|
+
this.#pageRenderer.render(this._pageTemplate, this);
|
182
|
+
}
|
183
|
+
|
184
|
+
/**
|
185
|
+
* @returns {string}
|
186
|
+
*/
|
187
|
+
get title() {
|
188
|
+
return this.#title.length ? this.#title : this._fallBackTitle();
|
189
|
+
}
|
190
|
+
|
191
|
+
/**
|
192
|
+
* @param {string} value
|
193
|
+
*/
|
194
|
+
set title(value) {
|
195
|
+
this.#title = value;
|
196
|
+
this.render();
|
197
|
+
}
|
198
|
+
highlightTitle() {
|
199
|
+
this.setHighLighted('title');
|
200
|
+
}
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Creates a dummy component for when guidance is highlighted
|
204
|
+
* but no guidance text exists
|
205
|
+
* @returns {Markdown}
|
206
|
+
*/
|
207
|
+
static createGuidanceComponent() {
|
208
|
+
const guidanceElement = new ContentElements({
|
209
|
+
type: ComponentType.Markdown,
|
210
|
+
title: 'Guidance component',
|
211
|
+
name: 'guidanceComponent',
|
212
|
+
content: 'Guidance text',
|
213
|
+
options: {}
|
214
|
+
});
|
215
|
+
const guidanceComponent = new Markdown(guidanceElement, questionRenderer);
|
216
|
+
|
217
|
+
// the dummy component should always be highlighted
|
218
|
+
guidanceComponent.highlightContent();
|
219
|
+
return guidanceComponent;
|
220
|
+
}
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Helper method to return the guidance or a new one
|
224
|
+
* @param { Markdown | Question | undefined } guidanceComponent
|
225
|
+
* @returns {Markdown}
|
226
|
+
* @private
|
227
|
+
*/
|
228
|
+
static getOrCreateGuidanceComponent(guidanceComponent) {
|
229
|
+
if (guidanceComponent instanceof Markdown) {
|
230
|
+
return guidanceComponent;
|
231
|
+
}
|
232
|
+
return PreviewPageController.createGuidanceComponent();
|
233
|
+
}
|
234
|
+
highlightGuidance() {
|
235
|
+
this._guidanceComponent.highlightContent();
|
236
|
+
this.setHighLighted('guidance');
|
237
|
+
}
|
238
|
+
|
239
|
+
/**
|
240
|
+
* @param {'title'|'guidance'} highlightSection
|
241
|
+
*/
|
242
|
+
setHighLighted(highlightSection) {
|
243
|
+
this._highlighted = highlightSection;
|
244
|
+
this.render();
|
245
|
+
}
|
246
|
+
clearHighlight() {
|
247
|
+
this._highlighted = undefined;
|
248
|
+
this._guidanceComponent.unHighlightContent();
|
249
|
+
this.render();
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
/**
|
254
|
+
* @import { PageRenderer, PageOverviewElements, QuestionRenderer, QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'
|
255
|
+
* @import { Question } from '~/src/form/form-editor/preview/question.js'
|
256
|
+
* @import { FormDefinition, Page } from '~/src/form/form-definition/types.js'
|
257
|
+
* @import { ComponentDef, MarkdownComponent } from '~/src/components/types.js'
|
258
|
+
* @import { PagePreviewComponent, PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'
|
259
|
+
*/
|
260
|
+
//# sourceMappingURL=page-controller.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"page-controller.js","names":["ComponentType","HIGHLIGHT_CLASS","ContentElements","mapComponentToPreviewQuestion","Markdown","hasComponents","questionRenderer","render","_questionTemplate","_questionBaseModel","PagePreviewElements","_page","constructor","page","heading","title","guidance","components","length","possibleGuidanceComponent","type","content","PreviewPageController","PATH","_pageTemplate","_components","pageRenderer","_highlighted","undefined","_guidanceText","_emptyGuidance","createGuidanceComponent","_guidanceComponent","_showGuidance","elements","definition","renderer","questions","map","firstQuestion","shift","getOrCreateGuidanceComponent","constructComponents","#constructComponents","_guidanceComponents","componentsWithGuidance","component","model","renderInput","questionType","componentType","guidanceText","text","classes","_fallBackTitle","question","pageTitle","value","highlightTitle","setHighLighted","guidanceElement","name","options","guidanceComponent","highlightContent","highlightGuidance","highlightSection","clearHighlight","unHighlightContent"],"sources":["../../../../../../src/form/form-editor/preview/controller/page-controller.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 { mapComponentToPreviewQuestion } from '~/src/form/form-editor/preview/helpers.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\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/**\n * @implements {PageOverviewElements}\n */\nexport class PagePreviewElements {\n /**\n * @type {Page}\n * @private\n */\n _page\n /**\n * @param {Page} page\n */\n constructor(page) {\n this._page = page\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\n/**\n * @implements {PagePreviewPanelMacro}\n */\nexport class PreviewPageController {\n static PATH = 'preview-controllers/'\n /**\n * @type {string}\n * @protected\n */\n _pageTemplate = PreviewPageController.PATH + 'page-controller.njk'\n /**\n * @protected\n * @type {Question[]}\n */\n _components = []\n /**\n * @type {string}\n */\n #title = ''\n /**\n *\n * @type {PageRenderer}\n */\n #pageRenderer\n /**\n * @type { undefined | 'title' | 'guidance'}\n * @protected\n */\n _highlighted = undefined\n /**\n * @type {string}\n * @private\n */\n _guidanceText = ''\n /**\n * @type {Markdown}\n * @private\n */\n _emptyGuidance = PreviewPageController.createGuidanceComponent()\n /**\n *\n * @type {Markdown}\n * @protected\n */\n _guidanceComponent\n\n /**\n * @type {boolean}\n * @private\n */\n _showGuidance = false\n /**\n * @param {ComponentDef[]} components\n * @param {PageOverviewElements} elements\n * @param {FormDefinition} definition\n * @param {PageRenderer} renderer\n */\n constructor(components, elements, definition, renderer) {\n const questions = components.map(\n mapComponentToPreviewQuestion(questionRenderer, definition)\n )\n const firstQuestion = /** @type { Markdown | undefined | Question } */ (\n questions.shift()\n )\n\n this._guidanceComponent =\n PreviewPageController.getOrCreateGuidanceComponent(firstQuestion)\n this._guidanceText = elements.guidance\n this._components = this.#constructComponents(firstQuestion, questions)\n this.#title = elements.heading\n this.#pageRenderer = renderer\n }\n\n /**\n * @param { Question | Markdown | undefined} firstQuestion\n * @param {Question[]} questions\n * @returns {Question[]}\n */\n #constructComponents(firstQuestion, questions) {\n return firstQuestion instanceof Markdown || firstQuestion === undefined\n ? questions\n : [firstQuestion, ...questions]\n }\n\n /**\n * @returns {Markdown[]}\n * @private\n */\n get _guidanceComponents() {\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 {PagePreviewComponent[]}\n */\n get components() {\n const componentsWithGuidance = /** @type {Question[]} */ ([\n ...this._guidanceComponents,\n ...this._components\n ])\n\n return componentsWithGuidance.map((component) => ({\n model: component.renderInput,\n questionType: component.componentType\n }))\n }\n\n set guidanceText(text) {\n this._guidanceText = text\n this._guidanceComponent.content = text\n this.render()\n }\n\n get guidanceText() {\n return this._guidanceText\n }\n\n get guidance() {\n return {\n text: this.guidanceText,\n classes: this._highlighted === 'guidance' ? 'highlight' : ''\n }\n }\n\n /**\n * @private\n * @returns {string}\n */\n _fallBackTitle() {\n return this._components[0]?.question ?? ''\n }\n\n /**\n * @returns {{ text: string, classes: string }}\n */\n get pageTitle() {\n return {\n text: this.title,\n classes: this._highlighted === 'title' ? HIGHLIGHT_CLASS : ''\n }\n }\n\n render() {\n this.#pageRenderer.render(this._pageTemplate, this)\n }\n\n /**\n * @returns {string}\n */\n get title() {\n return this.#title.length ? this.#title : this._fallBackTitle()\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('title')\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() {\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 // the dummy component should always be highlighted\n guidanceComponent.highlightContent()\n return guidanceComponent\n }\n\n /**\n * Helper method to return the guidance or a new one\n * @param { Markdown | Question | undefined } guidanceComponent\n * @returns {Markdown}\n * @private\n */\n static getOrCreateGuidanceComponent(guidanceComponent) {\n if (guidanceComponent instanceof Markdown) {\n return guidanceComponent\n }\n return PreviewPageController.createGuidanceComponent()\n }\n\n highlightGuidance() {\n this._guidanceComponent.highlightContent()\n this.setHighLighted('guidance')\n }\n\n /**\n * @param {'title'|'guidance'} 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/**\n * @import { PageRenderer, PageOverviewElements, QuestionRenderer, QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'\n * @import { Question } from '~/src/form/form-editor/preview/question.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,6BAA6B;AACtC,SAASC,QAAQ;AACjB,SAASC,aAAa;AACtB;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACvB;AACF;AACA;AACA;EACEC,MAAMA,CAACC,iBAAiB,EAAEC,kBAAkB,EAAE;IAC5C;EAAA;AAEJ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAC;EAC/B;AACF;AACA;AACA;EACEC,KAAK;EACL;AACF;AACA;EACEC,WAAWA,CAACC,IAAI,EAAE;IAChB,IAAI,CAACF,KAAK,GAAGE,IAAI;EACnB;EAEA,IAAIC,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACH,KAAK,CAACI,KAAK;EACzB;EAEA,IAAIC,QAAQA,CAAA,EAAG;IACb,IAAI,CAACX,aAAa,CAAC,IAAI,CAACM,KAAK,CAAC,IAAI,CAAC,IAAI,CAACA,KAAK,CAACM,UAAU,CAACC,MAAM,EAAE;MAC/D,OAAO,EAAE;IACX;IAEA,MAAM,CAACC,yBAAyB,CAAC,GAAG,IAAI,CAACR,KAAK,CAACM,UAAU;IAEzD,OAAOE,yBAAyB,CAACC,IAAI,KAAKpB,aAAa,CAACI,QAAQ,GAC5De,yBAAyB,CAACE,OAAO,GACjC,EAAE;EACR;AACF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iBAAiB,YAAY3D,QAAQ,EAAE;MACzC,OAAO2D,iBAAiB;IAC1B;IACA,OAAOzC,qBAAqB,CAACS,uBAAuB,CAAC,CAAC;EACxD;EAEAkC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,CAACjC,kBAAkB,CAACgC,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAACL,cAAc,CAAC,UAAU,CAAC;EACjC;;EAEA;AACF;AACA;EACEA,cAAcA,CAACO,gBAAgB,EAAE;IAC/B,IAAI,CAACvC,YAAY,GAAGuC,gBAAgB;IACpC,IAAI,CAAC3D,MAAM,CAAC,CAAC;EACf;EAEA4D,cAAcA,CAAA,EAAG;IACf,IAAI,CAACxC,YAAY,GAAGC,SAAS;IAE7B,IAAI,CAACI,kBAAkB,CAACoC,kBAAkB,CAAC,CAAC;IAC5C,IAAI,CAAC7D,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -1,11 +1,16 @@
|
|
1
|
+
import { ComponentType } from "../../../components/enums.js";
|
1
2
|
import { FieldsetQuestion } from "./fieldset-question.js";
|
2
|
-
import {
|
3
|
+
import { PreviewComponent } from "./preview.js";
|
3
4
|
export class DateInputQuestion extends FieldsetQuestion {
|
5
|
+
/**
|
6
|
+
* @type {ComponentType}
|
7
|
+
*/
|
8
|
+
componentType = ComponentType.DatePartsField;
|
4
9
|
/**
|
5
10
|
* @type {string}
|
6
11
|
* @protected
|
7
12
|
*/
|
8
|
-
_questionTemplate =
|
13
|
+
_questionTemplate = PreviewComponent.PATH + 'date-input.njk';
|
9
14
|
_fieldName = 'dateInput';
|
10
15
|
}
|
11
16
|
//# sourceMappingURL=date-input.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"date-input.js","names":["FieldsetQuestion","
|
1
|
+
{"version":3,"file":"date-input.js","names":["ComponentType","FieldsetQuestion","PreviewComponent","DateInputQuestion","componentType","DatePartsField","_questionTemplate","PATH","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/date-input.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { FieldsetQuestion } from '~/src/form/form-editor/preview/fieldset-question.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\nexport class DateInputQuestion extends FieldsetQuestion {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.DatePartsField\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'date-input.njk'\n _fieldName = 'dateInput'\n}\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,iBAAiB,SAASF,gBAAgB,CAAC;EACtD;AACF;AACA;EACEG,aAAa,GAAGJ,aAAa,CAACK,cAAc;EAC5C;AACF;AACA;AACA;EACEC,iBAAiB,GAAGJ,gBAAgB,CAACK,IAAI,GAAG,gBAAgB;EAC5DC,UAAU,GAAG,WAAW;AAC1B","ignoreList":[]}
|
@@ -1,6 +1,12 @@
|
|
1
|
+
import { ComponentType } from "../../../components/enums.js";
|
2
|
+
import { PreviewComponent } from "./preview.js";
|
1
3
|
import { Question } from "./question.js";
|
2
4
|
export class EmailAddressQuestion extends Question {
|
3
|
-
|
5
|
+
/**
|
6
|
+
* @type {ComponentType}
|
7
|
+
*/
|
8
|
+
componentType = ComponentType.EmailAddressField;
|
9
|
+
_questionTemplate = PreviewComponent.PATH + 'emailaddressfield.njk';
|
4
10
|
_fieldName = 'emailAddressField';
|
5
11
|
}
|
6
12
|
//# sourceMappingURL=email-address.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"email-address.js","names":["Question","EmailAddressQuestion","_questionTemplate","PATH","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/email-address.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class EmailAddressQuestion extends Question {\n _questionTemplate =
|
1
|
+
{"version":3,"file":"email-address.js","names":["ComponentType","PreviewComponent","Question","EmailAddressQuestion","componentType","EmailAddressField","_questionTemplate","PATH","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/email-address.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\nimport { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class EmailAddressQuestion extends Question {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.EmailAddressField\n _questionTemplate = PreviewComponent.PATH + 'emailaddressfield.njk'\n _fieldName = 'emailAddressField'\n}\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,QAAQ;AAEjB,OAAO,MAAMC,oBAAoB,SAASD,QAAQ,CAAC;EACjD;AACF;AACA;EACEE,aAAa,GAAGJ,aAAa,CAACK,iBAAiB;EAC/CC,iBAAiB,GAAGL,gBAAgB,CAACM,IAAI,GAAG,uBAAuB;EACnEC,UAAU,GAAG,mBAAmB;AAClC","ignoreList":[]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ComponentType } from "../../../components/enums.js";
|
1
2
|
import { Question } from "./question.js";
|
2
3
|
|
3
4
|
/**
|
@@ -5,6 +6,10 @@ import { Question } from "./question.js";
|
|
5
6
|
* @abstract
|
6
7
|
*/
|
7
8
|
export class FieldsetQuestion extends Question {
|
9
|
+
/**
|
10
|
+
* @type {ComponentType}
|
11
|
+
*/
|
12
|
+
componentType = ComponentType.TextField;
|
8
13
|
get renderInput() {
|
9
14
|
return {
|
10
15
|
id: this._fieldName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fieldset-question.js","names":["Question","FieldsetQuestion","renderInput","id","_fieldName","name","fieldset","fieldSet","hint","customRenderFields"],"sources":["../../../../../src/form/form-editor/preview/fieldset-question.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * Simple extension of Question that uses fieldset instead of label - not exported\n * @abstract\n */\nexport class FieldsetQuestion extends Question {\n get renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n fieldset: this.fieldSet,\n hint: this.hint,\n ...this.customRenderFields\n }\n }\n}\n"],"mappings":"AAAA,SAASA,QAAQ;;AAEjB;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASD,QAAQ,CAAC;EAC7C,
|
1
|
+
{"version":3,"file":"fieldset-question.js","names":["ComponentType","Question","FieldsetQuestion","componentType","TextField","renderInput","id","_fieldName","name","fieldset","fieldSet","hint","customRenderFields"],"sources":["../../../../../src/form/form-editor/preview/fieldset-question.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { Question } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * Simple extension of Question that uses fieldset instead of label - not exported\n * @abstract\n */\nexport class FieldsetQuestion extends Question {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.TextField\n\n get renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n fieldset: this.fieldSet,\n hint: this.hint,\n ...this.customRenderFields\n }\n }\n}\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,QAAQ;;AAEjB;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASD,QAAQ,CAAC;EAC7C;AACF;AACA;EACEE,aAAa,GAAGH,aAAa,CAACI,SAAS;EAEvC,IAAIC,WAAWA,CAAA,EAAG;IAChB,OAAO;MACLC,EAAE,EAAE,IAAI,CAACC,UAAU;MACnBC,IAAI,EAAE,IAAI,CAACD,UAAU;MACrBE,QAAQ,EAAE,IAAI,CAACC,QAAQ;MACvBC,IAAI,EAAE,IAAI,CAACA,IAAI;MACf,GAAG,IAAI,CAACC;IACV,CAAC;EACH;AACF","ignoreList":[]}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import { ComponentType } from "../../../components/enums.js";
|
2
|
+
import { AutocompleteListQuestion } from "./autocomplete.js";
|
3
|
+
import { CheckboxQuestion } from "./checkbox.js";
|
4
|
+
import { ComponentElements } from "./component-elements.js";
|
5
|
+
import { ContentElements } from "./content.js";
|
6
|
+
import { DateInputQuestion } from "./date-input.js";
|
7
|
+
import { EmailAddressQuestion } from "./email-address.js";
|
8
|
+
import { ListQuestion } from "./list.js";
|
9
|
+
import { LongAnswerQuestion } from "./long-answer.js";
|
10
|
+
import { Markdown } from "./markdown.js";
|
11
|
+
import { MonthYearQuestion } from "./month-year.js";
|
12
|
+
import { NumberOnlyQuestion } from "./number-only.js";
|
13
|
+
import { PhoneNumberQuestion } from "./phone-number.js";
|
14
|
+
import { RadioQuestion } from "./radio.js";
|
15
|
+
import { SelectQuestion } from "./select.js";
|
16
|
+
import { ShortAnswerQuestion } from "./short-answer.js";
|
17
|
+
import { SupportingEvidenceQuestion } from "./supporting-evidence.js";
|
18
|
+
import { UkAddressQuestion } from "./uk-address.js";
|
19
|
+
import { YesNoQuestion } from "./yes-no.js";
|
20
|
+
import { findDefinitionListFromComponent } from "../../utils/list.js";
|
21
|
+
import { ListComponentElements, QuestionComponentElements, hasContentField, hasInputField, hasListField, hasSelectionFields } from "../../../index.js";
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @type {Record<ComponentType, typeof PreviewComponent>}
|
25
|
+
*/
|
26
|
+
const InputFieldComponentDictionary = {
|
27
|
+
[ComponentType.TextField]: ShortAnswerQuestion,
|
28
|
+
[ComponentType.Details]: ShortAnswerQuestion,
|
29
|
+
[ComponentType.InsetText]: ShortAnswerQuestion,
|
30
|
+
[ComponentType.Html]: ShortAnswerQuestion,
|
31
|
+
[ComponentType.Markdown]: Markdown,
|
32
|
+
[ComponentType.List]: ListQuestion,
|
33
|
+
[ComponentType.EmailAddressField]: EmailAddressQuestion,
|
34
|
+
[ComponentType.NumberField]: NumberOnlyQuestion,
|
35
|
+
[ComponentType.MultilineTextField]: LongAnswerQuestion,
|
36
|
+
[ComponentType.TelephoneNumberField]: PhoneNumberQuestion,
|
37
|
+
[ComponentType.MonthYearField]: MonthYearQuestion,
|
38
|
+
[ComponentType.DatePartsField]: DateInputQuestion,
|
39
|
+
[ComponentType.UkAddressField]: UkAddressQuestion,
|
40
|
+
[ComponentType.AutocompleteField]: AutocompleteListQuestion,
|
41
|
+
[ComponentType.RadiosField]: RadioQuestion,
|
42
|
+
[ComponentType.CheckboxesField]: CheckboxQuestion,
|
43
|
+
[ComponentType.SelectField]: SelectQuestion,
|
44
|
+
[ComponentType.YesNoField]: YesNoQuestion,
|
45
|
+
[ComponentType.FileUploadField]: SupportingEvidenceQuestion
|
46
|
+
};
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @param {QuestionRenderer} questionRenderer
|
50
|
+
* @param {FormDefinition} definition
|
51
|
+
* @returns {(component: ComponentDef) => Question}
|
52
|
+
*/
|
53
|
+
export function mapComponentToPreviewQuestion(questionRenderer, definition) {
|
54
|
+
return /** @type {(component: ComponentDef) => Question} */component => {
|
55
|
+
/**
|
56
|
+
* @type {QuestionElements}
|
57
|
+
*/
|
58
|
+
let questionElements;
|
59
|
+
if (hasSelectionFields(component) && hasListField(component)) {
|
60
|
+
const list = findDefinitionListFromComponent(component, definition);
|
61
|
+
questionElements = new ListComponentElements(component, list);
|
62
|
+
} else if (hasInputField(component) || component.type === ComponentType.YesNoField) {
|
63
|
+
questionElements = new QuestionComponentElements(component);
|
64
|
+
} else if (hasContentField(component)) {
|
65
|
+
questionElements = new ContentElements(component);
|
66
|
+
} else {
|
67
|
+
questionElements = new ComponentElements(component);
|
68
|
+
}
|
69
|
+
const QuestionConstructor = InputFieldComponentDictionary[component.type];
|
70
|
+
return new QuestionConstructor(questionElements, questionRenderer);
|
71
|
+
};
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* @import { QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
|
76
|
+
* @import { Question } from '~/src/form/form-editor/preview/question.js'
|
77
|
+
* @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'
|
78
|
+
* @import { Item, FormDefinition } from '~/src/form/form-definition/types.js'
|
79
|
+
* @import { FormComponentsDef, ComponentDef } from '~/src/components/types.js'
|
80
|
+
*/
|
81
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["ComponentType","AutocompleteListQuestion","CheckboxQuestion","ComponentElements","ContentElements","DateInputQuestion","EmailAddressQuestion","ListQuestion","LongAnswerQuestion","Markdown","MonthYearQuestion","NumberOnlyQuestion","PhoneNumberQuestion","RadioQuestion","SelectQuestion","ShortAnswerQuestion","SupportingEvidenceQuestion","UkAddressQuestion","YesNoQuestion","findDefinitionListFromComponent","ListComponentElements","QuestionComponentElements","hasContentField","hasInputField","hasListField","hasSelectionFields","InputFieldComponentDictionary","TextField","Details","InsetText","Html","List","EmailAddressField","NumberField","MultilineTextField","TelephoneNumberField","MonthYearField","DatePartsField","UkAddressField","AutocompleteField","RadiosField","CheckboxesField","SelectField","YesNoField","FileUploadField","mapComponentToPreviewQuestion","questionRenderer","definition","component","questionElements","list","type","QuestionConstructor"],"sources":["../../../../../src/form/form-editor/preview/helpers.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { AutocompleteListQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { CheckboxQuestion } from '~/src/form/form-editor/preview/checkbox.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { ContentElements } from '~/src/form/form-editor/preview/content.js'\nimport { DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { ListQuestion } from '~/src/form/form-editor/preview/list.js'\nimport { LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { MonthYearQuestion } from '~/src/form/form-editor/preview/month-year.js'\nimport { NumberOnlyQuestion } from '~/src/form/form-editor/preview/number-only.js'\nimport { PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { RadioQuestion } from '~/src/form/form-editor/preview/radio.js'\nimport { SelectQuestion } from '~/src/form/form-editor/preview/select.js'\nimport { ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { SupportingEvidenceQuestion } from '~/src/form/form-editor/preview/supporting-evidence.js'\nimport { UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { YesNoQuestion } from '~/src/form/form-editor/preview/yes-no.js'\nimport { findDefinitionListFromComponent } from '~/src/form/utils/list.js'\nimport {\n ListComponentElements,\n QuestionComponentElements,\n hasContentField,\n hasInputField,\n hasListField,\n hasSelectionFields\n} from '~/src/index.js'\n\n/**\n * @type {Record<ComponentType, typeof PreviewComponent>}\n */\nconst InputFieldComponentDictionary = {\n [ComponentType.TextField]: ShortAnswerQuestion,\n [ComponentType.Details]: ShortAnswerQuestion,\n [ComponentType.InsetText]: ShortAnswerQuestion,\n [ComponentType.Html]: ShortAnswerQuestion,\n [ComponentType.Markdown]: Markdown,\n [ComponentType.List]: ListQuestion,\n [ComponentType.EmailAddressField]: EmailAddressQuestion,\n [ComponentType.NumberField]: NumberOnlyQuestion,\n [ComponentType.MultilineTextField]: LongAnswerQuestion,\n [ComponentType.TelephoneNumberField]: PhoneNumberQuestion,\n [ComponentType.MonthYearField]: MonthYearQuestion,\n [ComponentType.DatePartsField]: DateInputQuestion,\n [ComponentType.UkAddressField]: UkAddressQuestion,\n [ComponentType.AutocompleteField]: AutocompleteListQuestion,\n [ComponentType.RadiosField]: RadioQuestion,\n [ComponentType.CheckboxesField]: CheckboxQuestion,\n [ComponentType.SelectField]: SelectQuestion,\n [ComponentType.YesNoField]: YesNoQuestion,\n [ComponentType.FileUploadField]: SupportingEvidenceQuestion\n}\n\n/**\n * @param {QuestionRenderer} questionRenderer\n * @param {FormDefinition} definition\n * @returns {(component: ComponentDef) => Question}\n */\nexport function mapComponentToPreviewQuestion(questionRenderer, definition) {\n return /** @type {(component: ComponentDef) => Question} */ (\n (component) => {\n /**\n * @type {QuestionElements}\n */\n let questionElements\n\n if (hasSelectionFields(component) && hasListField(component)) {\n const list = findDefinitionListFromComponent(component, definition)\n questionElements = new ListComponentElements(component, list)\n } else if (\n hasInputField(component) ||\n component.type === ComponentType.YesNoField\n ) {\n questionElements = new QuestionComponentElements(component)\n } else if (hasContentField(component)) {\n questionElements = new ContentElements(component)\n } else {\n questionElements = new ComponentElements(component)\n }\n\n const QuestionConstructor = InputFieldComponentDictionary[component.type]\n\n return new QuestionConstructor(questionElements, questionRenderer)\n }\n )\n}\n\n/**\n * @import { QuestionElements, QuestionRenderer } 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 { Item, FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { FormComponentsDef, ComponentDef } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,wBAAwB;AACjC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SAASC,oBAAoB;AAC7B,SAASC,YAAY;AACrB,SAASC,kBAAkB;AAC3B,SAASC,QAAQ;AACjB,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAC3B,SAASC,mBAAmB;AAC5B,SAASC,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,iBAAiB;AAC1B,SAASC,aAAa;AACtB,SAASC,+BAA+B;AACxC,SACEC,qBAAqB,EACrBC,yBAAyB,EACzBC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,kBAAkB;;AAGpB;AACA;AACA;AACA,MAAMC,6BAA6B,GAAG;EACpC,CAAC1B,aAAa,CAAC2B,SAAS,GAAGZ,mBAAmB;EAC9C,CAACf,aAAa,CAAC4B,OAAO,GAAGb,mBAAmB;EAC5C,CAACf,aAAa,CAAC6B,SAAS,GAAGd,mB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AS,CAACG,IAAI,KAAKnD,aAAa,CAAC2C,UAAU,EAC3C;MACAM,gBAAgB,GAAG,IAAI5B,yBAAyB,CAAC2B,SAAS,CAAC;IAC7D,CAAC,MAAM,IAAI1B,eAAe,CAAC0B,SAAS,CAAC,EAAE;MACrCC,gBAAgB,GAAG,IAAI7C,eAAe,CAAC4C,SAAS,CAAC;IACnD,CAAC,MAAM;MACLC,gBAAgB,GAAG,IAAI9C,iBAAiB,CAAC6C,SAAS,CAAC;IACrD;IAEA,MAAMI,mBAAmB,GAAG1B,6BAA6B,CAACsB,SAAS,CAACG,IAAI,CAAC;IAEzE,OAAO,IAAIC,mBAAmB,CAACH,gBAAgB,EAAEH,gBAAgB,CAAC;EACpE,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -1,18 +1,24 @@
|
|
1
1
|
export * from "./autocomplete.js";
|
2
|
+
export * from "./checkbox.js";
|
2
3
|
export * from "./checkbox-sortable.js";
|
3
4
|
export * from "./date-input.js";
|
4
5
|
export * from "./email-address.js";
|
5
6
|
export * from "./list.js";
|
6
7
|
export * from "./list-sortable.js";
|
8
|
+
export * from "./markdown.js";
|
7
9
|
export * from "./month-year.js";
|
8
10
|
export * from "./number-only.js";
|
9
11
|
export * from "./phone-number.js";
|
10
12
|
export * from "./question.js";
|
11
13
|
export * from "./radio.js";
|
12
14
|
export * from "./radio-sortable.js";
|
15
|
+
export * from "./select-sortable.js";
|
13
16
|
export * from "./short-answer.js";
|
17
|
+
export * from "./select.js";
|
18
|
+
export * from "./select-sortable.js";
|
14
19
|
export * from "./supporting-evidence.js";
|
15
20
|
export * from "./long-answer.js";
|
16
21
|
export * from "./uk-address.js";
|
17
22
|
export * from "./yes-no.js";
|
23
|
+
export * from "./controller/page-controller.js";
|
18
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/autocomplete.js'\nexport * from '~/src/form/form-editor/preview/checkbox-sortable.js'\nexport * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/supporting-evidence.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\nexport * from '~/src/form/form-editor/preview/yes-no.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/autocomplete.js'\nexport * from '~/src/form/form-editor/preview/checkbox.js'\nexport * from '~/src/form/form-editor/preview/checkbox-sortable.js'\nexport * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/markdown.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/select.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/supporting-evidence.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\nexport * from '~/src/form/form-editor/preview/yes-no.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|