@genesislcap/pbc-documents-ui 0.0.32 → 14.338.0
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/dts/components/document-upload/document-upload.d.ts +79 -41
- package/dist/dts/components/document-upload/document-upload.d.ts.map +1 -1
- package/dist/dts/components/document-upload/document-upload.template.d.ts.map +1 -1
- package/dist/dts/components/document-upload/document-upload.types.d.ts +0 -1
- package/dist/dts/components/document-upload/document-upload.types.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +81 -41
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/types/main.types.d.ts +11 -0
- package/dist/dts/types/main.types.d.ts.map +1 -1
- package/dist/esm/components/document-upload/document-upload.js +22 -17
- package/dist/esm/components/document-upload/document-upload.js.map +1 -1
- package/dist/esm/components/document-upload/document-upload.template.js +2 -5
- package/dist/esm/components/document-upload/document-upload.template.js.map +1 -1
- package/dist/esm/components/document-upload/document-upload.types.js +0 -1
- package/dist/esm/components/document-upload/document-upload.types.js.map +1 -1
- package/dist/esm/components/template-asset-link/template-asset-link.js.map +1 -1
- package/dist/esm/components/utils/column-config.js.map +1 -1
- package/dist/esm/main/main.js +32 -16
- package/dist/esm/main/main.js.map +1 -1
- package/dist/esm/main/main.template.js +6 -6
- package/dist/esm/main/main.template.js.map +1 -1
- package/dist/esm/types/main.types.js +9 -0
- package/dist/esm/types/main.types.js.map +1 -1
- package/package.json +28 -29
- package/src/components/document-upload/document-upload.styles.ts +183 -0
- package/src/components/document-upload/document-upload.template.ts +122 -0
- package/src/components/document-upload/document-upload.ts +171 -0
- package/src/components/document-upload/document-upload.types.ts +6 -0
- package/src/components/rapid-components.ts +70 -0
- package/src/components/template-asset-link/template-asset-link.styles.ts +42 -0
- package/src/components/template-asset-link/template-asset-link.template.ts +41 -0
- package/src/components/template-asset-link/template-asset-link.ts +101 -0
- package/src/components/utils/action-cell-renderer.ts +58 -0
- package/src/components/utils/column-config.ts +187 -0
- package/src/components/utils/icons.ts +149 -0
- package/src/components/zero-components.ts +57 -0
- package/src/config/config.ts +49 -0
- package/src/config/configure.ts +68 -0
- package/src/config/index.ts +2 -0
- package/src/config/templates.ts +58 -0
- package/src/globals.d.ts +7 -0
- package/src/index.federated.ts +1 -0
- package/src/index.ts +3 -0
- package/src/main/index.ts +4 -0
- package/src/main/main.styles.ts +188 -0
- package/src/main/main.template.ts +93 -0
- package/src/main/main.ts +521 -0
- package/src/sandbox.ts +42 -0
- package/src/services/document.service.ts +131 -0
- package/src/tags/index.ts +1 -0
- package/src/tags/tags.ts +79 -0
- package/src/types/index.ts +2 -0
- package/src/types/main.types.ts +100 -0
- package/src/types/utils.types.ts +7 -0
- package/src/typings.d.ts +1 -0
- package/src/utils/formatting.ts +55 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/logger.ts +3 -0
- package/src/utils/misc.ts +11 -0
- package/src/utils/notifications.ts +6 -0
- package/src/utils/styles.ts +28 -0
- package/tsconfig.json +29 -0
- package/index.html +0 -29
- package/sonar-project.properties +0 -5
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Auth, Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
import { FileMetaType } from '../types';
|
|
4
|
+
import { logger, showNotificationToast } from '../utils';
|
|
5
|
+
|
|
6
|
+
export type UploadParams = {
|
|
7
|
+
file: File;
|
|
8
|
+
path: string;
|
|
9
|
+
fileMetaType: FileMetaType;
|
|
10
|
+
};
|
|
11
|
+
export type ReplaceParams = {
|
|
12
|
+
file: File;
|
|
13
|
+
fileStorageId: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export interface IDocumentService {
|
|
17
|
+
uploadDocument(params: UploadParams): Promise<Response>;
|
|
18
|
+
replaceDocument(params: ReplaceParams): Promise<Response>;
|
|
19
|
+
downloadDocument(documentId: string);
|
|
20
|
+
deleteDocument(documentId: string);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class DocumentServiceImpl implements IDocumentService {
|
|
24
|
+
constructor(
|
|
25
|
+
@Connect private connect: Connect,
|
|
26
|
+
@Auth private auth: Auth,
|
|
27
|
+
) {}
|
|
28
|
+
|
|
29
|
+
async uploadDocument({ file, path, fileMetaType }: UploadParams) {
|
|
30
|
+
if (!file) {
|
|
31
|
+
logger.error('No file provided.');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const headers = new Headers();
|
|
36
|
+
if (this.auth.loggedUserResult) {
|
|
37
|
+
headers.append('SESSION_AUTH_TOKEN', this.auth.loggedUserResult.authToken);
|
|
38
|
+
}
|
|
39
|
+
const formData = new FormData();
|
|
40
|
+
formData.append(file.name, file);
|
|
41
|
+
formData.append('SUB_DIR', path);
|
|
42
|
+
formData.append('FILE_TYPE', fileMetaType.toString());
|
|
43
|
+
|
|
44
|
+
return fetch('gwf/file-server/upload/', {
|
|
45
|
+
method: 'POST',
|
|
46
|
+
body: formData,
|
|
47
|
+
headers: headers,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async replaceDocument({ file, fileStorageId }: ReplaceParams): Promise<any> {
|
|
51
|
+
if (!file) {
|
|
52
|
+
logger.error('No file provided.');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const headers = new Headers();
|
|
57
|
+
if (this.auth.loggedUserResult) {
|
|
58
|
+
headers.append('SESSION_AUTH_TOKEN', this.auth.loggedUserResult.authToken);
|
|
59
|
+
}
|
|
60
|
+
const formData = new FormData();
|
|
61
|
+
formData.append(file.name, file);
|
|
62
|
+
formData.append('FILE_STORAGE_ID', fileStorageId);
|
|
63
|
+
|
|
64
|
+
return fetch('gwf/file-server/replace/', {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
body: formData,
|
|
67
|
+
headers: headers,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async deleteDocument(documentId: string) {
|
|
72
|
+
try {
|
|
73
|
+
const deleteResponse = await this.connect.commitEvent('EVENT_FILE_STORAGE_DELETE', {
|
|
74
|
+
DETAILS: {
|
|
75
|
+
FILE_STORAGE_ID: documentId,
|
|
76
|
+
},
|
|
77
|
+
IGNORE_WARNINGS: true,
|
|
78
|
+
VALIDATE: false,
|
|
79
|
+
});
|
|
80
|
+
if (deleteResponse.MESSAGE_TYPE === 'EVENT_ACK') {
|
|
81
|
+
showNotificationToast({
|
|
82
|
+
title: 'Delete Document',
|
|
83
|
+
body: `document was deleted successfully`,
|
|
84
|
+
toast: { type: 'success' as any },
|
|
85
|
+
});
|
|
86
|
+
} else {
|
|
87
|
+
const error = deleteResponse?.ERROR?.length ? deleteResponse.ERROR[0].TEXT : '';
|
|
88
|
+
showNotificationToast({
|
|
89
|
+
title: 'Delete Document',
|
|
90
|
+
body: `document was not deleted due to following error "${error}"`,
|
|
91
|
+
toast: { type: 'critical' as any },
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
} catch (err) {
|
|
95
|
+
logger.error(err);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
downloadDocument(documentId: string) {
|
|
100
|
+
const headers = new Headers();
|
|
101
|
+
headers.append('SESSION_AUTH_TOKEN', sessionStorage.getItem('authToken'));
|
|
102
|
+
|
|
103
|
+
let filename = '';
|
|
104
|
+
fetch(`gwf/file-server/download?fileStorageId=${documentId}`, {
|
|
105
|
+
method: 'GET',
|
|
106
|
+
headers: headers,
|
|
107
|
+
})
|
|
108
|
+
.then((response) => {
|
|
109
|
+
const contentDispositionHeader = response.headers.get('Content-disposition');
|
|
110
|
+
filename = contentDispositionHeader.split(';')[1].split('filename')[1].split('=')[1].trim();
|
|
111
|
+
return response.blob();
|
|
112
|
+
})
|
|
113
|
+
.then((blob) => URL.createObjectURL(blob))
|
|
114
|
+
.then((url) => {
|
|
115
|
+
const a = document.createElement('a');
|
|
116
|
+
a.style.display = 'none';
|
|
117
|
+
a.href = url;
|
|
118
|
+
a.download = filename;
|
|
119
|
+
document.body.appendChild(a);
|
|
120
|
+
a.click();
|
|
121
|
+
window.URL.revokeObjectURL(url);
|
|
122
|
+
})
|
|
123
|
+
.catch((err) => {
|
|
124
|
+
logger.error(err);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const IDocumentService = DI.createInterface<IDocumentService>((x) =>
|
|
130
|
+
x.singleton(DocumentServiceImpl),
|
|
131
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tags';
|
package/src/tags/tags.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { tagFor } from '@genesislcap/foundation-ui';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
import { DocumentManagerConfig } from '../config/config';
|
|
4
|
+
import { defaultTemplateOptions } from '../config/templates';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* It's important this file isn't referenced ahead of a `configure` call, otherwise these values may remain fixed at
|
|
8
|
+
* their defaults. Consumers must use the `/config` subpath to help avoid this. Files with references to tags should be
|
|
9
|
+
* lazily loaded. There is an alternative `getTags` utility at the end which could offer another approach, but direct
|
|
10
|
+
* tag exports and inline template references feel cleaner than having to convert all component `template` and `styles`
|
|
11
|
+
* exports to functions to call `getTags` on execution.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export const { templateOptions = defaultTemplateOptions } =
|
|
18
|
+
DI.getOrCreateDOMContainer().get(DocumentManagerConfig);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export const iconTag = tagFor(templateOptions.icon);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export const buttonTag = tagFor(templateOptions.button);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export const badgeTag = tagFor(templateOptions.badge);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export const progressTag = tagFor(templateOptions.progress);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export const searchBarTag = tagFor(templateOptions.searchBar);
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export const treeViewTag = tagFor(templateOptions.treeView);
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
export const treeItemTag = tagFor(templateOptions.treeItem);
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export const gridTag = tagFor(templateOptions.grid);
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export const modalTag = tagFor(templateOptions.modal);
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export const textInputTag = tagFor(templateOptions.textInput);
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export const checkboxInputTag = tagFor(templateOptions.checkboxInput);
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export const selectInputTag = tagFor(templateOptions.selectInput);
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export const optionTag = tagFor(templateOptions.option);
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export const multiSelectInputTag = tagFor(templateOptions.multiselect);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export enum ColumnFields {
|
|
2
|
+
FILE_STORAGE_ID = 'FILE_STORAGE_ID',
|
|
3
|
+
STORAGE_MANAGER = 'STORAGE_MANAGER',
|
|
4
|
+
FILE_NAME = 'FILE_NAME',
|
|
5
|
+
FILE_SIZE = 'FILE_SIZE',
|
|
6
|
+
MODIFIED_AT = 'MODIFIED_AT',
|
|
7
|
+
MODIFIED_BY = 'MODIFIED_BY',
|
|
8
|
+
CREATED_BY = 'CREATED_BY',
|
|
9
|
+
CREATED_AT = 'CREATED_AT',
|
|
10
|
+
LOCATION_DETAILS = 'LOCATION_DETAILS',
|
|
11
|
+
FILE_TYPE = 'FILE_TYPE',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum ColumnMetadata {
|
|
15
|
+
IS_DIR = 'IS_DIR',
|
|
16
|
+
DIR_PATH = 'DIR_PATH',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const fileTypes = ['CSV', 'JPG', 'PNG', 'PDF'] as const;
|
|
20
|
+
export type FileTypes = (typeof fileTypes)[number];
|
|
21
|
+
|
|
22
|
+
export enum DIRECTORY {
|
|
23
|
+
ALL = 'ALL',
|
|
24
|
+
MY_FILES = 'MY_FILES',
|
|
25
|
+
ALL_TEMPLATES = 'ALL_TEMPLATES',
|
|
26
|
+
ALL_ASSETS = 'ALL_ASSETS',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type Directories = {
|
|
30
|
+
id: DIRECTORY;
|
|
31
|
+
icon: any;
|
|
32
|
+
title: string;
|
|
33
|
+
selected: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type DataRowMetadata = {
|
|
37
|
+
[ColumnMetadata.IS_DIR]: boolean;
|
|
38
|
+
[ColumnMetadata.DIR_PATH]: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export enum FileMetaType {
|
|
42
|
+
'USER_DOCUMENT' = 'USER_DOCUMENT',
|
|
43
|
+
'DOCUMENT_TEMPLATE' = 'DOCUMENT_TEMPLATE',
|
|
44
|
+
'TEMPLATE_ASSET' = 'TEMPLATE_ASSET',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type _DataRow = {
|
|
48
|
+
[ColumnFields.FILE_STORAGE_ID]: string;
|
|
49
|
+
[ColumnFields.STORAGE_MANAGER]: string;
|
|
50
|
+
[ColumnFields.FILE_NAME]: string;
|
|
51
|
+
[ColumnFields.FILE_SIZE]: number;
|
|
52
|
+
[ColumnFields.MODIFIED_AT]: number;
|
|
53
|
+
[ColumnFields.MODIFIED_BY]: string;
|
|
54
|
+
[ColumnFields.CREATED_BY]: string;
|
|
55
|
+
[ColumnFields.CREATED_AT]: number;
|
|
56
|
+
[ColumnFields.LOCATION_DETAILS]: string;
|
|
57
|
+
[ColumnFields.FILE_TYPE]: FileMetaType;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type DataRow = _DataRow & Partial<DataRowMetadata>;
|
|
61
|
+
|
|
62
|
+
export enum DocManagerEvents {
|
|
63
|
+
RowCountChanged = 'row-count-changed',
|
|
64
|
+
HandleUploadStarted = 'handle-upload-started',
|
|
65
|
+
HandleReplaceStarted = 'handle-replace-started',
|
|
66
|
+
HandleFileDeleted = 'handle-file-deleted',
|
|
67
|
+
HandleFileUploaded = 'handle-file-uploaded',
|
|
68
|
+
HandleFileReplaced = 'handle-file-replaced',
|
|
69
|
+
HandleFileProcessError = 'handle-file-process-error',
|
|
70
|
+
InitFileDownload = 'init-file-download',
|
|
71
|
+
InitFileDelete = 'init-file-delete',
|
|
72
|
+
InitFileUpload = 'init-file-upload',
|
|
73
|
+
InitTemplateAssetLinking = 'init-template-asset-linking',
|
|
74
|
+
InitFileReplace = 'init-file-replace',
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type DocManagerEventDetailMap = {
|
|
78
|
+
[DocManagerEvents.RowCountChanged]: number;
|
|
79
|
+
[DocManagerEvents.HandleUploadStarted]: void;
|
|
80
|
+
[DocManagerEvents.HandleReplaceStarted]: void;
|
|
81
|
+
[DocManagerEvents.HandleFileProcessError]: void;
|
|
82
|
+
[DocManagerEvents.HandleFileDeleted]: void;
|
|
83
|
+
[DocManagerEvents.HandleFileUploaded]: void;
|
|
84
|
+
[DocManagerEvents.HandleFileReplaced]: void;
|
|
85
|
+
[DocManagerEvents.InitFileDownload]: DataRow[ColumnFields.FILE_STORAGE_ID];
|
|
86
|
+
[DocManagerEvents.InitFileDelete]: DataRow[ColumnFields.FILE_STORAGE_ID];
|
|
87
|
+
[DocManagerEvents.InitFileUpload]: string;
|
|
88
|
+
[DocManagerEvents.InitTemplateAssetLinking]: DataRow[ColumnFields.FILE_STORAGE_ID];
|
|
89
|
+
[DocManagerEvents.InitFileReplace]: {
|
|
90
|
+
FILE_STORAGE_ID: DataRow[ColumnFields.FILE_STORAGE_ID];
|
|
91
|
+
FILE_TYPE: DataRow[ColumnFields.FILE_TYPE];
|
|
92
|
+
LOCATION_DETAILS: DataRow[ColumnFields.LOCATION_DETAILS];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export enum FileUploadMode {
|
|
97
|
+
DISABLED = 'Disabled',
|
|
98
|
+
UPLOAD = 'Uploading',
|
|
99
|
+
REPLACE = 'Replacing',
|
|
100
|
+
}
|
package/src/typings.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'foundationZero/ZeroDesignSystem';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number formatter, can be used directly on ag-grid columns as valueFormatter.
|
|
3
|
+
*
|
|
4
|
+
* @param minDP min decimal points
|
|
5
|
+
* @param maxDP max decimal points
|
|
6
|
+
*/
|
|
7
|
+
export function formatNumber(minDP = 2, maxDP = minDP) {
|
|
8
|
+
return (params) => {
|
|
9
|
+
if (!(params && typeof params.value === 'number')) return '';
|
|
10
|
+
const lang = (navigator && navigator.language) || 'en-GB';
|
|
11
|
+
return Intl.NumberFormat(lang, {
|
|
12
|
+
minimumFractionDigits: minDP,
|
|
13
|
+
maximumFractionDigits: maxDP,
|
|
14
|
+
}).format(params.value);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const getFormattedDateTime = (dateTimeInMills) => {
|
|
19
|
+
if (!dateTimeInMills) return undefined;
|
|
20
|
+
const dateTime = new Date(dateTimeInMills);
|
|
21
|
+
return `${dateTime.toLocaleDateString()} ${dateTime.toLocaleTimeString()}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const getFileType = (fileName: string): string => {
|
|
25
|
+
if (!fileName) return undefined;
|
|
26
|
+
const typeIndex = fileName.lastIndexOf('.');
|
|
27
|
+
return fileName.substring(typeIndex + 1).toUpperCase();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const getFileColor = (fileType: string): string => {
|
|
31
|
+
switch (fileType) {
|
|
32
|
+
case 'CSV':
|
|
33
|
+
return '#63a103';
|
|
34
|
+
case 'JPG':
|
|
35
|
+
case 'PNG':
|
|
36
|
+
return '#8a98f5';
|
|
37
|
+
case 'PDF':
|
|
38
|
+
return '#f9644d';
|
|
39
|
+
default:
|
|
40
|
+
return '#ffffff';
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const formatBytes = (bytes, decimals = 2): string => {
|
|
45
|
+
if (!bytes) return undefined;
|
|
46
|
+
if (!+bytes) return '0 Bytes';
|
|
47
|
+
|
|
48
|
+
const k = 1000;
|
|
49
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
50
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
|
51
|
+
|
|
52
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
53
|
+
|
|
54
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
|
55
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MessageError } from '@genesislcap/foundation-comms';
|
|
2
|
+
|
|
3
|
+
export const msgUnwrap = (res: unknown): string => {
|
|
4
|
+
if (typeof res !== 'object' || !('receivedMessage' in res))
|
|
5
|
+
return 'Unknown error, unable to parse error message';
|
|
6
|
+
return (
|
|
7
|
+
(res as { receivedMessage: { ERROR?: MessageError[] } }).receivedMessage.ERROR?.map(
|
|
8
|
+
({ TEXT }) => TEXT,
|
|
9
|
+
).join(', ') + '.'
|
|
10
|
+
);
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getNotificationContainer, ToastStructure } from '@genesislcap/foundation-notifications';
|
|
2
|
+
import { showNotificationToast as toast } from '@genesislcap/foundation-notifications';
|
|
3
|
+
|
|
4
|
+
const container = getNotificationContainer('notify-container', 'rapid');
|
|
5
|
+
|
|
6
|
+
export const showNotificationToast = (config: ToastStructure) => toast(config, 'rapid', container);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { css } from '@genesislcap/web-core';
|
|
2
|
+
import { modalTag } from '../tags';
|
|
3
|
+
|
|
4
|
+
export const modalStyles = css`
|
|
5
|
+
${modalTag}::part(dialog) {
|
|
6
|
+
width: 50%;
|
|
7
|
+
height: 50%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
${modalTag}::part(content) {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
${modalTag}:not(:defined) {
|
|
16
|
+
visibility: hidden;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const titleStyles = css`
|
|
21
|
+
.title {
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
font-size: var(--type-ramp-plus-2-font-size);
|
|
24
|
+
color: var(--neutral-foreground-rest);
|
|
25
|
+
text-align: left;
|
|
26
|
+
line-height: normal;
|
|
27
|
+
}
|
|
28
|
+
`;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declarationDir": "./dist/dts",
|
|
4
|
+
"outDir": "./dist/esm",
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationMap": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"lib": ["DOM", "ES2015", "ES2016", "ES2017"],
|
|
14
|
+
"module": "ESNext",
|
|
15
|
+
"moduleResolution": "node",
|
|
16
|
+
"noEmitOnError": true,
|
|
17
|
+
"noImplicitAny": false,
|
|
18
|
+
"preserveConstEnums": true,
|
|
19
|
+
"pretty": true,
|
|
20
|
+
"removeComments": true,
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"skipLibCheck": true,
|
|
23
|
+
"sourceMap": true,
|
|
24
|
+
"strictNullChecks": false,
|
|
25
|
+
"target": "ES2017"
|
|
26
|
+
},
|
|
27
|
+
"include": ["src/**/*"],
|
|
28
|
+
"exclude": ["node_modules", "dist", "build"]
|
|
29
|
+
}
|
package/index.html
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>{{htmlWebpackPlugin.options.title}}</title>
|
|
7
|
-
<style>
|
|
8
|
-
html,
|
|
9
|
-
body {
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
background: var(--neutral-layer-4);
|
|
13
|
-
padding: 0;
|
|
14
|
-
margin: 0;
|
|
15
|
-
overflow: clip;
|
|
16
|
-
}
|
|
17
|
-
:not(:defined) {
|
|
18
|
-
visibility: hidden;
|
|
19
|
-
}
|
|
20
|
-
</style>
|
|
21
|
-
</head>
|
|
22
|
-
<body>
|
|
23
|
-
<document-manager-sandbox></document-manager-sandbox>
|
|
24
|
-
{{#if insertEntryPoint}}
|
|
25
|
-
<script type="module" src="/src/sandbox.ts"></script>
|
|
26
|
-
<script type="module" src="/src/index.ts"></script>
|
|
27
|
-
{{/if}}
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|