@one-paragon/angular-utilities 1.2.11 → 1.2.13
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/action-state/ngrx.d.ts +1 -1
- package/esm2022/table-builder/classes/TableBuilderDataSource.mjs +18 -27
- package/esm2022/table-builder/classes/table-builder.mjs +2 -2
- package/esm2022/table-builder/classes/table-store.mjs +9 -13
- package/esm2022/table-builder/components/column-builder/column-helpers.mjs +1 -3
- package/esm2022/table-builder/components/gen-col-displayer/gen-col-displayer.component.mjs +11 -17
- package/esm2022/table-builder/components/generic-table/generic-table.component.mjs +21 -20
- package/esm2022/table-builder/components/generic-table/paginator.component.mjs +58 -56
- package/esm2022/table-builder/components/table-container/table-container.mjs +55 -51
- package/esm2022/table-builder/components/table-container/virtual-scroll-container.mjs +57 -34
- package/esm2022/table-builder/directives/tb-filter.directive.mjs +10 -19
- package/esm2022/table-builder/services/export-to-csv.service.mjs +6 -16
- package/fesm2022/one-paragon-angular-utilities.mjs +239 -242
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/package.json +1 -1
- package/table-builder/classes/TableBuilderDataSource.d.ts +4 -4
- package/table-builder/classes/table-store.d.ts +5 -3
- package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +5 -3
- package/table-builder/components/generic-table/generic-table.component.d.ts +3 -1
- package/table-builder/components/generic-table/paginator.component.d.ts +20 -19
- package/table-builder/components/table-container/table-container-imports.d.ts +2 -2
- package/table-builder/components/table-container/table-container.d.ts +10 -11
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +15 -2
- package/table-builder/directives/table-wrapper.directive.d.ts +1 -1
- package/table-builder/directives/tb-filter.directive.d.ts +2 -3
- package/table-builder/services/export-to-csv.service.d.ts +1 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, isSignal, computed, Injectable, Pipe, Renderer2, ElementRef, booleanAttribute, signal, InjectionToken, makeEnvironmentProviders, HostListener, Component, ChangeDetectionStrategy, EventEmitter, untracked, Output, ContentChildren, ChangeDetectorRef, input, output, ViewChild, EnvironmentInjector, createComponent, viewChild, effect, forwardRef, contentChildren, ContentChild, APP_INITIALIZER } from '@angular/core';
|
|
3
|
-
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, first as first$1,
|
|
2
|
+
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, isSignal, computed, Injectable, Pipe, Renderer2, ElementRef, booleanAttribute, signal, InjectionToken, makeEnvironmentProviders, HostListener, Component, ChangeDetectionStrategy, EventEmitter, untracked, Output, ContentChildren, ChangeDetectorRef, input, output, ViewChild, EnvironmentInjector, createComponent, viewChild, effect, forwardRef, contentChildren, runInInjectionContext, ContentChild, APP_INITIALIZER } from '@angular/core';
|
|
3
|
+
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, debounceTime, distinctUntilChanged, first as first$1, observeOn, scan as scan$1, timestamp as timestamp$1, mergeAll } 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,
|
|
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, BehaviorSubject, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, animationFrameScheduler, timestamp } from 'rxjs';
|
|
6
6
|
import { ComponentStore } from '@ngrx/component-store';
|
|
7
7
|
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
8
8
|
import * as i1$8 from '@angular/common';
|
|
@@ -10,7 +10,7 @@ import { DatePipe, CurrencyPipe, AsyncPipe, KeyValuePipe, NgTemplateOutlet, NgCl
|
|
|
10
10
|
import * as i3$2 from '@angular/material/sort';
|
|
11
11
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
12
12
|
import { v4 } from 'uuid';
|
|
13
|
-
import { merge as merge$1, get, sumBy, difference,
|
|
13
|
+
import { merge as merge$1, get, sumBy, difference, intersection, groupBy, orderBy, set, cloneDeep } from 'lodash';
|
|
14
14
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
15
15
|
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
|
16
16
|
import * as i10 from '@angular/material/radio';
|
|
@@ -1118,27 +1118,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
1118
1118
|
selector: ' '
|
|
1119
1119
|
}]
|
|
1120
1120
|
}] });
|
|
1121
|
-
class TableFilterDirective
|
|
1121
|
+
class TableFilterDirective {
|
|
1122
1122
|
model = inject(NgControl, { optional: true });
|
|
1123
1123
|
wrapper = inject(TableWrapperDirective, { optional: true });
|
|
1124
1124
|
constructor() {
|
|
1125
|
-
super();
|
|
1126
1125
|
if (this.wrapper) {
|
|
1127
1126
|
this.wrapper.register(this);
|
|
1128
1127
|
}
|
|
1129
1128
|
if (this.model) {
|
|
1130
|
-
this.
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
this.update();
|
|
1134
|
-
}));
|
|
1129
|
+
subscriber(this.model.valueChanges, val => {
|
|
1130
|
+
this.filterValue = val;
|
|
1131
|
+
this.update();
|
|
1135
1132
|
});
|
|
1136
1133
|
}
|
|
1137
1134
|
}
|
|
1138
1135
|
reset() {
|
|
1139
1136
|
this.filterValue = undefined;
|
|
1140
1137
|
}
|
|
1141
|
-
filter$ =
|
|
1138
|
+
filter$ = new Subject;
|
|
1142
1139
|
filterType;
|
|
1143
1140
|
key;
|
|
1144
1141
|
fieldType;
|
|
@@ -1173,7 +1170,7 @@ class TableFilterDirective extends ComponentStore {
|
|
|
1173
1170
|
this.update();
|
|
1174
1171
|
}
|
|
1175
1172
|
setFilter(filter) {
|
|
1176
|
-
this.
|
|
1173
|
+
this.filter$.next(filter);
|
|
1177
1174
|
}
|
|
1178
1175
|
update() {
|
|
1179
1176
|
if (this.ready) {
|
|
@@ -1189,7 +1186,7 @@ class TableFilterDirective extends ComponentStore {
|
|
|
1189
1186
|
}
|
|
1190
1187
|
}
|
|
1191
1188
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableFilterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1192
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.2", type: TableFilterDirective, isStandalone: true, selector: "[tbFilter]", inputs: { filterType: "filterType", key: "key", fieldType: "fieldType", filterId: "filterId", active: "active", filterValue: "filterValue" },
|
|
1189
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.2", type: TableFilterDirective, isStandalone: true, selector: "[tbFilter]", inputs: { filterType: "filterType", key: "key", fieldType: "fieldType", filterId: "filterId", active: "active", filterValue: "filterValue" }, usesOnChanges: true, ngImport: i0 });
|
|
1193
1190
|
}
|
|
1194
1191
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableFilterDirective, decorators: [{
|
|
1195
1192
|
type: Directive,
|
|
@@ -1215,12 +1212,6 @@ class TableFilterStringContainsDirective extends TableFilterDirective {
|
|
|
1215
1212
|
super();
|
|
1216
1213
|
this.filterType = FilterTypes.StringContains;
|
|
1217
1214
|
this.fieldType = FieldType.String;
|
|
1218
|
-
this.effect(() => {
|
|
1219
|
-
return this.model.valueChanges.pipe(tap$1(val => {
|
|
1220
|
-
this.filterValue = val;
|
|
1221
|
-
this.update();
|
|
1222
|
-
}));
|
|
1223
|
-
});
|
|
1224
1215
|
}
|
|
1225
1216
|
reset() {
|
|
1226
1217
|
if (this.model) {
|
|
@@ -1739,7 +1730,7 @@ class TableStore extends ComponentStore {
|
|
|
1739
1730
|
}
|
|
1740
1731
|
selectStateReady = this.select(state => state.initializationState).pipe(filter(i => i === InitializationState.Ready));
|
|
1741
1732
|
getSavableState() {
|
|
1742
|
-
return this.state$.pipe(map(s => {
|
|
1733
|
+
return this.state$.pipe(debounceTime(300), map(s => {
|
|
1743
1734
|
return this.mapSaveableState(s);
|
|
1744
1735
|
}));
|
|
1745
1736
|
}
|
|
@@ -1957,6 +1948,8 @@ class TableStore extends ComponentStore {
|
|
|
1957
1948
|
tableSettings.collapseFooter = !tableSettings.collapseFooter;
|
|
1958
1949
|
return ({ ...state, persistedTableSettings: new PersistedTableSettings(tableSettings) });
|
|
1959
1950
|
});
|
|
1951
|
+
$collapseFooter = this.selectSignal(state => state.persistedTableSettings.collapseFooter);
|
|
1952
|
+
$collapseHeader = this.selectSignal(state => state.persistedTableSettings.collapseHeader);
|
|
1960
1953
|
addGroupByKey = this.updater((state, metaDataKey) => ({
|
|
1961
1954
|
...state,
|
|
1962
1955
|
groupBy: [...state.groupBy, { key: metaDataKey, expandedHeaders: [] }]
|
|
@@ -2039,27 +2032,22 @@ class TableStore extends ComponentStore {
|
|
|
2039
2032
|
return 'all';
|
|
2040
2033
|
}
|
|
2041
2034
|
});
|
|
2042
|
-
|
|
2043
|
-
$orderedVisibleColumns = this.selectSignal(this.$
|
|
2035
|
+
$orderedCodeVisibleMetaDatas = this.selectSignal(this.$metaDataArray, (mds) => mds.filter(m => m.fieldType !== FieldType.Hidden), { equal: (a, b) => b.length === a.length && b.every((s, i) => a[i].key === s.key) });
|
|
2036
|
+
$orderedVisibleColumns = this.selectSignal(this.$orderedCodeVisibleMetaDatas, this.$hiddenKeys, (cs, hiddenKeys) => cs.filter(m => !hiddenKeys.includes(m.key)).map(m => m.key));
|
|
2037
|
+
$currentPage = this.selectSignal(state => state.currentPage);
|
|
2038
|
+
$pageSize = this.selectSignal(s => s.userDefined?.pageSize || s.pageSize);
|
|
2044
2039
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2045
2040
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableStore });
|
|
2046
2041
|
}
|
|
2047
2042
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableStore, decorators: [{
|
|
2048
2043
|
type: Injectable
|
|
2049
2044
|
}], ctorParameters: () => [] });
|
|
2050
|
-
const orderedVisibleColumns = (state) => orderedStateVisibleMetaData(state).map(md => md.key);
|
|
2051
2045
|
const orderedStateVisibleMetaData = (state) => {
|
|
2052
2046
|
const ordered = orderStateMetaData(state);
|
|
2053
2047
|
const orderedVisible = ordered
|
|
2054
2048
|
.filter(metaData => !state.hiddenKeys.includes(metaData.key) && state.metaData[metaData.key].fieldType !== FieldType.Hidden);
|
|
2055
2049
|
return orderedVisible;
|
|
2056
2050
|
};
|
|
2057
|
-
const orderedVisibleMetaData = (metaData, userDefinedOrder, hiddenKeys) => {
|
|
2058
|
-
const ordered = orderMetaData(metaData, userDefinedOrder);
|
|
2059
|
-
const orderedVisible = ordered
|
|
2060
|
-
.filter(m => !hiddenKeys.includes(m.key) && metaData[m.key].fieldType !== FieldType.Hidden);
|
|
2061
|
-
return orderedVisible;
|
|
2062
|
-
};
|
|
2063
2051
|
const orderedCodeVisibleMetaData = (state) => orderStateMetaData(state).filter(md => md.fieldType !== FieldType.Hidden);
|
|
2064
2052
|
const orderStateMetaData = (state) => {
|
|
2065
2053
|
return orderMetaData(state.metaData, state.userDefined.order);
|
|
@@ -2902,15 +2890,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
2902
2890
|
|
|
2903
2891
|
class GenColDisplayerComponent {
|
|
2904
2892
|
tableState = inject(TableStore);
|
|
2905
|
-
columns
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
displayName: md.displayName,
|
|
2911
|
-
isVisible: !state.hiddenKeys.includes(md.key)
|
|
2912
|
-
}))), defaultShareReplay());
|
|
2913
|
-
}
|
|
2893
|
+
$columns = computed(() => this.tableState.$orderedCodeVisibleMetaDatas().map(md => ({
|
|
2894
|
+
key: md.key,
|
|
2895
|
+
displayName: md.displayName,
|
|
2896
|
+
isVisible: !this.tableState.$hiddenKeys().includes(md.key)
|
|
2897
|
+
})));
|
|
2914
2898
|
reset(displayCols) {
|
|
2915
2899
|
displayCols.forEach(c => c.isVisible = true);
|
|
2916
2900
|
this.emit(displayCols);
|
|
@@ -2926,15 +2910,15 @@ class GenColDisplayerComponent {
|
|
|
2926
2910
|
this.tableState.setHiddenColumns(displayCols.map(c => ({ key: c.key, visible: c.isVisible })));
|
|
2927
2911
|
}
|
|
2928
2912
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenColDisplayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2929
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: GenColDisplayerComponent, isStandalone: true, selector: "tb-col-displayer", ngImport: i0, template: "@if(columns
|
|
2913
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: GenColDisplayerComponent, isStandalone: true, selector: "tb-col-displayer", ngImport: i0, template: "@if($columns(); as displayCols){\r\n <span matTooltip=\"Show/hide columns\">\r\n <button mat-icon-button [matMenuTriggerFor]=\"menu\">\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n </button>\r\n </span>\r\n <mat-menu #menu=\"matMenu\" class=\"my-mat-menu\">\r\n\r\n <button mat-menu-item>\r\n <span matTooltip=\"Close\">\r\n <button class=\"filter-button\" mat-icon-button>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </span>\r\n </button>\r\n\r\n <button mat-menu-item stop-propagation>\r\n <span matTooltip=\"Show all columns\">\r\n <button mat-icon-button (click)=\"reset(displayCols)\">\r\n <mat-icon color=\"primary\">done_all</mat-icon>\r\n </button>\r\n </span>\r\n\r\n <span matTooltip=\"Hide all columns\">\r\n <button mat-icon-button (click)=\"unset(displayCols)\">\r\n <mat-icon color=\"primary\">cancel</mat-icon>\r\n </button>\r\n </span>\r\n </button>\r\n\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" stop-propagation [cdkDropListLockAxis]=\"'y'\">\r\n @for (col of displayCols; track col.key) {\r\n <button [class.isHidden]=\"!col.isVisible\" stop-propagation mat-menu-item cdkDrag [cdkDragData]=\"col\">\r\n <div (click)=\"col.isVisible = !col.isVisible; emit(displayCols)\" style=\"display: flex; align-items: center;\">\r\n @if(col.isVisible){\r\n <button mat-icon-button matTooltip=\"Hide Column\" class=\"show-hide\">\r\n <mat-icon color=\"primary\">check_box</mat-icon>\r\n </button>\r\n } @else {\r\n <button mat-icon-button matTooltip=\"Show Column\" class=\"show-hide\">\r\n <mat-icon>indeterminate_check_box</mat-icon>\r\n </button>\r\n }\r\n \r\n <p class=\"label\">\r\n {{col.displayName || (col.key | spaceCase) }}\r\n </p>\r\n\r\n </div>\r\n </button>\r\n }\r\n\r\n </div>\r\n </mat-menu>\r\n}", styles: [".show-hide{margin-right:15px;height:24px;width:24px;padding:4px}.label{color:#6495ed;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;margin:0;font-size:17px;font-weight:700;display:inline-block;width:66%}.row{margin:0;padding:0}.isHidden{background-color:#d3d3d3;color:#a9a9a9;font-weight:700;font-size:17px;white-space:nowrap}.filter-button{margin-top:10px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.mdc-list-item__primary-text{display:inline-block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { 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.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4$2.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: i4$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { 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: "directive", type: i5.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "pipe", type: SpaceCasePipe, name: "spaceCase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2930
2914
|
}
|
|
2931
2915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenColDisplayerComponent, decorators: [{
|
|
2932
2916
|
type: Component,
|
|
2933
2917
|
args: [{ selector: 'tb-col-displayer', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2934
2918
|
AsyncPipe, MatTooltipModule, MatIconModule, MatButtonModule, MatMenuModule, StopPropagationDirective,
|
|
2935
2919
|
DragDropModule, SpaceCasePipe
|
|
2936
|
-
], template: "@if(columns
|
|
2937
|
-
}]
|
|
2920
|
+
], template: "@if($columns(); as displayCols){\r\n <span matTooltip=\"Show/hide columns\">\r\n <button mat-icon-button [matMenuTriggerFor]=\"menu\">\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n </button>\r\n </span>\r\n <mat-menu #menu=\"matMenu\" class=\"my-mat-menu\">\r\n\r\n <button mat-menu-item>\r\n <span matTooltip=\"Close\">\r\n <button class=\"filter-button\" mat-icon-button>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </span>\r\n </button>\r\n\r\n <button mat-menu-item stop-propagation>\r\n <span matTooltip=\"Show all columns\">\r\n <button mat-icon-button (click)=\"reset(displayCols)\">\r\n <mat-icon color=\"primary\">done_all</mat-icon>\r\n </button>\r\n </span>\r\n\r\n <span matTooltip=\"Hide all columns\">\r\n <button mat-icon-button (click)=\"unset(displayCols)\">\r\n <mat-icon color=\"primary\">cancel</mat-icon>\r\n </button>\r\n </span>\r\n </button>\r\n\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\" stop-propagation [cdkDropListLockAxis]=\"'y'\">\r\n @for (col of displayCols; track col.key) {\r\n <button [class.isHidden]=\"!col.isVisible\" stop-propagation mat-menu-item cdkDrag [cdkDragData]=\"col\">\r\n <div (click)=\"col.isVisible = !col.isVisible; emit(displayCols)\" style=\"display: flex; align-items: center;\">\r\n @if(col.isVisible){\r\n <button mat-icon-button matTooltip=\"Hide Column\" class=\"show-hide\">\r\n <mat-icon color=\"primary\">check_box</mat-icon>\r\n </button>\r\n } @else {\r\n <button mat-icon-button matTooltip=\"Show Column\" class=\"show-hide\">\r\n <mat-icon>indeterminate_check_box</mat-icon>\r\n </button>\r\n }\r\n \r\n <p class=\"label\">\r\n {{col.displayName || (col.key | spaceCase) }}\r\n </p>\r\n\r\n </div>\r\n </button>\r\n }\r\n\r\n </div>\r\n </mat-menu>\r\n}", styles: [".show-hide{margin-right:15px;height:24px;width:24px;padding:4px}.label{color:#6495ed;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;margin:0;font-size:17px;font-weight:700;display:inline-block;width:66%}.row{margin:0;padding:0}.isHidden{background-color:#d3d3d3;color:#a9a9a9;font-weight:700;font-size:17px;white-space:nowrap}.filter-button{margin-top:10px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.mdc-list-item__primary-text{display:inline-block;width:100%}\n"] }]
|
|
2921
|
+
}] });
|
|
2938
2922
|
|
|
2939
2923
|
class WrapperFilterStore extends ComponentStore {
|
|
2940
2924
|
constructor() {
|
|
@@ -3488,8 +3472,6 @@ function calculateTableDefinedWidth(metaData, tableSettingsMinWidth) {
|
|
|
3488
3472
|
}
|
|
3489
3473
|
const calculateFlexWidth = (metaData, userDefinedWidth, tableSettingsMinWidth) => {
|
|
3490
3474
|
const definedWidth = calculateWidths(metaData, userDefinedWidth);
|
|
3491
|
-
if (definedWidth)
|
|
3492
|
-
console.log(metaData.key, definedWidth);
|
|
3493
3475
|
if (definedWidth)
|
|
3494
3476
|
return ({ flex: `0 0 ${definedWidth}`, maxWidth: 'none' });
|
|
3495
3477
|
const style = { flex: `${1}` };
|
|
@@ -3724,7 +3706,6 @@ class GenericTableComponent {
|
|
|
3724
3706
|
myColumns = signal({});
|
|
3725
3707
|
$showHeader = computed(() => !this.state.tableSettings().hideColumnHeader);
|
|
3726
3708
|
offset$ = this.dataStore.select(s => s.virtualScrollOffset);
|
|
3727
|
-
offsetIndex = 0;
|
|
3728
3709
|
dataView;
|
|
3729
3710
|
constructor() {
|
|
3730
3711
|
this.setUpSelections();
|
|
@@ -3796,15 +3777,21 @@ class GenericTableComponent {
|
|
|
3796
3777
|
this.selection.deselect(...removed);
|
|
3797
3778
|
}
|
|
3798
3779
|
});
|
|
3799
|
-
if (this.state.tableSettings().usePaginator || this.state.tableSettings().useVirtualScroll) {
|
|
3800
|
-
this.state.on(combineLatest([this.state.state$, this.dataStore.state$]), ([state, data]) => {
|
|
3801
|
-
this.offsetIndex = data.virtualEnds.start;
|
|
3802
|
-
if (this.state.tableSettings().usePaginator) {
|
|
3803
|
-
this.offsetIndex += (state.pageSize * state.currentPage);
|
|
3804
|
-
}
|
|
3805
|
-
});
|
|
3806
|
-
}
|
|
3807
3780
|
}
|
|
3781
|
+
$usePaginator = computed(() => this.state.tableSettings().usePaginator);
|
|
3782
|
+
$useVirtualScroll = computed(() => this.state.$viewType().includes('virtual'));
|
|
3783
|
+
$offsetIndex = computed(() => {
|
|
3784
|
+
const virtualStart = this.dataStore.selectSignal(d => d.virtualEnds.start)();
|
|
3785
|
+
const pageSize = this.state.$pageSize();
|
|
3786
|
+
const currentPage = this.state.$currentPage();
|
|
3787
|
+
if (this.$useVirtualScroll()) {
|
|
3788
|
+
return virtualStart;
|
|
3789
|
+
}
|
|
3790
|
+
if (this.$usePaginator()) {
|
|
3791
|
+
return pageSize * currentPage;
|
|
3792
|
+
}
|
|
3793
|
+
return 0;
|
|
3794
|
+
});
|
|
3808
3795
|
isGroupHeader(_, row) {
|
|
3809
3796
|
return row.isGroupHeader;
|
|
3810
3797
|
}
|
|
@@ -3847,14 +3834,11 @@ class GenericTableComponent {
|
|
|
3847
3834
|
this.state.on(this.selection.changed, c => this.selection$.emit(c));
|
|
3848
3835
|
}
|
|
3849
3836
|
$selectableData = computed(() => {
|
|
3850
|
-
if (this.state.$viewType() === 'paginator') {
|
|
3851
|
-
|
|
3837
|
+
if (this.state.$viewType() === 'virtual paginator' || this.state.$viewType() === 'paginator') {
|
|
3838
|
+
const previousPageRecords = this.state.$currentPage() * this.state.$pageSize();
|
|
3839
|
+
return this.$data().slice(previousPageRecords, previousPageRecords + this.state.$pageSize());
|
|
3852
3840
|
}
|
|
3853
|
-
else if (this.state.$viewType() === 'virtual
|
|
3854
|
-
const previousPageRecords = this.state.state().currentPage * this.state.state().pageSize;
|
|
3855
|
-
return this.$data().slice(previousPageRecords, previousPageRecords + this.state.state().pageSize);
|
|
3856
|
-
}
|
|
3857
|
-
else if (this.state.$viewType() === 'all') {
|
|
3841
|
+
else if (this.state.$viewType() === 'all' || this.state.$viewType() === 'virtual all') {
|
|
3858
3842
|
return this.$data();
|
|
3859
3843
|
}
|
|
3860
3844
|
return [];
|
|
@@ -3924,14 +3908,14 @@ class GenericTableComponent {
|
|
|
3924
3908
|
});
|
|
3925
3909
|
$stickyFooter = computed(() => this.state.props().stickyFooter || this.state.$isVirtual());
|
|
3926
3910
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenericTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3927
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: false, isRequired: false, transformFunction: null }, $displayData: { classPropertyName: "$displayData", publicName: "displayData", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: false, isRequired: false, transformFunction: null }, columnBuilders: { classPropertyName: "columnBuilders", publicName: "columnBuilders", isSignal: false, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, 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, static: true }], usesOnChanges: 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 [class]=\"($footerRowStyle())\"\r\n #table\r\n [dataSource]=\"state.props().dataSource!\"\r\n [trackBy]=\"trackByFunction\"\r\n [style]=\"tableWidth | async \"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!(masterToggleChecked$ | async)\"\r\n [indeterminate]=\"masterToggleIndeterminate$ | async\">\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$ | async)! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? (offset$ | async) : undefined\"/>", 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$5.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$5.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$5.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", "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: AsyncPipe, name: "async" }, { kind: "pipe", type: FunctionPipe, name: "func" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3911
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: false, isRequired: false, transformFunction: null }, $displayData: { classPropertyName: "$displayData", publicName: "displayData", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: false, isRequired: false, transformFunction: null }, columnBuilders: { classPropertyName: "columnBuilders", publicName: "columnBuilders", isSignal: false, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, 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, static: true }], usesOnChanges: 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 [class]=\"($footerRowStyle())\"\r\n #table\r\n [dataSource]=\"state.props().dataSource!\"\r\n [trackBy]=\"trackByFunction\"\r\n [style]=\"tableWidth | async \"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!(masterToggleChecked$ | async)\"\r\n [indeterminate]=\"masterToggleIndeterminate$ | async\">\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$ | async)! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? (offset$ | async) : undefined\"/>", 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}mat-table{overflow-x:auto}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$5.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$5.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$5.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", "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: AsyncPipe, name: "async" }, { kind: "pipe", type: FunctionPipe, name: "func" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3928
3912
|
}
|
|
3929
3913
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenericTableComponent, decorators: [{
|
|
3930
3914
|
type: Component,
|
|
3931
3915
|
args: [{ selector: 'tb-generic-table', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
3932
3916
|
MatTableModule, DragDropModule, MatCheckboxModule, MatButtonModule, MatIconModule, NgTemplateOutlet,
|
|
3933
3917
|
MatTooltipModule, AsyncPipe, FunctionPipe,
|
|
3934
|
-
], 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 [class]=\"($footerRowStyle())\"\r\n #table\r\n [dataSource]=\"state.props().dataSource!\"\r\n [trackBy]=\"trackByFunction\"\r\n [style]=\"tableWidth | async \"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!(masterToggleChecked$ | async)\"\r\n [indeterminate]=\"masterToggleIndeterminate$ | async\">\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$ | async)! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? (offset$ | async) : undefined\"/>", 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}\n"] }]
|
|
3918
|
+
], 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 [class]=\"($footerRowStyle())\"\r\n #table\r\n [dataSource]=\"state.props().dataSource!\"\r\n [trackBy]=\"trackByFunction\"\r\n [style]=\"tableWidth | async \"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!(masterToggleChecked$ | async)\"\r\n [indeterminate]=\"masterToggleIndeterminate$ | async\">\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$ | async)! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? (offset$ | async) : undefined\"/>", 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}mat-table{overflow-x:auto}\n"] }]
|
|
3935
3919
|
}], ctorParameters: () => [], propDecorators: { trackBy: [{
|
|
3936
3920
|
type: Input
|
|
3937
3921
|
}], rows: [{
|
|
@@ -3962,8 +3946,10 @@ class ExportToCsvService {
|
|
|
3962
3946
|
config = inject(TableBuilderConfigToken);
|
|
3963
3947
|
datePipe = inject(DatePipe);
|
|
3964
3948
|
exportToCsv = (data) => {
|
|
3965
|
-
const
|
|
3966
|
-
|
|
3949
|
+
const hiddenKeys = this.state.selectSignal(s => s.hiddenKeys)();
|
|
3950
|
+
const meta = this.state.$metaDataArray().filter(md => !md.noExport && !hiddenKeys.includes(md.key));
|
|
3951
|
+
const csv = this.csvData(data, meta);
|
|
3952
|
+
downloadData(csv, 'export.csv', 'text/csv');
|
|
3967
3953
|
};
|
|
3968
3954
|
csvData = (data, metaData) => {
|
|
3969
3955
|
const res = data.map(row => metaData.map(meta => this.metaToField(meta, row)).join(','));
|
|
@@ -4020,38 +4006,12 @@ class ExportToCsvService {
|
|
|
4020
4006
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ExportToCsvService, decorators: [{
|
|
4021
4007
|
type: Injectable
|
|
4022
4008
|
}] });
|
|
4023
|
-
const removeFromMetaData = (state, keysToRemove) => orderStateMetaData(state)
|
|
4024
|
-
.filter(meta => !keysToRemove.includes(meta.key));
|
|
4025
|
-
const nonExportableFields = (state) => Object.values(state.metaData)
|
|
4026
|
-
.filter(md => md.noExport)
|
|
4027
|
-
.map(md => md.key);
|
|
4028
|
-
const mapExportableFields = (state) => {
|
|
4029
|
-
const fieldsToRemove = nonExportableFields(state)
|
|
4030
|
-
.concat(state.hiddenKeys);
|
|
4031
|
-
return removeFromMetaData(state, fieldsToRemove);
|
|
4032
|
-
};
|
|
4033
4009
|
|
|
4034
4010
|
const ArrayDefaults = {
|
|
4035
4011
|
limit: 3,
|
|
4036
4012
|
arrayStyle: ArrayStyle.CommaDelimited
|
|
4037
4013
|
};
|
|
4038
4014
|
|
|
4039
|
-
function sortData(data, sorted) {
|
|
4040
|
-
const ordered = orderBy(data, sorted.map(r => r.active), sorted.map(r => r.direction));
|
|
4041
|
-
return ordered;
|
|
4042
|
-
}
|
|
4043
|
-
function filterData(data, filters, resetAll = false) {
|
|
4044
|
-
for (let index = 0; index < data.length; index++) {
|
|
4045
|
-
const element = data[index];
|
|
4046
|
-
const hide = !filters.every(filter => filter(element));
|
|
4047
|
-
if (hide || resetAll) {
|
|
4048
|
-
element[tbNoShowSymbol] = hide;
|
|
4049
|
-
}
|
|
4050
|
-
}
|
|
4051
|
-
return data;
|
|
4052
|
-
}
|
|
4053
|
-
const tbNoShowSymbol = Symbol('tb_no_show');
|
|
4054
|
-
|
|
4055
4015
|
function createLinkCreatorDict(metaDatas) {
|
|
4056
4016
|
return metaDatas.reduce((acc, md) => {
|
|
4057
4017
|
if (md.fieldType === FieldType.Link) {
|
|
@@ -4365,32 +4325,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4365
4325
|
class PaginatorComponent {
|
|
4366
4326
|
state = inject(TableStore);
|
|
4367
4327
|
data = inject(DataStore);
|
|
4368
|
-
paginator;
|
|
4369
|
-
|
|
4370
|
-
$
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4328
|
+
$paginator = viewChild(MatPaginator);
|
|
4329
|
+
$tableElRef = input.required({ alias: 'tableElRef' });
|
|
4330
|
+
$dataLength = this.data.selectSignal(d => d.dataLen);
|
|
4331
|
+
pageEvent$ = toObservable(this.$paginator).pipe(notNull(), switchMap(p => p.page));
|
|
4332
|
+
$pageEvent = toSignal(this.pageEvent$);
|
|
4333
|
+
$pageIndexChangeEvent = computed(() => this.$pageEvent()?.pageIndex);
|
|
4334
|
+
$pageSizeChangeEvent = computed(() => this.$pageEvent()?.pageSize);
|
|
4335
|
+
$currentPageData = computed(() => {
|
|
4336
|
+
const pageEvent = this.$pageEvent();
|
|
4337
|
+
if (!pageEvent)
|
|
4338
|
+
return;
|
|
4339
|
+
const pageDetails = mapPaginationEventToCurrentPageDetails(pageEvent);
|
|
4340
|
+
const dataLength = this.$dataLength();
|
|
4341
|
+
return ({ ...pageDetails, total: dataLength });
|
|
4342
|
+
});
|
|
4343
|
+
onPageIndexEffect = effect(() => {
|
|
4344
|
+
const index = this.$pageIndexChangeEvent();
|
|
4345
|
+
untracked(() => this.state.updateState({ currentPage: index }));
|
|
4346
|
+
});
|
|
4347
|
+
onPageSizeEffect = effect(() => {
|
|
4348
|
+
const size = this.$pageSizeChangeEvent();
|
|
4349
|
+
if (!size)
|
|
4350
|
+
return;
|
|
4351
|
+
untracked(() => this.state.setPageSize(size));
|
|
4352
|
+
});
|
|
4353
|
+
onMetaPageSizeEffect = effect(() => {
|
|
4354
|
+
const paginator = this.$paginator();
|
|
4355
|
+
if (!paginator)
|
|
4356
|
+
return;
|
|
4357
|
+
const metaPageSize = this.state.$pageSize();
|
|
4358
|
+
untracked(() => paginator._changePageSize(metaPageSize));
|
|
4359
|
+
});
|
|
4360
|
+
onDataLengthEffect = effect(() => {
|
|
4361
|
+
const paginator = this.$paginator();
|
|
4362
|
+
const dataLength = this.$dataLength();
|
|
4363
|
+
untracked(() => {
|
|
4364
|
+
if (paginator) {
|
|
4365
|
+
paginator.length = dataLength;
|
|
4366
|
+
}
|
|
4378
4367
|
});
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
}
|
|
4382
|
-
ngAfterViewInit() {
|
|
4383
|
-
this.currentPageData$ = merge(this.paginator.page.pipe(map(mapPaginationEventToCurrentPageDetails)), this.data$.pipe(distinctUntilKeyChanged("length"), delayToAllowForProperUpdate, map(updateCurrentPageDetailsOnDataLengthChange(this.paginator))));
|
|
4384
|
-
}
|
|
4385
|
-
paginatorChange() {
|
|
4386
|
-
if (!this.ourPageEvent) {
|
|
4387
|
-
setTimeout(() => this.tableElRef?.nativeElement?.scrollIntoView(), 0);
|
|
4388
|
-
}
|
|
4389
|
-
else {
|
|
4390
|
-
this.ourPageEvent = false;
|
|
4391
|
-
}
|
|
4392
|
-
}
|
|
4393
|
-
ourPageEvent = false;
|
|
4368
|
+
});
|
|
4369
|
+
$collapseFooter = computed(() => this.state.selectSignal(state => state.persistedTableSettings.collapseFooter)() || this.$showAll());
|
|
4394
4370
|
$showAllOption = this.state.selectSignal(s => s.notPersistedTableSettings?.includeAllInPaginatorOptions);
|
|
4395
4371
|
$showAll = this.state.selectSignal(s => s.showAll);
|
|
4396
4372
|
updatePaginator = this.state.updater(state => ({ ...state, showAll: !state.showAll }));
|
|
@@ -4398,56 +4374,41 @@ class PaginatorComponent {
|
|
|
4398
4374
|
this.updatePaginator();
|
|
4399
4375
|
}
|
|
4400
4376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4401
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: PaginatorComponent, isStandalone: true, selector: "tb-paginator", inputs: {
|
|
4377
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: PaginatorComponent, isStandalone: true, selector: "tb-paginator", inputs: { $tableElRef: { classPropertyName: "$tableElRef", publicName: "tableElRef", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "$paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
4402
4378
|
<div class="paginator-row">
|
|
4403
|
-
@if(currentPageData
|
|
4379
|
+
@if($currentPageData(); as pageData){
|
|
4404
4380
|
<div [class]="{ 'hide' : ! $collapseFooter(), 'page-amounts':true}">
|
|
4405
|
-
@if(!$showAll()){{{pageData.currentStart}} - {{pageData.currentEnd}} of }{{pageData.total}}
|
|
4381
|
+
@if(!$showAll()){ {{pageData.currentStart}} - {{pageData.currentEnd}} of }{{pageData.total}}
|
|
4406
4382
|
</div>
|
|
4407
4383
|
}
|
|
4408
|
-
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
4384
|
+
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
4409
4385
|
[class]="{ 'hide' : $collapseFooter() }">
|
|
4410
4386
|
</mat-paginator>
|
|
4411
4387
|
@if ($showAllOption()) {<button mat-button (click)="updatePaginator()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
4412
4388
|
</div>
|
|
4413
|
-
`, isInline: true, 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}\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: "
|
|
4389
|
+
`, isInline: true, 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}mat-table{overflow-x:auto}\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: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1$6.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4414
4390
|
}
|
|
4415
4391
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
4416
4392
|
type: Component,
|
|
4417
|
-
args: [{ selector: 'tb-paginator', standalone: true, imports: [
|
|
4393
|
+
args: [{ selector: 'tb-paginator', standalone: true, imports: [MatPaginatorModule, NgClass, MatButtonModule], template: `
|
|
4418
4394
|
<div class="paginator-row">
|
|
4419
|
-
@if(currentPageData
|
|
4395
|
+
@if($currentPageData(); as pageData){
|
|
4420
4396
|
<div [class]="{ 'hide' : ! $collapseFooter(), 'page-amounts':true}">
|
|
4421
|
-
@if(!$showAll()){{{pageData.currentStart}} - {{pageData.currentEnd}} of }{{pageData.total}}
|
|
4397
|
+
@if(!$showAll()){ {{pageData.currentStart}} - {{pageData.currentEnd}} of }{{pageData.total}}
|
|
4422
4398
|
</div>
|
|
4423
4399
|
}
|
|
4424
|
-
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
4400
|
+
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
4425
4401
|
[class]="{ 'hide' : $collapseFooter() }">
|
|
4426
4402
|
</mat-paginator>
|
|
4427
4403
|
@if ($showAllOption()) {<button mat-button (click)="updatePaginator()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
4428
4404
|
</div>
|
|
4429
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}\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"] }]
|
|
4430
|
-
}]
|
|
4431
|
-
type: ViewChild,
|
|
4432
|
-
args: [MatPaginator, { static: true }]
|
|
4433
|
-
}], data$: [{
|
|
4434
|
-
type: Input
|
|
4435
|
-
}], tableElRef: [{
|
|
4436
|
-
type: Input,
|
|
4437
|
-
args: [{ required: true }]
|
|
4438
|
-
}] } });
|
|
4405
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, 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}.small-footer mat-footer-row{min-height:1rem;height:1rem}mat-table{overflow-x:auto}\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"] }]
|
|
4406
|
+
}] });
|
|
4439
4407
|
const mapPaginationEventToCurrentPageDetails = (pageData) => ({
|
|
4440
4408
|
currentStart: (pageData.pageIndex * pageData.pageSize) + 1,
|
|
4441
4409
|
currentEnd: Math.min(pageData.length, ((pageData.pageIndex + 1) * pageData.pageSize)),
|
|
4442
4410
|
total: pageData.length
|
|
4443
4411
|
});
|
|
4444
|
-
const updateCurrentPageDetailsOnDataLengthChange = (paginator) => () => ({ currentStart: (paginator.pageIndex * paginator.pageSize) + 1,
|
|
4445
|
-
currentEnd: Math.min(paginator.length, ((paginator.pageIndex + 1) * paginator.pageSize)),
|
|
4446
|
-
total: paginator.length });
|
|
4447
|
-
const delayToAllowForProperUpdate = delay$1(0, asyncScheduler);
|
|
4448
|
-
const metaDataPageSizeChange = (state) => state.state$.pipe(map(state => state.userDefined.pageSize || state.pageSize), distinctUntilChanged());
|
|
4449
|
-
const setPaginatorPageSize = (paginator) => (pageSize) => paginator._changePageSize(pageSize);
|
|
4450
|
-
const onPaginatorPageSizeChange = (paginator) => paginator.page.pipe(map(e => e.pageSize), distinctUntilChanged());
|
|
4451
4412
|
|
|
4452
4413
|
class TableVirtualScrollStrategy {
|
|
4453
4414
|
itemHeight;
|
|
@@ -4512,47 +4473,69 @@ class VirtualScrollContainer {
|
|
|
4512
4473
|
viewport = viewChild(CdkVirtualScrollViewport);
|
|
4513
4474
|
defaultOptions = new VirtualScrollOptions();
|
|
4514
4475
|
scrollStrategy = new TableVirtualScrollStrategy(this.computedRowHeight(), this.computedHeaderHeight());
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4476
|
+
$usePaginator = this.state.selectSignal(s => s.notPersistedTableSettings.usePaginator);
|
|
4477
|
+
$pageSize = this.state.$pageSize;
|
|
4478
|
+
$currentPage = this.state.$currentPage;
|
|
4479
|
+
$showAll = this.state.selectSignal(s => s.showAll);
|
|
4480
|
+
$stateDataLength = this.dataStore.selectSignal(s => s.dataLen);
|
|
4481
|
+
$dataLength = computed(() => {
|
|
4482
|
+
const paginated = this.$usePaginator() && !this.$showAll();
|
|
4483
|
+
const pageSize = this.$pageSize();
|
|
4484
|
+
const pageNumber = this.$currentPage();
|
|
4485
|
+
const dataLen = this.$stateDataLength();
|
|
4524
4486
|
if (paginated)
|
|
4525
4487
|
return Math.min(dataLen - (pageNumber * pageSize), pageSize);
|
|
4526
4488
|
return dataLen;
|
|
4527
|
-
}), distinctUntilChanged$1());
|
|
4528
|
-
subscriber = subscriber(this.dataLength$, (dataLength) => {
|
|
4529
|
-
this.scrollStrategy.setDataLength(dataLength);
|
|
4530
|
-
if (this.viewport()) {
|
|
4531
|
-
this.setSize(this.viewport().elementRef);
|
|
4532
|
-
}
|
|
4533
4489
|
});
|
|
4534
|
-
|
|
4490
|
+
constructor() {
|
|
4491
|
+
addEventListener('resize', this.resizeHandler);
|
|
4492
|
+
}
|
|
4493
|
+
setViewportEffect = effect(() => {
|
|
4535
4494
|
const viewport = this.viewport();
|
|
4536
4495
|
untracked(() => {
|
|
4537
4496
|
if (!!viewport) {
|
|
4538
|
-
addEventListener('resize', this.resizeHandler);
|
|
4539
|
-
this.subscriber.on(viewport.renderedRangeStream, (range) => {
|
|
4540
|
-
this.dataStore.patchState({
|
|
4541
|
-
virtualEnds: {
|
|
4542
|
-
start: range.start,
|
|
4543
|
-
end: range.end + 25,
|
|
4544
|
-
}
|
|
4545
|
-
});
|
|
4546
|
-
});
|
|
4547
|
-
var offset$ = viewport.scrolledIndexChange.pipe(map$1(() => viewport.getOffsetToRenderedContentStart() ?? 0), distinctUntilChanged$1(), defaultShareReplay());
|
|
4548
|
-
this.subscriber.on(offset$, (offset) => {
|
|
4549
|
-
this.dataStore.patchState({ virtualScrollOffset: offset });
|
|
4550
|
-
});
|
|
4551
4497
|
this.setSize(this.viewport().elementRef);
|
|
4552
4498
|
}
|
|
4553
4499
|
;
|
|
4554
4500
|
});
|
|
4555
4501
|
});
|
|
4502
|
+
subscriber = subscriber();
|
|
4503
|
+
onRenderedRangeEffect = effect(() => {
|
|
4504
|
+
const renderedRange = this.$renderedRange();
|
|
4505
|
+
if (!renderedRange)
|
|
4506
|
+
return;
|
|
4507
|
+
untracked(() => {
|
|
4508
|
+
this.dataStore.patchState({
|
|
4509
|
+
virtualEnds: {
|
|
4510
|
+
start: renderedRange.start,
|
|
4511
|
+
end: renderedRange.end + 25,
|
|
4512
|
+
}
|
|
4513
|
+
});
|
|
4514
|
+
this.setSize(this.viewport().elementRef);
|
|
4515
|
+
});
|
|
4516
|
+
});
|
|
4517
|
+
onDataLengthEffect = effect(() => {
|
|
4518
|
+
const dataLength = this.$dataLength();
|
|
4519
|
+
untracked(() => {
|
|
4520
|
+
this.scrollStrategy.setDataLength(dataLength);
|
|
4521
|
+
});
|
|
4522
|
+
});
|
|
4523
|
+
onOffsetEffect = effect(() => {
|
|
4524
|
+
const offset = this.$offset();
|
|
4525
|
+
untracked(() => {
|
|
4526
|
+
this.dataStore.patchState({ virtualScrollOffset: offset });
|
|
4527
|
+
});
|
|
4528
|
+
});
|
|
4529
|
+
viewPort$ = toObservable(this.viewport).pipe(notNull());
|
|
4530
|
+
$scrolledIndexChange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.scrolledIndexChange)));
|
|
4531
|
+
$renderedRange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.renderedRangeStream)));
|
|
4532
|
+
$offset = computed(() => {
|
|
4533
|
+
const viewport = this.viewport();
|
|
4534
|
+
const scrolledIndexChange = this.$scrolledIndexChange();
|
|
4535
|
+
if (!scrolledIndexChange || !viewport)
|
|
4536
|
+
return 0;
|
|
4537
|
+
return viewport.getOffsetToRenderedContentStart() ?? 0;
|
|
4538
|
+
});
|
|
4556
4539
|
ngOnDestroy() {
|
|
4557
4540
|
removeEventListener('resize', this.resizeHandler);
|
|
4558
4541
|
}
|
|
@@ -4622,7 +4605,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4622
4605
|
},
|
|
4623
4606
|
],
|
|
4624
4607
|
}]
|
|
4625
|
-
}] });
|
|
4608
|
+
}], ctorParameters: () => [] });
|
|
4626
4609
|
|
|
4627
4610
|
class ProfilesMenuComponent {
|
|
4628
4611
|
stateService = inject(TableBuilderStateStore);
|
|
@@ -4831,6 +4814,22 @@ const getGroupHeaders = (data, filterFunc, arr = []) => {
|
|
|
4831
4814
|
return arr;
|
|
4832
4815
|
};
|
|
4833
4816
|
|
|
4817
|
+
function sortData(data, sorted) {
|
|
4818
|
+
const ordered = orderBy(data, sorted.map(r => r.active), sorted.map(r => r.direction));
|
|
4819
|
+
return ordered;
|
|
4820
|
+
}
|
|
4821
|
+
function filterData(data, filters, resetAll = false) {
|
|
4822
|
+
for (let index = 0; index < data.length; index++) {
|
|
4823
|
+
const element = data[index];
|
|
4824
|
+
const hide = !filters.every(filter => filter(element));
|
|
4825
|
+
if (hide || resetAll) {
|
|
4826
|
+
element[tbNoShowSymbol] = hide;
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
return data;
|
|
4830
|
+
}
|
|
4831
|
+
const tbNoShowSymbol = Symbol('tb_no_show');
|
|
4832
|
+
|
|
4834
4833
|
const sortAndFilterData = (data, sortState, filterState) => combineLatest([
|
|
4835
4834
|
data.pipe(timestamp()),
|
|
4836
4835
|
sortState.pipe(timestamp()),
|
|
@@ -4975,40 +4974,32 @@ class TableBuilderDataSource extends MatTableDataSource {
|
|
|
4975
4974
|
constructor(dataSrc, state, data) {
|
|
4976
4975
|
super([]);
|
|
4977
4976
|
this.dataSrc = dataSrc;
|
|
4978
|
-
const
|
|
4979
|
-
const
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4977
|
+
const $currentPage = state.$currentPage;
|
|
4978
|
+
const $pageSize = state.$pageSize;
|
|
4979
|
+
const $virtualEnds = data.selectSignal(d => d.virtualEnds);
|
|
4980
|
+
const $dataLength = computed(() => dataSrc().length);
|
|
4981
|
+
const $dataSize = computed(() => {
|
|
4982
|
+
const viewType = state.$viewType();
|
|
4983
|
+
const dataLength = $dataLength();
|
|
4984
|
+
const currentPage = $currentPage();
|
|
4985
|
+
const pageSize = $pageSize();
|
|
4986
|
+
const virtualEnds = $virtualEnds();
|
|
4988
4987
|
const previousPageRecords = currentPage * pageSize;
|
|
4989
4988
|
if (viewType === 'virtual paginator') {
|
|
4990
|
-
return ({ start:
|
|
4989
|
+
return ({ start: virtualEnds.start + previousPageRecords, end: Math.min(virtualEnds.end, pageSize) + previousPageRecords });
|
|
4991
4990
|
}
|
|
4992
4991
|
if (viewType === 'paginator') {
|
|
4993
4992
|
return ({ start: previousPageRecords, end: previousPageRecords + pageSize });
|
|
4994
4993
|
}
|
|
4995
4994
|
if (viewType === 'all') {
|
|
4996
|
-
return ({ start: 0, end:
|
|
4995
|
+
return ({ start: 0, end: dataLength });
|
|
4997
4996
|
}
|
|
4998
|
-
return ({ start:
|
|
4999
|
-
})
|
|
5000
|
-
|
|
5001
|
-
this.
|
|
5002
|
-
.pipe(map$1(([data, size]) => data.slice(size.start, size.end)))
|
|
5003
|
-
.pipe(defaultShareReplay());
|
|
4997
|
+
return ({ start: virtualEnds.start, end: virtualEnds.end });
|
|
4998
|
+
});
|
|
4999
|
+
const $dataToShow = computed(() => dataSrc().slice($dataSize().start, $dataSize().end));
|
|
5000
|
+
effect(() => this.data = $dataToShow());
|
|
5004
5001
|
}
|
|
5005
|
-
dataToShow$;
|
|
5006
5002
|
connect() {
|
|
5007
|
-
if (!this.subscription) {
|
|
5008
|
-
this.subscription = this.dataToShow$.subscribe((data) => {
|
|
5009
|
-
this.data = data;
|
|
5010
|
-
});
|
|
5011
|
-
}
|
|
5012
5003
|
return super.connect();
|
|
5013
5004
|
}
|
|
5014
5005
|
disconnect() {
|
|
@@ -5022,7 +5013,7 @@ class TableBuilderDataSource extends MatTableDataSource {
|
|
|
5022
5013
|
|
|
5023
5014
|
class TableContainerComponent {
|
|
5024
5015
|
props = { ...defaultProps };
|
|
5025
|
-
|
|
5016
|
+
data = new BehaviorSubject([]);
|
|
5026
5017
|
state = inject(TableStore);
|
|
5027
5018
|
dataStore = inject(DataStore);
|
|
5028
5019
|
config = inject(TableBuilderConfigToken);
|
|
@@ -5032,7 +5023,7 @@ class TableContainerComponent {
|
|
|
5032
5023
|
injector = inject(Injector);
|
|
5033
5024
|
filterDirectives = contentChildren(TableFilterDirective, { descendants: true });
|
|
5034
5025
|
customFilterDirectives = contentChildren(TableCustomFilterDirective, { descendants: true });
|
|
5035
|
-
allFilterDirectives = computed(() => {
|
|
5026
|
+
$allFilterDirectives = computed(() => {
|
|
5036
5027
|
if (this.wrapper) {
|
|
5037
5028
|
return [...this.filterDirectives(), ...this.customFilterDirectives(), ...this.wrapper.$registrations()];
|
|
5038
5029
|
}
|
|
@@ -5040,15 +5031,17 @@ class TableContainerComponent {
|
|
|
5040
5031
|
return [...this.filterDirectives(), ...this.customFilterDirectives()];
|
|
5041
5032
|
}
|
|
5042
5033
|
});
|
|
5043
|
-
|
|
5034
|
+
$isInitializationState = (state) => computed(() => this.state.selectSignal(s => s.initializationState === state)());
|
|
5044
5035
|
allFilterDirectivesEffect = effect(() => {
|
|
5045
|
-
const
|
|
5036
|
+
const loaded = this.$isInitializationState(InitializationState.LoadedFromStore)();
|
|
5037
|
+
const stateFilters = this.state.$filters();
|
|
5038
|
+
const filterDirectives = this.$allFilterDirectives();
|
|
5046
5039
|
untracked(() => {
|
|
5047
|
-
if (
|
|
5048
|
-
|
|
5040
|
+
if (loaded) {
|
|
5041
|
+
filterDirectives.filter(f => !f.used).forEach(f => {
|
|
5049
5042
|
f.used = true;
|
|
5050
5043
|
if (f.savable) {
|
|
5051
|
-
var filter =
|
|
5044
|
+
var filter = stateFilters[f.filterId];
|
|
5052
5045
|
if (isFilterInfo(filter)) {
|
|
5053
5046
|
const filterDirective = f;
|
|
5054
5047
|
filterDirective.fieldType = filter.fieldType;
|
|
@@ -5100,27 +5093,27 @@ class TableContainerComponent {
|
|
|
5100
5093
|
trackBy;
|
|
5101
5094
|
inputFilters;
|
|
5102
5095
|
selection$ = new EventEmitter();
|
|
5103
|
-
data = this.
|
|
5096
|
+
$data = toSignal(this.data, { initialValue: [] });
|
|
5104
5097
|
onStateReset = new EventEmitter();
|
|
5105
5098
|
onSaveState = new EventEmitter();
|
|
5106
5099
|
state$ = this.state.getSavableState().pipe(map(state => cloneDeep(state)), defaultShareReplay());
|
|
5107
5100
|
clearSelections() {
|
|
5108
5101
|
this.genericTable?.selection.clear(true);
|
|
5109
5102
|
}
|
|
5110
|
-
|
|
5111
|
-
displayData = this.displayDataSubject.pipe(switchAll(), defaultShareReplay());
|
|
5103
|
+
displayData = new ReplaySubject(1);
|
|
5112
5104
|
$displayData = toSignal(this.displayData, { initialValue: [] });
|
|
5113
|
-
collapseFooter
|
|
5105
|
+
$collapseFooter = this.state.$collapseFooter;
|
|
5106
|
+
$collapseHeader = this.state.$collapseHeader;
|
|
5114
5107
|
ngOnDestroy() {
|
|
5115
5108
|
if (this.tableId) {
|
|
5116
5109
|
this.stateService.saveTableStateToLocal({ tableId: this.tableId, tableState: this.state.getSavableStateSignal() });
|
|
5117
5110
|
}
|
|
5118
5111
|
}
|
|
5119
5112
|
firstPage() {
|
|
5120
|
-
this.paginatorComponent
|
|
5113
|
+
this.paginatorComponent?.$paginator()?.firstPage();
|
|
5121
5114
|
}
|
|
5122
5115
|
lastPage() {
|
|
5123
|
-
this.paginatorComponent
|
|
5116
|
+
this.paginatorComponent?.$paginator()?.lastPage();
|
|
5124
5117
|
}
|
|
5125
5118
|
resetState() {
|
|
5126
5119
|
this.customFilterDirectives().forEach(cf => cf.reset());
|
|
@@ -5128,22 +5121,22 @@ class TableContainerComponent {
|
|
|
5128
5121
|
this.state.resetState();
|
|
5129
5122
|
this.onStateReset.next(null);
|
|
5130
5123
|
}
|
|
5131
|
-
|
|
5132
|
-
this
|
|
5133
|
-
|
|
5134
|
-
if (
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5124
|
+
initializeStateEffect = effect(() => {
|
|
5125
|
+
const metaLoaded = this.$isInitializationState(InitializationState.MetaDataLoaded)();
|
|
5126
|
+
untracked(() => {
|
|
5127
|
+
if (metaLoaded) {
|
|
5128
|
+
this.state.setTableSettings(this.tableBuilder.settings);
|
|
5129
|
+
if (this.tableId) {
|
|
5130
|
+
const persistedState = this.stateService.$selectLocalTableStateForView(this.tableId)();
|
|
5131
|
+
if (persistedState) {
|
|
5132
|
+
this.state.updateStateFromPersistedState(persistedState);
|
|
5133
|
+
return;
|
|
5138
5134
|
}
|
|
5139
|
-
}
|
|
5140
|
-
this.state.updateStateFromPersistedState(persistedState$.pipe(notNull()));
|
|
5141
|
-
}
|
|
5142
|
-
else {
|
|
5135
|
+
}
|
|
5143
5136
|
this.state.setInitializationState(InitializationState.LoadedFromStore);
|
|
5144
5137
|
}
|
|
5145
5138
|
});
|
|
5146
|
-
}
|
|
5139
|
+
});
|
|
5147
5140
|
customFilters$ = new BehaviorSubject([]);
|
|
5148
5141
|
initializeData() {
|
|
5149
5142
|
const predicateFilters$ = combineLatest([this.inputFilters?.pipe(startWith([])) ?? of([]), this.customFilters$])
|
|
@@ -5156,29 +5149,35 @@ class TableContainerComponent {
|
|
|
5156
5149
|
const sortsState$ = this.state.sort$.pipe(scan$1(updateSortState, initialSortState));
|
|
5157
5150
|
const sortedAndFilteredData$ = sortAndFilterData(this.tableBuilder.getData$(), sortsState$, filters$);
|
|
5158
5151
|
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());
|
|
5159
|
-
this.
|
|
5160
|
-
|
|
5161
|
-
this.state.on(this.displayData, (data) => {
|
|
5152
|
+
this.state.on(sortedAndFilteredData$, (data) => {
|
|
5153
|
+
this.data.next(data);
|
|
5162
5154
|
this.dataStore.patchState({ dataLen: data.length });
|
|
5163
5155
|
});
|
|
5156
|
+
this.state.on(flatGrouped$, (data) => {
|
|
5157
|
+
this.displayData.next(data);
|
|
5158
|
+
});
|
|
5164
5159
|
}
|
|
5165
5160
|
ngOnInit() {
|
|
5166
5161
|
const customCells$ = toObservable(this.$customCells, { injector: this.injector });
|
|
5167
5162
|
this.state.setLinkMaps(this.tableBuilder.metaData$.pipe(map(createLinkCreatorDict)));
|
|
5168
|
-
const
|
|
5169
|
-
|
|
5163
|
+
const customCellMeta = customCells$.pipe(switchMap(c => c.length ? combineLatest(c.map(c => c.$metaData)) : of([])));
|
|
5164
|
+
const metaForState = combineLatest([this.tableBuilder.metaData$, customCellMeta]).pipe(map(([mds, customCells]) => {
|
|
5170
5165
|
mds = mds.map(this.mapArrayFieldsMetaDatas);
|
|
5171
5166
|
return [
|
|
5172
5167
|
...mds,
|
|
5173
5168
|
...customCells.map(md => this.mergeMetaData(md, mds.find(item => item.key === md.key)))
|
|
5174
5169
|
];
|
|
5175
|
-
}))
|
|
5176
|
-
|
|
5177
|
-
this.
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5170
|
+
}));
|
|
5171
|
+
this.state.setMetaData(metaForState);
|
|
5172
|
+
runInInjectionContext(this.injector, () => {
|
|
5173
|
+
const ds = new TableBuilderDataSource(this.$displayData, this.state, this.dataStore);
|
|
5174
|
+
this.state.updateState({
|
|
5175
|
+
props: {
|
|
5176
|
+
dataSource: ds,
|
|
5177
|
+
...this.props
|
|
5178
|
+
}
|
|
5179
|
+
});
|
|
5180
|
+
});
|
|
5182
5181
|
this.initializeData();
|
|
5183
5182
|
}
|
|
5184
5183
|
mergeMetaData(metaData1, metaData2) {
|
|
@@ -5200,8 +5199,7 @@ class TableContainerComponent {
|
|
|
5200
5199
|
return metaData1;
|
|
5201
5200
|
}
|
|
5202
5201
|
exportToCsv() {
|
|
5203
|
-
|
|
5204
|
-
this.exportToCsvService.exportToCsv(sorted);
|
|
5202
|
+
this.exportToCsvService.exportToCsv(this.$data());
|
|
5205
5203
|
}
|
|
5206
5204
|
expandAllGroups = () => {
|
|
5207
5205
|
const groupHeaders = getAllGroupHeaderNames(this.$displayData());
|
|
@@ -5223,9 +5221,8 @@ class TableContainerComponent {
|
|
|
5223
5221
|
}
|
|
5224
5222
|
return meta;
|
|
5225
5223
|
};
|
|
5226
|
-
collapseHeader$ = this.state.state$.pipe(map(state => state.persistedTableSettings.collapseHeader));
|
|
5227
5224
|
addFilterDirectives = (state) => {
|
|
5228
|
-
const customFilters$ = toObservable(this
|
|
5225
|
+
const customFilters$ = toObservable(this.$allFilterDirectives, { injector: this.injector }).pipe(mergeMap(customerFilters => customerFilters
|
|
5229
5226
|
.filter(filter => !filter.savable)
|
|
5230
5227
|
.map(filter => filter.filter$)), mergeAll(), scan$1((a, b) => {
|
|
5231
5228
|
if (b.active) {
|
|
@@ -5242,12 +5239,14 @@ class TableContainerComponent {
|
|
|
5242
5239
|
};
|
|
5243
5240
|
$useVirtual = this.state.$isVirtual;
|
|
5244
5241
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5245
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { tableBuilder: "tableBuilder", tableId: "tableId", indexColumn: "indexColumn", selectionColumn: "selectionColumn", isSticky: "isSticky", stickyFooter: "stickyFooter", pageSize: "pageSize", groupHeaderTemplate: "groupHeaderTemplate", groupHeaderHeight: "groupHeaderHeight", trackBy: "trackBy", inputFilters: "inputFilters" }, outputs: {
|
|
5242
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { tableBuilder: "tableBuilder", tableId: "tableId", indexColumn: "indexColumn", selectionColumn: "selectionColumn", isSticky: "isSticky", stickyFooter: "stickyFooter", pageSize: "pageSize", groupHeaderTemplate: "groupHeaderTemplate", groupHeaderHeight: "groupHeaderHeight", trackBy: "trackBy", inputFilters: "inputFilters" }, outputs: { data: "data", selection$: "selection$", onStateReset: "onStateReset", onSaveState: "onSaveState", state$: "state$" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }, { propertyName: "tableElRef", first: true, predicate: ["table"], descendants: true, read: ElementRef }, { propertyName: "customRows", predicate: MatRowDef }], viewQueries: [{ propertyName: "paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true }, { propertyName: "genericTable", first: true, predicate: GenericTableComponent, descendants: true }], ngImport: i0, template: "<ng-content select=\"[before]\" />\r\n\r\n<ng-container multiSort *ngrxLet=\"state.tableSettings$ as tableSettings\">\r\n <div class=\"header-wrapper\">\r\n <div class=\"title\">\r\n @if ((!$collapseHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if((state.groupByKeys$ | async)?.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 (!$collapseHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"mainMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #mainMenu='matMenu'>\r\n <ng-container *ngTemplateOutlet=\"headerMenuExtra\"/>\r\n </mat-menu>\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\"/>\r\n </div>\r\n <ng-container *ngTemplateOutlet=\"headerMenuExtra\"/>\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapseHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapseHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n <div class=\"table-wrapper\">\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container>\r\n <tb-generic-table [rows]='customRows' [data]=\"(data | async)!\" [displayData]=\"$displayData()\"\r\n (selection$)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"trackBy\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]='customRows' [data]=\"(data | async)!\" [displayData]=\"$displayData()\"\r\n (selection$)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"trackBy\" />\r\n }\r\n\r\n </div>\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator [tableElRef]=\"tableElRef\" />\r\n\r\n <mat-icon [matTooltip]=\"$collapseFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapseFooter() ? '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\" (onSaveState)=\"onSaveState.emit($event)\"/>}\r\n </ng-template>\r\n\r\n <ng-template #headerMenuExtra>\r\n <button mat-menu-item (click)=\"resetState()\">\r\n <mat-icon color=\"primary\">autorenew</mat-icon>\r\n <span>Reset table</span>\r\n </button>\r\n @if (!tableSettings.hideExport) {\r\n <button mat-menu-item (click)=\"exportToCsv()\">\r\n <mat-icon color=\"primary\">file_download</mat-icon>\r\n <span>Export Table</span>\r\n </button>\r\n }\r\n @if (tableId) {\r\n <button stop-propagation mat-menu-item (click)=\"pm.trigger()?.toggleMenu()\">\r\n <mat-icon color=\"primary\">people</mat-icon>\r\n <span>Profiles</span>\r\n </button>\r\n <tb-profiles-menu class=\"profiles-menu\" #pm [$tableId]=\"tableId\" (onSaveState)=\"onSaveState.emit($event)\"/>\r\n }\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".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: "pipe", type: i1$8.AsyncPipe, name: "async" }, { kind: "directive", type: i1$8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator", inputs: ["tableElRef"] }, { kind: "directive", type: i3$3.LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { 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: ["trackBy", "displayData", "data", "rows", "columnBuilders", "columnInfos"], outputs: ["selection$"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { kind: "component", type: ProfilesMenuComponent, selector: "tb-profiles-menu", inputs: ["$tableId"], outputs: ["onSaveState"] }, { kind: "ngmodule", type: i3$1.MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: i4$2.MatMenuModule }, { kind: "component", type: i4$2.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: i4$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$2.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: i2.MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: i4$1.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 });
|
|
5246
5243
|
}
|
|
5247
5244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableContainerComponent, decorators: [{
|
|
5248
5245
|
type: Component,
|
|
5249
|
-
args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], standalone: true, imports: containerImports, template: "<ng-content select=\"[before]\" />\r\n\r\n<ng-container multiSort *ngrxLet=\"state.tableSettings$ as tableSettings\">\r\n <div class=\"header-wrapper\">\r\n <div class=\"title\">\r\n @if ((
|
|
5250
|
-
}], propDecorators: {
|
|
5246
|
+
args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], standalone: true, imports: containerImports, template: "<ng-content select=\"[before]\" />\r\n\r\n<ng-container multiSort *ngrxLet=\"state.tableSettings$ as tableSettings\">\r\n <div class=\"header-wrapper\">\r\n <div class=\"title\">\r\n @if ((!$collapseHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if((state.groupByKeys$ | async)?.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 (!$collapseHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"mainMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #mainMenu='matMenu'>\r\n <ng-container *ngTemplateOutlet=\"headerMenuExtra\"/>\r\n </mat-menu>\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\"/>\r\n </div>\r\n <ng-container *ngTemplateOutlet=\"headerMenuExtra\"/>\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapseHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapseHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n <div class=\"table-wrapper\">\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container>\r\n <tb-generic-table [rows]='customRows' [data]=\"(data | async)!\" [displayData]=\"$displayData()\"\r\n (selection$)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"trackBy\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]='customRows' [data]=\"(data | async)!\" [displayData]=\"$displayData()\"\r\n (selection$)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"trackBy\" />\r\n }\r\n\r\n </div>\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator [tableElRef]=\"tableElRef\" />\r\n\r\n <mat-icon [matTooltip]=\"$collapseFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapseFooter() ? '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\" (onSaveState)=\"onSaveState.emit($event)\"/>}\r\n </ng-template>\r\n\r\n <ng-template #headerMenuExtra>\r\n <button mat-menu-item (click)=\"resetState()\">\r\n <mat-icon color=\"primary\">autorenew</mat-icon>\r\n <span>Reset table</span>\r\n </button>\r\n @if (!tableSettings.hideExport) {\r\n <button mat-menu-item (click)=\"exportToCsv()\">\r\n <mat-icon color=\"primary\">file_download</mat-icon>\r\n <span>Export Table</span>\r\n </button>\r\n }\r\n @if (tableId) {\r\n <button stop-propagation mat-menu-item (click)=\"pm.trigger()?.toggleMenu()\">\r\n <mat-icon color=\"primary\">people</mat-icon>\r\n <span>Profiles</span>\r\n </button>\r\n <tb-profiles-menu class=\"profiles-menu\" #pm [$tableId]=\"tableId\" (onSaveState)=\"onSaveState.emit($event)\"/>\r\n }\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".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"] }]
|
|
5247
|
+
}], propDecorators: { data: [{
|
|
5248
|
+
type: Output
|
|
5249
|
+
}], paginatorComponent: [{
|
|
5251
5250
|
type: ViewChild,
|
|
5252
5251
|
args: [PaginatorComponent]
|
|
5253
5252
|
}], genericTable: [{
|
|
@@ -5284,8 +5283,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5284
5283
|
type: Input
|
|
5285
5284
|
}], selection$: [{
|
|
5286
5285
|
type: Output
|
|
5287
|
-
}], data: [{
|
|
5288
|
-
type: Output
|
|
5289
5286
|
}], onStateReset: [{
|
|
5290
5287
|
type: Output
|
|
5291
5288
|
}], onSaveState: [{
|
|
@@ -5447,7 +5444,7 @@ class TableBuilder {
|
|
|
5447
5444
|
cleaned[initIndexSymbol] = i * ((ii % 2) + 1);
|
|
5448
5445
|
return cleaned;
|
|
5449
5446
|
});
|
|
5450
|
-
}))));
|
|
5447
|
+
}))), defaultShareReplay());
|
|
5451
5448
|
}
|
|
5452
5449
|
createMetaData(obj) {
|
|
5453
5450
|
return Object.keys(obj ?? {})
|