@wix/form-public 0.99.0 → 0.100.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 +40 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -29
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -37067,10 +37067,6 @@ var PhoneInput = (_ref2) => {
|
|
|
37067
37067
|
id,
|
|
37068
37068
|
value,
|
|
37069
37069
|
onChange,
|
|
37070
|
-
disabled,
|
|
37071
|
-
required,
|
|
37072
|
-
onBlur,
|
|
37073
|
-
onFocus,
|
|
37074
37070
|
FieldLayout,
|
|
37075
37071
|
defaultCountry,
|
|
37076
37072
|
validation
|
|
@@ -37091,9 +37087,7 @@ var PhoneInput = (_ref2) => {
|
|
|
37091
37087
|
onChange
|
|
37092
37088
|
});
|
|
37093
37089
|
const labelElement = findChildOfType(children, PhoneInput.Label);
|
|
37094
|
-
const
|
|
37095
|
-
const countryOptionsElement = findChildOfType(children, PhoneInput.CountryOptions);
|
|
37096
|
-
const phoneNumberElement = findChildOfType(children, PhoneInput.PhoneNumber);
|
|
37090
|
+
const controlElement = findChildOfType(children, PhoneInput.Control);
|
|
37097
37091
|
const descriptionElement = findChildOfType(children, PhoneInput.Description);
|
|
37098
37092
|
const errorElement = findChildOfType(children, PhoneInput.Error);
|
|
37099
37093
|
const contextValue = {
|
|
@@ -37109,19 +37103,7 @@ var PhoneInput = (_ref2) => {
|
|
|
37109
37103
|
}, /* @__PURE__ */ React40__namespace.default.createElement(FieldLayout, {
|
|
37110
37104
|
fieldId: id,
|
|
37111
37105
|
renderLabel: () => labelElement,
|
|
37112
|
-
renderInput: () =>
|
|
37113
|
-
style: {
|
|
37114
|
-
display: "flex",
|
|
37115
|
-
gap: "8px"
|
|
37116
|
-
}
|
|
37117
|
-
}, /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.Select, {
|
|
37118
|
-
value: selectedCountryCode ?? null,
|
|
37119
|
-
onChange: (key) => handleCountryCodeChange(key),
|
|
37120
|
-
isDisabled: disabled,
|
|
37121
|
-
isRequired: required,
|
|
37122
|
-
onBlur,
|
|
37123
|
-
onFocus
|
|
37124
|
-
}, countryButtonElement, countryOptionsElement), phoneNumberElement),
|
|
37106
|
+
renderInput: () => controlElement,
|
|
37125
37107
|
renderDescription: () => /* @__PURE__ */ React40__namespace.default.createElement(React40__namespace.default.Fragment, null, descriptionElement, errorElement)
|
|
37126
37108
|
}));
|
|
37127
37109
|
};
|
|
@@ -37296,23 +37278,52 @@ var PhoneNumber2 = (_ref1) => {
|
|
|
37296
37278
|
var _ref$current2;
|
|
37297
37279
|
(_ref$current2 = ref.current) == null || _ref$current2.focus();
|
|
37298
37280
|
}, id);
|
|
37299
|
-
return /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.
|
|
37300
|
-
value: currentValue,
|
|
37301
|
-
onChange: handlePhoneChange,
|
|
37302
|
-
isDisabled: disabled,
|
|
37303
|
-
isRequired: required,
|
|
37304
|
-
onBlur,
|
|
37305
|
-
onFocus
|
|
37306
|
-
}, /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.Input, {
|
|
37281
|
+
return /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.Input, {
|
|
37307
37282
|
ref,
|
|
37308
37283
|
id: inputId,
|
|
37309
37284
|
type: "tel",
|
|
37285
|
+
value: currentValue,
|
|
37286
|
+
onChange: (e2) => handlePhoneChange(e2.target.value),
|
|
37287
|
+
disabled,
|
|
37288
|
+
required,
|
|
37289
|
+
onBlur,
|
|
37290
|
+
onFocus,
|
|
37310
37291
|
"aria-describedby": ariaDescribedBy,
|
|
37311
37292
|
placeholder,
|
|
37312
37293
|
className
|
|
37313
|
-
})
|
|
37294
|
+
});
|
|
37295
|
+
};
|
|
37296
|
+
var Control3 = (_ref10) => {
|
|
37297
|
+
let {
|
|
37298
|
+
children,
|
|
37299
|
+
className
|
|
37300
|
+
} = _ref10;
|
|
37301
|
+
const {
|
|
37302
|
+
disabled,
|
|
37303
|
+
required,
|
|
37304
|
+
onBlur,
|
|
37305
|
+
onFocus
|
|
37306
|
+
} = useFieldPropsV2();
|
|
37307
|
+
const {
|
|
37308
|
+
selectedCountryCode,
|
|
37309
|
+
handleCountryCodeChange
|
|
37310
|
+
} = usePhoneInputContext();
|
|
37311
|
+
const countryButtonElement = findChildOfType(children, PhoneInput.CountryButton);
|
|
37312
|
+
const countryOptionsElement = findChildOfType(children, PhoneInput.CountryOptions);
|
|
37313
|
+
const phoneNumberElement = findChildOfType(children, PhoneInput.PhoneNumber);
|
|
37314
|
+
return /* @__PURE__ */ React40__namespace.default.createElement("div", {
|
|
37315
|
+
className
|
|
37316
|
+
}, /* @__PURE__ */ React40__namespace.default.createElement(reactAriaComponents.Select, {
|
|
37317
|
+
value: selectedCountryCode ?? null,
|
|
37318
|
+
onChange: (key) => handleCountryCodeChange(key),
|
|
37319
|
+
isDisabled: disabled,
|
|
37320
|
+
isRequired: required,
|
|
37321
|
+
onBlur,
|
|
37322
|
+
onFocus
|
|
37323
|
+
}, countryButtonElement, countryOptionsElement), phoneNumberElement);
|
|
37314
37324
|
};
|
|
37315
37325
|
PhoneInput.Label = Label;
|
|
37326
|
+
PhoneInput.Control = Control3;
|
|
37316
37327
|
PhoneInput.CountryButton = CountryButton;
|
|
37317
37328
|
PhoneInput.CountryOptions = CountryOptions;
|
|
37318
37329
|
PhoneInput.PhoneNumber = PhoneNumber2;
|