@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.cjs
CHANGED
|
@@ -27280,6 +27280,8 @@ var InputField = (_ref) => {
|
|
|
27280
27280
|
errors,
|
|
27281
27281
|
values,
|
|
27282
27282
|
onFieldChange,
|
|
27283
|
+
onBlur,
|
|
27284
|
+
onFocus,
|
|
27283
27285
|
FieldLayout
|
|
27284
27286
|
} = _ref;
|
|
27285
27287
|
const bi = useBi();
|
|
@@ -27312,7 +27314,8 @@ var InputField = (_ref) => {
|
|
|
27312
27314
|
value: currentFieldValue,
|
|
27313
27315
|
path: field.path
|
|
27314
27316
|
}]);
|
|
27315
|
-
|
|
27317
|
+
onBlur == null || onBlur(field.path);
|
|
27318
|
+
}, [bi, field.id, field.properties.label, field.target, field.path, validateFields2, onBlur]);
|
|
27316
27319
|
const _onFocus = () => {
|
|
27317
27320
|
bi == null || bi.report(formFieldFocus({
|
|
27318
27321
|
action_type: "focus",
|
|
@@ -27320,6 +27323,7 @@ var InputField = (_ref) => {
|
|
|
27320
27323
|
field_label: field.properties.label,
|
|
27321
27324
|
field_target: field == null ? void 0 : field.target
|
|
27322
27325
|
}));
|
|
27326
|
+
onFocus == null || onFocus(field.path);
|
|
27323
27327
|
};
|
|
27324
27328
|
const handleChange = React42.useCallback((value) => {
|
|
27325
27329
|
if (fieldError) {
|
|
@@ -27350,6 +27354,8 @@ var InputField = (_ref) => {
|
|
|
27350
27354
|
onChange: handleChange,
|
|
27351
27355
|
onBlur: _onBlur,
|
|
27352
27356
|
onFocus: _onFocus,
|
|
27357
|
+
onFieldBlur: onBlur,
|
|
27358
|
+
onFieldFocus: onFocus,
|
|
27353
27359
|
hasError,
|
|
27354
27360
|
errorMessage,
|
|
27355
27361
|
error: fieldError,
|
|
@@ -27710,6 +27716,8 @@ var createFormFields = (_ref) => {
|
|
|
27710
27716
|
errors,
|
|
27711
27717
|
values,
|
|
27712
27718
|
onFieldChange,
|
|
27719
|
+
onBlur,
|
|
27720
|
+
onFocus,
|
|
27713
27721
|
FieldLayout,
|
|
27714
27722
|
formSchema,
|
|
27715
27723
|
validateFields: validateFields2,
|
|
@@ -27735,6 +27743,8 @@ var createFormFields = (_ref) => {
|
|
|
27735
27743
|
values,
|
|
27736
27744
|
errors,
|
|
27737
27745
|
onFieldChange,
|
|
27746
|
+
onBlur,
|
|
27747
|
+
onFocus,
|
|
27738
27748
|
FieldLayout
|
|
27739
27749
|
}))))));
|
|
27740
27750
|
return {
|
|
@@ -27912,6 +27922,8 @@ var FormRoot = (_ref) => {
|
|
|
27912
27922
|
form,
|
|
27913
27923
|
values,
|
|
27914
27924
|
onFieldChange,
|
|
27925
|
+
onBlur,
|
|
27926
|
+
onFocus,
|
|
27915
27927
|
errors,
|
|
27916
27928
|
formSchema,
|
|
27917
27929
|
validateFields: validateFields2,
|
|
@@ -27925,6 +27937,8 @@ var FormRoot = (_ref) => {
|
|
|
27925
27937
|
form,
|
|
27926
27938
|
values,
|
|
27927
27939
|
onFieldChange,
|
|
27940
|
+
onBlur,
|
|
27941
|
+
onFocus,
|
|
27928
27942
|
errors,
|
|
27929
27943
|
FieldLayout: DefaultFieldLayout,
|
|
27930
27944
|
formSchema,
|
|
@@ -32998,7 +33012,7 @@ var useReportFieldEdit = (form) => {
|
|
|
32998
33012
|
};
|
|
32999
33013
|
|
|
33000
33014
|
// ../form-viewer/dist/esm/hooks/use-form.js
|
|
33001
|
-
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 }) => {
|
|
33015
|
+
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 }) => {
|
|
33002
33016
|
const formWithOverrides = React42.useMemo(() => applyAllOverrides(paramForm, paramValues, overrides), [paramForm, paramValues, overrides]);
|
|
33003
33017
|
const formId = formWithOverrides.id;
|
|
33004
33018
|
const { setFocusedFieldId } = useFocusedField();
|
|
@@ -33112,6 +33126,8 @@ var useForm2 = ({ form: paramForm, values: paramValues, stepId, onStepIdChange,
|
|
|
33112
33126
|
formSchema: formWithOverrides,
|
|
33113
33127
|
values: normalizedValues,
|
|
33114
33128
|
onFieldChange,
|
|
33129
|
+
onBlur,
|
|
33130
|
+
onFocus,
|
|
33115
33131
|
errors,
|
|
33116
33132
|
FieldLayout: DefaultFieldLayout,
|
|
33117
33133
|
fields: fieldMap,
|