cat-documents-ng 0.3.38 → 0.3.40

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.
@@ -2,6 +2,8 @@ import { OnChanges, SimpleChanges, OnInit } from '@angular/core';
2
2
  import { ExcelParserService, ExcelRowData } from '../../services/excel-parser.service';
3
3
  import { CsvParserService, CsvRowData } from '../../services/csv-parser.service';
4
4
  import { DocumentHttpService } from '../../services/document-http.service';
5
+ import { DocumentZoomService } from '../../services/document-zoom.service';
6
+ import { DocumentListItem } from '../../models/document-list-response.model';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * Component for viewing different types of document content.
@@ -13,6 +15,7 @@ export declare class DocumentContentViewerComponent implements OnChanges, OnInit
13
15
  private excelParserService;
14
16
  private csvParserService;
15
17
  private documentHttpService;
18
+ private zoomService;
16
19
  /**
17
20
  * The document URL to display
18
21
  * @type {string}
@@ -28,6 +31,16 @@ export declare class DocumentContentViewerComponent implements OnChanges, OnInit
28
31
  * @type {string}
29
32
  */
30
33
  documentName?: string;
34
+ /**
35
+ * The selected document for display purposes
36
+ * @type {DocumentListItem}
37
+ */
38
+ selectedDocument?: DocumentListItem;
39
+ /**
40
+ * The context ID for the document
41
+ * @type {string}
42
+ */
43
+ contextId?: string;
31
44
  /**
32
45
  * Excel data for display
33
46
  * @type {any}
@@ -94,16 +107,17 @@ export declare class DocumentContentViewerComponent implements OnChanges, OnInit
94
107
  */
95
108
  csvError: string | null;
96
109
  /**
97
- * Configuration for the document viewer
98
- * @type {any}
110
+ * Current zoom level for the document
111
+ * @type {number}
99
112
  */
100
- docViewerConfig: any;
113
+ currentZoom: number;
101
114
  /**
102
115
  * Constructor
103
116
  * @param {ExcelParserService} excelParserService - Service for parsing Excel files
104
117
  * @param {DocumentHttpService} documentHttpService - Service for making HTTP requests with authentication
118
+ * @param {DocumentZoomService} zoomService - Service for handling zoom functionality
105
119
  */
106
- constructor(excelParserService: ExcelParserService, csvParserService: CsvParserService, documentHttpService: DocumentHttpService);
120
+ constructor(excelParserService: ExcelParserService, csvParserService: CsvParserService, documentHttpService: DocumentHttpService, zoomService: DocumentZoomService);
107
121
  /**
108
122
  * Computed property to determine if the document is an image
109
123
  * @type {boolean}
@@ -173,6 +187,14 @@ export declare class DocumentContentViewerComponent implements OnChanges, OnInit
173
187
  * Initializes the component
174
188
  */
175
189
  ngOnInit(): void;
190
+ /**
191
+ * Initializes zoom functionality
192
+ */
193
+ private initializeZoom;
194
+ /**
195
+ * Handles mouse wheel events for zooming
196
+ */
197
+ onWheel(event: WheelEvent): void;
176
198
  /**
177
199
  * Downloads the document
178
200
  */
@@ -224,6 +246,10 @@ export declare class DocumentContentViewerComponent implements OnChanges, OnInit
224
246
  * @returns {boolean} True if CSV data is valid
225
247
  */
226
248
  private isCsvDataValid;
249
+ /**
250
+ * Handles document name update event from zoom controls
251
+ */
252
+ onDocumentNameUpdated(): void;
227
253
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContentViewerComponent, never>;
228
- 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>;
254
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContentViewerComponent, "document-content-viewer", never, { "documentUrl": { "alias": "documentUrl"; "required": false; }; "contentType": { "alias": "contentType"; "required": false; }; "documentName": { "alias": "documentName"; "required": false; }; "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
229
255
  }
@@ -126,33 +126,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
126
126
  * Message to display for document deletion
127
127
  */
128
128
  deleteMessage: Message[];
129
- /**
130
- * The name of the document being edited
131
- */
132
- documentName: string;
133
- /**
134
- * Error message for invalid file names.
135
- */
136
- fileNameError: string;
137
- /**
138
- * The file extension of the document being edited
139
- */
140
- documentExtension: string;
141
- /**
142
- * Controls whether the document name input field is visible for editing
143
- */
144
- isEditingDocumentName: boolean;
145
- /**
146
- * The alias name returned after successful document name update
147
- */
148
- aliasName: string;
149
129
  handleSelectedDocument: EventEmitter<DocumentListItem>;
150
- /**
151
- * Regular expression to match disallowed characters in file names.
152
- * Prevents characters like < > : " / \ | ? *
153
- * @type {RegExp}
154
- */
155
- disallowedCharsRegex: RegExp;
156
130
  /**
157
131
  * Getter to return category labels as they come from the API
158
132
  */
@@ -202,14 +176,6 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
202
176
  * @param {any} rowData - The row data containing the document to delete
203
177
  */
204
178
  handleDeleteAction(rowData: any): void;
205
- /**
206
- * Handles clicking on the document name to enable editing
207
- */
208
- onDocumentNameClick(): void;
209
- /**
210
- * Cancels editing and resets the document name
211
- */
212
- cancelDocumentNameEdit(): void;
213
179
  /**
214
180
  * Closes the document viewer dialog and resets the selected document
215
181
  */
@@ -219,6 +185,17 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
219
185
  * @param {boolean} isDeleteAction - Optional flag indicating if this refresh is due to a delete action
220
186
  */
221
187
  refreshDocumentList(isDeleteAction?: boolean): void;
188
+ /**
189
+ * Handles document status update events from viewer
190
+ * @param event - The status update event
191
+ */
192
+ handleDocumentStatusUpdate(event: {
193
+ actionType?: string;
194
+ }): void;
195
+ /**
196
+ * Handles document name update event from viewer
197
+ */
198
+ handleDocumentNameUpdate(): void;
222
199
  /**
223
200
  * Handles the event when the document viewer is destroyed
224
201
  * Triggers a refresh of the document data
@@ -269,8 +246,6 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
269
246
  * @returns True if the section is visible, false otherwise
270
247
  */
271
248
  private isSelectedMenuItemSectionVisible;
272
- onDocumentNameChange(event: Event): void;
273
- handleSaveClick(): void;
274
249
  /**
275
250
  * Cleanup subscriptions on component destroy
276
251
  */
@@ -100,6 +100,10 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
100
100
  */
101
101
  handleDocumentAction(action: DocumentAction): void;
102
102
  ngOnDestroy(): void;
103
+ /**
104
+ * Handles document name update event from content viewer
105
+ */
106
+ onDocumentNameUpdated(): void;
103
107
  /**
104
108
  * Refreshes document data when the viewer is closed
105
109
  */
@@ -0,0 +1,32 @@
1
+ import { OnInit, OnDestroy, EventEmitter } from '@angular/core';
2
+ import { DocumentZoomService } from '../../services/document-zoom.service';
3
+ import { DocumentHttpService } from '../../services/document-http.service';
4
+ import { DocumentListItem } from '../../models/document-list-response.model';
5
+ import * as i0 from "@angular/core";
6
+ export declare class DocumentZoomControlsComponent implements OnInit, OnDestroy {
7
+ private zoomService;
8
+ private documentHttpService;
9
+ selectedDocument?: DocumentListItem;
10
+ contextId?: string;
11
+ documentNameUpdated: EventEmitter<void>;
12
+ currentZoom: number;
13
+ private subscription;
14
+ isEditingDocumentName: boolean;
15
+ documentName: string;
16
+ fileNameError: string;
17
+ disallowedCharsRegex: RegExp;
18
+ constructor(zoomService: DocumentZoomService, documentHttpService: DocumentHttpService);
19
+ ngOnInit(): void;
20
+ ngOnDestroy(): void;
21
+ get isZoomOutDisabled(): boolean;
22
+ get isZoomInDisabled(): boolean;
23
+ zoomIn(): void;
24
+ zoomOut(): void;
25
+ resetZoom(): void;
26
+ onDocumentNameClick(): void;
27
+ cancelDocumentNameEdit(): void;
28
+ onDocumentNameChange(event: Event): void;
29
+ handleSaveClick(): void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentZoomControlsComponent, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentZoomControlsComponent, "document-zoom-controls", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, { "documentNameUpdated": "documentNameUpdated"; }, never, never, false, never>;
32
+ }
@@ -8,42 +8,43 @@ 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
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";
11
+ import * as i10 from "./components/document-zoom-controls/document-zoom-controls.component";
12
+ import * as i11 from "./directives/document.directive";
13
+ import * as i12 from "./components/linked-document/linked-document.component";
14
+ import * as i13 from "./components/documents-menu/documents-menu.component";
15
+ import * as i14 from "./components/user-list/user-list.component";
16
+ import * as i15 from "./components/document-status/document-status.component";
17
+ import * as i16 from "./components/document-actions/document-actions.component";
18
+ import * as i17 from "./components/document-search/document-search.component";
19
+ import * as i18 from "./components/sidebar/sidebar.component";
20
+ import * as i19 from "@angular/common";
21
+ import * as i20 from "primeng/accordion";
22
+ import * as i21 from "@angular/common/http";
23
+ import * as i22 from "primeng/button";
24
+ import * as i23 from "primeng/sidebar";
25
+ import * as i24 from "primeng/fileupload";
26
+ import * as i25 from "primeng/progressbar";
27
+ import * as i26 from "primeng/badge";
28
+ import * as i27 from "primeng/listbox";
29
+ import * as i28 from "primeng/checkbox";
30
+ import * as i29 from "primeng/radiobutton";
31
+ import * as i30 from "primeng/timeline";
32
+ import * as i31 from "primeng/inputtextarea";
33
+ import * as i32 from "@angular/forms";
34
+ import * as i33 from "ng2-pdf-viewer";
35
+ import * as i34 from "ngx-doc-viewer";
36
+ import * as i35 from "primeng/dialog";
37
+ import * as i36 from "primeng/dropdown";
38
+ import * as i37 from "primeng/inputtext";
39
+ import * as i38 from "primeng/menu";
40
+ import * as i39 from "primeng/panelmenu";
41
+ import * as i40 from "primeng/card";
42
+ import * as i41 from "primeng/table";
43
+ import * as i42 from "../../Shared/shared.module";
44
+ import * as i43 from "primeng/toast";
45
+ import * as i44 from "primeng/tooltip";
46
+ import * as i45 from "primeng/messages";
47
+ import * as i46 from "primeng/message";
47
48
  /**
48
49
  * @module DocumentModule
49
50
  *
@@ -53,6 +54,6 @@ import * as i45 from "primeng/message";
53
54
  */
54
55
  export declare class DocumentModule {
55
56
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
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]>;
57
+ 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.DocumentZoomControlsComponent, typeof i11.DocumentDirective, typeof i12.LinkedDocumentComponent, typeof i13.DocumentsMenuComponent, typeof i14.UserListComponent, typeof i15.DocumentStatusComponent, typeof i16.DocumentActionsComponent, typeof i17.DocumentSearchComponent, typeof i18.SidebarComponent], [typeof i19.CommonModule, typeof i20.AccordionModule, typeof i21.HttpClientModule, typeof i22.ButtonModule, typeof i23.SidebarModule, typeof i24.FileUploadModule, typeof i25.ProgressBarModule, typeof i26.BadgeModule, typeof i27.ListboxModule, typeof i28.CheckboxModule, typeof i29.RadioButtonModule, typeof i30.TimelineModule, typeof i31.InputTextareaModule, typeof i32.FormsModule, typeof i33.PdfViewerModule, typeof i34.NgxDocViewerModule, typeof i35.DialogModule, typeof i36.DropdownModule, typeof i37.InputTextModule, typeof i38.MenuModule, typeof i39.PanelMenuModule, typeof i40.CardModule, typeof i41.TableModule, typeof i42.SharedModule, typeof i31.InputTextareaModule, typeof i43.ToastModule, typeof i44.TooltipModule, typeof i45.MessagesModule, typeof i46.MessageModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i9.DocumentContentViewerComponent, typeof i10.DocumentZoomControlsComponent, typeof i16.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i11.DocumentDirective, typeof i17.DocumentSearchComponent, typeof i18.SidebarComponent]>;
57
58
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
58
59
  }
@@ -0,0 +1,51 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export interface ZoomConfig {
4
+ defaultZoom: number;
5
+ zoomStep: number;
6
+ minZoom: number;
7
+ maxZoom: number;
8
+ }
9
+ export declare class DocumentZoomService {
10
+ private readonly DEFAULT_CONFIG;
11
+ private zoomLevelSubject;
12
+ private config;
13
+ /**
14
+ * Gets the current zoom level as an observable
15
+ */
16
+ get zoomLevel$(): Observable<number>;
17
+ /**
18
+ * Gets the current zoom level value
19
+ */
20
+ get currentZoom(): number;
21
+ /**
22
+ * Gets the current zoom configuration
23
+ */
24
+ get zoomConfig(): ZoomConfig;
25
+ /**
26
+ * Sets custom zoom configuration
27
+ */
28
+ setZoomConfig(config: Partial<ZoomConfig>): void;
29
+ /**
30
+ * Zooms in by the configured step
31
+ */
32
+ zoomIn(): void;
33
+ /**
34
+ * Zooms out by the configured step
35
+ */
36
+ zoomOut(): void;
37
+ /**
38
+ * Sets zoom to a specific level
39
+ */
40
+ setZoom(zoom: number): void;
41
+ /**
42
+ * Resets zoom to default level
43
+ */
44
+ resetZoom(): void;
45
+ /**
46
+ * Handles mouse wheel zoom
47
+ */
48
+ handleWheelZoom(event: WheelEvent, zoomFactor?: number): void;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentZoomService, never>;
50
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentZoomService>;
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.38",
3
+ "version": "0.3.40",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
package/public-api.d.ts CHANGED
@@ -2,6 +2,7 @@ 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
4
  export * from './lib/document/components/document-content-viewer/document-content-viewer.component';
5
+ export * from './lib/document/components/document-zoom-controls/document-zoom-controls.component';
5
6
  export * from './lib/document/components/document-actions/document-actions.component';
6
7
  export * from './lib/document/components/document-history/document-history.component';
7
8
  export * from './lib/document/components/document-list/document-list.component';
@@ -11,6 +12,7 @@ export * from './lib/document/models/document-history.model';
11
12
  export * from './lib/document/models/uploaded-file-response.model';
12
13
  export * from './lib/document/services/document-table-builder.service';
13
14
  export * from './lib/document/services/document-content-type.service';
15
+ export * from './lib/document/services/document-zoom.service';
14
16
  export * from './lib/document/directives/document.directive';
15
17
  export * from './lib/document/directives/permission.directive';
16
18
  export * from './Shared/components/confirmation-dialog/confirmation-dialog.component';