@awell-health/ui-library 0.1.83 → 0.1.85

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14293,7 +14293,8 @@ Check the top-level render call using <` + t + ">.");
14293
14293
 
14294
14294
  var RichTextViewer = function (_a) {
14295
14295
  var content = _a.content;
14296
- return jsxRuntime.exports.jsx("div", { className: richTextClasses.content, dangerouslySetInnerHTML: { __html: content } });
14296
+ var contentWithLineBreaks = content.split('\n').join('<br />');
14297
+ return jsxRuntime.exports.jsx("div", { className: richTextClasses.content, dangerouslySetInnerHTML: { __html: contentWithLineBreaks } });
14297
14298
  };
14298
14299
 
14299
14300
  var purify = {exports: {}};
@@ -34822,6 +34823,14 @@ Check the top-level render call using <` + t + ">.");
34822
34823
  setFilteredOptions(options);
34823
34824
  }
34824
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]);
34825
34834
  var toggleDropdown = React.useCallback(function () {
34826
34835
  setIsOpen(!isOpen);
34827
34836
  }, [isOpen]);
@@ -37309,20 +37318,32 @@ Check the top-level render call using <` + t + ">.");
37309
37318
  countries: countries,
37310
37319
  forceDialCode: forceDialCode }),
37311
37320
  phone = _d.phone,handlePhoneValueChange = _d.handlePhoneValueChange,inputRef = _d.inputRef,country = _d.country,setCountry = _d.setCountry;
37321
+ React.useEffect(function () {
37322
+ onChange({ target: { value: phone } });
37323
+ }, [phone, onChange]);
37312
37324
  var handleInputChange = function (e) {
37313
37325
  handlePhoneValueChange(e);
37314
- onChange(e);
37315
37326
  };
37316
37327
  var handleCountrySelect = function (_a) {
37317
37328
  var iso2 = _a.iso2;
37318
37329
  setCountry(iso2);
37319
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
+ };
37320
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: {
37321
37342
  border: 0,
37322
37343
  height: 42,
37323
37344
  marginRight: 2,
37324
37345
  backgroundColor: 'transparent' } }),
37325
- 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 }))] }))] }));
37326
37347
  };
37327
37348
  PhoneInputField.displayName = 'PhoneInputField';
37328
37349
 
@@ -42251,9 +42272,9 @@ Check the top-level render call using <` + t + ">.");
42251
42272
  resetLayoutMode();
42252
42273
  };
42253
42274
  }, []);
42254
- 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.
42255
42276
  filter(function (vb) {return vb.visible;}).
42256
- 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 }))] })) }))] }));
42257
42278
  };
42258
42279
 
42259
42280
  var WizardForm = ConversationalForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/ui-library",
3
- "version": "0.1.83",
3
+ "version": "0.1.85",
4
4
  "description": "UI components to integrate with Awell Health",
5
5
  "repository": {
6
6
  "type": "git",