@wise/dynamic-flow-client 5.17.0 → 5.17.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.
- package/build/i18n/sv.json +38 -0
- package/build/main.js +102 -51
- package/build/main.mjs +102 -51
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/controller/FlowController.d.ts +1 -2
- package/build/types/controller/FlowController.d.ts.map +1 -1
- package/build/types/domain/components/IntegerInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/NumberInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/TextInputComponent.d.ts.map +1 -1
- package/build/types/domain/features/validation/value-checks.d.ts +1 -0
- package/build/types/domain/features/validation/value-checks.d.ts.map +1 -1
- package/build/types/domain/mappers/mapStepSchemas.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/allOfSchemaToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/arraySchemaToComponent/arraySchemaToTupleComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/blobSchemaToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/integerSchemaToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/numberSchemaToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/objectSchemaToComponent/objectSchemaToObjectComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/types.d.ts +1 -1
- package/build/types/domain/mappers/schema/types.d.ts.map +1 -1
- package/build/types/useDynamicFlow.d.ts.map +1 -1
- package/package.json +7 -7
package/build/main.mjs
CHANGED
|
@@ -2152,7 +2152,7 @@ var debounce = (callback, waitMs) => {
|
|
|
2152
2152
|
let timeoutId = null;
|
|
2153
2153
|
let lastArgs = null;
|
|
2154
2154
|
const clearTimer = () => {
|
|
2155
|
-
if (timeoutId) {
|
|
2155
|
+
if (timeoutId !== null) {
|
|
2156
2156
|
clearTimeout(timeoutId);
|
|
2157
2157
|
timeoutId = null;
|
|
2158
2158
|
}
|
|
@@ -2981,7 +2981,7 @@ var executeRequest = async (props) => {
|
|
|
2981
2981
|
url,
|
|
2982
2982
|
{
|
|
2983
2983
|
method,
|
|
2984
|
-
body: body ? JSON.stringify(body) : void 0,
|
|
2984
|
+
body: body != null ? JSON.stringify(body) : void 0,
|
|
2985
2985
|
headers: { "Content-Type": "application/json" }
|
|
2986
2986
|
}
|
|
2987
2987
|
],
|
|
@@ -3375,6 +3375,7 @@ var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
|
3375
3375
|
"summariser"
|
|
3376
3376
|
]);
|
|
3377
3377
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
3378
|
+
const onValueChangeDebounced = debounce(onValueChange, 1e3);
|
|
3378
3379
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
3379
3380
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
3380
3381
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
@@ -3391,6 +3392,7 @@ var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
|
3391
3392
|
}));
|
|
3392
3393
|
validateAsync == null ? void 0 : validateAsync.flush();
|
|
3393
3394
|
}
|
|
3395
|
+
onValueChangeDebounced.flush();
|
|
3394
3396
|
},
|
|
3395
3397
|
onFocus() {
|
|
3396
3398
|
},
|
|
@@ -3407,7 +3409,7 @@ var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
|
3407
3409
|
if (isValid) {
|
|
3408
3410
|
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
3409
3411
|
}
|
|
3410
|
-
|
|
3412
|
+
onValueChangeDebounced();
|
|
3411
3413
|
},
|
|
3412
3414
|
async getSubmittableValue() {
|
|
3413
3415
|
return component.getSubmittableValueSync();
|
|
@@ -3600,11 +3602,14 @@ var getRequiredCheck = (required, messageFunctions) => (value) => {
|
|
|
3600
3602
|
if (isArray(value) && value.length === 0) {
|
|
3601
3603
|
return messageFunctions.required();
|
|
3602
3604
|
}
|
|
3603
|
-
if (value === "") {
|
|
3604
|
-
return messageFunctions.required();
|
|
3605
|
-
}
|
|
3606
3605
|
return isNullish(value) ? messageFunctions.required() : null;
|
|
3607
3606
|
};
|
|
3607
|
+
var getStringRequiredCheck = (required, messageFunctions) => (value) => {
|
|
3608
|
+
if (!required) {
|
|
3609
|
+
return null;
|
|
3610
|
+
}
|
|
3611
|
+
return isNullish(value) || value === "" ? messageFunctions.required() : null;
|
|
3612
|
+
};
|
|
3608
3613
|
var getValidDateCheck = (required, messageFunctions) => (value) => {
|
|
3609
3614
|
if (required && !isValidDate(value)) {
|
|
3610
3615
|
return messageFunctions.required();
|
|
@@ -3866,9 +3871,16 @@ var schemaHasPlaceholder = (schema) => Boolean("placeholder" in schema && schema
|
|
|
3866
3871
|
|
|
3867
3872
|
// src/domain/mappers/schema/numberSchemaToComponent.ts
|
|
3868
3873
|
var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
3869
|
-
const {
|
|
3874
|
+
const {
|
|
3875
|
+
schema,
|
|
3876
|
+
model,
|
|
3877
|
+
localValue,
|
|
3878
|
+
required = false,
|
|
3879
|
+
onPersistAsync,
|
|
3880
|
+
onValueChange
|
|
3881
|
+
} = schemaMapperProps;
|
|
3870
3882
|
const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
|
|
3871
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
3883
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
3872
3884
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
3873
3885
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
3874
3886
|
schemaMapperProps,
|
|
@@ -3973,7 +3985,7 @@ var createAllOfComponent = (props) => {
|
|
|
3973
3985
|
|
|
3974
3986
|
// src/domain/mappers/schema/allOfSchemaToComponent.ts
|
|
3975
3987
|
var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
3976
|
-
const { uid, schema, localValue, model, required, validationErrors } = schemaMapperProps;
|
|
3988
|
+
const { uid, schema, localValue, model, required, validationErrors, onValueChange } = schemaMapperProps;
|
|
3977
3989
|
const { allOf } = schema;
|
|
3978
3990
|
const components = allOf.map(
|
|
3979
3991
|
(childSchema, index) => mapSchemaToComponent(
|
|
@@ -3983,7 +3995,8 @@ var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
3983
3995
|
model,
|
|
3984
3996
|
localValue,
|
|
3985
3997
|
required,
|
|
3986
|
-
validationErrors
|
|
3998
|
+
validationErrors,
|
|
3999
|
+
onValueChange
|
|
3987
4000
|
},
|
|
3988
4001
|
mapperProps
|
|
3989
4002
|
)
|
|
@@ -4121,7 +4134,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4121
4134
|
schema,
|
|
4122
4135
|
model: initialModel,
|
|
4123
4136
|
required = false,
|
|
4124
|
-
validationErrors
|
|
4137
|
+
validationErrors,
|
|
4138
|
+
onValueChange
|
|
4125
4139
|
} = schemaMapperProps;
|
|
4126
4140
|
const { items, addItemTitle, editItemTitle, maxItems, minItems, summary } = schema;
|
|
4127
4141
|
const value = isArray(localValue) ? localValue : [];
|
|
@@ -4133,7 +4147,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4133
4147
|
model: item,
|
|
4134
4148
|
localValue: value == null ? void 0 : value[index],
|
|
4135
4149
|
// TODO tests for this
|
|
4136
|
-
validationErrors
|
|
4150
|
+
validationErrors,
|
|
4151
|
+
onValueChange
|
|
4137
4152
|
},
|
|
4138
4153
|
mapperProps
|
|
4139
4154
|
)
|
|
@@ -4145,11 +4160,11 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4145
4160
|
localValue: editableValue,
|
|
4146
4161
|
model: localValueToJsonElement(editableValue),
|
|
4147
4162
|
validationErrors: void 0,
|
|
4148
|
-
required: true
|
|
4163
|
+
required: true,
|
|
4164
|
+
onValueChange
|
|
4149
4165
|
},
|
|
4150
4166
|
mapperProps
|
|
4151
4167
|
);
|
|
4152
|
-
const { onValueChange } = mapperProps;
|
|
4153
4168
|
const errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
|
|
4154
4169
|
return createRepeatableComponent(
|
|
4155
4170
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
@@ -4433,7 +4448,7 @@ var schemaHasValidationMessages = (schema) => Boolean("validationMessages" in sc
|
|
|
4433
4448
|
var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
|
|
4434
4449
|
var _a;
|
|
4435
4450
|
const { getErrorMessageFunctions } = mapperProps;
|
|
4436
|
-
const { localValue, model, schema, required = false } = schemaMapperProps;
|
|
4451
|
+
const { localValue, model, schema, required = false, onValueChange } = schemaMapperProps;
|
|
4437
4452
|
const uploadSchema = getUploadSchema(schema.items);
|
|
4438
4453
|
const { accepts, cameraConfig, maxSize } = uploadSchema;
|
|
4439
4454
|
const { minItems, maxItems, title, validationMessages } = schema;
|
|
@@ -4454,7 +4469,6 @@ var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4454
4469
|
persistAsyncConfig,
|
|
4455
4470
|
schema: __spreadProps(__spreadValues({}, uploadSchema), { hidden: (_a = schema.hidden) != null ? _a : uploadSchema.hidden, alert: schema.alert })
|
|
4456
4471
|
});
|
|
4457
|
-
const { onValueChange } = mapperProps;
|
|
4458
4472
|
const performPersistAsync = persistAsyncConfig ? getPerformPersistAsyncFn(combinedSchemaProps.schema, persistAsyncConfig, mapperProps) : void 0;
|
|
4459
4473
|
const value = performPersistAsync ? getValueForPersistAsync(localValue) : [];
|
|
4460
4474
|
const persistedState = performPersistAsync && isArray(model) ? model.map((itemModel) => getInitialPersistedState(null, itemModel)) : [];
|
|
@@ -4605,7 +4619,8 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4605
4619
|
schema,
|
|
4606
4620
|
model,
|
|
4607
4621
|
required = false,
|
|
4608
|
-
validationErrors: initialError
|
|
4622
|
+
validationErrors: initialError,
|
|
4623
|
+
onValueChange
|
|
4609
4624
|
} = schemaMapperProps;
|
|
4610
4625
|
const initialModel = model != null ? model : null;
|
|
4611
4626
|
const options = schema.items.oneOf.map((childSchema, index) => {
|
|
@@ -4629,14 +4644,15 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4629
4644
|
model: initialModel,
|
|
4630
4645
|
localValue,
|
|
4631
4646
|
validationErrors: initialError,
|
|
4632
|
-
required
|
|
4647
|
+
required,
|
|
4648
|
+
onValueChange
|
|
4633
4649
|
},
|
|
4634
4650
|
mapperProps
|
|
4635
4651
|
)
|
|
4636
4652
|
};
|
|
4637
4653
|
});
|
|
4638
4654
|
const { maxItems, minItems, title, validationMessages } = schema;
|
|
4639
|
-
const { getErrorMessageFunctions, onBehavior,
|
|
4655
|
+
const { getErrorMessageFunctions, onBehavior, onComponentUpdate } = mapperProps;
|
|
4640
4656
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
4641
4657
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
4642
4658
|
schemaMapperProps,
|
|
@@ -4730,7 +4746,8 @@ var arraySchemaToTupleComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4730
4746
|
schema,
|
|
4731
4747
|
model: initialModel,
|
|
4732
4748
|
required = false,
|
|
4733
|
-
validationErrors
|
|
4749
|
+
validationErrors,
|
|
4750
|
+
onValueChange
|
|
4734
4751
|
} = schemaMapperProps;
|
|
4735
4752
|
const { items } = schema;
|
|
4736
4753
|
const components = items.map(
|
|
@@ -4743,7 +4760,8 @@ var arraySchemaToTupleComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4743
4760
|
model: isArray(initialModel) ? (_a = initialModel[index]) != null ? _a : null : null,
|
|
4744
4761
|
localValue: isArray(localValue) ? (_b = localValue[index]) != null ? _b : null : null,
|
|
4745
4762
|
validationErrors: isArray(validationErrors) ? validationErrors[index] : void 0,
|
|
4746
|
-
required
|
|
4763
|
+
required,
|
|
4764
|
+
onValueChange
|
|
4747
4765
|
},
|
|
4748
4766
|
mapperProps
|
|
4749
4767
|
);
|
|
@@ -4867,9 +4885,16 @@ var createUploadInputComponent = (props, onComponentUpdate) => {
|
|
|
4867
4885
|
|
|
4868
4886
|
// src/domain/mappers/schema/blobSchemaToComponent.ts
|
|
4869
4887
|
var blobSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
4870
|
-
const {
|
|
4888
|
+
const {
|
|
4889
|
+
schema,
|
|
4890
|
+
localValue,
|
|
4891
|
+
model,
|
|
4892
|
+
required = false,
|
|
4893
|
+
onPersistAsync,
|
|
4894
|
+
onValueChange
|
|
4895
|
+
} = schemaMapperProps;
|
|
4871
4896
|
const { accepts, cameraConfig, maxSize, source, validationMessages } = schema;
|
|
4872
|
-
const { getErrorMessageFunctions, onComponentUpdate
|
|
4897
|
+
const { getErrorMessageFunctions, onComponentUpdate } = mapperProps;
|
|
4873
4898
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
4874
4899
|
const validLocalValue = isFile(localValue) ? localValue : null;
|
|
4875
4900
|
const value = onPersistAsync && model !== null ? validLocalValue : null;
|
|
@@ -4957,9 +4982,9 @@ var createBooleanInputComponent = (props, onComponentUpdate) => {
|
|
|
4957
4982
|
|
|
4958
4983
|
// src/domain/mappers/schema/booleanSchemaToComponent.ts
|
|
4959
4984
|
var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
4960
|
-
const { schema, localValue, model, onPersistAsync } = schemaMapperProps;
|
|
4985
|
+
const { schema, localValue, model, onPersistAsync, onValueChange } = schemaMapperProps;
|
|
4961
4986
|
const { default: defaultValue, additionalText, inlineAlert, supportingValues } = schema;
|
|
4962
|
-
const { onComponentUpdate, onBehavior
|
|
4987
|
+
const { onComponentUpdate, onBehavior } = mapperProps;
|
|
4963
4988
|
const schemaOnChange = getSchemaOnChange(schema, onBehavior);
|
|
4964
4989
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
4965
4990
|
schemaMapperProps,
|
|
@@ -5060,6 +5085,7 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5060
5085
|
"summariser"
|
|
5061
5086
|
]);
|
|
5062
5087
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5088
|
+
const onValueChangeDebounced = debounce(onValueChange, 1e3);
|
|
5063
5089
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5064
5090
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
5065
5091
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
@@ -5077,6 +5103,7 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5077
5103
|
}));
|
|
5078
5104
|
validateAsync == null ? void 0 : validateAsync.flush();
|
|
5079
5105
|
}
|
|
5106
|
+
onValueChangeDebounced.flush();
|
|
5080
5107
|
},
|
|
5081
5108
|
onFocus() {
|
|
5082
5109
|
},
|
|
@@ -5093,7 +5120,7 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5093
5120
|
if (isValid) {
|
|
5094
5121
|
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
5095
5122
|
}
|
|
5096
|
-
|
|
5123
|
+
onValueChangeDebounced();
|
|
5097
5124
|
},
|
|
5098
5125
|
async getSubmittableValue() {
|
|
5099
5126
|
return component.getSubmittableValueSync();
|
|
@@ -5121,9 +5148,16 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5121
5148
|
|
|
5122
5149
|
// src/domain/mappers/schema/integerSchemaToComponent.ts
|
|
5123
5150
|
var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
5124
|
-
const {
|
|
5151
|
+
const {
|
|
5152
|
+
schema,
|
|
5153
|
+
localValue,
|
|
5154
|
+
model,
|
|
5155
|
+
required = false,
|
|
5156
|
+
onPersistAsync,
|
|
5157
|
+
onValueChange
|
|
5158
|
+
} = schemaMapperProps;
|
|
5125
5159
|
const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
|
|
5126
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
5160
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
5127
5161
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
5128
5162
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
5129
5163
|
schemaMapperProps,
|
|
@@ -5445,7 +5479,7 @@ var objectSchemaToObjectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5445
5479
|
}));
|
|
5446
5480
|
};
|
|
5447
5481
|
var createComponentMap = (schemaMapperProps, mapperProps, uidPrefix) => {
|
|
5448
|
-
const { uid, localValue, schema, model, validationErrors } = schemaMapperProps;
|
|
5482
|
+
const { uid, localValue, schema, model, validationErrors, onValueChange } = schemaMapperProps;
|
|
5449
5483
|
const { $id, displayOrder, properties, required } = schema;
|
|
5450
5484
|
const initialReducerValue = {};
|
|
5451
5485
|
return displayOrder.reduce((acc, propName) => {
|
|
@@ -5462,7 +5496,8 @@ var createComponentMap = (schemaMapperProps, mapperProps, uidPrefix) => {
|
|
|
5462
5496
|
model: isObjectModel(model) ? model[propName] : null,
|
|
5463
5497
|
localValue: isObjectLocalValue(localValue) ? localValue[propName] : null,
|
|
5464
5498
|
required: (_a = required == null ? void 0 : required.includes(propName)) != null ? _a : false,
|
|
5465
|
-
validationErrors: isObject(validationErrors) ? validationErrors[propName] : void 0
|
|
5499
|
+
validationErrors: isObject(validationErrors) ? validationErrors[propName] : void 0,
|
|
5500
|
+
onValueChange
|
|
5466
5501
|
},
|
|
5467
5502
|
mapperProps
|
|
5468
5503
|
)
|
|
@@ -5680,7 +5715,8 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5680
5715
|
schema,
|
|
5681
5716
|
model,
|
|
5682
5717
|
validationErrors: initialError,
|
|
5683
|
-
required = false
|
|
5718
|
+
required = false,
|
|
5719
|
+
onValueChange
|
|
5684
5720
|
} = schemaMapperProps;
|
|
5685
5721
|
const initialModel = (_a = model != null ? model : schema.default) != null ? _a : null;
|
|
5686
5722
|
const options = schema.oneOf.map((childSchema, index) => {
|
|
@@ -5715,13 +5751,14 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5715
5751
|
model: initialModel,
|
|
5716
5752
|
localValue,
|
|
5717
5753
|
validationErrors: initialError,
|
|
5718
|
-
required
|
|
5754
|
+
required,
|
|
5755
|
+
onValueChange
|
|
5719
5756
|
},
|
|
5720
5757
|
mapperProps
|
|
5721
5758
|
)
|
|
5722
5759
|
};
|
|
5723
5760
|
});
|
|
5724
|
-
const { getErrorMessageFunctions, onComponentUpdate, trackEvent, onBehavior
|
|
5761
|
+
const { getErrorMessageFunctions, onComponentUpdate, trackEvent, onBehavior } = mapperProps;
|
|
5725
5762
|
const { validationMessages } = schema;
|
|
5726
5763
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
5727
5764
|
return createSelectInputComponent(
|
|
@@ -5999,7 +6036,14 @@ var mapStringSchemaSuggestions = (suggestions, logEvent) => {
|
|
|
5999
6036
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.ts
|
|
6000
6037
|
var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
6001
6038
|
var _a;
|
|
6002
|
-
const {
|
|
6039
|
+
const {
|
|
6040
|
+
schema,
|
|
6041
|
+
localValue,
|
|
6042
|
+
model,
|
|
6043
|
+
required = false,
|
|
6044
|
+
onPersistAsync,
|
|
6045
|
+
onValueChange
|
|
6046
|
+
} = schemaMapperProps;
|
|
6003
6047
|
const {
|
|
6004
6048
|
autocompleteHint,
|
|
6005
6049
|
default: defaultValue,
|
|
@@ -6007,7 +6051,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6007
6051
|
maximum: maximumDate,
|
|
6008
6052
|
suggestions
|
|
6009
6053
|
} = schema;
|
|
6010
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
6054
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
6011
6055
|
const errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
|
|
6012
6056
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
6013
6057
|
schemaMapperProps,
|
|
@@ -6020,7 +6064,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6020
6064
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
6021
6065
|
autoComplete: getAutocompleteString(autocompleteHint),
|
|
6022
6066
|
checks: schema.hidden ? [] : [
|
|
6023
|
-
|
|
6067
|
+
getStringRequiredCheck(required, errorMessageFunctions),
|
|
6024
6068
|
getValidDateCheck(required, errorMessageFunctions),
|
|
6025
6069
|
getAboveMaximumDateCheck(schema, errorMessageFunctions),
|
|
6026
6070
|
getBelowMinimumDateCheck(schema, errorMessageFunctions)
|
|
@@ -6056,9 +6100,9 @@ var getValidDate = (model) => {
|
|
|
6056
6100
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.ts
|
|
6057
6101
|
var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
|
|
6058
6102
|
var _a;
|
|
6059
|
-
const { schema, localValue, model, required = false } = schemaMapperProps;
|
|
6103
|
+
const { schema, localValue, model, required = false, onValueChange } = schemaMapperProps;
|
|
6060
6104
|
const { accepts, autocompleteHint, cameraConfig, hidden, maxSize, source, validationMessages } = schema;
|
|
6061
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
6105
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
6062
6106
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
6063
6107
|
const validLocalValue = isFile(localValue) ? localValue : null;
|
|
6064
6108
|
const value = (_a = getFileFromModel(model)) != null ? _a : validLocalValue;
|
|
@@ -6109,6 +6153,7 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6109
6153
|
"value"
|
|
6110
6154
|
]);
|
|
6111
6155
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
6156
|
+
const onValueChangeDebounced = debounce(onValueChange, 1e3);
|
|
6112
6157
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
6113
6158
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
6114
6159
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
@@ -6126,6 +6171,7 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6126
6171
|
}));
|
|
6127
6172
|
validateAsync == null ? void 0 : validateAsync.flush();
|
|
6128
6173
|
}
|
|
6174
|
+
onValueChangeDebounced.flush();
|
|
6129
6175
|
},
|
|
6130
6176
|
onFocus() {
|
|
6131
6177
|
},
|
|
@@ -6145,7 +6191,7 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6145
6191
|
if (!updatedValue) {
|
|
6146
6192
|
validateAsync == null ? void 0 : validateAsync.cancel();
|
|
6147
6193
|
}
|
|
6148
|
-
|
|
6194
|
+
onValueChangeDebounced();
|
|
6149
6195
|
},
|
|
6150
6196
|
async getSubmittableValue() {
|
|
6151
6197
|
return component.getSubmittableValueSync();
|
|
@@ -6172,7 +6218,14 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6172
6218
|
|
|
6173
6219
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.ts
|
|
6174
6220
|
var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
6175
|
-
const {
|
|
6221
|
+
const {
|
|
6222
|
+
schema,
|
|
6223
|
+
localValue,
|
|
6224
|
+
model,
|
|
6225
|
+
required = false,
|
|
6226
|
+
onPersistAsync,
|
|
6227
|
+
onValueChange
|
|
6228
|
+
} = schemaMapperProps;
|
|
6176
6229
|
const {
|
|
6177
6230
|
autocapitalization,
|
|
6178
6231
|
autocompleteHint,
|
|
@@ -6186,7 +6239,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6186
6239
|
suggestions,
|
|
6187
6240
|
validationMessages
|
|
6188
6241
|
} = schema;
|
|
6189
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior,
|
|
6242
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior, logEvent } = mapperProps;
|
|
6190
6243
|
const controlForLegacyFormat = getControlForLegacyFormat(format);
|
|
6191
6244
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
6192
6245
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
@@ -6201,7 +6254,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6201
6254
|
autocapitalization,
|
|
6202
6255
|
autoComplete: getAutocompleteString(autocompleteHint),
|
|
6203
6256
|
checks: schema.hidden ? [] : [
|
|
6204
|
-
|
|
6257
|
+
getStringRequiredCheck(required, errorMessageFunctions),
|
|
6205
6258
|
getAboveMaxLengthCheck(schema, errorMessageFunctions),
|
|
6206
6259
|
getBelowMinLengthCheck(schema, errorMessageFunctions),
|
|
6207
6260
|
getNotAdheringToPatternCheck(schema, errorMessageFunctions, { logEvent })
|
|
@@ -6300,6 +6353,8 @@ var mapSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6300
6353
|
};
|
|
6301
6354
|
|
|
6302
6355
|
// src/domain/mappers/mapStepSchemas.ts
|
|
6356
|
+
var noop2 = () => {
|
|
6357
|
+
};
|
|
6303
6358
|
var mapStepSchemas = (uid, step, stepLocalValue, mapperProps) => {
|
|
6304
6359
|
return step.schemas.map(
|
|
6305
6360
|
(schema, i) => {
|
|
@@ -6312,7 +6367,8 @@ var mapStepSchemas = (uid, step, stepLocalValue, mapperProps) => {
|
|
|
6312
6367
|
model: (_a = step.model) != null ? _a : null,
|
|
6313
6368
|
localValue: stepLocalValue,
|
|
6314
6369
|
validationErrors: (_b = step.errors) == null ? void 0 : _b.validation,
|
|
6315
|
-
required: true
|
|
6370
|
+
required: true,
|
|
6371
|
+
onValueChange: noop2
|
|
6316
6372
|
},
|
|
6317
6373
|
mapperProps
|
|
6318
6374
|
);
|
|
@@ -6981,8 +7037,7 @@ var createFlowController = (props) => {
|
|
|
6981
7037
|
onNotification,
|
|
6982
7038
|
onError,
|
|
6983
7039
|
onEvent,
|
|
6984
|
-
onLog
|
|
6985
|
-
onValueChange
|
|
7040
|
+
onLog
|
|
6986
7041
|
} = props;
|
|
6987
7042
|
const httpClient = getHttpClientWithCapabilities(props.httpClient, nativeSubflowHandlers);
|
|
6988
7043
|
const rootComponent = createRootDomainComponent(
|
|
@@ -7023,8 +7078,7 @@ var createFlowController = (props) => {
|
|
|
7023
7078
|
httpClient,
|
|
7024
7079
|
onBehavior,
|
|
7025
7080
|
onLink,
|
|
7026
|
-
onPoll
|
|
7027
|
-
onValueChange
|
|
7081
|
+
onPoll
|
|
7028
7082
|
});
|
|
7029
7083
|
const createStepComponent2 = (newStep, etag, localValue) => {
|
|
7030
7084
|
rootComponent.stop();
|
|
@@ -7348,6 +7402,7 @@ var createFlowController = (props) => {
|
|
|
7348
7402
|
switch (command.type) {
|
|
7349
7403
|
case "replace-step":
|
|
7350
7404
|
createStep(command.step, command.etag);
|
|
7405
|
+
trackCoreEvent("Step Shown", { isFirstStep: false });
|
|
7351
7406
|
return true;
|
|
7352
7407
|
case "behavior":
|
|
7353
7408
|
void onBehavior(command.behavior);
|
|
@@ -8738,8 +8793,6 @@ function useStableCallback(handler) {
|
|
|
8738
8793
|
// src/useDynamicFlow.tsx
|
|
8739
8794
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
8740
8795
|
var className = "dynamic-flow";
|
|
8741
|
-
var noop2 = () => {
|
|
8742
|
-
};
|
|
8743
8796
|
function useDynamicFlow(props) {
|
|
8744
8797
|
var _a, _b;
|
|
8745
8798
|
const { flowId, renderers } = props;
|
|
@@ -8761,7 +8814,6 @@ function useDynamicFlow(props) {
|
|
|
8761
8814
|
const onError = useStableCallback(props.onError);
|
|
8762
8815
|
const onEvent = useStableCallback(props.onEvent);
|
|
8763
8816
|
const onLog = useStableCallback(props.onLog);
|
|
8764
|
-
const onValueChange = noop2;
|
|
8765
8817
|
const { formatMessage, locale } = useIntl2();
|
|
8766
8818
|
const getErrorMessageFunctions = useMemo(
|
|
8767
8819
|
() => getSchemaErrorMessageFunction(formatMessage, locale),
|
|
@@ -8783,7 +8835,6 @@ function useDynamicFlow(props) {
|
|
|
8783
8835
|
onError,
|
|
8784
8836
|
onEvent,
|
|
8785
8837
|
onLog,
|
|
8786
|
-
onValueChange,
|
|
8787
8838
|
scrollToTop
|
|
8788
8839
|
}));
|
|
8789
8840
|
const render = useMemo(
|