@angular-generic-table/core 5.0.0-rc.1 → 5.0.0-rc.12

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.
Files changed (69) hide show
  1. package/angular-generic-table-core.d.ts +1 -3
  2. package/esm2020/angular-generic-table-core.mjs +5 -0
  3. package/esm2020/lib/core.component.mjs +161 -0
  4. package/esm2020/lib/core.module.mjs +40 -0
  5. package/esm2020/lib/core.service.mjs +14 -0
  6. package/esm2020/lib/enums/order.enum.mjs +6 -0
  7. package/esm2020/lib/gt-delta/gt-delta.component.mjs +115 -0
  8. package/esm2020/lib/models/gt-pagination.mjs +2 -0
  9. package/esm2020/lib/models/table-column.interface.mjs +2 -0
  10. package/esm2020/lib/models/table-config.interface.mjs +2 -0
  11. package/esm2020/lib/models/table-info.interface.mjs +2 -0
  12. package/esm2020/lib/models/table-meta.interface.mjs +2 -0
  13. package/esm2020/lib/models/table-row.interface.mjs +2 -0
  14. package/esm2020/lib/models/table-sort.interface.mjs +2 -0
  15. package/esm2020/lib/pagination/pagination.component.mjs +98 -0
  16. package/esm2020/lib/pagination/pagination.module.mjs +18 -0
  17. package/esm2020/lib/pipes/capital-case.pipe.mjs +17 -0
  18. package/esm2020/lib/pipes/dash-case.pipe.mjs +17 -0
  19. package/esm2020/lib/pipes/dynamic.pipe.mjs +25 -0
  20. package/esm2020/lib/pipes/highlight.pipe.mjs +48 -0
  21. package/esm2020/lib/pipes/sort-class.pipe.mjs +22 -0
  22. package/esm2020/lib/utilities/utilities.mjs +53 -0
  23. package/esm2020/public-api.mjs +16 -0
  24. package/fesm2015/angular-generic-table-core.mjs +610 -0
  25. package/fesm2015/angular-generic-table-core.mjs.map +1 -0
  26. package/fesm2020/angular-generic-table-core.mjs +603 -0
  27. package/fesm2020/angular-generic-table-core.mjs.map +1 -0
  28. package/lib/core.component.d.ts +20 -18
  29. package/lib/core.module.d.ts +12 -0
  30. package/lib/core.service.d.ts +3 -0
  31. package/lib/gt-delta/gt-delta.component.d.ts +20 -0
  32. package/lib/models/gt-pagination.d.ts +10 -0
  33. package/lib/models/table-column.interface.d.ts +13 -1
  34. package/lib/models/table-config.interface.d.ts +12 -3
  35. package/lib/models/table-meta.interface.d.ts +8 -0
  36. package/lib/models/table-row.interface.d.ts +2 -1
  37. package/lib/pagination/pagination.component.d.ts +24 -0
  38. package/lib/pagination/pagination.module.d.ts +8 -0
  39. package/lib/pipes/capital-case.pipe.d.ts +7 -0
  40. package/lib/pipes/dash-case.pipe.d.ts +3 -0
  41. package/lib/pipes/dynamic.pipe.d.ts +9 -0
  42. package/lib/pipes/highlight.pipe.d.ts +3 -0
  43. package/lib/pipes/sort-class.pipe.d.ts +4 -1
  44. package/lib/utilities/utilities.d.ts +1 -0
  45. package/package.json +21 -9
  46. package/public-api.d.ts +9 -0
  47. package/scss/index.scss +259 -0
  48. package/angular-generic-table-core.metadata.json +0 -1
  49. package/bundles/angular-generic-table-core.umd.js +0 -594
  50. package/bundles/angular-generic-table-core.umd.js.map +0 -1
  51. package/bundles/angular-generic-table-core.umd.min.js +0 -2
  52. package/bundles/angular-generic-table-core.umd.min.js.map +0 -1
  53. package/esm2015/angular-generic-table-core.js +0 -8
  54. package/esm2015/lib/core.component.js +0 -107
  55. package/esm2015/lib/core.module.js +0 -16
  56. package/esm2015/lib/core.service.js +0 -13
  57. package/esm2015/lib/enums/order.enum.js +0 -6
  58. package/esm2015/lib/models/table-column.interface.js +0 -2
  59. package/esm2015/lib/models/table-config.interface.js +0 -2
  60. package/esm2015/lib/models/table-info.interface.js +0 -2
  61. package/esm2015/lib/models/table-row.interface.js +0 -2
  62. package/esm2015/lib/models/table-sort.interface.js +0 -2
  63. package/esm2015/lib/pipes/dash-case.pipe.js +0 -13
  64. package/esm2015/lib/pipes/highlight.pipe.js +0 -44
  65. package/esm2015/lib/pipes/sort-class.pipe.js +0 -12
  66. package/esm2015/lib/utilities/utilities.js +0 -25
  67. package/esm2015/public-api.js +0 -7
  68. package/fesm2015/angular-generic-table-core.js +0 -234
  69. package/fesm2015/angular-generic-table-core.js.map +0 -1
@@ -0,0 +1,603 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Pipe, Injector, Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
3
+ import { ReplaySubject, Subject, isObservable, of, combineLatest, EMPTY, BehaviorSubject } from 'rxjs';
4
+ import { startWith, map, switchMap, shareReplay, withLatestFrom, pluck } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+
8
+ class CoreService {
9
+ constructor() { }
10
+ }
11
+ CoreService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12
+ CoreService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoreService, providedIn: 'root' });
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoreService, decorators: [{
14
+ type: Injectable,
15
+ args: [{
16
+ providedIn: 'root',
17
+ }]
18
+ }], ctorParameters: function () { return []; } });
19
+
20
+ var Order;
21
+ (function (Order) {
22
+ Order["ASC"] = "asc";
23
+ Order["DESC"] = "desc";
24
+ })(Order || (Order = {}));
25
+
26
+ let dashed;
27
+ dashed = (s) => s.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());
28
+ let capitalize;
29
+ capitalize = (s) => (s.charAt(0).toUpperCase() + s.slice(1))
30
+ .replace(/_/g, ' ')
31
+ .replace(/([A-Z][a-z]+)/g, ' $1')
32
+ .replace(/([A-Z]{2,})/g, ' $1')
33
+ .replace(/\s{2,}/g, ' ')
34
+ .trim();
35
+ let chunk;
36
+ chunk = (array, chunkSize) => {
37
+ if (chunkSize < 0) {
38
+ throw new Error('Invalid chunk size');
39
+ }
40
+ if (chunkSize === 0 && !chunkSize) {
41
+ return [array];
42
+ }
43
+ const CHUNK = [];
44
+ for (let i = 0, len = array.length; i < len; i += chunkSize) {
45
+ CHUNK.push(array.slice(i, i + chunkSize));
46
+ }
47
+ return CHUNK;
48
+ };
49
+ let search;
50
+ search = (text, caseSensitive, data, config) => {
51
+ if (config.columns) {
52
+ const searchColumns = Object.keys(config.columns).filter(
53
+ // @ts-ignore
54
+ (key) => config.columns &&
55
+ !config.columns[key]?.hidden &&
56
+ config.columns[key]?.search !== false);
57
+ const FILTERED = [];
58
+ for (let i = 0; i < data.length; i++) {
59
+ const row = data[i];
60
+ const match = Object.entries(row)
61
+ .filter(([key, value]) => searchColumns.indexOf(key) !== -1)
62
+ .reduce((acc, [key, value], index) => {
63
+ return (acc +
64
+ (index === 0 ? '' : ' ? ') +
65
+ (caseSensitive ? value + '' : (value + '').toLowerCase()));
66
+ }, '')
67
+ .indexOf(text) !== -1;
68
+ if (match) {
69
+ FILTERED[FILTERED.length] = row;
70
+ }
71
+ }
72
+ return FILTERED;
73
+ }
74
+ else {
75
+ return data;
76
+ }
77
+ };
78
+
79
+ class DashCasePipe {
80
+ transform(s) {
81
+ return dashed(s);
82
+ }
83
+ }
84
+ DashCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DashCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
85
+ DashCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DashCasePipe, name: "dashCase" });
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DashCasePipe, decorators: [{
87
+ type: Pipe,
88
+ args: [{
89
+ name: 'dashCase',
90
+ }]
91
+ }] });
92
+
93
+ class SortClassPipe {
94
+ transform(selection, property, aria = false) {
95
+ return selection?.sortBy === property
96
+ ? !aria
97
+ ? 'gt-sort-' + selection.sortByOrder
98
+ : selection.sortByOrder + 'ending'
99
+ : !aria
100
+ ? ''
101
+ : null;
102
+ }
103
+ }
104
+ SortClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SortClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
105
+ SortClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SortClassPipe, name: "sortClass" });
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SortClassPipe, decorators: [{
107
+ type: Pipe,
108
+ args: [{
109
+ name: 'sortClass',
110
+ }]
111
+ }] });
112
+
113
+ class CapitalCasePipe {
114
+ transform(s) {
115
+ return capitalize(s);
116
+ }
117
+ }
118
+ CapitalCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CapitalCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
119
+ CapitalCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CapitalCasePipe, name: "capitalCase" });
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CapitalCasePipe, decorators: [{
121
+ type: Pipe,
122
+ args: [{
123
+ name: 'capitalCase',
124
+ }]
125
+ }] });
126
+
127
+ class HighlightPipe {
128
+ transform(text, searchTerm) {
129
+ if (!searchTerm) {
130
+ return text;
131
+ }
132
+ const haystackAlwaysString = text + '';
133
+ let highlightedText = haystackAlwaysString; // fallback
134
+ let searchPattern;
135
+ try {
136
+ searchPattern = new RegExp('(' +
137
+ // @ts-ignore
138
+ searchTerm
139
+ .toLowerCase()
140
+ .match(/".*?"|[^ ]+/g) // extract words
141
+ .map((needle) => needle.replace(/"(.*?)"/, '$1') // strip away '"'
142
+ )
143
+ .join('|') + // combine words
144
+ ')', 'ig');
145
+ }
146
+ catch (error) {
147
+ return highlightedText;
148
+ }
149
+ const containsTagPattern = /(<.*?>)(.*)(<\/.*?>)/gi;
150
+ const containsTagMatches = containsTagPattern.exec(haystackAlwaysString);
151
+ if (containsTagMatches) {
152
+ // tag exists in haystack
153
+ highlightedText =
154
+ containsTagMatches[1] +
155
+ containsTagMatches[2].replace(searchPattern, '<span class="gt-highlight-search">$1</span>') +
156
+ containsTagMatches[3];
157
+ }
158
+ else {
159
+ highlightedText = haystackAlwaysString.replace(searchPattern, '<span class="gt-highlight-search">$1</span>');
160
+ }
161
+ return highlightedText;
162
+ }
163
+ }
164
+ HighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
165
+ HighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HighlightPipe, name: "highlight" });
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HighlightPipe, decorators: [{
167
+ type: Pipe,
168
+ args: [{
169
+ name: 'highlight',
170
+ }]
171
+ }] });
172
+
173
+ class DynamicPipe {
174
+ constructor(injector) {
175
+ this.injector = injector;
176
+ }
177
+ transform(value, requiredPipe, pipeArgs) {
178
+ const injector = Injector.create({
179
+ name: 'DynamicPipe',
180
+ parent: this.injector,
181
+ providers: [{ provide: requiredPipe }],
182
+ });
183
+ const pipe = injector.get(requiredPipe);
184
+ return pipe.transform(value, ...(pipeArgs || []));
185
+ }
186
+ }
187
+ DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DynamicPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
188
+ DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DynamicPipe, decorators: [{
190
+ type: Pipe,
191
+ args: [{
192
+ name: 'dynamicPipe',
193
+ }]
194
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
195
+
196
+ class CoreComponent {
197
+ constructor() {
198
+ this._loading$ = new ReplaySubject(1);
199
+ this.sortBy$ = new Subject();
200
+ // tslint:disable-next-line:variable-name
201
+ this._searchBy$ = new ReplaySubject(1);
202
+ this.searchBy$ = this._searchBy$.pipe(startWith(''), map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => obs), shareReplay(1));
203
+ // tslint:disable-next-line:variable-name
204
+ this._tableConfig$ = new ReplaySubject(1);
205
+ this.tableConfig$ = this._tableConfig$.pipe(map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => obs), shareReplay(1));
206
+ this._data$ = new ReplaySubject(1);
207
+ this.data$ = this._data$.pipe(map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => combineLatest([obs])), withLatestFrom(this.tableConfig$), map(([[data], config]) => {
208
+ // if columns or rows contains config for mapTo...
209
+ if ((config.columns &&
210
+ !!Object.values(config.columns).find((column) => !!column.mapTo)) ||
211
+ (config.rows &&
212
+ !!Object.values(config.rows).find((column) => !!column.mapTo))) {
213
+ // ...map data to new keys on row...
214
+ data = data.map((row) => {
215
+ const newKeys = Object.entries(config.columns || config.rows || [])
216
+ .filter(([key, value]) => !!value.mapTo) // add keys for columns with mapTo config...
217
+ .reduce((previousValue, currentValue) => ({
218
+ ...previousValue,
219
+ // tslint:disable-next-line:no-non-null-assertion
220
+ [currentValue[0]]: this.nestedValue(row, currentValue[1].mapTo.path, currentValue[1].mapTo?.missingValue),
221
+ }), {});
222
+ return { ...row, ...newKeys };
223
+ });
224
+ }
225
+ return { data, config };
226
+ }), switchMap((obs) => combineLatest([
227
+ of(obs),
228
+ this.sortBy$.pipe(startWith(EMPTY)),
229
+ this.searchBy$,
230
+ ])), map(([table, sortBy, searchBy]) => {
231
+ // create a new array reference and sort new array (prevent mutating existing state)
232
+ table.data = [...table.data];
233
+ return !sortBy
234
+ ? searchBy
235
+ ? search(searchBy, false, table.data, table.config)
236
+ : table.data
237
+ : (searchBy
238
+ ? search(searchBy, false, table.data, table.config)
239
+ : table.data)?.sort((a, b) => {
240
+ // TODO: improve logic
241
+ const typed = sortBy;
242
+ return a[typed.sortBy] > b[typed.sortBy]
243
+ ? typed.sortByOrder === Order.ASC
244
+ ? 1
245
+ : -1
246
+ : b[typed.sortBy] > a[typed.sortBy]
247
+ ? typed.sortByOrder === Order.ASC
248
+ ? -1
249
+ : 1
250
+ : 0;
251
+ });
252
+ }), shareReplay(1));
253
+ this.table$ = combineLatest([
254
+ this.data$,
255
+ this.tableConfig$,
256
+ ]).pipe(map(([sorted, config]) => {
257
+ // if pagination is disabled...
258
+ if (!config.pagination || config.pagination.length === 0) {
259
+ // ...return unaltered array
260
+ return {
261
+ data: [sorted],
262
+ config,
263
+ info: { records: sorted.length, pageTotal: 1 },
264
+ };
265
+ }
266
+ // return record set
267
+ return {
268
+ data: chunk(sorted, +(config.pagination.length || 0)),
269
+ config,
270
+ info: {
271
+ records: sorted.length,
272
+ pageTotal: Math.ceil(sorted.length / +(config.pagination.length || 0)),
273
+ },
274
+ };
275
+ }), shareReplay(1));
276
+ this._currentPage$ = new BehaviorSubject(0);
277
+ this.currentPage$ = combineLatest([this._currentPage$, this.table$]).pipe(map(([page, table]) => {
278
+ // determine last page
279
+ const lastPage = Math.ceil(table.info.records /
280
+ (table.config?.pagination?.length || table.info.records)) - 1;
281
+ // determine max/min position
282
+ return +page < 0 ? 0 : +page > lastPage ? lastPage : +page;
283
+ }), shareReplay(1));
284
+ this.colspan$ = this.tableConfig$.pipe(switchMap((config) => config.columns
285
+ ? of(Object.values(config.columns || config.rows || {}).filter((value) => value.hidden !== true).length)
286
+ : this.data$.pipe(map((data) => data.length + 1))));
287
+ this.columnOrder = (a, b) => {
288
+ return (a.value.order || 0) - (b.value.order || 0);
289
+ };
290
+ }
291
+ set loading(isLoading) {
292
+ this._loading$.next(isLoading);
293
+ }
294
+ set page(page) {
295
+ this._currentPage$.next(page);
296
+ }
297
+ set search(string) {
298
+ this._searchBy$.next(string);
299
+ }
300
+ set config(config) {
301
+ this._tableConfig$.next(config);
302
+ }
303
+ set data(data) {
304
+ this._data$.next(data);
305
+ }
306
+ get loading$() {
307
+ return this._loading$.pipe(startWith(false), map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => obs), shareReplay(1));
308
+ }
309
+ sort(property) {
310
+ const newSortOrder = this._sortBy?.sortBy !== property ||
311
+ this._sortBy?.sortByOrder === Order.DESC ||
312
+ !this._sortBy.sortByOrder
313
+ ? Order.ASC
314
+ : Order.DESC;
315
+ const newSortBy = {
316
+ sortBy: property,
317
+ sortByOrder: newSortOrder,
318
+ };
319
+ this.sortBy$.next(newSortBy);
320
+ this._sortBy = newSortBy;
321
+ }
322
+ nestedValue(object, mapTo, missingValue = null) {
323
+ const levels = mapTo.split('.');
324
+ return levels.reduce((previousValue, currentValue, index) => previousValue[currentValue] ||
325
+ (index === levels.length - 1 ? missingValue : {}), object);
326
+ }
327
+ }
328
+ CoreComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
329
+ CoreComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: CoreComponent, selector: "angular-generic-table", inputs: { loading: "loading", page: "page", search: "search", config: "config", data: "data" }, ngImport: i0, template: "<table\n [ngClass]=\"(tableConfig$ | async)?.class || 'table'\"\n [class.table-mobile]=\"(tableConfig$ | async)?.mobileLayout\"\n [class.table-horizontal]=\"(tableConfig$ | async)?.rows\"\n [class.table-loading]=\"loading$ | async\"\n [class.gt-sticky-row-header]=\"\n (tableConfig$ | async)?.stickyHeaders?.row && (tableConfig$ | async)?.rows\n \"\n [class.gt-sticky-column-header]=\"\n (tableConfig$ | async)?.stickyHeaders?.column\n \"\n [attr.aria-busy]=\"(loading$ | async) === true ? true : null\"\n>\n <thead>\n <tr\n *ngIf=\"{\n config: (tableConfig$ | async)!,\n isLoading: loading$ | async\n } as table\"\n >\n <ng-container\n *ngFor=\"let column of table?.config?.columns | keyvalue: columnOrder\"\n >\n <th\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ (column.key | dashCase) + '-column' }} {{\n column.value.class\n }}\"\n [class.disabled]=\"table.isLoading\"\n [attr.aria-sort]=\"sortBy$ | async | sortClass: column.key:true\"\n [class.gt-sortable]=\"true\"\n scope=\"col\"\n >\n <button\n *ngIf=\"column.value?.sortable\"\n class=\"gt-sort\"\n (click)=\"\n table.isLoading || !column.value?.sortable || sort(column.key)\n \"\n >\n <span *ngIf=\"column.value?.header !== false\">{{\n column.value?.header || column.key | capitalCase\n }}</span>\n </button>\n <span\n *ngIf=\"!column.value?.sortable && column.value?.header !== false\"\n >{{ column.value?.header || column.key | capitalCase }}</span\n >\n </th>\n </ng-container>\n <ng-container\n *ngIf=\"\n ((table?.config?.rows | keyvalue: columnOrder) || [])[0] as headerRow\n \"\n >\n <th\n class=\"row-header\"\n [attr.aria-sort]=\"sortBy$ | async | sortClass: headerRow.key:true\"\n ngClass=\"{{ headerRow.value?.sortable ? 'sort ' : '' }} {{\n sortBy$ | async | sortClass: headerRow.key\n }} {{ (headerRow.key | dashCase) + '-column' }}\"\n (click)=\"\n table.isLoading || !headerRow.value?.sortable || sort(headerRow.key)\n \"\n scope=\"col\"\n >\n <ng-container *ngIf=\"headerRow?.value?.header !== false\">{{\n headerRow?.value?.header || headerRow.key | capitalCase\n }}</ng-container>\n </th>\n <th\n *ngFor=\"let column of ((table$ | async)?.data || [])[0]\"\n ngClass=\"{{ headerRow.value?.class }}\"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (table.config?.rows || {})[headerRow.key].templateRef\n ? templateRef\n : (table.config?.rows || {})[headerRow.key].transform\n ? transformData\n : rawData\n \"\n [ngTemplateOutletContext]=\"{\n row: column,\n column: headerRow,\n transform: (table.config?.rows || {})[headerRow.key].transform,\n templateRef: (table.config?.rows || {})[headerRow.key]\n .templateRef,\n index: 0\n }\"\n >\n </ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n <tbody *ngIf=\"loading$ | async; else tableContent\">\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-loading\"></ng-content>\n </td>\n </tr>\n </tbody>\n</table>\n<ng-template #tableContent>\n <ng-container *ngIf=\"(table$ | async)! as table\">\n <tbody *ngIf=\"(table!.data![0] || table!.data!).length > 0; else noData\">\n <ng-container *ngIf=\"table.config.columns\">\n <tr\n *ngFor=\"\n let row of table!.data![(currentPage$ | async) || 0];\n let i = index\n \"\n [attr.id]=\"'tableRow_' + i\"\n >\n <ng-container\n *ngFor=\"let column of table.config?.columns | keyvalue: columnOrder\"\n >\n <td\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ (column.key | dashCase) + '-column' }} {{\n column.value?.class\n }}\"\n [attr.data-label]=\"\n table.config?.mobileLayout && column.value?.mobileHeader\n ? column.value?.mobileHeader !== true\n ? column.value?.mobileHeader\n : (column.value?.header || column.key | capitalCase)\n : null\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (searchBy$ | async) &&\n !(table.config?.columns || {})[column.key].templateRef\n ? highlighted\n : (table.config?.columns || {})[column.key].templateRef\n ? templateRef\n : (table.config?.columns || {})[column.key].transform\n ? transformData\n : rawData\n \"\n [ngTemplateOutletContext]=\"{\n row: row,\n column: column,\n search: (searchBy$ | async),\n transform: (table.config?.columns || {})[column.key]\n .transform,\n templateRef: (table.config?.columns || {})[column.key]\n .templateRef,\n index: i,\n data: table.data[(currentPage$ | async) || 0]\n }\"\n ></ng-container>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n <ng-container *ngIf=\"table.config.rows\">\n <ng-container\n *ngFor=\"\n let row of table?.config?.rows | keyvalue: columnOrder | slice: 1;\n let i = index\n \"\n >\n <tr\n *ngIf=\"!row.value?.hidden\"\n [attr.id]=\"'tableRow_' + i\"\n ngClass=\"{{ (row.key | dashCase) + '-row' }}\"\n >\n <th class=\"row-header\" scope=\"row\">\n {{ row.value?.header || row.key | capitalCase }}\n </th>\n <td\n *ngFor=\"let column of (table?.data || [])[0]; let y = index\"\n ngClass=\"{{ row.value?.class }}\"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (table.config?.rows || {})[row.key].templateRef\n ? templateRef\n : (table.config?.rows || {})[row.key].transform\n ? transformData\n : rawData\n \"\n [ngTemplateOutletContext]=\"{\n row: column,\n column: row,\n transform: (table.config?.rows || {})[row.key].transform,\n templateRef: (table.config?.rows || {})[row.key].templateRef,\n index: table.config?.rows ? y : i,\n data: table.data[(currentPage$ | async) || 0]\n }\"\n >\n </ng-container>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </ng-container>\n</ng-template>\n<ng-template #noData>\n <tbody>\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-no-data\"></ng-content>\n </td>\n </tr>\n </tbody>\n</ng-template>\n<ng-template #highlighted let-row=\"row\" let-column=\"column\" let-search=\"search\">\n <div [innerHTML]=\"row[column.key] | highlight: search\"></div>\n</ng-template>\n<ng-template #rawData let-row=\"row\" let-column=\"column\">\n {{ row[column.key] }}\n</ng-template>\n<ng-template\n #transformData\n let-row=\"row\"\n let-column=\"column\"\n let-transform=\"transform\"\n let-data=\"data\"\n>\n {{ row[column.key] | dynamicPipe: transform.pipe:transform?.args }}\n</ng-template>\n<ng-template\n #templateRef\n let-row=\"row\"\n let-column=\"column\"\n let-index=\"index\"\n let-templateRef=\"templateRef\"\n let-data=\"data\"\n>\n <ng-container\n [ngTemplateOutlet]=\"templateRef\"\n [ngTemplateOutletContext]=\"{\n row: row,\n col: column,\n index: index,\n data: data\n }\"\n ></ng-container>\n</ng-template>\n", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe, "keyvalue": i1.KeyValuePipe, "dashCase": DashCasePipe, "sortClass": SortClassPipe, "capitalCase": CapitalCasePipe, "slice": i1.SlicePipe, "highlight": HighlightPipe, "dynamicPipe": DynamicPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoreComponent, decorators: [{
331
+ type: Component,
332
+ args: [{ selector: 'angular-generic-table', styles: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<table\n [ngClass]=\"(tableConfig$ | async)?.class || 'table'\"\n [class.table-mobile]=\"(tableConfig$ | async)?.mobileLayout\"\n [class.table-horizontal]=\"(tableConfig$ | async)?.rows\"\n [class.table-loading]=\"loading$ | async\"\n [class.gt-sticky-row-header]=\"\n (tableConfig$ | async)?.stickyHeaders?.row && (tableConfig$ | async)?.rows\n \"\n [class.gt-sticky-column-header]=\"\n (tableConfig$ | async)?.stickyHeaders?.column\n \"\n [attr.aria-busy]=\"(loading$ | async) === true ? true : null\"\n>\n <thead>\n <tr\n *ngIf=\"{\n config: (tableConfig$ | async)!,\n isLoading: loading$ | async\n } as table\"\n >\n <ng-container\n *ngFor=\"let column of table?.config?.columns | keyvalue: columnOrder\"\n >\n <th\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ (column.key | dashCase) + '-column' }} {{\n column.value.class\n }}\"\n [class.disabled]=\"table.isLoading\"\n [attr.aria-sort]=\"sortBy$ | async | sortClass: column.key:true\"\n [class.gt-sortable]=\"true\"\n scope=\"col\"\n >\n <button\n *ngIf=\"column.value?.sortable\"\n class=\"gt-sort\"\n (click)=\"\n table.isLoading || !column.value?.sortable || sort(column.key)\n \"\n >\n <span *ngIf=\"column.value?.header !== false\">{{\n column.value?.header || column.key | capitalCase\n }}</span>\n </button>\n <span\n *ngIf=\"!column.value?.sortable && column.value?.header !== false\"\n >{{ column.value?.header || column.key | capitalCase }}</span\n >\n </th>\n </ng-container>\n <ng-container\n *ngIf=\"\n ((table?.config?.rows | keyvalue: columnOrder) || [])[0] as headerRow\n \"\n >\n <th\n class=\"row-header\"\n [attr.aria-sort]=\"sortBy$ | async | sortClass: headerRow.key:true\"\n ngClass=\"{{ headerRow.value?.sortable ? 'sort ' : '' }} {{\n sortBy$ | async | sortClass: headerRow.key\n }} {{ (headerRow.key | dashCase) + '-column' }}\"\n (click)=\"\n table.isLoading || !headerRow.value?.sortable || sort(headerRow.key)\n \"\n scope=\"col\"\n >\n <ng-container *ngIf=\"headerRow?.value?.header !== false\">{{\n headerRow?.value?.header || headerRow.key | capitalCase\n }}</ng-container>\n </th>\n <th\n *ngFor=\"let column of ((table$ | async)?.data || [])[0]\"\n ngClass=\"{{ headerRow.value?.class }}\"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (table.config?.rows || {})[headerRow.key].templateRef\n ? templateRef\n : (table.config?.rows || {})[headerRow.key].transform\n ? transformData\n : rawData\n \"\n [ngTemplateOutletContext]=\"{\n row: column,\n column: headerRow,\n transform: (table.config?.rows || {})[headerRow.key].transform,\n templateRef: (table.config?.rows || {})[headerRow.key]\n .templateRef,\n index: 0\n }\"\n >\n </ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n <tbody *ngIf=\"loading$ | async; else tableContent\">\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-loading\"></ng-content>\n </td>\n </tr>\n </tbody>\n</table>\n<ng-template #tableContent>\n <ng-container *ngIf=\"(table$ | async)! as table\">\n <tbody *ngIf=\"(table!.data![0] || table!.data!).length > 0; else noData\">\n <ng-container *ngIf=\"table.config.columns\">\n <tr\n *ngFor=\"\n let row of table!.data![(currentPage$ | async) || 0];\n let i = index\n \"\n [attr.id]=\"'tableRow_' + i\"\n >\n <ng-container\n *ngFor=\"let column of table.config?.columns | keyvalue: columnOrder\"\n >\n <td\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ (column.key | dashCase) + '-column' }} {{\n column.value?.class\n }}\"\n [attr.data-label]=\"\n table.config?.mobileLayout && column.value?.mobileHeader\n ? column.value?.mobileHeader !== true\n ? column.value?.mobileHeader\n : (column.value?.header || column.key | capitalCase)\n : null\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (searchBy$ | async) &&\n !(table.config?.columns || {})[column.key].templateRef\n ? highlighted\n : (table.config?.columns || {})[column.key].templateRef\n ? templateRef\n : (table.config?.columns || {})[column.key].transform\n ? transformData\n : rawData\n \"\n [ngTemplateOutletContext]=\"{\n row: row,\n column: column,\n search: (searchBy$ | async),\n transform: (table.config?.columns || {})[column.key]\n .transform,\n templateRef: (table.config?.columns || {})[column.key]\n .templateRef,\n index: i,\n data: table.data[(currentPage$ | async) || 0]\n }\"\n ></ng-container>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n <ng-container *ngIf=\"table.config.rows\">\n <ng-container\n *ngFor=\"\n let row of table?.config?.rows | keyvalue: columnOrder | slice: 1;\n let i = index\n \"\n >\n <tr\n *ngIf=\"!row.value?.hidden\"\n [attr.id]=\"'tableRow_' + i\"\n ngClass=\"{{ (row.key | dashCase) + '-row' }}\"\n >\n <th class=\"row-header\" scope=\"row\">\n {{ row.value?.header || row.key | capitalCase }}\n </th>\n <td\n *ngFor=\"let column of (table?.data || [])[0]; let y = index\"\n ngClass=\"{{ row.value?.class }}\"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (table.config?.rows || {})[row.key].templateRef\n ? templateRef\n : (table.config?.rows || {})[row.key].transform\n ? transformData\n : rawData\n \"\n [ngTemplateOutletContext]=\"{\n row: column,\n column: row,\n transform: (table.config?.rows || {})[row.key].transform,\n templateRef: (table.config?.rows || {})[row.key].templateRef,\n index: table.config?.rows ? y : i,\n data: table.data[(currentPage$ | async) || 0]\n }\"\n >\n </ng-container>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </ng-container>\n</ng-template>\n<ng-template #noData>\n <tbody>\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-no-data\"></ng-content>\n </td>\n </tr>\n </tbody>\n</ng-template>\n<ng-template #highlighted let-row=\"row\" let-column=\"column\" let-search=\"search\">\n <div [innerHTML]=\"row[column.key] | highlight: search\"></div>\n</ng-template>\n<ng-template #rawData let-row=\"row\" let-column=\"column\">\n {{ row[column.key] }}\n</ng-template>\n<ng-template\n #transformData\n let-row=\"row\"\n let-column=\"column\"\n let-transform=\"transform\"\n let-data=\"data\"\n>\n {{ row[column.key] | dynamicPipe: transform.pipe:transform?.args }}\n</ng-template>\n<ng-template\n #templateRef\n let-row=\"row\"\n let-column=\"column\"\n let-index=\"index\"\n let-templateRef=\"templateRef\"\n let-data=\"data\"\n>\n <ng-container\n [ngTemplateOutlet]=\"templateRef\"\n [ngTemplateOutletContext]=\"{\n row: row,\n col: column,\n index: index,\n data: data\n }\"\n ></ng-container>\n</ng-template>\n" }]
333
+ }], propDecorators: { loading: [{
334
+ type: Input
335
+ }], page: [{
336
+ type: Input
337
+ }], search: [{
338
+ type: Input
339
+ }], config: [{
340
+ type: Input
341
+ }], data: [{
342
+ type: Input
343
+ }] } });
344
+
345
+ class GtDeltaComponent {
346
+ constructor() {
347
+ this.Math = Math;
348
+ this.Number = Number;
349
+ this.data = [];
350
+ this.index = 0;
351
+ this.classes = {
352
+ span: 'gt-delta',
353
+ positive: 'text-success',
354
+ negative: 'text-danger',
355
+ };
356
+ this.key = 'value';
357
+ this.notApplicableValue = 'n/a';
358
+ this.initialValue = '-';
359
+ }
360
+ }
361
+ GtDeltaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GtDeltaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
362
+ GtDeltaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GtDeltaComponent, selector: "gt-delta", inputs: { data: "data", index: "index", baseIndex: "baseIndex", classes: "classes", key: "key", notApplicableValue: "notApplicableValue", initialValue: "initialValue" }, ngImport: i0, template: `<span
363
+ *ngIf="{
364
+ value:
365
+ index === 0
366
+ ? initialValue
367
+ : ((baseIndex === undefined
368
+ ? data[index - 1][key]
369
+ : data[baseIndex][key]) -
370
+ data[index][key]) /
371
+ -Math.abs(
372
+ baseIndex === undefined
373
+ ? data[index - 1][key]
374
+ : data[baseIndex][key]
375
+ )
376
+ } as delta"
377
+ [class]="[
378
+ classes.span,
379
+ !delta.value || !Number.isFinite(delta.value)
380
+ ? null
381
+ : delta.value > 0
382
+ ? classes.positive
383
+ : classes.negative
384
+ ]"
385
+ [class.gt-delta-positive]="delta.value > 0 && Number.isFinite(delta.value)"
386
+ [class.gt-delta-negative]="delta.value < 0"
387
+ >{{
388
+ Number.isFinite(delta.value)
389
+ ? (delta.value | percent)
390
+ : delta.value === initialValue
391
+ ? initialValue
392
+ : notApplicableValue
393
+ }}</span
394
+ >`, isInline: true, styles: [":host{display:inline-block}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "percent": i1.PercentPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GtDeltaComponent, decorators: [{
396
+ type: Component,
397
+ args: [{
398
+ selector: 'gt-delta',
399
+ template: `<span
400
+ *ngIf="{
401
+ value:
402
+ index === 0
403
+ ? initialValue
404
+ : ((baseIndex === undefined
405
+ ? data[index - 1][key]
406
+ : data[baseIndex][key]) -
407
+ data[index][key]) /
408
+ -Math.abs(
409
+ baseIndex === undefined
410
+ ? data[index - 1][key]
411
+ : data[baseIndex][key]
412
+ )
413
+ } as delta"
414
+ [class]="[
415
+ classes.span,
416
+ !delta.value || !Number.isFinite(delta.value)
417
+ ? null
418
+ : delta.value > 0
419
+ ? classes.positive
420
+ : classes.negative
421
+ ]"
422
+ [class.gt-delta-positive]="delta.value > 0 && Number.isFinite(delta.value)"
423
+ [class.gt-delta-negative]="delta.value < 0"
424
+ >{{
425
+ Number.isFinite(delta.value)
426
+ ? (delta.value | percent)
427
+ : delta.value === initialValue
428
+ ? initialValue
429
+ : notApplicableValue
430
+ }}</span
431
+ >`,
432
+ styles: [
433
+ `
434
+ :host {
435
+ display: inline-block;
436
+ }
437
+ `,
438
+ ],
439
+ changeDetection: ChangeDetectionStrategy.OnPush,
440
+ }]
441
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
442
+ type: Input
443
+ }], index: [{
444
+ type: Input
445
+ }], baseIndex: [{
446
+ type: Input
447
+ }], classes: [{
448
+ type: Input
449
+ }], key: [{
450
+ type: Input
451
+ }], notApplicableValue: [{
452
+ type: Input
453
+ }], initialValue: [{
454
+ type: Input
455
+ }] } });
456
+
457
+ class GenericTableCoreModule {
458
+ }
459
+ GenericTableCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTableCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
460
+ GenericTableCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTableCoreModule, declarations: [CoreComponent,
461
+ SortClassPipe,
462
+ DashCasePipe,
463
+ HighlightPipe,
464
+ CapitalCasePipe,
465
+ CapitalCasePipe,
466
+ DynamicPipe,
467
+ GtDeltaComponent], imports: [CommonModule], exports: [CoreComponent, GtDeltaComponent] });
468
+ GenericTableCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTableCoreModule, imports: [[CommonModule]] });
469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTableCoreModule, decorators: [{
470
+ type: NgModule,
471
+ args: [{
472
+ declarations: [
473
+ CoreComponent,
474
+ SortClassPipe,
475
+ DashCasePipe,
476
+ HighlightPipe,
477
+ CapitalCasePipe,
478
+ CapitalCasePipe,
479
+ DynamicPipe,
480
+ GtDeltaComponent,
481
+ ],
482
+ imports: [CommonModule],
483
+ exports: [CoreComponent, GtDeltaComponent],
484
+ }]
485
+ }] });
486
+
487
+ class PaginationComponent {
488
+ constructor() {
489
+ this.table$ = new ReplaySubject(1);
490
+ this._ariaLabels = {
491
+ nav: 'Table pagination',
492
+ button: 'Go to page ',
493
+ };
494
+ this._classes = {
495
+ ul: 'pagination',
496
+ li: 'page-item',
497
+ button: 'page-link',
498
+ };
499
+ this._paginationLength = 5;
500
+ this.pagination$ = this.table$.pipe(switchMap((core) => combineLatest([core?.table$.pipe(pluck('info')), core?.currentPage$])), map(([info, currentPage]) => this.generateList(info.pageTotal, currentPage)));
501
+ }
502
+ get paginationLength() {
503
+ return this._paginationLength;
504
+ }
505
+ set paginationLength(value) {
506
+ this._paginationLength = +value;
507
+ }
508
+ get classes() {
509
+ return this._classes;
510
+ }
511
+ set classes(value) {
512
+ this._classes = value;
513
+ }
514
+ get ariaLabels() {
515
+ return this._ariaLabels;
516
+ }
517
+ set ariaLabels(value) {
518
+ this._ariaLabels = value;
519
+ }
520
+ get table() {
521
+ return this._table;
522
+ }
523
+ set table(value) {
524
+ this._table = value;
525
+ this.table$.next(value);
526
+ }
527
+ generateList(pages, currentPosition) {
528
+ const middle = Math.floor(this.paginationLength / 2);
529
+ const length = pages < this.paginationLength ? pages : this.paginationLength;
530
+ return Array.from({ length }, (_, i) => {
531
+ if (i === 0) {
532
+ return 1;
533
+ }
534
+ else if (pages < this.paginationLength) {
535
+ return i + 1;
536
+ }
537
+ else if (i + 1 === length) {
538
+ return pages;
539
+ }
540
+ else if (currentPosition > middle && currentPosition < pages - middle) {
541
+ return i + currentPosition - (middle - 1);
542
+ }
543
+ else if (currentPosition > middle &&
544
+ currentPosition < pages - (middle - 1)) {
545
+ return i + currentPosition - middle;
546
+ }
547
+ else if (currentPosition > middle &&
548
+ currentPosition === pages - (middle - 1)) {
549
+ return i + currentPosition - (middle + 1);
550
+ }
551
+ else if (currentPosition > middle && currentPosition === pages - 1) {
552
+ return i + currentPosition - (middle + 2);
553
+ }
554
+ else {
555
+ return i + 1;
556
+ }
557
+ });
558
+ }
559
+ goto(page) {
560
+ if (this.table) {
561
+ this.table.page = page - 1;
562
+ }
563
+ }
564
+ }
565
+ PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
566
+ PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PaginationComponent, selector: "angular-generic-table-pagination", inputs: { paginationLength: "paginationLength", classes: "classes", ariaLabels: "ariaLabels", table: "table" }, ngImport: i0, template: "<ng-container\n *ngIf=\"{\n links: pagination$ | async,\n currentPosition: table?.currentPage$ | async\n } as pagination\"\n>\n <nav\n *ngIf=\"pagination.links && pagination.links.length > 1\"\n role=\"navigation\"\n [attr.aria-label]=\"ariaLabels?.nav\"\n class=\"gt-pagination\"\n [class]=\"classes?.nav\"\n >\n <ul [class]=\"classes?.ul\">\n <ng-container\n *ngFor=\"\n let position of pagination!.links;\n let i = index;\n let last = last\n \"\n >\n <li\n [class]=\"classes?.li\"\n [class.active]=\"position === (pagination!.currentPosition || 0) + 1\"\n >\n <button\n [class]=\"classes?.button\"\n [attr.aria-label]=\"ariaLabels.button + position\"\n (click)=\"goto(position)\"\n >\n {{ position }}\n </button>\n </li>\n <li\n [class]=\"classes?.li\"\n class=\"gt-ellipsis\"\n *ngIf=\"position + 1 !== pagination!.links![i + 1] && !last\"\n >\n <button [class]=\"classes?.button\" disabled tabindex=\"-1\"></button>\n </li>\n </ng-container>\n </ul>\n </nav>\n</ng-container>\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PaginationComponent, decorators: [{
568
+ type: Component,
569
+ args: [{ selector: 'angular-generic-table-pagination', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container\n *ngIf=\"{\n links: pagination$ | async,\n currentPosition: table?.currentPage$ | async\n } as pagination\"\n>\n <nav\n *ngIf=\"pagination.links && pagination.links.length > 1\"\n role=\"navigation\"\n [attr.aria-label]=\"ariaLabels?.nav\"\n class=\"gt-pagination\"\n [class]=\"classes?.nav\"\n >\n <ul [class]=\"classes?.ul\">\n <ng-container\n *ngFor=\"\n let position of pagination!.links;\n let i = index;\n let last = last\n \"\n >\n <li\n [class]=\"classes?.li\"\n [class.active]=\"position === (pagination!.currentPosition || 0) + 1\"\n >\n <button\n [class]=\"classes?.button\"\n [attr.aria-label]=\"ariaLabels.button + position\"\n (click)=\"goto(position)\"\n >\n {{ position }}\n </button>\n </li>\n <li\n [class]=\"classes?.li\"\n class=\"gt-ellipsis\"\n *ngIf=\"position + 1 !== pagination!.links![i + 1] && !last\"\n >\n <button [class]=\"classes?.button\" disabled tabindex=\"-1\"></button>\n </li>\n </ng-container>\n </ul>\n </nav>\n</ng-container>\n" }]
570
+ }], propDecorators: { paginationLength: [{
571
+ type: Input
572
+ }], classes: [{
573
+ type: Input
574
+ }], ariaLabels: [{
575
+ type: Input
576
+ }], table: [{
577
+ type: Input
578
+ }] } });
579
+
580
+ class GenericTablePaginationModule {
581
+ }
582
+ GenericTablePaginationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTablePaginationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
583
+ GenericTablePaginationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTablePaginationModule, declarations: [PaginationComponent], imports: [CommonModule], exports: [PaginationComponent] });
584
+ GenericTablePaginationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTablePaginationModule, imports: [[CommonModule]] });
585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GenericTablePaginationModule, decorators: [{
586
+ type: NgModule,
587
+ args: [{
588
+ declarations: [PaginationComponent],
589
+ imports: [CommonModule],
590
+ exports: [PaginationComponent],
591
+ }]
592
+ }] });
593
+
594
+ /*
595
+ * Public API Surface of core
596
+ */
597
+
598
+ /**
599
+ * Generated bundle index. Do not edit.
600
+ */
601
+
602
+ export { CoreComponent, CoreService, GenericTableCoreModule, GenericTablePaginationModule, GtDeltaComponent, PaginationComponent };
603
+ //# sourceMappingURL=angular-generic-table-core.mjs.map