@defra/forms-model 3.0.576 → 3.0.578

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 (48) hide show
  1. package/dist/module/conditions/migration.js +9 -1
  2. package/dist/module/conditions/migration.js.map +1 -1
  3. package/dist/module/form/form-editor/__stubs__/preview.js +53 -17
  4. package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
  5. package/dist/module/form/form-editor/index.js +3 -2
  6. package/dist/module/form/form-editor/index.js.map +1 -1
  7. package/dist/module/form/form-editor/macros/types.js.map +1 -1
  8. package/dist/module/form/form-editor/preview/declaration.js +82 -0
  9. package/dist/module/form/form-editor/preview/declaration.js.map +1 -0
  10. package/dist/module/form/form-editor/preview/helpers.js +43 -10
  11. package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
  12. package/dist/module/form/form-editor/preview/index.js +1 -0
  13. package/dist/module/form/form-editor/preview/index.js.map +1 -1
  14. package/dist/module/form/form-editor/preview/types.js.map +1 -1
  15. package/dist/module/form/form-editor/preview/uk-address.js +3 -3
  16. package/dist/module/form/form-editor/preview/uk-address.js.map +1 -1
  17. package/dist/module/form/form-editor/types.js.map +1 -1
  18. package/dist/types/conditions/migration.d.ts.map +1 -1
  19. package/dist/types/form/form-editor/__stubs__/preview.d.ts +38 -12
  20. package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
  21. package/dist/types/form/form-editor/index.d.ts +1 -0
  22. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  23. package/dist/types/form/form-editor/macros/types.d.ts +6 -0
  24. package/dist/types/form/form-editor/macros/types.d.ts.map +1 -1
  25. package/dist/types/form/form-editor/preview/declaration.d.ts +42 -0
  26. package/dist/types/form/form-editor/preview/declaration.d.ts.map +1 -0
  27. package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
  28. package/dist/types/form/form-editor/preview/index.d.ts +1 -0
  29. package/dist/types/form/form-editor/preview/types.d.ts +12 -1
  30. package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
  31. package/dist/types/form/form-editor/preview/uk-address.d.ts +13 -0
  32. package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -1
  33. package/dist/types/form/form-editor/types.d.ts +8 -1
  34. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/schemas/form-editor-input-page-schema.json +1 -0
  37. package/schemas/question-type-full-schema.json +1 -0
  38. package/schemas/question-type-schema.json +1 -0
  39. package/src/conditions/migration.ts +15 -1
  40. package/src/form/form-editor/__stubs__/preview.js +47 -17
  41. package/src/form/form-editor/index.ts +3 -0
  42. package/src/form/form-editor/macros/types.ts +7 -0
  43. package/src/form/form-editor/preview/declaration.js +88 -0
  44. package/src/form/form-editor/preview/helpers.js +47 -16
  45. package/src/form/form-editor/preview/index.js +1 -0
  46. package/src/form/form-editor/preview/types.ts +16 -1
  47. package/src/form/form-editor/preview/uk-address.js +3 -3
  48. package/src/form/form-editor/types.ts +8 -0
@@ -0,0 +1,82 @@
1
+ import { ComponentType } from "../../../components/enums.js";
2
+ import { HIGHLIGHT_CLASS } from "./constants.js";
3
+ import { PreviewComponent } from "./preview.js";
4
+ import { Question, QuestionComponentElements } from "./question.js";
5
+
6
+ /**
7
+ * @implements {QuestionElements}
8
+ */
9
+ export class DeclarationComponentPreviewElements extends QuestionComponentElements {
10
+ /**
11
+ * @param {DeclarationFieldComponent} component
12
+ */
13
+ constructor(component) {
14
+ super(component);
15
+ this._declarationText = component.content;
16
+ }
17
+
18
+ /**
19
+ * @protected
20
+ * @returns {DeclarationSettings}
21
+ */
22
+ _getValues() {
23
+ return {
24
+ ...super._getValues(),
25
+ declarationText: this._declarationText
26
+ };
27
+ }
28
+ }
29
+ export class DeclarationQuestion extends Question {
30
+ /**
31
+ * @type {ComponentType}
32
+ */
33
+ componentType = ComponentType.DeclarationField;
34
+ /**
35
+ * @type {string}
36
+ * @protected
37
+ */
38
+ _questionTemplate = PreviewComponent.PATH + 'declarationfield.njk';
39
+ _fieldName = 'DeclarationField';
40
+ _declarationText = '';
41
+
42
+ /**
43
+ * @param {DeclarationElements} htmlElements
44
+ * @param {QuestionRenderer} questionRenderer
45
+ */
46
+ constructor(htmlElements, questionRenderer) {
47
+ super(htmlElements, questionRenderer);
48
+ this._declarationText = htmlElements.values.declarationText;
49
+ }
50
+ get declarationText() {
51
+ return this._declarationText;
52
+ }
53
+
54
+ /**
55
+ * @param {string} val
56
+ */
57
+ set declarationText(val) {
58
+ this._declarationText = val;
59
+ this.render();
60
+ }
61
+
62
+ /**
63
+ * @protected
64
+ * @returns {DeclarationModel}
65
+ */
66
+ _renderInput() {
67
+ return {
68
+ ...super._renderInput(),
69
+ declaration: {
70
+ text: this._declarationText ? this._declarationText : 'Declaration text',
71
+ classes: this._highlight === 'declarationText' ? HIGHLIGHT_CLASS : ''
72
+ }
73
+ };
74
+ }
75
+ }
76
+
77
+ /**
78
+ * @import { DeclarationSettings, DeclarationElements, QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
79
+ * @import { DeclarationModel } from '~/src/form/form-editor/macros/types.js'
80
+ * @import { DeclarationFieldComponent } from '~/src/components/types.js'
81
+ */
82
+ //# sourceMappingURL=declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.js","names":["ComponentType","HIGHLIGHT_CLASS","PreviewComponent","Question","QuestionComponentElements","DeclarationComponentPreviewElements","constructor","component","_declarationText","content","_getValues","declarationText","DeclarationQuestion","componentType","DeclarationField","_questionTemplate","PATH","_fieldName","htmlElements","questionRenderer","values","val","render","_renderInput","declaration","text","classes","_highlight"],"sources":["../../../../../src/form/form-editor/preview/declaration.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\nimport {\n Question,\n QuestionComponentElements\n} from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class DeclarationComponentPreviewElements extends QuestionComponentElements {\n /**\n * @param {DeclarationFieldComponent} component\n */\n constructor(component) {\n super(component)\n this._declarationText = component.content\n }\n\n /**\n * @protected\n * @returns {DeclarationSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n declarationText: this._declarationText\n }\n }\n}\n\nexport class DeclarationQuestion extends Question {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.DeclarationField\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'declarationfield.njk'\n _fieldName = 'DeclarationField'\n _declarationText = ''\n\n /**\n * @param {DeclarationElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n this._declarationText = htmlElements.values.declarationText\n }\n\n get declarationText() {\n return this._declarationText\n }\n\n /**\n * @param {string} val\n */\n set declarationText(val) {\n this._declarationText = val\n this.render()\n }\n\n /**\n * @protected\n * @returns {DeclarationModel}\n */\n _renderInput() {\n return {\n ...super._renderInput(),\n declaration: {\n text: this._declarationText\n ? this._declarationText\n : 'Declaration text',\n classes: this._highlight === 'declarationText' ? HIGHLIGHT_CLASS : ''\n }\n }\n }\n}\n\n/**\n * @import { DeclarationSettings, DeclarationElements, QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { DeclarationModel } from '~/src/form/form-editor/macros/types.js'\n * @import { DeclarationFieldComponent } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SACEC,QAAQ,EACRC,yBAAyB;;AAG3B;AACA;AACA;AACA,OAAO,MAAMC,mCAAmC,SAASD,yBAAyB,CAAC;EACjF;AACF;AACA;EACEE,WAAWA,CAACC,SAAS,EAAE;IACrB,KAAK,CAACA,SAAS,CAAC;IAChB,IAAI,CAACC,gBAAgB,GAAGD,SAAS,CAACE,OAAO;EAC3C;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,OAAO;MACL,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBC,eAAe,EAAE,IAAI,CAACH;IACxB,CAAC;EACH;AACF;AAEA,OAAO,MAAMI,mBAAmB,SAAST,QAAQ,CAAC;EAChD;AACF;AACA;EACEU,aAAa,GAAGb,aAAa,CAACc,gBAAgB;EAC9C;AACF;AACA;AACA;EACEC,iBAAiB,GAAGb,gBAAgB,CAACc,IAAI,GAAG,sBAAsB;EAClEC,UAAU,GAAG,kBAAkB;EAC/BT,gBAAgB,GAAG,EAAE;;EAErB;AACF;AACA;AACA;EACEF,WAAWA,CAACY,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,KAAK,CAACD,YAAY,EAAEC,gBAAgB,CAAC;IACrC,IAAI,CAACX,gBAAgB,GAAGU,YAAY,CAACE,MAAM,CAACT,eAAe;EAC7D;EAEA,IAAIA,eAAeA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACH,gBAAgB;EAC9B;;EAEA;AACF;AACA;EACE,IAAIG,eAAeA,CAACU,GAAG,EAAE;IACvB,IAAI,CAACb,gBAAgB,GAAGa,GAAG;IAC3B,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;AACA;EACEC,YAAYA,CAAA,EAAG;IACb,OAAO;MACL,GAAG,KAAK,CAACA,YAAY,CAAC,CAAC;MACvBC,WAAW,EAAE;QACXC,IAAI,EAAE,IAAI,CAACjB,gBAAgB,GACvB,IAAI,CAACA,gBAAgB,GACrB,kBAAkB;QACtBkB,OAAO,EAAE,IAAI,CAACC,UAAU,KAAK,iBAAiB,GAAG1B,eAAe,GAAG;MACrE;IACF,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -5,6 +5,7 @@ import { CheckboxQuestion } from "./checkbox.js";
5
5
  import { ComponentElements } from "./component-elements.js";
6
6
  import { ContentElements } from "./content.js";
7
7
  import { DateInputQuestion } from "./date-input.js";
8
+ import { DeclarationComponentPreviewElements, DeclarationQuestion } from "./declaration.js";
8
9
  import { EmailAddressQuestion } from "./email-address.js";
9
10
  import { ListComponentElements, ListQuestion, SelectComponentElements } from "./list.js";
10
11
  import { LongAnswerQuestion } from "./long-answer.js";
@@ -42,7 +43,7 @@ const InputFieldComponentDictionary = {
42
43
  [ComponentType.CheckboxesField]: CheckboxQuestion,
43
44
  [ComponentType.SelectField]: SelectQuestion,
44
45
  [ComponentType.YesNoField]: YesNoQuestion,
45
- [ComponentType.DeclarationField]: YesNoQuestion,
46
+ [ComponentType.DeclarationField]: DeclarationQuestion,
46
47
  [ComponentType.FileUploadField]: SupportingEvidenceQuestion,
47
48
  [ComponentType.EastingNorthingField]: ShortAnswerQuestion,
48
49
  [ComponentType.OsGridRefField]: ShortAnswerQuestion,
@@ -50,6 +51,40 @@ const InputFieldComponentDictionary = {
50
51
  [ComponentType.LatLongField]: ShortAnswerQuestion
51
52
  };
52
53
 
54
+ /**
55
+ * @type {Partial<Record<ComponentType, (component: ComponentDef, definition: FormDefinition ) => QuestionElements>>}
56
+ */
57
+ const ComponentToPreviewQuestion = {
58
+ [ComponentType.AutocompleteField]: (component, definition) => {
59
+ const componentCoerced = /** @type {AutocompleteFieldComponent} */
60
+ component;
61
+ const list = findDefinitionListFromComponent(componentCoerced, definition);
62
+ return new SelectComponentElements(componentCoerced, list);
63
+ },
64
+ [ComponentType.SelectField]: (component, definition) => {
65
+ const componentCoerced = /** @type {SelectFieldComponent} */component;
66
+ const list = findDefinitionListFromComponent(componentCoerced, definition);
67
+ return new SelectComponentElements(componentCoerced, list);
68
+ },
69
+ [ComponentType.UkAddressField]: (component, _definition) => {
70
+ const componentCoerced = /** @type {UkAddressFieldComponent} */component;
71
+ return new UkAddressComponentPreviewElements(componentCoerced);
72
+ },
73
+ [ComponentType.NumberField]: (component, _definition) => {
74
+ const componentCoerced = /** @type {NumberFieldComponent} */component;
75
+ return new NumberComponentPreviewElements(componentCoerced);
76
+ },
77
+ [ComponentType.DeclarationField]: (component, _definition) => {
78
+ const componentCoerced = /** @type {DeclarationFieldComponent} */
79
+ component;
80
+ return new DeclarationComponentPreviewElements(componentCoerced);
81
+ },
82
+ [ComponentType.YesNoField]: (component, _definition) => {
83
+ const componentCoerced = /** @type {YesNoFieldComponent} */component;
84
+ return new QuestionComponentElements(componentCoerced);
85
+ }
86
+ };
87
+
53
88
  /**
54
89
  * @param {QuestionRenderer} questionRenderer
55
90
  * @param {FormDefinition} definition
@@ -61,17 +96,15 @@ export function mapComponentToPreviewQuestion(questionRenderer, definition) {
61
96
  * @type {QuestionElements}
62
97
  */
63
98
  let questionElements;
64
- if (component.type === ComponentType.AutocompleteField || component.type === ComponentType.SelectField) {
65
- const list = findDefinitionListFromComponent(component, definition);
66
- questionElements = new SelectComponentElements(component, list);
67
- } else if (component.type === ComponentType.UkAddressField) {
68
- questionElements = new UkAddressComponentPreviewElements(component);
69
- } else if (component.type === ComponentType.NumberField) {
70
- questionElements = new NumberComponentPreviewElements(component);
99
+
100
+ // Look for one-to-one mapping first, then fallback if not found
101
+ const getQuestionElementsFunc = ComponentToPreviewQuestion[component.type];
102
+ if (getQuestionElementsFunc) {
103
+ questionElements = getQuestionElementsFunc(component, definition);
71
104
  } else if (hasSelectionFields(component) && hasListField(component)) {
72
105
  const list = findDefinitionListFromComponent(component, definition);
73
106
  questionElements = new ListComponentElements(component, list);
74
- } else if (hasInputField(component) || component.type === ComponentType.YesNoField) {
107
+ } else if (hasInputField(component)) {
75
108
  questionElements = new QuestionComponentElements(component);
76
109
  } else if (hasContentField(component)) {
77
110
  questionElements = new ContentElements(component);
@@ -90,6 +123,6 @@ export function mapComponentToPreviewQuestion(questionRenderer, definition) {
90
123
  * @import { Question } from '~/src/form/form-editor/preview/question.js'
91
124
  * @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'
92
125
  * @import { FormDefinition } from '~/src/form/form-definition/types.js'
93
- * @import { ComponentDef } from '~/src/components/types.js'
126
+ * @import { AutocompleteFieldComponent, ComponentDef, DeclarationFieldComponent, NumberFieldComponent, SelectFieldComponent, UkAddressFieldComponent, YesNoFieldComponent } from '~/src/components/types.js'
94
127
  */
95
128
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["ComponentType","hasContentField","hasInputField","hasListField","hasSelectionFields","AutocompleteListQuestion","CheckboxQuestion","ComponentElements","ContentElements","DateInputQuestion","EmailAddressQuestion","ListComponentElements","ListQuestion","SelectComponentElements","LongAnswerQuestion","Markdown","MonthYearQuestion","NumberComponentPreviewElements","NumberOnlyQuestion","PhoneNumberQuestion","QuestionComponentElements","RadioQuestion","SelectQuestion","ShortAnswerQuestion","SupportingEvidenceQuestion","UkAddressComponentPreviewElements","UkAddressQuestion","YesNoQuestion","findDefinitionListFromComponent","InputFieldComponentDictionary","TextField","Details","InsetText","Html","List","EmailAddressField","NumberField","MultilineTextField","TelephoneNumberField","MonthYearField","DatePartsField","UkAddressField","AutocompleteField","RadiosField","CheckboxesField","SelectField","YesNoField","DeclarationField","FileUploadField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","mapComponentToPreviewQuestion","questionRenderer","definition","component","questionElements","type","list","QuestionConstructor","previewComponent","id"],"sources":["../../../../../src/form/form-editor/preview/helpers.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n hasContentField,\n hasInputField,\n hasListField,\n hasSelectionFields\n} from '~/src/components/helpers.js'\nimport { AutocompleteListQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { CheckboxQuestion } from '~/src/form/form-editor/preview/checkbox.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { ContentElements } from '~/src/form/form-editor/preview/content.js'\nimport { DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport {\n ListComponentElements,\n ListQuestion,\n SelectComponentElements\n} from '~/src/form/form-editor/preview/list.js'\nimport { LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { MonthYearQuestion } from '~/src/form/form-editor/preview/month-year.js'\nimport {\n NumberComponentPreviewElements,\n NumberOnlyQuestion\n} from '~/src/form/form-editor/preview/number-only.js'\nimport { PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { QuestionComponentElements } from '~/src/form/form-editor/preview/question.js'\nimport { RadioQuestion } from '~/src/form/form-editor/preview/radio.js'\nimport { SelectQuestion } from '~/src/form/form-editor/preview/select.js'\nimport { ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { SupportingEvidenceQuestion } from '~/src/form/form-editor/preview/supporting-evidence.js'\nimport {\n UkAddressComponentPreviewElements,\n UkAddressQuestion\n} from '~/src/form/form-editor/preview/uk-address.js'\nimport { YesNoQuestion } from '~/src/form/form-editor/preview/yes-no.js'\nimport { findDefinitionListFromComponent } from '~/src/form/utils/list.js'\n/**\n * @type {Record<ComponentType, typeof PreviewComponent>}\n */\nconst InputFieldComponentDictionary = {\n [ComponentType.TextField]: ShortAnswerQuestion,\n [ComponentType.Details]: ShortAnswerQuestion,\n [ComponentType.InsetText]: ShortAnswerQuestion,\n [ComponentType.Html]: ShortAnswerQuestion,\n [ComponentType.Markdown]: Markdown,\n [ComponentType.List]: ListQuestion,\n [ComponentType.EmailAddressField]: EmailAddressQuestion,\n [ComponentType.NumberField]: NumberOnlyQuestion,\n [ComponentType.MultilineTextField]: LongAnswerQuestion,\n [ComponentType.TelephoneNumberField]: PhoneNumberQuestion,\n [ComponentType.MonthYearField]: MonthYearQuestion,\n [ComponentType.DatePartsField]: DateInputQuestion,\n [ComponentType.UkAddressField]: UkAddressQuestion,\n [ComponentType.AutocompleteField]: AutocompleteListQuestion,\n [ComponentType.RadiosField]: RadioQuestion,\n [ComponentType.CheckboxesField]: CheckboxQuestion,\n [ComponentType.SelectField]: SelectQuestion,\n [ComponentType.YesNoField]: YesNoQuestion,\n [ComponentType.DeclarationField]: YesNoQuestion,\n [ComponentType.FileUploadField]: SupportingEvidenceQuestion,\n [ComponentType.EastingNorthingField]: ShortAnswerQuestion,\n [ComponentType.OsGridRefField]: ShortAnswerQuestion,\n [ComponentType.NationalGridFieldNumberField]: ShortAnswerQuestion,\n [ComponentType.LatLongField]: ShortAnswerQuestion\n}\n\n/**\n * @param {QuestionRenderer} questionRenderer\n * @param {FormDefinition} definition\n * @returns {(component: ComponentDef) => Question}\n */\nexport function mapComponentToPreviewQuestion(questionRenderer, definition) {\n return /** @type {(component: ComponentDef) => Question} */ (\n (component) => {\n /**\n * @type {QuestionElements}\n */\n let questionElements\n\n if (\n component.type === ComponentType.AutocompleteField ||\n component.type === ComponentType.SelectField\n ) {\n const list = findDefinitionListFromComponent(component, definition)\n questionElements = new SelectComponentElements(component, list)\n } else if (component.type === ComponentType.UkAddressField) {\n questionElements = new UkAddressComponentPreviewElements(component)\n } else if (component.type === ComponentType.NumberField) {\n questionElements = new NumberComponentPreviewElements(component)\n } else if (hasSelectionFields(component) && hasListField(component)) {\n const list = findDefinitionListFromComponent(component, definition)\n questionElements = new ListComponentElements(component, list)\n } else if (\n hasInputField(component) ||\n component.type === ComponentType.YesNoField\n ) {\n questionElements = new QuestionComponentElements(component)\n } else if (hasContentField(component)) {\n questionElements = new ContentElements(component)\n } else {\n questionElements = new ComponentElements(component)\n }\n\n const QuestionConstructor = InputFieldComponentDictionary[component.type]\n\n const previewComponent = new QuestionConstructor(\n questionElements,\n questionRenderer\n )\n previewComponent.id = component.id\n return previewComponent\n }\n )\n}\n\n/**\n * @import { QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { Question } from '~/src/form/form-editor/preview/question.js'\n * @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n * @import { FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { ComponentDef } from '~/src/components/types.js'\n */\n"],"m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8B,CAACuC,SAAS,CAAC;IAClE,CAAC,MAAM,IAAIpD,kBAAkB,CAACoD,SAAS,CAAC,IAAIrD,YAAY,CAACqD,SAAS,CAAC,EAAE;MACnE,MAAMG,IAAI,GAAG/B,+BAA+B,CAAC4B,SAAS,EAAED,UAAU,CAAC;MACnEE,gBAAgB,GAAG,IAAI9C,qBAAqB,CAAC6C,SAAS,EAAEG,IAAI,CAAC;IAC/D,CAAC,MAAM,IACLzD,aAAa,CAACsD,SAAS,CAAC,IACxBA,SAAS,CAACE,IAAI,KAAK1D,aAAa,CAAC8C,UAAU,EAC3C;MACAW,gBAAgB,GAAG,IAAIrC,yBAAyB,CAACoC,SAAS,CAAC;IAC7D,CAAC,MAAM,IAAIvD,eAAe,CAACuD,SAAS,CAAC,EAAE;MACrCC,gBAAgB,GAAG,IAAIjD,eAAe,CAACgD,SAAS,CAAC;IACnD,CAAC,MAAM;MACLC,gBAAgB,GAAG,IAAIlD,iBAAiB,CAACiD,SAAS,CAAC;IACrD;IAEA,MAAMI,mBAAmB,GAAG/B,6BAA6B,CAAC2B,SAAS,CAACE,IAAI,CAAC;IAEzE,MAAMG,gBAAgB,GAAG,IAAID,mBAAmB,CAC9CH,gBAAgB,EAChBH,gBACF,CAAC;IACDO,gBAAgB,CAACC,EAAE,GAAGN,SAAS,CAACM,EAAE;IAClC,OAAOD,gBAAgB;EACzB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"helpers.js","names":["ComponentType","hasContentField","hasInputField","hasListField","hasSelectionFields","AutocompleteListQuestion","CheckboxQuestion","ComponentElements","ContentElements","DateInputQuestion","DeclarationComponentPreviewElements","DeclarationQuestion","EmailAddressQuestion","ListComponentElements","ListQuestion","SelectComponentElements","LongAnswerQuestion","Markdown","MonthYearQuestion","NumberComponentPreviewElements","NumberOnlyQuestion","PhoneNumberQuestion","QuestionComponentElements","RadioQuestion","SelectQuestion","ShortAnswerQuestion","SupportingEvidenceQuestion","UkAddressComponentPreviewElements","UkAddressQuestion","YesNoQuestion","findDefinitionListFromComponent","InputFieldComponentDictionary","TextField","Details","InsetText","Html","List","EmailAddressField","NumberField","MultilineTextField","TelephoneNumberField","MonthYearField","DatePartsField","UkAddressField","AutocompleteField","RadiosField","CheckboxesField","SelectField","YesNoField","DeclarationField","FileUploadField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","ComponentToPreviewQuestion","component","definition","componentCoerced","list","_definition","mapComponentToPreviewQuestion","questionRenderer","questionElements","getQuestionElementsFunc","type","QuestionConstructor","previewComponent","id"],"sources":["../../../../../src/form/form-editor/preview/helpers.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport {\n hasContentField,\n hasInputField,\n hasListField,\n hasSelectionFields\n} from '~/src/components/helpers.js'\nimport { AutocompleteListQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { CheckboxQuestion } from '~/src/form/form-editor/preview/checkbox.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { ContentElements } from '~/src/form/form-editor/preview/content.js'\nimport { DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport {\n DeclarationComponentPreviewElements,\n DeclarationQuestion\n} from '~/src/form/form-editor/preview/declaration.js'\nimport { EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport {\n ListComponentElements,\n ListQuestion,\n SelectComponentElements\n} from '~/src/form/form-editor/preview/list.js'\nimport { LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { Markdown } from '~/src/form/form-editor/preview/markdown.js'\nimport { MonthYearQuestion } from '~/src/form/form-editor/preview/month-year.js'\nimport {\n NumberComponentPreviewElements,\n NumberOnlyQuestion\n} from '~/src/form/form-editor/preview/number-only.js'\nimport { PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { QuestionComponentElements } from '~/src/form/form-editor/preview/question.js'\nimport { RadioQuestion } from '~/src/form/form-editor/preview/radio.js'\nimport { SelectQuestion } from '~/src/form/form-editor/preview/select.js'\nimport { ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { SupportingEvidenceQuestion } from '~/src/form/form-editor/preview/supporting-evidence.js'\nimport {\n UkAddressComponentPreviewElements,\n UkAddressQuestion\n} from '~/src/form/form-editor/preview/uk-address.js'\nimport { YesNoQuestion } from '~/src/form/form-editor/preview/yes-no.js'\nimport { findDefinitionListFromComponent } from '~/src/form/utils/list.js'\n/**\n * @type {Record<ComponentType, typeof PreviewComponent>}\n */\nconst InputFieldComponentDictionary = {\n [ComponentType.TextField]: ShortAnswerQuestion,\n [ComponentType.Details]: ShortAnswerQuestion,\n [ComponentType.InsetText]: ShortAnswerQuestion,\n [ComponentType.Html]: ShortAnswerQuestion,\n [ComponentType.Markdown]: Markdown,\n [ComponentType.List]: ListQuestion,\n [ComponentType.EmailAddressField]: EmailAddressQuestion,\n [ComponentType.NumberField]: NumberOnlyQuestion,\n [ComponentType.MultilineTextField]: LongAnswerQuestion,\n [ComponentType.TelephoneNumberField]: PhoneNumberQuestion,\n [ComponentType.MonthYearField]: MonthYearQuestion,\n [ComponentType.DatePartsField]: DateInputQuestion,\n [ComponentType.UkAddressField]: UkAddressQuestion,\n [ComponentType.AutocompleteField]: AutocompleteListQuestion,\n [ComponentType.RadiosField]: RadioQuestion,\n [ComponentType.CheckboxesField]: CheckboxQuestion,\n [ComponentType.SelectField]: SelectQuestion,\n [ComponentType.YesNoField]: YesNoQuestion,\n [ComponentType.DeclarationField]: DeclarationQuestion,\n [ComponentType.FileUploadField]: SupportingEvidenceQuestion,\n [ComponentType.EastingNorthingField]: ShortAnswerQuestion,\n [ComponentType.OsGridRefField]: ShortAnswerQuestion,\n [ComponentType.NationalGridFieldNumberField]: ShortAnswerQuestion,\n [ComponentType.LatLongField]: ShortAnswerQuestion\n}\n\n/**\n * @type {Partial<Record<ComponentType, (component: ComponentDef, definition: FormDefinition ) => QuestionElements>>}\n */\nconst ComponentToPreviewQuestion = {\n [ComponentType.AutocompleteField]: (component, definition) => {\n const componentCoerced = /** @type {AutocompleteFieldComponent} */ (\n component\n )\n const list = findDefinitionListFromComponent(componentCoerced, definition)\n return new SelectComponentElements(componentCoerced, list)\n },\n [ComponentType.SelectField]: (component, definition) => {\n const componentCoerced = /** @type {SelectFieldComponent} */ (component)\n const list = findDefinitionListFromComponent(componentCoerced, definition)\n return new SelectComponentElements(componentCoerced, list)\n },\n [ComponentType.UkAddressField]: (component, _definition) => {\n const componentCoerced = /** @type {UkAddressFieldComponent} */ (component)\n return new UkAddressComponentPreviewElements(componentCoerced)\n },\n [ComponentType.NumberField]: (component, _definition) => {\n const componentCoerced = /** @type {NumberFieldComponent} */ (component)\n return new NumberComponentPreviewElements(componentCoerced)\n },\n [ComponentType.DeclarationField]: (component, _definition) => {\n const componentCoerced = /** @type {DeclarationFieldComponent} */ (\n component\n )\n return new DeclarationComponentPreviewElements(componentCoerced)\n },\n [ComponentType.YesNoField]: (component, _definition) => {\n const componentCoerced = /** @type {YesNoFieldComponent} */ (component)\n return new QuestionComponentElements(componentCoerced)\n }\n}\n\n/**\n * @param {QuestionRenderer} questionRenderer\n * @param {FormDefinition} definition\n * @returns {(component: ComponentDef) => Question}\n */\nexport function mapComponentToPreviewQuestion(questionRenderer, definition) {\n return /** @type {(component: ComponentDef) => Question} */ (\n (component) => {\n /**\n * @type {QuestionElements}\n */\n let questionElements\n\n // Look for one-to-one mapping first, then fallback if not found\n const getQuestionElementsFunc = ComponentToPreviewQuestion[component.type]\n if (getQuestionElementsFunc) {\n questionElements = getQuestionElementsFunc(component, definition)\n } else if (hasSelectionFields(component) && hasListField(component)) {\n const list = findDefinitionListFromComponent(component, definition)\n questionElements = new ListComponentElements(component, list)\n } else if (hasInputField(component)) {\n questionElements = new QuestionComponentElements(component)\n } else if (hasContentField(component)) {\n questionElements = new ContentElements(component)\n } else {\n questionElements = new ComponentElements(component)\n }\n\n const QuestionConstructor = InputFieldComponentDictionary[component.type]\n\n const previewComponent = new QuestionConstructor(\n questionElements,\n questionRenderer\n )\n previewComponent.id = component.id\n return previewComponent\n }\n )\n}\n\n/**\n * @import { QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { Question } from '~/src/form/form-editor/preview/question.js'\n * @import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n * @import { FormDefinition } from '~/src/form/form-definition/types.js'\n * @import { AutocompleteFieldComponent, ComponentDef, DeclarationFieldComponent, NumberFieldComponent, SelectFieldComponent, UkAddressFieldComponent, YesNoFieldComponent } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,kBAAkB;AAEpB,SAASC,wBAAwB;AACjC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SACEC,mCAAmC,EACnCC,mBAAmB;AAErB,SAASC,oBAAoB;AAC7B,SACEC,qBAAqB,EACrBC,YAAY,EACZC,uBAAuB;AAEzB,SAASC,kBAAkB;AAC3B,SAASC,QAAQ;AACjB,SAASC,iBAAiB;AAC1B,SACEC,8BAA8B,EAC9BC,kBAAkB;AAEpB,SAASC,mBAAmB;AAC5B,SAASC,yBAAyB;AAClC,SAASC,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SACEC,iCAAiC,EACjCC,iBAAiB;AAEnB,SAASC,aAAa;AACtB,SAASC,+BAA+B;AACxC;AACA;AACA;AACA,MAAMC,6BAA6B,GAAG;EACpC,CAAC/B,aAAa,CAACgC,SAAS,GAAGP,mBAAmB;EAC9C,CAACzB,aAAa,CAACiC,OAAO,GAAGR,mBAAmB;EAC5C,CAACzB,aAAa,CAACkC,SAAS,GAAGT,mBAAmB;EAC9C,CAACzB,aAAa,CAACmC,IAAI,GAAGV,mBAAmB;EACzC,CAACzB,aAAa,CAAC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B,CAACC,SAAS,CAACS,IAAI,CAAC;IAC1E,IAAID,uBAAuB,EAAE;MAC3BD,gBAAgB,GAAGC,uBAAuB,CAACR,SAAS,EAAEC,UAAU,CAAC;IACnE,CAAC,MAAM,IAAIrD,kBAAkB,CAACoD,SAAS,CAAC,IAAIrD,YAAY,CAACqD,SAAS,CAAC,EAAE;MACnE,MAAMG,IAAI,GAAG7B,+BAA+B,CAAC0B,SAAS,EAAEC,UAAU,CAAC;MACnEM,gBAAgB,GAAG,IAAIlD,qBAAqB,CAAC2C,SAAS,EAAEG,IAAI,CAAC;IAC/D,CAAC,MAAM,IAAIzD,aAAa,CAACsD,SAAS,CAAC,EAAE;MACnCO,gBAAgB,GAAG,IAAIzC,yBAAyB,CAACkC,SAAS,CAAC;IAC7D,CAAC,MAAM,IAAIvD,eAAe,CAACuD,SAAS,CAAC,EAAE;MACrCO,gBAAgB,GAAG,IAAIvD,eAAe,CAACgD,SAAS,CAAC;IACnD,CAAC,MAAM;MACLO,gBAAgB,GAAG,IAAIxD,iBAAiB,CAACiD,SAAS,CAAC;IACrD;IAEA,MAAMU,mBAAmB,GAAGnC,6BAA6B,CAACyB,SAAS,CAACS,IAAI,CAAC;IAEzE,MAAME,gBAAgB,GAAG,IAAID,mBAAmB,CAC9CH,gBAAgB,EAChBD,gBACF,CAAC;IACDK,gBAAgB,CAACC,EAAE,GAAGZ,SAAS,CAACY,EAAE;IAClC,OAAOD,gBAAgB;EACzB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -2,6 +2,7 @@ export * from "./autocomplete.js";
2
2
  export * from "./checkbox.js";
3
3
  export * from "./checkbox-sortable.js";
4
4
  export * from "./date-input.js";
5
+ export * from "./declaration.js";
5
6
  export * from "./email-address.js";
6
7
  export * from "./list.js";
7
8
  export * from "./list-sortable.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/autocomplete.js'\nexport * from '~/src/form/form-editor/preview/checkbox.js'\nexport * from '~/src/form/form-editor/preview/checkbox-sortable.js'\nexport * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/markdown.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/select.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/supporting-evidence.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\nexport * from '~/src/form/form-editor/preview/yes-no.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/guidance-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/summary-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/reorder-questions-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/autocomplete.js'\nexport * from '~/src/form/form-editor/preview/checkbox.js'\nexport * from '~/src/form/form-editor/preview/checkbox-sortable.js'\nexport * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/declaration.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/markdown.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/select.js'\nexport * from '~/src/form/form-editor/preview/select-sortable.js'\nexport * from '~/src/form/form-editor/preview/supporting-evidence.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\nexport * from '~/src/form/form-editor/preview/yes-no.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/guidance-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/summary-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/reorder-questions-page-controller.js'\nexport * from '~/src/form/form-editor/preview/controller/page-controller-base.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type PagePreviewPanelMacro,\n type QuestionBaseModel\n} from '~/src/form/form-editor/macros/types.js'\nimport { type AutocompleteQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type SelectSortableQuestion } from '~/src/form/form-editor/preview/select-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { type ListElement } from '~/src/form/form-editor/types.js'\nexport { type QuestionBaseModel } from '~/src/form/form-editor/macros/types.js'\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n userClasses: string\n items: ListElement[]\n content: string\n attributes?: Record<string, string>\n usePostcodeLookup?: boolean\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n isPageHeading?: boolean\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface DomElementsBase {\n readonly values?: BaseSettings\n autocompleteOptions?: string\n setPreviewHTML(value: string): void\n setPreviewDOM(element: HTMLElement): void\n}\n\nexport interface QuestionElements extends DomElementsBase {\n readonly values: BaseSettings\n}\n\nexport interface AutocompleteElements extends QuestionElements {\n autocompleteOptions: string\n}\n\nexport interface NumberSettings extends BaseSettings {\n prefix: string\n suffix: string\n}\n\nexport interface NumberElements extends DomElementsBase {\n readonly values: NumberSettings\n}\n\nexport interface RenderBase {\n render(questionTemplate: string, renderContext: RenderContext): void\n}\n\nexport interface QuestionRenderContext {\n model: QuestionBaseModel\n}\n\nexport interface PageRenderContext {\n params: PagePreviewPanelMacro\n}\n\nexport type RenderContext = QuestionRenderContext | PageRenderContext\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface PageRenderer {\n render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void\n}\n\nexport type Renderer = QuestionRenderer | PageRenderer\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport interface PagePreviewBaseElements {\n heading: string\n guidance: string\n}\n\nexport interface PageOverviewElements extends PagePreviewBaseElements {\n addHeading: boolean\n repeatQuestion: string | undefined\n hasRepeater: boolean\n}\n\nexport interface SummaryPageElements extends PagePreviewBaseElements {\n declaration: boolean\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | SelectSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n | AutocompleteQuestion\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\n type PagePreviewPanelMacro,\n type QuestionBaseModel\n} from '~/src/form/form-editor/macros/types.js'\nimport { type AutocompleteQuestion } from '~/src/form/form-editor/preview/autocomplete.js'\nimport { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type SelectSortableQuestion } from '~/src/form/form-editor/preview/select-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport { type ListElement } from '~/src/form/form-editor/types.js'\nexport { type QuestionBaseModel } from '~/src/form/form-editor/macros/types.js'\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n userClasses: string\n items: ListElement[]\n content: string\n attributes?: Record<string, string>\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n isPageHeading?: boolean\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface DomElementsBase {\n readonly values?: BaseSettings\n autocompleteOptions?: string\n setPreviewHTML(value: string): void\n setPreviewDOM(element: HTMLElement): void\n}\n\nexport interface QuestionElements extends DomElementsBase {\n readonly values: BaseSettings\n}\n\nexport interface AutocompleteElements extends QuestionElements {\n autocompleteOptions: string\n}\n\nexport interface NumberSettings extends BaseSettings {\n prefix: string\n suffix: string\n}\n\nexport interface DeclarationSettings extends BaseSettings {\n declarationText: string\n}\n\nexport interface DeclarationElements extends DomElementsBase {\n readonly values: DeclarationSettings\n}\n\nexport interface UkAddressSettings extends BaseSettings {\n usePostcodeLookup?: boolean\n}\n\nexport interface UkAddressElements extends DomElementsBase {\n readonly values: UkAddressSettings\n}\n\nexport interface NumberElements extends DomElementsBase {\n readonly values: NumberSettings\n}\n\nexport interface RenderBase {\n render(questionTemplate: string, renderContext: RenderContext): void\n}\n\nexport interface QuestionRenderContext {\n model: QuestionBaseModel\n}\n\nexport interface PageRenderContext {\n params: PagePreviewPanelMacro\n}\n\nexport type RenderContext = QuestionRenderContext | PageRenderContext\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface PageRenderer {\n render(pageTemplate: string, pagePreview: PagePreviewPanelMacro): void\n}\n\nexport type Renderer = QuestionRenderer | PageRenderer\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport interface PagePreviewBaseElements {\n heading: string\n guidance: string\n}\n\nexport interface PageOverviewElements extends PagePreviewBaseElements {\n addHeading: boolean\n repeatQuestion: string | undefined\n hasRepeater: boolean\n}\n\nexport interface SummaryPageElements extends PagePreviewBaseElements {\n declaration: boolean\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | SelectSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n | AutocompleteQuestion\n"],"mappings":"","ignoreList":[]}
@@ -17,7 +17,7 @@ export class UkAddressComponentPreviewElements extends QuestionComponentElements
17
17
 
18
18
  /**
19
19
  * @protected
20
- * @returns {BaseSettings}
20
+ * @returns {UkAddressSettings}
21
21
  */
22
22
  _getValues() {
23
23
  return {
@@ -36,7 +36,7 @@ export class UkAddressQuestion extends FieldsetQuestion {
36
36
  _usePostcodeLookup = false;
37
37
 
38
38
  /**
39
- * @param {QuestionElements} htmlElements
39
+ * @param {UkAddressElements} htmlElements
40
40
  * @param {QuestionRenderer} questionRenderer
41
41
  */
42
42
  constructor(htmlElements, questionRenderer) {
@@ -67,7 +67,7 @@ export class UkAddressQuestion extends FieldsetQuestion {
67
67
  }
68
68
 
69
69
  /**
70
- * @import { BaseSettings, QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
70
+ * @import { QuestionElements, QuestionRenderer, UkAddressElements, UkAddressSettings } from '~/src/form/form-editor/preview/types.js'
71
71
  * @import { UkAddressFieldComponent } from '~/src/components/types.js'
72
72
  */
73
73
  //# sourceMappingURL=uk-address.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uk-address.js","names":["ComponentType","FieldsetQuestion","PreviewComponent","QuestionComponentElements","UkAddressComponentPreviewElements","constructor","component","_usePostcodeLookup","options","usePostcodeLookup","_getValues","UkAddressQuestion","componentType","UkAddressField","_questionTemplate","PATH","_fieldName","htmlElements","questionRenderer","values","val","render","_renderInput"],"sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { FieldsetQuestion } from '~/src/form/form-editor/preview/fieldset-question.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\nimport { QuestionComponentElements } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class UkAddressComponentPreviewElements extends QuestionComponentElements {\n /**\n * @param {UkAddressFieldComponent} component\n */\n constructor(component) {\n super(component)\n this._usePostcodeLookup = component.options.usePostcodeLookup\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n usePostcodeLookup: this._usePostcodeLookup\n }\n }\n}\n\nexport class UkAddressQuestion extends FieldsetQuestion {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.UkAddressField\n _questionTemplate = PreviewComponent.PATH + 'ukaddressfield.njk'\n _fieldName = 'addressField'\n _usePostcodeLookup = false\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n this._usePostcodeLookup = htmlElements.values.usePostcodeLookup ?? false\n }\n\n get usePostcodeLookup() {\n return this._usePostcodeLookup\n }\n\n /**\n * @param {boolean} val\n */\n set usePostcodeLookup(val) {\n this._usePostcodeLookup = val\n this.render()\n }\n\n /**\n * @protected\n */\n _renderInput() {\n return {\n ...super._renderInput(),\n usePostcodeLookup: this.usePostcodeLookup\n }\n }\n}\n\n/**\n * @import { BaseSettings, QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { UkAddressFieldComponent } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AACzB,SAASC,yBAAyB;;AAElC;AACA;AACA;AACA,OAAO,MAAMC,iCAAiC,SAASD,yBAAyB,CAAC;EAC/E;AACF;AACA;EACEE,WAAWA,CAACC,SAAS,EAAE;IACrB,KAAK,CAACA,SAAS,CAAC;IAChB,IAAI,CAACC,kBAAkB,GAAGD,SAAS,CAACE,OAAO,CAACC,iBAAiB;EAC/D;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,OAAO;MACL,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBD,iBAAiB,EAAE,IAAI,CAACF;IAC1B,CAAC;EACH;AACF;AAEA,OAAO,MAAMI,iBAAiB,SAASV,gBAAgB,CAAC;EACtD;AACF;AACA;EACEW,aAAa,GAAGZ,aAAa,CAACa,cAAc;EAC5CC,iBAAiB,GAAGZ,gBAAgB,CAACa,IAAI,GAAG,oBAAoB;EAChEC,UAAU,GAAG,cAAc;EAC3BT,kBAAkB,GAAG,KAAK;;EAE1B;AACF;AACA;AACA;EACEF,WAAWA,CAACY,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,KAAK,CAACD,YAAY,EAAEC,gBAAgB,CAAC;IACrC,IAAI,CAACX,kBAAkB,GAAGU,YAAY,CAACE,MAAM,CAACV,iBAAiB,IAAI,KAAK;EAC1E;EAEA,IAAIA,iBAAiBA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACF,kBAAkB;EAChC;;EAEA;AACF;AACA;EACE,IAAIE,iBAAiBA,CAACW,GAAG,EAAE;IACzB,IAAI,CAACb,kBAAkB,GAAGa,GAAG;IAC7B,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;EACEC,YAAYA,CAAA,EAAG;IACb,OAAO;MACL,GAAG,KAAK,CAACA,YAAY,CAAC,CAAC;MACvBb,iBAAiB,EAAE,IAAI,CAACA;IAC1B,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"uk-address.js","names":["ComponentType","FieldsetQuestion","PreviewComponent","QuestionComponentElements","UkAddressComponentPreviewElements","constructor","component","_usePostcodeLookup","options","usePostcodeLookup","_getValues","UkAddressQuestion","componentType","UkAddressField","_questionTemplate","PATH","_fieldName","htmlElements","questionRenderer","values","val","render","_renderInput"],"sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { FieldsetQuestion } from '~/src/form/form-editor/preview/fieldset-question.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\nimport { QuestionComponentElements } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class UkAddressComponentPreviewElements extends QuestionComponentElements {\n /**\n * @param {UkAddressFieldComponent} component\n */\n constructor(component) {\n super(component)\n this._usePostcodeLookup = component.options.usePostcodeLookup\n }\n\n /**\n * @protected\n * @returns {UkAddressSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n usePostcodeLookup: this._usePostcodeLookup\n }\n }\n}\n\nexport class UkAddressQuestion extends FieldsetQuestion {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.UkAddressField\n _questionTemplate = PreviewComponent.PATH + 'ukaddressfield.njk'\n _fieldName = 'addressField'\n _usePostcodeLookup = false\n\n /**\n * @param {UkAddressElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n this._usePostcodeLookup = htmlElements.values.usePostcodeLookup ?? false\n }\n\n get usePostcodeLookup() {\n return this._usePostcodeLookup\n }\n\n /**\n * @param {boolean} val\n */\n set usePostcodeLookup(val) {\n this._usePostcodeLookup = val\n this.render()\n }\n\n /**\n * @protected\n */\n _renderInput() {\n return {\n ...super._renderInput(),\n usePostcodeLookup: this.usePostcodeLookup\n }\n }\n}\n\n/**\n * @import { QuestionElements, QuestionRenderer, UkAddressElements, UkAddressSettings } from '~/src/form/form-editor/preview/types.js'\n * @import { UkAddressFieldComponent } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AACzB,SAASC,yBAAyB;;AAElC;AACA;AACA;AACA,OAAO,MAAMC,iCAAiC,SAASD,yBAAyB,CAAC;EAC/E;AACF;AACA;EACEE,WAAWA,CAACC,SAAS,EAAE;IACrB,KAAK,CAACA,SAAS,CAAC;IAChB,IAAI,CAACC,kBAAkB,GAAGD,SAAS,CAACE,OAAO,CAACC,iBAAiB;EAC/D;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,OAAO;MACL,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBD,iBAAiB,EAAE,IAAI,CAACF;IAC1B,CAAC;EACH;AACF;AAEA,OAAO,MAAMI,iBAAiB,SAASV,gBAAgB,CAAC;EACtD;AACF;AACA;EACEW,aAAa,GAAGZ,aAAa,CAACa,cAAc;EAC5CC,iBAAiB,GAAGZ,gBAAgB,CAACa,IAAI,GAAG,oBAAoB;EAChEC,UAAU,GAAG,cAAc;EAC3BT,kBAAkB,GAAG,KAAK;;EAE1B;AACF;AACA;AACA;EACEF,WAAWA,CAACY,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,KAAK,CAACD,YAAY,EAAEC,gBAAgB,CAAC;IACrC,IAAI,CAACX,kBAAkB,GAAGU,YAAY,CAACE,MAAM,CAACV,iBAAiB,IAAI,KAAK;EAC1E;EAEA,IAAIA,iBAAiBA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACF,kBAAkB;EAChC;;EAEA;AACF;AACA;EACE,IAAIE,iBAAiBA,CAACW,GAAG,EAAE;IACzB,IAAI,CAACb,kBAAkB,GAAGa,GAAG;IAC7B,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;EACEC,YAAYA,CAAA,EAAG;IACb,OAAO;MACL,GAAG,KAAK,CAACA,YAAY,CAAC,CAAC;MACvBb,iBAAiB,EAAE,IAAI,CAACA;IAC1B,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA","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 DateDirections, type DateUnits } from '~/src/conditions/enums.js'\nimport {\n type ConditionWrapperV2,\n type Item\n} from '~/src/form/form-definition/types.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 location\n */\n locationSub: 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 instruction text field\n */\n giveInstructions: string\n\n /**\n * The instruction text for location components (optional)\n */\n instructionText: 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 /**\n * List item id for conditions\n */\n itemId: string\n\n /**\n * Relative date period for conditions\n */\n period: string\n\n /**\n * Relative date unit for conditions\n */\n unit: DateUnits\n\n /**\n * Relative date direction for conditions\n */\n direction: DateDirections\n\n /**\n * Denotes if page is an Exit Page\n */\n exitPage: boolean\n\n /**\n * Denotes if the UK address question supports postcode lookup\n */\n usePostcodeLookup: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n | 'pageType'\n | 'questionType'\n | 'writtenAnswerSub'\n | 'dateSub'\n | 'locationSub'\n | '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 | 'usePostcodeLookup'\n | 'giveInstructions'\n | 'instructionText'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n | 'exitPage'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText' | 'exitPage'\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\ntype ListValue = string | boolean | number\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: ListValue\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: ListValue\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: ListValue\n readonly label?: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface ListConflict {\n conflictItem: {\n id: string\n text: string\n }\n originalItem?: {\n id: string\n text: string\n }\n conditionNames: string[]\n linkableItems: {\n id?: string\n text: string\n value: string | number | boolean\n }[]\n closestMatch?: string | number | boolean\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?: ListValue\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n listConflicts?: ListConflict[]\n}\n\nexport interface ConditionSessionState {\n id?: string\n stateId?: string\n conditionWrapper?: ConditionWrapperV2\n}\n\nexport interface ConditionDetails {\n pageCondition: string | undefined\n pageConditionDetails: ConditionWrapperV2 | undefined\n pageConditionPresentationString: string | null\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n hint?: { text?: string; html?: string; classes?: string }\n}\n\nexport interface GovukSummaryListRow {\n key?: {\n text?: string\n classes?: string\n }\n value?: {\n text?: string\n html?: string\n classes?: string\n }\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 formGroup?: {\n classes?: string\n }\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 GovukFieldUsePostcodeLookup = Omit<GovukField, 'name' | 'items'> & {\n name: 'usePostcodeLookup'\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 instructionText?: 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 usePostcodeLookup?: 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\nexport type AdvancedFieldMappingsType = Record<\n ComponentType,\n Record<string, string>\n>\n\nexport type HTMLElementOrNull = HTMLElement | null\n\nexport type HTMLInputElementOrNull = HTMLInputElement | null\n\nexport interface ErrorPreviewFieldMappingDef {\n min?: { fieldName: string; placeholder: string }\n max?: { fieldName: string; placeholder: string }\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 DateDirections, type DateUnits } from '~/src/conditions/enums.js'\nimport {\n type ConditionWrapperV2,\n type Item\n} from '~/src/form/form-definition/types.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 location\n */\n locationSub: 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 instruction text field\n */\n giveInstructions: string\n\n /**\n * The instruction text for location components (optional)\n */\n instructionText: 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 /**\n * List item id for conditions\n */\n itemId: string\n\n /**\n * Relative date period for conditions\n */\n period: string\n\n /**\n * Relative date unit for conditions\n */\n unit: DateUnits\n\n /**\n * Relative date direction for conditions\n */\n direction: DateDirections\n\n /**\n * Denotes if page is an Exit Page\n */\n exitPage: boolean\n\n /**\n * Denotes if the UK address question supports postcode lookup\n */\n usePostcodeLookup: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n | 'pageType'\n | 'questionType'\n | 'writtenAnswerSub'\n | 'dateSub'\n | 'locationSub'\n | '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 | 'declarationText'\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 | 'usePostcodeLookup'\n | 'giveInstructions'\n | 'instructionText'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n | 'exitPage'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText' | 'exitPage'\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\ntype ListValue = string | boolean | number\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: ListValue\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: ListValue\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: ListValue\n readonly label?: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface ListConflict {\n conflictItem: {\n id: string\n text: string\n }\n originalItem?: {\n id: string\n text: string\n }\n conditionNames: string[]\n linkableItems: {\n id?: string\n text: string\n value: string | number | boolean\n }[]\n closestMatch?: string | number | boolean\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?: ListValue\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n listConflicts?: ListConflict[]\n}\n\nexport interface ConditionSessionState {\n id?: string\n stateId?: string\n conditionWrapper?: ConditionWrapperV2\n}\n\nexport interface ConditionDetails {\n pageCondition: string | undefined\n pageConditionDetails: ConditionWrapperV2 | undefined\n pageConditionPresentationString: string | null\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n hint?: { text?: string; html?: string; classes?: string }\n}\n\nexport interface GovukSummaryListRow {\n key?: {\n text?: string\n classes?: string\n }\n value?: {\n text?: string\n html?: string\n classes?: string\n }\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 formGroup?: {\n classes?: string\n }\n preContent?: {\n path?: string\n }\n postContent?: {\n path?: string\n }\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 GovukFieldUsePostcodeLookup = Omit<GovukField, 'name' | 'items'> & {\n name: 'usePostcodeLookup'\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 instructionText?: 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 usePostcodeLookup?: GovukField\n declarationText?: 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\nexport type AdvancedFieldMappingsType = Record<\n ComponentType,\n Record<string, string>\n>\n\nexport type HTMLElementOrNull = HTMLElement | null\n\nexport type HTMLInputElementOrNull = HTMLInputElement | null\n\nexport interface ErrorPreviewFieldMappingDef {\n min?: { fieldName: string; placeholder: string }\n max?: { fieldName: string; placeholder: string }\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/conditions/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAEL,KAAK,eAAe,EAOrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACV,MAAM,qCAAqC,CAAA;AAE5C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,KAAG,MAE5D,CAAA;AAED,wBAAgB,iC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,iCAAiC,CAAC,SAAS,EAAE,eAAe,WAE3E;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,WAEtE;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,eAAe,WAEvE;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,WAEtE;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,eAAe,WAEpE;AAED,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,eAAe,WAE5E;AAmKD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,kBAAkB,CAE/B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,gBAAgB,CAE7B;AAED,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,kBAAkB,EACpC,KAAK,EAAE,gBAAgB,GACtB,gBAAgB,CAqClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAAA;IACjD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAA;IACnE,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAA;CAC1E"}
@@ -59,7 +59,7 @@ export class QuestionPreviewElements implements ListElements {
59
59
  /**
60
60
  * @param {BaseSettings} baseSettings
61
61
  */
62
- constructor({ question, hintText, optional, shortDesc, userClasses, usePostcodeLookup, items, content }: BaseSettings);
62
+ constructor({ question, hintText, optional, shortDesc, userClasses, items, content }: BaseSettings);
63
63
  /**
64
64
  * @protected
65
65
  */
@@ -89,11 +89,6 @@ export class QuestionPreviewElements implements ListElements {
89
89
  * @private
90
90
  */
91
91
  private _items;
92
- /**
93
- * @protected
94
- * @type {boolean}
95
- */
96
- protected _usePostcodeLookup: boolean;
97
92
  afterInputsHTML: string;
98
93
  /**
99
94
  * @returns {BaseSettings}
@@ -120,6 +115,38 @@ export class AutocompletePreviewElements extends QuestionPreviewElements impleme
120
115
  });
121
116
  autocompleteOptions: string;
122
117
  }
118
+ /**
119
+ * @implements {UkAddressElements}
120
+ */
121
+ export class UkAddressPreviewElements extends QuestionPreviewElements implements UkAddressElements {
122
+ /**
123
+ * @param {BaseSettings & {usePostcodeLookup?: boolean}} elements
124
+ */
125
+ constructor({ usePostcodeLookup, ...elements }: BaseSettings & {
126
+ usePostcodeLookup?: boolean;
127
+ });
128
+ _usePostcodeLookup: boolean;
129
+ /**
130
+ * @returns {UkAddressSettings}
131
+ */
132
+ get values(): UkAddressSettings;
133
+ }
134
+ /**
135
+ * @implements {DeclarationElements}
136
+ */
137
+ export class DeclarationPreviewElements extends QuestionPreviewElements implements DeclarationElements {
138
+ /**
139
+ * @param {BaseSettings & {declarationText: string}} elements
140
+ */
141
+ constructor({ declarationText, ...elements }: BaseSettings & {
142
+ declarationText: string;
143
+ });
144
+ _declarationText: string;
145
+ /**
146
+ * @returns {DeclarationSettings}
147
+ */
148
+ get values(): DeclarationSettings;
149
+ }
123
150
  /**
124
151
  * @implements {PageOverviewElements}
125
152
  */
@@ -151,7 +178,7 @@ export class NumberPreviewElements {
151
178
  /**
152
179
  * @param {NumberSettings} baseSettings
153
180
  */
154
- constructor({ question, hintText, optional, shortDesc, userClasses, prefix, suffix, usePostcodeLookup, items, content }: NumberSettings);
181
+ constructor({ question, hintText, optional, shortDesc, userClasses, prefix, suffix, items, content }: NumberSettings);
155
182
  /**
156
183
  * @protected
157
184
  */
@@ -191,11 +218,6 @@ export class NumberPreviewElements {
191
218
  * @private
192
219
  */
193
220
  private _items;
194
- /**
195
- * @protected
196
- * @type {boolean}
197
- */
198
- protected _usePostcodeLookup: boolean;
199
221
  afterInputsHTML: string;
200
222
  /**
201
223
  * @returns {NumberSettings}
@@ -219,6 +241,10 @@ import type { PageRenderer } from '../../../form/form-editor/preview/types.js';
219
241
  import type { PagePreviewPanelMacro } from '../../../form/form-editor/macros/types.js';
220
242
  import type { ListElements } from '../../../form/form-editor/preview/types.js';
221
243
  import type { AutocompleteElements } from '../../../form/form-editor/preview/types.js';
244
+ import type { UkAddressElements } from '../../../form/form-editor/preview/types.js';
245
+ import type { UkAddressSettings } from '../../../form/form-editor/preview/types.js';
246
+ import type { DeclarationElements } from '../../../form/form-editor/preview/types.js';
247
+ import type { DeclarationSettings } from '../../../form/form-editor/preview/types.js';
222
248
  import type { PageOverviewElements } from '../../../form/form-editor/preview/types.js';
223
249
  import type { NumberSettings } from '../../../form/form-editor/preview/types.js';
224
250
  declare const list1Id: "414d82a3-4cab-416a-bd54-6b86fbd51120";
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AAoRA;;;;GAIG;AACH,6DAJW,OAAO,CAAC,YAAY,CAAC,cACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GAC1C,QAAQ,CAUpB;AA/RD;;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;IAqBE;;;;OAIG;IACH,oCAHW,MAAM,kBACN,aAAa,GAFX,MAAM,CAMlB;IAtBD;;OAEG;IACH,wBAFW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,qBAAqB,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;IACZ;;;OAGG;IACH,mBAHU,MAAM,CAGJ;IACZ;;;OAGG;IACH,oBAHU,MAAM,CAGH;IACb;;;;OAIG;IACH,eAAW;IACX;;;OAGG;IACH,8BAFU,OAAO,CAES;IAC1B,wBAA2E;IA6B3E;;OAEG;IACH,cAFa,cAAc,CAe1B;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,sBAFW,WAAW,QAIrB;CACF;kCAK6K,yCAAyC;uCAAzC,yCAAyC;yBAjZ9L,4CAA4C;sCAiZyG,yCAAyC;mCAAzC,yCAAyC;kCAAzC,yCAAyC;2CAD7K,wCAAwC;kCAC4F,yCAAyC;0CAAzC,yCAAyC;0CAAzC,yCAAyC;oCAAzC,yCAAyC;AAxKvN,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AAEtD,gCAAoC,YAAY,CA4B9C"}
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AA0TA;;;;GAIG;AACH,6DAJW,OAAO,CAAC,YAAY,CAAC,cACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GAC1C,QAAQ,CAUpB;AArUD;;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;IA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AAM,aACN,MAAM,eACN,OAAO,mBACP,MAAM,gBACN,OAAO,EAcjB;IAzBD,iBAAQ;IACR,gBAAO;IACP,oBAAU;IACV,uBAAc;IACd,qBAAW;CAsBZ;AAED,2BAAuC,YAAY,CASjD;AAEF,6BAAyC,cAAc,CAWrD;;;;;;;;AA4DF;IA0CE;;OAEG;IACH,sGAFW,cAAc,EAsBxB;IAhED;;OAEG;IACH,4BAAc;IACd,iBAAiB;IACjB,4BAAc;IACd,iBAAiB;IACjB,6BAAiB;IACjB;;;OAGG;IACH,sBAHU,MAAM,CAGD;IACf;;;OAGG;IACH,wBAHU,MAAM,CAGC;IACjB;;;OAGG;IACH,mBAHU,MAAM,CAGJ;IACZ;;;OAGG;IACH,mBAHU,MAAM,CAGJ;IACZ;;;OAGG;IACH,oBAHU,MAAM,CAGH;IACb;;;;OAIG;IACH,eAAW;IACX,wBAA2E;IA2B3E;;OAEG;IACH,cAFa,cAAc,CAc1B;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,sBAFW,WAAW,QAIrB;CACF;kCAK6P,yCAAyC;uCAAzC,yCAAyC;yBA/a9Q,4CAA4C;sCA+ayL,yCAAyC;mCAAzC,yCAAyC;kCAAzC,yCAAyC;2CAD7P,wCAAwC;kCAC4K,yCAAyC;0CAAzC,yCAAyC;uCAAzC,yCAAyC;uCAAzC,yCAAyC;yCAAzC,yCAAyC;yCAAzC,yCAAyC;0CAAzC,yCAAyC;oCAAzC,yCAAyC;AAhKvS,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AAEtD,gCAAoC,YAAY,CA4B9C"}
@@ -79,6 +79,7 @@ export declare const questionDetailsFullSchema: {
79
79
  value: string;
80
80
  }[]>;
81
81
  classesSchema: Joi.StringSchema<string>;
82
+ declarationTextSchema: Joi.StringSchema<string>;
82
83
  documentTypesSchema: Joi.ArraySchema<any[]>;
83
84
  enhancedActionSchema: Joi.StringSchema<string>;
84
85
  exactFilesSchema: Joi.NumberSchema<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,KAAK,WAAW,EAAuB,MAAM,KAAK,CAAA;AAOhE,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AAExC,oBAAY,oBAAoB;IAC9B,qBAAqB,qBAAqB;IAC1C,YAAY,YAAY;IACxB,YAAY,YAAY;IACxB,gBAAgB,gBAAgB;CACjC;AAED,eAAO,MAAM,cAAc,0BAG6C,CAAA;AAExE,eAAO,MAAM,kBAAkB,0BAgB2C,CAAA;AAE1E,eAAO,MAAM,sBAAsB,0BAsBmC,CAAA;AAEtE,eAAO,MAAM,sBAAsB,0BAOmB,CAAA;AAEtD,eAAO,MAAM,aAAa,0BAG0B,CAAA;AAEpD,eAAO,MAAM,aAAa,0BAS0B,CAAA;AAEpD,eAAO,MAAM,iBAAiB,0BAQ0B,CAAA;AAExD,eAAO,MAAM,UAAU,0BAG0B,CAAA;AAEjD,eAAO,MAAM,cAAc,0BAG8B,CAAA;AAEzD,eAAO,MAAM,cAAc,0BAI0C,CAAA;AAErE,eAAO,MAAM,qBAAqB,0BAM/B,CAAA;AAEH,eAAO,MAAM,sBAAsB,0BAMhC,CAAA;AAEH,eAAO,MAAM,qBAAqB,0BAIgC,CAAA;AAElE,eAAO,MAAM,mBAAmB,0BAEoC,CAAA;AAEpE,eAAO,MAAM,mBAAmB,0BAE8C,CAAA;AAE9E,eAAO,MAAM,gBAAgB,0BAO1B,CAAA;AAEH,eAAO,MAAM,cAAc,0BA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EA4GtB,eAAe,CAAA;AAErB,eAAO,MAAM,yBAAyB;UACvB,MAAM;WAAS,MAAM;IAiBvB,CAAA;AAEb,eAAO,MAAM,yBAAyB;;cAnBvB,MAAM;eAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DnC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;CAGnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uCAGmC,CAAA;AAEzE,eAAO,MAAM,sCAAsC;;CAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wCAAwC,uDAIO,CAAA;AAE5D,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2CAMrC,CAAA;AAEL,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAI8B,CAAA;AAE5E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,gBAAgB,CAUhC;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,0BAA0B,GAAG,2BAA2B,CASxE;AAGD,eAAO,MAAM,6BAA6B,UAA+B,CAAA"}
@@ -56,6 +56,12 @@ export interface QuestionBaseModel {
56
56
  text: string;
57
57
  };
58
58
  }
59
+ export interface DeclarationModel extends QuestionBaseModel {
60
+ declaration?: {
61
+ text?: string;
62
+ classes?: string;
63
+ };
64
+ }
59
65
  export interface AppPreviewPanelMacro extends AppPreviewPanelTabsMacro {
60
66
  model: QuestionBaseModel;
61
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/macros/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB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