@wise/dynamic-flow-client 3.8.0-experimental-6700be9 → 3.9.0-experimental-bd037e3

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 (47) hide show
  1. package/build/main.js +91 -32
  2. package/build/main.min.js +1 -1
  3. package/build/main.mjs +101 -34
  4. package/build/revamp/DynamicFlowCore.js +14 -3
  5. package/build/revamp/DynamicFlowWise.js +17 -8
  6. package/build/revamp/domain/components/BooleanInputComponent.js +2 -1
  7. package/build/revamp/domain/components/DateInputComponent.js +2 -1
  8. package/build/revamp/domain/components/IntegerInputComponent.js +2 -1
  9. package/build/revamp/domain/components/MultiUploadInputComponent.js +3 -1
  10. package/build/revamp/domain/components/NumberInputComponent.js +2 -1
  11. package/build/revamp/domain/components/SelectInputComponent.js +3 -1
  12. package/build/revamp/domain/components/TextInputComponent.js +2 -1
  13. package/build/revamp/domain/components/UploadInputComponent.js +4 -1
  14. package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +3 -1
  15. package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +1 -0
  16. package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +1 -0
  17. package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +1 -0
  18. package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.js +2 -1
  19. package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +2 -1
  20. package/build/revamp/domain/mappers/schema/blobSchemaToComponent.js +2 -2
  21. package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +2 -2
  22. package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +2 -2
  23. package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +2 -2
  24. package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +2 -2
  25. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +2 -2
  26. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +2 -2
  27. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.js +2 -2
  28. package/build/revamp/domain/mappers/schema/tests/test-utils.js +1 -1
  29. package/build/revamp/test-utils/component-utils.js +1 -1
  30. package/build/types/index.d.ts +1 -1
  31. package/build/types/revamp/DynamicFlowCore.d.ts +4 -2
  32. package/build/types/revamp/DynamicFlowWise.d.ts +4 -3
  33. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +2 -1
  34. package/build/types/revamp/domain/components/DateInputComponent.d.ts +2 -1
  35. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +2 -1
  36. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +2 -1
  37. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +2 -1
  38. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +2 -1
  39. package/build/types/revamp/domain/components/TextInputComponent.d.ts +2 -1
  40. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +2 -1
  41. package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +2 -1
  42. package/build/types/revamp/domain/features/events.d.ts +1 -1
  43. package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +1 -0
  44. package/build/types/revamp/domain/mappers/schema/types.d.ts +2 -1
  45. package/build/types/revamp/domain/types.d.ts +1 -0
  46. package/build/types/revamp/types.d.ts +5 -1
  47. package/package.json +1 -1
@@ -62,7 +62,7 @@ import { getComponentPersistAsync } from '../features/persistAsync/getComponentP
62
62
  import { getDebouncedPerformRefresh, } from '../features/refresh/getPerformRefresh';
63
63
  import { getComponentValidationAsync } from '../features/validationAsync/getComponentValidationAsync';
64
64
  export var createIntegerInputComponent = function (integerInputProps, updateComponent) {
65
- var uid = integerInputProps.uid, id = integerInputProps.id, checks = integerInputProps.checks, value = integerInputProps.value, performPersistAsync = integerInputProps.performPersistAsync, performRefresh = integerInputProps.performRefresh, performValidationAsync = integerInputProps.performValidationAsync, summariser = integerInputProps.summariser, rest = __rest(integerInputProps, ["uid", "id", "checks", "value", "performPersistAsync", "performRefresh", "performValidationAsync", "summariser"]);
65
+ var uid = integerInputProps.uid, id = integerInputProps.id, checks = integerInputProps.checks, value = integerInputProps.value, performPersistAsync = integerInputProps.performPersistAsync, performRefresh = integerInputProps.performRefresh, performValidationAsync = integerInputProps.performValidationAsync, onValueChange = integerInputProps.onValueChange, summariser = integerInputProps.summariser, rest = __rest(integerInputProps, ["uid", "id", "checks", "value", "performPersistAsync", "performRefresh", "performValidationAsync", "onValueChange", "summariser"]);
66
66
  var performDebouncedRefresh = getDebouncedPerformRefresh(performRefresh);
67
67
  var update = getInputUpdateFunction(uid, updateComponent);
68
68
  var getValidationErrors = getLocalValueValidator(checks);
@@ -84,6 +84,7 @@ export var createIntegerInputComponent = function (integerInputProps, updateComp
84
84
  draft.value = updatedValue;
85
85
  });
86
86
  performDebouncedRefresh === null || performDebouncedRefresh === void 0 ? void 0 : performDebouncedRefresh();
87
+ onValueChange();
87
88
  }, getSubmittableValue: function () {
88
89
  var _a;
89
90
  return __awaiter(this, void 0, void 0, function () {
@@ -70,7 +70,7 @@ import { getInputUpdateFunction } from './utils/component-utils';
70
70
  import { getComponentMultiPersistAsync } from '../features/persistAsync/getComponentPersistAsync';
71
71
  import { toBase64 } from './utils/file-utils';
72
72
  export var createMultiUploadInputComponent = function (uploadInputProps, updateComponent) {
73
- var uid = uploadInputProps.uid, id = uploadInputProps.id, checks = uploadInputProps.checks, format = uploadInputProps.format, performPersistAsync = uploadInputProps.performPersistAsync, summariser = uploadInputProps.summariser, rest = __rest(uploadInputProps, ["uid", "id", "checks", "format", "performPersistAsync", "summariser"]);
73
+ var uid = uploadInputProps.uid, id = uploadInputProps.id, checks = uploadInputProps.checks, format = uploadInputProps.format, performPersistAsync = uploadInputProps.performPersistAsync, onValueChange = uploadInputProps.onValueChange, summariser = uploadInputProps.summariser, rest = __rest(uploadInputProps, ["uid", "id", "checks", "format", "performPersistAsync", "onValueChange", "summariser"]);
74
74
  var update = getInputUpdateFunction(uid, updateComponent);
75
75
  var getValidationErrors = getLocalValueValidator(checks);
76
76
  var getAndSetValidationErrors = function (currentValue) {
@@ -108,6 +108,7 @@ export var createMultiUploadInputComponent = function (uploadInputProps, updateC
108
108
  draft.value = __spreadArray(__spreadArray([], _this.value, true), [file], false);
109
109
  draft.errors = [];
110
110
  });
111
+ onValueChange();
111
112
  return [2 /*return*/];
112
113
  });
113
114
  });
@@ -154,6 +155,7 @@ export var createMultiUploadInputComponent = function (uploadInputProps, updateC
154
155
  return [4 /*yield*/, persist(submission, fileId)];
155
156
  case 5:
156
157
  _b.sent();
158
+ onValueChange();
157
159
  return [2 /*return*/];
158
160
  }
159
161
  });
@@ -62,7 +62,7 @@ import { getLocalValueValidator } from '../features/validation/validation-functi
62
62
  import { getComponentValidationAsync } from '../features/validationAsync/getComponentValidationAsync';
63
63
  import { getInputUpdateFunction } from './utils/component-utils';
64
64
  export var createNumberInputComponent = function (numberInputProps, updateComponent) {
65
- var uid = numberInputProps.uid, id = numberInputProps.id, checks = numberInputProps.checks, performPersistAsync = numberInputProps.performPersistAsync, performRefresh = numberInputProps.performRefresh, performValidationAsync = numberInputProps.performValidationAsync, summariser = numberInputProps.summariser, rest = __rest(numberInputProps, ["uid", "id", "checks", "performPersistAsync", "performRefresh", "performValidationAsync", "summariser"]);
65
+ var uid = numberInputProps.uid, id = numberInputProps.id, checks = numberInputProps.checks, performPersistAsync = numberInputProps.performPersistAsync, performRefresh = numberInputProps.performRefresh, performValidationAsync = numberInputProps.performValidationAsync, onValueChange = numberInputProps.onValueChange, summariser = numberInputProps.summariser, rest = __rest(numberInputProps, ["uid", "id", "checks", "performPersistAsync", "performRefresh", "performValidationAsync", "onValueChange", "summariser"]);
66
66
  var performDebouncedRefresh = getDebouncedPerformRefresh(performRefresh);
67
67
  var update = getInputUpdateFunction(uid, updateComponent);
68
68
  var getValidationErrors = getLocalValueValidator(checks);
@@ -84,6 +84,7 @@ export var createNumberInputComponent = function (numberInputProps, updateCompon
84
84
  draft.value = updatedValue;
85
85
  });
86
86
  performDebouncedRefresh === null || performDebouncedRefresh === void 0 ? void 0 : performDebouncedRefresh();
87
+ onValueChange();
87
88
  }, getSubmittableValue: function () {
88
89
  var _a;
89
90
  return __awaiter(this, void 0, void 0, function () {
@@ -61,7 +61,7 @@ import { isPartialLocalValueMatch } from './utils/isPartialLocalValueMatch';
61
61
  import { getComponentPersistAsync } from '../features/persistAsync/getComponentPersistAsync';
62
62
  import { getLocalValueValidator } from '../features/validation/validation-functions';
63
63
  export var createSelectInputComponent = function (selectProps, updateComponent) {
64
- var uid = selectProps.uid, checks = selectProps.checks, initialValue = selectProps.initialValue, options = selectProps.options, performPersistAsync = selectProps.performPersistAsync, performRefresh = selectProps.performRefresh, summariser = selectProps.summariser, rest = __rest(selectProps, ["uid", "checks", "initialValue", "options", "performPersistAsync", "performRefresh", "summariser"]);
64
+ var uid = selectProps.uid, checks = selectProps.checks, initialValue = selectProps.initialValue, options = selectProps.options, performPersistAsync = selectProps.performPersistAsync, performRefresh = selectProps.performRefresh, onValueChange = selectProps.onValueChange, summariser = selectProps.summariser, rest = __rest(selectProps, ["uid", "checks", "initialValue", "options", "performPersistAsync", "performRefresh", "onValueChange", "summariser"]);
65
65
  var children = options.map(function (option) { return option.component; });
66
66
  var matchingOptions = options.map(function (option) {
67
67
  return isPartialLocalValueMatch(selectProps.initialValue, option.component);
@@ -111,6 +111,7 @@ export var createSelectInputComponent = function (selectProps, updateComponent)
111
111
  draft.selectedIndex = updatedIndex;
112
112
  });
113
113
  performRefresh === null || performRefresh === void 0 ? void 0 : performRefresh();
114
+ onValueChange();
114
115
  }, validate: function () {
115
116
  var _a, _b;
116
117
  var validChild = (_b = (_a = this.getSelectedChild()) === null || _a === void 0 ? void 0 : _a.validate()) !== null && _b !== void 0 ? _b : true;
@@ -126,6 +127,7 @@ export var createSelectInputComponent = function (selectProps, updateComponent)
126
127
  var isValid = getValidationErrors(this.getLocalValue()).length === 0;
127
128
  if (isValid && updatedIndex !== null) {
128
129
  persist(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
130
+ onValueChange();
129
131
  }
130
132
  }, getSubmittableValue: function () {
131
133
  return __awaiter(this, void 0, void 0, function () {
@@ -62,7 +62,7 @@ import { getLocalValueValidator } from '../features/validation/validation-functi
62
62
  import { getComponentValidationAsync } from '../features/validationAsync/getComponentValidationAsync';
63
63
  import { getInputUpdateFunction } from './utils/component-utils';
64
64
  export var createTextInputComponent = function (textInputProps, updateComponent) {
65
- var uid = textInputProps.uid, id = textInputProps.id, checks = textInputProps.checks, performPersistAsync = textInputProps.performPersistAsync, performRefresh = textInputProps.performRefresh, performValidationAsync = textInputProps.performValidationAsync, summariser = textInputProps.summariser, value = textInputProps.value, rest = __rest(textInputProps, ["uid", "id", "checks", "performPersistAsync", "performRefresh", "performValidationAsync", "summariser", "value"]);
65
+ var uid = textInputProps.uid, id = textInputProps.id, checks = textInputProps.checks, performPersistAsync = textInputProps.performPersistAsync, performRefresh = textInputProps.performRefresh, performValidationAsync = textInputProps.performValidationAsync, onValueChange = textInputProps.onValueChange, summariser = textInputProps.summariser, value = textInputProps.value, rest = __rest(textInputProps, ["uid", "id", "checks", "performPersistAsync", "performRefresh", "performValidationAsync", "onValueChange", "summariser", "value"]);
66
66
  var performDebouncedRefresh = getDebouncedPerformRefresh(performRefresh);
67
67
  var update = getInputUpdateFunction(uid, updateComponent);
68
68
  var getValidationErrors = getLocalValueValidator(checks);
@@ -84,6 +84,7 @@ export var createTextInputComponent = function (textInputProps, updateComponent)
84
84
  draft.value = updatedValue;
85
85
  });
86
86
  performDebouncedRefresh === null || performDebouncedRefresh === void 0 ? void 0 : performDebouncedRefresh();
87
+ onValueChange();
87
88
  }, getSubmittableValue: function () {
88
89
  var _a;
89
90
  return __awaiter(this, void 0, void 0, function () {
@@ -61,7 +61,7 @@ import { getInputUpdateFunction } from './utils/component-utils';
61
61
  import { getComponentPersistAsync } from '../features/persistAsync/getComponentPersistAsync';
62
62
  import { toBase64 } from './utils/file-utils';
63
63
  export var createUploadInputComponent = function (uploadInputProps, updateComponent) {
64
- var uid = uploadInputProps.uid, id = uploadInputProps.id, checks = uploadInputProps.checks, format = uploadInputProps.format, value = uploadInputProps.value, performPersistAsync = uploadInputProps.performPersistAsync, performRefresh = uploadInputProps.performRefresh, summariser = uploadInputProps.summariser, rest = __rest(uploadInputProps, ["uid", "id", "checks", "format", "value", "performPersistAsync", "performRefresh", "summariser"]);
64
+ var uid = uploadInputProps.uid, id = uploadInputProps.id, checks = uploadInputProps.checks, format = uploadInputProps.format, value = uploadInputProps.value, performPersistAsync = uploadInputProps.performPersistAsync, performRefresh = uploadInputProps.performRefresh, onValueChange = uploadInputProps.onValueChange, summariser = uploadInputProps.summariser, rest = __rest(uploadInputProps, ["uid", "id", "checks", "format", "value", "performPersistAsync", "performRefresh", "onValueChange", "summariser"]);
65
65
  var update = getInputUpdateFunction(uid, updateComponent);
66
66
  var getValidationErrors = getLocalValueValidator(checks);
67
67
  var getAndSetValidationErrors = function (currentValue) {
@@ -82,6 +82,7 @@ export var createUploadInputComponent = function (uploadInputProps, updateCompon
82
82
  draft.value = updatedValue;
83
83
  });
84
84
  performRefresh === null || performRefresh === void 0 ? void 0 : performRefresh();
85
+ onValueChange();
85
86
  return [2 /*return*/];
86
87
  });
87
88
  });
@@ -116,6 +117,7 @@ export var createUploadInputComponent = function (uploadInputProps, updateCompon
116
117
  draft.errors = [];
117
118
  draft.value = file;
118
119
  });
120
+ onValueChange();
119
121
  if (!(format === 'base64' && file)) return [3 /*break*/, 2];
120
122
  return [4 /*yield*/, toBase64(file)];
121
123
  case 1:
@@ -137,6 +139,7 @@ export var createUploadInputComponent = function (uploadInputProps, updateCompon
137
139
  })];
138
140
  case 4:
139
141
  _b.sent();
142
+ onValueChange();
140
143
  return [2 /*return*/];
141
144
  }
142
145
  });
@@ -68,7 +68,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
68
68
  import { validateComponents, getLocalValueValidator, } from '../../features/validation/validation-functions';
69
69
  import { getInputUpdateFunction } from '../utils/component-utils';
70
70
  export var createRepeatableComponent = function (repeatableProps, updateComponent) {
71
- var uid = repeatableProps.uid, id = repeatableProps.id, checks = repeatableProps.checks, components = repeatableProps.components, summary = repeatableProps.summary, createEditableComponent = repeatableProps.createEditableComponent, summariser = repeatableProps.summariser, componentProps = __rest(repeatableProps, ["uid", "id", "checks", "components", "summary", "createEditableComponent", "summariser"]);
71
+ var uid = repeatableProps.uid, id = repeatableProps.id, checks = repeatableProps.checks, components = repeatableProps.components, summary = repeatableProps.summary, onValueChange = repeatableProps.onValueChange, createEditableComponent = repeatableProps.createEditableComponent, summariser = repeatableProps.summariser, componentProps = __rest(repeatableProps, ["uid", "id", "checks", "components", "summary", "onValueChange", "createEditableComponent", "summariser"]);
72
72
  var update = getInputUpdateFunction(uid, updateComponent);
73
73
  var getValidationErrors = getLocalValueValidator(checks);
74
74
  return __assign(__assign({ uid: uid, id: id, type: 'repeatable', components: components, editableComponent: null, editableIndex: null, summaryDefaults: {
@@ -110,6 +110,7 @@ export var createRepeatableComponent = function (repeatableProps, updateComponen
110
110
  draft.editableComponent = null;
111
111
  draft.editableIndex = null;
112
112
  });
113
+ onValueChange();
113
114
  return true;
114
115
  }, onRemove: function () {
115
116
  update(function (draft) {
@@ -120,6 +121,7 @@ export var createRepeatableComponent = function (repeatableProps, updateComponen
120
121
  draft.editableComponent = null;
121
122
  draft.editableIndex = null;
122
123
  });
124
+ onValueChange();
123
125
  }, getChildren: function () {
124
126
  return this.editableComponent !== null
125
127
  ? __spreadArray(__spreadArray([], this.components, true), [this.editableComponent], false) : this.components;
@@ -59,6 +59,7 @@ describe('RepeatableComponent', function () {
59
59
  hidden: false,
60
60
  keywords: [],
61
61
  summariser: function () { return ({}); },
62
+ onValueChange: function () { },
62
63
  createEditableComponent: function (value) {
63
64
  return createMockTextInputComponent({ value: value });
64
65
  },
@@ -67,6 +67,7 @@ var defaultProps = {
67
67
  value: '',
68
68
  performValidationAsync: undefined,
69
69
  performRefresh: undefined,
70
+ onValueChange: function () { },
70
71
  summariser: function () { return ({}); },
71
72
  };
72
73
  describe('getComponentPersistAsync', function () {
@@ -68,6 +68,7 @@ var defaultProps = {
68
68
  value: '',
69
69
  performPersistAsync: undefined,
70
70
  performRefresh: undefined,
71
+ onValueChange: function () { },
71
72
  summariser: function () { return ({}); },
72
73
  };
73
74
  describe('getComponentValidationAsync', function () {
@@ -31,12 +31,13 @@ export var arraySchemaToMultiUploadComponent = function (schemaMapperProps, mapp
31
31
  var persistAsyncConfig = getPersistAsyncConfig(schema.items);
32
32
  var format = getFormat(schema.items);
33
33
  var combinedSchemaProps = __assign(__assign({}, schemaMapperProps), { persistAsyncConfig: persistAsyncConfig, schema: uploadSchema });
34
+ var onValueChange = mapperProps.onValueChange;
34
35
  var performPersistAsync = getPersistAsyncInitialState(combinedSchemaProps, mapperProps).performPersistAsync;
35
36
  var value = performPersistAsync ? getValueForPersistAsync(localValue) : [];
36
37
  var persistedState = performPersistAsync && isArray(model)
37
38
  ? model.map(function (itemModel) { return getInitialPersistedState(null, itemModel); })
38
39
  : [];
39
- return createMultiUploadInputComponent(__assign(__assign({}, mapCommonSchemaProps(combinedSchemaProps)), { title: title, uploadLabel: uploadSchema.title, accepts: accepts, autoComplete: 'off', checks: schema.hidden ? [] : checks, format: format, maxSize: maxSize, minItems: minItems, maxItems: maxItems, required: required, value: value, persistedState: persistedState, performPersistAsync: performPersistAsync }), mapperProps.updateComponent);
40
+ return createMultiUploadInputComponent(__assign(__assign({}, mapCommonSchemaProps(combinedSchemaProps)), { title: title, uploadLabel: uploadSchema.title, accepts: accepts, autoComplete: 'off', checks: schema.hidden ? [] : checks, format: format, maxSize: maxSize, minItems: minItems, maxItems: maxItems, required: required, value: value, persistedState: persistedState, performPersistAsync: performPersistAsync, onValueChange: onValueChange }), mapperProps.updateComponent);
40
41
  };
41
42
  var getFormat = function (schema) {
42
43
  if (isStringSchemaWithUpload(schema)) {
@@ -38,6 +38,7 @@ export var arraySchemaToRepeatableComponent = function (schemaMapperProps, mappe
38
38
  validationErrors: undefined,
39
39
  }, mapperProps);
40
40
  };
41
+ var onValueChange = mapperProps.onValueChange;
41
42
  var errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
42
43
  return createRepeatableComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { addItemTitle: addItemTitle, checks: schema.hidden
43
44
  ? []
@@ -45,7 +46,7 @@ export var arraySchemaToRepeatableComponent = function (schemaMapperProps, mappe
45
46
  getRequiredCheck(required, errorMessageFunctions),
46
47
  getAboveMaxItemsCheck(schema, errorMessageFunctions),
47
48
  getBelowMinItemsCheck(schema, errorMessageFunctions),
48
- ], components: components !== null && components !== void 0 ? components : [], editItemTitle: editItemTitle, summary: summary, createEditableComponent: createEditableComponent }), mapperProps.updateComponent);
49
+ ], components: components !== null && components !== void 0 ? components : [], editItemTitle: editItemTitle, summary: summary, createEditableComponent: createEditableComponent, onValueChange: onValueChange }), mapperProps.updateComponent);
49
50
  };
50
51
  var localValueToJsonElement = function (localValue) {
51
52
  if (localValue instanceof Array) {
@@ -18,7 +18,7 @@ import { mapCommonSchemaProps } from './utils/mapCommonSchemaProps';
18
18
  export var blobSchemaToComponent = function (schemaMapperProps, mapperProps) {
19
19
  var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
20
20
  var accepts = schema.accepts, maxSize = schema.maxSize, validationMessages = schema.validationMessages;
21
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent;
21
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onValueChange = mapperProps.onValueChange;
22
22
  var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
23
23
  var performPersistAsync = getPersistAsyncInitialState(schemaMapperProps, mapperProps).performPersistAsync;
24
24
  var persistedState = performPersistAsync
@@ -26,5 +26,5 @@ export var blobSchemaToComponent = function (schemaMapperProps, mapperProps) {
26
26
  : getInitialPersistedState();
27
27
  var validLocalValue = isFile(localValue) ? localValue : null;
28
28
  var value = performPersistAsync ? validLocalValue : null;
29
- return createUploadInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { accepts: accepts, autoComplete: 'off', format: 'blob', maxSize: maxSize, value: value, persistedState: persistedState, performPersistAsync: performPersistAsync, checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)] }), updateComponent);
29
+ return createUploadInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { accepts: accepts, autoComplete: 'off', format: 'blob', maxSize: maxSize, value: value, persistedState: persistedState, performPersistAsync: performPersistAsync, checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)], onValueChange: onValueChange }), updateComponent);
30
30
  };
@@ -18,14 +18,14 @@ import { getValidationAsyncInitialState } from './utils/getValidationAsyncInitia
18
18
  export var booleanSchemaToComponent = function (schemaMapperProps, mapperProps) {
19
19
  var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model;
20
20
  var defaultValue = schema.default;
21
- var updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
21
+ var updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
22
22
  var performRefresh = getPerformRefresh(schema, onRefresh);
23
23
  var _a = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _a.performPersistAsync, persistedState = _a.persistedState;
24
24
  var _b = getValidationAsyncInitialState(schemaMapperProps, mapperProps), performValidationAsync = _b.performValidationAsync, validationState = _b.validationState;
25
25
  var validLocalValue = isBoolean(localValue) ? localValue : false;
26
26
  var validModel = getValidModel(model, defaultValue);
27
27
  var value = performPersistAsync ? validLocalValue : validModel;
28
- return createBooleanInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { value: value !== null && value !== void 0 ? value : false, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: performRefresh, performValidationAsync: performValidationAsync }), updateComponent);
28
+ return createBooleanInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { value: value !== null && value !== void 0 ? value : false, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: performRefresh, performValidationAsync: performValidationAsync, onValueChange: onValueChange }), updateComponent);
29
29
  };
30
30
  var getValidModel = function (model, defaultValue) {
31
31
  if (isBoolean(model)) {
@@ -20,7 +20,7 @@ import { getValidationAsyncInitialState } from './utils/getValidationAsyncInitia
20
20
  export var integerSchemaToComponent = function (schemaMapperProps, mapperProps) {
21
21
  var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
22
22
  var autocompleteHint = schema.autocompleteHint, validationMessages = schema.validationMessages, defaultValue = schema.default;
23
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
23
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
24
24
  var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
25
25
  var _b = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _b.performPersistAsync, persistedState = _b.persistedState;
26
26
  var _c = getValidationAsyncInitialState(schemaMapperProps, mapperProps), performValidationAsync = _c.performValidationAsync, validationState = _c.validationState;
@@ -32,5 +32,5 @@ export var integerSchemaToComponent = function (schemaMapperProps, mapperProps)
32
32
  getBelowMinimumCheck(schema, errorMessageFunctions),
33
33
  getAboveMaximumCheck(schema, errorMessageFunctions),
34
34
  ];
35
- return createIntegerInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { autoComplete: getAutocompleteString(autocompleteHint), checks: checks, persistedState: persistedState, value: value, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync }), updateComponent);
35
+ return createIntegerInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { autoComplete: getAutocompleteString(autocompleteHint), checks: checks, persistedState: persistedState, value: value, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync, onValueChange: onValueChange }), updateComponent);
36
36
  };
@@ -20,7 +20,7 @@ import { getValidationAsyncInitialState } from './utils/getValidationAsyncInitia
20
20
  export var numberSchemaToComponent = function (schemaMapperProps, mapperProps) {
21
21
  var schema = schemaMapperProps.schema, model = schemaMapperProps.model, localValue = schemaMapperProps.localValue, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
22
22
  var autocompleteHint = schema.autocompleteHint, validationMessages = schema.validationMessages, defaultValue = schema.default;
23
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
23
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
24
24
  var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
25
25
  var _b = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _b.performPersistAsync, persistedState = _b.persistedState;
26
26
  var _c = getValidationAsyncInitialState(schemaMapperProps, mapperProps), performValidationAsync = _c.performValidationAsync, validationState = _c.validationState;
@@ -31,5 +31,5 @@ export var numberSchemaToComponent = function (schemaMapperProps, mapperProps) {
31
31
  getRequiredCheck(required, errorMessageFunctions),
32
32
  getBelowMinimumCheck(schema, errorMessageFunctions),
33
33
  getAboveMaximumCheck(schema, errorMessageFunctions),
34
- ], value: value, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync }), updateComponent);
34
+ ], value: value, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync, onValueChange: onValueChange }), updateComponent);
35
35
  };
@@ -50,12 +50,12 @@ export var oneOfSchemaToComponent = function (schemaMapperProps, mapperProps) {
50
50
  }, mapperProps),
51
51
  };
52
52
  });
53
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, trackEvent = mapperProps.trackEvent, onRefresh = mapperProps.onRefresh;
53
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, trackEvent = mapperProps.trackEvent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
54
54
  var defaultValue = schema.default, validationMessages = schema.validationMessages;
55
55
  var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
56
56
  var _d = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _d.performPersistAsync, persistedState = _d.persistedState;
57
57
  var initialValue = performPersistAsync ? localValue : (_b = model !== null && model !== void 0 ? model : defaultValue) !== null && _b !== void 0 ? _b : null;
58
- return createSelectInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { autoComplete: getAutocompleteString(schema.autocompleteHint), checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)], options: options, initialValue: initialValue, persistedState: persistedState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), trackEvent: trackEvent }), updateComponent);
58
+ return createSelectInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { autoComplete: getAutocompleteString(schema.autocompleteHint), checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)], options: options, initialValue: initialValue, persistedState: persistedState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), onValueChange: onValueChange, trackEvent: trackEvent }), updateComponent);
59
59
  };
60
60
  /**
61
61
  * When using a schema in a oneOf, the title is not needed, as it is already displayed in the dropdown, radio or tab.
@@ -20,7 +20,7 @@ import { getValidationAsyncInitialState } from '../utils/getValidationAsyncIniti
20
20
  export var stringSchemaToDateInputComponent = function (schemaMapperProps, mapperProps) {
21
21
  var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
22
22
  var autocompleteHint = schema.autocompleteHint, defaultValue = schema.default, minimumDate = schema.minimum, maximumDate = schema.maximum;
23
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
23
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
24
24
  var errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
25
25
  var _b = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _b.performPersistAsync, persistedState = _b.persistedState;
26
26
  var _c = getValidationAsyncInitialState(schemaMapperProps, mapperProps), performValidationAsync = _c.performValidationAsync, validationState = _c.validationState;
@@ -33,5 +33,5 @@ export var stringSchemaToDateInputComponent = function (schemaMapperProps, mappe
33
33
  getRequiredCheck(required, errorMessageFunctions),
34
34
  getAboveMaximumDateCheck(schema, errorMessageFunctions),
35
35
  getBelowMinimumDateCheck(schema, errorMessageFunctions),
36
- ], minimumDate: minimumDate, maximumDate: maximumDate, value: value, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync }), updateComponent);
36
+ ], minimumDate: minimumDate, maximumDate: maximumDate, value: value, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync, onValueChange: onValueChange }), updateComponent);
37
37
  };
@@ -20,7 +20,7 @@ import { getValidationAsyncInitialState } from '../utils/getValidationAsyncIniti
20
20
  export var stringSchemaToTextInputComponent = function (schemaMapperProps, mapperProps) {
21
21
  var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
22
22
  var autocompleteHint = schema.autocompleteHint, control = schema.control, defaultValue = schema.default, displayFormat = schema.displayFormat, format = schema.format, validationMessages = schema.validationMessages;
23
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
23
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
24
24
  var controlForLegacyFormat = getControlForLegacyFormat(format);
25
25
  var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
26
26
  var _b = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _b.performPersistAsync, persistedState = _b.persistedState;
@@ -35,7 +35,7 @@ export var stringSchemaToTextInputComponent = function (schemaMapperProps, mappe
35
35
  getAboveMaxLengthCheck(schema, errorMessageFunctions),
36
36
  getBelowMinLengthCheck(schema, errorMessageFunctions),
37
37
  getNotAdheringToPatternCheck(schema, errorMessageFunctions),
38
- ], control: control !== null && control !== void 0 ? control : controlForLegacyFormat, displayFormat: displayFormat, value: value, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync }), updateComponent);
38
+ ], control: control !== null && control !== void 0 ? control : controlForLegacyFormat, displayFormat: displayFormat, value: value, persistedState: persistedState, validationState: validationState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), performValidationAsync: performValidationAsync, onValueChange: onValueChange }), updateComponent);
39
39
  };
40
40
  var getControlForLegacyFormat = function (format) {
41
41
  if (format && ['numeric', 'phone-number', 'email', 'password'].includes(format)) {
@@ -20,7 +20,7 @@ import { mapCommonSchemaProps } from '../utils/mapCommonSchemaProps';
20
20
  export var stringSchemaToUploadInputComponent = function (schemaMapperProps, mapperProps) {
21
21
  var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
22
22
  var accepts = schema.accepts, autocompleteHint = schema.autocompleteHint, maxSize = schema.maxSize, validationMessages = schema.validationMessages;
23
- var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
23
+ var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh, onValueChange = mapperProps.onValueChange;
24
24
  var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
25
25
  var performPersistAsync = getPersistAsyncInitialState(schemaMapperProps, mapperProps).performPersistAsync;
26
26
  var persistedState = performPersistAsync
@@ -28,5 +28,5 @@ export var stringSchemaToUploadInputComponent = function (schemaMapperProps, map
28
28
  : getInitialPersistedState();
29
29
  var validLocalValue = isFile(localValue) ? localValue : null;
30
30
  var value = performPersistAsync ? validLocalValue : null;
31
- return createUploadInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { accepts: accepts, autoComplete: getAutocompleteString(autocompleteHint), checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)], format: 'base64', maxSize: maxSize, value: value, persistedState: persistedState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh) }), updateComponent);
31
+ return createUploadInputComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { accepts: accepts, autoComplete: getAutocompleteString(autocompleteHint), checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)], format: 'base64', maxSize: maxSize, value: value, persistedState: persistedState, performPersistAsync: performPersistAsync, performRefresh: getPerformRefresh(schema, onRefresh), onValueChange: onValueChange }), updateComponent);
32
32
  };
@@ -14,7 +14,7 @@ import { getInputUpdateFunction } from '../../../components/utils/component-util
14
14
  import { getRandomId } from '../../utils/getRandomId';
15
15
  export var getMockMapperProps = function (mapperProps) {
16
16
  if (mapperProps === void 0) { mapperProps = {}; }
17
- return (__assign({ step: {}, stepLocalValue: null, updateComponent: jest.fn(), onAction: jest.fn(), onRefresh: jest.fn(), getErrorMessageFunctions: jest.fn().mockReturnValue(mockErrorMessageFunctions), trackEvent: jest.fn(), logEvent: jest.fn(), httpClient: jest.fn() }, mapperProps));
17
+ return (__assign({ step: {}, stepLocalValue: null, updateComponent: jest.fn(), onAction: jest.fn(), onRefresh: jest.fn(), onValueChange: jest.fn(), getErrorMessageFunctions: jest.fn().mockReturnValue(mockErrorMessageFunctions), trackEvent: jest.fn(), logEvent: jest.fn(), httpClient: jest.fn() }, mapperProps));
18
18
  };
19
19
  export var getMockSchemaMapperProps = function (schemaMapperProps) { return (__assign({ uid: getRandomId(), localValue: null, model: null, required: false, validationErrors: null }, schemaMapperProps)); };
20
20
  export var mockUpdateFunction = function (draftComponent) {
@@ -15,5 +15,5 @@ import { getInitialValidationState } from '../domain/features/validationAsync/ge
15
15
  import { getRandomId } from '../domain/mappers/utils/getRandomId';
16
16
  export var createMockTextInputComponent = function (props) {
17
17
  if (props === void 0) { props = {}; }
18
- return createTextInputComponent(__assign({ uid: getRandomId(), checks: [], analyticsId: 'analyticsId', autoComplete: 'off', disabled: true, errors: [], id: 'id', hidden: false, required: false, persistedState: getInitialPersistedState(), validationState: getInitialValidationState(), value: '', summariser: function () { return ({}); }, performPersistAsync: undefined, performValidationAsync: undefined, performRefresh: undefined }, props), jest.fn());
18
+ return createTextInputComponent(__assign({ uid: getRandomId(), checks: [], analyticsId: 'analyticsId', autoComplete: 'off', disabled: true, errors: [], id: 'id', hidden: false, required: false, persistedState: getInitialPersistedState(), validationState: getInitialValidationState(), value: '', summariser: function () { return ({}); }, performPersistAsync: undefined, performValidationAsync: undefined, performRefresh: undefined, onValueChange: function () { } }, props), jest.fn());
19
19
  };
@@ -1,7 +1,7 @@
1
1
  export { makeHttpClient } from './common/makeHttpClient';
2
2
  export { default as translations } from './i18n';
3
3
  export type { Step, Model } from '@wise/dynamic-flow-types';
4
- export type { DynamicFlowWiseProps as DynamicFlowRevampProps, DynamicFlowWisePropsWithInitialAction as DynamicFlowRevampPropsWithInitialAction, DynamicFlowWisePropsWithInitialStep as DynamicFlowRevampPropsWithInitialStep, } from './revamp/types';
4
+ export type { DynamicFlowWiseProps as DynamicFlowRevampProps, DynamicFlowWisePropsWithInitialAction as DynamicFlowRevampPropsWithInitialAction, DynamicFlowWisePropsWithInitialStep as DynamicFlowRevampPropsWithInitialStep, DynamicFlowController, } from './revamp/types';
5
5
  export { default as DynamicFlowRevamp } from './revamp/DynamicFlowWise';
6
6
  export type { DynamicFlowProps, InitialAction } from './legacy/dynamic-flow-types';
7
7
  export { convertStepToLayout, inlineReferences } from './legacy/step/layoutStep/utils';
@@ -1,2 +1,4 @@
1
- import type { DynamicFlowCoreProps } from './types';
2
- export declare function DynamicFlowCore(props: DynamicFlowCoreProps): JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { DynamicFlowCoreProps, DynamicFlowController } from './types';
3
+ declare const DynamicFlowCore: import("react").ForwardRefExoticComponent<DynamicFlowCoreProps & import("react").RefAttributes<DynamicFlowController>>;
4
+ export default DynamicFlowCore;
@@ -1,3 +1,4 @@
1
- import type { DynamicFlowWiseProps } from './types';
2
- declare function DynamicFlowWise(props: DynamicFlowWiseProps): JSX.Element;
3
- export default DynamicFlowWise;
1
+ /// <reference types="react" />
2
+ import type { DynamicFlowWiseProps, DynamicFlowController } from './types';
3
+ declare const DynamicFragmentWise: import("react").ForwardRefExoticComponent<DynamicFlowWiseProps & import("react").RefAttributes<DynamicFlowController>>;
4
+ export default DynamicFragmentWise;
@@ -1,7 +1,7 @@
1
1
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
2
2
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
4
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
4
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
5
5
  export type BooleanInputComponent = InputComponent<boolean> & {
6
6
  type: 'boolean';
7
7
  persistedState: PersistedState;
@@ -13,4 +13,5 @@ export declare const createBooleanInputComponent: (booleanInputProps: Pick<Boole
13
13
  performRefresh: PerformRefresh | undefined;
14
14
  performValidationAsync: PerformValidationAsync | undefined;
15
15
  summariser: (value: boolean) => RepeatableSummary;
16
+ onValueChange: OnValueChange;
16
17
  }, updateComponent: UpdateComponent) => BooleanInputComponent;
@@ -1,6 +1,6 @@
1
1
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
3
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
4
4
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
5
5
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
6
6
  export type DateInputComponent = InputComponent<string | null> & {
@@ -16,5 +16,6 @@ export declare const createDateInputComponent: (textInputProps: Pick<DateInputCo
16
16
  performPersistAsync: PerformPersistAsync | undefined;
17
17
  performRefresh: PerformRefresh | undefined;
18
18
  performValidationAsync: PerformValidationAsync | undefined;
19
+ onValueChange: OnValueChange;
19
20
  summariser: (value: string | null) => RepeatableSummary;
20
21
  }, updateComponent: UpdateComponent) => DateInputComponent;
@@ -1,4 +1,4 @@
1
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
1
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
3
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
4
4
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
@@ -14,5 +14,6 @@ export declare const createIntegerInputComponent: (integerInputProps: Pick<Integ
14
14
  performPersistAsync: PerformPersistAsync | undefined;
15
15
  performRefresh: PerformRefresh | undefined;
16
16
  performValidationAsync: PerformValidationAsync | undefined;
17
+ onValueChange: OnValueChange;
17
18
  summariser: (value: number | null) => RepeatableSummary;
18
19
  }, updateComponent: UpdateComponent) => IntegerInputComponent;
@@ -1,5 +1,5 @@
1
1
  import type { IsInvalidCheck } from '../features/validation/value-checks';
2
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent } from '../types';
2
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent } from '../types';
3
3
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
4
4
  export type MultiUploadInputComponent = InputComponent<File[]> & {
5
5
  type: 'multi-upload';
@@ -17,5 +17,6 @@ export type MultiUploadInputComponent = InputComponent<File[]> & {
17
17
  export declare const createMultiUploadInputComponent: (uploadInputProps: Pick<MultiUploadInputComponent, "value" | "id" | "uid" | "control" | "analyticsId" | "title" | "maxItems" | "minItems" | "description" | "errors" | "hidden" | "help" | "disabled" | "placeholder" | "accepts" | "maxSize" | "required" | "format" | "autoComplete" | "persistedState" | "uploadLabel"> & {
18
18
  checks: IsInvalidCheck<File[]>[];
19
19
  performPersistAsync: PerformPersistAsync | undefined;
20
+ onValueChange: OnValueChange;
20
21
  summariser: (value: string[]) => RepeatableSummary;
21
22
  }, updateComponent: UpdateComponent) => MultiUploadInputComponent;
@@ -2,7 +2,7 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
2
2
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
5
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
5
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
6
6
  export type NumberInputComponent = InputComponent<number | null> & {
7
7
  type: 'number';
8
8
  persistedState: PersistedState;
@@ -14,5 +14,6 @@ export declare const createNumberInputComponent: (numberInputProps: Pick<NumberI
14
14
  performPersistAsync: PerformPersistAsync | undefined;
15
15
  performRefresh: PerformRefresh | undefined;
16
16
  performValidationAsync: PerformValidationAsync | undefined;
17
+ onValueChange: OnValueChange;
17
18
  summariser: (value: number | null) => RepeatableSummary;
18
19
  }, updateComponent: UpdateComponent) => NumberInputComponent;
@@ -1,5 +1,5 @@
1
1
  import type { Icon, Image } from '@wise/dynamic-flow-types/build/next';
2
- import type { InputComponent, LocalValue, PersistedState, RepeatableSummary, DomainComponent, UpdateComponent } from '../types';
2
+ import type { InputComponent, LocalValue, PersistedState, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange } from '../types';
3
3
  import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { AnalyticsEventDispatcher } from '../features/events';
5
5
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
@@ -31,5 +31,6 @@ export declare const createSelectInputComponent: (selectProps: Pick<SelectInputC
31
31
  performPersistAsync: PerformPersistAsync | undefined;
32
32
  performRefresh?: PerformRefresh | undefined;
33
33
  summariser: (value: LocalValue | null) => RepeatableSummary;
34
+ onValueChange: OnValueChange;
34
35
  trackEvent: AnalyticsEventDispatcher;
35
36
  }, updateComponent: UpdateComponent) => SelectInputComponent;
@@ -2,7 +2,7 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
2
2
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
5
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
5
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationState } from '../types';
6
6
  export type TextInputComponent = InputComponent<string | null> & {
7
7
  type: 'text';
8
8
  displayFormat?: string;
@@ -15,5 +15,6 @@ export declare const createTextInputComponent: (textInputProps: Pick<TextInputCo
15
15
  performPersistAsync: PerformPersistAsync | undefined;
16
16
  performValidationAsync: PerformValidationAsync | undefined;
17
17
  performRefresh: PerformRefresh | undefined;
18
+ onValueChange: OnValueChange;
18
19
  summariser: (value: string | null) => RepeatableSummary;
19
20
  }, updateComponent: UpdateComponent) => TextInputComponent;
@@ -1,5 +1,5 @@
1
1
  import type { IsInvalidCheck } from '../features/validation/value-checks';
2
- import type { InputComponent, PersistedState, RepeatableSummary, UpdateComponent } from '../types';
2
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent } from '../types';
3
3
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
4
4
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
5
5
  export type UploadInputComponent = InputComponent<File | null> & {
@@ -14,5 +14,6 @@ export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadI
14
14
  checks: IsInvalidCheck<File | null>[];
15
15
  performPersistAsync: PerformPersistAsync | undefined;
16
16
  performRefresh?: PerformRefresh | undefined;
17
+ onValueChange: OnValueChange;
17
18
  summariser: (value: string | null) => RepeatableSummary;
18
19
  }, updateComponent: UpdateComponent) => UploadInputComponent;
@@ -1,5 +1,5 @@
1
1
  import type { SummarySummariser } from '@wise/dynamic-flow-types/build/next/feature/SummarySummariser';
2
- import type { ComponentWithTitle, LocalValue, LocalValueArray, RepeatableSummary, DomainComponent, UpdateComponent } from '../../types';
2
+ import type { ComponentWithTitle, LocalValue, LocalValueArray, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange } from '../../types';
3
3
  import type { IsInvalidCheck } from '../../features/validation/value-checks';
4
4
  export type RepeatableComponent = ComponentWithTitle & {
5
5
  type: 'repeatable';
@@ -23,5 +23,6 @@ export declare const createRepeatableComponent: (repeatableProps: Pick<Repeatabl
23
23
  checks: IsInvalidCheck<LocalValueArray | null>[];
24
24
  summary?: SummarySummariser | undefined;
25
25
  summariser: (value: LocalValueArray | null) => RepeatableSummary;
26
+ onValueChange: OnValueChange;
26
27
  createEditableComponent: (value: LocalValue) => DomainComponent;
27
28
  }, updateComponent: UpdateComponent) => RepeatableComponent;
@@ -1,6 +1,6 @@
1
1
  export type AnalyticsEventHandler = (eventName: string, properties?: Record<string, unknown>) => void;
2
2
  export type AnalyticsEventDispatcher<E extends string = EventName> = (eventName: E, properties?: Record<string, unknown>) => void;
3
- export type EventName = 'Initiated' | 'Succeeded' | 'Failed' | 'Step Shown' | 'Action Triggered' | 'Action Succeeded' | 'Action Aborted' | 'Action Failed' | 'Refresh Triggered' | 'Refresh Succeeded' | 'Refresh Aborted' | 'Refresh Failed' | 'OneOf Selected' | 'PersistAsync Triggered' | 'PersistAsync Succeeded' | 'PersistAsync Failed' | 'ValidationAsync Triggered' | 'ValidationAsync Succeeded' | 'ValidationAsync Failed';
3
+ export type EventName = 'Initiated' | 'Succeeded' | 'Failed' | 'Step Shown' | 'Action Triggered' | 'Action Succeeded' | 'Action Aborted' | 'Action Failed' | 'Refresh Triggered' | 'Refresh Succeeded' | 'Refresh Aborted' | 'Refresh Failed' | 'OneOf Selected' | 'PersistAsync Triggered' | 'PersistAsync Succeeded' | 'PersistAsync Failed' | 'ValidationAsync Triggered' | 'ValidationAsync Succeeded' | 'ValidationAsync Failed' | 'Value Changed';
4
4
  export type LogLevel = 'info' | 'warning' | 'error';
5
5
  export type LoggingEventHandler = (level: LogLevel, message: string, extra: Record<string, unknown>) => void;
6
6
  export type LoggingEventDispatcher = (level: LogLevel, message: string, extra?: Record<string, unknown>) => void;