@angular-generic-table/core 5.0.0-rc.16 → 5.0.0-rc.18
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/esm2020/lib/core.component.mjs +334 -39
- package/esm2020/lib/core.module.mjs +5 -1
- package/esm2020/lib/models/gt-pagination.mjs +1 -1
- package/esm2020/lib/models/table-config.interface.mjs +1 -1
- package/esm2020/lib/models/table-events.interface.mjs +1 -1
- package/esm2020/lib/models/table-info.interface.mjs +1 -1
- package/esm2020/lib/pagination/pagination.component.mjs +86 -27
- package/esm2020/lib/pipes/row-selection.pipe.mjs +17 -0
- package/esm2020/lib/utilities/utilities.mjs +36 -1
- package/esm2020/public-api.mjs +8 -1
- package/fesm2015/angular-generic-table-core.mjs +476 -67
- package/fesm2015/angular-generic-table-core.mjs.map +1 -1
- package/fesm2020/angular-generic-table-core.mjs +469 -63
- package/fesm2020/angular-generic-table-core.mjs.map +1 -1
- package/lib/core.component.d.ts +94 -18
- package/lib/core.module.d.ts +5 -4
- package/lib/models/gt-pagination.d.ts +8 -0
- package/lib/models/table-config.interface.d.ts +5 -1
- package/lib/models/table-events.interface.d.ts +11 -2
- package/lib/models/table-info.interface.d.ts +3 -1
- package/lib/pagination/pagination.component.d.ts +49 -11
- package/lib/pipes/row-selection.pipe.d.ts +8 -0
- package/lib/utilities/utilities.d.ts +21 -1
- package/package.json +1 -1
- package/public-api.d.ts +7 -0
- package/scss/index.scss +6 -3
package/lib/core.component.d.ts
CHANGED
|
@@ -1,37 +1,100 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
1
|
+
import { EventEmitter, OnDestroy, TrackByFunction } from '@angular/core';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
3
|
import { TableConfig } from './models/table-config.interface';
|
|
4
4
|
import { KeyValue } from '@angular/common';
|
|
5
5
|
import { TableColumn } from './models/table-column.interface';
|
|
6
6
|
import { TableRow } from './models/table-row.interface';
|
|
7
7
|
import { GtSortOrder } from './models/table-sort.interface';
|
|
8
8
|
import { TableMeta } from './models/table-meta.interface';
|
|
9
|
-
import { GtRowClickEvent,
|
|
9
|
+
import { GtPageChangeEvent, GtRowSelectEvent, GtRowClickEvent, GtRowActiveEvent, GtSortEvent } from './models/table-events.interface';
|
|
10
|
+
import { GtPaginationInfo } from './models/gt-pagination';
|
|
11
|
+
import { TableInfo } from './models/table-info.interface';
|
|
10
12
|
import * as i0 from "@angular/core";
|
|
11
|
-
export declare class CoreComponent {
|
|
13
|
+
export declare class CoreComponent implements OnDestroy {
|
|
14
|
+
unsubscribe$: Subject<unknown>;
|
|
15
|
+
get navigationKeys(): typeof this._navigationKeys;
|
|
16
|
+
/** navigationKeys
|
|
17
|
+
* @description An array of keyboard keys that will trigger navigation and active row, currently only supports arrow keys, home and end (omit key name from array to disable it)
|
|
18
|
+
* @type {string[]}
|
|
19
|
+
* @default ['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'Home', 'End']
|
|
20
|
+
*/
|
|
21
|
+
set navigationKeys(value: typeof this._navigationKeys);
|
|
22
|
+
private _navigationKeys;
|
|
23
|
+
get selectKeys(): string[];
|
|
24
|
+
/** selectKeys
|
|
25
|
+
* @description An array of keyboard keys that will trigger row selection (omit key name from array to disable it)
|
|
26
|
+
* @type {string[]}
|
|
27
|
+
* @default ['Enter', ' ']
|
|
28
|
+
*/
|
|
29
|
+
set selectKeys(value: string[]);
|
|
30
|
+
private _selectKeys;
|
|
12
31
|
get sortOrder$(): Observable<GtSortOrder>;
|
|
13
32
|
set loading(isLoading: Observable<boolean> | boolean);
|
|
14
|
-
set
|
|
15
|
-
|
|
33
|
+
set paginationIndex(pageIndex: number);
|
|
34
|
+
get paginationIndex(): number;
|
|
35
|
+
set pagingInfo(value: GtPaginationInfo | null);
|
|
36
|
+
/** customClasses
|
|
37
|
+
* @description An object that contains custom classes for various elements in the table.
|
|
38
|
+
* @type {object} - { selectedRow: string, activeRow: string } - default classes are 'gt-selected' and 'gt-active'
|
|
39
|
+
*/
|
|
40
|
+
set customClasses(classes: Partial<typeof this._customClasses>);
|
|
41
|
+
get customClasses(): typeof this._customClasses;
|
|
42
|
+
private _customClasses;
|
|
43
|
+
/** isRowSelectedFn
|
|
44
|
+
* @description Function to determine if row is selected or not.
|
|
45
|
+
* @type {fn} A function that receives a row object and optional state for current selection that can be used to determine if row should be marked as selected or not. */
|
|
46
|
+
set isRowSelectedFn(fn: (row: TableRow | any, selection?: any) => boolean);
|
|
47
|
+
get isRowSelectedFn(): any;
|
|
48
|
+
private _isRowSelectedFn;
|
|
49
|
+
/** selection
|
|
50
|
+
* @description An object that contains the currently selected row(s) in the table. It's passed to the selection function to determine which rows should be selected.
|
|
51
|
+
* @type {any}
|
|
52
|
+
*/
|
|
53
|
+
selection: any;
|
|
54
|
+
/** rowIdKey
|
|
55
|
+
* @description row key to use as unique id for table row. If passed, table won't generate unique ids for each row but instead use key to retrieve unique id from row.
|
|
56
|
+
* @type {string}
|
|
57
|
+
*/
|
|
58
|
+
rowIdKey: string | undefined;
|
|
59
|
+
/** generateRowId
|
|
60
|
+
* @description Whether or not to generate a unique id for each row in the table. Defaults to `true`.
|
|
61
|
+
* @type {boolean}
|
|
62
|
+
*/
|
|
63
|
+
generateRowId: boolean;
|
|
64
|
+
/** trackRowByFn
|
|
65
|
+
* @description A function that returns a unique identifier for each row in the table to optimize rendering when data is added or removed.
|
|
66
|
+
* @type fn - TrackByFunction to retrieve unique id based on index and/or row. Defaults to using `row[this.rowIdKey]`.
|
|
67
|
+
*/
|
|
68
|
+
set trackRowByFn(fn: TrackByFunction<TableRow>);
|
|
69
|
+
get trackRowByFn(): TrackByFunction<TableRow>;
|
|
70
|
+
private _trackRowByFn;
|
|
71
|
+
set search(string: Observable<string | null> | string | null);
|
|
16
72
|
set config(config: Observable<TableConfig<any>> | TableConfig<any>);
|
|
17
|
-
|
|
18
|
-
set
|
|
73
|
+
private _tableConfig;
|
|
74
|
+
set data(data: Observable<Array<TableRow>> | Array<TableRow> | null);
|
|
75
|
+
set sortOrder(sortConfig: GtSortOrder<TableRow> | any);
|
|
19
76
|
rowClick: EventEmitter<GtRowClickEvent<TableRow>>;
|
|
77
|
+
rowSelect: EventEmitter<GtRowSelectEvent<TableRow>>;
|
|
20
78
|
sortOrderChange: EventEmitter<GtSortOrder<TableRow>>;
|
|
21
79
|
_rowClick(row: TableRow, index: number, event: MouseEvent): void;
|
|
22
|
-
|
|
23
|
-
|
|
80
|
+
_rowActive(row: TableRow, index: number, event: KeyboardEvent): void;
|
|
81
|
+
private _rowActive$;
|
|
82
|
+
rowActive: EventEmitter<GtRowActiveEvent<TableRow>>;
|
|
24
83
|
columnSort: EventEmitter<GtSortEvent<TableRow>>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
84
|
+
/** page change event - emitted when current page/index changes for pagination */
|
|
85
|
+
pageChange: EventEmitter<GtPageChangeEvent>;
|
|
86
|
+
rowActive$: Observable<GtRowActiveEvent<TableRow>>;
|
|
87
|
+
activeRowIndex: number | null;
|
|
88
|
+
activateRow(id: string, event?: MouseEvent | KeyboardEvent): void;
|
|
89
|
+
activateRow(index: number, event?: MouseEvent | KeyboardEvent): void;
|
|
90
|
+
activateRow(none: null, event?: MouseEvent | KeyboardEvent): void;
|
|
91
|
+
protected _activateRow(row: TableRow | null, index: number | null, event?: MouseEvent | KeyboardEvent): void;
|
|
30
92
|
get loading$(): Observable<boolean>;
|
|
31
93
|
private _loading$;
|
|
32
94
|
private _sortOrder$;
|
|
33
95
|
private _searchBy$;
|
|
34
96
|
searchBy$: Observable<string | null>;
|
|
97
|
+
private _pagingInfo$;
|
|
35
98
|
private _tableConfig$;
|
|
36
99
|
tableConfig$: Observable<TableConfig<any>>;
|
|
37
100
|
private _data$;
|
|
@@ -42,8 +105,15 @@ export declare class CoreComponent {
|
|
|
42
105
|
calculatedColumnsCount: number;
|
|
43
106
|
}>;
|
|
44
107
|
table$: Observable<TableMeta>;
|
|
45
|
-
|
|
46
|
-
|
|
108
|
+
/** tableInfo$ - returns observable for table info
|
|
109
|
+
* @return Observable<TableInfo> */
|
|
110
|
+
get tableInfo$(): Observable<TableInfo | undefined>;
|
|
111
|
+
/** tableInfo - returns the current table info
|
|
112
|
+
* @return TableInfo */
|
|
113
|
+
get tableInfo(): TableInfo | undefined;
|
|
114
|
+
private _tableInfo$;
|
|
115
|
+
private _currentPaginationIndex$;
|
|
116
|
+
currentPaginationIndex$: Observable<number>;
|
|
47
117
|
colspan$: Observable<number>;
|
|
48
118
|
footerColspan$: Observable<number>;
|
|
49
119
|
/** sortByKey - Sort by key in table row
|
|
@@ -53,6 +123,12 @@ export declare class CoreComponent {
|
|
|
53
123
|
sortByKey(key: keyof TableRow, $event?: MouseEvent): void;
|
|
54
124
|
columnOrder: (a: KeyValue<string, TableColumn>, b: KeyValue<string, TableColumn>) => number;
|
|
55
125
|
nestedValue(object: any, mapTo: string, missingValue?: string | number | null): unknown;
|
|
126
|
+
private _unsubscribeFromKeyboardEvents$;
|
|
127
|
+
private _keyboardArrowEvent$;
|
|
128
|
+
protected listenToKeyboardEvents(): void;
|
|
129
|
+
unsubscribeFromKeyboardEvents(tableRef: HTMLTableElement): void;
|
|
130
|
+
private _handleNavigationEvent;
|
|
131
|
+
ngOnDestroy(): void;
|
|
56
132
|
static ɵfac: i0.ɵɵFactoryDeclaration<CoreComponent, never>;
|
|
57
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CoreComponent, "angular-generic-table", never, { "loading": "loading"; "
|
|
133
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CoreComponent, "angular-generic-table", never, { "navigationKeys": "navigationKeys"; "selectKeys": "selectKeys"; "loading": "loading"; "paginationIndex": "paginationIndex"; "pagingInfo": "pagingInfo"; "customClasses": "customClasses"; "isRowSelectedFn": "isRowSelectedFn"; "selection": "selection"; "rowIdKey": "rowIdKey"; "generateRowId": "generateRowId"; "trackRowByFn": "trackRowByFn"; "search": "search"; "config": "config"; "data": "data"; "sortOrder": "sortOrder"; }, { "rowClick": "rowClick"; "rowSelect": "rowSelect"; "sortOrderChange": "sortOrderChange"; "rowActive": "rowActive"; "columnSort": "columnSort"; "pageChange": "pageChange"; }, never, [".table-loading", ".table-no-data"], true, never>;
|
|
58
134
|
}
|
package/lib/core.module.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ import * as i2 from "./core.component";
|
|
|
4
4
|
import * as i3 from "./pipes/sort-class.pipe";
|
|
5
5
|
import * as i4 from "./pipes/dash-case.pipe";
|
|
6
6
|
import * as i5 from "./pipes/highlight.pipe";
|
|
7
|
-
import * as i6 from "./pipes/
|
|
8
|
-
import * as i7 from "./pipes/
|
|
9
|
-
import * as i8 from "./
|
|
7
|
+
import * as i6 from "./pipes/row-selection.pipe";
|
|
8
|
+
import * as i7 from "./pipes/capital-case.pipe";
|
|
9
|
+
import * as i8 from "./pipes/dynamic.pipe";
|
|
10
|
+
import * as i9 from "./gt-delta/gt-delta.component";
|
|
10
11
|
export declare class GenericTableCoreModule {
|
|
11
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<GenericTableCoreModule, never>;
|
|
12
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<GenericTableCoreModule, never, [typeof i1.CommonModule, typeof i2.CoreComponent, typeof i3.SortClassPipe, typeof i4.DashCasePipe, typeof i5.HighlightPipe, typeof i6.
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<GenericTableCoreModule, never, [typeof i1.CommonModule, typeof i2.CoreComponent, typeof i3.SortClassPipe, typeof i4.DashCasePipe, typeof i5.HighlightPipe, typeof i6.RowSelectionPipe, typeof i7.CapitalCasePipe, typeof i7.CapitalCasePipe, typeof i8.DynamicPipe, typeof i9.GtDeltaComponent], [typeof i2.CoreComponent, typeof i9.GtDeltaComponent]>;
|
|
13
14
|
static ɵinj: i0.ɵɵInjectorDeclaration<GenericTableCoreModule>;
|
|
14
15
|
}
|
|
@@ -8,3 +8,11 @@ export interface GtPaginationAriaLabels {
|
|
|
8
8
|
nav: string;
|
|
9
9
|
button: string;
|
|
10
10
|
}
|
|
11
|
+
export interface GtPaginationInfo {
|
|
12
|
+
pageNext: number | null;
|
|
13
|
+
pageCurrent: number | null;
|
|
14
|
+
pagePrevious: number | null;
|
|
15
|
+
pageSize: number | null;
|
|
16
|
+
numberOfRecords: number | null;
|
|
17
|
+
pageTotal?: number | null;
|
|
18
|
+
}
|
|
@@ -22,7 +22,11 @@ export interface TableConfig<R = TableRow> {
|
|
|
22
22
|
length?: number;
|
|
23
23
|
};
|
|
24
24
|
rowClick?: boolean;
|
|
25
|
-
|
|
25
|
+
/** Toggle row active state on mouse enter/leave (hover) <p>**Default:** `false`</p>*/
|
|
26
|
+
activateRowOnHover?: boolean;
|
|
27
|
+
/** Toggle row active state on keyboard navigation <p>**Default:** `false`</p>*/
|
|
28
|
+
activateRowOnKeyboardNavigation?: boolean;
|
|
29
|
+
deactivateRowOnLostFocus?: boolean;
|
|
26
30
|
footer?: {
|
|
27
31
|
headers?: {
|
|
28
32
|
[key: FooterCalculation | string]: string | boolean;
|
|
@@ -5,14 +5,23 @@ export interface GtRowClickEvent<R = TableRow> {
|
|
|
5
5
|
index: number;
|
|
6
6
|
event: MouseEvent;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface GtRowActiveEvent<R = TableRow> {
|
|
9
9
|
row: R | null;
|
|
10
10
|
index: number | null;
|
|
11
|
-
event?: MouseEvent;
|
|
11
|
+
event?: MouseEvent | KeyboardEvent;
|
|
12
|
+
}
|
|
13
|
+
export interface GtRowSelectEvent<R = TableRow> {
|
|
14
|
+
row: R | null;
|
|
15
|
+
index: number | null;
|
|
16
|
+
event?: KeyboardEvent;
|
|
12
17
|
}
|
|
13
18
|
export interface GtSortEvent<R = TableRow> {
|
|
14
19
|
key: keyof R;
|
|
15
20
|
order: GtOrder;
|
|
16
21
|
currentSortOrder: GtSortOrder<R>;
|
|
17
22
|
event?: MouseEvent;
|
|
23
|
+
addSortKey: boolean /** Add additional key to sort on multiple properties? True if the user is holding shift while sorting */;
|
|
24
|
+
}
|
|
25
|
+
export interface GtPageChangeEvent {
|
|
26
|
+
index: number;
|
|
18
27
|
}
|
|
@@ -1,24 +1,62 @@
|
|
|
1
|
-
import { ReplaySubject } from 'rxjs';
|
|
2
1
|
import { CoreComponent } from '../core.component';
|
|
3
|
-
import { GtPaginationAriaLabels, GtPaginationClasses } from '../models/gt-pagination';
|
|
2
|
+
import { GtPaginationAriaLabels, GtPaginationClasses, GtPaginationInfo } from '../models/gt-pagination';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class PaginationComponent {
|
|
5
|
+
get pagingInfo(): GtPaginationInfo;
|
|
6
|
+
/** pagingInfo
|
|
7
|
+
* @description when provided, pagination component will use this information to render pagination instead of data from table. Use this option when pagination is handled by backend (server side).
|
|
8
|
+
* @type info - metadata for pagination component
|
|
9
|
+
*/
|
|
10
|
+
set pagingInfo(info: GtPaginationInfo);
|
|
6
11
|
get paginationLength(): number;
|
|
7
|
-
|
|
12
|
+
/** paginationLength
|
|
13
|
+
* @description number of buttons to show in pagination
|
|
14
|
+
* @type length - number of buttons to show. Defaults to: `5`
|
|
15
|
+
*/
|
|
16
|
+
set paginationLength(length: number);
|
|
8
17
|
get classes(): GtPaginationClasses;
|
|
9
|
-
|
|
18
|
+
/** classes
|
|
19
|
+
* @description classes that should be used within pagination component for different elements
|
|
20
|
+
* @type classes - classes to be used. Defaults to: `{
|
|
21
|
+
* ul: 'pagination',
|
|
22
|
+
* li: 'page-item',
|
|
23
|
+
* button: 'page-link',
|
|
24
|
+
* }`
|
|
25
|
+
*/
|
|
26
|
+
set classes(classes: GtPaginationClasses);
|
|
10
27
|
get ariaLabels(): GtPaginationAriaLabels;
|
|
11
|
-
|
|
28
|
+
/** ariaLabels
|
|
29
|
+
* @description aria labels that describe pagination component
|
|
30
|
+
* @type labels - aria labels for pagination. Defaults to: `{
|
|
31
|
+
* nav: 'Table pagination',
|
|
32
|
+
* button: 'Go to page ',
|
|
33
|
+
* }`
|
|
34
|
+
*/
|
|
35
|
+
set ariaLabels(labels: GtPaginationAriaLabels);
|
|
12
36
|
get table(): CoreComponent;
|
|
13
|
-
|
|
14
|
-
|
|
37
|
+
/** table
|
|
38
|
+
* @description table component to which pagination is attached
|
|
39
|
+
* @type tableRef - table component
|
|
40
|
+
*/
|
|
41
|
+
set table(tableRef: CoreComponent);
|
|
42
|
+
private _pagingInfo;
|
|
43
|
+
private _table$;
|
|
15
44
|
private _table;
|
|
16
45
|
private _ariaLabels;
|
|
17
46
|
private _classes;
|
|
18
47
|
private _paginationLength;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
48
|
+
/** paginationListItems$ - observable for page numbers to show based on number of pages and current position */
|
|
49
|
+
paginationListItems$: import("rxjs").Observable<number[]>;
|
|
50
|
+
/** generate list - generate an array with page numbers to show based on number of pages and current position
|
|
51
|
+
* @param numberOfPages number of pages to show
|
|
52
|
+
* @param currentPosition current position (page index) being shown in table
|
|
53
|
+
* @returns Array<number> array of page numbers to show
|
|
54
|
+
*/
|
|
55
|
+
private _generateList;
|
|
56
|
+
/** go to page
|
|
57
|
+
* @param index - page index to go to
|
|
58
|
+
*/
|
|
59
|
+
goToPage(index: number): void;
|
|
22
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "angular-generic-table-pagination", never, { "paginationLength": "paginationLength"; "classes": "classes"; "ariaLabels": "ariaLabels"; "table": "table"; }, {}, never, never, true, never>;
|
|
61
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "angular-generic-table-pagination", never, { "pagingInfo": "pagingInfo"; "paginationLength": "paginationLength"; "classes": "classes"; "ariaLabels": "ariaLabels"; "table": "table"; }, {}, never, never, true, never>;
|
|
24
62
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { TableRow } from '../models/table-row.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class RowSelectionPipe implements PipeTransform {
|
|
5
|
+
transform(row: TableRow, selection: any, comparator: (row: TableRow, selection: any) => boolean, className?: string): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RowSelectionPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<RowSelectionPipe, "rowSelection", true>;
|
|
8
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableRow } from '../models/table-row.interface';
|
|
2
2
|
import { TableConfig } from '../models/table-config.interface';
|
|
3
|
-
import { GtSortOrder } from '../models/table-sort.interface';
|
|
3
|
+
import { GtSortConfig, GtSortOrder } from '../models/table-sort.interface';
|
|
4
|
+
import { GtSortEvent } from '../models/table-events.interface';
|
|
4
5
|
export declare let dashed: (s: string) => string;
|
|
5
6
|
export declare let capitalize: (s: string) => string;
|
|
6
7
|
export declare let chunk: (array: Array<any>, chunkSize: number) => Array<Array<TableRow>>;
|
|
@@ -11,7 +12,26 @@ export declare let calculate: (data: Array<TableRow>, config: TableConfig) => {
|
|
|
11
12
|
calculatedColumnsCount: number;
|
|
12
13
|
};
|
|
13
14
|
/** sortOnMultipleKeys
|
|
15
|
+
* @description Sort data on multiple keys
|
|
14
16
|
* @param {GtSortOrder} keys - array with sort config objects to sort on, data will be sorted according to array order
|
|
15
17
|
* @returns sort function
|
|
16
18
|
*/
|
|
17
19
|
export declare const sortOnMultipleKeys: (keys: GtSortOrder<TableRow>) => (a: TableRow, b: TableRow) => number;
|
|
20
|
+
/** parseSortOrderParams
|
|
21
|
+
* @description Convert sort order query param to array with sort config objects
|
|
22
|
+
* @param sortParams - Query param string where each sort config object is separated by comma and order is indicated by + (ascending) or - (descending), e.g. _'name,-age'_
|
|
23
|
+
* @returns GtSortOrder - Array with sort config objects
|
|
24
|
+
*/
|
|
25
|
+
export declare const parseSortOrderParams: (sortParams: string) => GtSortOrder<TableRow>;
|
|
26
|
+
/** sortOrderConfigToParam
|
|
27
|
+
* @description Convert sort config object to string that can be used as query param when sorting is implemented server side
|
|
28
|
+
* @param sortConfig - Sort config object
|
|
29
|
+
* @returns string - Query param string where order is indicated by + (ascending) or - (descending), e.g. _'-name'_
|
|
30
|
+
*/
|
|
31
|
+
export declare const sortOrderConfigToParam: (sortConfig: GtSortEvent | GtSortConfig) => string;
|
|
32
|
+
/** sortOrderToParams
|
|
33
|
+
* @description Convert sort order array to string that can be used as query param when sorting is implemented server side
|
|
34
|
+
* @param sortOrder - Array with sort config objects
|
|
35
|
+
* @returns string - Query param string where each sort config object is separated by comma and order is indicated by + (ascending) or - (descending), e.g. _'name,-age'_
|
|
36
|
+
*/
|
|
37
|
+
export declare const sortOrderToParams: (sortOrder: GtSortOrder<TableRow>) => string;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -11,3 +11,10 @@ export * from './lib/models/table-row.interface';
|
|
|
11
11
|
export * from './lib/models/table-sort.interface';
|
|
12
12
|
export * from './lib/models/table-meta.interface';
|
|
13
13
|
export * from './lib/models/table-events.interface';
|
|
14
|
+
export * from './lib/models/gt-pagination';
|
|
15
|
+
export * from './lib/utilities/utilities';
|
|
16
|
+
export * from './lib/pipes/capital-case.pipe';
|
|
17
|
+
export * from './lib/pipes/dash-case.pipe';
|
|
18
|
+
export * from './lib/pipes/dynamic.pipe';
|
|
19
|
+
export * from './lib/pipes/highlight.pipe';
|
|
20
|
+
export * from './lib/pipes/sort-class.pipe';
|
package/scss/index.scss
CHANGED
|
@@ -49,8 +49,10 @@ $descending-sort-gradient: linear-gradient(0.75turn,
|
|
|
49
49
|
|
|
50
50
|
$skeleton-loader-highlight-color: var(--bs-gray-300, rgb(200,200,200)) !default;
|
|
51
51
|
$skeleton-loader-background-color: var(--bs-gray-200, rgb(240,240,240)) !default;
|
|
52
|
-
$skeleton-loader-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
|
|
52
|
+
$skeleton-loader-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='a' viewBox='0 0 768 135'%3E%3Cdefs/%3E%3Cpath fill='%23FFF' d='M114 10h100v24H114V10ZM114 55h120v24H114V55ZM114 100h130v24H114v-24ZM268 10h100v24H268V10ZM268 55h80v24h-80V55ZM268 100h100v24H268v-24ZM402 10h90v24h-90V10ZM402 55h70v24h-70V55ZM402 100h80v24h-80v-24ZM516 10h90v24h-90V10ZM516 55h110v24H516V55ZM516 100h120v24H516v-24ZM660 100h74v24h-74v-24ZM660 55h64v24h-64V55ZM660 10h84v24h-84V10ZM0 100h80v24H0v-24ZM0 55h70v24H0V55ZM0 10h90v24H0V10ZM0 134h768v1H0v-1ZM0 89h768v1H0v-1ZM0 44h768v1H0v-1Z' class='b'/%3E%3C/svg%3E") !default;
|
|
53
|
+
$skeleton-loader-mask-size: 768px 135px !default;
|
|
53
54
|
|
|
55
|
+
$skeleton-height: var(--gt-skeleton-height, 169px) !default;
|
|
54
56
|
@mixin styles() {
|
|
55
57
|
@include default-style;
|
|
56
58
|
@include footer-style;
|
|
@@ -287,7 +289,7 @@ $skeleton-loader-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2
|
|
|
287
289
|
|
|
288
290
|
@mixin skeleton-loader-styles() {
|
|
289
291
|
.gt-skeleton-loader {
|
|
290
|
-
margin: 0.625rem 0;
|
|
292
|
+
margin:0 0 0.625rem 0;
|
|
291
293
|
--gt-skeleton-loader-mask: #{$skeleton-loader-mask};
|
|
292
294
|
--gt-skeleton-loader-highlight-color: #{$skeleton-loader-highlight-color};
|
|
293
295
|
--gt-skeleton-loader-bg-color: #{$skeleton-loader-background-color};
|
|
@@ -300,8 +302,9 @@ $skeleton-loader-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2
|
|
|
300
302
|
background-position: 200vw 0;
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
|
-
height:
|
|
305
|
+
height: $skeleton-height;
|
|
304
306
|
mask-image: var(--gt-skeleton-loader-mask);
|
|
307
|
+
mask-size: $skeleton-loader-mask-size;
|
|
305
308
|
background: linear-gradient(
|
|
306
309
|
280deg,
|
|
307
310
|
$skeleton-loader-background-color 12.5%,
|