@wise/dynamic-flow-client 0.4.0 → 0.4.2

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 (233) hide show
  1. package/build/common/constants/DateMode.js +2 -2
  2. package/build/common/constants/FormControlType.js +2 -2
  3. package/build/common/constants/MonthFormat.js +2 -2
  4. package/build/common/constants/SchemaType.js +2 -2
  5. package/build/common/constants/Size.js +2 -2
  6. package/build/common/constants/index.js +1 -1
  7. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +15 -27
  8. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +11 -9
  9. package/build/common/contexts/eventsContext/EventsContext.js +11 -28
  10. package/build/common/contexts/fetcherContexts/FetcherContexts.js +14 -27
  11. package/build/common/contexts/index.js +1 -1
  12. package/build/common/contexts/logContext/LogContext.js +12 -30
  13. package/build/common/hooks/index.js +1 -1
  14. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +3 -3
  15. package/build/common/hooks/useExternal/useExternal.js +8 -8
  16. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +20 -31
  17. package/build/common/hooks/usePersistAsync/usePersistAsync.js +60 -139
  18. package/build/common/hooks/usePolling/usePolling.js +20 -21
  19. package/build/common/hooks/usePrevious/usePrevious.js +5 -5
  20. package/build/common/hooks/useStepPolling/useStepPolling.js +15 -14
  21. package/build/common/makeFetcher/index.js +1 -1
  22. package/build/common/makeFetcher/makeFetcher.js +10 -24
  23. package/build/common/messages.js +5 -5
  24. package/build/common/utils/api-utils.js +3 -4
  25. package/build/common/utils/date-utils.js +11 -11
  26. package/build/common/utils/debounce.js +11 -15
  27. package/build/common/utils/file-utils.js +12 -25
  28. package/build/common/utils/id-utils.js +4 -5
  29. package/build/common/utils/index.js +1 -1
  30. package/build/common/utils/is-equal.js +8 -8
  31. package/build/common/utils/schema-utils.js +6 -6
  32. package/build/common/utils/step-utils.js +14 -14
  33. package/build/common/validators/index.js +7 -7
  34. package/build/common/validators/models/model-validators.js +8 -8
  35. package/build/common/validators/models/models.utils.js +29 -42
  36. package/build/common/validators/schemas/schema-validators.js +11 -13
  37. package/build/common/validators/types/type-validators.js +9 -13
  38. package/build/common/validators/validationFailures/validation-failures.js +14 -14
  39. package/build/common/validators/validationFailures/validation-failures.utils.js +5 -7
  40. package/build/common/validators/values/value-validators.js +4 -6
  41. package/build/dynamicFlow/DynamicFlow.js +185 -307
  42. package/build/dynamicFlow/DynamicFlowStep.js +12 -23
  43. package/build/dynamicFlow/DynamicFlowTypes.js +1 -1
  44. package/build/dynamicFlow/index.js +6 -14
  45. package/build/dynamicFlow/stories/DynamicFlow.story.js +20 -20
  46. package/build/dynamicFlow/stories/EditableDynamicFlow.js +20 -33
  47. package/build/dynamicFlow/stories/fixtureFetcher.js +46 -104
  48. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +22 -40
  49. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +6 -6
  50. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +10 -11
  51. package/build/dynamicFlow/utils/index.js +5 -2
  52. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +53 -118
  53. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +9 -9
  54. package/build/dynamicFlow/utils/useDynamicFlowState.js +51 -74
  55. package/build/dynamicFlow/utils/useLoader.js +9 -20
  56. package/build/fixtures/components/alert.js +8 -8
  57. package/build/fixtures/components/box.js +7 -7
  58. package/build/fixtures/components/button.js +25 -36
  59. package/build/fixtures/components/columns.js +10 -10
  60. package/build/fixtures/components/copyable.js +6 -6
  61. package/build/fixtures/components/decision.js +15 -15
  62. package/build/fixtures/components/heading.js +7 -7
  63. package/build/fixtures/components/image.js +10 -10
  64. package/build/fixtures/components/index.js +17 -25
  65. package/build/fixtures/components/info.js +22 -6
  66. package/build/fixtures/components/list.js +8 -8
  67. package/build/fixtures/components/loading-indicator.js +5 -5
  68. package/build/fixtures/components/paragraph.js +9 -9
  69. package/build/fixtures/components/review.js +11 -11
  70. package/build/fixtures/examples/camera-capture.js +29 -29
  71. package/build/fixtures/examples/index.js +9 -17
  72. package/build/fixtures/examples/recipient-update.js +69 -69
  73. package/build/fixtures/examples/recipient.js +63 -63
  74. package/build/fixtures/examples/single-file-upload.js +21 -21
  75. package/build/fixtures/examples/step-validation-errors.js +21 -21
  76. package/build/fixtures/features/action-response.js +8 -8
  77. package/build/fixtures/features/external.js +8 -8
  78. package/build/fixtures/features/index.js +9 -17
  79. package/build/fixtures/features/persist-async.js +11 -11
  80. package/build/fixtures/features/polling.js +9 -9
  81. package/build/fixtures/features/validation-async.js +10 -10
  82. package/build/fixtures/index.js +11 -22
  83. package/build/fixtures/jsonSchemaForm/allOf.js +30 -30
  84. package/build/fixtures/jsonSchemaForm/audRecipient.js +271 -271
  85. package/build/fixtures/jsonSchemaForm/currency.js +12 -12
  86. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +11 -11
  87. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +11 -11
  88. package/build/fixtures/jsonSchemaForm/oneOf.js +27 -27
  89. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +16 -16
  90. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +17 -17
  91. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +30 -30
  92. package/build/fixtures/jsonSchemaForm/simple.js +16 -16
  93. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +19 -19
  94. package/build/fixtures/jsonSchemaForm/validationAsync.js +8 -8
  95. package/build/fixtures/layouts/all.js +37 -37
  96. package/build/fixtures/layouts/final-step-layout.js +9 -9
  97. package/build/fixtures/layouts/index.js +10 -18
  98. package/build/fixtures/layouts/list.js +10 -10
  99. package/build/fixtures/layouts/pay-in.js +23 -23
  100. package/build/fixtures/layouts/review.js +38 -38
  101. package/build/fixtures/layouts/success.js +15 -15
  102. package/build/fixtures/responses/action-response-final.js +8 -8
  103. package/build/fixtures/responses/action.js +3 -3
  104. package/build/fixtures/responses/exit.js +3 -3
  105. package/build/fixtures/responses/index.js +8 -16
  106. package/build/fixtures/responses/recipient-update-final.js +8 -8
  107. package/build/fixtures/schemas/basic-form.js +11 -11
  108. package/build/fixtures/schemas/index.js +8 -16
  109. package/build/fixtures/schemas/number-and-integer.js +11 -11
  110. package/build/fixtures/schemas/one-of.js +43 -46
  111. package/build/fixtures/schemas/string-formats.js +15 -15
  112. package/build/fixtures/utils/image-util.js +8 -8
  113. package/build/formControl/FormControl.js +118 -148
  114. package/build/formControl/index.js +6 -14
  115. package/build/formControl/utils/index.js +1 -1
  116. package/build/formControl/utils/value-utils.js +18 -23
  117. package/build/i18n/index.js +31 -31
  118. package/build/index.js +13 -10
  119. package/build/jsonSchemaForm/JsonSchemaForm.js +12 -24
  120. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +24 -37
  121. package/build/jsonSchemaForm/allOfSchema/index.js +6 -14
  122. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +9 -20
  123. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +9 -20
  124. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +6 -14
  125. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +56 -115
  126. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +7 -7
  127. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +6 -14
  128. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +1 -1
  129. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +19 -71
  130. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +10 -11
  131. package/build/jsonSchemaForm/arrayTypeSchema/index.js +6 -14
  132. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +45 -62
  133. package/build/jsonSchemaForm/basicTypeSchema/index.js +6 -14
  134. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +39 -50
  135. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +18 -18
  136. package/build/jsonSchemaForm/controlFeedback/index.js +6 -14
  137. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +52 -61
  138. package/build/jsonSchemaForm/genericSchema/index.js +6 -14
  139. package/build/jsonSchemaForm/help/Help.js +9 -9
  140. package/build/jsonSchemaForm/help/Help.messages.js +5 -5
  141. package/build/jsonSchemaForm/help/index.js +6 -14
  142. package/build/jsonSchemaForm/index.js +6 -14
  143. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +28 -49
  144. package/build/jsonSchemaForm/objectSchema/index.js +6 -14
  145. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +54 -74
  146. package/build/jsonSchemaForm/oneOfSchema/index.js +6 -14
  147. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +3 -3
  148. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +1 -1
  149. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +19 -20
  150. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +11 -22
  151. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +5 -5
  152. package/build/jsonSchemaForm/persistAsyncSchema/index.js +6 -14
  153. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +73 -127
  154. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +6 -14
  155. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +45 -110
  156. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +17 -17
  157. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +6 -14
  158. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +28 -47
  159. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +6 -14
  160. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +4 -4
  161. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +13 -24
  162. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +11 -22
  163. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +12 -23
  164. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +24 -26
  165. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +6 -6
  166. package/build/jsonSchemaForm/readOnlySchema/index.js +6 -14
  167. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +26 -39
  168. package/build/jsonSchemaForm/schemaFormControl/index.js +6 -14
  169. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +5 -5
  170. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +1 -1
  171. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +30 -47
  172. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +57 -119
  173. package/build/jsonSchemaForm/validationAsyncSchema/index.js +6 -14
  174. package/build/layout/DynamicLayout.js +10 -21
  175. package/build/layout/alert/DynamicAlert.js +9 -9
  176. package/build/layout/box/DynamicBox.js +12 -23
  177. package/build/layout/button/DynamicButton.js +16 -27
  178. package/build/layout/columns/DynamicColumns.js +13 -24
  179. package/build/layout/decision/DynamicDecision.js +16 -27
  180. package/build/layout/divider/DynamicDivider.js +7 -8
  181. package/build/layout/external/DynamicExternal.js +16 -28
  182. package/build/layout/external/DynamicExternal.messages.js +5 -5
  183. package/build/layout/form/DynamicForm.js +10 -21
  184. package/build/layout/heading/DynamicHeading.js +12 -23
  185. package/build/layout/icon/DynamicIcon.js +9 -10
  186. package/build/layout/image/DynamicImage.js +43 -93
  187. package/build/layout/index.js +21 -29
  188. package/build/layout/info/DynamicInfo.js +7 -19
  189. package/build/layout/list/DynamicList.js +14 -26
  190. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +8 -9
  191. package/build/layout/paragraph/DynamicParagraph.js +19 -37
  192. package/build/layout/paragraph/DynamicParagraph.messages.js +6 -6
  193. package/build/layout/paragraph/useSnackBarIfAvailable.js +4 -4
  194. package/build/layout/review/DynamicReview.js +14 -26
  195. package/build/layout/utils.js +4 -6
  196. package/build/step/cameraStep/CameraStep.js +42 -88
  197. package/build/step/cameraStep/cameraCapture/CameraCapture.js +48 -105
  198. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +7 -7
  199. package/build/step/cameraStep/cameraCapture/components/index.js +10 -28
  200. package/build/step/cameraStep/cameraCapture/hooks/index.js +17 -72
  201. package/build/step/cameraStep/cameraCapture/index.js +6 -14
  202. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +33 -45
  203. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +8 -19
  204. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +6 -6
  205. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +9 -21
  206. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +7 -7
  207. package/build/step/cameraStep/cameraCapture/screens/index.js +6 -14
  208. package/build/step/cameraStep/cameraCapture/tracking/index.js +17 -99
  209. package/build/step/cameraStep/cameraCapture/utils/index.js +33 -96
  210. package/build/step/cameraStep/index.js +6 -14
  211. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +20 -21
  212. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +8 -8
  213. package/build/step/externalConfirmationStep/index.js +6 -14
  214. package/build/step/index.js +7 -15
  215. package/build/step/layoutStep/LayoutStep.js +19 -19
  216. package/build/step/layoutStep/index.js +6 -14
  217. package/build/step/layoutStep/utils/index.js +3 -14
  218. package/build/step/layoutStep/utils/inline-reference-utils.js +29 -46
  219. package/build/step/layoutStep/utils/layout-utils.js +34 -53
  220. package/build/types/common/FormControl.js +1 -1
  221. package/build/types/index.js +13 -13
  222. package/build/types/specification/Action.js +1 -1
  223. package/build/types/specification/FileUploadSchema.js +1 -1
  224. package/build/types/specification/LayoutComponent.js +1 -1
  225. package/build/types/specification/Model.js +9 -17
  226. package/build/types/specification/PersistAsync.js +1 -1
  227. package/build/types/specification/Polling.js +1 -1
  228. package/build/types/specification/Promotion.js +1 -1
  229. package/build/types/specification/Schema.js +8 -8
  230. package/build/types/specification/Step.js +3 -5
  231. package/build/types/specification/ValidationAsync.js +1 -1
  232. package/build/types/specification/core.js +1 -1
  233. package/package.json +1 -1
@@ -1,90 +1,38 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constructUploadError = exports.constructUploadResponse = exports.createPayload = void 0;
4
+ const utils_1 = require("../../../../../common/utils");
5
+ const validators_1 = require("../../../../../common/validators");
6
+ async function createPayload(userUploadedFile, isBlobSchema) {
7
+ if (isBlobSchema) {
8
+ return userUploadedFile;
9
+ }
10
+ else {
11
+ if (userUploadedFile instanceof Blob) {
12
+ return (0, utils_1.toBase64)(userUploadedFile);
8
13
  }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- 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;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
14
+ throw new Error('Error creating payload for MultipleFileUploadSchema. Uploaded file is not an instance of Blob.');
47
15
  }
48
- };
49
- exports.__esModule = true;
50
- exports.constructUploadError = exports.constructUploadResponse = exports.createPayload = void 0;
51
- var utils_1 = require("../../../../../common/utils");
52
- var validators_1 = require("../../../../../common/validators");
53
- function createPayload(userUploadedFile, isBlobSchema) {
54
- return __awaiter(this, void 0, void 0, function () {
55
- return __generator(this, function (_a) {
56
- if (isBlobSchema) {
57
- return [2 /*return*/, userUploadedFile];
58
- }
59
- else {
60
- if (userUploadedFile instanceof Blob) {
61
- return [2 /*return*/, (0, utils_1.toBase64)(userUploadedFile)];
62
- }
63
- throw new Error('Error creating payload for MultipleFileUploadSchema. Uploaded file is not an instance of Blob.');
64
- }
65
- return [2 /*return*/];
66
- });
67
- });
68
16
  }
69
17
  exports.createPayload = createPayload;
70
18
  function constructUploadResponse(response) {
71
- var id = response.data;
72
- return __assign({ id: id }, response);
19
+ const id = response.data;
20
+ return Object.assign({ id }, response);
73
21
  }
74
22
  exports.constructUploadResponse = constructUploadResponse;
75
23
  function constructUploadError(response) {
76
- var isError = response instanceof Error;
77
- var hasValidData = (0, validators_1.isObject)(response) && 'data' in response;
78
- var isInvalidResponseData = !hasValidData && !isError;
24
+ const isError = response instanceof Error;
25
+ const hasValidData = (0, validators_1.isObject)(response) && 'data' in response;
26
+ const isInvalidResponseData = !hasValidData && !isError;
79
27
  if (isInvalidResponseData) {
80
28
  return (0, validators_1.isString)(response) ? response : undefined;
81
29
  }
82
30
  if (isError) {
83
- var error = response;
31
+ const error = response;
84
32
  return { id: (0, utils_1.generateRandomId)(), message: error.message };
85
33
  }
86
34
  else {
87
- return __assign({ message: (0, validators_1.isString)(response.message) ? response.message : '' }, response);
35
+ return Object.assign({ message: (0, validators_1.isString)(response.message) ? response.message : '' }, response);
88
36
  }
89
37
  }
90
38
  exports.constructUploadError = constructUploadError;
@@ -2,20 +2,19 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- exports.__esModule = true;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useFormattedDefaultErrorMessages = void 0;
7
- var react_intl_1 = require("react-intl");
8
- var messages_1 = __importDefault(require("../../../../../common/messages"));
9
- var MultipleFileUploadSchema_messages_1 = __importDefault(require("../MultipleFileUploadSchema.messages"));
10
- function useFormattedDefaultErrorMessages(_a) {
11
- var maxItems = _a.maxItems, minItems = _a.minItems;
12
- var formatMessage = (0, react_intl_1.useIntl)().formatMessage;
13
- var maxFileSizeError = MultipleFileUploadSchema_messages_1["default"].maxFileSizeError, maxItemsError = MultipleFileUploadSchema_messages_1["default"].maxItemsError, minItemsError = MultipleFileUploadSchema_messages_1["default"].minItemsError;
7
+ const react_intl_1 = require("react-intl");
8
+ const messages_1 = __importDefault(require("../../../../../common/messages"));
9
+ const MultipleFileUploadSchema_messages_1 = __importDefault(require("../MultipleFileUploadSchema.messages"));
10
+ function useFormattedDefaultErrorMessages({ maxItems, minItems, }) {
11
+ const { formatMessage } = (0, react_intl_1.useIntl)();
12
+ const { maxFileSizeError, maxItemsError, minItemsError } = MultipleFileUploadSchema_messages_1.default;
14
13
  return {
15
14
  maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
16
- maxItemsErrorMessage: formatMessage(maxItemsError, { maxItems: maxItems }),
17
- minItemsErrorMessage: formatMessage(minItemsError, { minItems: minItems }),
18
- requiredMessage: formatMessage(messages_1["default"].required)
15
+ maxItemsErrorMessage: formatMessage(maxItemsError, { maxItems }),
16
+ minItemsErrorMessage: formatMessage(minItemsError, { minItems }),
17
+ requiredMessage: formatMessage(messages_1.default.required),
19
18
  };
20
19
  }
21
20
  exports.useFormattedDefaultErrorMessages = useFormattedDefaultErrorMessages;
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
14
- exports["default"] = void 0;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
15
7
  var ArraySchema_1 = require("./ArraySchema");
16
- __createBinding(exports, ArraySchema_1, "default");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ArraySchema_1).default; } });
@@ -1,48 +1,33 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
- exports.__esModule = true;
17
- var jsx_runtime_1 = require("react/jsx-runtime");
18
- var classnames_1 = __importDefault(require("classnames"));
19
- var react_1 = require("react");
20
- var utils_1 = require("../../common/utils");
21
- var validators_1 = require("../../common/validators");
22
- var layout_1 = require("../../layout");
23
- var controlFeedback_1 = __importDefault(require("../controlFeedback"));
24
- var help_1 = __importDefault(require("../help"));
25
- var schemaFormControl_1 = __importDefault(require("../schemaFormControl"));
26
- var isNullish = function (value) {
27
- return (0, validators_1.isNull)(value) || (0, validators_1.isUndefined)(value);
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const classnames_1 = __importDefault(require("classnames"));
8
+ const react_1 = require("react");
9
+ const utils_1 = require("../../common/utils");
10
+ const validators_1 = require("../../common/validators");
11
+ const layout_1 = require("../../layout");
12
+ const controlFeedback_1 = __importDefault(require("../controlFeedback"));
13
+ const help_1 = __importDefault(require("../help"));
14
+ const schemaFormControl_1 = __importDefault(require("../schemaFormControl"));
15
+ const isNullish = (value) => (0, validators_1.isNull)(value) || (0, validators_1.isUndefined)(value);
16
+ const getDefaultValue = (schema) => {
17
+ return schema.type === 'boolean' && isNullish(schema.default) ? false : schema.default;
28
18
  };
29
- var getDefaultValue = function (schema) {
30
- return schema.type === 'boolean' && isNullish(schema["default"]) ? false : schema["default"];
31
- };
32
- var BasicTypeSchema = function (props) {
19
+ const BasicTypeSchema = (props) => {
33
20
  var _a, _b, _c;
34
- var onChange = function (newModel) {
21
+ const onChange = (newModel) => {
35
22
  setChanged(true);
36
23
  setModelAndBroadcast(sanitiseModel(newModel), 'user');
37
24
  };
38
- var getValidationKeys = function (newModel) {
39
- return (0, validators_1.getValidationFailures)(newModel, props.schema, props.required);
40
- }; // TODO: LOW avoid type assertion
41
- var setModelAndBroadcast = function (newModel, type) {
25
+ const getValidationKeys = (newModel) => (0, validators_1.getValidationFailures)(newModel, props.schema, props.required); // TODO: LOW avoid type assertion
26
+ const setModelAndBroadcast = (newModel, type) => {
42
27
  setModel(newModel);
43
- var validationKeys = getValidationKeys(newModel);
28
+ const validationKeys = getValidationKeys(newModel);
44
29
  setValidations(validationKeys);
45
- var broadcastModel = newModel;
30
+ const broadcastModel = newModel;
46
31
  setLastModel(broadcastModel);
47
32
  if (broadcastModel !== lastModel) {
48
33
  props.onChange({
@@ -50,59 +35,57 @@ var BasicTypeSchema = function (props) {
50
35
  triggerSchema: props.schema,
51
36
  triggerModel: broadcastModel,
52
37
  lastTriggerModel: lastModel,
53
- type: type
38
+ type,
54
39
  });
55
40
  }
56
41
  };
57
- var sanitiseModel = function (newModel) {
58
- return (0, validators_1.getValidBasicModelOrNull)(newModel, props.schema);
59
- };
60
- var onFocus = function () { return setFocused(true); };
61
- var onBlur = function () {
42
+ const sanitiseModel = (newModel) => (0, validators_1.getValidBasicModelOrNull)(newModel, props.schema);
43
+ const onFocus = () => setFocused(true);
44
+ const onBlur = () => {
62
45
  setFocused(false);
63
46
  setBlurred(true);
64
47
  if (props.onBlur) {
65
48
  props.onBlur();
66
49
  }
67
50
  };
68
- var _d = (0, react_1.useState)((_a = props.model) !== null && _a !== void 0 ? _a : null), model = _d[0], setModel = _d[1];
69
- var _e = (0, react_1.useState)((_b = props.model) !== null && _b !== void 0 ? _b : null), lastModel = _e[0], setLastModel = _e[1];
70
- var _f = (0, react_1.useState)(false), changed = _f[0], setChanged = _f[1];
71
- var _g = (0, react_1.useState)(false), focused = _g[0], setFocused = _g[1];
72
- var _h = (0, react_1.useState)(false), blurred = _h[0], setBlurred = _h[1];
73
- var _j = (0, react_1.useState)([]), validations = _j[0], setValidations = _j[1];
74
- var id = (0, react_1.useMemo)(function () { return props.schema.$id || (0, utils_1.generateRandomId)(); }, [props.schema.$id]);
75
- var onSchemaChange = function () {
76
- var defaultValue = getDefaultValue(props.schema);
51
+ const [model, setModel] = (0, react_1.useState)((_a = props.model) !== null && _a !== void 0 ? _a : null);
52
+ const [lastModel, setLastModel] = (0, react_1.useState)((_b = props.model) !== null && _b !== void 0 ? _b : null);
53
+ const [changed, setChanged] = (0, react_1.useState)(false);
54
+ const [focused, setFocused] = (0, react_1.useState)(false);
55
+ const [blurred, setBlurred] = (0, react_1.useState)(false);
56
+ const [validations, setValidations] = (0, react_1.useState)([]);
57
+ const id = (0, react_1.useMemo)(() => props.schema.$id || (0, utils_1.generateRandomId)(), [props.schema.$id]);
58
+ const onSchemaChange = () => {
59
+ const defaultValue = getDefaultValue(props.schema);
77
60
  // if no model, change to the default, only run this when the schema changes
78
61
  if (isNullish(model) && !isNullish(defaultValue)) {
79
62
  setModelAndBroadcast(defaultValue, 'init');
80
63
  }
81
- if (props.schema["const"]) {
82
- setModelAndBroadcast(props.schema["const"], 'init');
64
+ if (props.schema.const) {
65
+ setModelAndBroadcast(props.schema.const, 'init');
83
66
  }
84
67
  };
85
- var refreshValidations = function () {
68
+ const refreshValidations = () => {
86
69
  setValidations(getValidationKeys(model));
87
70
  };
88
- var isConst = props.schema["const"];
89
- var isHidden = props.schema.hidden || isConst;
71
+ const isConst = props.schema.const;
72
+ const isHidden = props.schema.hidden || isConst;
90
73
  (0, react_1.useEffect)(refreshValidations, [props.model, props.submitted]);
91
74
  (0, react_1.useEffect)(onSchemaChange, [props.schema]);
92
- (0, react_1.useEffect)(function () { var _a; return setModel((_a = props.model) !== null && _a !== void 0 ? _a : null); }, [props.model]);
93
- var formGroupClasses = {
75
+ (0, react_1.useEffect)(() => { var _a; return setModel((_a = props.model) !== null && _a !== void 0 ? _a : null); }, [props.model]);
76
+ const formGroupClasses = {
94
77
  'form-group': true,
95
78
  'has-error': ((props.submitted || !changed) && !!props.errors) ||
96
79
  ((props.submitted || (changed && blurred)) && !!validations.length),
97
- 'has-info': (focused && !!props.schema.description) || !!props.infoMessage
80
+ 'has-info': (focused && !!props.schema.description) || !!props.infoMessage,
98
81
  };
99
- var showLabel = props.schema.format !== 'file' && props.schema.type !== 'boolean';
100
- var schemaHelp = props.schema.help;
101
- return !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.alert && (0, jsx_runtime_1.jsx)(layout_1.DynamicAlert, { component: props.schema.alert }), (0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1["default"])(formGroupClasses) }, { children: [showLabel && ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "d-inline-block" }, { children: [(0, jsx_runtime_1.jsx)("label", __assign({ className: "control-label d-inline", htmlFor: id }, { children: props.schema.title })), !!schemaHelp && (0, jsx_runtime_1.jsx)(help_1["default"], { help: schemaHelp })] }))), !showLabel && !!schemaHelp && (0, jsx_runtime_1.jsx)(help_1["default"], { help: schemaHelp }), (0, jsx_runtime_1.jsx)(schemaFormControl_1["default"], { id: id, schema: props.schema, value: model, disabled: !!props.disabled, onChange: onChange, onFocus: onFocus, onBlur: onBlur }), (0, jsx_runtime_1.jsx)(controlFeedback_1["default"], { 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;
82
+ const showLabel = props.schema.format !== 'file' && props.schema.type !== 'boolean';
83
+ const schemaHelp = props.schema.help;
84
+ return !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.alert && (0, jsx_runtime_1.jsx)(layout_1.DynamicAlert, { component: props.schema.alert }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(formGroupClasses) }, { children: [showLabel && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "d-inline-block" }, { children: [(0, jsx_runtime_1.jsx)("label", Object.assign({ className: "control-label d-inline", htmlFor: id }, { children: props.schema.title })), !!schemaHelp && (0, jsx_runtime_1.jsx)(help_1.default, { help: schemaHelp })] }))), !showLabel && !!schemaHelp && (0, jsx_runtime_1.jsx)(help_1.default, { help: schemaHelp }), (0, jsx_runtime_1.jsx)(schemaFormControl_1.default, { id: id, schema: props.schema, value: model, disabled: !!props.disabled, onChange: onChange, onFocus: onFocus, onBlur: onBlur }), (0, jsx_runtime_1.jsx)(controlFeedback_1.default, { 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;
102
85
  };
103
86
  BasicTypeSchema.defaultProps = {
104
87
  required: false,
105
88
  disabled: false,
106
- onBlur: null
89
+ onBlur: null,
107
90
  };
108
- exports["default"] = BasicTypeSchema;
91
+ exports.default = BasicTypeSchema;
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
14
- exports["default"] = void 0;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
15
7
  var BasicTypeSchema_1 = require("./BasicTypeSchema");
16
- __createBinding(exports, BasicTypeSchema_1, "default");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(BasicTypeSchema_1).default; } });
@@ -1,84 +1,73 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
- exports.__esModule = true;
17
- var jsx_runtime_1 = require("react/jsx-runtime");
18
- var components_1 = require("@transferwise/components");
19
- var formatting_1 = require("@transferwise/formatting");
20
- var react_intl_1 = require("react-intl");
21
- var ControlFeedback_messages_1 = __importDefault(require("./ControlFeedback.messages"));
22
- var ControlFeedback = function (props) {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const components_1 = require("@transferwise/components");
8
+ const formatting_1 = require("@transferwise/formatting");
9
+ const react_intl_1 = require("react-intl");
10
+ const ControlFeedback_messages_1 = __importDefault(require("./ControlFeedback.messages"));
11
+ const ControlFeedback = (props) => {
23
12
  var _a;
24
- var defaultValidationMessages = useDefaultValidationMessages(props.schema);
25
- var validationMessages = __assign(__assign(__assign({}, defaultValidationMessages), props.validationMessages), props.schema.validationMessages);
26
- var isErrorVisible = (props.submitted || !props.changed) && !!props.errors;
27
- var isValidationVisible = !isErrorVisible &&
13
+ const defaultValidationMessages = useDefaultValidationMessages(props.schema);
14
+ const validationMessages = Object.assign(Object.assign(Object.assign({}, defaultValidationMessages), props.validationMessages), props.schema.validationMessages);
15
+ const isErrorVisible = (props.submitted || !props.changed) && !!props.errors;
16
+ const isValidationVisible = !isErrorVisible &&
28
17
  (props.submitted || (props.changed && props.blurred)) &&
29
18
  !!((_a = props.validations) === null || _a === void 0 ? void 0 : _a.length);
30
- var isDescriptionVisible = props.focused && props.schema.description && !isValidationVisible;
31
- var hasInfoMessage = !!props.infoMessage;
32
- return ((0, jsx_runtime_1.jsxs)("div", { children: [isErrorVisible ? (0, jsx_runtime_1.jsx)(components_1.InlineAlert, __assign({ type: "error" }, { children: props.errors })) : null, isValidationVisible ? ((0, jsx_runtime_1.jsx)(components_1.InlineAlert, __assign({ type: "error" }, { children: props.validations.map(function (validation) { return ((0, jsx_runtime_1.jsx)("div", { children: validationMessages[validation] }, validation)); }) }))) : null, (isDescriptionVisible || hasInfoMessage) && ((0, jsx_runtime_1.jsxs)(components_1.InlineAlert, __assign({ type: "info" }, { children: [isDescriptionVisible && (0, jsx_runtime_1.jsx)("div", { children: props.schema.description }), hasInfoMessage && (0, jsx_runtime_1.jsx)("div", { children: props.infoMessage })] })))] }));
19
+ const isDescriptionVisible = props.focused && props.schema.description && !isValidationVisible;
20
+ const hasInfoMessage = !!props.infoMessage;
21
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [isErrorVisible ? (0, jsx_runtime_1.jsx)(components_1.InlineAlert, Object.assign({ type: "error" }, { children: props.errors })) : null, isValidationVisible ? ((0, jsx_runtime_1.jsx)(components_1.InlineAlert, Object.assign({ type: "error" }, { children: props.validations.map((validation) => ((0, jsx_runtime_1.jsx)("div", { children: validationMessages[validation] }, validation))) }))) : null, (isDescriptionVisible || hasInfoMessage) && ((0, jsx_runtime_1.jsxs)(components_1.InlineAlert, Object.assign({ type: "info" }, { children: [isDescriptionVisible && (0, jsx_runtime_1.jsx)("div", { children: props.schema.description }), hasInfoMessage && (0, jsx_runtime_1.jsx)("div", { children: props.infoMessage })] })))] }));
33
22
  };
34
23
  ControlFeedback.defaultProps = {
35
24
  errors: '',
36
25
  validations: [],
37
26
  validationMessages: {},
38
- validationAsyncSuccessMessage: null
27
+ validationAsyncSuccessMessage: null,
39
28
  };
40
29
  // TODO: avoid typre assertions in this function
41
30
  function useDefaultValidationMessages(schema) {
42
- var _a = (0, react_intl_1.useIntl)(), formatMessage = _a.formatMessage, locale = _a.locale;
43
- var formattedMessages = {
44
- type: formatMessage(ControlFeedback_messages_1["default"].type),
45
- minimum: formatMessage(ControlFeedback_messages_1["default"].minimum, {
46
- minimum: schema.minimum
31
+ const { formatMessage, locale } = (0, react_intl_1.useIntl)();
32
+ const formattedMessages = {
33
+ type: formatMessage(ControlFeedback_messages_1.default.type),
34
+ minimum: formatMessage(ControlFeedback_messages_1.default.minimum, {
35
+ minimum: schema.minimum,
47
36
  }),
48
- maximum: formatMessage(ControlFeedback_messages_1["default"].maximum, {
49
- maximum: schema.maximum
37
+ maximum: formatMessage(ControlFeedback_messages_1.default.maximum, {
38
+ maximum: schema.maximum,
50
39
  }),
51
- minLength: formatMessage(ControlFeedback_messages_1["default"].minLength, {
52
- minLength: schema.minLength
40
+ minLength: formatMessage(ControlFeedback_messages_1.default.minLength, {
41
+ minLength: schema.minLength,
53
42
  }),
54
- maxLength: formatMessage(ControlFeedback_messages_1["default"].maxLength, {
55
- maxLength: schema.maxLength
43
+ maxLength: formatMessage(ControlFeedback_messages_1.default.maxLength, {
44
+ maxLength: schema.maxLength,
56
45
  }),
57
- pattern: formatMessage(ControlFeedback_messages_1["default"].pattern),
58
- required: formatMessage(ControlFeedback_messages_1["default"].required)
46
+ pattern: formatMessage(ControlFeedback_messages_1.default.pattern),
47
+ required: formatMessage(ControlFeedback_messages_1.default.required),
59
48
  };
60
49
  if (schema.format === 'date') {
61
- var dateOverrides = {
62
- pattern: formatMessage(ControlFeedback_messages_1["default"].patternDate),
50
+ const dateOverrides = {
51
+ pattern: formatMessage(ControlFeedback_messages_1.default.patternDate),
63
52
  minimum: schema.minimum
64
- ? formatMessage(ControlFeedback_messages_1["default"].minimumDate, {
53
+ ? formatMessage(ControlFeedback_messages_1.default.minimumDate, {
65
54
  minimum: (0, formatting_1.formatDate)(new Date(schema.minimum), locale, {
66
55
  timeZone: 'UTC',
67
- dateStyle: 'long'
68
- })
56
+ dateStyle: 'long',
57
+ }),
69
58
  })
70
59
  : undefined,
71
60
  maximum: schema.maximum
72
- ? formatMessage(ControlFeedback_messages_1["default"].maximumDate, {
61
+ ? formatMessage(ControlFeedback_messages_1.default.maximumDate, {
73
62
  maximum: (0, formatting_1.formatDate)(new Date(schema.maximum), locale, {
74
63
  timeZone: 'UTC',
75
- dateStyle: 'long'
76
- })
64
+ dateStyle: 'long',
65
+ }),
77
66
  })
78
- : undefined
67
+ : undefined,
79
68
  };
80
- return __assign(__assign({}, formattedMessages), dateOverrides);
69
+ return Object.assign(Object.assign({}, formattedMessages), dateOverrides);
81
70
  }
82
71
  return formattedMessages;
83
72
  }
84
- exports["default"] = ControlFeedback;
73
+ exports.default = ControlFeedback;
@@ -1,55 +1,55 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var react_intl_1 = require("react-intl");
4
- exports["default"] = (0, react_intl_1.defineMessages)({
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_intl_1 = require("react-intl");
4
+ exports.default = (0, react_intl_1.defineMessages)({
5
5
  type: {
6
6
  id: 'dynamicFlows.ControlFeedback.type',
7
7
  defaultMessage: 'Incorrect type',
8
- description: ''
8
+ description: '',
9
9
  },
10
10
  minimum: {
11
11
  id: 'dynamicFlows.ControlFeedback.minimum',
12
- defaultMessage: "Please enter a number that's {minimum} or more.",
13
- description: ''
12
+ defaultMessage: `Please enter a number that's {minimum} or more.`,
13
+ description: '',
14
14
  },
15
15
  maximum: {
16
16
  id: 'dynamicFlows.ControlFeedback.maximum',
17
- defaultMessage: "Please enter a number that's {maximum} or less.",
18
- description: ''
17
+ defaultMessage: `Please enter a number that's {maximum} or less.`,
18
+ description: '',
19
19
  },
20
20
  minLength: {
21
21
  id: 'dynamicFlows.ControlFeedback.minLength',
22
22
  defaultMessage: 'Please enter at least {minLength} characters.',
23
- description: ''
23
+ description: '',
24
24
  },
25
25
  maxLength: {
26
26
  id: 'dynamicFlows.ControlFeedback.maxLength',
27
27
  defaultMessage: 'Please enter {maxLength} or fewer characters.',
28
- description: ''
28
+ description: '',
29
29
  },
30
30
  minimumDate: {
31
31
  id: 'dynamicFlows.ControlFeedback.minimumDate',
32
- defaultMessage: "Please enter a date that's on or after {minimum}.",
33
- description: ''
32
+ defaultMessage: `Please enter a date that's on or after {minimum}.`,
33
+ description: '',
34
34
  },
35
35
  maximumDate: {
36
36
  id: 'dynamicFlows.ControlFeedback.maximumDate',
37
- defaultMessage: "Please enter a date that's on or before {maximum}.",
38
- description: ''
37
+ defaultMessage: `Please enter a date that's on or before {maximum}.`,
38
+ description: '',
39
39
  },
40
40
  pattern: {
41
41
  id: 'dynamicFlows.ControlFeedback.pattern',
42
42
  defaultMessage: 'Please enter this in the correct format.',
43
- description: ''
43
+ description: '',
44
44
  },
45
45
  patternDate: {
46
46
  id: 'dynamicFlows.ControlFeedback.patternDate',
47
47
  defaultMessage: 'Please enter a date in the corrrect format.',
48
- description: ''
48
+ description: '',
49
49
  },
50
50
  required: {
51
51
  id: 'dynamicFlows.ControlFeedback.required',
52
52
  defaultMessage: 'Please fill out this field.',
53
- description: ''
54
- }
53
+ description: '',
54
+ },
55
55
  });
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
14
- exports["default"] = void 0;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
15
7
  var ControlFeedback_1 = require("./ControlFeedback");
16
- __createBinding(exports, ControlFeedback_1, "default");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ControlFeedback_1).default; } });