@posiwise/dashboard-module 0.0.154 → 0.0.155

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posiwise/dashboard-module",
3
- "version": "0.0.154",
3
+ "version": "0.0.155",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.2.0",
6
6
  "@angular/core": "^22.2.0"
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectorRef, InjectionToken, Injector, OnDestroy, OnInit, Type } from "@angular/core";
2
+ import { ChangeDetectorRef, EventEmitter, InjectionToken, Injector, OnDestroy, OnInit, Type } from "@angular/core";
3
3
  import * as i10 from "@angular/common";
4
4
  import * as i11 from "@angular/forms";
5
5
  import * as i15 from "@posiwise/pipes";
@@ -12,13 +12,14 @@ import * as i18 from "primeng/radiobutton";
12
12
  import * as i16 from "primeng/progressspinner";
13
13
  import { DomSanitizer, SafeHtml, SafeResourceUrl } from "@angular/platform-browser";
14
14
  import { AppBaseComponent } from "@posiwise/app-base-component";
15
- import { CommonService, DashboardService, HopscotchService, NotificationService, ProductService } from "@posiwise/common-services";
15
+ import { CommonService, DashboardService, HopscotchService, NotificationCounts, NotificationService, ProductService } from "@posiwise/common-services";
16
16
  import { FAQ, GlobalSearchResponse, Product, User } from "@posiwise/common-utilities";
17
+ import { Observable, Subscription } from "rxjs";
18
+ import * as i20 from "@posiwise/shared-components";
19
+ import { ConfirmDialogService, NotificationNote, NotificationOpenerService } from "@posiwise/shared-components";
17
20
  import * as i12 from "@angular/router";
18
21
  import { ActivatedRoute } from "@angular/router";
19
22
  import * as i19 from "primeng/tooltip";
20
- import * as i20 from "@posiwise/shared-components";
21
- import { Observable, Subscription } from "rxjs";
22
23
  declare namespace documentation_view_component_d_exports {
23
24
  export { DocumentationComponent };
24
25
  }
@@ -228,65 +229,105 @@ export declare class HomeComponent extends AppBaseComponent implements OnInit, O
228
229
  }]>;
229
230
  static ɵcmp: i0.ɵɵComponentDeclaration<HomeComponent, "pw-home", never, {}, {}, never, never, false, never>;
230
231
  }
232
+ type RowActionName = 'dismiss' | 'delete' | 'restore';
233
+ /** What a finished row action did, so the page can move its tab counts. */
234
+ type NoteMoved = 'dismissed' | 'restored' | 'deleted';
235
+ interface RowActionHost {
236
+ busyId: number | null;
237
+ busyAction: RowActionName | null;
238
+ }
239
+ /** The clicked action's icon spins and every action is disabled until the request settles, either way. */
240
+ declare function rowAction<T>(host: RowActionHost, id: number, action: RowActionName, request: Observable<T>, cdr: ChangeDetectorRef): Observable<T>;
241
+ /** Fades the notes a read event covers: one note, or every note for "mark all as read". */
242
+ declare function applyReadEvent(notes: {
243
+ id: number;
244
+ unread?: boolean | null;
245
+ }[], event: {
246
+ id: number | 'all';
247
+ }): void;
231
248
  declare namespace notifications_page_component_d_exports {
232
249
  export { NotificationsPageComponent };
233
250
  }
234
- export declare class NotificationsPageComponent {
251
+ export declare class NotificationsPageComponent implements OnInit {
252
+ private readonly notificationService;
253
+ private readonly cdr;
254
+ counts: NotificationCounts | null;
255
+ constructor(notificationService: NotificationService, cdr: ChangeDetectorRef);
256
+ ngOnInit(): void;
257
+ onMoved(moved: NoteMoved): void;
235
258
  static ɵfac: i0.ɵɵFactoryDeclaration<NotificationsPageComponent, never>;
236
259
  static ɵcmp: i0.ɵɵComponentDeclaration<NotificationsPageComponent, "pw-notifications-page", never, {}, {}, never, never, false, never>;
237
260
  }
238
261
  declare namespace current_notifications_component_d_exports {
239
262
  export { CurrentNotificationsComponent };
240
263
  }
241
- export declare class CurrentNotificationsComponent implements OnInit {
264
+ export declare class CurrentNotificationsComponent implements OnInit, RowActionHost {
242
265
  private readonly notificationService;
266
+ private readonly opener;
243
267
  private readonly cdr;
268
+ readonly moved: EventEmitter<NoteMoved>;
244
269
  notificationCount: number;
245
270
  noNoti: boolean;
271
+ busyId: number | null;
272
+ busyAction: RowActionName | null;
273
+ private readonly destroyRef;
246
274
  itemsPerPage: number;
247
275
  notifications: any[];
248
276
  currentPage: number;
249
277
  isLoaded: boolean;
250
278
  totalPages: number;
251
279
  totalRecords: number;
252
- constructor(notificationService: NotificationService, cdr: ChangeDetectorRef);
280
+ constructor(notificationService: NotificationService, opener: NotificationOpenerService, cdr: ChangeDetectorRef);
253
281
  ngOnInit(): void;
254
282
  private getNotifications;
255
283
  nextPage(): void;
256
284
  previousPage(): void;
257
285
  dismiss(id: number, e: any): void;
286
+ open(note: NotificationNote): void;
258
287
  trackByNotification(_index: number, item: {
259
288
  id: number;
260
289
  }): number;
261
290
  static ɵfac: i0.ɵɵFactoryDeclaration<CurrentNotificationsComponent, never>;
262
- static ɵcmp: i0.ɵɵComponentDeclaration<CurrentNotificationsComponent, "pw-current-notifications", never, {}, {}, never, never, false, never>;
291
+ static ɵcmp: i0.ɵɵComponentDeclaration<CurrentNotificationsComponent, "pw-current-notifications", never, {}, {
292
+ "moved": "moved";
293
+ }, never, never, false, never>;
263
294
  }
264
295
  declare namespace dismissed_notifications_component_d_exports {
265
296
  export { DismissedNotificationsComponent };
266
297
  }
267
- export declare class DismissedNotificationsComponent implements OnInit {
298
+ export declare class DismissedNotificationsComponent implements OnInit, RowActionHost {
268
299
  private readonly notificationService;
300
+ private readonly opener;
301
+ private readonly confirmDialog;
269
302
  private readonly cdr;
303
+ readonly moved: EventEmitter<NoteMoved>;
270
304
  notificationCount: number;
271
305
  noNoti: boolean;
306
+ busyId: number | null;
307
+ busyAction: RowActionName | null;
308
+ private readonly destroyRef;
272
309
  dismissedNotifications: any[];
273
310
  isLoaded: boolean;
274
311
  itemsPerPage: number;
275
312
  currentPage: number;
276
313
  totalPages: number;
277
314
  totalRecords: number;
278
- constructor(notificationService: NotificationService, cdr: ChangeDetectorRef);
315
+ constructor(notificationService: NotificationService, opener: NotificationOpenerService, confirmDialog: ConfirmDialogService, cdr: ChangeDetectorRef);
279
316
  ngOnInit(): void;
280
317
  private getNotifications;
281
318
  nextPage(): void;
282
319
  previousPage(): void;
283
320
  dismiss(id: number, e: any): void;
284
321
  restoreNotification(id: number, e: any): void;
322
+ private removeAfter;
323
+ open(note: NotificationNote): void;
285
324
  trackByNotification(_index: number, item: {
286
325
  id: number;
287
326
  }): number;
288
327
  static ɵfac: i0.ɵɵFactoryDeclaration<DismissedNotificationsComponent, never>;
289
- static ɵcmp: i0.ɵɵComponentDeclaration<DismissedNotificationsComponent, "pw-dismissed-notifications", never, {}, {}, never, never, false, never>;
328
+ static ɵcmp: i0.ɵɵComponentDeclaration<DismissedNotificationsComponent, "pw-dismissed-notifications", never, {}, {
329
+ "moved": "moved";
330
+ }, never, never, false, never>;
290
331
  }
291
332
  declare namespace search_component_d_exports {
292
333
  export { SearchComponent };