@wise/dynamic-flow-client 0.2.0 → 0.3.0-beta-d45b31.38

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 (480) hide show
  1. package/package.json +34 -32
  2. package/build/common/api/utils.d.ts +0 -4
  3. package/build/common/api/utils.js +0 -13
  4. package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.d.ts +0 -11
  5. package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.js +0 -36
  6. package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.d.ts +0 -4
  7. package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.js +0 -13
  8. package/build/common/contexts/fetcherContext/fetcherContext.d.ts +0 -18
  9. package/build/common/contexts/fetcherContext/fetcherContext.js +0 -35
  10. package/build/common/contexts/fetcherContext/index.d.ts +0 -2
  11. package/build/common/contexts/fetcherContext/index.js +0 -2
  12. package/build/common/contexts/fetcherContext/makeFetcher.d.ts +0 -2
  13. package/build/common/contexts/fetcherContext/makeFetcher.js +0 -33
  14. package/build/common/general/index.d.ts +0 -2
  15. package/build/common/general/index.js +0 -22
  16. package/build/common/hooks/useDebouncedFunction.d.ts +0 -2
  17. package/build/common/hooks/useDebouncedFunction.js +0 -9
  18. package/build/common/hooks/useDebouncedFunction.test.d.ts +0 -1
  19. package/build/common/hooks/useDebouncedFunction.test.js +0 -59
  20. package/build/common/hooks/usePersistAsync.d.ts +0 -7
  21. package/build/common/hooks/usePersistAsync.js +0 -170
  22. package/build/common/hooks/usePolling.d.ts +0 -11
  23. package/build/common/hooks/usePolling.js +0 -48
  24. package/build/common/hooks/usePrevious.d.ts +0 -2
  25. package/build/common/hooks/usePrevious.js +0 -9
  26. package/build/common/index.d.ts +0 -4
  27. package/build/common/index.js +0 -4
  28. package/build/common/logging/index.d.ts +0 -22
  29. package/build/common/logging/index.js +0 -39
  30. package/build/common/logging/spec.d.ts +0 -1
  31. package/build/common/logging/spec.js +0 -45
  32. package/build/common/messages.d.ts +0 -8
  33. package/build/common/messages.js +0 -8
  34. package/build/common/propsValues/dateMode.d.ts +0 -4
  35. package/build/common/propsValues/dateMode.js +0 -4
  36. package/build/common/propsValues/formControlType.d.ts +0 -17
  37. package/build/common/propsValues/formControlType.js +0 -17
  38. package/build/common/propsValues/monthFormat.d.ts +0 -4
  39. package/build/common/propsValues/monthFormat.js +0 -4
  40. package/build/common/propsValues/size.d.ts +0 -7
  41. package/build/common/propsValues/size.js +0 -7
  42. package/build/common/requirements.d.ts +0 -10
  43. package/build/common/requirements.js +0 -50
  44. package/build/common/schemaTypes/schemaTypes.d.ts +0 -23
  45. package/build/common/schemaTypes/schemaTypes.js +0 -53
  46. package/build/common/schemaTypes/shouldDebounceSchema.d.ts +0 -2
  47. package/build/common/schemaTypes/shouldDebounceSchema.js +0 -6
  48. package/build/common/stepTypes/stepTypes.d.ts +0 -7
  49. package/build/common/stepTypes/stepTypes.js +0 -42
  50. package/build/common/tracking/index.d.ts +0 -15
  51. package/build/common/tracking/index.js +0 -33
  52. package/build/common/tracking/spec.d.ts +0 -1
  53. package/build/common/tracking/spec.js +0 -49
  54. package/build/common/utils/file-utils.d.ts +0 -4
  55. package/build/common/utils/file-utils.js +0 -45
  56. package/build/common/utils/generate-random-id.d.ts +0 -1
  57. package/build/common/utils/generate-random-id.js +0 -5
  58. package/build/common/utils/generate-random-id.test.d.ts +0 -1
  59. package/build/common/utils/generate-random-id.test.js +0 -12
  60. package/build/common/validation/rule-validators/index.d.ts +0 -10
  61. package/build/common/validation/rule-validators/index.js +0 -40
  62. package/build/common/validation/rule-validators/spec.d.ts +0 -1
  63. package/build/common/validation/rule-validators/spec.js +0 -145
  64. package/build/common/validation/schema-validators/index.d.ts +0 -9
  65. package/build/common/validation/schema-validators/index.js +0 -98
  66. package/build/common/validation/schema-validators/spec.d.ts +0 -1
  67. package/build/common/validation/schema-validators/spec.js +0 -137
  68. package/build/common/validation/valid-model/index.d.ts +0 -5
  69. package/build/common/validation/valid-model/index.js +0 -64
  70. package/build/common/validation/valid-model/spec.d.ts +0 -1
  71. package/build/common/validation/valid-model/spec.js +0 -605
  72. package/build/common/validation/valid-model/utils.d.ts +0 -11
  73. package/build/common/validation/valid-model/utils.js +0 -118
  74. package/build/common/validation/validation-failures/index.d.ts +0 -23
  75. package/build/common/validation/validation-failures/index.js +0 -140
  76. package/build/common/validation/validation-failures/spec.d.ts +0 -1
  77. package/build/common/validation/validation-failures/spec.js +0 -185
  78. package/build/dynamic-flow-types/Action.d.ts +0 -19
  79. package/build/dynamic-flow-types/Action.js +0 -1
  80. package/build/dynamic-flow-types/FileUploadSchema.d.ts +0 -23
  81. package/build/dynamic-flow-types/FileUploadSchema.js +0 -3
  82. package/build/dynamic-flow-types/LayoutComponent.d.ts +0 -129
  83. package/build/dynamic-flow-types/LayoutComponent.js +0 -1
  84. package/build/dynamic-flow-types/Model.d.ts +0 -12
  85. package/build/dynamic-flow-types/Model.js +0 -28
  86. package/build/dynamic-flow-types/PersistAsync.d.ts +0 -8
  87. package/build/dynamic-flow-types/PersistAsync.js +0 -1
  88. package/build/dynamic-flow-types/Polling.d.ts +0 -12
  89. package/build/dynamic-flow-types/Polling.js +0 -1
  90. package/build/dynamic-flow-types/Promotion.d.ts +0 -20
  91. package/build/dynamic-flow-types/Promotion.js +0 -1
  92. package/build/dynamic-flow-types/Schema.d.ts +0 -184
  93. package/build/dynamic-flow-types/Schema.js +0 -49
  94. package/build/dynamic-flow-types/Step.d.ts +0 -127
  95. package/build/dynamic-flow-types/Step.js +0 -4
  96. package/build/dynamic-flow-types/ValidationAsync.d.ts +0 -6
  97. package/build/dynamic-flow-types/ValidationAsync.js +0 -1
  98. package/build/dynamic-flow-types/core.d.ts +0 -29
  99. package/build/dynamic-flow-types/core.js +0 -1
  100. package/build/dynamic-flow-types/index.d.ts +0 -14
  101. package/build/dynamic-flow-types/index.js +0 -12
  102. package/build/field/Field.d.ts +0 -69
  103. package/build/field/Field.js +0 -311
  104. package/build/field/index.d.ts +0 -2
  105. package/build/field/index.js +0 -2
  106. package/build/flow/DynamicFlow.d.ts +0 -3
  107. package/build/flow/DynamicFlow.js +0 -368
  108. package/build/flow/DynamicFlowStep.d.ts +0 -8
  109. package/build/flow/DynamicFlowStep.js +0 -32
  110. package/build/flow/errorBoundary/ErrorBoundary.d.ts +0 -20
  111. package/build/flow/errorBoundary/ErrorBoundary.js +0 -45
  112. package/build/flow/errorBoundary/ErrorBoundary.messages.d.ts +0 -13
  113. package/build/flow/errorBoundary/ErrorBoundary.messages.js +0 -13
  114. package/build/flow/errorBoundary/ErrorBoundaryAlert.d.ts +0 -5
  115. package/build/flow/errorBoundary/ErrorBoundaryAlert.js +0 -12
  116. package/build/flow/errorBoundary/index.d.ts +0 -1
  117. package/build/flow/errorBoundary/index.js +0 -1
  118. package/build/flow/fixtures/components/alert.d.ts +0 -3
  119. package/build/flow/fixtures/components/alert.js +0 -31
  120. package/build/flow/fixtures/components/box.d.ts +0 -3
  121. package/build/flow/fixtures/components/box.js +0 -20
  122. package/build/flow/fixtures/components/button.d.ts +0 -3
  123. package/build/flow/fixtures/components/button.js +0 -65
  124. package/build/flow/fixtures/components/columns.d.ts +0 -3
  125. package/build/flow/fixtures/components/columns.js +0 -36
  126. package/build/flow/fixtures/components/copyable.d.ts +0 -3
  127. package/build/flow/fixtures/components/copyable.js +0 -22
  128. package/build/flow/fixtures/components/decision.d.ts +0 -3
  129. package/build/flow/fixtures/components/decision.js +0 -54
  130. package/build/flow/fixtures/components/heading.d.ts +0 -3
  131. package/build/flow/fixtures/components/heading.js +0 -14
  132. package/build/flow/fixtures/components/image.d.ts +0 -3
  133. package/build/flow/fixtures/components/image.js +0 -22
  134. package/build/flow/fixtures/components/info.d.ts +0 -3
  135. package/build/flow/fixtures/components/info.js +0 -17
  136. package/build/flow/fixtures/components/list.d.ts +0 -3
  137. package/build/flow/fixtures/components/list.js +0 -34
  138. package/build/flow/fixtures/components/loading-indicator.d.ts +0 -3
  139. package/build/flow/fixtures/components/loading-indicator.js +0 -16
  140. package/build/flow/fixtures/components/paragraph.d.ts +0 -3
  141. package/build/flow/fixtures/components/paragraph.js +0 -28
  142. package/build/flow/fixtures/components/review.d.ts +0 -3
  143. package/build/flow/fixtures/components/review.js +0 -60
  144. package/build/flow/fixtures/examples/camera-capture.d.ts +0 -3
  145. package/build/flow/fixtures/examples/camera-capture.js +0 -121
  146. package/build/flow/fixtures/examples/recipient-update.d.ts +0 -3
  147. package/build/flow/fixtures/examples/recipient-update.js +0 -250
  148. package/build/flow/fixtures/examples/recipient.d.ts +0 -3
  149. package/build/flow/fixtures/examples/recipient.js +0 -313
  150. package/build/flow/fixtures/examples/single-file-upload.d.ts +0 -3
  151. package/build/flow/fixtures/examples/single-file-upload.js +0 -96
  152. package/build/flow/fixtures/examples/step-validation-errors.d.ts +0 -3
  153. package/build/flow/fixtures/examples/step-validation-errors.js +0 -75
  154. package/build/flow/fixtures/features/action-response.d.ts +0 -3
  155. package/build/flow/fixtures/features/action-response.js +0 -29
  156. package/build/flow/fixtures/features/external.d.ts +0 -3
  157. package/build/flow/fixtures/features/external.js +0 -31
  158. package/build/flow/fixtures/features/persist-async.d.ts +0 -3
  159. package/build/flow/fixtures/features/persist-async.js +0 -44
  160. package/build/flow/fixtures/features/polling.d.ts +0 -3
  161. package/build/flow/fixtures/features/polling.js +0 -33
  162. package/build/flow/fixtures/index.d.ts +0 -42
  163. package/build/flow/fixtures/index.js +0 -66
  164. package/build/flow/fixtures/responses/action-response-final.d.ts +0 -3
  165. package/build/flow/fixtures/responses/action-response-final.js +0 -24
  166. package/build/flow/fixtures/responses/action.d.ts +0 -5
  167. package/build/flow/fixtures/responses/action.js +0 -2
  168. package/build/flow/fixtures/responses/exit.d.ts +0 -6
  169. package/build/flow/fixtures/responses/exit.js +0 -2
  170. package/build/flow/fixtures/responses/recipient-update-final.d.ts +0 -3
  171. package/build/flow/fixtures/responses/recipient-update-final.js +0 -24
  172. package/build/flow/fixtures/schemas/basic-form.d.ts +0 -3
  173. package/build/flow/fixtures/schemas/basic-form.js +0 -39
  174. package/build/flow/fixtures/schemas/number-and-integer.d.ts +0 -3
  175. package/build/flow/fixtures/schemas/number-and-integer.js +0 -41
  176. package/build/flow/fixtures/schemas/one-of.d.ts +0 -3
  177. package/build/flow/fixtures/schemas/one-of.js +0 -223
  178. package/build/flow/fixtures/schemas/string-formats.d.ts +0 -3
  179. package/build/flow/fixtures/schemas/string-formats.js +0 -58
  180. package/build/flow/index.d.ts +0 -1
  181. package/build/flow/index.js +0 -1
  182. package/build/flow/response-parsers/index.d.ts +0 -17
  183. package/build/flow/response-parsers/index.js +0 -112
  184. package/build/flow/response-parsers/spec.d.ts +0 -1
  185. package/build/flow/response-parsers/spec.js +0 -263
  186. package/build/flow/stories/EditableDynamicFlow.d.ts +0 -4
  187. package/build/flow/stories/EditableDynamicFlow.js +0 -61
  188. package/build/flow/types.d.ts +0 -77
  189. package/build/flow/types.js +0 -3
  190. package/build/flow/useDebouncedRefresh/index.d.ts +0 -1
  191. package/build/flow/useDebouncedRefresh/index.js +0 -1
  192. package/build/flow/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -5
  193. package/build/flow/useDebouncedRefresh/useDebouncedRefresh.js +0 -24
  194. package/build/flow/useDynamicFlowState.d.ts +0 -18
  195. package/build/flow/useDynamicFlowState.js +0 -111
  196. package/build/flow/useLoader.d.ts +0 -9
  197. package/build/flow/useLoader.js +0 -22
  198. package/build/formControl/FormControl.d.ts +0 -86
  199. package/build/formControl/FormControl.js +0 -241
  200. package/build/formControl/index.d.ts +0 -1
  201. package/build/formControl/index.js +0 -1
  202. package/build/formControl/types.d.ts +0 -57
  203. package/build/formControl/types.js +0 -1
  204. package/build/formControl/value-utils.d.ts +0 -9
  205. package/build/formControl/value-utils.js +0 -108
  206. package/build/i18n/cs.json +0 -8
  207. package/build/i18n/de.json +0 -34
  208. package/build/i18n/en.json +0 -38
  209. package/build/i18n/es.json +0 -34
  210. package/build/i18n/fr.json +0 -34
  211. package/build/i18n/hu.json +0 -34
  212. package/build/i18n/id.json +0 -34
  213. package/build/i18n/index.d.ts +0 -2
  214. package/build/i18n/index.js +0 -31
  215. package/build/i18n/it.json +0 -34
  216. package/build/i18n/ja.json +0 -34
  217. package/build/i18n/pl.json +0 -11
  218. package/build/i18n/pt.json +0 -34
  219. package/build/i18n/ro.json +0 -34
  220. package/build/i18n/ru.json +0 -34
  221. package/build/i18n/th.json +0 -34
  222. package/build/i18n/tr.json +0 -11
  223. package/build/i18n/uk.json +0 -8
  224. package/build/i18n/zh-CN.json +0 -34
  225. package/build/i18n/zh.json +0 -34
  226. package/build/index.d.ts +0 -12
  227. package/build/index.js +0 -11
  228. package/build/jsonSchemaForm/JsonSchemaForm.d.ts +0 -65
  229. package/build/jsonSchemaForm/JsonSchemaForm.js +0 -31
  230. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +0 -13
  231. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +0 -54
  232. package/build/jsonSchemaForm/allOfSchema/index.d.ts +0 -2
  233. package/build/jsonSchemaForm/allOfSchema/index.js +0 -1
  234. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +0 -14
  235. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +0 -25
  236. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -15
  237. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +0 -26
  238. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.d.ts +0 -1
  239. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +0 -1
  240. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -17
  241. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +0 -141
  242. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -24
  243. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +0 -18
  244. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -1
  245. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +0 -1
  246. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.d.ts +0 -9
  247. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.js +0 -14
  248. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.d.ts +0 -6
  249. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.js +0 -85
  250. package/build/jsonSchemaForm/arrayTypeSchema/index.d.ts +0 -2
  251. package/build/jsonSchemaForm/arrayTypeSchema/index.js +0 -1
  252. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +0 -21
  253. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +0 -105
  254. package/build/jsonSchemaForm/basicTypeSchema/index.d.ts +0 -2
  255. package/build/jsonSchemaForm/basicTypeSchema/index.js +0 -1
  256. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +0 -30
  257. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +0 -79
  258. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts +0 -53
  259. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +0 -53
  260. package/build/jsonSchemaForm/controlFeedback/index.d.ts +0 -1
  261. package/build/jsonSchemaForm/controlFeedback/index.js +0 -1
  262. package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +0 -18
  263. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +0 -122
  264. package/build/jsonSchemaForm/genericSchema/index.d.ts +0 -1
  265. package/build/jsonSchemaForm/genericSchema/index.js +0 -1
  266. package/build/jsonSchemaForm/help/Help.d.ts +0 -7
  267. package/build/jsonSchemaForm/help/Help.js +0 -9
  268. package/build/jsonSchemaForm/help/Help.messages.d.ts +0 -8
  269. package/build/jsonSchemaForm/help/Help.messages.js +0 -8
  270. package/build/jsonSchemaForm/help/index.d.ts +0 -1
  271. package/build/jsonSchemaForm/help/index.js +0 -1
  272. package/build/jsonSchemaForm/index.d.ts +0 -1
  273. package/build/jsonSchemaForm/index.js +0 -1
  274. package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +0 -15
  275. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +0 -78
  276. package/build/jsonSchemaForm/objectSchema/index.d.ts +0 -2
  277. package/build/jsonSchemaForm/objectSchema/index.js +0 -1
  278. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +0 -14
  279. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +0 -153
  280. package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.d.ts +0 -3
  281. package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.js +0 -40
  282. package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.d.ts +0 -2
  283. package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.js +0 -27
  284. package/build/jsonSchemaForm/oneOfSchema/index.d.ts +0 -2
  285. package/build/jsonSchemaForm/oneOfSchema/index.js +0 -1
  286. package/build/jsonSchemaForm/oneOfSchema/isConstSchema.d.ts +0 -3
  287. package/build/jsonSchemaForm/oneOfSchema/isConstSchema.js +0 -7
  288. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -15
  289. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +0 -26
  290. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -8
  291. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +0 -8
  292. package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.d.ts +0 -20
  293. package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.js +0 -168
  294. package/build/jsonSchemaForm/persistAsyncSchema/basic/index.d.ts +0 -1
  295. package/build/jsonSchemaForm/persistAsyncSchema/basic/index.js +0 -1
  296. package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.d.ts +0 -19
  297. package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.js +0 -127
  298. package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.d.ts +0 -16
  299. package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.js +0 -32
  300. package/build/jsonSchemaForm/persistAsyncSchema/blob/index.d.ts +0 -1
  301. package/build/jsonSchemaForm/persistAsyncSchema/blob/index.js +0 -1
  302. package/build/jsonSchemaForm/persistAsyncSchema/index.d.ts +0 -2
  303. package/build/jsonSchemaForm/persistAsyncSchema/index.js +0 -1
  304. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -8
  305. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +0 -72
  306. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.d.ts +0 -2
  307. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.js +0 -8
  308. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.d.ts +0 -6
  309. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.js +0 -27
  310. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.d.ts +0 -23
  311. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.js +0 -31
  312. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.d.ts +0 -8
  313. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.js +0 -32
  314. package/build/jsonSchemaForm/promotedOneOfSchema/index.d.ts +0 -2
  315. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +0 -1
  316. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +0 -7
  317. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +0 -55
  318. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -16
  319. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +0 -13
  320. package/build/jsonSchemaForm/readOnlySchema/index.d.ts +0 -1
  321. package/build/jsonSchemaForm/readOnlySchema/index.js +0 -1
  322. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +0 -24
  323. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +0 -106
  324. package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.d.ts +0 -3
  325. package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.js +0 -73
  326. package/build/jsonSchemaForm/schemaFormControl/index.d.ts +0 -1
  327. package/build/jsonSchemaForm/schemaFormControl/index.js +0 -1
  328. package/build/jsonSchemaForm/schemaFormControl/optionMapper.d.ts +0 -39
  329. package/build/jsonSchemaForm/schemaFormControl/optionMapper.js +0 -89
  330. package/build/jsonSchemaForm/schemas/allOf.json.d.ts +0 -3
  331. package/build/jsonSchemaForm/schemas/allOf.json.js +0 -119
  332. package/build/jsonSchemaForm/schemas/audRecipient.json.d.ts +0 -3
  333. package/build/jsonSchemaForm/schemas/audRecipient.json.js +0 -1104
  334. package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.d.ts +0 -3
  335. package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.js +0 -37
  336. package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.d.ts +0 -3
  337. package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.js +0 -36
  338. package/build/jsonSchemaForm/schemas/currency.json.d.ts +0 -3
  339. package/build/jsonSchemaForm/schemas/currency.json.js +0 -48
  340. package/build/jsonSchemaForm/schemas/oneOf.json.d.ts +0 -3
  341. package/build/jsonSchemaForm/schemas/oneOf.json.js +0 -119
  342. package/build/jsonSchemaForm/schemas/oneOfTabs.json.d.ts +0 -3
  343. package/build/jsonSchemaForm/schemas/oneOfTabs.json.js +0 -53
  344. package/build/jsonSchemaForm/schemas/promotedOneOf.json.d.ts +0 -3
  345. package/build/jsonSchemaForm/schemas/promotedOneOf.json.js +0 -56
  346. package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.d.ts +0 -3
  347. package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.js +0 -102
  348. package/build/jsonSchemaForm/schemas/simple.json.d.ts +0 -3
  349. package/build/jsonSchemaForm/schemas/simple.json.js +0 -48
  350. package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.d.ts +0 -3
  351. package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.js +0 -71
  352. package/build/jsonSchemaForm/schemas/validationAsync.json.d.ts +0 -3
  353. package/build/jsonSchemaForm/schemas/validationAsync.json.js +0 -23
  354. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -16
  355. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +0 -149
  356. package/build/jsonSchemaForm/validationAsyncSchema/index.d.ts +0 -2
  357. package/build/jsonSchemaForm/validationAsyncSchema/index.js +0 -1
  358. package/build/layout/DynamicLayout.d.ts +0 -16
  359. package/build/layout/DynamicLayout.js +0 -75
  360. package/build/layout/alert/index.d.ts +0 -5
  361. package/build/layout/alert/index.js +0 -29
  362. package/build/layout/box/index.d.ts +0 -7
  363. package/build/layout/box/index.js +0 -41
  364. package/build/layout/button/index.d.ts +0 -7
  365. package/build/layout/button/index.js +0 -58
  366. package/build/layout/columns/index.d.ts +0 -7
  367. package/build/layout/columns/index.js +0 -38
  368. package/build/layout/decision/index.d.ts +0 -8
  369. package/build/layout/decision/index.js +0 -38
  370. package/build/layout/divider/index.d.ts +0 -6
  371. package/build/layout/divider/index.js +0 -9
  372. package/build/layout/external/DynamicExternal.d.ts +0 -7
  373. package/build/layout/external/DynamicExternal.js +0 -30
  374. package/build/layout/external/DynamicExternal.messages.d.ts +0 -8
  375. package/build/layout/external/DynamicExternal.messages.js +0 -8
  376. package/build/layout/external/index.d.ts +0 -1
  377. package/build/layout/external/index.js +0 -1
  378. package/build/layout/external/useExternalStepPolling.d.ts +0 -11
  379. package/build/layout/external/useExternalStepPolling.js +0 -68
  380. package/build/layout/form/index.d.ts +0 -7
  381. package/build/layout/form/index.js +0 -22
  382. package/build/layout/heading/index.d.ts +0 -5
  383. package/build/layout/heading/index.js +0 -31
  384. package/build/layout/icon/index.d.ts +0 -6
  385. package/build/layout/icon/index.js +0 -22
  386. package/build/layout/image/index.d.ts +0 -5
  387. package/build/layout/image/index.js +0 -126
  388. package/build/layout/index.d.ts +0 -1
  389. package/build/layout/index.js +0 -1
  390. package/build/layout/info/index.d.ts +0 -6
  391. package/build/layout/info/index.js +0 -19
  392. package/build/layout/layouts/all.json.d.ts +0 -3
  393. package/build/layout/layouts/all.json.js +0 -176
  394. package/build/layout/layouts/final-step-layout.json.d.ts +0 -3
  395. package/build/layout/layouts/final-step-layout.json.js +0 -39
  396. package/build/layout/layouts/finalStep.json.d.ts +0 -3
  397. package/build/layout/layouts/finalStep.json.js +0 -24
  398. package/build/layout/layouts/list.json.d.ts +0 -3
  399. package/build/layout/layouts/list.json.js +0 -33
  400. package/build/layout/layouts/pay-in.json.d.ts +0 -3
  401. package/build/layout/layouts/pay-in.json.js +0 -97
  402. package/build/layout/layouts/review.json.d.ts +0 -3
  403. package/build/layout/layouts/review.json.js +0 -160
  404. package/build/layout/layouts/success.json.d.ts +0 -3
  405. package/build/layout/layouts/success.json.js +0 -66
  406. package/build/layout/list/index.d.ts +0 -7
  407. package/build/layout/list/index.js +0 -30
  408. package/build/layout/loading-indicator/index.d.ts +0 -6
  409. package/build/layout/loading-indicator/index.js +0 -10
  410. package/build/layout/loading-indicator/spec.d.ts +0 -1
  411. package/build/layout/loading-indicator/spec.js +0 -11
  412. package/build/layout/paragraph/DynamicParagraph.d.ts +0 -6
  413. package/build/layout/paragraph/DynamicParagraph.js +0 -42
  414. package/build/layout/paragraph/DynamicParagraph.messages.d.ts +0 -13
  415. package/build/layout/paragraph/DynamicParagraph.messages.js +0 -13
  416. package/build/layout/paragraph/index.d.ts +0 -1
  417. package/build/layout/paragraph/index.js +0 -1
  418. package/build/layout/paragraph/useSnackBarIfAvailable.d.ts +0 -10
  419. package/build/layout/paragraph/useSnackBarIfAvailable.js +0 -9
  420. package/build/layout/review/index.d.ts +0 -8
  421. package/build/layout/review/index.js +0 -33
  422. package/build/layout/utils.d.ts +0 -7
  423. package/build/layout/utils.js +0 -31
  424. package/build/main.css +0 -143
  425. package/build/schema.d.ts +0 -1
  426. package/build/schema.js +0 -1
  427. package/build/step/cameraStep/CameraStep.d.ts +0 -7
  428. package/build/step/cameraStep/CameraStep.js +0 -125
  429. package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +0 -15
  430. package/build/step/cameraStep/cameraCapture/CameraCapture.js +0 -122
  431. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -18
  432. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +0 -18
  433. package/build/step/cameraStep/cameraCapture/components/index.d.ts +0 -7
  434. package/build/step/cameraStep/cameraCapture/components/index.js +0 -28
  435. package/build/step/cameraStep/cameraCapture/hooks/index.d.ts +0 -4
  436. package/build/step/cameraStep/cameraCapture/hooks/index.js +0 -80
  437. package/build/step/cameraStep/cameraCapture/index.d.ts +0 -1
  438. package/build/step/cameraStep/cameraCapture/index.js +0 -1
  439. package/build/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -10
  440. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +0 -78
  441. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -2
  442. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +0 -19
  443. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -13
  444. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +0 -13
  445. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -5
  446. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +0 -21
  447. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -18
  448. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +0 -18
  449. package/build/step/cameraStep/cameraCapture/screens/index.d.ts +0 -2
  450. package/build/step/cameraStep/cameraCapture/screens/index.js +0 -2
  451. package/build/step/cameraStep/cameraCapture/tracking/index.d.ts +0 -7
  452. package/build/step/cameraStep/cameraCapture/tracking/index.js +0 -101
  453. package/build/step/cameraStep/cameraCapture/utils/index.d.ts +0 -8
  454. package/build/step/cameraStep/cameraCapture/utils/index.js +0 -103
  455. package/build/step/cameraStep/index.d.ts +0 -1
  456. package/build/step/cameraStep/index.js +0 -1
  457. package/build/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -6
  458. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +0 -64
  459. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -23
  460. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +0 -23
  461. package/build/step/externalConfirmationStep/index.d.ts +0 -1
  462. package/build/step/externalConfirmationStep/index.js +0 -1
  463. package/build/step/features/external/useExternal.d.ts +0 -4
  464. package/build/step/features/external/useExternal.js +0 -15
  465. package/build/step/features/index.d.ts +0 -2
  466. package/build/step/features/index.js +0 -2
  467. package/build/step/features/polling/useStepPolling.d.ts +0 -2
  468. package/build/step/features/polling/useStepPolling.js +0 -44
  469. package/build/step/index.d.ts +0 -3
  470. package/build/step/index.js +0 -3
  471. package/build/step/layoutStep/LayoutStep.d.ts +0 -10
  472. package/build/step/layoutStep/LayoutStep.js +0 -34
  473. package/build/step/layoutStep/index.d.ts +0 -1
  474. package/build/step/layoutStep/index.js +0 -1
  475. package/build/step/layoutStep/layoutService/convertStepToLayout.d.ts +0 -8
  476. package/build/step/layoutStep/layoutService/convertStepToLayout.js +0 -217
  477. package/build/step/layoutStep/layoutService/index.d.ts +0 -2
  478. package/build/step/layoutStep/layoutService/index.js +0 -2
  479. package/build/step/layoutStep/layoutService/inlineReferences.d.ts +0 -7
  480. package/build/step/layoutStep/layoutService/inlineReferences.js +0 -91
@@ -1,127 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
- import classNames from 'classnames';
50
- import { useEffect, useState } from 'react';
51
- import { isStatus422 } from '../../../common/api/utils';
52
- import { useFetcher } from '../../../common/contexts/fetcherContext';
53
- import { useTracking } from '../../../common/tracking';
54
- import { getValidationFailures } from '../../../common/validation/validation-failures';
55
- import ControlFeedback from '../../controlFeedback';
56
- import { mapSchemaToUploadOptions } from '../../schemaFormControl/optionMapper';
57
- import { getIdFromResponse } from '../basic/PersistAsyncBasicSchema';
58
- import { UploadInputAdapter } from './UploadInputAdapter';
59
- var PersistAsyncBlobSchema = function (props) {
60
- var _a = useState({}), persistAsyncValidationMessages = _a[0], setPersistAsyncValidationMessages = _a[1];
61
- var _b = useState(null), persistAsyncValidations = _b[0], setPersistAsyncValidations = _b[1];
62
- var _c = useState([]), validations = _c[0], setValidations = _c[1];
63
- var _d = useState(false), changed = _d[0], setChanged = _d[1];
64
- var fetcher = useFetcher();
65
- var trackEvent = useTracking();
66
- var refreshValidations = function () {
67
- if (props.submitted) {
68
- setValidations(getValidationFailures(props.model, props.schema, !!props.required));
69
- }
70
- };
71
- useEffect(refreshValidations, [props.model, props.submitted]);
72
- var onSuccess = function (httpResponse, _fileName) { return __awaiter(void 0, void 0, void 0, function () {
73
- var jsonResponse, id;
74
- return __generator(this, function (_a) {
75
- switch (_a.label) {
76
- case 0: return [4 /*yield*/, httpResponse.json()];
77
- case 1:
78
- jsonResponse = (_a.sent());
79
- id = getIdFromResponse(props.schema.persistAsync.idProperty, jsonResponse);
80
- props.onChange({ model: id, triggerSchema: props.schema, triggerModel: id });
81
- setChanged(true);
82
- trackEvent('Dynamic Flow - PersistAsync', { status: 'success', schemaId: props.schema.$id });
83
- return [2 /*return*/];
84
- }
85
- });
86
- }); };
87
- var onFailure = function (errorResponse) { return __awaiter(void 0, void 0, void 0, function () {
88
- var jsonResponse;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0:
92
- if (!(errorResponse.response && isStatus422(errorResponse.response.status))) return [3 /*break*/, 2];
93
- return [4 /*yield*/, errorResponse.response.json()];
94
- case 1:
95
- jsonResponse = (_a.sent());
96
- setPersistAsyncValidationMessages(jsonResponse.validation || {});
97
- setPersistAsyncValidations([props.schema.persistAsync.param]);
98
- _a.label = 2;
99
- case 2:
100
- props.onChange({ model: null, triggerSchema: props.schema, triggerModel: null });
101
- setChanged(true);
102
- trackEvent('Dynamic Flow - PersistAsync', { status: 'failure', schemaId: props.schema.$id });
103
- return [2 /*return*/];
104
- }
105
- });
106
- }); };
107
- var onCancel = function () {
108
- setPersistAsyncValidations(null);
109
- props.onChange({ model: null, triggerSchema: props.schema, triggerModel: null });
110
- setChanged(true);
111
- };
112
- var _e = props.schema.persistAsync, url = _e.url, method = _e.method;
113
- var combinedValidations = persistAsyncValidations || validations;
114
- var formGroupClasses = {
115
- 'form-group': true,
116
- 'has-error': (props.submitted || changed) && !!combinedValidations.length
117
- };
118
- return (_jsxs("div", __assign({ className: classNames(formGroupClasses) }, { children: [_jsx(UploadInputAdapter, __assign({ id: props.schema.$id ||
119
- props.schema.persistAsync.schema.$id ||
120
- props.schema.persistAsync.idProperty,
121
- // TODO: LOW avoid type assertion -- model can be null, but fileId must be number | string -- or maybe make fileId: string| number | undefined
122
- fileId: props.model, idProperty: props.schema.persistAsync.idProperty, animationDelay: 0, maxSize: props.schema.persistAsync.schema.maxSize, usLabel: props.schema.title || props.schema.persistAsync.schema.title, usPlaceholder: props.schema.description || props.schema.persistAsync.schema.description, httpOptions: { url: url, method: method, fileInputName: props.schema.persistAsync.param }, fetcher: fetcher, onSuccess: onSuccess, onFailure: onFailure, onCancel: onCancel }, mapSchemaToUploadOptions(props.schema.persistAsync.schema))), _jsx(ControlFeedback, { blurred: true, focused: false, changed: changed, submitted: props.submitted, errors: props.errors, schema: props.schema, validations: combinedValidations, validationMessages: __assign({ required: 'Value is required...' }, persistAsyncValidationMessages), infoMessage: null })] })));
123
- };
124
- PersistAsyncBlobSchema.defaultProps = {
125
- required: false
126
- };
127
- export default PersistAsyncBlobSchema;
@@ -1,16 +0,0 @@
1
- import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
2
- import { PersistAsync } from '../../../dynamic-flow-types';
3
- import { Fetcher } from '../../../schema';
4
- type Props = UploadProps & {
5
- id: string;
6
- fetcher: Fetcher;
7
- fileId: number | string;
8
- idProperty: string;
9
- httpOptions: {
10
- url: string;
11
- method?: PersistAsync['method'];
12
- fileInputName?: string;
13
- };
14
- };
15
- export declare const UploadInputAdapter: (props: Props) => JSX.Element;
16
- export {};
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Status, UploadInput } from '@transferwise/components';
3
- import { useMemo } from 'react';
4
- import { useTracking } from '../../../common/tracking';
5
- import { toKilobytes } from '../../../common/utils/file-utils';
6
- export var UploadInputAdapter = function (props) {
7
- var id = props.id, _a = props.fetcher, fetcher = _a === void 0 ? fetch : _a, httpOptions = props.httpOptions, fileId = props.fileId, idProperty = props.idProperty, usAccept = props.usAccept, maxSize = props.maxSize, usPlaceholder = props.usPlaceholder, onSuccess = props.onSuccess, onFailure = props.onFailure, onCancel = props.onCancel;
8
- var trackEvent = useTracking();
9
- var files = useMemo(function () { return (fileId ? [{ id: fileId, status: Status.SUCCEEDED }] : []); }, [fileId]);
10
- var uploadFile = function (formData) {
11
- trackEvent('Dynamic Flow - PersistAsync', { status: 'pending', schemaId: id });
12
- return fetcher("".concat(httpOptions.url), {
13
- method: httpOptions.method || 'POST',
14
- body: formData
15
- }).then(function (response) {
16
- if (response.ok) {
17
- onSuccess && onSuccess(response.clone());
18
- return response.json().then(function (responseBody) {
19
- return { id: responseBody[idProperty] };
20
- });
21
- }
22
- else {
23
- onFailure && onFailure({ response: response });
24
- return Promise.reject();
25
- }
26
- });
27
- };
28
- return (_jsx(UploadInput, { id: id, fileInputName: httpOptions.fileInputName, files: files, uploadButtonTitle: props.usLabel, sizeLimit: maxSize ? toKilobytes(maxSize) : undefined, fileTypes: usAccept, description: usPlaceholder, onUploadFile: uploadFile, onDeleteFile: function (_id) {
29
- onCancel && onCancel();
30
- return Promise.resolve();
31
- } }));
32
- };
@@ -1 +0,0 @@
1
- export { default } from './PersistAsyncBlobSchema';
@@ -1 +0,0 @@
1
- export { default } from './PersistAsyncBlobSchema';
@@ -1,2 +0,0 @@
1
- export { default } from './PersistAsyncSchema';
2
- export type { PersistAsyncSchemaProps } from './PersistAsyncSchema';
@@ -1 +0,0 @@
1
- export { default } from './PersistAsyncSchema';
@@ -1,8 +0,0 @@
1
- import { ObjectModel, OneOfObjectSchema } from '../../dynamic-flow-types';
2
- import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
- declare const PromotedOneOfSchema: (props: PromotedOneOfSchemaProps) => JSX.Element;
4
- export type PromotedOneOfSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model'> & {
5
- schema: OneOfObjectSchema;
6
- model: ObjectModel | null;
7
- };
8
- export default PromotedOneOfSchema;
@@ -1,72 +0,0 @@
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
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
- if (ar || !(i in from)) {
15
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
- ar[i] = from[i];
17
- }
18
- }
19
- return to.concat(ar || Array.prototype.slice.call(from));
20
- };
21
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
22
- import { useState } from 'react';
23
- import DynamicAlert from '../../layout/alert';
24
- import GenericSchema from '../genericSchema';
25
- import ObjectSchema from '../objectSchema';
26
- import { getSelectionFromModel } from './PromotedOneOfSchemaModelMatcher';
27
- import PromotedOneOfControl from './control/PromotedOneOfControl';
28
- var isPromoted = function (schema) { return schema.promoted === true; };
29
- var PromotedOneOfSchema = function (props) {
30
- var _a;
31
- // TODO: LOW avoid type assertion -- actually non-null assertion operator: props.model!
32
- var _b = useState(getSelectionFromModel(props.schema, props.model) ||
33
- ((_a = props.schema.promotion) === null || _a === void 0 ? void 0 : _a["default"]) ||
34
- 'promoted'), selection = _b[0], setSelection = _b[1];
35
- var promotedAlert = props.schema.alert;
36
- var promotedOneOf = props.schema.oneOf.find(isPromoted);
37
- // TODO: LOW avoid type assertion -- actually non-null assertion operator
38
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
39
- var promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
40
- var otherOneOf = getOtherOneOf(props.schema);
41
- return (_jsxs(_Fragment, { children: [promotedAlert && _jsx(DynamicAlert, { component: promotedAlert }), _jsx(PromotedOneOfControl, { id: props.schema.$id, title: props.schema.title,
42
- // TODO: LOW avoid type assertion -- actually non-null assertion operator
43
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
- promotedOneOf: promotedOneOf,
45
- // TODO: LOW avoid type assertion -- actually non-null assertion operator
46
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
47
- promotion: props.schema.promotion, selection: selection, setSelection: setSelection }), selection === 'promoted' && _jsx(ObjectSchema, __assign({}, props, { schema: promotedObjectSchema })), selection === 'other' && _jsx(GenericSchema, __assign({}, props, { schema: otherOneOf }))] }));
48
- };
49
- function getPromotedObjectSchema(promotedSchema) {
50
- return __assign(__assign({}, promotedSchema), {
51
- // We don't need to show these since they are already displayed in the radio option
52
- title: undefined, description: undefined });
53
- }
54
- function getOtherOneOf(schema) {
55
- var _a, _b, _c;
56
- var other = ((_a = schema.promotion) === null || _a === void 0 ? void 0 : _a.displayTwice)
57
- ? __spreadArray([], schema.oneOf, true) : schema.oneOf.filter(function (one) { return !isPromoted(one); });
58
- var title = (_c = (_b = schema.promotion) === null || _b === void 0 ? void 0 : _b.other.heading) === null || _c === void 0 ? void 0 : _c.text;
59
- if (other.length === 1) {
60
- return __assign(__assign({}, other[0]), { title: title });
61
- }
62
- if (other.length > 1) {
63
- return {
64
- title: title,
65
- oneOf: other,
66
- // TODO: LOW avoid type assertion -- the spec does not recognise a `control` property in ObjectSchema
67
- control: schema.control
68
- };
69
- }
70
- return null;
71
- }
72
- export default PromotedOneOfSchema;
@@ -1,2 +0,0 @@
1
- import { ObjectModel, OneOfObjectSchema } from '../../dynamic-flow-types';
2
- export declare const getSelectionFromModel: (schema: OneOfObjectSchema, model: ObjectModel) => "promoted" | "other" | null;
@@ -1,8 +0,0 @@
1
- import { getBestMatchingSchemaIndexForValue } from '../oneOfSchema/getBestMatchingSchemaIndexForValue';
2
- export var getSelectionFromModel = function (schema, model) {
3
- var index = getBestMatchingSchemaIndexForValue(schema, model);
4
- if (index !== null) {
5
- return schema.oneOf[index].promoted ? 'promoted' : 'other';
6
- }
7
- return null;
8
- };
@@ -1,6 +0,0 @@
1
- import { PromotedOneOfControlProps } from './PromotedOneOfControl';
2
- declare const PromotedOneOfCheckboxControl: {
3
- (props: PromotedOneOfControlProps): JSX.Element;
4
- defaultProps: {};
5
- };
6
- export default PromotedOneOfCheckboxControl;
@@ -1,27 +0,0 @@
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
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Checkbox } from '@transferwise/components';
14
- var PromotedOneOfCheckboxControl = function (props) {
15
- var id = props.id, selection = props.selection, setSelection = props.setSelection;
16
- var _a = props.promotion, promoted = _a.promoted, other = _a.other, checkedMeans = _a.checkedMeans;
17
- var title = checkedMeans === 'other' ? other.title : (promoted === null || promoted === void 0 ? void 0 : promoted.title) || props.promotedOneOf.title;
18
- var selectionWhenChecked = checkedMeans === 'other' ? 'other' : 'promoted';
19
- var selectionWhenUnchecked = checkedMeans === 'other' ? 'promoted' : 'other';
20
- var checked = selection === selectionWhenChecked;
21
- var toggleSelection = function () {
22
- setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
23
- };
24
- return (_jsx("div", __assign({ className: "form-group" }, { children: _jsx(Checkbox, { id: id, label: title, checked: checked, onChange: toggleSelection }) })));
25
- };
26
- PromotedOneOfCheckboxControl.defaultProps = {};
27
- export default PromotedOneOfCheckboxControl;
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- import { Icon, Image, Promotion } from '../../../dynamic-flow-types';
3
- declare const PromotedOneOfControl: {
4
- (props: PromotedOneOfControlProps): JSX.Element;
5
- defaultProps: {
6
- id: string;
7
- title: undefined;
8
- };
9
- };
10
- export type PromotedOneOfControlProps = {
11
- id?: string;
12
- title?: string;
13
- promotedOneOf: {
14
- title?: string;
15
- description?: string;
16
- image?: Image;
17
- icon?: Icon;
18
- };
19
- promotion: Promotion;
20
- selection: string;
21
- setSelection: React.Dispatch<React.SetStateAction<'promoted' | 'other'>>;
22
- };
23
- export default PromotedOneOfControl;
@@ -1,31 +0,0 @@
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
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
13
- import { generateRandomId } from '../../../common/utils/generate-random-id';
14
- import PromotedOneOfCheckboxControl from './PromotedOneOfCheckboxControl';
15
- import PromotedOneOfRadioControl from './PromotedOneOfRadioControl';
16
- var PromotedOneOfControl = function (props) {
17
- var controlType = props.promotion.control || 'radio';
18
- switch (controlType) {
19
- case 'radio':
20
- return _jsx(PromotedOneOfRadioControl, __assign({}, props));
21
- case 'checkbox':
22
- return _jsx(PromotedOneOfCheckboxControl, __assign({}, props));
23
- default:
24
- return _jsx(_Fragment, {});
25
- }
26
- };
27
- PromotedOneOfControl.defaultProps = {
28
- id: generateRandomId(),
29
- title: undefined
30
- };
31
- export default PromotedOneOfControl;
@@ -1,8 +0,0 @@
1
- import { PromotedOneOfControlProps } from './PromotedOneOfControl';
2
- declare const PromotedOneOfRadioControl: {
3
- (props: PromotedOneOfControlProps): JSX.Element;
4
- defaultProps: {
5
- title: undefined;
6
- };
7
- };
8
- export default PromotedOneOfRadioControl;
@@ -1,32 +0,0 @@
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
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { RadioGroup } from '@transferwise/components';
14
- import { mapAvatar, mapIconToAvatar } from '../../schemaFormControl/optionMapper';
15
- var PromotedOneOfRadioControl = function (props) {
16
- var _a, _b;
17
- var id = props.id, selection = props.selection, setSelection = props.setSelection, promotion = props.promotion, promotedOneOf = props.promotedOneOf, title = props.title;
18
- var radios = [
19
- __assign(__assign({ value: 'promoted',
20
- // TODO: LOW avoid type assertion below the expression may be nullish, but "label" cannot be
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 }, mapIconToAvatar(promotedOneOf.icon)), mapAvatar(promotedOneOf.image)),
22
- __assign(__assign({ value: 'other', label: promotion.other.title, secondary: promotion.other.description }, mapIconToAvatar(promotion.other.icon)), mapAvatar(promotion.other.image)),
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,
25
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
26
- // @ts-expect-error -- TODO: avoid @ts-ignore -- apparently RadioGroup does not expect an id prop
27
- id: id, onChange: setSelection })] })));
28
- };
29
- PromotedOneOfRadioControl.defaultProps = {
30
- title: undefined
31
- };
32
- export default PromotedOneOfRadioControl;
@@ -1,2 +0,0 @@
1
- export { default } from './PromotedOneOfSchema';
2
- export type { PromotedOneOfSchemaProps } from './PromotedOneOfSchema';
@@ -1 +0,0 @@
1
- export { default } from './PromotedOneOfSchema';
@@ -1,7 +0,0 @@
1
- import { Model, Schema } from '../../dynamic-flow-types';
2
- type ReadOnlySchemaProps = {
3
- schema: Schema;
4
- model: Model;
5
- };
6
- declare const ReadOnlySchema: ({ schema, model }: ReadOnlySchemaProps) => JSX.Element;
7
- export default ReadOnlySchema;
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { DefinitionList, Layout } from '@transferwise/components';
3
- import { isBoolean } from '@transferwise/neptune-validation';
4
- import { useIntl } from 'react-intl';
5
- import { isBasicSchema, isOneOfSchema } from '../../dynamic-flow-types';
6
- import { getCurrencyFlag } from '../schemaFormControl/availableCurrencyFlags';
7
- import messages from './ReadOnlySchema.messages';
8
- var ReadOnlySchema = function (_a) {
9
- var schema = _a.schema, model = _a.model;
10
- var _b = schema.title, title = _b === void 0 ? '' : _b;
11
- var formatMessage = useIntl().formatMessage;
12
- var value = getValueForSchema({ schema: schema, model: model, formatMessage: formatMessage });
13
- // FIXME: This is a workaround for the fact that the DefinitionList component value prop doesn't match Model
14
- return (_jsx(DefinitionList, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title: title, value: value, key: '' }] }));
15
- };
16
- export default ReadOnlySchema;
17
- function getValueForSchema(_a) {
18
- var schema = _a.schema, model = _a.model, formatMessage = _a.formatMessage;
19
- if (isBasicSchema(schema)) {
20
- if (isOneOfSchema(schema)) {
21
- return getValueFromOneOfSchema(schema, model);
22
- }
23
- else {
24
- if (schema.type === 'boolean' && isBoolean(model)) {
25
- return model ? formatMessage(messages.yes) : formatMessage(messages.no);
26
- }
27
- else {
28
- return (model && model.toString()) || '';
29
- }
30
- }
31
- }
32
- return '';
33
- }
34
- function getValueFromOneOfSchema(schema, model) {
35
- var option = getSelectedOneOf(schema, model);
36
- // FIXME Remove type assertion
37
- return option ? getValueFromOption(option) : model;
38
- }
39
- function getSelectedOneOf(schema, model) {
40
- return schema.oneOf.find(function (childSchema) {
41
- return 'const' in childSchema ? model === childSchema["const"] : false;
42
- });
43
- }
44
- function getValueFromOption(option) {
45
- var text = option.title && option.description
46
- ? "".concat(option.title, " - ").concat(option.description)
47
- : option.title || '';
48
- var currencyFlag = getCurrencyFlagFromOption(option);
49
- return currencyFlag ? (_jsxs(_Fragment, { children: [currencyFlag, " ", text] })) : (text);
50
- }
51
- function getCurrencyFlagFromOption(option) {
52
- var _a, _b;
53
- var currency = (_b = getCurrencyFlag((_a = option.icon) === null || _a === void 0 ? void 0 : _a.name)) === null || _b === void 0 ? void 0 : _b.currency;
54
- return currency ? _jsx("i", { className: "currency-flag currency-flag-".concat(currency, " hidden-xs") }) : null;
55
- }
@@ -1,16 +0,0 @@
1
- declare namespace _default {
2
- namespace yes {
3
- const id: string;
4
- const defaultMessage: string;
5
- const description: string;
6
- }
7
- namespace no {
8
- const id_1: string;
9
- export { id_1 as id };
10
- const defaultMessage_1: string;
11
- export { defaultMessage_1 as defaultMessage };
12
- const description_1: string;
13
- export { description_1 as description };
14
- }
15
- }
16
- export default _default;
@@ -1,13 +0,0 @@
1
- import { defineMessages } from 'react-intl';
2
- export default defineMessages({
3
- yes: {
4
- id: 'dynamicFlows.ReadOnlySchema.yes',
5
- defaultMessage: 'Yes',
6
- description: 'Yes, used for boolean schemas with a value of true.'
7
- },
8
- no: {
9
- id: 'dynamicFlows.ReadOnlySchema.no',
10
- defaultMessage: 'No',
11
- description: 'No: used for boolean schemas with a value of false.'
12
- }
13
- });
@@ -1 +0,0 @@
1
- export { default } from './ReadOnlySchema';
@@ -1 +0,0 @@
1
- export { default } from './ReadOnlySchema';
@@ -1,24 +0,0 @@
1
- import { FormControlType } from '../../common';
2
- import { BasicModel, Schema } from '../../dynamic-flow-types';
3
- export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
4
- declare const SchemaFormControl: {
5
- (props: SchemaFormControlProps): JSX.Element;
6
- defaultProps: {
7
- value: null;
8
- onFocus: null;
9
- onBlur: null;
10
- onSearchChange: null;
11
- disabled: boolean;
12
- };
13
- };
14
- type SchemaFormControlProps = {
15
- id: string;
16
- value: BasicModel | null;
17
- schema: Schema;
18
- onChange: (model: BasicModel | null, type?: 'init' | 'user') => void;
19
- onFocus?: () => void;
20
- onBlur?: () => void;
21
- onSearchChange?: (searchValue: string) => void;
22
- disabled?: boolean;
23
- };
24
- export default SchemaFormControl;