@rxap/material-table-system 16.0.0-dev.9 → 16.0.1-dev.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/LICENSE +621 -0
  3. package/LICENSE.md +621 -0
  4. package/README.md +1 -1
  5. package/esm2022/index.mjs +78 -56
  6. package/esm2022/lib/cells/link-cell/link-cell.component.mjs +4 -6
  7. package/esm2022/lib/cells/tree-control-cell/tree-control-cell.component.mjs +49 -0
  8. package/esm2022/lib/expand-row/expand-controls-cell/expand-controls-cell.component.mjs +5 -10
  9. package/esm2022/lib/expand-row/expand-row-container/expand-row-container.component.mjs +3 -8
  10. package/esm2022/lib/expand-row/expand-row.directive.mjs +3 -8
  11. package/esm2022/lib/select-row/checkbox-cell/checkbox-cell.component.mjs +3 -8
  12. package/esm2022/lib/select-row/select-row.service.mjs +5 -2
  13. package/esm2022/lib/table-column-menu/table-column-menu.component.mjs +26 -12
  14. package/esm2022/lib/table-column-menu/table-column-option/table-column-option.component.mjs +4 -8
  15. package/esm2022/lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component.mjs +43 -12
  16. package/esm2022/lib/table-create-button/table-create-button.directive.mjs +8 -11
  17. package/esm2022/lib/table-data-source.directive.mjs +25 -23
  18. package/esm2022/lib/table-header-button/decorators.mjs +15 -0
  19. package/esm2022/lib/table-header-button/table-header-button-action-status.mjs +8 -0
  20. package/esm2022/lib/table-header-button/table-header-button.directive.mjs +187 -0
  21. package/esm2022/lib/table-header-button/tokens.mjs +3 -0
  22. package/esm2022/lib/table-row-actions/abstract-table-row-action.mjs +251 -0
  23. package/esm2022/lib/table-row-actions/decorators.mjs +1 -1
  24. package/esm2022/lib/table-row-actions/table-row-action.directive.mjs +14 -227
  25. package/esm2022/lib/table-row-actions/table-row-header-action.directive.mjs +26 -20
  26. package/esm2022/lib/table-row-metadata.mjs +8 -2
  27. package/esm2022/lib/table-select-controls/table-select-controls.component.mjs +4 -7
  28. package/fesm2022/rxap-material-table-system.mjs +1566 -1504
  29. package/fesm2022/rxap-material-table-system.mjs.map +1 -1
  30. package/index.d.ts +42 -38
  31. package/lib/cells/tree-control-cell/tree-control-cell.component.d.ts +16 -0
  32. package/lib/expand-row/expand-controls-cell/expand-controls-cell.component.d.ts +1 -1
  33. package/lib/expand-row/expand-row-container/expand-row-container.component.d.ts +1 -1
  34. package/lib/expand-row/expand-row.directive.d.ts +1 -1
  35. package/lib/select-row/checkbox-cell/checkbox-cell.component.d.ts +1 -1
  36. package/lib/select-row/select-row.service.d.ts +2 -1
  37. package/lib/table-column-menu/table-column-menu.component.d.ts +8 -1
  38. package/lib/table-column-menu/table-column-option/table-column-option.component.d.ts +1 -1
  39. package/lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component.d.ts +10 -4
  40. package/lib/table-create-button/table-create-button.directive.d.ts +4 -4
  41. package/lib/table-data-source.directive.d.ts +7 -10
  42. package/lib/table-header-button/decorators.d.ts +26 -0
  43. package/lib/table-header-button/table-header-button-action-status.d.ts +6 -0
  44. package/lib/table-header-button/table-header-button.directive.d.ts +55 -0
  45. package/lib/table-header-button/tokens.d.ts +3 -0
  46. package/lib/table-row-actions/abstract-table-row-action.d.ts +76 -0
  47. package/lib/table-row-actions/decorators.d.ts +5 -0
  48. package/lib/table-row-actions/table-row-action.directive.d.ts +5 -68
  49. package/lib/table-row-actions/table-row-header-action.directive.d.ts +10 -9
  50. package/lib/table-row-metadata.d.ts +21 -0
  51. package/package.json +54 -53
  52. package/theme.css +1 -0
  53. package/esm2022/lib/table-row-controls/row-controls-cell/row-controls-cell.component.mjs +0 -122
  54. package/esm2022/lib/table-row-controls/row-controls-header-cell/row-controls-header-cell.component.mjs +0 -117
  55. package/esm2022/lib/table-row-controls/table-row-controls.module.mjs +0 -29
  56. package/esm2022/lib/table-row-controls/tokens.mjs +0 -30
  57. package/lib/table-row-controls/row-controls-cell/row-controls-cell.component.d.ts +0 -50
  58. package/lib/table-row-controls/row-controls-header-cell/row-controls-header-cell.component.d.ts +0 -34
  59. package/lib/table-row-controls/table-row-controls.module.d.ts +0 -11
  60. package/lib/table-row-controls/tokens.d.ts +0 -37
package/index.d.ts CHANGED
@@ -1,49 +1,53 @@
1
- export * from './lib/expand-row/expand-row.module';
2
- export * from './lib/expand-row/expand-row-container/expand-row-container.component';
3
- export * from './lib/expand-row/expand-row-container/expand-row-content.directive';
4
- export * from './lib/expand-row/expand-controls-cell/expand-controls-cell.component';
5
- export * from './lib/expand-row/expand-row.service';
6
- export * from './lib/expand-row/expand-row.directive';
7
- export * from './lib/select-row/checkbox-cell/checkbox-cell.component';
8
- export * from './lib/select-row/checkbox-header-cell/checkbox-header-cell.component';
9
- export * from './lib/select-row/select-row.service';
10
- export * from './lib/select-row/selected-rows.directive';
11
- export * from './lib/select-row/tokens';
12
- export * from './lib/select-row/select-row.module';
13
- export * from './lib/row-animation';
14
- export * from './lib/table-data-source.directive';
15
- export * from './lib/table-row-metadata';
16
- export * from './lib/persistent-paginator.directive';
1
+ export * from './lib/table-select-controls/table-select-controls.component';
2
+ export * from './lib/table-row-actions/abstract-table-row-action';
3
+ export * from './lib/table-row-actions/decorators';
4
+ export * from './lib/table-row-actions/row-action-check.pipe';
5
+ export * from './lib/table-row-actions/table-row-action-executing.directive';
6
+ export * from './lib/table-row-actions/table-row-action-status';
7
+ export * from './lib/table-row-actions/table-row-action.directive';
8
+ export * from './lib/table-row-actions/table-row-action.method';
9
+ export * from './lib/table-row-actions/table-row-actions.module';
10
+ export * from './lib/table-row-actions/table-row-header-action.directive';
11
+ export * from './lib/table-row-actions/tokens';
12
+ export * from './lib/table-row-actions/types';
13
+ export * from './lib/table-header-button/decorators';
14
+ export * from './lib/table-header-button/table-header-button-action-status';
15
+ export * from './lib/table-header-button/table-header-button.directive';
16
+ export * from './lib/table-header-button/tokens';
17
17
  export * from './lib/table-filter/filter-header-row.directive';
18
18
  export * from './lib/table-filter/table-filter.module';
19
19
  export * from './lib/table-filter/table-filter.service';
20
20
  export * from './lib/table-filter/to-filter-column-names.pipe';
21
21
  export * from './lib/table-filter/tokens';
22
- export * from './lib/table-column-menu/table-column-menu.component';
23
- export * from './lib/table-column-menu/table-column-menu.module';
24
- export * from './lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component';
25
- export * from './lib/table-column-menu/table-column-option/table-column-option.component';
26
22
  export * from './lib/table-create-button/table-create-button.directive';
27
23
  export * from './lib/table-create-button/tokens';
28
- export * from './lib/table-row-controls/row-controls-cell/row-controls-cell.component';
29
- export * from './lib/table-row-controls/row-controls-header-cell/row-controls-header-cell.component';
30
- export * from './lib/table-row-controls/tokens';
31
- export * from './lib/table-row-controls/table-row-controls.module';
32
- export * from './lib/table-select-controls/table-select-controls.component';
24
+ export * from './lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component';
25
+ export * from './lib/table-column-menu/table-column-option/table-column-option.component';
26
+ export * from './lib/table-column-menu/table-column-menu.component';
27
+ export * from './lib/table-column-menu/table-column-menu.module';
28
+ export * from './lib/select-row/checkbox-header-cell/checkbox-header-cell.component';
29
+ export * from './lib/select-row/checkbox-cell/checkbox-cell.component';
30
+ export * from './lib/select-row/select-row.module';
31
+ export * from './lib/select-row/select-row.options';
32
+ export * from './lib/select-row/select-row.service';
33
+ export * from './lib/select-row/selected-rows.directive';
34
+ export * from './lib/select-row/selection-model';
35
+ export * from './lib/select-row/tokens';
36
+ export * from './lib/expand-row/expand-row-container/expand-row-container.component';
37
+ export * from './lib/expand-row/expand-row-container/expand-row-content.directive';
38
+ export * from './lib/expand-row/expand-controls-cell/expand-controls-cell.component';
39
+ export * from './lib/expand-row/expand-row.directive';
40
+ export * from './lib/expand-row/expand-row.module';
41
+ export * from './lib/expand-row/expand-row.service';
42
+ export * from './lib/cells/tree-control-cell/tree-control-cell.component';
43
+ export * from './lib/cells/options-cell/options-cell.component';
44
+ export * from './lib/cells/link-cell/link-cell.component';
33
45
  export * from './lib/cells/image-cell/image-cell.component';
34
- export * from './lib/cells/copy-to-clipboard-cell/copy-to-clipboard-cell.component';
35
46
  export * from './lib/cells/icon-cell/icon-cell.component';
36
47
  export * from './lib/cells/date-cell/date-cell.component';
37
- export * from './lib/cells/link-cell/link-cell.component';
38
- export * from './lib/cells/options-cell/options-cell.component';
48
+ export * from './lib/cells/copy-to-clipboard-cell/copy-to-clipboard-cell.component';
39
49
  export * from './lib/cells/boolean-cell/boolean-cell.component';
40
- export * from './lib/table-row-actions/decorators';
41
- export * from './lib/table-row-actions/table-row-action.directive';
42
- export * from './lib/table-row-actions/table-row-action.method';
43
- export * from './lib/table-row-actions/table-row-action-executing.directive';
44
- export * from './lib/table-row-actions/table-row-action-status';
45
- export * from './lib/table-row-actions/table-row-actions.module';
46
- export * from './lib/table-row-actions/table-row-header-action.directive';
47
- export * from './lib/table-row-actions/tokens';
48
- export * from './lib/table-row-actions/types';
49
- export * from './lib/table-row-actions/row-action-check.pipe';
50
+ export * from './lib/persistent-paginator.directive';
51
+ export * from './lib/row-animation';
52
+ export * from './lib/table-data-source.directive';
53
+ export * from './lib/table-row-metadata';
@@ -0,0 +1,16 @@
1
+ import { DoCheck, OnInit } from '@angular/core';
2
+ import { IconConfig } from '@rxap/utilities';
3
+ import { RowDataWithNode } from '@rxap/data-source/table/tree';
4
+ import * as i0 from "@angular/core";
5
+ export declare class TreeControlCellComponent implements OnInit, DoCheck {
6
+ offset: string;
7
+ icon: IconConfig;
8
+ expandIcon: string;
9
+ element: RowDataWithNode<any>;
10
+ ngOnInit(): void;
11
+ ngDoCheck(): void;
12
+ toggleExpand(): any;
13
+ private updateIcon;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeControlCellComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<TreeControlCellComponent, "rxap-tree-control-cell, td[rxap-tree-control-cell]", never, { "element": { "alias": "rxap-tree-control-cell"; "required": false; }; }, {}, never, ["*"], true, never>;
16
+ }
@@ -5,5 +5,5 @@ export declare class ExpandControlsCellComponent<Data extends Record<string, any
5
5
  element: Data;
6
6
  constructor(expandCell: ExpandRowService<Data>);
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<ExpandControlsCellComponent<any>, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<ExpandControlsCellComponent<any>, "td[rxap-expand-controls-cell]", never, { "element": { "alias": "element"; "required": false; }; }, {}, never, never, true, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExpandControlsCellComponent<any>, "td[rxap-expand-controls-cell]", never, { "element": { "alias": "element"; "required": true; }; }, {}, never, never, true, never>;
9
9
  }
@@ -14,5 +14,5 @@ export declare class ExpandRowContainerComponent<Data extends Record<string, any
14
14
  ngOnDestroy(): void;
15
15
  ngAfterContentInit(): void;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<ExpandRowContainerComponent<any>, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<ExpandRowContainerComponent<any>, "td[rxap-expand-row]", never, { "element": { "alias": "element"; "required": false; }; }, {}, ["expandCellContent"], ["*"], true, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExpandRowContainerComponent<any>, "td[rxap-expand-row]", never, { "element": { "alias": "element"; "required": true; }; }, {}, ["expandCellContent"], ["*"], true, never>;
18
18
  }
@@ -7,5 +7,5 @@ export declare class ExpandRowDirective<Data extends Record<string, any>> {
7
7
  constructor(expandCell: ExpandRowService<Data>);
8
8
  onClick(): void;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<ExpandRowDirective<any>, never>;
10
- static ɵdir: i0.ɵɵDirectiveDeclaration<ExpandRowDirective<any>, "tr[rxapExpandRow]", never, { "element": { "alias": "element"; "required": false; }; }, {}, never, never, true, never>;
10
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ExpandRowDirective<any>, "tr[rxapExpandRow]", never, { "element": { "alias": "element"; "required": true; }; }, {}, never, never, true, never>;
11
11
  }
@@ -5,5 +5,5 @@ export declare class CheckboxCellComponent<Data extends Record<string, any>> {
5
5
  element: Data;
6
6
  constructor(selectRow: SelectRowService<Data>);
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxCellComponent<any>, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxCellComponent<any>, "td[rxap-checkbox-cell]", never, { "element": { "alias": "element"; "required": false; }; }, {}, never, never, true, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxCellComponent<any>, "td[rxap-checkbox-cell]", never, { "element": { "alias": "element"; "required": true; }; }, {}, never, never, true, never>;
9
9
  }
@@ -2,11 +2,12 @@ import type { Observable } from 'rxjs';
2
2
  import { SelectRowOptions } from './select-row.options';
3
3
  import { SelectionModel } from './selection-model';
4
4
  import * as i0 from "@angular/core";
5
- export declare class SelectRowService<Data extends Record<string, any>> {
5
+ export declare class SelectRowService<Data = unknown> {
6
6
  selectedRows$: Observable<Data[]>;
7
7
  readonly selectionModel: SelectionModel<Data>;
8
8
  get selectedRows(): Data[];
9
9
  constructor(options?: SelectRowOptions<Data> | null);
10
+ clear(): void;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectRowService<any>, [{ optional: true; }]>;
11
12
  static ɵprov: i0.ɵɵInjectableDeclaration<SelectRowService<any>>;
12
13
  }
@@ -5,6 +5,13 @@ import * as i0 from "@angular/core";
5
5
  export declare class TableColumnMenuComponent implements AfterContentInit {
6
6
  columns?: QueryList<TableColumnOptionComponent>;
7
7
  displayColumns: string[];
8
+ private _inline;
9
+ get inline(): boolean | '';
10
+ /**
11
+ * true - the menu is displayed inline and not absolute
12
+ * @param value
13
+ */
14
+ set inline(value: boolean | '');
8
15
  set matCard(value: boolean | '');
9
16
  private _matCardMode;
10
17
  ngAfterContentInit(): void;
@@ -12,5 +19,5 @@ export declare class TableColumnMenuComponent implements AfterContentInit {
12
19
  activate(columnName: string): void;
13
20
  deactivate(columnName: string): void;
14
21
  static ɵfac: i0.ɵɵFactoryDeclaration<TableColumnMenuComponent, never>;
15
- static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnMenuComponent, "rxap-table-column-menu", ["rxapTableColumns"], { "matCard": { "alias": "matCard"; "required": false; }; }, {}, ["columns"], ["[mat-menu-item],mat-divider"], true, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnMenuComponent, "rxap-table-column-menu", ["rxapTableColumns"], { "inline": { "alias": "inline"; "required": false; }; "matCard": { "alias": "matCard"; "required": false; }; }, {}, ["columns"], ["[mat-menu-item],mat-divider"], true, never>;
16
23
  }
@@ -23,5 +23,5 @@ export declare class TableColumnOptionComponent implements OnInit {
23
23
  activate(): void;
24
24
  deactivate(): void;
25
25
  static ɵfac: i0.ɵɵFactoryDeclaration<TableColumnOptionComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnOptionComponent, "rxap-table-column-option", never, { "name": { "alias": "name"; "required": false; }; "active": { "alias": "active"; "required": false; }; "inactive": { "alias": "inactive"; "required": false; }; "hidden": { "alias": "hidden"; "required": false; }; "show": { "alias": "show"; "required": false; }; }, {}, never, ["*"], true, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnOptionComponent, "rxap-table-column-option", never, { "name": { "alias": "name"; "required": true; }; "active": { "alias": "active"; "required": false; }; "inactive": { "alias": "inactive"; "required": false; }; "hidden": { "alias": "hidden"; "required": false; }; "show": { "alias": "show"; "required": false; }; }, {}, never, ["*"], true, never>;
27
27
  }
@@ -1,12 +1,18 @@
1
+ import { AfterViewInit } from '@angular/core';
2
+ import { MatPaginator } from '@angular/material/paginator';
1
3
  import { MatSlideToggleChange } from '@angular/material/slide-toggle';
4
+ import { SelectRowService } from '../../select-row/select-row.service';
2
5
  import { TableFilterService } from '../../table-filter/table-filter.service';
3
6
  import { TableColumnMenuComponent } from '../table-column-menu.component';
4
7
  import * as i0 from "@angular/core";
5
- export declare class TableShowArchivedSlideComponent {
8
+ export declare class TableShowArchivedSlideComponent implements AfterViewInit {
6
9
  private readonly tableFilter;
7
10
  private readonly tableColumnMenu;
8
- constructor(tableFilter: TableFilterService, tableColumnMenu: TableColumnMenuComponent);
11
+ private readonly selectRows;
12
+ paginator?: MatPaginator;
13
+ constructor(tableFilter: TableFilterService | null, tableColumnMenu: TableColumnMenuComponent, selectRows: SelectRowService | null);
9
14
  onChange($event: MatSlideToggleChange): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<TableShowArchivedSlideComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<TableShowArchivedSlideComponent, "rxap-table-show-archived-slide", never, {}, {}, never, never, true, never>;
15
+ ngAfterViewInit(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableShowArchivedSlideComponent, [{ optional: true; }, null, null]>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableShowArchivedSlideComponent, "rxap-table-show-archived-slide", never, { "paginator": { "alias": "paginator"; "required": false; }; }, {}, never, never, true, never>;
12
18
  }
@@ -1,18 +1,18 @@
1
1
  import { ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
+ import { Method } from '@rxap/pattern';
2
3
  import { Observable } from 'rxjs';
3
4
  import { TableDataSourceDirective } from '../table-data-source.directive';
4
- import { Method } from '@rxap/pattern';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class TableCreateButtonDirective<Data extends Record<string, any>> implements OnInit, OnDestroy {
7
- private readonly remoteMethod;
7
+ private readonly method;
8
8
  private readonly elementRef;
9
9
  private readonly renderer;
10
10
  dataSource: TableDataSourceDirective<Data>;
11
11
  private _createObservable?;
12
- constructor(remoteMethod: Method<any, Data | Observable<Data>>, elementRef: ElementRef, renderer: Renderer2);
12
+ constructor(method: Method<any, Data | Observable<Data>>, elementRef: ElementRef, renderer: Renderer2);
13
13
  ngOnInit(): void;
14
14
  ngOnDestroy(): void;
15
15
  onClick(): Promise<void>;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<TableCreateButtonDirective<any>, never>;
17
- static ɵdir: i0.ɵɵDirectiveDeclaration<TableCreateButtonDirective<any>, "button[rxapTableCreate]", never, { "dataSource": { "alias": "rxapTableCreate"; "required": false; }; }, {}, never, never, true, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableCreateButtonDirective<any>, "button[rxapTableCreate]", never, { "dataSource": { "alias": "rxapTableCreate"; "required": true; }; }, {}, never, never, true, never>;
18
18
  }
@@ -1,16 +1,13 @@
1
+ import { CdkTable } from '@angular/cdk/table';
1
2
  import { ChangeDetectorRef, InjectionToken, OnDestroy, OnInit } from '@angular/core';
2
3
  import type { MatPaginator } from '@angular/material/paginator';
3
- import type { Observable } from 'rxjs';
4
- import { Subscription } from 'rxjs';
5
4
  import { MatSort } from '@angular/material/sort';
6
- import type { AbstractTableDataSource, FilterLike } from '@rxap/data-source/table';
7
- import { SortLike, TableEvent } from '@rxap/data-source/table';
8
- import { BaseRemoteMethod } from '@rxap/remote-method';
9
5
  import { PaginatorLike } from '@rxap/data-source/pagination';
10
- import { CdkTable } from '@angular/cdk/table';
11
- import { TableFilterService } from './table-filter/table-filter.service';
12
- import { ToggleSubject } from '@rxap/rxjs';
6
+ import { AbstractTableDataSource, FilterLike, SortLike, TableEvent } from '@rxap/data-source/table';
13
7
  import { Method } from '@rxap/pattern';
8
+ import { ToggleSubject } from '@rxap/rxjs';
9
+ import { Observable, Subscription } from 'rxjs';
10
+ import { TableFilterService } from './table-filter/table-filter.service';
14
11
  import * as i0 from "@angular/core";
15
12
  export { RXAP_TABLE_METHOD } from '@rxap/data-source/table';
16
13
  /**
@@ -20,7 +17,7 @@ export declare const TABLE_REMOTE_METHOD: InjectionToken<unknown>;
20
17
  export declare const TABLE_REMOTE_METHOD_ADAPTER_FACTORY: InjectionToken<unknown>;
21
18
  export declare const RXAP_TABLE_FILTER: InjectionToken<unknown>;
22
19
  export declare const TABLE_DATA_SOURCE: InjectionToken<unknown>;
23
- export type TableRemoteMethodAdapterFactory<Data extends Record<string, any> = Record<string, any>> = (method: Method, paginator?: PaginatorLike, sort?: SortLike | null, filter?: FilterLike | null, parameters?: Observable<Record<string, any>>) => BaseRemoteMethod<Data[], TableEvent>;
20
+ export type TableRemoteMethodAdapterFactory<Data extends Record<string, any> = Record<string, any>> = (method: Method, paginator?: PaginatorLike, sort?: SortLike | null, filter?: FilterLike | null, parameters?: Observable<Record<string, any>>) => Method<Data[], TableEvent>;
24
21
  export declare class TableDataSourceDirective<Data extends Record<string, any> = any> implements OnInit, OnDestroy {
25
22
  private readonly matTable;
26
23
  protected readonly cdr: ChangeDetectorRef;
@@ -57,5 +54,5 @@ export declare class TableDataSourceDirective<Data extends Record<string, any> =
57
54
  refresh(): void;
58
55
  retry(): void;
59
56
  static ɵfac: i0.ɵɵFactoryDeclaration<TableDataSourceDirective<any>, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
60
- static ɵdir: i0.ɵɵDirectiveDeclaration<TableDataSourceDirective<any>, "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", ["rxapTableDataSource"], { "setDataSource": { "alias": "rxapTableDataSource"; "required": false; }; "paginator": { "alias": "paginator"; "required": false; }; "id": { "alias": "id"; "required": false; }; "parameters": { "alias": "parameters"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; }, {}, never, never, true, never>;
57
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableDataSourceDirective<any>, "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", ["rxapTableDataSource"], { "setDataSource": { "alias": "rxapTableDataSource"; "required": false; }; "paginator": { "alias": "paginator"; "required": false; }; "id": { "alias": "id"; "required": true; }; "parameters": { "alias": "parameters"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; }, {}, never, never, true, never>;
61
58
  }
@@ -0,0 +1,26 @@
1
+ import { Method } from '@rxap/pattern';
2
+ export declare const RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA = "rxap-table-header-button-method-metadata";
3
+ export interface TableHeaderButtonMethodOptions {
4
+ /**
5
+ * If true, the table will be refreshed after the action is executed.
6
+ */
7
+ refresh?: boolean;
8
+ /**
9
+ * If true, the user will be asked to confirm the action before execution.
10
+ */
11
+ confirm?: boolean;
12
+ /**
13
+ * The tooltip of the action button.
14
+ */
15
+ tooltip?: string;
16
+ /**
17
+ * The error message that will be displayed if the action fails.
18
+ */
19
+ errorMessage?: string;
20
+ /**
21
+ * The success message that will be displayed if the action succeeds.
22
+ */
23
+ successMessage?: string;
24
+ }
25
+ export declare function TableHeaderButtonMethod(options?: TableHeaderButtonMethodOptions): ClassDecorator;
26
+ export declare function GetTableHeaderButtonMetadata(method: Method): TableHeaderButtonMethodOptions;
@@ -0,0 +1,6 @@
1
+ export declare enum TableHeaderButtonActionStatus {
2
+ EXECUTING = "executing",
3
+ DONE = "done",
4
+ ERROR = "error",
5
+ SUCCESS = "success"
6
+ }
@@ -0,0 +1,55 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { ChangeDetectorRef, ElementRef, OnInit } from '@angular/core';
3
+ import { MatMiniFabButton } from '@angular/material/button';
4
+ import { MatSnackBar } from '@angular/material/snack-bar';
5
+ import { MatTooltip } from '@angular/material/tooltip';
6
+ import { ConfirmDirective } from '@rxap/components';
7
+ import { Method } from '@rxap/pattern';
8
+ import { TableDataSourceDirective } from '../table-data-source.directive';
9
+ import { TableHeaderButtonMethodOptions } from './decorators';
10
+ import * as i0 from "@angular/core";
11
+ export declare class TableHeaderButtonDirective<Data extends Record<string, any>> extends ConfirmDirective implements OnInit {
12
+ private readonly method;
13
+ private readonly snackBar;
14
+ private readonly matTooltip;
15
+ private readonly matButton;
16
+ protected readonly cdr: ChangeDetectorRef;
17
+ tableDataSourceDirective: TableDataSourceDirective<Data>;
18
+ errorMessage?: string;
19
+ successMessage?: string;
20
+ /**
21
+ * true - after the action is executed the table datasource is refreshed
22
+ */
23
+ refresh?: boolean;
24
+ protected options: TableHeaderButtonMethodOptions | null;
25
+ private _actionDisabled;
26
+ private _currentStatus;
27
+ constructor(overlay: Overlay, elementRef: ElementRef, method: Method, snackBar: MatSnackBar, matTooltip: MatTooltip | null, matButton: MatMiniFabButton | null, cdr: ChangeDetectorRef);
28
+ private _hasConfirmDirective;
29
+ set hasConfirmDirective(value: any);
30
+ onConfirmed(): Promise<void>;
31
+ onClick($event: Event): Promise<void>;
32
+ execute(): Promise<void>;
33
+ ngOnInit(): void;
34
+ /**
35
+ * Disables the action. If the button is pressed the action is NOT executed
36
+ *
37
+ * Hint: the button is set to disabled = true to prevent any conflict with
38
+ * extern button enable features linke : rxapHasEnablePermission
39
+ * @protected
40
+ */
41
+ protected setButtonDisabled(): void;
42
+ /**
43
+ * Enables the action. If the button is pressed the action is executed
44
+ *
45
+ * TODO : find a way to communicate the disabled state between the features
46
+ * Hint: the button is set to disabled = false to prevent any conflict with
47
+ * extern button enable features linke : rxapHasEnablePermission
48
+ * @protected
49
+ */
50
+ protected setButtonEnabled(): void;
51
+ private setStatus;
52
+ private getTableHeaderButtonOptions;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableHeaderButtonDirective<any>, [null, null, null, null, { optional: true; }, { optional: true; }, null]>;
54
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableHeaderButtonDirective<any>, "button[mat-mini-fab][rxapTableHeaderButton]", never, { "tableDataSourceDirective": { "alias": "rxapTableHeaderButton"; "required": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "successMessage": { "alias": "successMessage"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "hasConfirmDirective": { "alias": "rxapConfirm"; "required": false; }; }, {}, never, never, true, never>;
55
+ }
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { Method } from '@rxap/pattern';
3
+ export declare const TABLE_HEADER_BUTTON_METHOD: InjectionToken<Method<any, any>>;
@@ -0,0 +1,76 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { ChangeDetectorRef, ElementRef, Injector, OnInit, Renderer2, ViewContainerRef } from '@angular/core';
3
+ import { MatIconButton } from '@angular/material/button';
4
+ import { ThemePalette } from '@angular/material/core';
5
+ import { MatSnackBar } from '@angular/material/snack-bar';
6
+ import { MatTooltip } from '@angular/material/tooltip';
7
+ import { ConfirmDirective } from '@rxap/components';
8
+ import { TableDataSourceDirective } from '../table-data-source.directive';
9
+ import { TableActionMethodOptions } from './decorators';
10
+ import { TableRowActionMethod } from './types';
11
+ import * as i0 from "@angular/core";
12
+ export declare abstract class AbstractTableRowAction<Data extends Record<string, any>> extends ConfirmDirective implements OnInit {
13
+ protected readonly renderer: Renderer2;
14
+ protected readonly cdr: ChangeDetectorRef;
15
+ protected readonly vcr: ViewContainerRef;
16
+ protected readonly tableDataSourceDirective: TableDataSourceDirective;
17
+ protected readonly snackBar: MatSnackBar;
18
+ protected matButton: MatIconButton | null;
19
+ protected matTooltip: MatTooltip | null;
20
+ protected readonly injector: Injector;
21
+ abstract type: string;
22
+ errorMessage?: string;
23
+ successMessage?: string;
24
+ /**
25
+ * true - after the action is executed the table datasource is refreshed
26
+ */
27
+ refresh?: boolean;
28
+ color?: ThemePalette;
29
+ readonly isHeader: boolean;
30
+ protected options: TableActionMethodOptions | null;
31
+ private readonly executingDirective?;
32
+ private _currentStatus;
33
+ private readonly actionMethodList;
34
+ private _actionDisabled;
35
+ constructor(renderer: Renderer2, overlay: Overlay, elementRef: ElementRef, actionMethodList: Array<TableRowActionMethod<Data>> | TableRowActionMethod<Data>, cdr: ChangeDetectorRef, vcr: ViewContainerRef, tableDataSourceDirective: TableDataSourceDirective, snackBar: MatSnackBar, matButton: MatIconButton | null, matTooltip: MatTooltip | null, injector: Injector);
36
+ private _hasConfirmDirective;
37
+ set hasConfirmDirective(value: any);
38
+ ngOnInit(): void;
39
+ onConfirmed(): Promise<void>;
40
+ onClick($event: Event): Promise<void>;
41
+ execute(): Promise<void>;
42
+ protected abstract getElementList(): Data[];
43
+ /**
44
+ * Disables the action. If the button is pressed the action is NOT executed
45
+ *
46
+ * Hint: the button is set to disabled = true to prevent any conflict with
47
+ * extern button enable features linke : rxapHasEnablePermission
48
+ * @protected
49
+ */
50
+ protected setButtonDisabled(): void;
51
+ /**
52
+ * Enables the action. If the button is pressed the action is executed
53
+ *
54
+ * TODO : find a way to communicate the disabled state between the features
55
+ * Hint: the button is set to disabled = false to prevent any conflict with
56
+ * extern button enable features linke : rxapHasEnablePermission
57
+ * @protected
58
+ */
59
+ protected setButtonEnabled(): void;
60
+ /**
61
+ * find all method instance in the actionMethodList member that
62
+ * do not have a @TableActionMethod decorators
63
+ * @private
64
+ */
65
+ private findUntypedActionMethod;
66
+ /**
67
+ * find all method instance in the actionMethodList member that
68
+ * do have a @TableActionMethod decorators with the current type
69
+ * @private
70
+ */
71
+ private findTypedActionMethod;
72
+ private setStatus;
73
+ private getTableActionOptions;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractTableRowAction<any>, [null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null]>;
75
+ static ɵprov: i0.ɵɵInjectableDeclaration<AbstractTableRowAction<any>>;
76
+ }
@@ -1,3 +1,4 @@
1
+ import { ThemePalette } from '@angular/material/core';
1
2
  import { RowActionCheckFunction } from './types';
2
3
  /**
3
4
  * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
@@ -37,6 +38,10 @@ export interface TableActionMethodOptions<Data = any> {
37
38
  * the directive.
38
39
  */
39
40
  priority?: number;
41
+ /**
42
+ * The color of the action button.
43
+ */
44
+ color?: ThemePalette;
40
45
  }
41
46
  export declare function TableActionMethod<Data = any>(options: TableActionMethodOptions): ClassDecorator;
42
47
  export declare function TableActionMethod<Data = any>(type: string, checkFunction?: RowActionCheckFunction<Data>): ClassDecorator;
@@ -1,72 +1,9 @@
1
- import { ChangeDetectorRef, ElementRef, OnInit, ViewContainerRef } from '@angular/core';
2
- import { MatButton } from '@angular/material/button';
3
- import { MatSnackBar } from '@angular/material/snack-bar';
4
- import { TableDataSourceDirective } from '../table-data-source.directive';
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';
1
+ import { AbstractTableRowAction } from './abstract-table-row-action';
10
2
  import * as i0 from "@angular/core";
11
- export declare class TableRowActionDirective<Data extends Record<string, any>> extends ConfirmDirective implements OnInit {
12
- protected readonly cdr: ChangeDetectorRef;
13
- private readonly vcr;
14
- private readonly tableDataSourceDirective;
15
- private readonly snackBar;
16
- private readonly matButton;
17
- private readonly matTooltip;
18
- private _hasConfirmDirective;
19
- set hasConfirmDirective(value: any);
20
- element: Data;
3
+ export declare class TableRowActionDirective<Data extends Record<string, any>> extends AbstractTableRowAction<Data> {
21
4
  type: string;
22
- errorMessage?: string;
23
- successMessage?: string;
24
- /**
25
- * true - after the action is executed the table datasource is refreshed
26
- */
27
- refresh?: boolean;
28
- private readonly executingDirective?;
29
- private _currentStatus;
30
- private readonly actionMethodList;
31
- private _actionDisabled;
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;
35
- onConfirmed(): Promise<void>;
36
- onClick($event: Event): Promise<void>;
37
- execute(): Promise<void>;
5
+ element: Data;
38
6
  protected getElementList(): Data[];
39
- /**
40
- * find all method instance in the actionMethodList member that
41
- * do not have a @TableActionMethod decorators
42
- * @private
43
- */
44
- private findUntypedActionMethod;
45
- /**
46
- * find all method instance in the actionMethodList member that
47
- * do have a @TableActionMethod decorators with the current type
48
- * @private
49
- */
50
- private findTypedActionMethod;
51
- /**
52
- * Disables the action. If the button is pressed the action is NOT executed
53
- *
54
- * Hint: the button is set to disabled = true to prevent any conflict with
55
- * extern button enable features linke : rxapHasEnablePermission
56
- * @protected
57
- */
58
- protected setButtonDisabled(): void;
59
- /**
60
- * Enables the action. If the button is pressed the action is executed
61
- *
62
- * TODO : find a way to communicate the disabled state between the features
63
- * Hint: the button is set to disabled = false to prevent any conflict with
64
- * extern button enable features linke : rxapHasEnablePermission
65
- * @protected
66
- */
67
- protected setButtonEnabled(): void;
68
- private setStatus;
69
- private getTableActionOptions;
70
- static ɵfac: i0.ɵɵFactoryDeclaration<TableRowActionDirective<any>, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
71
- static ɵdir: i0.ɵɵDirectiveDeclaration<TableRowActionDirective<any>, "button[rxapTableRowAction]", never, { "hasConfirmDirective": { "alias": "rxapConfirm"; "required": false; }; "element": { "alias": "element"; "required": false; }; "type": { "alias": "rxapTableRowAction"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "successMessage": { "alias": "successMessage"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; }, {}, ["executingDirective"], never, true, never>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableRowActionDirective<any>, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableRowActionDirective<any>, "button[rxapTableRowAction]", never, { "errorMessage": { "alias": "errorMessage"; "required": false; }; "successMessage": { "alias": "successMessage"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "color": { "alias": "color"; "required": false; }; "type": { "alias": "rxapTableRowAction"; "required": true; }; "element": { "alias": "element"; "required": true; }; }, {}, never, never, true, never>;
72
9
  }
@@ -1,21 +1,22 @@
1
- import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { ChangeDetectorRef, ElementRef, Injector, OnDestroy, OnInit, Renderer2, ViewContainerRef } from '@angular/core';
2
3
  import { MatButton } from '@angular/material/button';
3
4
  import { MatSnackBar } from '@angular/material/snack-bar';
4
- import { TableRowActionDirective } from './table-row-action.directive';
5
- import { TableDataSourceDirective } from '../table-data-source.directive';
5
+ import { MatTooltip } from '@angular/material/tooltip';
6
6
  import { SelectRowService } from '../select-row/select-row.service';
7
+ import { TableDataSourceDirective } from '../table-data-source.directive';
8
+ import { AbstractTableRowAction } from './abstract-table-row-action';
7
9
  import { TableRowActionMethod } from './types';
8
- import { Overlay } from '@angular/cdk/overlay';
9
- import { MatTooltip } from '@angular/material/tooltip';
10
10
  import * as i0 from "@angular/core";
11
- export declare class TableRowHeaderActionDirective<Data extends Record<string, any>> extends TableRowActionDirective<Data> implements OnInit, OnDestroy {
11
+ export declare class TableRowHeaderActionDirective<Data extends Record<string, any>> extends AbstractTableRowAction<Data> implements OnInit, OnDestroy {
12
12
  private readonly selectRowService;
13
+ readonly isHeader = true;
13
14
  private _subscription?;
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);
15
+ constructor(renderer: Renderer2, overlay: Overlay, elementRef: ElementRef, actionMethod: TableRowActionMethod<Data>, cdr: ChangeDetectorRef, vcr: ViewContainerRef, tableDataSourceDirective: TableDataSourceDirective, snackBar: MatSnackBar, matButton: MatButton | null, matTooltip: MatTooltip | null, injector: Injector, selectRowService: SelectRowService<Data> | null);
15
16
  ngOnDestroy(): void;
16
17
  ngOnInit(): void;
17
18
  protected getElementList(): Data[];
18
19
  type: string;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<TableRowHeaderActionDirective<any>, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
20
- static ɵdir: i0.ɵɵDirectiveDeclaration<TableRowHeaderActionDirective<any>, "button[rxapTableRowHeaderAction]", never, { "type": { "alias": "rxapTableRowHeaderAction"; "required": false; }; }, {}, never, never, true, never>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableRowHeaderActionDirective<any>, [null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null, { optional: true; }]>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableRowHeaderActionDirective<any>, "button[rxapTableRowHeaderAction]", never, { "errorMessage": { "alias": "errorMessage"; "required": false; }; "successMessage": { "alias": "successMessage"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "color": { "alias": "color"; "required": false; }; "type": { "alias": "rxapTableRowHeaderAction"; "required": true; }; }, {}, never, never, true, never>;
21
22
  }
@@ -1,6 +1,27 @@
1
1
  import { ToggleSubject } from '@rxap/rxjs';
2
2
  export interface TableRowMetadata {
3
+ /**
4
+ * the unique id of the row. Use to track the row in the table for change detection and other purposes
5
+ */
6
+ __rowId: string;
7
+ /**
8
+ * metadata for the row. Added by the table system to facilitate some features
9
+ */
3
10
  __metadata__: {
4
11
  loading$: ToggleSubject;
5
12
  };
6
13
  }
14
+ export type RawTableRow<T extends TableRowMetadata> = Omit<T, '__metadata__' | '__rowId'> & Partial<Pick<TableRowMetadata, '__rowId' | '__metadata__'>>;
15
+ export type RowIdMapperFunction<T extends TableRowMetadata> = (row: RawTableRow<T>) => string;
16
+ /**
17
+ * Normalize the table row. Add the __rowId and __metadata__ properties to the row.
18
+ *
19
+ * CAUTION: This function mutate the row object
20
+ *
21
+ * @template T extends TableRowMetadata
22
+ * @param row
23
+ * @param rowId
24
+ * @returns T the normalized row
25
+ */
26
+ export declare function NormalizeTableRow<T extends TableRowMetadata>(row: RawTableRow<T>, rowId: string): T;
27
+ export declare function NormalizeTableRow<T extends TableRowMetadata>(row: RawTableRow<T>, rowIdMapper: RowIdMapperFunction<T>): T;