@ukhomeoffice/cop-react-form-renderer 5.14.0 → 5.14.4

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 (328) hide show
  1. package/dist/components/CheckYourAnswers/Answer.js +15 -15
  2. package/dist/components/CheckYourAnswers/Answer.test.js +94 -128
  3. package/dist/components/CheckYourAnswers/CheckYourAnswers.js +99 -129
  4. package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +291 -501
  5. package/dist/components/CheckYourAnswers/index.js +2 -3
  6. package/dist/components/CollectionPage/CollectionPage.js +64 -58
  7. package/dist/components/CollectionPage/CollectionPage.test.js +212 -238
  8. package/dist/components/CollectionPage/index.js +2 -3
  9. package/dist/components/FormComponent/Collection.js +77 -113
  10. package/dist/components/FormComponent/Collection.test.js +688 -787
  11. package/dist/components/FormComponent/Container.js +44 -43
  12. package/dist/components/FormComponent/Container.test.js +316 -346
  13. package/dist/components/FormComponent/FormComponent.js +58 -64
  14. package/dist/components/FormComponent/FormComponent.test.js +180 -219
  15. package/dist/components/FormComponent/helpers/addLabel.js +5 -9
  16. package/dist/components/FormComponent/helpers/getComponentDisabled.js +2 -3
  17. package/dist/components/FormComponent/helpers/getComponentDisabled.test.js +8 -8
  18. package/dist/components/FormComponent/helpers/getComponentError.js +4 -7
  19. package/dist/components/FormComponent/helpers/getComponentError.test.js +15 -15
  20. package/dist/components/FormComponent/helpers/getComponentFieldSet.js +2 -2
  21. package/dist/components/FormComponent/helpers/getComponentFieldSet.test.js +7 -7
  22. package/dist/components/FormComponent/helpers/index.js +5 -5
  23. package/dist/components/FormComponent/index.js +2 -3
  24. package/dist/components/FormPage/FormPage.js +65 -79
  25. package/dist/components/FormPage/FormPage.test.js +134 -170
  26. package/dist/components/FormPage/index.js +2 -3
  27. package/dist/components/FormRenderer/FormRenderer.js +151 -193
  28. package/dist/components/FormRenderer/FormRenderer.test.js +598 -920
  29. package/dist/components/FormRenderer/handlers/cyaAction.js +4 -5
  30. package/dist/components/FormRenderer/handlers/getPageId.js +2 -5
  31. package/dist/components/FormRenderer/handlers/getPageId.test.js +15 -15
  32. package/dist/components/FormRenderer/handlers/handlers.test.js +33 -33
  33. package/dist/components/FormRenderer/handlers/index.js +3 -4
  34. package/dist/components/FormRenderer/handlers/navigate.js +5 -6
  35. package/dist/components/FormRenderer/handlers/submissionError.js +2 -3
  36. package/dist/components/FormRenderer/helpers/canActionProceed.js +2 -3
  37. package/dist/components/FormRenderer/helpers/canActionProceed.test.js +10 -10
  38. package/dist/components/FormRenderer/helpers/canCYASubmit.js +2 -5
  39. package/dist/components/FormRenderer/helpers/canCYASubmit.test.js +17 -21
  40. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +19 -27
  41. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.test.js +17 -17
  42. package/dist/components/FormRenderer/helpers/getCYA.js +6 -9
  43. package/dist/components/FormRenderer/helpers/getCYA.test.js +12 -12
  44. package/dist/components/FormRenderer/helpers/getFormState.js +7 -10
  45. package/dist/components/FormRenderer/helpers/getFormState.test.js +11 -11
  46. package/dist/components/FormRenderer/helpers/getNextPageId.js +19 -34
  47. package/dist/components/FormRenderer/helpers/getNextPageId.test.js +68 -68
  48. package/dist/components/FormRenderer/helpers/getPage.js +3 -6
  49. package/dist/components/FormRenderer/helpers/getPage.test.js +12 -12
  50. package/dist/components/FormRenderer/helpers/getRelevantPages.js +9 -13
  51. package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +15 -15
  52. package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +12 -13
  53. package/dist/components/FormRenderer/helpers/getSubmissionStatus.test.js +98 -92
  54. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +66 -66
  55. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.test.js +72 -79
  56. package/dist/components/FormRenderer/helpers/index.js +3 -4
  57. package/dist/components/FormRenderer/index.js +2 -3
  58. package/dist/components/FormRenderer/onCYAAction.js +52 -62
  59. package/dist/components/FormRenderer/onCYAAction.test.js +146 -138
  60. package/dist/components/FormRenderer/onPageAction.js +48 -47
  61. package/dist/components/FormRenderer/onPageAction.test.js +219 -205
  62. package/dist/components/FormRenderer/onTaskAction.js +12 -17
  63. package/dist/components/FormRenderer/onTaskAction.test.js +94 -89
  64. package/dist/components/PageActions/ActionButton.js +15 -19
  65. package/dist/components/PageActions/ActionButton.test.js +58 -79
  66. package/dist/components/PageActions/PageActions.js +12 -13
  67. package/dist/components/PageActions/PageActions.test.js +88 -116
  68. package/dist/components/PageActions/index.js +2 -3
  69. package/dist/components/SummaryList/GroupAction.js +15 -23
  70. package/dist/components/SummaryList/GroupAction.test.js +41 -37
  71. package/dist/components/SummaryList/RowAction.js +14 -19
  72. package/dist/components/SummaryList/RowAction.test.js +41 -37
  73. package/dist/components/SummaryList/SummaryList.js +25 -30
  74. package/dist/components/SummaryList/SummaryList.test.js +160 -182
  75. package/dist/components/SummaryList/SummaryListHeadingRow.js +9 -8
  76. package/dist/components/SummaryList/SummaryListRow.js +9 -8
  77. package/dist/components/SummaryList/SummaryListTitleRow.js +8 -7
  78. package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +5 -8
  79. package/dist/components/SummaryList/helpers/getGroupActionAttributes.test.js +24 -24
  80. package/dist/components/SummaryList/helpers/getRowActionAttributes.js +5 -8
  81. package/dist/components/SummaryList/helpers/getRowActionAttributes.test.js +24 -24
  82. package/dist/components/SummaryList/helpers/index.js +2 -2
  83. package/dist/components/SummaryList/index.js +2 -3
  84. package/dist/components/TaskList/Task.js +22 -33
  85. package/dist/components/TaskList/Task.test.js +84 -77
  86. package/dist/components/TaskList/TaskList.js +46 -75
  87. package/dist/components/TaskList/TaskList.test.js +118 -113
  88. package/dist/components/TaskList/TaskState.js +9 -9
  89. package/dist/components/TaskList/TaskState.test.js +56 -49
  90. package/dist/components/TaskList/index.js +2 -3
  91. package/dist/components/index.js +8 -8
  92. package/dist/context/HooksContext/HooksContext.js +59 -85
  93. package/dist/context/HooksContext/HooksContext.test.js +28 -36
  94. package/dist/context/HooksContext/index.js +4 -6
  95. package/dist/context/ValidationContext/ValidationContext.js +35 -76
  96. package/dist/context/ValidationContext/ValidationContext.test.js +50 -61
  97. package/dist/context/ValidationContext/index.js +4 -6
  98. package/dist/context/index.js +3 -3
  99. package/dist/hooks/index.js +10 -11
  100. package/dist/hooks/useAxios.js +17 -43
  101. package/dist/hooks/useGetRequest.js +65 -106
  102. package/dist/hooks/useHooks.js +2 -5
  103. package/dist/hooks/useRefData.js +30 -45
  104. package/dist/hooks/useValidation.js +2 -5
  105. package/dist/index.js +15 -17
  106. package/dist/models/CollectionLabels.js +2 -3
  107. package/dist/models/ComponentTypes.js +25 -26
  108. package/dist/models/EventTypes.js +5 -6
  109. package/dist/models/FormPages.js +5 -6
  110. package/dist/models/FormTypes.js +9 -10
  111. package/dist/models/HubFormats.js +4 -5
  112. package/dist/models/PageAction.js +45 -42
  113. package/dist/models/TaskStates.js +30 -31
  114. package/dist/models/index.js +11 -12
  115. package/dist/setupTests.js +20 -24
  116. package/dist/utils/CheckYourAnswers/getCYAAction.js +6 -7
  117. package/dist/utils/CheckYourAnswers/getCYAAction.test.js +53 -55
  118. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +18 -20
  119. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.test.js +21 -23
  120. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +17 -21
  121. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.test.js +18 -20
  122. package/dist/utils/CheckYourAnswers/getCYARow.js +8 -10
  123. package/dist/utils/CheckYourAnswers/getCYARow.test.js +72 -72
  124. package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +20 -27
  125. package/dist/utils/CheckYourAnswers/getCYARowForGroup.test.js +16 -17
  126. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +41 -47
  127. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.test.js +72 -75
  128. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +71 -78
  129. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.test.js +133 -114
  130. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +27 -23
  131. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.test.js +112 -106
  132. package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +16 -23
  133. package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +77 -83
  134. package/dist/utils/CheckYourAnswers/index.js +3 -4
  135. package/dist/utils/CheckYourAnswers/showComponentCYA.js +7 -9
  136. package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +25 -25
  137. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +9 -16
  138. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.test.js +19 -20
  139. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +4 -8
  140. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.test.js +15 -15
  141. package/dist/utils/CollectionPage/index.js +3 -4
  142. package/dist/utils/CollectionPage/mergeCollectionPages.js +26 -29
  143. package/dist/utils/CollectionPage/mergeCollectionPages.test.js +15 -15
  144. package/dist/utils/Component/addShowWhen.js +5 -10
  145. package/dist/utils/Component/addShowWhen.test.js +38 -38
  146. package/dist/utils/Component/applyToComponentTree.js +20 -22
  147. package/dist/utils/Component/applyToComponentTree.test.js +28 -33
  148. package/dist/utils/Component/cleanAttributes.js +11 -16
  149. package/dist/utils/Component/cleanAttributes.test.js +17 -18
  150. package/dist/utils/Component/elevateNestedComponents.js +7 -9
  151. package/dist/utils/Component/elevateNestedComponents.test.js +19 -19
  152. package/dist/utils/Component/getComponent.js +91 -99
  153. package/dist/utils/Component/getComponentTests/getComponent.autocomplete.test.js +19 -18
  154. package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +51 -63
  155. package/dist/utils/Component/getComponentTests/getComponent.checkboxes.test.js +41 -49
  156. package/dist/utils/Component/getComponentTests/getComponent.date.test.js +33 -37
  157. package/dist/utils/Component/getComponentTests/getComponent.details.test.js +21 -19
  158. package/dist/utils/Component/getComponentTests/getComponent.email.test.js +19 -23
  159. package/dist/utils/Component/getComponentTests/getComponent.file.test.js +23 -27
  160. package/dist/utils/Component/getComponentTests/getComponent.heading.test.js +12 -11
  161. package/dist/utils/Component/getComponentTests/getComponent.html.test.js +18 -16
  162. package/dist/utils/Component/getComponentTests/getComponent.insetText.test.js +10 -9
  163. package/dist/utils/Component/getComponentTests/getComponent.list.test.js +18 -16
  164. package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +24 -27
  165. package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +156 -175
  166. package/dist/utils/Component/getComponentTests/getComponent.paragraph.test.js +18 -16
  167. package/dist/utils/Component/getComponentTests/getComponent.phoneNumber.test.js +19 -23
  168. package/dist/utils/Component/getComponentTests/getComponent.radios.test.js +59 -73
  169. package/dist/utils/Component/getComponentTests/getComponent.select.test.js +19 -23
  170. package/dist/utils/Component/getComponentTests/getComponent.text.test.js +19 -23
  171. package/dist/utils/Component/getComponentTests/getComponent.textArea.test.js +35 -41
  172. package/dist/utils/Component/getComponentTests/getComponent.time.test.js +24 -32
  173. package/dist/utils/Component/getComponentTests/getComponent.unknown.test.js +3 -3
  174. package/dist/utils/Component/getComponentTests/getComponent.warningText.test.js +10 -9
  175. package/dist/utils/Component/getDefaultValue.js +7 -9
  176. package/dist/utils/Component/getDefaultValue.test.js +14 -14
  177. package/dist/utils/Component/index.js +3 -4
  178. package/dist/utils/Component/isEditable.js +3 -7
  179. package/dist/utils/Component/isEditable.test.js +14 -15
  180. package/dist/utils/Component/optionIsSelected.js +2 -3
  181. package/dist/utils/Component/optionIsSelected.test.js +10 -10
  182. package/dist/utils/Component/setupContainerComponentsPath.js +30 -33
  183. package/dist/utils/Component/setupContainerComponentsPath.test.js +16 -16
  184. package/dist/utils/Component/showComponent.js +4 -6
  185. package/dist/utils/Component/showComponent.test.js +29 -29
  186. package/dist/utils/Component/wrapInFormGroup.js +6 -6
  187. package/dist/utils/Condition/index.js +3 -4
  188. package/dist/utils/Condition/meetsAllConditions.js +9 -10
  189. package/dist/utils/Condition/meetsAllConditions.test.js +18 -18
  190. package/dist/utils/Condition/meetsCondition.js +19 -27
  191. package/dist/utils/Condition/meetsCondition.test.js +377 -377
  192. package/dist/utils/Condition/meetsOneCondition.js +7 -8
  193. package/dist/utils/Condition/meetsOneCondition.test.js +17 -17
  194. package/dist/utils/Condition/setupConditions.js +15 -21
  195. package/dist/utils/Condition/setupConditions.test.js +8 -8
  196. package/dist/utils/Container/getEditableComponents.js +5 -8
  197. package/dist/utils/Container/getEditableComponents.test.js +44 -46
  198. package/dist/utils/Container/index.js +3 -4
  199. package/dist/utils/Container/setupNesting.js +17 -24
  200. package/dist/utils/Container/setupNesting.test.js +28 -31
  201. package/dist/utils/Container/showContainer.js +5 -10
  202. package/dist/utils/Container/showContainer.test.js +31 -31
  203. package/dist/utils/Data/applyFormula.js +41 -52
  204. package/dist/utils/Data/applyFormula.test.js +26 -26
  205. package/dist/utils/Data/getAutocompleteSource.js +11 -14
  206. package/dist/utils/Data/getAutocompleteSource.test.js +59 -59
  207. package/dist/utils/Data/getDataPath.js +21 -32
  208. package/dist/utils/Data/getDataPath.test.js +20 -20
  209. package/dist/utils/Data/getOptions.js +22 -28
  210. package/dist/utils/Data/getOptions.test.js +21 -21
  211. package/dist/utils/Data/getSourceData.js +7 -21
  212. package/dist/utils/Data/getSourceData.test.js +85 -81
  213. package/dist/utils/Data/index.js +3 -4
  214. package/dist/utils/Data/refDataToOptions.js +12 -17
  215. package/dist/utils/Data/refDataToOptions.test.js +20 -20
  216. package/dist/utils/Data/setDataItem.js +8 -10
  217. package/dist/utils/Data/setDataItem.test.js +38 -38
  218. package/dist/utils/Data/setupFormData.js +32 -48
  219. package/dist/utils/Data/setupFormData.test.js +99 -98
  220. package/dist/utils/Data/setupRefDataUrlForComponent.js +22 -30
  221. package/dist/utils/Data/setupRefDataUrlForComponent.test.js +28 -28
  222. package/dist/utils/FormPage/applyConditionalProperties.js +7 -12
  223. package/dist/utils/FormPage/applyConditionalProperties.test.js +16 -19
  224. package/dist/utils/FormPage/getFormPage.js +17 -19
  225. package/dist/utils/FormPage/getFormPage.test.js +49 -48
  226. package/dist/utils/FormPage/getFormPages.js +9 -15
  227. package/dist/utils/FormPage/getFormPages.test.js +22 -25
  228. package/dist/utils/FormPage/getPageActions.js +11 -19
  229. package/dist/utils/FormPage/getPageActions.test.js +33 -33
  230. package/dist/utils/FormPage/getParagraphFromText.js +6 -9
  231. package/dist/utils/FormPage/getParagraphFromText.test.js +7 -7
  232. package/dist/utils/FormPage/index.js +3 -4
  233. package/dist/utils/FormPage/showFormPage.js +5 -10
  234. package/dist/utils/FormPage/showFormPage.test.js +33 -33
  235. package/dist/utils/FormPage/showFormPageCYA.js +4 -5
  236. package/dist/utils/FormPage/showFormPageCYA.test.js +9 -9
  237. package/dist/utils/FormPage/useComponent.js +21 -29
  238. package/dist/utils/FormPage/useComponent.test.js +71 -73
  239. package/dist/utils/Format/formatData.js +2 -3
  240. package/dist/utils/Format/formatData.test.js +19 -19
  241. package/dist/utils/Format/formatDataForComponent.js +6 -9
  242. package/dist/utils/Format/formatDataForComponent.test.js +50 -78
  243. package/dist/utils/Format/formatDataForForm.js +7 -10
  244. package/dist/utils/Format/formatDataForForm.test.js +14 -17
  245. package/dist/utils/Format/formatDataForPage.js +4 -7
  246. package/dist/utils/Format/formatDataForPage.test.js +20 -25
  247. package/dist/utils/Format/index.js +3 -4
  248. package/dist/utils/Hub/getFormHub.js +3 -4
  249. package/dist/utils/Hub/getFormHub.test.js +29 -32
  250. package/dist/utils/Hub/index.js +3 -4
  251. package/dist/utils/Meta/constants.js +2 -4
  252. package/dist/utils/Meta/documents/getDocuments.js +2 -6
  253. package/dist/utils/Meta/documents/getDocuments.test.js +25 -17
  254. package/dist/utils/Meta/documents/index.js +3 -4
  255. package/dist/utils/Meta/documents/setDocumentsForField.js +16 -19
  256. package/dist/utils/Meta/documents/setDocumentsForField.test.js +69 -35
  257. package/dist/utils/Meta/index.js +3 -4
  258. package/dist/utils/Operate/checkValueIsTruthy.js +5 -6
  259. package/dist/utils/Operate/checkValueIsTruthy.test.js +17 -17
  260. package/dist/utils/Operate/getFirstOf.js +9 -10
  261. package/dist/utils/Operate/getFirstOf.test.js +33 -33
  262. package/dist/utils/Operate/getIndexOfMatchingValueIn.js +13 -14
  263. package/dist/utils/Operate/getIndexOfMatchingValueIn.test.js +47 -53
  264. package/dist/utils/Operate/index.js +3 -4
  265. package/dist/utils/Operate/persistValueInFormData.js +7 -8
  266. package/dist/utils/Operate/persistValueInFormData.test.js +23 -21
  267. package/dist/utils/Operate/runPageOperations.js +10 -11
  268. package/dist/utils/Operate/runPageOperations.test.js +36 -37
  269. package/dist/utils/Operate/setValueInFormData.js +6 -7
  270. package/dist/utils/Operate/setValueInFormData.test.js +17 -17
  271. package/dist/utils/Operate/shouldRun.js +9 -10
  272. package/dist/utils/Operate/shouldRun.test.js +22 -28
  273. package/dist/utils/Validate/additional/conditionallyRequired.js +5 -7
  274. package/dist/utils/Validate/additional/conditionallyRequired.test.js +19 -19
  275. package/dist/utils/Validate/additional/index.js +8 -9
  276. package/dist/utils/Validate/additional/index.test.js +13 -13
  277. package/dist/utils/Validate/additional/mustBeAfter.js +4 -5
  278. package/dist/utils/Validate/additional/mustBeAfter.test.js +41 -41
  279. package/dist/utils/Validate/additional/mustBeBefore.js +4 -5
  280. package/dist/utils/Validate/additional/mustBeBefore.test.js +29 -29
  281. package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +8 -14
  282. package/dist/utils/Validate/additional/mustBeEarlierDateTime.test.js +34 -38
  283. package/dist/utils/Validate/additional/mustBeGreaterThan.js +3 -4
  284. package/dist/utils/Validate/additional/mustBeGreaterThan.test.js +19 -19
  285. package/dist/utils/Validate/additional/mustBeInTheFuture.js +5 -6
  286. package/dist/utils/Validate/additional/mustBeInTheFuture.test.js +13 -13
  287. package/dist/utils/Validate/additional/mustBeInThePast.js +6 -7
  288. package/dist/utils/Validate/additional/mustBeInThePast.test.js +13 -13
  289. package/dist/utils/Validate/additional/mustBeLessThan.js +3 -4
  290. package/dist/utils/Validate/additional/mustBeLessThan.test.js +18 -18
  291. package/dist/utils/Validate/additional/mustBeLongerThan.js +2 -3
  292. package/dist/utils/Validate/additional/mustBeLongerThan.test.js +17 -17
  293. package/dist/utils/Validate/additional/mustBeNumbersOnly.js +3 -4
  294. package/dist/utils/Validate/additional/mustBeNumbersOnly.test.js +21 -21
  295. package/dist/utils/Validate/additional/mustBeShorterThan.js +2 -3
  296. package/dist/utils/Validate/additional/mustBeShorterThan.test.js +17 -17
  297. package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +4 -7
  298. package/dist/utils/Validate/additional/mustEnterAtLeastOne.test.js +15 -17
  299. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +2 -3
  300. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.test.js +13 -13
  301. package/dist/utils/Validate/additional/mustSelectOnlyOne.js +4 -7
  302. package/dist/utils/Validate/additional/mustSelectOnlyOne.test.js +29 -27
  303. package/dist/utils/Validate/additional/utils.js +9 -25
  304. package/dist/utils/Validate/index.js +3 -4
  305. package/dist/utils/Validate/validateCollection.js +22 -29
  306. package/dist/utils/Validate/validateCollection.test.js +85 -77
  307. package/dist/utils/Validate/validateComponent.js +19 -19
  308. package/dist/utils/Validate/validateComponent.test.js +169 -147
  309. package/dist/utils/Validate/validateContainer.js +16 -22
  310. package/dist/utils/Validate/validateContainer.test.js +52 -48
  311. package/dist/utils/Validate/validateDate.js +14 -21
  312. package/dist/utils/Validate/validateDate.test.js +28 -29
  313. package/dist/utils/Validate/validateEmail.js +8 -11
  314. package/dist/utils/Validate/validateEmail.test.js +26 -26
  315. package/dist/utils/Validate/validateMultifile.js +6 -10
  316. package/dist/utils/Validate/validateMultifile.test.js +17 -18
  317. package/dist/utils/Validate/validatePage.js +20 -22
  318. package/dist/utils/Validate/validatePage.test.js +146 -143
  319. package/dist/utils/Validate/validateRegex.js +6 -10
  320. package/dist/utils/Validate/validateRegex.test.js +17 -17
  321. package/dist/utils/Validate/validateRequired.js +6 -9
  322. package/dist/utils/Validate/validateRequired.test.js +19 -19
  323. package/dist/utils/Validate/validateTextArea.js +6 -9
  324. package/dist/utils/Validate/validateTextArea.test.js +21 -21
  325. package/dist/utils/Validate/validateTime.js +8 -16
  326. package/dist/utils/Validate/validateTime.test.js +15 -15
  327. package/dist/utils/index.js +10 -12
  328. package/package.json +9 -6
@@ -5,12 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _models = require("../../models");
8
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ // Local imports.
9
+
14
10
  /**
15
11
  * Call a callback on a component and all of its child/nested components.
16
12
  * At each stage, the value of the component is set to the returned value
@@ -24,40 +20,43 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
24
20
  * null if root is not valid.
25
21
  * root if callback is not valid.
26
22
  */
27
- var applyToComponentTree = function applyToComponentTree(root, callback) {
28
- var _root$data;
23
+ const applyToComponentTree = (root, callback) => {
29
24
  if (!root) {
30
25
  return null;
31
26
  }
32
27
  if (!callback) {
33
28
  return root;
34
29
  }
35
- var result = _objectSpread({}, root);
30
+ const result = {
31
+ ...root
32
+ };
36
33
  switch (root.type) {
37
34
  case _models.ComponentTypes.CONTAINER:
38
- result.components.forEach(function (c, index, containerArray) {
39
- var array = containerArray;
35
+ result.components.forEach((c, index, containerArray) => {
36
+ const array = containerArray;
40
37
  array[index] = applyToComponentTree(c, callback);
41
38
  });
42
39
  break;
43
40
  case _models.ComponentTypes.COLLECTION:
44
- result.item.forEach(function (c, index, collectionArray) {
45
- var array = collectionArray;
41
+ result.item.forEach((c, index, collectionArray) => {
42
+ const array = collectionArray;
46
43
  array[index] = applyToComponentTree(c, callback);
47
44
  });
48
45
  break;
49
46
  case _models.ComponentTypes.CHECKBOXES:
50
47
  case _models.ComponentTypes.RADIOS:
51
- if (!((_root$data = root.data) !== null && _root$data !== void 0 && _root$data.options)) {
48
+ if (!root.data?.options) {
52
49
  break;
53
50
  }
54
- result.data = _objectSpread({}, root.data);
55
- result.data.options = root.data.options.map(function (option) {
56
- var newOption = _objectSpread({}, option);
51
+ result.data = {
52
+ ...root.data
53
+ };
54
+ result.data.options = root.data.options.map(option => {
55
+ const newOption = {
56
+ ...option
57
+ };
57
58
  if (option.nested) {
58
- newOption.nested = option.nested.map(function (c) {
59
- return applyToComponentTree(c, callback);
60
- });
59
+ newOption.nested = option.nested.map(c => applyToComponentTree(c, callback));
61
60
  }
62
61
  return newOption;
63
62
  });
@@ -67,5 +66,4 @@ var applyToComponentTree = function applyToComponentTree(root, callback) {
67
66
  }
68
67
  return callback(result);
69
68
  };
70
- var _default = applyToComponentTree;
71
- exports.default = _default;
69
+ var _default = exports.default = applyToComponentTree;
@@ -1,19 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _applyToComponentTree = _interopRequireDefault(require("./applyToComponentTree"));
4
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
- describe('utils.Component.applyToComponentTree', function () {
12
- var SINGLE_COMP = {
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
5
+ // Local imports.
6
+
7
+ describe('utils.Component.applyToComponentTree', () => {
8
+ const SINGLE_COMP = {
13
9
  type: 'text',
14
10
  label: 'alpha'
15
11
  };
16
- var CONTAINER = {
12
+ const CONTAINER = {
17
13
  type: 'container',
18
14
  label: 'bravo',
19
15
  components: [{
@@ -21,7 +17,7 @@ describe('utils.Component.applyToComponentTree', function () {
21
17
  label: 'charlie'
22
18
  }]
23
19
  };
24
- var COLLECTION = {
20
+ const COLLECTION = {
25
21
  type: 'collection',
26
22
  label: 'delta',
27
23
  item: [{
@@ -29,7 +25,7 @@ describe('utils.Component.applyToComponentTree', function () {
29
25
  label: 'echo'
30
26
  }]
31
27
  };
32
- var COMP_WITH_NESTED = {
28
+ const COMP_WITH_NESTED = {
33
29
  type: 'radios',
34
30
  label: 'foxtrot',
35
31
  data: {
@@ -46,44 +42,43 @@ describe('utils.Component.applyToComponentTree', function () {
46
42
  }]
47
43
  }
48
44
  };
49
- var CALLBACK = function CALLBACK(component) {
50
- return _objectSpread(_objectSpread({}, component), {}, {
51
- label: component.label.toUpperCase()
52
- });
53
- };
54
- it('should return null when root is undefined', function () {
55
- var result = (0, _applyToComponentTree.default)(undefined, CALLBACK);
45
+ const CALLBACK = component => ({
46
+ ...component,
47
+ label: component.label.toUpperCase()
48
+ });
49
+ it('should return null when root is undefined', () => {
50
+ const result = (0, _applyToComponentTree.default)(undefined, CALLBACK);
56
51
  expect(result).toEqual(null);
57
52
  });
58
- it('should return null when root is null', function () {
59
- var result = (0, _applyToComponentTree.default)(null, CALLBACK);
53
+ it('should return null when root is null', () => {
54
+ const result = (0, _applyToComponentTree.default)(null, CALLBACK);
60
55
  expect(result).toEqual(null);
61
56
  });
62
- it('should return root when callback is undefined', function () {
63
- var result = (0, _applyToComponentTree.default)({
57
+ it('should return root when callback is undefined', () => {
58
+ const result = (0, _applyToComponentTree.default)({
64
59
  type: 'text'
65
60
  }, undefined);
66
61
  expect(result).toEqual({
67
62
  type: 'text'
68
63
  });
69
64
  });
70
- it('should return root when callback is null', function () {
71
- var result = (0, _applyToComponentTree.default)({
65
+ it('should return root when callback is null', () => {
66
+ const result = (0, _applyToComponentTree.default)({
72
67
  type: 'text'
73
68
  }, null);
74
69
  expect(result).toEqual({
75
70
  type: 'text'
76
71
  });
77
72
  });
78
- it('should correctly call callback on a single component', function () {
79
- var result = (0, _applyToComponentTree.default)(SINGLE_COMP, CALLBACK);
73
+ it('should correctly call callback on a single component', () => {
74
+ const result = (0, _applyToComponentTree.default)(SINGLE_COMP, CALLBACK);
80
75
  expect(result).toEqual({
81
76
  type: 'text',
82
77
  label: 'ALPHA'
83
78
  });
84
79
  });
85
- it('should correctly call callback on a container component', function () {
86
- var result = (0, _applyToComponentTree.default)(CONTAINER, CALLBACK);
80
+ it('should correctly call callback on a container component', () => {
81
+ const result = (0, _applyToComponentTree.default)(CONTAINER, CALLBACK);
87
82
  expect(result).toEqual({
88
83
  type: 'container',
89
84
  label: 'BRAVO',
@@ -93,8 +88,8 @@ describe('utils.Component.applyToComponentTree', function () {
93
88
  }]
94
89
  });
95
90
  });
96
- it('should correctly call callback on a collection component', function () {
97
- var result = (0, _applyToComponentTree.default)(COLLECTION, CALLBACK);
91
+ it('should correctly call callback on a collection component', () => {
92
+ const result = (0, _applyToComponentTree.default)(COLLECTION, CALLBACK);
98
93
  expect(result).toEqual({
99
94
  type: 'collection',
100
95
  label: 'DELTA',
@@ -104,8 +99,8 @@ describe('utils.Component.applyToComponentTree', function () {
104
99
  }]
105
100
  });
106
101
  });
107
- it('should correctly call callback on a component with nested components', function () {
108
- var result = (0, _applyToComponentTree.default)(COMP_WITH_NESTED, CALLBACK);
102
+ it('should correctly call callback on a component with nested components', () => {
103
+ const result = (0, _applyToComponentTree.default)(COMP_WITH_NESTED, CALLBACK);
109
104
  expect(result).toEqual({
110
105
  type: 'radios',
111
106
  label: 'FOXTROT',
@@ -4,13 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.JSON_ONLY_PROPERTIES = void 0;
7
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
- var JSON_ONLY_PROPERTIES = ['source', 'use', 'show_when', 'options', 'additionalValidation', 'full_path', 'fullPath', 'formData'];
7
+ const JSON_ONLY_PROPERTIES = exports.JSON_ONLY_PROPERTIES = ['source', 'use', 'show_when', 'options', 'additionalValidation', 'full_path', 'fullPath', 'formData'];
14
8
 
15
9
  /**
16
10
  * This method removes and properties that are entirely specific to the JSON
@@ -23,14 +17,16 @@ var JSON_ONLY_PROPERTIES = ['source', 'use', 'show_when', 'options', 'additional
23
17
  * @param {Array} alsoRemove An array of additional properties to remove.
24
18
  * @returns A clean(er) JSON object.
25
19
  */
26
- exports.JSON_ONLY_PROPERTIES = JSON_ONLY_PROPERTIES;
27
- var cleanAttributes = function cleanAttributes(options) {
28
- var alsoRemove = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
29
- var removeKeys = Array.isArray(alsoRemove) ? [].concat(JSON_ONLY_PROPERTIES, alsoRemove) : JSON_ONLY_PROPERTIES;
30
- if (options && _typeof(options) === 'object') {
31
- return Object.keys(options).reduce(function (obj, key) {
20
+ const cleanAttributes = function (options) {
21
+ let alsoRemove = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
22
+ const removeKeys = Array.isArray(alsoRemove) ? [].concat(JSON_ONLY_PROPERTIES, alsoRemove) : JSON_ONLY_PROPERTIES;
23
+ if (options && typeof options === 'object') {
24
+ return Object.keys(options).reduce((obj, key) => {
32
25
  if (!removeKeys.includes(key)) {
33
- return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, key, options[key]));
26
+ return {
27
+ ...obj,
28
+ [key]: options[key]
29
+ };
34
30
  }
35
31
  ;
36
32
  return obj;
@@ -38,5 +34,4 @@ var cleanAttributes = function cleanAttributes(options) {
38
34
  }
39
35
  return {};
40
36
  };
41
- var _default = cleanAttributes;
42
- exports.default = _default;
37
+ var _default = exports.default = cleanAttributes;
@@ -1,35 +1,34 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  var _cleanAttributes = _interopRequireWildcard(require("./cleanAttributes"));
5
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
6
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
5
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
7
6
  // Local imports
8
7
 
9
- describe('utils', function () {
10
- describe('Component', function () {
11
- describe('clean', function () {
12
- it('should handle null options', function () {
8
+ describe('utils', () => {
9
+ describe('Component', () => {
10
+ describe('clean', () => {
11
+ it('should handle null options', () => {
13
12
  expect((0, _cleanAttributes.default)(null)).toEqual({});
14
13
  });
15
- it('should handle undefined options', function () {
14
+ it('should handle undefined options', () => {
16
15
  expect((0, _cleanAttributes.default)(undefined)).toEqual({});
17
16
  });
18
- it('should handle empty options', function () {
17
+ it('should handle empty options', () => {
19
18
  expect((0, _cleanAttributes.default)({}, null)).toEqual({});
20
19
  });
21
- it('should handle a non-object options', function () {
20
+ it('should handle a non-object options', () => {
22
21
  expect((0, _cleanAttributes.default)(23, null)).toEqual({});
23
22
  });
24
- it('should only remove properties specific to JSON', function () {
25
- var OPTIONS = {
23
+ it('should only remove properties specific to JSON', () => {
24
+ const OPTIONS = {
26
25
  id: 'bob'
27
26
  };
28
27
  // Add a bunch of properties we know will need to be removed.
29
- _cleanAttributes.JSON_ONLY_PROPERTIES.forEach(function (p) {
28
+ _cleanAttributes.JSON_ONLY_PROPERTIES.forEach(p => {
30
29
  OPTIONS[p] = 'value';
31
30
  });
32
- var RESULT = (0, _cleanAttributes.default)(OPTIONS);
31
+ const RESULT = (0, _cleanAttributes.default)(OPTIONS);
33
32
 
34
33
  // The original options should remain untouched.
35
34
  expect(OPTIONS.id).toEqual('bob');
@@ -41,16 +40,16 @@ describe('utils', function () {
41
40
  id: 'bob'
42
41
  });
43
42
  });
44
- it('should also remove properties specified in the alsoRemove parameter', function () {
45
- var OPTIONS = {
43
+ it('should also remove properties specified in the alsoRemove parameter', () => {
44
+ const OPTIONS = {
46
45
  id: 'bob',
47
46
  fieldId: 'bobField'
48
47
  };
49
48
  // Add a bunch of properties we know will need to be removed.
50
- _cleanAttributes.JSON_ONLY_PROPERTIES.forEach(function (p) {
49
+ _cleanAttributes.JSON_ONLY_PROPERTIES.forEach(p => {
51
50
  OPTIONS[p] = 'value';
52
51
  });
53
- var RESULT = (0, _cleanAttributes.default)(OPTIONS, ['fieldId']);
52
+ const RESULT = (0, _cleanAttributes.default)(OPTIONS, ['fieldId']);
54
53
 
55
54
  // The original options should remain untouched.
56
55
  expect(OPTIONS.id).toEqual('bob');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _Data = _interopRequireDefault(require("../Data"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  /**
10
10
  * Iterates over an array of components and brings any nested
11
11
  * components that should be visible into the top level array.
@@ -32,15 +32,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
32
32
  * @returns A new array consisting of components interspersed
33
33
  * with any visible nested components.
34
34
  */
35
- var elevateNestedComponents = function elevateNestedComponents(components, data) {
36
- var allComponents = [];
37
- components === null || components === void 0 ? void 0 : components.forEach(function (component) {
38
- var _component$data, _component$data$optio;
35
+ const elevateNestedComponents = (components, data) => {
36
+ let allComponents = [];
37
+ components?.forEach(component => {
39
38
  allComponents.push(component);
40
- (_component$data = component.data) === null || _component$data === void 0 ? void 0 : (_component$data$optio = _component$data.options) === null || _component$data$optio === void 0 ? void 0 : _component$data$optio.forEach(function (option) {
39
+ component.data?.options?.forEach(option => {
41
40
  // If this option has nested components and is
42
41
  // selected, then add its nested components to the array.
43
- var sourceData = (data === null || data === void 0 ? void 0 : data[component.id]) || _Data.default.getSource(data, component.full_path);
42
+ const sourceData = data?.[component.id] || _Data.default.getSource(data, component.full_path);
44
43
  if (Array.isArray(option.nested) && sourceData === option.value) {
45
44
  allComponents = allComponents.concat(option.nested);
46
45
  }
@@ -48,5 +47,4 @@ var elevateNestedComponents = function elevateNestedComponents(components, data)
48
47
  });
49
48
  return allComponents;
50
49
  };
51
- var _default = elevateNestedComponents;
52
- exports.default = _default;
50
+ var _default = exports.default = elevateNestedComponents;
@@ -1,28 +1,28 @@
1
1
  "use strict";
2
2
 
3
3
  var _elevateNestedComponents = _interopRequireDefault(require("./elevateNestedComponents"));
4
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5
- describe('utils.Component.elevateNestedComponents', function () {
6
- it('should return an empty array if components is undefined', function () {
7
- var DATA = {
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
5
+ describe('utils.Component.elevateNestedComponents', () => {
6
+ it('should return an empty array if components is undefined', () => {
7
+ const DATA = {
8
8
  alpha: 'abc'
9
9
  };
10
10
  expect((0, _elevateNestedComponents.default)(undefined, DATA)).toEqual([]);
11
11
  });
12
- it('should return an empty array if components is null', function () {
13
- var DATA = {
12
+ it('should return an empty array if components is null', () => {
13
+ const DATA = {
14
14
  alpha: 'abc'
15
15
  };
16
16
  expect((0, _elevateNestedComponents.default)(null, DATA)).toEqual([]);
17
17
  });
18
- it('should return an empty array if components is empty', function () {
19
- var DATA = {
18
+ it('should return an empty array if components is empty', () => {
19
+ const DATA = {
20
20
  alpha: 'abc'
21
21
  };
22
22
  expect((0, _elevateNestedComponents.default)([], DATA)).toEqual([]);
23
23
  });
24
- it('should return the original components if none have nested components', function () {
25
- var COMPONENTS = [{
24
+ it('should return the original components if none have nested components', () => {
25
+ const COMPONENTS = [{
26
26
  id: 'textComp'
27
27
  }, {
28
28
  id: 'radiosComp',
@@ -36,13 +36,13 @@ describe('utils.Component.elevateNestedComponents', function () {
36
36
  }]
37
37
  }
38
38
  }];
39
- var DATA = {
39
+ const DATA = {
40
40
  alpha: 'abc'
41
41
  };
42
42
  expect((0, _elevateNestedComponents.default)(COMPONENTS, DATA)).toEqual(COMPONENTS);
43
43
  });
44
- it('should return the original components if data is null', function () {
45
- var COMPONENTS = [{
44
+ it('should return the original components if data is null', () => {
45
+ const COMPONENTS = [{
46
46
  id: 'textComp'
47
47
  }, {
48
48
  id: 'radiosComp',
@@ -58,8 +58,8 @@ describe('utils.Component.elevateNestedComponents', function () {
58
58
  }];
59
59
  expect((0, _elevateNestedComponents.default)(COMPONENTS, null)).toEqual(COMPONENTS);
60
60
  });
61
- it('should return the original array with elevated nested components when they are visible', function () {
62
- var COMPONENTS = [{
61
+ it('should return the original array with elevated nested components when they are visible', () => {
62
+ const COMPONENTS = [{
63
63
  id: 'textComp'
64
64
  }, {
65
65
  id: 'radiosComp',
@@ -78,7 +78,7 @@ describe('utils.Component.elevateNestedComponents', function () {
78
78
  }]
79
79
  }
80
80
  }];
81
- var DATA = {
81
+ const DATA = {
82
82
  radiosComp: 'yes'
83
83
  };
84
84
  expect((0, _elevateNestedComponents.default)(COMPONENTS, DATA)).toEqual([].concat(COMPONENTS, [{
@@ -87,8 +87,8 @@ describe('utils.Component.elevateNestedComponents', function () {
87
87
  id: 'nestedTwo'
88
88
  }]));
89
89
  });
90
- it('should return the original array with elevated nested components when a component has a full_path', function () {
91
- var COMPONENTS = [{
90
+ it('should return the original array with elevated nested components when a component has a full_path', () => {
91
+ const COMPONENTS = [{
92
92
  id: 'textComp'
93
93
  }, {
94
94
  id: 'radiosComp',
@@ -108,7 +108,7 @@ describe('utils.Component.elevateNestedComponents', function () {
108
108
  },
109
109
  full_path: 'component.radiosComp'
110
110
  }];
111
- var DATA = {
111
+ const DATA = {
112
112
  component: {
113
113
  radiosComp: 'yes'
114
114
  }