@one-paragon/angular-utilities 2.0.7-beta.1 → 2.0.7
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/fesm2022/one-paragon-angular-utilities.mjs +430 -533
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/package.json +1 -1
- package/table-builder/classes/table-builder-general-settings.d.ts +9 -16
- package/table-builder/classes/table-builder.d.ts +9 -14
- package/table-builder/classes/table-store.d.ts +0 -2
- package/table-builder/components/column-builder/column-builder.component.d.ts +1 -1
- package/table-builder/components/generic-table/generic-table.component.d.ts +1 -2
- package/table-builder/components/reset-menu/reset-menu.component.d.ts +1 -1
- package/table-builder/components/scroll-strategy.d.ts +10 -25
- package/table-builder/components/table-container/table-container.d.ts +20 -44
- package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +2 -3
- package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +3 -10
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +8 -5
- package/table-builder/directives/tb-filter.directive.d.ts +1 -4
- package/table-builder/functions/sort-data-function.d.ts +1 -0
- package/table-builder/services/transform-creator.d.ts +12 -4
- package/table-builder/table-builder.module.d.ts +13 -6
- package/utilities/pipes/phone.pipe.d.ts +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, input, signal, Renderer2, ElementRef, booleanAttribute,
|
|
3
|
-
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
|
2
|
+
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, Pipe, input, signal, Renderer2, ElementRef, booleanAttribute, InjectionToken, makeEnvironmentProviders, Component, ChangeDetectionStrategy, HostListener, EventEmitter, untracked, Output, ContentChildren, ChangeDetectorRef, output, ViewChild, EnvironmentInjector, createComponent, viewChild, linkedSignal, effect, contentChild, forwardRef, contentChildren, model, runInInjectionContext, provideAppInitializer } from '@angular/core';
|
|
3
|
+
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, observeOn, debounceTime, scan as scan$1, timestamp as timestamp$1, first as first$1 } from 'rxjs/operators';
|
|
4
4
|
import * as i1 from 'rxjs';
|
|
5
|
-
import { Subject, isObservable, of, ReplaySubject, filter as filter$1, first, map as map$1, Observable, combineLatest, Subscription, startWith as startWith$1, pairwise, concatMap, merge, delay, fromEvent, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, timestamp } from 'rxjs';
|
|
5
|
+
import { Subject, isObservable, of, ReplaySubject, filter as filter$1, first, map as map$1, Observable, combineLatest, Subscription, startWith as startWith$1, pairwise, concatMap, merge, delay, fromEvent, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, timestamp, animationFrameScheduler, debounceTime as debounceTime$1, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import { ComponentStore } from '@ngrx/component-store';
|
|
7
7
|
import { toObservable, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { DatePipe, CurrencyPipe, KeyValuePipe, NgTemplateOutlet, DecimalPipe, CommonModule, AsyncPipe } from '@angular/common';
|
|
8
9
|
import * as i3$2 from '@angular/material/sort';
|
|
9
10
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
10
11
|
import { merge as merge$1, get, sumBy, difference, intersection, groupBy, orderBy, set, isFunction as isFunction$1 } from 'lodash';
|
|
@@ -19,10 +20,11 @@ import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
|
|
|
19
20
|
import * as i3 from '@angular/forms';
|
|
20
21
|
import { NgControl, FormsModule, ControlContainer, NgForm, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
21
22
|
import * as i9 from '@angular/material/core';
|
|
22
|
-
import { MatOption } from '@angular/material/core';
|
|
23
|
-
import { DatePipe, CurrencyPipe, KeyValuePipe, NgTemplateOutlet, formatDate, formatCurrency, DecimalPipe, CommonModule, AsyncPipe } from '@angular/common';
|
|
23
|
+
import { MatOption, MatNativeDateModule } from '@angular/material/core';
|
|
24
24
|
import * as i5 from '@angular/cdk/drag-drop';
|
|
25
25
|
import { moveItemInArray, DragDropModule, CDK_DROP_LIST, CdkDropList, transferArrayItem } from '@angular/cdk/drag-drop';
|
|
26
|
+
import * as i1$5 from '@angular/router';
|
|
27
|
+
import { RouterModule } from '@angular/router';
|
|
26
28
|
import * as i1$1 from '@angular/material/input';
|
|
27
29
|
import { MatInputModule, MatInput } from '@angular/material/input';
|
|
28
30
|
import * as i4 from '@angular/material/datepicker';
|
|
@@ -30,7 +32,7 @@ import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
|
30
32
|
import * as i6 from '@angular/material/form-field';
|
|
31
33
|
import * as i1$3 from '@angular/material/card';
|
|
32
34
|
import { MatCardModule } from '@angular/material/card';
|
|
33
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
35
|
+
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
34
36
|
import * as i3$1 from '@angular/material/button';
|
|
35
37
|
import { MatButtonModule, MatIconButton, MatButton } from '@angular/material/button';
|
|
36
38
|
import * as i4$1 from '@angular/material/tooltip';
|
|
@@ -46,8 +48,6 @@ import { MatChipsModule } from '@angular/material/chips';
|
|
|
46
48
|
import * as i1$6 from '@angular/material/table';
|
|
47
49
|
import { MatTable, MatColumnDef, MatTableModule, MatHeaderRowDef, MatFooterRowDef, MatTableDataSource, MatRowDef } from '@angular/material/table';
|
|
48
50
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
49
|
-
import * as i1$5 from '@angular/router';
|
|
50
|
-
import { RouterModule } from '@angular/router';
|
|
51
51
|
import * as i1$7 from '@angular/material/paginator';
|
|
52
52
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
53
53
|
import * as i1$8 from '@angular/cdk/scrolling';
|
|
@@ -683,6 +683,34 @@ function getDestroyRef(options) {
|
|
|
683
683
|
return destroyRef;
|
|
684
684
|
}
|
|
685
685
|
|
|
686
|
+
class SpaceCasePipe {
|
|
687
|
+
transform(value) {
|
|
688
|
+
return spaceCase(value);
|
|
689
|
+
}
|
|
690
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
691
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, isStandalone: true, name: "spaceCase" });
|
|
692
|
+
}
|
|
693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, decorators: [{
|
|
694
|
+
type: Pipe,
|
|
695
|
+
args: [{ name: 'spaceCase' }]
|
|
696
|
+
}] });
|
|
697
|
+
/**
|
|
698
|
+
* Adds a space before uppercase letters that either
|
|
699
|
+
* 1. follows a lowercase letter or digit
|
|
700
|
+
* 2. or precedes a lowercase letter and follows an alpha-numeric character
|
|
701
|
+
*
|
|
702
|
+
* Uppercases the first digit
|
|
703
|
+
*
|
|
704
|
+
* Turns underscores into spaces
|
|
705
|
+
*/
|
|
706
|
+
function spaceCase(value) {
|
|
707
|
+
const phrase = value?.replace(regex1, '$1$3 $2$4');
|
|
708
|
+
// uppercase the first character of every word
|
|
709
|
+
return phrase?.replace(regex2, x => x.toUpperCase());
|
|
710
|
+
}
|
|
711
|
+
const regex1 = /([a-z0-9])([A-Z])|([a-zA-Z0-9])([A-Z])(?=[a-z])|_/g;
|
|
712
|
+
const regex2 = /(^| )(\w)/g;
|
|
713
|
+
|
|
686
714
|
var FieldType;
|
|
687
715
|
(function (FieldType) {
|
|
688
716
|
FieldType[FieldType["Unknown"] = 0] = "Unknown";
|
|
@@ -737,8 +765,8 @@ class GeneralTableSettings {
|
|
|
737
765
|
headerSettings = new TableWrapperHeaderSettings();
|
|
738
766
|
footerSettings = new TableWrapperFooterSettings();
|
|
739
767
|
columnHeaderSettings = new TableColumnHeaderSettings();
|
|
740
|
-
columnFooterSettings = new TableColumnFooterSettings();
|
|
741
768
|
tableSettings = new TableSettings();
|
|
769
|
+
injector;
|
|
742
770
|
}
|
|
743
771
|
class TableWrapperHeaderSettings {
|
|
744
772
|
hideExport = false;
|
|
@@ -754,18 +782,10 @@ class TableWrapperFooterSettings {
|
|
|
754
782
|
collapse = false;
|
|
755
783
|
}
|
|
756
784
|
class TableColumnHeaderSettings {
|
|
757
|
-
stickyHeaderRow = true;
|
|
758
785
|
noFilters = false;
|
|
759
786
|
noHeader = false;
|
|
760
787
|
}
|
|
761
|
-
class TableColumnFooterSettings {
|
|
762
|
-
stickyFooterRow = false;
|
|
763
|
-
}
|
|
764
788
|
class TableSettings {
|
|
765
|
-
tableId = undefined;
|
|
766
|
-
trackBy = undefined;
|
|
767
|
-
includeIndexColumn = false;
|
|
768
|
-
includeSelectionColumn = false;
|
|
769
789
|
usePaginator = undefined;
|
|
770
790
|
useVirtualScroll = undefined;
|
|
771
791
|
paginatorSettings = undefined;
|
|
@@ -1166,7 +1186,6 @@ class TableFilterDirective {
|
|
|
1166
1186
|
this.filterValue = undefined;
|
|
1167
1187
|
}
|
|
1168
1188
|
filter$ = new ReplaySubject(1);
|
|
1169
|
-
$filter = toSignal(this.filter$);
|
|
1170
1189
|
filterType;
|
|
1171
1190
|
key;
|
|
1172
1191
|
fieldType;
|
|
@@ -1276,7 +1295,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
1276
1295
|
}], ctorParameters: () => [] });
|
|
1277
1296
|
class TableCustomFilterDirectiveBase extends TableCustomFilterDirective {
|
|
1278
1297
|
filter$ = new ReplaySubject(1);
|
|
1279
|
-
$filter = toSignal(this.filter$);
|
|
1280
1298
|
filter;
|
|
1281
1299
|
_predicate;
|
|
1282
1300
|
set predicate(val) {
|
|
@@ -1508,7 +1526,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
1508
1526
|
|
|
1509
1527
|
class PhoneNumberPipe {
|
|
1510
1528
|
transform(phoneNum) {
|
|
1511
|
-
|
|
1529
|
+
if (phoneNum) {
|
|
1530
|
+
phoneNum = phoneNum.replace(/\D/g, '');
|
|
1531
|
+
if (phoneNum[0] === '1') {
|
|
1532
|
+
phoneNum = phoneNum.substring(1);
|
|
1533
|
+
}
|
|
1534
|
+
return '(' + phoneNum.slice(0, 3) + ') ' + phoneNum.slice(3, 6) + '-' + phoneNum.slice(6, 10) + ' ' + phoneNum.slice(10);
|
|
1535
|
+
}
|
|
1512
1536
|
}
|
|
1513
1537
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PhoneNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1514
1538
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: PhoneNumberPipe, isStandalone: true, name: "phone" });
|
|
@@ -1517,44 +1541,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
1517
1541
|
type: Pipe,
|
|
1518
1542
|
args: [{ name: 'phone' }]
|
|
1519
1543
|
}] });
|
|
1520
|
-
function phoneFormatter(phoneNum) {
|
|
1521
|
-
if (phoneNum) {
|
|
1522
|
-
phoneNum = phoneNum.replace(/\D/g, '');
|
|
1523
|
-
if (phoneNum[0] === '1') {
|
|
1524
|
-
phoneNum = phoneNum.substring(1);
|
|
1525
|
-
}
|
|
1526
|
-
return '(' + phoneNum.slice(0, 3) + ') ' + phoneNum.slice(3, 6) + '-' + phoneNum.slice(6, 10) + ' ' + phoneNum.slice(10);
|
|
1527
|
-
}
|
|
1528
|
-
return '';
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
class SpaceCasePipe {
|
|
1532
|
-
transform(value) {
|
|
1533
|
-
return spaceCase(value);
|
|
1534
|
-
}
|
|
1535
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1536
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, isStandalone: true, name: "spaceCase" });
|
|
1537
|
-
}
|
|
1538
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, decorators: [{
|
|
1539
|
-
type: Pipe,
|
|
1540
|
-
args: [{ name: 'spaceCase' }]
|
|
1541
|
-
}] });
|
|
1542
|
-
/**
|
|
1543
|
-
* Adds a space before uppercase letters that either
|
|
1544
|
-
* 1. follows a lowercase letter or digit
|
|
1545
|
-
* 2. or precedes a lowercase letter and follows an alpha-numeric character
|
|
1546
|
-
*
|
|
1547
|
-
* Uppercases the first digit
|
|
1548
|
-
*
|
|
1549
|
-
* Turns underscores into spaces
|
|
1550
|
-
*/
|
|
1551
|
-
function spaceCase(value) {
|
|
1552
|
-
const phrase = value?.replace(regex1, '$1$3 $2$4');
|
|
1553
|
-
// uppercase the first character of every word
|
|
1554
|
-
return phrase?.replace(regex2, x => x.toUpperCase());
|
|
1555
|
-
}
|
|
1556
|
-
const regex1 = /([a-z0-9])([A-Z])|([a-zA-Z0-9])([A-Z])(?=[a-z])|_/g;
|
|
1557
|
-
const regex2 = /(^| )(\w)/g;
|
|
1558
1544
|
|
|
1559
1545
|
const defaultConfig = {
|
|
1560
1546
|
defaultTableSettings: {
|
|
@@ -1928,8 +1914,8 @@ class TableStore extends ComponentStore {
|
|
|
1928
1914
|
equal: sortsAreSame
|
|
1929
1915
|
});
|
|
1930
1916
|
selectSorted$ = this.select(state => state.sorted).pipe(distinctUntilChanged(sortsAreSame));
|
|
1931
|
-
$
|
|
1932
|
-
|
|
1917
|
+
sort$ = this.select(state => state.initializationState).pipe(filter(i => i === InitializationState.Ready))
|
|
1918
|
+
.pipe(switchMap(() => this.selectSorted$));
|
|
1933
1919
|
$getUserDefinedTableWidth = this.selectSignal(state => state.userDefined.table.width);
|
|
1934
1920
|
getUserDefinedTableWidth$ = this.select(state => state.userDefined.table.width);
|
|
1935
1921
|
$userDefinedRowHeight = this.selectSignal(state => (state.userDefined.rowHeight));
|
|
@@ -1948,11 +1934,6 @@ class TableStore extends ComponentStore {
|
|
|
1948
1934
|
const bb = b.flatMap(g => g.expandedHeaders);
|
|
1949
1935
|
return aa.length === bb.length && aa.every((k) => bb.includes(k));
|
|
1950
1936
|
}));
|
|
1951
|
-
$expandGroups = this.selectSignal(state => state.groupBy, { equal: (a, b) => {
|
|
1952
|
-
const aa = a.flatMap(g => g.expandedHeaders);
|
|
1953
|
-
const bb = b.flatMap(g => g.expandedHeaders);
|
|
1954
|
-
return aa.length === bb.length && aa.every((k) => bb.includes(k));
|
|
1955
|
-
} });
|
|
1956
1937
|
$getIsExpanded = (columnKey, groupHeaderKey) => {
|
|
1957
1938
|
return this.selectSignal(state => !!state.groupBy.filter(g => g.key === columnKey && g.expandedHeaders.includes(groupHeaderKey)).length);
|
|
1958
1939
|
};
|
|
@@ -2037,7 +2018,7 @@ class TableStore extends ComponentStore {
|
|
|
2037
2018
|
updateStateFunc = (state, incomingTableState) => {
|
|
2038
2019
|
const metaData = state.metaData;
|
|
2039
2020
|
const sorted = incomingTableState.sorted?.length ? incomingTableState.sorted
|
|
2040
|
-
: state.initializationState <= InitializationState.Created ?
|
|
2021
|
+
: state.initializationState <= InitializationState.Created ? createPreSort(metaData) : state.sorted;
|
|
2041
2022
|
return { ...state, ...incomingTableState, metaData, sorted };
|
|
2042
2023
|
};
|
|
2043
2024
|
setTableSettings = this.updater((state, settings) => {
|
|
@@ -2063,7 +2044,7 @@ class TableStore extends ComponentStore {
|
|
|
2063
2044
|
return prev;
|
|
2064
2045
|
}, {});
|
|
2065
2046
|
const sortedInitialized = state.sorted.length > 0;
|
|
2066
|
-
const sorted = sortedInitialized ? state.sorted :
|
|
2047
|
+
const sorted = sortedInitialized ? state.sorted : createPreSort(metaData);
|
|
2067
2048
|
const order = initializeOrder(state, metaData);
|
|
2068
2049
|
const initializationState = state.initializationState == InitializationState.Created ? InitializationState.MetaDataLoaded : state.initializationState;
|
|
2069
2050
|
return { ...state, initializationState, metaData, sorted, userDefined: { ...state.userDefined, order: order } };
|
|
@@ -3179,92 +3160,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
3179
3160
|
function isPipe(o) {
|
|
3180
3161
|
return typeof (o.transform) === 'function';
|
|
3181
3162
|
}
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
return (value) => transformer(defaultFunc(value));
|
|
3204
|
-
}
|
|
3205
|
-
const defaultDateFormat = config.dateFormats?.dateFormat ?? 'shortDate';
|
|
3206
|
-
const defaultDateTimeFormat = config.dateFormats?.dateTimeFormat ?? 'short';
|
|
3207
|
-
switch (metaData.fieldType) {
|
|
3208
|
-
case FieldType.Date:
|
|
3209
|
-
const dateFormat = metaData.additional?.dateFormat ?? defaultDateFormat;
|
|
3210
|
-
return (value) => dateFormatter(defaultFunc(value), dateFormat);
|
|
3211
|
-
case FieldType.DateTime:
|
|
3212
|
-
const dateTimeFormat = metaData.additional?.dateTimeOptions?.format ?? defaultDateTimeFormat;
|
|
3213
|
-
return (value) => dateFormatter(defaultFunc(value), dateTimeFormat);
|
|
3214
|
-
case FieldType.Currency:
|
|
3215
|
-
return (value) => currencyFormatter(defaultFunc(value));
|
|
3216
|
-
case FieldType.PhoneNumber:
|
|
3217
|
-
return (value) => phoneFormatter(defaultFunc(value));
|
|
3218
|
-
case FieldType.Enum:
|
|
3219
|
-
return (value) => spaceCase(metaData.additional?.enumMap[defaultFunc(value)]);
|
|
3220
|
-
case FieldType.Boolean:
|
|
3221
|
-
if (noIcons) {
|
|
3222
|
-
return defaultFunc;
|
|
3223
|
-
}
|
|
3224
|
-
let forTrue = 'check';
|
|
3225
|
-
let forFalse = '';
|
|
3226
|
-
if (metaData.additional?.boolean?.forTrue) {
|
|
3227
|
-
forTrue = metaData?.additional.boolean.forTrue.icon;
|
|
3228
|
-
}
|
|
3229
|
-
if (metaData.additional?.boolean?.showForFalse === true) {
|
|
3230
|
-
forFalse = 'clear';
|
|
3231
|
-
}
|
|
3232
|
-
else if (metaData.additional?.boolean?.showForFalse?.icon) {
|
|
3233
|
-
forFalse = metaData.additional?.boolean?.showForFalse?.icon;
|
|
3163
|
+
class TransformCreator {
|
|
3164
|
+
datePipe = inject(DatePipe);
|
|
3165
|
+
currencyPipe = inject(CurrencyPipe);
|
|
3166
|
+
phonePipe = inject(PhoneNumberPipe);
|
|
3167
|
+
config = inject(TableBuilderConfigToken);
|
|
3168
|
+
createTransformer(metaData, noIcons = false, forItem = false) {
|
|
3169
|
+
const nested = metaData.key.includes('.');
|
|
3170
|
+
const defaultFunc = nested ? (value) => get(value, metaData.key) : (value) => value[metaData.key];
|
|
3171
|
+
if (metaData.map && !forItem) {
|
|
3172
|
+
return (value) => {
|
|
3173
|
+
return metaData.map(value);
|
|
3174
|
+
};
|
|
3175
|
+
}
|
|
3176
|
+
if (metaData.mapItem) {
|
|
3177
|
+
return (value) => {
|
|
3178
|
+
return metaData.mapItem(defaultFunc(value));
|
|
3179
|
+
};
|
|
3180
|
+
}
|
|
3181
|
+
if (metaData.transform) {
|
|
3182
|
+
if (isPipe(metaData.transform)) {
|
|
3183
|
+
return (value) => metaData.transform.transform(defaultFunc(value));
|
|
3234
3184
|
}
|
|
3235
|
-
return (value) => defaultFunc(value)
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3185
|
+
return metaData.fieldType === FieldType.Expression ? metaData.transform : (value) => metaData.transform(defaultFunc(value), value);
|
|
3186
|
+
}
|
|
3187
|
+
if (this.config.transformers && this.config.transformers[metaData.fieldType]) {
|
|
3188
|
+
var transformer = this.config.transformers[metaData.fieldType];
|
|
3189
|
+
return (value) => transformer(defaultFunc(value));
|
|
3190
|
+
}
|
|
3191
|
+
const defaultDateFormat = this.config.dateFormats?.dateFormat ?? 'shortDate';
|
|
3192
|
+
const defaultDateTimeFormat = this.config.dateFormats?.dateTimeFormat ?? 'short';
|
|
3193
|
+
switch (metaData.fieldType) {
|
|
3194
|
+
case FieldType.Date:
|
|
3195
|
+
const dateFormat = metaData.additional?.dateFormat ?? defaultDateFormat;
|
|
3196
|
+
return (value) => this.datePipe.transform(defaultFunc(value), dateFormat);
|
|
3197
|
+
case FieldType.DateTime:
|
|
3198
|
+
const dateTimeFormat = metaData.additional?.dateTimeOptions?.format ?? defaultDateTimeFormat;
|
|
3199
|
+
return (value) => this.datePipe.transform(defaultFunc(value), dateTimeFormat);
|
|
3200
|
+
case FieldType.Currency:
|
|
3201
|
+
return (value) => this.currencyPipe.transform(defaultFunc(value));
|
|
3202
|
+
case FieldType.PhoneNumber:
|
|
3203
|
+
return (value) => this.phonePipe.transform(defaultFunc(value));
|
|
3204
|
+
case FieldType.Enum:
|
|
3205
|
+
return (value) => spaceCase(metaData.additional?.enumMap[defaultFunc(value)]);
|
|
3206
|
+
case FieldType.Boolean:
|
|
3207
|
+
if (noIcons) {
|
|
3208
|
+
return defaultFunc;
|
|
3209
|
+
}
|
|
3210
|
+
let forTrue = 'check';
|
|
3211
|
+
let forFalse = '';
|
|
3212
|
+
if (metaData.additional?.boolean?.forTrue) {
|
|
3213
|
+
forTrue = metaData?.additional.boolean.forTrue.icon;
|
|
3214
|
+
}
|
|
3215
|
+
if (metaData.additional?.boolean?.showForFalse === true) {
|
|
3216
|
+
forFalse = 'clear';
|
|
3217
|
+
}
|
|
3218
|
+
else if (metaData.additional?.boolean?.showForFalse?.icon) {
|
|
3219
|
+
forFalse = metaData.additional?.boolean?.showForFalse?.icon;
|
|
3220
|
+
}
|
|
3221
|
+
return (value) => defaultFunc(value) ? forTrue : forFalse;
|
|
3244
3222
|
}
|
|
3245
|
-
|
|
3223
|
+
return defaultFunc;
|
|
3224
|
+
}
|
|
3225
|
+
createItemTransformer = (metaData, noIcons = false, mutate = false) => {
|
|
3226
|
+
const transform = this.createTransformer(metaData, noIcons);
|
|
3227
|
+
return (t) => {
|
|
3228
|
+
if (!mutate) {
|
|
3229
|
+
t = { ...t };
|
|
3230
|
+
}
|
|
3231
|
+
t[metaData.key] = transform(t);
|
|
3232
|
+
};
|
|
3246
3233
|
};
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3234
|
+
createItemTransformers = (metaDatas, noIcons = false, mutate = false) => {
|
|
3235
|
+
const transformers = metaDatas.map(meta => this.createItemTransformer(meta, noIcons, true));
|
|
3236
|
+
return (t) => {
|
|
3237
|
+
if (!t)
|
|
3238
|
+
return t;
|
|
3239
|
+
if (!mutate) {
|
|
3240
|
+
t = { ...t };
|
|
3241
|
+
}
|
|
3242
|
+
transformers.forEach(m => m(t));
|
|
3252
3243
|
return t;
|
|
3253
|
-
|
|
3254
|
-
t = { ...t };
|
|
3255
|
-
}
|
|
3256
|
-
transformers.forEach(m => m(t));
|
|
3257
|
-
return t;
|
|
3244
|
+
};
|
|
3258
3245
|
};
|
|
3246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TransformCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3247
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TransformCreator, providedIn: 'root' });
|
|
3259
3248
|
}
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
}
|
|
3265
|
-
|
|
3266
|
-
return formatCurrency(amt, 'en-US', '$');
|
|
3267
|
-
}
|
|
3249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TransformCreator, decorators: [{
|
|
3250
|
+
type: Injectable,
|
|
3251
|
+
args: [{
|
|
3252
|
+
providedIn: 'root',
|
|
3253
|
+
}]
|
|
3254
|
+
}] });
|
|
3268
3255
|
|
|
3269
3256
|
class RouterLinkColumnComponent {
|
|
3270
3257
|
additional = input.required();
|
|
@@ -3528,14 +3515,14 @@ class ColumnHeaderMenuComponent {
|
|
|
3528
3515
|
}
|
|
3529
3516
|
}
|
|
3530
3517
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ColumnHeaderMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3531
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: ColumnHeaderMenuComponent, isStandalone: true, selector: "tb-header-menu", inputs: { $metaData: { classPropertyName: "$metaData", publicName: "metaData", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "$trigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }], ngImport: i0, template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;width:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button.chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"], dependencies: [{ kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: InListFilterComponent, selector: "tb-in-list-filter , [tb-in-list-filter]", inputs: ["key"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3518
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: ColumnHeaderMenuComponent, isStandalone: true, selector: "tb-header-menu", inputs: { $metaData: { classPropertyName: "$metaData", publicName: "metaData", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "$trigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }], ngImport: i0, template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button.chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"], dependencies: [{ kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: InListFilterComponent, selector: "tb-in-list-filter , [tb-in-list-filter]", inputs: ["key"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3532
3519
|
}
|
|
3533
3520
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ColumnHeaderMenuComponent, decorators: [{
|
|
3534
3521
|
type: Component,
|
|
3535
3522
|
args: [{ selector: 'tb-header-menu', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
3536
3523
|
MatMenuModule, MatIconModule, MatButtonModule, FormsModule, InListFilterComponent,
|
|
3537
3524
|
MatInputModule, MatTooltipModule, StopPropagationDirective, MatRadioModule, MatDatepickerModule
|
|
3538
|
-
], template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;
|
|
3525
|
+
], template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button.chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"] }]
|
|
3539
3526
|
}] });
|
|
3540
3527
|
|
|
3541
3528
|
class ColumnTotalPipe {
|
|
@@ -3602,7 +3589,7 @@ const columnsStyles = (metaDatas, userDefinedWidths) => {
|
|
|
3602
3589
|
|
|
3603
3590
|
class ColumnBuilderComponent {
|
|
3604
3591
|
FieldType = FieldType;
|
|
3605
|
-
|
|
3592
|
+
transformCreator = inject(TransformCreator);
|
|
3606
3593
|
table = inject(MatTable);
|
|
3607
3594
|
state = inject(TableStore);
|
|
3608
3595
|
templateService = inject(TableTemplateService);
|
|
@@ -3632,7 +3619,7 @@ class ColumnBuilderComponent {
|
|
|
3632
3619
|
const metaData = this.$metaData();
|
|
3633
3620
|
if (!metaData)
|
|
3634
3621
|
return;
|
|
3635
|
-
return createTransformer(metaData
|
|
3622
|
+
return this.transformCreator.createTransformer(metaData);
|
|
3636
3623
|
});
|
|
3637
3624
|
$innerTemplate = computed(() => {
|
|
3638
3625
|
const metaData = this.$metaData();
|
|
@@ -3763,7 +3750,7 @@ class GenericTableComponent {
|
|
|
3763
3750
|
state = inject(TableStore);
|
|
3764
3751
|
dataStore = inject(DataStore);
|
|
3765
3752
|
viewContainer = inject(ViewContainerRef);
|
|
3766
|
-
|
|
3753
|
+
transformCreator = inject(TransformCreator);
|
|
3767
3754
|
_injector = inject(Injector);
|
|
3768
3755
|
smallFooter = 10;
|
|
3769
3756
|
$headerRow = viewChild(MatHeaderRowDef);
|
|
@@ -3874,9 +3861,8 @@ class GenericTableComponent {
|
|
|
3874
3861
|
});
|
|
3875
3862
|
$usePaginator = computed(() => this.state.$tableSettings().usePaginator);
|
|
3876
3863
|
$useVirtualScroll = computed(() => this.state.$viewType().includes('virtual'));
|
|
3877
|
-
$virtualStart = this.dataStore.selectSignal(d => d.virtualEnds.start);
|
|
3878
3864
|
$offsetIndex = computed(() => {
|
|
3879
|
-
const virtualStart = this
|
|
3865
|
+
const virtualStart = this.dataStore.selectSignal(d => d.virtualEnds.start)();
|
|
3880
3866
|
const pageSize = this.state.$pageSize();
|
|
3881
3867
|
const currentPage = this.state.$currentPage();
|
|
3882
3868
|
if (this.$useVirtualScroll()) {
|
|
@@ -3992,7 +3978,7 @@ class GenericTableComponent {
|
|
|
3992
3978
|
if (val == undefined || val === 'null')
|
|
3993
3979
|
return '';
|
|
3994
3980
|
try {
|
|
3995
|
-
return createTransformer(this.state.$getMetaData(key)(),
|
|
3981
|
+
return this.transformCreator.createTransformer(this.state.$getMetaData(key)(), true, true)({ [`${key}`]: val });
|
|
3996
3982
|
}
|
|
3997
3983
|
catch (error) {
|
|
3998
3984
|
return val;
|
|
@@ -4046,14 +4032,14 @@ class GenericTableComponent {
|
|
|
4046
4032
|
});
|
|
4047
4033
|
$stickyFooter = computed(() => this.state.$props().stickyFooter || this.state.$isVirtual());
|
|
4048
4034
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GenericTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4049
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { $displayDataLength: { classPropertyName: "$displayDataLength", publicName: "displayDataLength", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, $rows: { classPropertyName: "$rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, transformFunction: null }, $dataSource: { classPropertyName: "$dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection" }, viewQueries: [{ propertyName: "$headerRow", first: true, predicate: MatHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "$footerRow", first: true, predicate: MatFooterRowDef, descendants: true, isSignal: true }, { propertyName: "$table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "$dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index
|
|
4035
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { $displayDataLength: { classPropertyName: "$displayDataLength", publicName: "displayDataLength", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, $rows: { classPropertyName: "$rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, transformFunction: null }, $dataSource: { classPropertyName: "$dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection" }, viewQueries: [{ propertyName: "$headerRow", first: true, predicate: MatHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "$footerRow", first: true, predicate: MatFooterRowDef, descendants: true, isSignal: true }, { propertyName: "$table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "$dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index;\" class=\"index-column\">\r\n {{ 1 + i + $offsetIndex() }}\r\n </mat-cell>\r\n <mat-footer-cell *matFooterCellDef class=\"index-column\"></mat-footer-cell>\r\n </ng-container>\r\n\r\n <!-- Grouping -->\r\n <ng-container matColumnDef=\"groupHeader\">\r\n <mat-cell *matCellDef=\"let row\">\r\n @let expanded = (state.$getIsExpanded | func : row.key : row.groupName );\r\n <div [style.paddingLeft]=\"row.padding + 'px !important'\">\r\n <button mat-icon-button (click)=\"setExpanded(row.key, row.groupName, !expanded());\">\r\n @if (!expanded()) {\r\n <mat-icon>chevron_right</mat-icon>\r\n } @else {\r\n <mat-icon>expand_more</mat-icon>\r\n }\r\n </button>\r\n {{ getTransform | func : row.key : row.groupHeaderDisplay }} ({{ row.length }})\r\n </div>\r\n <div style=\"flex-grow: 1\">\r\n <ng-container *ngTemplateOutlet=\"state.$props().groupHeaderTemplate!; context: { element: row }\"></ng-container>\r\n </div>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"/>\r\n <mat-row [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\" style=\"background-color: white;\"/>\r\n</mat-table>\r\n\r\n<mat-header-row [style.height]=\"$headerHeight()\" [style.min-height]=\"$headerHeight()\"\r\n *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$footerHeight()\" [style.min-height]=\"$footerHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: initial}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.mat-mdc-row:nth-child(odd){background-color:var(--tb-odd-row-background-color, #cdeefe)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$6.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$6.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$6.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$6.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "pipe", type: FunctionPipe, name: "func" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4050
4036
|
}
|
|
4051
4037
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GenericTableComponent, decorators: [{
|
|
4052
4038
|
type: Component,
|
|
4053
4039
|
args: [{ selector: 'tb-generic-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
4054
4040
|
MatTableModule, DragDropModule, MatCheckboxModule, MatButtonModule, MatIconModule, NgTemplateOutlet,
|
|
4055
4041
|
MatTooltipModule, FunctionPipe,
|
|
4056
|
-
], template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index
|
|
4042
|
+
], template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index;\" class=\"index-column\">\r\n {{ 1 + i + $offsetIndex() }}\r\n </mat-cell>\r\n <mat-footer-cell *matFooterCellDef class=\"index-column\"></mat-footer-cell>\r\n </ng-container>\r\n\r\n <!-- Grouping -->\r\n <ng-container matColumnDef=\"groupHeader\">\r\n <mat-cell *matCellDef=\"let row\">\r\n @let expanded = (state.$getIsExpanded | func : row.key : row.groupName );\r\n <div [style.paddingLeft]=\"row.padding + 'px !important'\">\r\n <button mat-icon-button (click)=\"setExpanded(row.key, row.groupName, !expanded());\">\r\n @if (!expanded()) {\r\n <mat-icon>chevron_right</mat-icon>\r\n } @else {\r\n <mat-icon>expand_more</mat-icon>\r\n }\r\n </button>\r\n {{ getTransform | func : row.key : row.groupHeaderDisplay }} ({{ row.length }})\r\n </div>\r\n <div style=\"flex-grow: 1\">\r\n <ng-container *ngTemplateOutlet=\"state.$props().groupHeaderTemplate!; context: { element: row }\"></ng-container>\r\n </div>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"/>\r\n <mat-row [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\" style=\"background-color: white;\"/>\r\n</mat-table>\r\n\r\n<mat-header-row [style.height]=\"$headerHeight()\" [style.min-height]=\"$headerHeight()\"\r\n *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$footerHeight()\" [style.min-height]=\"$footerHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: initial}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.mat-mdc-row:nth-child(odd){background-color:var(--tb-odd-row-background-color, #cdeefe)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"] }]
|
|
4057
4043
|
}] });
|
|
4058
4044
|
|
|
4059
4045
|
function downloadData(data, filename, mimeType) {
|
|
@@ -4459,20 +4445,17 @@ const tbGroupBy = (data, groupByKeys, parentGroupName) => {
|
|
|
4459
4445
|
};
|
|
4460
4446
|
});
|
|
4461
4447
|
};
|
|
4462
|
-
function updateGroupByState(groupedData,
|
|
4463
|
-
if (
|
|
4464
|
-
|| dataUpdated(data, groups,
|
|
4465
|
-
|| groupsUpdated(groups,
|
|
4448
|
+
function updateGroupByState({ groupedData }, [data, groups, expandedGroups], index) {
|
|
4449
|
+
if (index === 0
|
|
4450
|
+
|| dataUpdated(data, groups, expandedGroups)
|
|
4451
|
+
|| groupsUpdated(groups, expandedGroups)) {
|
|
4466
4452
|
groupedData = groups.value.length ? getGroupedData(data.value, groups.value) : data.value;
|
|
4467
4453
|
}
|
|
4468
|
-
const newDisplayData =
|
|
4454
|
+
const newDisplayData = expandedGroups.value.length === 0
|
|
4469
4455
|
? groupedData
|
|
4470
|
-
: groupedData.map(group => mapGroupHeader(group,
|
|
4456
|
+
: groupedData.map(group => mapGroupHeader(group, expandedGroups.value)).flat();
|
|
4471
4457
|
return ({ displayData: newDisplayData, groupedData });
|
|
4472
4458
|
}
|
|
4473
|
-
function _updateGroupByState({ groupedData }, [data, groups, expanded], index) {
|
|
4474
|
-
return updateGroupByState(groupedData, { data, groups, expanded }, index === 0);
|
|
4475
|
-
}
|
|
4476
4459
|
function mapGroupHeader(obj, data) {
|
|
4477
4460
|
const showChildren = data.find(a => a.expandedHeaders.includes(obj.groupName));
|
|
4478
4461
|
const children = !showChildren ? [] :
|
|
@@ -4509,15 +4492,6 @@ function sortData(data, sorted) {
|
|
|
4509
4492
|
return ordered;
|
|
4510
4493
|
}
|
|
4511
4494
|
function filterData(data, filters, resetAll = false) {
|
|
4512
|
-
if (filters.length === 0) {
|
|
4513
|
-
if (resetAll) {
|
|
4514
|
-
for (let index = 0; index < data.length; index++) {
|
|
4515
|
-
const element = data[index];
|
|
4516
|
-
element[tbNoShowSymbol] = false;
|
|
4517
|
-
}
|
|
4518
|
-
}
|
|
4519
|
-
return data;
|
|
4520
|
-
}
|
|
4521
4495
|
for (let index = 0; index < data.length; index++) {
|
|
4522
4496
|
const element = data[index];
|
|
4523
4497
|
const hide = !filters.every(filter => filter(element));
|
|
@@ -4529,33 +4503,19 @@ function filterData(data, filters, resetAll = false) {
|
|
|
4529
4503
|
}
|
|
4530
4504
|
const tbNoShowSymbol = Symbol('tb_no_show');
|
|
4531
4505
|
|
|
4532
|
-
const
|
|
4506
|
+
const sortAndFilterData = (data, sortState, filterState) => combineLatest([
|
|
4533
4507
|
data.pipe(timestamp()),
|
|
4534
4508
|
sortState.pipe(timestamp()),
|
|
4535
4509
|
filterState.pipe(timestamp())
|
|
4536
|
-
]).pipe(scan((mappedData, [data, sort, f], index) => {
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
if (runAllOnAllData) {
|
|
4546
|
-
const filteredData = filterData(sortData(allData.value, sort.value.sortsToRun), filters.value.allFilters, resetFilters);
|
|
4547
|
-
return filteredData;
|
|
4548
|
-
}
|
|
4549
|
-
if (sortChanged) {
|
|
4550
|
-
return (sortData(filteredData, sort.value.sortsToRun));
|
|
4551
|
-
}
|
|
4552
|
-
return (filterData(filteredData, filters.value.onlyAddedFilters || filters.value.allFilters, resetFilters));
|
|
4553
|
-
};
|
|
4554
|
-
const sortAndFilterData = (data, filters, sort, firstRun, resultData) => {
|
|
4555
|
-
const markedAndSortedData = mapDataSortsAndFilters(data, filters, sort, firstRun, resultData);
|
|
4556
|
-
const filteredData = markedAndSortedData.filter(item => !item[tbNoShowSymbol]);
|
|
4557
|
-
return filteredData;
|
|
4558
|
-
};
|
|
4510
|
+
]).pipe(scan(({ mappedData: resultData }, [data, sort, f], index) => {
|
|
4511
|
+
if (index === 0 || (data.timestamp > sort.timestamp && data.timestamp > f.timestamp)) {
|
|
4512
|
+
return ({ mappedData: filterData(sortData(data.value, sort.value.sortsToRun), f.value.allFilters) });
|
|
4513
|
+
}
|
|
4514
|
+
if (sort.timestamp > f.timestamp) {
|
|
4515
|
+
return ({ mappedData: sortData(resultData, sort.value.sortsToRun) });
|
|
4516
|
+
}
|
|
4517
|
+
return ({ mappedData: filterData(resultData, f.value.onlyAddedFilters || f.value.allFilters, !f.value.onlyAddedFilters) });
|
|
4518
|
+
}, { mappedData: [] })).pipe(map$1(({ mappedData: resultData }) => resultData.filter(item => !item[tbNoShowSymbol])), defaultShareReplay());
|
|
4559
4519
|
const createDataCleaners = (metadatas, mutate = false) => {
|
|
4560
4520
|
const transforms = createCleaners(metadatas);
|
|
4561
4521
|
return (data) => {
|
|
@@ -4788,7 +4748,7 @@ class TableBuilderDataSource extends MatTableDataSource {
|
|
|
4788
4748
|
const $pageSize = state.$pageSize;
|
|
4789
4749
|
const $virtualEnds = data.selectSignal(d => d.virtualEnds);
|
|
4790
4750
|
const $dataLength = computed(() => this.#$dataSrc().length);
|
|
4791
|
-
|
|
4751
|
+
const $dataSize = computed(() => {
|
|
4792
4752
|
const viewType = state.$viewType();
|
|
4793
4753
|
const dataLength = $dataLength();
|
|
4794
4754
|
const currentPage = $currentPage();
|
|
@@ -4806,6 +4766,7 @@ class TableBuilderDataSource extends MatTableDataSource {
|
|
|
4806
4766
|
}
|
|
4807
4767
|
return ({ start: virtualEnds.start, end: virtualEnds.end });
|
|
4808
4768
|
});
|
|
4769
|
+
this.$dataSize = $dataSize;
|
|
4809
4770
|
}
|
|
4810
4771
|
connect() {
|
|
4811
4772
|
return super.connect();
|
|
@@ -4841,13 +4802,13 @@ function mergeCustomCellMetaData(metaData1, metaData2) {
|
|
|
4841
4802
|
class GroupByListComponent {
|
|
4842
4803
|
tableStore = inject(TableStore);
|
|
4843
4804
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GroupByListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4844
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GroupByListComponent, isStandalone: true, selector: "group-by-list", ngImport: i0, template: "<span class=\"tb-group-label\">Group By:</span>\r\n
|
|
4805
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GroupByListComponent, isStandalone: true, selector: "group-by-list", ngImport: i0, template: "<mat-chip-set>\r\n <span class=\"tb-group-label\">Group By:</span>\r\n @for (groupByKey of tableStore.$groupByKeys(); track groupByKey) {\r\n @if($index > 0){\r\n <mat-icon class=\"nested-arrow\">arrow_right</mat-icon>\r\n }\r\n <mat-chip (removed)=\"tableStore.removeGroupByKey(groupByKey)\">\r\n {{groupByKey | spaceCase}}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n</mat-chip-set>\r\n", styles: [".tb-group-label{padding-right:5px}.nested-arrow{margin-right:-8px;margin-left:-8px}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i4$2.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i4$2.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: SpaceCasePipe, name: "spaceCase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4845
4806
|
}
|
|
4846
4807
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GroupByListComponent, decorators: [{
|
|
4847
4808
|
type: Component,
|
|
4848
4809
|
args: [{ selector: 'group-by-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
4849
4810
|
MatChipsModule, MatIconModule, SpaceCasePipe
|
|
4850
|
-
], template: "<span class=\"tb-group-label\">Group By:</span>\r\n
|
|
4811
|
+
], template: "<mat-chip-set>\r\n <span class=\"tb-group-label\">Group By:</span>\r\n @for (groupByKey of tableStore.$groupByKeys(); track groupByKey) {\r\n @if($index > 0){\r\n <mat-icon class=\"nested-arrow\">arrow_right</mat-icon>\r\n }\r\n <mat-chip (removed)=\"tableStore.removeGroupByKey(groupByKey)\">\r\n {{groupByKey | spaceCase}}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n</mat-chip-set>\r\n", styles: [".tb-group-label{padding-right:5px}.nested-arrow{margin-right:-8px;margin-left:-8px}\n"] }]
|
|
4851
4812
|
}] });
|
|
4852
4813
|
|
|
4853
4814
|
class ProfilesMenuComponent {
|
|
@@ -5031,7 +4992,7 @@ class ResetMenuComponent {
|
|
|
5031
4992
|
$widthsSet = computed(() => Object.keys(this.state.$getUserDefinedWidths()).length);
|
|
5032
4993
|
$rowHeightSet = this.state.$userDefinedRowHeight;
|
|
5033
4994
|
headerHeightSet = this.state.$userDefinedHeaderHeight;
|
|
5034
|
-
pageSizeSet =
|
|
4995
|
+
pageSizeSet = this.state.$userDefinedPageSize;
|
|
5035
4996
|
showAllSet = this.state.selectSignal(s => s.userDefined.showAll);
|
|
5036
4997
|
$set = computed(() => {
|
|
5037
4998
|
const arr = [];
|
|
@@ -5108,120 +5069,93 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
5108
5069
|
}] });
|
|
5109
5070
|
|
|
5110
5071
|
class TableVirtualScrollStrategy {
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
this.$headerHeight = scrollContainer.computedHeaderHeight;
|
|
5114
|
-
this.viewport = scrollContainer.viewport;
|
|
5115
|
-
this.dataStore = dataStore;
|
|
5116
|
-
this.$dataLength = scrollContainer.$dataLength;
|
|
5117
|
-
}
|
|
5118
|
-
dataStore;
|
|
5072
|
+
scrolledIndexChange;
|
|
5073
|
+
dataLength = 0;
|
|
5119
5074
|
indexChange = new Subject();
|
|
5120
|
-
scrolledIndexChange = this.indexChange.pipe(distinctUntilChanged());
|
|
5121
5075
|
viewport;
|
|
5122
|
-
$dataLength;
|
|
5123
|
-
$dataLengthChange = linkedSignal({
|
|
5124
|
-
source: () => this.$dataLength(),
|
|
5125
|
-
computation: (curr, previous) => ({ curr, previous: previous == undefined ? curr : previous.source })
|
|
5126
|
-
});
|
|
5127
5076
|
$rowHeight;
|
|
5128
5077
|
$rowHeightChange = linkedSignal({
|
|
5129
5078
|
source: () => this.$rowHeight(),
|
|
5130
|
-
computation: (curr, previous) => {
|
|
5131
|
-
return ({ curr, previous: previous == undefined ? curr : previous.source });
|
|
5132
|
-
}
|
|
5079
|
+
computation: (curr, previous) => ({ curr, previous: previous?.source || curr })
|
|
5133
5080
|
});
|
|
5134
5081
|
$headerHeight;
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5082
|
+
constructor(scrollContainer) {
|
|
5083
|
+
this.scrolledIndexChange = this.indexChange.pipe(distinctUntilChanged());
|
|
5084
|
+
this.$rowHeight = scrollContainer.computedRowHeight;
|
|
5085
|
+
this.$headerHeight = scrollContainer.computedHeaderHeight;
|
|
5086
|
+
}
|
|
5087
|
+
attach(viewport) {
|
|
5088
|
+
this.viewport = viewport;
|
|
5089
|
+
this.onDataLengthChanged();
|
|
5090
|
+
}
|
|
5139
5091
|
contentScrolled$ = new Subject();
|
|
5140
|
-
sub = subscriber(this.contentScrolled$.pipe(
|
|
5092
|
+
sub = subscriber(this.contentScrolled$.pipe(observeOn(animationFrameScheduler), debounceTime(20)), () => {
|
|
5141
5093
|
this.updateContent('scroll');
|
|
5142
5094
|
});
|
|
5143
5095
|
onContentScrolled() {
|
|
5144
|
-
this.contentScrolled$.next(
|
|
5096
|
+
this.contentScrolled$.next();
|
|
5097
|
+
}
|
|
5098
|
+
onDataLengthChanged() {
|
|
5099
|
+
}
|
|
5100
|
+
setDataLength(length) {
|
|
5101
|
+
this.dataLength = length;
|
|
5102
|
+
if (this.viewport && this.$rowHeight) {
|
|
5103
|
+
this.viewport.setTotalContentSize(this.dataLength * this.$rowHeight());
|
|
5104
|
+
// this.updateContent('data ' + dataTrigger);
|
|
5105
|
+
}
|
|
5106
|
+
this.updateContent('data ');
|
|
5107
|
+
}
|
|
5108
|
+
detach() { }
|
|
5109
|
+
onContentRendered() { }
|
|
5110
|
+
onRenderedOffsetChanged() {
|
|
5111
|
+
}
|
|
5112
|
+
scrollToIndex(index, behavior) {
|
|
5145
5113
|
}
|
|
5146
|
-
#onDataLengthChange = effect(() => {
|
|
5147
|
-
const dataLengthChange = this.$dataLengthChange();
|
|
5148
|
-
untracked(() => {
|
|
5149
|
-
if (dataLengthChange.curr === dataLengthChange.previous)
|
|
5150
|
-
return;
|
|
5151
|
-
this.updateContent('data length');
|
|
5152
|
-
});
|
|
5153
|
-
});
|
|
5154
5114
|
#onHeaderChange = effect(() => {
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
if (headerHeightChange.curr === headerHeightChange.previous)
|
|
5158
|
-
return;
|
|
5159
|
-
this.updateContent('header height');
|
|
5160
|
-
});
|
|
5115
|
+
this.$headerHeight && this.$headerHeight();
|
|
5116
|
+
this.updateContent('header height');
|
|
5161
5117
|
});
|
|
5162
5118
|
#onRowChange = effect(() => {
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
if (rowHeightChange.curr === rowHeightChange.previous)
|
|
5166
|
-
return;
|
|
5167
|
-
this.updateContent('row height');
|
|
5168
|
-
});
|
|
5119
|
+
this.$rowHeight && this.$rowHeight();
|
|
5120
|
+
this.updateContent('row height');
|
|
5169
5121
|
});
|
|
5170
|
-
$currentRange = signal({ start: 0, end: 0 });
|
|
5171
5122
|
updateContent(trigger) {
|
|
5172
|
-
|
|
5173
|
-
if (!viewport || !this.$rowHeight) {
|
|
5123
|
+
if (!this.viewport || !this.$rowHeight) {
|
|
5174
5124
|
return;
|
|
5175
5125
|
}
|
|
5176
|
-
const currentContentHeight = +viewport._totalContentHeight.replace('px', '');
|
|
5177
|
-
const newContentHeight = this
|
|
5126
|
+
const currentContentHeight = +this.viewport._totalContentHeight.replace('px', '');
|
|
5127
|
+
const newContentHeight = this.dataLength * this.$rowHeight();
|
|
5178
5128
|
if (currentContentHeight !== newContentHeight) {
|
|
5179
|
-
viewport.setTotalContentSize(newContentHeight);
|
|
5180
|
-
|
|
5129
|
+
this.viewport.setTotalContentSize(newContentHeight);
|
|
5130
|
+
setTimeout(() => {
|
|
5131
|
+
this.update(trigger);
|
|
5132
|
+
}, 0);
|
|
5181
5133
|
return;
|
|
5182
5134
|
}
|
|
5183
|
-
this.update(trigger
|
|
5135
|
+
this.update(trigger);
|
|
5184
5136
|
}
|
|
5185
|
-
update(trigger
|
|
5186
|
-
if (!viewport
|
|
5137
|
+
update(trigger) {
|
|
5138
|
+
if (!this.viewport || !this.$rowHeight) {
|
|
5187
5139
|
return;
|
|
5140
|
+
}
|
|
5188
5141
|
const rowHeightChangeEvent = this.$rowHeightChange();
|
|
5189
5142
|
const rowHeight = rowHeightChangeEvent.curr;
|
|
5190
5143
|
const rowHeightAdjustment = trigger === 'row height' ? rowHeightChangeEvent.curr / rowHeightChangeEvent.previous : 1;
|
|
5191
|
-
const amountOfRows = Math.ceil((viewport.getViewportSize() - this.$headerHeight()) / rowHeight);
|
|
5192
|
-
const f = viewport.measureScrollOffset();
|
|
5193
|
-
const offset = viewport.measureScrollOffset() * rowHeightAdjustment;
|
|
5194
|
-
|
|
5144
|
+
const amountOfRows = Math.ceil((this.viewport.getViewportSize() - this.$headerHeight()) / rowHeight);
|
|
5145
|
+
const f = this.viewport.measureScrollOffset();
|
|
5146
|
+
const offset = this.viewport.measureScrollOffset() * rowHeightAdjustment;
|
|
5147
|
+
if (offset !== f) {
|
|
5148
|
+
this.viewport.scrollToOffset(offset);
|
|
5149
|
+
}
|
|
5150
|
+
const buffer = 35;
|
|
5195
5151
|
const skip = Math.round(offset / rowHeight);
|
|
5196
5152
|
const index = skip % 2 === 0 ? skip : skip - 1;
|
|
5197
5153
|
const start = Math.max(0, index - buffer);
|
|
5198
|
-
const end = Math.min(this
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
}
|
|
5202
|
-
else if (f !== offset) {
|
|
5203
|
-
if (offset < f)
|
|
5204
|
-
viewport.scrollToOffset(offset);
|
|
5205
|
-
else
|
|
5206
|
-
setTimeout(() => {
|
|
5207
|
-
viewport.scrollToOffset(offset);
|
|
5208
|
-
}, 0);
|
|
5209
|
-
}
|
|
5210
|
-
if (this.$currentRange().start === start && this.$currentRange().end === end) {
|
|
5211
|
-
return;
|
|
5212
|
-
}
|
|
5213
|
-
this.$currentRange.set({ start, end });
|
|
5214
|
-
viewport.setRenderedContentOffset(rowHeight * start);
|
|
5215
|
-
this.dataStore.patchState({ virtualScrollOffset: offset });
|
|
5216
|
-
viewport.setRenderedRange({ start, end });
|
|
5154
|
+
const end = Math.min(this.dataLength, index + amountOfRows + buffer);
|
|
5155
|
+
this.viewport.setRenderedContentOffset(rowHeight * start);
|
|
5156
|
+
this.viewport.setRenderedRange({ start, end });
|
|
5217
5157
|
this.indexChange.next(index);
|
|
5218
5158
|
}
|
|
5219
|
-
attach(viewport) { }
|
|
5220
|
-
onDataLengthChanged() { }
|
|
5221
|
-
detach() { }
|
|
5222
|
-
onContentRendered() { }
|
|
5223
|
-
onRenderedOffsetChanged() { }
|
|
5224
|
-
scrollToIndex(index, behavior) { }
|
|
5225
5159
|
}
|
|
5226
5160
|
|
|
5227
5161
|
class VirtualScrollContainer {
|
|
@@ -5239,13 +5173,7 @@ class VirtualScrollContainer {
|
|
|
5239
5173
|
viewPort$ = toObservable(this.viewport).pipe(notNull());
|
|
5240
5174
|
$scrolledIndexChange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.scrolledIndexChange)));
|
|
5241
5175
|
$renderedRange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.renderedRangeStream)));
|
|
5242
|
-
$virtualScrollOptions = computed(() =>
|
|
5243
|
-
if (this.state.$initializationState() >= InitializationState.Ready)
|
|
5244
|
-
return this.state.$tableSettings().virtualSettings;
|
|
5245
|
-
else
|
|
5246
|
-
return undefined;
|
|
5247
|
-
});
|
|
5248
|
-
$optionsSet = computed(() => !!this.$virtualScrollOptions());
|
|
5176
|
+
$virtualScrollOptions = computed(() => this.state.$tableSettings().virtualSettings);
|
|
5249
5177
|
$dataLength = computed(() => {
|
|
5250
5178
|
const paginated = this.$usePaginator() && !this.$showAll();
|
|
5251
5179
|
const pageSize = this.$pageSize();
|
|
@@ -5258,41 +5186,58 @@ class VirtualScrollContainer {
|
|
|
5258
5186
|
constructor() {
|
|
5259
5187
|
addEventListener('resize', this.resizeHandler);
|
|
5260
5188
|
}
|
|
5261
|
-
|
|
5189
|
+
setViewportEffect = effect(() => {
|
|
5262
5190
|
const viewport = this.viewport();
|
|
5263
|
-
const options = this.$optionsSet();
|
|
5264
5191
|
untracked(() => {
|
|
5265
|
-
if (!!viewport
|
|
5266
|
-
this.setSize(this.viewport().elementRef
|
|
5192
|
+
if (!!viewport) {
|
|
5193
|
+
this.setSize(this.viewport().elementRef);
|
|
5267
5194
|
}
|
|
5268
5195
|
;
|
|
5269
5196
|
});
|
|
5270
5197
|
});
|
|
5198
|
+
subscriber = subscriber();
|
|
5271
5199
|
#onRenderedRangeEffect = effect(() => {
|
|
5272
5200
|
const renderedRange = this.$renderedRange();
|
|
5273
|
-
const viewport = this.viewport();
|
|
5274
5201
|
if (!renderedRange)
|
|
5275
5202
|
return;
|
|
5276
5203
|
untracked(() => {
|
|
5277
5204
|
this.dataStore.patchState({
|
|
5278
5205
|
virtualEnds: {
|
|
5279
5206
|
start: renderedRange.start,
|
|
5280
|
-
end: renderedRange.end,
|
|
5207
|
+
end: renderedRange.end + 25,
|
|
5281
5208
|
}
|
|
5282
5209
|
});
|
|
5283
|
-
|
|
5284
|
-
return;
|
|
5285
|
-
this.setSize(viewport.elementRef, 'rendered range');
|
|
5210
|
+
this.setSize(this.viewport().elementRef);
|
|
5286
5211
|
});
|
|
5287
5212
|
});
|
|
5213
|
+
#onDataLengthEffect = effect(() => {
|
|
5214
|
+
const dataLength = this.$dataLength();
|
|
5215
|
+
untracked(() => {
|
|
5216
|
+
const renderedRange = this.$renderedRange();
|
|
5217
|
+
this.scrollStrategy.setDataLength(dataLength);
|
|
5218
|
+
if ((renderedRange?.start || 0) > dataLength) {
|
|
5219
|
+
this.viewport().scrollToOffset(0);
|
|
5220
|
+
}
|
|
5221
|
+
});
|
|
5222
|
+
});
|
|
5223
|
+
#onOffsetEffect = effect(() => {
|
|
5224
|
+
const offset = this.$offset();
|
|
5225
|
+
untracked(() => {
|
|
5226
|
+
this.dataStore.patchState({ virtualScrollOffset: offset });
|
|
5227
|
+
});
|
|
5228
|
+
});
|
|
5229
|
+
$offset = computed(() => {
|
|
5230
|
+
const viewport = this.viewport();
|
|
5231
|
+
const scrolledIndexChange = this.$scrolledIndexChange();
|
|
5232
|
+
if (!scrolledIndexChange || !viewport)
|
|
5233
|
+
return 0;
|
|
5234
|
+
return viewport.getOffsetToRenderedContentStart() ?? 0;
|
|
5235
|
+
});
|
|
5288
5236
|
ngOnDestroy() {
|
|
5289
5237
|
removeEventListener('resize', this.resizeHandler);
|
|
5290
5238
|
}
|
|
5291
|
-
setSize(el
|
|
5292
|
-
console.log(trigger);
|
|
5239
|
+
setSize(el) {
|
|
5293
5240
|
const virtualScrollOptions = this.$virtualScrollOptions();
|
|
5294
|
-
if (!virtualScrollOptions)
|
|
5295
|
-
return;
|
|
5296
5241
|
if (virtualScrollOptions.dynamicHeight) {
|
|
5297
5242
|
this.calcDynamic(el);
|
|
5298
5243
|
return;
|
|
@@ -5309,10 +5254,18 @@ class VirtualScrollContainer {
|
|
|
5309
5254
|
height = maxViewPortHeightPx;
|
|
5310
5255
|
this.setHeight(height, el);
|
|
5311
5256
|
}
|
|
5257
|
+
calcDynamic$ = new Subject();
|
|
5258
|
+
$calcDynamic = toSignal(this.calcDynamic$.pipe(debounceTime$1(300)));
|
|
5259
|
+
#onCalcDynamicEffect = effect(() => {
|
|
5260
|
+
const el = this.$calcDynamic();
|
|
5261
|
+
if (!el)
|
|
5262
|
+
return;
|
|
5263
|
+
untracked(() => {
|
|
5264
|
+
this.calcDynamic(el);
|
|
5265
|
+
});
|
|
5266
|
+
});
|
|
5312
5267
|
calcDynamic(el) {
|
|
5313
5268
|
const virtualScrollOptions = this.$virtualScrollOptions();
|
|
5314
|
-
if (!virtualScrollOptions)
|
|
5315
|
-
return;
|
|
5316
5269
|
const t = this.tableContainer.elementRef.nativeElement.querySelector(`#${TableContainerComponent.headerId}`);
|
|
5317
5270
|
const rect = t?.getBoundingClientRect();
|
|
5318
5271
|
const windowHeight = window.innerHeight;
|
|
@@ -5347,8 +5300,8 @@ class VirtualScrollContainer {
|
|
|
5347
5300
|
this.dataStore.patchState({ virtualScrollOffset });
|
|
5348
5301
|
}
|
|
5349
5302
|
resizeHandler = () => {
|
|
5350
|
-
if (this.viewport() && this.$virtualScrollOptions()
|
|
5351
|
-
this.setSize(this.viewport().elementRef
|
|
5303
|
+
if (this.viewport() && this.$virtualScrollOptions().dynamicHeight) {
|
|
5304
|
+
this.setSize(this.viewport().elementRef);
|
|
5352
5305
|
}
|
|
5353
5306
|
};
|
|
5354
5307
|
computedRowHeight = computed(() => {
|
|
@@ -5372,7 +5325,7 @@ class VirtualScrollContainer {
|
|
|
5372
5325
|
return 0;
|
|
5373
5326
|
return parseTbSizeToPixels(virtualScrollOptions.dynamicalHeightBuffer) || 0;
|
|
5374
5327
|
});
|
|
5375
|
-
scrollStrategy = new TableVirtualScrollStrategy(this
|
|
5328
|
+
scrollStrategy = new TableVirtualScrollStrategy(this);
|
|
5376
5329
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VirtualScrollContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5377
5330
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.0", type: VirtualScrollContainer, isStandalone: true, selector: "tb-virtual-scroll-container", queries: [{ propertyName: "genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
5378
5331
|
<cdk-virtual-scroll-viewport>
|
|
@@ -5428,27 +5381,35 @@ class TableContainerComponent {
|
|
|
5428
5381
|
parent: this.injector
|
|
5429
5382
|
});
|
|
5430
5383
|
$tableBuilder = input.required({ alias: 'tableBuilder' });
|
|
5431
|
-
$
|
|
5432
|
-
$
|
|
5433
|
-
$inputFilters =
|
|
5384
|
+
$tableId = input(undefined, { alias: 'tableId' });
|
|
5385
|
+
$trackBy = input(undefined, { alias: 'trackBy' });
|
|
5386
|
+
$inputFilters = model([], { alias: 'inputFilters' });
|
|
5434
5387
|
predicateInputFilters$ = toObservable(computed(() => this.$inputFilters().filter(isFunction$1)));
|
|
5435
5388
|
$filterInfoInputs = computed(() => this.$inputFilters().filter(i => !isFunction$1(i)));
|
|
5436
|
-
$
|
|
5437
|
-
$
|
|
5438
|
-
$
|
|
5439
|
-
$
|
|
5389
|
+
$indexColumn = input(false, { alias: 'indexColumn' });
|
|
5390
|
+
$selectionColumn = input(false, { alias: 'selectionColumn' });
|
|
5391
|
+
$isSticky = input(true, { alias: 'isSticky' });
|
|
5392
|
+
$stickyFooter = input(false, { alias: 'stickyFooter' });
|
|
5440
5393
|
$groupHeaderTemplate = input(undefined, { alias: 'groupHeaderTemplate' });
|
|
5441
5394
|
$groupHeaderHeight = input(undefined, { alias: 'groupHeaderHeight' });
|
|
5442
5395
|
$pageSize = input(undefined, { alias: 'pageSize' });
|
|
5396
|
+
$props = computed(() => {
|
|
5397
|
+
const indexColumn = this.$indexColumn();
|
|
5398
|
+
const selectionColumn = this.$selectionColumn();
|
|
5399
|
+
const isSticky = this.$isSticky();
|
|
5400
|
+
const stickyFooter = this.$stickyFooter();
|
|
5401
|
+
const groupHeaderTemplate = this.$groupHeaderTemplate();
|
|
5402
|
+
const groupHeaderHeight = this.$groupHeaderHeight();
|
|
5403
|
+
return ({ indexColumn, selectionColumn, isSticky, stickyFooter, groupHeaderTemplate, groupHeaderHeight });
|
|
5404
|
+
});
|
|
5443
5405
|
selection$ = output({ alias: 'selection' });
|
|
5444
5406
|
onStateReset$ = output({ alias: 'onStateReset' });
|
|
5445
5407
|
onSaveState$ = output({ alias: 'onSaveState' });
|
|
5446
5408
|
_state$ = toObservable(this.state.$savableState);
|
|
5447
5409
|
state$ = outputFromObservable(this._state$, { alias: 'state' });
|
|
5448
|
-
$
|
|
5449
|
-
_data$ = toObservable(this.$data);
|
|
5410
|
+
_data$ = new BehaviorSubject([]);
|
|
5450
5411
|
data$ = outputFromObservable(this._data$, { alias: 'data' });
|
|
5451
|
-
$
|
|
5412
|
+
$data = toSignal(this._data$, { initialValue: [] });
|
|
5452
5413
|
clearSelections() {
|
|
5453
5414
|
this.$genericTable()?.$selection().clear(true);
|
|
5454
5415
|
}
|
|
@@ -5472,37 +5433,14 @@ class TableContainerComponent {
|
|
|
5472
5433
|
$useVirtual = this.state.$isVirtual;
|
|
5473
5434
|
$collapsedFooter = this.state.$footerCollapsed;
|
|
5474
5435
|
$collapsedHeader = this.state.$headerCollapsed;
|
|
5475
|
-
$displayDataLength = computed(() => this.$displayData()
|
|
5476
|
-
$tableBuilderSettings = computed(() => this.$tableBuilder().$settings());
|
|
5477
|
-
$trackBy = computed(() => this.$trackByInput() || this.$tableBuilderSettings()?.tableSettings?.trackBy);
|
|
5478
|
-
$tableId = computed(() => this.$tableIdInput() || this.$tableBuilderSettings()?.tableSettings?.tableId);
|
|
5479
|
-
$includeSelectionColumn = computed(() => this.$selectionColumnInput() || !!this.$tableBuilderSettings()?.tableSettings?.includeSelectionColumn);
|
|
5480
|
-
$includeIndexColumn = computed(() => this.$indexColumnInput() || !!this.$tableBuilderSettings()?.tableSettings?.includeIndexColumn);
|
|
5481
|
-
$stickyHeader = computed(() => {
|
|
5482
|
-
const settings = this.$tableBuilderSettings()?.columnHeaderSettings?.stickyHeaderRow;
|
|
5483
|
-
if (settings != null) {
|
|
5484
|
-
return settings;
|
|
5485
|
-
}
|
|
5486
|
-
return this.$stickyHeaderInput();
|
|
5487
|
-
});
|
|
5488
|
-
$stickyFooter = computed(() => this.$stickyFooterInput() || !!this.$tableBuilderSettings()?.columnFooterSettings?.stickyFooterRow);
|
|
5489
|
-
$props = computed(() => {
|
|
5490
|
-
const indexColumn = this.$includeIndexColumn();
|
|
5491
|
-
const selectionColumn = this.$includeSelectionColumn();
|
|
5492
|
-
const stickHeader = this.$stickyHeader();
|
|
5493
|
-
const stickyFooter = this.$stickyFooter();
|
|
5494
|
-
const groupHeaderTemplate = this.$groupHeaderTemplate();
|
|
5495
|
-
const groupHeaderHeight = this.$groupHeaderHeight();
|
|
5496
|
-
return ({ indexColumn, selectionColumn, isSticky: stickHeader, stickyFooter, groupHeaderTemplate, groupHeaderHeight });
|
|
5497
|
-
});
|
|
5436
|
+
$displayDataLength = computed(() => this.$displayData().length);
|
|
5498
5437
|
#initializeTableSettingsFromTableBuilderAndPersistedStateEffect = effect(() => {
|
|
5499
5438
|
const metaLoaded = this.$isInitializationState(InitializationState.MetaDataLoaded)();
|
|
5500
5439
|
if (!metaLoaded)
|
|
5501
5440
|
return;
|
|
5502
5441
|
const persistedState = this.$persistedState();
|
|
5503
|
-
const tbSettings = this.$tableBuilderSettings();
|
|
5504
5442
|
untracked(() => {
|
|
5505
|
-
this.state.setTableSettings(
|
|
5443
|
+
this.state.setTableSettings(this.$tableBuilder().settings$);
|
|
5506
5444
|
if (persistedState) {
|
|
5507
5445
|
persistedState.persistedTableSettings = new PersistedTableSettings(persistedState.persistedTableSettings);
|
|
5508
5446
|
this.state.updateStateFromPersistedState(persistedState);
|
|
@@ -5569,22 +5507,10 @@ class TableContainerComponent {
|
|
|
5569
5507
|
});
|
|
5570
5508
|
#initializeDataEffect = effect(() => {
|
|
5571
5509
|
const tableBuilder = this.$tableBuilder();
|
|
5572
|
-
|
|
5573
|
-
if (!tableBuilder || !data)
|
|
5574
|
-
return;
|
|
5575
|
-
untracked(() => {
|
|
5576
|
-
this.dataStore.patchState({ sortedFilteredDataLength: data.value.length });
|
|
5577
|
-
});
|
|
5578
|
-
});
|
|
5579
|
-
#initializeDataEffect2 = effect(() => {
|
|
5580
|
-
const tableBuilder = this.$tableBuilder();
|
|
5581
|
-
const flat = this.$filteredSortedAndGrouped();
|
|
5582
|
-
if (!tableBuilder || !flat)
|
|
5510
|
+
if (!tableBuilder)
|
|
5583
5511
|
return;
|
|
5584
5512
|
untracked(() => {
|
|
5585
|
-
|
|
5586
|
-
this.dataSource.setData(data);
|
|
5587
|
-
this.dataStore.patchState({ sortedFilteredGroupedDataLength: data.length });
|
|
5513
|
+
this.initializeData();
|
|
5588
5514
|
});
|
|
5589
5515
|
});
|
|
5590
5516
|
$persistedState = computed(() => {
|
|
@@ -5600,7 +5526,12 @@ class TableContainerComponent {
|
|
|
5600
5526
|
}
|
|
5601
5527
|
return [...this.$filterDirectives(), ...this.$customFilterDirectives()];
|
|
5602
5528
|
});
|
|
5603
|
-
$
|
|
5529
|
+
allNotSavableFilterDirectivesFilters$ = toObservable(this.$allFilterDirectives).pipe(filterArray(d => !d.savable), switchMap(d => {
|
|
5530
|
+
const a = d.map(d => d.filter$);
|
|
5531
|
+
return combineLatest(a).pipe(startWith([]));
|
|
5532
|
+
}), map(createFilterFuncs));
|
|
5533
|
+
tableBuilderMetaData$ = toObservable(this.$tableBuilder).pipe(notNull(), switchMap(tb => tb.metaData$));
|
|
5534
|
+
$tableBuilderMetaData = toSignal(this.tableBuilderMetaData$);
|
|
5604
5535
|
$allMetaDatas = computed(() => {
|
|
5605
5536
|
const tableBuilderMetaData = this.$tableBuilderMetaData();
|
|
5606
5537
|
if (!tableBuilderMetaData)
|
|
@@ -5609,117 +5540,39 @@ class TableContainerComponent {
|
|
|
5609
5540
|
const mappedCustomCellMetaDatas = customCellMetaDatas.map(md => mergeCustomCellMetaData(md, tableBuilderMetaData.find(item => item.key === md.key)));
|
|
5610
5541
|
return [...tableBuilderMetaData, ...mappedCustomCellMetaDatas];
|
|
5611
5542
|
});
|
|
5612
|
-
|
|
5613
|
-
this.$tableBuilder().prep(this.injector);
|
|
5614
|
-
}
|
|
5543
|
+
$displayData = signal([]);
|
|
5615
5544
|
ngOnDestroy() {
|
|
5616
5545
|
const tableId = this.$tableId();
|
|
5617
5546
|
if (tableId) {
|
|
5618
5547
|
this.stateService.saveTableStateToLocal({ tableId, tableState: this.state.$savableState() });
|
|
5619
5548
|
}
|
|
5620
5549
|
}
|
|
5621
|
-
|
|
5622
|
-
const
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
.
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
return ({ value: updateFilterPredicateState(previous.value.value, curr), timestamp: new Date().getTime() });
|
|
5636
|
-
}
|
|
5637
|
-
});
|
|
5638
|
-
$savableFiltersState = linkedSignal({
|
|
5639
|
-
source: this.state.$filters,
|
|
5640
|
-
computation: (curr, previous) => {
|
|
5641
|
-
if (!previous?.value)
|
|
5642
|
-
return ({ value: updateFilterInfoState({ allFilters: {} }, curr), timestamp: new Date().getTime() });
|
|
5643
|
-
return ({ value: updateFilterInfoState(previous.value.value, curr), timestamp: new Date().getTime() });
|
|
5644
|
-
}
|
|
5645
|
-
});
|
|
5646
|
-
$allFilterStatesTimeStamped = computed(() => {
|
|
5647
|
-
if (!this.$isInitializationState(InitializationState.Ready)())
|
|
5648
|
-
return undefined;
|
|
5649
|
-
return ({ value: updateFilterState(this.$savableFiltersState(), this.$predicateFiltersState()), timestamp: new Date().getTime() });
|
|
5650
|
-
});
|
|
5651
|
-
$sortStateTimeStamped = linkedSignal({
|
|
5652
|
-
source: computed(() => this.$isInitializationState(InitializationState.Ready)() && this.state.$getSorts()),
|
|
5653
|
-
computation: (curr, prev) => {
|
|
5654
|
-
if (!curr)
|
|
5655
|
-
return undefined;
|
|
5656
|
-
if (!prev?.value)
|
|
5657
|
-
return ({ value: updateSortState(initialSortState, curr), timestamp: new Date().getTime() });
|
|
5658
|
-
return ({ value: updateSortState(prev.value.value, curr), timestamp: new Date().getTime() });
|
|
5659
|
-
}
|
|
5660
|
-
});
|
|
5661
|
-
$allData = computed(() => this.$tableBuilder()?.$data() || []);
|
|
5662
|
-
$allDataTimeStamped = computed(() => {
|
|
5663
|
-
const data = this.$allData();
|
|
5664
|
-
if (!data)
|
|
5665
|
-
return undefined;
|
|
5666
|
-
return ({
|
|
5667
|
-
value: data,
|
|
5668
|
-
timestamp: new Date().getTime()
|
|
5669
|
-
});
|
|
5670
|
-
});
|
|
5671
|
-
$allTimeStamped = computed(() => {
|
|
5672
|
-
const data = this.$allDataTimeStamped();
|
|
5673
|
-
const sort = this.$sortStateTimeStamped();
|
|
5674
|
-
const filter = this.$allFilterStatesTimeStamped();
|
|
5675
|
-
if (!data?.value || !sort?.value || !filter?.value)
|
|
5676
|
-
return undefined;
|
|
5677
|
-
return ({
|
|
5678
|
-
data,
|
|
5679
|
-
sort,
|
|
5680
|
-
filter
|
|
5550
|
+
initializeData() {
|
|
5551
|
+
const predicateFilters$ = combineLatest([this.predicateInputFilters$.pipe(), this.allNotSavableFilterDirectivesFilters$])
|
|
5552
|
+
.pipe(map(([a, b]) => [...a, ...b]));
|
|
5553
|
+
const filters$ = combineLatest([
|
|
5554
|
+
this.state.filters$.pipe(scan$1(updateFilterInfoState, { allFilters: {} }), timestamp$1()),
|
|
5555
|
+
predicateFilters$.pipe(scan$1(updateFilterPredicateState, { allFilters: [] }), timestamp$1())
|
|
5556
|
+
])
|
|
5557
|
+
.pipe(map(([filterInfo, pred]) => updateFilterState(filterInfo, pred)));
|
|
5558
|
+
const sortsState$ = this.state.sort$.pipe(scan$1(updateSortState, initialSortState));
|
|
5559
|
+
const sortedAndFilteredData$ = sortAndFilterData(this.$tableBuilder().getData$(), sortsState$, filters$);
|
|
5560
|
+
const flatGrouped$ = combineLatest([sortedAndFilteredData$.pipe(timestamp$1()), this.state.groupByKeys$.pipe(timestamp$1()), this.state.expandedGroups$.pipe(timestamp$1())]).pipe(scan$1(updateGroupByState, initialGroupByState), map(({ displayData }) => displayData), defaultShareReplay());
|
|
5561
|
+
this.state.on(sortedAndFilteredData$, (data) => {
|
|
5562
|
+
this._data$.next(data);
|
|
5563
|
+
this.dataStore.patchState({ sortedFilteredDataLength: data.length });
|
|
5681
5564
|
});
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
const init = this.$isInitializationState(InitializationState.Ready);
|
|
5687
|
-
if (!values || !init)
|
|
5688
|
-
return undefined;
|
|
5689
|
-
const { data, filter, sort } = values;
|
|
5690
|
-
const val = prev?.value?.value || data.value;
|
|
5691
|
-
const filteredData = sortAndFilterData(data, filter, sort, !prev?.value, val);
|
|
5692
|
-
return ({ value: filteredData, timestamp: new Date().getTime() });
|
|
5693
|
-
}
|
|
5694
|
-
});
|
|
5695
|
-
$timestampedGroups = computed(() => ({ value: this.state.$groupByKeys(), timestamp: new Date().getTime() }));
|
|
5696
|
-
$timestampedExpanded = computed(() => ({ value: this.state.$expandGroups(), timestamp: new Date().getTime() }));
|
|
5697
|
-
$dataAndGroupsTimestamped = computed(() => {
|
|
5698
|
-
const data = this.$sortedAndFilteredData();
|
|
5699
|
-
const groups = this.$timestampedGroups();
|
|
5700
|
-
const expanded = this.$timestampedExpanded();
|
|
5701
|
-
if (!data)
|
|
5702
|
-
return undefined;
|
|
5703
|
-
return ({
|
|
5704
|
-
data,
|
|
5705
|
-
groups,
|
|
5706
|
-
expanded
|
|
5565
|
+
this.state.on(flatGrouped$, (data) => {
|
|
5566
|
+
this.dataSource.setData(data);
|
|
5567
|
+
this.$displayData.set(data);
|
|
5568
|
+
this.dataStore.patchState({ sortedFilteredGroupedDataLength: data.length });
|
|
5707
5569
|
});
|
|
5708
|
-
}
|
|
5709
|
-
$filteredSortedAndGrouped = linkedSignal({
|
|
5710
|
-
source: this.$dataAndGroupsTimestamped,
|
|
5711
|
-
computation: (curr, prev) => {
|
|
5712
|
-
if (!curr)
|
|
5713
|
-
return undefined;
|
|
5714
|
-
const val = prev?.value?.groupedData || [];
|
|
5715
|
-
return updateGroupByState(val, curr, !prev?.value);
|
|
5716
|
-
}
|
|
5717
|
-
});
|
|
5570
|
+
}
|
|
5718
5571
|
$isInitializationState = (state) => computed(() => this.state.selectSignal(s => s.initializationState >= state)());
|
|
5719
5572
|
static headerId = 'tb-header-wrapper';
|
|
5720
5573
|
headerId = TableContainerComponent.headerId;
|
|
5721
5574
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5722
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $
|
|
5575
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $tableId: { classPropertyName: "$tableId", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumn: { classPropertyName: "$indexColumn", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumn: { classPropertyName: "$selectionColumn", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $isSticky: { classPropertyName: "$isSticky", publicName: "isSticky", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooter: { classPropertyName: "$stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderTemplate: { classPropertyName: "$groupHeaderTemplate", publicName: "groupHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderHeight: { classPropertyName: "$groupHeaderHeight", publicName: "groupHeaderHeight", isSignal: true, isRequired: false, transformFunction: null }, $pageSize: { classPropertyName: "$pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { $inputFilters: "inputFiltersChange", selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }, { propertyName: "$menu", first: true, predicate: MatMenu, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"l.menu()\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n\r\n <lib-table-header-menu #l/>\r\n\r\n }\r\n @else {\r\n <mat-icon color=\"primary\" [matMenuTriggerFor]=\"mainMenu\" class=\"flat-menu-button pointer\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"flex-column\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayDataLength", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "component", type: ProfilesMenuComponent, selector: "tb-profiles-menu", inputs: ["tableId", "isMatMenuChild"] }, { kind: "component", type: TableHeaderMenuComponent, selector: "lib-table-header-menu" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: VirtualScrollContainer, selector: "tb-virtual-scroll-container" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5723
5576
|
}
|
|
5724
5577
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableContainerComponent, decorators: [{
|
|
5725
5578
|
type: Component,
|
|
@@ -5727,7 +5580,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
5727
5580
|
PaginatorComponent,
|
|
5728
5581
|
MultiSortDirective, GroupByListComponent, FilterChipsComponent, GenFilterDisplayerComponent, GenColDisplayerComponent,
|
|
5729
5582
|
SortMenuComponent, GenericTableComponent, ProfilesMenuComponent, TableHeaderMenuComponent,
|
|
5730
|
-
MatButtonModule, MatMenuModule, MatIconModule, MatTooltipModule, VirtualScrollContainer], template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed)
|
|
5583
|
+
MatButtonModule, MatMenuModule, MatIconModule, MatTooltipModule, VirtualScrollContainer], template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"l.menu()\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n\r\n <lib-table-header-menu #l/>\r\n\r\n }\r\n @else {\r\n <mat-icon color=\"primary\" [matMenuTriggerFor]=\"mainMenu\" class=\"flat-menu-button pointer\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"flex-column\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"] }]
|
|
5731
5584
|
}] });
|
|
5732
5585
|
|
|
5733
5586
|
class TableBuilderModule {
|
|
@@ -5740,38 +5593,102 @@ class TableBuilderModule {
|
|
|
5740
5593
|
};
|
|
5741
5594
|
}
|
|
5742
5595
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5743
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, imports: [
|
|
5596
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, imports: [CommonModule,
|
|
5597
|
+
MatDialogModule,
|
|
5598
|
+
MatNativeDateModule,
|
|
5599
|
+
RouterModule,
|
|
5600
|
+
TableContainerComponent,
|
|
5601
|
+
GenericTableComponent,
|
|
5602
|
+
TableContainerComponent,
|
|
5744
5603
|
CustomCellDirective,
|
|
5604
|
+
FilterComponent,
|
|
5605
|
+
MatSlideToggleTbFilterDirective,
|
|
5606
|
+
MatRadioButtonTbFilterDirective,
|
|
5607
|
+
MatOptionTbFilterDirective,
|
|
5608
|
+
MatCheckboxTbFilterDirective,
|
|
5609
|
+
MatButtonToggleFilterDirective,
|
|
5745
5610
|
TableFilterDirective,
|
|
5746
5611
|
TableFilterStringContainsDirective,
|
|
5747
|
-
TableWrapperDirective
|
|
5612
|
+
TableWrapperDirective,
|
|
5613
|
+
ResizeColumnDirective,
|
|
5614
|
+
UtilitiesModule], exports: [GenericTableComponent,
|
|
5615
|
+
TableContainerComponent,
|
|
5748
5616
|
CustomCellDirective,
|
|
5617
|
+
FilterComponent,
|
|
5618
|
+
MatSlideToggleTbFilterDirective,
|
|
5619
|
+
MatRadioButtonTbFilterDirective,
|
|
5620
|
+
MatOptionTbFilterDirective,
|
|
5621
|
+
MatCheckboxTbFilterDirective,
|
|
5622
|
+
MatButtonToggleFilterDirective,
|
|
5623
|
+
TableFilterDirective,
|
|
5749
5624
|
TableFilterStringContainsDirective,
|
|
5750
5625
|
TableWrapperDirective,
|
|
5626
|
+
ResizeColumnDirective,
|
|
5751
5627
|
UtilitiesModule] });
|
|
5752
5628
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, providers: [
|
|
5629
|
+
SpaceCasePipe,
|
|
5630
|
+
DatePipe,
|
|
5631
|
+
CurrencyPipe,
|
|
5632
|
+
PhoneNumberPipe,
|
|
5753
5633
|
MultiSortDirective,
|
|
5754
|
-
|
|
5634
|
+
TableBuilderStateStore,
|
|
5635
|
+
], imports: [CommonModule,
|
|
5636
|
+
MatDialogModule,
|
|
5637
|
+
MatNativeDateModule,
|
|
5638
|
+
RouterModule,
|
|
5639
|
+
TableContainerComponent,
|
|
5640
|
+
GenericTableComponent,
|
|
5641
|
+
TableContainerComponent,
|
|
5642
|
+
FilterComponent,
|
|
5643
|
+
UtilitiesModule, UtilitiesModule] });
|
|
5755
5644
|
}
|
|
5756
5645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, decorators: [{
|
|
5757
5646
|
type: NgModule,
|
|
5758
5647
|
args: [{
|
|
5759
5648
|
imports: [
|
|
5649
|
+
CommonModule,
|
|
5650
|
+
MatDialogModule,
|
|
5651
|
+
MatNativeDateModule,
|
|
5652
|
+
RouterModule,
|
|
5653
|
+
TableContainerComponent,
|
|
5654
|
+
GenericTableComponent,
|
|
5760
5655
|
TableContainerComponent,
|
|
5761
5656
|
CustomCellDirective,
|
|
5657
|
+
FilterComponent,
|
|
5658
|
+
MatSlideToggleTbFilterDirective,
|
|
5659
|
+
MatRadioButtonTbFilterDirective,
|
|
5660
|
+
MatOptionTbFilterDirective,
|
|
5661
|
+
MatCheckboxTbFilterDirective,
|
|
5662
|
+
MatButtonToggleFilterDirective,
|
|
5762
5663
|
TableFilterDirective,
|
|
5763
5664
|
TableFilterStringContainsDirective,
|
|
5764
5665
|
TableWrapperDirective,
|
|
5666
|
+
ResizeColumnDirective,
|
|
5667
|
+
UtilitiesModule,
|
|
5765
5668
|
],
|
|
5766
5669
|
exports: [
|
|
5670
|
+
GenericTableComponent,
|
|
5767
5671
|
TableContainerComponent,
|
|
5768
5672
|
CustomCellDirective,
|
|
5673
|
+
FilterComponent,
|
|
5674
|
+
MatSlideToggleTbFilterDirective,
|
|
5675
|
+
MatRadioButtonTbFilterDirective,
|
|
5676
|
+
MatOptionTbFilterDirective,
|
|
5677
|
+
MatCheckboxTbFilterDirective,
|
|
5678
|
+
MatButtonToggleFilterDirective,
|
|
5679
|
+
TableFilterDirective,
|
|
5769
5680
|
TableFilterStringContainsDirective,
|
|
5770
5681
|
TableWrapperDirective,
|
|
5682
|
+
ResizeColumnDirective,
|
|
5771
5683
|
UtilitiesModule,
|
|
5772
5684
|
],
|
|
5773
5685
|
providers: [
|
|
5686
|
+
SpaceCasePipe,
|
|
5687
|
+
DatePipe,
|
|
5688
|
+
CurrencyPipe,
|
|
5689
|
+
PhoneNumberPipe,
|
|
5774
5690
|
MultiSortDirective,
|
|
5691
|
+
TableBuilderStateStore,
|
|
5775
5692
|
]
|
|
5776
5693
|
}]
|
|
5777
5694
|
}] });
|
|
@@ -5799,86 +5716,66 @@ class MatTableObservableDataSource extends MatTableDataSource {
|
|
|
5799
5716
|
}
|
|
5800
5717
|
|
|
5801
5718
|
class TableBuilder {
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
settings
|
|
5805
|
-
#$metaData;
|
|
5806
|
-
#$data;
|
|
5807
|
-
#$settings;
|
|
5808
|
-
$metaData = computed(() => this.$inited() && this.#$metaData());
|
|
5809
|
-
$settings = computed(() => this.$inited() ? this.#$settings() : undefined);
|
|
5810
|
-
metaNeeds = false;
|
|
5811
|
-
dataObs = false;
|
|
5812
|
-
settingsObs = false;
|
|
5813
|
-
$inited = signal(false);
|
|
5719
|
+
metaData$;
|
|
5720
|
+
data$;
|
|
5721
|
+
settings$;
|
|
5814
5722
|
constructor(data, metaData, settings = new GeneralTableSettings()) {
|
|
5815
|
-
this.
|
|
5816
|
-
|
|
5817
|
-
this.
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5723
|
+
this.settings$ = this.coerceSettingsToObservable(settings)
|
|
5724
|
+
.pipe(defaultShareReplay());
|
|
5725
|
+
this.data$ = this.coerceToObservable(data, this.settings$)
|
|
5726
|
+
.pipe(notNull(), defaultShareReplay());
|
|
5727
|
+
this.metaData$ = metaData ?
|
|
5728
|
+
this.coerceToObservable(metaData, this.settings$).pipe(defaultShareReplay())
|
|
5729
|
+
:
|
|
5730
|
+
this.data$.pipe(first$1(), map(d => this.createMetaData(d[0])), defaultShareReplay());
|
|
5731
|
+
}
|
|
5732
|
+
getData$() {
|
|
5733
|
+
return this.metaData$.pipe(map(md => createDataCleaners(md)), switchMap(cleaner => this.data$.pipe(map((datas, ii) => {
|
|
5734
|
+
return datas.map((data, i) => {
|
|
5735
|
+
const cleaned = cleaner(data);
|
|
5736
|
+
cleaned[initIndexSymbol] = i * ((ii % 2) + 1);
|
|
5737
|
+
return cleaned;
|
|
5738
|
+
});
|
|
5739
|
+
}))), defaultShareReplay());
|
|
5740
|
+
}
|
|
5741
|
+
createMetaData(obj) {
|
|
5742
|
+
return Object.keys(obj ?? {})
|
|
5743
|
+
.map(key => ({
|
|
5744
|
+
key,
|
|
5745
|
+
fieldType: FieldType.Unknown,
|
|
5746
|
+
order: -1
|
|
5747
|
+
}));
|
|
5748
|
+
}
|
|
5749
|
+
coerceToObservable(arg, settings) {
|
|
5750
|
+
if (isObservable(arg)) {
|
|
5751
|
+
return arg;
|
|
5823
5752
|
}
|
|
5824
|
-
if (
|
|
5825
|
-
|
|
5753
|
+
else if (isSignal(arg)) {
|
|
5754
|
+
return settings.pipe(switchMap(s => {
|
|
5755
|
+
this.assertInjector(s);
|
|
5756
|
+
return toObservable(arg, { injector: s.injector });
|
|
5757
|
+
}));
|
|
5826
5758
|
}
|
|
5827
5759
|
else {
|
|
5828
|
-
|
|
5760
|
+
return of(arg);
|
|
5829
5761
|
}
|
|
5762
|
+
}
|
|
5763
|
+
coerceSettingsToObservable(settings) {
|
|
5830
5764
|
if (isObservable(settings)) {
|
|
5831
|
-
|
|
5765
|
+
return settings;
|
|
5832
5766
|
}
|
|
5833
|
-
else {
|
|
5834
|
-
this
|
|
5767
|
+
else if (isSignal(settings)) {
|
|
5768
|
+
this.assertInjector(settings());
|
|
5769
|
+
return toObservable(settings, { injector: settings().injector });
|
|
5835
5770
|
}
|
|
5836
|
-
|
|
5837
|
-
|
|
5771
|
+
else {
|
|
5772
|
+
return of(settings);
|
|
5838
5773
|
}
|
|
5839
5774
|
}
|
|
5840
|
-
|
|
5841
|
-
if (
|
|
5842
|
-
|
|
5843
|
-
}
|
|
5844
|
-
if (this.dataObs) {
|
|
5845
|
-
this.#$data = toSignal(this.data, { injector, initialValue: [] });
|
|
5775
|
+
assertInjector(s) {
|
|
5776
|
+
if (!s.injector) {
|
|
5777
|
+
throw new Error('Injector must be provided when passing a signal to table builder');
|
|
5846
5778
|
}
|
|
5847
|
-
if (this.metaNeeds) {
|
|
5848
|
-
if (this.metaData) {
|
|
5849
|
-
this.#$metaData = toSignal(this.metaData, { injector, initialValue: [] });
|
|
5850
|
-
}
|
|
5851
|
-
else {
|
|
5852
|
-
this.#$metaData = computed(() => this.createMetaData(this.#$data()[0]));
|
|
5853
|
-
}
|
|
5854
|
-
}
|
|
5855
|
-
this.$inited.set(true);
|
|
5856
|
-
}
|
|
5857
|
-
#dataCleaners = computed(() => {
|
|
5858
|
-
const metaData = this.$metaData();
|
|
5859
|
-
if (!metaData)
|
|
5860
|
-
return undefined;
|
|
5861
|
-
return createDataCleaners(metaData);
|
|
5862
|
-
});
|
|
5863
|
-
$data = computed(() => {
|
|
5864
|
-
const data = this.#$data();
|
|
5865
|
-
const cleaners = this.#dataCleaners();
|
|
5866
|
-
if (!data || !cleaners)
|
|
5867
|
-
return [];
|
|
5868
|
-
const cleanedData = data.map((data, i) => {
|
|
5869
|
-
const cleaned = cleaners(data);
|
|
5870
|
-
cleaned[initIndexSymbol] = i;
|
|
5871
|
-
return cleaned;
|
|
5872
|
-
});
|
|
5873
|
-
return cleanedData;
|
|
5874
|
-
});
|
|
5875
|
-
createMetaData(obj) {
|
|
5876
|
-
return Object.keys(obj ?? {})
|
|
5877
|
-
.map(key => ({
|
|
5878
|
-
key,
|
|
5879
|
-
fieldType: FieldType.Unknown,
|
|
5880
|
-
order: -1
|
|
5881
|
-
}));
|
|
5882
5779
|
}
|
|
5883
5780
|
}
|
|
5884
5781
|
const CreateTableBuilder = (reportDef$) => {
|
|
@@ -6104,5 +6001,5 @@ function setUpStoreFactoryOld(store, env) {
|
|
|
6104
6001
|
* Generated bundle index. Do not edit.
|
|
6105
6002
|
*/
|
|
6106
6003
|
|
|
6107
|
-
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule,
|
|
6004
|
+
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, parseTbSizeToPixels, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, setUpStoreFactoryOld, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
6108
6005
|
//# sourceMappingURL=one-paragon-angular-utilities.mjs.map
|