@testgorilla/tgo-ui 2.6.99 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/components/button/button.model.d.ts +2 -1
- package/components/deprecated-table/deprecated-table.component.module.d.ts +8 -8
- package/components/deprecated-table/directives/dynamic-component.directive.d.ts +1 -1
- package/components/deprecated-table/pipes/data-property-getter.d.ts +1 -1
- package/components/empty-state/empty-state.component.d.ts +1 -1
- package/components/field/field.component.d.ts +8 -1
- package/components/icon/icon.model.d.ts +1 -1
- package/components/overflow-menu/overflow-menu.component.d.ts +1 -1
- package/components/table/table.component.d.ts +35 -8
- package/components/table/table.component.module.d.ts +3 -1
- package/components/table/table.model.d.ts +47 -5
- package/esm2022/assets/i18n/en.json +2 -1
- package/esm2022/components/button/button.component.mjs +3 -3
- package/esm2022/components/button/button.model.mjs +1 -1
- package/esm2022/components/deprecated-table/deprecated-table.component.module.mjs +23 -6
- package/esm2022/components/deprecated-table/directives/dynamic-component.directive.mjs +3 -2
- package/esm2022/components/deprecated-table/pipes/data-property-getter.mjs +3 -2
- package/esm2022/components/dropdown/dropdown.component.mjs +3 -3
- package/esm2022/components/field/field.component.mjs +12 -3
- package/esm2022/components/icon/icon.component.mjs +2 -2
- package/esm2022/components/icon/icon.model.mjs +1 -1
- package/esm2022/components/navbar/navbar.component.mjs +3 -3
- package/esm2022/components/overflow-menu/overflow-menu.component.mjs +3 -3
- package/esm2022/components/password-criteria/password.component.mjs +1 -1
- package/esm2022/components/segmented-button/segmented-button.component.mjs +2 -2
- package/esm2022/components/table/table.component.mjs +71 -5
- package/esm2022/components/table/table.component.module.mjs +8 -2
- package/esm2022/components/table/table.model.mjs +13 -2
- package/esm2022/components/toggle/toggle.component.mjs +2 -2
- package/esm2022/components/validation-error/validation-error.component.mjs +3 -3
- package/esm2022/models/colors.model.mjs +77 -0
- package/esm2022/pipes/has-validation-error.pipe.mjs +2 -2
- package/esm2022/public-api.mjs +3 -1
- package/esm2022/utils/table.utils.mjs +1 -1
- package/fesm2022/testgorilla-tgo-ui.mjs +215 -32
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/models/colors.model.d.ts +62 -0
- package/package.json +16 -15
- package/projects/tgo-canopy-ui/assets/i18n/en.json +2 -1
- package/projects/tgo-canopy-ui/theme/_typography.scss +6 -0
- package/public-api.d.ts +1 -0
- package/utils/table.utils.d.ts +1 -1
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
To see the updates of the library in the client app, use commands below from package.json
|
|
6
6
|
|
|
7
|
-
- build the updated version of canopy-ui with
|
|
8
|
-
- restart the client app with
|
|
7
|
+
- build the updated version of canopy-ui with `build:tgo-ui (ng build tgo-ui)`
|
|
8
|
+
- restart the client app with `start:client (ng serve)`
|
|
9
9
|
|
|
10
10
|
# Foundations
|
|
11
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeVariant } from '../badge/badge.model';
|
|
1
|
+
import { BadgeVariant, RebrandBadgeColor } from '../badge/badge.model';
|
|
2
2
|
export type ButtonIconPosition = 'left' | 'right';
|
|
3
3
|
export type ButtonColor = 'primary' | 'secondary' | 'ghost' | 'outlined' | 'destructive' | 'tertiary' | 'link' | 'tab' | 'text' | 'menuTrigger' | 'menuCell' | 'icon-button';
|
|
4
4
|
export type ButtonSize = 'big' | 'medium' | 'small';
|
|
@@ -10,4 +10,5 @@ export interface ButtonBadgeConfig {
|
|
|
10
10
|
badgeType: BadgeVariant | null;
|
|
11
11
|
badgeLabel: string;
|
|
12
12
|
badgeNotificationAmount: number;
|
|
13
|
+
rebrandColor: RebrandBadgeColor;
|
|
13
14
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./deprecated-table.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@angular/
|
|
6
|
-
import * as i5 from "@angular/material/
|
|
7
|
-
import * as i6 from "@angular/material/
|
|
8
|
-
import * as i7 from "
|
|
9
|
-
import * as i8 from "
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/table";
|
|
5
|
+
import * as i4 from "@angular/material/sort";
|
|
6
|
+
import * as i5 from "@angular/material/icon";
|
|
7
|
+
import * as i6 from "@angular/material/tooltip";
|
|
8
|
+
import * as i7 from "./directives/dynamic-component.directive";
|
|
9
|
+
import * as i8 from "./pipes/data-property-getter";
|
|
10
10
|
export declare class DeprecatedTableComponentModule {
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<DeprecatedTableComponentModule, never>;
|
|
12
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DeprecatedTableComponentModule, [typeof i1.DeprecatedTableComponent, typeof i2.
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DeprecatedTableComponentModule, [typeof i1.DeprecatedTableComponent], [typeof i2.CommonModule, typeof i3.MatTableModule, typeof i4.MatSortModule, typeof i5.MatIconModule, typeof i6.MatTooltipModule, typeof i7.DynamicComponentDirective, typeof i8.DataPropertyGetterPipe], [typeof i1.DeprecatedTableComponent]>;
|
|
13
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<DeprecatedTableComponentModule>;
|
|
14
14
|
}
|
|
@@ -9,5 +9,5 @@ export declare class DynamicComponentDirective implements OnDestroy {
|
|
|
9
9
|
constructor(vcr: ViewContainerRef);
|
|
10
10
|
ngOnDestroy(): void;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicComponentDirective, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicComponentDirective, "[dynamicComponent]", never, { "dynamicComponent": { "alias": "dynamicComponent"; "required": false; }; }, {}, never, never,
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicComponentDirective, "[dynamicComponent]", never, { "dynamicComponent": { "alias": "dynamicComponent"; "required": false; }; }, {}, never, never, true, never>;
|
|
13
13
|
}
|
|
@@ -4,5 +4,5 @@ export declare class DataPropertyGetterPipe implements PipeTransform {
|
|
|
4
4
|
transform(obj: object, keyName?: string): any;
|
|
5
5
|
private getDeepVal;
|
|
6
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataPropertyGetterPipe, never>;
|
|
7
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<DataPropertyGetterPipe, "dataPropertyGetter",
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DataPropertyGetterPipe, "dataPropertyGetter", true>;
|
|
8
8
|
}
|
|
@@ -118,7 +118,7 @@ export declare class EmptyStateComponent {
|
|
|
118
118
|
onPrimaryButtonClick(event: Event): void;
|
|
119
119
|
onSecondaryButtonClick(event: Event): void;
|
|
120
120
|
onTertiaryButtonClick(event: Event): void;
|
|
121
|
-
getVariant(variant: ButtonVariant): "
|
|
121
|
+
getVariant(variant: ButtonVariant): "ghost" | "primary" | "secondary";
|
|
122
122
|
static ɵfac: i0.ɵɵFactoryDeclaration<EmptyStateComponent, [{ optional: true; }]>;
|
|
123
123
|
static ɵcmp: i0.ɵɵComponentDeclaration<EmptyStateComponent, "ui-empty-state", never, { "showIllustration": { "alias": "showIllustration"; "required": false; }; "illustrationVariant": { "alias": "illustrationVariant"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "emptyStateVariant": { "alias": "emptyStateVariant"; "required": false; }; "title": { "alias": "title"; "required": false; }; "bodyText": { "alias": "bodyText"; "required": false; }; "primaryButtonText": { "alias": "primaryButtonText"; "required": false; }; "primaryButtonVariant": { "alias": "primaryButtonVariant"; "required": false; }; "secondaryButtonText": { "alias": "secondaryButtonText"; "required": false; }; "secondaryButtonVariant": { "alias": "secondaryButtonVariant"; "required": false; }; "tertiaryButtonText": { "alias": "tertiaryButtonText"; "required": false; }; "tertiaryButtonVariant": { "alias": "tertiaryButtonVariant"; "required": false; }; "language": { "alias": "language"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; }, { "primaryButtonClick": "primaryButtonClick"; "secondaryButtonClick": "secondaryButtonClick"; "tertiaryButtonClick": "tertiaryButtonClick"; }, never, never, false, never>;
|
|
124
124
|
}
|
|
@@ -169,6 +169,13 @@ export declare class FieldComponent implements OnInit, ControlValueAccessor, DoC
|
|
|
169
169
|
* @memberof FieldComponent
|
|
170
170
|
*/
|
|
171
171
|
trimOnSubmit: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Max rows for multi-line type
|
|
174
|
+
*
|
|
175
|
+
* @type {number}
|
|
176
|
+
* @memberof FieldComponent
|
|
177
|
+
*/
|
|
178
|
+
maxRows: number;
|
|
172
179
|
validateEvent: EventEmitter<string>;
|
|
173
180
|
get getPasswordIcon(): IconName;
|
|
174
181
|
isActiveField: boolean;
|
|
@@ -211,5 +218,5 @@ export declare class FieldComponent implements OnInit, ControlValueAccessor, DoC
|
|
|
211
218
|
private clearSpace;
|
|
212
219
|
trackByFn: (index: number, value: any) => any;
|
|
213
220
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldComponent, [{ optional: true; }, null, null, null, { optional: true; self: true; }]>;
|
|
214
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldComponent, "ui-field", never, { "label": { "alias": "label"; "required": false; }; "fieldName": { "alias": "fieldName"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "id": { "alias": "id"; "required": false; }; "value": { "alias": "value"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "hintMessage": { "alias": "hintMessage"; "required": false; }; "type": { "alias": "type"; "required": false; }; "updateOnBlur": { "alias": "updateOnBlur"; "required": false; }; "allowOnlyDigits": { "alias": "allowOnlyDigits"; "required": false; }; "language": { "alias": "language"; "required": false; }; "showBottomContent": { "alias": "showBottomContent"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "isValid": { "alias": "isValid"; "required": false; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; }; "trimOnBlur": { "alias": "trimOnBlur"; "required": false; }; "trimOnSubmit": { "alias": "trimOnSubmit"; "required": false; }; }, { "validateEvent": "validateEvent"; }, never, never, false, never>;
|
|
221
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldComponent, "ui-field", never, { "label": { "alias": "label"; "required": false; }; "fieldName": { "alias": "fieldName"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "id": { "alias": "id"; "required": false; }; "value": { "alias": "value"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "hintMessage": { "alias": "hintMessage"; "required": false; }; "type": { "alias": "type"; "required": false; }; "updateOnBlur": { "alias": "updateOnBlur"; "required": false; }; "allowOnlyDigits": { "alias": "allowOnlyDigits"; "required": false; }; "language": { "alias": "language"; "required": false; }; "showBottomContent": { "alias": "showBottomContent"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "isValid": { "alias": "isValid"; "required": false; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; }; "trimOnBlur": { "alias": "trimOnBlur"; "required": false; }; "trimOnSubmit": { "alias": "trimOnSubmit"; "required": false; }; "maxRows": { "alias": "maxRows"; "required": false; }; }, { "validateEvent": "validateEvent"; }, never, never, false, never>;
|
|
215
222
|
}
|
|
@@ -3,5 +3,5 @@ type TgoIcons = typeof tgoIcons[number];
|
|
|
3
3
|
type TgoRebrandIcons = typeof tgoRebrandIcons[number];
|
|
4
4
|
export type IconSize = '16' | '24' | '40' | '80';
|
|
5
5
|
export type IconName = TgoRebrandIcons | TgoIcons | '';
|
|
6
|
-
export type IconColor = 'teal' | 'petrol' | 'dark' | 'white' | 'black' | 'inherit' | 'rebrand-black' | string;
|
|
6
|
+
export type IconColor = 'teal' | 'petrol' | 'dark' | 'white' | 'black' | 'inherit' | 'rebrand-black' | 'red' | 'grey' | 'orange' | string;
|
|
7
7
|
export {};
|
|
@@ -51,5 +51,5 @@ export declare class OverflowMenuComponent implements OnInit {
|
|
|
51
51
|
ngOnInit(): void;
|
|
52
52
|
onSelectItem(event: Event, value: string): void;
|
|
53
53
|
static ɵfac: i0.ɵɵFactoryDeclaration<OverflowMenuComponent, [{ optional: true; }]>;
|
|
54
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OverflowMenuComponent, "ui-overflow-menu", never, { "buttons": { "alias": "buttons"; "required": false; }; "iconTrigger": { "alias": "iconTrigger"; "required": false; }; "menuLabel": { "alias": "menuLabel"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; }; }, { "selectItem": "selectItem"; }, never,
|
|
54
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OverflowMenuComponent, "ui-overflow-menu", never, { "buttons": { "alias": "buttons"; "required": false; }; "iconTrigger": { "alias": "iconTrigger"; "required": false; }; "menuLabel": { "alias": "menuLabel"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; }; }, { "selectItem": "selectItem"; }, never, ["[menu-content]"], false, never>;
|
|
55
55
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { ColumnEllipse,
|
|
2
|
+
import { ColumnEllipse, ColumnType, DataSource, TableColumn, TableConfig, TableConfigWithPagination, TableData, TableDetailColumn } from './table.model';
|
|
3
3
|
import { PageEvent } from '@angular/material/paginator';
|
|
4
4
|
import { ApplicationTheme } from '../../models/application-theme.model';
|
|
5
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
6
|
+
import { Sort } from '@angular/material/sort';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class TableComponent implements OnChanges {
|
|
8
|
+
export declare class TableComponent<T extends DataSource, TDetail extends DataSource> implements OnChanges {
|
|
7
9
|
private readonly defaultAppTheme;
|
|
8
10
|
/**
|
|
9
11
|
* Table configuration
|
|
@@ -11,7 +13,7 @@ export declare class TableComponent implements OnChanges {
|
|
|
11
13
|
* @type {TableConfig}
|
|
12
14
|
* @memberof TableComponent
|
|
13
15
|
*/
|
|
14
|
-
set config(config: TableConfig);
|
|
16
|
+
set config(config: TableConfig<T>);
|
|
15
17
|
/**
|
|
16
18
|
* Input property for providing the table data.
|
|
17
19
|
*
|
|
@@ -34,26 +36,51 @@ export declare class TableComponent implements OnChanges {
|
|
|
34
36
|
* @memberof TableComponent
|
|
35
37
|
*/
|
|
36
38
|
applicationTheme: ApplicationTheme;
|
|
39
|
+
/**
|
|
40
|
+
* Data structure to select which columns should be rendered and their capabilities
|
|
41
|
+
*
|
|
42
|
+
* @type {TableDetailColumn}
|
|
43
|
+
* @memberof TableComponent
|
|
44
|
+
*/
|
|
45
|
+
tableDetailColumns: TableDetailColumn<T, TDetail>;
|
|
46
|
+
tableDetails: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Disable border radius for table
|
|
49
|
+
*
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
* @memberof TableComponent
|
|
52
|
+
*/
|
|
53
|
+
disableBorderRadius: boolean;
|
|
54
|
+
onRowClickEvent: EventEmitter<any>;
|
|
55
|
+
onDetailRowClickEvent: EventEmitter<any>;
|
|
37
56
|
paginatorChange: EventEmitter<PageEvent>;
|
|
38
57
|
sortChange: EventEmitter<Sort>;
|
|
39
58
|
protected tableData: TableData;
|
|
40
59
|
protected sourceData: TableData;
|
|
41
60
|
protected columnsTooltipState: ColumnEllipse[];
|
|
42
|
-
protected tableConfig: TableConfigWithPagination
|
|
61
|
+
protected tableConfig: TableConfigWithPagination<T>;
|
|
43
62
|
protected displayedColumns: string[];
|
|
63
|
+
protected columnsDetailToDisplay: string[];
|
|
44
64
|
protected skeletonStyleConfig: {
|
|
45
65
|
background: string;
|
|
46
66
|
'border-radius': string;
|
|
47
67
|
height: string;
|
|
48
68
|
};
|
|
69
|
+
protected dataSourceDetail: MatTableDataSource<any, import("@angular/material/table").MatTableDataSourcePaginator>;
|
|
70
|
+
protected elementDetail: any;
|
|
71
|
+
protected readonly DataType: typeof ColumnType;
|
|
49
72
|
constructor(defaultAppTheme: ApplicationTheme);
|
|
50
73
|
ngOnInit(): void;
|
|
51
74
|
ngOnChanges(changes: SimpleChanges): void;
|
|
52
|
-
private defaultPaginationConfig;
|
|
53
75
|
protected onPaginatorChange(event: PageEvent): void;
|
|
54
76
|
protected onChangeColumnSize(columnIndex: number, showTooltip: boolean): void;
|
|
55
77
|
protected onSortChange(sortState: Sort): void;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
protected onRowClick(rowParams: any): void;
|
|
79
|
+
protected onDetailRowClick(rowParams: any): void;
|
|
80
|
+
protected toggleRow(element: T): void;
|
|
81
|
+
private setTableDetailDataSource;
|
|
82
|
+
private defaultPaginationConfig;
|
|
83
|
+
trackColumnKey: (index: number, column: TableColumn<T>) => string;
|
|
84
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any, any>, [{ optional: true; }]>;
|
|
85
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any, any>, "ui-table", never, { "config": { "alias": "config"; "required": true; }; "data": { "alias": "data"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "tableDetailColumns": { "alias": "tableDetailColumns"; "required": false; }; "tableDetails": { "alias": "tableDetails"; "required": false; }; "disableBorderRadius": { "alias": "disableBorderRadius"; "required": false; }; }, { "onRowClickEvent": "onRowClickEvent"; "onDetailRowClickEvent": "onDetailRowClickEvent"; "paginatorChange": "paginatorChange"; "sortChange": "sortChange"; }, never, never, false, never>;
|
|
59
86
|
}
|
|
@@ -10,8 +10,10 @@ import * as i8 from "../button/button.component.module";
|
|
|
10
10
|
import * as i9 from "@angular/material/sort";
|
|
11
11
|
import * as i10 from "../icon/icon.component.module";
|
|
12
12
|
import * as i11 from "../../directives/ellipse-text.directive";
|
|
13
|
+
import * as i12 from "../deprecated-table/directives/dynamic-component.directive";
|
|
14
|
+
import * as i13 from "../deprecated-table/pipes/data-property-getter";
|
|
13
15
|
export declare class TableComponentModule {
|
|
14
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponentModule, never>;
|
|
15
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent, typeof i2.SentenceCasePipe], [typeof i3.CommonModule, typeof i4.MatTableModule, typeof i5.MatTooltipModule, typeof i6.SkeletonComponent, typeof i7.PaginatorComponentModule, typeof i8.ButtonComponentModule, typeof i9.MatSortModule, typeof i10.IconComponentModule, typeof i11.EllipseTextDirective], [typeof i1.TableComponent]>;
|
|
17
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableComponentModule, [typeof i1.TableComponent, typeof i2.SentenceCasePipe], [typeof i3.CommonModule, typeof i4.MatTableModule, typeof i5.MatTooltipModule, typeof i6.SkeletonComponent, typeof i7.PaginatorComponentModule, typeof i8.ButtonComponentModule, typeof i9.MatSortModule, typeof i10.IconComponentModule, typeof i11.EllipseTextDirective, typeof i12.DynamicComponentDirective, typeof i13.DataPropertyGetterPipe], [typeof i1.TableComponent]>;
|
|
16
18
|
static ɵinj: i0.ɵɵInjectorDeclaration<TableComponentModule>;
|
|
17
19
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
export interface TableConfig {
|
|
3
|
-
columns: TableColumn[];
|
|
1
|
+
import { TemplateRef, Type } from '@angular/core';
|
|
2
|
+
export interface TableConfig<T> {
|
|
3
|
+
columns: TableColumn<T>[];
|
|
4
4
|
pagination?: Pagination;
|
|
5
5
|
title?: string;
|
|
6
6
|
width?: number;
|
|
7
7
|
sort?: Sort;
|
|
8
|
+
hidePagination?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export interface TableConfigWithPagination extends TableConfig {
|
|
10
|
+
export interface TableConfigWithPagination<T> extends TableConfig<T> {
|
|
10
11
|
pagination: Pagination;
|
|
11
12
|
}
|
|
12
|
-
export interface TableColumn {
|
|
13
|
+
export interface TableColumn<T> {
|
|
13
14
|
title: string;
|
|
14
15
|
key: string;
|
|
15
16
|
widthPerc?: number;
|
|
@@ -17,6 +18,7 @@ export interface TableColumn {
|
|
|
17
18
|
allowMultiline?: boolean;
|
|
18
19
|
bold?: boolean;
|
|
19
20
|
showTooltip?: boolean;
|
|
21
|
+
tooltip?: string;
|
|
20
22
|
allowSort?: boolean;
|
|
21
23
|
isSticky?: boolean;
|
|
22
24
|
headerCellTemplate?: TemplateRef<any>;
|
|
@@ -25,6 +27,11 @@ export interface TableColumn {
|
|
|
25
27
|
hidden?: boolean;
|
|
26
28
|
order?: number;
|
|
27
29
|
fontSize?: '12px' | '14px';
|
|
30
|
+
field?: string;
|
|
31
|
+
type?: ColumnType;
|
|
32
|
+
function?: (v: T) => string;
|
|
33
|
+
renderer?: (v: T) => ComponentRenderer | string;
|
|
34
|
+
styles?: ColumnStyles;
|
|
28
35
|
}
|
|
29
36
|
export interface Pagination {
|
|
30
37
|
itemsPerPageOptions: number[];
|
|
@@ -40,5 +47,40 @@ export interface ColumnEllipse {
|
|
|
40
47
|
export interface Sort {
|
|
41
48
|
active: string;
|
|
42
49
|
direction: SortDirection;
|
|
50
|
+
defaultSortStart: SortDirection;
|
|
43
51
|
}
|
|
44
52
|
export type SortDirection = 'asc' | 'desc' | '';
|
|
53
|
+
export interface TableDetailColumn<T, TDetail> {
|
|
54
|
+
columnDefs: TableColumn<TDetail>[];
|
|
55
|
+
setDetailRowData: (params: DetailRowDataParams<T, TDetail>) => void;
|
|
56
|
+
}
|
|
57
|
+
export interface DetailRowDataParams<T, TDetail> {
|
|
58
|
+
data: T;
|
|
59
|
+
setDetailDataSource(rowData: TDetail[]): void;
|
|
60
|
+
}
|
|
61
|
+
export declare enum ColumnType {
|
|
62
|
+
FIELD = "field",
|
|
63
|
+
FUNCTION = "function",
|
|
64
|
+
RENDERER = "renderer"
|
|
65
|
+
}
|
|
66
|
+
export interface ComponentRenderer {
|
|
67
|
+
component: Type<any>;
|
|
68
|
+
inputs?: any;
|
|
69
|
+
outputs?: {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface ColumnStyles {
|
|
74
|
+
alignment?: ColumnAlignment;
|
|
75
|
+
width?: string;
|
|
76
|
+
'min-width'?: string;
|
|
77
|
+
padding?: string;
|
|
78
|
+
}
|
|
79
|
+
export declare enum ColumnAlignment {
|
|
80
|
+
LEFT = "left",
|
|
81
|
+
RIGHT = "right",
|
|
82
|
+
CENTER = "center"
|
|
83
|
+
}
|
|
84
|
+
export type DataSource = {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
};
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"MAX_LENGTH": "Please enter a value with a maximum length of ({{maxlength}}) characters",
|
|
93
93
|
"MIN_LENGTH": "Please enter a value with a minimum length of ({{maxlength}}) characters",
|
|
94
94
|
"MAX": "Please enter a value with a maximum value of ({{max}})",
|
|
95
|
-
"MIN": "Please enter a value with a minimum value of ({{min}})"
|
|
95
|
+
"MIN": "Please enter a value with a minimum value of ({{min}})",
|
|
96
|
+
"EMAIL_INCORRECT": "Please use a valid email address"
|
|
96
97
|
}
|
|
97
98
|
}
|