@awell-health/ui-library 0.1.99 → 0.1.101
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
|
@@ -16245,6 +16245,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
16245
16245
|
exports.ElementType = void 0;
|
|
16246
16246
|
(function (ElementType) {
|
|
16247
16247
|
ElementType["Action"] = "ACTION";
|
|
16248
|
+
ElementType["Agent"] = "AGENT";
|
|
16248
16249
|
ElementType["Pathway"] = "PATHWAY";
|
|
16249
16250
|
ElementType["Step"] = "STEP";
|
|
16250
16251
|
ElementType["Track"] = "TRACK";
|
|
@@ -37420,7 +37421,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
37420
37421
|
};
|
|
37421
37422
|
|
|
37422
37423
|
var isValidEmail = function (email) {
|
|
37423
|
-
var emailRegex = /^[
|
|
37424
|
+
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
37424
37425
|
return emailRegex.test(email);
|
|
37425
37426
|
};
|
|
37426
37427
|
|
|
@@ -48233,10 +48234,10 @@ var Kr=[{
|
|
|
48233
48234
|
|
|
48234
48235
|
var AUTO_PROGRESS_DELAY = 850;
|
|
48235
48236
|
var QuestionData = function (_a) {
|
|
48236
|
-
var _b, _c, _d, _e, _f;
|
|
48237
|
-
var question = _a.question,control = _a.control,getValues = _a.getValues,labels = _a.labels,
|
|
48237
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
48238
|
+
var question = _a.question,control = _a.control,getValues = _a.getValues,labels = _a.labels,_k = _a.inputAutoFocus,inputAutoFocus = _k === void 0 ? false : _k,_l = _a.submitAndMoveToNextQuestion,submitAndMoveToNextQuestion = _l === void 0 ? lodash.exports.noop : _l,_m = _a.onAnswerChange,onAnswerChange = _m === void 0 ? lodash.exports.noop : _m,_o = _a.shouldAutoProgress,shouldAutoProgress = _o === void 0 ? function () {return false;} : _o,onFileUpload = _a.onFileUpload;
|
|
48238
48239
|
var config = question === null || question === void 0 ? void 0 : question.questionConfig;
|
|
48239
|
-
var
|
|
48240
|
+
var _p = useICDClassificationList(question.id),icdClassificationOptions = _p.options,optionsLoading = _p.loading,onIcdClassificationSearchChange = _p.onIcdClassificationSearchChange;
|
|
48240
48241
|
switch (question.userQuestionType) {
|
|
48241
48242
|
case exports.UserQuestionType.YesNo:
|
|
48242
48243
|
return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, defaultValue: "", rules: { required: config === null || config === void 0 ? void 0 : config.mandatory }, render: function (_a) {
|
|
@@ -48330,7 +48331,10 @@ var Kr=[{
|
|
|
48330
48331
|
}, label: question.title, id: question.id, value: value, mandatory: config === null || config === void 0 ? void 0 : config.mandatory, min: getMinValueForNumberInput(config === null || config === void 0 ? void 0 : config.number), max: getMaxValueForNumberInput(config === null || config === void 0 ? void 0 : config.number) });
|
|
48331
48332
|
} });
|
|
48332
48333
|
case exports.UserQuestionType.ShortText:
|
|
48333
|
-
return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, defaultValue: "", rules: { required: config === null || config === void 0 ? void 0 : config.mandatory },
|
|
48334
|
+
return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, defaultValue: "", rules: __assign({ required: config === null || config === void 0 ? void 0 : config.mandatory }, ((_b = config === null || config === void 0 ? void 0 : config.input_validation) === null || _b === void 0 ? void 0 : _b.pattern) && {
|
|
48335
|
+
value: new RegExp((_c = config === null || config === void 0 ? void 0 : config.input_validation) === null || _c === void 0 ? void 0 : _c.pattern),
|
|
48336
|
+
message: (_d = config === null || config === void 0 ? void 0 : config.input_validation) === null || _d === void 0 ? void 0 : _d.helper_text }),
|
|
48337
|
+
render: function (_a) {
|
|
48334
48338
|
var _b = _a.field,onChange = _b.onChange,value = _b.value;
|
|
48335
48339
|
return jsxRuntime.exports.jsx(InputField, { autoFocus: inputAutoFocus, type: "text", onChange: function (e) {
|
|
48336
48340
|
onChange(e.target.value);
|
|
@@ -48338,10 +48342,10 @@ var Kr=[{
|
|
|
48338
48342
|
}, label: question.title, id: question.id, value: value, mandatory: config === null || config === void 0 ? void 0 : config.mandatory });
|
|
48339
48343
|
} });
|
|
48340
48344
|
case exports.UserQuestionType.Telephone:
|
|
48341
|
-
var availableCountries_1 = ((
|
|
48345
|
+
var availableCountries_1 = ((_f = (_e = config === null || config === void 0 ? void 0 : config.phone) === null || _e === void 0 ? void 0 : _e.available_countries) !== null && _f !== void 0 ? _f : []).
|
|
48342
48346
|
map(function (c) {return c === null || c === void 0 ? void 0 : c.toLocaleLowerCase();}).
|
|
48343
48347
|
filter(function (x) {return !lodash.exports.isNil(x);});
|
|
48344
|
-
var initialCountry_1 = (
|
|
48348
|
+
var initialCountry_1 = (_j = (_h = (_g = config === null || config === void 0 ? void 0 : config.phone) === null || _g === void 0 ? void 0 : _g.default_country) === null || _h === void 0 ? void 0 : _h.toLocaleLowerCase()) !== null && _j !== void 0 ? _j : 'gb';
|
|
48345
48349
|
return jsxRuntime.exports.jsx(Controller, { name: question.id, control: control, defaultValue: "", render: function (_a) {
|
|
48346
48350
|
var _b;
|
|
48347
48351
|
var _c = _a.field,onChange = _c.onChange,value = _c.value;
|
|
@@ -603,6 +603,7 @@ export declare enum ElementStatus {
|
|
|
603
603
|
}
|
|
604
604
|
export declare enum ElementType {
|
|
605
605
|
Action = "ACTION",
|
|
606
|
+
Agent = "AGENT",
|
|
606
607
|
Pathway = "PATHWAY",
|
|
607
608
|
Step = "STEP",
|
|
608
609
|
Track = "TRACK",
|
|
@@ -902,6 +903,25 @@ export declare type IdentityVerificationPayload = Payload & {
|
|
|
902
903
|
is_verified: Scalars['Boolean'];
|
|
903
904
|
success: Scalars['Boolean'];
|
|
904
905
|
};
|
|
906
|
+
export declare type InputValidationAllowed = {
|
|
907
|
+
__typename?: 'InputValidationAllowed';
|
|
908
|
+
letters?: Maybe<Scalars['Boolean']>;
|
|
909
|
+
numbers?: Maybe<Scalars['Boolean']>;
|
|
910
|
+
special?: Maybe<Scalars['Boolean']>;
|
|
911
|
+
whitespace?: Maybe<Scalars['Boolean']>;
|
|
912
|
+
};
|
|
913
|
+
export declare type InputValidationConfig = {
|
|
914
|
+
__typename?: 'InputValidationConfig';
|
|
915
|
+
helper_text?: Maybe<Scalars['String']>;
|
|
916
|
+
mode?: Maybe<Scalars['String']>;
|
|
917
|
+
pattern?: Maybe<Scalars['String']>;
|
|
918
|
+
simpleConfig?: Maybe<InputValidationSimpleConfig>;
|
|
919
|
+
};
|
|
920
|
+
export declare type InputValidationSimpleConfig = {
|
|
921
|
+
__typename?: 'InputValidationSimpleConfig';
|
|
922
|
+
allowed?: Maybe<InputValidationAllowed>;
|
|
923
|
+
exactLength?: Maybe<Scalars['Float']>;
|
|
924
|
+
};
|
|
905
925
|
export declare type MarkMessageAsReadInput = {
|
|
906
926
|
activity_id: Scalars['String'];
|
|
907
927
|
};
|
|
@@ -915,7 +935,7 @@ export declare type Message = {
|
|
|
915
935
|
__typename?: 'Message';
|
|
916
936
|
attachments?: Maybe<Array<MessageAttachment>>;
|
|
917
937
|
body: Scalars['String'];
|
|
918
|
-
format
|
|
938
|
+
format?: Maybe<MessageFormat>;
|
|
919
939
|
id: Scalars['ID'];
|
|
920
940
|
subject?: Maybe<Scalars['String']>;
|
|
921
941
|
};
|
|
@@ -1182,6 +1202,8 @@ export declare type Pathway = {
|
|
|
1182
1202
|
export declare type PathwayContext = {
|
|
1183
1203
|
__typename?: 'PathwayContext';
|
|
1184
1204
|
action_id?: Maybe<Scalars['String']>;
|
|
1205
|
+
agent_id?: Maybe<Scalars['String']>;
|
|
1206
|
+
agent_thread_id?: Maybe<Scalars['String']>;
|
|
1185
1207
|
instance_id: Scalars['String'];
|
|
1186
1208
|
pathway_id: Scalars['String'];
|
|
1187
1209
|
step_id?: Maybe<Scalars['String']>;
|
|
@@ -1636,6 +1658,7 @@ export declare type QuestionConfig = {
|
|
|
1636
1658
|
__typename?: 'QuestionConfig';
|
|
1637
1659
|
date?: Maybe<DateConfig>;
|
|
1638
1660
|
file_storage?: Maybe<FileStorageQuestionConfig>;
|
|
1661
|
+
input_validation?: Maybe<InputValidationConfig>;
|
|
1639
1662
|
mandatory: Scalars['Boolean'];
|
|
1640
1663
|
multiple_select?: Maybe<MultipleSelectConfig>;
|
|
1641
1664
|
number?: Maybe<NumberConfig>;
|