@wise/dynamic-flow-client 3.5.0-experimental-63c768d → 3.5.1-experimental-ccbce45

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 (345) hide show
  1. package/build/common/errorBoundary/ErrorBoundaryAlert.js +1 -1
  2. package/build/common/httpClientContext/HttpClientContext.js +2 -13
  3. package/build/common/makeHttpClient/makeHttpClient.spec.js +10 -10
  4. package/build/common/messages/external-confirmation.messages.js +5 -5
  5. package/build/common/messages/generic-error.messages.js +4 -4
  6. package/build/common/messages/help.messages.js +2 -2
  7. package/build/common/messages/multi-file-upload.messages.js +4 -4
  8. package/build/common/messages/multi-select.messages.js +2 -2
  9. package/build/common/messages/paragraph.messages.js +3 -3
  10. package/build/common/messages/repeatable.messages.js +5 -5
  11. package/build/common/messages/validation.array.messages.js +3 -3
  12. package/build/common/messages/validation.messages.js +11 -11
  13. package/build/i18n/index.js +1 -1
  14. package/build/legacy/common/constants/DateMode.js +1 -1
  15. package/build/legacy/common/constants/FormControlType.js +1 -1
  16. package/build/legacy/common/constants/MonthFormat.js +1 -1
  17. package/build/legacy/common/constants/Size.js +1 -1
  18. package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +3 -14
  19. package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +3 -1
  20. package/build/legacy/common/contexts/eventsContext/EventsContext.js +2 -2
  21. package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +1 -12
  22. package/build/legacy/common/contexts/featureContext/FeatureContext.js +1 -12
  23. package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +4 -15
  24. package/build/legacy/common/contexts/logContext/LogContext.js +2 -2
  25. package/build/legacy/common/contexts/logContext/LogContext.spec.js +1 -12
  26. package/build/legacy/common/hooks/useExternal/useExternal.spec.js +6 -6
  27. package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +3 -2
  28. package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +1 -1
  29. package/build/legacy/common/hooks/usePolling/usePolling.js +4 -2
  30. package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +5 -3
  31. package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +4 -4
  32. package/build/legacy/common/messages.js +2 -2
  33. package/build/legacy/common/utils/file-utils.spec.js +4 -4
  34. package/build/legacy/common/utils/mobile-utils.spec.js +1 -1
  35. package/build/legacy/common/utils/schema-utils.js +2 -2
  36. package/build/legacy/common/validators/models/model-utils.spec.js +7 -7
  37. package/build/legacy/common/validators/models/model-validators.js +2 -2
  38. package/build/legacy/common/validators/models/model-validators.spec.js +54 -54
  39. package/build/legacy/common/validators/schemas/schema-validators.js +1 -1
  40. package/build/legacy/common/validators/schemas/schema-validators.spec.js +20 -20
  41. package/build/legacy/common/validators/validationFailures/validation-failures.js +2 -2
  42. package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +11 -11
  43. package/build/legacy/dynamicFlow/BackButton.js +2 -2
  44. package/build/legacy/dynamicFlow/DynamicFlow.js +5 -5
  45. package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +7 -7
  46. package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +18 -18
  47. package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +1 -1
  48. package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +1 -1
  49. package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +5 -5
  50. package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +24 -24
  51. package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +10 -21
  52. package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +4 -4
  53. package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +19 -19
  54. package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +18 -18
  55. package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +25 -25
  56. package/build/legacy/dynamicFlow/tests/Actions.spec.js +6 -6
  57. package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +17 -17
  58. package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +6 -6
  59. package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +11 -11
  60. package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +13 -13
  61. package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +48 -48
  62. package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +4 -4
  63. package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +3 -3
  64. package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +24 -24
  65. package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +20 -20
  66. package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +21 -21
  67. package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +24 -24
  68. package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +16 -16
  69. package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +77 -77
  70. package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +19 -19
  71. package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +10 -10
  72. package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +19 -19
  73. package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +46 -46
  74. package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +62 -62
  75. package/build/legacy/dynamicFlow/tests/StepModel.spec.js +6 -6
  76. package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +13 -13
  77. package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +13 -13
  78. package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +4 -4
  79. package/build/legacy/formControl/FormControl.js +9 -9
  80. package/build/legacy/formControl/Select.spec.js +3 -3
  81. package/build/legacy/formControl/utils/getAutocompleteString.js +1 -1
  82. package/build/legacy/formControl/utils/value-utils.js +1 -1
  83. package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +66 -66
  84. package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +1 -1
  85. package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +5 -5
  86. package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +1 -1
  87. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +1 -1
  88. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +6 -17
  89. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +3 -3
  90. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +1 -1
  91. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +7 -7
  92. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +6 -6
  93. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +7 -7
  94. package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +190 -190
  95. package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +8 -19
  96. package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +14 -14
  97. package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +2 -2
  98. package/build/legacy/jsonSchemaForm/help/Help.js +1 -12
  99. package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +4 -4
  100. package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +12 -12
  101. package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +6 -6
  102. package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +1 -1
  103. package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +2 -2
  104. package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +4 -4
  105. package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +2 -2
  106. package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +2 -2
  107. package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +1 -12
  108. package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +1 -1
  109. package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +3 -3
  110. package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +1 -1
  111. package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +3 -3
  112. package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -6
  113. package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +12 -12
  114. package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +10 -10
  115. package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +23 -23
  116. package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +2 -2
  117. package/build/legacy/layout/DynamicLayout.js +1 -1
  118. package/build/legacy/layout/box/DynamicBox.js +2 -13
  119. package/build/legacy/layout/button/DynamicButton.js +1 -12
  120. package/build/legacy/layout/button/DynamicButton.spec.js +13 -24
  121. package/build/legacy/layout/button/utils.js +3 -3
  122. package/build/legacy/layout/button/utils.spec.js +6 -6
  123. package/build/legacy/layout/columns/DynamicColumns.js +4 -15
  124. package/build/legacy/layout/decision/DynamicDecision.js +1 -12
  125. package/build/legacy/layout/external/DynamicExternal.js +1 -1
  126. package/build/legacy/layout/external/DynamicExternal.messages.js +2 -2
  127. package/build/legacy/layout/form/DynamicForm.js +2 -2
  128. package/build/legacy/layout/heading/DynamicHeading.js +8 -19
  129. package/build/legacy/layout/image/DynamicImage.js +5 -4
  130. package/build/legacy/layout/instructions/DynamicInstructions.js +1 -12
  131. package/build/legacy/layout/list/DynamicStatusList.js +3 -3
  132. package/build/legacy/layout/list/DynamicStatusList.spec.js +9 -9
  133. package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +1 -1
  134. package/build/legacy/layout/markdown/DynamicMarkdown.js +2 -13
  135. package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +4 -4
  136. package/build/legacy/layout/modal/DynamicModal.js +2 -2
  137. package/build/legacy/layout/paragraph/DynamicParagraph.js +5 -16
  138. package/build/legacy/layout/review/DynamicReview.js +3 -14
  139. package/build/legacy/layout/review/DynamicReview.spec.js +6 -6
  140. package/build/legacy/layout/search/DynamicSearch.js +2 -13
  141. package/build/legacy/layout/search/SearchInput.js +1 -12
  142. package/build/legacy/layout/search/SearchResults.js +3 -14
  143. package/build/legacy/layout/search/useSearch.js +4 -4
  144. package/build/legacy/layout/utils/getNavigationOptionMedia.js +2 -13
  145. package/build/legacy/step/cameraStep/CameraStep.js +1 -1
  146. package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +6 -6
  147. package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +12 -12
  148. package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.spec.js +13 -13
  149. package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +3 -14
  150. package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +1 -12
  151. package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +2 -2
  152. package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +6 -4
  153. package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +1 -1
  154. package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +6 -6
  155. package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +1 -12
  156. package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +1 -1
  157. package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +7 -7
  158. package/build/legacy/step/layoutStep/LayoutStep.js +1 -1
  159. package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +3 -3
  160. package/build/legacy/step/layoutStep/utils/layout-utils.js +12 -12
  161. package/build/legacy/test-utils/DynamicFlowProviders.js +1 -12
  162. package/build/legacy/test-utils/legacy-utils.js +4 -4
  163. package/build/legacy/test-utils/log-utils.js +1 -1
  164. package/build/revamp/DynamicFlowCore.js +5 -5
  165. package/build/revamp/DynamicFlowWise.js +1 -1
  166. package/build/revamp/DynamicFlowWise.spec.js +11 -11
  167. package/build/revamp/domain/components/AllOfComponent.js +1 -1
  168. package/build/revamp/domain/components/BooleanInputComponent.js +2 -2
  169. package/build/revamp/domain/components/ConstComponent.js +1 -1
  170. package/build/revamp/domain/components/DateInputComponent.js +2 -2
  171. package/build/revamp/domain/components/IntegerInputComponent.js +2 -2
  172. package/build/revamp/domain/components/NumberInputComponent.js +2 -2
  173. package/build/revamp/domain/components/ObjectComponent.js +1 -1
  174. package/build/revamp/domain/components/SelectInputComponent.js +2 -2
  175. package/build/revamp/domain/components/StepDomainComponent.js +1 -1
  176. package/build/revamp/domain/components/TextInputComponent.js +2 -2
  177. package/build/revamp/domain/components/UploadInputComponent.js +1 -1
  178. package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +1 -1
  179. package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +1 -1
  180. package/build/revamp/domain/components/searchComponent/SearchComponent.js +4 -3
  181. package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +13 -13
  182. package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +7 -7
  183. package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +4 -4
  184. package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +1 -1
  185. package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +1 -1
  186. package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +17 -17
  187. package/build/revamp/domain/features/search/getPerformSearchFunction.js +3 -3
  188. package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +18 -18
  189. package/build/revamp/domain/features/summary/summary-utils.js +2 -2
  190. package/build/revamp/domain/features/summary/summary-utils.spec.js +27 -27
  191. package/build/revamp/domain/features/utils/http-utils.js +1 -1
  192. package/build/revamp/domain/features/validation/spec-utils.js +1 -1
  193. package/build/revamp/domain/features/validation/validation-functions.spec.js +4 -4
  194. package/build/revamp/domain/features/validation/value-checks.spec.js +4 -4
  195. package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +4 -3
  196. package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +1 -1
  197. package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +1 -1
  198. package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +1 -1
  199. package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +17 -17
  200. package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +1 -1
  201. package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +1 -1
  202. package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +1 -1
  203. package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +1 -1
  204. package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +1 -1
  205. package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +2 -2
  206. package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +1 -1
  207. package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +1 -1
  208. package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +1 -1
  209. package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +2 -2
  210. package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +2 -2
  211. package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +1 -1
  212. package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +2 -2
  213. package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +1 -1
  214. package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +3 -3
  215. package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +1 -1
  216. package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +1 -1
  217. package/build/revamp/domain/mappers/mapSchemaToComponent.js +1 -1
  218. package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +22 -22
  219. package/build/revamp/domain/mappers/mapStepToComponent.js +3 -3
  220. package/build/revamp/domain/mappers/mapStepToComponent.spec.js +12 -12
  221. package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +1 -1
  222. package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +2 -2
  223. package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +1 -1
  224. package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +2 -2
  225. package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +1 -1
  226. package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +1 -1
  227. package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +1 -1
  228. package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +21 -21
  229. package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +4 -4
  230. package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +48 -48
  231. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +21 -21
  232. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +1 -1
  233. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +1 -1
  234. package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +1 -1
  235. package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +1 -1
  236. package/build/revamp/domain/mappers/utils/getAutocompleteString.js +1 -1
  237. package/build/revamp/domain/mappers/utils/legacy-utils.js +2 -2
  238. package/build/revamp/flow/executeRefresh.js +2 -2
  239. package/build/revamp/flow/executeSubmission.js +1 -1
  240. package/build/revamp/renderers/CoreContainerRenderer.js +1 -1
  241. package/build/revamp/renderers/getRenderFunction.js +3 -3
  242. package/build/revamp/renderers/getSchemaErrorMessageFunction.js +12 -12
  243. package/build/revamp/renderers/mappers/allOfComponentToProps.js +1 -1
  244. package/build/revamp/renderers/mappers/buttonComponentToProps.js +1 -1
  245. package/build/revamp/renderers/mappers/containerComponentToProps.js +1 -1
  246. package/build/revamp/renderers/mappers/headingComponentToProps.js +1 -1
  247. package/build/revamp/renderers/mappers/hiddenComponentToProps.js +1 -1
  248. package/build/revamp/renderers/mappers/imageComponentToProps.js +1 -1
  249. package/build/revamp/renderers/mappers/instructionsComponentToProps.js +1 -1
  250. package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +1 -1
  251. package/build/revamp/renderers/mappers/markdownComponentToProps.js +1 -1
  252. package/build/revamp/renderers/mappers/modalComponentToProps.js +1 -1
  253. package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +1 -1
  254. package/build/revamp/renderers/mappers/objectComponentToProps.js +1 -1
  255. package/build/revamp/renderers/mappers/paragraphComponentToProps.js +1 -1
  256. package/build/revamp/renderers/mappers/repeatableComponentToProps.js +2 -2
  257. package/build/revamp/renderers/mappers/reviewComponentToProps.js +1 -1
  258. package/build/revamp/renderers/mappers/searchComponentToProps.js +2 -2
  259. package/build/revamp/renderers/mappers/statusListComponentToProps.js +1 -1
  260. package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +1 -1
  261. package/build/revamp/renderers/step/ExternalConfirmationDialog.js +2 -13
  262. package/build/revamp/renderers/step/StepRenderer.js +2 -13
  263. package/build/revamp/renderers/stepComponentToProps.js +1 -1
  264. package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +53 -53
  265. package/build/revamp/stories/dev-tools/EditableStep.story.js +7 -7
  266. package/build/revamp/stories/dev-tools/ErrorHandling.story.js +17 -17
  267. package/build/revamp/stories/dev-tools/External.story.js +6 -6
  268. package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +14 -14
  269. package/build/revamp/stories/dev-tools/PersistAsync.story.js +16 -16
  270. package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +41 -41
  271. package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +210 -210
  272. package/build/revamp/stories/dev-tools/ServerTest.story.js +4 -4
  273. package/build/revamp/stories/dev-tools/Upload.story.js +18 -18
  274. package/build/revamp/stories/dev-tools/ValidationAsync.story.js +18 -18
  275. package/build/revamp/stories/examples/ObjectConst.story.js +25 -25
  276. package/build/revamp/stories/examples/OneOfInitialisation.story.js +10 -10
  277. package/build/revamp/stories/utils/fixtureHttpClient.js +1 -1
  278. package/build/revamp/stories/utils/mockSearchHandler.js +8 -8
  279. package/build/revamp/stories/visual-tests/VisualTests.story.js +1 -1
  280. package/build/revamp/test-utils/step-utils.js +1 -1
  281. package/build/revamp/tests/ImageRenderer.spec.js +3 -3
  282. package/build/revamp/tests/InitialAction.spec.js +9 -9
  283. package/build/revamp/tests/InitialStep.spec.js +3 -3
  284. package/build/revamp/tests/Logging.spec.js +5 -5
  285. package/build/revamp/tests/OneOfInitialisation.spec.js +73 -73
  286. package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +19 -19
  287. package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +57 -57
  288. package/build/revamp/tests/RefreshOnChangePreserve.spec.js +13 -13
  289. package/build/revamp/tests/Submission.ResponseHandling.spec.js +38 -38
  290. package/build/revamp/tests/Submission.spec.js +23 -23
  291. package/build/revamp/tests/legacy/HiddenSchemas.spec.js +24 -24
  292. package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +27 -27
  293. package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +18 -18
  294. package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +8 -8
  295. package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +15 -14
  296. package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +50 -50
  297. package/build/revamp/tests/legacy/ValidationAsync.spec.js +14 -14
  298. package/build/revamp/tests/legacy/useExternal.spec.js +6 -6
  299. package/build/revamp/utils/component-utils.spec.js +43 -43
  300. package/build/revamp/utils/findComponent.spec.js +14 -14
  301. package/build/revamp/utils/type-utils.js +1 -1
  302. package/build/revamp/wise/renderers/AlertRenderer.js +1 -1
  303. package/build/revamp/wise/renderers/BooleanInputRenderer.js +2 -2
  304. package/build/revamp/wise/renderers/BoxRenderer.js +4 -15
  305. package/build/revamp/wise/renderers/ButtonRenderer.js +2 -13
  306. package/build/revamp/wise/renderers/ColumnsRenderer.js +4 -15
  307. package/build/revamp/wise/renderers/DateInputRenderer.js +2 -2
  308. package/build/revamp/wise/renderers/DecisionRenderer.js +3 -14
  309. package/build/revamp/wise/renderers/DividerRenderer.js +1 -1
  310. package/build/revamp/wise/renderers/FormRenderer.js +2 -13
  311. package/build/revamp/wise/renderers/FormSectionRenderer.js +1 -1
  312. package/build/revamp/wise/renderers/HeadingRenderer.js +7 -7
  313. package/build/revamp/wise/renderers/ImageRenderer.js +5 -4
  314. package/build/revamp/wise/renderers/InstructionsRenderer.js +2 -13
  315. package/build/revamp/wise/renderers/IntegerInputRenderer.js +3 -3
  316. package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +1 -1
  317. package/build/revamp/wise/renderers/MarkdownRenderer.js +2 -13
  318. package/build/revamp/wise/renderers/ModalRenderer.js +2 -2
  319. package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +3 -14
  320. package/build/revamp/wise/renderers/NumberInputRenderer.js +3 -3
  321. package/build/revamp/wise/renderers/ParagraphRenderer.js +5 -4
  322. package/build/revamp/wise/renderers/RepeatableRenderer.js +5 -5
  323. package/build/revamp/wise/renderers/ReviewRenderer.js +5 -16
  324. package/build/revamp/wise/renderers/SearchRenderer.js +5 -5
  325. package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +2 -13
  326. package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +3 -14
  327. package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +1 -1
  328. package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +4 -4
  329. package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +2 -13
  330. package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +3 -14
  331. package/build/revamp/wise/renderers/StatusListRenderer.js +3 -14
  332. package/build/revamp/wise/renderers/TextInputRenderer.js +2 -2
  333. package/build/revamp/wise/renderers/UploadInputRenderer.js +6 -6
  334. package/build/revamp/wise/renderers/components/FieldInput.js +1 -12
  335. package/build/revamp/wise/renderers/components/Help.js +1 -12
  336. package/build/revamp/wise/renderers/components/UploadFieldInput.js +3 -14
  337. package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +2 -13
  338. package/build/test-utils/NeptuneProviders.js +1 -1
  339. package/build/types/common/messages/multi-file-upload.messages.d.ts +9 -9
  340. package/build/types/legacy/common/utils/mobile-utils.d.ts +1 -1
  341. package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +6 -6
  342. package/build/types/legacy/layout/external/DynamicExternal.messages.d.ts +3 -3
  343. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
  344. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
  345. package/package.json +3 -3
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
2
  import classNames from 'classnames';
14
3
  import { useEffect, useMemo, useState } from 'react';
@@ -22,7 +11,7 @@ var isNullish = function (value) {
22
11
  return isNull(value) || isUndefined(value);
23
12
  };
24
13
  var getDefaultValue = function (schema) {
25
- return schema.type === 'boolean' && isNullish(schema["default"]) ? false : schema["default"];
14
+ return schema.type === 'boolean' && isNullish(schema.default) ? false : schema.default;
26
15
  };
27
16
  var BasicTypeSchema = function (props) {
28
17
  var _a, _b, _c;
@@ -46,7 +35,7 @@ var BasicTypeSchema = function (props) {
46
35
  triggerModel: broadcastModel,
47
36
  lastTriggerModel: lastModel,
48
37
  type: type,
49
- metadata: metadata
38
+ metadata: metadata,
50
39
  });
51
40
  }
52
41
  };
@@ -74,14 +63,14 @@ var BasicTypeSchema = function (props) {
74
63
  if (isNullish(model) && !isNullish(defaultValue)) {
75
64
  setModelAndBroadcast(defaultValue, 'init');
76
65
  }
77
- if (props.schema["const"]) {
78
- setModelAndBroadcast(props.schema["const"], 'init');
66
+ if (props.schema.const) {
67
+ setModelAndBroadcast(props.schema.const, 'init');
79
68
  }
80
69
  };
81
70
  var refreshValidations = function () {
82
71
  setValidations(getValidationKeys(model));
83
72
  };
84
- var isConst = props.schema["const"];
73
+ var isConst = props.schema.const;
85
74
  var isHidden = props.schema.hidden || isConst;
86
75
  useEffect(refreshValidations, [props.model, props.submitted]);
87
76
  useEffect(onSchemaChange, [props.schema]);
@@ -96,16 +85,16 @@ var BasicTypeSchema = function (props) {
96
85
  'form-group': true,
97
86
  'has-error': ((props.submitted || !changed) && !!props.errors) ||
98
87
  ((props.submitted || (changed && blurred)) && !!validations.length),
99
- 'has-info': !!props.schema.description || !!props.infoMessage
88
+ 'has-info': !!props.schema.description || !!props.infoMessage,
100
89
  };
101
90
  var showLabel = props.schema.format !== 'file' && props.schema.type !== 'boolean';
102
91
  var schemaHelp = props.schema.help;
103
92
  var feedbackId = "".concat(id, "-feedback");
104
- return !isHidden ? (_jsxs(_Fragment, { children: [props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsxs("div", __assign({ className: classNames(formGroupClasses) }, { children: [showLabel && (_jsxs("div", __assign({ className: "d-inline-block m-b-1" }, { children: [_jsx("label", __assign({ className: "control-label d-inline", htmlFor: id }, { children: props.schema.title })), !!schemaHelp && _jsx(Help, { help: schemaHelp })] }))), !showLabel && !!schemaHelp && _jsx(Help, { help: schemaHelp }), _jsx(SchemaFormControl, { id: id, schema: props.schema, value: model, disabled: !!props.disabled, onChange: onChange, onFocus: onFocus, onBlur: onBlur, describedBy: feedbackId }), _jsx(ControlFeedback, { id: feedbackId, changed: changed, focused: focused, blurred: blurred, submitted: props.submitted, errors: (_c = props.errors) !== null && _c !== void 0 ? _c : null, schema: props.schema, validations: validations, infoMessage: props.infoMessage })] }))] })) : null;
93
+ return !isHidden ? (_jsxs(_Fragment, { children: [props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsxs("div", { className: classNames(formGroupClasses), children: [showLabel && (_jsxs("div", { className: "d-inline-block m-b-1", children: [_jsx("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }), !!schemaHelp && _jsx(Help, { help: schemaHelp })] })), !showLabel && !!schemaHelp && _jsx(Help, { help: schemaHelp }), _jsx(SchemaFormControl, { id: id, schema: props.schema, value: model, disabled: !!props.disabled, onChange: onChange, onFocus: onFocus, onBlur: onBlur, describedBy: feedbackId }), _jsx(ControlFeedback, { id: feedbackId, changed: changed, focused: focused, blurred: blurred, submitted: props.submitted, errors: (_c = props.errors) !== null && _c !== void 0 ? _c : null, schema: props.schema, validations: validations, infoMessage: props.infoMessage })] })] })) : null;
105
94
  };
106
95
  BasicTypeSchema.defaultProps = {
107
96
  required: false,
108
97
  disabled: false,
109
- onBlur: null
98
+ onBlur: null,
110
99
  };
111
100
  export default BasicTypeSchema;
@@ -25,13 +25,13 @@ function ControlFeedback(props) {
25
25
  Boolean((_a = props.validations) === null || _a === void 0 ? void 0 : _a.length);
26
26
  var isDescriptionVisible = props.schema.description && !isErrorVisible && !isValidationVisible;
27
27
  var hasInfoMessage = Boolean(props.infoMessage);
28
- return (_jsxs("div", __assign({ id: props.id }, { children: [isErrorVisible ? _jsx(InlineAlert, __assign({ type: "error" }, { children: props.errors })) : null, isValidationVisible ? (_jsx(InlineAlert, __assign({ type: "error" }, { children: props.validations.map(function (validation) { return (_jsx("div", { children: validationMessages[validation] }, validation)); }) }))) : null, (isDescriptionVisible || hasInfoMessage) && (_jsxs(InlineAlert, __assign({ type: "info" }, { children: [isDescriptionVisible && _jsx("div", { children: props.schema.description }), hasInfoMessage && _jsx("div", { children: props.infoMessage })] })))] })));
28
+ return (_jsxs("div", { id: props.id, children: [isErrorVisible ? _jsx(InlineAlert, { type: "error", children: props.errors }) : null, isValidationVisible ? (_jsx(InlineAlert, { type: "error", children: props.validations.map(function (validation) { return (_jsx("div", { children: validationMessages[validation] }, validation)); }) })) : null, (isDescriptionVisible || hasInfoMessage) && (_jsxs(InlineAlert, { type: "info", children: [isDescriptionVisible && _jsx("div", { children: props.schema.description }), hasInfoMessage && _jsx("div", { children: props.infoMessage })] }))] }));
29
29
  }
30
30
  ControlFeedback.defaultProps = {
31
31
  errors: '',
32
32
  validations: [],
33
33
  validationMessages: {},
34
- validationAsyncSuccessMessage: null
34
+ validationAsyncSuccessMessage: null,
35
35
  };
36
36
  // TODO: avoid typre assertions in this function
37
37
  function useDefaultValidationMessages(schema) {
@@ -39,25 +39,25 @@ function useDefaultValidationMessages(schema) {
39
39
  var formattedMessages = {
40
40
  type: formatMessage(controlFeedbackMessages.type),
41
41
  minimum: formatMessage(controlFeedbackMessages.minimum, {
42
- minimum: schema.minimum
42
+ minimum: schema.minimum,
43
43
  }),
44
44
  maximum: formatMessage(controlFeedbackMessages.maximum, {
45
- maximum: schema.maximum
45
+ maximum: schema.maximum,
46
46
  }),
47
47
  minLength: formatMessage(controlFeedbackMessages.minLength, {
48
- minLength: schema.minLength
48
+ minLength: schema.minLength,
49
49
  }),
50
50
  maxLength: formatMessage(controlFeedbackMessages.maxLength, {
51
- maxLength: schema.maxLength
51
+ maxLength: schema.maxLength,
52
52
  }),
53
53
  minItems: formatMessage(validationArrayMessages.minItemsError, {
54
- minItems: schema.minItems
54
+ minItems: schema.minItems,
55
55
  }),
56
56
  maxItems: formatMessage(validationArrayMessages.maxItemsError, {
57
- maxItems: schema.maxItems
57
+ maxItems: schema.maxItems,
58
58
  }),
59
59
  pattern: formatMessage(controlFeedbackMessages.pattern),
60
- required: formatMessage(controlFeedbackMessages.required)
60
+ required: formatMessage(controlFeedbackMessages.required),
61
61
  };
62
62
  if (schema.format === 'date') {
63
63
  var dateOverrides = {
@@ -66,18 +66,18 @@ function useDefaultValidationMessages(schema) {
66
66
  ? formatMessage(controlFeedbackMessages.minimumDate, {
67
67
  minimum: formatDate(new Date(schema.minimum), locale, {
68
68
  timeZone: 'UTC',
69
- dateStyle: 'long'
70
- })
69
+ dateStyle: 'long',
70
+ }),
71
71
  })
72
72
  : undefined,
73
73
  maximum: schema.maximum
74
74
  ? formatMessage(controlFeedbackMessages.maximumDate, {
75
75
  maximum: formatDate(new Date(schema.maximum), locale, {
76
76
  timeZone: 'UTC',
77
- dateStyle: 'long'
78
- })
77
+ dateStyle: 'long',
78
+ }),
79
79
  })
80
- : undefined
80
+ : undefined,
81
81
  };
82
82
  return __assign(__assign({}, formattedMessages), dateOverrides);
83
83
  }
@@ -25,13 +25,13 @@ describe('GenericSchema', function () {
25
25
  errors: null,
26
26
  submitted: false,
27
27
  onChange: jest.fn(),
28
- onPersistAsync: jest.fn()
28
+ onPersistAsync: jest.fn(),
29
29
  }); };
30
30
  describe('when an invalid schema-model combination is supplied', function () {
31
31
  var getSchema = function () { return ({
32
32
  $id: 'id',
33
33
  type: 'string',
34
- title: 'String Schema A'
34
+ title: 'String Schema A',
35
35
  }); };
36
36
  var getModel = function () { return ({ name: 'Bob' }); };
37
37
  it('logs an error', function () {
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import { Markdown, Info } from '@transferwise/components';
14
3
  import { useIntl } from 'react-intl';
15
4
  import helpMessages from '../../../common/messages/help.messages';
16
5
  function Help(props) {
17
6
  var intl = useIntl();
18
- return (_jsx(Info, { className: "m-l-1", content: _jsx(Markdown, __assign({ config: { link: { target: '_blank' } } }, { children: props.help.markdown })), presentation: "POPOVER", size: "sm", "aria-label": intl.formatMessage(helpMessages.helpAria) }));
7
+ return (_jsx(Info, { className: "m-l-1", content: _jsx(Markdown, { config: { link: { target: '_blank' } }, children: props.help.markdown }), presentation: "POPOVER", size: "sm", "aria-label": intl.formatMessage(helpMessages.helpAria) }));
19
8
  }
20
9
  export default Help;
@@ -29,7 +29,7 @@ import GenericSchema from '../genericSchema';
29
29
  var getSchemaColumnClasses = function (width) { return ({
30
30
  'col-xs-12': true,
31
31
  'col-sm-6': width === 'md',
32
- 'col-sm-4': width === 'sm'
32
+ 'col-sm-4': width === 'sm',
33
33
  }); };
34
34
  function ObjectSchema(props) {
35
35
  var _a = useState(function () { return (__assign({}, getValidObjectModelParts(props.model, props.schema))); }), model = _a[0], setModel = _a[1];
@@ -56,7 +56,7 @@ function ObjectSchema(props) {
56
56
  props.onChange({
57
57
  model: newModel,
58
58
  triggerSchema: props.schema,
59
- triggerModel: newModel
59
+ triggerModel: newModel,
60
60
  });
61
61
  }
62
62
  }, [props.schema]);
@@ -68,10 +68,10 @@ function ObjectSchema(props) {
68
68
  var orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
69
69
  // TODO: LOW avoid type assertion -- what happens when props.errors is not an object?
70
70
  var propsErrors = props.errors;
71
- return (_jsxs(_Fragment, { children: [props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsxs("fieldset", { children: [props.schema.title && !props.hideTitle && (_jsx(Header, { title: props.schema.title, as: "legend" })), props.schema.description && !props.hideTitle && _jsxs("p", { children: [" ", props.schema.description, " "] }), _jsx("div", __assign({ className: "row" }, { children: orderedPropertyNames.map(function (propertyName) { return (_jsx("div", __assign({ className: classNames(getSchemaColumnClasses(props.schema.properties[propertyName].width)) }, { children: _jsx(GenericSchema, { schema: props.schema.properties[propertyName], model: props.model && props.model[propertyName], errors: propsErrors === null || propsErrors === void 0 ? void 0 : propsErrors[propertyName], submitted: props.submitted, required: isRequired(propertyName), disabled: props.disabled, onChange: function (onChangeProps) { return onChangeProperty(propertyName, onChangeProps); }, onPersistAsync: props.onPersistAsync }) }), propertyName)); }) }))] })] }));
71
+ return (_jsxs(_Fragment, { children: [props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsxs("fieldset", { children: [props.schema.title && !props.hideTitle && (_jsx(Header, { title: props.schema.title, as: "legend" })), props.schema.description && !props.hideTitle && _jsxs("p", { children: [" ", props.schema.description, " "] }), _jsx("div", { className: "row", children: orderedPropertyNames.map(function (propertyName) { return (_jsx("div", { className: classNames(getSchemaColumnClasses(props.schema.properties[propertyName].width)), children: _jsx(GenericSchema, { schema: props.schema.properties[propertyName], model: props.model && props.model[propertyName], errors: propsErrors === null || propsErrors === void 0 ? void 0 : propsErrors[propertyName], submitted: props.submitted, required: isRequired(propertyName), disabled: props.disabled, onChange: function (onChangeProps) { return onChangeProperty(propertyName, onChangeProps); }, onPersistAsync: props.onPersistAsync }) }, propertyName)); }) })] })] }));
72
72
  }
73
73
  ObjectSchema.defaultProps = {
74
74
  hideTitle: false,
75
- disabled: false
75
+ disabled: false,
76
76
  };
77
77
  export default ObjectSchema;
@@ -44,13 +44,13 @@ function OneOfSchema(props) {
44
44
  var onSearchChange = function (searchValue) {
45
45
  debouncedTrackEvent('Dynamic Flow - OneOf Searched', {
46
46
  oneOfId: props.schema.analyticsId,
47
- searchValueLength: searchValue.length
47
+ searchValueLength: searchValue.length,
48
48
  });
49
49
  };
50
50
  // When the schema we receive from parent changes
51
51
  useEffect(function () {
52
52
  var modelIndex = getValidIndexFromValue(props.schema, props.model);
53
- var defaultIndex = getValidIndexFromValue(props.schema, props.schema["default"]);
53
+ var defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
54
54
  if (modelIndex === -1 && defaultIndex >= 0) {
55
55
  onChooseNewSchema(defaultIndex, 'init');
56
56
  }
@@ -78,13 +78,13 @@ function OneOfSchema(props) {
78
78
  var newSchema = props.schema.oneOf[index];
79
79
  if (isConstSchema(newSchema)) {
80
80
  // If new schema is a const we want to share the parent schema, not the const
81
- var model = newSchema["const"];
81
+ var model = newSchema.const;
82
82
  props.onChange({
83
83
  model: model,
84
84
  triggerSchema: props.schema,
85
85
  triggerModel: model,
86
86
  type: type,
87
- metadata: metadata
87
+ metadata: metadata,
88
88
  });
89
89
  }
90
90
  else {
@@ -93,13 +93,13 @@ function OneOfSchema(props) {
93
93
  triggerSchema: newSchema,
94
94
  triggerModel: models[index],
95
95
  type: type,
96
- metadata: metadata
96
+ metadata: metadata,
97
97
  });
98
98
  }
99
99
  if (type !== 'init' && props.schema.analyticsId) {
100
100
  onEvent('Dynamic Flow - OneOf Selected', {
101
101
  oneOfId: props.schema.analyticsId,
102
- schemaId: newSchema === null || newSchema === void 0 ? void 0 : newSchema.analyticsId
102
+ schemaId: newSchema === null || newSchema === void 0 ? void 0 : newSchema.analyticsId,
103
103
  });
104
104
  }
105
105
  };
@@ -108,21 +108,21 @@ function OneOfSchema(props) {
108
108
  var formGroupClasses = {
109
109
  'form-group': true,
110
110
  'has-error': (!changed && props.errors && !isEmpty(props.errors)) ||
111
- ((props.submitted || (changed && blurred)) && validations.length)
111
+ ((props.submitted || (changed && blurred)) && validations.length),
112
112
  };
113
113
  var feedbackId = "".concat(id, "-feedback");
114
- return (_jsxs(_Fragment, { children: [(props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && (_jsxs(_Fragment, { children: [props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsxs("div", __assign({ className: classNames(formGroupClasses) }, { children: [getTitleAndHelp(props.schema, id), _jsx(SchemaFormControl, { id: id, schema: schemaForSelect, value: schemaIndex, disabled: props.disabled, describedBy: feedbackId, onChange: onChooseNewSchema, onFocus: onFocus, onBlur: onBlur, onSearchChange: onSearchChange }), _jsx(ControlFeedback, { id: feedbackId, changed: changed, focused: focused, blurred: blurred, submitted: props.submitted, errors: errorsToString(props.errors), schema: props.schema, validations: validations, infoMessage: null })] }))] })), isNoNConstSchema(props.schema.oneOf[schemaIndex]) && (_jsx(GenericSchema, { schema: props.schema.oneOf[schemaIndex], model: models[schemaIndex], errors: props.errors, submitted: props.submitted, hideTitle: true, disabled: props.disabled, onChange: function (parameters) { return onChildModelChange(schemaIndex, parameters); }, onPersistAsync: props.onPersistAsync }))] }));
114
+ return (_jsxs(_Fragment, { children: [(props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && (_jsxs(_Fragment, { children: [props.schema.alert && _jsx(DynamicAlert, { component: props.schema.alert }), _jsxs("div", { className: classNames(formGroupClasses), children: [getTitleAndHelp(props.schema, id), _jsx(SchemaFormControl, { id: id, schema: schemaForSelect, value: schemaIndex, disabled: props.disabled, describedBy: feedbackId, onChange: onChooseNewSchema, onFocus: onFocus, onBlur: onBlur, onSearchChange: onSearchChange }), _jsx(ControlFeedback, { id: feedbackId, changed: changed, focused: focused, blurred: blurred, submitted: props.submitted, errors: errorsToString(props.errors), schema: props.schema, validations: validations, infoMessage: null })] })] })), isNoNConstSchema(props.schema.oneOf[schemaIndex]) && (_jsx(GenericSchema, { schema: props.schema.oneOf[schemaIndex], model: models[schemaIndex], errors: props.errors, submitted: props.submitted, hideTitle: true, disabled: props.disabled, onChange: function (parameters) { return onChildModelChange(schemaIndex, parameters); }, onPersistAsync: props.onPersistAsync }))] }));
115
115
  }
116
116
  function getTitleAndHelp(schema, forId) {
117
117
  var _a;
118
118
  var helpElement = schema.help ? _jsx(Help, { help: schema.help }) : null;
119
- var titleElement = isConstSchema(schema.oneOf[0]) ? (_jsx("div", __assign({ className: "m-b-1" }, { children: _jsxs("label", __assign({ className: "control-label d-inline", htmlFor: forId }, { children: [schema.title, " ", helpElement] })) }))) : (_jsx(_Fragment, { children: helpElement ? (_jsxs("h4", __assign({ className: "m-b-2" }, { children: [schema.title, " ", helpElement] }))) : (_jsx(Header, { title: (_a = schema.title) !== null && _a !== void 0 ? _a : '' })) }));
119
+ var titleElement = isConstSchema(schema.oneOf[0]) ? (_jsx("div", { className: "m-b-1", children: _jsxs("label", { className: "control-label d-inline", htmlFor: forId, children: [schema.title, " ", helpElement] }) })) : (_jsx(_Fragment, { children: helpElement ? (_jsxs("h4", { className: "m-b-2", children: [schema.title, " ", helpElement] })) : (_jsx(Header, { title: (_a = schema.title) !== null && _a !== void 0 ? _a : '' })) }));
120
120
  return schema.title ? titleElement : helpElement;
121
121
  }
122
122
  function getValidations(props, schemaIndex) {
123
123
  var selectedSchema = props.schema.oneOf[schemaIndex !== null && schemaIndex !== void 0 ? schemaIndex : -1];
124
124
  if (isConstSchema(selectedSchema)) {
125
- return getValidationFailures(selectedSchema["const"], props.schema, Boolean(props.required));
125
+ return getValidationFailures(selectedSchema.const, props.schema, Boolean(props.required));
126
126
  }
127
127
  if (schemaIndex === null || schemaIndex < 0) {
128
128
  return getValidationFailures(null, props.schema, Boolean(props.required));
@@ -146,10 +146,10 @@ function mapSchemasForSelect(schema) {
146
146
  function mapOneOfToConst(schema, index) {
147
147
  var title = schema.title, description = schema.description, _a = schema.disabled, disabled = _a === void 0 ? false : _a, icon = schema.icon, image = schema.image, keywords = schema.keywords;
148
148
  // TODO LOW avoid type assertion below -- consider adding { type: 'integer' }
149
- return { title: title, description: description, disabled: disabled, icon: icon, image: image, "const": index, keywords: keywords };
149
+ return { title: title, description: description, disabled: disabled, icon: icon, image: image, const: index, keywords: keywords };
150
150
  }
151
151
  OneOfSchema.defaultProps = {
152
152
  required: false,
153
- disabled: false
153
+ disabled: false,
154
154
  };
155
155
  export default OneOfSchema;
@@ -11,7 +11,7 @@ export var getActiveSchemaIndex = function (schema, model) {
11
11
  return 0;
12
12
  }
13
13
  if (isConstSchema(schema.oneOf[0])) {
14
- var indexFromDefault = getValidIndexFromValue(schema, schema["default"]);
14
+ var indexFromDefault = getValidIndexFromValue(schema, schema.default);
15
15
  // If the default value satisfies one of the schemas, use that schema.
16
16
  if (indexFromDefault >= 0) {
17
17
  return indexFromDefault;
@@ -22,11 +22,11 @@ export var getActiveSchemaIndex = function (schema, model) {
22
22
  return getBestMatchingSchemaIndexForValue(schema, model);
23
23
  }
24
24
  if (isOneOfObjectSchema(schema) &&
25
- !isUndefined(schema["default"]) &&
26
- isObjectModel(schema["default"]) &&
27
- Object.keys(schema["default"]).length >= 1) {
25
+ !isUndefined(schema.default) &&
26
+ isObjectModel(schema.default) &&
27
+ Object.keys(schema.default).length >= 1) {
28
28
  // Even if the default value does not satisfy any of the schemas, it may be closer to one of them.
29
- return getBestMatchingSchemaIndexForValue(schema, schema["default"]);
29
+ return getBestMatchingSchemaIndexForValue(schema, schema.default);
30
30
  }
31
31
  // Otherwise do not default
32
32
  return null;
@@ -47,7 +47,7 @@ export function getBestMatchingSchemaIndexForValue(schema, value) {
47
47
  var schemaPoints = schema.oneOf.map(function (childSchema) {
48
48
  return getSchemaProperties(childSchema).reduce(function (total, _a) {
49
49
  var key = _a[0], propertySchema = _a[1];
50
- if (isConstSchema(propertySchema) && propertySchema["const"] === value[key]) {
50
+ if (isConstSchema(propertySchema) && propertySchema.const === value[key]) {
51
51
  return total + 2;
52
52
  }
53
53
  if (isNoNConstSchema(propertySchema) && typeof value[key] !== 'undefined') {
@@ -21,6 +21,6 @@ function PersistAsyncSchema(props) {
21
21
  return _jsx(PersistAsyncBasicSchema, __assign({}, props));
22
22
  }
23
23
  PersistAsyncSchema.defaultProps = {
24
- required: false
24
+ required: false,
25
25
  };
26
26
  export default PersistAsyncSchema;
@@ -97,7 +97,7 @@ function PersistAsyncBasicSchema(props) {
97
97
  method: persistAsyncSpec.method,
98
98
  headers: { 'Content-Type': 'application/json' },
99
99
  body: JSON.stringify(requestBody),
100
- signal: signal
100
+ signal: signal,
101
101
  });
102
102
  onPersistAsync(persistAsyncFetch);
103
103
  return [4 /*yield*/, persistAsyncFetch];
@@ -160,6 +160,6 @@ function PersistAsyncBasicSchema(props) {
160
160
  return (_jsx(BasicTypeSchema, { required: required, submitted: submitted || fieldSubmitted, schema: schema.persistAsync.schema, errors: persistAsyncError || errors, model: null, infoMessage: null, onChange: persistAsyncOnChange, onBlur: onBlur }));
161
161
  }
162
162
  PersistAsyncBasicSchema.defaultProps = {
163
- required: false
163
+ required: false,
164
164
  };
165
165
  export default PersistAsyncBasicSchema;
@@ -117,15 +117,15 @@ function PersistAsyncBlobSchema(props) {
117
117
  var combinedValidations = persistAsyncValidations || validations;
118
118
  var formGroupClasses = {
119
119
  'form-group': true,
120
- 'has-error': (submitted || changed) && Boolean(combinedValidations.length)
120
+ 'has-error': (submitted || changed) && Boolean(combinedValidations.length),
121
121
  };
122
122
  var id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
123
123
  var feedbackId = "".concat(id, "-feedback");
124
- return (_jsxs("div", __assign({ className: classNames(formGroupClasses) }, { children: [_jsx("div", __assign({ "aria-describedby": feedbackId }, { children: _jsx(UploadInputAdapter, __assign({ id: id,
124
+ return (_jsxs("div", { className: classNames(formGroupClasses), children: [_jsx("div", { "aria-describedby": feedbackId, children: _jsx(UploadInputAdapter, __assign({ id: id,
125
125
  // TODO: LOW avoid type assertion -- model can be null, but fileId must be number | string -- or maybe make fileId: string| number | undefined
126
- fileId: model, idProperty: schema.persistAsync.idProperty, animationDelay: 0, maxSize: schema.persistAsync.schema.maxSize, usLabel: schema.title || schema.persistAsync.schema.title, usPlaceholder: schema.description || schema.persistAsync.schema.description, httpOptions: { url: url, method: method, fileInputName: schema.persistAsync.param }, httpClient: httpClient, onSuccess: onSuccess, onFailure: onFailure, onCancel: onCancel }, mapSchemaToUploadOptions(schema.persistAsync.schema))) })), _jsx(ControlFeedback, { id: feedbackId, blurred: true, focused: false, changed: changed, submitted: submitted, errors: errors, schema: schema, validations: combinedValidations, validationMessages: __assign({ required: 'Value is required...' }, persistAsyncValidationMessages), infoMessage: null })] })));
126
+ fileId: model, idProperty: schema.persistAsync.idProperty, animationDelay: 0, maxSize: schema.persistAsync.schema.maxSize, usLabel: schema.title || schema.persistAsync.schema.title, usPlaceholder: schema.description || schema.persistAsync.schema.description, httpOptions: { url: url, method: method, fileInputName: schema.persistAsync.param }, httpClient: httpClient, onSuccess: onSuccess, onFailure: onFailure, onCancel: onCancel }, mapSchemaToUploadOptions(schema.persistAsync.schema))) }), _jsx(ControlFeedback, { id: feedbackId, blurred: true, focused: false, changed: changed, submitted: submitted, errors: errors, schema: schema, validations: combinedValidations, validationMessages: __assign({ required: 'Value is required...' }, persistAsyncValidationMessages), infoMessage: null })] }));
127
127
  }
128
128
  PersistAsyncBlobSchema.defaultProps = {
129
- required: false
129
+ required: false,
130
130
  };
131
131
  export default PersistAsyncBlobSchema;
@@ -11,12 +11,12 @@ export function UploadInputAdapter(props) {
11
11
  onEvent('Dynamic Flow - PersistAsync', { status: 'pending', schemaId: id });
12
12
  return httpClient(String(httpOptions.url), {
13
13
  method: httpOptions.method || 'POST',
14
- body: formData
14
+ body: formData,
15
15
  }).then(function (response) {
16
16
  if (response.ok) {
17
17
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(response.clone());
18
18
  return response.json().then(function (responseBody) { return ({
19
- id: responseBody[idProperty]
19
+ id: responseBody[idProperty],
20
20
  }); });
21
21
  }
22
22
  onFailure === null || onFailure === void 0 ? void 0 : onFailure({ response: response });
@@ -30,7 +30,7 @@ var PromotedOneOfSchema = function (props) {
30
30
  var _a;
31
31
  // TODO: LOW avoid type assertion -- actually non-null assertion operator: props.model!
32
32
  var _b = useState(getSelectionFromModel(props.schema, props.model) ||
33
- ((_a = props.schema.promotion) === null || _a === void 0 ? void 0 : _a["default"]) ||
33
+ ((_a = props.schema.promotion) === null || _a === void 0 ? void 0 : _a.default) ||
34
34
  'promoted'), selection = _b[0], setSelection = _b[1];
35
35
  var promotedAlert = props.schema.alert;
36
36
  var promotedOneOf = props.schema.oneOf.find(isPromoted);
@@ -64,7 +64,7 @@ function getOtherOneOf(schema) {
64
64
  title: title,
65
65
  oneOf: other,
66
66
  // TODO: LOW avoid type assertion -- the spec does not recognise a `control` property in ObjectSchema
67
- control: schema.control
67
+ control: schema.control,
68
68
  };
69
69
  }
70
70
  return null;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import { Checkbox } from '@transferwise/components';
14
3
  var PromotedOneOfCheckboxControl = function (props) {
@@ -21,7 +10,7 @@ var PromotedOneOfCheckboxControl = function (props) {
21
10
  var toggleSelection = function () {
22
11
  setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
23
12
  };
24
- return (_jsx("div", __assign({ className: "form-group" }, { children: _jsx(Checkbox, { id: id, label: title, checked: checked, onChange: toggleSelection }) })));
13
+ return (_jsx("div", { className: "form-group", children: _jsx(Checkbox, { id: id, label: title, checked: checked, onChange: toggleSelection }) }));
25
14
  };
26
15
  PromotedOneOfCheckboxControl.defaultProps = {};
27
16
  export default PromotedOneOfCheckboxControl;
@@ -26,6 +26,6 @@ function PromotedOneOfControl(props) {
26
26
  }
27
27
  PromotedOneOfControl.defaultProps = {
28
28
  id: generateRandomId(),
29
- title: undefined
29
+ title: undefined,
30
30
  };
31
31
  export default PromotedOneOfControl;
@@ -21,12 +21,12 @@ function PromotedOneOfRadioControl(props) {
21
21
  label: (((_a = promotion.promoted) === null || _a === void 0 ? void 0 : _a.title) || promotedOneOf.title), secondary: ((_b = promotion.promoted) === null || _b === void 0 ? void 0 : _b.description) || promotedOneOf.description }, getAvatarPropertyForRadioOption(promotedOneOf)),
22
22
  __assign({ value: 'other', label: promotion.other.title, secondary: promotion.other.description }, getAvatarPropertyForRadioOption(promotion.other)),
23
23
  ];
24
- return (_jsxs("div", __assign({ className: "form-group" }, { children: [title && (_jsx("label", __assign({ className: "control-label", htmlFor: id }, { children: title }))), _jsx(RadioGroup, { name: "promoted-selection", selectedValue: selection, radios: radios,
24
+ return (_jsxs("div", { className: "form-group", children: [title && (_jsx("label", { className: "control-label", htmlFor: id, children: title })), _jsx(RadioGroup, { name: "promoted-selection", selectedValue: selection, radios: radios,
25
25
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
26
26
  // @ts-expect-error -- TODO: avoid @ts-ignore -- apparently RadioGroup does not expect an id prop
27
- id: id, onChange: setSelection })] })));
27
+ id: id, onChange: setSelection })] }));
28
28
  }
29
29
  PromotedOneOfRadioControl.defaultProps = {
30
- title: undefined
30
+ title: undefined,
31
31
  };
32
32
  export default PromotedOneOfRadioControl;
@@ -42,7 +42,7 @@ function getValueFromOneOfSchema(schema, model) {
42
42
  }
43
43
  function getSelectedOneOf(schema, model) {
44
44
  return schema.oneOf.find(function (childSchema) {
45
- return 'const' in childSchema ? model === childSchema["const"] : false;
45
+ return 'const' in childSchema ? model === childSchema.const : false;
46
46
  });
47
47
  }
48
48
  function getValueFromOption(option) {
@@ -3,11 +3,11 @@ export default defineMessages({
3
3
  yes: {
4
4
  id: 'dynamicFlows.ReadOnlySchema.yes',
5
5
  defaultMessage: 'Yes',
6
- description: 'Yes, used for boolean schemas with a value of true.'
6
+ description: 'Yes, used for boolean schemas with a value of true.',
7
7
  },
8
8
  no: {
9
9
  id: 'dynamicFlows.ReadOnlySchema.no',
10
10
  defaultMessage: 'No',
11
- description: 'No: used for boolean schemas with a value of false.'
12
- }
11
+ description: 'No: used for boolean schemas with a value of false.',
12
+ },
13
13
  });
@@ -58,7 +58,7 @@ var stringControlToFormControlType = {
58
58
  textarea: 'textarea',
59
59
  email: 'email',
60
60
  numeric: 'numeric',
61
- 'phone-number': 'tel'
61
+ 'phone-number': 'tel',
62
62
  };
63
63
  var stringFormatToFormControlType = {
64
64
  date: 'date',
@@ -66,7 +66,7 @@ var stringFormatToFormControlType = {
66
66
  email: 'email',
67
67
  base64url: 'file',
68
68
  password: 'password',
69
- 'phone-number': 'tel'
69
+ 'phone-number': 'tel',
70
70
  };
71
71
  var getOptions = function (schema, controlType) {
72
72
  if (schema.oneOf) {
@@ -93,7 +93,7 @@ function SchemaFormControl(props) {
93
93
  onFocus: onFocus,
94
94
  onBlur: onBlur,
95
95
  onSearchChange: onSearchChange,
96
- onChange: onModelChange
96
+ onChange: onModelChange,
97
97
  };
98
98
  var safeValue = getSanitisedValue(value);
99
99
  var controlProps = {
@@ -108,16 +108,16 @@ function SchemaFormControl(props) {
108
108
  displayPattern: schema.displayFormat,
109
109
  // TODO: LOW avoid type assertion below
110
110
  uploadProps: mapSchemaToUploadOptions(schema),
111
- describedBy: describedBy
111
+ describedBy: describedBy,
112
112
  };
113
- return (_jsx("div", __assign({ "aria-describedby": describedBy }, { children: _jsx(FormControl, __assign({ type: controlType, value: safeValue }, events, controlProps)) })));
113
+ return (_jsx("div", { "aria-describedby": describedBy, children: _jsx(FormControl, __assign({ type: controlType, value: safeValue }, events, controlProps)) }));
114
114
  }
115
115
  SchemaFormControl.defaultProps = {
116
116
  value: null,
117
117
  onFocus: null,
118
118
  onBlur: null,
119
119
  onSearchChange: null,
120
- disabled: false
120
+ disabled: false,
121
121
  };
122
122
  var warnIfInvalidSchema = function (schema, log, controlType) {
123
123
  if (isOneOfSchema(schema) && schema.oneOf.length === 2 && !schema.control) {
@@ -61,7 +61,7 @@ beforeEach(function () {
61
61
  });
62
62
  jest.mock('../../formControl/FormControl', function () { return ({
63
63
  __esModule: true,
64
- "default": function (props) {
64
+ default: function (props) {
65
65
  var keys = [
66
66
  'id',
67
67
  'type',
@@ -70,11 +70,11 @@ jest.mock('../../formControl/FormControl', function () { return ({
70
70
  'value',
71
71
  'disabled',
72
72
  ];
73
- return (_jsxs("div", __assign({ "data-testid": "form-control" }, { children: [keys.map(function (key) {
73
+ return (_jsxs("div", { "data-testid": "form-control", children: [keys.map(function (key) {
74
74
  var value = typeof props[key] === 'boolean' ? (props[key] ? 'true' : 'false') : props[key];
75
75
  return _jsx("div", { children: "".concat(key, ": ").concat(String(value)) }, key);
76
- }), _jsx("input", { "data-testid": props.id, type: "text", value: String(props.value), onChange: function (e) { return props.onChange(e.target.value); }, onFocus: props.onFocus, onBlur: props.onBlur })] })));
77
- }
76
+ }), _jsx("input", { "data-testid": props.id, type: "text", value: String(props.value), onChange: function (e) { return props.onChange(e.target.value); }, onFocus: props.onFocus, onBlur: props.onBlur })] }));
77
+ },
78
78
  }); });
79
79
  var getProps = function () { return ({
80
80
  id: 'id',
@@ -82,7 +82,7 @@ var getProps = function () { return ({
82
82
  onFocus: jest.fn(),
83
83
  onBlur: jest.fn(),
84
84
  schema: { type: 'string' },
85
- value: null
85
+ value: null,
86
86
  }); };
87
87
  describe('Given a SchemaFormControl component', function () {
88
88
  var cases = [
@@ -162,7 +162,7 @@ describe('when a schema with oneOf consts is supplied', function () {
162
162
  control: control,
163
163
  oneOf: Array(options)
164
164
  .fill(null)
165
- .map(function (_, i) { return ({ "const": i + 1, title: String(i + 1) }); })
165
+ .map(function (_, i) { return ({ const: i + 1, title: String(i + 1) }); }),
166
166
  };
167
167
  var props = __assign(__assign({}, getProps()), { schema: schema });
168
168
  renderWithProviders(_jsx(SchemaFormControl, __assign({}, props)));
@@ -174,9 +174,9 @@ describe('when a schema with a oneOf with only 2 options and no control property
174
174
  var getSchema = function () { return ({
175
175
  $id: 'one-of',
176
176
  oneOf: [
177
- { type: 'string', "const": 'A' },
178
- { type: 'string', "const": 'B' },
179
- ]
177
+ { type: 'string', const: 'A' },
178
+ { type: 'string', const: 'B' },
179
+ ],
180
180
  }); };
181
181
  it('logs a warning', function () {
182
182
  renderWithProviders(_jsx(SchemaFormControl, __assign({}, getProps(), { schema: getSchema() })));
@@ -197,10 +197,10 @@ describe('schema control property', function () {
197
197
  it('overrides the default and renders FormControl with the specified control as type prop', function () {
198
198
  var schema = {
199
199
  oneOf: [
200
- { "const": 1, title: '1' },
201
- { "const": 2, title: '2' },
200
+ { const: 1, title: '1' },
201
+ { const: 2, title: '2' },
202
202
  ],
203
- control: 'select'
203
+ control: 'select',
204
204
  };
205
205
  var props = __assign(__assign({}, getProps()), { schema: schema });
206
206
  renderWithProviders(_jsx(SchemaFormControl, __assign({}, props)));