@awell-health/ui-library 0.1.84 → 0.1.86
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 +25 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34823,6 +34823,14 @@ Check the top-level render call using <` + t + ">.");
|
|
|
34823
34823
|
setFilteredOptions(options);
|
|
34824
34824
|
}
|
|
34825
34825
|
}, [options]);
|
|
34826
|
+
React.useEffect(function () {
|
|
34827
|
+
if (isOpen) {
|
|
34828
|
+
var container = document.getElementById('ahp_main_content_with_scroll_hint');
|
|
34829
|
+
if (container) {
|
|
34830
|
+
container.scrollTo({ top: container.scrollHeight, behavior: 'smooth' });
|
|
34831
|
+
}
|
|
34832
|
+
}
|
|
34833
|
+
}, [isOpen]);
|
|
34826
34834
|
var toggleDropdown = React.useCallback(function () {
|
|
34827
34835
|
setIsOpen(!isOpen);
|
|
34828
34836
|
}, [isOpen]);
|
|
@@ -37308,22 +37316,34 @@ Check the top-level render call using <` + t + ">.");
|
|
|
37308
37316
|
value: value,
|
|
37309
37317
|
hideSpaceAfterDialCode: true,
|
|
37310
37318
|
countries: countries,
|
|
37311
|
-
forceDialCode: forceDialCode
|
|
37319
|
+
forceDialCode: forceDialCode,
|
|
37320
|
+
onPhoneUpdate: function (phone) {
|
|
37321
|
+
onChange({ target: { value: phone } });
|
|
37322
|
+
} }),
|
|
37312
37323
|
phone = _d.phone,handlePhoneValueChange = _d.handlePhoneValueChange,inputRef = _d.inputRef,country = _d.country,setCountry = _d.setCountry;
|
|
37313
37324
|
var handleInputChange = function (e) {
|
|
37314
37325
|
handlePhoneValueChange(e);
|
|
37315
|
-
onChange(e);
|
|
37316
37326
|
};
|
|
37317
37327
|
var handleCountrySelect = function (_a) {
|
|
37318
37328
|
var iso2 = _a.iso2;
|
|
37319
37329
|
setCountry(iso2);
|
|
37320
37330
|
};
|
|
37331
|
+
var onPaste = function (e) {
|
|
37332
|
+
var _a;
|
|
37333
|
+
var phoneNumber = (_a = e.clipboardData.getData('text')) !== null && _a !== void 0 ? _a : '';
|
|
37334
|
+
if (phoneNumber.includes('+')) {
|
|
37335
|
+
if (inputRef.current) {
|
|
37336
|
+
inputRef.current.value = '';
|
|
37337
|
+
inputRef.current.dispatchEvent(new Event('change'));
|
|
37338
|
+
}
|
|
37339
|
+
}
|
|
37340
|
+
};
|
|
37321
37341
|
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$9.awell_input_field_wrapper }, { children: [jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsxs("div", __assign({ className: classes$9.awell_phone_input_field_container }, { children: [jsxRuntime.exports.jsx(build.exports.CountrySelector, { countries: countries, selectedCountry: country, onSelect: handleCountrySelect, buttonStyle: {
|
|
37322
37342
|
border: 0,
|
|
37323
37343
|
height: 42,
|
|
37324
37344
|
marginRight: 2,
|
|
37325
37345
|
backgroundColor: 'transparent' } }),
|
|
37326
|
-
jsxRuntime.exports.jsx("input", __assign({}, props, { type: "tel", id: id, ref: inputRef, className: classes$9.awell_input_field, placeholder: placeholder, onChange: handleInputChange, "data-1p-ignore": true, value: phone, "data-testid": "input-".concat(id), dir: "ltr" }))] }))] }));
|
|
37346
|
+
jsxRuntime.exports.jsx("input", __assign({}, props, { type: "tel", id: id, ref: inputRef, className: classes$9.awell_input_field, placeholder: placeholder, onChange: handleInputChange, "data-1p-ignore": true, value: phone, "data-testid": "input-".concat(id), dir: "ltr", onPaste: onPaste }))] }))] }));
|
|
37327
37347
|
};
|
|
37328
37348
|
PhoneInputField.displayName = 'PhoneInputField';
|
|
37329
37349
|
|
|
@@ -42252,9 +42272,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
42252
42272
|
resetLayoutMode();
|
|
42253
42273
|
};
|
|
42254
42274
|
}, []);
|
|
42255
|
-
return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsx("main", __assign({ id: "ahp_main_content_with_scroll_hint", className: clsx(layoutClasses.main_content, classes$4.traditional_form) }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: clsx(classes$4.container, classes$4.traditional_container) }, { children: [!questionWithVisiblity ? jsxRuntime.exports.jsx("div", __assign({ className: classes$4.loadingContainer }, { children: jsxRuntime.exports.jsx(LoadActivityPlaceholder, {}) })) : jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx("div", { children: questionWithVisiblity.
|
|
42275
|
+
return jsxRuntime.exports.jsxs("div", __assign({ style: { height: '100%' } }, { children: [jsxRuntime.exports.jsx("main", __assign({ id: "ahp_main_content_with_scroll_hint", className: clsx(layoutClasses.main_content, classes$4.traditional_form) }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: clsx(classes$4.container, classes$4.traditional_container) }, { children: [!questionWithVisiblity ? jsxRuntime.exports.jsx("div", __assign({ className: classes$4.loadingContainer }, { children: jsxRuntime.exports.jsx(LoadActivityPlaceholder, {}) })) : jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx("div", { children: questionWithVisiblity.
|
|
42256
42276
|
filter(function (vb) {return vb.visible;}).
|
|
42257
|
-
map(function (visibleQuestion) {return jsxRuntime.exports.jsx("div", __assign({ className: classes$4.traditional_form_question }, { children: jsxRuntime.exports.jsx(Question, { question: visibleQuestion, control: control, getValues: getValues, errors: errors, inputAutoFocus: false, onAnswerChange: updateQuestionVisibility, labels: questionLabels }, visibleQuestion.id) }), visibleQuestion.id);}) }) }), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: classes$4.trademark }, { children: form.trademark }))] })) })), jsxRuntime.exports.jsx("div", { ref: scrollHintOverlayRef, className: classes$4.scroll_hint_overlay }), jsxRuntime.exports.jsx(HostedPageFooter, __assign({ showScrollHint: false, fixPosition: true }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$4.traditional_button_wrapper }, { children: [formHasErrors && jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx(Text, __assign({ variant: "textSmall", color: "var(--awell-signalError100)" }, { children: errorLabels.formHasErrors })) }), jsxRuntime.exports.jsx("div", {}), jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit }))] })) }))] });
|
|
42277
|
+
map(function (visibleQuestion) {return jsxRuntime.exports.jsx("div", __assign({ className: classes$4.traditional_form_question }, { children: jsxRuntime.exports.jsx(Question, { question: visibleQuestion, control: control, getValues: getValues, errors: errors, inputAutoFocus: false, onAnswerChange: updateQuestionVisibility, labels: questionLabels }, visibleQuestion.id) }), visibleQuestion.id);}) }) }), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: classes$4.trademark }, { children: form.trademark }))] })) })), jsxRuntime.exports.jsx("div", { ref: scrollHintOverlayRef, className: classes$4.scroll_hint_overlay }), jsxRuntime.exports.jsx(HostedPageFooter, __assign({ showScrollHint: false, fixPosition: true }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$4.traditional_button_wrapper }, { children: [formHasErrors && jsxRuntime.exports.jsx("div", { children: jsxRuntime.exports.jsx(Text, __assign({ variant: "textSmall", color: "var(--awell-signalError100)" }, { children: errorLabels.formHasErrors })) }), jsxRuntime.exports.jsx("div", {}), jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit }))] })) }))] }));
|
|
42258
42278
|
};
|
|
42259
42279
|
|
|
42260
42280
|
var WizardForm = ConversationalForm;
|