@one-paragon/angular-utilities 1.2.8 → 1.2.9-beta.1
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 -12
- package/esm2022/table-builder/classes/TableState.mjs +5 -3
- package/esm2022/table-builder/classes/data-store.mjs +15 -0
- package/esm2022/table-builder/classes/table-builder-general-settings.mjs +11 -1
- package/esm2022/table-builder/classes/table-builder.mjs +3 -3
- package/esm2022/table-builder/classes/table-store.mjs +71 -46
- package/esm2022/table-builder/components/column-builder/column-builder.component.mjs +2 -2
- package/esm2022/table-builder/components/generic-table/generic-table.component.mjs +94 -55
- package/esm2022/table-builder/components/generic-table/paginator.component.mjs +6 -4
- package/esm2022/table-builder/components/sort-menu/sort-menu.component-store.mjs +4 -2
- package/esm2022/table-builder/components/table-container/table-container.mjs +42 -26
- package/esm2022/table-builder/components/table-container/virtual-scroll-container.mjs +9 -7
- package/esm2022/table-builder/components/table-container-filter/filter-list/filter-list.component.mjs +5 -6
- package/esm2022/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.mjs +9 -11
- package/esm2022/table-builder/directives/custom-cell-directive.mjs +12 -13
- package/esm2022/table-builder/interfaces/ColumnInfo.mjs +1 -1
- package/esm2022/table-builder/services/export-to-csv.service.mjs +3 -3
- package/fesm2022/one-paragon-angular-utilities.mjs +277 -170
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/package.json +1 -1
- package/table-builder/classes/TableBuilderDataSource.d.ts +2 -3
- package/table-builder/classes/TableState.d.ts +14 -4
- package/table-builder/classes/data-store.d.ts +8 -0
- package/table-builder/classes/table-builder-general-settings.d.ts +4 -0
- package/table-builder/classes/table-store.d.ts +16 -28
- package/table-builder/components/generic-table/generic-table.component.d.ts +19 -10
- package/table-builder/components/generic-table/paginator.component.d.ts +1 -0
- package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +1 -0
- package/table-builder/components/table-container/table-container-imports.d.ts +1 -1
- package/table-builder/components/table-container/table-container.d.ts +10 -7
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +1 -0
- package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +2 -3
- package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +1 -3
- package/table-builder/directives/custom-cell-directive.d.ts +6 -4
- package/table-builder/directives/table-wrapper.directive.d.ts +1 -1
- package/table-builder/interfaces/ColumnInfo.d.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
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,
|
|
3
|
+
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, first as first$1, distinctUntilKeyChanged, delay as delay$1, observeOn, scan as scan$1, timestamp as timestamp$1, withLatestFrom, 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, tap as tap$1, BehaviorSubject, takeUntil as takeUntil$1, switchMap as switchMap$1, scan, asyncScheduler, animationFrameScheduler, distinctUntilChanged as distinctUntilChanged$1, timestamp,
|
|
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, tap as tap$1, BehaviorSubject, takeUntil as takeUntil$1, switchMap as switchMap$1, scan, asyncScheduler, animationFrameScheduler, distinctUntilChanged as distinctUntilChanged$1, timestamp, skip } 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';
|
|
@@ -49,7 +49,7 @@ import { LetDirective } from '@ngrx/component';
|
|
|
49
49
|
import * as i4$3 from '@angular/material/chips';
|
|
50
50
|
import { MatChipsModule } from '@angular/material/chips';
|
|
51
51
|
import * as i1$5 from '@angular/material/table';
|
|
52
|
-
import { MatTable, MatColumnDef, MatTableModule, MatTableDataSource, MatRowDef } from '@angular/material/table';
|
|
52
|
+
import { MatTable, MatColumnDef, MatTableModule, MatHeaderRowDef, MatFooterRowDef, MatTableDataSource, MatRowDef } from '@angular/material/table';
|
|
53
53
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
54
54
|
import * as i1$6 from '@angular/material/paginator';
|
|
55
55
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
@@ -757,6 +757,12 @@ class GeneralTableSettings {
|
|
|
757
757
|
merge$1(this.tableSettings, settings.tableSettings);
|
|
758
758
|
if (settings.tableSettings?.useVirtualScroll) {
|
|
759
759
|
const currVirt = settings.tableSettings.useVirtualScroll === true ? new VirtualScrollOptions() : settings.tableSettings.useVirtualScroll;
|
|
760
|
+
if (!currVirt.headerHeight || settings.tableSettings.useVirtualScroll === true) {
|
|
761
|
+
currVirt.headerHeight = (typeof settings.headerSettings?.headerHeight === 'number' ? settings.headerSettings?.headerHeight : DefaultVirtualScrollOptions.headerHeight);
|
|
762
|
+
}
|
|
763
|
+
if (!currVirt.rowHeight || settings.tableSettings.useVirtualScroll === true) {
|
|
764
|
+
currVirt.rowHeight = (typeof settings.tableSettings?.rowHeight === 'number' ? settings.tableSettings?.rowHeight : DefaultVirtualScrollOptions.rowHeight);
|
|
765
|
+
}
|
|
760
766
|
this.tableSettings.useVirtualScroll = { ...new VirtualScrollOptions(), ...currVirt };
|
|
761
767
|
}
|
|
762
768
|
}
|
|
@@ -845,6 +851,10 @@ class VirtualScrollOptions {
|
|
|
845
851
|
*/
|
|
846
852
|
maxViewPortHeight = undefined;
|
|
847
853
|
}
|
|
854
|
+
const DefaultVirtualScrollOptions = {
|
|
855
|
+
rowHeight: 48,
|
|
856
|
+
headerHeight: 56,
|
|
857
|
+
};
|
|
848
858
|
|
|
849
859
|
class KeysToDelete {
|
|
850
860
|
initializationState = null;
|
|
@@ -883,13 +893,15 @@ const defaultTableState = {
|
|
|
883
893
|
groupBy: [],
|
|
884
894
|
minColumnWidth: undefined,
|
|
885
895
|
currentPage: 0,
|
|
896
|
+
props: {},
|
|
897
|
+
showAll: false,
|
|
898
|
+
};
|
|
899
|
+
const defaultDataState = {
|
|
886
900
|
virtualScrollOffset: 0,
|
|
887
901
|
dataLen: 0,
|
|
888
902
|
virtualEnds: {
|
|
889
903
|
start: 0, end: 20
|
|
890
904
|
},
|
|
891
|
-
props: {},
|
|
892
|
-
showAll: false,
|
|
893
905
|
};
|
|
894
906
|
|
|
895
907
|
// here is how to use it
|
|
@@ -915,23 +927,21 @@ class CustomCellDirective {
|
|
|
915
927
|
if (this.templateRef !== null)
|
|
916
928
|
this.TemplateRef = this.templateRef;
|
|
917
929
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
this.TemplateRef = this.templateRef;
|
|
921
|
-
}
|
|
930
|
+
ngOnInit() {
|
|
931
|
+
this.$metaData.next(this.getMetaData());
|
|
922
932
|
}
|
|
923
|
-
|
|
933
|
+
$metaData = new ReplaySubject();
|
|
934
|
+
getMetaData = () => {
|
|
924
935
|
return {
|
|
925
936
|
key: this.customCell,
|
|
926
|
-
displayName: this.displayName
|
|
927
|
-
preSort: this.preSort
|
|
928
|
-
fieldType:
|
|
929
|
-
order: this.customCellOrder
|
|
930
|
-
width: this.customCellWidth
|
|
937
|
+
displayName: this.displayName,
|
|
938
|
+
preSort: this.preSort,
|
|
939
|
+
fieldType: this.customCellNotMapped ? FieldType.NotMapped : FieldType.Unknown,
|
|
940
|
+
order: this.customCellOrder,
|
|
941
|
+
width: this.customCellWidth,
|
|
931
942
|
customCell: true,
|
|
932
|
-
noExport: !metaData,
|
|
933
943
|
};
|
|
934
|
-
}
|
|
944
|
+
};
|
|
935
945
|
static ngTemplateContextGuard(dir, ctx) {
|
|
936
946
|
return true;
|
|
937
947
|
}
|
|
@@ -1743,22 +1753,18 @@ class TableStore extends ComponentStore {
|
|
|
1743
1753
|
this.effect(() => srcObservable.pipe(tap(func)));
|
|
1744
1754
|
return this;
|
|
1745
1755
|
};
|
|
1746
|
-
onLast(callback) {
|
|
1747
|
-
this.on(this.state$.pipe(last()), callback);
|
|
1748
|
-
}
|
|
1749
1756
|
metaData$ = this.select(state => state.metaData);
|
|
1750
|
-
|
|
1751
|
-
|
|
1757
|
+
$metaData = this.selectSignal(state => state.metaData);
|
|
1758
|
+
$userDefinedOrder = this.selectSignal(state => state.userDefined.order);
|
|
1759
|
+
$hiddenKeys = this.selectSignal(state => state.hiddenKeys);
|
|
1760
|
+
$metaDataArray = this.selectSignal(this.$metaData, this.$userDefinedOrder, orderMetaData);
|
|
1752
1761
|
getMetaData$ = (key) => {
|
|
1753
1762
|
return this.select(state => state.metaData[key]).pipe(tap(meta => { if (!meta)
|
|
1754
1763
|
console.warn(`Meta data with key ${key} not found`); }), notNull());
|
|
1755
1764
|
};
|
|
1756
|
-
getUserDefinedWidth
|
|
1757
|
-
|
|
1758
|
-
getUserDefinedWidths$ = this.select(state => state.userDefined.widths);
|
|
1759
|
-
getUserDefinedWidths = this.selectSignal(state => state.userDefined.widths);
|
|
1765
|
+
$getUserDefinedWidth = (key) => this.selectSignal(state => state.userDefined.widths[key]);
|
|
1766
|
+
$getUserDefinedWidths = this.selectSignal(state => state.userDefined.widths);
|
|
1760
1767
|
tableSettingsMinWidth = this.selectSignal(state => state.minColumnWidth);
|
|
1761
|
-
displayedColumns$ = this.select(orderedVisibleColumns);
|
|
1762
1768
|
resetState = this.updater((state) => {
|
|
1763
1769
|
const sorted = this.createPreSort(state.metaData);
|
|
1764
1770
|
return ({ ...state, hiddenKeys: [], sorted, filters: {}, groupBy: [], userDefined: { widths: {}, order: {}, table: {} } });
|
|
@@ -1783,7 +1789,7 @@ class TableStore extends ComponentStore {
|
|
|
1783
1789
|
});
|
|
1784
1790
|
setUserDefinedOrder = this.updater((state, moved) => {
|
|
1785
1791
|
const { newOrder, oldOrder } = moved;
|
|
1786
|
-
const mdsArr =
|
|
1792
|
+
const mdsArr = orderedStateVisibleMetaData(state);
|
|
1787
1793
|
moveItemInArray(mdsArr, oldOrder, newOrder);
|
|
1788
1794
|
const userDefinedOrder = mdsArr.reduce((aggregate, current, index) => {
|
|
1789
1795
|
aggregate[current.key] = index;
|
|
@@ -1791,6 +1797,7 @@ class TableStore extends ComponentStore {
|
|
|
1791
1797
|
}, {});
|
|
1792
1798
|
return ({ ...state, userDefined: { ...state.userDefined, order: userDefinedOrder } });
|
|
1793
1799
|
});
|
|
1800
|
+
$filters = this.selectSignal(state => state.filters);
|
|
1794
1801
|
filters$ = this.select(state => state.filters);
|
|
1795
1802
|
getFilter$ = (filterId) => {
|
|
1796
1803
|
return this.select(state => state.filters[filterId]);
|
|
@@ -1840,7 +1847,7 @@ class TableStore extends ComponentStore {
|
|
|
1840
1847
|
createPreSort = (metaDatas) => {
|
|
1841
1848
|
return Object.values(metaDatas).filter((metaData) => !!metaData.preSort)
|
|
1842
1849
|
.sort(({ preSort: ps1 }, { preSort: ps2 }) => (ps1.precedence || Number.MAX_VALUE) - (ps2.precedence || Number.MAX_VALUE))
|
|
1843
|
-
.map(({ key, preSort }) => ({ active: key, direction
|
|
1850
|
+
.map(({ key, preSort: { direction } }) => ({ active: key, direction }));
|
|
1844
1851
|
};
|
|
1845
1852
|
setSort = this.updater((state, { key, direction }) => {
|
|
1846
1853
|
const sortArray = state.sorted.filter(s => s.active !== key);
|
|
@@ -1867,17 +1874,8 @@ class TableStore extends ComponentStore {
|
|
|
1867
1874
|
setPageSize = this.updater((state, pageSize) => ({ ...state, pageSize, userDefined: { ...state.userDefined, pageSize } }));
|
|
1868
1875
|
getPageSize = this.select(state => state.userDefined.pageSize || state.pageSize);
|
|
1869
1876
|
updateState = this.updater(this.updateStateFunc);
|
|
1870
|
-
cleanPersistedState(state, pState) {
|
|
1871
|
-
const metas = Object.values(state.metaData);
|
|
1872
|
-
const filters = Object.values(pState.filters).filter(fltr => isCustomFilter(fltr) || metas.some(m => m.key === fltr.key)).reduce((obj, filter) => {
|
|
1873
|
-
obj[filter.filterId] = pState.filters[filter.filterId];
|
|
1874
|
-
return obj;
|
|
1875
|
-
}, {});
|
|
1876
|
-
const sorted = pState.sorted.filter(s => metas.some(m => m.key === s.active));
|
|
1877
|
-
return ({ ...pState, filters, sorted });
|
|
1878
|
-
}
|
|
1879
1877
|
updateStateFromPersistedState = this.updater((state, persistedState) => {
|
|
1880
|
-
const incomingTableState =
|
|
1878
|
+
const incomingTableState = cleanPersistedState(state, persistedState);
|
|
1881
1879
|
const newState = this.updateStateFunc(state, incomingTableState);
|
|
1882
1880
|
newState.initializationState = state.initializationState === InitializationState.MetaDataLoaded ? InitializationState.LoadedFromStore : state.initializationState;
|
|
1883
1881
|
return newState;
|
|
@@ -1920,7 +1918,7 @@ class TableStore extends ComponentStore {
|
|
|
1920
1918
|
this.runOnceWhen(stateIs(InitializationState.Ready), func);
|
|
1921
1919
|
}
|
|
1922
1920
|
setMetaData = this.updater((state, md) => {
|
|
1923
|
-
const metaData =
|
|
1921
|
+
const metaData = md
|
|
1924
1922
|
.reduce((prev, curr) => {
|
|
1925
1923
|
if (prev[curr.key]) {
|
|
1926
1924
|
prev[curr.key] = this.mergeMeta(prev[curr.key], curr);
|
|
@@ -2025,43 +2023,80 @@ class TableStore extends ComponentStore {
|
|
|
2025
2023
|
$isVirtual = this.selectSignal(state => state.notPersistedTableSettings.useVirtualScroll === true || state.notPersistedTableSettings.useVirtualScroll?.virtualAsDefault || state.showAll);
|
|
2026
2024
|
$viewType = this.selectSignal(state => {
|
|
2027
2025
|
const usePaginator = state.notPersistedTableSettings.usePaginator;
|
|
2028
|
-
|
|
2026
|
+
if (state.showAll || (this.$isVirtual() && !usePaginator)) {
|
|
2027
|
+
return 'virtual all';
|
|
2028
|
+
}
|
|
2029
|
+
else if (this.$isVirtual() && usePaginator) {
|
|
2030
|
+
return 'virtual paginator';
|
|
2031
|
+
}
|
|
2032
|
+
else if (usePaginator) {
|
|
2033
|
+
return 'paginator';
|
|
2034
|
+
}
|
|
2035
|
+
else {
|
|
2036
|
+
return 'all';
|
|
2037
|
+
}
|
|
2029
2038
|
});
|
|
2030
2039
|
viewType$ = toObservable(this.$viewType);
|
|
2040
|
+
$orderedVisibleColumns = this.selectSignal(this.$metaData, this.$userDefinedOrder, this.$hiddenKeys, (m, u, h) => orderedVisibleMetaData(m, u, h).map(md => md.key), { equal: (a, b) => b.length === a.length && b.every((s, i) => a[i] === s) });
|
|
2031
2041
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2032
2042
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableStore });
|
|
2033
2043
|
}
|
|
2034
2044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableStore, decorators: [{
|
|
2035
2045
|
type: Injectable
|
|
2036
2046
|
}], ctorParameters: () => [] });
|
|
2037
|
-
const orderedVisibleColumns = (state) =>
|
|
2038
|
-
const
|
|
2039
|
-
const ordered =
|
|
2047
|
+
const orderedVisibleColumns = (state) => orderedStateVisibleMetaData(state).map(md => md.key);
|
|
2048
|
+
const orderedStateVisibleMetaData = (state) => {
|
|
2049
|
+
const ordered = orderStateMetaData(state);
|
|
2040
2050
|
const orderedVisible = ordered
|
|
2041
2051
|
.filter(metaData => !state.hiddenKeys.includes(metaData.key) && state.metaData[metaData.key].fieldType !== FieldType.Hidden);
|
|
2042
2052
|
return orderedVisible;
|
|
2043
2053
|
};
|
|
2044
|
-
const
|
|
2045
|
-
const
|
|
2046
|
-
const
|
|
2054
|
+
const orderedVisibleMetaData = (metaData, userDefinedOrder, hiddenKeys) => {
|
|
2055
|
+
const ordered = orderMetaData(metaData, userDefinedOrder);
|
|
2056
|
+
const orderedVisible = ordered
|
|
2057
|
+
.filter(m => !hiddenKeys.includes(m.key) && metaData[m.key].fieldType !== FieldType.Hidden);
|
|
2058
|
+
return orderedVisible;
|
|
2059
|
+
};
|
|
2060
|
+
const orderedCodeVisibleMetaData = (state) => orderStateMetaData(state).filter(md => md.fieldType !== FieldType.Hidden);
|
|
2061
|
+
const orderStateMetaData = (state) => {
|
|
2062
|
+
return orderMetaData(state.metaData, state.userDefined.order);
|
|
2063
|
+
};
|
|
2064
|
+
const orderMetaData = (metaData, userDefined) => {
|
|
2065
|
+
const userOrderArr = Object.entries(userDefined);
|
|
2047
2066
|
return userOrderArr.length ?
|
|
2048
|
-
Object.values(
|
|
2049
|
-
const orderA =
|
|
2050
|
-
const orderB =
|
|
2051
|
-
|
|
2052
|
-
return 0;
|
|
2053
|
-
}
|
|
2054
|
-
if (orderA == null) {
|
|
2055
|
-
return 1;
|
|
2056
|
-
}
|
|
2057
|
-
if (orderB == null) {
|
|
2058
|
-
return -1;
|
|
2059
|
-
}
|
|
2060
|
-
return state.userDefined.order[a.key] - state.userDefined.order[b.key];
|
|
2067
|
+
Object.values(metaData).sort((a, b) => {
|
|
2068
|
+
const orderA = userDefined[a.key];
|
|
2069
|
+
const orderB = userDefined[b.key];
|
|
2070
|
+
return order(orderA, orderB);
|
|
2061
2071
|
})
|
|
2062
2072
|
:
|
|
2063
|
-
Object.values(
|
|
2073
|
+
Object.values(metaData).sort((a, b) => {
|
|
2074
|
+
const orderA = a.order;
|
|
2075
|
+
const orderB = b.order;
|
|
2076
|
+
return order(orderA, orderB);
|
|
2077
|
+
});
|
|
2064
2078
|
};
|
|
2079
|
+
function order(orderA, orderB) {
|
|
2080
|
+
if (orderA == null && orderB == null) {
|
|
2081
|
+
return 0;
|
|
2082
|
+
}
|
|
2083
|
+
if (orderA == null) {
|
|
2084
|
+
return 1;
|
|
2085
|
+
}
|
|
2086
|
+
if (orderB == null) {
|
|
2087
|
+
return -1;
|
|
2088
|
+
}
|
|
2089
|
+
return orderA - orderB;
|
|
2090
|
+
}
|
|
2091
|
+
function cleanPersistedState(state, pState) {
|
|
2092
|
+
const metas = Object.values(state.metaData);
|
|
2093
|
+
const filters = Object.values(pState.filters).filter(fltr => isCustomFilter(fltr) || metas.some(m => m.key === fltr.key)).reduce((obj, filter) => {
|
|
2094
|
+
obj[filter.filterId] = pState.filters[filter.filterId];
|
|
2095
|
+
return obj;
|
|
2096
|
+
}, {});
|
|
2097
|
+
const sorted = pState.sorted.filter(s => metas.some(m => m.key === s.active));
|
|
2098
|
+
return ({ ...pState, filters, sorted });
|
|
2099
|
+
}
|
|
2065
2100
|
|
|
2066
2101
|
class MultiSortDirective extends MatSort {
|
|
2067
2102
|
state = inject(TableStore);
|
|
@@ -2922,24 +2957,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
2922
2957
|
class GenFilterDisplayerComponent {
|
|
2923
2958
|
tableState = inject(TableStore);
|
|
2924
2959
|
filterStore = inject(WrapperFilterStore);
|
|
2925
|
-
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2928
|
-
}
|
|
2929
|
-
filterCols$;
|
|
2960
|
+
$filterCols = computed(() => {
|
|
2961
|
+
const mds = this.tableState.$metaDataArray();
|
|
2962
|
+
return mds.filter(m => m.fieldType !== FieldType.Hidden && m.fieldType !== FieldType.NotMapped && !m.noFilter);
|
|
2963
|
+
});
|
|
2930
2964
|
addFilter(metaData) {
|
|
2931
2965
|
this.filterStore.addFilter({ key: metaData.key, fieldType: metaData.fieldType });
|
|
2932
2966
|
}
|
|
2933
2967
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenFilterDisplayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2934
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: GenFilterDisplayerComponent, isStandalone: true, selector: "tb-filter-displayer", ngImport: i0, template: "<button stop-propagation class=\"filter-button\" mat-icon-button [matMenuTriggerFor]=\"menu\" matTooltip=\"Add Filter\">\r\n <mat-icon class=\"filter-icon\" color=\"primary\">filter_list</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\">\r\n @for (md of filterCols
|
|
2968
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: GenFilterDisplayerComponent, isStandalone: true, selector: "tb-filter-displayer", ngImport: i0, template: "<button stop-propagation class=\"filter-button\" mat-icon-button [matMenuTriggerFor]=\"menu\" matTooltip=\"Add Filter\">\r\n <mat-icon class=\"filter-icon\" color=\"primary\">filter_list</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\">\r\n @for (md of $filterCols(); track md.key) {\r\n <button (click)=\"addFilter(md)\" mat-menu-item>\r\n <span class=\"filter-labels\">{{md.displayName || (md.key | spaceCase)}}</span>\r\n </button>\r\n }\r\n</mat-menu>\r\n", styles: [".filter{margin:15px;display:inline-block}.filter-button{color:#6495ed;font-size:22px;font-weight:700}.cancel-button{margin-right:30px;font-weight:700}.filter-wrapper{margin-top:1em;margin-bottom:1em;float:right}.menu{margin-bottom:10px;width:109.1%}.filter-labels{color:#6495ed;font-size:17px;font-weight:600}.float{position:absolute;width:fit-content;z-index:101;top:10px;right:180px;max-width:90vw}.d-w{display:flex;flex-direction:row;justify-content:flex-end}\n"], dependencies: [{ 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: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: SpaceCasePipe, name: "spaceCase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2935
2969
|
}
|
|
2936
2970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenFilterDisplayerComponent, decorators: [{
|
|
2937
2971
|
type: Component,
|
|
2938
2972
|
args: [{ selector: 'tb-filter-displayer', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2939
2973
|
MatButtonModule, MatMenuModule, MatTooltipModule, StopPropagationDirective, MatIconModule,
|
|
2940
2974
|
AsyncPipe, SpaceCasePipe
|
|
2941
|
-
], template: "<button stop-propagation class=\"filter-button\" mat-icon-button [matMenuTriggerFor]=\"menu\" matTooltip=\"Add Filter\">\r\n <mat-icon class=\"filter-icon\" color=\"primary\">filter_list</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\">\r\n @for (md of filterCols
|
|
2942
|
-
}]
|
|
2975
|
+
], template: "<button stop-propagation class=\"filter-button\" mat-icon-button [matMenuTriggerFor]=\"menu\" matTooltip=\"Add Filter\">\r\n <mat-icon class=\"filter-icon\" color=\"primary\">filter_list</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\">\r\n @for (md of $filterCols(); track md.key) {\r\n <button (click)=\"addFilter(md)\" mat-menu-item>\r\n <span class=\"filter-labels\">{{md.displayName || (md.key | spaceCase)}}</span>\r\n </button>\r\n }\r\n</mat-menu>\r\n", styles: [".filter{margin:15px;display:inline-block}.filter-button{color:#6495ed;font-size:22px;font-weight:700}.cancel-button{margin-right:30px;font-weight:700}.filter-wrapper{margin-top:1em;margin-bottom:1em;float:right}.menu{margin-bottom:10px;width:109.1%}.filter-labels{color:#6495ed;font-size:17px;font-weight:600}.float{position:absolute;width:fit-content;z-index:101;top:10px;right:180px;max-width:90vw}.d-w{display:flex;flex-direction:row;justify-content:flex-end}\n"] }]
|
|
2976
|
+
}] });
|
|
2943
2977
|
|
|
2944
2978
|
class KeyDisplayPipe {
|
|
2945
2979
|
tableState = inject(TableStore);
|
|
@@ -3006,7 +3040,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
3006
3040
|
class FilterChipsComponent {
|
|
3007
3041
|
tableState = inject(TableStore);
|
|
3008
3042
|
filterStore = inject(WrapperFilterStore);
|
|
3009
|
-
filters
|
|
3043
|
+
$filters = computed(() => Object.values(this.tableState.$filters()).filter(f => isFilterInfo(f) && !f._isExternallyManaged));
|
|
3010
3044
|
deleteByIndex(index) {
|
|
3011
3045
|
this.filterStore.deleteByIndex(index);
|
|
3012
3046
|
}
|
|
@@ -3018,14 +3052,14 @@ class FilterChipsComponent {
|
|
|
3018
3052
|
}
|
|
3019
3053
|
currentFilters$ = this.filterStore.currentFilters$;
|
|
3020
3054
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: FilterChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3021
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: FilterChipsComponent, isStandalone: true, selector: "lib-filter-list", ngImport: i0, template: "<div class=\"d-w\" *ngrxLet=\"currentFilters$ as currentFilters\" >\r\n\r\n @if (currentFilters.length) {\r\n <button class=\"cancel-button\" mat-icon-button (click)=\"clearAll()\" matTooltip=\"Close all Filters Cards\">\r\n <mat-icon class=\"cancel-button\" color=\"primary\">close</mat-icon>\r\n </button>\r\n <div class=\"float\">\r\n @for (filter of currentFilters; track filter.key) {\r\n <div class=\"filter\">\r\n <tb-filter [filter]=\"filter\" (close)=\"deleteByIndex($index)\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <mat-chip-set
|
|
3055
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: FilterChipsComponent, isStandalone: true, selector: "lib-filter-list", ngImport: i0, template: "<div class=\"d-w\" *ngrxLet=\"currentFilters$ as currentFilters\" >\r\n\r\n @if (currentFilters.length) {\r\n <button class=\"cancel-button\" mat-icon-button (click)=\"clearAll()\" matTooltip=\"Close all Filters Cards\">\r\n <mat-icon class=\"cancel-button\" color=\"primary\">close</mat-icon>\r\n </button>\r\n <div class=\"float\">\r\n @for (filter of currentFilters; track filter.key) {\r\n <div class=\"filter\">\r\n <tb-filter [filter]=\"filter\" (close)=\"deleteByIndex($index)\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <mat-chip-set>\r\n @for (filter of $filters(); track filter.key) {\r\n <mat-chip (dblclick)=\"addFilter(filter)\" (removed)=\"tableState.removeFilter(filter.filterId!)\">\r\n {{ filter.key | keyDisplay | async }} {{filter.filterType | formatFilterType : filter.filterValue}} {{ filter.filterValue | formatFilterValue: filter.key : filter.filterType | async }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n @if ($filters().length > 1) {\r\n <mat-chip (removed)=\"tableState.clearFilters()\">\r\n Clear All\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n </mat-chip-set>\r\n\r\n</div>\r\n", styles: [".filter{margin:15px;display:inline-block}.filter-button{color:#6495ed;font-size:22px;font-weight:700}.cancel-button{margin-right:30px;font-weight:700}.filter-wrapper{margin-top:1em;margin-bottom:1em;float:right}.menu{margin-bottom:10px;width:109.1%}.filter-labels{color:#6495ed;font-size:17px;font-weight:600}.float{position:absolute;width:fit-content;z-index:101;top:10px;right:180px;max-width:90vw}.d-w{display:flex;flex-direction:row;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { 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: "component", type: FilterComponent, selector: "tb-filter", inputs: ["filter"], outputs: ["close"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$3.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i4$3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i4$3.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: KeyDisplayPipe, name: "keyDisplay" }, { kind: "pipe", type: FormatFilterTypePipe, name: "formatFilterType" }, { kind: "pipe", type: FormatFilterValuePipe, name: "formatFilterValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3022
3056
|
}
|
|
3023
3057
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: FilterChipsComponent, decorators: [{
|
|
3024
3058
|
type: Component,
|
|
3025
3059
|
args: [{ selector: 'lib-filter-list', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
3026
3060
|
LetDirective, MatButtonModule, MatTooltipModule, MatIconModule, FilterComponent,
|
|
3027
3061
|
MatChipsModule, AsyncPipe, KeyDisplayPipe, FormatFilterTypePipe, FormatFilterValuePipe
|
|
3028
|
-
], template: "<div class=\"d-w\" *ngrxLet=\"currentFilters$ as currentFilters\" >\r\n\r\n @if (currentFilters.length) {\r\n <button class=\"cancel-button\" mat-icon-button (click)=\"clearAll()\" matTooltip=\"Close all Filters Cards\">\r\n <mat-icon class=\"cancel-button\" color=\"primary\">close</mat-icon>\r\n </button>\r\n <div class=\"float\">\r\n @for (filter of currentFilters; track filter.key) {\r\n <div class=\"filter\">\r\n <tb-filter [filter]=\"filter\" (close)=\"deleteByIndex($index)\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <mat-chip-set
|
|
3062
|
+
], template: "<div class=\"d-w\" *ngrxLet=\"currentFilters$ as currentFilters\" >\r\n\r\n @if (currentFilters.length) {\r\n <button class=\"cancel-button\" mat-icon-button (click)=\"clearAll()\" matTooltip=\"Close all Filters Cards\">\r\n <mat-icon class=\"cancel-button\" color=\"primary\">close</mat-icon>\r\n </button>\r\n <div class=\"float\">\r\n @for (filter of currentFilters; track filter.key) {\r\n <div class=\"filter\">\r\n <tb-filter [filter]=\"filter\" (close)=\"deleteByIndex($index)\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <mat-chip-set>\r\n @for (filter of $filters(); track filter.key) {\r\n <mat-chip (dblclick)=\"addFilter(filter)\" (removed)=\"tableState.removeFilter(filter.filterId!)\">\r\n {{ filter.key | keyDisplay | async }} {{filter.filterType | formatFilterType : filter.filterValue}} {{ filter.filterValue | formatFilterValue: filter.key : filter.filterType | async }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n @if ($filters().length > 1) {\r\n <mat-chip (removed)=\"tableState.clearFilters()\">\r\n Clear All\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n </mat-chip-set>\r\n\r\n</div>\r\n", styles: [".filter{margin:15px;display:inline-block}.filter-button{color:#6495ed;font-size:22px;font-weight:700}.cancel-button{margin-right:30px;font-weight:700}.filter-wrapper{margin-top:1em;margin-bottom:1em;float:right}.menu{margin-bottom:10px;width:109.1%}.filter-labels{color:#6495ed;font-size:17px;font-weight:600}.float{position:absolute;width:fit-content;z-index:101;top:10px;right:180px;max-width:90vw}.d-w{display:flex;flex-direction:row;justify-content:flex-end}\n"] }]
|
|
3029
3063
|
}] });
|
|
3030
3064
|
|
|
3031
3065
|
function isPipe(o) {
|
|
@@ -3521,7 +3555,7 @@ class ColumnBuilderComponent {
|
|
|
3521
3555
|
}
|
|
3522
3556
|
classes;
|
|
3523
3557
|
styles = computed(() => {
|
|
3524
|
-
return columnStyles(this.metaData, this.state
|
|
3558
|
+
return columnStyles(this.metaData, this.state.$getUserDefinedWidth(this.metaData.key)(), this.state.tableSettingsMinWidth());
|
|
3525
3559
|
});
|
|
3526
3560
|
ngOnInit() {
|
|
3527
3561
|
this.initialSetUp();
|
|
@@ -3623,10 +3657,25 @@ function getSameTailLength(previousSorts, currentSorts) {
|
|
|
3623
3657
|
const initIndexSymbol = Symbol('tb_init_index');
|
|
3624
3658
|
const initialSortState = { sortsToRun: [], allSorts: [] };
|
|
3625
3659
|
|
|
3660
|
+
class DataStore extends ComponentStore {
|
|
3661
|
+
constructor() {
|
|
3662
|
+
super({ ...defaultDataState });
|
|
3663
|
+
}
|
|
3664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DataStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3665
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DataStore });
|
|
3666
|
+
}
|
|
3667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DataStore, decorators: [{
|
|
3668
|
+
type: Injectable
|
|
3669
|
+
}], ctorParameters: () => [] });
|
|
3670
|
+
|
|
3626
3671
|
class GenericTableComponent {
|
|
3627
3672
|
state = inject(TableStore);
|
|
3673
|
+
dataStore = inject(DataStore);
|
|
3628
3674
|
viewContainer = inject(ViewContainerRef);
|
|
3629
3675
|
transformCreator = inject(TransformCreator);
|
|
3676
|
+
$headerRow = viewChild(MatHeaderRowDef);
|
|
3677
|
+
$footerRow = viewChild(MatFooterRowDef);
|
|
3678
|
+
$table = viewChild(MatTable);
|
|
3630
3679
|
drop(event) {
|
|
3631
3680
|
this.state.setUserDefinedOrder({ newOrder: event.currentIndex, oldOrder: event.previousIndex });
|
|
3632
3681
|
}
|
|
@@ -3639,55 +3688,103 @@ class GenericTableComponent {
|
|
|
3639
3688
|
this.setUpSelections(trackBy);
|
|
3640
3689
|
}
|
|
3641
3690
|
get trackBy() { return this._trackBy; }
|
|
3642
|
-
displayData
|
|
3691
|
+
$displayData = input.required({ alias: 'displayData' });
|
|
3692
|
+
$displayDataLength = computed(() => this.$displayData()?.length || 0);
|
|
3693
|
+
$hasFooterMeta = computed(() => this.state.$metaDataArray().some(md => !!md.additional?.footer));
|
|
3643
3694
|
$data = input.required({ alias: 'data' });
|
|
3644
3695
|
data$ = toObservable(this.$data);
|
|
3645
3696
|
rows;
|
|
3646
3697
|
columnBuilders;
|
|
3647
|
-
columnInfos;
|
|
3648
|
-
|
|
3698
|
+
$columnInfos = input.required({ alias: 'columnInfos' });
|
|
3699
|
+
$hasCustomFooter = computed(() => this.$columnInfos()?.some(ci => !!ci.customCell?.columnDef?.footerCell));
|
|
3649
3700
|
dropList;
|
|
3701
|
+
$footerRowStyle = computed(() => {
|
|
3702
|
+
const hasData = !!this.$displayDataLength();
|
|
3703
|
+
const metaFooter = this.$hasFooterMeta();
|
|
3704
|
+
const customFooter = this.$hasCustomFooter();
|
|
3705
|
+
const hasSelectionColumn = this.state.props().selectionColumn;
|
|
3706
|
+
return customFooter || (hasData && (metaFooter || hasSelectionColumn)) ? 'regular-footer' : hasData ? 'no-footer' : 'small-footer';
|
|
3707
|
+
});
|
|
3708
|
+
$showFooterRow = computed(() => this.$footerRowStyle() !== 'no-footer');
|
|
3650
3709
|
currentColumns;
|
|
3651
|
-
keys = [];
|
|
3652
3710
|
_injector = inject(Injector);
|
|
3653
3711
|
injector = Injector.create({
|
|
3654
3712
|
providers: [
|
|
3655
|
-
{ provide: MatTable, useFactory: () => this
|
|
3713
|
+
{ provide: MatTable, useFactory: () => this.$table() },
|
|
3656
3714
|
{ provide: CdkDropList, useFactory: () => this.dropList },
|
|
3657
3715
|
],
|
|
3658
3716
|
parent: this._injector
|
|
3659
3717
|
});
|
|
3660
3718
|
rowDefArr = [];
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3719
|
+
$hasSelectColumn = computed(() => this.state.selectSignal(state => state.props.selectionColumn)());
|
|
3720
|
+
$hasIndexColumn = computed(() => this.state.selectSignal(state => state.props.indexColumn)());
|
|
3721
|
+
myColumns = signal({});
|
|
3722
|
+
$showHeader = computed(() => !this.state.tableSettings().hideColumnHeader);
|
|
3723
|
+
offset$ = this.dataStore.select(s => s.virtualScrollOffset);
|
|
3665
3724
|
offsetIndex = 0;
|
|
3666
3725
|
dataView;
|
|
3667
3726
|
constructor() {
|
|
3668
3727
|
this.setUpSelections();
|
|
3728
|
+
effect(() => {
|
|
3729
|
+
const columnInfos = this.$columnInfos() || [];
|
|
3730
|
+
untracked(() => {
|
|
3731
|
+
Object.entries(this.myColumns()).forEach(([key, value]) => {
|
|
3732
|
+
const columnInfo = columnInfos.find(ci => ci.metaData.key === key);
|
|
3733
|
+
if (!columnInfo || columnInfo.customCell !== value.customCell) {
|
|
3734
|
+
delete this.myColumns()[key];
|
|
3735
|
+
this.$table()?.removeColumnDef(value.columnDef);
|
|
3736
|
+
}
|
|
3737
|
+
});
|
|
3738
|
+
columnInfos.forEach(ci => this.addMetaData(ci));
|
|
3739
|
+
});
|
|
3740
|
+
});
|
|
3741
|
+
effect(() => {
|
|
3742
|
+
const headerRow = this.$headerRow();
|
|
3743
|
+
const showHeader = this.$showHeader();
|
|
3744
|
+
const table = this.$table();
|
|
3745
|
+
untracked(() => {
|
|
3746
|
+
if (headerRow && showHeader && table)
|
|
3747
|
+
table.addHeaderRowDef(headerRow);
|
|
3748
|
+
else if (headerRow && table)
|
|
3749
|
+
table.removeHeaderRowDef(headerRow);
|
|
3750
|
+
});
|
|
3751
|
+
});
|
|
3752
|
+
effect(() => {
|
|
3753
|
+
const footerRow = this.$footerRow();
|
|
3754
|
+
const showFooter = this.$showFooterRow();
|
|
3755
|
+
const table = this.$table();
|
|
3756
|
+
untracked(() => {
|
|
3757
|
+
if (footerRow && showFooter && table)
|
|
3758
|
+
table.addFooterRowDef(footerRow);
|
|
3759
|
+
else if (footerRow && table)
|
|
3760
|
+
table.removeFooterRowDef(footerRow);
|
|
3761
|
+
});
|
|
3762
|
+
});
|
|
3669
3763
|
}
|
|
3670
3764
|
defaultTrackBy = (index, item) => item[initIndexSymbol];
|
|
3671
3765
|
trackByFunction = this.defaultTrackBy;
|
|
3672
3766
|
ngOnChanges(changes) {
|
|
3673
|
-
if (changes.rows && this.rows && this.myColumns.length) {
|
|
3767
|
+
if (changes.rows && this.rows && this.myColumns().length) {
|
|
3674
3768
|
this.initializeRowDefs([...this.rows]);
|
|
3675
3769
|
}
|
|
3676
3770
|
}
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3771
|
+
$keys = computed(() => {
|
|
3772
|
+
const displayed = this.state.$orderedVisibleColumns();
|
|
3773
|
+
const built = this.myColumns();
|
|
3774
|
+
const keys = displayed.filter(d => !!built[d]);
|
|
3775
|
+
if (this.$hasSelectColumn()) {
|
|
3776
|
+
keys.unshift('select');
|
|
3680
3777
|
}
|
|
3681
|
-
if (this
|
|
3682
|
-
|
|
3778
|
+
if (this.$hasIndexColumn()) {
|
|
3779
|
+
keys.unshift('index');
|
|
3683
3780
|
}
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3781
|
+
return keys;
|
|
3782
|
+
});
|
|
3783
|
+
keys$ = toObservable(this.$keys);
|
|
3784
|
+
ngOnInit() {
|
|
3687
3785
|
this.initializeRowDefs([...this.rows]);
|
|
3688
|
-
this.state.on(this.
|
|
3689
|
-
this.
|
|
3690
|
-
this.rowDefArr?.forEach(row => row.columns = this.keys);
|
|
3786
|
+
this.state.on(this.keys$, keys => {
|
|
3787
|
+
this.rowDefArr?.forEach(row => row.columns = keys);
|
|
3691
3788
|
});
|
|
3692
3789
|
this.state.on(this.selectableData$, (data) => {
|
|
3693
3790
|
if (this.selection.selected.length) {
|
|
@@ -3696,18 +3793,9 @@ class GenericTableComponent {
|
|
|
3696
3793
|
this.selection.deselect(...removed);
|
|
3697
3794
|
}
|
|
3698
3795
|
});
|
|
3699
|
-
this.showHeader$ = this.state.tableSettings$.pipe(map(settings => !(settings.hideColumnHeader)));
|
|
3700
|
-
this.showFooterRow$ = combineLatest([
|
|
3701
|
-
this.displayData$.pipe(map(d => !!d.length), distinctUntilChanged()),
|
|
3702
|
-
this.state.metaDataArray$.pipe(map(metaData => metaData.some(md => !!md.additional?.footer)), distinctUntilChanged()),
|
|
3703
|
-
this.columnInfos.pipe(map(columnInfos => columnInfos.some(ci => !!ci.customCell?.columnDef?.footerCell)), distinctUntilChanged()),
|
|
3704
|
-
]).pipe(map(([hasData, hasFooterDef, hasCustomFooter]) => {
|
|
3705
|
-
const hasSelectionColumn = this.state.props().selectionColumn;
|
|
3706
|
-
return hasCustomFooter || (hasData && (hasFooterDef || hasSelectionColumn)) ? 'regular-footer' : hasData ? 'no-footer' : 'small-footer';
|
|
3707
|
-
}));
|
|
3708
3796
|
if (this.state.tableSettings().usePaginator || this.state.tableSettings().useVirtualScroll) {
|
|
3709
|
-
this.state.on(this.state.state$, (state) => {
|
|
3710
|
-
this.offsetIndex =
|
|
3797
|
+
this.state.on(combineLatest([this.state.state$, this.dataStore.state$]), ([state, data]) => {
|
|
3798
|
+
this.offsetIndex = data.virtualEnds.start;
|
|
3711
3799
|
if (this.state.tableSettings().usePaginator) {
|
|
3712
3800
|
this.offsetIndex += (state.pageSize * state.currentPage);
|
|
3713
3801
|
}
|
|
@@ -3721,7 +3809,7 @@ class GenericTableComponent {
|
|
|
3721
3809
|
this.state.updateExpandedGroups({ key, isExpanded, groupKey });
|
|
3722
3810
|
}
|
|
3723
3811
|
addMetaData(column) {
|
|
3724
|
-
const columnBuilder = this.myColumns[column.metaData.key];
|
|
3812
|
+
const columnBuilder = this.myColumns()[column.metaData.key];
|
|
3725
3813
|
if (columnBuilder) {
|
|
3726
3814
|
columnBuilder.metaData = column.metaData;
|
|
3727
3815
|
}
|
|
@@ -3733,17 +3821,18 @@ class GenericTableComponent {
|
|
|
3733
3821
|
component.instance.customCell = column.customCell;
|
|
3734
3822
|
component.instance.metaData = column.metaData;
|
|
3735
3823
|
component.instance.data$ = this.data$;
|
|
3736
|
-
this.myColumns[column.metaData.key]
|
|
3824
|
+
this.myColumns.update(mc => ({ ...mc, [column.metaData.key]: component.instance }));
|
|
3737
3825
|
}
|
|
3738
3826
|
}
|
|
3739
3827
|
initializeRowDefs = (defs) => {
|
|
3740
|
-
|
|
3828
|
+
const table = this.$table();
|
|
3829
|
+
if (!table)
|
|
3830
|
+
return;
|
|
3831
|
+
this.rowDefArr.forEach(r => table.removeRowDef(r));
|
|
3741
3832
|
this.rowDefArr = defs;
|
|
3742
3833
|
defs.forEach(r => {
|
|
3743
|
-
r.columns = this.
|
|
3744
|
-
|
|
3745
|
-
this.table.addRowDef(r);
|
|
3746
|
-
}
|
|
3834
|
+
r.columns = this.$keys().concat(Object.values(this.myColumns).filter(c => c.metaData.fieldType !== FieldType.Hidden).map(c => c.metaData.key));
|
|
3835
|
+
table.addRowDef(r);
|
|
3747
3836
|
});
|
|
3748
3837
|
};
|
|
3749
3838
|
selection;
|
|
@@ -3794,7 +3883,6 @@ class GenericTableComponent {
|
|
|
3794
3883
|
return (previousUserDefinedWidth ?? 0) >= 0 && currentUserDefinedWidth == null;
|
|
3795
3884
|
}
|
|
3796
3885
|
}));
|
|
3797
|
-
showFooterRow$;
|
|
3798
3886
|
getTransform = (key, val) => {
|
|
3799
3887
|
if (val == undefined || val === 'null')
|
|
3800
3888
|
return '';
|
|
@@ -3807,7 +3895,8 @@ class GenericTableComponent {
|
|
|
3807
3895
|
};
|
|
3808
3896
|
$rowHeight = this.state.selectSignal(s => {
|
|
3809
3897
|
if (this.state.$isVirtual() && s.notPersistedTableSettings.useVirtualScroll?.enforceRowHeight) {
|
|
3810
|
-
|
|
3898
|
+
const height = s.notPersistedTableSettings.useVirtualScroll.rowHeight;
|
|
3899
|
+
return height + 'px';
|
|
3811
3900
|
}
|
|
3812
3901
|
if (typeof s.notPersistedTableSettings.rowHeight === 'number') {
|
|
3813
3902
|
return s.notPersistedTableSettings.rowHeight + 'px';
|
|
@@ -3816,7 +3905,8 @@ class GenericTableComponent {
|
|
|
3816
3905
|
});
|
|
3817
3906
|
$headerHeight = this.state.selectSignal(s => {
|
|
3818
3907
|
if (this.state.$isVirtual() && s.notPersistedTableSettings.useVirtualScroll?.enforceHeaderHeight) {
|
|
3819
|
-
|
|
3908
|
+
const height = s.notPersistedTableSettings.useVirtualScroll.headerHeight;
|
|
3909
|
+
return height + 'px';
|
|
3820
3910
|
}
|
|
3821
3911
|
if (typeof s.notPersistedTableSettings.headerHeight === 'number') {
|
|
3822
3912
|
return s.notPersistedTableSettings.headerHeight + 'px';
|
|
@@ -3825,27 +3915,20 @@ class GenericTableComponent {
|
|
|
3825
3915
|
});
|
|
3826
3916
|
$stickyFooter = computed(() => this.state.props().stickyFooter || this.state.$isVirtual());
|
|
3827
3917
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenericTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3828
|
-
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
|
|
3918
|
+
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]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\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 });
|
|
3829
3919
|
}
|
|
3830
3920
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: GenericTableComponent, decorators: [{
|
|
3831
3921
|
type: Component,
|
|
3832
3922
|
args: [{ selector: 'tb-generic-table', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
3833
3923
|
MatTableModule, DragDropModule, MatCheckboxModule, MatButtonModule, MatIconModule, NgTemplateOutlet,
|
|
3834
3924
|
MatTooltipModule, AsyncPipe, FunctionPipe,
|
|
3835
|
-
], 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]=\"(
|
|
3925
|
+
], 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]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\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"] }]
|
|
3836
3926
|
}], ctorParameters: () => [], propDecorators: { trackBy: [{
|
|
3837
3927
|
type: Input
|
|
3838
|
-
}], displayData$: [{
|
|
3839
|
-
type: Input
|
|
3840
3928
|
}], rows: [{
|
|
3841
3929
|
type: Input
|
|
3842
3930
|
}], columnBuilders: [{
|
|
3843
3931
|
type: Input
|
|
3844
|
-
}], columnInfos: [{
|
|
3845
|
-
type: Input
|
|
3846
|
-
}], table: [{
|
|
3847
|
-
type: ViewChild,
|
|
3848
|
-
args: [MatTable, { static: true }]
|
|
3849
3932
|
}], dropList: [{
|
|
3850
3933
|
type: ViewChild,
|
|
3851
3934
|
args: [CdkDropList, { static: true }]
|
|
@@ -3928,7 +4011,7 @@ class ExportToCsvService {
|
|
|
3928
4011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ExportToCsvService, decorators: [{
|
|
3929
4012
|
type: Injectable
|
|
3930
4013
|
}] });
|
|
3931
|
-
const removeFromMetaData = (state, keysToRemove) =>
|
|
4014
|
+
const removeFromMetaData = (state, keysToRemove) => orderStateMetaData(state)
|
|
3932
4015
|
.filter(meta => !keysToRemove.includes(meta.key));
|
|
3933
4016
|
const nonExportableFields = (state) => Object.values(state.metaData)
|
|
3934
4017
|
.filter(md => md.noExport)
|
|
@@ -4187,11 +4270,12 @@ class SortMenuComponentStore extends ComponentStore {
|
|
|
4187
4270
|
sorted.splice(index, 1, sort);
|
|
4188
4271
|
return ({ ...state, sorted });
|
|
4189
4272
|
});
|
|
4273
|
+
metaDataArr$ = toObservable(this.tableState.$metaDataArray);
|
|
4190
4274
|
reset = () => {
|
|
4191
4275
|
const sorted = this.tableState.sort$.pipe(mergeMap(sort => this.tableState.metaData$.pipe(notNull(), map(meta => sort.map(s => {
|
|
4192
4276
|
return { ...s, displayName: meta[s.active]?.displayName };
|
|
4193
4277
|
})))));
|
|
4194
|
-
const notSorted = this.
|
|
4278
|
+
const notSorted = this.metaDataArr$.pipe(mergeMap(metas => this.tableState.sort$.pipe(map(s => metas
|
|
4195
4279
|
.filter(meta => !s.some(s => s.active === meta.key) && meta.fieldType !== FieldType.NotMapped && !meta.noSort)
|
|
4196
4280
|
.map(meta => ({ active: meta.key, displayName: meta.displayName }))))));
|
|
4197
4281
|
this.set(combineLatest([
|
|
@@ -4271,6 +4355,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4271
4355
|
|
|
4272
4356
|
class PaginatorComponent {
|
|
4273
4357
|
state = inject(TableStore);
|
|
4358
|
+
data = inject(DataStore);
|
|
4274
4359
|
paginator;
|
|
4275
4360
|
currentPageData$;
|
|
4276
4361
|
$collapseFooter = computed(() => this.state.selectSignal(state => state.persistedTableSettings.collapseFooter)() || this.$showAll());
|
|
@@ -4283,7 +4368,7 @@ class PaginatorComponent {
|
|
|
4283
4368
|
this.state.updateState({ currentPage: pageEvent.pageIndex });
|
|
4284
4369
|
});
|
|
4285
4370
|
this.state.setPageSize(onPaginatorPageSizeChange(this.paginator));
|
|
4286
|
-
this.state.on(this.
|
|
4371
|
+
this.state.on(this.data.select(s => s.dataLen), (len) => this.paginator.length = len);
|
|
4287
4372
|
}
|
|
4288
4373
|
ngAfterViewInit() {
|
|
4289
4374
|
this.currentPageData$ = merge(this.paginator.page.pipe(map(mapPaginationEventToCurrentPageDetails)), this.data$.pipe(distinctUntilKeyChanged("length"), delayToAllowForProperUpdate, map(updateCurrentPageDetailsOnDataLengthChange(this.paginator))));
|
|
@@ -4316,7 +4401,7 @@ class PaginatorComponent {
|
|
|
4316
4401
|
</mat-paginator>
|
|
4317
4402
|
@if ($showAllOption()) {<button mat-button (click)="updatePaginator()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
4318
4403
|
</div>
|
|
4319
|
-
`, 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}
|
|
4404
|
+
`, 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: "pipe", type: AsyncPipe, name: "async" }, { 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 });
|
|
4320
4405
|
}
|
|
4321
4406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
4322
4407
|
type: Component,
|
|
@@ -4332,7 +4417,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4332
4417
|
</mat-paginator>
|
|
4333
4418
|
@if ($showAllOption()) {<button mat-button (click)="updatePaginator()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
4334
4419
|
</div>
|
|
4335
|
-
`, 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}
|
|
4420
|
+
`, 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"] }]
|
|
4336
4421
|
}], propDecorators: { paginator: [{
|
|
4337
4422
|
type: ViewChild,
|
|
4338
4423
|
args: [MatPaginator, { static: true }]
|
|
@@ -4414,14 +4499,15 @@ class TableVirtualScrollStrategy {
|
|
|
4414
4499
|
|
|
4415
4500
|
class VirtualScrollContainer {
|
|
4416
4501
|
state = inject(TableStore);
|
|
4502
|
+
dataStore = inject(DataStore);
|
|
4417
4503
|
viewport = viewChild(CdkVirtualScrollViewport);
|
|
4418
4504
|
defaultOptions = new VirtualScrollOptions();
|
|
4419
4505
|
scrollStrategy = new TableVirtualScrollStrategy(this.computedRowHeight(), this.computedHeaderHeight());
|
|
4420
|
-
dataLength$ = this.state.state
|
|
4506
|
+
dataLength$ = combineLatest([this.state.state$, this.dataStore.state$]).pipe(map$1(([s, d]) => ({
|
|
4421
4507
|
paginated: s.notPersistedTableSettings.usePaginator && !s.showAll,
|
|
4422
4508
|
pageSize: s.userDefined?.pageSize || s.pageSize,
|
|
4423
4509
|
pageNumber: s.currentPage,
|
|
4424
|
-
dataLen:
|
|
4510
|
+
dataLen: d.dataLen
|
|
4425
4511
|
})), distinctUntilChanged$1((a, b) => a.dataLen === b.dataLen &&
|
|
4426
4512
|
a.pageSize === b.pageSize &&
|
|
4427
4513
|
a.pageNumber === b.pageNumber &&
|
|
@@ -4442,7 +4528,7 @@ class VirtualScrollContainer {
|
|
|
4442
4528
|
if (!!viewport) {
|
|
4443
4529
|
addEventListener('resize', this.resizeHandler);
|
|
4444
4530
|
this.subscriber.on(viewport.renderedRangeStream, (range) => {
|
|
4445
|
-
this.
|
|
4531
|
+
this.dataStore.patchState({
|
|
4446
4532
|
virtualEnds: {
|
|
4447
4533
|
start: range.start,
|
|
4448
4534
|
end: range.end + 25,
|
|
@@ -4451,7 +4537,7 @@ class VirtualScrollContainer {
|
|
|
4451
4537
|
});
|
|
4452
4538
|
var offset$ = viewport.scrolledIndexChange.pipe(map$1(() => viewport.getOffsetToRenderedContentStart() ?? 0), distinctUntilChanged$1(), defaultShareReplay());
|
|
4453
4539
|
this.subscriber.on(offset$, (offset) => {
|
|
4454
|
-
this.
|
|
4540
|
+
this.dataStore.patchState({ virtualScrollOffset: offset });
|
|
4455
4541
|
});
|
|
4456
4542
|
this.setSize(this.viewport().elementRef);
|
|
4457
4543
|
}
|
|
@@ -4477,7 +4563,7 @@ class VirtualScrollContainer {
|
|
|
4477
4563
|
vsViewport.setAttribute('style', `height: ${height}px !important;`);
|
|
4478
4564
|
this.viewport()?.checkViewportSize();
|
|
4479
4565
|
const virtualScrollOffset = this.viewport()?.getOffsetToRenderedContentStart() ?? 0;
|
|
4480
|
-
this.
|
|
4566
|
+
this.dataStore.patchState({ virtualScrollOffset });
|
|
4481
4567
|
}
|
|
4482
4568
|
resizeHandler = () => {
|
|
4483
4569
|
if (this.viewport()) {
|
|
@@ -4876,13 +4962,19 @@ const defaultProps = {
|
|
|
4876
4962
|
class TableBuilderDataSource extends MatTableDataSource {
|
|
4877
4963
|
dataSrc;
|
|
4878
4964
|
subscription;
|
|
4879
|
-
|
|
4880
|
-
viewableData$ = this.#viewableData$.pipe(mergeAll());
|
|
4881
|
-
constructor(dataSrc, state) {
|
|
4965
|
+
constructor(dataSrc, state, data) {
|
|
4882
4966
|
super([]);
|
|
4883
4967
|
this.dataSrc = dataSrc;
|
|
4884
|
-
|
|
4885
|
-
|
|
4968
|
+
const viewType$ = state.viewType$.pipe(distinctUntilChanged$1(), defaultShareReplay());
|
|
4969
|
+
const distinctSizingData = combineLatest([state.state$, data.state$]).pipe(map$1(([{ currentPage, pageSize }, { virtualEnds }]) => ({ currentPage, pageSize, virtualEnd: virtualEnds?.end, virtualStart: virtualEnds?.start })), distinctUntilChanged$1((d1, d2) => d1.currentPage === d2.currentPage
|
|
4970
|
+
&& d1.pageSize === d2.pageSize
|
|
4971
|
+
&& d1.virtualEnd === d2.virtualEnd
|
|
4972
|
+
&& d1.virtualStart === d2.virtualStart));
|
|
4973
|
+
const _dataLength = this.dataSrc.pipe(map$1((data) => data.length), distinctUntilChanged$1());
|
|
4974
|
+
const firstDataLength = _dataLength.pipe(first());
|
|
4975
|
+
const subsequentDataLength = _dataLength.pipe(skip(1), delay(0));
|
|
4976
|
+
const dataLength = merge(firstDataLength, subsequentDataLength);
|
|
4977
|
+
const dataSize$ = combineLatest([viewType$, distinctSizingData, dataLength]).pipe(map$1(([viewType, { currentPage, pageSize, virtualEnd, virtualStart }, length]) => {
|
|
4886
4978
|
const previousPageRecords = currentPage * pageSize;
|
|
4887
4979
|
if (viewType === 'virtual paginator') {
|
|
4888
4980
|
return ({ start: virtualStart + previousPageRecords, end: Math.min(virtualEnd, pageSize) + previousPageRecords });
|
|
@@ -4890,15 +4982,16 @@ class TableBuilderDataSource extends MatTableDataSource {
|
|
|
4890
4982
|
if (viewType === 'paginator') {
|
|
4891
4983
|
return ({ start: previousPageRecords, end: previousPageRecords + pageSize });
|
|
4892
4984
|
}
|
|
4985
|
+
if (viewType === 'all') {
|
|
4986
|
+
return ({ start: 0, end: length });
|
|
4987
|
+
}
|
|
4893
4988
|
return ({ start: virtualStart, end: virtualEnd });
|
|
4894
|
-
}))
|
|
4989
|
+
}))
|
|
4895
4990
|
.pipe(distinctUntilChanged$1((a, b) => a.start === b.start && a.end === b.end), defaultShareReplay());
|
|
4896
|
-
this.dataToShow$ = combineLatest([this.dataSrc,
|
|
4991
|
+
this.dataToShow$ = combineLatest([this.dataSrc, dataSize$])
|
|
4897
4992
|
.pipe(map$1(([data, size]) => data.slice(size.start, size.end)))
|
|
4898
4993
|
.pipe(defaultShareReplay());
|
|
4899
4994
|
}
|
|
4900
|
-
#viewType$;
|
|
4901
|
-
#dataSize$;
|
|
4902
4995
|
dataToShow$;
|
|
4903
4996
|
connect() {
|
|
4904
4997
|
if (!this.subscription) {
|
|
@@ -4906,7 +4999,6 @@ class TableBuilderDataSource extends MatTableDataSource {
|
|
|
4906
4999
|
this.data = data;
|
|
4907
5000
|
});
|
|
4908
5001
|
}
|
|
4909
|
-
this.#viewableData$.next(this.dataToShow$);
|
|
4910
5002
|
return super.connect();
|
|
4911
5003
|
}
|
|
4912
5004
|
disconnect() {
|
|
@@ -4922,6 +5014,7 @@ class TableContainerComponent {
|
|
|
4922
5014
|
props = { ...defaultProps };
|
|
4923
5015
|
dataSubject = new ReplaySubject(1);
|
|
4924
5016
|
state = inject(TableStore);
|
|
5017
|
+
dataStore = inject(DataStore);
|
|
4925
5018
|
config = inject(TableBuilderConfigToken);
|
|
4926
5019
|
exportToCsvService = inject((ExportToCsvService));
|
|
4927
5020
|
wrapper = inject(TableWrapperDirective, { optional: true });
|
|
@@ -4964,7 +5057,10 @@ class TableContainerComponent {
|
|
|
4964
5057
|
paginatorComponent;
|
|
4965
5058
|
genericTable;
|
|
4966
5059
|
customRows;
|
|
4967
|
-
customCells;
|
|
5060
|
+
$customCells = contentChildren(CustomCellDirective);
|
|
5061
|
+
$myColumns = computed(() => {
|
|
5062
|
+
return this.state.$metaDataArray().map(metaData => ({ metaData, customCell: this.$customCells().find(cc => cc.customCell === metaData.key) }));
|
|
5063
|
+
});
|
|
4968
5064
|
tableElRef;
|
|
4969
5065
|
tableBuilder;
|
|
4970
5066
|
tableId;
|
|
@@ -5000,7 +5096,6 @@ class TableContainerComponent {
|
|
|
5000
5096
|
displayData = this.displayDataSubject.pipe(switchAll(), defaultShareReplay());
|
|
5001
5097
|
$displayData = toSignal(this.displayData, { initialValue: [] });
|
|
5002
5098
|
collapseFooter$ = this.state.state$.pipe(map(state => state.persistedTableSettings.collapseFooter));
|
|
5003
|
-
myColumns$;
|
|
5004
5099
|
ngOnDestroy() {
|
|
5005
5100
|
if (this.tableId) {
|
|
5006
5101
|
this.stateService.saveTableStateToLocal({ tableId: this.tableId, tableState: this.state.getSavableStateSignal() });
|
|
@@ -5049,11 +5144,21 @@ class TableContainerComponent {
|
|
|
5049
5144
|
this.displayDataSubject.next(flatGrouped$);
|
|
5050
5145
|
this.dataSubject.next(sortedAndFilteredData$);
|
|
5051
5146
|
this.state.on(this.displayData, (data) => {
|
|
5052
|
-
this.
|
|
5147
|
+
this.dataStore.patchState({ dataLen: data.length });
|
|
5053
5148
|
});
|
|
5054
5149
|
}
|
|
5055
5150
|
ngOnInit() {
|
|
5056
|
-
const
|
|
5151
|
+
const customCells$ = toObservable(this.$customCells, { injector: this.injector });
|
|
5152
|
+
this.state.setLinkMaps(this.tableBuilder.metaData$.pipe(map(createLinkCreatorDict)));
|
|
5153
|
+
const c = customCells$.pipe(switchMap(c => c.length ? combineLatest(c.map(c => c.$metaData)) : of([])));
|
|
5154
|
+
this.state.setMetaData(combineLatest([this.tableBuilder.metaData$, c]).pipe(map(([mds, customCells]) => {
|
|
5155
|
+
mds = mds.map(this.mapArrayFieldsMetaDatas);
|
|
5156
|
+
return [
|
|
5157
|
+
...mds,
|
|
5158
|
+
...customCells.map(md => this.mergeMetaData(md, mds.find(item => item.key === md.key)))
|
|
5159
|
+
];
|
|
5160
|
+
})));
|
|
5161
|
+
const ds = new TableBuilderDataSource(this.displayData, this.state, this.dataStore);
|
|
5057
5162
|
this.state.updateState({ props: {
|
|
5058
5163
|
dataSource: ds,
|
|
5059
5164
|
...this.props
|
|
@@ -5061,6 +5166,24 @@ class TableContainerComponent {
|
|
|
5061
5166
|
this.initializeState();
|
|
5062
5167
|
this.initializeData();
|
|
5063
5168
|
}
|
|
5169
|
+
mergeMetaData(metaData1, metaData2) {
|
|
5170
|
+
if (!metaData2) {
|
|
5171
|
+
metaData1.noExport = true;
|
|
5172
|
+
return metaData1;
|
|
5173
|
+
}
|
|
5174
|
+
if (!metaData1.displayName)
|
|
5175
|
+
metaData1.displayName = metaData2.displayName;
|
|
5176
|
+
if (!metaData1.preSort)
|
|
5177
|
+
metaData1.preSort = metaData2.preSort;
|
|
5178
|
+
if (!metaData1.order)
|
|
5179
|
+
metaData1.order = metaData2.order;
|
|
5180
|
+
if (!metaData1.width)
|
|
5181
|
+
metaData1.width = metaData2.width;
|
|
5182
|
+
if (metaData2.fieldType)
|
|
5183
|
+
metaData1.fieldType = metaData2.fieldType;
|
|
5184
|
+
metaData1.noExport = !metaData2;
|
|
5185
|
+
return metaData1;
|
|
5186
|
+
}
|
|
5064
5187
|
exportToCsv() {
|
|
5065
5188
|
const sorted = this.data.pipe(withLatestFrom(this.state.sort$), map(([data, sorted]) => sortData(data, sorted)));
|
|
5066
5189
|
this.exportToCsvService.exportToCsv(sorted);
|
|
@@ -5071,25 +5194,12 @@ class TableContainerComponent {
|
|
|
5071
5194
|
};
|
|
5072
5195
|
collapseAllGroups = () => this.state.collapseAll();
|
|
5073
5196
|
ngAfterContentInit() {
|
|
5074
|
-
this.initializeColumns();
|
|
5075
5197
|
this.state.runOnceWhen(stateIs(InitializationState.LoadedFromStore), state => {
|
|
5076
5198
|
this.addFilterDirectives(state);
|
|
5077
5199
|
this.state.updateState({ initializationState: InitializationState.Ready });
|
|
5078
5200
|
});
|
|
5079
5201
|
}
|
|
5080
|
-
|
|
5081
|
-
const customCellMap = new Map(this.customCells.map(cc => [cc.customCell, cc]));
|
|
5082
|
-
this.state.setMetaData(this.tableBuilder.metaData$.pipe(map((mds) => {
|
|
5083
|
-
mds = mds.map(this.mapMetaDatas);
|
|
5084
|
-
return [
|
|
5085
|
-
...mds,
|
|
5086
|
-
...this.customCells.map(cc => cc.getMetaData(mds.find(item => item.key === cc.customCell)))
|
|
5087
|
-
];
|
|
5088
|
-
})));
|
|
5089
|
-
this.state.setLinkMaps(this.tableBuilder.metaData$.pipe(map(createLinkCreatorDict)));
|
|
5090
|
-
this.myColumns$ = this.state.metaDataArray$.pipe(mapArray(metaData => ({ metaData, customCell: customCellMap.get(metaData.key) })), defaultShareReplay());
|
|
5091
|
-
}
|
|
5092
|
-
mapMetaDatas = (meta) => {
|
|
5202
|
+
mapArrayFieldsMetaDatas = (meta) => {
|
|
5093
5203
|
if (meta.fieldType === FieldType.Array) {
|
|
5094
5204
|
const additional = { ...meta.additional };
|
|
5095
5205
|
additional.arrayStyle = additional?.arrayStyle ?? ArrayDefaults.arrayStyle;
|
|
@@ -5102,7 +5212,7 @@ class TableContainerComponent {
|
|
|
5102
5212
|
addFilterDirectives = (state) => {
|
|
5103
5213
|
const customFilters$ = toObservable(this.allFilterDirectives, { injector: this.injector }).pipe(mergeMap(customerFilters => customerFilters
|
|
5104
5214
|
.filter(filter => !filter.savable)
|
|
5105
|
-
.map(filter => filter.filter$)), mergeAll
|
|
5215
|
+
.map(filter => filter.filter$)), mergeAll(), scan$1((a, b) => {
|
|
5106
5216
|
if (b.active) {
|
|
5107
5217
|
a[b.filterId] = isCustomFilter(b) ? b.predicate : createFilterFunc(b);
|
|
5108
5218
|
}
|
|
@@ -5117,11 +5227,11 @@ class TableContainerComponent {
|
|
|
5117
5227
|
};
|
|
5118
5228
|
$useVirtual = this.state.$isVirtual;
|
|
5119
5229
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5120
|
-
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", trackBy: "trackBy", inputFilters: "inputFilters" }, outputs: { selection$: "selection$", data: "data", onStateReset: "onStateReset", onSaveState: "onSaveState", state$: "state$" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore], queries: [{ propertyName: "filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "tableElRef", first: true, predicate: ["table"], descendants: true, read: ElementRef }, { propertyName: "customRows", predicate: MatRowDef }
|
|
5230
|
+
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", trackBy: "trackBy", inputFilters: "inputFilters" }, outputs: { selection$: "selection$", data: "data", 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$ | async)) || 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$ | async)) {\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$ | async) ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{(collapseHeader$ | async) ? '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 [data$]=\"data\" [tableElRef]=\"tableElRef\" />\r\n\r\n <mat-icon [matTooltip]=\"(collapseFooter$ | async) ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{(collapseFooter$ | async) ? '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%}.table-wrapper{overflow-x:auto}.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: ["data$", "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 });
|
|
5121
5231
|
}
|
|
5122
5232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TableContainerComponent, decorators: [{
|
|
5123
5233
|
type: Component,
|
|
5124
|
-
args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore], 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$ | async)) || 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$ | async)) {\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$ | async) ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{(collapseHeader$ | async) ? '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
|
|
5234
|
+
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$ | async)) || 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$ | async)) {\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$ | async) ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{(collapseHeader$ | async) ? '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 [data$]=\"data\" [tableElRef]=\"tableElRef\" />\r\n\r\n <mat-icon [matTooltip]=\"(collapseFooter$ | async) ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{(collapseFooter$ | async) ? '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%}.table-wrapper{overflow-x:auto}.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"] }]
|
|
5125
5235
|
}], propDecorators: { paginatorComponent: [{
|
|
5126
5236
|
type: ViewChild,
|
|
5127
5237
|
args: [PaginatorComponent]
|
|
@@ -5131,9 +5241,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5131
5241
|
}], customRows: [{
|
|
5132
5242
|
type: ContentChildren,
|
|
5133
5243
|
args: [MatRowDef]
|
|
5134
|
-
}], customCells: [{
|
|
5135
|
-
type: ContentChildren,
|
|
5136
|
-
args: [CustomCellDirective]
|
|
5137
5244
|
}], tableElRef: [{
|
|
5138
5245
|
type: ContentChild,
|
|
5139
5246
|
args: ['table', { read: ElementRef }]
|
|
@@ -5310,7 +5417,7 @@ class TableBuilder {
|
|
|
5310
5417
|
this.settings = this.coerceSettingsToObservable(settings)
|
|
5311
5418
|
.pipe(map(sett => new GeneralTableSettings(sett)), defaultShareReplay());
|
|
5312
5419
|
this.data$ = this.coerceToObservable(data, this.settings)
|
|
5313
|
-
.pipe(defaultShareReplay());
|
|
5420
|
+
.pipe(notNull(), defaultShareReplay());
|
|
5314
5421
|
this.metaData$ = metaData ?
|
|
5315
5422
|
this.coerceToObservable(metaData, this.settings).pipe(defaultShareReplay())
|
|
5316
5423
|
:
|
|
@@ -5545,5 +5652,5 @@ function provideActionableSelector() {
|
|
|
5545
5652
|
* Generated bundle index. Do not edit.
|
|
5546
5653
|
*/
|
|
5547
5654
|
|
|
5548
|
-
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterTypes, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isDifferent, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
5655
|
+
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterTypes, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isDifferent, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
5549
5656
|
//# sourceMappingURL=one-paragon-angular-utilities.mjs.map
|