@testgorilla/tgo-ui 0.0.2 → 0.0.3
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 +5 -0
- package/components/paginator/paginator.component.d.ts +31 -0
- package/components/paginator/paginator.component.module.d.ts +9 -0
- package/components/table/table.component.d.ts +11 -7
- package/components/table/table.component.module.d.ts +3 -2
- package/components/table/table.types.d.ts +8 -3
- package/esm2020/components/paginator/paginator.component.mjs +48 -0
- package/esm2020/components/paginator/paginator.component.module.mjs +20 -0
- package/esm2020/components/table/table.component.mjs +13 -6
- package/esm2020/components/table/table.component.module.mjs +6 -5
- package/esm2020/components/table/table.types.mjs +7 -1
- package/esm2020/public-api.mjs +7 -2
- package/esm2020/shared/pipes/dataPropertyGetter.mjs +1 -1
- package/fesm2015/testgorilla-tgo-ui.mjs +118 -14
- package/fesm2015/testgorilla-tgo-ui.mjs.map +1 -1
- package/fesm2020/testgorilla-tgo-ui.mjs +118 -14
- package/fesm2020/testgorilla-tgo-ui.mjs.map +1 -1
- package/package.json +4 -2
- package/public-api.d.ts +4 -1
- package/shared/pipes/dataPropertyGetter.d.ts +6 -6
- package/src/theme/_variables.scss +2 -2
- package/src/theme/base.scss +3 -2
package/README.md
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { PageEvent } from '@angular/material/paginator';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class PaginatorComponent implements OnInit {
|
|
5
|
+
/**
|
|
6
|
+
* Data length
|
|
7
|
+
*
|
|
8
|
+
* @type {number}
|
|
9
|
+
* @memberof PaginatorComponent
|
|
10
|
+
*/
|
|
11
|
+
length: number;
|
|
12
|
+
/**
|
|
13
|
+
* Default page size
|
|
14
|
+
*
|
|
15
|
+
* @type {number}
|
|
16
|
+
* @memberof PaginatorComponent
|
|
17
|
+
*/
|
|
18
|
+
defaultPageSize: number;
|
|
19
|
+
/**
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
22
|
+
paginatorChangedEvent: EventEmitter<PageEvent>;
|
|
23
|
+
/**
|
|
24
|
+
* @ignore
|
|
25
|
+
*/
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
constructor();
|
|
28
|
+
paginatorChanged(paginator: PageEvent): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorComponent, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PaginatorComponent, "ui-paginator", never, { "length": "length"; "defaultPageSize": "defaultPageSize"; }, { "paginatorChangedEvent": "paginatorChangedEvent"; }, never, never>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./paginator.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/paginator";
|
|
5
|
+
export declare class PaginatorComponentModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorComponentModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PaginatorComponentModule, [typeof i1.PaginatorComponent], [typeof i2.CommonModule, typeof i3.MatPaginatorModule], [typeof i1.PaginatorComponent]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PaginatorComponentModule>;
|
|
9
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
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 { DataPropertyGetterPipe } from '
|
|
5
|
-
import { DataType, IDataSource, ITableColumn } from './table.types';
|
|
4
|
+
import { DataPropertyGetterPipe } from '../../shared/pipes/dataPropertyGetter';
|
|
5
|
+
import { DataType, DateFormat, IDataSource, ITableColumn } from './table.types';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class TableComponent implements OnInit {
|
|
7
|
+
export declare class TableComponent<T extends IDataSource> implements OnInit {
|
|
8
8
|
private dataPropertyGetterPipe;
|
|
9
9
|
/**
|
|
10
10
|
* @ignore
|
|
@@ -18,6 +18,10 @@ export declare class TableComponent implements OnInit {
|
|
|
18
18
|
* @ignore
|
|
19
19
|
*/
|
|
20
20
|
DataType: typeof DataType;
|
|
21
|
+
/**
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
DateFormat: typeof DateFormat;
|
|
21
25
|
/**
|
|
22
26
|
* @ignore
|
|
23
27
|
*/
|
|
@@ -28,7 +32,7 @@ export declare class TableComponent implements OnInit {
|
|
|
28
32
|
* @type {IDataSource}
|
|
29
33
|
* @memberof TableComponent
|
|
30
34
|
*/
|
|
31
|
-
set tableData(data:
|
|
35
|
+
set tableData(data: T[] | null);
|
|
32
36
|
/**
|
|
33
37
|
* Data structure to select which columns should be rendered and their capabilities
|
|
34
38
|
*
|
|
@@ -48,13 +52,13 @@ export declare class TableComponent implements OnInit {
|
|
|
48
52
|
* @ignore
|
|
49
53
|
*/
|
|
50
54
|
ngOnInit(): void;
|
|
51
|
-
constructor(dataPropertyGetterPipe: DataPropertyGetterPipe);
|
|
55
|
+
constructor(dataPropertyGetterPipe: DataPropertyGetterPipe<T>);
|
|
52
56
|
onSort(sortParams: Sort): void;
|
|
53
57
|
onRowClick(rowParams: any): void;
|
|
54
58
|
/**
|
|
55
59
|
* @ignore
|
|
56
60
|
*/
|
|
57
61
|
private setTableDataSource;
|
|
58
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent
|
|
59
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "ui-table", never, { "tableData": "tableData"; "tableColumns": "tableColumns"; }, { "onSortEvent": "onSortEvent"; "onRowClickEvent": "onRowClickEvent"; }, never, never>;
|
|
60
64
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./table.component";
|
|
3
|
-
import * as i2 from "
|
|
3
|
+
import * as i2 from "../../shared/pipes/dataPropertyGetter";
|
|
4
4
|
import * as i3 from "@angular/common";
|
|
5
5
|
import * as i4 from "@angular/material/table";
|
|
6
6
|
import * as i5 from "@angular/material/sort";
|
|
7
|
+
import * as i6 from "ngx-date-fns";
|
|
7
8
|
export declare class TableComponentModule {
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponentModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent, typeof i2.DataPropertyGetterPipe], [typeof i3.CommonModule, typeof i4.MatTableModule, typeof i5.MatSortModule], [typeof i1.TableComponent]>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent, typeof i2.DataPropertyGetterPipe], [typeof i3.CommonModule, typeof i4.MatTableModule, typeof i5.MatSortModule, typeof i6.DateFnsModule], [typeof i1.TableComponent]>;
|
|
10
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<TableComponentModule>;
|
|
11
12
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
export declare type IDataSource = {
|
|
2
|
-
[key: string]:
|
|
2
|
+
[key: string]: any;
|
|
3
3
|
};
|
|
4
4
|
export interface ITableColumn {
|
|
5
5
|
name: string;
|
|
6
6
|
dataKey: string;
|
|
7
7
|
sortable?: boolean;
|
|
8
8
|
dataType?: DataType;
|
|
9
|
-
dateFormat?:
|
|
9
|
+
dateFormat?: DateFormat;
|
|
10
10
|
}
|
|
11
11
|
export declare enum DataType {
|
|
12
12
|
Date = "date",
|
|
13
13
|
String = "string",
|
|
14
|
-
Label = "label"
|
|
14
|
+
Label = "label",
|
|
15
|
+
Percentage = "percentage"
|
|
16
|
+
}
|
|
17
|
+
export declare enum DateFormat {
|
|
18
|
+
Short = "short",
|
|
19
|
+
TimeAgo = "timeAgo"
|
|
15
20
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/material/paginator";
|
|
4
|
+
export class PaginatorComponent {
|
|
5
|
+
constructor() {
|
|
6
|
+
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
7
|
+
// https://github.com/storybookjs/storybook/issues/16865
|
|
8
|
+
// https://github.com/storybookjs/storybook/issues/17004
|
|
9
|
+
/**
|
|
10
|
+
* Data length
|
|
11
|
+
*
|
|
12
|
+
* @type {number}
|
|
13
|
+
* @memberof PaginatorComponent
|
|
14
|
+
*/
|
|
15
|
+
this.length = 0;
|
|
16
|
+
/**
|
|
17
|
+
* Default page size
|
|
18
|
+
*
|
|
19
|
+
* @type {number}
|
|
20
|
+
* @memberof PaginatorComponent
|
|
21
|
+
*/
|
|
22
|
+
this.defaultPageSize = 10;
|
|
23
|
+
/**
|
|
24
|
+
* @ignore
|
|
25
|
+
*/
|
|
26
|
+
this.paginatorChangedEvent = new EventEmitter();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
ngOnInit() { }
|
|
32
|
+
paginatorChanged(paginator) {
|
|
33
|
+
this.paginatorChangedEvent.emit(paginator);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
37
|
+
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PaginatorComponent, selector: "ui-paginator", inputs: { length: "length", defaultPageSize: "defaultPageSize" }, outputs: { paginatorChangedEvent: "paginatorChangedEvent" }, ngImport: i0, template: "<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>", styles: ["mat-paginator{border-radius:0 0 8px 8px}mat-paginator .mat-paginator-outer-container{border-radius:0 0 8px 8px;background:rgba(233,240,241,.5);font-weight:400;font-size:14px;line-height:16px;color:#000}mat-paginator .mat-paginator-outer-container .mat-paginator-container{padding:0}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-select-value-text{font-size:14px}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions{height:100%}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions button{background:rgba(233,240,241,.5);height:100%;width:70px;border-radius:0}\n"], components: [{ type: i1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'ui-paginator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>", styles: ["mat-paginator{border-radius:0 0 8px 8px}mat-paginator .mat-paginator-outer-container{border-radius:0 0 8px 8px;background:rgba(233,240,241,.5);font-weight:400;font-size:14px;line-height:16px;color:#000}mat-paginator .mat-paginator-outer-container .mat-paginator-container{padding:0}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-select-value-text{font-size:14px}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions{height:100%}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions button{background:rgba(233,240,241,.5);height:100%;width:70px;border-radius:0}\n"] }]
|
|
41
|
+
}], ctorParameters: function () { return []; }, propDecorators: { length: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}], defaultPageSize: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}], paginatorChangedEvent: [{
|
|
46
|
+
type: Output
|
|
47
|
+
}] } });
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdG9yLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3BhZ2luYXRvci9wYWdpbmF0b3IuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvcGFnaW5hdG9yL3BhZ2luYXRvci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQVUsTUFBTSxFQUFFLGlCQUFpQixFQUFFLE1BQU0sZUFBZSxDQUFDOzs7QUFVM0gsTUFBTSxPQUFPLGtCQUFrQjtJQStCN0I7UUE5QkEsbUhBQW1IO1FBQ25ILHdEQUF3RDtRQUN4RCx3REFBd0Q7UUFFeEQ7Ozs7O1dBS0c7UUFDTSxXQUFNLEdBQUcsQ0FBQyxDQUFDO1FBRXBCOzs7OztXQUtHO1FBQ00sb0JBQWUsR0FBRyxFQUFFLENBQUM7UUFFOUI7O1dBRUc7UUFDTywwQkFBcUIsR0FBNEIsSUFBSSxZQUFZLEVBQWEsQ0FBQztJQU8xRSxDQUFDO0lBTGhCOztPQUVHO0lBQ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pbmF0b3IgW2xlbmd0aF09XCJsZW5ndGhcIlxuICAgICAgICAgICAgICBbcGFnZVNpemVdPVwiZGVmYXVsdFBhZ2VTaXplXCJcbiAgICAgICAgICAgICAgW3BhZ2VTaXplT3B0aW9uc109XCJbMTAsIDI1LCA1MF1cIlxuICAgICAgICAgICAgICAocGFnZSk9XCJwYWdpbmF0b3JDaGFuZ2VkKCRldmVudClcIj5cbjwvbWF0LXBhZ2luYXRvcj4iXX0=
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
4
|
+
import { PaginatorComponent } from './paginator.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class PaginatorComponentModule {
|
|
7
|
+
}
|
|
8
|
+
PaginatorComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
+
PaginatorComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, declarations: [PaginatorComponent], imports: [CommonModule, MatPaginatorModule], exports: [PaginatorComponent] });
|
|
10
|
+
PaginatorComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, providers: [], imports: [[CommonModule, MatPaginatorModule]] });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, decorators: [{
|
|
12
|
+
type: NgModule,
|
|
13
|
+
args: [{
|
|
14
|
+
declarations: [PaginatorComponent],
|
|
15
|
+
imports: [CommonModule, MatPaginatorModule],
|
|
16
|
+
exports: [PaginatorComponent],
|
|
17
|
+
providers: [],
|
|
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B7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBNYXRQYWdpbmF0b3JNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9tYXRlcmlhbC9wYWdpbmF0b3InO1xuaW1wb3J0IHsgUGFnaW5hdG9yQ29tcG9uZW50IH0gZnJvbSAnLi9wYWdpbmF0b3IuY29tcG9uZW50JztcblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBbUGFnaW5hdG9yQ29tcG9uZW50XSxcbiAgaW1wb3J0czogW0NvbW1vbk1vZHVsZSwgTWF0UGFnaW5hdG9yTW9kdWxlXSxcbiAgZXhwb3J0czogW1BhZ2luYXRvckNvbXBvbmVudF0sXG4gIHByb3ZpZGVyczogW10sXG59KVxuZXhwb3J0IGNsYXNzIFBhZ2luYXRvckNvbXBvbmVudE1vZHVsZSB7fVxuIl19
|
|
@@ -1,12 +1,13 @@
|
|
|
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
|
+
import { DataType, DateFormat } from './table.types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "
|
|
6
|
+
import * as i1 from "../../shared/pipes/dataPropertyGetter";
|
|
7
7
|
import * as i2 from "@angular/material/table";
|
|
8
8
|
import * as i3 from "@angular/material/sort";
|
|
9
9
|
import * as i4 from "@angular/common";
|
|
10
|
+
import * as i5 from "ngx-date-fns";
|
|
10
11
|
export class TableComponent {
|
|
11
12
|
constructor(dataPropertyGetterPipe) {
|
|
12
13
|
this.dataPropertyGetterPipe = dataPropertyGetterPipe;
|
|
@@ -25,6 +26,10 @@ export class TableComponent {
|
|
|
25
26
|
* @ignore
|
|
26
27
|
*/
|
|
27
28
|
this.DataType = DataType;
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
this.DateFormat = DateFormat;
|
|
28
33
|
/**
|
|
29
34
|
* Data structure to select which columns should be rendered and their capabilities
|
|
30
35
|
*
|
|
@@ -48,7 +53,9 @@ export class TableComponent {
|
|
|
48
53
|
* @memberof TableComponent
|
|
49
54
|
*/
|
|
50
55
|
set tableData(data) {
|
|
51
|
-
|
|
56
|
+
if (data?.length) {
|
|
57
|
+
this.setTableDataSource(data);
|
|
58
|
+
}
|
|
52
59
|
}
|
|
53
60
|
/**
|
|
54
61
|
* @ignore
|
|
@@ -76,10 +83,10 @@ export class TableComponent {
|
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
85
|
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) |
|
|
86
|
+
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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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%;overflow:hidden;border-radius:8px 8px 0 0}table .mat-header-cell{font-weight:700;color:#000;background:rgba(233,240,241,.5)}table td,table th,table .mat-row{border:none}table ::ng-deep .mat-sort-header-arrow{color:#276678}table .label{padding:0 8px;width:-moz-fit-content;width:fit-content;font-weight:600;font-size:10px;border-radius:4px;background-color:#e9f0f1;color:#000}table .label.active{background-color:#46a997;color:#fff}\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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "uppercase": i4.UpperCasePipe, "dataPropertyGetter": i1.DataPropertyGetterPipe, "dfnsFormat": i5.FormatPipe, "dfnsParseIso": i5.ParseIsoPipe, "dfnsFormatDistanceToNow": i5.FormatDistanceToNowPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
80
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
81
88
|
type: Component,
|
|
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) |
|
|
89
|
+
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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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%;overflow:hidden;border-radius:8px 8px 0 0}table .mat-header-cell{font-weight:700;color:#000;background:rgba(233,240,241,.5)}table td,table th,table .mat-row{border:none}table ::ng-deep .mat-sort-header-arrow{color:#276678}table .label{padding:0 8px;width:-moz-fit-content;width:fit-content;font-weight:600;font-size:10px;border-radius:4px;background-color:#e9f0f1;color:#000}table .label.active{background-color:#46a997;color:#fff}\n"] }]
|
|
83
90
|
}], ctorParameters: function () { return [{ type: i1.DataPropertyGetterPipe }]; }, propDecorators: { sort: [{
|
|
84
91
|
type: ViewChild,
|
|
85
92
|
args: [MatSort, { static: true }]
|
|
@@ -92,4 +99,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
92
99
|
}], onRowClickEvent: [{
|
|
93
100
|
type: Output
|
|
94
101
|
}] } });
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
102
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkgsT0FBTyxFQUFFL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y1jb250YWluZXI+XG4gICAgICA8L25nLWNvbnRhaW5lcj5cbiAgICA8L3RkPlxuICA8L25nLWNvbnRhaW5lcj5cbiAgPHRyIG1hdC1oZWFkZXItcm93ICptYXRIZWFkZXJSb3dEZWY9XCJkaXNwbGF5ZWRDb2x1bW5zXCI+PC90cj5cbiAgPHRyIG1hdC1yb3cgKm1hdFJvd0RlZj1cImxldCByb3c7IGNvbHVtbnM6IGRpc3BsYXllZENvbHVtbnM7XCI+PC90cj5cbjwvdGFibGU+XG4iXX0=
|
|
@@ -2,21 +2,22 @@ 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 {
|
|
5
|
+
import { DateFnsModule } from 'ngx-date-fns';
|
|
6
|
+
import { DataPropertyGetterPipe } from '../../shared/pipes/dataPropertyGetter';
|
|
6
7
|
import { TableComponent } from './table.component';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export class TableComponentModule {
|
|
9
10
|
}
|
|
10
11
|
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
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
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent, DataPropertyGetterPipe], imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule], exports: [TableComponent] });
|
|
13
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, providers: [DataPropertyGetterPipe], imports: [[CommonModule, MatTableModule, MatSortModule, DateFnsModule]] });
|
|
13
14
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
14
15
|
type: NgModule,
|
|
15
16
|
args: [{
|
|
16
17
|
declarations: [TableComponent, DataPropertyGetterPipe],
|
|
17
|
-
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
18
|
+
imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule],
|
|
18
19
|
exports: [TableComponent],
|
|
19
20
|
providers: [DataPropertyGetterPipe],
|
|
20
21
|
}]
|
|
21
22
|
}] });
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50Lm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3RhYmxlL3RhYmxlLmNvbXBvbmVudC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN6RCxPQUFPLEVBQUUs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5zTW9kdWxlIH0gZnJvbSAnbmd4LWRhdGUtZm5zJztcbmltcG9ydCB7IERhdGFQcm9wZXJ0eUdldHRlclBpcGUgfSBmcm9tICcuLi8uLi9zaGFyZWQvcGlwZXMvZGF0YVByb3BlcnR5R2V0dGVyJztcbmltcG9ydCB7IFRhYmxlQ29tcG9uZW50IH0gZnJvbSAnLi90YWJsZS5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtUYWJsZUNvbXBvbmVudCwgRGF0YVByb3BlcnR5R2V0dGVyUGlwZV0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGUsIE1hdFRhYmxlTW9kdWxlLCBNYXRTb3J0TW9kdWxlLCBEYXRlRm5zTW9kdWxlXSxcbiAgZXhwb3J0czogW1RhYmxlQ29tcG9uZW50XSxcbiAgcHJvdmlkZXJzOiBbRGF0YVByb3BlcnR5R2V0dGVyUGlwZV0sXG59KVxuZXhwb3J0IGNsYXNzIFRhYmxlQ29tcG9uZW50TW9kdWxlIHt9XG4iXX0=
|
|
@@ -3,5 +3,11 @@ export var DataType;
|
|
|
3
3
|
DataType["Date"] = "date";
|
|
4
4
|
DataType["String"] = "string";
|
|
5
5
|
DataType["Label"] = "label";
|
|
6
|
+
DataType["Percentage"] = "percentage";
|
|
6
7
|
})(DataType || (DataType = {}));
|
|
7
|
-
|
|
8
|
+
export var DateFormat;
|
|
9
|
+
(function (DateFormat) {
|
|
10
|
+
DateFormat["Short"] = "short";
|
|
11
|
+
DateFormat["TimeAgo"] = "timeAgo";
|
|
12
|
+
})(DateFormat || (DateFormat = {}));
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy90YWJsZS90YWJsZS50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZQSxNQUFNLENBQU4sSUFBWSxRQUtYO0FBTEQsV0FBWSxRQUFRO0lBQ2xCLHlCQUFhLENBQUE7SUFDYiw2QkFBaUIsQ0FBQTtJQUNqQiwyQkFBZSxDQUFBO0lBQ2YscUNBQXlCLENBQUE7QUFDM0IsQ0FBQyxFQUxXLFFBQVEsS0FBUixRQUFRLFFBS25CO0FBRUQsTUFBTSxDQUFOLElBQVksVUFHWDtBQUhELFdBQVksVUFBVTtJQUNwQiw2QkFBZSxDQUFBO0lBQ2YsaUNBQW1CLENBQUE7QUFDckIsQ0FBQyxFQUhXLFVBQVUsS0FBVixVQUFVLFFBR3JCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgSURhdGFTb3VyY2UgPSB7XG4gIFtrZXk6IHN0cmluZ106IGFueTtcbn07XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVRhYmxlQ29sdW1uIHtcbiAgbmFtZTogc3RyaW5nO1xuICBkYXRhS2V5OiBzdHJpbmc7XG4gIHNvcnRhYmxlPzogYm9vbGVhbjtcbiAgZGF0YVR5cGU/OiBEYXRhVHlwZTtcbiAgZGF0ZUZvcm1hdD86IERhdGVGb3JtYXQ7XG59XG5cbmV4cG9ydCBlbnVtIERhdGFUeXBlIHtcbiAgRGF0ZSA9ICdkYXRlJyxcbiAgU3RyaW5nID0gJ3N0cmluZycsXG4gIExhYmVsID0gJ2xhYmVsJyxcbiAgUGVyY2VudGFnZSA9ICdwZXJjZW50YWdlJyxcbn1cblxuZXhwb3J0IGVudW0gRGF0ZUZvcm1hdCB7XG4gIFNob3J0ID0gJ3Nob3J0JyxcbiAgVGltZUFnbyA9ICd0aW1lQWdvJyxcbn1cbiJdfQ==
|
package/esm2020/public-api.mjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
// Paginator Component
|
|
2
|
+
export * from './components/paginator/paginator.component';
|
|
3
|
+
export * from './components/paginator/paginator.component.module';
|
|
1
4
|
// Table Component
|
|
2
|
-
export * from './components/table/table.component.module';
|
|
3
5
|
export * from './components/table/table.component';
|
|
6
|
+
export * from './components/table/table.component.module';
|
|
4
7
|
export * from './components/table/table.types';
|
|
5
|
-
|
|
8
|
+
// Pipes
|
|
9
|
+
export * from './shared/pipes/dataPropertyGetter';
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHNCQUFzQjtBQUN0QixjQUFjLDRDQUE0QyxDQUFDO0FBQzNELGNBQWMsbURBQW1ELENBQUM7QUFDbEUsa0JBQWtCO0FBQ2xCLGNBQWMsb0NBQW9DLENBQUM7QUFDbkQsY0FBYywyQ0FBMkMsQ0FBQztBQUMxRCxjQUFjLGdDQUFnQyxDQUFDO0FBQy9DLFFBQVE7QUFDUixjQUFjLG1DQUFtQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gUGFnaW5hdG9yIENvbXBvbmVudFxuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL3BhZ2luYXRvci9wYWdpbmF0b3IuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cy9wYWdpbmF0b3IvcGFnaW5hdG9yLmNvbXBvbmVudC5tb2R1bGUnO1xuLy8gVGFibGUgQ29tcG9uZW50XG5leHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cy90YWJsZS90YWJsZS5jb21wb25lbnQubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cy90YWJsZS90YWJsZS50eXBlcyc7XG4vLyBQaXBlc1xuZXhwb3J0ICogZnJvbSAnLi9zaGFyZWQvcGlwZXMvZGF0YVByb3BlcnR5R2V0dGVyJztcbiJdfQ==
|
|
@@ -29,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
29
29
|
name: 'dataPropertyGetter',
|
|
30
30
|
}]
|
|
31
31
|
}] });
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YVByb3BlcnR5R2V0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL3NoYXJlZC9waXBlcy9kYXRhUHJvcGVydHlHZXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7O0FBU3BELE1BQU0sT0FBTyxzQkFBc0I7SUFDakMsU0FBUyxDQUFDLE1BQVMsRUFBRSxPQUFlO1FBQ2xDLE9BQU8sSUFBSSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDMUMsQ0FBQztJQUVPLFVBQVUsQ0FBQyxHQUFRLEVBQUUsSUFBWTtRQUN2QyxJQUFJLE9BQU8sR0FBRyxLQUFLLFdBQVcsSUFBSSxHQUFHLEtBQUssSUFBSSxFQUFFO1lBQzlDLE9BQU8sRUFBRSxDQUFDO1NBQ1g7UUFDRCxNQUFNLFlBQVksR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLG1CQUFtQixDQUFDLENBQUM7UUFDckQsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLFlBQVksQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtZQUNuRCxJQUFJ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biAgcHJpdmF0ZSBnZXREZWVwVmFsKG9iajogYW55LCBwYXRoOiBzdHJpbmcpOiBEYXRhUHJvcGVydHlHZXR0ZXJUeXBlIHtcbiAgICBpZiAodHlwZW9mIG9iaiA9PT0gJ3VuZGVmaW5lZCcgfHwgb2JqID09PSBudWxsKSB7XG4gICAgICByZXR1cm4gJyc7XG4gICAgfVxuICAgIGNvbnN0IHNwbGl0dGVkUGF0aCA9IHBhdGguc3BsaXQoL1tcXC5cXFtcXF1cXFwiXFwnXXsxLDJ9Lyk7XG4gICAgZm9yIChsZXQgaSA9IDAsIGwgPSBzcGxpdHRlZFBhdGgubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XG4gICAgICBpZiAoc3BsaXR0ZWRQYXRoW2ldID09PSAnJykge1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cbiAgICAgIG9iaiA9IG9ialtzcGxpdHRlZFBhdGhbaV1dO1xuICAgICAgaWYgKHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnIHx8IG9iaiA9PT0gbnVsbCkge1xuICAgICAgICByZXR1cm4gJyc7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBvYmo7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,20 +1,118 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule, Pipe, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/paginator';
|
|
4
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
1
5
|
import * as i4 from '@angular/common';
|
|
2
6
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
5
7
|
import * as i3 from '@angular/material/sort';
|
|
6
8
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
7
9
|
import * as i2 from '@angular/material/table';
|
|
8
10
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
+
import * as i5 from 'ngx-date-fns';
|
|
12
|
+
import { DateFnsModule } from 'ngx-date-fns';
|
|
13
|
+
|
|
14
|
+
class PaginatorComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
17
|
+
// https://github.com/storybookjs/storybook/issues/16865
|
|
18
|
+
// https://github.com/storybookjs/storybook/issues/17004
|
|
19
|
+
/**
|
|
20
|
+
* Data length
|
|
21
|
+
*
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @memberof PaginatorComponent
|
|
24
|
+
*/
|
|
25
|
+
this.length = 0;
|
|
26
|
+
/**
|
|
27
|
+
* Default page size
|
|
28
|
+
*
|
|
29
|
+
* @type {number}
|
|
30
|
+
* @memberof PaginatorComponent
|
|
31
|
+
*/
|
|
32
|
+
this.defaultPageSize = 10;
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
this.paginatorChangedEvent = new EventEmitter();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
ngOnInit() { }
|
|
42
|
+
paginatorChanged(paginator) {
|
|
43
|
+
this.paginatorChangedEvent.emit(paginator);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PaginatorComponent, selector: "ui-paginator", inputs: { length: "length", defaultPageSize: "defaultPageSize" }, outputs: { paginatorChangedEvent: "paginatorChangedEvent" }, ngImport: i0, template: "<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>", styles: ["mat-paginator{border-radius:0 0 8px 8px}mat-paginator .mat-paginator-outer-container{border-radius:0 0 8px 8px;background:rgba(233,240,241,.5);font-weight:400;font-size:14px;line-height:16px;color:#000}mat-paginator .mat-paginator-outer-container .mat-paginator-container{padding:0}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-select-value-text{font-size:14px}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions{height:100%}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions button{background:rgba(233,240,241,.5);height:100%;width:70px;border-radius:0}\n"], components: [{ type: i1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{ selector: 'ui-paginator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>", styles: ["mat-paginator{border-radius:0 0 8px 8px}mat-paginator .mat-paginator-outer-container{border-radius:0 0 8px 8px;background:rgba(233,240,241,.5);font-weight:400;font-size:14px;line-height:16px;color:#000}mat-paginator .mat-paginator-outer-container .mat-paginator-container{padding:0}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-select-value-text{font-size:14px}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions{height:100%}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions button{background:rgba(233,240,241,.5);height:100%;width:70px;border-radius:0}\n"] }]
|
|
51
|
+
}], ctorParameters: function () { return []; }, propDecorators: { length: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], defaultPageSize: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], paginatorChangedEvent: [{
|
|
56
|
+
type: Output
|
|
57
|
+
}] } });
|
|
58
|
+
|
|
59
|
+
class PaginatorComponentModule {
|
|
60
|
+
}
|
|
61
|
+
PaginatorComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
62
|
+
PaginatorComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, declarations: [PaginatorComponent], imports: [CommonModule, MatPaginatorModule], exports: [PaginatorComponent] });
|
|
63
|
+
PaginatorComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, providers: [], imports: [[CommonModule, MatPaginatorModule]] });
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, decorators: [{
|
|
65
|
+
type: NgModule,
|
|
66
|
+
args: [{
|
|
67
|
+
declarations: [PaginatorComponent],
|
|
68
|
+
imports: [CommonModule, MatPaginatorModule],
|
|
69
|
+
exports: [PaginatorComponent],
|
|
70
|
+
providers: [],
|
|
71
|
+
}]
|
|
72
|
+
}] });
|
|
11
73
|
|
|
12
74
|
var DataType;
|
|
13
75
|
(function (DataType) {
|
|
14
76
|
DataType["Date"] = "date";
|
|
15
77
|
DataType["String"] = "string";
|
|
16
78
|
DataType["Label"] = "label";
|
|
79
|
+
DataType["Percentage"] = "percentage";
|
|
17
80
|
})(DataType || (DataType = {}));
|
|
81
|
+
var DateFormat;
|
|
82
|
+
(function (DateFormat) {
|
|
83
|
+
DateFormat["Short"] = "short";
|
|
84
|
+
DateFormat["TimeAgo"] = "timeAgo";
|
|
85
|
+
})(DateFormat || (DateFormat = {}));
|
|
86
|
+
|
|
87
|
+
class DataPropertyGetterPipe {
|
|
88
|
+
transform(object, keyName) {
|
|
89
|
+
return this.getDeepVal(object, keyName);
|
|
90
|
+
}
|
|
91
|
+
getDeepVal(obj, path) {
|
|
92
|
+
if (typeof obj === 'undefined' || obj === null) {
|
|
93
|
+
return '';
|
|
94
|
+
}
|
|
95
|
+
const splittedPath = path.split(/[\.\[\]\"\']{1,2}/);
|
|
96
|
+
for (let i = 0, l = splittedPath.length; i < l; i++) {
|
|
97
|
+
if (splittedPath[i] === '') {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
obj = obj[splittedPath[i]];
|
|
101
|
+
if (typeof obj === 'undefined' || obj === null) {
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return obj;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
DataPropertyGetterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
109
|
+
DataPropertyGetterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, name: "dataPropertyGetter" });
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, decorators: [{
|
|
111
|
+
type: Pipe,
|
|
112
|
+
args: [{
|
|
113
|
+
name: 'dataPropertyGetter',
|
|
114
|
+
}]
|
|
115
|
+
}] });
|
|
18
116
|
|
|
19
117
|
class TableComponent {
|
|
20
118
|
constructor(dataPropertyGetterPipe) {
|
|
@@ -34,6 +132,10 @@ class TableComponent {
|
|
|
34
132
|
* @ignore
|
|
35
133
|
*/
|
|
36
134
|
this.DataType = DataType;
|
|
135
|
+
/**
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
138
|
+
this.DateFormat = DateFormat;
|
|
37
139
|
/**
|
|
38
140
|
* Data structure to select which columns should be rendered and their capabilities
|
|
39
141
|
*
|
|
@@ -57,7 +159,9 @@ class TableComponent {
|
|
|
57
159
|
* @memberof TableComponent
|
|
58
160
|
*/
|
|
59
161
|
set tableData(data) {
|
|
60
|
-
|
|
162
|
+
if (data === null || data === void 0 ? void 0 : data.length) {
|
|
163
|
+
this.setTableDataSource(data);
|
|
164
|
+
}
|
|
61
165
|
}
|
|
62
166
|
/**
|
|
63
167
|
* @ignore
|
|
@@ -84,12 +188,12 @@ class TableComponent {
|
|
|
84
188
|
this.dataSource.sort = this.sort;
|
|
85
189
|
}
|
|
86
190
|
}
|
|
87
|
-
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token:
|
|
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) |
|
|
191
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token: DataPropertyGetterPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
192
|
+
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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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%;overflow:hidden;border-radius:8px 8px 0 0}table .mat-header-cell{font-weight:700;color:#000;background:rgba(233,240,241,.5)}table td,table th,table .mat-row{border:none}table ::ng-deep .mat-sort-header-arrow{color:#276678}table .label{padding:0 8px;width:-moz-fit-content;width:fit-content;font-weight:600;font-size:10px;border-radius:4px;background-color:#e9f0f1;color:#000}table .label.active{background-color:#46a997;color:#fff}\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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "uppercase": i4.UpperCasePipe, "dataPropertyGetter": DataPropertyGetterPipe, "dfnsFormat": i5.FormatPipe, "dfnsParseIso": i5.ParseIsoPipe, "dfnsFormatDistanceToNow": i5.FormatDistanceToNowPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
89
193
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
90
194
|
type: Component,
|
|
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) |
|
|
92
|
-
}], ctorParameters: function () { return [{ type:
|
|
195
|
+
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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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%;overflow:hidden;border-radius:8px 8px 0 0}table .mat-header-cell{font-weight:700;color:#000;background:rgba(233,240,241,.5)}table td,table th,table .mat-row{border:none}table ::ng-deep .mat-sort-header-arrow{color:#276678}table .label{padding:0 8px;width:-moz-fit-content;width:fit-content;font-weight:600;font-size:10px;border-radius:4px;background-color:#e9f0f1;color:#000}table .label.active{background-color:#46a997;color:#fff}\n"] }]
|
|
196
|
+
}], ctorParameters: function () { return [{ type: DataPropertyGetterPipe }]; }, propDecorators: { sort: [{
|
|
93
197
|
type: ViewChild,
|
|
94
198
|
args: [MatSort, { static: true }]
|
|
95
199
|
}], tableData: [{
|
|
@@ -105,23 +209,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
105
209
|
class TableComponentModule {
|
|
106
210
|
}
|
|
107
211
|
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
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]] });
|
|
212
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent, DataPropertyGetterPipe], imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule], exports: [TableComponent] });
|
|
213
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, providers: [DataPropertyGetterPipe], imports: [[CommonModule, MatTableModule, MatSortModule, DateFnsModule]] });
|
|
110
214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
111
215
|
type: NgModule,
|
|
112
216
|
args: [{
|
|
113
217
|
declarations: [TableComponent, DataPropertyGetterPipe],
|
|
114
|
-
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
218
|
+
imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule],
|
|
115
219
|
exports: [TableComponent],
|
|
116
220
|
providers: [DataPropertyGetterPipe],
|
|
117
221
|
}]
|
|
118
222
|
}] });
|
|
119
223
|
|
|
120
|
-
//
|
|
224
|
+
// Paginator Component
|
|
121
225
|
|
|
122
226
|
/**
|
|
123
227
|
* Generated bundle index. Do not edit.
|
|
124
228
|
*/
|
|
125
229
|
|
|
126
|
-
export { DataType, TableComponent, TableComponentModule };
|
|
230
|
+
export { DataPropertyGetterPipe, DataType, DateFormat, PaginatorComponent, PaginatorComponentModule, TableComponent, TableComponentModule };
|
|
127
231
|
//# sourceMappingURL=testgorilla-tgo-ui.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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,CAAC,EAJW,QAAQ,KAAR,QAAQ,GAInB,EAAA,CAAA,CAAA;;MCJY,cAAc,CAAA;AA4DzB,IAAA,WAAA,CAAoB,sBAA8C,EAAA;AAA9C,QAAA,IAAsB,CAAA,sBAAA,GAAtB,sBAAsB,CAAwB;;;;AAvDlE;;AAEG;QACH,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,CAAM,EAAE,CAAC,CAAC;AAE7C;;AAEG;AACH,QAAA,IAAgB,CAAA,gBAAA,GAAa,EAAE,CAAC;AAEhC;;AAEG;AACH,QAAA,IAAQ,CAAA,QAAA,GAAG,QAAQ,CAAC;AAiBpB;;;;;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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AA,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
|
+
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/paginator/paginator.component.ts","../../../src/components/paginator/paginator.component.html","../../../src/components/paginator/paginator.component.module.ts","../../../src/components/table/table.types.ts","../../../src/shared/pipes/dataPropertyGetter.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":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';\nimport { PageEvent } from '@angular/material/paginator';\n\n@Component({\n selector: 'ui-paginator',\n templateUrl: './paginator.component.html',\n styleUrls: ['./paginator.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class PaginatorComponent 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 * Data length\n *\n * @type {number}\n * @memberof PaginatorComponent\n */\n @Input() length = 0;\n\n /**\n * Default page size\n *\n * @type {number}\n * @memberof PaginatorComponent\n */\n @Input() defaultPageSize = 10;\n\n /**\n * @ignore\n */\n @Output() paginatorChangedEvent: EventEmitter<PageEvent> = new EventEmitter<PageEvent>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {}\n\n constructor() {}\n\n paginatorChanged(paginator: PageEvent) {\n this.paginatorChangedEvent.emit(paginator);\n }\n}\n","<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatPaginatorModule } from '@angular/material/paginator';\nimport { PaginatorComponent } from './paginator.component';\n\n@NgModule({\n declarations: [PaginatorComponent],\n imports: [CommonModule, MatPaginatorModule],\n exports: [PaginatorComponent],\n providers: [],\n})\nexport class PaginatorComponentModule {}\n","export type IDataSource = {\n [key: string]: any;\n};\n\nexport interface ITableColumn {\n name: string;\n dataKey: string;\n sortable?: boolean;\n dataType?: DataType;\n dateFormat?: DateFormat;\n}\n\nexport enum DataType {\n Date = 'date',\n String = 'string',\n Label = 'label',\n Percentage = 'percentage',\n}\n\nexport enum DateFormat {\n Short = 'short',\n TimeAgo = 'timeAgo',\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { IDataSource } from '../../components/table/table.types';\n\n// TODO: Check type (backend could return a number)\ntype DataPropertyGetterType = string;\n\n@Pipe({\n name: 'dataPropertyGetter',\n})\nexport class DataPropertyGetterPipe<T extends IDataSource> implements PipeTransform {\n transform(object: T, keyName: string): DataPropertyGetterType {\n return this.getDeepVal(object, keyName);\n }\n\n private getDeepVal(obj: any, path: string): DataPropertyGetterType {\n if (typeof obj === 'undefined' || obj === null) {\n return '';\n }\n const splittedPath = path.split(/[\\.\\[\\]\\\"\\']{1,2}/);\n for (let i = 0, l = splittedPath.length; i < l; i++) {\n if (splittedPath[i] === '') {\n continue;\n }\n obj = obj[splittedPath[i]];\n if (typeof obj === 'undefined' || obj === null) {\n return '';\n }\n }\n return obj;\n }\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 '../../shared/pipes/dataPropertyGetter';\nimport { DataType, DateFormat, 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<T extends IDataSource> 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 DateFormat = DateFormat;\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: T[] | null) {\n if (data?.length) {\n this.setTableDataSource(data);\n }\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<T>) {}\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: T[]) {\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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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 { DateFnsModule } from 'ngx-date-fns';\nimport { DataPropertyGetterPipe } from '../../shared/pipes/dataPropertyGetter';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent, DataPropertyGetterPipe],\n imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule],\n exports: [TableComponent],\n providers: [DataPropertyGetterPipe],\n})\nexport class TableComponentModule {}\n","// Paginator Component\nexport * from './components/paginator/paginator.component';\nexport * from './components/paginator/paginator.component.module';\n// Table Component\nexport * from './components/table/table.component';\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.types';\n// Pipes\nexport * from './shared/pipes/dataPropertyGetter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DataPropertyGetterPipe"],"mappings":";;;;;;;;;;;;;MAUa,kBAAkB,CAAA;AA+B7B,IAAA,WAAA,GAAA;;;;AA1BA;;;;;AAKG;AACM,QAAA,IAAM,CAAA,MAAA,GAAG,CAAC,CAAC;AAEpB;;;;;AAKG;AACM,QAAA,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;AAE9B;;AAEG;AACO,QAAA,IAAA,CAAA,qBAAqB,GAA4B,IAAI,YAAY,EAAa,CAAC;KAOzE;AALhB;;AAEG;AACH,IAAA,QAAQ,MAAW;AAInB,IAAA,gBAAgB,CAAC,SAAoB,EAAA;AACnC,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC5C;;gHAnCU,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA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e, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/paginator';
|
|
4
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
1
5
|
import * as i4 from '@angular/common';
|
|
2
6
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
5
7
|
import * as i3 from '@angular/material/sort';
|
|
6
8
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
7
9
|
import * as i2 from '@angular/material/table';
|
|
8
10
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
+
import * as i5 from 'ngx-date-fns';
|
|
12
|
+
import { DateFnsModule } from 'ngx-date-fns';
|
|
13
|
+
|
|
14
|
+
class PaginatorComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
17
|
+
// https://github.com/storybookjs/storybook/issues/16865
|
|
18
|
+
// https://github.com/storybookjs/storybook/issues/17004
|
|
19
|
+
/**
|
|
20
|
+
* Data length
|
|
21
|
+
*
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @memberof PaginatorComponent
|
|
24
|
+
*/
|
|
25
|
+
this.length = 0;
|
|
26
|
+
/**
|
|
27
|
+
* Default page size
|
|
28
|
+
*
|
|
29
|
+
* @type {number}
|
|
30
|
+
* @memberof PaginatorComponent
|
|
31
|
+
*/
|
|
32
|
+
this.defaultPageSize = 10;
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
this.paginatorChangedEvent = new EventEmitter();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
ngOnInit() { }
|
|
42
|
+
paginatorChanged(paginator) {
|
|
43
|
+
this.paginatorChangedEvent.emit(paginator);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PaginatorComponent, selector: "ui-paginator", inputs: { length: "length", defaultPageSize: "defaultPageSize" }, outputs: { paginatorChangedEvent: "paginatorChangedEvent" }, ngImport: i0, template: "<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>", styles: ["mat-paginator{border-radius:0 0 8px 8px}mat-paginator .mat-paginator-outer-container{border-radius:0 0 8px 8px;background:rgba(233,240,241,.5);font-weight:400;font-size:14px;line-height:16px;color:#000}mat-paginator .mat-paginator-outer-container .mat-paginator-container{padding:0}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-select-value-text{font-size:14px}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions{height:100%}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions button{background:rgba(233,240,241,.5);height:100%;width:70px;border-radius:0}\n"], components: [{ type: i1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{ selector: 'ui-paginator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>", styles: ["mat-paginator{border-radius:0 0 8px 8px}mat-paginator .mat-paginator-outer-container{border-radius:0 0 8px 8px;background:rgba(233,240,241,.5);font-weight:400;font-size:14px;line-height:16px;color:#000}mat-paginator .mat-paginator-outer-container .mat-paginator-container{padding:0}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-select-value-text{font-size:14px}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions{height:100%}mat-paginator .mat-paginator-outer-container .mat-paginator-container .mat-paginator-range-actions button{background:rgba(233,240,241,.5);height:100%;width:70px;border-radius:0}\n"] }]
|
|
51
|
+
}], ctorParameters: function () { return []; }, propDecorators: { length: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], defaultPageSize: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], paginatorChangedEvent: [{
|
|
56
|
+
type: Output
|
|
57
|
+
}] } });
|
|
58
|
+
|
|
59
|
+
class PaginatorComponentModule {
|
|
60
|
+
}
|
|
61
|
+
PaginatorComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
62
|
+
PaginatorComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, declarations: [PaginatorComponent], imports: [CommonModule, MatPaginatorModule], exports: [PaginatorComponent] });
|
|
63
|
+
PaginatorComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, providers: [], imports: [[CommonModule, MatPaginatorModule]] });
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginatorComponentModule, decorators: [{
|
|
65
|
+
type: NgModule,
|
|
66
|
+
args: [{
|
|
67
|
+
declarations: [PaginatorComponent],
|
|
68
|
+
imports: [CommonModule, MatPaginatorModule],
|
|
69
|
+
exports: [PaginatorComponent],
|
|
70
|
+
providers: [],
|
|
71
|
+
}]
|
|
72
|
+
}] });
|
|
11
73
|
|
|
12
74
|
var DataType;
|
|
13
75
|
(function (DataType) {
|
|
14
76
|
DataType["Date"] = "date";
|
|
15
77
|
DataType["String"] = "string";
|
|
16
78
|
DataType["Label"] = "label";
|
|
79
|
+
DataType["Percentage"] = "percentage";
|
|
17
80
|
})(DataType || (DataType = {}));
|
|
81
|
+
var DateFormat;
|
|
82
|
+
(function (DateFormat) {
|
|
83
|
+
DateFormat["Short"] = "short";
|
|
84
|
+
DateFormat["TimeAgo"] = "timeAgo";
|
|
85
|
+
})(DateFormat || (DateFormat = {}));
|
|
86
|
+
|
|
87
|
+
class DataPropertyGetterPipe {
|
|
88
|
+
transform(object, keyName) {
|
|
89
|
+
return this.getDeepVal(object, keyName);
|
|
90
|
+
}
|
|
91
|
+
getDeepVal(obj, path) {
|
|
92
|
+
if (typeof obj === 'undefined' || obj === null) {
|
|
93
|
+
return '';
|
|
94
|
+
}
|
|
95
|
+
const splittedPath = path.split(/[\.\[\]\"\']{1,2}/);
|
|
96
|
+
for (let i = 0, l = splittedPath.length; i < l; i++) {
|
|
97
|
+
if (splittedPath[i] === '') {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
obj = obj[splittedPath[i]];
|
|
101
|
+
if (typeof obj === 'undefined' || obj === null) {
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return obj;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
DataPropertyGetterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
109
|
+
DataPropertyGetterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, name: "dataPropertyGetter" });
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataPropertyGetterPipe, decorators: [{
|
|
111
|
+
type: Pipe,
|
|
112
|
+
args: [{
|
|
113
|
+
name: 'dataPropertyGetter',
|
|
114
|
+
}]
|
|
115
|
+
}] });
|
|
18
116
|
|
|
19
117
|
class TableComponent {
|
|
20
118
|
constructor(dataPropertyGetterPipe) {
|
|
@@ -34,6 +132,10 @@ class TableComponent {
|
|
|
34
132
|
* @ignore
|
|
35
133
|
*/
|
|
36
134
|
this.DataType = DataType;
|
|
135
|
+
/**
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
138
|
+
this.DateFormat = DateFormat;
|
|
37
139
|
/**
|
|
38
140
|
* Data structure to select which columns should be rendered and their capabilities
|
|
39
141
|
*
|
|
@@ -57,7 +159,9 @@ class TableComponent {
|
|
|
57
159
|
* @memberof TableComponent
|
|
58
160
|
*/
|
|
59
161
|
set tableData(data) {
|
|
60
|
-
|
|
162
|
+
if (data?.length) {
|
|
163
|
+
this.setTableDataSource(data);
|
|
164
|
+
}
|
|
61
165
|
}
|
|
62
166
|
/**
|
|
63
167
|
* @ignore
|
|
@@ -84,12 +188,12 @@ class TableComponent {
|
|
|
84
188
|
this.dataSource.sort = this.sort;
|
|
85
189
|
}
|
|
86
190
|
}
|
|
87
|
-
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token:
|
|
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) |
|
|
191
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [{ token: DataPropertyGetterPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
192
|
+
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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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%;overflow:hidden;border-radius:8px 8px 0 0}table .mat-header-cell{font-weight:700;color:#000;background:rgba(233,240,241,.5)}table td,table th,table .mat-row{border:none}table ::ng-deep .mat-sort-header-arrow{color:#276678}table .label{padding:0 8px;width:-moz-fit-content;width:fit-content;font-weight:600;font-size:10px;border-radius:4px;background-color:#e9f0f1;color:#000}table .label.active{background-color:#46a997;color:#fff}\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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "uppercase": i4.UpperCasePipe, "dataPropertyGetter": DataPropertyGetterPipe, "dfnsFormat": i5.FormatPipe, "dfnsParseIso": i5.ParseIsoPipe, "dfnsFormatDistanceToNow": i5.FormatDistanceToNowPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
89
193
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
90
194
|
type: Component,
|
|
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) |
|
|
92
|
-
}], ctorParameters: function () { return [{ type:
|
|
195
|
+
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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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%;overflow:hidden;border-radius:8px 8px 0 0}table .mat-header-cell{font-weight:700;color:#000;background:rgba(233,240,241,.5)}table td,table th,table .mat-row{border:none}table ::ng-deep .mat-sort-header-arrow{color:#276678}table .label{padding:0 8px;width:-moz-fit-content;width:fit-content;font-weight:600;font-size:10px;border-radius:4px;background-color:#e9f0f1;color:#000}table .label.active{background-color:#46a997;color:#fff}\n"] }]
|
|
196
|
+
}], ctorParameters: function () { return [{ type: DataPropertyGetterPipe }]; }, propDecorators: { sort: [{
|
|
93
197
|
type: ViewChild,
|
|
94
198
|
args: [MatSort, { static: true }]
|
|
95
199
|
}], tableData: [{
|
|
@@ -105,23 +209,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
105
209
|
class TableComponentModule {
|
|
106
210
|
}
|
|
107
211
|
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
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]] });
|
|
212
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent, DataPropertyGetterPipe], imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule], exports: [TableComponent] });
|
|
213
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, providers: [DataPropertyGetterPipe], imports: [[CommonModule, MatTableModule, MatSortModule, DateFnsModule]] });
|
|
110
214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
111
215
|
type: NgModule,
|
|
112
216
|
args: [{
|
|
113
217
|
declarations: [TableComponent, DataPropertyGetterPipe],
|
|
114
|
-
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
218
|
+
imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule],
|
|
115
219
|
exports: [TableComponent],
|
|
116
220
|
providers: [DataPropertyGetterPipe],
|
|
117
221
|
}]
|
|
118
222
|
}] });
|
|
119
223
|
|
|
120
|
-
//
|
|
224
|
+
// Paginator Component
|
|
121
225
|
|
|
122
226
|
/**
|
|
123
227
|
* Generated bundle index. Do not edit.
|
|
124
228
|
*/
|
|
125
229
|
|
|
126
|
-
export { DataType, TableComponent, TableComponentModule };
|
|
230
|
+
export { DataPropertyGetterPipe, DataType, DateFormat, PaginatorComponent, PaginatorComponentModule, TableComponent, TableComponentModule };
|
|
127
231
|
//# sourceMappingURL=testgorilla-tgo-ui.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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,sBAA8C,EAAA;QAA9C,IAAsB,CAAA,sBAAA,GAAtB,sBAAsB,CAAwB;;;;AAvDlE;;AAEG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,CAAM,EAAE,CAAC,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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;;;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/paginator/paginator.component.ts","../../../src/components/paginator/paginator.component.html","../../../src/components/paginator/paginator.component.module.ts","../../../src/components/table/table.types.ts","../../../src/shared/pipes/dataPropertyGetter.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":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';\nimport { PageEvent } from '@angular/material/paginator';\n\n@Component({\n selector: 'ui-paginator',\n templateUrl: './paginator.component.html',\n styleUrls: ['./paginator.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class PaginatorComponent 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 * Data length\n *\n * @type {number}\n * @memberof PaginatorComponent\n */\n @Input() length = 0;\n\n /**\n * Default page size\n *\n * @type {number}\n * @memberof PaginatorComponent\n */\n @Input() defaultPageSize = 10;\n\n /**\n * @ignore\n */\n @Output() paginatorChangedEvent: EventEmitter<PageEvent> = new EventEmitter<PageEvent>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {}\n\n constructor() {}\n\n paginatorChanged(paginator: PageEvent) {\n this.paginatorChangedEvent.emit(paginator);\n }\n}\n","<mat-paginator [length]=\"length\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"[10, 25, 50]\"\n (page)=\"paginatorChanged($event)\">\n</mat-paginator>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatPaginatorModule } from '@angular/material/paginator';\nimport { PaginatorComponent } from './paginator.component';\n\n@NgModule({\n declarations: [PaginatorComponent],\n imports: [CommonModule, MatPaginatorModule],\n exports: [PaginatorComponent],\n providers: [],\n})\nexport class PaginatorComponentModule {}\n","export type IDataSource = {\n [key: string]: any;\n};\n\nexport interface ITableColumn {\n name: string;\n dataKey: string;\n sortable?: boolean;\n dataType?: DataType;\n dateFormat?: DateFormat;\n}\n\nexport enum DataType {\n Date = 'date',\n String = 'string',\n Label = 'label',\n Percentage = 'percentage',\n}\n\nexport enum DateFormat {\n Short = 'short',\n TimeAgo = 'timeAgo',\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { IDataSource } from '../../components/table/table.types';\n\n// TODO: Check type (backend could return a number)\ntype DataPropertyGetterType = string;\n\n@Pipe({\n name: 'dataPropertyGetter',\n})\nexport class DataPropertyGetterPipe<T extends IDataSource> implements PipeTransform {\n transform(object: T, keyName: string): DataPropertyGetterType {\n return this.getDeepVal(object, keyName);\n }\n\n private getDeepVal(obj: any, path: string): DataPropertyGetterType {\n if (typeof obj === 'undefined' || obj === null) {\n return '';\n }\n const splittedPath = path.split(/[\\.\\[\\]\\\"\\']{1,2}/);\n for (let i = 0, l = splittedPath.length; i < l; i++) {\n if (splittedPath[i] === '') {\n continue;\n }\n obj = obj[splittedPath[i]];\n if (typeof obj === 'undefined' || obj === null) {\n return '';\n }\n }\n return obj;\n }\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 '../../shared/pipes/dataPropertyGetter';\nimport { DataType, DateFormat, 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<T extends IDataSource> 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 DateFormat = DateFormat;\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: T[] | null) {\n if (data?.length) {\n this.setTableDataSource(data);\n }\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<T>) {}\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: T[]) {\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 | uppercase}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name | uppercase}}\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 <span *ngIf=\"tableColumn.dateFormat === DateFormat.Short\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormat: 'dd MMM yyyy'}}</span>\n <span *ngIf=\"tableColumn.dateFormat === DateFormat.TimeAgo\">{{(element | dataPropertyGetter:\n tableColumn.dataKey) | dfnsParseIso | dfnsFormatDistanceToNow}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Label\">\n <span class=\"label\" [ngClass]=\"(element | dataPropertyGetter: tableColumn.dataKey)\">\n {{(element | dataPropertyGetter: tableColumn.dataKey)}}\n </span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DataType.Percentage\">\n {{element | dataPropertyGetter: tableColumn.dataKey}}%\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 { DateFnsModule } from 'ngx-date-fns';\nimport { DataPropertyGetterPipe } from '../../shared/pipes/dataPropertyGetter';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent, DataPropertyGetterPipe],\n imports: [CommonModule, MatTableModule, MatSortModule, DateFnsModule],\n exports: [TableComponent],\n providers: [DataPropertyGetterPipe],\n})\nexport class TableComponentModule {}\n","// Paginator Component\nexport * from './components/paginator/paginator.component';\nexport * from './components/paginator/paginator.component.module';\n// Table Component\nexport * from './components/table/table.component';\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.types';\n// Pipes\nexport * from './shared/pipes/dataPropertyGetter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DataPropertyGetterPipe"],"mappings":";;;;;;;;;;;;;MAUa,kBAAkB,CAAA;AA+B7B,IAAA,WAAA,GAAA;;;;AA1BA;;;;;AAKG;QACM,IAAM,CAAA,MAAA,GAAG,CAAC,CAAC;AAEpB;;;;;AAKG;QACM,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;AAE9B;;AAEG;AACO,QAAA,IAAA,CAAA,qBAAqB,GAA4B,IAAI,YAAY,EAAa,CAAC;KAOzE;AALhB;;AAEG;AACH,IAAA,QAAQ,MAAW;AAInB,IAAA,gBAAgB,CAAC,SAAoB,EAAA;AACnC,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC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|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"lint-staged": {
|
|
5
5
|
"src/**/*.ts": [
|
|
6
6
|
"eslint --fix",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"@angular/platform-browser-dynamic": "^13.3.4",
|
|
28
28
|
"@angular/router": "^13.3.4",
|
|
29
29
|
"rxjs": "^7.5.5",
|
|
30
|
-
"zone.js": "^0.11.5"
|
|
30
|
+
"zone.js": "^0.11.5",
|
|
31
|
+
"date-fns": "^2.28.0",
|
|
32
|
+
"ngx-date-fns": "^9.0.0"
|
|
31
33
|
},
|
|
32
34
|
"module": "fesm2015/testgorilla-tgo-ui.mjs",
|
|
33
35
|
"es2020": "fesm2020/testgorilla-tgo-ui.mjs",
|
package/public-api.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export * from './components/
|
|
1
|
+
export * from './components/paginator/paginator.component';
|
|
2
|
+
export * from './components/paginator/paginator.component.module';
|
|
2
3
|
export * from './components/table/table.component';
|
|
4
|
+
export * from './components/table/table.component.module';
|
|
3
5
|
export * from './components/table/table.types';
|
|
6
|
+
export * from './shared/pipes/dataPropertyGetter';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import { IDataSource } from '
|
|
2
|
+
import { IDataSource } from '../../components/table/table.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
declare type DataPropertyGetterType = string
|
|
5
|
-
export declare class DataPropertyGetterPipe implements PipeTransform {
|
|
6
|
-
transform(object:
|
|
4
|
+
declare type DataPropertyGetterType = string;
|
|
5
|
+
export declare class DataPropertyGetterPipe<T extends IDataSource> implements PipeTransform {
|
|
6
|
+
transform(object: T, keyName: string): DataPropertyGetterType;
|
|
7
7
|
private getDeepVal;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DataPropertyGetterPipe
|
|
9
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<DataPropertyGetterPipe
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataPropertyGetterPipe<any>, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DataPropertyGetterPipe<any>, "dataPropertyGetter">;
|
|
10
10
|
}
|
|
11
11
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* global */
|
|
2
|
+
$background: #ffffff;
|
package/src/theme/base.scss
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
@use "palette.scss"
|
|
1
|
+
@use "palette.scss" as *;
|
|
2
|
+
@use "variables.scss" as *;
|
|
2
3
|
@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
4
|
|
|
4
5
|
body {
|
|
5
6
|
margin: 0;
|
|
6
|
-
background:
|
|
7
|
+
background: $background;
|
|
7
8
|
font-size: 14px;
|
|
8
9
|
color: #888888;
|
|
9
10
|
|