@wix/form-public 0.509.0 → 0.510.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 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -25
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -51730,15 +51730,6 @@ function r(r3, e, n) {
|
|
|
51730
51730
|
}, d;
|
|
51731
51731
|
}
|
|
51732
51732
|
|
|
51733
|
-
// ../form-fields/dist/esm/ui/options-layout/options-layout-constants.js
|
|
51734
|
-
var NUMBER_OF_COLUMNS = /* @__PURE__ */ (function(NUMBER_OF_COLUMNS2) {
|
|
51735
|
-
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["FREE_FLOW"] = 0] = "FREE_FLOW";
|
|
51736
|
-
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["ONE"] = 1] = "ONE";
|
|
51737
|
-
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["TWO"] = 2] = "TWO";
|
|
51738
|
-
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["THREE"] = 3] = "THREE";
|
|
51739
|
-
return NUMBER_OF_COLUMNS2;
|
|
51740
|
-
})({});
|
|
51741
|
-
|
|
51742
51733
|
// ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
|
|
51743
51734
|
var OTHER_ID = "Other";
|
|
51744
51735
|
var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
|
|
@@ -51756,7 +51747,7 @@ var getOtherValue = (value, addOtherLabel) => {
|
|
|
51756
51747
|
var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
|
|
51757
51748
|
|
|
51758
51749
|
// ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
|
|
51759
|
-
var CheckboxGroup = ({ children }) => {
|
|
51750
|
+
var CheckboxGroup = ({ children, className }) => {
|
|
51760
51751
|
const props2 = useFieldPropsV2();
|
|
51761
51752
|
const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
|
|
51762
51753
|
const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
|
|
@@ -51783,6 +51774,7 @@ var CheckboxGroup = ({ children }) => {
|
|
|
51783
51774
|
onBlur,
|
|
51784
51775
|
onFocus
|
|
51785
51776
|
}, /* @__PURE__ */ React172__default.default.createElement(reactAriaComponents.CheckboxGroup, {
|
|
51777
|
+
className,
|
|
51786
51778
|
"aria-labelledby": labelId,
|
|
51787
51779
|
value: _value,
|
|
51788
51780
|
onChange: handleChange,
|
|
@@ -51797,13 +51789,11 @@ var Options = ({ children, className }) => {
|
|
|
51797
51789
|
const props2 = useFieldPropsV2();
|
|
51798
51790
|
const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
|
|
51799
51791
|
const { t } = useTranslation2();
|
|
51800
|
-
const { isMobile: isMobile2 } = useConfig();
|
|
51801
51792
|
const optionElement = findChildOfType(children, Options.Option);
|
|
51802
51793
|
const otherLabel = getOtherLabel(addOtherLabel, t);
|
|
51803
|
-
const columns = isMobile2 ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
|
|
51804
51794
|
return /* @__PURE__ */ React172__default.default.createElement("div", {
|
|
51805
51795
|
className,
|
|
51806
|
-
"data-columns":
|
|
51796
|
+
"data-columns": numberOfColumns
|
|
51807
51797
|
}, options?.map((option2, index2) => {
|
|
51808
51798
|
const checkboxValue = option2.value ?? option2.label;
|
|
51809
51799
|
return applyInternalProps(optionElement, {
|
|
@@ -55099,12 +55089,10 @@ var Control3 = ({ children, className, ...internal }) => {
|
|
|
55099
55089
|
var Options2 = ({ children, className, ...internal }) => {
|
|
55100
55090
|
const { productsById } = internal;
|
|
55101
55091
|
const { options, numberOfColumns } = useFieldPropsV2();
|
|
55102
|
-
const { isMobile: isMobile2 } = useConfig();
|
|
55103
55092
|
const optionElement = findChildOfType(children, Options2.Option);
|
|
55104
|
-
const columns = isMobile2 ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
|
|
55105
55093
|
return /* @__PURE__ */ React172__default.default.createElement("div", {
|
|
55106
55094
|
className,
|
|
55107
|
-
"data-columns":
|
|
55095
|
+
"data-columns": numberOfColumns
|
|
55108
55096
|
}, options.map((option2) => {
|
|
55109
55097
|
const product = productsById[option2.value];
|
|
55110
55098
|
const price = product?.fixedPriceOptions?.price;
|
|
@@ -55522,7 +55510,7 @@ var getOtherValue2 = (value, addOtherLabel) => {
|
|
|
55522
55510
|
};
|
|
55523
55511
|
|
|
55524
55512
|
// ../form-fields/dist/esm/ui/radio-group-field/radio-group-field-headless.js
|
|
55525
|
-
var RadioGroup = ({ children }) => {
|
|
55513
|
+
var RadioGroup = ({ children, className }) => {
|
|
55526
55514
|
const { id: id6, value, onChange, disabled, readOnly, required, onBlur, onFocus, hasError, FieldLayout, options } = useFieldPropsV2();
|
|
55527
55515
|
const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
|
|
55528
55516
|
const labelElement = findChildOfType(children, RadioGroup.Label);
|
|
@@ -55537,6 +55525,7 @@ var RadioGroup = ({ children }) => {
|
|
|
55537
55525
|
}),
|
|
55538
55526
|
renderInput: () => /* @__PURE__ */ React172__default.default.createElement(reactAriaComponents.RadioGroup, {
|
|
55539
55527
|
id: inputId,
|
|
55528
|
+
className,
|
|
55540
55529
|
"aria-labelledby": labelId,
|
|
55541
55530
|
"aria-describedby": ariaDescribedBy,
|
|
55542
55531
|
value: groupValue,
|
|
@@ -55554,17 +55543,15 @@ var RadioGroup = ({ children }) => {
|
|
|
55554
55543
|
var Options4 = ({ children, className }) => {
|
|
55555
55544
|
const { options, addOther, addOtherLabel, id: id6, numberOfColumns, hasError } = useFieldPropsV2();
|
|
55556
55545
|
const { t } = useTranslation2();
|
|
55557
|
-
const { isMobile: isMobile2 } = useConfig();
|
|
55558
55546
|
const optionElement = findChildOfType(children, RadioGroup.Option);
|
|
55559
55547
|
const firstRadioRef = React172.useRef(null);
|
|
55560
55548
|
const otherLabel = addOtherLabel || t("add-other.default-other-option-label") || OTHER_ID2;
|
|
55561
|
-
const columns = isMobile2 ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
|
|
55562
55549
|
useFocusFieldEvent(() => {
|
|
55563
55550
|
firstRadioRef.current?.focus();
|
|
55564
55551
|
}, id6);
|
|
55565
55552
|
return /* @__PURE__ */ React172__default.default.createElement("div", {
|
|
55566
55553
|
className,
|
|
55567
|
-
"data-columns":
|
|
55554
|
+
"data-columns": numberOfColumns,
|
|
55568
55555
|
"data-invalid": hasError
|
|
55569
55556
|
}, options.map((option2, index2) => applyInternalProps(optionElement, {
|
|
55570
55557
|
key: option2.value ?? option2.label,
|
|
@@ -56208,12 +56195,11 @@ FixedPayment.Amount = Amount;
|
|
|
56208
56195
|
FixedPayment.Description = Description;
|
|
56209
56196
|
FixedPayment.Error = Error2;
|
|
56210
56197
|
var Options5 = ({ children, className }) => {
|
|
56211
|
-
const { isMobile: isMobile2 } = useConfig();
|
|
56212
56198
|
const { id: id6, options, numberOfColumns } = useFieldPropsV2();
|
|
56213
56199
|
const optionElement = findChildOfType(children, Options5.Option);
|
|
56214
56200
|
return /* @__PURE__ */ React172__default.default.createElement("div", {
|
|
56215
56201
|
className,
|
|
56216
|
-
"data-columns":
|
|
56202
|
+
"data-columns": numberOfColumns
|
|
56217
56203
|
}, options?.map((option2, index2) => applyInternalProps(optionElement, {
|
|
56218
56204
|
key: option2.id || option2.label,
|
|
56219
56205
|
option: option2,
|
|
@@ -61748,6 +61734,15 @@ ButtonsContainer.NextButton = NextButton;
|
|
|
61748
61734
|
ButtonsContainer.SubmitButton = SubmitButtonComponent;
|
|
61749
61735
|
SubmitButton.SubmitButton = ButtonsContainer;
|
|
61750
61736
|
|
|
61737
|
+
// ../form-fields/dist/esm/ui/options-layout/options-layout-constants.js
|
|
61738
|
+
var NUMBER_OF_COLUMNS = /* @__PURE__ */ (function(NUMBER_OF_COLUMNS2) {
|
|
61739
|
+
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["FREE_FLOW"] = 0] = "FREE_FLOW";
|
|
61740
|
+
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["ONE"] = 1] = "ONE";
|
|
61741
|
+
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["TWO"] = 2] = "TWO";
|
|
61742
|
+
NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["THREE"] = 3] = "THREE";
|
|
61743
|
+
return NUMBER_OF_COLUMNS2;
|
|
61744
|
+
})({});
|
|
61745
|
+
|
|
61751
61746
|
// ../form-fields/dist/esm/ui/tags-field/tags-field-utils.js
|
|
61752
61747
|
var OTHER_ID3 = "Other";
|
|
61753
61748
|
var getOtherValue3 = (value, addOtherLabel) => {
|
|
@@ -61865,9 +61860,7 @@ var Option12 = ({ children, className, ...internal }) => {
|
|
|
61865
61860
|
};
|
|
61866
61861
|
var Options12 = ({ children, className }) => {
|
|
61867
61862
|
const { options, addOther, addOtherLabel, numberOfColumns = NUMBER_OF_COLUMNS.FREE_FLOW } = useFieldPropsV2();
|
|
61868
|
-
const { isMobile: isMobile2 } = useConfig();
|
|
61869
61863
|
const { t } = useTranslation2();
|
|
61870
|
-
const columns = isMobile2 && numberOfColumns !== NUMBER_OF_COLUMNS.FREE_FLOW ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
|
|
61871
61864
|
const otherLabel = addOtherLabel || t("add-other.default-other-option-label") || OTHER_ID3;
|
|
61872
61865
|
const optionElement = findChildOfType(children, Option12);
|
|
61873
61866
|
const allOptions = React172.useMemo(() => {
|
|
@@ -61893,7 +61886,7 @@ var Options12 = ({ children, className }) => {
|
|
|
61893
61886
|
}
|
|
61894
61887
|
return /* @__PURE__ */ React172__default.default.createElement("div", {
|
|
61895
61888
|
className,
|
|
61896
|
-
"data-columns":
|
|
61889
|
+
"data-columns": numberOfColumns
|
|
61897
61890
|
}, allOptions.map((option2, index2) => {
|
|
61898
61891
|
const optionValue = option2.value ?? option2.label;
|
|
61899
61892
|
return applyInternalProps(optionElement, {
|