@wix/form-public 0.187.0 → 0.188.0
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/dist/index.cjs +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -27254,6 +27254,8 @@ var InputField = (_ref) => {
|
|
|
27254
27254
|
errors,
|
|
27255
27255
|
values,
|
|
27256
27256
|
onFieldChange,
|
|
27257
|
+
onBlur,
|
|
27258
|
+
onFocus,
|
|
27257
27259
|
FieldLayout
|
|
27258
27260
|
} = _ref;
|
|
27259
27261
|
const bi = useBi();
|
|
@@ -27286,7 +27288,8 @@ var InputField = (_ref) => {
|
|
|
27286
27288
|
value: currentFieldValue,
|
|
27287
27289
|
path: field.path
|
|
27288
27290
|
}]);
|
|
27289
|
-
|
|
27291
|
+
onBlur == null || onBlur(field.path);
|
|
27292
|
+
}, [bi, field.id, field.properties.label, field.target, field.path, validateFields2, onBlur]);
|
|
27290
27293
|
const _onFocus = () => {
|
|
27291
27294
|
bi == null || bi.report(formFieldFocus({
|
|
27292
27295
|
action_type: "focus",
|
|
@@ -27294,6 +27297,7 @@ var InputField = (_ref) => {
|
|
|
27294
27297
|
field_label: field.properties.label,
|
|
27295
27298
|
field_target: field == null ? void 0 : field.target
|
|
27296
27299
|
}));
|
|
27300
|
+
onFocus == null || onFocus(field.path);
|
|
27297
27301
|
};
|
|
27298
27302
|
const handleChange = useCallback((value) => {
|
|
27299
27303
|
if (fieldError) {
|
|
@@ -27324,6 +27328,8 @@ var InputField = (_ref) => {
|
|
|
27324
27328
|
onChange: handleChange,
|
|
27325
27329
|
onBlur: _onBlur,
|
|
27326
27330
|
onFocus: _onFocus,
|
|
27331
|
+
onFieldBlur: onBlur,
|
|
27332
|
+
onFieldFocus: onFocus,
|
|
27327
27333
|
hasError,
|
|
27328
27334
|
errorMessage,
|
|
27329
27335
|
error: fieldError,
|
|
@@ -27684,6 +27690,8 @@ var createFormFields = (_ref) => {
|
|
|
27684
27690
|
errors,
|
|
27685
27691
|
values,
|
|
27686
27692
|
onFieldChange,
|
|
27693
|
+
onBlur,
|
|
27694
|
+
onFocus,
|
|
27687
27695
|
FieldLayout,
|
|
27688
27696
|
formSchema,
|
|
27689
27697
|
validateFields: validateFields2,
|
|
@@ -27709,6 +27717,8 @@ var createFormFields = (_ref) => {
|
|
|
27709
27717
|
values,
|
|
27710
27718
|
errors,
|
|
27711
27719
|
onFieldChange,
|
|
27720
|
+
onBlur,
|
|
27721
|
+
onFocus,
|
|
27712
27722
|
FieldLayout
|
|
27713
27723
|
}))))));
|
|
27714
27724
|
return {
|
|
@@ -27886,6 +27896,8 @@ var FormRoot = (_ref) => {
|
|
|
27886
27896
|
form,
|
|
27887
27897
|
values,
|
|
27888
27898
|
onFieldChange,
|
|
27899
|
+
onBlur,
|
|
27900
|
+
onFocus,
|
|
27889
27901
|
errors,
|
|
27890
27902
|
formSchema,
|
|
27891
27903
|
validateFields: validateFields2,
|
|
@@ -27899,6 +27911,8 @@ var FormRoot = (_ref) => {
|
|
|
27899
27911
|
form,
|
|
27900
27912
|
values,
|
|
27901
27913
|
onFieldChange,
|
|
27914
|
+
onBlur,
|
|
27915
|
+
onFocus,
|
|
27902
27916
|
errors,
|
|
27903
27917
|
FieldLayout: DefaultFieldLayout,
|
|
27904
27918
|
formSchema,
|
|
@@ -32972,7 +32986,7 @@ var useReportFieldEdit = (form) => {
|
|
|
32972
32986
|
};
|
|
32973
32987
|
|
|
32974
32988
|
// ../form-viewer/dist/esm/hooks/use-form.js
|
|
32975
|
-
var useForm2 = ({ form: paramForm, values: paramValues, stepId, onStepIdChange, onChange, errors, onValidate, onSubmit, onSubmitSuccess, onSubmitFailure, enableScrollToFirstError = true, forwardedRef, overrides, actions, config, breakpoint, validationMode, fieldMap, inProgress, enableAutofill }) => {
|
|
32989
|
+
var useForm2 = ({ form: paramForm, values: paramValues, stepId, onStepIdChange, onChange, onBlur, onFocus, errors, onValidate, onSubmit, onSubmitSuccess, onSubmitFailure, enableScrollToFirstError = true, forwardedRef, overrides, actions, config, breakpoint, validationMode, fieldMap, inProgress, enableAutofill }) => {
|
|
32976
32990
|
const formWithOverrides = useMemo(() => applyAllOverrides(paramForm, paramValues, overrides), [paramForm, paramValues, overrides]);
|
|
32977
32991
|
const formId = formWithOverrides.id;
|
|
32978
32992
|
const { setFocusedFieldId } = useFocusedField();
|
|
@@ -33086,6 +33100,8 @@ var useForm2 = ({ form: paramForm, values: paramValues, stepId, onStepIdChange,
|
|
|
33086
33100
|
formSchema: formWithOverrides,
|
|
33087
33101
|
values: normalizedValues,
|
|
33088
33102
|
onFieldChange,
|
|
33103
|
+
onBlur,
|
|
33104
|
+
onFocus,
|
|
33089
33105
|
errors,
|
|
33090
33106
|
FieldLayout: DefaultFieldLayout,
|
|
33091
33107
|
fields: fieldMap,
|