@wise/dynamic-flow-client 4.18.1 → 4.18.3
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.
- package/build/main.js +57 -26
- package/build/main.mjs +57 -26
- package/build/types/revamp/domain/components/utils/debounce.d.ts +0 -1
- package/build/types/revamp/domain/features/schema-on-change/getDebouncedSchemaOnChange.d.ts +0 -1
- package/build/types/revamp/domain/features/schema-on-change/getSchemaOnChange.d.ts +1 -1
- package/build/types/revamp/domain/types.d.ts +4 -1
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -1958,7 +1958,7 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
1958
1958
|
const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
|
|
1959
1959
|
return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
|
|
1960
1960
|
autoComplete,
|
|
1961
|
-
options,
|
|
1961
|
+
options: options.map((option) => __spreadValues(__spreadValues({}, option), mapMediaToLegacyProps(option.media))),
|
|
1962
1962
|
selectedIndex,
|
|
1963
1963
|
onSelect: onSelect.bind(component),
|
|
1964
1964
|
children: rendererMapperProps.render(childrenProps),
|
|
@@ -2978,7 +2978,6 @@ var debounce = (callback, waitMs) => {
|
|
|
2978
2978
|
clearTimer();
|
|
2979
2979
|
}
|
|
2980
2980
|
};
|
|
2981
|
-
debouncedFn.isPending = () => timeoutId !== null;
|
|
2982
2981
|
return debouncedFn;
|
|
2983
2982
|
};
|
|
2984
2983
|
|
|
@@ -3503,23 +3502,51 @@ var isOrWasValid = (getErrors, previous, current) => {
|
|
|
3503
3502
|
};
|
|
3504
3503
|
|
|
3505
3504
|
// src/revamp/domain/features/schema-on-change/getDebouncedSchemaOnChange.ts
|
|
3505
|
+
var debounceDelay = 1e3;
|
|
3506
3506
|
var getDebouncedSchemaOnChange = (onChange, getValidationErrors) => {
|
|
3507
3507
|
if (!onChange) {
|
|
3508
3508
|
return void 0;
|
|
3509
3509
|
}
|
|
3510
|
-
const
|
|
3511
|
-
return
|
|
3510
|
+
const performOnChange = onChange.behaviorType === "refresh" ? getSelectiveDebouncedSchemaOnChange(onChange, getValidationErrors) : debounce(onChange, debounceDelay);
|
|
3511
|
+
return performOnChange;
|
|
3512
3512
|
};
|
|
3513
|
-
var getSelectiveDebouncedSchemaOnChange = (
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3513
|
+
var getSelectiveDebouncedSchemaOnChange = (onChange, getValidationErrors) => {
|
|
3514
|
+
let behaviorControl = { abort: () => {
|
|
3515
|
+
} };
|
|
3516
|
+
let timeoutId = null;
|
|
3517
|
+
const clearTimer = () => {
|
|
3518
|
+
if (timeoutId) {
|
|
3519
|
+
clearTimeout(timeoutId);
|
|
3517
3520
|
}
|
|
3521
|
+
timeoutId = null;
|
|
3518
3522
|
};
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
+
const flush = () => {
|
|
3524
|
+
if (timeoutId !== null) {
|
|
3525
|
+
void onChange().then((bc) => {
|
|
3526
|
+
behaviorControl = bc;
|
|
3527
|
+
});
|
|
3528
|
+
clearTimer();
|
|
3529
|
+
}
|
|
3530
|
+
};
|
|
3531
|
+
const debouncedOnChange = (prevValue, updatedValue) => {
|
|
3532
|
+
var _a;
|
|
3533
|
+
const valid = isOrWasValid(getValidationErrors, prevValue, updatedValue);
|
|
3534
|
+
const isPending = timeoutId !== null;
|
|
3535
|
+
if (valid || isPending) {
|
|
3536
|
+
(_a = behaviorControl.abort) == null ? void 0 : _a.call(behaviorControl);
|
|
3537
|
+
clearTimer();
|
|
3538
|
+
timeoutId = setTimeout(() => flush(), debounceDelay);
|
|
3539
|
+
}
|
|
3540
|
+
};
|
|
3541
|
+
debouncedOnChange.cancel = () => {
|
|
3542
|
+
var _a;
|
|
3543
|
+
clearTimer();
|
|
3544
|
+
(_a = behaviorControl.abort) == null ? void 0 : _a.call(behaviorControl);
|
|
3545
|
+
};
|
|
3546
|
+
debouncedOnChange.flush = () => {
|
|
3547
|
+
flush();
|
|
3548
|
+
};
|
|
3549
|
+
return debouncedOnChange;
|
|
3523
3550
|
};
|
|
3524
3551
|
|
|
3525
3552
|
// src/revamp/domain/features/validation/validation-functions.ts
|
|
@@ -3688,9 +3715,7 @@ var getSchemaOnChange = (schema, onBehavior) => {
|
|
|
3688
3715
|
var _a, _b;
|
|
3689
3716
|
const behavior = (_b = (_a = getBehaviorFromSchemaOnChange(schema)) != null ? _a : getBehaviorFromSchemaRefreshStepOnChange(schema)) != null ? _b : void 0;
|
|
3690
3717
|
if (behavior) {
|
|
3691
|
-
const onChange = () =>
|
|
3692
|
-
void onBehavior(behavior);
|
|
3693
|
-
};
|
|
3718
|
+
const onChange = async () => onBehavior(behavior);
|
|
3694
3719
|
onChange.behaviorType = behavior.type;
|
|
3695
3720
|
return onChange;
|
|
3696
3721
|
}
|
|
@@ -4064,9 +4089,9 @@ var schemaHasValidationAsync = (schema) => Boolean("validationAsync" in schema &
|
|
|
4064
4089
|
|
|
4065
4090
|
// src/revamp/domain/features/summary/summary-utils.ts
|
|
4066
4091
|
var getSummariser = (schema) => (value) => {
|
|
4067
|
-
const { summary, icon, image } = schema;
|
|
4092
|
+
const { summary, icon, image, media } = schema;
|
|
4068
4093
|
const stringValueOrNull = isString(value) ? value : null;
|
|
4069
|
-
return summaryIfProvides(summary, { value: stringValueOrNull, icon, image });
|
|
4094
|
+
return summaryIfProvides(summary, { value: stringValueOrNull, icon, image, media });
|
|
4070
4095
|
};
|
|
4071
4096
|
var getConstSummary = (schema, model) => {
|
|
4072
4097
|
const { summary, icon, image, media } = schema;
|
|
@@ -4795,7 +4820,7 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
|
|
|
4795
4820
|
draft.selectedIndices = indices;
|
|
4796
4821
|
draft.errors = [];
|
|
4797
4822
|
});
|
|
4798
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
4823
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4799
4824
|
const errors = getValidationErrors(this.getLocalValue());
|
|
4800
4825
|
this._update((draft) => {
|
|
4801
4826
|
draft.errors = errors;
|
|
@@ -5067,7 +5092,7 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
|
|
|
5067
5092
|
draft.value = updatedValue;
|
|
5068
5093
|
draft.base64Value = base64Value;
|
|
5069
5094
|
});
|
|
5070
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5095
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5071
5096
|
onValueChange();
|
|
5072
5097
|
await (onPersistAsync == null ? void 0 : onPersistAsync().catch((e) => {
|
|
5073
5098
|
this._update((draft) => {
|
|
@@ -5185,7 +5210,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
|
|
|
5185
5210
|
draft.errors = [];
|
|
5186
5211
|
draft.value = updatedValue;
|
|
5187
5212
|
});
|
|
5188
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5213
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5189
5214
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
5190
5215
|
}));
|
|
5191
5216
|
validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
|
|
@@ -5613,7 +5638,7 @@ var createSelectInputComponent = (selectProps, updateComponent) => {
|
|
|
5613
5638
|
draft.errors = [];
|
|
5614
5639
|
draft.selectedIndex = updatedIndex;
|
|
5615
5640
|
});
|
|
5616
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5641
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5617
5642
|
onValueChange();
|
|
5618
5643
|
},
|
|
5619
5644
|
validate() {
|
|
@@ -5750,7 +5775,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
|
|
|
5750
5775
|
draft.value = updatedValue;
|
|
5751
5776
|
});
|
|
5752
5777
|
if (isOrWasValid(getValidationErrors, prevValue, updatedValue)) {
|
|
5753
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5778
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5754
5779
|
}
|
|
5755
5780
|
onValueChange();
|
|
5756
5781
|
if (getValidationErrors(updatedValue).length === 0) {
|
|
@@ -6098,7 +6123,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, u
|
|
|
6098
6123
|
draft.submission = resolvedNull;
|
|
6099
6124
|
draft.errors = [];
|
|
6100
6125
|
});
|
|
6101
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
6126
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
6102
6127
|
return resolvedNull;
|
|
6103
6128
|
}
|
|
6104
6129
|
const { signal } = newAbortController;
|
|
@@ -6107,7 +6132,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, u
|
|
|
6107
6132
|
draft.lastResponse = token;
|
|
6108
6133
|
draft.errors = [];
|
|
6109
6134
|
});
|
|
6110
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
6135
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
6111
6136
|
return token;
|
|
6112
6137
|
}).catch((error) => {
|
|
6113
6138
|
if (error instanceof DOMException && error.name === "AbortError") {
|
|
@@ -7044,8 +7069,12 @@ function useDynamicFlowCore(props) {
|
|
|
7044
7069
|
}
|
|
7045
7070
|
case "refresh": {
|
|
7046
7071
|
rootComponentRef.current.dismissAllModals();
|
|
7047
|
-
|
|
7048
|
-
|
|
7072
|
+
void onRefresh({ refreshUrl: behavior.url, analytics: behavior.analytics });
|
|
7073
|
+
return {
|
|
7074
|
+
abort: () => {
|
|
7075
|
+
abortControllerRef.current.abort();
|
|
7076
|
+
}
|
|
7077
|
+
};
|
|
7049
7078
|
}
|
|
7050
7079
|
case "link": {
|
|
7051
7080
|
onLink(behavior.url);
|
|
@@ -7073,6 +7102,8 @@ function useDynamicFlowCore(props) {
|
|
|
7073
7102
|
case "none":
|
|
7074
7103
|
break;
|
|
7075
7104
|
}
|
|
7105
|
+
return { abort: () => {
|
|
7106
|
+
} };
|
|
7076
7107
|
}, []);
|
|
7077
7108
|
const onAction = (0, import_react3.useCallback)(async (action, model) => {
|
|
7078
7109
|
var _a2, _b, _c, _d, _e, _f;
|
package/build/main.mjs
CHANGED
|
@@ -1915,7 +1915,7 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
1915
1915
|
const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
|
|
1916
1916
|
return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
|
|
1917
1917
|
autoComplete,
|
|
1918
|
-
options,
|
|
1918
|
+
options: options.map((option) => __spreadValues(__spreadValues({}, option), mapMediaToLegacyProps(option.media))),
|
|
1919
1919
|
selectedIndex,
|
|
1920
1920
|
onSelect: onSelect.bind(component),
|
|
1921
1921
|
children: rendererMapperProps.render(childrenProps),
|
|
@@ -2935,7 +2935,6 @@ var debounce = (callback, waitMs) => {
|
|
|
2935
2935
|
clearTimer();
|
|
2936
2936
|
}
|
|
2937
2937
|
};
|
|
2938
|
-
debouncedFn.isPending = () => timeoutId !== null;
|
|
2939
2938
|
return debouncedFn;
|
|
2940
2939
|
};
|
|
2941
2940
|
|
|
@@ -3460,23 +3459,51 @@ var isOrWasValid = (getErrors, previous, current) => {
|
|
|
3460
3459
|
};
|
|
3461
3460
|
|
|
3462
3461
|
// src/revamp/domain/features/schema-on-change/getDebouncedSchemaOnChange.ts
|
|
3462
|
+
var debounceDelay = 1e3;
|
|
3463
3463
|
var getDebouncedSchemaOnChange = (onChange, getValidationErrors) => {
|
|
3464
3464
|
if (!onChange) {
|
|
3465
3465
|
return void 0;
|
|
3466
3466
|
}
|
|
3467
|
-
const
|
|
3468
|
-
return
|
|
3467
|
+
const performOnChange = onChange.behaviorType === "refresh" ? getSelectiveDebouncedSchemaOnChange(onChange, getValidationErrors) : debounce(onChange, debounceDelay);
|
|
3468
|
+
return performOnChange;
|
|
3469
3469
|
};
|
|
3470
|
-
var getSelectiveDebouncedSchemaOnChange = (
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3470
|
+
var getSelectiveDebouncedSchemaOnChange = (onChange, getValidationErrors) => {
|
|
3471
|
+
let behaviorControl = { abort: () => {
|
|
3472
|
+
} };
|
|
3473
|
+
let timeoutId = null;
|
|
3474
|
+
const clearTimer = () => {
|
|
3475
|
+
if (timeoutId) {
|
|
3476
|
+
clearTimeout(timeoutId);
|
|
3474
3477
|
}
|
|
3478
|
+
timeoutId = null;
|
|
3475
3479
|
};
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
+
const flush = () => {
|
|
3481
|
+
if (timeoutId !== null) {
|
|
3482
|
+
void onChange().then((bc) => {
|
|
3483
|
+
behaviorControl = bc;
|
|
3484
|
+
});
|
|
3485
|
+
clearTimer();
|
|
3486
|
+
}
|
|
3487
|
+
};
|
|
3488
|
+
const debouncedOnChange = (prevValue, updatedValue) => {
|
|
3489
|
+
var _a;
|
|
3490
|
+
const valid = isOrWasValid(getValidationErrors, prevValue, updatedValue);
|
|
3491
|
+
const isPending = timeoutId !== null;
|
|
3492
|
+
if (valid || isPending) {
|
|
3493
|
+
(_a = behaviorControl.abort) == null ? void 0 : _a.call(behaviorControl);
|
|
3494
|
+
clearTimer();
|
|
3495
|
+
timeoutId = setTimeout(() => flush(), debounceDelay);
|
|
3496
|
+
}
|
|
3497
|
+
};
|
|
3498
|
+
debouncedOnChange.cancel = () => {
|
|
3499
|
+
var _a;
|
|
3500
|
+
clearTimer();
|
|
3501
|
+
(_a = behaviorControl.abort) == null ? void 0 : _a.call(behaviorControl);
|
|
3502
|
+
};
|
|
3503
|
+
debouncedOnChange.flush = () => {
|
|
3504
|
+
flush();
|
|
3505
|
+
};
|
|
3506
|
+
return debouncedOnChange;
|
|
3480
3507
|
};
|
|
3481
3508
|
|
|
3482
3509
|
// src/revamp/domain/features/validation/validation-functions.ts
|
|
@@ -3645,9 +3672,7 @@ var getSchemaOnChange = (schema, onBehavior) => {
|
|
|
3645
3672
|
var _a, _b;
|
|
3646
3673
|
const behavior = (_b = (_a = getBehaviorFromSchemaOnChange(schema)) != null ? _a : getBehaviorFromSchemaRefreshStepOnChange(schema)) != null ? _b : void 0;
|
|
3647
3674
|
if (behavior) {
|
|
3648
|
-
const onChange = () =>
|
|
3649
|
-
void onBehavior(behavior);
|
|
3650
|
-
};
|
|
3675
|
+
const onChange = async () => onBehavior(behavior);
|
|
3651
3676
|
onChange.behaviorType = behavior.type;
|
|
3652
3677
|
return onChange;
|
|
3653
3678
|
}
|
|
@@ -4021,9 +4046,9 @@ var schemaHasValidationAsync = (schema) => Boolean("validationAsync" in schema &
|
|
|
4021
4046
|
|
|
4022
4047
|
// src/revamp/domain/features/summary/summary-utils.ts
|
|
4023
4048
|
var getSummariser = (schema) => (value) => {
|
|
4024
|
-
const { summary, icon, image } = schema;
|
|
4049
|
+
const { summary, icon, image, media } = schema;
|
|
4025
4050
|
const stringValueOrNull = isString(value) ? value : null;
|
|
4026
|
-
return summaryIfProvides(summary, { value: stringValueOrNull, icon, image });
|
|
4051
|
+
return summaryIfProvides(summary, { value: stringValueOrNull, icon, image, media });
|
|
4027
4052
|
};
|
|
4028
4053
|
var getConstSummary = (schema, model) => {
|
|
4029
4054
|
const { summary, icon, image, media } = schema;
|
|
@@ -4752,7 +4777,7 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
|
|
|
4752
4777
|
draft.selectedIndices = indices;
|
|
4753
4778
|
draft.errors = [];
|
|
4754
4779
|
});
|
|
4755
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
4780
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4756
4781
|
const errors = getValidationErrors(this.getLocalValue());
|
|
4757
4782
|
this._update((draft) => {
|
|
4758
4783
|
draft.errors = errors;
|
|
@@ -5024,7 +5049,7 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
|
|
|
5024
5049
|
draft.value = updatedValue;
|
|
5025
5050
|
draft.base64Value = base64Value;
|
|
5026
5051
|
});
|
|
5027
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5052
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5028
5053
|
onValueChange();
|
|
5029
5054
|
await (onPersistAsync == null ? void 0 : onPersistAsync().catch((e) => {
|
|
5030
5055
|
this._update((draft) => {
|
|
@@ -5142,7 +5167,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
|
|
|
5142
5167
|
draft.errors = [];
|
|
5143
5168
|
draft.value = updatedValue;
|
|
5144
5169
|
});
|
|
5145
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5170
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5146
5171
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
5147
5172
|
}));
|
|
5148
5173
|
validateAsync == null ? void 0 : validateAsync(this, this.getLocalValue()).catch(() => {
|
|
@@ -5570,7 +5595,7 @@ var createSelectInputComponent = (selectProps, updateComponent) => {
|
|
|
5570
5595
|
draft.errors = [];
|
|
5571
5596
|
draft.selectedIndex = updatedIndex;
|
|
5572
5597
|
});
|
|
5573
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5598
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5574
5599
|
onValueChange();
|
|
5575
5600
|
},
|
|
5576
5601
|
validate() {
|
|
@@ -5707,7 +5732,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
|
|
|
5707
5732
|
draft.value = updatedValue;
|
|
5708
5733
|
});
|
|
5709
5734
|
if (isOrWasValid(getValidationErrors, prevValue, updatedValue)) {
|
|
5710
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
5735
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5711
5736
|
}
|
|
5712
5737
|
onValueChange();
|
|
5713
5738
|
if (getValidationErrors(updatedValue).length === 0) {
|
|
@@ -6055,7 +6080,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, u
|
|
|
6055
6080
|
draft.submission = resolvedNull;
|
|
6056
6081
|
draft.errors = [];
|
|
6057
6082
|
});
|
|
6058
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
6083
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
6059
6084
|
return resolvedNull;
|
|
6060
6085
|
}
|
|
6061
6086
|
const { signal } = newAbortController;
|
|
@@ -6064,7 +6089,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, u
|
|
|
6064
6089
|
draft.lastResponse = token;
|
|
6065
6090
|
draft.errors = [];
|
|
6066
6091
|
});
|
|
6067
|
-
schemaOnChange == null ? void 0 : schemaOnChange();
|
|
6092
|
+
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
6068
6093
|
return token;
|
|
6069
6094
|
}).catch((error) => {
|
|
6070
6095
|
if (error instanceof DOMException && error.name === "AbortError") {
|
|
@@ -7001,8 +7026,12 @@ function useDynamicFlowCore(props) {
|
|
|
7001
7026
|
}
|
|
7002
7027
|
case "refresh": {
|
|
7003
7028
|
rootComponentRef.current.dismissAllModals();
|
|
7004
|
-
|
|
7005
|
-
|
|
7029
|
+
void onRefresh({ refreshUrl: behavior.url, analytics: behavior.analytics });
|
|
7030
|
+
return {
|
|
7031
|
+
abort: () => {
|
|
7032
|
+
abortControllerRef.current.abort();
|
|
7033
|
+
}
|
|
7034
|
+
};
|
|
7006
7035
|
}
|
|
7007
7036
|
case "link": {
|
|
7008
7037
|
onLink(behavior.url);
|
|
@@ -7030,6 +7059,8 @@ function useDynamicFlowCore(props) {
|
|
|
7030
7059
|
case "none":
|
|
7031
7060
|
break;
|
|
7032
7061
|
}
|
|
7062
|
+
return { abort: () => {
|
|
7063
|
+
} };
|
|
7033
7064
|
}, []);
|
|
7034
7065
|
const onAction = useCallback2(async (action, model) => {
|
|
7035
7066
|
var _a2, _b, _c, _d, _e, _f;
|
|
@@ -2,6 +2,5 @@ export interface DebouncedFunc<T extends (...args: Parameters<T>) => ReturnType<
|
|
|
2
2
|
(...args: Parameters<T>): void;
|
|
3
3
|
cancel: () => void;
|
|
4
4
|
flush: () => void;
|
|
5
|
-
isPending: () => boolean;
|
|
6
5
|
}
|
|
7
6
|
export declare const debounce: <T extends (...args: Parameters<T>) => ReturnType<T>>(callback: T, waitMs: number) => DebouncedFunc<T>;
|
|
@@ -4,7 +4,6 @@ type DebouncedSchemaOnChange<V extends LocalValue> = {
|
|
|
4
4
|
(prevValue: V, updatedValue: V): void;
|
|
5
5
|
cancel: () => void;
|
|
6
6
|
flush: () => void;
|
|
7
|
-
isPending: () => boolean;
|
|
8
7
|
};
|
|
9
8
|
export declare const getDebouncedSchemaOnChange: <V extends LocalValue>(onChange: SchemaOnChange | undefined, getValidationErrors: (value: V) => string[]) => DebouncedSchemaOnChange<V> | undefined;
|
|
10
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import { Behavior, OnBehavior } from '../../types';
|
|
3
3
|
export type SchemaOnChange = {
|
|
4
|
-
():
|
|
4
|
+
(): ReturnType<OnBehavior>;
|
|
5
5
|
behaviorType: Behavior['type'];
|
|
6
6
|
};
|
|
7
7
|
export declare const getSchemaOnChange: (schema: Schema, onBehavior: OnBehavior) => SchemaOnChange | undefined;
|
|
@@ -153,7 +153,10 @@ export type BaseInputComponent<LV extends LocalValue> = BaseSchemaComponent<LV>
|
|
|
153
153
|
onFocus: () => void;
|
|
154
154
|
};
|
|
155
155
|
export type UpdateComponent = () => void;
|
|
156
|
-
export type OnBehavior = (behavior: Behavior) => Promise<
|
|
156
|
+
export type OnBehavior = (behavior: Behavior) => Promise<BehaviorController>;
|
|
157
|
+
export type BehaviorController = {
|
|
158
|
+
abort: () => void;
|
|
159
|
+
};
|
|
157
160
|
export type OnPoll = (url: string, errorBehavior: Behavior, signal: AbortSignal) => Promise<boolean>;
|
|
158
161
|
export type OnLink = (url: string) => boolean;
|
|
159
162
|
export type OnValueChange = () => void;
|