@defra/forms-model 3.0.447 → 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 (95) hide show
  1. package/dist/module/form/form-definition/index.js +1 -1
  2. package/dist/module/form/form-definition/index.js.map +1 -1
  3. package/dist/module/form/form-editor/__stubs__/preview.js +105 -0
  4. package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -0
  5. package/dist/module/form/form-editor/index.js +14 -0
  6. package/dist/module/form/form-editor/index.js.map +1 -1
  7. package/dist/module/form/form-editor/preview/date-input.js +17 -0
  8. package/dist/module/form/form-editor/preview/date-input.js.map +1 -0
  9. package/dist/module/form/form-editor/preview/email-address.js +6 -0
  10. package/dist/module/form/form-editor/preview/email-address.js.map +1 -0
  11. package/dist/module/form/form-editor/preview/index.js +11 -0
  12. package/dist/module/form/form-editor/preview/index.js.map +1 -0
  13. package/dist/module/form/form-editor/preview/list-sortable.js +40 -0
  14. package/dist/module/form/form-editor/preview/list-sortable.js.map +1 -0
  15. package/dist/module/form/form-editor/preview/list.js +182 -0
  16. package/dist/module/form/form-editor/preview/list.js.map +1 -0
  17. package/dist/module/form/form-editor/preview/phone-number.js +10 -0
  18. package/dist/module/form/form-editor/preview/phone-number.js.map +1 -0
  19. package/dist/module/form/form-editor/preview/question.js +197 -0
  20. package/dist/module/form/form-editor/preview/question.js.map +1 -0
  21. package/dist/module/form/form-editor/preview/radio-sortable.js +5 -0
  22. package/dist/module/form/form-editor/preview/radio-sortable.js.map +1 -0
  23. package/dist/module/form/form-editor/preview/radio.js +5 -0
  24. package/dist/module/form/form-editor/preview/radio.js.map +1 -0
  25. package/dist/module/form/form-editor/preview/short-answer.js +3 -0
  26. package/dist/module/form/form-editor/preview/short-answer.js.map +1 -0
  27. package/dist/module/form/form-editor/preview/types.js +2 -0
  28. package/dist/module/form/form-editor/preview/types.js.map +1 -0
  29. package/dist/module/form/form-editor/preview/uk-address.js +6 -0
  30. package/dist/module/form/form-editor/preview/uk-address.js.map +1 -0
  31. package/dist/module/form/form-editor/types.js.map +1 -1
  32. package/dist/module/form/form-manager/types.js.map +1 -1
  33. package/dist/module/index.js +1 -1
  34. package/dist/module/index.js.map +1 -1
  35. package/dist/types/form/form-definition/index.d.ts +2 -1
  36. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  37. package/dist/types/form/form-editor/__stubs__/preview.d.ts +72 -0
  38. package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -0
  39. package/dist/types/form/form-editor/index.d.ts +7 -1
  40. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  41. package/dist/types/form/form-editor/preview/date-input.d.ts +10 -0
  42. package/dist/types/form/form-editor/preview/date-input.d.ts.map +1 -0
  43. package/dist/types/form/form-editor/preview/email-address.d.ts +4 -0
  44. package/dist/types/form/form-editor/preview/email-address.d.ts.map +1 -0
  45. package/dist/types/form/form-editor/preview/index.d.ts +11 -0
  46. package/dist/types/form/form-editor/preview/index.d.ts.map +1 -0
  47. package/dist/types/form/form-editor/preview/list-sortable.d.ts +17 -0
  48. package/dist/types/form/form-editor/preview/list-sortable.d.ts.map +1 -0
  49. package/dist/types/form/form-editor/preview/list.d.ts +81 -0
  50. package/dist/types/form/form-editor/preview/list.d.ts.map +1 -0
  51. package/dist/types/form/form-editor/preview/phone-number.d.ts +4 -0
  52. package/dist/types/form/form-editor/preview/phone-number.d.ts.map +1 -0
  53. package/dist/types/form/form-editor/preview/question.d.ts +119 -0
  54. package/dist/types/form/form-editor/preview/question.d.ts.map +1 -0
  55. package/dist/types/form/form-editor/preview/radio-sortable.d.ts +4 -0
  56. package/dist/types/form/form-editor/preview/radio-sortable.d.ts.map +1 -0
  57. package/dist/types/form/form-editor/preview/radio.d.ts +4 -0
  58. package/dist/types/form/form-editor/preview/radio.d.ts.map +1 -0
  59. package/dist/types/form/form-editor/preview/short-answer.d.ts +4 -0
  60. package/dist/types/form/form-editor/preview/short-answer.d.ts.map +1 -0
  61. package/dist/types/form/form-editor/preview/types.d.ts +52 -0
  62. package/dist/types/form/form-editor/preview/types.d.ts.map +1 -0
  63. package/dist/types/form/form-editor/preview/uk-address.d.ts +4 -0
  64. package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -0
  65. package/dist/types/form/form-editor/types.d.ts +36 -6
  66. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  67. package/dist/types/form/form-manager/types.d.ts +2 -2
  68. package/dist/types/form/form-manager/types.d.ts.map +1 -1
  69. package/dist/types/index.d.ts +2 -1
  70. package/dist/types/index.d.ts.map +1 -1
  71. package/package.json +2 -2
  72. package/src/form/form-definition/index.ts +1 -1
  73. package/src/form/form-editor/__stubs__/preview.js +101 -0
  74. package/src/form/form-editor/index.ts +43 -1
  75. package/src/form/form-editor/preview/date-input.js +18 -0
  76. package/src/form/form-editor/preview/email-address.js +6 -0
  77. package/src/form/form-editor/preview/index.js +10 -0
  78. package/src/form/form-editor/preview/list-sortable.js +39 -0
  79. package/src/form/form-editor/preview/list.js +202 -0
  80. package/src/form/form-editor/preview/phone-number.js +10 -0
  81. package/src/form/form-editor/preview/question.js +199 -0
  82. package/src/form/form-editor/preview/radio-sortable.js +5 -0
  83. package/src/form/form-editor/preview/radio.js +5 -0
  84. package/src/form/form-editor/preview/short-answer.js +3 -0
  85. package/src/form/form-editor/preview/types.ts +60 -0
  86. package/src/form/form-editor/preview/uk-address.js +6 -0
  87. package/src/form/form-editor/types.ts +47 -2
  88. package/src/form/form-manager/types.ts +2 -2
  89. package/src/index.ts +2 -1
  90. package/dist/module/form/form-manager/index.js +0 -7
  91. package/dist/module/form/form-manager/index.js.map +0 -1
  92. package/dist/types/form/form-manager/index.d.ts +0 -3
  93. package/dist/types/form/form-manager/index.d.ts.map +0 -1
  94. package/schemas/patch-page-schema.json +0 -26
  95. package/src/form/form-manager/index.ts +0 -21
@@ -0,0 +1,40 @@
1
+ import { ListQuestion } from "./list.js";
2
+ export class ListSortableQuestion extends ListQuestion {
3
+ /**
4
+ * @param {ListElements} listElements
5
+ * @param {QuestionRenderer} questionRenderer
6
+ */
7
+ constructor(listElements, questionRenderer) {
8
+ super(listElements, questionRenderer);
9
+ const items = /** @type {ListElement[]} */listElements.values.items;
10
+ this._list = this.createListFromElements(items);
11
+ this._listElements = listElements;
12
+ }
13
+
14
+ /**
15
+ * @returns {Map<string, ListElement>}
16
+ */
17
+ resyncPreviewAfterReorder() {
18
+ const newList = this._listElements.values.items;
19
+ this._list = this.createListFromElements(newList);
20
+ this.render();
21
+ return this._list;
22
+ }
23
+ get listElementObjects() {
24
+ return Array.from(this._list).map(([, value]) => ({
25
+ id: value.id,
26
+ text: value.text,
27
+ hint: value.hint?.text ? {
28
+ text: value.hint.text
29
+ } : undefined,
30
+ value: value.value
31
+ }));
32
+ }
33
+ }
34
+
35
+ /**
36
+ * @import {ListElement} from '~/src/form/form-editor/types.js'
37
+ * @import { QuestionRenderer, HTMLBuilder, ListElements, BaseSettings } from '~/src/form/form-editor/preview/types.js'
38
+ * @import { SortableEvent, SortableOptions } from 'sortablejs'
39
+ */
40
+ //# sourceMappingURL=list-sortable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-sortable.js","names":["ListQuestion","ListSortableQuestion","constructor","listElements","questionRenderer","items","values","_list","createListFromElements","_listElements","resyncPreviewAfterReorder","newList","render","listElementObjects","Array","from","map","value","id","text","hint","undefined"],"sources":["../../../../../src/form/form-editor/preview/list-sortable.js"],"sourcesContent":["import { ListQuestion } from '~/src/form/form-editor/preview/list.js'\n\nexport class ListSortableQuestion extends ListQuestion {\n /**\n * @param {ListElements} listElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(listElements, questionRenderer) {\n super(listElements, questionRenderer)\n const items = /** @type {ListElement[]} */ (listElements.values.items)\n this._list = this.createListFromElements(items)\n this._listElements = listElements\n }\n\n /**\n * @returns {Map<string, ListElement>}\n */\n resyncPreviewAfterReorder() {\n const newList = this._listElements.values.items\n this._list = this.createListFromElements(newList)\n this.render()\n return this._list\n }\n\n get listElementObjects() {\n return Array.from(this._list).map(([, value]) => ({\n id: value.id,\n text: value.text,\n hint: value.hint?.text ? { text: value.hint.text } : undefined,\n value: value.value\n }))\n }\n}\n\n/**\n * @import {ListElement} from '~/src/form/form-editor/types.js'\n * @import { QuestionRenderer, HTMLBuilder, ListElements, BaseSettings } from '~/src/form/form-editor/preview/types.js'\n * @import { SortableEvent, SortableOptions } from 'sortablejs'\n */\n"],"mappings":"AAAA,SAASA,YAAY;AAErB,OAAO,MAAMC,oBAAoB,SAASD,YAAY,CAAC;EACrD;AACF;AACA;AACA;EACEE,WAAWA,CAACC,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,KAAK,CAACD,YAAY,EAAEC,gBAAgB,CAAC;IACrC,MAAMC,KAAK,GAAG,4BAA8BF,YAAY,CAACG,MAAM,CAACD,KAAM;IACtE,IAAI,CAACE,KAAK,GAAG,IAAI,CAACC,sBAAsB,CAACH,KAAK,CAAC;IAC/C,IAAI,CAACI,aAAa,GAAGN,YAAY;EACnC;;EAEA;AACF;AACA;EACEO,yBAAyBA,CAAA,EAAG;IAC1B,MAAMC,OAAO,GAAG,IAAI,CAACF,aAAa,CAACH,MAAM,CAACD,KAAK;IAC/C,IAAI,CAACE,KAAK,GAAG,IAAI,CAACC,sBAAsB,CAACG,OAAO,CAAC;IACjD,IAAI,CAACC,MAAM,CAAC,CAAC;IACb,OAAO,IAAI,CAACL,KAAK;EACnB;EAEA,IAAIM,kBAAkBA,CAAA,EAAG;IACvB,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACR,KAAK,CAAC,CAACS,GAAG,CAAC,CAAC,GAAGC,KAAK,CAAC,MAAM;MAChDC,EAAE,EAAED,KAAK,CAACC,EAAE;MACZC,IAAI,EAAEF,KAAK,CAACE,IAAI;MAChBC,IAAI,EAAEH,KAAK,CAACG,IAAI,EAAED,IAAI,GAAG;QAAEA,IAAI,EAAEF,KAAK,CAACG,IAAI,CAACD;MAAK,CAAC,GAAGE,SAAS;MAC9DJ,KAAK,EAAEA,KAAK,CAACA;IACf,CAAC,CAAC,CAAC;EACL;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,182 @@
1
+ import { Question } from "./question.js";
2
+ const DefaultListConst = {
3
+ TextElementId: 'radioText',
4
+ HintElementId: 'radioHint',
5
+ Template: 'radios.njk',
6
+ Input: 'listInput',
7
+ RenderName: 'listInputField'
8
+ };
9
+
10
+ /**
11
+ * @param {ListElement} listElement
12
+ * @returns {[string, ListElement]}
13
+ */
14
+ export function listItemMapper(listElement) {
15
+ return [listElement.id, listElement];
16
+ }
17
+
18
+ /**
19
+ *
20
+ * @param { ListElement[]| undefined } listElements
21
+ * @returns {Map<string, ListElement>}
22
+ */
23
+ export function listsElementToMap(listElements) {
24
+ const entries = listElements ? listElements.map(listItemMapper) : [];
25
+ return new Map(entries);
26
+ }
27
+ export class ListQuestion extends Question {
28
+ /**
29
+ * @type {string}
30
+ * @protected
31
+ */
32
+ _questionTemplate = DefaultListConst.Template;
33
+ /** @type {ListElements} */
34
+ _listElements;
35
+ listRenderId = DefaultListConst.Input;
36
+ listRenderName = DefaultListConst.RenderName;
37
+
38
+ /**
39
+ * @type {Map<string, ListElement>}
40
+ * @protected
41
+ */
42
+ _list;
43
+
44
+ /**
45
+ * @param {ListElements} listElements
46
+ * @param {QuestionRenderer} questionRenderer
47
+ */
48
+ constructor(listElements, questionRenderer) {
49
+ super(listElements, questionRenderer);
50
+ const items = /** @type {ListElement[]} */listElements.values.items;
51
+ this._list = this.createListFromElements(items);
52
+ this._listElements = listElements;
53
+ }
54
+ get renderInput() {
55
+ const afterInputs = /** @type {{ formGroup?: { afterInputs: { html: string } } }} */
56
+ this.list.length ? {} : {
57
+ formGroup: {
58
+ afterInputs: {
59
+ html: this._listElements.afterInputsHTML
60
+ }
61
+ }
62
+ };
63
+ return {
64
+ id: this.listRenderId,
65
+ name: this.listRenderName,
66
+ fieldset: this.fieldSet,
67
+ hint: this.hint,
68
+ items: this.list,
69
+ ...afterInputs
70
+ };
71
+ }
72
+
73
+ /**
74
+ *
75
+ * @param {ListElement} listElement
76
+ */
77
+ push(listElement) {
78
+ this._list.set(listElement.id, listElement);
79
+ this.render();
80
+ }
81
+
82
+ /**
83
+ * @param {string} key
84
+ */
85
+ delete(key) {
86
+ this._list.delete(key);
87
+ this.render();
88
+ }
89
+
90
+ /**
91
+ * @param {ListElement[]} listElements
92
+ * @returns {Map<string, ListElement>}
93
+ */
94
+ createListFromElements(listElements) {
95
+ this._list = listsElementToMap(listElements);
96
+ return this._list;
97
+ }
98
+
99
+ /**
100
+ * @returns {ListItemReadonly[]}
101
+ * @readonly
102
+ */
103
+ get list() {
104
+ const iterator = /** @type {MapIterator<ListElement>} */
105
+ this._list.values();
106
+ return Array.from(iterator).map(listItem => {
107
+ const hintText = this._highlight === `${listItem.id}-hint` && !listItem.hint?.text.length ? 'Hint text' : listItem.hint?.text ?? '';
108
+ const hint = {
109
+ hint: hintText ? {
110
+ text: hintText,
111
+ classes: this.getHighlight(listItem.id + '-hint')
112
+ } : undefined
113
+ };
114
+ const text = listItem.text.length ? listItem.text : 'Item text';
115
+ return {
116
+ ...listItem,
117
+ text,
118
+ ...hint,
119
+ label: {
120
+ text: listItem.text,
121
+ classes: this.getHighlight(listItem.id + '-label')
122
+ }
123
+ };
124
+ });
125
+ }
126
+
127
+ /**
128
+ *
129
+ * @param {string | undefined} id
130
+ * @param {string} text
131
+ */
132
+ updateText(id, text) {
133
+ if (!id) {
134
+ return;
135
+ }
136
+ const listItem = this._list.get(id);
137
+ if (listItem) {
138
+ listItem.text = text;
139
+ this.render();
140
+ }
141
+ }
142
+
143
+ /**
144
+ *
145
+ * @param {string | undefined} id
146
+ * @param {string} hint
147
+ */
148
+ updateHint(id, hint) {
149
+ if (!id) {
150
+ return;
151
+ }
152
+ const listItem = this._list.get(id);
153
+ if (listItem) {
154
+ listItem.hint = {
155
+ ...listItem.hint,
156
+ text: hint
157
+ };
158
+ this.render();
159
+ }
160
+ }
161
+
162
+ /**
163
+ * @param {string | undefined} id
164
+ * @param {string} value
165
+ */
166
+ updateValue(id, value) {
167
+ if (!id) {
168
+ return;
169
+ }
170
+ const listItem = this._list.get(id);
171
+ if (listItem) {
172
+ listItem.value = value;
173
+ this.render();
174
+ }
175
+ }
176
+ }
177
+
178
+ /**
179
+ * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'
180
+ * @import { ListenerRow, ListElements, QuestionRenderer, HTMLBuilder } from '~/src/form/form-editor/preview/types.js'
181
+ */
182
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","names":["Question","DefaultListConst","TextElementId","HintElementId","Template","Input","RenderName","listItemMapper","listElement","id","listsElementToMap","listElements","entries","map","Map","ListQuestion","_questionTemplate","_listElements","listRenderId","listRenderName","_list","constructor","questionRenderer","items","values","createListFromElements","renderInput","afterInputs","list","length","formGroup","html","afterInputsHTML","name","fieldset","fieldSet","hint","push","set","render","delete","key","iterator","Array","from","listItem","hintText","_highlight","text","classes","getHighlight","undefined","label","updateText","get","updateHint","updateValue","value"],"sources":["../../../../../src/form/form-editor/preview/list.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nconst DefaultListConst = {\n TextElementId: 'radioText',\n HintElementId: 'radioHint',\n Template: 'radios.njk',\n Input: 'listInput',\n RenderName: 'listInputField'\n}\n\n/**\n * @param {ListElement} listElement\n * @returns {[string, ListElement]}\n */\nexport function listItemMapper(listElement) {\n return [listElement.id, listElement]\n}\n\n/**\n *\n * @param { ListElement[]| undefined } listElements\n * @returns {Map<string, ListElement>}\n */\nexport function listsElementToMap(listElements) {\n const entries = listElements ? listElements.map(listItemMapper) : []\n return new Map(entries)\n}\n\nexport class ListQuestion extends Question {\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = DefaultListConst.Template\n /** @type {ListElements} */\n _listElements\n listRenderId = DefaultListConst.Input\n listRenderName = DefaultListConst.RenderName\n\n /**\n * @type {Map<string, ListElement>}\n * @protected\n */\n _list\n\n /**\n * @param {ListElements} listElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(listElements, questionRenderer) {\n super(listElements, questionRenderer)\n\n const items = /** @type {ListElement[]} */ (listElements.values.items)\n this._list = this.createListFromElements(items)\n this._listElements = listElements\n }\n\n get renderInput() {\n const afterInputs =\n /** @type {{ formGroup?: { afterInputs: { html: string } } }} */ (\n this.list.length\n ? {}\n : {\n formGroup: {\n afterInputs: {\n html: this._listElements.afterInputsHTML\n }\n }\n }\n )\n\n return {\n id: this.listRenderId,\n name: this.listRenderName,\n fieldset: this.fieldSet,\n hint: this.hint,\n items: this.list,\n ...afterInputs\n }\n }\n\n /**\n *\n * @param {ListElement} listElement\n */\n push(listElement) {\n this._list.set(listElement.id, listElement)\n this.render()\n }\n\n /**\n * @param {string} key\n */\n delete(key) {\n this._list.delete(key)\n this.render()\n }\n\n /**\n * @param {ListElement[]} listElements\n * @returns {Map<string, ListElement>}\n */\n createListFromElements(listElements) {\n this._list = listsElementToMap(listElements)\n return this._list\n }\n\n /**\n * @returns {ListItemReadonly[]}\n * @readonly\n */\n get list() {\n const iterator = /** @type {MapIterator<ListElement>} */ (\n this._list.values()\n )\n return Array.from(iterator).map((listItem) => {\n const hintText =\n this._highlight === `${listItem.id}-hint` && !listItem.hint?.text.length\n ? 'Hint text'\n : (listItem.hint?.text ?? '')\n\n const hint = {\n hint: hintText\n ? {\n text: hintText,\n classes: this.getHighlight(listItem.id + '-hint')\n }\n : undefined\n }\n\n const text = listItem.text.length ? listItem.text : 'Item text'\n\n return {\n ...listItem,\n text,\n ...hint,\n label: {\n text: listItem.text,\n classes: this.getHighlight(listItem.id + '-label')\n }\n }\n })\n }\n\n /**\n *\n * @param {string | undefined} id\n * @param {string} text\n */\n updateText(id, text) {\n if (!id) {\n return\n }\n\n const listItem = this._list.get(id)\n if (listItem) {\n listItem.text = text\n this.render()\n }\n }\n\n /**\n *\n * @param {string | undefined} id\n * @param {string} hint\n */\n updateHint(id, hint) {\n if (!id) {\n return\n }\n\n const listItem = this._list.get(id)\n if (listItem) {\n listItem.hint = {\n ...listItem.hint,\n text: hint\n }\n this.render()\n }\n }\n\n /**\n * @param {string | undefined} id\n * @param {string} value\n */\n updateValue(id, value) {\n if (!id) {\n return\n }\n\n const listItem = this._list.get(id)\n if (listItem) {\n listItem.value = value\n this.render()\n }\n }\n}\n\n/**\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n * @import { ListenerRow, ListElements, QuestionRenderer, HTMLBuilder } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,MAAMC,gBAAgB,GAAG;EACvBC,aAAa,EAAE,WAAW;EAC1BC,aAAa,EAAE,WAAW;EAC1BC,QAAQ,EAAE,YAAY;EACtBC,KAAK,EAAE,WAAW;EAClBC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,WAAW,EAAE;EAC1C,OAAO,CAACA,WAAW,CAACC,EAAE,EAAED,WAAW,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiBA,CAACC,YAAY,EAAE;EAC9C,MAAMC,OAAO,GAAGD,YAAY,GAAGA,YAAY,CAACE,GAAG,CAACN,cAAc,CAAC,GAAG,EAAE;EACpE,OAAO,IAAIO,GAAG,CAACF,OAAO,CAAC;AACzB;AAEA,OAAO,MAAMG,YAAY,SAASf,QAAQ,CAAC;EACzC;AACF;AACA;AACA;EACEgB,iBAAiB,GAAGf,gBAAgB,CAACG,QAAQ;EAC7C;EACAa,aAAa;EACbC,YAAY,GAAGjB,gBAAgB,CAACI,KAAK;EACrCc,cAAc,GAAGlB,gBAAgB,CAACK,UAAU;;EAE5C;AACF;AACA;AACA;EACEc,KAAK;;EAEL;AACF;AACA;AACA;EACEC,WAAWA,CAACV,YAAY,EAAEW,gBAAgB,EAAE;IAC1C,KAAK,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AE;IACnB,IAAI,CAAC3B,EAAE,EAAE;MACP;IACF;IAEA,MAAMoC,QAAQ,GAAG,IAAI,CAACzB,KAAK,CAACkC,GAAG,CAAC7C,EAAE,CAAC;IACnC,IAAIoC,QAAQ,EAAE;MACZA,QAAQ,CAACT,IAAI,GAAG;QACd,GAAGS,QAAQ,CAACT,IAAI;QAChBY,IAAI,EAAEZ;MACR,CAAC;MACD,IAAI,CAACG,MAAM,CAAC,CAAC;IACf;EACF;;EAEA;AACF;AACA;AACA;EACEiB,WAAWA,CAAC/C,EAAE,EAAEgD,KAAK,EAAE;IACrB,IAAI,CAAChD,EAAE,EAAE;MACP;IACF;IAEA,MAAMoC,QAAQ,GAAG,IAAI,CAACzB,KAAK,CAACkC,GAAG,CAAC7C,EAAE,CAAC;IACnC,IAAIoC,QAAQ,EAAE;MACZA,QAAQ,CAACY,KAAK,GAAGA,KAAK;MACtB,IAAI,CAAClB,MAAM,CAAC,CAAC;IACf;EACF;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { Question } from "./question.js";
2
+ export class PhoneNumberQuestion extends Question {
3
+ _questionTemplate = 'telephonenumberfield.njk';
4
+ _fieldName = 'phoneNumberField';
5
+ }
6
+
7
+ /**
8
+ * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/question.js'
9
+ */
10
+ //# sourceMappingURL=phone-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-number.js","names":["Question","PhoneNumberQuestion","_questionTemplate","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/phone-number.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class PhoneNumberQuestion extends Question {\n _questionTemplate = 'telephonenumberfield.njk'\n _fieldName = 'phoneNumberField'\n}\n\n/**\n * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/question.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,mBAAmB,SAASD,QAAQ,CAAC;EAChDE,iBAAiB,GAAG,0BAA0B;EAC9CC,UAAU,GAAG,kBAAkB;AACjC;;AAEA;AACA;AACA","ignoreList":[]}
@@ -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;AAC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AAI,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 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' | 'pageHeading' | 'guidanceText'\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":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Page } from '~/src/index.js'\n\nexport type PatchPageFields = Partial<\n Pick<Page, 'title' | 'path' | 'controller'>\n>\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type PageRepeat } from '~/src/index.js'\n\nexport type PatchPageFields = Partial<\n Pick<PageRepeat, 'title' | 'path' | 'controller' | 'repeat'>\n>\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n"],"mappings":"","ignoreList":[]}
@@ -12,7 +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-manager/index.js";
15
+ export * from "./form/form-editor/preview/index.js";
16
16
  export * from "./form/form-manager/types.js";
17
17
  export * from "./pages/index.js";
18
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/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;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":[]}
@@ -1,8 +1,9 @@
1
1
  import Joi from 'joi';
2
2
  import { type ComponentDef } from '../../components/types.js';
3
- import { type FormDefinition, type List, type Page } from '../../form/form-definition/types.js';
3
+ import { type FormDefinition, type List, type Page, type Repeat } from '../../form/form-definition/types.js';
4
4
  export declare const componentSchema: Joi.ObjectSchema<ComponentDef>;
5
5
  export declare const componentSchemaV2: Joi.ObjectSchema<ComponentDef>;
6
+ export declare const pageRepeatSchema: Joi.ObjectSchema<Repeat>;
6
7
  /**
7
8
  * `/status` is a special route for providing a user's application status.
8
9
  * It should not be configured via the designer.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAA8B,MAAM,KAAK,CAAA;AAIhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAU7D,OAAO,EAKL,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAMV,MAAM,qCAAqC,CAAA;AA0K5C,eAAO,MAAM,eAAe,gCAsGZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAQkD,CAAA;AAsGhF;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