cat-documents-ng 0.3.19 → 0.3.20
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/Shared/constant/SHARED.d.ts +3 -0
- package/fesm2022/cat-documents-ng.mjs +1016 -46
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +169 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +0 -21
- package/lib/document/document.module.d.ts +38 -36
- package/lib/document/services/document-content-type.service.d.ts +85 -0
- package/lib/document/services/excel-parser.service.d.ts +169 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges, OnInit } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { ExcelParserService, ExcelRowData } from '../../services/excel-parser.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Component for viewing different types of document content.
|
|
7
|
+
* Supports PDF, images, and other document formats.
|
|
8
|
+
* @class DocumentContentViewerComponent
|
|
9
|
+
* @typedef {DocumentContentViewerComponent}
|
|
10
|
+
*/
|
|
11
|
+
export declare class DocumentContentViewerComponent implements OnChanges, OnInit {
|
|
12
|
+
private http;
|
|
13
|
+
private excelParserService;
|
|
14
|
+
/**
|
|
15
|
+
* The document URL to display
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
documentUrl?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The content type of the document
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
contentType?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The document name for display purposes
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
documentName?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Excel data for display
|
|
31
|
+
* @type {any}
|
|
32
|
+
*/
|
|
33
|
+
excelData: any;
|
|
34
|
+
/**
|
|
35
|
+
* Parsed Excel data as table rows
|
|
36
|
+
* @type {any[][]}
|
|
37
|
+
*/
|
|
38
|
+
excelTableData: any[][];
|
|
39
|
+
/**
|
|
40
|
+
* Enhanced Excel data with styling information
|
|
41
|
+
* @type {ExcelRowData[]}
|
|
42
|
+
*/
|
|
43
|
+
excelStyledData: ExcelRowData[];
|
|
44
|
+
/**
|
|
45
|
+
* Excel sheet names
|
|
46
|
+
* @type {string[]}
|
|
47
|
+
*/
|
|
48
|
+
excelSheets: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Current active sheet
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
currentSheet: string;
|
|
54
|
+
/**
|
|
55
|
+
* Loading state for Excel files
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
*/
|
|
58
|
+
isLoadingExcel: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Error state for Excel files
|
|
61
|
+
* @type {string | null}
|
|
62
|
+
*/
|
|
63
|
+
excelError: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Configuration for the document viewer
|
|
66
|
+
* @type {any}
|
|
67
|
+
*/
|
|
68
|
+
docViewerConfig: any;
|
|
69
|
+
/**
|
|
70
|
+
* Computed property to determine if the document is an image
|
|
71
|
+
* @type {boolean}
|
|
72
|
+
*/
|
|
73
|
+
get isImage(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Computed property to determine if the document is a PDF
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
*/
|
|
78
|
+
get isPdf(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Computed property to determine if the document is an Excel file
|
|
81
|
+
* @type {boolean}
|
|
82
|
+
*/
|
|
83
|
+
get isExcel(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Computed property to determine if the document is a Word file
|
|
86
|
+
* @type {boolean}
|
|
87
|
+
*/
|
|
88
|
+
get isWord(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Computed property to determine if the document is a CSV file
|
|
91
|
+
* @type {boolean}
|
|
92
|
+
*/
|
|
93
|
+
get isCsv(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Computed property to determine if the document is an email file
|
|
96
|
+
* @type {boolean}
|
|
97
|
+
*/
|
|
98
|
+
get isEmail(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Computed property to determine if the document is an OpenDocument file
|
|
101
|
+
* @type {boolean}
|
|
102
|
+
*/
|
|
103
|
+
get isOpenDocument(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Computed property to determine if the document has an unsupported content type
|
|
106
|
+
* @type {boolean}
|
|
107
|
+
*/
|
|
108
|
+
get isUnsupported(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Computed property to get the appropriate icon for the document type
|
|
111
|
+
* @type {string}
|
|
112
|
+
*/
|
|
113
|
+
get documentIcon(): string;
|
|
114
|
+
/**
|
|
115
|
+
* Computed property to get the display text for the document type
|
|
116
|
+
* @type {string}
|
|
117
|
+
*/
|
|
118
|
+
get documentTypeText(): string;
|
|
119
|
+
/**
|
|
120
|
+
* Safely gets the styled Excel data for display
|
|
121
|
+
* @type {ExcelRowData[]}
|
|
122
|
+
*/
|
|
123
|
+
get safeExcelStyledData(): ExcelRowData[];
|
|
124
|
+
/**
|
|
125
|
+
* Handles changes to input properties
|
|
126
|
+
* @param {SimpleChanges} changes - The changes object
|
|
127
|
+
*/
|
|
128
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
129
|
+
/**
|
|
130
|
+
* Initializes the component
|
|
131
|
+
*/
|
|
132
|
+
ngOnInit(): void;
|
|
133
|
+
/**
|
|
134
|
+
* Downloads the document
|
|
135
|
+
*/
|
|
136
|
+
downloadDocument(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Opens the document in a new tab
|
|
139
|
+
*/
|
|
140
|
+
openInNewTab(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Loads Excel data for display
|
|
143
|
+
*/
|
|
144
|
+
private loadExcelData;
|
|
145
|
+
/**
|
|
146
|
+
* Parses Excel data using the service
|
|
147
|
+
* @param {ArrayBuffer} data - Excel file data
|
|
148
|
+
*/
|
|
149
|
+
private parseExcelData;
|
|
150
|
+
/**
|
|
151
|
+
* Changes the active Excel sheet
|
|
152
|
+
* @param {string} sheetName - Name of the sheet to activate
|
|
153
|
+
*/
|
|
154
|
+
changeSheet(sheetName: string): void;
|
|
155
|
+
/**
|
|
156
|
+
* Resets Excel data to initial state
|
|
157
|
+
*/
|
|
158
|
+
private resetExcelData;
|
|
159
|
+
/**
|
|
160
|
+
* Constructor
|
|
161
|
+
* @param {HttpClient} http - HTTP client for fetching Excel data
|
|
162
|
+
* @param {ExcelParserService} excelParserService - Service for parsing Excel files
|
|
163
|
+
* @param {DocxParserService} docxParserService - Service for parsing DOCX files
|
|
164
|
+
* @param {DomSanitizer} sanitizer - Service for sanitizing HTML content
|
|
165
|
+
*/
|
|
166
|
+
constructor(http: HttpClient, excelParserService: ExcelParserService);
|
|
167
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContentViewerComponent, never>;
|
|
168
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContentViewerComponent, "document-content-viewer", never, { "documentUrl": { "alias": "documentUrl"; "required": false; }; "contentType": { "alias": "contentType"; "required": false; }; "documentName": { "alias": "documentName"; "required": false; }; }, {}, never, never, false, never>;
|
|
169
|
+
}
|
|
@@ -64,21 +64,6 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
|
|
|
64
64
|
* @type {DocumentViewerState}
|
|
65
65
|
*/
|
|
66
66
|
currentState: DocumentViewerState;
|
|
67
|
-
/**
|
|
68
|
-
* Computed property to determine if the selected document is an image
|
|
69
|
-
* @type {boolean}
|
|
70
|
-
*/
|
|
71
|
-
get isSelectedDocumentImage(): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Computed property to determine if the selected document is a PDF
|
|
74
|
-
* @type {boolean}
|
|
75
|
-
*/
|
|
76
|
-
get isSelectedDocumentPdf(): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Computed property to determine if the selected document has an unsupported content type
|
|
79
|
-
* @type {boolean}
|
|
80
|
-
*/
|
|
81
|
-
get isSelectedDocumentUnsupported(): boolean;
|
|
82
67
|
/**
|
|
83
68
|
* Holds the subscription to manage observable cleanup.
|
|
84
69
|
* @private
|
|
@@ -102,12 +87,6 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
|
|
|
102
87
|
* @param document The selected document
|
|
103
88
|
*/
|
|
104
89
|
handleSelectedDocument(document: DocumentListItem): void;
|
|
105
|
-
/**
|
|
106
|
-
* Determines if the given content type is an image.
|
|
107
|
-
* @param {string | undefined} contentType - The MIME type of the content.
|
|
108
|
-
* @returns {boolean} `true` if the content type is an image; otherwise, `false`.
|
|
109
|
-
*/
|
|
110
|
-
isImage(contentType?: string): boolean;
|
|
111
90
|
/**
|
|
112
91
|
* Handles document actions from the actions component
|
|
113
92
|
* @param {DocumentAction} action - The action performed
|
|
@@ -7,41 +7,43 @@ import * as i5 from "./components/document-list-item/document-list-item.componen
|
|
|
7
7
|
import * as i6 from "./components/document-upload/document-upload.component";
|
|
8
8
|
import * as i7 from "./components/document-viewer/document-viewer.component";
|
|
9
9
|
import * as i8 from "./components/document-history/document-history.component";
|
|
10
|
-
import * as i9 from "./
|
|
11
|
-
import * as i10 from "./
|
|
12
|
-
import * as i11 from "./components/
|
|
13
|
-
import * as i12 from "./components/
|
|
14
|
-
import * as i13 from "./components/
|
|
15
|
-
import * as i14 from "./components/document-
|
|
16
|
-
import * as i15 from "./components/document-
|
|
17
|
-
import * as i16 from "./components/
|
|
18
|
-
import * as i17 from "
|
|
19
|
-
import * as i18 from "
|
|
20
|
-
import * as i19 from "
|
|
21
|
-
import * as i20 from "
|
|
22
|
-
import * as i21 from "primeng/
|
|
23
|
-
import * as i22 from "primeng/
|
|
24
|
-
import * as i23 from "primeng/
|
|
25
|
-
import * as i24 from "primeng/
|
|
26
|
-
import * as i25 from "primeng/
|
|
27
|
-
import * as i26 from "primeng/
|
|
28
|
-
import * as i27 from "primeng/
|
|
29
|
-
import * as i28 from "primeng/
|
|
30
|
-
import * as i29 from "primeng/
|
|
31
|
-
import * as i30 from "
|
|
32
|
-
import * as i31 from "
|
|
33
|
-
import * as i32 from "
|
|
34
|
-
import * as i33 from "
|
|
35
|
-
import * as i34 from "primeng/
|
|
36
|
-
import * as i35 from "primeng/
|
|
37
|
-
import * as i36 from "primeng/
|
|
38
|
-
import * as i37 from "primeng/
|
|
39
|
-
import * as i38 from "primeng/
|
|
40
|
-
import * as i39 from "
|
|
41
|
-
import * as i40 from "primeng/
|
|
42
|
-
import * as i41 from "
|
|
43
|
-
import * as i42 from "primeng/
|
|
44
|
-
import * as i43 from "primeng/
|
|
10
|
+
import * as i9 from "./components/document-content-viewer/document-content-viewer.component";
|
|
11
|
+
import * as i10 from "./directives/document.directive";
|
|
12
|
+
import * as i11 from "./components/linked-document/linked-document.component";
|
|
13
|
+
import * as i12 from "./components/documents-menu/documents-menu.component";
|
|
14
|
+
import * as i13 from "./components/user-list/user-list.component";
|
|
15
|
+
import * as i14 from "./components/document-status/document-status.component";
|
|
16
|
+
import * as i15 from "./components/document-actions/document-actions.component";
|
|
17
|
+
import * as i16 from "./components/document-search/document-search.component";
|
|
18
|
+
import * as i17 from "./components/sidebar/sidebar.component";
|
|
19
|
+
import * as i18 from "@angular/common";
|
|
20
|
+
import * as i19 from "primeng/accordion";
|
|
21
|
+
import * as i20 from "@angular/common/http";
|
|
22
|
+
import * as i21 from "primeng/button";
|
|
23
|
+
import * as i22 from "primeng/sidebar";
|
|
24
|
+
import * as i23 from "primeng/fileupload";
|
|
25
|
+
import * as i24 from "primeng/progressbar";
|
|
26
|
+
import * as i25 from "primeng/badge";
|
|
27
|
+
import * as i26 from "primeng/listbox";
|
|
28
|
+
import * as i27 from "primeng/checkbox";
|
|
29
|
+
import * as i28 from "primeng/radiobutton";
|
|
30
|
+
import * as i29 from "primeng/timeline";
|
|
31
|
+
import * as i30 from "primeng/inputtextarea";
|
|
32
|
+
import * as i31 from "@angular/forms";
|
|
33
|
+
import * as i32 from "ng2-pdf-viewer";
|
|
34
|
+
import * as i33 from "ngx-doc-viewer";
|
|
35
|
+
import * as i34 from "primeng/dialog";
|
|
36
|
+
import * as i35 from "primeng/dropdown";
|
|
37
|
+
import * as i36 from "primeng/inputtext";
|
|
38
|
+
import * as i37 from "primeng/menu";
|
|
39
|
+
import * as i38 from "primeng/panelmenu";
|
|
40
|
+
import * as i39 from "primeng/card";
|
|
41
|
+
import * as i40 from "primeng/table";
|
|
42
|
+
import * as i41 from "../../Shared/shared.module";
|
|
43
|
+
import * as i42 from "primeng/toast";
|
|
44
|
+
import * as i43 from "primeng/tooltip";
|
|
45
|
+
import * as i44 from "primeng/messages";
|
|
46
|
+
import * as i45 from "primeng/message";
|
|
45
47
|
/**
|
|
46
48
|
* @module DocumentModule
|
|
47
49
|
*
|
|
@@ -51,6 +53,6 @@ import * as i43 from "primeng/message";
|
|
|
51
53
|
*/
|
|
52
54
|
export declare class DocumentModule {
|
|
53
55
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
|
|
54
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.
|
|
56
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentContentViewerComponent, typeof i10.DocumentDirective, typeof i11.LinkedDocumentComponent, typeof i12.DocumentsMenuComponent, typeof i13.UserListComponent, typeof i14.DocumentStatusComponent, typeof i15.DocumentActionsComponent, typeof i16.DocumentSearchComponent, typeof i17.SidebarComponent], [typeof i18.CommonModule, typeof i19.AccordionModule, typeof i20.HttpClientModule, typeof i21.ButtonModule, typeof i22.SidebarModule, typeof i23.FileUploadModule, typeof i24.ProgressBarModule, typeof i25.BadgeModule, typeof i26.ListboxModule, typeof i27.CheckboxModule, typeof i28.RadioButtonModule, typeof i29.TimelineModule, typeof i30.InputTextareaModule, typeof i31.FormsModule, typeof i32.PdfViewerModule, typeof i33.NgxDocViewerModule, typeof i34.DialogModule, typeof i35.DropdownModule, typeof i36.InputTextModule, typeof i37.MenuModule, typeof i38.PanelMenuModule, typeof i39.CardModule, typeof i40.TableModule, typeof i41.SharedModule, typeof i30.InputTextareaModule, typeof i42.ToastModule, typeof i43.TooltipModule, typeof i44.MessagesModule, typeof i45.MessageModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i9.DocumentContentViewerComponent, typeof i15.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i10.DocumentDirective, typeof i16.DocumentSearchComponent, typeof i17.SidebarComponent]>;
|
|
55
57
|
static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
|
|
56
58
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Service for handling document content types and their mappings.
|
|
4
|
+
* Supports the content types: "xlsx","xls","doc","docx","pdf","jpg","jpeg","odt","csv","png","msg","eml"
|
|
5
|
+
* @class DocumentContentTypeService
|
|
6
|
+
* @typedef {DocumentContentTypeService}
|
|
7
|
+
*/
|
|
8
|
+
export declare class DocumentContentTypeService {
|
|
9
|
+
/**
|
|
10
|
+
* Mapping of file extensions to MIME types
|
|
11
|
+
* @type {Record<string, string>}
|
|
12
|
+
*/
|
|
13
|
+
private readonly extensionToMimeType;
|
|
14
|
+
/**
|
|
15
|
+
* Mapping of MIME types to file extensions
|
|
16
|
+
* @type {Record<string, string>}
|
|
17
|
+
*/
|
|
18
|
+
private readonly mimeTypeToExtension;
|
|
19
|
+
/**
|
|
20
|
+
* List of all supported file extensions
|
|
21
|
+
* @type {string[]}
|
|
22
|
+
*/
|
|
23
|
+
readonly supportedExtensions: string[];
|
|
24
|
+
/**
|
|
25
|
+
* List of all supported MIME types
|
|
26
|
+
* @type {string[]}
|
|
27
|
+
*/
|
|
28
|
+
readonly supportedMimeTypes: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Gets the MIME type for a given file extension
|
|
31
|
+
* @param {string} extension - The file extension (with or without dot)
|
|
32
|
+
* @returns {string | undefined} The MIME type or undefined if not supported
|
|
33
|
+
*/
|
|
34
|
+
getMimeType(extension: string): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the file extension for a given MIME type
|
|
37
|
+
* @param {string} mimeType - The MIME type
|
|
38
|
+
* @returns {string | undefined} The file extension or undefined if not supported
|
|
39
|
+
*/
|
|
40
|
+
getExtension(mimeType: string): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if a file extension is supported
|
|
43
|
+
* @param {string} extension - The file extension (with or without dot)
|
|
44
|
+
* @returns {boolean} True if the extension is supported
|
|
45
|
+
*/
|
|
46
|
+
isExtensionSupported(extension: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Checks if a MIME type is supported
|
|
49
|
+
* @param {string} mimeType - The MIME type
|
|
50
|
+
* @returns {boolean} True if the MIME type is supported
|
|
51
|
+
*/
|
|
52
|
+
isMimeTypeSupported(mimeType: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the file extension from a filename
|
|
55
|
+
* @param {string} filename - The filename
|
|
56
|
+
* @returns {string | undefined} The file extension or undefined if no extension found
|
|
57
|
+
*/
|
|
58
|
+
getExtensionFromFilename(filename: string): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the MIME type from a filename
|
|
61
|
+
* @param {string} filename - The filename
|
|
62
|
+
* @returns {string | undefined} The MIME type or undefined if not supported
|
|
63
|
+
*/
|
|
64
|
+
getMimeTypeFromFilename(filename: string): string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Validates if a file can be uploaded based on its extension
|
|
67
|
+
* @param {string} filename - The filename to validate
|
|
68
|
+
* @returns {boolean} True if the file can be uploaded
|
|
69
|
+
*/
|
|
70
|
+
canUploadFile(filename: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Gets a human-readable description for a content type
|
|
73
|
+
* @param {string} contentType - The content type (MIME type or extension)
|
|
74
|
+
* @returns {string} Human-readable description
|
|
75
|
+
*/
|
|
76
|
+
getContentTypeDescription(contentType: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Gets a human-readable description for a file extension
|
|
79
|
+
* @param {string} extension - The file extension
|
|
80
|
+
* @returns {string} Human-readable description
|
|
81
|
+
*/
|
|
82
|
+
private getExtensionDescription;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContentTypeService, never>;
|
|
84
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentContentTypeService>;
|
|
85
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as XLSX from 'xlsx';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Interface for Excel cell styling information
|
|
5
|
+
*/
|
|
6
|
+
export interface ExcelCellStyle {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
fontColor?: string;
|
|
9
|
+
bold?: boolean;
|
|
10
|
+
italic?: boolean;
|
|
11
|
+
border?: {
|
|
12
|
+
top?: string;
|
|
13
|
+
bottom?: string;
|
|
14
|
+
left?: string;
|
|
15
|
+
right?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Interface for Excel cell data with styling
|
|
20
|
+
*/
|
|
21
|
+
export interface ExcelCellData {
|
|
22
|
+
value: any;
|
|
23
|
+
style?: ExcelCellStyle;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Interface for Excel row data
|
|
27
|
+
*/
|
|
28
|
+
export interface ExcelRowData {
|
|
29
|
+
cells: ExcelCellData[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Interface for parsed Excel data
|
|
33
|
+
*/
|
|
34
|
+
export interface ParsedExcelData {
|
|
35
|
+
sheets: string[];
|
|
36
|
+
currentSheet: string;
|
|
37
|
+
styledData: ExcelRowData[];
|
|
38
|
+
tableData: any[][];
|
|
39
|
+
hasStyling: boolean;
|
|
40
|
+
workbook: XLSX.WorkBook;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Service for parsing Excel files and extracting styling information
|
|
44
|
+
*/
|
|
45
|
+
export declare class ExcelParserService {
|
|
46
|
+
private workbookColors;
|
|
47
|
+
/**
|
|
48
|
+
* Parses Excel data from ArrayBuffer
|
|
49
|
+
*/
|
|
50
|
+
parseExcelData(data: ArrayBuffer): ParsedExcelData | null;
|
|
51
|
+
/**
|
|
52
|
+
* Creates workbook from ArrayBuffer
|
|
53
|
+
*/
|
|
54
|
+
private createWorkbook;
|
|
55
|
+
/**
|
|
56
|
+
* Gets sheet names from workbook
|
|
57
|
+
*/
|
|
58
|
+
private getSheetNames;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the first sheet name
|
|
61
|
+
*/
|
|
62
|
+
private getFirstSheet;
|
|
63
|
+
/**
|
|
64
|
+
* Parses sheet data with styling
|
|
65
|
+
*/
|
|
66
|
+
parseSheetData(workbook: XLSX.WorkBook, sheetName: string): ExcelRowData[];
|
|
67
|
+
/**
|
|
68
|
+
* Gets worksheet from workbook
|
|
69
|
+
*/
|
|
70
|
+
private getWorksheet;
|
|
71
|
+
/**
|
|
72
|
+
* Gets worksheet range
|
|
73
|
+
*/
|
|
74
|
+
private getWorksheetRange;
|
|
75
|
+
/**
|
|
76
|
+
* Processes worksheet rows
|
|
77
|
+
*/
|
|
78
|
+
private processWorksheetRows;
|
|
79
|
+
/**
|
|
80
|
+
* Processes a single row
|
|
81
|
+
*/
|
|
82
|
+
private processRow;
|
|
83
|
+
/**
|
|
84
|
+
* Gets cell from worksheet
|
|
85
|
+
*/
|
|
86
|
+
private getCell;
|
|
87
|
+
/**
|
|
88
|
+
* Creates cell data with styling
|
|
89
|
+
*/
|
|
90
|
+
private createCellData;
|
|
91
|
+
/**
|
|
92
|
+
* Checks if row has content
|
|
93
|
+
*/
|
|
94
|
+
private hasRowContent;
|
|
95
|
+
/**
|
|
96
|
+
* Creates no data row
|
|
97
|
+
*/
|
|
98
|
+
private createNoDataRow;
|
|
99
|
+
/**
|
|
100
|
+
* Creates error row
|
|
101
|
+
*/
|
|
102
|
+
private createErrorRow;
|
|
103
|
+
/**
|
|
104
|
+
* Extracts styling from cell
|
|
105
|
+
*/
|
|
106
|
+
extractCellStyle(cell: XLSX.CellObject): ExcelCellStyle | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Extracts background color
|
|
109
|
+
*/
|
|
110
|
+
private extractBackgroundColor;
|
|
111
|
+
/**
|
|
112
|
+
* Extracts font color
|
|
113
|
+
*/
|
|
114
|
+
private extractFontColor;
|
|
115
|
+
/**
|
|
116
|
+
* Extracts font formatting
|
|
117
|
+
*/
|
|
118
|
+
private extractFontFormatting;
|
|
119
|
+
/**
|
|
120
|
+
* Extracts borders
|
|
121
|
+
*/
|
|
122
|
+
private extractBorders;
|
|
123
|
+
/**
|
|
124
|
+
* Gets color value from color object
|
|
125
|
+
*/
|
|
126
|
+
private getColorValue;
|
|
127
|
+
/**
|
|
128
|
+
* Converts RGB to hex
|
|
129
|
+
*/
|
|
130
|
+
private rgbToHex;
|
|
131
|
+
/**
|
|
132
|
+
* Extracts theme color dynamically from Excel
|
|
133
|
+
*/
|
|
134
|
+
private extractThemeColor;
|
|
135
|
+
/**
|
|
136
|
+
* Generates a theme color based on index (fallback)
|
|
137
|
+
*/
|
|
138
|
+
private generateThemeColor;
|
|
139
|
+
/**
|
|
140
|
+
* Extracts indexed color dynamically from Excel
|
|
141
|
+
*/
|
|
142
|
+
private extractIndexedColor;
|
|
143
|
+
/**
|
|
144
|
+
* Generates an indexed color based on index (fallback)
|
|
145
|
+
*/
|
|
146
|
+
private generateIndexedColor;
|
|
147
|
+
/**
|
|
148
|
+
* Extracts color palette from Excel workbook
|
|
149
|
+
*/
|
|
150
|
+
private extractWorkbookColors;
|
|
151
|
+
/**
|
|
152
|
+
* Checks if workbook has styling
|
|
153
|
+
*/
|
|
154
|
+
hasWorkbookStyling(workbook: XLSX.WorkBook): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Checks if worksheet has styling
|
|
157
|
+
*/
|
|
158
|
+
private hasWorksheetStyling;
|
|
159
|
+
/**
|
|
160
|
+
* Converts styled data to legacy format
|
|
161
|
+
*/
|
|
162
|
+
convertToLegacyFormat(styledData: ExcelRowData[]): any[][];
|
|
163
|
+
/**
|
|
164
|
+
* Ensures data consistency
|
|
165
|
+
*/
|
|
166
|
+
ensureDataConsistency(styledData: ExcelRowData[]): ExcelRowData[];
|
|
167
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ExcelParserService, never>;
|
|
168
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ExcelParserService>;
|
|
169
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './lib/document/document.module';
|
|
2
2
|
export * from './lib/document/components/document-container/document-container.component';
|
|
3
3
|
export * from './lib/document/components/document-viewer/document-viewer.component';
|
|
4
|
+
export * from './lib/document/components/document-content-viewer/document-content-viewer.component';
|
|
4
5
|
export * from './lib/document/components/document-actions/document-actions.component';
|
|
5
6
|
export * from './lib/document/components/document-history/document-history.component';
|
|
6
7
|
export * from './lib/document/components/document-list/document-list.component';
|
|
@@ -9,6 +10,7 @@ export * from './lib/document/components/sidebar/sidebar.component';
|
|
|
9
10
|
export * from './lib/document/models/document-history.model';
|
|
10
11
|
export * from './lib/document/models/uploaded-file-response.model';
|
|
11
12
|
export * from './lib/document/services/document-table-builder.service';
|
|
13
|
+
export * from './lib/document/services/document-content-type.service';
|
|
12
14
|
export * from './lib/document/directives/document.directive';
|
|
13
15
|
export * from './lib/document/directives/permission.directive';
|
|
14
16
|
export * from './Shared/components/confirmation-dialog/confirmation-dialog.component';
|