@defra/forms-model 3.0.448 → 3.0.449

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.
Files changed (80) hide show
  1. package/dist/module/form/form-editor/__stubs__/preview.js +105 -0
  2. package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -0
  3. package/dist/module/form/form-editor/index.js +10 -0
  4. package/dist/module/form/form-editor/index.js.map +1 -1
  5. package/dist/module/form/form-editor/preview/date-input.js +17 -0
  6. package/dist/module/form/form-editor/preview/date-input.js.map +1 -0
  7. package/dist/module/form/form-editor/preview/email-address.js +6 -0
  8. package/dist/module/form/form-editor/preview/email-address.js.map +1 -0
  9. package/dist/module/form/form-editor/preview/index.js +11 -0
  10. package/dist/module/form/form-editor/preview/index.js.map +1 -0
  11. package/dist/module/form/form-editor/preview/list-sortable.js +40 -0
  12. package/dist/module/form/form-editor/preview/list-sortable.js.map +1 -0
  13. package/dist/module/form/form-editor/preview/list.js +182 -0
  14. package/dist/module/form/form-editor/preview/list.js.map +1 -0
  15. package/dist/module/form/form-editor/preview/phone-number.js +10 -0
  16. package/dist/module/form/form-editor/preview/phone-number.js.map +1 -0
  17. package/dist/module/form/form-editor/preview/question.js +197 -0
  18. package/dist/module/form/form-editor/preview/question.js.map +1 -0
  19. package/dist/module/form/form-editor/preview/radio-sortable.js +5 -0
  20. package/dist/module/form/form-editor/preview/radio-sortable.js.map +1 -0
  21. package/dist/module/form/form-editor/preview/radio.js +5 -0
  22. package/dist/module/form/form-editor/preview/radio.js.map +1 -0
  23. package/dist/module/form/form-editor/preview/short-answer.js +3 -0
  24. package/dist/module/form/form-editor/preview/short-answer.js.map +1 -0
  25. package/dist/module/form/form-editor/preview/types.js +2 -0
  26. package/dist/module/form/form-editor/preview/types.js.map +1 -0
  27. package/dist/module/form/form-editor/preview/uk-address.js +6 -0
  28. package/dist/module/form/form-editor/preview/uk-address.js.map +1 -0
  29. package/dist/module/form/form-editor/types.js.map +1 -1
  30. package/dist/module/index.js +1 -0
  31. package/dist/module/index.js.map +1 -1
  32. package/dist/types/form/form-editor/__stubs__/preview.d.ts +72 -0
  33. package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -0
  34. package/dist/types/form/form-editor/index.d.ts +3 -1
  35. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  36. package/dist/types/form/form-editor/preview/date-input.d.ts +10 -0
  37. package/dist/types/form/form-editor/preview/date-input.d.ts.map +1 -0
  38. package/dist/types/form/form-editor/preview/email-address.d.ts +4 -0
  39. package/dist/types/form/form-editor/preview/email-address.d.ts.map +1 -0
  40. package/dist/types/form/form-editor/preview/index.d.ts +11 -0
  41. package/dist/types/form/form-editor/preview/index.d.ts.map +1 -0
  42. package/dist/types/form/form-editor/preview/list-sortable.d.ts +17 -0
  43. package/dist/types/form/form-editor/preview/list-sortable.d.ts.map +1 -0
  44. package/dist/types/form/form-editor/preview/list.d.ts +81 -0
  45. package/dist/types/form/form-editor/preview/list.d.ts.map +1 -0
  46. package/dist/types/form/form-editor/preview/phone-number.d.ts +4 -0
  47. package/dist/types/form/form-editor/preview/phone-number.d.ts.map +1 -0
  48. package/dist/types/form/form-editor/preview/question.d.ts +119 -0
  49. package/dist/types/form/form-editor/preview/question.d.ts.map +1 -0
  50. package/dist/types/form/form-editor/preview/radio-sortable.d.ts +4 -0
  51. package/dist/types/form/form-editor/preview/radio-sortable.d.ts.map +1 -0
  52. package/dist/types/form/form-editor/preview/radio.d.ts +4 -0
  53. package/dist/types/form/form-editor/preview/radio.d.ts.map +1 -0
  54. package/dist/types/form/form-editor/preview/short-answer.d.ts +4 -0
  55. package/dist/types/form/form-editor/preview/short-answer.d.ts.map +1 -0
  56. package/dist/types/form/form-editor/preview/types.d.ts +52 -0
  57. package/dist/types/form/form-editor/preview/types.d.ts.map +1 -0
  58. package/dist/types/form/form-editor/preview/uk-address.d.ts +4 -0
  59. package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -0
  60. package/dist/types/form/form-editor/types.d.ts +19 -5
  61. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  62. package/dist/types/index.d.ts +2 -0
  63. package/dist/types/index.d.ts.map +1 -1
  64. package/package.json +2 -2
  65. package/src/form/form-editor/__stubs__/preview.js +101 -0
  66. package/src/form/form-editor/index.ts +22 -1
  67. package/src/form/form-editor/preview/date-input.js +18 -0
  68. package/src/form/form-editor/preview/email-address.js +6 -0
  69. package/src/form/form-editor/preview/index.js +10 -0
  70. package/src/form/form-editor/preview/list-sortable.js +39 -0
  71. package/src/form/form-editor/preview/list.js +202 -0
  72. package/src/form/form-editor/preview/phone-number.js +10 -0
  73. package/src/form/form-editor/preview/question.js +199 -0
  74. package/src/form/form-editor/preview/radio-sortable.js +5 -0
  75. package/src/form/form-editor/preview/radio.js +5 -0
  76. package/src/form/form-editor/preview/short-answer.js +3 -0
  77. package/src/form/form-editor/preview/types.ts +60 -0
  78. package/src/form/form-editor/preview/uk-address.js +6 -0
  79. package/src/form/form-editor/types.ts +20 -1
  80. package/src/index.ts +2 -0
@@ -0,0 +1,197 @@
1
+ /**
2
+ * @class Question
3
+ * @classdesc
4
+ * A data object that has access to the underlying data via the QuestionElements object interface
5
+ * and the templating mechanism to render the HTML for the data.
6
+ *
7
+ * It does not have access to the DOM, but has access to QuestionElements.setPreviewHTML to update
8
+ * the HTML. Question classes should only be responsible for data and rendering as are reused in the
9
+ * server side.
10
+ */
11
+ export class Question {
12
+ /**
13
+ * @type {string}
14
+ * @protected
15
+ */
16
+ _questionTemplate = 'textfield.njk';
17
+ /**
18
+ * @type { string|null }
19
+ * @protected
20
+ */
21
+ _highlight = null;
22
+ /**
23
+ * @type {string}
24
+ * @protected
25
+ */
26
+ _fieldName = 'inputField';
27
+ /**
28
+ * @type {QuestionRenderer}
29
+ * @protected
30
+ */
31
+ _questionRenderer;
32
+
33
+ /**
34
+ * @param {QuestionElements} htmlElements
35
+ * @param {QuestionRenderer} questionRenderer
36
+ */
37
+ constructor(htmlElements, questionRenderer) {
38
+ const {
39
+ question,
40
+ hintText,
41
+ optional
42
+ } = htmlElements.values;
43
+
44
+ /**
45
+ * @type {QuestionElements}
46
+ * @private
47
+ */
48
+ this._htmlElements = htmlElements;
49
+ /**
50
+ * @type {string}
51
+ * @private
52
+ */
53
+ this._question = question;
54
+ /**
55
+ * @type {string}
56
+ * @private
57
+ */
58
+ this._hintText = hintText;
59
+ /**
60
+ * @type {boolean}
61
+ * @private
62
+ */
63
+ this._optional = optional;
64
+ /**
65
+ *
66
+ * @type {QuestionRenderer}
67
+ * @protected
68
+ */
69
+ this._questionRenderer = questionRenderer;
70
+ }
71
+
72
+ /**
73
+ * @param {string} element
74
+ * @returns {string}
75
+ * @protected
76
+ */
77
+ getHighlight(element) {
78
+ return this._highlight === element ? ' highlight' : '';
79
+ }
80
+ get titleText() {
81
+ const optionalText = this._optional ? ' (optional)' : '';
82
+ return (!this._question ? 'Question' : this._question) + optionalText;
83
+ }
84
+
85
+ /**
86
+ * @protected
87
+ * @type {DefaultComponent}
88
+ */
89
+ get label() {
90
+ return {
91
+ text: this.titleText,
92
+ classes: 'govuk-label--l' + this.getHighlight('question')
93
+ };
94
+ }
95
+
96
+ /**
97
+ * @protected
98
+ * @type {GovukFieldset}
99
+ */
100
+ get fieldSet() {
101
+ return {
102
+ legend: {
103
+ text: this.titleText,
104
+ classes: 'govuk-fieldset__legend--l' + this.getHighlight('question')
105
+ }
106
+ };
107
+ }
108
+
109
+ /**
110
+ * @type {DefaultComponent}
111
+ * @protected
112
+ */
113
+ get hint() {
114
+ const text = this._highlight === 'hintText' && !this._hintText.length ? 'Hint text' : this._hintText;
115
+ return {
116
+ text,
117
+ classes: this.getHighlight('hintText')
118
+ };
119
+ }
120
+
121
+ /**
122
+ * @type {QuestionBaseModel}
123
+ */
124
+ get renderInput() {
125
+ return {
126
+ id: this._fieldName,
127
+ name: this._fieldName,
128
+ label: this.label,
129
+ hint: this.hint
130
+ };
131
+ }
132
+ render() {
133
+ this._questionRenderer.render(this._questionTemplate, this.renderInput);
134
+ }
135
+
136
+ /**
137
+ * @type {string}
138
+ */
139
+ get question() {
140
+ return this._question;
141
+ }
142
+
143
+ /**
144
+ * @param {string} value
145
+ */
146
+ set question(value) {
147
+ this._question = value;
148
+ this.render();
149
+ }
150
+
151
+ /**
152
+ * @type {string}
153
+ */
154
+ get hintText() {
155
+ return this._hintText;
156
+ }
157
+
158
+ /**
159
+ * @param {string} value
160
+ */
161
+ set hintText(value) {
162
+ this._hintText = value;
163
+ this.render();
164
+ }
165
+ get optional() {
166
+ return this._optional;
167
+ }
168
+
169
+ /**
170
+ * @param {boolean} value
171
+ */
172
+ set optional(value) {
173
+ this._optional = value;
174
+ this.render();
175
+ }
176
+
177
+ /**
178
+ * @type {string | null}
179
+ */
180
+ get highlight() {
181
+ return this._highlight;
182
+ }
183
+
184
+ /**
185
+ * @param {string | null} value
186
+ */
187
+ set highlight(value) {
188
+ this._highlight = value;
189
+ this.render();
190
+ }
191
+ }
192
+
193
+ /**
194
+ * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
195
+ * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'
196
+ */
197
+ //# sourceMappingURL=question.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question.js","names":["Question","_questionTemplate","_highlight","_fieldName","_questionRenderer","constructor","htmlElements","questionRenderer","question","hintText","optional","values","_htmlElements","_question","_hintText","_optional","getHighlight","element","titleText","optionalText","label","text","classes","fieldSet","legend","hint","length","renderInput","id","name","render","value","highlight"],"sources":["../../../../../src/form/form-editor/preview/question.js"],"sourcesContent":["/**\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 {\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = 'textfield.njk'\n /**\n * @type { string|null }\n * @protected\n */\n _highlight = null\n /**\n * @type {string}\n * @protected\n */\n _fieldName = 'inputField'\n /**\n * @type {QuestionRenderer}\n * @protected\n */\n _questionRenderer\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n const { question, hintText, optional } = htmlElements.values\n\n /**\n * @type {QuestionElements}\n * @private\n */\n this._htmlElements = htmlElements\n /**\n * @type {string}\n * @private\n */\n this._question = question\n /**\n * @type {string}\n * @private\n */\n this._hintText = hintText\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 * @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 * @type {QuestionBaseModel}\n */\n get renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n label: this.label,\n hint: this.hint\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 /**\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 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/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,CAAC;EACpB;AACF;AACA;AACA;EACEC,iBAAiB,GAAG,eAAe;EACnC;AACF;AACA;AACA;EACEC,UAAU,GAAG,IAAI;EACjB;AACF;AACA;AACA;EACEC,UAAU,GAAG,YAAY;EACzB;AACF;AACA;AACA;EACEC,iBAAiB;;EAEjB;AACF;AACA;AACA;EACEC,WAAWA,CAACC,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,MAAM;MAAEC,QAAQ;MAAEC,QAAQ;MAAEC;IAAS,CAAC,GAAGJ,YAAY,CAACK,MAAM;;IAE5D;AACJ;AACA;AACA;IACI,IAAI,CAACC,aAAa,GAAGN,YAAY;IACjC;AACJ;AACA;AACA;IACI,IAAI,CAACO,SAAS,GAAGL,QAAQ;IACzB;AACJ;AACA;AACA;IACI,IAAI,CAACM,SAAS,GAAGL,QAAQ;IACzB;AACJ;AACA;AACA;IACI,IAAI,CAACM,SAAS,GAAGL,QAAQ;IACzB;AACJ;AACA;AACA;AACA;IACI,IAAI,CAACN,iBAAiB,GAAGG,gBAAgB;EAC3C;;EAEA;AACF;AACA;AACA;AACA;EACES,YAAYA,CAACC,OAAO,EAAE;IACp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CAAC7B,iBAAiB,EAAE,IAAI,CAAC0B,WAAW,CAAC;EACzE;;EAEA;AACF;AACA;EACE,IAAInB,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACK,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIL,QAAQA,CAACuB,KAAK,EAAE;IAClB,IAAI,CAAClB,SAAS,GAAGkB,KAAK;IACtB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;EACE,IAAIrB,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACK,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIL,QAAQA,CAACsB,KAAK,EAAE;IAClB,IAAI,CAACjB,SAAS,GAAGiB,KAAK;IACtB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;EAEA,IAAIpB,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACK,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIL,QAAQA,CAACqB,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,CAAC9B,UAAU;EACxB;;EAEA;AACF;AACA;EACE,IAAI8B,SAASA,CAACD,KAAK,EAAE;IACnB,IAAI,CAAC7B,UAAU,GAAG6B,KAAK;IACvB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { ListSortableQuestion } from "./list-sortable.js";
2
+ export class RadioSortableQuestion extends ListSortableQuestion {
3
+ _questionTemplate = 'radios.njk';
4
+ }
5
+ //# sourceMappingURL=radio-sortable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-sortable.js","names":["ListSortableQuestion","RadioSortableQuestion","_questionTemplate"],"sources":["../../../../../src/form/form-editor/preview/radio-sortable.js"],"sourcesContent":["import { ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\n\nexport class RadioSortableQuestion extends ListSortableQuestion {\n _questionTemplate = 'radios.njk'\n}\n"],"mappings":"AAAA,SAASA,oBAAoB;AAE7B,OAAO,MAAMC,qBAAqB,SAASD,oBAAoB,CAAC;EAC9DE,iBAAiB,GAAG,YAAY;AAClC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { ListQuestion } from "./list.js";
2
+ export class RadioQuestion extends ListQuestion {
3
+ _questionTemplate = 'radios.njk';
4
+ }
5
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.js","names":["ListQuestion","RadioQuestion","_questionTemplate"],"sources":["../../../../../src/form/form-editor/preview/radio.js"],"sourcesContent":["import { ListQuestion } from '~/src/form/form-editor/preview/list.js'\n\nexport class RadioQuestion extends ListQuestion {\n _questionTemplate = 'radios.njk'\n}\n"],"mappings":"AAAA,SAASA,YAAY;AAErB,OAAO,MAAMC,aAAa,SAASD,YAAY,CAAC;EAC9CE,iBAAiB,GAAG,YAAY;AAClC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { Question } from "./question.js";
2
+ export class ShortAnswerQuestion extends Question {}
3
+ //# sourceMappingURL=short-answer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-answer.js","names":["Question","ShortAnswerQuestion"],"sources":["../../../../../src/form/form-editor/preview/short-answer.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class ShortAnswerQuestion extends Question {}\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,mBAAmB,SAASD,QAAQ,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type ListElement,\n type ListItemReadonly\n} from '~/src/form/form-editor/types.js'\n\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n items: ListElement[]\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 interface QuestionBaseModel {\n id?: string\n name?: string\n label?: DefaultComponent\n hint?: DefaultComponent\n fieldset?: GovukFieldset\n readonly items?: ListItemReadonly[]\n text?: string\n formGroup?: { afterInputs: { html: string } }\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface QuestionElements {\n readonly values: BaseSettings\n setPreviewHTML(value: string): void\n}\n\nexport interface RenderContext {\n model: QuestionBaseModel\n}\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 ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import { Question } from "./question.js";
2
+ export class UkAddressQuestion extends Question {
3
+ _questionTemplate = 'ukaddressfield.njk';
4
+ _fieldName = 'addressField';
5
+ }
6
+ //# sourceMappingURL=uk-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uk-address.js","names":["Question","UkAddressQuestion","_questionTemplate","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class UkAddressQuestion extends Question {\n _questionTemplate = 'ukaddressfield.njk'\n _fieldName = 'addressField'\n}\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,iBAAiB,SAASD,QAAQ,CAAC;EAC9CE,iBAAiB,GAAG,oBAAoB;EACxCC,UAAU,GAAG,cAAc;AAC7B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioText?: string\n\n /**\n * The hint of the radio item\n */\n radioHint?: string\n\n /**\n * The value of the radio item\n */\n radioValue?: string\n\n /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: string\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: string\n label: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: string\n readonly label: ListLabel\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioText?: string\n\n /**\n * The hint of the radio item\n */\n radioHint?: string\n\n /**\n * The value of the radio item\n */\n radioValue?: string\n\n /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: string\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: string\n label: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: string\n readonly label: ListLabel\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -12,6 +12,7 @@ export * from "./form/form-metadata/index.js";
12
12
  export * from "./form/form-submission/index.js";
13
13
  export * from "./form/utils/index.js";
14
14
  export * from "./form/form-editor/index.js";
15
+ export * from "./form/form-editor/preview/index.js";
15
16
  export * from "./form/form-manager/types.js";
16
17
  export * from "./pages/index.js";
17
18
  export * from "./utils/helpers.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/types.js'\n"],"mappings":"AAAA;AACA;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/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @implements {QuestionRenderer}
3
+ */
4
+ export class QuestionRendererStub implements QuestionRenderer {
5
+ /**
6
+ * @returns {string}
7
+ * @param {string} _questionTemplate
8
+ * @param {RenderContext} _renderContext
9
+ */
10
+ static buildHTML(_questionTemplate: string, _renderContext: RenderContext): string;
11
+ /**
12
+ * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock
13
+ */
14
+ constructor(renderMock: jest.Mock<void, [string, QuestionBaseModel]>);
15
+ /**
16
+ * @type {jest.Mock<void, [string, QuestionBaseModel]>}
17
+ */
18
+ renderMock: jest.Mock<void, [string, QuestionBaseModel]>;
19
+ /**
20
+ * @param {string} questionTemplate
21
+ * @param {QuestionBaseModel} questionBaseModel
22
+ */
23
+ render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void;
24
+ }
25
+ /**
26
+ * @implements {ListElements}
27
+ */
28
+ export class QuestionPreviewElements implements ListElements {
29
+ /**
30
+ * @param {BaseSettings} baseSettings
31
+ */
32
+ constructor({ question, hintText, optional, shortDesc, items }: BaseSettings);
33
+ /**
34
+ * @protected
35
+ */
36
+ protected _question: string;
37
+ /** @protected */
38
+ protected _hintText: string;
39
+ /** @protected */
40
+ protected _optional: boolean;
41
+ /**
42
+ * @type {string}
43
+ * @protected
44
+ */
45
+ protected _shortDesc: string;
46
+ /**
47
+ *
48
+ * @type {ListElement[]}
49
+ * @private
50
+ */
51
+ private _items;
52
+ afterInputsHTML: string;
53
+ get values(): {
54
+ question: string;
55
+ hintText: string;
56
+ optional: boolean;
57
+ shortDesc: string;
58
+ items: ListElement[];
59
+ };
60
+ /**
61
+ * @param {string} _value
62
+ */
63
+ setPreviewHTML(_value: string): void;
64
+ }
65
+ export const baseElements: BaseSettings;
66
+ import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
67
+ import type { QuestionBaseModel } from '../../../form/form-editor/preview/types.js';
68
+ import type { RenderContext } from '../../../form/form-editor/preview/types.js';
69
+ import type { ListElements } from '../../../form/form-editor/preview/types.js';
70
+ import type { ListElement } from '../../../form/form-editor/types.js';
71
+ import type { BaseSettings } from '../../../form/form-editor/preview/types.js';
72
+ //# sourceMappingURL=preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAqBE;;;;OAIG;IACH,oCAHW,MAAM,kBACN,aAAa,GAFX,MAAM,CAMlB;IAtBD;;OAEG;IACH,wBAFW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EAItD;IAVD;;OAEG;IACH,YAFU,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAE5C;IASV;;;OAGG;IACH,yBAHW,MAAM,qBACN,iBAAiB,QAI3B;CAUF;AAED;;GAEG;AACH;IAuBE;;OAEG;IACH,gEAFW,YAAY,EAQtB;IA/BD;;OAEG;IACH,4BAAc;IACd,iBAAiB;IACjB,4BAAc;IACd,iBAAiB;IACjB,6BAAiB;IACjB;;;OAGG;IACH,sBAHU,MAAM,CAGD;IACf;;;;OAIG;IACH,eAAW;IAEX,wBAA2E;IAa3E;;;;;;MAQC;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;CACF;AAED,2BAAuC,YAAY,CAMjD;sCAIoH,yCAAyC;uCAAzC,yCAAyC;mCAAzC,yCAAyC;kCAAzC,yCAAyC;iCAD9H,iCAAiC;kCACoD,yCAAyC"}
@@ -1,5 +1,5 @@
1
1
  import Joi, { type ArraySchema } from 'joi';
2
- import { type FormEditorInputCheckAnswersSettings, type FormEditorInputPage, type FormEditorInputPageSettings, type FormEditorInputQuestion } from '../../form/form-editor/types.js';
2
+ import { type FormEditorInputCheckAnswersSettings, type FormEditorInputPage, type FormEditorInputPageSettings, type FormEditorInputQuestion, type GovukField, type GovukFieldQuestionOptional, type GovukStringField } from '../../form/form-editor/types.js';
3
3
  export declare enum QuestionTypeSubGroup {
4
4
  WrittenAnswerSubGroup = "writtenAnswerSub",
5
5
  DateSubGroup = "dateSub",
@@ -146,5 +146,7 @@ export declare const formEditorInputPageSettingsKeys: {
146
146
  * @see {@link FormEditorInputPageSettings}
147
147
  */
148
148
  export declare const formEditorInputPageSettingsSchema: Joi.ObjectSchema<FormEditorInputPageSettings>;
149
+ export declare function govukFieldValueIsString(govukField: GovukField): govukField is GovukStringField;
150
+ export declare function govukFieldIsQuestionOptional(govukField: GovukField): govukField is GovukFieldQuestionOptional;
149
151
  export {};
150
152
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form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types.js").GovukFieldset;
6
+ hint: import("./types.js").DefaultComponent;
7
+ };
8
+ }
9
+ import { Question } from '../../../form/form-editor/preview/question.js';
10
+ //# sourceMappingURL=date-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/date-input.js"],"names":[],"mappings":"AAEA;IAOE;;;;;MAOC;CACF;yBAjBwB,4CAA4C"}
@@ -0,0 +1,4 @@
1
+ export class EmailAddressQuestion extends Question {
2
+ }
3
+ import { Question } from '../../../form/form-editor/preview/question.js';
4
+ //# sourceMappingURL=email-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-address.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/email-address.js"],"names":[],"mappings":"AAEA;CAGC;yBALwB,4CAA4C"}
@@ -0,0 +1,11 @@
1
+ export * from "../../../form/form-editor/preview/date-input.js";
2
+ export * from "../../../form/form-editor/preview/email-address.js";
3
+ export * from "../../../form/form-editor/preview/list.js";
4
+ export * from "../../../form/form-editor/preview/list-sortable.js";
5
+ export * from "../../../form/form-editor/preview/phone-number.js";
6
+ export * from "../../../form/form-editor/preview/question.js";
7
+ export * from "../../../form/form-editor/preview/radio.js";
8
+ export * from "../../../form/form-editor/preview/radio-sortable.js";
9
+ export * from "../../../form/form-editor/preview/short-answer.js";
10
+ export * from "../../../form/form-editor/preview/uk-address.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ export class ListSortableQuestion extends ListQuestion {
2
+ /**
3
+ * @returns {Map<string, ListElement>}
4
+ */
5
+ resyncPreviewAfterReorder(): Map<string, ListElement>;
6
+ get listElementObjects(): {
7
+ id: string;
8
+ text: string;
9
+ hint: {
10
+ text: string;
11
+ } | undefined;
12
+ value: string;
13
+ }[];
14
+ }
15
+ import { ListQuestion } from '../../../form/form-editor/preview/list.js';
16
+ import type { ListElement } from '../../../form/form-editor/types.js';
17
+ //# sourceMappingURL=list-sortable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-sortable.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/list-sortable.js"],"names":[],"mappings":"AAEA;IAYE;;OAEG;IACH,6BAFa,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAOpC;IAED;;;;;;;QAOC;CACF;6BAhC4B,wCAAwC;iCAmCvC,iCAAiC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @param {ListElement} listElement
3
+ * @returns {[string, ListElement]}
4
+ */
5
+ export function listItemMapper(listElement: ListElement): [string, ListElement];
6
+ /**
7
+ *
8
+ * @param { ListElement[]| undefined } listElements
9
+ * @returns {Map<string, ListElement>}
10
+ */
11
+ export function listsElementToMap(listElements: ListElement[] | undefined): Map<string, ListElement>;
12
+ export class ListQuestion extends Question {
13
+ /**
14
+ * @param {ListElements} listElements
15
+ * @param {QuestionRenderer} questionRenderer
16
+ */
17
+ constructor(listElements: ListElements, questionRenderer: QuestionRenderer);
18
+ /** @type {ListElements} */
19
+ _listElements: ListElements;
20
+ listRenderId: string;
21
+ listRenderName: string;
22
+ /**
23
+ * @type {Map<string, ListElement>}
24
+ * @protected
25
+ */
26
+ protected _list: Map<string, ListElement>;
27
+ get renderInput(): {
28
+ formGroup?: {
29
+ afterInputs: {
30
+ html: string;
31
+ };
32
+ };
33
+ id: string;
34
+ name: string;
35
+ fieldset: import("../../../form/form-editor/preview/types.js").GovukFieldset;
36
+ hint: import("../../../form/form-editor/preview/types.js").DefaultComponent;
37
+ items: ListItemReadonly[];
38
+ };
39
+ /**
40
+ *
41
+ * @param {ListElement} listElement
42
+ */
43
+ push(listElement: ListElement): void;
44
+ /**
45
+ * @param {string} key
46
+ */
47
+ delete(key: string): void;
48
+ /**
49
+ * @param {ListElement[]} listElements
50
+ * @returns {Map<string, ListElement>}
51
+ */
52
+ createListFromElements(listElements: ListElement[]): Map<string, ListElement>;
53
+ /**
54
+ * @returns {ListItemReadonly[]}
55
+ * @readonly
56
+ */
57
+ readonly get list(): ListItemReadonly[];
58
+ /**
59
+ *
60
+ * @param {string | undefined} id
61
+ * @param {string} text
62
+ */
63
+ updateText(id: string | undefined, text: string): void;
64
+ /**
65
+ *
66
+ * @param {string | undefined} id
67
+ * @param {string} hint
68
+ */
69
+ updateHint(id: string | undefined, hint: string): void;
70
+ /**
71
+ * @param {string | undefined} id
72
+ * @param {string} value
73
+ */
74
+ updateValue(id: string | undefined, value: string): void;
75
+ }
76
+ import type { ListElement } from '../../../form/form-editor/types.js';
77
+ import { Question } from '../../../form/form-editor/preview/question.js';
78
+ import type { ListElements } from '../../../form/form-editor/preview/types.js';
79
+ import type { ListItemReadonly } from '../../../form/form-editor/types.js';
80
+ import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
81
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/list.js"],"names":[],"mappings":"AAUA;;;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;IAiBE;;;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;oBAE6B;YAAE,WAAW,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE;;;;;;MAoB7D;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;;;OAGG;IACH,qBAHa,gBAAgB,EAAE,CAkC9B;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;yBAvM1D,4CAA4C;kCAwMQ,yCAAyC;sCADpE,iCAAiC;sCACN,yCAAyC"}
@@ -0,0 +1,4 @@
1
+ export class PhoneNumberQuestion extends Question {
2
+ }
3
+ import { Question } from '../../../form/form-editor/preview/question.js';
4
+ //# sourceMappingURL=phone-number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-number.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/phone-number.js"],"names":[],"mappings":"AAEA;CAGC;yBALwB,4CAA4C"}