@awell-health/ui-library 0.1.97 → 0.1.99
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 +138 -151
- package/dist/types/atoms/fileInputField/SingleFileInputField.d.ts +21 -0
- package/dist/types/molecules/question/helpers/isAttachmentValid.d.ts +5 -0
- package/dist/types/types/generated/types-orchestration.d.ts +17 -14
- package/dist/types/utils/custom_json_parser.d.ts +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -16098,6 +16098,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
16098
16098
|
exports.ActivityObjectType = void 0;
|
|
16099
16099
|
(function (ActivityObjectType) {
|
|
16100
16100
|
ActivityObjectType["Action"] = "ACTION";
|
|
16101
|
+
ActivityObjectType["Agent"] = "AGENT";
|
|
16101
16102
|
ActivityObjectType["ApiCall"] = "API_CALL";
|
|
16102
16103
|
ActivityObjectType["Calculation"] = "CALCULATION";
|
|
16103
16104
|
ActivityObjectType["Checklist"] = "CHECKLIST";
|
|
@@ -16204,6 +16205,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
16204
16205
|
})(exports.ConditionOperator || (exports.ConditionOperator = {}));
|
|
16205
16206
|
exports.DataPointSourceType = void 0;
|
|
16206
16207
|
(function (DataPointSourceType) {
|
|
16208
|
+
DataPointSourceType["Agent"] = "AGENT";
|
|
16207
16209
|
DataPointSourceType["ApiCall"] = "API_CALL";
|
|
16208
16210
|
DataPointSourceType["ApiCallStatus"] = "API_CALL_STATUS";
|
|
16209
16211
|
DataPointSourceType["Calculation"] = "CALCULATION";
|
|
@@ -41218,6 +41220,40 @@ Check the top-level render call using <` + t + ">.");
|
|
|
41218
41220
|
return { options: options, loading: loading, error: error, onIcdClassificationSearchChange: onIcdClassificationSearchChange };
|
|
41219
41221
|
};
|
|
41220
41222
|
|
|
41223
|
+
var custom_json_parser = function (blob, defaultValue) {
|
|
41224
|
+
if (defaultValue === void 0) {defaultValue = 'invalid JSON';}
|
|
41225
|
+
try {
|
|
41226
|
+
if (typeof blob !== 'string') {
|
|
41227
|
+
throw new Error();
|
|
41228
|
+
}
|
|
41229
|
+
var parsed = JSON.parse(blob);
|
|
41230
|
+
if (typeof parsed === 'string') {
|
|
41231
|
+
return JSON.parse(parsed);
|
|
41232
|
+
}
|
|
41233
|
+
return parsed;
|
|
41234
|
+
}
|
|
41235
|
+
catch (error) {
|
|
41236
|
+
return defaultValue;
|
|
41237
|
+
}
|
|
41238
|
+
};
|
|
41239
|
+
|
|
41240
|
+
var areAttachmentsValid = function (_a) {
|
|
41241
|
+
var attachmentsValue = _a.attachmentsValue,required = _a.required,acceptedFileTypes = _a.acceptedFileTypes;
|
|
41242
|
+
var parseAttachments = function (val) {
|
|
41243
|
+
try {
|
|
41244
|
+
return JSON.parse(val);
|
|
41245
|
+
}
|
|
41246
|
+
catch (error) {
|
|
41247
|
+
return [];
|
|
41248
|
+
}
|
|
41249
|
+
};
|
|
41250
|
+
var attachments = parseAttachments(attachmentsValue);
|
|
41251
|
+
if (required) {
|
|
41252
|
+
return !lodash.exports.isNil(attachments) && attachments.length > 0;
|
|
41253
|
+
}
|
|
41254
|
+
return attachments.every(function (attachment) {var _a;return acceptedFileTypes.includes((_a = attachment.contentType) !== null && _a !== void 0 ? _a : '');});
|
|
41255
|
+
};
|
|
41256
|
+
|
|
41221
41257
|
var Tr={exports:{}},En={};
|
|
41222
41258
|
/**
|
|
41223
41259
|
* @license React
|
|
@@ -48061,187 +48097,138 @@ var Kr=[{
|
|
|
48061
48097
|
|
|
48062
48098
|
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","btn-square":"awell__FileInputField_btn-square"};
|
|
48063
48099
|
|
|
48064
|
-
var
|
|
48065
|
-
var
|
|
48066
|
-
var
|
|
48067
|
-
|
|
48068
|
-
|
|
48069
|
-
|
|
48070
|
-
|
|
48071
|
-
|
|
48072
|
-
|
|
48073
|
-
|
|
48074
|
-
|
|
48075
|
-
|
|
48076
|
-
|
|
48077
|
-
|
|
48078
|
-
[]),selectedFiles = _d[0],setSelectedFiles = _d[1];
|
|
48079
|
-
React.useEffect(function () {
|
|
48080
|
-
var attachments = selectedFiles.
|
|
48081
|
-
filter(function (file) {return file.url;}).
|
|
48082
|
-
map(function (file) {return {
|
|
48083
|
-
url: file.url,
|
|
48084
|
-
filename: file.name,
|
|
48085
|
-
contentType: file.type,
|
|
48086
|
-
size: file.size };
|
|
48087
|
-
});
|
|
48088
|
-
onChange(attachments);
|
|
48089
|
-
}, [selectedFiles]);
|
|
48100
|
+
var SingleFileInputField = function (_a) {
|
|
48101
|
+
var _b, _c, _d, _e, _f;
|
|
48102
|
+
var id = _a.id,label = _a.label,accept = _a.accept,error = _a.error,onChange = _a.onChange,onError = _a.onError,_g = _a.className,className = _g === void 0 ? '' : _g,dataCy = _a.dataCy,onFileUpload = _a.onFileUpload,configSlug = _a.configSlug,value = _a.value,mandatory = _a.mandatory,disabled = _a.disabled;
|
|
48103
|
+
var _h = React.useState(!lodash.exports.isNil(value) && !lodash.exports.isEmpty(value) ?
|
|
48104
|
+
{
|
|
48105
|
+
id: (_b = value.filename) !== null && _b !== void 0 ? _b : 'untitled',
|
|
48106
|
+
name: (_c = value.filename) !== null && _c !== void 0 ? _c : 'untitled',
|
|
48107
|
+
size: (_d = value.size) !== null && _d !== void 0 ? _d : 0,
|
|
48108
|
+
type: (_e = value.contentType) !== null && _e !== void 0 ? _e : '',
|
|
48109
|
+
url: (_f = value.url) !== null && _f !== void 0 ? _f : '',
|
|
48110
|
+
progress: 100,
|
|
48111
|
+
error: undefined } :
|
|
48112
|
+
|
|
48113
|
+
undefined),selectedFile = _h[0],setSelectedFile = _h[1];
|
|
48090
48114
|
var convertErrorMessage = function (error) {
|
|
48091
48115
|
if (error === 'Failed to fetch') {
|
|
48092
48116
|
return 'File upload failed. Please remove this file and try again.';
|
|
48093
48117
|
}
|
|
48094
48118
|
return error;
|
|
48095
48119
|
};
|
|
48096
|
-
var
|
|
48097
|
-
var
|
|
48098
|
-
return __generator(this, function (
|
|
48099
|
-
switch (
|
|
48120
|
+
var uploadFileToStorage = function (file) {return __awaiter(void 0, void 0, void 0, function () {
|
|
48121
|
+
var uploadingFile, fileUrl, completedFile, finalFile, attachment, error_1, failedFile;
|
|
48122
|
+
return __generator(this, function (_a) {
|
|
48123
|
+
switch (_a.label) {
|
|
48100
48124
|
case 0:
|
|
48101
|
-
|
|
48102
|
-
|
|
48103
|
-
|
|
48104
|
-
|
|
48105
|
-
|
|
48106
|
-
|
|
48107
|
-
|
|
48108
|
-
|
|
48109
|
-
|
|
48110
|
-
|
|
48111
|
-
|
|
48112
|
-
type: file.type,
|
|
48113
|
-
progress: 10,
|
|
48114
|
-
error: undefined };
|
|
48115
|
-
|
|
48116
|
-
setSelectedFiles(function (prev) {return __spreadArray(__spreadArray([], prev.filter(function (f) {return f.id !== file.name;}), true), [
|
|
48117
|
-
uploadingFile_1],
|
|
48118
|
-
false);});
|
|
48119
|
-
return [4, onFileUpload === null || onFileUpload === void 0 ? void 0 : onFileUpload(file, configSlug)];
|
|
48120
|
-
case 1:
|
|
48121
|
-
fileUrl = _c.sent();
|
|
48122
|
-
completedFile_1 = {
|
|
48123
|
-
id: file.name,
|
|
48124
|
-
name: file.name,
|
|
48125
|
-
size: file.size,
|
|
48126
|
-
type: file.type,
|
|
48127
|
-
progress: 99,
|
|
48128
|
-
error: undefined,
|
|
48129
|
-
url: fileUrl };
|
|
48130
|
-
|
|
48131
|
-
setSelectedFiles(function (prev) {return __spreadArray(__spreadArray([], prev.filter(function (f) {return f.id !== file.name;}), true), [
|
|
48132
|
-
completedFile_1],
|
|
48133
|
-
false);});
|
|
48134
|
-
return [4, new Promise(function (resolve) {return setTimeout(resolve, 100);})];
|
|
48135
|
-
case 2:
|
|
48136
|
-
_c.sent();
|
|
48137
|
-
setSelectedFiles(function (prev) {return __spreadArray(__spreadArray([], prev.filter(function (f) {return f.id !== file.name;}), true), [
|
|
48138
|
-
__assign(__assign({}, completedFile_1), { progress: 100 })],
|
|
48139
|
-
false);});
|
|
48140
|
-
fileListWithUrls.push(completedFile_1);
|
|
48141
|
-
return [3, 4];
|
|
48142
|
-
case 3:
|
|
48143
|
-
error_1 = _c.sent();
|
|
48144
|
-
failedFile_1 = {
|
|
48145
|
-
id: file.name,
|
|
48146
|
-
name: file.name,
|
|
48147
|
-
size: file.size,
|
|
48148
|
-
type: file.type,
|
|
48149
|
-
progress: 0,
|
|
48150
|
-
error: error_1 instanceof Error ?
|
|
48151
|
-
convertErrorMessage(error_1.message) :
|
|
48152
|
-
'File upload failed',
|
|
48153
|
-
url: undefined };
|
|
48154
|
-
|
|
48155
|
-
setSelectedFiles(function (prev) {return __spreadArray(__spreadArray([], prev.filter(function (f) {return f.id !== file.name;}), true), [
|
|
48156
|
-
failedFile_1],
|
|
48157
|
-
false);});
|
|
48158
|
-
fileListWithUrls.push(failedFile_1);
|
|
48159
|
-
return [3, 4];
|
|
48160
|
-
case 4:return [2];}
|
|
48161
|
-
|
|
48162
|
-
});
|
|
48163
|
-
};
|
|
48164
|
-
_i = 0, _a = Array.from(files);
|
|
48165
|
-
_b.label = 1;
|
|
48125
|
+
_a.trys.push([0, 3,, 4]);
|
|
48126
|
+
uploadingFile = {
|
|
48127
|
+
id: file.name,
|
|
48128
|
+
name: file.name,
|
|
48129
|
+
size: file.size,
|
|
48130
|
+
type: file.type,
|
|
48131
|
+
progress: 10,
|
|
48132
|
+
error: undefined };
|
|
48133
|
+
|
|
48134
|
+
setSelectedFile(uploadingFile);
|
|
48135
|
+
return [4, onFileUpload === null || onFileUpload === void 0 ? void 0 : onFileUpload(file, configSlug)];
|
|
48166
48136
|
case 1:
|
|
48167
|
-
|
|
48168
|
-
|
|
48169
|
-
|
|
48137
|
+
fileUrl = _a.sent();
|
|
48138
|
+
completedFile = __assign(__assign({}, uploadingFile), { progress: 99, error: undefined, url: fileUrl });
|
|
48139
|
+
setSelectedFile(completedFile);
|
|
48140
|
+
return [4, new Promise(function (resolve) {return setTimeout(resolve, 100);})];
|
|
48170
48141
|
case 2:
|
|
48171
|
-
|
|
48172
|
-
|
|
48142
|
+
_a.sent();
|
|
48143
|
+
finalFile = __assign(__assign({}, completedFile), { progress: 100 });
|
|
48144
|
+
setSelectedFile(finalFile);
|
|
48145
|
+
if (finalFile.url) {
|
|
48146
|
+
attachment = {
|
|
48147
|
+
url: finalFile.url,
|
|
48148
|
+
filename: finalFile.name,
|
|
48149
|
+
contentType: finalFile.type,
|
|
48150
|
+
size: finalFile.size };
|
|
48151
|
+
|
|
48152
|
+
onChange(attachment);
|
|
48153
|
+
}
|
|
48154
|
+
return [2, finalFile];
|
|
48173
48155
|
case 3:
|
|
48174
|
-
|
|
48175
|
-
|
|
48176
|
-
|
|
48156
|
+
error_1 = _a.sent();
|
|
48157
|
+
failedFile = {
|
|
48158
|
+
id: file.name,
|
|
48159
|
+
name: file.name,
|
|
48160
|
+
size: file.size,
|
|
48161
|
+
type: file.type,
|
|
48162
|
+
progress: 0,
|
|
48163
|
+
error: error_1 instanceof Error ?
|
|
48164
|
+
convertErrorMessage(error_1.message) :
|
|
48165
|
+
'File upload failed',
|
|
48166
|
+
url: undefined };
|
|
48167
|
+
|
|
48168
|
+
setSelectedFile(failedFile);
|
|
48169
|
+
return [2, failedFile];
|
|
48170
|
+
case 4:return [2];}
|
|
48177
48171
|
|
|
48178
48172
|
});
|
|
48179
48173
|
});};
|
|
48180
48174
|
var handleFilesChange = function (files) {return __awaiter(void 0, void 0, void 0, function () {
|
|
48181
|
-
var
|
|
48175
|
+
var file, pendingFile;
|
|
48182
48176
|
return __generator(this, function (_a) {
|
|
48183
48177
|
switch (_a.label) {
|
|
48184
48178
|
case 0:
|
|
48185
|
-
|
|
48186
|
-
|
|
48187
|
-
|
|
48188
|
-
|
|
48189
|
-
|
|
48190
|
-
|
|
48191
|
-
|
|
48192
|
-
|
|
48193
|
-
|
|
48194
|
-
|
|
48179
|
+
file = files[0];
|
|
48180
|
+
if (!file) {
|
|
48181
|
+
onChange(undefined);
|
|
48182
|
+
setSelectedFile(undefined);
|
|
48183
|
+
return [2];
|
|
48184
|
+
}
|
|
48185
|
+
pendingFile = {
|
|
48186
|
+
id: file.name,
|
|
48187
|
+
name: file.name,
|
|
48188
|
+
size: file.size,
|
|
48189
|
+
type: file.type,
|
|
48190
|
+
progress: 1,
|
|
48191
|
+
error: undefined };
|
|
48192
|
+
|
|
48193
|
+
setSelectedFile(pendingFile);
|
|
48194
|
+
return [4, uploadFileToStorage(file)];
|
|
48195
48195
|
case 1:
|
|
48196
48196
|
_a.sent();
|
|
48197
48197
|
return [2];}
|
|
48198
48198
|
|
|
48199
48199
|
});
|
|
48200
48200
|
});};
|
|
48201
|
-
var handleRemoveFile = function (
|
|
48202
|
-
|
|
48201
|
+
var handleRemoveFile = function () {
|
|
48202
|
+
setSelectedFile(undefined);
|
|
48203
|
+
onChange(undefined);
|
|
48203
48204
|
};
|
|
48204
|
-
|
|
48205
|
-
|
|
48206
|
-
return acc + ((_a = file.progress) !== null && _a !== void 0 ? _a : 0);
|
|
48207
|
-
}, 0) / selectedFiles.length;
|
|
48208
|
-
var hideGeneralProgress = selectedFiles.length === 0 ||
|
|
48209
|
-
selectedFiles.every(function (file) {return file.progress === 100;}) ||
|
|
48210
|
-
generalProgress === 0;
|
|
48211
|
-
return jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$9.file_input_field_container, " ").concat(className), "data-cy": dataCy }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), error && jsxRuntime.exports.jsx("div", __assign({ className: classes$9.error_message }, { children: error })), jsxRuntime.exports.jsx("div", __assign({ className: classes$9.file_upload_wrapper }, { children: jsxRuntime.exports.jsx(dg, { onChange: handleFilesChange, onError: onError, isMultiple: multiple, accept: accept, error: error }) })), selectedFiles.length > 0 && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$9.file_list_wrapper, " ").concat(classes$9.custom_file_list_container) }, { children: jsxRuntime.exports.jsx(ug, { files: selectedFiles, onDelete: handleRemoveFile, generalProgress: hideGeneralProgress ? undefined : generalProgress }) }))] }), id);
|
|
48212
|
-
};
|
|
48213
|
-
|
|
48214
|
-
var custom_json_parser = function (blob) {
|
|
48215
|
-
try {
|
|
48216
|
-
if (typeof blob !== 'string') {
|
|
48217
|
-
throw new Error();
|
|
48218
|
-
}
|
|
48219
|
-
var parsed = JSON.parse(blob);
|
|
48220
|
-
if (typeof parsed === 'string') {
|
|
48221
|
-
return JSON.parse(parsed);
|
|
48222
|
-
}
|
|
48223
|
-
return parsed;
|
|
48224
|
-
}
|
|
48225
|
-
catch (error) {
|
|
48226
|
-
return 'invalid JSON';
|
|
48205
|
+
if (value && disabled === true) {
|
|
48206
|
+
return jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$9.file_input_field_container, " ").concat(className), "data-cy": dataCy }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), !value.url ? jsxRuntime.exports.jsx("div", { children: "No file uploaded" }) : jsxRuntime.exports.jsxs("div", __assign({ className: classes$9.read_only_file }, { children: [value.filename, " (", value.contentType, ")"] }))] }), id);
|
|
48227
48207
|
}
|
|
48208
|
+
return jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$9.file_input_field_container, " ").concat(className), "data-cy": dataCy }, { children: [label && jsxRuntime.exports.jsx(QuestionLabel, { htmlFor: id, label: label, mandatory: mandatory }), error && jsxRuntime.exports.jsx("div", __assign({ className: classes$9.error_message }, { children: error })), jsxRuntime.exports.jsx("div", __assign({ className: classes$9.file_upload_wrapper }, { children: jsxRuntime.exports.jsx(dg, { onChange: handleFilesChange, onError: onError, isMultiple: false, accept: accept, error: error }) })), selectedFile && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$9.file_list_wrapper, " ").concat(classes$9.custom_file_list_container) }, { children: jsxRuntime.exports.jsx(ug, { files: [selectedFile], onDelete: function () {return handleRemoveFile();}, generalProgress: selectedFile.progress !== undefined && selectedFile.progress < 100 ?
|
|
48209
|
+
selectedFile.progress :
|
|
48210
|
+
undefined }) }))] }), id);
|
|
48228
48211
|
};
|
|
48229
48212
|
|
|
48230
|
-
var
|
|
48213
|
+
var isAttachmentValid = function (_a) {
|
|
48231
48214
|
var attachmentsValue = _a.attachmentsValue,required = _a.required,acceptedFileTypes = _a.acceptedFileTypes;
|
|
48232
|
-
var
|
|
48215
|
+
var parseAttachment = function (val) {
|
|
48233
48216
|
try {
|
|
48234
|
-
|
|
48217
|
+
var parsed = JSON.parse(val);
|
|
48218
|
+
return parsed;
|
|
48235
48219
|
}
|
|
48236
48220
|
catch (error) {
|
|
48237
|
-
return
|
|
48221
|
+
return null;
|
|
48238
48222
|
}
|
|
48239
48223
|
};
|
|
48240
|
-
var
|
|
48224
|
+
var attachment = parseAttachment(attachmentsValue);
|
|
48241
48225
|
if (required) {
|
|
48242
|
-
return !lodash.exports.isNil(
|
|
48226
|
+
return !lodash.exports.isNil(attachment) && !lodash.exports.isNil(attachment.url);
|
|
48243
48227
|
}
|
|
48244
|
-
|
|
48228
|
+
if (lodash.exports.isNil(attachment) || lodash.exports.isNil(attachment.contentType)) {
|
|
48229
|
+
return !required;
|
|
48230
|
+
}
|
|
48231
|
+
return acceptedFileTypes.includes(attachment.contentType);
|
|
48245
48232
|
};
|
|
48246
48233
|
|
|
48247
48234
|
var AUTO_PROGRESS_DELAY = 850;
|
|
@@ -48425,7 +48412,7 @@ var Kr=[{
|
|
|
48425
48412
|
required: config === null || config === void 0 ? void 0 : config.mandatory,
|
|
48426
48413
|
validate: function (value) {
|
|
48427
48414
|
var _a, _b, _c;
|
|
48428
|
-
return
|
|
48415
|
+
return isAttachmentValid({
|
|
48429
48416
|
attachmentsValue: value,
|
|
48430
48417
|
acceptedFileTypes: (_b = (_a = config === null || config === void 0 ? void 0 : config.file_storage) === null || _a === void 0 ? void 0 : _a.accepted_file_types) !== null && _b !== void 0 ? _b : [],
|
|
48431
48418
|
required: (_c = config === null || config === void 0 ? void 0 : config.mandatory) !== null && _c !== void 0 ? _c : false });
|
|
@@ -48434,8 +48421,8 @@ var Kr=[{
|
|
|
48434
48421
|
render: function (_a) {
|
|
48435
48422
|
var _b, _c, _d;
|
|
48436
48423
|
var _e = _a.field,onControllerChange = _e.onChange,onBlur = _e.onBlur,value = _e.value;
|
|
48437
|
-
return jsxRuntime.exports.jsx(
|
|
48438
|
-
onControllerChange(JSON.stringify(
|
|
48424
|
+
return jsxRuntime.exports.jsx(SingleFileInputField, { id: question.id, value: custom_json_parser(value, ''), onChange: function (attachment) {
|
|
48425
|
+
onControllerChange(JSON.stringify(attachment));
|
|
48439
48426
|
onAnswerChange();
|
|
48440
48427
|
}, 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 : [
|
|
48441
48428
|
'application/pdf'],
|
|
@@ -48455,8 +48442,8 @@ var Kr=[{
|
|
|
48455
48442
|
render: function (_a) {
|
|
48456
48443
|
var _b, _c, _d;
|
|
48457
48444
|
var _e = _a.field,onControllerChange = _e.onChange,onBlur = _e.onBlur,value = _e.value;
|
|
48458
|
-
return jsxRuntime.exports.jsx(
|
|
48459
|
-
onControllerChange(JSON.stringify(
|
|
48445
|
+
return jsxRuntime.exports.jsx(SingleFileInputField, { id: question.id, value: custom_json_parser(value, ''), onChange: function (attachment) {
|
|
48446
|
+
onControllerChange(JSON.stringify(attachment));
|
|
48460
48447
|
onAnswerChange();
|
|
48461
48448
|
}, 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, label: question.title, mandatory: config === null || config === void 0 ? void 0 : config.mandatory });
|
|
48462
48449
|
} });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Attachment } from '../../molecules/question/types';
|
|
3
|
+
import '@awell-health/design-system/style.css';
|
|
4
|
+
interface Props {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
accept?: Array<string>;
|
|
8
|
+
error?: string;
|
|
9
|
+
onChange: (attachment: Attachment | undefined) => void;
|
|
10
|
+
onError?: (error: string) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
onBlur?: () => void;
|
|
13
|
+
dataCy?: string;
|
|
14
|
+
onFileUpload?: (file: File, configSlug?: string) => Promise<string | undefined>;
|
|
15
|
+
configSlug?: string;
|
|
16
|
+
value?: Attachment | null;
|
|
17
|
+
mandatory?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const SingleFileInputField: React.FC<Props>;
|
|
21
|
+
export {};
|
|
@@ -124,6 +124,7 @@ export declare type ActivityObject = {
|
|
|
124
124
|
};
|
|
125
125
|
export declare enum ActivityObjectType {
|
|
126
126
|
Action = "ACTION",
|
|
127
|
+
Agent = "AGENT",
|
|
127
128
|
ApiCall = "API_CALL",
|
|
128
129
|
Calculation = "CALCULATION",
|
|
129
130
|
Checklist = "CHECKLIST",
|
|
@@ -467,19 +468,6 @@ export declare type CreatePatientPayload = Payload & {
|
|
|
467
468
|
patient?: Maybe<User>;
|
|
468
469
|
success: Scalars['Boolean'];
|
|
469
470
|
};
|
|
470
|
-
export declare type CurrentUser = {
|
|
471
|
-
__typename?: 'CurrentUser';
|
|
472
|
-
id: Scalars['ID'];
|
|
473
|
-
profile?: Maybe<UserProfile>;
|
|
474
|
-
tenant: Tenant;
|
|
475
|
-
tenant_id: Scalars['String'];
|
|
476
|
-
};
|
|
477
|
-
export declare type CurrentUserPayload = Payload & {
|
|
478
|
-
__typename?: 'CurrentUserPayload';
|
|
479
|
-
code: Scalars['String'];
|
|
480
|
-
success: Scalars['Boolean'];
|
|
481
|
-
user: CurrentUser;
|
|
482
|
-
};
|
|
483
471
|
export declare type DataPoint = {
|
|
484
472
|
__typename?: 'DataPoint';
|
|
485
473
|
activity_id?: Maybe<Scalars['String']>;
|
|
@@ -529,6 +517,7 @@ export declare type DataPointPossibleValue = {
|
|
|
529
517
|
value: Scalars['String'];
|
|
530
518
|
};
|
|
531
519
|
export declare enum DataPointSourceType {
|
|
520
|
+
Agent = "AGENT",
|
|
532
521
|
ApiCall = "API_CALL",
|
|
533
522
|
ApiCallStatus = "API_CALL_STATUS",
|
|
534
523
|
Calculation = "CALCULATION",
|
|
@@ -663,6 +652,10 @@ export declare type ExclusiveOptionConfig = {
|
|
|
663
652
|
enabled?: Maybe<Scalars['Boolean']>;
|
|
664
653
|
option_id?: Maybe<Scalars['String']>;
|
|
665
654
|
};
|
|
655
|
+
export declare type ExpireTimerInput = {
|
|
656
|
+
activity_id: Scalars['String'];
|
|
657
|
+
user_name: Scalars['String'];
|
|
658
|
+
};
|
|
666
659
|
export declare type ExtensionActionField = {
|
|
667
660
|
__typename?: 'ExtensionActionField';
|
|
668
661
|
id: Scalars['ID'];
|
|
@@ -963,6 +956,7 @@ export declare type Mutation = {
|
|
|
963
956
|
deletePathway: EmptyPayload;
|
|
964
957
|
deletePatient: EmptyPayload;
|
|
965
958
|
evaluateFormRules: EvaluateFormRulesPayload;
|
|
959
|
+
expireTimer: EmptyPayload;
|
|
966
960
|
markMessageAsRead: MarkMessageAsReadPayload;
|
|
967
961
|
requestPatientDemographics: PatientDemographicsPayload;
|
|
968
962
|
retryActivity: EmptyPayload;
|
|
@@ -1018,6 +1012,9 @@ export declare type MutationDeletePatientArgs = {
|
|
|
1018
1012
|
export declare type MutationEvaluateFormRulesArgs = {
|
|
1019
1013
|
input: EvaluateFormRulesInput;
|
|
1020
1014
|
};
|
|
1015
|
+
export declare type MutationExpireTimerArgs = {
|
|
1016
|
+
input: ExpireTimerInput;
|
|
1017
|
+
};
|
|
1021
1018
|
export declare type MutationMarkMessageAsReadArgs = {
|
|
1022
1019
|
input: MarkMessageAsReadInput;
|
|
1023
1020
|
};
|
|
@@ -1422,11 +1419,11 @@ export declare type Query = {
|
|
|
1422
1419
|
stakeholdersByDefinitionIds: StakeholdersPayload;
|
|
1423
1420
|
stakeholdersByPathwayDefinitionIds: StakeholdersPayload;
|
|
1424
1421
|
stakeholdersByReleaseIds: StakeholdersPayload;
|
|
1422
|
+
tenant: TenantPayload;
|
|
1425
1423
|
webhookCall: WebhookCallPayload;
|
|
1426
1424
|
webhookCalls: WebhookCallsPayload;
|
|
1427
1425
|
webhookCallsForPathwayDefinition: WebhookCallsPayload;
|
|
1428
1426
|
webhookCallsForTenant: WebhookCallsPayload;
|
|
1429
|
-
whoami: CurrentUserPayload;
|
|
1430
1427
|
};
|
|
1431
1428
|
export declare type QueryActivitiesArgs = {
|
|
1432
1429
|
filters?: InputMaybe<FilterActivitiesParams>;
|
|
@@ -2041,6 +2038,12 @@ export declare type Tenant = {
|
|
|
2041
2038
|
logo_path: Scalars['String'];
|
|
2042
2039
|
name: Scalars['String'];
|
|
2043
2040
|
};
|
|
2041
|
+
export declare type TenantPayload = Payload & {
|
|
2042
|
+
__typename?: 'TenantPayload';
|
|
2043
|
+
code: Scalars['String'];
|
|
2044
|
+
success: Scalars['Boolean'];
|
|
2045
|
+
tenant: Tenant;
|
|
2046
|
+
};
|
|
2044
2047
|
export declare type TextFilter = {
|
|
2045
2048
|
contains?: InputMaybe<Scalars['String']>;
|
|
2046
2049
|
eq?: InputMaybe<Scalars['String']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const custom_json_parser: (blob: string) => any;
|
|
1
|
+
export declare const custom_json_parser: (blob: string, defaultValue?: any) => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awell-health/ui-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.99",
|
|
4
4
|
"description": "UI components to integrate with Awell Health",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -194,5 +194,6 @@
|
|
|
194
194
|
"last 1 firefox version",
|
|
195
195
|
"last 1 safari version"
|
|
196
196
|
]
|
|
197
|
-
}
|
|
197
|
+
},
|
|
198
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
198
199
|
}
|