@testgorilla/tgo-ui 0.0.1 → 0.0.2
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/README.md +7 -13
- package/components/table/table.component.d.ts +8 -1
- package/components/table/table.component.module.d.ts +5 -4
- package/components/table/table.types.d.ts +9 -2
- package/esm2020/components/table/table.component.mjs +17 -9
- package/esm2020/components/table/table.component.module.mjs +6 -4
- package/esm2020/components/table/table.types.mjs +7 -2
- package/esm2020/public-api.mjs +2 -3
- package/esm2020/shared/pipes/dataPropertyGetter.mjs +32 -0
- package/fesm2015/testgorilla-tgo-ui.mjs +30 -14
- package/fesm2015/testgorilla-tgo-ui.mjs.map +1 -1
- package/fesm2020/testgorilla-tgo-ui.mjs +30 -14
- package/fesm2020/testgorilla-tgo-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/shared/pipes/dataPropertyGetter.d.ts +11 -0
- package/src/theme/base.scss +1 -3
package/README.md
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TestGorilla UI Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Storybook Development Server
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Run `npm run storybook`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Build Storybook
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Run `npm run build-storybook`
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Build UI Library
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
Run `ng build` to build the ui library. The build artifacts will be stored in the `dist/` directory.
|
|
16
14
|
|
|
17
15
|
## Running unit tests
|
|
18
16
|
|
|
@@ -22,10 +20,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
|
|
|
22
20
|
|
|
23
21
|
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
|
24
22
|
|
|
25
|
-
## Further help
|
|
26
|
-
|
|
27
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
28
|
-
|
|
29
23
|
## Visual regression
|
|
30
24
|
|
|
31
25
|
We are using playwright on top of storybook to capture the visual differences. Code for the same can be found in `common.spec.ts` file.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { MatSort, Sort } from '@angular/material/sort';
|
|
3
3
|
import { MatTableDataSource } from '@angular/material/table';
|
|
4
|
-
import {
|
|
4
|
+
import { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';
|
|
5
|
+
import { DataType, IDataSource, ITableColumn } from './table.types';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class TableComponent implements OnInit {
|
|
8
|
+
private dataPropertyGetterPipe;
|
|
7
9
|
/**
|
|
8
10
|
* @ignore
|
|
9
11
|
*/
|
|
@@ -12,6 +14,10 @@ export declare class TableComponent implements OnInit {
|
|
|
12
14
|
* @ignore
|
|
13
15
|
*/
|
|
14
16
|
displayedColumns: string[];
|
|
17
|
+
/**
|
|
18
|
+
* @ignore
|
|
19
|
+
*/
|
|
20
|
+
DataType: typeof DataType;
|
|
15
21
|
/**
|
|
16
22
|
* @ignore
|
|
17
23
|
*/
|
|
@@ -42,6 +48,7 @@ export declare class TableComponent implements OnInit {
|
|
|
42
48
|
* @ignore
|
|
43
49
|
*/
|
|
44
50
|
ngOnInit(): void;
|
|
51
|
+
constructor(dataPropertyGetterPipe: DataPropertyGetterPipe);
|
|
45
52
|
onSort(sortParams: Sort): void;
|
|
46
53
|
onRowClick(rowParams: any): void;
|
|
47
54
|
/**
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./table.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "@angular/
|
|
5
|
-
import * as i4 from "@angular/material/
|
|
3
|
+
import * as i2 from "src/shared/pipes/dataPropertyGetter";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/material/table";
|
|
6
|
+
import * as i5 from "@angular/material/sort";
|
|
6
7
|
export declare class TableComponentModule {
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponentModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent], [typeof
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent, typeof i2.DataPropertyGetterPipe], [typeof i3.CommonModule, typeof i4.MatTableModule, typeof i5.MatSortModule], [typeof i1.TableComponent]>;
|
|
9
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<TableComponentModule>;
|
|
10
11
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
export declare type IDataSource = {
|
|
2
|
-
[key: string]: string | number;
|
|
2
|
+
[key: string]: IDataSource | string | number;
|
|
3
3
|
};
|
|
4
4
|
export interface ITableColumn {
|
|
5
5
|
name: string;
|
|
6
6
|
dataKey: string;
|
|
7
|
-
|
|
7
|
+
sortable?: boolean;
|
|
8
|
+
dataType?: DataType;
|
|
9
|
+
dateFormat?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare enum DataType {
|
|
12
|
+
Date = "date",
|
|
13
|
+
String = "string",
|
|
14
|
+
Label = "label"
|
|
8
15
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
2
2
|
import { MatSort } from '@angular/material/sort';
|
|
3
3
|
import { MatTableDataSource } from '@angular/material/table';
|
|
4
|
+
import { DataType } from './table.types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "
|
|
6
|
-
import * as i2 from "@angular/material/
|
|
7
|
-
import * as i3 from "@angular/
|
|
6
|
+
import * as i1 from "src/shared/pipes/dataPropertyGetter";
|
|
7
|
+
import * as i2 from "@angular/material/table";
|
|
8
|
+
import * as i3 from "@angular/material/sort";
|
|
9
|
+
import * as i4 from "@angular/common";
|
|
8
10
|
export class TableComponent {
|
|
9
|
-
constructor() {
|
|
11
|
+
constructor(dataPropertyGetterPipe) {
|
|
12
|
+
this.dataPropertyGetterPipe = dataPropertyGetterPipe;
|
|
10
13
|
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
11
14
|
// https://github.com/storybookjs/storybook/issues/16865
|
|
12
15
|
// https://github.com/storybookjs/storybook/issues/17004
|
|
@@ -18,6 +21,10 @@ export class TableComponent {
|
|
|
18
21
|
* @ignore
|
|
19
22
|
*/
|
|
20
23
|
this.displayedColumns = [];
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
this.DataType = DataType;
|
|
21
28
|
/**
|
|
22
29
|
* Data structure to select which columns should be rendered and their capabilities
|
|
23
30
|
*
|
|
@@ -64,15 +71,16 @@ export class TableComponent {
|
|
|
64
71
|
*/
|
|
65
72
|
setTableDataSource(data) {
|
|
66
73
|
this.dataSource = new MatTableDataSource(data);
|
|
74
|
+
this.dataSource.sortingDataAccessor = (item, property) => this.dataPropertyGetterPipe.transform(item, property);
|
|
67
75
|
this.dataSource.sort = this.sort;
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
|
-
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
-
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.
|
|
78
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token: i1.DataPropertyGetterPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"], components: [{ type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i3.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i2.MatCellDef, selector: "[matCellDef]" }, { type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "dataPropertyGetter": i1.DataPropertyGetterPipe, "date": i4.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
80
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
73
81
|
type: Component,
|
|
74
|
-
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.
|
|
75
|
-
}], propDecorators: { sort: [{
|
|
82
|
+
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"] }]
|
|
83
|
+
}], ctorParameters: function () { return [{ type: i1.DataPropertyGetterPipe }]; }, propDecorators: { sort: [{
|
|
76
84
|
type: ViewChild,
|
|
77
85
|
args: [MatSort, { static: true }]
|
|
78
86
|
}], tableData: [{
|
|
@@ -84,4 +92,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
84
92
|
}], onRowClickEvent: [{
|
|
85
93
|
type: Output
|
|
86
94
|
}] } });
|
|
87
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
95
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkgsT0FBTyxFQUFFLE9BQU8sRUFBUSxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRTdELE9BQU8sRUFBRSxRQUFRLEVBQTZCLE1BQU0sZUFBZSxDQUFDOzs7Ozs7QUFRcEUsTUFBTSxPQUFPLGNBQWM7SUE0RHpCLFlBQW9CLHNCQUE4QztRQUE5QywyQkFBc0IsR0FBdEIsc0JBQXNC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y1jb250YWluZXIgW25nU3dpdGNoXT1cInRhYmxlQ29sdW1uLmRhdGFUeXBlXCI+XG4gICAgICAgIDxuZy1jb250YWluZXIgKm5nU3dpdGNoQ2FzZT1cIkRhdGFUeXBlLlN0cmluZ1wiPlxuICAgICAgICAgIHt7ZWxlbWVudCB8IGRhdGFQcm9wZXJ0eUdldHRlcjogdGFibGVDb2x1bW4uZGF0YUtleX19XG4gICAgICAgIDwvbmctY29udGFpbmVyPlxuICAgICAgICA8bmctY29udGFpbmVyICpuZ1N3aXRjaENhc2U9XCJEYXRhVHlwZS5EYXRlXCI+XG4gICAgICAgICAge3soZWxlbWVudCB8IGRhdGFQcm9wZXJ0eUdldHRlcjogdGFibGVDb2x1bW4uZGF0YUtleSkgfCBkYXRlOiB0YWJsZUNvbHVtbi5kYXRlRm9ybWF0fX1cbiAgICAgICAgPC9uZy1jb250YWluZXI+XG4gICAgICAgIDxuZy1jb250YWluZXIgKm5nU3dpdGNoRGVmYXVsdD5cbiAgICAgICAgICB7e2VsZW1lbnQgfCBkYXRhUHJvcGVydHlHZXR0ZXI6IHRhYmxlQ29sdW1uLmRhdGFLZXl9fVxuICAgICAgICA8L25nLWNvbnRhaW5lcj5cbiAgICAgIDwvbmctY29udGFpbmVyPlxuICAgIDwvdGQ+XG4gIDwvbmctY29udGFpbmVyPlxuICA8dHIgbWF0LWhlYWRlci1yb3cgKm1hdEhlYWRlclJvd0RlZj1cImRpc3BsYXllZENvbHVtbnNcIj48L3RyPlxuICA8dHIgbWF0LXJvdyAqbWF0Um93RGVmPVwibGV0IHJvdzsgY29sdW1uczogZGlzcGxheWVkQ29sdW1ucztcIj48L3RyPlxuPC90YWJsZT5cbiJdfQ==
|
|
@@ -2,19 +2,21 @@ import { CommonModule } from '@angular/common';
|
|
|
2
2
|
import { NgModule } from '@angular/core';
|
|
3
3
|
import { MatSortModule } from '@angular/material/sort';
|
|
4
4
|
import { MatTableModule } from '@angular/material/table';
|
|
5
|
+
import { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';
|
|
5
6
|
import { TableComponent } from './table.component';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export class TableComponentModule {
|
|
8
9
|
}
|
|
9
10
|
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
-
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
11
|
-
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
11
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent, DataPropertyGetterPipe], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
12
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, providers: [DataPropertyGetterPipe], imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
12
13
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
13
14
|
type: NgModule,
|
|
14
15
|
args: [{
|
|
15
|
-
declarations: [TableComponent],
|
|
16
|
+
declarations: [TableComponent, DataPropertyGetterPipe],
|
|
16
17
|
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
17
18
|
exports: [TableComponent],
|
|
19
|
+
providers: [DataPropertyGetterPipe],
|
|
18
20
|
}]
|
|
19
21
|
}] });
|
|
20
|
-
//# sourceMappingURL=data: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yxFQUFFLENBQUMsY0FBYyxDQUFDO29CQUN6QixTQUFTLEVBQUUsQ0FBQyxzQkFBc0IsQ0FBQztpQkFDcEMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IE1hdFNvcnRNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9tYXRlcmlhbC9zb3J0JztcbmltcG9ydCB7IE1hdFRhYmxlTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvbWF0ZXJpYWwvdGFibGUnO1xuaW1wb3J0IHsgRGF0YVByb3BlcnR5R2V0dGVyUGlwZSB9IGZyb20gJ3NyYy9zaGFyZWQvcGlwZXMvZGF0YVByb3BlcnR5R2V0dGVyJztcbmltcG9ydCB7IFRhYmxlQ29tcG9uZW50IH0gZnJvbSAnLi90YWJsZS5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtUYWJsZUNvbXBvbmVudCwgRGF0YVByb3BlcnR5R2V0dGVyUGlwZV0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGUsIE1hdFRhYmxlTW9kdWxlLCBNYXRTb3J0TW9kdWxlXSxcbiAgZXhwb3J0czogW1RhYmxlQ29tcG9uZW50XSxcbiAgcHJvdmlkZXJzOiBbRGF0YVByb3BlcnR5R2V0dGVyUGlwZV0sXG59KVxuZXhwb3J0IGNsYXNzIFRhYmxlQ29tcG9uZW50TW9kdWxlIHt9XG4iXX0=
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export var DataType;
|
|
2
|
+
(function (DataType) {
|
|
3
|
+
DataType["Date"] = "date";
|
|
4
|
+
DataType["String"] = "string";
|
|
5
|
+
DataType["Label"] = "label";
|
|
6
|
+
})(DataType || (DataType = {}));
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy90YWJsZS90YWJsZS50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZQSxNQUFNLENBQU4sSUFBWSxRQUlYO0FBSkQsV0FBWSxRQUFRO0lBQ2xCLHlCQUFhLENBQUE7SUFDYiw2QkFBaUIsQ0FBQTtJQUNqQiwyQkFBZSxDQUFBO0FBQ2pCLENBQUMsRUFKVyxRQUFRLEtBQVIsUUFBUSxRQUluQiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIElEYXRhU291cmNlID0ge1xuICBba2V5OiBzdHJpbmddOiBJRGF0YVNvdXJjZSB8IHN0cmluZyB8IG51bWJlcjtcbn07XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVRhYmxlQ29sdW1uIHtcbiAgbmFtZTogc3RyaW5nO1xuICBkYXRhS2V5OiBzdHJpbmc7XG4gIHNvcnRhYmxlPzogYm9vbGVhbjtcbiAgZGF0YVR5cGU/OiBEYXRhVHlwZTtcbiAgZGF0ZUZvcm1hdD86IHN0cmluZztcbn1cblxuZXhwb3J0IGVudW0gRGF0YVR5cGUge1xuICBEYXRlID0gJ2RhdGUnLFxuICBTdHJpbmcgPSAnc3RyaW5nJyxcbiAgTGFiZWwgPSAnbGFiZWwnLFxufVxuIl19
|
package/esm2020/public-api.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// PUBLIC API
|
|
2
1
|
// Table Component
|
|
3
|
-
export * from './components/table/table.component';
|
|
4
2
|
export * from './components/table/table.component.module';
|
|
3
|
+
export * from './components/table/table.component';
|
|
5
4
|
export * from './components/table/table.types';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFrQjtBQUNsQixjQUFjLDJDQUEyQyxDQUFDO0FBQzFELGNBQWMsb0NBQW9DLENBQUM7QUFDbkQsY0FBYyxnQ0FBZ0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRhYmxlIENvbXBvbmVudFxuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL3RhYmxlL3RhYmxlLmNvbXBvbmVudC5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL3RhYmxlL3RhYmxlLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvdGFibGUvdGFibGUudHlwZXMnO1xuIl19
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class DataPropertyGetterPipe {
|
|
4
|
+
transform(object, keyName) {
|
|
5
|
+
return this.getDeepVal(object, keyName);
|
|
6
|
+
}
|
|
7
|
+
getDeepVal(obj, path) {
|
|
8
|
+
if (typeof obj === 'undefined' || obj === null) {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
const splittedPath = path.split(/[\.\[\]\"\']{1,2}/);
|
|
12
|
+
for (let i = 0, l = splittedPath.length; i < l; i++) {
|
|
13
|
+
if (splittedPath[i] === '') {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
obj = obj[splittedPath[i]];
|
|
17
|
+
if (typeof obj === 'undefined' || obj === null) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
DataPropertyGetterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
25
|
+
DataPropertyGetterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, name: "dataPropertyGetter" });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, decorators: [{
|
|
27
|
+
type: Pipe,
|
|
28
|
+
args: [{
|
|
29
|
+
name: 'dataPropertyGetter',
|
|
30
|
+
}]
|
|
31
|
+
}] });
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YVByb3BlcnR5R2V0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL3NoYXJlZC9waXBlcy9kYXRhUHJvcGVydHlHZXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7O0FBUXBELE1BQU0sT0FBTyxzQkFBc0I7SUFDakMsU0FBUyxDQUFDLE1BQW1CLEVBQUUsT0FBZTtRQUM1QyxPQUFPLElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQzFDLENBQUM7SUFFTyxVQUFVLENBQUMsR0FBUSxFQUFFLElBQVk7UUFDdkMsSUFBSSxPQUFPLEdBQUcsS0FBSyxXQUFXLElBQUksR0FBRyxLQUFLLElBQUksRUFBRTtZQUM5QyxPQUFPLEVBQUUsQ0FBQztTQUNYO1FBQ0QsTUFBTSxZQUFZLEdBQUcsSUFBSSxDQU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hU291cmNlLCBrZXlOYW1lOiBzdHJpbmcpOiBEYXRhUHJvcGVydHlHZXR0ZXJUeXBlIHtcbiAgICByZXR1cm4gdGhpcy5nZXREZWVwVmFsKG9iamVjdCwga2V5TmFtZSk7XG4gIH1cblxuICBwcml2YXRlIGdldERlZXBWYWwob2JqOiBhbnksIHBhdGg6IHN0cmluZyk6IERhdGFQcm9wZXJ0eUdldHRlclR5cGUge1xuICAgIGlmICh0eXBlb2Ygb2JqID09PSAndW5kZWZpbmVkJyB8fCBvYmogPT09IG51bGwpIHtcbiAgICAgIHJldHVybiAnJztcbiAgICB9XG4gICAgY29uc3Qgc3BsaXR0ZWRQYXRoID0gcGF0aC5zcGxpdCgvW1xcLlxcW1xcXVxcXCJcXCddezEsMn0vKTtcbiAgICBmb3IgKGxldCBpID0gMCwgbCA9IHNwbGl0dGVkUGF0aC5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgIGlmIChzcGxpdHRlZFBhdGhbaV0gPT09ICcnKSB7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuICAgICAgb2JqID0gb2JqW3NwbGl0dGVkUGF0aFtpXV07XG4gICAgICBpZiAodHlwZW9mIG9iaiA9PT0gJ3VuZGVmaW5lZCcgfHwgb2JqID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiAnJztcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG9iajtcbiAgfVxufVxuIl19
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
import * as i4 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
4
|
import { EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
5
|
+
import * as i3 from '@angular/material/sort';
|
|
4
6
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
5
|
-
import * as
|
|
7
|
+
import * as i2 from '@angular/material/table';
|
|
6
8
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
7
|
-
import * as
|
|
8
|
-
import {
|
|
9
|
+
import * as i1 from 'src/shared/pipes/dataPropertyGetter';
|
|
10
|
+
import { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';
|
|
11
|
+
|
|
12
|
+
var DataType;
|
|
13
|
+
(function (DataType) {
|
|
14
|
+
DataType["Date"] = "date";
|
|
15
|
+
DataType["String"] = "string";
|
|
16
|
+
DataType["Label"] = "label";
|
|
17
|
+
})(DataType || (DataType = {}));
|
|
9
18
|
|
|
10
19
|
class TableComponent {
|
|
11
|
-
constructor() {
|
|
20
|
+
constructor(dataPropertyGetterPipe) {
|
|
21
|
+
this.dataPropertyGetterPipe = dataPropertyGetterPipe;
|
|
12
22
|
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
13
23
|
// https://github.com/storybookjs/storybook/issues/16865
|
|
14
24
|
// https://github.com/storybookjs/storybook/issues/17004
|
|
@@ -20,6 +30,10 @@ class TableComponent {
|
|
|
20
30
|
* @ignore
|
|
21
31
|
*/
|
|
22
32
|
this.displayedColumns = [];
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
this.DataType = DataType;
|
|
23
37
|
/**
|
|
24
38
|
* Data structure to select which columns should be rendered and their capabilities
|
|
25
39
|
*
|
|
@@ -66,15 +80,16 @@ class TableComponent {
|
|
|
66
80
|
*/
|
|
67
81
|
setTableDataSource(data) {
|
|
68
82
|
this.dataSource = new MatTableDataSource(data);
|
|
83
|
+
this.dataSource.sortingDataAccessor = (item, property) => this.dataPropertyGetterPipe.transform(item, property);
|
|
69
84
|
this.dataSource.sort = this.sort;
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
|
-
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
-
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.
|
|
87
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token: i1.DataPropertyGetterPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
88
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"], components: [{ type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i3.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i2.MatCellDef, selector: "[matCellDef]" }, { type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "dataPropertyGetter": i1.DataPropertyGetterPipe, "date": i4.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
75
90
|
type: Component,
|
|
76
|
-
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.
|
|
77
|
-
}], propDecorators: { sort: [{
|
|
91
|
+
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"] }]
|
|
92
|
+
}], ctorParameters: function () { return [{ type: i1.DataPropertyGetterPipe }]; }, propDecorators: { sort: [{
|
|
78
93
|
type: ViewChild,
|
|
79
94
|
args: [MatSort, { static: true }]
|
|
80
95
|
}], tableData: [{
|
|
@@ -90,22 +105,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
90
105
|
class TableComponentModule {
|
|
91
106
|
}
|
|
92
107
|
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
93
|
-
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
94
|
-
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
108
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent, DataPropertyGetterPipe], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
109
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, providers: [DataPropertyGetterPipe], imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
95
110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
96
111
|
type: NgModule,
|
|
97
112
|
args: [{
|
|
98
|
-
declarations: [TableComponent],
|
|
113
|
+
declarations: [TableComponent, DataPropertyGetterPipe],
|
|
99
114
|
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
100
115
|
exports: [TableComponent],
|
|
116
|
+
providers: [DataPropertyGetterPipe],
|
|
101
117
|
}]
|
|
102
118
|
}] });
|
|
103
119
|
|
|
104
|
-
//
|
|
120
|
+
// Table Component
|
|
105
121
|
|
|
106
122
|
/**
|
|
107
123
|
* Generated bundle index. Do not edit.
|
|
108
124
|
*/
|
|
109
125
|
|
|
110
|
-
export { TableComponent, TableComponentModule };
|
|
126
|
+
export { DataType, TableComponent, TableComponentModule };
|
|
111
127
|
//# sourceMappingURL=testgorilla-tgo-ui.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/table/table.component.ts","../../../src/components/table/table.component.html","../../../src/components/table/table.component.module.ts","../../../src/public-api.ts","../../../src/testgorilla-tgo-ui.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { MatSort, Sort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\nimport { IDataSource, ITableColumn } from './table.types';\n\n@Component({\n selector: 'ui-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TableComponent implements OnInit {\n // TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13\n // https://github.com/storybookjs/storybook/issues/16865\n // https://github.com/storybookjs/storybook/issues/17004\n\n /**\n * @ignore\n */\n dataSource = new MatTableDataSource<any>([]);\n\n /**\n * @ignore\n */\n displayedColumns: string[] = [];\n\n /**\n * @ignore\n */\n @ViewChild(MatSort, { static: true }) sort!: MatSort;\n\n /**\n * Data to be rendered\n *\n * @type {IDataSource}\n * @memberof TableComponent\n */\n @Input() set tableData(data: IDataSource[]) {\n this.setTableDataSource(data);\n }\n\n /**\n * Data structure to select which columns should be rendered and their capabilities\n *\n * @type {ITableColumn}\n * @memberof TableComponent\n */\n @Input() tableColumns: ITableColumn[] = [];\n\n /**\n * @ignore\n */\n @Output() onSortEvent: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /**\n * @ignore\n */\n @Output() onRowClickEvent: EventEmitter<any> = new EventEmitter<any>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.displayedColumns = this.tableColumns.map((tableColumn: ITableColumn) => tableColumn.name);\n }\n\n onSort(sortParams: Sort) {\n const column = this.tableColumns.find((column: ITableColumn) => column.name === sortParams.active);\n if (column?.dataKey) {\n sortParams.active = column?.dataKey;\n }\n this.onSortEvent.emit(sortParams);\n }\n\n onRowClick(rowParams: any) {\n this.onRowClickEvent.emit(rowParams);\n }\n\n /**\n * @ignore\n */\n private setTableDataSource(data: IDataSource[]) {\n this.dataSource = new MatTableDataSource<any>(data);\n this.dataSource.sort = this.sort;\n }\n}\n","<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent],\n imports: [CommonModule, MatTableModule, MatSortModule],\n exports: [TableComponent],\n})\nexport class TableComponentModule {}\n","// PUBLIC API\n\n// Table Component\nexport * from './components/table/table.component';\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAWa,cAAc,CAAA;AAN3B,IAAA,WAAA,GAAA;;;;AAWE;;AAEG;QACH,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,CAAM,EAAE,CAAC,CAAC;AAE7C;;AAEG;AACH,QAAA,IAAgB,CAAA,gBAAA,GAAa,EAAE,CAAC;AAiBhC;;;;;AAKG;AACM,QAAA,IAAY,CAAA,YAAA,GAAmB,EAAE,CAAC;AAE3C;;AAEG;AACO,QAAA,IAAA,CAAA,WAAW,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAErE;;AAEG;AACO,QAAA,IAAA,CAAA,eAAe,GAAsB,IAAI,YAAY,EAAO,CAAC;KA4BxE;AAtDC;;;;;AAKG;IACH,IAAa,SAAS,CAAC,IAAmB,EAAA;AACxC,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC/B;AAoBD;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAyB,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC;KAChG;AAED,IAAA,MAAM,CAAC,UAAgB,EAAA;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAoB,KAAK,MAAM,CAAC,IAAI,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AAA,EAAA,CAAA,CAAA;AAEb,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAHtB,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,CAAA,EAAA,CAAA,CAAA;4FAG3C,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;AAC9B,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC;oBACtD,OAAO,EAAE,CAAC,cAAc,CAAC;iBAC1B,CAAA;;;ACVD;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/table/table.types.ts","../../../src/components/table/table.component.ts","../../../src/components/table/table.component.html","../../../src/components/table/table.component.module.ts","../../../src/public-api.ts","../../../src/testgorilla-tgo-ui.ts"],"sourcesContent":["export type IDataSource = {\n [key: string]: IDataSource | string | number;\n};\n\nexport interface ITableColumn {\n name: string;\n dataKey: string;\n sortable?: boolean;\n dataType?: DataType;\n dateFormat?: string;\n}\n\nexport enum DataType {\n Date = 'date',\n String = 'string',\n Label = 'label',\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { MatSort, Sort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\nimport { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';\nimport { DataType, IDataSource, ITableColumn } from './table.types';\n\n@Component({\n selector: 'ui-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TableComponent implements OnInit {\n // TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13\n // https://github.com/storybookjs/storybook/issues/16865\n // https://github.com/storybookjs/storybook/issues/17004\n\n /**\n * @ignore\n */\n dataSource = new MatTableDataSource<any>([]);\n\n /**\n * @ignore\n */\n displayedColumns: string[] = [];\n\n /**\n * @ignore\n */\n DataType = DataType;\n\n /**\n * @ignore\n */\n @ViewChild(MatSort, { static: true }) sort!: MatSort;\n\n /**\n * Data to be rendered\n *\n * @type {IDataSource}\n * @memberof TableComponent\n */\n @Input() set tableData(data: IDataSource[]) {\n this.setTableDataSource(data);\n }\n\n /**\n * Data structure to select which columns should be rendered and their capabilities\n *\n * @type {ITableColumn}\n * @memberof TableComponent\n */\n @Input() tableColumns: ITableColumn[] = [];\n\n /**\n * @ignore\n */\n @Output() onSortEvent: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /**\n * @ignore\n */\n @Output() onRowClickEvent: EventEmitter<any> = new EventEmitter<any>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.displayedColumns = this.tableColumns.map((tableColumn: ITableColumn) => tableColumn.name);\n }\n\n constructor(private dataPropertyGetterPipe: DataPropertyGetterPipe) {}\n\n onSort(sortParams: Sort) {\n const column = this.tableColumns.find((column: ITableColumn) => column.name === sortParams.active);\n if (column?.dataKey) {\n sortParams.active = column?.dataKey;\n }\n this.onSortEvent.emit(sortParams);\n }\n\n onRowClick(rowParams: any) {\n this.onRowClickEvent.emit(rowParams);\n }\n\n /**\n * @ignore\n */\n private setTableDataSource(data: IDataSource[]) {\n this.dataSource = new MatTableDataSource<any>(data);\n this.dataSource.sortingDataAccessor = (item, property) => this.dataPropertyGetterPipe.transform(item, property);\n this.dataSource.sort = this.sort;\n }\n}\n","<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent, DataPropertyGetterPipe],\n imports: [CommonModule, MatTableModule, MatSortModule],\n exports: [TableComponent],\n providers: [DataPropertyGetterPipe],\n})\nexport class TableComponentModule {}\n","// Table Component\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.component';\nexport * from './components/table/table.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAYY,IAAA,SAIX;AAJD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,C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A,CAAA;sBAApB,KAAK;gBAKI,WAAW,EAAA,CAAA;sBAApB,MAAM;gBAKG,eAAe,EAAA,CAAA;sBAAxB,MAAM;;;MElDI,oBAAoB,CAAA;;kHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mHAApB,oBAAoB,EAAA,YAAA,EAAA,CALhB,cAAc,EAAE,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAC3C,YAAY,EAAE,cAAc,EAAE,aAAa,CAAA,EAAA,OAAA,EAAA,CAC3C,cAAc,CAAA,EAAA,CAAA,CAAA;mHAGb,oBAAoB,EAAA,SAAA,EAFpB,CAAC,sBAAsB,CAAC,EAAA,OAAA,EAAA,CAF1B,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,CAAA,EAAA,CAAA,CAAA;4FAI3C,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,cAAc,EAAE,sBAAsB,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC;oBACtD,OAAO,EAAE,CAAC,cAAc,CAAC;oBACzB,SAAS,EAAE,CAAC,sBAAsB,CAAC;iBACpC,CAAA;;;ACZD;;ACAA;;AAEG;;;;"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
import * as i4 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
4
|
import { EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
5
|
+
import * as i3 from '@angular/material/sort';
|
|
4
6
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
5
|
-
import * as
|
|
7
|
+
import * as i2 from '@angular/material/table';
|
|
6
8
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
7
|
-
import * as
|
|
8
|
-
import {
|
|
9
|
+
import * as i1 from 'src/shared/pipes/dataPropertyGetter';
|
|
10
|
+
import { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';
|
|
11
|
+
|
|
12
|
+
var DataType;
|
|
13
|
+
(function (DataType) {
|
|
14
|
+
DataType["Date"] = "date";
|
|
15
|
+
DataType["String"] = "string";
|
|
16
|
+
DataType["Label"] = "label";
|
|
17
|
+
})(DataType || (DataType = {}));
|
|
9
18
|
|
|
10
19
|
class TableComponent {
|
|
11
|
-
constructor() {
|
|
20
|
+
constructor(dataPropertyGetterPipe) {
|
|
21
|
+
this.dataPropertyGetterPipe = dataPropertyGetterPipe;
|
|
12
22
|
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
13
23
|
// https://github.com/storybookjs/storybook/issues/16865
|
|
14
24
|
// https://github.com/storybookjs/storybook/issues/17004
|
|
@@ -20,6 +30,10 @@ class TableComponent {
|
|
|
20
30
|
* @ignore
|
|
21
31
|
*/
|
|
22
32
|
this.displayedColumns = [];
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
this.DataType = DataType;
|
|
23
37
|
/**
|
|
24
38
|
* Data structure to select which columns should be rendered and their capabilities
|
|
25
39
|
*
|
|
@@ -66,15 +80,16 @@ class TableComponent {
|
|
|
66
80
|
*/
|
|
67
81
|
setTableDataSource(data) {
|
|
68
82
|
this.dataSource = new MatTableDataSource(data);
|
|
83
|
+
this.dataSource.sortingDataAccessor = (item, property) => this.dataPropertyGetterPipe.transform(item, property);
|
|
69
84
|
this.dataSource.sort = this.sort;
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
|
-
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
-
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.
|
|
87
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token: i1.DataPropertyGetterPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
88
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"], components: [{ type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i3.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i2.MatCellDef, selector: "[matCellDef]" }, { type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "dataPropertyGetter": i1.DataPropertyGetterPipe, "date": i4.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
75
90
|
type: Component,
|
|
76
|
-
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.
|
|
77
|
-
}], propDecorators: { sort: [{
|
|
91
|
+
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"] }]
|
|
92
|
+
}], ctorParameters: function () { return [{ type: i1.DataPropertyGetterPipe }]; }, propDecorators: { sort: [{
|
|
78
93
|
type: ViewChild,
|
|
79
94
|
args: [MatSort, { static: true }]
|
|
80
95
|
}], tableData: [{
|
|
@@ -90,22 +105,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
90
105
|
class TableComponentModule {
|
|
91
106
|
}
|
|
92
107
|
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
93
|
-
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
94
|
-
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
108
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent, DataPropertyGetterPipe], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
109
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, providers: [DataPropertyGetterPipe], imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
95
110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
96
111
|
type: NgModule,
|
|
97
112
|
args: [{
|
|
98
|
-
declarations: [TableComponent],
|
|
113
|
+
declarations: [TableComponent, DataPropertyGetterPipe],
|
|
99
114
|
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
100
115
|
exports: [TableComponent],
|
|
116
|
+
providers: [DataPropertyGetterPipe],
|
|
101
117
|
}]
|
|
102
118
|
}] });
|
|
103
119
|
|
|
104
|
-
//
|
|
120
|
+
// Table Component
|
|
105
121
|
|
|
106
122
|
/**
|
|
107
123
|
* Generated bundle index. Do not edit.
|
|
108
124
|
*/
|
|
109
125
|
|
|
110
|
-
export { TableComponent, TableComponentModule };
|
|
126
|
+
export { DataType, TableComponent, TableComponentModule };
|
|
111
127
|
//# sourceMappingURL=testgorilla-tgo-ui.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/table/table.component.ts","../../../src/components/table/table.component.html","../../../src/components/table/table.component.module.ts","../../../src/public-api.ts","../../../src/testgorilla-tgo-ui.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { MatSort, Sort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\nimport { IDataSource, ITableColumn } from './table.types';\n\n@Component({\n selector: 'ui-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TableComponent implements OnInit {\n // TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13\n // https://github.com/storybookjs/storybook/issues/16865\n // https://github.com/storybookjs/storybook/issues/17004\n\n /**\n * @ignore\n */\n dataSource = new MatTableDataSource<any>([]);\n\n /**\n * @ignore\n */\n displayedColumns: string[] = [];\n\n /**\n * @ignore\n */\n @ViewChild(MatSort, { static: true }) sort!: MatSort;\n\n /**\n * Data to be rendered\n *\n * @type {IDataSource}\n * @memberof TableComponent\n */\n @Input() set tableData(data: IDataSource[]) {\n this.setTableDataSource(data);\n }\n\n /**\n * Data structure to select which columns should be rendered and their capabilities\n *\n * @type {ITableColumn}\n * @memberof TableComponent\n */\n @Input() tableColumns: ITableColumn[] = [];\n\n /**\n * @ignore\n */\n @Output() onSortEvent: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /**\n * @ignore\n */\n @Output() onRowClickEvent: EventEmitter<any> = new EventEmitter<any>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.displayedColumns = this.tableColumns.map((tableColumn: ITableColumn) => tableColumn.name);\n }\n\n onSort(sortParams: Sort) {\n const column = this.tableColumns.find((column: ITableColumn) => column.name === sortParams.active);\n if (column?.dataKey) {\n sortParams.active = column?.dataKey;\n }\n this.onSortEvent.emit(sortParams);\n }\n\n onRowClick(rowParams: any) {\n this.onRowClickEvent.emit(rowParams);\n }\n\n /**\n * @ignore\n */\n private setTableDataSource(data: IDataSource[]) {\n this.dataSource = new MatTableDataSource<any>(data);\n this.dataSource.sort = this.sort;\n }\n}\n","<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent],\n imports: [CommonModule, MatTableModule, MatSortModule],\n exports: [TableComponent],\n})\nexport class TableComponentModule {}\n","// PUBLIC API\n\n// Table Component\nexport * from './components/table/table.component';\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAWa,cAAc,CAAA;AAN3B,IAAA,WAAA,GAAA;;;;AAWE;;AAEG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,CAAM,EAAE,CAAC,CAAC;AAE7C;;AAEG;QACH,IAAgB,CAAA,gBAAA,GAAa,EAAE,CAAC;AAiBhC;;;;;AAKG;QACM,IAAY,CAAA,YAAA,GAAmB,EAAE,CAAC;AAE3C;;AAEG;AACO,QAAA,IAAA,CAAA,WAAW,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAErE;;AAEG;AACO,QAAA,IAAA,CAAA,eAAe,GAAsB,IAAI,YAAY,EAAO,CAAC;AA4BxE,KAAA;AAtDC;;;;;AAKG;IACH,IAAa,SAAS,CAAC,IAAmB,EAAA;AACxC,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC/B;AAoBD;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAyB,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC;KAChG;AAED,IAAA,MAAM,CAAC,UAAgB,EAAA;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAoB,KAAK,MAAM,CAAC,IAAI,KAA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A,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAHtB,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,CAAA,EAAA,CAAA,CAAA;4FAG3C,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;AAC9B,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC;oBACtD,OAAO,EAAE,CAAC,cAAc,CAAC;AAC1B,iBAAA,CAAA;;;ACVD;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/table/table.types.ts","../../../src/components/table/table.component.ts","../../../src/components/table/table.component.html","../../../src/components/table/table.component.module.ts","../../../src/public-api.ts","../../../src/testgorilla-tgo-ui.ts"],"sourcesContent":["export type IDataSource = {\n [key: string]: IDataSource | string | number;\n};\n\nexport interface ITableColumn {\n name: string;\n dataKey: string;\n sortable?: boolean;\n dataType?: DataType;\n dateFormat?: string;\n}\n\nexport enum DataType {\n Date = 'date',\n String = 'string',\n Label = 'label',\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { MatSort, Sort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\nimport { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';\nimport { DataType, IDataSource, ITableColumn } from './table.types';\n\n@Component({\n selector: 'ui-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TableComponent implements OnInit {\n // TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13\n // https://github.com/storybookjs/storybook/issues/16865\n // https://github.com/storybookjs/storybook/issues/17004\n\n /**\n * @ignore\n */\n dataSource = new MatTableDataSource<any>([]);\n\n /**\n * @ignore\n */\n displayedColumns: string[] = [];\n\n /**\n * @ignore\n */\n DataType = DataType;\n\n /**\n * @ignore\n */\n @ViewChild(MatSort, { static: true }) sort!: MatSort;\n\n /**\n * Data to be rendered\n *\n * @type {IDataSource}\n * @memberof TableComponent\n */\n @Input() set tableData(data: IDataSource[]) {\n this.setTableDataSource(data);\n }\n\n /**\n * Data structure to select which columns should be rendered and their capabilities\n *\n * @type {ITableColumn}\n * @memberof TableComponent\n */\n @Input() tableColumns: ITableColumn[] = [];\n\n /**\n * @ignore\n */\n @Output() onSortEvent: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /**\n * @ignore\n */\n @Output() onRowClickEvent: EventEmitter<any> = new EventEmitter<any>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.displayedColumns = this.tableColumns.map((tableColumn: ITableColumn) => tableColumn.name);\n }\n\n constructor(private dataPropertyGetterPipe: DataPropertyGetterPipe) {}\n\n onSort(sortParams: Sort) {\n const column = this.tableColumns.find((column: ITableColumn) => column.name === sortParams.active);\n if (column?.dataKey) {\n sortParams.active = column?.dataKey;\n }\n this.onSortEvent.emit(sortParams);\n }\n\n onRowClick(rowParams: any) {\n this.onRowClickEvent.emit(rowParams);\n }\n\n /**\n * @ignore\n */\n private setTableDataSource(data: IDataSource[]) {\n this.dataSource = new MatTableDataSource<any>(data);\n this.dataSource.sortingDataAccessor = (item, property) => this.dataPropertyGetterPipe.transform(item, property);\n this.dataSource.sort = this.sort;\n }\n}\n","<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.sortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n <ng-container [ngSwitch]=\"tableColumn.dataType\">\n <ng-container *ngSwitchCase=\"DataType.String\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Date\">\n {{(element | dataPropertyGetter: tableColumn.dataKey) | date: tableColumn.dateFormat}}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{element | dataPropertyGetter: tableColumn.dataKey}}\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { DataPropertyGetterPipe } from 'src/shared/pipes/dataPropertyGetter';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent, DataPropertyGetterPipe],\n imports: [CommonModule, MatTableModule, MatSortModule],\n exports: [TableComponent],\n providers: [DataPropertyGetterPipe],\n})\nexport class TableComponentModule {}\n","// Table Component\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.component';\nexport * from './components/table/table.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;IAYY,SAIX;AAJD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EAJW,QAAQ,KAAR,QAAQ,GAInB,EAAA,CAAA,CAAA;;MCJY,cAAc,CAAA;AA4DzB,IAAA,WAAA,CAAoB,sBAA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;mHAApB,oBAAoB,EAAA,YAAA,EAAA,CALhB,cAAc,EAAE,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAC3C,YAAY,EAAE,cAAc,EAAE,aAAa,CAAA,EAAA,OAAA,EAAA,CAC3C,cAAc,CAAA,EAAA,CAAA,CAAA;mHAGb,oBAAoB,EAAA,SAAA,EAFpB,CAAC,sBAAsB,CAAC,EAAA,OAAA,EAAA,CAF1B,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,CAAA,EAAA,CAAA,CAAA;4FAI3C,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,cAAc,EAAE,sBAAsB,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC;oBACtD,OAAO,EAAE,CAAC,cAAc,CAAC;oBACzB,SAAS,EAAE,CAAC,sBAAsB,CAAC;AACpC,iBAAA,CAAA;;;ACZD;;ACAA;;AAEG;;;;"}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { IDataSource } from 'src/components/table/table.types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
declare type DataPropertyGetterType = string | number;
|
|
5
|
+
export declare class DataPropertyGetterPipe implements PipeTransform {
|
|
6
|
+
transform(object: IDataSource, keyName: string): DataPropertyGetterType;
|
|
7
|
+
private getDeepVal;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataPropertyGetterPipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DataPropertyGetterPipe, "dataPropertyGetter">;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
package/src/theme/base.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "palette.scss";
|
|
2
2
|
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap");
|
|
3
3
|
|
|
4
4
|
body {
|
|
@@ -91,5 +91,3 @@ input {
|
|
|
91
91
|
input::placeholder {
|
|
92
92
|
font-size: 16px !important;
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|