@paperless/angular 1.45.0 → 1.47.0

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.
@@ -1,9 +1,10 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, QueryList, SimpleChanges, TemplateRef } from '@angular/core';
2
+ import { Params } from '@angular/router';
2
3
  import { QuickFilter, RowClickEvent } from '@paperless/core';
3
4
  import { IconVariant, IllustrationVariant } from '@paperless/core/dist/types/components';
4
5
  import { BehaviorSubject } from 'rxjs';
5
6
  import { TableColumn } from '../table-column/table-column.component';
6
- import { TableRowAction } from '../table-row-action/table-row-action.component';
7
+ import { AsyncItem, TableRowAction, TableRowActionQueryParams, TableRowActionRouterLink } from '../table-row-action/table-row-action.component';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class Table implements OnInit, OnChanges {
9
10
  private _changeDetection;
@@ -277,6 +278,8 @@ export declare class Table implements OnInit, OnChanges {
277
278
  _selectionContainsAll(): boolean;
278
279
  _selectionIndeterminate(): boolean;
279
280
  _rowClick($event: MouseEvent, index: number): void;
281
+ _getActionRouterLink(routerLink: TableRowActionRouterLink, rowIndex: number): BehaviorSubject<string | any[]> | AsyncItem<string | any[]>;
282
+ _getActionQueryParams(queryParams: TableRowActionQueryParams, rowIndex: number): BehaviorSubject<Params> | AsyncItem<Params>;
280
283
  _rowActionClick(action: TableRowAction, rowIndex?: number): void;
281
284
  private _findRow;
282
285
  private _findRowAction;
@@ -1,5 +1,8 @@
1
1
  import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { Params } from '@angular/router';
2
3
  import { Components } from '@paperless/core';
4
+ import { TableRowActionShowFunc } from '@paperless/core/dist/types/components';
5
+ import { Observable, Subscribable } from 'rxjs';
3
6
  import * as i0 from "@angular/core";
4
7
  export interface TableRowActionClickEvent {
5
8
  item?: any;
@@ -7,9 +10,13 @@ export interface TableRowActionClickEvent {
7
10
  multi: boolean;
8
11
  ctrlDown: boolean;
9
12
  }
10
- export declare interface TableRowAction extends Omit<Components.PTableRowAction, 'action'> {
13
+ export declare interface TableRowAction extends Omit<Components.PTableRowAction, 'action' | 'showFunction'> {
11
14
  action: EventEmitter<TableRowActionClickEvent>;
15
+ showFunction?: TableRowActionShowFunc;
12
16
  }
17
+ export declare type AsyncItem<T> = Observable<T> | Subscribable<T> | Promise<T>;
18
+ export declare type TableRowActionRouterLink = string | any[] | AsyncItem<string | any[]> | ((item: any) => AsyncItem<string | any[]> | string | any[]);
19
+ export declare type TableRowActionQueryParams = Params | AsyncItem<Params> | ((item: any) => Params | AsyncItem<Params>);
13
20
  export declare class TableRowAction implements OnChanges {
14
21
  private _c;
15
22
  protected z: NgZone;
@@ -17,7 +24,11 @@ export declare class TableRowAction implements OnChanges {
17
24
  /**
18
25
  * Routerlink to navigate to
19
26
  */
20
- routerLink?: string | any[];
27
+ routerLink?: TableRowActionRouterLink;
28
+ /**
29
+ * Queryparams to add to the navigation
30
+ */
31
+ queryParams?: TableRowActionQueryParams;
21
32
  /**
22
33
  * Event whenever a row is clicked
23
34
  */
@@ -26,8 +37,12 @@ export declare class TableRowAction implements OnChanges {
26
37
  * Event whenever loading has changed
27
38
  */
28
39
  _loadingChanged: EventEmitter<boolean>;
40
+ /**
41
+ * A function for row actions of type "single" or "both" that determines if the action is shown on the row
42
+ */
43
+ showFunction?: TableRowActionShowFunc;
29
44
  constructor(_c: ChangeDetectorRef, z: NgZone, r: ElementRef);
30
45
  ngOnChanges(changes: SimpleChanges): void;
31
46
  static ɵfac: i0.ɵɵFactoryDeclaration<TableRowAction, never>;
32
- static ɵcmp: i0.ɵɵComponentDeclaration<TableRowAction, "p-table-row-action", never, { "disabled": "disabled"; "icon": "icon"; "iconFlip": "iconFlip"; "iconOnly": "iconOnly"; "iconRotate": "iconRotate"; "label": "label"; "type": "type"; "loading": "loading"; "routerLink": "routerLink"; }, { "action": "action"; "_loadingChanged": "_loadingChanged"; }, never, ["*"], false, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableRowAction, "p-table-row-action", never, { "disabled": "disabled"; "icon": "icon"; "iconFlip": "iconFlip"; "iconOnly": "iconOnly"; "iconRotate": "iconRotate"; "label": "label"; "type": "type"; "loading": "loading"; "routerLink": "routerLink"; "queryParams": "queryParams"; "showFunction": "showFunction"; }, { "action": "action"; "_loadingChanged": "_loadingChanged"; }, never, ["*"], false, never>;
33
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paperless/angular",
3
- "version": "1.45.0",
3
+ "version": "1.47.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^13.3.0 || ^14.0.0 || ^15.0.0 || ^17.0.0",
6
6
  "@angular/common": "^13.3.0 || ^14.0.0 || ^15.0.0",