@wix/form-public 0.25.0 → 0.27.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/_tsup-dts-rollup.d.cts +34 -6
- package/dist/_tsup-dts-rollup.d.ts +34 -6
- package/dist/index.cjs +349 -204
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +0 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +250 -105
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React32 from 'react';
|
|
2
|
+
import React32__default, { createContext, forwardRef, useState, useMemo, useRef, useEffect, useCallback, useImperativeHandle, useContext } from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
import camelCase from 'lodash.camelcase';
|
|
5
5
|
import mapKeys from 'lodash.mapkeys';
|
|
@@ -4261,7 +4261,7 @@ var require_classnames = __commonJS({
|
|
|
4261
4261
|
var RicosViewerContext;
|
|
4262
4262
|
var init_ViewerContext = __esm({
|
|
4263
4263
|
"../../node_modules/@wix/ricos/dist/es/ricos-context/viewer/ViewerContext.js"() {
|
|
4264
|
-
RicosViewerContext =
|
|
4264
|
+
RicosViewerContext = React32__default.createContext(null);
|
|
4265
4265
|
}
|
|
4266
4266
|
});
|
|
4267
4267
|
|
|
@@ -5210,16 +5210,16 @@ var require_prop_types = __commonJS({
|
|
|
5210
5210
|
// ../../node_modules/@babel/runtime/helpers/extends.js
|
|
5211
5211
|
var require_extends = __commonJS({
|
|
5212
5212
|
"../../node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
|
|
5213
|
-
function
|
|
5214
|
-
return module.exports =
|
|
5213
|
+
function _extends7() {
|
|
5214
|
+
return module.exports = _extends7 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5215
5215
|
for (var e = 1; e < arguments.length; e++) {
|
|
5216
5216
|
var t = arguments[e];
|
|
5217
5217
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5218
5218
|
}
|
|
5219
5219
|
return n;
|
|
5220
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports,
|
|
5220
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends7.apply(null, arguments);
|
|
5221
5221
|
}
|
|
5222
|
-
module.exports =
|
|
5222
|
+
module.exports = _extends7, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5223
5223
|
}
|
|
5224
5224
|
});
|
|
5225
5225
|
|
|
@@ -5285,7 +5285,7 @@ var init_PropTypes = __esm({
|
|
|
5285
5285
|
var TransitionGroupContext_default;
|
|
5286
5286
|
var init_TransitionGroupContext = __esm({
|
|
5287
5287
|
"../../node_modules/react-transition-group/esm/TransitionGroupContext.js"() {
|
|
5288
|
-
TransitionGroupContext_default =
|
|
5288
|
+
TransitionGroupContext_default = React32__default.createContext(null);
|
|
5289
5289
|
}
|
|
5290
5290
|
});
|
|
5291
5291
|
|
|
@@ -5517,13 +5517,13 @@ var init_Transition = __esm({
|
|
|
5517
5517
|
var _this$props = this.props, children = _this$props.children; _this$props.in; _this$props.mountOnEnter; _this$props.unmountOnExit; _this$props.appear; _this$props.enter; _this$props.exit; _this$props.timeout; _this$props.addEndListener; _this$props.onEnter; _this$props.onEntering; _this$props.onEntered; _this$props.onExit; _this$props.onExiting; _this$props.onExited; _this$props.nodeRef; var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
5518
5518
|
return (
|
|
5519
5519
|
// allows for nested Transitions
|
|
5520
|
-
/* @__PURE__ */
|
|
5520
|
+
/* @__PURE__ */ React32__default.createElement(TransitionGroupContext_default.Provider, {
|
|
5521
5521
|
value: null
|
|
5522
|
-
}, typeof children === "function" ? children(status, childProps) :
|
|
5522
|
+
}, typeof children === "function" ? children(status, childProps) : React32__default.cloneElement(React32__default.Children.only(children), childProps))
|
|
5523
5523
|
);
|
|
5524
5524
|
};
|
|
5525
5525
|
return Transition2;
|
|
5526
|
-
})(
|
|
5526
|
+
})(React32__default.Component);
|
|
5527
5527
|
Transition.contextType = TransitionGroupContext_default;
|
|
5528
5528
|
Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
5529
5529
|
/**
|
|
@@ -20493,7 +20493,6 @@ var INPUT_FIELD_TYPES = {
|
|
|
20493
20493
|
var READONLY_FIELD_TYPES = {
|
|
20494
20494
|
HEADER: "HEADER",
|
|
20495
20495
|
RICH_TEXT: "RICH_TEXT",
|
|
20496
|
-
SUBMIT_BUTTON: "SUBMIT_BUTTON",
|
|
20497
20496
|
ECOM_CONTACT_DETAILS: "ECOM_CONTACT_DETAILS",
|
|
20498
20497
|
ECOM_SHIPPING_DETAILS: "ECOM_SHIPPING_DETAILS",
|
|
20499
20498
|
BOOKINGS_HEADER: "BOOKINGS_HEADER",
|
|
@@ -20504,8 +20503,7 @@ var READONLY_FIELD_TYPES = {
|
|
|
20504
20503
|
// ../form-fields/dist/esm/constants/field-types.js
|
|
20505
20504
|
var FIELD_TYPES = {
|
|
20506
20505
|
...INPUT_FIELD_TYPES,
|
|
20507
|
-
...READONLY_FIELD_TYPES
|
|
20508
|
-
};
|
|
20506
|
+
...READONLY_FIELD_TYPES};
|
|
20509
20507
|
|
|
20510
20508
|
// ../form-fields/dist/esm/constants/empty-values.js
|
|
20511
20509
|
var EMPTY_VALUE = null;
|
|
@@ -20557,10 +20555,17 @@ var FormStatusProvider = (_ref) => {
|
|
|
20557
20555
|
setFormStatus
|
|
20558
20556
|
};
|
|
20559
20557
|
}, [currentFormStatus, setFormStatus]);
|
|
20560
|
-
return /* @__PURE__ */
|
|
20558
|
+
return /* @__PURE__ */ React32__default.createElement(FormStatusContext.Provider, {
|
|
20561
20559
|
value: contextValue
|
|
20562
20560
|
}, children);
|
|
20563
20561
|
};
|
|
20562
|
+
function useFormStatus() {
|
|
20563
|
+
const context = useContext(FormStatusContext);
|
|
20564
|
+
if (context === void 0) {
|
|
20565
|
+
throw new Error("useFormStatus must be used within a Form Status provider");
|
|
20566
|
+
}
|
|
20567
|
+
return context;
|
|
20568
|
+
}
|
|
20564
20569
|
var WixRicosViewerContext = /* @__PURE__ */ createContext(void 0);
|
|
20565
20570
|
function useWixRicosViewer() {
|
|
20566
20571
|
const context = useContext(WixRicosViewerContext);
|
|
@@ -20625,7 +20630,7 @@ var link_viewer_default = {
|
|
|
20625
20630
|
// ../../node_modules/@wix/ricos/dist/es/plugin-link/nodeViewDecorators/anchor.js
|
|
20626
20631
|
var decorator = (anchorDecoration, element) => {
|
|
20627
20632
|
const { anchor } = anchorDecoration.anchorData;
|
|
20628
|
-
return /* @__PURE__ */
|
|
20633
|
+
return /* @__PURE__ */ React32__default.createElement(
|
|
20629
20634
|
"a",
|
|
20630
20635
|
{
|
|
20631
20636
|
key: `anchor-${element?.key}`,
|
|
@@ -20683,7 +20688,7 @@ var decorator2 = (element, linkDecoration, contextualData, node) => {
|
|
|
20683
20688
|
type: Node_Type.TEXT,
|
|
20684
20689
|
textData: node.textData
|
|
20685
20690
|
});
|
|
20686
|
-
return /* @__PURE__ */
|
|
20691
|
+
return /* @__PURE__ */ React32__default.createElement(
|
|
20687
20692
|
"a",
|
|
20688
20693
|
{
|
|
20689
20694
|
key: `link=${element.key}`,
|
|
@@ -20742,7 +20747,7 @@ var htmlAttributesPlugin = (_23) => ({
|
|
|
20742
20747
|
type: "",
|
|
20743
20748
|
nodeViewDecorators: [htmlAttributesDecorator],
|
|
20744
20749
|
nodeViewRenderers: {
|
|
20745
|
-
[Node_Type.EXTERNAL]: (__) => /* @__PURE__ */
|
|
20750
|
+
[Node_Type.EXTERNAL]: (__) => /* @__PURE__ */ React32__default.createElement(React32__default.Fragment, null)
|
|
20746
20751
|
}
|
|
20747
20752
|
});
|
|
20748
20753
|
var htmlAttributesDecorator = {
|
|
@@ -20753,13 +20758,13 @@ var htmlAttributesDecorator = {
|
|
|
20753
20758
|
node
|
|
20754
20759
|
} = _ref;
|
|
20755
20760
|
if (((_node$textData = node.textData) == null ? void 0 : _node$textData.text) == null) {
|
|
20756
|
-
return /* @__PURE__ */
|
|
20761
|
+
return /* @__PURE__ */ React32__default.createElement(React32__default.Fragment, null);
|
|
20757
20762
|
}
|
|
20758
20763
|
const props = Object.fromEntries(Object.entries(((_node$externalData = node.externalData) == null ? void 0 : _node$externalData.fields) ?? []).map((_ref2) => {
|
|
20759
20764
|
let [k, v] = _ref2;
|
|
20760
20765
|
return [k, v.stringValue];
|
|
20761
20766
|
}));
|
|
20762
|
-
return /* @__PURE__ */
|
|
20767
|
+
return /* @__PURE__ */ React32__default.createElement("span", props, (_node$textData2 = node.textData) == null ? void 0 : _node$textData2.text);
|
|
20763
20768
|
}
|
|
20764
20769
|
};
|
|
20765
20770
|
|
|
@@ -20778,10 +20783,10 @@ var RicosViewer = (_ref) => {
|
|
|
20778
20783
|
if (!content) {
|
|
20779
20784
|
return null;
|
|
20780
20785
|
}
|
|
20781
|
-
return /* @__PURE__ */
|
|
20786
|
+
return /* @__PURE__ */ React32__default.createElement("div", {
|
|
20782
20787
|
className: (0, import_classnames3.default)(ricos_viewer_module_default.container, className),
|
|
20783
20788
|
"data-hook": dataHook
|
|
20784
|
-
}, /* @__PURE__ */
|
|
20789
|
+
}, /* @__PURE__ */ React32__default.createElement(WixRicosViewer, {
|
|
20785
20790
|
biSettings: {
|
|
20786
20791
|
consumer: "Forms",
|
|
20787
20792
|
platform: "Livesite",
|
|
@@ -20795,7 +20800,7 @@ var RicosViewer = (_ref) => {
|
|
|
20795
20800
|
locale
|
|
20796
20801
|
}));
|
|
20797
20802
|
};
|
|
20798
|
-
var ricos_viewer_default = /* @__PURE__ */
|
|
20803
|
+
var ricos_viewer_default = /* @__PURE__ */ React32__default.memo(RicosViewer);
|
|
20799
20804
|
function useRicosTheme(customTheme) {
|
|
20800
20805
|
return useMemo(() => ({
|
|
20801
20806
|
palette: {
|
|
@@ -20817,7 +20822,7 @@ var UniqueFieldSuffixContextProvider = (_ref) => {
|
|
|
20817
20822
|
compId = "comp"
|
|
20818
20823
|
} = useConfig();
|
|
20819
20824
|
const uniqueId = `${compId}-${parentId.split("-").at(0)}`;
|
|
20820
|
-
return /* @__PURE__ */
|
|
20825
|
+
return /* @__PURE__ */ React32__default.createElement(UniqueFieldSuffixContext.Provider, {
|
|
20821
20826
|
value: uniqueId
|
|
20822
20827
|
}, children);
|
|
20823
20828
|
};
|
|
@@ -20826,14 +20831,14 @@ var FocusedFieldProvider = (_ref) => {
|
|
|
20826
20831
|
let {
|
|
20827
20832
|
children
|
|
20828
20833
|
} = _ref;
|
|
20829
|
-
const [focusedFieldId, setFocusedFieldId] =
|
|
20834
|
+
const [focusedFieldId, setFocusedFieldId] = React32__default.useState(void 0);
|
|
20830
20835
|
const contextValue = useMemo(() => {
|
|
20831
20836
|
return {
|
|
20832
20837
|
focusedFieldId,
|
|
20833
20838
|
setFocusedFieldId
|
|
20834
20839
|
};
|
|
20835
20840
|
}, [focusedFieldId, setFocusedFieldId]);
|
|
20836
|
-
return /* @__PURE__ */
|
|
20841
|
+
return /* @__PURE__ */ React32__default.createElement(FocusedFieldContext.Provider, {
|
|
20837
20842
|
value: contextValue
|
|
20838
20843
|
}, children);
|
|
20839
20844
|
};
|
|
@@ -20861,7 +20866,7 @@ var EventsProvider = (_ref) => {
|
|
|
20861
20866
|
setSubmittedValues(values || {});
|
|
20862
20867
|
}
|
|
20863
20868
|
}), [submitSuccessCounter, submittedValues]);
|
|
20864
|
-
return /* @__PURE__ */
|
|
20869
|
+
return /* @__PURE__ */ React32__default.createElement(EventsContext.Provider, {
|
|
20865
20870
|
value
|
|
20866
20871
|
}, children);
|
|
20867
20872
|
};
|
|
@@ -20902,9 +20907,9 @@ var ScrollProvider = (_ref) => {
|
|
|
20902
20907
|
}
|
|
20903
20908
|
}
|
|
20904
20909
|
}), []);
|
|
20905
|
-
return /* @__PURE__ */
|
|
20910
|
+
return /* @__PURE__ */ React32__default.createElement("div", {
|
|
20906
20911
|
ref: scrollViewRef
|
|
20907
|
-
}, /* @__PURE__ */
|
|
20912
|
+
}, /* @__PURE__ */ React32__default.createElement(ScrollContext.Provider, {
|
|
20908
20913
|
value
|
|
20909
20914
|
}, children));
|
|
20910
20915
|
};
|
|
@@ -24405,7 +24410,7 @@ var ExternalDataProvider = (_ref) => {
|
|
|
24405
24410
|
children,
|
|
24406
24411
|
externalData
|
|
24407
24412
|
} = _ref;
|
|
24408
|
-
return /* @__PURE__ */
|
|
24413
|
+
return /* @__PURE__ */ React32__default.createElement(ExternalDataContext.Provider, {
|
|
24409
24414
|
value: externalData ?? FALLBACK
|
|
24410
24415
|
}, children);
|
|
24411
24416
|
};
|
|
@@ -24417,6 +24422,9 @@ function useExternalData() {
|
|
|
24417
24422
|
return context;
|
|
24418
24423
|
}
|
|
24419
24424
|
var FieldActionsContext = /* @__PURE__ */ createContext({});
|
|
24425
|
+
function useFieldActions() {
|
|
24426
|
+
return useContext(FieldActionsContext);
|
|
24427
|
+
}
|
|
24420
24428
|
var FormFieldsContext = /* @__PURE__ */ createContext(void 0);
|
|
24421
24429
|
function useFormFields() {
|
|
24422
24430
|
const context = useContext(FormFieldsContext);
|
|
@@ -24427,7 +24435,7 @@ function useFormFields() {
|
|
|
24427
24435
|
}
|
|
24428
24436
|
|
|
24429
24437
|
// ../form-fields/dist/esm/ui/form/components/form/form-field.js
|
|
24430
|
-
var
|
|
24438
|
+
var import_extends5 = __toESM(require_extends());
|
|
24431
24439
|
|
|
24432
24440
|
// ../form-fields/dist/esm/ui/form/types/form-view.js
|
|
24433
24441
|
function isInputField2(field) {
|
|
@@ -24514,7 +24522,7 @@ var InputField = (_ref) => {
|
|
|
24514
24522
|
if (!FieldComponent) {
|
|
24515
24523
|
return null;
|
|
24516
24524
|
}
|
|
24517
|
-
return /* @__PURE__ */
|
|
24525
|
+
return /* @__PURE__ */ React32__default.createElement(FieldComponent, (0, import_extends.default)({}, field.properties, {
|
|
24518
24526
|
onChange: handleChange,
|
|
24519
24527
|
onBlur: _onBlur,
|
|
24520
24528
|
onFocus: _onFocus,
|
|
@@ -24550,7 +24558,7 @@ var ReadOnlyField = (_ref) => {
|
|
|
24550
24558
|
if (!FieldComponent) {
|
|
24551
24559
|
return null;
|
|
24552
24560
|
}
|
|
24553
|
-
return /* @__PURE__ */
|
|
24561
|
+
return /* @__PURE__ */ React32__default.createElement(FieldComponent, (0, import_extends2.default)({}, field.properties, {
|
|
24554
24562
|
id: field.id,
|
|
24555
24563
|
externalData,
|
|
24556
24564
|
fieldType: field.fieldType,
|
|
@@ -24592,7 +24600,7 @@ var NestedFormField = (_ref) => {
|
|
|
24592
24600
|
if (!FieldComponent) {
|
|
24593
24601
|
return null;
|
|
24594
24602
|
}
|
|
24595
|
-
return /* @__PURE__ */
|
|
24603
|
+
return /* @__PURE__ */ React32__default.createElement(FieldComponent, (0, import_extends3.default)({}, field.properties, {
|
|
24596
24604
|
onChange: handleChange,
|
|
24597
24605
|
error: fieldError,
|
|
24598
24606
|
errors: fieldErrors,
|
|
@@ -24608,6 +24616,130 @@ var NestedFormField = (_ref) => {
|
|
|
24608
24616
|
}));
|
|
24609
24617
|
};
|
|
24610
24618
|
|
|
24619
|
+
// ../form-fields/dist/esm/ui/form/components/form/submit-button-field.js
|
|
24620
|
+
var import_extends4 = __toESM(require_extends());
|
|
24621
|
+
|
|
24622
|
+
// ../form-fields/dist/esm/fields/submit-button/submit-button/utils.js
|
|
24623
|
+
var getCurrentStep = (form, fieldId) => {
|
|
24624
|
+
var _form$steps;
|
|
24625
|
+
const stepCount = form != null && form.steps ? form.steps.length - 1 : 0;
|
|
24626
|
+
const hasSteps = stepCount > 0;
|
|
24627
|
+
const stepNumber = hasSteps && (form == null || (_form$steps = form.steps) == null ? void 0 : _form$steps.findIndex((step) => {
|
|
24628
|
+
var _step$layout;
|
|
24629
|
+
return (_step$layout = step.layout) == null || (_step$layout = _step$layout.large) == null || (_step$layout = _step$layout.items) == null ? void 0 : _step$layout.find((item) => item.fieldId === fieldId);
|
|
24630
|
+
}));
|
|
24631
|
+
const isLastStep = stepNumber === stepCount;
|
|
24632
|
+
return {
|
|
24633
|
+
hasSteps,
|
|
24634
|
+
stepNumber,
|
|
24635
|
+
isLastStep
|
|
24636
|
+
};
|
|
24637
|
+
};
|
|
24638
|
+
|
|
24639
|
+
// ../form-fields/dist/esm/fields/submit-button/submit-button/use-submit-button.js
|
|
24640
|
+
var useSubmitButton = (_ref) => {
|
|
24641
|
+
let {
|
|
24642
|
+
form,
|
|
24643
|
+
id
|
|
24644
|
+
} = _ref;
|
|
24645
|
+
const {
|
|
24646
|
+
hasSteps,
|
|
24647
|
+
stepNumber,
|
|
24648
|
+
isLastStep
|
|
24649
|
+
} = getCurrentStep(form, id);
|
|
24650
|
+
const {
|
|
24651
|
+
inProgress,
|
|
24652
|
+
actions
|
|
24653
|
+
} = useFieldActions();
|
|
24654
|
+
const [submitInProgress, setSubmitInProgress] = useState(false);
|
|
24655
|
+
const {
|
|
24656
|
+
formStatus
|
|
24657
|
+
} = useFormStatus();
|
|
24658
|
+
const isDisabled = submitInProgress;
|
|
24659
|
+
const isInProgress = inProgress || formStatus === FORM_STATUS.BUSY;
|
|
24660
|
+
const showPreviousButton = hasSteps && stepNumber !== 0;
|
|
24661
|
+
const showNextButton = hasSteps && !isLastStep;
|
|
24662
|
+
const showSubmitButton = !hasSteps || hasSteps && isLastStep;
|
|
24663
|
+
const handleSubmitClick = useCallback(async () => {
|
|
24664
|
+
if (isInProgress) {
|
|
24665
|
+
return;
|
|
24666
|
+
}
|
|
24667
|
+
setSubmitInProgress(true);
|
|
24668
|
+
try {
|
|
24669
|
+
await (actions == null ? void 0 : actions.submitForm());
|
|
24670
|
+
} catch (error2) {
|
|
24671
|
+
console.error(error2);
|
|
24672
|
+
}
|
|
24673
|
+
setSubmitInProgress(false);
|
|
24674
|
+
}, [actions, isInProgress]);
|
|
24675
|
+
return {
|
|
24676
|
+
handleSubmitClick,
|
|
24677
|
+
isDisabled,
|
|
24678
|
+
isInProgress,
|
|
24679
|
+
showPreviousButton,
|
|
24680
|
+
showNextButton,
|
|
24681
|
+
showSubmitButton,
|
|
24682
|
+
hasSteps
|
|
24683
|
+
};
|
|
24684
|
+
};
|
|
24685
|
+
|
|
24686
|
+
// ../form-fields/dist/esm/ui/form/components/form/submit-button-field.js
|
|
24687
|
+
var SubmitButtonField = (_ref) => {
|
|
24688
|
+
let {
|
|
24689
|
+
field,
|
|
24690
|
+
FieldLayout
|
|
24691
|
+
} = _ref;
|
|
24692
|
+
const {
|
|
24693
|
+
submitText,
|
|
24694
|
+
nextText,
|
|
24695
|
+
previousText,
|
|
24696
|
+
text
|
|
24697
|
+
} = field.properties;
|
|
24698
|
+
const componentsById = useFormFields();
|
|
24699
|
+
const externalData = useExternalData();
|
|
24700
|
+
const form = useForm();
|
|
24701
|
+
const {
|
|
24702
|
+
actions
|
|
24703
|
+
} = useFieldActions();
|
|
24704
|
+
const {
|
|
24705
|
+
handleSubmitClick,
|
|
24706
|
+
isDisabled,
|
|
24707
|
+
isInProgress,
|
|
24708
|
+
showPreviousButton,
|
|
24709
|
+
showNextButton,
|
|
24710
|
+
showSubmitButton,
|
|
24711
|
+
hasSteps
|
|
24712
|
+
} = useSubmitButton({
|
|
24713
|
+
form,
|
|
24714
|
+
id: field.id
|
|
24715
|
+
});
|
|
24716
|
+
const submitButtonText = submitText || text || "";
|
|
24717
|
+
const previousButtonText = previousText || "";
|
|
24718
|
+
const nextButtonText = nextText || "";
|
|
24719
|
+
const FieldComponent = componentsById[field.fieldType];
|
|
24720
|
+
if (!FieldComponent) {
|
|
24721
|
+
return null;
|
|
24722
|
+
}
|
|
24723
|
+
return /* @__PURE__ */ React32__default.createElement(FieldComponent, (0, import_extends4.default)({}, field.properties, {
|
|
24724
|
+
id: field.id,
|
|
24725
|
+
externalData,
|
|
24726
|
+
fieldType: field.fieldType,
|
|
24727
|
+
FieldLayout,
|
|
24728
|
+
hasSteps,
|
|
24729
|
+
isDisabled,
|
|
24730
|
+
isInProgress,
|
|
24731
|
+
showPreviousButton,
|
|
24732
|
+
showNextButton,
|
|
24733
|
+
showSubmitButton,
|
|
24734
|
+
submitText: submitButtonText,
|
|
24735
|
+
previousText: previousButtonText,
|
|
24736
|
+
nextText: nextButtonText,
|
|
24737
|
+
onSubmitClick: handleSubmitClick,
|
|
24738
|
+
onPreviousClick: () => actions == null ? void 0 : actions.setPreviousStep(),
|
|
24739
|
+
onNextClick: () => actions == null ? void 0 : actions.setNextStep()
|
|
24740
|
+
}));
|
|
24741
|
+
};
|
|
24742
|
+
|
|
24611
24743
|
// ../form-fields/dist/esm/services/multiline-address.js
|
|
24612
24744
|
var isMultilineAddressField = (field) => {
|
|
24613
24745
|
var _field$view3, _field$view4;
|
|
@@ -24622,18 +24754,24 @@ var FormField = (_ref) => {
|
|
|
24622
24754
|
...rest
|
|
24623
24755
|
} = _ref;
|
|
24624
24756
|
if (!isMultilineAddressField(field) && isNestedFormField(field)) {
|
|
24625
|
-
return /* @__PURE__ */
|
|
24757
|
+
return /* @__PURE__ */ React32__default.createElement(NestedFormField, (0, import_extends5.default)({}, rest, {
|
|
24626
24758
|
field,
|
|
24627
24759
|
FieldLayout
|
|
24628
24760
|
}));
|
|
24629
24761
|
}
|
|
24630
24762
|
if (isInputField2(field)) {
|
|
24631
|
-
return /* @__PURE__ */
|
|
24763
|
+
return /* @__PURE__ */ React32__default.createElement(InputField, (0, import_extends5.default)({}, rest, {
|
|
24764
|
+
field,
|
|
24765
|
+
FieldLayout
|
|
24766
|
+
}));
|
|
24767
|
+
}
|
|
24768
|
+
if (field.fieldType === "SUBMIT_BUTTON") {
|
|
24769
|
+
return /* @__PURE__ */ React32__default.createElement(SubmitButtonField, (0, import_extends5.default)({}, rest, {
|
|
24632
24770
|
field,
|
|
24633
24771
|
FieldLayout
|
|
24634
24772
|
}));
|
|
24635
24773
|
}
|
|
24636
|
-
return /* @__PURE__ */
|
|
24774
|
+
return /* @__PURE__ */ React32__default.createElement(ReadOnlyField, (0, import_extends5.default)({}, rest, {
|
|
24637
24775
|
field,
|
|
24638
24776
|
FieldLayout
|
|
24639
24777
|
}));
|
|
@@ -24649,7 +24787,7 @@ var createFormFields = (_ref) => {
|
|
|
24649
24787
|
FieldLayout
|
|
24650
24788
|
} = _ref;
|
|
24651
24789
|
return form.fields.map((formField) => {
|
|
24652
|
-
const component = /* @__PURE__ */
|
|
24790
|
+
const component = /* @__PURE__ */ React32__default.createElement(FormField, {
|
|
24653
24791
|
key: formField.id,
|
|
24654
24792
|
field: formField,
|
|
24655
24793
|
values,
|
|
@@ -24672,6 +24810,8 @@ var getGridStyle = (_ref) => {
|
|
|
24672
24810
|
layout
|
|
24673
24811
|
} = _ref;
|
|
24674
24812
|
return {
|
|
24813
|
+
display: "grid",
|
|
24814
|
+
width: "100%",
|
|
24675
24815
|
gridTemplateColumns: `repeat(${layout.columns}, 1fr)`,
|
|
24676
24816
|
gridAutoRows: "minmax(min-content, max-content) 1fr"
|
|
24677
24817
|
};
|
|
@@ -24696,7 +24836,7 @@ var Focusable = (_ref) => {
|
|
|
24696
24836
|
scrollTo(viewRef.current);
|
|
24697
24837
|
}
|
|
24698
24838
|
}, [scrollTo, fieldId, focusedFieldId]);
|
|
24699
|
-
return /* @__PURE__ */
|
|
24839
|
+
return /* @__PURE__ */ React32__default.createElement("div", {
|
|
24700
24840
|
ref: viewRef
|
|
24701
24841
|
}, children);
|
|
24702
24842
|
};
|
|
@@ -24719,17 +24859,17 @@ var Grid = (_ref) => {
|
|
|
24719
24859
|
enableAnimations
|
|
24720
24860
|
} = useConfig();
|
|
24721
24861
|
const reactElementsByRow = getReactElementsByRow(items);
|
|
24722
|
-
return /* @__PURE__ */
|
|
24862
|
+
return /* @__PURE__ */ React32__default.createElement("div", {
|
|
24723
24863
|
className: grid_module_default.container,
|
|
24724
24864
|
dir: isRTL ? "rtl" : ""
|
|
24725
24865
|
}, reactElementsByRow.map((elements, index) => {
|
|
24726
24866
|
var _elements$;
|
|
24727
24867
|
const fieldId = (_elements$ = elements[0]) == null || (_elements$ = _elements$.props) == null || (_elements$ = _elements$.field) == null ? void 0 : _elements$.id;
|
|
24728
24868
|
const key = isMobile && fieldId || index;
|
|
24729
|
-
return /* @__PURE__ */
|
|
24869
|
+
return /* @__PURE__ */ React32__default.createElement(Focusable, {
|
|
24730
24870
|
key: fieldId,
|
|
24731
24871
|
fieldId
|
|
24732
|
-
}, /* @__PURE__ */
|
|
24872
|
+
}, /* @__PURE__ */ React32__default.createElement("div", {
|
|
24733
24873
|
key,
|
|
24734
24874
|
style: getGridStyle({
|
|
24735
24875
|
layout
|
|
@@ -24743,7 +24883,7 @@ var Grid = (_ref) => {
|
|
|
24743
24883
|
function getReactElementsByRow(items) {
|
|
24744
24884
|
const reactElementsByRow = items.reduce((result2, item) => {
|
|
24745
24885
|
const row = item.layout.row;
|
|
24746
|
-
const element = /* @__PURE__ */
|
|
24886
|
+
const element = /* @__PURE__ */ React32__default.cloneElement(item.component, {
|
|
24747
24887
|
key: item.id
|
|
24748
24888
|
});
|
|
24749
24889
|
if (result2[row]) {
|
|
@@ -24770,7 +24910,7 @@ function useFormView() {
|
|
|
24770
24910
|
}
|
|
24771
24911
|
|
|
24772
24912
|
// ../form-fields/dist/esm/field-layout/default-field-layout.js
|
|
24773
|
-
var
|
|
24913
|
+
var import_extends6 = __toESM(require_extends());
|
|
24774
24914
|
|
|
24775
24915
|
// ../form-fields/dist/esm/field-layout/default-field-layout.module.scss
|
|
24776
24916
|
var default_field_layout_module_default = {};
|
|
@@ -24799,7 +24939,7 @@ var DefaultFieldLayout = (_ref) => {
|
|
|
24799
24939
|
const gridColumn = `${layout.column + 1} / span ${layout.width}`;
|
|
24800
24940
|
const [labelRow, inputRow] = rows.map((currentRow) => `${currentRow} / span 1`);
|
|
24801
24941
|
if ("children" in rest) {
|
|
24802
|
-
return /* @__PURE__ */
|
|
24942
|
+
return /* @__PURE__ */ React32__default.createElement("div", (0, import_extends6.default)({
|
|
24803
24943
|
style: {
|
|
24804
24944
|
gridRow,
|
|
24805
24945
|
gridColumn
|
|
@@ -24811,13 +24951,13 @@ var DefaultFieldLayout = (_ref) => {
|
|
|
24811
24951
|
renderInput,
|
|
24812
24952
|
renderDescription
|
|
24813
24953
|
} = rest;
|
|
24814
|
-
return /* @__PURE__ */
|
|
24954
|
+
return /* @__PURE__ */ React32__default.createElement(React32__default.Fragment, null, /* @__PURE__ */ React32__default.createElement("div", {
|
|
24815
24955
|
style: {
|
|
24816
24956
|
gridRow: labelRow,
|
|
24817
24957
|
gridColumn
|
|
24818
24958
|
},
|
|
24819
24959
|
className: default_field_layout_module_default.label
|
|
24820
|
-
}, renderLabel()), /* @__PURE__ */
|
|
24960
|
+
}, renderLabel()), /* @__PURE__ */ React32__default.createElement("div", (0, import_extends6.default)({
|
|
24821
24961
|
style: {
|
|
24822
24962
|
gridRow: inputRow,
|
|
24823
24963
|
gridColumn
|
|
@@ -24843,18 +24983,18 @@ var FormRoot = (_ref) => {
|
|
|
24843
24983
|
errors,
|
|
24844
24984
|
FieldLayout: DefaultFieldLayout
|
|
24845
24985
|
});
|
|
24846
|
-
return /* @__PURE__ */
|
|
24986
|
+
return /* @__PURE__ */ React32__default.createElement(Grid, {
|
|
24847
24987
|
isRTL,
|
|
24848
24988
|
items: formFields,
|
|
24849
24989
|
layout: form.grid
|
|
24850
24990
|
});
|
|
24851
24991
|
};
|
|
24852
24992
|
var Form = (props) => {
|
|
24853
|
-
return /* @__PURE__ */
|
|
24993
|
+
return /* @__PURE__ */ React32__default.createElement(FormViewContext.Provider, {
|
|
24854
24994
|
value: props.form
|
|
24855
|
-
}, /* @__PURE__ */
|
|
24995
|
+
}, /* @__PURE__ */ React32__default.createElement(UniqueFieldSuffixContextProvider, {
|
|
24856
24996
|
parentId: props.form.parentId
|
|
24857
|
-
}, /* @__PURE__ */
|
|
24997
|
+
}, /* @__PURE__ */ React32__default.createElement(FormRoot, props)));
|
|
24858
24998
|
};
|
|
24859
24999
|
|
|
24860
25000
|
// ../form-fields/dist/esm/utils/sort-fields.js
|
|
@@ -28985,7 +29125,7 @@ var SubmitStatusProvider = ({ children }) => {
|
|
|
28985
29125
|
setSubmitFailureCode,
|
|
28986
29126
|
setSubmitFailureMessage
|
|
28987
29127
|
}), [submitSuccessMessage, submitFailureCode, submitFailureMessage]);
|
|
28988
|
-
return
|
|
29128
|
+
return React32__default.createElement(SubmitStatusContext.Provider, { value }, children);
|
|
28989
29129
|
};
|
|
28990
29130
|
var useSubmitStatus = () => {
|
|
28991
29131
|
const context = useContext(SubmitStatusContext);
|
|
@@ -29206,9 +29346,9 @@ var SubmitThankYouMessage = ({ messageText }) => {
|
|
|
29206
29346
|
if (!messageText) {
|
|
29207
29347
|
return null;
|
|
29208
29348
|
}
|
|
29209
|
-
return
|
|
29349
|
+
return React32__default.createElement(ricos_viewer_default, { dataHook: DATA_HOOKS.SUBMIT_THANK_YOU_MESSAGE, content: messageText, customTheme, className: submit_status_message_module_default.thankYouMessage });
|
|
29210
29350
|
};
|
|
29211
|
-
var Error2 = ({ size, ...props }) => /* @__PURE__ */
|
|
29351
|
+
var Error2 = ({ size, ...props }) => /* @__PURE__ */ React32.createElement("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: size || "24", height: size || "24", ...props }, /* @__PURE__ */ React32.createElement("path", { fillRule: "evenodd", d: "M11.5,3 C16.187,3 20,6.813 20,11.5 C20,16.187 16.187,20 11.5,20 C6.813,20 3,16.187 3,11.5 C3,6.813 6.813,3 11.5,3 Z M11.5,4 C7.364,4 4,7.364 4,11.5 C4,15.636 7.364,19 11.5,19 C15.636,19 19,15.636 19,11.5 C19,7.364 15.636,4 11.5,4 Z M12,14 L12,15 L11,15 L11,14 L12,14 Z M12,8 L12,13 L11,13 L11,8 L12,8 Z" }));
|
|
29212
29352
|
Error2.displayName = "Error";
|
|
29213
29353
|
var Error_default = Error2;
|
|
29214
29354
|
|
|
@@ -29221,10 +29361,10 @@ var SubmitErrorMessage = ({ errorMessageCode, errorMessage }) => {
|
|
|
29221
29361
|
}
|
|
29222
29362
|
const errorMessageKeyByCode = `${ERROR_MESSAGE_KEY}.${errorMessageCode}`;
|
|
29223
29363
|
const errorMessageKey = i18n2.exists(`${TRANSLATIONS_NAMESPACE}:${errorMessageKeyByCode}`) ? errorMessageKeyByCode : ERROR_MESSAGE_KEY;
|
|
29224
|
-
return
|
|
29364
|
+
return React32__default.createElement(
|
|
29225
29365
|
"div",
|
|
29226
29366
|
{ className: submit_status_message_module_default.errorMessage, "data-hook": DATA_HOOKS.SUBMIT_ERROR_MESSAGE },
|
|
29227
|
-
|
|
29367
|
+
React32__default.createElement(Error_default, { className: submit_status_message_module_default.errorIcon, "aria-hidden": "true" }),
|
|
29228
29368
|
errorMessage || t(errorMessageKey)
|
|
29229
29369
|
);
|
|
29230
29370
|
};
|
|
@@ -29245,7 +29385,7 @@ var transitionStyles = {
|
|
|
29245
29385
|
};
|
|
29246
29386
|
var FadeOut = ({ visible, children }) => {
|
|
29247
29387
|
const nodeRef = useRef(null);
|
|
29248
|
-
return
|
|
29388
|
+
return React32__default.createElement(Transition_default, { nodeRef, in: visible, timeout: DURATION }, (state) => React32__default.createElement("div", { ref: nodeRef, style: {
|
|
29249
29389
|
...defaultStyle,
|
|
29250
29390
|
...transitionStyles[state]
|
|
29251
29391
|
} }, [ENTERING, ENTERED, EXITING].includes(state) ? children : null));
|
|
@@ -29254,15 +29394,15 @@ var FadeOut = ({ visible, children }) => {
|
|
|
29254
29394
|
// ../form-viewer/dist/esm/components/submit-status-message/submit-status-message.js
|
|
29255
29395
|
var SubmitStatusMessage = () => {
|
|
29256
29396
|
const { submitSuccessMessage, submitFailureCode, submitFailureMessage } = useSubmitStatus();
|
|
29257
|
-
return
|
|
29397
|
+
return React32__default.createElement(
|
|
29258
29398
|
"div",
|
|
29259
29399
|
{ role: "region", "aria-live": "polite" },
|
|
29260
|
-
|
|
29400
|
+
React32__default.createElement(
|
|
29261
29401
|
FadeOut,
|
|
29262
29402
|
{ visible: !!submitSuccessMessage },
|
|
29263
|
-
|
|
29403
|
+
React32__default.createElement(SubmitThankYouMessage, { messageText: submitSuccessMessage })
|
|
29264
29404
|
),
|
|
29265
|
-
|
|
29405
|
+
React32__default.createElement(SubmitErrorMessage, { errorMessageCode: submitFailureCode, errorMessage: submitFailureMessage })
|
|
29266
29406
|
);
|
|
29267
29407
|
};
|
|
29268
29408
|
var StepTitleA11y = ({ index = 0, total = 0 }) => {
|
|
@@ -29271,7 +29411,7 @@ var StepTitleA11y = ({ index = 0, total = 0 }) => {
|
|
|
29271
29411
|
index: index + 1,
|
|
29272
29412
|
total
|
|
29273
29413
|
});
|
|
29274
|
-
return total > 1 ?
|
|
29414
|
+
return total > 1 ? React32__default.createElement("span", { "aria-label": stepTitleA11y, "aria-live": "polite" }) : null;
|
|
29275
29415
|
};
|
|
29276
29416
|
|
|
29277
29417
|
// ../form-viewer/dist/esm/components/form/form-root.js
|
|
@@ -29416,23 +29556,23 @@ var FormRoot2 = ({
|
|
|
29416
29556
|
if (!formViews?.length || !currentView) {
|
|
29417
29557
|
return null;
|
|
29418
29558
|
}
|
|
29419
|
-
return
|
|
29559
|
+
return React32__default.createElement(
|
|
29420
29560
|
FieldValidationContext.Provider,
|
|
29421
29561
|
{ value: {
|
|
29422
29562
|
validateFields: handleFieldValidation
|
|
29423
29563
|
} },
|
|
29424
|
-
|
|
29564
|
+
React32__default.createElement(
|
|
29425
29565
|
FieldActionsContext.Provider,
|
|
29426
29566
|
{ value: fieldActions },
|
|
29427
|
-
|
|
29567
|
+
React32__default.createElement(
|
|
29428
29568
|
FormStatusProvider,
|
|
29429
29569
|
{ onStatusChange },
|
|
29430
|
-
|
|
29570
|
+
React32__default.createElement(
|
|
29431
29571
|
"div",
|
|
29432
29572
|
{ "data-hook": DATA_HOOKS.FORM_ROOT },
|
|
29433
|
-
|
|
29434
|
-
|
|
29435
|
-
|
|
29573
|
+
React32__default.createElement(Form, { form: currentView, values: normalizedValues, onFieldChange, errors, dataHook: DATA_HOOKS.FORM_ROOT }),
|
|
29574
|
+
React32__default.createElement(StepTitleA11y, { total: formWithOverrides.steps?.length, index: currentStep }),
|
|
29575
|
+
React32__default.createElement(SubmitStatusMessage, null)
|
|
29436
29576
|
)
|
|
29437
29577
|
)
|
|
29438
29578
|
)
|
|
@@ -29509,58 +29649,58 @@ var FormViewerProvider = ({ i18n: i18n2, bi, biFormFillSessionId, form, isMobile
|
|
|
29509
29649
|
enableAnimations
|
|
29510
29650
|
]);
|
|
29511
29651
|
const forcedViewState = useMemo(() => forcedState ?? [], [forcedState]);
|
|
29512
|
-
return
|
|
29652
|
+
return React32__default.createElement(
|
|
29513
29653
|
FormFieldsContext.Provider,
|
|
29514
29654
|
{ value: fields },
|
|
29515
|
-
|
|
29655
|
+
React32__default.createElement(
|
|
29516
29656
|
HttpClientContext.Provider,
|
|
29517
29657
|
{ value: { httpClient } },
|
|
29518
|
-
|
|
29658
|
+
React32__default.createElement(
|
|
29519
29659
|
PanoramaContext.Provider,
|
|
29520
29660
|
{ value: { panorama } },
|
|
29521
|
-
|
|
29661
|
+
React32__default.createElement(
|
|
29522
29662
|
TranslationContext.Provider,
|
|
29523
29663
|
{ value: translations },
|
|
29524
|
-
|
|
29664
|
+
React32__default.createElement(
|
|
29525
29665
|
ScrollProvider,
|
|
29526
29666
|
null,
|
|
29527
|
-
|
|
29667
|
+
React32__default.createElement(
|
|
29528
29668
|
FocusedFieldProvider,
|
|
29529
29669
|
null,
|
|
29530
|
-
|
|
29670
|
+
React32__default.createElement(
|
|
29531
29671
|
FieldInitialDataContext.Provider,
|
|
29532
29672
|
{ value: fieldInitialData },
|
|
29533
|
-
|
|
29673
|
+
React32__default.createElement(
|
|
29534
29674
|
BiContext.Provider,
|
|
29535
29675
|
{ value: formBi },
|
|
29536
|
-
|
|
29676
|
+
React32__default.createElement(
|
|
29537
29677
|
ExternalDataProvider,
|
|
29538
29678
|
{ externalData },
|
|
29539
|
-
|
|
29679
|
+
React32__default.createElement(
|
|
29540
29680
|
ConfigContext.Provider,
|
|
29541
29681
|
{ value: config },
|
|
29542
|
-
|
|
29682
|
+
React32__default.createElement(
|
|
29543
29683
|
ForcedStateContext.Provider,
|
|
29544
29684
|
{ value: forcedViewState },
|
|
29545
|
-
|
|
29685
|
+
React32__default.createElement(
|
|
29546
29686
|
FormContext.Provider,
|
|
29547
29687
|
{ value: form },
|
|
29548
|
-
|
|
29688
|
+
React32__default.createElement(
|
|
29549
29689
|
AddressFormsContext.Provider,
|
|
29550
29690
|
{ value: {
|
|
29551
29691
|
getCountryAddressForm: (country) => getAddressForm(addressTemplates, country),
|
|
29552
29692
|
addressTemplates
|
|
29553
29693
|
} },
|
|
29554
|
-
|
|
29694
|
+
React32__default.createElement(
|
|
29555
29695
|
ExperimentsContext.Provider,
|
|
29556
29696
|
{ value: experiments },
|
|
29557
|
-
|
|
29697
|
+
React32__default.createElement(
|
|
29558
29698
|
EventsProvider,
|
|
29559
29699
|
null,
|
|
29560
|
-
|
|
29700
|
+
React32__default.createElement(
|
|
29561
29701
|
WixRicosViewerContext.Provider,
|
|
29562
29702
|
{ value: WixRicosViewer },
|
|
29563
|
-
|
|
29703
|
+
React32__default.createElement(SubmitStatusProvider, null, children)
|
|
29564
29704
|
)
|
|
29565
29705
|
)
|
|
29566
29706
|
)
|
|
@@ -29599,7 +29739,7 @@ var DisabledFormOverlay = ({ content, isEditor }) => {
|
|
|
29599
29739
|
if (isEditor || !content) {
|
|
29600
29740
|
return null;
|
|
29601
29741
|
}
|
|
29602
|
-
return
|
|
29742
|
+
return React32__default.createElement(ricos_viewer_default, { content, className: disabled_form_overlay_module_default.disabledFormOverlay, customTheme });
|
|
29603
29743
|
};
|
|
29604
29744
|
|
|
29605
29745
|
// ../form-viewer/dist/esm/components/root/form-viewer-static.js
|
|
@@ -29617,23 +29757,23 @@ var FormViewerStatic = forwardRef(({ form, i18n: i18n2, isMobile, isRTL, config
|
|
|
29617
29757
|
return null;
|
|
29618
29758
|
}
|
|
29619
29759
|
const isDisabled = allowFormDisable && formWithValidSteps.properties?.disabled;
|
|
29620
|
-
return
|
|
29621
|
-
|
|
29760
|
+
return React32__default.createElement(
|
|
29761
|
+
React32__default.StrictMode,
|
|
29622
29762
|
null,
|
|
29623
|
-
|
|
29763
|
+
React32__default.createElement(
|
|
29624
29764
|
FormViewerProvider,
|
|
29625
29765
|
{ httpClient, i18n: i18n2, bi, panorama, biFormFillSessionId, form: formWithValidSteps, locale, regionalFormat, isRTL, isMobile, isEditor: config?.isEditor, isComposer: config?.isComposer, externalData, fields, forcedState, instance: config?.instance, experiments, translationNamespace: TRANSLATIONS_NAMESPACE, currency, userData, WixRicosViewer, addressTemplates: config?.addressTemplates, atlasBaseUrl: config?.atlasBaseUrl, fieldInitialData, compId: config?.compId, enableAnimations },
|
|
29626
|
-
|
|
29766
|
+
React32__default.createElement(
|
|
29627
29767
|
"form",
|
|
29628
29768
|
{ "aria-label": formWithValidSteps.properties?.name ?? "", id: `form-${formWithValidSteps.id}`, "data-hook": `form-${formWithValidSteps.id}`, className: (0, import_classnames5.default)({
|
|
29629
29769
|
[form_viewer_static_module_default.readOnly]: readOnly,
|
|
29630
29770
|
[form_viewer_static_module_default.disabled]: isDisabled && !config?.isEditor
|
|
29631
29771
|
}), onSubmit: (e) => e.preventDefault() },
|
|
29632
|
-
isDisabled &&
|
|
29633
|
-
|
|
29772
|
+
isDisabled && React32__default.createElement(DisabledFormOverlay, { content: formWithValidSteps.disabledFormMessage, isEditor: config?.isEditor }),
|
|
29773
|
+
React32__default.createElement(
|
|
29634
29774
|
"fieldset",
|
|
29635
29775
|
{ className: form_viewer_static_module_default.fieldsetReset, disabled: readOnly || isDisabled },
|
|
29636
|
-
|
|
29776
|
+
React32__default.createElement(FormRoot2, { form: formWithValidSteps, forwardedRef, config, breakpoint, ...rest })
|
|
29637
29777
|
)
|
|
29638
29778
|
)
|
|
29639
29779
|
)
|
|
@@ -29790,10 +29930,8 @@ var TimeInputMapper = (props) => {
|
|
|
29790
29930
|
};
|
|
29791
29931
|
var TextMapper = (props) => props;
|
|
29792
29932
|
var SubmitButtonMapper = (props) => {
|
|
29793
|
-
const { submitText } = props;
|
|
29794
29933
|
return {
|
|
29795
|
-
...props
|
|
29796
|
-
text: submitText
|
|
29934
|
+
...props
|
|
29797
29935
|
};
|
|
29798
29936
|
};
|
|
29799
29937
|
var ProductListMapper = (props) => {
|
|
@@ -29987,6 +30125,7 @@ function normalizeSchema(obj) {
|
|
|
29987
30125
|
}
|
|
29988
30126
|
return obj;
|
|
29989
30127
|
}
|
|
30128
|
+
var LANGUAGE_CODE = "en";
|
|
29990
30129
|
var mapFieldProps = (fields, mappers) => Object.fromEntries(
|
|
29991
30130
|
Object.entries(fields).map(([fieldType, Component]) => [
|
|
29992
30131
|
fieldType,
|
|
@@ -30005,15 +30144,18 @@ var Form2 = ({
|
|
|
30005
30144
|
values,
|
|
30006
30145
|
onChange,
|
|
30007
30146
|
errors,
|
|
30008
|
-
onValidate
|
|
30147
|
+
onValidate,
|
|
30148
|
+
submitForm
|
|
30009
30149
|
}) => {
|
|
30010
30150
|
const form = normalizeSchema(unformattedForm);
|
|
30011
|
-
const
|
|
30012
|
-
|
|
30013
|
-
|
|
30151
|
+
const i18n2 = initI18n({ locale: LANGUAGE_CODE });
|
|
30152
|
+
const [step, setStep] = useState();
|
|
30153
|
+
const actions = {
|
|
30154
|
+
submitForm,
|
|
30155
|
+
uploadFile: () => {
|
|
30156
|
+
console.log("upload file not implemented");
|
|
30014
30157
|
}
|
|
30015
30158
|
};
|
|
30016
|
-
const i18n2 = initI18n({ locale: siteConfig.locale.languageCode });
|
|
30017
30159
|
const mappedFieldProps = useMemo(
|
|
30018
30160
|
() => mapFieldProps(fields, FIELD_PROP_MAP),
|
|
30019
30161
|
[fields]
|
|
@@ -30025,6 +30167,8 @@ var Form2 = ({
|
|
|
30025
30167
|
return /* @__PURE__ */ jsx(
|
|
30026
30168
|
FormViewerStatic,
|
|
30027
30169
|
{
|
|
30170
|
+
stepId: step,
|
|
30171
|
+
onStepIdChange: setStep,
|
|
30028
30172
|
form,
|
|
30029
30173
|
values,
|
|
30030
30174
|
onChange,
|
|
@@ -30034,9 +30178,10 @@ var Form2 = ({
|
|
|
30034
30178
|
i18n: i18n2,
|
|
30035
30179
|
WixRicosViewer: () => null,
|
|
30036
30180
|
config: {
|
|
30037
|
-
locale:
|
|
30038
|
-
regionalFormat:
|
|
30039
|
-
}
|
|
30181
|
+
locale: LANGUAGE_CODE,
|
|
30182
|
+
regionalFormat: LANGUAGE_CODE
|
|
30183
|
+
},
|
|
30184
|
+
actions
|
|
30040
30185
|
}
|
|
30041
30186
|
);
|
|
30042
30187
|
};
|