@wix/form-public 0.104.0 → 0.106.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 CHANGED
@@ -27781,7 +27781,7 @@ var ExplanationTextKey = "explanationText";
27781
27781
  var MediaKey = "media";
27782
27782
  var UploadEnabledKey = "uploadEnabled";
27783
27783
  var FirstDayOfWeekKey = "firstDayOfWeek";
27784
- var DefaultCountryCodeKey = "defaultCountry";
27784
+ var DefaultCountryCodeKey = "defaultCountryCode";
27785
27785
  var ImageResizeKey = "imageResize";
27786
27786
  var ShowFlagKey = "showFlag";
27787
27787
  var NameKey = "name";
@@ -37714,8 +37714,7 @@ var Options9 = (_ref4) => {
37714
37714
  const {
37715
37715
  options,
37716
37716
  addOther,
37717
- addOtherLabel,
37718
- value: fieldValue
37717
+ addOtherLabel
37719
37718
  } = useFieldPropsV2();
37720
37719
  const {
37721
37720
  ariaDescribedBy
@@ -37725,7 +37724,6 @@ var Options9 = (_ref4) => {
37725
37724
  } = useTranslation();
37726
37725
  const otherLabel = addOtherLabel || t("add-other.default-other-option-label") || OTHER_ID3;
37727
37726
  const optionElement = findChildOfType(children, Option10);
37728
- const otherInputElement = optionElement ? findChildOfType(optionElement.props.children, OtherInput2) : void 0;
37729
37727
  const allOptions = React40.useMemo(() => {
37730
37728
  const regularOptions = options || [];
37731
37729
  if (addOther) {
@@ -37737,13 +37735,7 @@ var Options9 = (_ref4) => {
37737
37735
  }
37738
37736
  return regularOptions;
37739
37737
  }, [options, addOther, otherLabel]);
37740
- const isOtherSelected = React40.useMemo(() => {
37741
- if (!addOther || !fieldValue) {
37742
- return false;
37743
- }
37744
- return fieldValue.some((val) => val === otherLabel || val.startsWith(`${otherLabel}:`));
37745
- }, [addOther, fieldValue, otherLabel]);
37746
- return /* @__PURE__ */ React40__namespace.default.createElement(React40__namespace.default.Fragment, null, /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.TagList, {
37738
+ return /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.TagList, {
37747
37739
  "aria-describedby": ariaDescribedBy,
37748
37740
  className
37749
37741
  }, allOptions.map((option, index) => {
@@ -37755,12 +37747,38 @@ var Options9 = (_ref4) => {
37755
37747
  isOther: option.isOther,
37756
37748
  isFirstOption: index === 0
37757
37749
  });
37758
- })), isOtherSelected && otherInputElement);
37750
+ }));
37759
37751
  };
37760
- var Tags = (_ref5) => {
37752
+ var Control4 = (_ref5) => {
37761
37753
  let {
37762
- children
37754
+ children,
37755
+ className
37763
37756
  } = _ref5;
37757
+ const {
37758
+ addOther,
37759
+ addOtherLabel,
37760
+ value: fieldValue
37761
+ } = useFieldPropsV2();
37762
+ const {
37763
+ t
37764
+ } = useTranslation();
37765
+ const otherLabel = addOtherLabel || t("add-other.default-other-option-label") || OTHER_ID3;
37766
+ const optionsElement = findChildOfType(children, Options9);
37767
+ const otherInputElement = findChildOfType(children, OtherInput2);
37768
+ const isOtherSelected = React40.useMemo(() => {
37769
+ if (!addOther || !fieldValue) {
37770
+ return false;
37771
+ }
37772
+ return fieldValue.some((val) => val === otherLabel || val.startsWith(`${otherLabel}:`));
37773
+ }, [addOther, fieldValue, otherLabel]);
37774
+ return /* @__PURE__ */ React40__namespace.default.createElement("div", {
37775
+ className
37776
+ }, optionsElement, isOtherSelected && otherInputElement);
37777
+ };
37778
+ var Tags = (_ref6) => {
37779
+ let {
37780
+ children
37781
+ } = _ref6;
37764
37782
  const {
37765
37783
  id,
37766
37784
  value,
@@ -37796,7 +37814,7 @@ var Tags = (_ref5) => {
37796
37814
  return new Set(normalizedValues);
37797
37815
  }, [value, otherLabel]);
37798
37816
  const labelElement = findChildOfType(children, Label);
37799
- const optionsElement = findChildOfType(children, Options9);
37817
+ const controlElement = findChildOfType(children, Control4);
37800
37818
  const descriptionElement = findChildOfType(children, Description);
37801
37819
  const errorElement = findChildOfType(children, Error2);
37802
37820
  return /* @__PURE__ */ React40__namespace.default.createElement(FieldLayout, {
@@ -37806,15 +37824,16 @@ var Tags = (_ref5) => {
37806
37824
  selectionMode: "multiple",
37807
37825
  selectedKeys,
37808
37826
  onSelectionChange: handleSelectionChange
37809
- }, optionsElement),
37827
+ }, controlElement),
37810
37828
  renderDescription: () => /* @__PURE__ */ React40__namespace.default.createElement(React40__namespace.default.Fragment, null, descriptionElement, errorElement)
37811
37829
  });
37812
37830
  };
37813
37831
  Options9.Option = Option10;
37814
37832
  Option10.Label = OptionLabel3;
37815
- Option10.OtherInput = OtherInput2;
37816
37833
  Tags.Label = Label;
37834
+ Tags.Control = Control4;
37817
37835
  Tags.Options = Options9;
37836
+ Tags.OtherInput = OtherInput2;
37818
37837
  Tags.Description = Description;
37819
37838
  Tags.Error = Error2;
37820
37839
  var TextArea = (_ref) => {