@awell-health/ui-library 0.1.93 → 0.1.95
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
|
@@ -16183,6 +16183,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
16183
16183
|
(function (ConditionOperator) {
|
|
16184
16184
|
ConditionOperator["Contains"] = "CONTAINS";
|
|
16185
16185
|
ConditionOperator["DoesNotContain"] = "DOES_NOT_CONTAIN";
|
|
16186
|
+
ConditionOperator["HasFileUploaded"] = "HAS_FILE_UPLOADED";
|
|
16187
|
+
ConditionOperator["HasNoFileUploaded"] = "HAS_NO_FILE_UPLOADED";
|
|
16186
16188
|
ConditionOperator["IsAnyOf"] = "IS_ANY_OF";
|
|
16187
16189
|
ConditionOperator["IsEmpty"] = "IS_EMPTY";
|
|
16188
16190
|
ConditionOperator["IsEqualTo"] = "IS_EQUAL_TO";
|
|
@@ -48053,7 +48055,7 @@ var Kr=[{
|
|
|
48053
48055
|
var classes$9 = {"file_input_field_container":"awell__FileInputField_file_input_field_container","error_message":"awell__FileInputField_error_message","file_upload_wrapper":"awell__FileInputField_file_upload_wrapper","file_list_wrapper":"awell__FileInputField_file_list_wrapper"};
|
|
48054
48056
|
|
|
48055
48057
|
var FileInputField = function (_a) {
|
|
48056
|
-
var id = _a.id,label = _a.label,accept = _a.accept,_b = _a.multiple,multiple = _b === void 0 ? true : _b,error = _a.error,onChange = _a.onChange,onError = _a.onError,_c = _a.className,className = _c === void 0 ? '' : _c,dataCy = _a.dataCy,onFileUpload = _a.onFileUpload,
|
|
48058
|
+
var id = _a.id,label = _a.label,accept = _a.accept,_b = _a.multiple,multiple = _b === void 0 ? true : _b,error = _a.error,onChange = _a.onChange,onError = _a.onError,_c = _a.className,className = _c === void 0 ? '' : _c,dataCy = _a.dataCy,onFileUpload = _a.onFileUpload,configSlug = _a.configSlug,value = _a.value;
|
|
48057
48059
|
var _d = React.useState(Array.isArray(value) ?
|
|
48058
48060
|
value === null || value === void 0 ? void 0 : value.map(function (attachment) {
|
|
48059
48061
|
var _a, _b, _c, _d;
|
|
@@ -48088,10 +48090,11 @@ var Kr=[{
|
|
|
48088
48090
|
switch (_a.label) {
|
|
48089
48091
|
case 0:
|
|
48090
48092
|
_a.trys.push([0, 2,, 3]);
|
|
48091
|
-
return [4, onFileUpload === null || onFileUpload === void 0 ? void 0 : onFileUpload(file,
|
|
48093
|
+
return [4, onFileUpload === null || onFileUpload === void 0 ? void 0 : onFileUpload(file, configSlug)];
|
|
48092
48094
|
case 1:
|
|
48093
48095
|
fileUrl = _a.sent();
|
|
48094
48096
|
return [2, {
|
|
48097
|
+
id: file.name,
|
|
48095
48098
|
name: file.name,
|
|
48096
48099
|
size: file.size,
|
|
48097
48100
|
type: file.type,
|
|
@@ -48102,6 +48105,7 @@ var Kr=[{
|
|
|
48102
48105
|
case 2:
|
|
48103
48106
|
error_1 = _a.sent();
|
|
48104
48107
|
return [2, {
|
|
48108
|
+
id: file.name,
|
|
48105
48109
|
name: file.name,
|
|
48106
48110
|
size: file.size,
|
|
48107
48111
|
type: file.type,
|
|
@@ -48125,17 +48129,20 @@ var Kr=[{
|
|
|
48125
48129
|
switch (_a.label) {
|
|
48126
48130
|
case 0:
|
|
48127
48131
|
fileList = Array.from(files).map(function (file) {return {
|
|
48132
|
+
id: file.name,
|
|
48128
48133
|
name: "".concat(file.name, " (uploading...)"),
|
|
48129
48134
|
size: file.size,
|
|
48130
48135
|
type: file.type,
|
|
48131
48136
|
progress: 0,
|
|
48132
48137
|
error: undefined };
|
|
48133
48138
|
});
|
|
48134
|
-
setSelectedFiles(fileList);
|
|
48139
|
+
setSelectedFiles(function (prev) {return __spreadArray(__spreadArray([], prev, true), fileList, true);});
|
|
48135
48140
|
return [4, uploadFilesToStorage(files)];
|
|
48136
48141
|
case 1:
|
|
48137
48142
|
fileListWithUrls = _a.sent();
|
|
48138
|
-
setSelectedFiles(
|
|
48143
|
+
setSelectedFiles(function (prev) {
|
|
48144
|
+
return prev.map(function (file) {return fileListWithUrls.find(function (f) {return f.id === file.id;}) || file;});
|
|
48145
|
+
});
|
|
48139
48146
|
return [2];}
|
|
48140
48147
|
|
|
48141
48148
|
});
|
|
@@ -48346,7 +48353,7 @@ var Kr=[{
|
|
|
48346
48353
|
onControllerChange(JSON.stringify(attachments));
|
|
48347
48354
|
}, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : [
|
|
48348
48355
|
'application/pdf'],
|
|
48349
|
-
|
|
48356
|
+
configSlug: (_d = config === null || config === void 0 ? void 0 : config.file_storage) === null || _d === void 0 ? void 0 : _d.file_storage_config_slug, onFileUpload: onFileUpload });
|
|
48350
48357
|
} });
|
|
48351
48358
|
case exports.UserQuestionType.Image:
|
|
48352
48359
|
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) {
|
|
@@ -48354,7 +48361,7 @@ var Kr=[{
|
|
|
48354
48361
|
var _e = _a.field,onControllerChange = _e.onChange,onBlur = _e.onBlur,value = _e.value;
|
|
48355
48362
|
return jsxRuntime.exports.jsx(FileInputField, { id: question.id, value: custom_json_parser(value), onChange: function (attachments) {
|
|
48356
48363
|
onControllerChange(JSON.stringify(attachments));
|
|
48357
|
-
}, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : ['image/*'],
|
|
48364
|
+
}, onBlur: onBlur, accept: (_c = (_b = config === null || config === void 0 ? void 0 : config.file_storage) === null || _b === void 0 ? void 0 : _b.accepted_file_types) !== null && _c !== void 0 ? _c : ['image/*'], configSlug: (_d = config === null || config === void 0 ? void 0 : config.file_storage) === null || _d === void 0 ? void 0 : _d.file_storage_config_slug, onFileUpload: onFileUpload });
|
|
48358
48365
|
} });
|
|
48359
48366
|
case exports.UserQuestionType.Description:
|
|
48360
48367
|
return jsxRuntime.exports.jsx(Description, { content: question.title });
|
|
@@ -11,8 +11,8 @@ interface Props {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
onBlur?: () => void;
|
|
13
13
|
dataCy?: string;
|
|
14
|
-
onFileUpload?: (file: File,
|
|
15
|
-
|
|
14
|
+
onFileUpload?: (file: File, configSlug?: string) => Promise<string | undefined>;
|
|
15
|
+
configSlug?: string;
|
|
16
16
|
value?: Array<Attachment>;
|
|
17
17
|
}
|
|
18
18
|
export declare const FileInputField: React.FC<Props>;
|
|
@@ -24,7 +24,7 @@ export interface QuestionDataProps {
|
|
|
24
24
|
submitAndMoveToNextQuestion?: () => void;
|
|
25
25
|
onAnswerChange?: () => void;
|
|
26
26
|
shouldAutoProgress?: (question: Question) => boolean;
|
|
27
|
-
onFileUpload?: (file: File,
|
|
27
|
+
onFileUpload?: (file: File, configSlug?: string) => Promise<string>;
|
|
28
28
|
}
|
|
29
29
|
export interface QuestionProps {
|
|
30
30
|
question: Question;
|
|
@@ -36,7 +36,7 @@ export interface QuestionProps {
|
|
|
36
36
|
submitAndMoveToNextQuestion?: () => void;
|
|
37
37
|
onAnswerChange?: () => void;
|
|
38
38
|
shouldAutoProgress?: (question: Question) => boolean;
|
|
39
|
-
onFileUpload?: (file: File,
|
|
39
|
+
onFileUpload?: (file: File, configSlug?: string) => Promise<string>;
|
|
40
40
|
}
|
|
41
41
|
export interface Attachment {
|
|
42
42
|
url?: string;
|
|
@@ -358,6 +358,22 @@ export declare type CancelScheduledTracksPayload = Payload & {
|
|
|
358
358
|
success: Scalars['Boolean'];
|
|
359
359
|
unscheduled_ids: Array<Scalars['String']>;
|
|
360
360
|
};
|
|
361
|
+
export declare type CareflowVersion = {
|
|
362
|
+
__typename?: 'CareflowVersion';
|
|
363
|
+
live?: Maybe<Scalars['Boolean']>;
|
|
364
|
+
release_date?: Maybe<Scalars['String']>;
|
|
365
|
+
release_id?: Maybe<Scalars['String']>;
|
|
366
|
+
version?: Maybe<Scalars['Float']>;
|
|
367
|
+
};
|
|
368
|
+
export declare type CareflowVersions = {
|
|
369
|
+
__typename?: 'CareflowVersions';
|
|
370
|
+
careflow_definition_id: Scalars['String'];
|
|
371
|
+
versions?: Maybe<Array<CareflowVersion>>;
|
|
372
|
+
};
|
|
373
|
+
export declare type CareflowVersionsPayload = {
|
|
374
|
+
__typename?: 'CareflowVersionsPayload';
|
|
375
|
+
careflowVersions: Array<CareflowVersions>;
|
|
376
|
+
};
|
|
361
377
|
export declare type Checklist = {
|
|
362
378
|
__typename?: 'Checklist';
|
|
363
379
|
items: Array<Scalars['String']>;
|
|
@@ -411,6 +427,8 @@ export declare enum ConditionOperandType {
|
|
|
411
427
|
export declare enum ConditionOperator {
|
|
412
428
|
Contains = "CONTAINS",
|
|
413
429
|
DoesNotContain = "DOES_NOT_CONTAIN",
|
|
430
|
+
HasFileUploaded = "HAS_FILE_UPLOADED",
|
|
431
|
+
HasNoFileUploaded = "HAS_NO_FILE_UPLOADED",
|
|
414
432
|
IsAnyOf = "IS_ANY_OF",
|
|
415
433
|
IsEmpty = "IS_EMPTY",
|
|
416
434
|
IsEqualTo = "IS_EQUAL_TO",
|
|
@@ -693,7 +711,7 @@ export declare type ExtensionDataPointInput = {
|
|
|
693
711
|
export declare type FileStorageQuestionConfig = {
|
|
694
712
|
__typename?: 'FileStorageQuestionConfig';
|
|
695
713
|
accepted_file_types?: Maybe<Array<Scalars['String']>>;
|
|
696
|
-
|
|
714
|
+
file_storage_config_slug?: Maybe<Scalars['String']>;
|
|
697
715
|
};
|
|
698
716
|
export declare type FileUploadGcsPayload = Payload & {
|
|
699
717
|
__typename?: 'FileUploadGCSPayload';
|
|
@@ -1373,6 +1391,7 @@ export declare type Query = {
|
|
|
1373
1391
|
forms: FormsPayload;
|
|
1374
1392
|
generateRetoolEmbedUrl: GenerateRetoolEmbedUrlPayload;
|
|
1375
1393
|
getOrchestrationFactsFromPrompt: OrchestrationFactsPromptPayload;
|
|
1394
|
+
getPublishedCareflowVersions: CareflowVersionsPayload;
|
|
1376
1395
|
getSignedUrl: FileUploadGcsPayload;
|
|
1377
1396
|
getStatusForPublishedPathwayDefinitions: PublishedPathwayDefinitionsPayload;
|
|
1378
1397
|
hostedPagesLink: HostedPagesLinkPayload;
|
|
@@ -1491,8 +1510,11 @@ export declare type QueryGetOrchestrationFactsFromPromptArgs = {
|
|
|
1491
1510
|
pathway_id: Scalars['String'];
|
|
1492
1511
|
prompt: Scalars['String'];
|
|
1493
1512
|
};
|
|
1513
|
+
export declare type QueryGetPublishedCareflowVersionsArgs = {
|
|
1514
|
+
careflow_definition_id?: InputMaybe<Scalars['String']>;
|
|
1515
|
+
};
|
|
1494
1516
|
export declare type QueryGetSignedUrlArgs = {
|
|
1495
|
-
|
|
1517
|
+
config_slug: Scalars['String'];
|
|
1496
1518
|
content_type: Scalars['String'];
|
|
1497
1519
|
expires_in?: InputMaybe<Scalars['Float']>;
|
|
1498
1520
|
file_name: Scalars['String'];
|
|
@@ -1511,6 +1533,7 @@ export declare type QueryMyActivitiesArgs = {
|
|
|
1511
1533
|
pagination?: InputMaybe<PaginationParams>;
|
|
1512
1534
|
pathway_id: Scalars['String'];
|
|
1513
1535
|
sorting?: InputMaybe<SortingParams>;
|
|
1536
|
+
track_id?: InputMaybe<Scalars['String']>;
|
|
1514
1537
|
};
|
|
1515
1538
|
export declare type QueryPathwayArgs = {
|
|
1516
1539
|
id: Scalars['String'];
|
|
@@ -1519,6 +1542,7 @@ export declare type QueryPathwayActivitiesArgs = {
|
|
|
1519
1542
|
pagination?: InputMaybe<PaginationParams>;
|
|
1520
1543
|
pathway_id: Scalars['String'];
|
|
1521
1544
|
sorting?: InputMaybe<SortingParams>;
|
|
1545
|
+
track_id?: InputMaybe<Scalars['String']>;
|
|
1522
1546
|
};
|
|
1523
1547
|
export declare type QueryPathwayDataPointDefinitionsArgs = {
|
|
1524
1548
|
filters?: InputMaybe<FilterPathwayDataPointDefinitionsParams>;
|
|
@@ -1535,6 +1559,7 @@ export declare type QueryPathwayDataPointsArgs = {
|
|
|
1535
1559
|
};
|
|
1536
1560
|
export declare type QueryPathwayElementsArgs = {
|
|
1537
1561
|
pathway_id: Scalars['String'];
|
|
1562
|
+
track_id?: InputMaybe<Scalars['String']>;
|
|
1538
1563
|
};
|
|
1539
1564
|
export declare type QueryPathwayFactsArgs = {
|
|
1540
1565
|
filters: PathwayFactsFilters;
|
|
@@ -1908,6 +1933,7 @@ export declare type SubActivity = {
|
|
|
1908
1933
|
error_category?: Maybe<Scalars['String']>;
|
|
1909
1934
|
id: Scalars['String'];
|
|
1910
1935
|
object?: Maybe<ActivityObject>;
|
|
1936
|
+
scheduled_date?: Maybe<Scalars['String']>;
|
|
1911
1937
|
subject: ActivitySubject;
|
|
1912
1938
|
text?: Maybe<TranslatedText>;
|
|
1913
1939
|
};
|