@wix/form-public 0.538.0 → 0.539.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 +12 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -54158,10 +54158,8 @@ var ADDRESS_FIELD_TYPES = [
|
|
|
54158
54158
|
];
|
|
54159
54159
|
var hasCountryOptions = ({ properties }) => properties.validation?.string?.phoneOptions?.allowedCountryCodes?.length !== 1;
|
|
54160
54160
|
var showsCountry = ({ properties }) => properties.fieldSettings?.country?.show !== false;
|
|
54161
|
-
var
|
|
54162
|
-
|
|
54163
|
-
return !isMobile2 && hasCountryOptions(field);
|
|
54164
|
-
}
|
|
54161
|
+
var hasPhoneCountryList = (field, isMobile2) => PHONE_FIELD_TYPES.includes(field.fieldType) && !isMobile2 && hasCountryOptions(field);
|
|
54162
|
+
var hasDropdown = (field) => {
|
|
54165
54163
|
if (ADDRESS_FIELD_TYPES.includes(field.fieldType)) {
|
|
54166
54164
|
return showsCountry(field);
|
|
54167
54165
|
}
|
|
@@ -54188,6 +54186,11 @@ var useIsForcedOpenDropdown = (fieldId) => {
|
|
|
54188
54186
|
const openableDropdownIds = useOpenableFieldIds(hasDropdown);
|
|
54189
54187
|
return isOpenState && openableDropdownIds.includes(fieldId);
|
|
54190
54188
|
};
|
|
54189
|
+
var useIsForcedOpenPhone = (fieldId) => {
|
|
54190
|
+
const isOpenState = useElementProps().phone?.open === true;
|
|
54191
|
+
const openablePhoneIds = useOpenableFieldIds(hasPhoneCountryList);
|
|
54192
|
+
return isOpenState && openablePhoneIds.includes(fieldId);
|
|
54193
|
+
};
|
|
54191
54194
|
var useIsForcedOpenDatePicker = (fieldId) => {
|
|
54192
54195
|
const isOpenState = useElementProps().datePicker?.open === true;
|
|
54193
54196
|
const openableDatePickerIds = useOpenableFieldIds(hasDatePicker);
|
|
@@ -54700,7 +54703,7 @@ var Control2 = ({ children, className }) => {
|
|
|
54700
54703
|
const { inputId, ariaDescribedBy } = useFieldAttributes();
|
|
54701
54704
|
const { hasError, disabled, readOnly } = useFieldPropsV2();
|
|
54702
54705
|
const state = React172.useContext(reactAriaComponents.DatePickerStateContext);
|
|
54703
|
-
const
|
|
54706
|
+
const handleClick = React172.useCallback((event) => {
|
|
54704
54707
|
if (!state || state.isOpen || disabled || readOnly) {
|
|
54705
54708
|
return;
|
|
54706
54709
|
}
|
|
@@ -54723,7 +54726,7 @@ var Control2 = ({ children, className }) => {
|
|
|
54723
54726
|
"aria-describedby": ariaDescribedBy,
|
|
54724
54727
|
className,
|
|
54725
54728
|
"data-invalid": hasError,
|
|
54726
|
-
|
|
54729
|
+
onClick: handleClick
|
|
54727
54730
|
}, children);
|
|
54728
54731
|
};
|
|
54729
54732
|
var Input2 = ({ className }) => {
|
|
@@ -59334,7 +59337,7 @@ var ADDRESS_FIELDS = {
|
|
|
59334
59337
|
};
|
|
59335
59338
|
var NO_VALUES2 = {};
|
|
59336
59339
|
var NO_ERRORS3 = [];
|
|
59337
|
-
var MultilineAddress = ({ children }) => {
|
|
59340
|
+
var MultilineAddress = ({ children, className }) => {
|
|
59338
59341
|
const { id: id6, form: _form, value, onChange, onFieldBlur, onFieldFocus, errors, FieldLayout, fieldSettings, label, validation, target, autocompleteEnabled, required, fieldType } = useFieldPropsV2();
|
|
59339
59342
|
const [portalContainer, setPortalContainer] = React172.useState(null);
|
|
59340
59343
|
const hostFields = useFormFields();
|
|
@@ -59477,6 +59480,7 @@ var MultilineAddress = ({ children }) => {
|
|
|
59477
59480
|
}), /* @__PURE__ */ React172__default.default.createElement($72abaeab4d80592f$export$78efe591171d7d45, {
|
|
59478
59481
|
getContainer: () => portalContainer
|
|
59479
59482
|
}, /* @__PURE__ */ React172__default.default.createElement("fieldset", {
|
|
59483
|
+
className,
|
|
59480
59484
|
style: FIELDSET_RESET_STYLE
|
|
59481
59485
|
}, /* @__PURE__ */ React172__default.default.createElement("legend", {
|
|
59482
59486
|
style: VISUALLY_HIDDEN_STYLE
|
|
@@ -60161,7 +60165,7 @@ var Control7 = ({ children, className }) => {
|
|
|
60161
60165
|
const popoverElement = findChildOfType(children, PhoneInput.CountryPopover);
|
|
60162
60166
|
const phoneNumberElement = findChildOfType(children, PhoneInput.PhoneNumber);
|
|
60163
60167
|
const hasCountryOptions2 = countries.length > 1;
|
|
60164
|
-
const isForcedOpen =
|
|
60168
|
+
const isForcedOpen = useIsForcedOpenPhone(id6) && !!popoverElement && hasCountryOptions2;
|
|
60165
60169
|
const controlClassName = typeof className === "function" ? ({ isHovered, isFocusWithin }) => className({
|
|
60166
60170
|
hasCountryOptions: hasCountryOptions2,
|
|
60167
60171
|
isHovered,
|