@awell-health/ui-library 0.1.77 → 0.1.79
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.js
CHANGED
|
@@ -37271,14 +37271,15 @@ Check the top-level render call using <` + t + ">.");
|
|
|
37271
37271
|
};
|
|
37272
37272
|
|
|
37273
37273
|
var PhoneInputField = function (_a) {
|
|
37274
|
-
var onChange = _a.onChange,id = _a.id,label = _a.label,mandatory = _a.mandatory,value = _a.value,placeholder = _a.placeholder,_b = _a.initialCountry,initialCountry = _b === void 0 ? 'us' : _b,availableCountries = _a.availableCountries,props = __rest(_a, ["onChange", "id", "label", "mandatory", "value", "placeholder", "initialCountry", "availableCountries"]);
|
|
37274
|
+
var onChange = _a.onChange,id = _a.id,label = _a.label,mandatory = _a.mandatory,value = _a.value,placeholder = _a.placeholder,_b = _a.initialCountry,initialCountry = _b === void 0 ? 'us' : _b,availableCountries = _a.availableCountries,_c = _a.forceDialCode,forceDialCode = _c === void 0 ? false : _c,props = __rest(_a, ["onChange", "id", "label", "mandatory", "value", "placeholder", "initialCountry", "availableCountries", "forceDialCode"]);
|
|
37275
37275
|
var countries = getDefaultCountries(availableCountries, initialCountry);
|
|
37276
|
-
var
|
|
37276
|
+
var _d = build.exports.usePhoneInput({
|
|
37277
37277
|
initialCountry: initialCountry,
|
|
37278
37278
|
value: value,
|
|
37279
37279
|
hideSpaceAfterDialCode: true,
|
|
37280
|
-
countries: countries
|
|
37281
|
-
|
|
37280
|
+
countries: countries,
|
|
37281
|
+
forceDialCode: forceDialCode }),
|
|
37282
|
+
phone = _d.phone,handlePhoneValueChange = _d.handlePhoneValueChange,inputRef = _d.inputRef,country = _d.country,setCountry = _d.setCountry;
|
|
37282
37283
|
var handleInputChange = function (e) {
|
|
37283
37284
|
handlePhoneValueChange(e);
|
|
37284
37285
|
onChange(e);
|
|
@@ -37667,14 +37668,18 @@ Check the top-level render call using <` + t + ">.");
|
|
|
37667
37668
|
return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, defaultValue: "", rules: {
|
|
37668
37669
|
required: config === null || config === void 0 ? void 0 : config.mandatory,
|
|
37669
37670
|
validate: function (value) {
|
|
37670
|
-
|
|
37671
|
+
if (!lodash.exports.isEmpty(value)) {
|
|
37672
|
+
return isValidEmail(value);
|
|
37673
|
+
}
|
|
37674
|
+
return true;
|
|
37671
37675
|
} },
|
|
37672
37676
|
render: function (_a) {
|
|
37673
|
-
var _b
|
|
37677
|
+
var _b;
|
|
37678
|
+
var _c = _a.field,onChange = _c.onChange,value = _c.value;
|
|
37674
37679
|
return jsxRuntime.exports.jsx(InputField, { autoFocus: inputAutoFocus, type: "email", onChange: function (e) {
|
|
37675
37680
|
onChange(e.target.value);
|
|
37676
37681
|
onAnswerChange();
|
|
37677
|
-
}, label: question.title, id: question.id, value: value, mandatory: config === null || config === void 0 ? void 0 : config.mandatory, placeholder: "name@example.com" });
|
|
37682
|
+
}, label: question.title, id: question.id, value: value, mandatory: (_b = config === null || config === void 0 ? void 0 : config.mandatory) !== null && _b !== void 0 ? _b : false, placeholder: "name@example.com" });
|
|
37678
37683
|
} });
|
|
37679
37684
|
case exports.UserQuestionType.Date:
|
|
37680
37685
|
return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, rules: {
|
|
@@ -15,8 +15,9 @@ export interface PhoneInputFieldProps extends InputHTMLAttributes<HTMLInputEleme
|
|
|
15
15
|
initialCountry?: CountryIso2;
|
|
16
16
|
availableCountries?: Array<CountryIso2>;
|
|
17
17
|
placeholder?: string;
|
|
18
|
+
forceDialCode?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export declare const PhoneInputField: {
|
|
20
|
-
({ onChange, id, label, mandatory, value, placeholder, initialCountry, availableCountries, ...props }: PhoneInputFieldProps): JSX.Element;
|
|
21
|
+
({ onChange, id, label, mandatory, value, placeholder, initialCountry, availableCountries, forceDialCode, ...props }: PhoneInputFieldProps): JSX.Element;
|
|
21
22
|
displayName: string;
|
|
22
23
|
};
|