@awell-health/ui-library 0.1.127 → 0.1.128
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 +9 -6
- package/dist/types/atoms/inputField/InputField.d.ts +1 -1
- package/dist/types/atoms/longTextField/LongTextField.d.ts +1 -1
- package/dist/types/atoms/phoneInputField/PhoneInputField.d.ts +1 -1
- package/dist/types/atoms/questionLabel/QuestionLabel.d.ts +2 -2
- package/dist/types/atoms/rangeInput/RangeInput.d.ts +1 -1
- package/dist/types/molecules/multipleChoiceQuestion/MultipleChoiceQuestion.d.ts +1 -1
- package/dist/types/molecules/singleChoiceQuestion/SingleChoiceQuestion.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9874,6 +9874,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
9874
9874
|
|
|
9875
9875
|
var QuestionLabel = function (_a) {
|
|
9876
9876
|
var label = _a.label,_b = _a.mandatory,mandatory = _b === void 0 ? false : _b,props = __rest(_a, ["label", "mandatory"]);
|
|
9877
|
+
if (!label || label.trim() === '') {
|
|
9878
|
+
return null;
|
|
9879
|
+
}
|
|
9877
9880
|
return jsxRuntime.exports.jsxs("label", __assign({}, props, { className: "".concat(classes$t.label, " awell__question_label"), id: "awell__question_label" }, { children: [jsxRuntime.exports.jsx("span", { children: label }), ' ', mandatory && jsxRuntime.exports.jsx("span", __assign({ className: classes$t.asterix }, { children: "*" }))] }));
|
|
9878
9881
|
};
|
|
9879
9882
|
|
|
@@ -16492,7 +16495,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
16492
16495
|
|
|
16493
16496
|
var InputField = function (_a) {
|
|
16494
16497
|
var onChange = _a.onChange,id = _a.id,label = _a.label,type = _a.type,mandatory = _a.mandatory,props = __rest(_a, ["onChange", "id", "label", "type", "mandatory"]);
|
|
16495
|
-
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$q.awell_input_field_wrapper }, { children: [jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("input", __assign({}, props, { type: type, id: id, "data-1p-ignore": true, className: classes$q.awell_input_field, onChange: onChange, "data-testid": "input-".concat(id), dir: "ltr" }))] }));
|
|
16498
|
+
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$q.awell_input_field_wrapper }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("input", __assign({}, props, { type: type, id: id, "data-1p-ignore": true, className: classes$q.awell_input_field, onChange: onChange, "data-testid": "input-".concat(id), dir: "ltr" }))] }));
|
|
16496
16499
|
};
|
|
16497
16500
|
|
|
16498
16501
|
var classes$p = {"awell_logo":"awell__logo_awell_logo"};
|
|
@@ -16509,7 +16512,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
16509
16512
|
var LongTextField = function (_a) {
|
|
16510
16513
|
var onChange = _a.onChange,id = _a.id,label = _a.label,mandatory = _a.mandatory,props = __rest(_a, ["onChange", "id", "label", "mandatory"]);
|
|
16511
16514
|
var DEFAULT_ROWS = 4;
|
|
16512
|
-
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$o.awell_long_text_field_wrapper }, { children: [jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("textarea", __assign({}, props, { id: id, rows: DEFAULT_ROWS, className: classes$o.awell_long_text_field, onChange: onChange, dir: "ltr" }))] }));
|
|
16515
|
+
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$o.awell_long_text_field_wrapper }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("textarea", __assign({}, props, { id: id, rows: DEFAULT_ROWS, className: classes$o.awell_long_text_field, onChange: onChange, dir: "ltr" }))] }));
|
|
16513
16516
|
};
|
|
16514
16517
|
|
|
16515
16518
|
var classes$n = {"awell_message_container":"awell__messageAttachment_awell_message_container","awell_message_link_button":"awell__messageAttachment_awell_message_link_button","awell_message_name_container":"awell__messageAttachment_awell_message_name_container"};
|
|
@@ -33920,7 +33923,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
33920
33923
|
}
|
|
33921
33924
|
}
|
|
33922
33925
|
}, [internalValue, is_value_tooltip_on, max, min, touched]);
|
|
33923
|
-
return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory, id: "".concat(id, "-label") }), jsxRuntime.exports.jsxs("div", __assign({ className: classes$j.input_container }, { children: [jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$j.touch_tooltip_wrapper, " ").concat(is_value_tooltip_on ? classes$j.with_value_tooltip : '') }, { children: renderTouchTooltip() })), jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$j.awell_range_input_wrapper, " ").concat(display_marks ? classes$j.with_marks : ''), style: style }, { children: [is_value_tooltip_on &&
|
|
33926
|
+
return jsxRuntime.exports.jsxs("div", { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory, id: "".concat(id, "-label") }), jsxRuntime.exports.jsxs("div", __assign({ className: classes$j.input_container }, { children: [jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$j.touch_tooltip_wrapper, " ").concat(is_value_tooltip_on ? classes$j.with_value_tooltip : '') }, { children: renderTouchTooltip() })), jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$j.awell_range_input_wrapper, " ").concat(display_marks ? classes$j.with_marks : ''), style: style }, { children: [is_value_tooltip_on &&
|
|
33924
33927
|
renderValueTooltip(internalValue, tooltipPosition.left, tooltipPosition.top, touched), jsxRuntime.exports.jsx("input", __assign({}, props, { "data-testid": id, type: "range", id: "awell__slider_input", min: min, max: max, step: step_value, className: "".concat(classes$j.awell_range_input, " ").concat(touched ? classes$j.showThumb : classes$j.hideThumb), onChange: handleValueChange, onFocus: function (e) {
|
|
33925
33928
|
if (!touched) {
|
|
33926
33929
|
handleValueChange(e);
|
|
@@ -35091,7 +35094,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
35091
35094
|
}
|
|
35092
35095
|
setCheckedOptions(newCheckedOptions);
|
|
35093
35096
|
};
|
|
35094
|
-
return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsx(QuestionLabel, { label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("fieldset", __assign({ className: classes$e.awell_multiple_choice_question }, { children: options.map(function (option) {return jsxRuntime.exports.jsx(CheckboxButton, { onChange: function (event) {return handleSelectOption(event, option);}, label: option.label, id: option.id, checked: checkedOptions.map(function (c) {return c.value;}).includes(option.value), name: questionId }, option.id);}) }))] });
|
|
35097
|
+
return jsxRuntime.exports.jsxs("div", { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("fieldset", __assign({ className: classes$e.awell_multiple_choice_question }, { children: options.map(function (option) {return jsxRuntime.exports.jsx(CheckboxButton, { onChange: function (event) {return handleSelectOption(event, option);}, label: option.label, id: option.id, checked: checkedOptions.map(function (c) {return c.value;}).includes(option.value), name: questionId }, option.id);}) }))] });
|
|
35095
35098
|
};
|
|
35096
35099
|
|
|
35097
35100
|
var classes$d = {"awell_navbar":"awell__navbar_awell_navbar","awell_navbar_keyboard_open":"awell__navbar_awell_navbar_keyboard_open"};
|
|
@@ -37300,7 +37303,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
37300
37303
|
var handleSelectOption = function (option) {
|
|
37301
37304
|
setCheckedOption(option);
|
|
37302
37305
|
};
|
|
37303
|
-
return jsxRuntime.exports.jsxs("div", { children: [jsxRuntime.exports.jsx(QuestionLabel, { label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("fieldset", __assign({ className: classes$c.awell_single_choice_question }, { children: (options || []).map(function (option) {return jsxRuntime.exports.jsx(RadioButton, { onChange: function () {return handleSelectOption(option);}, label: option.label, id: option.id, checked: option.id === (checkedOption === null || checkedOption === void 0 ? void 0 : checkedOption.id), name: questionId, customWrapperClass: flickerAnimation &&
|
|
37306
|
+
return jsxRuntime.exports.jsxs("div", { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { label: label, mandatory: mandatory }), jsxRuntime.exports.jsx("fieldset", __assign({ className: classes$c.awell_single_choice_question }, { children: (options || []).map(function (option) {return jsxRuntime.exports.jsx(RadioButton, { onChange: function () {return handleSelectOption(option);}, label: option.label, id: option.id, checked: option.id === (checkedOption === null || checkedOption === void 0 ? void 0 : checkedOption.id), name: questionId, customWrapperClass: flickerAnimation &&
|
|
37304
37307
|
option.id === (checkedOption === null || checkedOption === void 0 ? void 0 : checkedOption.id) &&
|
|
37305
37308
|
showFlickerOnSelected ?
|
|
37306
37309
|
classes$c.animate_flicker :
|
|
@@ -37392,7 +37395,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
37392
37395
|
}
|
|
37393
37396
|
}
|
|
37394
37397
|
};
|
|
37395
|
-
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$a.awell_input_field_wrapper }, { children: [jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsxs("div", __assign({ className: classes$a.awell_phone_input_field_container }, { children: [jsxRuntime.exports.jsx(build.exports.CountrySelector, { countries: countries, selectedCountry: country, onSelect: handleCountrySelect, buttonStyle: {
|
|
37398
|
+
return jsxRuntime.exports.jsxs("div", __assign({ className: classes$a.awell_input_field_wrapper }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), jsxRuntime.exports.jsxs("div", __assign({ className: classes$a.awell_phone_input_field_container }, { children: [jsxRuntime.exports.jsx(build.exports.CountrySelector, { countries: countries, selectedCountry: country, onSelect: handleCountrySelect, buttonStyle: {
|
|
37396
37399
|
border: 0,
|
|
37397
37400
|
height: 42,
|
|
37398
37401
|
marginRight: 2,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChangeEventHandler, InputHTMLAttributes, MouseEventHandler } from 'react';
|
|
2
2
|
export interface InputFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
type: 'number' | 'text' | 'date' | 'email';
|
|
4
|
-
label
|
|
4
|
+
label?: string;
|
|
5
5
|
id: string;
|
|
6
6
|
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
7
7
|
onClick?: MouseEventHandler<HTMLInputElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
2
2
|
export interface LongTextFieldProps extends InputHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
-
label
|
|
3
|
+
label?: string;
|
|
4
4
|
id: string;
|
|
5
5
|
onChange: ChangeEventHandler<HTMLTextAreaElement>;
|
|
6
6
|
value?: string;
|
|
@@ -2,7 +2,7 @@ import { InputHTMLAttributes, MouseEventHandler } from 'react';
|
|
|
2
2
|
import 'react-international-phone/style.css';
|
|
3
3
|
import { CountryIso2 } from 'react-international-phone';
|
|
4
4
|
export interface PhoneInputFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
-
label
|
|
5
|
+
label?: string;
|
|
6
6
|
id: string;
|
|
7
7
|
onChange: ({ target: { value } }: {
|
|
8
8
|
target: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LabelHTMLAttributes } from 'react';
|
|
2
2
|
export interface QuestionLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
|
-
label
|
|
3
|
+
label?: string;
|
|
4
4
|
mandatory?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare const QuestionLabel: ({ label, mandatory, ...props }: QuestionLabelProps) => JSX.Element;
|
|
6
|
+
export declare const QuestionLabel: ({ label, mandatory, ...props }: QuestionLabelProps) => JSX.Element | null;
|
|
@@ -6,7 +6,7 @@ interface OptionStringOrNumberType {
|
|
|
6
6
|
}
|
|
7
7
|
export interface MultipleChoiceQuestionProps {
|
|
8
8
|
questionId: string;
|
|
9
|
-
label
|
|
9
|
+
label?: string;
|
|
10
10
|
options: Array<OptionStringOrNumberType>;
|
|
11
11
|
onChange: (newValue: Array<OptionStringOrNumberType>) => void;
|
|
12
12
|
values: Array<OptionStringOrNumberType>;
|
|
@@ -6,7 +6,7 @@ interface OptionStringOrNumberType {
|
|
|
6
6
|
}
|
|
7
7
|
export interface SingleChoiceQuestionProps {
|
|
8
8
|
questionId: string;
|
|
9
|
-
label
|
|
9
|
+
label?: string;
|
|
10
10
|
options: Array<OptionStringOrNumberType>;
|
|
11
11
|
value: OptionStringOrNumberType | null;
|
|
12
12
|
onChange: (newValue: OptionStringOrNumberType | null) => void;
|