@testgorilla/tgo-ui 0.0.1
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 +55 -0
- package/components/table/table.component.d.ts +53 -0
- package/components/table/table.component.module.d.ts +10 -0
- package/components/table/table.types.d.ts +8 -0
- package/esm2020/components/table/table.component.mjs +87 -0
- package/esm2020/components/table/table.component.module.mjs +20 -0
- package/esm2020/components/table/table.types.mjs +2 -0
- package/esm2020/public-api.mjs +6 -0
- package/esm2020/testgorilla-tgo-ui.mjs +5 -0
- package/fesm2015/testgorilla-tgo-ui.mjs +111 -0
- package/fesm2015/testgorilla-tgo-ui.mjs.map +1 -0
- package/fesm2020/testgorilla-tgo-ui.mjs +111 -0
- package/fesm2020/testgorilla-tgo-ui.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +52 -0
- package/public-api.d.ts +3 -0
- package/src/theme/_palette.scss +108 -0
- package/src/theme/_variables.scss +2 -0
- package/src/theme/base.scss +95 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# TgoTalentFrontend
|
|
2
|
+
|
|
3
|
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.3.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
|
8
|
+
|
|
9
|
+
## Code scaffolding
|
|
10
|
+
|
|
11
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
16
|
+
|
|
17
|
+
## Running unit tests
|
|
18
|
+
|
|
19
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
+
|
|
21
|
+
## Running end-to-end tests
|
|
22
|
+
|
|
23
|
+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
|
24
|
+
|
|
25
|
+
## Further help
|
|
26
|
+
|
|
27
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
28
|
+
|
|
29
|
+
## Visual regression
|
|
30
|
+
|
|
31
|
+
We are using playwright on top of storybook to capture the visual differences. Code for the same can be found in `common.spec.ts` file.
|
|
32
|
+
|
|
33
|
+
In order to update the existing snapshots, we need to use DOCKER to update, since updating from mac or windows has its own effect on the rendering, we might want to use the following way to update the snapshots to be consistant with CI.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.22.0-focal /bin/bash
|
|
37
|
+
npm install
|
|
38
|
+
npx playwright test e2e/common.spec.ts --update-snapshots
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
In order to execute the visual tests, we need to use same docker so that the screenshots are aligned with the same OS.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.22.0-focal /bin/bash
|
|
45
|
+
npm install
|
|
46
|
+
npx playwright test e2e/common.spec.ts
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Currently we are using `toMatchSnapshot` instead of the latest `toHaveScreenshot` from playwright. Since `toHaveScreenshot` doesn't support firefox now, we are going ahead with `toMatchSnapshot`. In (near) future once it supports firefox, we will be using the latest `toHaveScreenshot` method.
|
|
50
|
+
|
|
51
|
+
### Visual Regression Important to note !!!
|
|
52
|
+
|
|
53
|
+
* To add a new component to visual regression one has to provide the `/iframe.html?id=<element_id>` in the file `common.spec.ts` which will take care of taking snapshot whenever we initiate visual tests.
|
|
54
|
+
* We need to have the elements in such a way that `element_id` in `/iframe.html?id=<element_id>` should be present in the DOM. i.e., we should have a dom element `<element_id> ... </element_id>`.
|
|
55
|
+
* We are using that element_id to wait until its fully loaded and then we are taking the snapshot.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { MatSort, Sort } from '@angular/material/sort';
|
|
3
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
4
|
+
import { IDataSource, ITableColumn } from './table.types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TableComponent implements OnInit {
|
|
7
|
+
/**
|
|
8
|
+
* @ignore
|
|
9
|
+
*/
|
|
10
|
+
dataSource: MatTableDataSource<any>;
|
|
11
|
+
/**
|
|
12
|
+
* @ignore
|
|
13
|
+
*/
|
|
14
|
+
displayedColumns: string[];
|
|
15
|
+
/**
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
18
|
+
sort: MatSort;
|
|
19
|
+
/**
|
|
20
|
+
* Data to be rendered
|
|
21
|
+
*
|
|
22
|
+
* @type {IDataSource}
|
|
23
|
+
* @memberof TableComponent
|
|
24
|
+
*/
|
|
25
|
+
set tableData(data: IDataSource[]);
|
|
26
|
+
/**
|
|
27
|
+
* Data structure to select which columns should be rendered and their capabilities
|
|
28
|
+
*
|
|
29
|
+
* @type {ITableColumn}
|
|
30
|
+
* @memberof TableComponent
|
|
31
|
+
*/
|
|
32
|
+
tableColumns: ITableColumn[];
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
onSortEvent: EventEmitter<Sort>;
|
|
37
|
+
/**
|
|
38
|
+
* @ignore
|
|
39
|
+
*/
|
|
40
|
+
onRowClickEvent: EventEmitter<any>;
|
|
41
|
+
/**
|
|
42
|
+
* @ignore
|
|
43
|
+
*/
|
|
44
|
+
ngOnInit(): void;
|
|
45
|
+
onSort(sortParams: Sort): void;
|
|
46
|
+
onRowClick(rowParams: any): void;
|
|
47
|
+
/**
|
|
48
|
+
* @ignore
|
|
49
|
+
*/
|
|
50
|
+
private setTableDataSource;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "ui-table", never, { "tableData": "tableData"; "tableColumns": "tableColumns"; }, { "onSortEvent": "onSortEvent"; "onRowClickEvent": "onRowClickEvent"; }, never, never>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./table.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/table";
|
|
5
|
+
import * as i4 from "@angular/material/sort";
|
|
6
|
+
export declare class TableComponentModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponentModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent], [typeof i2.CommonModule, typeof i3.MatTableModule, typeof i4.MatSortModule], [typeof i1.TableComponent]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TableComponentModule>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
2
|
+
import { MatSort } from '@angular/material/sort';
|
|
3
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/material/table";
|
|
6
|
+
import * as i2 from "@angular/material/sort";
|
|
7
|
+
import * as i3 from "@angular/common";
|
|
8
|
+
export class TableComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
11
|
+
// https://github.com/storybookjs/storybook/issues/16865
|
|
12
|
+
// https://github.com/storybookjs/storybook/issues/17004
|
|
13
|
+
/**
|
|
14
|
+
* @ignore
|
|
15
|
+
*/
|
|
16
|
+
this.dataSource = new MatTableDataSource([]);
|
|
17
|
+
/**
|
|
18
|
+
* @ignore
|
|
19
|
+
*/
|
|
20
|
+
this.displayedColumns = [];
|
|
21
|
+
/**
|
|
22
|
+
* Data structure to select which columns should be rendered and their capabilities
|
|
23
|
+
*
|
|
24
|
+
* @type {ITableColumn}
|
|
25
|
+
* @memberof TableComponent
|
|
26
|
+
*/
|
|
27
|
+
this.tableColumns = [];
|
|
28
|
+
/**
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
this.onSortEvent = new EventEmitter();
|
|
32
|
+
/**
|
|
33
|
+
* @ignore
|
|
34
|
+
*/
|
|
35
|
+
this.onRowClickEvent = new EventEmitter();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Data to be rendered
|
|
39
|
+
*
|
|
40
|
+
* @type {IDataSource}
|
|
41
|
+
* @memberof TableComponent
|
|
42
|
+
*/
|
|
43
|
+
set tableData(data) {
|
|
44
|
+
this.setTableDataSource(data);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
ngOnInit() {
|
|
50
|
+
this.displayedColumns = this.tableColumns.map((tableColumn) => tableColumn.name);
|
|
51
|
+
}
|
|
52
|
+
onSort(sortParams) {
|
|
53
|
+
const column = this.tableColumns.find((column) => column.name === sortParams.active);
|
|
54
|
+
if (column?.dataKey) {
|
|
55
|
+
sortParams.active = column?.dataKey;
|
|
56
|
+
}
|
|
57
|
+
this.onSortEvent.emit(sortParams);
|
|
58
|
+
}
|
|
59
|
+
onRowClick(rowParams) {
|
|
60
|
+
this.onRowClickEvent.emit(rowParams);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @ignore
|
|
64
|
+
*/
|
|
65
|
+
setTableDataSource(data) {
|
|
66
|
+
this.dataSource = new MatTableDataSource(data);
|
|
67
|
+
this.dataSource.sort = this.sort;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"], components: [{ type: i1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i2.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1.MatCellDef, selector: "[matCellDef]" }, { type: i1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"] }]
|
|
75
|
+
}], propDecorators: { sort: [{
|
|
76
|
+
type: ViewChild,
|
|
77
|
+
args: [MatSort, { static: true }]
|
|
78
|
+
}], tableData: [{
|
|
79
|
+
type: Input
|
|
80
|
+
}], tableColumns: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], onSortEvent: [{
|
|
83
|
+
type: Output
|
|
84
|
+
}], onRowClickEvent: [{
|
|
85
|
+
type: Output
|
|
86
|
+
}] } });
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkgsT0FBTyxFQUFFLE9BQU8sRUFBUSxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDOzs7OztBQVM3RCxNQUFNLE9BQU8sY0FBYztJQU4zQjtRQU9FLG1IQUFtSDtRQUNuSCx3REFBd0Q7UUFDeEQsd0RBQXdEO1FBRXhEOztXQUVHO1FBQ0gsZUFBVSxHQUFHLElBQUksa0JBQWtCLENBQU0sRUFBRSxDQUFDLENBQUM7UUFF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RlICNub3RTb3J0YWJsZT5cbiAgICAgIDx0aCBtYXQtaGVhZGVyLWNlbGwgKm1hdEhlYWRlckNlbGxEZWY+XG4gICAgICAgIHt7dGFibGVDb2x1bW4ubmFtZX19XG4gICAgICA8L3RoPlxuICAgIDwvbmctdGVtcGxhdGU+XG4gICAgPHRkIG1hdC1jZWxsICptYXRDZWxsRGVmPVwibGV0IGVsZW1lbnRcIiAoY2xpY2spPVwib25Sb3dDbGljayhlbGVtZW50KVwiPlxuICAgICAge3tlbGVtZW50W3RhYmxlQ29sdW1uLmRhdGFLZXldfX1cbiAgICA8L3RkPlxuICA8L25nLWNvbnRhaW5lcj5cbiAgPHRyIG1hdC1oZWFkZXItcm93ICptYXRIZWFkZXJSb3dEZWY9XCJkaXNwbGF5ZWRDb2x1bW5zXCI+PC90cj5cbiAgPHRyIG1hdC1yb3cgKm1hdFJvd0RlZj1cImxldCByb3c7IGNvbHVtbnM6IGRpc3BsYXllZENvbHVtbnM7XCI+PC90cj5cbjwvdGFibGU+XG4iXX0=
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { MatSortModule } from '@angular/material/sort';
|
|
4
|
+
import { MatTableModule } from '@angular/material/table';
|
|
5
|
+
import { TableComponent } from './table.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class TableComponentModule {
|
|
8
|
+
}
|
|
9
|
+
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
11
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
13
|
+
type: NgModule,
|
|
14
|
+
args: [{
|
|
15
|
+
declarations: [TableComponent],
|
|
16
|
+
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
17
|
+
exports: [TableComponent],
|
|
18
|
+
}]
|
|
19
|
+
}] });
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50Lm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3RhYmxlL3RhYmxlLmNvbXBvbmVudC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN6RCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7O0FBT25ELE1BQU0sT0FBTyxvQkFBb0I7O2tIQUFwQixvQkFBb0I7bUhBQXBCLG9CQUFvQixpQkFKaEIsY0FBYyxhQUNuQixZQUFZLEVBQUUsY0FBYyxFQUFFLGFBQWEsYUFDM0MsY0FBYzttSEFFYixvQkFBb0IsWUFIdEIsQ0FBQyxZQUFZLEVBQUUsY0FBYyxFQUFFLGFBQWEsQ0FBQzs0RkFHM0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291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgSURhdGFTb3VyY2UgPSB7XG4gIFtrZXk6IHN0cmluZ106IHN0cmluZyB8IG51bWJlcjtcbn07XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVRhYmxlQ29sdW1uIHtcbiAgbmFtZTogc3RyaW5nO1xuICBkYXRhS2V5OiBzdHJpbmc7XG4gIGlzU29ydGFibGU/OiBib29sZWFuO1xufVxuIl19
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// PUBLIC API
|
|
2
|
+
// Table Component
|
|
3
|
+
export * from './components/table/table.component';
|
|
4
|
+
export * from './components/table/table.component.module';
|
|
5
|
+
export * from './components/table/table.types';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGFBQWE7QUFFYixrQkFBa0I7QUFDbEIsY0FBYyxvQ0FBb0MsQ0FBQztBQUNuRCxjQUFjLDJDQUEyQyxDQUFDO0FBQzFELGNBQWMsZ0NBQWdDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBQVUJMSUMgQVBJXG5cbi8vIFRhYmxlIENvbXBvbmVudFxuZXhwb3J0ICogZnJvbSAnLi9jb21wb25lbnRzL3RhYmxlL3RhYmxlLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvdGFibGUvdGFibGUuY29tcG9uZW50Lm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2NvbXBvbmVudHMvdGFibGUvdGFibGUudHlwZXMnO1xuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGdvcmlsbGEtdGdvLXVpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3Rlc3Rnb3JpbGxhLXRnby11aS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/sort';
|
|
4
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
5
|
+
import * as i1 from '@angular/material/table';
|
|
6
|
+
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
7
|
+
import * as i3 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
|
|
10
|
+
class TableComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
13
|
+
// https://github.com/storybookjs/storybook/issues/16865
|
|
14
|
+
// https://github.com/storybookjs/storybook/issues/17004
|
|
15
|
+
/**
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
18
|
+
this.dataSource = new MatTableDataSource([]);
|
|
19
|
+
/**
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
22
|
+
this.displayedColumns = [];
|
|
23
|
+
/**
|
|
24
|
+
* Data structure to select which columns should be rendered and their capabilities
|
|
25
|
+
*
|
|
26
|
+
* @type {ITableColumn}
|
|
27
|
+
* @memberof TableComponent
|
|
28
|
+
*/
|
|
29
|
+
this.tableColumns = [];
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
this.onSortEvent = new EventEmitter();
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
this.onRowClickEvent = new EventEmitter();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Data to be rendered
|
|
41
|
+
*
|
|
42
|
+
* @type {IDataSource}
|
|
43
|
+
* @memberof TableComponent
|
|
44
|
+
*/
|
|
45
|
+
set tableData(data) {
|
|
46
|
+
this.setTableDataSource(data);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @ignore
|
|
50
|
+
*/
|
|
51
|
+
ngOnInit() {
|
|
52
|
+
this.displayedColumns = this.tableColumns.map((tableColumn) => tableColumn.name);
|
|
53
|
+
}
|
|
54
|
+
onSort(sortParams) {
|
|
55
|
+
const column = this.tableColumns.find((column) => column.name === sortParams.active);
|
|
56
|
+
if (column === null || column === void 0 ? void 0 : column.dataKey) {
|
|
57
|
+
sortParams.active = column === null || column === void 0 ? void 0 : column.dataKey;
|
|
58
|
+
}
|
|
59
|
+
this.onSortEvent.emit(sortParams);
|
|
60
|
+
}
|
|
61
|
+
onRowClick(rowParams) {
|
|
62
|
+
this.onRowClickEvent.emit(rowParams);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @ignore
|
|
66
|
+
*/
|
|
67
|
+
setTableDataSource(data) {
|
|
68
|
+
this.dataSource = new MatTableDataSource(data);
|
|
69
|
+
this.dataSource.sort = this.sort;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"], components: [{ type: i1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i2.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1.MatCellDef, selector: "[matCellDef]" }, { type: i1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"] }]
|
|
77
|
+
}], propDecorators: { sort: [{
|
|
78
|
+
type: ViewChild,
|
|
79
|
+
args: [MatSort, { static: true }]
|
|
80
|
+
}], tableData: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], tableColumns: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}], onSortEvent: [{
|
|
85
|
+
type: Output
|
|
86
|
+
}], onRowClickEvent: [{
|
|
87
|
+
type: Output
|
|
88
|
+
}] } });
|
|
89
|
+
|
|
90
|
+
class TableComponentModule {
|
|
91
|
+
}
|
|
92
|
+
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
93
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
94
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
96
|
+
type: NgModule,
|
|
97
|
+
args: [{
|
|
98
|
+
declarations: [TableComponent],
|
|
99
|
+
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
100
|
+
exports: [TableComponent],
|
|
101
|
+
}]
|
|
102
|
+
}] });
|
|
103
|
+
|
|
104
|
+
// PUBLIC API
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { TableComponent, TableComponentModule };
|
|
111
|
+
//# sourceMappingURL=testgorilla-tgo-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/table/table.component.ts","../../../src/components/table/table.component.html","../../../src/components/table/table.component.module.ts","../../../src/public-api.ts","../../../src/testgorilla-tgo-ui.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { MatSort, Sort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\nimport { IDataSource, ITableColumn } from './table.types';\n\n@Component({\n selector: 'ui-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TableComponent implements OnInit {\n // TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13\n // https://github.com/storybookjs/storybook/issues/16865\n // https://github.com/storybookjs/storybook/issues/17004\n\n /**\n * @ignore\n */\n dataSource = new MatTableDataSource<any>([]);\n\n /**\n * @ignore\n */\n displayedColumns: string[] = [];\n\n /**\n * @ignore\n */\n @ViewChild(MatSort, { static: true }) sort!: MatSort;\n\n /**\n * Data to be rendered\n *\n * @type {IDataSource}\n * @memberof TableComponent\n */\n @Input() set tableData(data: IDataSource[]) {\n this.setTableDataSource(data);\n }\n\n /**\n * Data structure to select which columns should be rendered and their capabilities\n *\n * @type {ITableColumn}\n * @memberof TableComponent\n */\n @Input() tableColumns: ITableColumn[] = [];\n\n /**\n * @ignore\n */\n @Output() onSortEvent: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /**\n * @ignore\n */\n @Output() onRowClickEvent: EventEmitter<any> = new EventEmitter<any>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.displayedColumns = this.tableColumns.map((tableColumn: ITableColumn) => tableColumn.name);\n }\n\n onSort(sortParams: Sort) {\n const column = this.tableColumns.find((column: ITableColumn) => column.name === sortParams.active);\n if (column?.dataKey) {\n sortParams.active = column?.dataKey;\n }\n this.onSortEvent.emit(sortParams);\n }\n\n onRowClick(rowParams: any) {\n this.onRowClickEvent.emit(rowParams);\n }\n\n /**\n * @ignore\n */\n private setTableDataSource(data: IDataSource[]) {\n this.dataSource = new MatTableDataSource<any>(data);\n this.dataSource.sort = this.sort;\n }\n}\n","<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent],\n imports: [CommonModule, MatTableModule, MatSortModule],\n exports: [TableComponent],\n})\nexport class TableComponentModule {}\n","// PUBLIC API\n\n// Table Component\nexport * from './components/table/table.component';\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAWa,cAAc,CAAA;AAN3B,IAAA,WAAA,GAAA;;;;AAWE;;AAEG;QACH,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,CAAM,EAAE,CAAC,CAAC;AAE7C;;AAEG;AACH,QAAA,IAAgB,CAAA,gBAAA,GAAa,EAAE,CAAC;AAiBhC;;;;;AAKG;AACM,QAAA,IAAY,CAAA,YAAA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} from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/sort';
|
|
4
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
5
|
+
import * as i1 from '@angular/material/table';
|
|
6
|
+
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
7
|
+
import * as i3 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
|
|
10
|
+
class TableComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
// TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13
|
|
13
|
+
// https://github.com/storybookjs/storybook/issues/16865
|
|
14
|
+
// https://github.com/storybookjs/storybook/issues/17004
|
|
15
|
+
/**
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
18
|
+
this.dataSource = new MatTableDataSource([]);
|
|
19
|
+
/**
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
22
|
+
this.displayedColumns = [];
|
|
23
|
+
/**
|
|
24
|
+
* Data structure to select which columns should be rendered and their capabilities
|
|
25
|
+
*
|
|
26
|
+
* @type {ITableColumn}
|
|
27
|
+
* @memberof TableComponent
|
|
28
|
+
*/
|
|
29
|
+
this.tableColumns = [];
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
this.onSortEvent = new EventEmitter();
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
this.onRowClickEvent = new EventEmitter();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Data to be rendered
|
|
41
|
+
*
|
|
42
|
+
* @type {IDataSource}
|
|
43
|
+
* @memberof TableComponent
|
|
44
|
+
*/
|
|
45
|
+
set tableData(data) {
|
|
46
|
+
this.setTableDataSource(data);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @ignore
|
|
50
|
+
*/
|
|
51
|
+
ngOnInit() {
|
|
52
|
+
this.displayedColumns = this.tableColumns.map((tableColumn) => tableColumn.name);
|
|
53
|
+
}
|
|
54
|
+
onSort(sortParams) {
|
|
55
|
+
const column = this.tableColumns.find((column) => column.name === sortParams.active);
|
|
56
|
+
if (column?.dataKey) {
|
|
57
|
+
sortParams.active = column?.dataKey;
|
|
58
|
+
}
|
|
59
|
+
this.onSortEvent.emit(sortParams);
|
|
60
|
+
}
|
|
61
|
+
onRowClick(rowParams) {
|
|
62
|
+
this.onRowClickEvent.emit(rowParams);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @ignore
|
|
66
|
+
*/
|
|
67
|
+
setTableDataSource(data) {
|
|
68
|
+
this.dataSource = new MatTableDataSource(data);
|
|
69
|
+
this.dataSource.sort = this.sort;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TableComponent, selector: "ui-table", inputs: { tableData: "tableData", tableColumns: "tableColumns" }, outputs: { onSortEvent: "onSortEvent", onRowClickEvent: "onRowClickEvent" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"], components: [{ type: i1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i2.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1.MatCellDef, selector: "[matCellDef]" }, { type: i1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{ selector: 'ui-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{width:100%}table .mat-header-cell{font-weight:700}\n"] }]
|
|
77
|
+
}], propDecorators: { sort: [{
|
|
78
|
+
type: ViewChild,
|
|
79
|
+
args: [MatSort, { static: true }]
|
|
80
|
+
}], tableData: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], tableColumns: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}], onSortEvent: [{
|
|
85
|
+
type: Output
|
|
86
|
+
}], onRowClickEvent: [{
|
|
87
|
+
type: Output
|
|
88
|
+
}] } });
|
|
89
|
+
|
|
90
|
+
class TableComponentModule {
|
|
91
|
+
}
|
|
92
|
+
TableComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
93
|
+
TableComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, declarations: [TableComponent], imports: [CommonModule, MatTableModule, MatSortModule], exports: [TableComponent] });
|
|
94
|
+
TableComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, imports: [[CommonModule, MatTableModule, MatSortModule]] });
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TableComponentModule, decorators: [{
|
|
96
|
+
type: NgModule,
|
|
97
|
+
args: [{
|
|
98
|
+
declarations: [TableComponent],
|
|
99
|
+
imports: [CommonModule, MatTableModule, MatSortModule],
|
|
100
|
+
exports: [TableComponent],
|
|
101
|
+
}]
|
|
102
|
+
}] });
|
|
103
|
+
|
|
104
|
+
// PUBLIC API
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { TableComponent, TableComponentModule };
|
|
111
|
+
//# sourceMappingURL=testgorilla-tgo-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui.mjs","sources":["../../../src/components/table/table.component.ts","../../../src/components/table/table.component.html","../../../src/components/table/table.component.module.ts","../../../src/public-api.ts","../../../src/testgorilla-tgo-ui.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { MatSort, Sort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\nimport { IDataSource, ITableColumn } from './table.types';\n\n@Component({\n selector: 'ui-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TableComponent implements OnInit {\n // TODO: Some properties and methods are ignored on purpose because of a current issue with compodoc and angular 13\n // https://github.com/storybookjs/storybook/issues/16865\n // https://github.com/storybookjs/storybook/issues/17004\n\n /**\n * @ignore\n */\n dataSource = new MatTableDataSource<any>([]);\n\n /**\n * @ignore\n */\n displayedColumns: string[] = [];\n\n /**\n * @ignore\n */\n @ViewChild(MatSort, { static: true }) sort!: MatSort;\n\n /**\n * Data to be rendered\n *\n * @type {IDataSource}\n * @memberof TableComponent\n */\n @Input() set tableData(data: IDataSource[]) {\n this.setTableDataSource(data);\n }\n\n /**\n * Data structure to select which columns should be rendered and their capabilities\n *\n * @type {ITableColumn}\n * @memberof TableComponent\n */\n @Input() tableColumns: ITableColumn[] = [];\n\n /**\n * @ignore\n */\n @Output() onSortEvent: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /**\n * @ignore\n */\n @Output() onRowClickEvent: EventEmitter<any> = new EventEmitter<any>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.displayedColumns = this.tableColumns.map((tableColumn: ITableColumn) => tableColumn.name);\n }\n\n onSort(sortParams: Sort) {\n const column = this.tableColumns.find((column: ITableColumn) => column.name === sortParams.active);\n if (column?.dataKey) {\n sortParams.active = column?.dataKey;\n }\n this.onSortEvent.emit(sortParams);\n }\n\n onRowClick(rowParams: any) {\n this.onRowClickEvent.emit(rowParams);\n }\n\n /**\n * @ignore\n */\n private setTableDataSource(data: IDataSource[]) {\n this.dataSource = new MatTableDataSource<any>(data);\n this.dataSource.sort = this.sort;\n }\n}\n","<table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSort($event)\">\n <ng-container *ngFor=\"let tableColumn of tableColumns\" [matColumnDef]=\"tableColumn.name\">\n <ng-container *ngIf=\"tableColumn.isSortable; else notSortable\">\n <th mat-header-cell *matHeaderCellDef=\"let element\" [mat-sort-header]=\"tableColumn.dataKey\" arrowPosition=\"after\">\n {{tableColumn.name}}\n </th>\n </ng-container>\n <ng-template #notSortable>\n <th mat-header-cell *matHeaderCellDef>\n {{tableColumn.name}}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" (click)=\"onRowClick(element)\">\n {{element[tableColumn.dataKey]}}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { TableComponent } from './table.component';\n\n@NgModule({\n declarations: [TableComponent],\n imports: [CommonModule, MatTableModule, MatSortModule],\n exports: [TableComponent],\n})\nexport class TableComponentModule {}\n","// PUBLIC API\n\n// Table Component\nexport * from './components/table/table.component';\nexport * from './components/table/table.component.module';\nexport * from './components/table/table.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAWa,cAAc,CAAA;AAN3B,IAAA,WAAA,GAAA;;;;AAWE;;AAEG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,CAAM,EAAE,CAAC,CAAC;AAE7C;;AAEG;QACH,IAAgB,CAAA,gBAAA,GAAa,EAAE,CAAC;AAiBhC;;;;;AAKG;QACM,IAAY,CAAA,YAAA,GAAmB,EAAE,CAAC;AAE3C;;AAEG;AACO,QAAA,IAAA,CAAA,WAAW,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAErE;;AAEG;AACO,QAAA,IAAA,CAAA,eAAe,GAAsB,IAAI,YAAY,EAAO,CAAC;AA4BxE,KAAA;AAtDC;;;;;AAKG;IACH,IAAa,SAAS,CAAC,IAAmB,EAAA;AACxC,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC/B;AAoBD;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAyB,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC;KAChG;AAED,IAAA,MAAM,CAAC,UAAgB,EAAA;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAoB,KAAK,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,CAAC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,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAHtB,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC,CAAA,EAAA,CAAA,CAAA;4FAG3C,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;AAC9B,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,aAAa,CAAC;oBACtD,OAAO,EAAE,CAAC,cAAc,CAAC;AAC1B,iBAAA,CAAA;;;ACVD;;ACAA;;AAEG;;;;"}
|
package/index.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@testgorilla/tgo-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"lint-staged": {
|
|
5
|
+
"src/**/*.ts": [
|
|
6
|
+
"eslint --fix",
|
|
7
|
+
"prettier --write",
|
|
8
|
+
"git add"
|
|
9
|
+
],
|
|
10
|
+
"src/**/*.scss": [
|
|
11
|
+
"stylelint"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"private": false,
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"tslib": "^2.4.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/animations": "^13.3.4",
|
|
20
|
+
"@angular/cdk": "^13.3.6",
|
|
21
|
+
"@angular/common": "^13.3.4",
|
|
22
|
+
"@angular/compiler": "^13.3.4",
|
|
23
|
+
"@angular/core": "^13.3.4",
|
|
24
|
+
"@angular/forms": "^13.3.4",
|
|
25
|
+
"@angular/material": "^13.3.6",
|
|
26
|
+
"@angular/platform-browser": "^13.3.4",
|
|
27
|
+
"@angular/platform-browser-dynamic": "^13.3.4",
|
|
28
|
+
"@angular/router": "^13.3.4",
|
|
29
|
+
"rxjs": "^7.5.5",
|
|
30
|
+
"zone.js": "^0.11.5"
|
|
31
|
+
},
|
|
32
|
+
"module": "fesm2015/testgorilla-tgo-ui.mjs",
|
|
33
|
+
"es2020": "fesm2020/testgorilla-tgo-ui.mjs",
|
|
34
|
+
"esm2020": "esm2020/testgorilla-tgo-ui.mjs",
|
|
35
|
+
"fesm2020": "fesm2020/testgorilla-tgo-ui.mjs",
|
|
36
|
+
"fesm2015": "fesm2015/testgorilla-tgo-ui.mjs",
|
|
37
|
+
"typings": "index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
"./package.json": {
|
|
40
|
+
"default": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./index.d.ts",
|
|
44
|
+
"esm2020": "./esm2020/testgorilla-tgo-ui.mjs",
|
|
45
|
+
"es2020": "./fesm2020/testgorilla-tgo-ui.mjs",
|
|
46
|
+
"es2015": "./fesm2015/testgorilla-tgo-ui.mjs",
|
|
47
|
+
"node": "./fesm2015/testgorilla-tgo-ui.mjs",
|
|
48
|
+
"default": "./fesm2020/testgorilla-tgo-ui.mjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": false
|
|
52
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@use "@angular/material" as mat;
|
|
2
|
+
|
|
3
|
+
@include mat.core();
|
|
4
|
+
|
|
5
|
+
$tgo-primary-palette: (
|
|
6
|
+
50: #e2f2f0,
|
|
7
|
+
100: #b7e0d9,
|
|
8
|
+
200: #8acdc1,
|
|
9
|
+
300: #60b9a9,
|
|
10
|
+
400: #46a997,
|
|
11
|
+
500: #389986,
|
|
12
|
+
600: #338c79,
|
|
13
|
+
700: #2e7c6a,
|
|
14
|
+
800: #296c5b,
|
|
15
|
+
900: #1f5041,
|
|
16
|
+
contrast: (
|
|
17
|
+
50: rgba(black, 0.87),
|
|
18
|
+
100: rgba(black, 0.87),
|
|
19
|
+
200: rgba(black, 0.87),
|
|
20
|
+
300: white,
|
|
21
|
+
400: white,
|
|
22
|
+
500: white,
|
|
23
|
+
600: white,
|
|
24
|
+
700: white,
|
|
25
|
+
800: white,
|
|
26
|
+
900: white,
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
$tgo-accent-palette: (
|
|
31
|
+
50: #d6f1fe,
|
|
32
|
+
100: #b4d8e3,
|
|
33
|
+
200: #91bbc9,
|
|
34
|
+
300: #6d9faf,
|
|
35
|
+
400: #51899c,
|
|
36
|
+
500: #337589,
|
|
37
|
+
600: #276678,
|
|
38
|
+
700: #185363,
|
|
39
|
+
800: #09404e,
|
|
40
|
+
900: #002b38,
|
|
41
|
+
contrast: (
|
|
42
|
+
50: rgba(black, 0.87),
|
|
43
|
+
100: rgba(black, 0.87),
|
|
44
|
+
200: rgba(black, 0.87),
|
|
45
|
+
300: rgba(black, 0.87),
|
|
46
|
+
400: rgba(black, 0.87),
|
|
47
|
+
500: white,
|
|
48
|
+
600: white,
|
|
49
|
+
700: white,
|
|
50
|
+
800: white,
|
|
51
|
+
900: white,
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
$tgo-warn-palette: (
|
|
56
|
+
50: #f9efef,
|
|
57
|
+
100: #efd7d7,
|
|
58
|
+
200: #e5bdbd,
|
|
59
|
+
300: #dba3a2,
|
|
60
|
+
400: #d38f8e,
|
|
61
|
+
500: #cb7b7a,
|
|
62
|
+
600: #c67372,
|
|
63
|
+
700: #be6867,
|
|
64
|
+
800: #b85e5d,
|
|
65
|
+
900: #ac4b4a,
|
|
66
|
+
A100: #ffffff,
|
|
67
|
+
A200: #ffd4d4,
|
|
68
|
+
A400: #ffa2a1,
|
|
69
|
+
A700: #ff8887,
|
|
70
|
+
contrast: (
|
|
71
|
+
50: #000000,
|
|
72
|
+
100: #000000,
|
|
73
|
+
200: #000000,
|
|
74
|
+
300: #000000,
|
|
75
|
+
400: #000000,
|
|
76
|
+
500: #000000,
|
|
77
|
+
600: #000000,
|
|
78
|
+
700: #000000,
|
|
79
|
+
800: #ffffff,
|
|
80
|
+
900: #ffffff,
|
|
81
|
+
A100: #000000,
|
|
82
|
+
A200: #000000,
|
|
83
|
+
A400: #000000,
|
|
84
|
+
A700: #000000,
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
$tgo-primary: mat.define-palette($tgo-primary-palette, 400);
|
|
89
|
+
$tgo-accent: mat.define-palette($tgo-accent-palette, 600);
|
|
90
|
+
$tgo-warn: mat.define-palette($tgo-warn-palette, 500);
|
|
91
|
+
$tgo-light: mat.define-palette($tgo-primary-palette, 50);
|
|
92
|
+
$tgo-typography: mat.define-typography-config(
|
|
93
|
+
$font-family: "'Open Sans', sans-serif",
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
$my-theme: mat.define-light-theme(
|
|
97
|
+
(
|
|
98
|
+
color: (
|
|
99
|
+
primary: $tgo-primary,
|
|
100
|
+
accent: $tgo-accent,
|
|
101
|
+
light: $tgo-light,
|
|
102
|
+
warn: $tgo-warn,
|
|
103
|
+
),
|
|
104
|
+
typography: $tgo-typography,
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
@include mat.all-component-themes($my-theme);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@use 'palette.scss';
|
|
2
|
+
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap");
|
|
3
|
+
|
|
4
|
+
body {
|
|
5
|
+
margin: 0;
|
|
6
|
+
background: #f6f6f6;
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
color: #888888;
|
|
9
|
+
|
|
10
|
+
h1,
|
|
11
|
+
h2,
|
|
12
|
+
h3,
|
|
13
|
+
h4,
|
|
14
|
+
h5,
|
|
15
|
+
h6,
|
|
16
|
+
button {
|
|
17
|
+
margin-top: 16px;
|
|
18
|
+
margin-bottom: 16px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
p {
|
|
22
|
+
line-height: 24px;
|
|
23
|
+
margin-top: 16px;
|
|
24
|
+
margin-bottom: 16px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.mat-form-field-label {
|
|
28
|
+
font-size: 16px !important;
|
|
29
|
+
color: #888888;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.hidden {
|
|
34
|
+
visibility: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//TODO: MOVE TO THE CORRESPONDING COMPONENTS
|
|
38
|
+
//custom scss for the angular material components
|
|
39
|
+
.mat-card {
|
|
40
|
+
border-radius: 8px !important;
|
|
41
|
+
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1) !important;
|
|
42
|
+
padding: 32px 32px 16px 32px !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.mat-flat-button {
|
|
46
|
+
line-height: 0 !important;
|
|
47
|
+
height: 48px;
|
|
48
|
+
padding: 16px 32px !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.mat-form-field-appearance-outline .mat-form-field-infix {
|
|
52
|
+
padding: 16px 0 16px 0;
|
|
53
|
+
margin-left: 8px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mat-form-field {
|
|
57
|
+
margin-top: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.mat-form-field-subscript-wrapper {
|
|
61
|
+
mat-error {
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
display: flex;
|
|
64
|
+
place-content: center flex-start;
|
|
65
|
+
align-items: center;
|
|
66
|
+
|
|
67
|
+
mat-icon {
|
|
68
|
+
margin-right: 8px;
|
|
69
|
+
font-size: 16px !important;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.mat-flat-button.mat-button-disabled.mat-button-disabled {
|
|
75
|
+
background-color: #b5ddd5 !important;
|
|
76
|
+
color: white !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
tgo-button > .mat-progress-spinner circle,
|
|
80
|
+
.mat-spinner circle {
|
|
81
|
+
stroke: white;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
Design spec says the input text size is 16px
|
|
86
|
+
*/
|
|
87
|
+
input {
|
|
88
|
+
font-size: 16px !important;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
input::placeholder {
|
|
92
|
+
font-size: 16px !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|