@porscheinformatik/material-addons 10.2.5 → 10.3.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.
@@ -0,0 +1,5 @@
1
+ export declare class DataTableActionType {
2
+ static SINGLE: string;
3
+ static BATCH: string;
4
+ static NONE: string;
5
+ }
@@ -1,5 +1,7 @@
1
1
  export interface DataTableAction {
2
2
  label: string;
3
3
  action: string;
4
- outputRow?: any;
4
+ type: "SINGLE" | "BATCH" | "NONE";
5
+ selected?: any[];
6
+ hiddenInMode?: string;
5
7
  }
@@ -1,6 +1,8 @@
1
1
  export interface DataTableColumnHeader {
2
2
  label: string;
3
- isSortable?: boolean;
4
3
  dataPropertyName: string;
4
+ isSortable?: boolean;
5
5
  isRightAligned?: boolean;
6
+ transformer?: any;
7
+ transformerParams?: any[];
6
8
  }
@@ -1,39 +1,69 @@
1
- import { AfterViewInit, EventEmitter, OnInit } from '@angular/core';
2
- import { MatTableDataSource } from '@angular/material/table';
3
- import { MatPaginator } from '@angular/material/paginator';
4
- import { MatSort, Sort } from '@angular/material/sort';
5
- import { DataTableColumnHeader } from './data-table-column-header';
6
- import { DataTableAction } from './data-table-action';
1
+ import { AfterViewInit, EventEmitter, OnInit } from "@angular/core";
2
+ import { MatTableDataSource } from "@angular/material/table";
3
+ import { MatPaginator } from "@angular/material/paginator";
4
+ import { MatSort, Sort } from "@angular/material/sort";
5
+ import { DataTableColumnHeader } from "./data-table-column-header";
6
+ import { DataTableAction } from "./data-table-action";
7
+ import { SelectionModel } from "@angular/cdk/collections";
7
8
  export declare class DataTableComponent implements OnInit, AfterViewInit {
8
9
  readonly ACTION_COLUMN_NAME = "__action__";
10
+ readonly SINGLE: string;
11
+ readonly BATCH: string;
12
+ readonly NONE: string;
9
13
  columns: DataTableColumnHeader[];
10
14
  filterLabel: string;
11
15
  filterPlaceholder: string;
12
16
  noDataText: string;
13
17
  pageSizeOptions: number[];
14
18
  defaultPageSize: number;
15
- rowActions: DataTableAction[];
16
- tableActions: DataTableAction[];
17
- set displayedData(data: any[]);
19
+ actions: DataTableAction[];
20
+ idGenerator: any;
21
+ set tableData(data: any[]);
22
+ set loading(isLoading: boolean);
18
23
  set paginationEnabled(isPaginationEnabled: boolean);
19
24
  set filterEnabled(isFilterEnabled: boolean);
20
- tableAction: EventEmitter<DataTableAction>;
21
- rowAction: EventEmitter<DataTableAction>;
25
+ set forceMode(mode: string);
22
26
  sortEvent: EventEmitter<Sort>;
27
+ actionEvent: EventEmitter<DataTableAction>;
28
+ pagingEvent: EventEmitter<any>;
23
29
  paginator: MatPaginator;
24
30
  sort: MatSort;
31
+ tableActions: DataTableAction[];
32
+ rowActions: DataTableAction[];
33
+ allSelected: boolean;
34
+ selected: [];
35
+ _forceMode: string;
36
+ displayedDataMap: Map<string, any>;
37
+ actualDataMap: Map<string, any>;
25
38
  dataSource: MatTableDataSource<any[]>;
39
+ selectionModel: SelectionModel<string>;
26
40
  columnNames: string[];
27
- isRowClickable: boolean;
28
41
  defaultAction: DataTableAction;
29
42
  isFilterEnabled: boolean;
30
43
  isPaginationEnabled: boolean;
44
+ mode: string;
45
+ isRowClickable: boolean;
46
+ isLoading: boolean;
31
47
  ngOnInit(): void;
32
48
  ngAfterViewInit(): void;
33
- onFilter(value: string): void;
49
+ get selectedCount(): number;
50
+ get rowCount(): number;
51
+ getSelectedCount(actionType: string): string;
52
+ isDisabled(actionType: string): boolean;
53
+ onToggleSelectAll(): void;
54
+ isSelected(rowId: string): boolean;
55
+ setFilterValue(value: string): void;
56
+ onRowCheckbox(event: MouseEvent, row: any): void;
34
57
  onRowEvent(event: MouseEvent, row: any, action?: DataTableAction): void;
35
58
  onSortingEvent(sortingParams: Sort): void;
59
+ onPaginationEvent(event: any): void;
36
60
  onTableAction(tableAction: DataTableAction): void;
37
- private setFilterValue;
38
- private isClickOnRowMenuIcon;
61
+ private static transformData;
62
+ private static generateRowId;
63
+ private static isClickOnRowMenuIcon;
64
+ private emitTableAction;
65
+ private generateDisplayedDataElement;
66
+ private setActions;
67
+ private createDataMapsAndSetDisplayedDataSourceData;
68
+ private getTableMode;
39
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porscheinformatik/material-addons",
3
- "version": "10.2.5",
3
+ "version": "10.3.0",
4
4
  "description": "Custom theme and components for Angular Material",
5
5
  "homepage": "https://github.com/porscheinformatik/material-addons",
6
6
  "repository": {