@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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dynamicFlows.ArraySchema.addItem": "Spara",
|
|
3
|
+
"dynamicFlows.ArraySchema.addItemTitle": "Add Item",
|
|
4
|
+
"dynamicFlows.ArraySchema.editItem": "Spara",
|
|
5
|
+
"dynamicFlows.ArraySchema.maxItemsError": "Please add {maxItems} or fewer.",
|
|
6
|
+
"dynamicFlows.ArraySchema.minItemsError": "Please add at least {minItems}.",
|
|
7
|
+
"dynamicFlows.ArraySchema.removeItem": "Remove",
|
|
8
|
+
"dynamicFlows.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
9
|
+
"dynamicFlows.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|
|
10
|
+
"dynamicFlows.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
|
|
11
|
+
"dynamicFlows.ControlFeedback.minLength": "Please enter at least {minLength} characters.",
|
|
12
|
+
"dynamicFlows.ControlFeedback.minimum": "Please enter a number that's {minimum} or more.",
|
|
13
|
+
"dynamicFlows.ControlFeedback.minimumDate": "Please enter a date that's on or after {minimum}.",
|
|
14
|
+
"dynamicFlows.ControlFeedback.pattern": "Please enter this in the correct format.",
|
|
15
|
+
"dynamicFlows.ControlFeedback.patternDate": "Please enter a date in the corrrect format.",
|
|
16
|
+
"dynamicFlows.ControlFeedback.required": "Please fill out this field.",
|
|
17
|
+
"dynamicFlows.ControlFeedback.type": "Incorrect type",
|
|
18
|
+
"dynamicFlows.DownloadFeedback.failed": "Download failed",
|
|
19
|
+
"dynamicFlows.DownloadFeedback.started": "Downloading...",
|
|
20
|
+
"dynamicFlows.DownloadFeedback.successful": "Download successful",
|
|
21
|
+
"dynamicFlows.DynamicParagraph.copied": "Copied to clipboard",
|
|
22
|
+
"dynamicFlows.DynamicParagraph.copy": "Kopiera",
|
|
23
|
+
"dynamicFlows.ErrorBoundary.errorAlert": "Something went wrong.",
|
|
24
|
+
"dynamicFlows.ErrorBoundary.retry": "Retry",
|
|
25
|
+
"dynamicFlows.ExternalConfirmation.cancel": "Avbryt",
|
|
26
|
+
"dynamicFlows.ExternalConfirmation.description": "Please confirm you want to open **{origin}** in a new browser tab.",
|
|
27
|
+
"dynamicFlows.ExternalConfirmation.open": "Open in new tab",
|
|
28
|
+
"dynamicFlows.ExternalConfirmation.title": "Please confirm",
|
|
29
|
+
"dynamicFlows.FileUploadSchema.maxFileSizeError": "Sorry, that file is too big. Please upload a smaller file.",
|
|
30
|
+
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "Sorry, that file format is not supported. Please upload a different file.",
|
|
31
|
+
"dynamicFlows.Help.ariaLabel": "Click here for more info.",
|
|
32
|
+
"dynamicFlows.MultiSelect.summary": "{first} and {count} more",
|
|
33
|
+
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Sorry, that file is too big. Please upload a smaller file.",
|
|
34
|
+
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "Please upload {maxItems} or fewer files.",
|
|
35
|
+
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Please upload at least {minItems} file(s).",
|
|
36
|
+
"dynamicFlows.PersistAsyncSchema.genericError": "Something went wrong, please try again.",
|
|
37
|
+
"dynamicFlows.SearchLayout.loading": "Loading..."
|
|
38
|
+
}
|
package/build/main.js
CHANGED
|
@@ -2183,7 +2183,7 @@ var debounce = (callback, waitMs) => {
|
|
|
2183
2183
|
let timeoutId = null;
|
|
2184
2184
|
let lastArgs = null;
|
|
2185
2185
|
const clearTimer = () => {
|
|
2186
|
-
if (timeoutId) {
|
|
2186
|
+
if (timeoutId !== null) {
|
|
2187
2187
|
clearTimeout(timeoutId);
|
|
2188
2188
|
timeoutId = null;
|
|
2189
2189
|
}
|
|
@@ -3012,7 +3012,7 @@ var executeRequest = async (props) => {
|
|
|
3012
3012
|
url,
|
|
3013
3013
|
{
|
|
3014
3014
|
method,
|
|
3015
|
-
body: body ? JSON.stringify(body) : void 0,
|
|
3015
|
+
body: body != null ? JSON.stringify(body) : void 0,
|
|
3016
3016
|
headers: { "Content-Type": "application/json" }
|
|
3017
3017
|
}
|
|
3018
3018
|
],
|
|
@@ -3406,6 +3406,7 @@ var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
|
3406
3406
|
"summariser"
|
|
3407
3407
|
]);
|
|
3408
3408
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
3409
|
+
const onValueChangeDebounced = debounce(onValueChange, 1e3);
|
|
3409
3410
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
3410
3411
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
3411
3412
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
@@ -3422,6 +3423,7 @@ var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
|
3422
3423
|
}));
|
|
3423
3424
|
validateAsync == null ? void 0 : validateAsync.flush();
|
|
3424
3425
|
}
|
|
3426
|
+
onValueChangeDebounced.flush();
|
|
3425
3427
|
},
|
|
3426
3428
|
onFocus() {
|
|
3427
3429
|
},
|
|
@@ -3438,7 +3440,7 @@ var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
|
3438
3440
|
if (isValid) {
|
|
3439
3441
|
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
3440
3442
|
}
|
|
3441
|
-
|
|
3443
|
+
onValueChangeDebounced();
|
|
3442
3444
|
},
|
|
3443
3445
|
async getSubmittableValue() {
|
|
3444
3446
|
return component.getSubmittableValueSync();
|
|
@@ -3631,11 +3633,14 @@ var getRequiredCheck = (required, messageFunctions) => (value) => {
|
|
|
3631
3633
|
if (isArray(value) && value.length === 0) {
|
|
3632
3634
|
return messageFunctions.required();
|
|
3633
3635
|
}
|
|
3634
|
-
if (value === "") {
|
|
3635
|
-
return messageFunctions.required();
|
|
3636
|
-
}
|
|
3637
3636
|
return isNullish(value) ? messageFunctions.required() : null;
|
|
3638
3637
|
};
|
|
3638
|
+
var getStringRequiredCheck = (required, messageFunctions) => (value) => {
|
|
3639
|
+
if (!required) {
|
|
3640
|
+
return null;
|
|
3641
|
+
}
|
|
3642
|
+
return isNullish(value) || value === "" ? messageFunctions.required() : null;
|
|
3643
|
+
};
|
|
3639
3644
|
var getValidDateCheck = (required, messageFunctions) => (value) => {
|
|
3640
3645
|
if (required && !isValidDate(value)) {
|
|
3641
3646
|
return messageFunctions.required();
|
|
@@ -3897,9 +3902,16 @@ var schemaHasPlaceholder = (schema) => Boolean("placeholder" in schema && schema
|
|
|
3897
3902
|
|
|
3898
3903
|
// src/domain/mappers/schema/numberSchemaToComponent.ts
|
|
3899
3904
|
var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
3900
|
-
const {
|
|
3905
|
+
const {
|
|
3906
|
+
schema,
|
|
3907
|
+
model,
|
|
3908
|
+
localValue,
|
|
3909
|
+
required = false,
|
|
3910
|
+
onPersistAsync,
|
|
3911
|
+
onValueChange
|
|
3912
|
+
} = schemaMapperProps;
|
|
3901
3913
|
const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
|
|
3902
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
3914
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
3903
3915
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
3904
3916
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
3905
3917
|
schemaMapperProps,
|
|
@@ -4004,7 +4016,7 @@ var createAllOfComponent = (props) => {
|
|
|
4004
4016
|
|
|
4005
4017
|
// src/domain/mappers/schema/allOfSchemaToComponent.ts
|
|
4006
4018
|
var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
4007
|
-
const { uid, schema, localValue, model, required, validationErrors } = schemaMapperProps;
|
|
4019
|
+
const { uid, schema, localValue, model, required, validationErrors, onValueChange } = schemaMapperProps;
|
|
4008
4020
|
const { allOf } = schema;
|
|
4009
4021
|
const components = allOf.map(
|
|
4010
4022
|
(childSchema, index) => mapSchemaToComponent(
|
|
@@ -4014,7 +4026,8 @@ var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4014
4026
|
model,
|
|
4015
4027
|
localValue,
|
|
4016
4028
|
required,
|
|
4017
|
-
validationErrors
|
|
4029
|
+
validationErrors,
|
|
4030
|
+
onValueChange
|
|
4018
4031
|
},
|
|
4019
4032
|
mapperProps
|
|
4020
4033
|
)
|
|
@@ -4152,7 +4165,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4152
4165
|
schema,
|
|
4153
4166
|
model: initialModel,
|
|
4154
4167
|
required = false,
|
|
4155
|
-
validationErrors
|
|
4168
|
+
validationErrors,
|
|
4169
|
+
onValueChange
|
|
4156
4170
|
} = schemaMapperProps;
|
|
4157
4171
|
const { items, addItemTitle, editItemTitle, maxItems, minItems, summary } = schema;
|
|
4158
4172
|
const value = isArray(localValue) ? localValue : [];
|
|
@@ -4164,7 +4178,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4164
4178
|
model: item,
|
|
4165
4179
|
localValue: value == null ? void 0 : value[index],
|
|
4166
4180
|
// TODO tests for this
|
|
4167
|
-
validationErrors
|
|
4181
|
+
validationErrors,
|
|
4182
|
+
onValueChange
|
|
4168
4183
|
},
|
|
4169
4184
|
mapperProps
|
|
4170
4185
|
)
|
|
@@ -4176,11 +4191,11 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4176
4191
|
localValue: editableValue,
|
|
4177
4192
|
model: localValueToJsonElement(editableValue),
|
|
4178
4193
|
validationErrors: void 0,
|
|
4179
|
-
required: true
|
|
4194
|
+
required: true,
|
|
4195
|
+
onValueChange
|
|
4180
4196
|
},
|
|
4181
4197
|
mapperProps
|
|
4182
4198
|
);
|
|
4183
|
-
const { onValueChange } = mapperProps;
|
|
4184
4199
|
const errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
|
|
4185
4200
|
return createRepeatableComponent(
|
|
4186
4201
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
@@ -4464,7 +4479,7 @@ var schemaHasValidationMessages = (schema) => Boolean("validationMessages" in sc
|
|
|
4464
4479
|
var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
|
|
4465
4480
|
var _a;
|
|
4466
4481
|
const { getErrorMessageFunctions } = mapperProps;
|
|
4467
|
-
const { localValue, model, schema, required = false } = schemaMapperProps;
|
|
4482
|
+
const { localValue, model, schema, required = false, onValueChange } = schemaMapperProps;
|
|
4468
4483
|
const uploadSchema = getUploadSchema(schema.items);
|
|
4469
4484
|
const { accepts, cameraConfig, maxSize } = uploadSchema;
|
|
4470
4485
|
const { minItems, maxItems, title, validationMessages } = schema;
|
|
@@ -4485,7 +4500,6 @@ var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4485
4500
|
persistAsyncConfig,
|
|
4486
4501
|
schema: __spreadProps(__spreadValues({}, uploadSchema), { hidden: (_a = schema.hidden) != null ? _a : uploadSchema.hidden, alert: schema.alert })
|
|
4487
4502
|
});
|
|
4488
|
-
const { onValueChange } = mapperProps;
|
|
4489
4503
|
const performPersistAsync = persistAsyncConfig ? getPerformPersistAsyncFn(combinedSchemaProps.schema, persistAsyncConfig, mapperProps) : void 0;
|
|
4490
4504
|
const value = performPersistAsync ? getValueForPersistAsync(localValue) : [];
|
|
4491
4505
|
const persistedState = performPersistAsync && isArray(model) ? model.map((itemModel) => getInitialPersistedState(null, itemModel)) : [];
|
|
@@ -4636,7 +4650,8 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4636
4650
|
schema,
|
|
4637
4651
|
model,
|
|
4638
4652
|
required = false,
|
|
4639
|
-
validationErrors: initialError
|
|
4653
|
+
validationErrors: initialError,
|
|
4654
|
+
onValueChange
|
|
4640
4655
|
} = schemaMapperProps;
|
|
4641
4656
|
const initialModel = model != null ? model : null;
|
|
4642
4657
|
const options = schema.items.oneOf.map((childSchema, index) => {
|
|
@@ -4660,14 +4675,15 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4660
4675
|
model: initialModel,
|
|
4661
4676
|
localValue,
|
|
4662
4677
|
validationErrors: initialError,
|
|
4663
|
-
required
|
|
4678
|
+
required,
|
|
4679
|
+
onValueChange
|
|
4664
4680
|
},
|
|
4665
4681
|
mapperProps
|
|
4666
4682
|
)
|
|
4667
4683
|
};
|
|
4668
4684
|
});
|
|
4669
4685
|
const { maxItems, minItems, title, validationMessages } = schema;
|
|
4670
|
-
const { getErrorMessageFunctions, onBehavior,
|
|
4686
|
+
const { getErrorMessageFunctions, onBehavior, onComponentUpdate } = mapperProps;
|
|
4671
4687
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
4672
4688
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
4673
4689
|
schemaMapperProps,
|
|
@@ -4761,7 +4777,8 @@ var arraySchemaToTupleComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4761
4777
|
schema,
|
|
4762
4778
|
model: initialModel,
|
|
4763
4779
|
required = false,
|
|
4764
|
-
validationErrors
|
|
4780
|
+
validationErrors,
|
|
4781
|
+
onValueChange
|
|
4765
4782
|
} = schemaMapperProps;
|
|
4766
4783
|
const { items } = schema;
|
|
4767
4784
|
const components = items.map(
|
|
@@ -4774,7 +4791,8 @@ var arraySchemaToTupleComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4774
4791
|
model: isArray(initialModel) ? (_a = initialModel[index]) != null ? _a : null : null,
|
|
4775
4792
|
localValue: isArray(localValue) ? (_b = localValue[index]) != null ? _b : null : null,
|
|
4776
4793
|
validationErrors: isArray(validationErrors) ? validationErrors[index] : void 0,
|
|
4777
|
-
required
|
|
4794
|
+
required,
|
|
4795
|
+
onValueChange
|
|
4778
4796
|
},
|
|
4779
4797
|
mapperProps
|
|
4780
4798
|
);
|
|
@@ -4898,9 +4916,16 @@ var createUploadInputComponent = (props, onComponentUpdate) => {
|
|
|
4898
4916
|
|
|
4899
4917
|
// src/domain/mappers/schema/blobSchemaToComponent.ts
|
|
4900
4918
|
var blobSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
4901
|
-
const {
|
|
4919
|
+
const {
|
|
4920
|
+
schema,
|
|
4921
|
+
localValue,
|
|
4922
|
+
model,
|
|
4923
|
+
required = false,
|
|
4924
|
+
onPersistAsync,
|
|
4925
|
+
onValueChange
|
|
4926
|
+
} = schemaMapperProps;
|
|
4902
4927
|
const { accepts, cameraConfig, maxSize, source, validationMessages } = schema;
|
|
4903
|
-
const { getErrorMessageFunctions, onComponentUpdate
|
|
4928
|
+
const { getErrorMessageFunctions, onComponentUpdate } = mapperProps;
|
|
4904
4929
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
4905
4930
|
const validLocalValue = isFile(localValue) ? localValue : null;
|
|
4906
4931
|
const value = onPersistAsync && model !== null ? validLocalValue : null;
|
|
@@ -4988,9 +5013,9 @@ var createBooleanInputComponent = (props, onComponentUpdate) => {
|
|
|
4988
5013
|
|
|
4989
5014
|
// src/domain/mappers/schema/booleanSchemaToComponent.ts
|
|
4990
5015
|
var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
4991
|
-
const { schema, localValue, model, onPersistAsync } = schemaMapperProps;
|
|
5016
|
+
const { schema, localValue, model, onPersistAsync, onValueChange } = schemaMapperProps;
|
|
4992
5017
|
const { default: defaultValue, additionalText, inlineAlert, supportingValues } = schema;
|
|
4993
|
-
const { onComponentUpdate, onBehavior
|
|
5018
|
+
const { onComponentUpdate, onBehavior } = mapperProps;
|
|
4994
5019
|
const schemaOnChange = getSchemaOnChange(schema, onBehavior);
|
|
4995
5020
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
4996
5021
|
schemaMapperProps,
|
|
@@ -5091,6 +5116,7 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5091
5116
|
"summariser"
|
|
5092
5117
|
]);
|
|
5093
5118
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5119
|
+
const onValueChangeDebounced = debounce(onValueChange, 1e3);
|
|
5094
5120
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5095
5121
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
5096
5122
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
@@ -5108,6 +5134,7 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5108
5134
|
}));
|
|
5109
5135
|
validateAsync == null ? void 0 : validateAsync.flush();
|
|
5110
5136
|
}
|
|
5137
|
+
onValueChangeDebounced.flush();
|
|
5111
5138
|
},
|
|
5112
5139
|
onFocus() {
|
|
5113
5140
|
},
|
|
@@ -5124,7 +5151,7 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5124
5151
|
if (isValid) {
|
|
5125
5152
|
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
5126
5153
|
}
|
|
5127
|
-
|
|
5154
|
+
onValueChangeDebounced();
|
|
5128
5155
|
},
|
|
5129
5156
|
async getSubmittableValue() {
|
|
5130
5157
|
return component.getSubmittableValueSync();
|
|
@@ -5152,9 +5179,16 @@ var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
|
5152
5179
|
|
|
5153
5180
|
// src/domain/mappers/schema/integerSchemaToComponent.ts
|
|
5154
5181
|
var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
5155
|
-
const {
|
|
5182
|
+
const {
|
|
5183
|
+
schema,
|
|
5184
|
+
localValue,
|
|
5185
|
+
model,
|
|
5186
|
+
required = false,
|
|
5187
|
+
onPersistAsync,
|
|
5188
|
+
onValueChange
|
|
5189
|
+
} = schemaMapperProps;
|
|
5156
5190
|
const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
|
|
5157
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
5191
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
5158
5192
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
5159
5193
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
5160
5194
|
schemaMapperProps,
|
|
@@ -5476,7 +5510,7 @@ var objectSchemaToObjectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5476
5510
|
}));
|
|
5477
5511
|
};
|
|
5478
5512
|
var createComponentMap = (schemaMapperProps, mapperProps, uidPrefix) => {
|
|
5479
|
-
const { uid, localValue, schema, model, validationErrors } = schemaMapperProps;
|
|
5513
|
+
const { uid, localValue, schema, model, validationErrors, onValueChange } = schemaMapperProps;
|
|
5480
5514
|
const { $id, displayOrder, properties, required } = schema;
|
|
5481
5515
|
const initialReducerValue = {};
|
|
5482
5516
|
return displayOrder.reduce((acc, propName) => {
|
|
@@ -5493,7 +5527,8 @@ var createComponentMap = (schemaMapperProps, mapperProps, uidPrefix) => {
|
|
|
5493
5527
|
model: isObjectModel(model) ? model[propName] : null,
|
|
5494
5528
|
localValue: isObjectLocalValue(localValue) ? localValue[propName] : null,
|
|
5495
5529
|
required: (_a = required == null ? void 0 : required.includes(propName)) != null ? _a : false,
|
|
5496
|
-
validationErrors: isObject(validationErrors) ? validationErrors[propName] : void 0
|
|
5530
|
+
validationErrors: isObject(validationErrors) ? validationErrors[propName] : void 0,
|
|
5531
|
+
onValueChange
|
|
5497
5532
|
},
|
|
5498
5533
|
mapperProps
|
|
5499
5534
|
)
|
|
@@ -5711,7 +5746,8 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5711
5746
|
schema,
|
|
5712
5747
|
model,
|
|
5713
5748
|
validationErrors: initialError,
|
|
5714
|
-
required = false
|
|
5749
|
+
required = false,
|
|
5750
|
+
onValueChange
|
|
5715
5751
|
} = schemaMapperProps;
|
|
5716
5752
|
const initialModel = (_a = model != null ? model : schema.default) != null ? _a : null;
|
|
5717
5753
|
const options = schema.oneOf.map((childSchema, index) => {
|
|
@@ -5746,13 +5782,14 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5746
5782
|
model: initialModel,
|
|
5747
5783
|
localValue,
|
|
5748
5784
|
validationErrors: initialError,
|
|
5749
|
-
required
|
|
5785
|
+
required,
|
|
5786
|
+
onValueChange
|
|
5750
5787
|
},
|
|
5751
5788
|
mapperProps
|
|
5752
5789
|
)
|
|
5753
5790
|
};
|
|
5754
5791
|
});
|
|
5755
|
-
const { getErrorMessageFunctions, onComponentUpdate, trackEvent, onBehavior
|
|
5792
|
+
const { getErrorMessageFunctions, onComponentUpdate, trackEvent, onBehavior } = mapperProps;
|
|
5756
5793
|
const { validationMessages } = schema;
|
|
5757
5794
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
5758
5795
|
return createSelectInputComponent(
|
|
@@ -6030,7 +6067,14 @@ var mapStringSchemaSuggestions = (suggestions, logEvent) => {
|
|
|
6030
6067
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.ts
|
|
6031
6068
|
var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
6032
6069
|
var _a;
|
|
6033
|
-
const {
|
|
6070
|
+
const {
|
|
6071
|
+
schema,
|
|
6072
|
+
localValue,
|
|
6073
|
+
model,
|
|
6074
|
+
required = false,
|
|
6075
|
+
onPersistAsync,
|
|
6076
|
+
onValueChange
|
|
6077
|
+
} = schemaMapperProps;
|
|
6034
6078
|
const {
|
|
6035
6079
|
autocompleteHint,
|
|
6036
6080
|
default: defaultValue,
|
|
@@ -6038,7 +6082,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6038
6082
|
maximum: maximumDate,
|
|
6039
6083
|
suggestions
|
|
6040
6084
|
} = schema;
|
|
6041
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
6085
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
6042
6086
|
const errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
|
|
6043
6087
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
6044
6088
|
schemaMapperProps,
|
|
@@ -6051,7 +6095,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6051
6095
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
6052
6096
|
autoComplete: getAutocompleteString(autocompleteHint),
|
|
6053
6097
|
checks: schema.hidden ? [] : [
|
|
6054
|
-
|
|
6098
|
+
getStringRequiredCheck(required, errorMessageFunctions),
|
|
6055
6099
|
getValidDateCheck(required, errorMessageFunctions),
|
|
6056
6100
|
getAboveMaximumDateCheck(schema, errorMessageFunctions),
|
|
6057
6101
|
getBelowMinimumDateCheck(schema, errorMessageFunctions)
|
|
@@ -6087,9 +6131,9 @@ var getValidDate = (model) => {
|
|
|
6087
6131
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.ts
|
|
6088
6132
|
var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
|
|
6089
6133
|
var _a;
|
|
6090
|
-
const { schema, localValue, model, required = false } = schemaMapperProps;
|
|
6134
|
+
const { schema, localValue, model, required = false, onValueChange } = schemaMapperProps;
|
|
6091
6135
|
const { accepts, autocompleteHint, cameraConfig, hidden, maxSize, source, validationMessages } = schema;
|
|
6092
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior
|
|
6136
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior } = mapperProps;
|
|
6093
6137
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
6094
6138
|
const validLocalValue = isFile(localValue) ? localValue : null;
|
|
6095
6139
|
const value = (_a = getFileFromModel(model)) != null ? _a : validLocalValue;
|
|
@@ -6140,6 +6184,7 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6140
6184
|
"value"
|
|
6141
6185
|
]);
|
|
6142
6186
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
6187
|
+
const onValueChangeDebounced = debounce(onValueChange, 1e3);
|
|
6143
6188
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
6144
6189
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
6145
6190
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
@@ -6157,6 +6202,7 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6157
6202
|
}));
|
|
6158
6203
|
validateAsync == null ? void 0 : validateAsync.flush();
|
|
6159
6204
|
}
|
|
6205
|
+
onValueChangeDebounced.flush();
|
|
6160
6206
|
},
|
|
6161
6207
|
onFocus() {
|
|
6162
6208
|
},
|
|
@@ -6176,7 +6222,7 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6176
6222
|
if (!updatedValue) {
|
|
6177
6223
|
validateAsync == null ? void 0 : validateAsync.cancel();
|
|
6178
6224
|
}
|
|
6179
|
-
|
|
6225
|
+
onValueChangeDebounced();
|
|
6180
6226
|
},
|
|
6181
6227
|
async getSubmittableValue() {
|
|
6182
6228
|
return component.getSubmittableValueSync();
|
|
@@ -6203,7 +6249,14 @@ var createTextInputComponent = (props, onComponentUpdate) => {
|
|
|
6203
6249
|
|
|
6204
6250
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.ts
|
|
6205
6251
|
var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
6206
|
-
const {
|
|
6252
|
+
const {
|
|
6253
|
+
schema,
|
|
6254
|
+
localValue,
|
|
6255
|
+
model,
|
|
6256
|
+
required = false,
|
|
6257
|
+
onPersistAsync,
|
|
6258
|
+
onValueChange
|
|
6259
|
+
} = schemaMapperProps;
|
|
6207
6260
|
const {
|
|
6208
6261
|
autocapitalization,
|
|
6209
6262
|
autocompleteHint,
|
|
@@ -6217,7 +6270,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6217
6270
|
suggestions,
|
|
6218
6271
|
validationMessages
|
|
6219
6272
|
} = schema;
|
|
6220
|
-
const { getErrorMessageFunctions, onComponentUpdate, onBehavior,
|
|
6273
|
+
const { getErrorMessageFunctions, onComponentUpdate, onBehavior, logEvent } = mapperProps;
|
|
6221
6274
|
const controlForLegacyFormat = getControlForLegacyFormat(format);
|
|
6222
6275
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
6223
6276
|
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
@@ -6232,7 +6285,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6232
6285
|
autocapitalization,
|
|
6233
6286
|
autoComplete: getAutocompleteString(autocompleteHint),
|
|
6234
6287
|
checks: schema.hidden ? [] : [
|
|
6235
|
-
|
|
6288
|
+
getStringRequiredCheck(required, errorMessageFunctions),
|
|
6236
6289
|
getAboveMaxLengthCheck(schema, errorMessageFunctions),
|
|
6237
6290
|
getBelowMinLengthCheck(schema, errorMessageFunctions),
|
|
6238
6291
|
getNotAdheringToPatternCheck(schema, errorMessageFunctions, { logEvent })
|
|
@@ -6331,6 +6384,8 @@ var mapSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6331
6384
|
};
|
|
6332
6385
|
|
|
6333
6386
|
// src/domain/mappers/mapStepSchemas.ts
|
|
6387
|
+
var noop2 = () => {
|
|
6388
|
+
};
|
|
6334
6389
|
var mapStepSchemas = (uid, step, stepLocalValue, mapperProps) => {
|
|
6335
6390
|
return step.schemas.map(
|
|
6336
6391
|
(schema, i) => {
|
|
@@ -6343,7 +6398,8 @@ var mapStepSchemas = (uid, step, stepLocalValue, mapperProps) => {
|
|
|
6343
6398
|
model: (_a = step.model) != null ? _a : null,
|
|
6344
6399
|
localValue: stepLocalValue,
|
|
6345
6400
|
validationErrors: (_b = step.errors) == null ? void 0 : _b.validation,
|
|
6346
|
-
required: true
|
|
6401
|
+
required: true,
|
|
6402
|
+
onValueChange: noop2
|
|
6347
6403
|
},
|
|
6348
6404
|
mapperProps
|
|
6349
6405
|
);
|
|
@@ -7012,8 +7068,7 @@ var createFlowController = (props) => {
|
|
|
7012
7068
|
onNotification,
|
|
7013
7069
|
onError,
|
|
7014
7070
|
onEvent,
|
|
7015
|
-
onLog
|
|
7016
|
-
onValueChange
|
|
7071
|
+
onLog
|
|
7017
7072
|
} = props;
|
|
7018
7073
|
const httpClient = getHttpClientWithCapabilities(props.httpClient, nativeSubflowHandlers);
|
|
7019
7074
|
const rootComponent = createRootDomainComponent(
|
|
@@ -7054,8 +7109,7 @@ var createFlowController = (props) => {
|
|
|
7054
7109
|
httpClient,
|
|
7055
7110
|
onBehavior,
|
|
7056
7111
|
onLink,
|
|
7057
|
-
onPoll
|
|
7058
|
-
onValueChange
|
|
7112
|
+
onPoll
|
|
7059
7113
|
});
|
|
7060
7114
|
const createStepComponent2 = (newStep, etag, localValue) => {
|
|
7061
7115
|
rootComponent.stop();
|
|
@@ -7379,6 +7433,7 @@ var createFlowController = (props) => {
|
|
|
7379
7433
|
switch (command.type) {
|
|
7380
7434
|
case "replace-step":
|
|
7381
7435
|
createStep(command.step, command.etag);
|
|
7436
|
+
trackCoreEvent("Step Shown", { isFirstStep: false });
|
|
7382
7437
|
return true;
|
|
7383
7438
|
case "behavior":
|
|
7384
7439
|
void onBehavior(command.behavior);
|
|
@@ -8769,8 +8824,6 @@ function useStableCallback(handler) {
|
|
|
8769
8824
|
// src/useDynamicFlow.tsx
|
|
8770
8825
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
8771
8826
|
var className = "dynamic-flow";
|
|
8772
|
-
var noop2 = () => {
|
|
8773
|
-
};
|
|
8774
8827
|
function useDynamicFlow(props) {
|
|
8775
8828
|
var _a, _b;
|
|
8776
8829
|
const { flowId, renderers } = props;
|
|
@@ -8792,7 +8845,6 @@ function useDynamicFlow(props) {
|
|
|
8792
8845
|
const onError = useStableCallback(props.onError);
|
|
8793
8846
|
const onEvent = useStableCallback(props.onEvent);
|
|
8794
8847
|
const onLog = useStableCallback(props.onLog);
|
|
8795
|
-
const onValueChange = noop2;
|
|
8796
8848
|
const { formatMessage, locale } = (0, import_react_intl8.useIntl)();
|
|
8797
8849
|
const getErrorMessageFunctions = (0, import_react3.useMemo)(
|
|
8798
8850
|
() => getSchemaErrorMessageFunction(formatMessage, locale),
|
|
@@ -8814,7 +8866,6 @@ function useDynamicFlow(props) {
|
|
|
8814
8866
|
onError,
|
|
8815
8867
|
onEvent,
|
|
8816
8868
|
onLog,
|
|
8817
|
-
onValueChange,
|
|
8818
8869
|
scrollToTop
|
|
8819
8870
|
}));
|
|
8820
8871
|
const render = (0, import_react3.useMemo)(
|