@wix/form-public 0.37.0 → 0.38.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 +62 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -59
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24410,10 +24410,6 @@ function useExternalData() {
|
|
|
24410
24410
|
}
|
|
24411
24411
|
return context;
|
|
24412
24412
|
}
|
|
24413
|
-
var FieldActionsContext = /* @__PURE__ */ React32.createContext({});
|
|
24414
|
-
function useFieldActions() {
|
|
24415
|
-
return React32.useContext(FieldActionsContext);
|
|
24416
|
-
}
|
|
24417
24413
|
var FormFieldsContext = /* @__PURE__ */ React32.createContext(void 0);
|
|
24418
24414
|
function useFormFields() {
|
|
24419
24415
|
const context = React32.useContext(FormFieldsContext);
|
|
@@ -24611,6 +24607,10 @@ var NestedFormField = (_ref) => {
|
|
|
24611
24607
|
|
|
24612
24608
|
// ../form-fields/dist/esm/ui/form/components/form/submit-button-field.js
|
|
24613
24609
|
var import_extends4 = __toESM(require_extends());
|
|
24610
|
+
var FieldActionsContext = /* @__PURE__ */ React32.createContext({});
|
|
24611
|
+
function useFieldActions() {
|
|
24612
|
+
return React32.useContext(FieldActionsContext);
|
|
24613
|
+
}
|
|
24614
24614
|
|
|
24615
24615
|
// ../form-fields/dist/esm/fields/submit-button/submit-button/utils.js
|
|
24616
24616
|
var getCurrentStep = (form, fieldId) => {
|
|
@@ -24779,11 +24779,17 @@ var createFormFields = (_ref) => {
|
|
|
24779
24779
|
onFieldChange,
|
|
24780
24780
|
FieldLayout,
|
|
24781
24781
|
formSchema,
|
|
24782
|
-
validateFields: validateFields2
|
|
24782
|
+
validateFields: validateFields2,
|
|
24783
|
+
fields,
|
|
24784
|
+
fieldActions
|
|
24783
24785
|
} = _ref;
|
|
24784
24786
|
return form.fields.map((formField) => {
|
|
24785
24787
|
const component = /* @__PURE__ */ React32__namespace.default.createElement(FormContext.Provider, {
|
|
24786
24788
|
value: formSchema
|
|
24789
|
+
}, /* @__PURE__ */ React32__namespace.default.createElement(FormFieldsContext.Provider, {
|
|
24790
|
+
value: fields
|
|
24791
|
+
}, /* @__PURE__ */ React32__namespace.default.createElement(FieldActionsContext.Provider, {
|
|
24792
|
+
value: fieldActions
|
|
24787
24793
|
}, /* @__PURE__ */ React32__namespace.default.createElement(FieldValidationContext.Provider, {
|
|
24788
24794
|
value: {
|
|
24789
24795
|
validateFields: validateFields2
|
|
@@ -24795,7 +24801,7 @@ var createFormFields = (_ref) => {
|
|
|
24795
24801
|
errors,
|
|
24796
24802
|
onFieldChange,
|
|
24797
24803
|
FieldLayout
|
|
24798
|
-
})));
|
|
24804
|
+
})))));
|
|
24799
24805
|
return {
|
|
24800
24806
|
id: formField.id,
|
|
24801
24807
|
fieldType: formField.fieldType,
|
|
@@ -24976,7 +24982,9 @@ var FormRoot = (_ref) => {
|
|
|
24976
24982
|
onFieldChange,
|
|
24977
24983
|
errors,
|
|
24978
24984
|
formSchema,
|
|
24979
|
-
validateFields: validateFields2
|
|
24985
|
+
validateFields: validateFields2,
|
|
24986
|
+
fields,
|
|
24987
|
+
fieldActions
|
|
24980
24988
|
} = _ref;
|
|
24981
24989
|
const {
|
|
24982
24990
|
isRTL
|
|
@@ -24988,7 +24996,9 @@ var FormRoot = (_ref) => {
|
|
|
24988
24996
|
errors,
|
|
24989
24997
|
FieldLayout: DefaultFieldLayout,
|
|
24990
24998
|
formSchema,
|
|
24991
|
-
validateFields: validateFields2
|
|
24999
|
+
validateFields: validateFields2,
|
|
25000
|
+
fields,
|
|
25001
|
+
fieldActions
|
|
24992
25002
|
});
|
|
24993
25003
|
return /* @__PURE__ */ React32__namespace.default.createElement(Grid, {
|
|
24994
25004
|
isRTL,
|
|
@@ -29517,7 +29527,8 @@ var FormRoot2 = ({
|
|
|
29517
29527
|
config,
|
|
29518
29528
|
breakpoint,
|
|
29519
29529
|
onStatusChange,
|
|
29520
|
-
validationMode
|
|
29530
|
+
validationMode,
|
|
29531
|
+
fields
|
|
29521
29532
|
}) => {
|
|
29522
29533
|
const formWithOverrides = React32.useMemo(() => applyAllOverrides(unprocessedForm, unprocessedValues, overrides), [unprocessedForm, unprocessedValues, overrides]);
|
|
29523
29534
|
const formId = formWithOverrides.id;
|
|
@@ -29638,18 +29649,14 @@ var FormRoot2 = ({
|
|
|
29638
29649
|
return null;
|
|
29639
29650
|
}
|
|
29640
29651
|
return React32__namespace.default.createElement(
|
|
29641
|
-
|
|
29642
|
-
{
|
|
29652
|
+
FormStatusProvider,
|
|
29653
|
+
{ onStatusChange },
|
|
29643
29654
|
React32__namespace.default.createElement(
|
|
29644
|
-
|
|
29645
|
-
{
|
|
29646
|
-
React32__namespace.default.createElement(
|
|
29647
|
-
|
|
29648
|
-
|
|
29649
|
-
React32__namespace.default.createElement(Form, { formSchema: formWithOverrides, form: currentView, values: normalizedValues, onFieldChange, errors, dataHook: DATA_HOOKS.FORM_ROOT, validateFields: handleFieldValidation }),
|
|
29650
|
-
React32__namespace.default.createElement(StepTitleA11y, { total: formWithOverrides.steps?.length, index: currentStep }),
|
|
29651
|
-
React32__namespace.default.createElement(SubmitStatusMessage, null)
|
|
29652
|
-
)
|
|
29655
|
+
"div",
|
|
29656
|
+
{ "data-hook": DATA_HOOKS.FORM_ROOT },
|
|
29657
|
+
React32__namespace.default.createElement(Form, { formSchema: formWithOverrides, form: currentView, values: normalizedValues, onFieldChange, errors, dataHook: DATA_HOOKS.FORM_ROOT, validateFields: handleFieldValidation, fields, fieldActions }),
|
|
29658
|
+
React32__namespace.default.createElement(StepTitleA11y, { total: formWithOverrides.steps?.length, index: currentStep }),
|
|
29659
|
+
React32__namespace.default.createElement(SubmitStatusMessage, null)
|
|
29653
29660
|
)
|
|
29654
29661
|
);
|
|
29655
29662
|
};
|
|
@@ -29690,7 +29697,7 @@ var useFormBi = (form, bi, biFormFillSessionId) => {
|
|
|
29690
29697
|
};
|
|
29691
29698
|
|
|
29692
29699
|
// ../form-viewer/dist/esm/components/root/form-viewer-provider.js
|
|
29693
|
-
var FormViewerProvider = ({ i18n: i18n2, bi, biFormFillSessionId, form, isMobile, isEditor, isComposer, isRTL, compId, locale, regionalFormat, externalData,
|
|
29700
|
+
var FormViewerProvider = ({ i18n: i18n2, bi, biFormFillSessionId, form, isMobile, isEditor, isComposer, isRTL, compId, locale, regionalFormat, externalData, forcedState, instance, children, httpClient, panorama, experiments, translationNamespace, currency, userData, WixRicosViewer, addressTemplates, atlasBaseUrl, fieldInitialData, enableAnimations }) => {
|
|
29694
29701
|
const translations = React32.useMemo(() => ({
|
|
29695
29702
|
t: i18n2.getFixedT(locale, translationNamespace),
|
|
29696
29703
|
i18n: i18n2
|
|
@@ -29725,58 +29732,54 @@ var FormViewerProvider = ({ i18n: i18n2, bi, biFormFillSessionId, form, isMobile
|
|
|
29725
29732
|
]);
|
|
29726
29733
|
const forcedViewState = React32.useMemo(() => forcedState ?? [], [forcedState]);
|
|
29727
29734
|
return React32__namespace.default.createElement(
|
|
29728
|
-
|
|
29729
|
-
{ value:
|
|
29735
|
+
HttpClientContext.Provider,
|
|
29736
|
+
{ value: { httpClient } },
|
|
29730
29737
|
React32__namespace.default.createElement(
|
|
29731
|
-
|
|
29732
|
-
{ value: {
|
|
29738
|
+
PanoramaContext.Provider,
|
|
29739
|
+
{ value: { panorama } },
|
|
29733
29740
|
React32__namespace.default.createElement(
|
|
29734
|
-
|
|
29735
|
-
{ value:
|
|
29741
|
+
TranslationContext.Provider,
|
|
29742
|
+
{ value: translations },
|
|
29736
29743
|
React32__namespace.default.createElement(
|
|
29737
|
-
|
|
29738
|
-
|
|
29744
|
+
ScrollProvider,
|
|
29745
|
+
null,
|
|
29739
29746
|
React32__namespace.default.createElement(
|
|
29740
|
-
|
|
29747
|
+
FocusedFieldProvider,
|
|
29741
29748
|
null,
|
|
29742
29749
|
React32__namespace.default.createElement(
|
|
29743
|
-
|
|
29744
|
-
|
|
29750
|
+
FieldInitialDataContext.Provider,
|
|
29751
|
+
{ value: fieldInitialData },
|
|
29745
29752
|
React32__namespace.default.createElement(
|
|
29746
|
-
|
|
29747
|
-
{ value:
|
|
29753
|
+
BiContext.Provider,
|
|
29754
|
+
{ value: formBi },
|
|
29748
29755
|
React32__namespace.default.createElement(
|
|
29749
|
-
|
|
29750
|
-
{
|
|
29756
|
+
ExternalDataProvider,
|
|
29757
|
+
{ externalData },
|
|
29751
29758
|
React32__namespace.default.createElement(
|
|
29752
|
-
|
|
29753
|
-
{
|
|
29759
|
+
ConfigContext.Provider,
|
|
29760
|
+
{ value: config },
|
|
29754
29761
|
React32__namespace.default.createElement(
|
|
29755
|
-
|
|
29756
|
-
{ value:
|
|
29762
|
+
ForcedStateContext.Provider,
|
|
29763
|
+
{ value: forcedViewState },
|
|
29757
29764
|
React32__namespace.default.createElement(
|
|
29758
|
-
|
|
29759
|
-
{ value:
|
|
29765
|
+
FormContext.Provider,
|
|
29766
|
+
{ value: form },
|
|
29760
29767
|
React32__namespace.default.createElement(
|
|
29761
|
-
|
|
29762
|
-
{ value:
|
|
29768
|
+
AddressFormsContext.Provider,
|
|
29769
|
+
{ value: {
|
|
29770
|
+
getCountryAddressForm: (country) => getAddressForm(addressTemplates, country),
|
|
29771
|
+
addressTemplates
|
|
29772
|
+
} },
|
|
29763
29773
|
React32__namespace.default.createElement(
|
|
29764
|
-
|
|
29765
|
-
{ value:
|
|
29766
|
-
getCountryAddressForm: (country) => getAddressForm(addressTemplates, country),
|
|
29767
|
-
addressTemplates
|
|
29768
|
-
} },
|
|
29774
|
+
ExperimentsContext.Provider,
|
|
29775
|
+
{ value: experiments },
|
|
29769
29776
|
React32__namespace.default.createElement(
|
|
29770
|
-
|
|
29771
|
-
|
|
29777
|
+
EventsProvider,
|
|
29778
|
+
null,
|
|
29772
29779
|
React32__namespace.default.createElement(
|
|
29773
|
-
|
|
29774
|
-
|
|
29775
|
-
React32__namespace.default.createElement(
|
|
29776
|
-
WixRicosViewerContext.Provider,
|
|
29777
|
-
{ value: WixRicosViewer },
|
|
29778
|
-
React32__namespace.default.createElement(SubmitStatusProvider, null, children)
|
|
29779
|
-
)
|
|
29780
|
+
WixRicosViewerContext.Provider,
|
|
29781
|
+
{ value: WixRicosViewer },
|
|
29782
|
+
React32__namespace.default.createElement(SubmitStatusProvider, null, children)
|
|
29780
29783
|
)
|
|
29781
29784
|
)
|
|
29782
29785
|
)
|
|
@@ -29848,7 +29851,7 @@ var FormViewerStatic = React32.forwardRef(({ form, i18n: i18n2, isMobile, isRTL,
|
|
|
29848
29851
|
React32__namespace.default.createElement(
|
|
29849
29852
|
"fieldset",
|
|
29850
29853
|
{ className: form_viewer_static_module_default.fieldsetReset, disabled: readOnly || isDisabled },
|
|
29851
|
-
React32__namespace.default.createElement(FormRoot2, { form: formWithValidSteps, forwardedRef, config, breakpoint, ...rest })
|
|
29854
|
+
React32__namespace.default.createElement(FormRoot2, { form: formWithValidSteps, fields, forwardedRef, config, breakpoint, ...rest })
|
|
29852
29855
|
)
|
|
29853
29856
|
)
|
|
29854
29857
|
)
|