@ieeesa-npm/presentation 0.27.2 → 0.27.4
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/esm2022/lib/assets/constants.json +20 -0
- package/esm2022/lib/components/dynamic-form/dynamic-form.component.mjs +11 -3
- package/esm2022/lib/components/file-download/file-download.component.mjs +163 -0
- package/esm2022/lib/components/file-upload/file-upload.component.mjs +45 -17
- package/esm2022/lib/components/list/list.component.mjs +23 -3
- package/esm2022/lib/directives/dynamic-form-field/dynamic-form-field.directive.mjs +14 -2
- package/esm2022/lib/models/align-type.model.mjs +2 -1
- package/esm2022/lib/models/download-file.model.mjs +1 -1
- package/esm2022/lib/models/field-config.model.mjs +1 -1
- package/esm2022/lib/models/file-attachment.model.mjs +1 -1
- package/esm2022/lib/models/file-download-config.model.mjs +2 -0
- package/esm2022/lib/models/file-upload-presigned-url-res.model.mjs +1 -1
- package/esm2022/lib/models/file-upload-status.model.mjs +1 -1
- package/esm2022/lib/models/list-item.model.mjs +1 -1
- package/esm2022/lib/services/file-upload.service.mjs +26 -12
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/ieeesa-npm-presentation.mjs +308 -55
- package/fesm2022/ieeesa-npm-presentation.mjs.map +1 -1
- package/lib/components/chips/chips.component.d.ts +18 -0
- package/lib/components/dynamic-form/dynamic-form.component.d.ts +5 -1
- package/lib/components/file-download/file-download.component.d.ts +377 -0
- package/lib/components/file-upload/file-upload.component.d.ts +43 -10
- package/lib/components/list/list.component.d.ts +12 -1
- package/lib/directives/dynamic-form-field/dynamic-form-field.directive.d.ts +5 -1
- package/lib/models/align-type.model.d.ts +2 -1
- package/lib/models/download-file.model.d.ts +1 -1
- package/lib/models/field-config.model.d.ts +1 -1
- package/lib/models/file-attachment.model.d.ts +5 -3
- package/lib/models/file-download-config.model.d.ts +9 -0
- package/lib/models/file-upload-presigned-url-res.model.d.ts +18 -0
- package/lib/models/file-upload-status.model.d.ts +1 -1
- package/lib/models/list-item.model.d.ts +2 -0
- package/lib/services/file-upload.service.d.ts +28 -9
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/src/lib/assets/constants.json +20 -0
|
@@ -7,13 +7,15 @@ export interface FileAttachment {
|
|
|
7
7
|
export interface FileAttachmentPayload {
|
|
8
8
|
payload: FileAttachment[];
|
|
9
9
|
}
|
|
10
|
+
export interface AgendaItemAttachment {
|
|
11
|
+
fileName: string;
|
|
12
|
+
agendaItemAttachmentId: string;
|
|
13
|
+
}
|
|
10
14
|
export interface FileAttachmentResponse {
|
|
11
15
|
status: boolean;
|
|
12
16
|
message: string;
|
|
13
17
|
body: {
|
|
14
|
-
id: string | null;
|
|
15
|
-
name: string | null;
|
|
16
|
-
message: string;
|
|
17
18
|
totalRecords: number;
|
|
19
|
+
agendaItemAttachmentList: AgendaItemAttachment[];
|
|
18
20
|
};
|
|
19
21
|
}
|
|
@@ -9,6 +9,24 @@ export interface GetFileDownloadPresignedUrlPayload {
|
|
|
9
9
|
domain: string;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
+
export interface GetFileDownloadPresignedUrlByAttachmentIdPayload {
|
|
13
|
+
payload: {
|
|
14
|
+
attachmentId?: string;
|
|
15
|
+
preSignedDuration: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface GetFileDownloadPresignedUrlByAttachmentIdResponse {
|
|
19
|
+
status: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
body: {
|
|
22
|
+
preSignedUrl: string;
|
|
23
|
+
fileName: string;
|
|
24
|
+
s3Path?: string;
|
|
25
|
+
errorMessage?: string;
|
|
26
|
+
} | null | {
|
|
27
|
+
errorCodes: string[];
|
|
28
|
+
};
|
|
29
|
+
}
|
|
12
30
|
export interface GetFileUploadPresignedUrlPayload {
|
|
13
31
|
payload: {
|
|
14
32
|
fileName: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IconButton } from '../models/icon-button.model';
|
|
2
|
+
import { DownloadFile } from './download-file.model';
|
|
2
3
|
import { Menu } from './menu.model';
|
|
3
4
|
export interface ListItem {
|
|
4
5
|
id: string;
|
|
@@ -13,6 +14,7 @@ export interface ListItem {
|
|
|
13
14
|
itemLevel?: number;
|
|
14
15
|
actionMenus?: Menu[];
|
|
15
16
|
actionIcon?: IconButton;
|
|
17
|
+
attachments?: DownloadFile[];
|
|
16
18
|
}
|
|
17
19
|
export interface ListHeader {
|
|
18
20
|
title: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { HttpBackend, HttpClient, HttpEvent } from '@angular/common/http';
|
|
2
2
|
import { OnDestroy } from '@angular/core';
|
|
3
3
|
import { AlertsService, HttpService, LoaderNotificationService } from '@ieeesa-npm/utility';
|
|
4
|
-
import { FileUploadPresignedUrl } from '../models/file-upload-presigned-url-res.model';
|
|
4
|
+
import { FileUploadPresignedUrl, GetFileDownloadPresignedUrlByAttachmentIdResponse } from '../models/file-upload-presigned-url-res.model';
|
|
5
5
|
import { Observable, Subject } from 'rxjs';
|
|
6
6
|
import { FileUploadPayload } from '../models/file-upload-payload-model';
|
|
7
7
|
import { FileUploadBodyResponse, FileUploadResponse } from '../models/file-upload-response.model';
|
|
8
8
|
import { DeleteFileResponse } from '../models/delete-file.model';
|
|
9
|
+
import { DownloadFile } from '../models/download-file.model';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
/**
|
|
11
12
|
* This service interacts with the server to obtain pre-signed URLs for file upload and uploads files to Amazon S3.
|
|
@@ -190,13 +191,7 @@ export declare class FileUploadService implements OnDestroy {
|
|
|
190
191
|
label: {
|
|
191
192
|
initial: string;
|
|
192
193
|
};
|
|
193
|
-
};
|
|
194
|
-
* Return distinct message for sent, upload progress, & response events.
|
|
195
|
-
* @param {HttpEvent<any>} event
|
|
196
|
-
* @param {(File | FileList)} file
|
|
197
|
-
* @return {*}
|
|
198
|
-
* @memberof FileUploadService
|
|
199
|
-
*/
|
|
194
|
+
};
|
|
200
195
|
loader: {
|
|
201
196
|
ariaLabel: {
|
|
202
197
|
spinner: string;
|
|
@@ -299,6 +294,24 @@ export declare class FileUploadService implements OnDestroy {
|
|
|
299
294
|
colorPicker: string;
|
|
300
295
|
};
|
|
301
296
|
};
|
|
297
|
+
fileDownload: {
|
|
298
|
+
buttons: {
|
|
299
|
+
id: number;
|
|
300
|
+
ariaLabel: string;
|
|
301
|
+
iconURL: string;
|
|
302
|
+
toolTip: string;
|
|
303
|
+
disabled: boolean;
|
|
304
|
+
}[];
|
|
305
|
+
preSignedDuration: string;
|
|
306
|
+
message: {
|
|
307
|
+
errors: {
|
|
308
|
+
errorReadingFile: string;
|
|
309
|
+
"5038": string;
|
|
310
|
+
"6027": string;
|
|
311
|
+
"6028": string;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
};
|
|
302
315
|
};
|
|
303
316
|
apiBaseUrl: string;
|
|
304
317
|
fileByteArray: Uint8Array | undefined;
|
|
@@ -314,6 +327,12 @@ export declare class FileUploadService implements OnDestroy {
|
|
|
314
327
|
* @memberof FileUploadService
|
|
315
328
|
*/
|
|
316
329
|
setApiBaseUrl(apiBaseUrl: string): void;
|
|
330
|
+
/**
|
|
331
|
+
* Gets API base URL for API requests.
|
|
332
|
+
* @return {*} {string}
|
|
333
|
+
* @memberof FileUploadService
|
|
334
|
+
*/
|
|
335
|
+
getApiBaseUrl(): string;
|
|
317
336
|
/**
|
|
318
337
|
* Retrieves presigned URL for uploading files to Amazon S3 bucket.
|
|
319
338
|
* @param {(File | FileList)} file
|
|
@@ -389,7 +408,7 @@ export declare class FileUploadService implements OnDestroy {
|
|
|
389
408
|
* @return {Observable<string>}
|
|
390
409
|
* @memberof FileUploadService
|
|
391
410
|
*/
|
|
392
|
-
getFileDownloadPresignedUrls(file: File | FileList | string, isPublicAPI?: boolean, domainUrl?: string): Observable<string>;
|
|
411
|
+
getFileDownloadPresignedUrls(file: File | FileList | string | DownloadFile, isPublicAPI?: boolean, domainUrl?: string, downloadUri?: string): Observable<string | GetFileDownloadPresignedUrlByAttachmentIdResponse>;
|
|
393
412
|
/**
|
|
394
413
|
* Downloads file to AWS S3 using a presigned URL.
|
|
395
414
|
* @return {Observable<any>}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from './lib/components/slide-toggle/slide-toggle.component';
|
|
|
34
34
|
export * from './lib/components/card/card.component';
|
|
35
35
|
export * from './lib/components/color-picker/color-picker.component';
|
|
36
36
|
export * from './lib/components/file-upload/file-upload.component';
|
|
37
|
+
export * from './lib/components/file-download/file-download.component';
|
|
37
38
|
export * from './lib/components/accordion/accordion.component';
|
|
38
39
|
export * from './lib/components/inactive-tenant/inactive-tenant.component';
|
|
39
40
|
export * from './lib/components/image-preview/image-preview.component';
|
|
@@ -57,6 +58,7 @@ export * from './lib/models/dynamic-properties.model';
|
|
|
57
58
|
export * from './lib/models/event-emit-type.model';
|
|
58
59
|
export * from './lib/models/field-config.model';
|
|
59
60
|
export * from './lib/models/file-attachment.model';
|
|
61
|
+
export * from './lib/models/file-download-config.model';
|
|
60
62
|
export * from './lib/models/footer-config.model';
|
|
61
63
|
export * from './lib/models/form-control-types.model';
|
|
62
64
|
export * from './lib/models/form-field.model';
|
|
@@ -612,5 +612,25 @@
|
|
|
612
612
|
"editor": "Rich text editor.",
|
|
613
613
|
"colorPicker": "Color picker."
|
|
614
614
|
}
|
|
615
|
+
},
|
|
616
|
+
"fileDownload": {
|
|
617
|
+
"buttons": [
|
|
618
|
+
{
|
|
619
|
+
"id": 1,
|
|
620
|
+
"ariaLabel": "File delete icon.",
|
|
621
|
+
"iconURL": "assets/images/sprites/sprites.svg#icon-file-delete",
|
|
622
|
+
"toolTip": "",
|
|
623
|
+
"disabled": false
|
|
624
|
+
}
|
|
625
|
+
],
|
|
626
|
+
"preSignedDuration": "5",
|
|
627
|
+
"message": {
|
|
628
|
+
"errors": {
|
|
629
|
+
"errorReadingFile": "File is damaged or unreadable.",
|
|
630
|
+
"5038": "Presigned duration is either null/empty.",
|
|
631
|
+
"6027": "Attachment id is either null/empty.",
|
|
632
|
+
"6028": "Agenda item attachment id does not exist."
|
|
633
|
+
}
|
|
634
|
+
}
|
|
615
635
|
}
|
|
616
636
|
}
|