cat-documents-ng 1.0.13 → 1.0.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.
@@ -35,6 +35,39 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
35
35
  * The currently selected menu item ID for scrolling
36
36
  */
37
37
  selectedMenuItemId: string | null;
38
+ /**
39
+ * Callback function to handle opening a document in a new tab when Ctrl+Click is used.
40
+ * This callback is called directly from the user gesture (preserving the gesture chain),
41
+ * BEFORE any Angular change detection, so window.open() will work without popup blockers.
42
+ *
43
+ * IMPORTANT: Build your URL synchronously and call window.open() immediately. Do NOT:
44
+ * - Use setTimeout, Promise, async/await
45
+ * - Use Angular Router.navigate() (use window.open() with URL string instead)
46
+ * - Trigger any operations that cause change detection before window.open()
47
+ *
48
+ * Best practice implementation:
49
+ *
50
+ * ```typescript
51
+ * onOpenInNewTab = (event: { selectedDocument: any, contextId: string, documentList: any[] }) => {
52
+ * // Build URL synchronously (no async operations)
53
+ * const baseUrl = window.location.origin;
54
+ * const params = new URLSearchParams({
55
+ * selectedDocument: JSON.stringify(event.selectedDocument),
56
+ * contextId: event.contextId,
57
+ * documentList: JSON.stringify(event.documentList)
58
+ * });
59
+ * const url = `${baseUrl}/your-route?${params.toString()}`;
60
+ *
61
+ * // Call window.open() immediately - this preserves the user gesture chain
62
+ * const newWindow = window.open(url, '_blank');
63
+ * if (newWindow) {
64
+ * newWindow.focus(); // Focus the new tab
65
+ * }
66
+ * }
67
+ * ```
68
+ *
69
+ * @param event - The event object containing selectedDocument, contextId, and documentList
70
+ */
38
71
  onOpenInNewTab?: (event: {
39
72
  selectedDocument: any;
40
73
  contextId: string;
@@ -62,6 +62,44 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
62
62
  contextId: string;
63
63
  documentList: DocumentListItem[];
64
64
  }>;
65
+ /**
66
+ * Callback function to handle opening a document in a new tab when Ctrl+Click is used.
67
+ * This callback is called directly from the user gesture (preserving the gesture chain),
68
+ * BEFORE any Angular change detection, so window.open() will work without popup blockers.
69
+ *
70
+ * IMPORTANT: Build your URL synchronously and call window.open() immediately. Do NOT:
71
+ * - Use setTimeout, Promise, async/await
72
+ * - Use Angular Router.navigate() (use window.open() with URL string instead)
73
+ * - Trigger any operations that cause change detection before window.open()
74
+ *
75
+ * Best practice implementation:
76
+ *
77
+ * ```typescript
78
+ * onOpenInNewTab = (event: { selectedDocument: any, contextId: string, documentList: any[] }) => {
79
+ * // Build URL synchronously (no async operations)
80
+ * const baseUrl = window.location.origin;
81
+ * const params = new URLSearchParams({
82
+ * selectedDocument: JSON.stringify(event.selectedDocument),
83
+ * contextId: event.contextId,
84
+ * documentList: JSON.stringify(event.documentList)
85
+ * });
86
+ * const url = `${baseUrl}/your-route?${params.toString()}`;
87
+ *
88
+ * // Call window.open() immediately - this preserves the user gesture chain
89
+ * const newWindow = window.open(url, '_blank');
90
+ * if (newWindow) {
91
+ * newWindow.focus(); // Focus the new tab
92
+ * }
93
+ * }
94
+ * ```
95
+ *
96
+ * @param event - The event object containing selectedDocument, contextId, and documentList
97
+ */
98
+ onOpenInNewTab?: (event: {
99
+ selectedDocument: any;
100
+ contextId: string;
101
+ documentList: any[];
102
+ }) => void;
65
103
  /**
66
104
  * The currently selected document.
67
105
  * @type {DocumentModel}
@@ -295,5 +333,5 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
295
333
  */
296
334
  ngOnDestroy(): void;
297
335
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
298
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentListResponse": { "alias": "documentListResponse"; "required": false; }; "selectedMenuItemId": { "alias": "selectedMenuItemId"; "required": false; }; "navigationInfo": { "alias": "navigationInfo"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "handleSelectedDocumentInNewTab": "handleSelectedDocumentInNewTab"; "handleSelectedDocument": "handleSelectedDocument"; }, never, ["*"], false, never>;
336
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentListResponse": { "alias": "documentListResponse"; "required": false; }; "selectedMenuItemId": { "alias": "selectedMenuItemId"; "required": false; }; "navigationInfo": { "alias": "navigationInfo"; "required": false; }; "onOpenInNewTab": { "alias": "onOpenInNewTab"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "handleSelectedDocumentInNewTab": "handleSelectedDocumentInNewTab"; "handleSelectedDocument": "handleSelectedDocument"; }, never, ["*"], false, never>;
299
337
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"