@rxap/material-table-system 13.3.1 → 13.5.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.
@@ -38,6 +38,7 @@ export declare class TableDataSourceDirective<Data extends Record<string, any> =
38
38
  parameters?: Observable<Record<string, any>>;
39
39
  dataSource?: AbstractTableDataSource<Data>;
40
40
  method?: Method<Data[], TableEvent>;
41
+ readonly hasError$: ToggleSubject;
41
42
  /**
42
43
  * @deprecated use method instead
43
44
  */
@@ -53,6 +54,7 @@ export declare class TableDataSourceDirective<Data extends Record<string, any> =
53
54
  ngOnInit(): void;
54
55
  ngOnDestroy(): void;
55
56
  refresh(): void;
57
+ retry(): void;
56
58
  static ɵfac: i0.ɵɵFactoryDeclaration<TableDataSourceDirective<any>, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
57
59
  static ɵdir: i0.ɵɵDirectiveDeclaration<TableDataSourceDirective<any>, "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", ["rxapTableDataSource"], { "setDataSource": "rxapTableDataSource"; "paginator": "paginator"; "id": "id"; "parameters": "parameters"; "dataSource": "dataSource"; }, {}, never>;
58
60
  }
@@ -1,4 +1,42 @@
1
1
  import { RowActionCheckFunction } from './types';
2
+ /**
3
+ * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
4
+ */
2
5
  export declare const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = "rxap-table-action-method-type-metadata";
6
+ export declare const RXAP_TABLE_ACTION_METHOD_METADATA = "rxap-table-action-method-metadata";
7
+ /**
8
+ * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
9
+ */
3
10
  export declare const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = "rxap-table-action-method-check-function-metadata";
4
- export declare function TableActionMethod<Data = unknown>(type: string, checkFunction?: RowActionCheckFunction<Data>): (target: any) => void;
11
+ export interface TableActionMethodOptions<Data = unknown> {
12
+ type: string;
13
+ checkFunction?: RowActionCheckFunction<Data>;
14
+ /**
15
+ * If true, the table will be refreshed after the action is executed.
16
+ */
17
+ refresh?: boolean;
18
+ /**
19
+ * If true, the user will be asked to confirm the action before execution.
20
+ */
21
+ confirm?: boolean;
22
+ /**
23
+ * The tooltip of the action button.
24
+ */
25
+ tooltip?: string;
26
+ /**
27
+ * The error message that will be displayed if the action fails.
28
+ */
29
+ errorMessage?: string;
30
+ /**
31
+ * The success message that will be displayed if the action succeeds.
32
+ */
33
+ successMessage?: string;
34
+ /**
35
+ * The priority of the action. If multiple action with the same type exists.
36
+ * The action with the highest priority will be used. To set the defaults for
37
+ * the directive.
38
+ */
39
+ priority?: number;
40
+ }
41
+ export declare function TableActionMethod<Data = unknown>(options: TableActionMethodOptions): ClassDecorator;
42
+ export declare function TableActionMethod<Data = unknown>(type: string, checkFunction?: RowActionCheckFunction<Data>): ClassDecorator;
@@ -1,15 +1,20 @@
1
- import { ChangeDetectorRef, ViewContainerRef } from '@angular/core';
1
+ import { ChangeDetectorRef, ViewContainerRef, OnInit, ElementRef } from '@angular/core';
2
2
  import { MatButton } from '@angular/material/button';
3
3
  import { MatSnackBar } from '@angular/material/snack-bar';
4
4
  import { TableDataSourceDirective } from '../table-data-source.directive';
5
5
  import { TableRowActionMethod } from './types';
6
+ import { TableActionMethodOptions } from './decorators';
7
+ import { MatTooltip } from '@angular/material/tooltip';
8
+ import { ConfirmDirective } from '@rxap/components';
9
+ import { Overlay } from '@angular/cdk/overlay';
6
10
  import * as i0 from "@angular/core";
7
- export declare class TableRowActionDirective<Data extends Record<string, any>> {
11
+ export declare class TableRowActionDirective<Data extends Record<string, any>> extends ConfirmDirective implements OnInit {
8
12
  protected readonly cdr: ChangeDetectorRef;
9
13
  private readonly vcr;
10
14
  private readonly tableDataSourceDirective;
11
15
  private readonly snackBar;
12
16
  private readonly matButton;
17
+ private readonly matTooltip;
13
18
  private _hasConfirmDirective;
14
19
  set hasConfirmDirective(value: any);
15
20
  element: Data;
@@ -24,7 +29,9 @@ export declare class TableRowActionDirective<Data extends Record<string, any>> {
24
29
  private _currentStatus;
25
30
  private readonly actionMethodList;
26
31
  private _actionDisabled;
27
- constructor(actionMethodList: Array<TableRowActionMethod<Data>> | TableRowActionMethod<Data>, cdr: ChangeDetectorRef, vcr: ViewContainerRef, tableDataSourceDirective: TableDataSourceDirective, snackBar: MatSnackBar, matButton: MatButton | null);
32
+ protected options: TableActionMethodOptions | null;
33
+ constructor(overlay: Overlay, elementRef: ElementRef, actionMethodList: Array<TableRowActionMethod<Data>> | TableRowActionMethod<Data>, cdr: ChangeDetectorRef, vcr: ViewContainerRef, tableDataSourceDirective: TableDataSourceDirective, snackBar: MatSnackBar, matButton: MatButton | null, matTooltip: MatTooltip | null);
34
+ ngOnInit(): void;
28
35
  onConfirmed(): Promise<void>;
29
36
  onClick($event: Event): Promise<void>;
30
37
  execute(): Promise<void>;
@@ -59,6 +66,7 @@ export declare class TableRowActionDirective<Data extends Record<string, any>> {
59
66
  */
60
67
  protected setButtonEnabled(): void;
61
68
  private setStatus;
62
- static ɵfac: i0.ɵɵFactoryDeclaration<TableRowActionDirective<any>, [null, null, null, null, null, { optional: true; }]>;
69
+ private getTableActionOptions;
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableRowActionDirective<any>, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
63
71
  static ɵdir: i0.ɵɵDirectiveDeclaration<TableRowActionDirective<any>, "button[rxapTableRowAction]", never, { "hasConfirmDirective": "rxapConfirm"; "element": "element"; "type": "rxapTableRowAction"; "errorMessage": "errorMessage"; "successMessage": "successMessage"; "refresh": "refresh"; }, {}, ["executingDirective"]>;
64
72
  }
@@ -1,5 +1,8 @@
1
+ import { TableActionMethodOptions } from './decorators';
1
2
  import { TableRowActionMethod, TableRowActionTypeMethod, TableRowActionTypeSwitchMethod, RowActionCheckFunction } from './types';
2
3
  export declare function IsTableRowActionTypeSwitchMethod<Data extends Record<string, any>>(method: TableRowActionMethod<Data>): method is TableRowActionTypeSwitchMethod<Data>;
3
4
  export declare function IsTableRowActionTypeMethod<Data extends Record<string, any>>(type: string): (method: TableRowActionMethod<Data>) => method is TableRowActionTypeMethod<Data>;
4
5
  export declare function HasTableRowActionCheckFunction(method: TableRowActionMethod<any>): boolean;
5
6
  export declare function GetTableRowActionCheckFunction<Data>(method: TableRowActionMethod<Data>): RowActionCheckFunction<Data>;
7
+ export declare function HasTableRowActionMetadata(method: TableRowActionMethod): boolean;
8
+ export declare function GetTableRowActionMetadata(method: TableRowActionMethod): TableActionMethodOptions;
@@ -3,14 +3,14 @@ import * as i1 from "./table-row-action.directive";
3
3
  import * as i2 from "./table-row-action-executing.directive";
4
4
  import * as i3 from "./table-row-header-action.directive";
5
5
  import * as i4 from "./row-action-check.pipe";
6
- import * as i5 from "@angular/material/tooltip";
7
- import * as i6 from "@angular/material/button";
8
- import * as i7 from "@rxap/components";
6
+ import * as i5 from "@rxap/components";
7
+ import * as i6 from "@angular/material/tooltip";
8
+ import * as i7 from "@angular/material/button";
9
9
  import * as i8 from "@angular/material/icon";
10
10
  import * as i9 from "@angular/material/progress-bar";
11
11
  import * as i10 from "@angular/common";
12
12
  export declare class TableRowActionsModule {
13
13
  static ɵfac: i0.ɵɵFactoryDeclaration<TableRowActionsModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<TableRowActionsModule, [typeof i1.TableRowActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i3.TableRowHeaderActionDirective, typeof i4.RowActionCheckPipe], never, [typeof i1.TableRowActionDirective, typeof i3.TableRowHeaderActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i4.RowActionCheckPipe, typeof i5.MatTooltipModule, typeof i6.MatButtonModule, typeof i7.ConfirmComponentModule, typeof i8.MatIconModule, typeof i9.MatProgressBarModule, typeof i10.CommonModule]>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TableRowActionsModule, [typeof i1.TableRowActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i3.TableRowHeaderActionDirective, typeof i4.RowActionCheckPipe], [typeof i5.ConfirmComponentModule], [typeof i1.TableRowActionDirective, typeof i3.TableRowHeaderActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i4.RowActionCheckPipe, typeof i6.MatTooltipModule, typeof i7.MatButtonModule, typeof i5.ConfirmComponentModule, typeof i8.MatIconModule, typeof i9.MatProgressBarModule, typeof i10.CommonModule]>;
15
15
  static ɵinj: i0.ɵɵInjectorDeclaration<TableRowActionsModule>;
16
16
  }
@@ -1,19 +1,21 @@
1
- import { ChangeDetectorRef, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
1
+ import { ChangeDetectorRef, OnDestroy, OnInit, ViewContainerRef, ElementRef } from '@angular/core';
2
2
  import { MatButton } from '@angular/material/button';
3
3
  import { MatSnackBar } from '@angular/material/snack-bar';
4
4
  import { TableRowActionDirective } from './table-row-action.directive';
5
5
  import { TableDataSourceDirective } from '../table-data-source.directive';
6
6
  import { SelectRowService } from '../select-row/select-row.service';
7
7
  import { TableRowActionMethod } from './types';
8
+ import { Overlay } from '@angular/cdk/overlay';
9
+ import { MatTooltip } from '@angular/material/tooltip';
8
10
  import * as i0 from "@angular/core";
9
11
  export declare class TableRowHeaderActionDirective<Data extends Record<string, any>> extends TableRowActionDirective<Data> implements OnInit, OnDestroy {
10
12
  private readonly selectRowService;
11
13
  private _subscription?;
12
- constructor(actionMethod: TableRowActionMethod<Data>, cdr: ChangeDetectorRef, vcr: ViewContainerRef, tableDataSourceDirective: TableDataSourceDirective, snackBar: MatSnackBar, matButton: MatButton | null, selectRowService: SelectRowService<Data> | null);
14
+ constructor(overlay: Overlay, elementRef: ElementRef, actionMethod: TableRowActionMethod<Data>, cdr: ChangeDetectorRef, vcr: ViewContainerRef, tableDataSourceDirective: TableDataSourceDirective, snackBar: MatSnackBar, matButton: MatButton | null, matTooltip: MatTooltip | null, selectRowService: SelectRowService<Data> | null);
13
15
  ngOnDestroy(): void;
14
16
  ngOnInit(): void;
15
17
  protected getElementList(): Data[];
16
18
  type: string;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<TableRowHeaderActionDirective<any>, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableRowHeaderActionDirective<any>, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
18
20
  static ɵdir: i0.ɵɵDirectiveDeclaration<TableRowHeaderActionDirective<any>, "button[rxapTableRowHeaderAction]", never, { "type": "rxapTableRowHeaderAction"; }, {}, never>;
19
21
  }
@@ -5,4 +5,4 @@ export declare type TableRowActionTypeSwitchMethod<Data extends Record<string, a
5
5
  type: string;
6
6
  }>;
7
7
  export declare type TableRowActionTypeMethod<Data extends Record<string, any>> = Method<any, Data>;
8
- export declare type TableRowActionMethod<Data extends Record<string, any>> = TableRowActionTypeSwitchMethod<Data> | TableRowActionTypeMethod<Data>;
8
+ export declare type TableRowActionMethod<Data extends Record<string, any> = Record<string, any>> = TableRowActionTypeSwitchMethod<Data> | TableRowActionTypeMethod<Data>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxap/material-table-system",
3
- "version": "13.3.1",
3
+ "version": "13.5.0",
4
4
  "peerDependencies": {
5
5
  "@angular-devkit/schematics": "^13.2.4",
6
6
  "@angular/animations": "^13.2.3",
@@ -14,18 +14,18 @@
14
14
  "@angular/platform-browser": "^13.2.3",
15
15
  "@angular/platform-browser-dynamic": "^13.2.3",
16
16
  "@angular/router": "^13.2.3",
17
- "@rxap/components": "^13.0.0",
17
+ "@rxap/components": "^13.0.1",
18
18
  "@rxap/config": "^13.1.3",
19
- "@rxap/data-source": "^13.1.1",
19
+ "@rxap/data-source": "^13.4.2",
20
20
  "@rxap/definition": "^13.0.0",
21
21
  "@rxap/directives": "^13.0.0",
22
- "@rxap/forms": "^13.0.5",
22
+ "@rxap/forms": "^13.0.7",
23
23
  "@rxap/material-directives": "^13.0.0",
24
24
  "@rxap/mixin": "^13.0.0",
25
- "@rxap/open-api": "^13.1.7",
25
+ "@rxap/open-api": "^13.2.0",
26
26
  "@rxap/remote-method": "^13.0.0",
27
27
  "@rxap/services": "^13.0.1",
28
- "@rxap/utilities": "^13.0.1",
28
+ "@rxap/utilities": "^13.1.0",
29
29
  "@rxap/window-system": "^13.0.0",
30
30
  "@schematics/angular": "^13.2.4",
31
31
  "joi": "^17.6.3",