@angular-generic-table/core 5.0.0-rc.13 → 5.0.0-rc.15
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 +37 -13
- package/esm2020/lib/core.module.mjs +11 -8
- package/esm2020/lib/core.service.mjs +3 -3
- package/esm2020/lib/gt-delta/gt-delta.component.mjs +95 -73
- package/esm2020/lib/models/table-column.interface.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-meta.interface.mjs +1 -1
- package/esm2020/lib/models/table-row.interface.mjs +1 -1
- package/esm2020/lib/pagination/pagination.component.mjs +6 -6
- package/esm2020/lib/pagination/pagination.module.mjs +6 -7
- package/esm2020/lib/pipes/capital-case.pipe.mjs +5 -4
- package/esm2020/lib/pipes/dash-case.pipe.mjs +5 -4
- package/esm2020/lib/pipes/dynamic.pipe.mjs +5 -4
- package/esm2020/lib/pipes/highlight.pipe.mjs +5 -4
- package/esm2020/lib/pipes/sort-class.pipe.mjs +5 -4
- package/esm2020/lib/utilities/utilities.mjs +72 -2
- package/fesm2015/angular-generic-table-core.mjs +274 -144
- package/fesm2015/angular-generic-table-core.mjs.map +1 -1
- package/fesm2020/angular-generic-table-core.mjs +266 -144
- package/fesm2020/angular-generic-table-core.mjs.map +1 -1
- package/lib/core.component.d.ts +12 -6
- package/lib/core.module.d.ts +9 -9
- package/lib/gt-delta/gt-delta.component.d.ts +18 -6
- package/lib/models/table-column.interface.d.ts +4 -2
- package/lib/models/table-config.interface.d.ts +22 -3
- package/lib/models/table-events.interface.d.ts +4 -4
- package/lib/models/table-meta.interface.d.ts +3 -3
- package/lib/models/table-row.interface.d.ts +0 -1
- package/lib/pagination/pagination.component.d.ts +3 -3
- package/lib/pagination/pagination.module.d.ts +3 -3
- package/lib/pipes/capital-case.pipe.d.ts +1 -1
- package/lib/pipes/dash-case.pipe.d.ts +1 -1
- package/lib/pipes/dynamic.pipe.d.ts +1 -1
- package/lib/pipes/highlight.pipe.d.ts +1 -1
- package/lib/pipes/sort-class.pipe.d.ts +1 -1
- package/lib/utilities/utilities.d.ts +5 -0
- package/package.json +1 -1
- package/scss/index.scss +41 -3
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Pipe, Injector, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, NgModule } from '@angular/core';
|
|
3
3
|
import { ReplaySubject, Subject, isObservable, of, combineLatest, EMPTY, BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { KeyValuePipe, AsyncPipe, NgTemplateOutlet, SlicePipe, NgClass, NgIf, NgForOf, PercentPipe, CommonModule } from '@angular/common';
|
|
4
5
|
import { debounceTime, distinctUntilChanged, tap, shareReplay, startWith, map, switchMap, withLatestFrom, take, pluck } from 'rxjs/operators';
|
|
5
|
-
import * as i1 from '@angular/common';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
6
|
|
|
8
7
|
class CoreService {
|
|
9
8
|
constructor() { }
|
|
10
9
|
}
|
|
11
|
-
CoreService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
12
|
-
CoreService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
10
|
+
CoreService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
11
|
+
CoreService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CoreService, providedIn: 'root' });
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CoreService, decorators: [{
|
|
14
13
|
type: Injectable,
|
|
15
14
|
args: [{
|
|
16
15
|
providedIn: 'root',
|
|
@@ -60,11 +59,17 @@ search = (text, caseSensitive, data, config) => {
|
|
|
60
59
|
const match = Object.entries(row)
|
|
61
60
|
.filter(([key, value]) => searchColumns.indexOf(key) !== -1)
|
|
62
61
|
.reduce((acc, [key, value], index) => {
|
|
62
|
+
const search = config?.columns[key]?.search;
|
|
63
|
+
// if search is a function...
|
|
64
|
+
if (typeof search === 'function') {
|
|
65
|
+
// ...use search function to return value to search
|
|
66
|
+
value = search(row, key, value);
|
|
67
|
+
}
|
|
63
68
|
return (acc +
|
|
64
69
|
(index === 0 ? '' : ' ? ') +
|
|
65
70
|
(caseSensitive ? value + '' : (value + '').toLowerCase()));
|
|
66
71
|
}, '')
|
|
67
|
-
.indexOf(text) !== -1;
|
|
72
|
+
.indexOf(caseSensitive ? text : text.toLowerCase()) !== -1;
|
|
68
73
|
if (match) {
|
|
69
74
|
FILTERED[FILTERED.length] = row;
|
|
70
75
|
}
|
|
@@ -75,6 +80,85 @@ search = (text, caseSensitive, data, config) => {
|
|
|
75
80
|
return data;
|
|
76
81
|
}
|
|
77
82
|
};
|
|
83
|
+
let calculate = (data, config) => {
|
|
84
|
+
const CALCULATIONS = {};
|
|
85
|
+
const COLUMN_CALCULATIONS = {};
|
|
86
|
+
let CALCULATED = Object.entries(config.footer?.columns || {})
|
|
87
|
+
.filter(([columnName, calculations]) => Object.values(calculations || {}).filter((value) => value !== false)
|
|
88
|
+
.length >= 0)
|
|
89
|
+
.reduce((acc, [columnName, calculations], index) => {
|
|
90
|
+
acc[columnName] = Object.entries(calculations || {})
|
|
91
|
+
.filter(([calculation, value]) => value !== false)
|
|
92
|
+
.reduce((acc, [calculation, value]) => {
|
|
93
|
+
if (COLUMN_CALCULATIONS[columnName]) {
|
|
94
|
+
COLUMN_CALCULATIONS[columnName].push(calculation);
|
|
95
|
+
}
|
|
96
|
+
else if (value === true) {
|
|
97
|
+
COLUMN_CALCULATIONS[columnName] = [calculation];
|
|
98
|
+
}
|
|
99
|
+
CALCULATIONS[calculation] = true;
|
|
100
|
+
if (typeof value === 'function') {
|
|
101
|
+
value = value(data, columnName);
|
|
102
|
+
}
|
|
103
|
+
acc[calculation] = value === true ? 0 : value;
|
|
104
|
+
return acc;
|
|
105
|
+
}, {});
|
|
106
|
+
return acc;
|
|
107
|
+
}, {});
|
|
108
|
+
if (Object.keys(CALCULATED).length > 0) {
|
|
109
|
+
for (let i = 0; i < data.length; i++) {
|
|
110
|
+
Object.entries(COLUMN_CALCULATIONS).forEach(([column, calculations]) => {
|
|
111
|
+
if (calculations.indexOf('sum') > -1) {
|
|
112
|
+
CALCULATED[column].sum += data[i][column];
|
|
113
|
+
}
|
|
114
|
+
if (calculations.indexOf('avg') > -1 &&
|
|
115
|
+
calculations.indexOf('sum') === -1) {
|
|
116
|
+
if (CALCULATED[column].sum === undefined) {
|
|
117
|
+
CALCULATED[column].sum = 0;
|
|
118
|
+
}
|
|
119
|
+
CALCULATED[column].sum += data[i][column];
|
|
120
|
+
}
|
|
121
|
+
if (calculations.indexOf('max') > -1 &&
|
|
122
|
+
(!CALCULATED[column].max || +data[i][column] > CALCULATED[column].max)) {
|
|
123
|
+
CALCULATED[column].max = +data[i][column];
|
|
124
|
+
}
|
|
125
|
+
if (calculations.indexOf('min') > -1 &&
|
|
126
|
+
(!CALCULATED[column].min || +data[i][column] < CALCULATED[column].min)) {
|
|
127
|
+
CALCULATED[column].min = +data[i][column];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
Object.entries(COLUMN_CALCULATIONS).forEach(([column, calculations]) => {
|
|
132
|
+
if (calculations.indexOf('avg') !== -1) {
|
|
133
|
+
CALCULATED[column].avg = CALCULATED[column]?.sum / data.length;
|
|
134
|
+
}
|
|
135
|
+
if (calculations.indexOf('count') !== -1) {
|
|
136
|
+
CALCULATED[column].count = data.length;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
calculated: CALCULATED,
|
|
142
|
+
calculations: Object.keys(CALCULATIONS).sort((a, b) => (config.footer?.rowOrder?.indexOf(a) || 0) -
|
|
143
|
+
(config.footer?.rowOrder?.indexOf(b) || 0)),
|
|
144
|
+
calculatedColumnsCount: Object.keys(CALCULATED).length || 0,
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
class CapitalCasePipe {
|
|
149
|
+
transform(s) {
|
|
150
|
+
return capitalize(s);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
CapitalCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CapitalCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
154
|
+
CapitalCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: CapitalCasePipe, isStandalone: true, name: "capitalCase" });
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CapitalCasePipe, decorators: [{
|
|
156
|
+
type: Pipe,
|
|
157
|
+
args: [{
|
|
158
|
+
name: 'capitalCase',
|
|
159
|
+
standalone: true,
|
|
160
|
+
}]
|
|
161
|
+
}] });
|
|
78
162
|
|
|
79
163
|
class SortClassPipe {
|
|
80
164
|
transform(selection, property, aria = false) {
|
|
@@ -87,12 +171,13 @@ class SortClassPipe {
|
|
|
87
171
|
: null;
|
|
88
172
|
}
|
|
89
173
|
}
|
|
90
|
-
SortClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
91
|
-
SortClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
174
|
+
SortClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: SortClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
175
|
+
SortClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: SortClassPipe, isStandalone: true, name: "sortClass" });
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: SortClassPipe, decorators: [{
|
|
93
177
|
type: Pipe,
|
|
94
178
|
args: [{
|
|
95
179
|
name: 'sortClass',
|
|
180
|
+
standalone: true,
|
|
96
181
|
}]
|
|
97
182
|
}] });
|
|
98
183
|
|
|
@@ -101,15 +186,40 @@ class DashCasePipe {
|
|
|
101
186
|
return dashed(s);
|
|
102
187
|
}
|
|
103
188
|
}
|
|
104
|
-
DashCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
105
|
-
DashCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
189
|
+
DashCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DashCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
190
|
+
DashCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: DashCasePipe, isStandalone: true, name: "dashCase" });
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DashCasePipe, decorators: [{
|
|
107
192
|
type: Pipe,
|
|
108
193
|
args: [{
|
|
109
194
|
name: 'dashCase',
|
|
195
|
+
standalone: true,
|
|
110
196
|
}]
|
|
111
197
|
}] });
|
|
112
198
|
|
|
199
|
+
class DynamicPipe {
|
|
200
|
+
constructor(injector) {
|
|
201
|
+
this.injector = injector;
|
|
202
|
+
}
|
|
203
|
+
transform(value, requiredPipe, pipeArgs) {
|
|
204
|
+
const injector = Injector.create({
|
|
205
|
+
name: 'DynamicPipe',
|
|
206
|
+
parent: this.injector,
|
|
207
|
+
providers: [{ provide: requiredPipe }],
|
|
208
|
+
});
|
|
209
|
+
const pipe = injector.get(requiredPipe);
|
|
210
|
+
return pipe.transform(value, ...(pipeArgs || []));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
214
|
+
DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: DynamicPipe, isStandalone: true, name: "dynamicPipe" });
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DynamicPipe, decorators: [{
|
|
216
|
+
type: Pipe,
|
|
217
|
+
args: [{
|
|
218
|
+
name: 'dynamicPipe',
|
|
219
|
+
standalone: true,
|
|
220
|
+
}]
|
|
221
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
222
|
+
|
|
113
223
|
class HighlightPipe {
|
|
114
224
|
transform(text, searchTerm) {
|
|
115
225
|
if (!searchTerm) {
|
|
@@ -147,52 +257,16 @@ class HighlightPipe {
|
|
|
147
257
|
return highlightedText;
|
|
148
258
|
}
|
|
149
259
|
}
|
|
150
|
-
HighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
151
|
-
HighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
152
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
260
|
+
HighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
261
|
+
HighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: HighlightPipe, isStandalone: true, name: "highlight" });
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: HighlightPipe, decorators: [{
|
|
153
263
|
type: Pipe,
|
|
154
264
|
args: [{
|
|
155
265
|
name: 'highlight',
|
|
266
|
+
standalone: true,
|
|
156
267
|
}]
|
|
157
268
|
}] });
|
|
158
269
|
|
|
159
|
-
class CapitalCasePipe {
|
|
160
|
-
transform(s) {
|
|
161
|
-
return capitalize(s);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
CapitalCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: CapitalCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
165
|
-
CapitalCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: CapitalCasePipe, name: "capitalCase" });
|
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: CapitalCasePipe, decorators: [{
|
|
167
|
-
type: Pipe,
|
|
168
|
-
args: [{
|
|
169
|
-
name: 'capitalCase',
|
|
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: "14.1.1", ngImport: i0, type: DynamicPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
188
|
-
DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
|
|
189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DynamicPipe, decorators: [{
|
|
190
|
-
type: Pipe,
|
|
191
|
-
args: [{
|
|
192
|
-
name: 'dynamicPipe',
|
|
193
|
-
}]
|
|
194
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
195
|
-
|
|
196
270
|
class CoreComponent {
|
|
197
271
|
constructor() {
|
|
198
272
|
this.rowClick = new EventEmitter();
|
|
@@ -256,6 +330,7 @@ class CoreComponent {
|
|
|
256
330
|
: 0;
|
|
257
331
|
});
|
|
258
332
|
}), shareReplay(1));
|
|
333
|
+
this.calculations$ = combineLatest([this.data$, this.tableConfig$]).pipe(map(([data, config]) => calculate(data, config)), shareReplay(1));
|
|
259
334
|
this.table$ = combineLatest([
|
|
260
335
|
this.data$,
|
|
261
336
|
this.tableConfig$,
|
|
@@ -289,7 +364,17 @@ class CoreComponent {
|
|
|
289
364
|
}), shareReplay(1));
|
|
290
365
|
this.colspan$ = this.tableConfig$.pipe(switchMap((config) => config.columns
|
|
291
366
|
? of(Object.values(config.columns || config.rows || {}).filter((value) => value.hidden !== true).length)
|
|
292
|
-
: this.data$.pipe(map((data) => data.length + 1))));
|
|
367
|
+
: this.data$.pipe(map((data) => data.length + 1))), shareReplay(1));
|
|
368
|
+
this.footerColspan$ = this.tableConfig$.pipe(map((config) => {
|
|
369
|
+
let colspan = 0;
|
|
370
|
+
Object.values(config?.footer?.columns || {}).forEach((calculations) => {
|
|
371
|
+
if (Object.values(calculations).filter((value) => value !== false)
|
|
372
|
+
.length >= 0) {
|
|
373
|
+
colspan += 1;
|
|
374
|
+
}
|
|
375
|
+
}, {});
|
|
376
|
+
return colspan;
|
|
377
|
+
}), shareReplay(1));
|
|
293
378
|
this.columnOrder = (a, b) => {
|
|
294
379
|
return (a.value.order || 0) - (b.value.order || 0);
|
|
295
380
|
};
|
|
@@ -350,11 +435,24 @@ class CoreComponent {
|
|
|
350
435
|
(index === levels.length - 1 ? missingValue : {}), object);
|
|
351
436
|
}
|
|
352
437
|
}
|
|
353
|
-
CoreComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
354
|
-
CoreComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: CoreComponent, selector: "angular-generic-table", inputs: { loading: "loading", page: "page", search: "search", config: "config", data: "data" }, outputs: { rowClick: "rowClick", rowHover: "rowHover" }, 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 (click)=\"table?.config?.rowClick && _rowClick(row, i, $event)\"\n (mouseover)=\"table?.config?.rowHover && _hoverRow(row, i, $event)\"\n (mouseout)=\"table?.config?.rowHover && _hoverRow(null, null, $event)\"\n [class.gt-hover]=\"(rowHover$ | async)?.index === 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 (click)=\"table?.config?.rowClick && _rowClick(row, i, $event)\"\n (mouseover)=\"table?.config?.rowHover && _hoverRow(row, i, $event)\"\n (mouseout)=\"\n table?.config?.rowHover && _hoverRow(null, null, $event)\n \"\n [class.gt-hover]=\"(rowHover$ | async)?.index === i\"\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", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: SortClassPipe, name: "sortClass" }, { kind: "pipe", type: DashCasePipe, name: "dashCase" }, { kind: "pipe", type: HighlightPipe, name: "highlight" }, { kind: "pipe", type: CapitalCasePipe, name: "capitalCase" }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
438
|
+
CoreComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
439
|
+
CoreComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: CoreComponent, isStandalone: true, selector: "angular-generic-table", inputs: { loading: "loading", page: "page", search: "search", config: "config", data: "data" }, outputs: { rowClick: "rowClick", rowHover: "rowHover" }, 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].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 <tfoot *ngIf=\"(table$ | async)! as table\">\n <ng-container *ngIf=\"table.data.length > 0 && !(loading$ | async)\">\n <ng-container *ngIf=\"(calculations$ | async)! as calculations\">\n <tr\n *ngFor=\"let calculation of calculations.calculations; let i = index\"\n >\n <ng-container\n *ngIf=\"{\n showHeader: (colspan$ | async) !== (footerColspan$ | async)\n } as footerRow\"\n >\n <th\n *ngIf=\"footerRow.showHeader\"\n [colSpan]=\"\n ((colspan$ | async) || 0) - ((footerColspan$ | async) || 0)\n \"\n scope=\"row\"\n >\n <ng-container\n *ngIf=\"table.config?.footer?.headers?.[calculation] as showHeader\"\n >{{showHeader === true ? (calculation | capitalCase): table.config.footer?.headers?.[calculation]}}\n </ng-container>\n </th>\n <ng-container\n *ngFor=\"\n let column of table.config?.columns | keyvalue: columnOrder\n \"\n >\n <td\n *ngIf=\"\n !column.value?.hidden && calculations.calculated[column.key]\n \"\n ngClass=\"{{ (column.key | dashCase) + '-column' }} {{\n column.value.class\n }}\"\n [attr.data-header]=\"\n !footerRow.showHeader && table.config.footer?.headers?.[calculation]\n ? table.config.footer?.headers?.[calculation] === true ? (calculation | capitalCase) : table.config.footer?.headers?.[calculation]\n : null\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (table.config.columns || {})[column.key].transform\n ? transformFooter\n : rawFooter\n \"\n [ngTemplateOutletContext]=\"{\n value: calculations.calculated[column.key][calculation],\n transform: (table.config.columns || {})[column.key]\n .transform\n }\"\n ></ng-container>\n </td>\n </ng-container>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </tfoot>\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 (click)=\"table?.config?.rowClick && _rowClick(row, i, $event)\"\n (mouseover)=\"table?.config?.rowHover && _hoverRow(row, i, $event)\"\n (mouseout)=\"table?.config?.rowHover && _hoverRow(null, null, $event)\"\n [class.gt-hover]=\"(rowHover$ | async)?.index === 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].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 (click)=\"table?.config?.rowClick && _rowClick(row, i, $event)\"\n (mouseover)=\"table?.config?.rowHover && _hoverRow(row, i, $event)\"\n (mouseout)=\"\n table?.config?.rowHover && _hoverRow(null, null, $event)\n \"\n [class.gt-hover]=\"(rowHover$ | async)?.index === i\"\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\n #highlighted\n let-row=\"row\"\n let-column=\"column\"\n let-search=\"search\"\n let-transform=\"transform\"\n>\n <div\n *ngIf=\"!transform\"\n [innerHTML]=\"row[column.key] | highlight: search\"\n ></div>\n <div\n *ngIf=\"transform\"\n [innerHTML]=\"\n row[column.key]\n | dynamicPipe: transform.pipe:transform?.args\n | highlight: search\n \"\n ></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 #transformFooter let-value=\"value\" let-transform=\"transform\">\n {{\n (value | dynamicPipe: transform.pipe:transform?.args) ||\n (tableConfig$ | async)?.footer?.emptyContent\n }}\n</ng-template>\n<ng-template #rawFooter let-value=\"value\">\n {{ value || (tableConfig$ | async)?.footer?.emptyContent }}\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", dependencies: [{ kind: "pipe", type: CapitalCasePipe, name: "capitalCase" }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: SortClassPipe, name: "sortClass" }, { kind: "pipe", type: DashCasePipe, name: "dashCase" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SlicePipe, name: "slice" }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }, { kind: "pipe", type: HighlightPipe, name: "highlight" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CoreComponent, decorators: [{
|
|
356
441
|
type: Component,
|
|
357
|
-
args: [{ selector: 'angular-generic-table', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
442
|
+
args: [{ selector: 'angular-generic-table', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
443
|
+
CapitalCasePipe,
|
|
444
|
+
KeyValuePipe,
|
|
445
|
+
SortClassPipe,
|
|
446
|
+
DashCasePipe,
|
|
447
|
+
AsyncPipe,
|
|
448
|
+
NgTemplateOutlet,
|
|
449
|
+
SlicePipe,
|
|
450
|
+
DynamicPipe,
|
|
451
|
+
HighlightPipe,
|
|
452
|
+
NgClass,
|
|
453
|
+
NgIf,
|
|
454
|
+
NgForOf,
|
|
455
|
+
], 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].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 <tfoot *ngIf=\"(table$ | async)! as table\">\n <ng-container *ngIf=\"table.data.length > 0 && !(loading$ | async)\">\n <ng-container *ngIf=\"(calculations$ | async)! as calculations\">\n <tr\n *ngFor=\"let calculation of calculations.calculations; let i = index\"\n >\n <ng-container\n *ngIf=\"{\n showHeader: (colspan$ | async) !== (footerColspan$ | async)\n } as footerRow\"\n >\n <th\n *ngIf=\"footerRow.showHeader\"\n [colSpan]=\"\n ((colspan$ | async) || 0) - ((footerColspan$ | async) || 0)\n \"\n scope=\"row\"\n >\n <ng-container\n *ngIf=\"table.config?.footer?.headers?.[calculation] as showHeader\"\n >{{showHeader === true ? (calculation | capitalCase): table.config.footer?.headers?.[calculation]}}\n </ng-container>\n </th>\n <ng-container\n *ngFor=\"\n let column of table.config?.columns | keyvalue: columnOrder\n \"\n >\n <td\n *ngIf=\"\n !column.value?.hidden && calculations.calculated[column.key]\n \"\n ngClass=\"{{ (column.key | dashCase) + '-column' }} {{\n column.value.class\n }}\"\n [attr.data-header]=\"\n !footerRow.showHeader && table.config.footer?.headers?.[calculation]\n ? table.config.footer?.headers?.[calculation] === true ? (calculation | capitalCase) : table.config.footer?.headers?.[calculation]\n : null\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"\n (table.config.columns || {})[column.key].transform\n ? transformFooter\n : rawFooter\n \"\n [ngTemplateOutletContext]=\"{\n value: calculations.calculated[column.key][calculation],\n transform: (table.config.columns || {})[column.key]\n .transform\n }\"\n ></ng-container>\n </td>\n </ng-container>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </tfoot>\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 (click)=\"table?.config?.rowClick && _rowClick(row, i, $event)\"\n (mouseover)=\"table?.config?.rowHover && _hoverRow(row, i, $event)\"\n (mouseout)=\"table?.config?.rowHover && _hoverRow(null, null, $event)\"\n [class.gt-hover]=\"(rowHover$ | async)?.index === 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].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 (click)=\"table?.config?.rowClick && _rowClick(row, i, $event)\"\n (mouseover)=\"table?.config?.rowHover && _hoverRow(row, i, $event)\"\n (mouseout)=\"\n table?.config?.rowHover && _hoverRow(null, null, $event)\n \"\n [class.gt-hover]=\"(rowHover$ | async)?.index === i\"\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\n #highlighted\n let-row=\"row\"\n let-column=\"column\"\n let-search=\"search\"\n let-transform=\"transform\"\n>\n <div\n *ngIf=\"!transform\"\n [innerHTML]=\"row[column.key] | highlight: search\"\n ></div>\n <div\n *ngIf=\"transform\"\n [innerHTML]=\"\n row[column.key]\n | dynamicPipe: transform.pipe:transform?.args\n | highlight: search\n \"\n ></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 #transformFooter let-value=\"value\" let-transform=\"transform\">\n {{\n (value | dynamicPipe: transform.pipe:transform?.args) ||\n (tableConfig$ | async)?.footer?.emptyContent\n }}\n</ng-template>\n<ng-template #rawFooter let-value=\"value\">\n {{ value || (tableConfig$ | async)?.footer?.emptyContent }}\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" }]
|
|
358
456
|
}], propDecorators: { loading: [{
|
|
359
457
|
type: Input
|
|
360
458
|
}], page: [{
|
|
@@ -383,80 +481,102 @@ class GtDeltaComponent {
|
|
|
383
481
|
negative: 'text-danger',
|
|
384
482
|
};
|
|
385
483
|
this.key = 'value';
|
|
386
|
-
this.notApplicableValue =
|
|
387
|
-
this.initialValue =
|
|
484
|
+
this.notApplicableValue = null;
|
|
485
|
+
this.initialValue = null;
|
|
388
486
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
487
|
+
get value() {
|
|
488
|
+
return this._value;
|
|
489
|
+
}
|
|
490
|
+
set value(value) {
|
|
491
|
+
this._value = value;
|
|
492
|
+
}
|
|
493
|
+
get deltaTemplate() {
|
|
494
|
+
return this._deltaTemplate;
|
|
495
|
+
}
|
|
496
|
+
set deltaTemplate(deltaTemplate) {
|
|
497
|
+
this._deltaTemplate = deltaTemplate;
|
|
498
|
+
}
|
|
499
|
+
ngOnChanges(changes) {
|
|
500
|
+
if (!changes.data.currentValue) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const data = changes.data?.currentValue;
|
|
504
|
+
const index = changes.index?.currentValue || this.index;
|
|
505
|
+
const baseIndex = changes.baseIndex?.currentValue;
|
|
506
|
+
const key = changes.key?.currentValue || this.key;
|
|
507
|
+
const initialValue = changes.initialValue?.currentValue || this.initialValue;
|
|
508
|
+
const deltaValue = index === 0
|
|
509
|
+
? initialValue
|
|
510
|
+
: data[index][key] -
|
|
511
|
+
(baseIndex === undefined
|
|
512
|
+
? data[index - 1][key]
|
|
513
|
+
: data[baseIndex][key]);
|
|
514
|
+
const baseValue = index === 0
|
|
515
|
+
? 1
|
|
516
|
+
: baseIndex === undefined
|
|
402
517
|
? data[index - 1][key]
|
|
403
|
-
: data[baseIndex][key]
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
518
|
+
: data[baseIndex][key];
|
|
519
|
+
const relative = index === 0
|
|
520
|
+
? initialValue
|
|
521
|
+
: Math.sign(deltaValue) * Math.abs(deltaValue / baseValue);
|
|
522
|
+
this.value = {
|
|
523
|
+
relative: Number.isFinite(relative)
|
|
524
|
+
? relative
|
|
525
|
+
: index === 0
|
|
526
|
+
? initialValue
|
|
527
|
+
: changes.notApplicableValue?.currentValue || this.notApplicableValue,
|
|
528
|
+
absolute: deltaValue,
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
GtDeltaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GtDeltaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
533
|
+
GtDeltaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: GtDeltaComponent, isStandalone: true, selector: "gt-delta", inputs: { deltaTemplate: "deltaTemplate", data: "data", index: "index", baseIndex: "baseIndex", classes: "classes", key: "key", notApplicableValue: "notApplicableValue", initialValue: "initialValue" }, usesOnChanges: true, ngImport: i0, template: `<span
|
|
534
|
+
*ngIf="value as delta"
|
|
535
|
+
[class]="[
|
|
536
|
+
classes.span,
|
|
537
|
+
delta.absolute > 0
|
|
538
|
+
? classes.positive
|
|
539
|
+
: delta.absolute < 0
|
|
540
|
+
? classes.negative
|
|
541
|
+
: null
|
|
542
|
+
]"
|
|
543
|
+
[class.gt-delta-positive]="delta.absolute > 0"
|
|
544
|
+
[class.gt-delta-negative]="delta.absolute < 0"
|
|
545
|
+
><ng-container
|
|
546
|
+
*ngTemplateOutlet="deltaTemplate || defaultTemplate; context: { delta }"
|
|
547
|
+
></ng-container>
|
|
548
|
+
</span>
|
|
549
|
+
<ng-template #defaultTemplate let-delta="delta">
|
|
550
|
+
<span *ngIf="delta.relative">{{
|
|
551
|
+
delta.relative | percent: '1.0-2'
|
|
552
|
+
}}</span>
|
|
553
|
+
</ng-template>`, isInline: true, styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "pipe", type: PercentPipe, name: "percent" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GtDeltaComponent, decorators: [{
|
|
425
555
|
type: Component,
|
|
426
556
|
args: [{ selector: 'gt-delta', template: `<span
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
:
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
[class.gt-delta-negative]="delta.value < 0"
|
|
451
|
-
>{{
|
|
452
|
-
Number.isFinite(delta.value)
|
|
453
|
-
? (delta.value | percent)
|
|
454
|
-
: delta.value === initialValue
|
|
455
|
-
? initialValue
|
|
456
|
-
: notApplicableValue
|
|
457
|
-
}}</span
|
|
458
|
-
>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block}\n"] }]
|
|
459
|
-
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
557
|
+
*ngIf="value as delta"
|
|
558
|
+
[class]="[
|
|
559
|
+
classes.span,
|
|
560
|
+
delta.absolute > 0
|
|
561
|
+
? classes.positive
|
|
562
|
+
: delta.absolute < 0
|
|
563
|
+
? classes.negative
|
|
564
|
+
: null
|
|
565
|
+
]"
|
|
566
|
+
[class.gt-delta-positive]="delta.absolute > 0"
|
|
567
|
+
[class.gt-delta-negative]="delta.absolute < 0"
|
|
568
|
+
><ng-container
|
|
569
|
+
*ngTemplateOutlet="deltaTemplate || defaultTemplate; context: { delta }"
|
|
570
|
+
></ng-container>
|
|
571
|
+
</span>
|
|
572
|
+
<ng-template #defaultTemplate let-delta="delta">
|
|
573
|
+
<span *ngIf="delta.relative">{{
|
|
574
|
+
delta.relative | percent: '1.0-2'
|
|
575
|
+
}}</span>
|
|
576
|
+
</ng-template>`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [PercentPipe, NgIf, NgTemplateOutlet], styles: [":host{display:inline-block}\n"] }]
|
|
577
|
+
}], ctorParameters: function () { return []; }, propDecorators: { deltaTemplate: [{
|
|
578
|
+
type: Input
|
|
579
|
+
}], data: [{
|
|
460
580
|
type: Input
|
|
461
581
|
}], index: [{
|
|
462
582
|
type: Input
|
|
@@ -474,20 +594,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
474
594
|
|
|
475
595
|
class GenericTableCoreModule {
|
|
476
596
|
}
|
|
477
|
-
GenericTableCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
478
|
-
GenericTableCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
|
|
597
|
+
GenericTableCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GenericTableCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
598
|
+
GenericTableCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: GenericTableCoreModule, imports: [CommonModule,
|
|
599
|
+
CoreComponent,
|
|
479
600
|
SortClassPipe,
|
|
480
601
|
DashCasePipe,
|
|
481
602
|
HighlightPipe,
|
|
482
603
|
CapitalCasePipe,
|
|
483
604
|
CapitalCasePipe,
|
|
484
605
|
DynamicPipe,
|
|
485
|
-
GtDeltaComponent],
|
|
486
|
-
GenericTableCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
|
|
487
|
-
|
|
606
|
+
GtDeltaComponent], exports: [CoreComponent, GtDeltaComponent] });
|
|
607
|
+
GenericTableCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GenericTableCoreModule, imports: [CommonModule,
|
|
608
|
+
CoreComponent,
|
|
609
|
+
GtDeltaComponent] });
|
|
610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GenericTableCoreModule, decorators: [{
|
|
488
611
|
type: NgModule,
|
|
489
612
|
args: [{
|
|
490
|
-
|
|
613
|
+
imports: [
|
|
614
|
+
CommonModule,
|
|
491
615
|
CoreComponent,
|
|
492
616
|
SortClassPipe,
|
|
493
617
|
DashCasePipe,
|
|
@@ -497,7 +621,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
497
621
|
DynamicPipe,
|
|
498
622
|
GtDeltaComponent,
|
|
499
623
|
],
|
|
500
|
-
imports: [CommonModule],
|
|
501
624
|
exports: [CoreComponent, GtDeltaComponent],
|
|
502
625
|
}]
|
|
503
626
|
}] });
|
|
@@ -580,11 +703,11 @@ class PaginationComponent {
|
|
|
580
703
|
}
|
|
581
704
|
}
|
|
582
705
|
}
|
|
583
|
-
PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
584
|
-
PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.
|
|
585
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
706
|
+
PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
707
|
+
PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: PaginationComponent, isStandalone: true, 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", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
708
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
586
709
|
type: Component,
|
|
587
|
-
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
|
|
710
|
+
args: [{ selector: 'angular-generic-table-pagination', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [AsyncPipe, NgIf, NgForOf], 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" }]
|
|
588
711
|
}], propDecorators: { paginationLength: [{
|
|
589
712
|
type: Input
|
|
590
713
|
}], classes: [{
|
|
@@ -597,14 +720,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImpor
|
|
|
597
720
|
|
|
598
721
|
class GenericTablePaginationModule {
|
|
599
722
|
}
|
|
600
|
-
GenericTablePaginationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
601
|
-
GenericTablePaginationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
|
|
602
|
-
GenericTablePaginationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
|
|
603
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
723
|
+
GenericTablePaginationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GenericTablePaginationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
724
|
+
GenericTablePaginationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: GenericTablePaginationModule, imports: [CommonModule, PaginationComponent], exports: [PaginationComponent] });
|
|
725
|
+
GenericTablePaginationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GenericTablePaginationModule, imports: [CommonModule, PaginationComponent] });
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: GenericTablePaginationModule, decorators: [{
|
|
604
727
|
type: NgModule,
|
|
605
728
|
args: [{
|
|
606
|
-
|
|
607
|
-
imports: [CommonModule],
|
|
729
|
+
imports: [CommonModule, PaginationComponent],
|
|
608
730
|
exports: [PaginationComponent],
|
|
609
731
|
}]
|
|
610
732
|
}] });
|