cat-documents-ng 0.3.15 → 0.3.16

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.
@@ -7,6 +7,7 @@ import { DocumentTableBuilderService } from './document-table-builder.service';
7
7
  import { DocumentHelperService } from './document.service';
8
8
  import { DocumentListItem, DocumentListResponse } from '../models/document-list-response.model';
9
9
  import { TableData } from '../../../Shared/components/table-primary/table-primary.model';
10
+ import { DocumentSeverityService } from './document-severity.service';
10
11
  import * as i0 from "@angular/core";
11
12
  export declare class DocumentListService {
12
13
  private documentUploadService;
@@ -15,7 +16,8 @@ export declare class DocumentListService {
15
16
  private documentStore;
16
17
  private documentTableBuilder;
17
18
  private documentHelperService;
18
- constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService, documentQuery: DocumentQuery, documentStore: DocumentStore, documentTableBuilder: DocumentTableBuilderService, documentHelperService: DocumentHelperService);
19
+ private documentSeverityService;
20
+ constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService, documentQuery: DocumentQuery, documentStore: DocumentStore, documentTableBuilder: DocumentTableBuilderService, documentHelperService: DocumentHelperService, documentSeverityService: DocumentSeverityService);
19
21
  /**
20
22
  * Handle file upload click event
21
23
  */
@@ -51,12 +53,6 @@ export declare class DocumentListService {
51
53
  categoryCompletionCounts: string[];
52
54
  categorySeverities: ('success' | 'info' | 'warning' | 'danger')[];
53
55
  };
54
- /**
55
- * Calculate severity for a category based on document statuses
56
- * @param category The document category
57
- * @returns Severity level for the category
58
- */
59
- private calculateCategorySeverity;
60
56
  /**
61
57
  * Handle table row click
62
58
  */
@@ -1,9 +1,11 @@
1
1
  import { DocumentCategory, DocumentCategoryItem } from '../models/document-category.model';
2
2
  import { DocumentStore } from '../state/document.store';
3
+ import { DocumentSeverityService } from './document-severity.service';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DocumentMenuService {
5
6
  private documentStore;
6
- constructor(documentStore: DocumentStore);
7
+ private documentSeverityService;
8
+ constructor(documentStore: DocumentStore, documentSeverityService: DocumentSeverityService);
7
9
  /**
8
10
  * Sorts categories alphabetically by label
9
11
  * @param categories - The list of document categories to sort
@@ -0,0 +1,33 @@
1
+ import { DocumentListItem } from '../models/document-list-response.model';
2
+ import * as i0 from "@angular/core";
3
+ export type SeverityLevel = 'success' | 'info' | 'warning' | 'danger';
4
+ export declare class DocumentSeverityService {
5
+ constructor();
6
+ /**
7
+ * Calculate severity for a list of documents based on their statuses
8
+ * This is the centralized severity calculation logic used across the application
9
+ * @param documents The list of documents to calculate severity for
10
+ * @returns Severity level for the document list
11
+ */
12
+ calculateSeverity(documents: DocumentListItem[]): SeverityLevel;
13
+ /**
14
+ * Calculate severity for a category based on document statuses
15
+ * @param category The document category
16
+ * @returns Severity level for the category
17
+ */
18
+ calculateCategorySeverity(category: any): SeverityLevel;
19
+ /**
20
+ * Calculate severity for a menu item based on status counts
21
+ * @param status The status object with counts
22
+ * @returns Severity level for the menu item
23
+ */
24
+ calculateMenuItemSeverity(status: any): SeverityLevel;
25
+ /**
26
+ * Helper method to get total count from status object
27
+ * @param status The status object
28
+ * @returns Total count
29
+ */
30
+ private getTotalFromStatus;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentSeverityService, never>;
32
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentSeverityService>;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"