@defra/forms-model 3.0.507 → 3.0.509

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 (87) hide show
  1. package/dist/module/__stubs__/components.js +1 -0
  2. package/dist/module/__stubs__/components.js.map +1 -1
  3. package/dist/module/common/search/types.js.map +1 -1
  4. package/dist/module/common/types.js.map +1 -1
  5. package/dist/module/form/form-editor/macros/types.js.map +1 -1
  6. package/dist/module/form/form-editor/preview/controller/page-controller-base.js +13 -3
  7. package/dist/module/form/form-editor/preview/controller/page-controller-base.js.map +1 -1
  8. package/dist/module/form/form-editor/preview/controller/page-controller.js +3 -3
  9. package/dist/module/form/form-editor/preview/controller/page-controller.js.map +1 -1
  10. package/dist/module/form/form-editor/preview/controller/reorder-questions-page-controller.js +21 -0
  11. package/dist/module/form/form-editor/preview/controller/reorder-questions-page-controller.js.map +1 -0
  12. package/dist/module/form/form-editor/preview/fieldset-question.js +2 -0
  13. package/dist/module/form/form-editor/preview/fieldset-question.js.map +1 -1
  14. package/dist/module/form/form-editor/preview/helpers.js +8 -6
  15. package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
  16. package/dist/module/form/form-editor/preview/index.js +2 -0
  17. package/dist/module/form/form-editor/preview/index.js.map +1 -1
  18. package/dist/module/form/form-editor/preview/list-sortable.js +1 -2
  19. package/dist/module/form/form-editor/preview/list-sortable.js.map +1 -1
  20. package/dist/module/form/form-editor/preview/list.js +3 -0
  21. package/dist/module/form/form-editor/preview/list.js.map +1 -1
  22. package/dist/module/form/form-editor/preview/preview.js +19 -3
  23. package/dist/module/form/form-editor/preview/preview.js.map +1 -1
  24. package/dist/module/form/form-editor/preview/question.js +2 -3
  25. package/dist/module/form/form-editor/preview/question.js.map +1 -1
  26. package/dist/module/form/form-editor/preview/select-sortable.js +4 -2
  27. package/dist/module/form/form-editor/preview/select-sortable.js.map +1 -1
  28. package/dist/module/form/form-editor/preview/select.js +3 -1
  29. package/dist/module/form/form-editor/preview/select.js.map +1 -1
  30. package/dist/module/form/form-editor/preview/yes-no.js +3 -0
  31. package/dist/module/form/form-editor/preview/yes-no.js.map +1 -1
  32. package/dist/module/form/form-editor/types.js.map +1 -1
  33. package/dist/module/form/form-manager/types.js.map +1 -1
  34. package/dist/module/stubs.js +1 -0
  35. package/dist/module/stubs.js.map +1 -1
  36. package/dist/types/__stubs__/components.d.ts.map +1 -1
  37. package/dist/types/common/search/types.d.ts +1 -1
  38. package/dist/types/common/search/types.d.ts.map +1 -1
  39. package/dist/types/common/types.d.ts +1 -1
  40. package/dist/types/common/types.d.ts.map +1 -1
  41. package/dist/types/form/form-editor/macros/types.d.ts +1 -1
  42. package/dist/types/form/form-editor/macros/types.d.ts.map +1 -1
  43. package/dist/types/form/form-editor/preview/controller/page-controller-base.d.ts +4 -0
  44. package/dist/types/form/form-editor/preview/controller/page-controller-base.d.ts.map +1 -1
  45. package/dist/types/form/form-editor/preview/controller/page-controller.d.ts.map +1 -1
  46. package/dist/types/form/form-editor/preview/controller/reorder-questions-page-controller.d.ts +8 -0
  47. package/dist/types/form/form-editor/preview/controller/reorder-questions-page-controller.d.ts.map +1 -0
  48. package/dist/types/form/form-editor/preview/fieldset-question.d.ts +1 -1
  49. package/dist/types/form/form-editor/preview/fieldset-question.d.ts.map +1 -1
  50. package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
  51. package/dist/types/form/form-editor/preview/index.d.ts +2 -0
  52. package/dist/types/form/form-editor/preview/list.d.ts +2 -0
  53. package/dist/types/form/form-editor/preview/list.d.ts.map +1 -1
  54. package/dist/types/form/form-editor/preview/preview.d.ts +12 -0
  55. package/dist/types/form/form-editor/preview/preview.d.ts.map +1 -1
  56. package/dist/types/form/form-editor/preview/question.d.ts.map +1 -1
  57. package/dist/types/form/form-editor/preview/select-sortable.d.ts +4 -4
  58. package/dist/types/form/form-editor/preview/select-sortable.d.ts.map +1 -1
  59. package/dist/types/form/form-editor/preview/select.d.ts.map +1 -1
  60. package/dist/types/form/form-editor/preview/yes-no.d.ts.map +1 -1
  61. package/dist/types/form/form-editor/types.d.ts +2 -1
  62. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  63. package/dist/types/form/form-manager/types.d.ts +2 -1
  64. package/dist/types/form/form-manager/types.d.ts.map +1 -1
  65. package/dist/types/stubs.d.ts +1 -0
  66. package/dist/types/stubs.d.ts.map +1 -1
  67. package/package.json +1 -1
  68. package/src/__stubs__/components.ts +1 -0
  69. package/src/common/search/types.ts +1 -1
  70. package/src/common/types.ts +1 -1
  71. package/src/form/form-editor/macros/types.ts +4 -1
  72. package/src/form/form-editor/preview/controller/page-controller-base.js +15 -3
  73. package/src/form/form-editor/preview/controller/page-controller.js +3 -3
  74. package/src/form/form-editor/preview/controller/reorder-questions-page-controller.js +24 -0
  75. package/src/form/form-editor/preview/fieldset-question.js +2 -0
  76. package/src/form/form-editor/preview/helpers.js +16 -12
  77. package/src/form/form-editor/preview/index.js +2 -0
  78. package/src/form/form-editor/preview/list-sortable.js +1 -2
  79. package/src/form/form-editor/preview/list.js +3 -0
  80. package/src/form/form-editor/preview/preview.js +19 -3
  81. package/src/form/form-editor/preview/question.js +2 -3
  82. package/src/form/form-editor/preview/select-sortable.js +5 -2
  83. package/src/form/form-editor/preview/select.js +4 -1
  84. package/src/form/form-editor/preview/yes-no.js +3 -0
  85. package/src/form/form-editor/types.ts +2 -3
  86. package/src/form/form-manager/types.ts +2 -1
  87. package/src/stubs.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","names":["ComponentType","PreviewComponent","Question","QuestionComponentElements","DefaultListConst","TextElementId","HintElementId","Template","PATH","Input","RenderName","listItemMapper","listElement","id","listsElementToMap","listElements","entries","map","Map","listItemToListElement","item","text","label","classes","value","hint","ListComponentElements","_list","constructor","component","list","_getValues","items","SelectComponentElements","emptyItem","ListQuestion","componentType","List","_questionTemplate","_listElements","listRenderId","listRenderName","questionRenderer","values","createListFromElements","_renderInput","afterInputs","length","formGroup","html","afterInputsHTML","name","fieldset","fieldSet","renderInput","push","set","render","delete","key","_getList","iterator","Array","from","listItem","hintText","_highlight","getHighlight","undefined","updateText","get","updateHint","updateValue"],"sources":["../../../../../src/form/form-editor/preview/list.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.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\nconst DefaultListConst = {\n TextElementId: 'radioText',\n HintElementId: 'radioHint',\n Template: PreviewComponent.PATH + '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\n/**\n * @param {Item} item\n * @returns {ListElement}\n */\nexport function listItemToListElement(item) {\n return {\n text: item.text,\n label: {\n text: item.text,\n classes: ''\n },\n value: item.value,\n id: item.id ?? '',\n hint: item.hint\n }\n}\n\n/**\n * @implements {QuestionElements}\n */\nexport class ListComponentElements extends QuestionComponentElements {\n /**\n * @type {List}\n * @protected\n */\n _list\n\n /**\n * @param {SelectionComponentsDef} component\n * @param {List} list\n */\n constructor(component, list) {\n super(component)\n this._list = list\n }\n\n /**\n * @returns {BaseSettings}\n * @protected\n */\n _getValues() {\n return {\n ...super._getValues(),\n items: this._list.items.map(listItemToListElement)\n }\n }\n}\n\n/**\n * @implements {QuestionElements}\n */\nexport class SelectComponentElements extends ListComponentElements {\n /**\n * @returns {BaseSettings}\n * @protected\n */\n _getValues() {\n const emptyItem = /** @type {ListElement} */ ({\n id: 'da310b6e-2513-4d14-a7a1-63a93231891d',\n text: '',\n value: ''\n })\n const items = /** @type {ListElement[]} */ ([\n emptyItem,\n ...super._getValues().items\n ])\n return {\n ...super._getValues(),\n items\n }\n }\n}\n\nexport class ListQuestion extends Question {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.List\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 /**\n * @protected\n * @returns {{\n * formGroup?: FormGroupAfterInput;\n * hint: DefaultComponent;\n * name: string;\n * fieldset?: GovukFieldset;\n * id: string;\n * items: ListItemReadonly[]\n * }}\n */\n _renderInput() {\n const afterInputs = /** @type {{ formGroup?: FormGroupAfterInput }} */ (\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 * @returns {{\n * formGroup?: FormGroupAfterInput;\n * hint: DefaultComponent;\n * name: string;\n * fieldset?: GovukFieldset;\n * id: string;\n * items: ListItemReadonly[]\n * }}\n */\n get renderInput() {\n return this._renderInput()\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 * @protected\n * @returns {ListItemReadonly[]}\n */\n _getList() {\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\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 * @returns {ListItemReadonly[]}\n */\n get list() {\n const list = this._getList()\n\n return list.map((listItem) => {\n const text = listItem.text.length ? listItem.text : 'Item text'\n\n return {\n ...listItem,\n text\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 { SelectionComponentsDef, ListComponentsDef } from '~/src/components/types.js'\n * @import { List, Item } from '~/src/form/form-definition/types.js'\n * @import { FormGroupAfterInput } from '~/src/form/form-editor/macros/types.js'\n * @import { ListElements, QuestionRenderer, DefaultComponent, GovukFieldset, BaseSettings, QuestionElements } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SACEC,QAAQ,EACRC,yBAAyB;AAG3B,MAAMC,gBAAgB,GAAG;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AI;MACpB,IAAI,CAACoC,MAAM,CAAC,CAAC;IACf;EACF;;EAEA;AACF;AACA;AACA;AACA;EACEc,UAAUA,CAAC1D,EAAE,EAAEY,IAAI,EAAE;IACnB,IAAI,CAACZ,EAAE,EAAE;MACP;IACF;IAEA,MAAMmD,QAAQ,GAAG,IAAI,CAACrC,KAAK,CAAC2C,GAAG,CAACzD,EAAE,CAAC;IACnC,IAAImD,QAAQ,EAAE;MACZA,QAAQ,CAACvC,IAAI,GAAG;QACd,GAAGuC,QAAQ,CAACvC,IAAI;QAChBJ,IAAI,EAAEI;MACR,CAAC;MACD,IAAI,CAACgC,MAAM,CAAC,CAAC;IACf;EACF;;EAEA;AACF;AACA;AACA;EACEe,WAAWA,CAAC3D,EAAE,EAAEW,KAAK,EAAE;IACrB,IAAI,CAACX,EAAE,EAAE;MACP;IACF;IAEA,MAAMmD,QAAQ,GAAG,IAAI,CAACrC,KAAK,CAAC2C,GAAG,CAACzD,EAAE,CAAC;IACnC,IAAImD,QAAQ,EAAE;MACZA,QAAQ,CAACxC,KAAK,GAAGA,KAAK;MACtB,IAAI,CAACiC,MAAM,CAAC,CAAC;IACf;EACF;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"list.js","names":["ComponentType","HIGHLIGHT_CLASS","PreviewComponent","Question","QuestionComponentElements","DefaultListConst","TextElementId","HintElementId","Template","PATH","Input","RenderName","listItemMapper","listElement","id","listsElementToMap","listElements","entries","map","Map","listItemToListElement","item","text","label","classes","value","hint","ListComponentElements","_list","constructor","component","list","_getValues","items","SelectComponentElements","emptyItem","ListQuestion","componentType","List","_questionTemplate","_listElements","listRenderId","listRenderName","questionRenderer","values","createListFromElements","_renderInput","afterInputs","length","formGroup","html","afterInputsHTML","name","fieldset","fieldSet","_highlighted","renderInput","push","set","render","delete","key","_getList","iterator","Array","from","listItem","hintText","_highlight","getHighlight","undefined","updateText","get","updateHint","updateValue"],"sources":["../../../../../src/form/form-editor/preview/list.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\nconst DefaultListConst = {\n TextElementId: 'radioText',\n HintElementId: 'radioHint',\n Template: PreviewComponent.PATH + '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\n/**\n * @param {Item} item\n * @returns {ListElement}\n */\nexport function listItemToListElement(item) {\n return {\n text: item.text,\n label: {\n text: item.text,\n classes: ''\n },\n value: item.value,\n id: item.id ?? '',\n hint: item.hint\n }\n}\n\n/**\n * @implements {QuestionElements}\n */\nexport class ListComponentElements extends QuestionComponentElements {\n /**\n * @type {List}\n * @protected\n */\n _list\n\n /**\n * @param {SelectionComponentsDef} component\n * @param {List} list\n */\n constructor(component, list) {\n super(component)\n this._list = list\n }\n\n /**\n * @returns {BaseSettings}\n * @protected\n */\n _getValues() {\n return {\n ...super._getValues(),\n items: this._list.items.map(listItemToListElement)\n }\n }\n}\n\n/**\n * @implements {QuestionElements}\n */\nexport class SelectComponentElements extends ListComponentElements {\n /**\n * @returns {BaseSettings}\n * @protected\n */\n _getValues() {\n const emptyItem = /** @type {ListElement} */ ({\n id: 'da310b6e-2513-4d14-a7a1-63a93231891d',\n text: '',\n value: ''\n })\n const items = /** @type {ListElement[]} */ ([\n emptyItem,\n ...super._getValues().items\n ])\n return {\n ...super._getValues(),\n items\n }\n }\n}\n\nexport class ListQuestion extends Question {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.List\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 /**\n * @protected\n * @returns {{\n * formGroup?: FormGroupAfterInput;\n * hint: DefaultComponent;\n * name: string;\n * fieldset?: GovukFieldset;\n * id: string;\n * classes: string;\n * items: ListItemReadonly[]\n * }}\n */\n _renderInput() {\n const afterInputs = /** @type {{ formGroup?: FormGroupAfterInput }} */ (\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 classes: this._highlighted ? HIGHLIGHT_CLASS : '',\n ...afterInputs\n }\n }\n\n /**\n * @returns {{\n * formGroup?: FormGroupAfterInput;\n * hint: DefaultComponent;\n * name: string;\n * fieldset?: GovukFieldset;\n * id: string;\n * items: ListItemReadonly[]\n * }}\n */\n get renderInput() {\n return this._renderInput()\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 * @protected\n * @returns {ListItemReadonly[]}\n */\n _getList() {\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\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 * @returns {ListItemReadonly[]}\n */\n get list() {\n const list = this._getList()\n\n return list.map((listItem) => {\n const text = listItem.text.length ? listItem.text : 'Item text'\n\n return {\n ...listItem,\n text\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 { SelectionComponentsDef, ListComponentsDef } from '~/src/components/types.js'\n * @import { List, Item } from '~/src/form/form-definition/types.js'\n * @import { FormGroupAfterInput } from '~/src/form/form-editor/macros/types.js'\n * @import { ListElements, QuestionRenderer, DefaultComponent, GovukFieldset, BaseSettings, QuestionElements } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SACEC,QAAQ,EACRC,yBAAyB;AAG3B,MAAMC,gBAAgB,GAAG;EACvBC,aAA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C,IAAIoD,QAAQ,EAAE;MACZA,QAAQ,CAAC5C,IAAI,GAAGA,IAAI;MACpB,IAAI,CAACqC,MAAM,CAAC,CAAC;IACf;EACF;;EAEA;AACF;AACA;AACA;AACA;EACEc,UAAUA,CAAC3D,EAAE,EAAEY,IAAI,EAAE;IACnB,IAAI,CAACZ,EAAE,EAAE;MACP;IACF;IAEA,MAAMoD,QAAQ,GAAG,IAAI,CAACtC,KAAK,CAAC4C,GAAG,CAAC1D,EAAE,CAAC;IACnC,IAAIoD,QAAQ,EAAE;MACZA,QAAQ,CAACxC,IAAI,GAAG;QACd,GAAGwC,QAAQ,CAACxC,IAAI;QAChBJ,IAAI,EAAEI;MACR,CAAC;MACD,IAAI,CAACiC,MAAM,CAAC,CAAC;IACf;EACF;;EAEA;AACF;AACA;AACA;EACEe,WAAWA,CAAC5D,EAAE,EAAEW,KAAK,EAAE;IACrB,IAAI,CAACX,EAAE,EAAE;MACP;IACF;IAEA,MAAMoD,QAAQ,GAAG,IAAI,CAACtC,KAAK,CAAC4C,GAAG,CAAC1D,EAAE,CAAC;IACnC,IAAIoD,QAAQ,EAAE;MACZA,QAAQ,CAACzC,KAAK,GAAGA,KAAK;MACtB,IAAI,CAACkC,MAAM,CAAC,CAAC;IACf;EACF;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -6,6 +6,10 @@ import { HIGHLIGHT_CLASS } from "./constants.js";
6
6
  */
7
7
  export class PreviewComponent {
8
8
  static PATH = 'preview-components/';
9
+ /**
10
+ * @type { string | undefined }
11
+ */
12
+ _id = undefined;
9
13
  /**
10
14
  * @abstract
11
15
  * @type {ComponentType}
@@ -193,6 +197,20 @@ export class PreviewComponent {
193
197
  this.render();
194
198
  }
195
199
 
200
+ /**
201
+ * @type { string | undefined }
202
+ */
203
+ get id() {
204
+ return this._id;
205
+ }
206
+
207
+ /**
208
+ * @param { string | undefined } value
209
+ */
210
+ set id(value) {
211
+ this._id = value;
212
+ }
213
+
196
214
  /**
197
215
  * no render
198
216
  */
@@ -209,8 +227,6 @@ export class PreviewComponent {
209
227
  }
210
228
 
211
229
  /**
212
- * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
213
- * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'
214
- * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'
230
+ * @import { QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
215
231
  */
216
232
  //# sourceMappingURL=preview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"preview.js","names":["ComponentType","HIGHLIGHT_CLASS","PreviewComponent","PATH","componentType","Details","_questionTemplate","_highlight","_fieldName","_questionRenderer","_htmlElements","_highlighted","constructor","htmlElements","questionRenderer","question","optional","values","_question","_optional","getHighlight","element","titleText","optionalText","label","text","classes","fieldSet","legend","customRenderFields","_renderInput","id","name","renderInput","render","value","highlight","highlightContent","unHighlightContent"],"sources":["../../../../../src/form/form-editor/preview/preview.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\n\n/**\n * @abstract\n */\nexport class PreviewComponent {\n static PATH = 'preview-components/'\n /**\n * @abstract\n * @type {ComponentType}\n */\n componentType = ComponentType.Details\n /**\n * @abstract\n * @type {string}\n * @protected\n */\n _questionTemplate = ''\n /**\n * @type { string|null }\n * @protected\n */\n _highlight = null\n /**\n * @abstract\n * @type {string}\n * @protected\n */\n _fieldName = ''\n /**\n * @type {QuestionRenderer}\n * @protected\n */\n _questionRenderer\n\n /**\n * @type {QuestionElements}\n * @protected\n */\n _htmlElements\n /**\n * @type {boolean}\n * @protected\n */\n _highlighted = false\n /**\n * @type {boolean}\n * @protected\n */\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n const { question, optional } = htmlElements.values\n\n /**\n * @type {QuestionElements}\n * @protected\n */\n this._htmlElements = htmlElements\n /**\n * @type {string}\n * @private\n */\n this._question = question\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 * @returns {Partial<QuestionBaseModel>}\n */\n get customRenderFields() {\n return {}\n }\n\n /**\n *\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n classes: this._highlighted ? HIGHLIGHT_CLASS : ''\n }\n }\n\n /**\n * @type {QuestionBaseModel}\n */\n get renderInput() {\n return {\n ...this._renderInput(),\n ...this.customRenderFields\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 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 * no render\n */\n highlightContent() {\n this._highlighted = true\n }\n\n /**\n * no render\n */\n unHighlightContent() {\n this._highlighted = false\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAOC,IAAI,GAAG,qBAAqB;EACnC;AACF;AACA;AACA;EACEC,aAAa,GAAGJ,aAAa,CAACK,OAAO;EACrC;AACF;AACA;AACA;AACA;EACEC,iBAAiB,GAAG,EAAE;EACtB;AACF;AACA;AACA;EACEC,UAAU,GAAG,IAAI;EACjB;AACF;AACA;AACA;AACA;EACEC,UAAU,GAAG,EAAE;EACf;AACF;AACA;AACA;EACEC,iBAAiB;;EAEjB;AACF;AACA;AACA;EACEC,aAAa;EACb;AACF;AACA;AACA;EACEC,YAAY,GAAG,KAAK;EACpB;AACF;AACA;AACA;;EAEE;AACF;AACA;AACA;EACEC,WAAWA,CAACC,YAAY,EAAEC,gBAAgB,EAAE;IAC1C,MAAM;MAAEC,QAAQ;MAAEC;IAAS,CAAC,GAAGH,YAAY,CAACI,MAAM;;IAElD;AACJ;AACA;AACA;IACI,IAAI,CAACP,aAAa,GAAGG,YAAY;IACjC;AACJ;AACA;AACA;IACI,IAAI,CAACK,SAAS,GAAGH,QAAQ;IACzB;AACJ;AACA;AACA;IACI,IAAI,CAACI,SAAS,GAAGH,QAAQ;IACzB;AACJ;AACA;AACA;AACA;IACI,IAAI,CAACP,iBAAiB,GAAGK,gBAAgB;EAC3C;;EAEA;AACF;AACA;AACA;AACA;EACEM,YAAYA,CAACC,OAAO,EAAE;IACpB,OAAO,IAAI,CAACd,UAAU,KAAKc,OAAO,GAAG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AO,IAAI,CAACG,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIH,QAAQA,CAACoB,KAAK,EAAE;IAClB,IAAI,CAACjB,SAAS,GAAGiB,KAAK;IACtB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;EAEA,IAAIlB,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACG,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIH,QAAQA,CAACmB,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,CAAC7B,UAAU;EACxB;;EAEA;AACF;AACA;EACE,IAAI6B,SAASA,CAACD,KAAK,EAAE;IACnB,IAAI,CAAC5B,UAAU,GAAG4B,KAAK;IACvB,IAAI,CAACD,MAAM,CAAC,CAAC;EACf;;EAEA;AACF;AACA;EACEG,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAAC1B,YAAY,GAAG,IAAI;EAC1B;;EAEA;AACF;AACA;EACE2B,kBAAkBA,CAAA,EAAG;IACnB,IAAI,CAAC3B,YAAY,GAAG,KAAK;EAC3B;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"preview.js","names":["ComponentType","HIGHLIGHT_CLASS","PreviewComponent","PATH","_id","undefined","componentType","Details","_questionTemplate","_highlight","_fieldName","_questionRenderer","_htmlElements","_highlighted","constructor","htmlElements","questionRenderer","question","optional","values","_question","_optional","getHighlight","element","titleText","optionalText","label","text","classes","fieldSet","legend","customRenderFields","_renderInput","id","name","renderInput","render","value","highlight","highlightContent","unHighlightContent"],"sources":["../../../../../src/form/form-editor/preview/preview.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\n\n/**\n * @abstract\n */\nexport class PreviewComponent {\n static PATH = 'preview-components/'\n /**\n * @type { string | undefined }\n */\n _id = undefined\n /**\n * @abstract\n * @type {ComponentType}\n */\n componentType = ComponentType.Details\n /**\n * @abstract\n * @type {string}\n * @protected\n */\n _questionTemplate = ''\n /**\n * @type { string|null }\n * @protected\n */\n _highlight = null\n /**\n * @abstract\n * @type {string}\n * @protected\n */\n _fieldName = ''\n /**\n * @type {QuestionRenderer}\n * @protected\n */\n _questionRenderer\n\n /**\n * @type {QuestionElements}\n * @protected\n */\n _htmlElements\n /**\n * @type {boolean}\n * @protected\n */\n _highlighted = false\n /**\n * @type {boolean}\n * @protected\n */\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n const { question, optional } = htmlElements.values\n\n /**\n * @type {QuestionElements}\n * @protected\n */\n this._htmlElements = htmlElements\n /**\n * @type {string}\n * @private\n */\n this._question = question\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 * @returns {Partial<QuestionBaseModel>}\n */\n get customRenderFields() {\n return {}\n }\n\n /**\n *\n * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n classes: this._highlighted ? HIGHLIGHT_CLASS : ''\n }\n }\n\n /**\n * @type {QuestionBaseModel}\n */\n get renderInput() {\n return {\n ...this._renderInput(),\n ...this.customRenderFields\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 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 * @type { string | undefined }\n */\n get id() {\n return this._id\n }\n\n /**\n * @param { string | undefined } value\n */\n set id(value) {\n this._id = value\n }\n\n /**\n * no render\n */\n highlightContent() {\n this._highlighted = true\n }\n\n /**\n * no render\n */\n unHighlightContent() {\n this._highlighted = false\n }\n}\n\n/**\n * @import { QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAOC,IAAI,GAAG,qBAAqB;EACnC;AACF;AACA;EACEC,GAAG,GAAGC,SAAS;EACf;AACF;AACA;AACA;EACEC,aAAa,GAAGN,aAAa,CAACO,OAAO;EACrC;AACF;AACA;AACA;AACA;EACEC,iBAAiB,GAAG,EAAE;EACtB;AACF;AACA;AACA;EACEC,UAAU,GAAG,IAAI;EACjB;AACF;AACA;AACA;AACA;EACEC,UAAU,GAAG,EAAE;EACf;AACF;AACA;AACA;EACEC,iBAAiB;;EAEjB;AACF;AACA;AACA;EACEC,aAAa;EACb;AACF;AACA;AACA;EACEC,YAAY,GAAG,KAAK;EACpB;AACF;AACA;AACA;;EAEE;AACF;AACA;AACA;EACEC,WAAWA,CAACC,YAAY,EAAE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F;AACA;EACEE,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAAC1B,YAAY,GAAG,IAAI;EAC1B;;EAEA;AACF;AACA;EACE2B,kBAAkBA,CAAA,EAAG;IACnB,IAAI,CAAC3B,YAAY,GAAG,KAAK;EAC3B;AACF;;AAEA;AACA;AACA","ignoreList":[]}
@@ -116,8 +116,7 @@ export class Question extends PreviewComponent {
116
116
  }
117
117
 
118
118
  /**
119
- * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
120
- * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'
121
- * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'
119
+ * @import { BaseSettings, QuestionElements, QuestionBaseModel, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
120
+ * @import { FormComponentsDef } from '~/src/components/types.js'
122
121
  */
123
122
  //# sourceMappingURL=question.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.js","names":["ComponentType","ComponentElements","PreviewComponent","QuestionComponentElements","_component","constructor","component","_getValues","hintText","hint","shortDesc","shortDescription","Question","componentType","TextField","_questionTemplate","PATH","_fieldName","htmlElements","questionRenderer","values","_hintText","text","_highlight","length","classes","getHighlight","_renderInput","label","value","render"],"sources":["../../../../../src/form/form-editor/preview/question.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class QuestionComponentElements extends ComponentElements {\n /**\n * @type {FormComponentsDef}\n * @protected\n */\n _component\n /**\n * @param {FormComponentsDef} component\n */\n constructor(component) {\n super(component)\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n hintText: this._component.hint ?? '',\n shortDesc: this._component.shortDescription ?? ''\n }\n }\n}\n\n/**\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 extends PreviewComponent {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.TextField\n\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'textfield.njk'\n /**\n * @type {string}\n * @protected\n */\n _fieldName = 'inputField'\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n const { hintText } = htmlElements.values\n /**\n * @type {string}\n * @private\n */\n this._hintText = hintText\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 * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return { ...super._renderInput(), label: this.label, hint: this.hint }\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\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,SAASF,iBAAiB,CAAC;EAC/D;AACF;AACA;AACA;EAC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K,CAACA,YAAY,CAAC,CAAC;MAAEC,KAAK,EAAE,IAAI,CAACA,KAAK;MAAEnB,IAAI,EAAE,IAAI,CAACA;IAAK,CAAC;EACxE;;EAEA;AACF;AACA;EACE,IAAID,QAAQA,CAAA,EAAG;IACb,OAAO,IAAI,CAACa,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIb,QAAQA,CAACqB,KAAK,EAAE;IAClB,IAAI,CAACR,SAAS,GAAGQ,KAAK;IACtB,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"question.js","names":["ComponentType","ComponentElements","PreviewComponent","QuestionComponentElements","_component","constructor","component","_getValues","hintText","hint","shortDesc","shortDescription","Question","componentType","TextField","_questionTemplate","PATH","_fieldName","htmlElements","questionRenderer","values","_hintText","text","_highlight","length","classes","getHighlight","_renderInput","label","value","render"],"sources":["../../../../../src/form/form-editor/preview/question.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { ComponentElements } from '~/src/form/form-editor/preview/component-elements.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\n/**\n * @implements {QuestionElements}\n */\nexport class QuestionComponentElements extends ComponentElements {\n /**\n * @type {FormComponentsDef}\n * @protected\n */\n _component\n /**\n * @param {FormComponentsDef} component\n */\n constructor(component) {\n super(component)\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n return {\n ...super._getValues(),\n hintText: this._component.hint ?? '',\n shortDesc: this._component.shortDescription ?? ''\n }\n }\n}\n\n/**\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 extends PreviewComponent {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.TextField\n\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'textfield.njk'\n /**\n * @type {string}\n * @protected\n */\n _fieldName = 'inputField'\n\n /**\n * @param {QuestionElements} htmlElements\n * @param {QuestionRenderer} questionRenderer\n */\n constructor(htmlElements, questionRenderer) {\n super(htmlElements, questionRenderer)\n const { hintText } = htmlElements.values\n /**\n * @type {string}\n * @private\n */\n this._hintText = hintText\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 * @returns {QuestionBaseModel}\n * @protected\n */\n _renderInput() {\n return { ...super._renderInput(), label: this.label, hint: this.hint }\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\n/**\n * @import { BaseSettings, QuestionElements, QuestionBaseModel, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef } from '~/src/components/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,SAASF,iBAAiB,CAAC;EAC/D;AACF;AACA;AACA;EACEG,UAAU;EACV;AACF;AACA;EACEC,WAAWA,CAACC,SAAS,EAAE;IACrB,KAAK,CAACA,SAAS,CAAC;IAChB,IAAI,CAACF,UAAU,GAAGE,SAAS;EAC7B;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,OAAO;MACL,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBC,QAAQ,EAAE,IAAI,CAACJ,UAAU,CAACK,IAAI,IAAI,EAAE;MACpCC,SAAS,EAAE,IAAI,CAACN,UAAU,CAACO,gBAAgB,IAAI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ACA;AACA","ignoreList":[]}
@@ -1,6 +1,7 @@
1
+ import { ComponentType } from "../../../components/enums.js";
2
+ import { HIGHLIGHT_CLASS } from "./constants.js";
1
3
  import { ListSortableQuestion } from "./list-sortable.js";
2
4
  import { PreviewComponent } from "./preview.js";
3
- import { ComponentType } from "../../../index.js";
4
5
  export class SelectSortableQuestion extends ListSortableQuestion {
5
6
  _questionTemplate = PreviewComponent.PATH + 'selectfield.njk';
6
7
  get selectList() {
@@ -24,13 +25,14 @@ export class SelectSortableQuestion extends ListSortableQuestion {
24
25
  }
25
26
  }
26
27
  };
28
+ const highlightedClass = this._highlighted ? HIGHLIGHT_CLASS : '';
27
29
  return {
28
30
  id: this._fieldName,
29
31
  name: this._fieldName,
30
32
  hint: this.hint,
31
33
  label: this.label,
32
34
  items: this.selectList,
33
- classes: this.list.length ? '' : 'govuk-visually-hidden',
35
+ classes: this.list.length ? highlightedClass : 'govuk-visually-hidden',
34
36
  ...afterInput
35
37
  };
36
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"select-sortable.js","names":["ListSortableQuestion","PreviewComponent","ComponentType","SelectSortableQuestion","_questionTemplate","PATH","selectList","list","length","id","value","text","componentType","SelectField","renderInput","afterInput","formGroup","html","_listElements","afterInputsHTML","_fieldName","name","hint","label","items","classes"],"sources":["../../../../../src/form/form-editor/preview/select-sortable.js"],"sourcesContent":["import { ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\nimport { ComponentType } from '~/src/index.js'\n\nexport class SelectSortableQuestion extends ListSortableQuestion {\n _questionTemplate = PreviewComponent.PATH + 'selectfield.njk'\n\n get selectList() {\n return this.list.length\n ? [{ id: '', value: '', text: ' ' }, ...this.list]\n : this.list\n }\n\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.SelectField\n\n get renderInput() {\n const afterInput =\n /** @type {{ formGroup?: { afterInput: { html: string }} }} */ (\n this.list.length\n ? {}\n : {\n formGroup: {\n afterInput: {\n html: this._listElements.afterInputsHTML\n }\n }\n }\n )\n\n return {\n id: this._fieldName,\n name: this._fieldName,\n hint: this.hint,\n label: this.label,\n items: this.selectList,\n classes: this.list.length ? '' : 'govuk-visually-hidden',\n ...afterInput\n }\n }\n}\n\n/**\n * @import { FormGroupAfterInput } from '~/src/form/form-editor/macros/types.js'\n */\n"],"mappings":"AAAA,SAASA,oBAAoB;AAC7B,SAASC,gBAAgB;AACzB,SAASC,aAAa;AAEtB,OAAO,MAAMC,sBAAsB,SAASH,oBAAoB,CAAC;EAC/DI,iBAAiB,GAAGH,gBAAgB,CAACI,IAAI,GAAG,iBAAiB;EAE7D,IAAIC,UAAUA,CAAA,EAAG;IACf,OAAO,IAAI,CAACC,IAAI,CAACC,MAAM,GACnB,CAAC;MAAEC,EAAE,EAAE,EAAE;MAAEC,KAAK,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAI,CAAC,EAAE,GAAG,IAAI,CAACJ,IAAI,CAAC,GAChD,IAAI,CAACA,IAAI;EACf;;EAEA;AACF;AACA;EACEK,aAAa,GAAGV,aAAa,CAACW,WAAW;EAEzC,IAAIC,WAAWA,CAAA,EAAG;IAChB,MAAMC,UAAU,GACd;IACE,IAAI,CAACR,IAAI,CAACC,MAAM,GACZ,CAAC,CAAC,GACF;MACEQ,SAAS,EAAE;QACTD,UAAU,EAAE;UACVE,IAAI,EAAE,IAAI,CAACC,aAAa,CAACC;QAC3B;MACF;IACF,CACL;IAEH,OAAO;MACLV,EAAE,EAAE,IAAI,CAACW,UAAU;MACnBC,IAAI,EAAE,IAAI,CAACD,UAAU;MACrBE,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,KAAK,EAAE,IAAI,CAAClB,UAAU;MACtBmB,OAAO,EAAE,IAAI,CAAClB,IAAI,CAACC,MAAM,GAAG,EAAE,GAAG,uBAAuB;MACxD,GAAGO;IACL,CAAC;EACH;AACF;;AAEA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"select-sortable.js","names":["ComponentType","HIGHLIGHT_CLASS","ListSortableQuestion","PreviewComponent","SelectSortableQuestion","_questionTemplate","PATH","selectList","list","length","id","value","text","componentType","SelectField","renderInput","afterInput","formGroup","html","_listElements","afterInputsHTML","highlightedClass","_highlighted","_fieldName","name","hint","label","items","classes"],"sources":["../../../../../src/form/form-editor/preview/select-sortable.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\nexport class SelectSortableQuestion extends ListSortableQuestion {\n _questionTemplate = PreviewComponent.PATH + 'selectfield.njk'\n\n get selectList() {\n return this.list.length\n ? [{ id: '', value: '', text: ' ' }, ...this.list]\n : this.list\n }\n\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.SelectField\n\n get renderInput() {\n const afterInput =\n /** @type {{ formGroup?: { afterInput: { html: string }} }} */ (\n this.list.length\n ? {}\n : {\n formGroup: {\n afterInput: {\n html: this._listElements.afterInputsHTML\n }\n }\n }\n )\n\n const highlightedClass = this._highlighted ? HIGHLIGHT_CLASS : ''\n\n return {\n id: this._fieldName,\n name: this._fieldName,\n hint: this.hint,\n label: this.label,\n items: this.selectList,\n classes: this.list.length ? highlightedClass : 'govuk-visually-hidden',\n ...afterInput\n }\n }\n}\n\n/**\n * @import { FormGroupAfterInput } from '~/src/form/form-editor/macros/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,sBAAsB,SAASF,oBAAoB,CAAC;EAC/DG,iBAAiB,GAAGF,gBAAgB,CAACG,IAAI,GAAG,iBAAiB;EAE7D,IAAIC,UAAUA,CAAA,EAAG;IACf,OAAO,IAAI,CAACC,IAAI,CAACC,MAAM,GACnB,CAAC;MAAEC,EAAE,EAAE,EAAE;MAAEC,KAAK,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAI,CAAC,EAAE,GAAG,IAAI,CAACJ,IAAI,CAAC,GAChD,IAAI,CAACA,IAAI;EACf;;EAEA;AACF;AACA;EACEK,aAAa,GAAGb,aAAa,CAACc,WAAW;EAEzC,IAAIC,WAAWA,CAAA,EAAG;IAChB,MAAMC,UAAU,GACd;IACE,IAAI,CAACR,IAAI,CAACC,MAAM,GACZ,CAAC,CAAC,GACF;MACEQ,SAAS,EAAE;QACTD,UAAU,EAAE;UACVE,IAAI,EAAE,IAAI,CAACC,aAAa,CAACC;QAC3B;MACF;IACF,CACL;IAEH,MAAMC,gBAAgB,GAAG,IAAI,CAACC,YAAY,GAAGrB,eAAe,GAAG,EAAE;IAEjE,OAAO;MACLS,EAAE,EAAE,IAAI,CAACa,UAAU;MACnBC,IAAI,EAAE,IAAI,CAACD,UAAU;MACrBE,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,KAAK,EAAE,IAAI,CAACpB,UAAU;MACtBqB,OAAO,EAAE,IAAI,CAACpB,IAAI,CAACC,MAAM,GAAGY,gBAAgB,GAAG,uBAAuB;MACtE,GAAGL;IACL,CAAC;EACH;AACF;;AAEA;AACA;AACA","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  import { ComponentType } from "../../../components/enums.js";
2
+ import { HIGHLIGHT_CLASS } from "./constants.js";
2
3
  import { ListQuestion } from "./list.js";
3
4
  import { PreviewComponent } from "./preview.js";
4
5
  export class SelectQuestion extends ListQuestion {
@@ -24,13 +25,14 @@ export class SelectQuestion extends ListQuestion {
24
25
  }
25
26
  }
26
27
  };
28
+ const highlightedClass = this._highlighted ? HIGHLIGHT_CLASS : '';
27
29
  return {
28
30
  id: this._fieldName,
29
31
  name: this._fieldName,
30
32
  hint: this.hint,
31
33
  label: this.label,
32
34
  items: this.list,
33
- classes: this.list.length ? '' : 'govuk-visually-hidden',
35
+ classes: this.list.length ? highlightedClass : 'govuk-visually-hidden',
34
36
  ...afterInput
35
37
  };
36
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["ComponentType","ListQuestion","PreviewComponent","SelectQuestion","_questionTemplate","PATH","_fieldName","componentType","SelectField","list","_getList","renderInput","afterInput","length","formGroup","html","_listElements","afterInputsHTML","id","name","hint","label","items","classes"],"sources":["../../../../../src/form/form-editor/preview/select.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { ListQuestion } from '~/src/form/form-editor/preview/list.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\nexport class SelectQuestion extends ListQuestion {\n _questionTemplate = PreviewComponent.PATH + 'selectfield.njk'\n _fieldName = 'selectInput'\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.SelectField\n\n /**\n * @returns {ListItemReadonly[]}\n */\n get list() {\n return this._getList()\n }\n\n get renderInput() {\n const afterInput =\n /** @type {{ formGroup?: { afterInput: { html: string }} }} */ (\n this.list.length\n ? {}\n : {\n formGroup: {\n afterInput: {\n html: this._listElements.afterInputsHTML\n }\n }\n }\n )\n\n return {\n id: this._fieldName,\n name: this._fieldName,\n hint: this.hint,\n label: this.label,\n items: this.list,\n classes: this.list.length ? '' : 'govuk-visually-hidden',\n ...afterInput\n }\n }\n}\n\n/**\n * @import { ListItemReadonly } from '~/src/form/form-editor/types.js'\n * @import { FormGroupAfterInput } from '~/src/form/form-editor/macros/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,YAAY;AACrB,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,cAAc,SAASF,YAAY,CAAC;EAC/CG,iBAAiB,GAAGF,gBAAgB,CAACG,IAAI,GAAG,iBAAiB;EAC7DC,UAAU,GAAG,aAAa;EAC1B;AACF;AACA;EACEC,aAAa,GAAGP,aAAa,CAACQ,WAAW;;EAEzC;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,QAAQ,CAAC,CAAC;EACxB;EAEA,IAAIC,WAAWA,CAAA,EAAG;IAChB,MAAMC,UAAU,GACd;IACE,IAAI,CAACH,IAAI,CAACI,MAAM,GACZ,CAAC,CAAC,GACF;MACEC,SAAS,EAAE;QACTF,UAAU,EAAE;UACVG,IAAI,EAAE,IAAI,CAACC,aAAa,CAACC;QAC3B;MACF;IACF,CACL;IAEH,OAAO;MACLC,EAAE,EAAE,IAAI,CAACZ,UAAU;MACnBa,IAAI,EAAE,IAAI,CAACb,UAAU;MACrBc,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,KAAK,EAAE,IAAI,CAACb,IAAI;MAChBc,OAAO,EAAE,IAAI,CAACd,IAAI,CAACI,MAAM,GAAG,EAAE,GAAG,uBAAuB;MACxD,GAAGD;IACL,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"select.js","names":["ComponentType","HIGHLIGHT_CLASS","ListQuestion","PreviewComponent","SelectQuestion","_questionTemplate","PATH","_fieldName","componentType","SelectField","list","_getList","renderInput","afterInput","length","formGroup","html","_listElements","afterInputsHTML","highlightedClass","_highlighted","id","name","hint","label","items","classes"],"sources":["../../../../../src/form/form-editor/preview/select.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { ListQuestion } from '~/src/form/form-editor/preview/list.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\nexport class SelectQuestion extends ListQuestion {\n _questionTemplate = PreviewComponent.PATH + 'selectfield.njk'\n _fieldName = 'selectInput'\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.SelectField\n\n /**\n * @returns {ListItemReadonly[]}\n */\n get list() {\n return this._getList()\n }\n\n get renderInput() {\n const afterInput =\n /** @type {{ formGroup?: { afterInput: { html: string }} }} */ (\n this.list.length\n ? {}\n : {\n formGroup: {\n afterInput: {\n html: this._listElements.afterInputsHTML\n }\n }\n }\n )\n\n const highlightedClass = this._highlighted ? HIGHLIGHT_CLASS : ''\n\n return {\n id: this._fieldName,\n name: this._fieldName,\n hint: this.hint,\n label: this.label,\n items: this.list,\n classes: this.list.length ? highlightedClass : 'govuk-visually-hidden',\n ...afterInput\n }\n }\n}\n\n/**\n * @import { ListItemReadonly } from '~/src/form/form-editor/types.js'\n * @import { FormGroupAfterInput } from '~/src/form/form-editor/macros/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,YAAY;AACrB,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,cAAc,SAASF,YAAY,CAAC;EAC/CG,iBAAiB,GAAGF,gBAAgB,CAACG,IAAI,GAAG,iBAAiB;EAC7DC,UAAU,GAAG,aAAa;EAC1B;AACF;AACA;EACEC,aAAa,GAAGR,aAAa,CAACS,WAAW;;EAEzC;AACF;AACA;EACE,IAAIC,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,QAAQ,CAAC,CAAC;EACxB;EAEA,IAAIC,WAAWA,CAAA,EAAG;IAChB,MAAMC,UAAU,GACd;IACE,IAAI,CAACH,IAAI,CAACI,MAAM,GACZ,CAAC,CAAC,GACF;MACEC,SAAS,EAAE;QACTF,UAAU,EAAE;UACVG,IAAI,EAAE,IAAI,CAACC,aAAa,CAACC;QAC3B;MACF;IACF,CACL;IAEH,MAAMC,gBAAgB,GAAG,IAAI,CAACC,YAAY,GAAGnB,eAAe,GAAG,EAAE;IAEjE,OAAO;MACLoB,EAAE,EAAE,IAAI,CAACd,UAAU;MACnBe,IAAI,EAAE,IAAI,CAACf,UAAU;MACrBgB,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,KAAK,EAAE,IAAI,CAACf,IAAI;MAChBgB,OAAO,EAAE,IAAI,CAAChB,IAAI,CAACI,MAAM,GAAGK,gBAAgB,GAAG,uBAAuB;MACtE,GAAGN;IACL,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  import { ComponentType } from "../../../components/enums.js";
2
+ import { HIGHLIGHT_CLASS } from "./constants.js";
2
3
  import { FieldsetQuestion } from "./fieldset-question.js";
3
4
  import { PreviewComponent } from "./preview.js";
4
5
  export class YesNoQuestion extends FieldsetQuestion {
@@ -20,8 +21,10 @@ export class YesNoQuestion extends FieldsetQuestion {
20
21
  /**
21
22
  *
22
23
  */
24
+ const highlightClass = this._highlighted ? ` ${HIGHLIGHT_CLASS}` : '';
23
25
  return {
24
26
  type: 'boolean',
27
+ classes: `govuk-radios--inline${highlightClass}`,
25
28
  items: (/** @type {ListElement[]} */[{
26
29
  id: 'yesNo-yes',
27
30
  text: 'Yes',
@@ -1 +1 @@
1
- {"version":3,"file":"yes-no.js","names":["ComponentType","FieldsetQuestion","PreviewComponent","YesNoQuestion","componentType","YesNoField","_questionTemplate","PATH","_fieldName","customRenderFields","type","items","id","text","value","label","classes"],"sources":["../../../../../src/form/form-editor/preview/yes-no.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { FieldsetQuestion } from '~/src/form/form-editor/preview/fieldset-question.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\nexport class YesNoQuestion extends FieldsetQuestion {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.YesNoField\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'radios.njk'\n _fieldName = 'yesNo'\n\n /**\n * @returns {Partial<QuestionBaseModel>}\n */\n get customRenderFields() {\n /**\n *\n */\n return {\n type: 'boolean',\n items: /** @type {ListElement[]} */ ([\n {\n id: 'yesNo-yes',\n text: 'Yes',\n value: true,\n label: {\n text: 'Yes',\n classes: ''\n }\n },\n {\n id: 'yesNo-no',\n text: 'No',\n value: false,\n label: {\n text: 'No',\n classes: ''\n }\n }\n ])\n }\n }\n}\n\n/**\n * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'\n * @import { ListElement } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,aAAa,SAASF,gBAAgB,CAAC;EAClD;AACF;AACA;EACEG,aAAa,GAAGJ,aAAa,CAACK,UAAU;EACxC;AACF;AACA;AACA;EACEC,iBAAiB,GAAGJ,gBAAgB,CAACK,IAAI,GAAG,YAAY;EACxDC,UAAU,GAAG,OAAO;;EAEpB;AACF;AACA;EACE,IAAIC,kBAAkBA,CAAA,EAAG;IACvB;AACJ;AACA;IACI,OAAO;MACLC,IAAI,EAAE,SAAS;MACfC,KAAK,GAAE,4BAA8B,CACnC;QACEC,EAAE,EAAE,WAAW;QACfC,IAAI,EAAE,KAAK;QACXC,KAAK,EAAE,IAAI;QACXC,KAAK,EAAE;UACLF,IAAI,EAAE,KAAK;UACXG,OAAO,EAAE;QACX;MACF,CAAC,EACD;QACEJ,EAAE,EAAE,UAAU;QACdC,IAAI,EAAE,IAAI;QACVC,KAAK,EAAE,KAAK;QACZC,KAAK,EAAE;UACLF,IAAI,EAAE,IAAI;UACVG,OAAO,EAAE;QACX;MACF,CAAC,CACF;IACH,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"yes-no.js","names":["ComponentType","HIGHLIGHT_CLASS","FieldsetQuestion","PreviewComponent","YesNoQuestion","componentType","YesNoField","_questionTemplate","PATH","_fieldName","customRenderFields","highlightClass","_highlighted","type","classes","items","id","text","value","label"],"sources":["../../../../../src/form/form-editor/preview/yes-no.js"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { HIGHLIGHT_CLASS } from '~/src/form/form-editor/preview/constants.js'\nimport { FieldsetQuestion } from '~/src/form/form-editor/preview/fieldset-question.js'\nimport { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'\n\nexport class YesNoQuestion extends FieldsetQuestion {\n /**\n * @type {ComponentType}\n */\n componentType = ComponentType.YesNoField\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = PreviewComponent.PATH + 'radios.njk'\n _fieldName = 'yesNo'\n\n /**\n * @returns {Partial<QuestionBaseModel>}\n */\n get customRenderFields() {\n /**\n *\n */\n const highlightClass = this._highlighted ? ` ${HIGHLIGHT_CLASS}` : ''\n return {\n type: 'boolean',\n classes: `govuk-radios--inline${highlightClass}`,\n items: /** @type {ListElement[]} */ ([\n {\n id: 'yesNo-yes',\n text: 'Yes',\n value: true,\n label: {\n text: 'Yes',\n classes: ''\n }\n },\n {\n id: 'yesNo-no',\n text: 'No',\n value: false,\n label: {\n text: 'No',\n classes: ''\n }\n }\n ])\n }\n }\n}\n\n/**\n * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'\n * @import { ListElement } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,aAAa,SAASF,gBAAgB,CAAC;EAClD;AACF;AACA;EACEG,aAAa,GAAGL,aAAa,CAACM,UAAU;EACxC;AACF;AACA;AACA;EACEC,iBAAiB,GAAGJ,gBAAgB,CAACK,IAAI,GAAG,YAAY;EACxDC,UAAU,GAAG,OAAO;;EAEpB;AACF;AACA;EACE,IAAIC,kBAAkBA,CAAA,EAAG;IACvB;AACJ;AACA;IACI,MAAMC,cAAc,GAAG,IAAI,CAACC,YAAY,GAAG,IAAIX,eAAe,EAAE,GAAG,EAAE;IACrE,OAAO;MACLY,IAAI,EAAE,SAAS;MACfC,OAAO,EAAE,uBAAuBH,cAAc,EAAE;MAChDI,KAAK,GAAE,4BAA8B,CACnC;QACEC,EAAE,EAAE,WAAW;QACfC,IAAI,EAAE,KAAK;QACXC,KAAK,EAAE,IAAI;QACXC,KAAK,EAAE;UACLF,IAAI,EAAE,KAAK;UACXH,OAAO,EAAE;QACX;MACF,CAAC,EACD;QACEE,EAAE,EAAE,UAAU;QACdC,IAAI,EAAE,IAAI;QACVC,KAAK,EAAE,KAAK;QACZC,KAAK,EAAE;UACLF,IAAI,EAAE,IAAI;UACVH,OAAO,EAAE;QACX;MACF,CAAC,CACF;IACH,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 {\n type ConditionWrapperV2,\n type DateDirections,\n type DateUnits,\n type Item\n} 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 /**\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\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 | '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 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}\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}\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}\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\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 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 /**\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\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 | '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 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}\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}\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}\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\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":"types.js","names":["FormDefinitionErrorType","FormDefinitionError","formDefinitionErrors","UniquePagePath","key","type","Unique","UniquePageId","UniquePageComponentId","UniquePageComponentName","UniqueSectionName","UniqueSectionTitle","UniqueListId","UniqueListTitle","UniqueListName","UniqueConditionDisplayName","UniqueConditionId","UniqueListItemId","UniqueListItemText","UniqueListItemValue","RefPageCondition","Ref","RefConditionComponentId","RefConditionListId","RefConditionItemId","RefConditionConditionId","RefPageComponentList","Other","Type"],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Context } from 'joi'\n\nimport { type ControllerType, type Repeat } from '~/src/index.js'\n\nexport interface PatchPageFields {\n title?: string\n path?: string\n controller?: ControllerType | null\n repeat?: Repeat\n condition?: string | null\n}\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n\n// Enum of error types that can be raised through validating the form definition\nexport enum FormDefinitionErrorType {\n Unique = 'unique', // Unique constraint\n Ref = 'ref', // Referential integrity\n Type = 'type' // General schema type error\n}\n\n// Enum for errors that can exist in a form definition\nexport enum FormDefinitionError {\n UniquePageId = 'unique_page_id',\n UniquePagePath = 'unique_page_path',\n UniquePageComponentId = 'unique_page_component_id',\n UniquePageComponentName = 'unique_page_component_name',\n UniqueSectionName = 'unique_section_name',\n UniqueSectionTitle = 'unique_section_title',\n UniqueListId = 'unique_list_id',\n UniqueListTitle = 'unique_list_title',\n UniqueListName = 'unique_list_name',\n UniqueConditionId = 'unique_condition_id',\n UniqueConditionDisplayName = 'unique_condition_displayname',\n UniqueListItemId = 'unique_list_item_id',\n UniqueListItemText = 'unique_list_item_text',\n UniqueListItemValue = 'unique_list_item_value',\n RefPageCondition = 'ref_page_condition',\n RefConditionComponentId = 'ref_condition_component_id',\n RefConditionListId = 'ref_condition_list_id',\n RefConditionItemId = 'ref_condition_item_id',\n RefConditionConditionId = 'ref_condition_condition_id',\n RefPageComponentList = 'ref_page_component_list',\n Other = 'other'\n}\n\nexport interface ErrorMatchValue {\n key: string\n type: FormDefinitionErrorType\n}\n\nexport type FormDefinitionErrors = Record<FormDefinitionError, ErrorMatchValue>\n\n// The errors that can exist in the form definition\nexport const formDefinitionErrors: FormDefinitionErrors = {\n [FormDefinitionError.UniquePagePath]: {\n key: 'path',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionDisplayName]: {\n key: 'displayName',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemText]: {\n key: 'text',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemValue]: {\n key: 'value',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.RefPageCondition]: {\n key: 'condition',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionComponentId]: {\n key: 'componentId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionListId]: {\n key: 'listId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionItemId]: {\n key: 'itemId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionConditionId]: {\n key: 'conditionId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefPageComponentList]: {\n key: 'list',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.Other]: {\n key: '',\n type: FormDefinitionErrorType.Type\n }\n}\n\nexport type FormDefinitionErrorCauseDetailPath = (string | number)[]\n\nexport interface FormDefinitionErrorCauseDetailUnique {\n path: FormDefinitionErrorCauseDetailPath\n pos: number\n dupePos: number\n}\n\nexport interface FormDefinitionErrorCauseDetailRef {\n path: FormDefinitionErrorCauseDetailPath\n}\n\nexport type FormDefinitionErrorCause =\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Unique\n message: string\n detail: FormDefinitionErrorCauseDetailUnique\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Ref\n message: string\n detail: FormDefinitionErrorCauseDetailRef\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Type\n message: string\n detail: Context | undefined\n }\n"],"mappings":"AAgBA;AACA,WAAYA,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;;AAMnC;AACA,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AA+B/B;AACA,OAAO,MAAMC,oBAA0C,GAAG;EACxD,CAACD,mBAAmB,CAACE,cAAc,GAAG;IACpCC,GAAG,EAAE,MAAM;IACXC,IAAI,EAAEL,uBAAuB,CAACM;EAChC,CAAC;EACD,CAACL,mBAAmB,CAACM,YAAY,GAAG;IAClCH,GAAG,EAAE,IAAI;IACTC,IAAI,EAAEL,uBAAuB,CAACM;EAChC,CAAC;EACD,CAACL,mBAAmB,CAACO,qBAAqB,GAAG;IAC3CJ,GAAG,EAAE,IAAI;IACTC,IAAI,EAAEL,uBAAuB,CAACM;EAChC,CAAC;EACD,CAACL,mBAAmB,CAACQ,uBAAuB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,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACqB,uBAAuB,GAAG;IAC7ClB,GAAG,EAAE,aAAa;IAClBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACsB,kBAAkB,GAAG;IACxCnB,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACuB,kBAAkB,GAAG;IACxCpB,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACwB,uBAAuB,GAAG;IAC7CrB,GAAG,EAAE,aAAa;IAClBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACyB,oBAAoB,GAAG;IAC1CtB,GAAG,EAAE,MAAM;IACXC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAAC0B,KAAK,GAAG;IAC3BvB,GAAG,EAAE,EAAE;IACPC,IAAI,EAAEL,uBAAuB,CAAC4B;EAChC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["FormDefinitionErrorType","FormDefinitionError","formDefinitionErrors","UniquePagePath","key","type","Unique","UniquePageId","UniquePageComponentId","UniquePageComponentName","UniqueSectionName","UniqueSectionTitle","UniqueListId","UniqueListTitle","UniqueListName","UniqueConditionDisplayName","UniqueConditionId","UniqueListItemId","UniqueListItemText","UniqueListItemValue","RefPageCondition","Ref","RefConditionComponentId","RefConditionListId","RefConditionItemId","RefConditionConditionId","RefPageComponentList","Other","Type"],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Context } from 'joi'\n\nimport { type Repeat } from '~/src/form/form-definition/types.js'\nimport { type ControllerType } from '~/src/pages/enums.js'\n\nexport interface PatchPageFields {\n title?: string\n path?: string\n controller?: ControllerType | null\n repeat?: Repeat\n condition?: string | null\n}\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n\n// Enum of error types that can be raised through validating the form definition\nexport enum FormDefinitionErrorType {\n Unique = 'unique', // Unique constraint\n Ref = 'ref', // Referential integrity\n Type = 'type' // General schema type error\n}\n\n// Enum for errors that can exist in a form definition\nexport enum FormDefinitionError {\n UniquePageId = 'unique_page_id',\n UniquePagePath = 'unique_page_path',\n UniquePageComponentId = 'unique_page_component_id',\n UniquePageComponentName = 'unique_page_component_name',\n UniqueSectionName = 'unique_section_name',\n UniqueSectionTitle = 'unique_section_title',\n UniqueListId = 'unique_list_id',\n UniqueListTitle = 'unique_list_title',\n UniqueListName = 'unique_list_name',\n UniqueConditionId = 'unique_condition_id',\n UniqueConditionDisplayName = 'unique_condition_displayname',\n UniqueListItemId = 'unique_list_item_id',\n UniqueListItemText = 'unique_list_item_text',\n UniqueListItemValue = 'unique_list_item_value',\n RefPageCondition = 'ref_page_condition',\n RefConditionComponentId = 'ref_condition_component_id',\n RefConditionListId = 'ref_condition_list_id',\n RefConditionItemId = 'ref_condition_item_id',\n RefConditionConditionId = 'ref_condition_condition_id',\n RefPageComponentList = 'ref_page_component_list',\n Other = 'other'\n}\n\nexport interface ErrorMatchValue {\n key: string\n type: FormDefinitionErrorType\n}\n\nexport type FormDefinitionErrors = Record<FormDefinitionError, ErrorMatchValue>\n\n// The errors that can exist in the form definition\nexport const formDefinitionErrors: FormDefinitionErrors = {\n [FormDefinitionError.UniquePagePath]: {\n key: 'path',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniquePageComponentName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueSectionTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListTitle]: {\n key: 'title',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListName]: {\n key: 'name',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionDisplayName]: {\n key: 'displayName',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueConditionId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemId]: {\n key: 'id',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemText]: {\n key: 'text',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.UniqueListItemValue]: {\n key: 'value',\n type: FormDefinitionErrorType.Unique\n },\n [FormDefinitionError.RefPageCondition]: {\n key: 'condition',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionComponentId]: {\n key: 'componentId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionListId]: {\n key: 'listId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionItemId]: {\n key: 'itemId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefConditionConditionId]: {\n key: 'conditionId',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.RefPageComponentList]: {\n key: 'list',\n type: FormDefinitionErrorType.Ref\n },\n [FormDefinitionError.Other]: {\n key: '',\n type: FormDefinitionErrorType.Type\n }\n}\n\nexport type FormDefinitionErrorCauseDetailPath = (string | number)[]\n\nexport interface FormDefinitionErrorCauseDetailUnique {\n path: FormDefinitionErrorCauseDetailPath\n pos: number\n dupePos: number\n}\n\nexport interface FormDefinitionErrorCauseDetailRef {\n path: FormDefinitionErrorCauseDetailPath\n}\n\nexport type FormDefinitionErrorCause =\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Unique\n message: string\n detail: FormDefinitionErrorCauseDetailUnique\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Ref\n message: string\n detail: FormDefinitionErrorCauseDetailRef\n }\n | {\n id: FormDefinitionError\n type: FormDefinitionErrorType.Type\n message: string\n detail: Context | undefined\n }\n"],"mappings":"AAiBA;AACA,WAAYA,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;;AAMnC;AACA,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AA+B/B;AACA,OAAO,MAAMC,oBAA0C,GAAG;EACxD,CAACD,mBAAmB,CAACE,cAAc,GAAG;IACpCC,GAAG,EAAE,MAAM;IACXC,IAAI,EAAEL,uBAAuB,CAACM;EAChC,CAAC;EACD,CAACL,mBAAmB,CAACM,YAAY,GAAG;IAClCH,GAAG,EAAE,IAAI;IACTC,IAAI,EAAEL,uBAAuB,CAACM;EAChC,CAAC;EACD,CAACL,mBAAmB,CAACO,qBAAqB,GAAG;IAC3CJ,GAAG,EAAE,IAAI;IACTC,IAAI,EAAEL,uBAAuB,CAACM;EAChC,CAAC;EACD,CAACL,mBAAmB,CAACQ,uBAAuB,GAAG;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EAAE,WAAW;IAChBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACqB,uBAAuB,GAAG;IAC7ClB,GAAG,EAAE,aAAa;IAClBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACsB,kBAAkB,GAAG;IACxCnB,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACuB,kBAAkB,GAAG;IACxCpB,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACwB,uBAAuB,GAAG;IAC7CrB,GAAG,EAAE,aAAa;IAClBC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAACyB,oBAAoB,GAAG;IAC1CtB,GAAG,EAAE,MAAM;IACXC,IAAI,EAAEL,uBAAuB,CAACqB;EAChC,CAAC;EACD,CAACpB,mBAAmB,CAAC0B,KAAK,GAAG;IAC3BvB,GAAG,EAAE,EAAE;IACPC,IAAI,EAAEL,uBAAuB,CAAC4B;EAChC;AACF,CAAC","ignoreList":[]}
@@ -4,6 +4,7 @@ export { buildListItem } from "./__stubs__/components.js";
4
4
  export { buildCheckboxComponent } from "./__stubs__/components.js";
5
5
  export { buildRadioComponent } from "./__stubs__/components.js";
6
6
  export { buildAutoCompleteComponent } from "./__stubs__/components.js";
7
+ export { buildNumberFieldComponent } from "./__stubs__/components.js";
7
8
  export { buildFileUploadComponent } from "./__stubs__/components.js";
8
9
  export { buildTextFieldComponent } from "./__stubs__/components.js";
9
10
  export { buildRepeaterPage } from "./__stubs__/pages.js";
@@ -1 +1 @@
1
- {"version":3,"file":"stubs.js","names":["buildList","buildListItem","buildCheckboxComponent","buildRadioComponent","buildAutoCompleteComponent","buildFileUploadComponent","buildTextFieldComponent","buildRepeaterPage","buildFileUploadPage","buildSummaryPage","buildQuestionPage","buildMarkdownComponent","QuestionRendererStub","PageRendererStub","QuestionPreviewElements"],"sources":["../../src/stubs.ts"],"sourcesContent":["export * from '~/src/__stubs__/form-definition.js'\nexport { buildList } from '~/src/__stubs__/components.js'\nexport { buildListItem } from '~/src/__stubs__/components.js'\nexport { buildCheckboxComponent } from '~/src/__stubs__/components.js'\nexport { buildRadioComponent } from '~/src/__stubs__/components.js'\nexport { buildAutoCompleteComponent } from '~/src/__stubs__/components.js'\nexport { buildFileUploadComponent } from '~/src/__stubs__/components.js'\nexport { buildTextFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildRepeaterPage } from '~/src/__stubs__/pages.js'\nexport { buildFileUploadPage } from '~/src/__stubs__/pages.js'\nexport { buildSummaryPage } from '~/src/__stubs__/pages.js'\nexport { buildQuestionPage } from '~/src/__stubs__/pages.js'\nexport { buildMarkdownComponent } from '~/src/__stubs__/components.js'\nexport { QuestionRendererStub } from '~/src/form/form-editor/__stubs__/preview.js'\nexport { PageRendererStub } from '~/src/form/form-editor/__stubs__/preview.js'\nexport { QuestionPreviewElements } from '~/src/form/form-editor/__stubs__/preview.js'\n"],"mappings":"AAAA;AACA,SAASA,SAAS;AAClB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,wBAAwB;AACjC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AACzB,SAASC,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"stubs.js","names":["buildList","buildListItem","buildCheckboxComponent","buildRadioComponent","buildAutoCompleteComponent","buildNumberFieldComponent","buildFileUploadComponent","buildTextFieldComponent","buildRepeaterPage","buildFileUploadPage","buildSummaryPage","buildQuestionPage","buildMarkdownComponent","QuestionRendererStub","PageRendererStub","QuestionPreviewElements"],"sources":["../../src/stubs.ts"],"sourcesContent":["export * from '~/src/__stubs__/form-definition.js'\nexport { buildList } from '~/src/__stubs__/components.js'\nexport { buildListItem } from '~/src/__stubs__/components.js'\nexport { buildCheckboxComponent } from '~/src/__stubs__/components.js'\nexport { buildRadioComponent } from '~/src/__stubs__/components.js'\nexport { buildAutoCompleteComponent } from '~/src/__stubs__/components.js'\nexport { buildNumberFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildFileUploadComponent } from '~/src/__stubs__/components.js'\nexport { buildTextFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildRepeaterPage } from '~/src/__stubs__/pages.js'\nexport { buildFileUploadPage } from '~/src/__stubs__/pages.js'\nexport { buildSummaryPage } from '~/src/__stubs__/pages.js'\nexport { buildQuestionPage } from '~/src/__stubs__/pages.js'\nexport { buildMarkdownComponent } from '~/src/__stubs__/components.js'\nexport { QuestionRendererStub } from '~/src/form/form-editor/__stubs__/preview.js'\nexport { PageRendererStub } from '~/src/form/form-editor/__stubs__/preview.js'\nexport { QuestionPreviewElements } from '~/src/form/form-editor/__stubs__/preview.js'\n"],"mappings":"AAAA;AACA,SAASA,SAAS;AAClB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;AACjC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AACzB,SAASC,uBAAuB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/__stubs__/components.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAA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AM,GACnD,oBAAoB,CAStB"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/__stubs__/components.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,qCAAqC,CAAA;AAE1E;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,GAAE,OAAO,CAAC,kBAAkB,CAAM,GACjD,kBAAkB,CAWpB;AAED,wBAAgB,gCAAgC,CAC9C,yBAAyB,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACnE,2BAA2B,CAU7B;AAED,wBAAgB,wBAAwB,CACtC,iBAAiB,GAAE,OAAO,CAAC,mBAAmB,CAAM,GACnD,mBAAmB,CASrB;AACD,wBAAgB,4BAA4B,CAC1C,qBAAqB,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC3D,uBAAuB,CASzB;AACD,wBAAgB,yBAAyB,CACvC,kBAAkB,GAAE,OAAO,CAAC,oBAAoB,CAAM,GACrD,oBAAoB,CAUtB;AACD,wBAAgB,4BAA4B,CAC1C,qBAAqB,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC3D,uBAAuB,CASzB;AACD,wBAAgB,kCAAkC,CAChD,2BAA2B,GAAE,OAAO,CAAC,6BAA6B,CAAM,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oB,CAStB;AAED,wBAAgB,kBAAkB,CAChC,gBAAgB,GAAE,OAAO,CAAC,uBAAuB,CAAM,GACtD,uBAAuB,CAQzB;AAED,wBAAgB,oBAAoB,CAClC,gBAAgB,GAAE,OAAO,CAAC,oBAAoB,CAAM,GACnD,oBAAoB,CAStB"}
@@ -1,4 +1,4 @@
1
- import { type FormStatus } from '../../index.js';
1
+ import { type FormStatus } from '../../common/enums.js';
2
2
  /**
3
3
  * Search options for querying forms
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CACtB"}
@@ -1,7 +1,7 @@
1
+ import { type FormStatus } from '../common/enums.js';
1
2
  import { type PaginationOptions, type PaginationResult } from '../common/pagination/types.js';
2
3
  import { type SearchOptions } from '../common/search/types.js';
3
4
  import { type SortingOptions } from '../common/sorting/types.js';
4
- import { type FormStatus } from '../index.js';
5
5
  /**
6
6
  * Options for querying results, including pagination, sorting, and searching
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,CAAA;AAE7E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAA;IAEjB;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAA;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,KAAK;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,EAAE,CAAA;IAEb;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;CACX;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,EA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AE7B;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,KAAK;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,EAAE,CAAA;IAEb;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;CACX;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IAED;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
@@ -1,6 +1,6 @@
1
1
  import { type ComponentType } from '../../../components/enums.js';
2
+ import { type DefaultComponent, type GovukFieldset } from '../../../form/form-editor/preview/types.js';
2
3
  import { type DateItem, type GovukField, type ListItemReadonly } from '../../../form/form-editor/types.js';
3
- import { type DefaultComponent, type GovukFieldset } from '../../../index.js';
4
4
  export interface AppPreviewErrorPanelMacroErrorTemplate {
5
5
  advancedSettingsErrors: [];
6
6
  baseErrors: {
@@ -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,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE1E,MAAM,WAAW,sCAAsC;IACrD,sBAAsB,EAAE,EAAE,CAAA;IAC1B,UAAU,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAClD;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,sCAAsC,CAAA;IACtD,YAAY,EAAE;QACZ,WAAW,EAAE,UAAU,EAAE,CAAA;QACzB,cAAc,EAAE,UAAU,EAAE,CAAA;KAC7B,CAAA;IACD,YAAY,EAAE,aAAa,CAAA;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,aAAa,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,sCAAsC,CAAA;IACtD,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,cAAc,EAAE,UAAU,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7B;AACD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9B;AAGD,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,2BAA2B,CAAA;AAEhF,MAAM,WAAW,iBAAiB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,QAAQ,CAAC,UAAU,EAAE,oBAAoB,EAAE,CAAA;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,cAAc,CAAC,EAAE;QACxB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACrB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,OAAO,EAAE;QACP,KAAK,EAAE,oBAAoB,EAAE,CAAA;KAC9B,CAAA;CACF"}
@@ -175,6 +175,10 @@ export class PreviewPageControllerBase implements PagePreviewPanelMacro {
175
175
  * @returns {string}
176
176
  */
177
177
  protected _isHighlighted(field: string): string;
178
+ /**
179
+ * @param {string} questionId
180
+ */
181
+ highlightQuestion(questionId: string): void;
178
182
  #private;
179
183
  }
180
184
  import type { PageOverviewElements } from '../../../../form/form-editor/preview/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"page-controller-base.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller-base.js"],"names":[],"mappings":"AA6BA;;GAEG;AACH;IASE;;OAEG;IACH,kBAFW,IAAI,GAAC,SAAS,EAMxB;IAfD;;;OAGG;IACH,cAEC;IAWD,sBAEC;IAED,uBAUC;IAED,0BAEC;IAED,yCAKC;IAED,2BAEC;CACF;AAED;;;GAGG;AACH;IACE,oBAAoC;IAmEpC;;OAEG;IACH,uBAFU,OAAO,cAAc,CAEO;IA4KtC;;;;OAIG;IACH,qDAFa,QAAQ,CAgB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,0BAFW,MAAM,GAAG,SAAS,EAK5B;IAED,wBAPW,MAAM,GAAG,SAAS,CAS5B;IAuBD,0BAGC;IAED;;OAEG;IACH,iCAFW,cAAc,QAKxB;IAED,uBAKC;IAED;;;;OAIG;IACH,gCAJW,MAAM,GAEJ,MAAM,CAIlB;;CACF;0CAGoH,yCAAyC;0BAGrH,qCAAqC;2CAEd,wCAAwC;8BAJ3E,4CAA4C;;;;sBAzW/D,MAAM;;;;;;yBAlBS,4CAA4C;0CA+XL,wCAAwC;6CALa,yCAAyC;kCAAzC,yCAAyC"}
1
+ {"version":3,"file":"page-controller-base.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller-base.js"],"names":[],"mappings":"AA6BA;;GAEG;AACH;IASE;;OAEG;IACH,kBAFW,IAAI,GAAC,SAAS,EAMxB;IAfD;;;OAGG;IACH,cAEC;IAWD,sBAEC;IAED,uBAUC;IAED,0BAEC;IAED,yCAKC;IAED,2BAEC;CACF;AAED;;;GAGG;AACH;IACE,oBAAoC;IAmEpC;;OAEG;IACH,uBAFU,OAAO,cAAc,CAEO;IA4KtC;;;;OAIG;IACH,qDAFa,QAAQ,CAgBpB;IA5MD;;;OAGG;IACH,sBAHW,uBAAuB,YACvB,YAAY,EAMtB;IAhED;;;OAGG;IACH,yBAHU,MAAM,CAGsD;IACtE;;;OAGG;IACH,uBAFU,QAAQ,EAAE,CAEJ;IAChB;;;OAGG;IACH,sBAHU,OAAO,CAGA;IACjB;;;OAGG;IACH,kBAFU,MAAM,CAEL;IAMX;;;OAGG;IACH,wBAHW,SAAS,GAAG,cAAc,CAGb;IACxB;;;OAGG;IACH,yBAHU,MAAM,CAGE;IAClB;;;OAGG;IACH,yBAHW,MAAM,CAGC;IAClB;;;OAGG;IACH,0BAHU,QAAQ,CAGkD;IACpE;;;OAGG;IACH,8BAHU,QAAQ,CAGsD;IACxE;;;OAGG;IACH,uBAFU,OAAO,CAEE;IAiBnB;;;OAGG;IACH,oCAHa,QAAQ,EAAE,CAWtB;IAED;;;OAGG;IACH,qCAHa,QAAQ,EAAE,CAKtB;IAED;;OAEG;IACH,kBAFa,oBAAoB,EAAE,CAclC;IAED;;;OAGG;IACH,8BAHa,MAAM,CAKlB;IAED,uBAOa,MAAM,EAHlB;IAED;;OAEG;IACH,oBAFa,MAAM,CAIlB;IAED;;;MAKC;IAED;;OAEG;IACH,yBAFW,OAAO,EAKjB;IAED,iBAPW,OAAO,CASjB;IAED;;OAEG;IACH,iBAFa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAO7C;IAED,oBAGC;IAED,sBAGC;IAED,0BAEC;IAED,eAEC;IAED;;;OAGG;IACH,uBAHa,MAAM,CAQlB;IASD;;OAEG;IACH,iBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,aAFa,MAAM,CAIlB;IAUD,uBAEC;IAED;;OAEG;IACH,oBAFa;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS,CAUvD;IAED;;;OAGG;IACH,kCAHa,MAAM,GAAC,SAAS,CAK5B;IAED;;OAEG;IACH,0BAFW,MAAM,GAAG,SAAS,EAK5B;IAED,wBAPW,MAAM,GAAG,SAAS,CAS5B;IAuBD,0BAGC;IAED;;OAEG;IACH,iCAFW,cAAc,QAKxB;IAED,uBAKC;IAED;;;;OAIG;IACH,gCAJW,MAAM,GAEJ,MAAM,CAIlB;IAED;;OAEG;IACH,8BAFW,MAAM,QAWhB;;CACF;0CAGoH,yCAAyC;0BAErI,qCAAqC;2CACE,wCAAwC;8BAF3E,4CAA4C;;;;sBAvX/D,MAAM;;;;;;yBAlBS,4CAA4C;0CA2YL,wCAAwC;6CAHa,yCAAyC;kCAAzC,yCAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller.js"],"names":[],"mappings":"AAiBA;IAyME;;;;;OAKG;IACH,4CAKC;IA5MD;;;;;OAKG;IACH,wBALW,YAAY,EAAE,YACd,oBAAoB,cACpB,cAAc,YACd,YAAY,EAiBtB;IAmCD;;OAEG;IACH,sBAFa,OAAO,CAgBnB;IAED;;;OAGG;IACH,qCAHW,gBAAgB,GACd,iBAAiB,CAgC7B;IAED;;OAEG;IACH,8BAFa,OAAO,CASnB;IAwBD,uCAQC;IAaD;;;kBAUC;IAED,6CAaC;;CAcF;0CAtOyC,mEAAmE;sCA2OxE,2CAA2C;uCAFY,yCAAyC;kCAIjF,2BAA2B;0CAJa,yCAAyC;oCAG5F,qCAAqC;kCAHc,yCAAyC"}
1
+ {"version":3,"file":"page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller.js"],"names":[],"mappings":"AAiBA;IAyME;;;;;OAKG;IACH,4CAKC;IA5MD;;;;;OAKG;IACH,wBALW,YAAY,EAAE,YACd,oBAAoB,cACpB,cAAc,YACd,YAAY,EAiBtB;IAmCD;;OAEG;IACH,sBAFa,OAAO,CAgBnB;IAED;;;OAGG;IACH,qCAHW,gBAAgB,GACd,iBAAiB,CAgC7B;IAED;;OAEG;IACH,8BAFa,OAAO,CASnB;IAwBD,uCAQC;IAaD;;;kBAUC;IAED,6CAaC;;CAcF;0CAtOyC,mEAAmE;sCA2OxE,2CAA2C;uCAFY,yCAAyC;kCAIpG,2BAA2B;0CAJgC,yCAAyC;oCAGlG,qCAAqC;kCAHoB,yCAAyC"}
@@ -0,0 +1,8 @@
1
+ export class ReorderQuestionsPageController extends PreviewPageController {
2
+ /**
3
+ * @param { string | undefined } newOrder
4
+ */
5
+ reorderComponents(newOrder: string | undefined): void;
6
+ }
7
+ import { PreviewPageController } from '../../../../form/form-editor/preview/controller/page-controller.js';
8
+ //# sourceMappingURL=reorder-questions-page-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reorder-questions-page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/reorder-questions-page-controller.js"],"names":[],"mappings":"AAEA;IACE;;OAEG;IACH,4BAFY,MAAM,GAAG,SAAS,QAkB7B;CACF;sCAvBqC,8DAA8D"}
@@ -15,7 +15,7 @@ export class FieldsetQuestion extends Question {
15
15
  text?: string | undefined;
16
16
  formGroup?: import("../macros/types.js").FormGroupAfterInput | undefined;
17
17
  type?: "text" | "number" | "boolean" | undefined;
18
- classes?: string | undefined;
18
+ classes: string;
19
19
  };
20
20
  }
21
21
  import { Question } from '../../../form/form-editor/preview/question.js';
@@ -1 +1 @@
1
- {"version":3,"file":"fieldset-question.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/fieldset-question.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;IAME;;;;;;;;;;;;;MAQC;CACF;yBArBwB,4CAA4C"}
1
+ {"version":3,"file":"fieldset-question.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/fieldset-question.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IAME;;;;;;;;;;;;;MASC;CACF;yBAtBwB,4CAA4C"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AAyDA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CAmCjD;sCAGsD,yCAAyC;oCAGvD,qCAAqC;kCAC1B,2BAA2B;8BAHlD,4CAA4C"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AAwDA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CAwCjD;sCAGsD,yCAAyC;oCAG7D,qCAAqC;kCACvC,2BAA2B;8BAH/B,4CAA4C"}