@one-paragon/angular-utilities 2.0.0-beta.1 → 2.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/one-paragon-angular-utilities.mjs +172 -89
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/package.json +1 -1
- package/table-builder/classes/TableState.d.ts +1 -0
- package/table-builder/classes/table-builder-general-settings.d.ts +18 -6
- package/table-builder/classes/table-store.d.ts +6 -3
- package/table-builder/classes/table-store.helpers.d.ts +1 -0
- package/table-builder/components/generic-table/generic-table.component.d.ts +1 -1
- package/table-builder/components/generic-table/paginator.component.d.ts +1 -2
- package/table-builder/components/table-container/table-container-imports.d.ts +1 -1
- package/table-builder/components/table-container/table-container.d.ts +10 -8
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +12 -3
- package/table-builder/directives/custom-cell-directive.d.ts +4 -2
- package/table-builder/directives/table-wrapper.directive.d.ts +1 -1
- package/table-builder/interfaces/report-def.d.ts +9 -2
- package/table-builder/pipes/format-filter-type.pipe.d.ts +1 -1
- package/table-builder/services/transform-creator.d.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, Pipe, input, Renderer2, ElementRef, booleanAttribute,
|
|
2
|
+
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, Pipe, input, signal, Renderer2, ElementRef, booleanAttribute, InjectionToken, makeEnvironmentProviders, Component, ChangeDetectionStrategy, HostListener, EventEmitter, untracked, Output, ContentChildren, ChangeDetectorRef, output, ViewChild, EnvironmentInjector, createComponent, viewChild, effect, linkedSignal, contentChild, forwardRef, contentChildren, model, runInInjectionContext, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, observeOn, scan as scan$1, timestamp as timestamp$1, first as first$1 } from 'rxjs/operators';
|
|
4
4
|
import * as i1 from 'rxjs';
|
|
5
|
-
import { Subject, isObservable, of, ReplaySubject, filter as filter$1, first, map as map$1, Observable, combineLatest, Subscription, startWith as startWith$1, pairwise, concatMap, merge, delay, fromEvent, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, animationFrameScheduler, timestamp, BehaviorSubject } from 'rxjs';
|
|
5
|
+
import { Subject, isObservable, of, ReplaySubject, filter as filter$1, first, map as map$1, Observable, combineLatest, Subscription, startWith as startWith$1, pairwise, concatMap, merge, delay, fromEvent, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, animationFrameScheduler, debounceTime, timestamp, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import { ComponentStore } from '@ngrx/component-store';
|
|
7
7
|
import { toObservable, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
8
8
|
import * as i1$8 from '@angular/common';
|
|
@@ -11,6 +11,7 @@ import * as i3$2 from '@angular/material/sort';
|
|
|
11
11
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
12
12
|
import { merge as merge$1, get, sumBy, difference, intersection, groupBy, orderBy, set, isFunction as isFunction$1 } from 'lodash';
|
|
13
13
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
14
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
14
15
|
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
|
15
16
|
import * as i10 from '@angular/material/radio';
|
|
16
17
|
import { MatRadioButton, MatRadioModule } from '@angular/material/radio';
|
|
@@ -786,9 +787,10 @@ class TableColumnHeaderSettings {
|
|
|
786
787
|
noHeader = false;
|
|
787
788
|
}
|
|
788
789
|
class TableSettings {
|
|
789
|
-
usePaginator =
|
|
790
|
+
usePaginator = undefined;
|
|
790
791
|
useVirtualScroll = undefined;
|
|
791
|
-
|
|
792
|
+
paginatorSettings = undefined;
|
|
793
|
+
virtualScrollSettings = undefined;
|
|
792
794
|
rowHeight = undefined;
|
|
793
795
|
groupHeaderHeight = undefined;
|
|
794
796
|
minColumnWidth;
|
|
@@ -824,22 +826,32 @@ class NotPersistedTableSettings {
|
|
|
824
826
|
newNpts.hideColumnHeaderFilters = tableSettings.columnHeaderSettings?.noFilters ?? newNpts.hideColumnHeaderFilters;
|
|
825
827
|
newNpts.hideColumnHeader = tableSettings.columnHeaderSettings?.noHeader ?? newNpts.hideColumnHeader;
|
|
826
828
|
newNpts.usePaginator = tableSettings.tableSettings?.usePaginator ?? newNpts.usePaginator;
|
|
827
|
-
newNpts.useVirtualScroll = tableSettings.tableSettings?.useVirtualScroll
|
|
828
|
-
|
|
829
|
+
newNpts.useVirtualScroll = tableSettings.tableSettings?.useVirtualScroll != undefined ? tableSettings.tableSettings?.useVirtualScroll :
|
|
830
|
+
tableSettings.tableSettings?.virtualScrollSettings ? true
|
|
831
|
+
: newNpts.useVirtualScroll;
|
|
829
832
|
newNpts.rowHeight = tableSettings.tableSettings?.rowHeight ?? newNpts.rowHeight;
|
|
830
833
|
newNpts.headerHeight = tableSettings.headerSettings?.headerHeight ?? newNpts.headerHeight;
|
|
831
834
|
newNpts.groupHeaderHeight = tableSettings.tableSettings?.groupHeaderHeight ?? newNpts.groupHeaderHeight;
|
|
832
835
|
newNpts.minColumnWidth = tableSettings.tableSettings?.minColumnWidth ?? newNpts.minColumnWidth;
|
|
833
|
-
if (tableSettings.tableSettings?.
|
|
834
|
-
const currVirt = tableSettings.tableSettings
|
|
835
|
-
if (!currVirt.headerHeight
|
|
836
|
+
if (tableSettings.tableSettings?.virtualScrollSettings) {
|
|
837
|
+
const currVirt = tableSettings.tableSettings?.virtualScrollSettings || newNpts.virtualSettings;
|
|
838
|
+
if (!currVirt.headerHeight) {
|
|
836
839
|
currVirt.headerHeight = (typeof tableSettings.headerSettings?.headerHeight === 'number' ? tableSettings.headerSettings?.headerHeight : DefaultVirtualScrollOptions.headerHeight);
|
|
837
840
|
}
|
|
838
|
-
if (!currVirt.rowHeight
|
|
841
|
+
if (!currVirt.rowHeight) {
|
|
839
842
|
currVirt.rowHeight = (typeof tableSettings.tableSettings?.rowHeight === 'number' ? tableSettings.tableSettings?.rowHeight : DefaultVirtualScrollOptions.rowHeight);
|
|
840
843
|
}
|
|
841
|
-
|
|
844
|
+
newNpts.virtualSettings = { ...new VirtualScrollOptions(), ...currVirt };
|
|
845
|
+
}
|
|
846
|
+
else
|
|
847
|
+
newNpts.virtualSettings ??= new VirtualScrollOptions();
|
|
848
|
+
if (tableSettings.tableSettings?.paginatorSettings) {
|
|
849
|
+
const currPag = tableSettings.tableSettings?.paginatorSettings ? merge$1(newNpts.paginatorSettings, tableSettings.tableSettings?.paginatorSettings) : (newNpts.paginatorSettings ?? new PaginatorOptions());
|
|
850
|
+
currPag.includeAllInOptions = (currPag.defaultAll && currPag.includeAllInOptions !== false) || currPag.includeAllInOptions;
|
|
851
|
+
newNpts.paginatorSettings = { ...new PaginatorOptions(), ...currPag };
|
|
842
852
|
}
|
|
853
|
+
else
|
|
854
|
+
newNpts.paginatorSettings ??= new PaginatorOptions();
|
|
843
855
|
}
|
|
844
856
|
return newNpts;
|
|
845
857
|
}
|
|
@@ -852,15 +864,15 @@ class NotPersistedTableSettings {
|
|
|
852
864
|
hideColumnHeaderFilters = false;
|
|
853
865
|
hideColumnHeader = false;
|
|
854
866
|
usePaginator = true;
|
|
855
|
-
useVirtualScroll =
|
|
856
|
-
|
|
867
|
+
useVirtualScroll = false;
|
|
868
|
+
paginatorSettings = undefined;
|
|
869
|
+
virtualSettings = undefined;
|
|
857
870
|
groupHeaderHeight = undefined;
|
|
858
871
|
rowHeight;
|
|
859
872
|
headerHeight = undefined;
|
|
860
873
|
minColumnWidth;
|
|
861
874
|
}
|
|
862
875
|
class VirtualScrollOptions {
|
|
863
|
-
virtualAsDefault = true;
|
|
864
876
|
rowHeight = 48;
|
|
865
877
|
enforceRowHeight = true;
|
|
866
878
|
headerHeight = 56;
|
|
@@ -870,6 +882,17 @@ class VirtualScrollOptions {
|
|
|
870
882
|
* This will win over `amountOfVisibleItems`
|
|
871
883
|
*/
|
|
872
884
|
maxViewPortHeight = undefined;
|
|
885
|
+
/**
|
|
886
|
+
* Will try to bring the table to the bottom of the screen
|
|
887
|
+
* If `amountOfVisibleItems` is set that will be the minimum number of rows
|
|
888
|
+
* If `maxViewPortHeight` is set that will be the max table size
|
|
889
|
+
*/
|
|
890
|
+
dynamicHeight = false;
|
|
891
|
+
}
|
|
892
|
+
class PaginatorOptions {
|
|
893
|
+
pageSize = undefined;
|
|
894
|
+
defaultAll = false;
|
|
895
|
+
includeAllInOptions = false;
|
|
873
896
|
}
|
|
874
897
|
const DefaultVirtualScrollOptions = {
|
|
875
898
|
rowHeight: 48,
|
|
@@ -937,7 +960,7 @@ class CustomCellDirective {
|
|
|
937
960
|
templateRef = inject(TemplateRef, { optional: true });
|
|
938
961
|
columnDef = inject(CdkColumnDef, { optional: true });
|
|
939
962
|
$customCell = input.required({ alias: 'customCell' });
|
|
940
|
-
$displayName = input(undefined, { alias: '
|
|
963
|
+
$displayName = input(undefined, { alias: 'customCellDisplayName' });
|
|
941
964
|
$preSort = input(undefined, { alias: 'preSort' });
|
|
942
965
|
$templateRef = input(this.templateRef || undefined, { alias: 'templateRef' });
|
|
943
966
|
$customCellOrder = input(undefined, { alias: 'customCellOrder' });
|
|
@@ -949,7 +972,7 @@ class CustomCellDirective {
|
|
|
949
972
|
/**
|
|
950
973
|
* true if column not mapped to a property in the data source. Default is false.
|
|
951
974
|
*/
|
|
952
|
-
$customCellNotMapped = input(false, { alias: 'customCellNotMapped' });
|
|
975
|
+
$customCellNotMapped = input(false, { alias: 'customCellNotMapped', transform: coerceBooleanProperty });
|
|
953
976
|
$metaData = computed(() => {
|
|
954
977
|
const c = this.$customCell();
|
|
955
978
|
if (!c)
|
|
@@ -965,11 +988,15 @@ class CustomCellDirective {
|
|
|
965
988
|
noExport: true,
|
|
966
989
|
});
|
|
967
990
|
});
|
|
991
|
+
$inited = signal(false);
|
|
992
|
+
ngOnInit() {
|
|
993
|
+
this.$inited.set(true);
|
|
994
|
+
}
|
|
968
995
|
static ngTemplateContextGuard(dir, ctx) {
|
|
969
996
|
return true;
|
|
970
997
|
}
|
|
971
998
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CustomCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
972
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: CustomCellDirective, isStandalone: true, selector: "[customCell]", inputs: { $customCell: { classPropertyName: "$customCell", publicName: "customCell", isSignal: true, isRequired: true, transformFunction: null }, $displayName: { classPropertyName: "$displayName", publicName: "
|
|
999
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: CustomCellDirective, isStandalone: true, selector: "[customCell]", inputs: { $customCell: { classPropertyName: "$customCell", publicName: "customCell", isSignal: true, isRequired: true, transformFunction: null }, $displayName: { classPropertyName: "$displayName", publicName: "customCellDisplayName", isSignal: true, isRequired: false, transformFunction: null }, $preSort: { classPropertyName: "$preSort", publicName: "preSort", isSignal: true, isRequired: false, transformFunction: null }, $templateRef: { classPropertyName: "$templateRef", publicName: "templateRef", isSignal: true, isRequired: false, transformFunction: null }, $customCellOrder: { classPropertyName: "$customCellOrder", publicName: "customCellOrder", isSignal: true, isRequired: false, transformFunction: null }, $customCellWidth: { classPropertyName: "$customCellWidth", publicName: "customCellWidth", isSignal: true, isRequired: false, transformFunction: null }, $customCellTableRef: { classPropertyName: "$customCellTableRef", publicName: "customCellTableRef", isSignal: true, isRequired: false, transformFunction: null }, $customCellNotMapped: { classPropertyName: "$customCellNotMapped", publicName: "customCellNotMapped", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
973
1000
|
}
|
|
974
1001
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CustomCellDirective, decorators: [{
|
|
975
1002
|
type: Directive,
|
|
@@ -1830,11 +1857,14 @@ class TableStore extends ComponentStore {
|
|
|
1830
1857
|
notPersistedTableSettings: new NotPersistedTableSettings().merge(config.defaultTableSettings),
|
|
1831
1858
|
};
|
|
1832
1859
|
if (config.defaultTableSettings?.pageSize) {
|
|
1833
|
-
settingsFromConfig
|
|
1860
|
+
settingsFromConfig.notPersistedTableSettings.paginatorSettings.pageSize = config.defaultTableSettings?.pageSize;
|
|
1834
1861
|
}
|
|
1835
|
-
|
|
1862
|
+
const pageSize = settingsFromConfig.notPersistedTableSettings.paginatorSettings.pageSize || defaultTableState.pageSize;
|
|
1863
|
+
const showAll = settingsFromConfig.notPersistedTableSettings.paginatorSettings.defaultAll || defaultTableState.showAll;
|
|
1864
|
+
super({ ...defaultTableState, ...settingsFromConfig, pageSize, showAll });
|
|
1836
1865
|
}
|
|
1837
|
-
|
|
1866
|
+
$initializationState = this.selectSignal(state => state.initializationState);
|
|
1867
|
+
$savableState = computed(() => {
|
|
1838
1868
|
const state = this.state();
|
|
1839
1869
|
return mapSaveableState(state);
|
|
1840
1870
|
});
|
|
@@ -1867,7 +1897,6 @@ class TableStore extends ComponentStore {
|
|
|
1867
1897
|
.pipe(switchMap(() => this.selectSorted$));
|
|
1868
1898
|
$getUserDefinedTableWidth = this.selectSignal(state => state.userDefined.table.width);
|
|
1869
1899
|
getUserDefinedTableWidth$ = this.select(state => state.userDefined.table.width);
|
|
1870
|
-
$getPageSize = this.selectSignal(state => state.userDefined.pageSize || state.pageSize);
|
|
1871
1900
|
$footerCollapsed = this.selectSignal(state => state.persistedTableSettings.collapseFooter);
|
|
1872
1901
|
$headerCollapsed = this.selectSignal(state => state.persistedTableSettings.collapseHeader);
|
|
1873
1902
|
$groupBy = this.selectSignal(state => state.groupBy);
|
|
@@ -1886,6 +1915,7 @@ class TableStore extends ComponentStore {
|
|
|
1886
1915
|
};
|
|
1887
1916
|
$currentPage = this.selectSignal(state => state.currentPage);
|
|
1888
1917
|
$pageSize = this.selectSignal(s => s.userDefined?.pageSize || s.pageSize);
|
|
1918
|
+
$showAll = this.selectSignal(s => s.userDefined?.showAll ?? s.showAll);
|
|
1889
1919
|
$tableSettings = this.selectSignal(state => {
|
|
1890
1920
|
const ts = { ...state.persistedTableSettings, ...state.notPersistedTableSettings };
|
|
1891
1921
|
return ts;
|
|
@@ -1893,13 +1923,17 @@ class TableStore extends ComponentStore {
|
|
|
1893
1923
|
tableSettings$ = toObservable(this.$tableSettings);
|
|
1894
1924
|
$props = this.selectSignal(s => s.props);
|
|
1895
1925
|
$getLinkInfo = (md) => this.selectSignal(state => state.linkMaps[md.key]);
|
|
1896
|
-
$isVirtual = this.selectSignal(state => state.notPersistedTableSettings.useVirtualScroll
|
|
1926
|
+
$isVirtual = this.selectSignal(state => state.notPersistedTableSettings.useVirtualScroll
|
|
1927
|
+
|| state.showAll
|
|
1928
|
+
|| state.userDefined?.showAll);
|
|
1897
1929
|
$viewType = this.selectSignal(state => {
|
|
1898
1930
|
const usePaginator = state.notPersistedTableSettings.usePaginator;
|
|
1899
|
-
|
|
1931
|
+
const showAll = state.showAll || state.userDefined?.showAll;
|
|
1932
|
+
const useVirtualScroll = state.notPersistedTableSettings.useVirtualScroll;
|
|
1933
|
+
if (showAll || (useVirtualScroll && !usePaginator)) {
|
|
1900
1934
|
return 'virtual all';
|
|
1901
1935
|
}
|
|
1902
|
-
else if (
|
|
1936
|
+
else if (useVirtualScroll && usePaginator) {
|
|
1903
1937
|
return 'virtual paginator';
|
|
1904
1938
|
}
|
|
1905
1939
|
else if (usePaginator) {
|
|
@@ -1929,8 +1963,11 @@ class TableStore extends ComponentStore {
|
|
|
1929
1963
|
const s = {
|
|
1930
1964
|
...state,
|
|
1931
1965
|
persistedTableSettings: state.persistedTableSettings.merge(settings),
|
|
1932
|
-
notPersistedTableSettings: state.notPersistedTableSettings.merge(settings)
|
|
1966
|
+
notPersistedTableSettings: state.notPersistedTableSettings.merge(settings),
|
|
1967
|
+
initializationState: InitializationState.Ready
|
|
1933
1968
|
};
|
|
1969
|
+
s.pageSize = settings.tableSettings?.paginatorSettings?.pageSize ?? s.pageSize;
|
|
1970
|
+
s.showAll = settings.tableSettings?.paginatorSettings?.defaultAll ?? s.showAll;
|
|
1934
1971
|
return s;
|
|
1935
1972
|
});
|
|
1936
1973
|
setMetaData = this.updater((state, md) => {
|
|
@@ -1981,12 +2018,6 @@ class TableStore extends ComponentStore {
|
|
|
1981
2018
|
addFilter = this.updater((state, filter) => {
|
|
1982
2019
|
return this.addFiltersToState(state, [filter]);
|
|
1983
2020
|
});
|
|
1984
|
-
// readonly patchPredicate = this.updater((state, {filterId, predicate}: {filterId: string, predicate: (data: any) => boolean}) => {
|
|
1985
|
-
// const filtersCopy = { ...state.filters };
|
|
1986
|
-
// const filter = filtersCopy[filterId] as CustomFilter;
|
|
1987
|
-
// filter.predicate = predicate;
|
|
1988
|
-
// return ({...state, filters: filtersCopy });
|
|
1989
|
-
// });
|
|
1990
2021
|
addFilters = this.updater((state, filters) => {
|
|
1991
2022
|
return this.addFiltersToState(state, filters);
|
|
1992
2023
|
});
|
|
@@ -2041,7 +2072,9 @@ class TableStore extends ComponentStore {
|
|
|
2041
2072
|
};
|
|
2042
2073
|
});
|
|
2043
2074
|
setCurrentPage = this.updater((state, currentPage) => ({ ...state, currentPage }));
|
|
2044
|
-
setPageSize = this.updater((state, pageSize) => ({ ...state, pageSize
|
|
2075
|
+
setPageSize = this.updater((state, pageSize) => ({ ...state, pageSize }));
|
|
2076
|
+
setUserDefinedPageSize = this.updater((state, pageSize) => ({ ...state, userDefined: { ...state.userDefined, pageSize } }));
|
|
2077
|
+
setUserDefinedShowAll = this.updater((state, showAll) => ({ ...state, showAll, userDefined: { ...state.userDefined, showAll } }));
|
|
2045
2078
|
setProps = this.updater((state, props) => {
|
|
2046
2079
|
return ({ ...state, props });
|
|
2047
2080
|
});
|
|
@@ -3052,14 +3085,19 @@ class TransformCreator {
|
|
|
3052
3085
|
currencyPipe = inject(CurrencyPipe);
|
|
3053
3086
|
phonePipe = inject(PhoneNumberPipe);
|
|
3054
3087
|
config = inject(TableBuilderConfigToken);
|
|
3055
|
-
createTransformer(metaData, noIcons = false) {
|
|
3088
|
+
createTransformer(metaData, noIcons = false, forItem = false) {
|
|
3056
3089
|
const nested = metaData.key.includes('.');
|
|
3057
3090
|
const defaultFunc = nested ? (value) => get(value, metaData.key) : (value) => value[metaData.key];
|
|
3058
|
-
if (metaData.map) {
|
|
3091
|
+
if (metaData.map && !forItem) {
|
|
3059
3092
|
return (value) => {
|
|
3060
3093
|
return metaData.map(value);
|
|
3061
3094
|
};
|
|
3062
3095
|
}
|
|
3096
|
+
if (metaData.mapItem) {
|
|
3097
|
+
return (value) => {
|
|
3098
|
+
return metaData.mapItem(defaultFunc(value));
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3063
3101
|
if (metaData.transform) {
|
|
3064
3102
|
if (isPipe(metaData.transform)) {
|
|
3065
3103
|
return (value) => metaData.transform.transform(defaultFunc(value));
|
|
@@ -3870,15 +3908,15 @@ class GenericTableComponent {
|
|
|
3870
3908
|
if (val == undefined || val === 'null')
|
|
3871
3909
|
return '';
|
|
3872
3910
|
try {
|
|
3873
|
-
return this.transformCreator.createTransformer(this.$
|
|
3911
|
+
return this.transformCreator.createTransformer(this.state.$getMetaData(key)(), true, true)(val);
|
|
3874
3912
|
}
|
|
3875
3913
|
catch (error) {
|
|
3876
3914
|
return val;
|
|
3877
3915
|
}
|
|
3878
3916
|
};
|
|
3879
3917
|
$rowHeight = this.state.selectSignal(s => {
|
|
3880
|
-
if (this.state.$isVirtual() && s.notPersistedTableSettings.
|
|
3881
|
-
const height = s.notPersistedTableSettings.
|
|
3918
|
+
if (this.state.$isVirtual() && s.notPersistedTableSettings.virtualSettings?.enforceRowHeight) {
|
|
3919
|
+
const height = s.notPersistedTableSettings.virtualSettings.rowHeight;
|
|
3882
3920
|
return height + 'px';
|
|
3883
3921
|
}
|
|
3884
3922
|
if (typeof s.notPersistedTableSettings.rowHeight === 'number') {
|
|
@@ -3887,8 +3925,8 @@ class GenericTableComponent {
|
|
|
3887
3925
|
return s.notPersistedTableSettings.rowHeight;
|
|
3888
3926
|
});
|
|
3889
3927
|
$headerHeight = this.state.selectSignal(s => {
|
|
3890
|
-
if (this.state.$isVirtual() && s.notPersistedTableSettings.
|
|
3891
|
-
const height = s.notPersistedTableSettings.
|
|
3928
|
+
if (this.state.$isVirtual() && s.notPersistedTableSettings.virtualSettings?.enforceHeaderHeight) {
|
|
3929
|
+
const height = s.notPersistedTableSettings.virtualSettings.headerHeight;
|
|
3892
3930
|
return height + 'px';
|
|
3893
3931
|
}
|
|
3894
3932
|
if (typeof s.notPersistedTableSettings.headerHeight === 'number') {
|
|
@@ -4347,9 +4385,10 @@ class PaginatorComponent {
|
|
|
4347
4385
|
});
|
|
4348
4386
|
onPageSizeEffect = effect(() => {
|
|
4349
4387
|
const size = this.$pageSizeChangeEvent();
|
|
4350
|
-
|
|
4388
|
+
const initialized = this.state.$initializationState() >= InitializationState.Ready;
|
|
4389
|
+
if (!size || !initialized)
|
|
4351
4390
|
return;
|
|
4352
|
-
untracked(() => this.state.
|
|
4391
|
+
untracked(() => this.state.setUserDefinedPageSize(size));
|
|
4353
4392
|
});
|
|
4354
4393
|
onMetaPageSizeEffect = effect(() => {
|
|
4355
4394
|
const paginator = this.$paginator();
|
|
@@ -4368,11 +4407,10 @@ class PaginatorComponent {
|
|
|
4368
4407
|
});
|
|
4369
4408
|
});
|
|
4370
4409
|
$collapseFooter = computed(() => this.state.selectSignal(state => state.persistedTableSettings.collapseFooter)() || this.$showAll());
|
|
4371
|
-
$showAllOption = this.state.selectSignal(s => s.notPersistedTableSettings?.
|
|
4372
|
-
$showAll = this.state
|
|
4373
|
-
updatePaginator = this.state.updater(state => ({ ...state, showAll: !state.showAll }));
|
|
4410
|
+
$showAllOption = this.state.selectSignal(s => s.notPersistedTableSettings?.paginatorSettings?.includeAllInOptions);
|
|
4411
|
+
$showAll = this.state.$showAll;
|
|
4374
4412
|
showAll() {
|
|
4375
|
-
this.
|
|
4413
|
+
this.state.setUserDefinedShowAll(!this.$showAll());
|
|
4376
4414
|
}
|
|
4377
4415
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4378
4416
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: PaginatorComponent, isStandalone: true, selector: "tb-paginator", viewQueries: [{ propertyName: "$paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
@@ -4385,7 +4423,7 @@ class PaginatorComponent {
|
|
|
4385
4423
|
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
4386
4424
|
[class]="{ 'hide' : $collapseFooter() }">
|
|
4387
4425
|
</mat-paginator>
|
|
4388
|
-
@if ($showAllOption()) {<button mat-button (click)="
|
|
4426
|
+
@if ($showAllOption()) {<button mat-button (click)="showAll()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
4389
4427
|
</div>
|
|
4390
4428
|
`, 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}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1$6.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4391
4429
|
}
|
|
@@ -4401,7 +4439,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
4401
4439
|
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
4402
4440
|
[class]="{ 'hide' : $collapseFooter() }">
|
|
4403
4441
|
</mat-paginator>
|
|
4404
|
-
@if ($showAllOption()) {<button mat-button (click)="
|
|
4442
|
+
@if ($showAllOption()) {<button mat-button (click)="showAll()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
4405
4443
|
</div>
|
|
4406
4444
|
`, 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}\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"] }]
|
|
4407
4445
|
}] });
|
|
@@ -4473,13 +4511,18 @@ class VirtualScrollContainer {
|
|
|
4473
4511
|
dataStore = inject(DataStore);
|
|
4474
4512
|
viewport = viewChild(CdkVirtualScrollViewport);
|
|
4475
4513
|
genericTable = contentChild(GenericTableComponent);
|
|
4514
|
+
tableContainer = inject(TableContainerComponent);
|
|
4476
4515
|
defaultOptions = new VirtualScrollOptions();
|
|
4477
4516
|
scrollStrategy = new TableVirtualScrollStrategy(this.computedRowHeight(), this.computedHeaderHeight());
|
|
4478
4517
|
$usePaginator = this.state.selectSignal(s => s.notPersistedTableSettings.usePaginator);
|
|
4479
4518
|
$pageSize = this.state.$pageSize;
|
|
4480
4519
|
$currentPage = this.state.$currentPage;
|
|
4481
|
-
$showAll = this.state
|
|
4520
|
+
$showAll = this.state.$showAll;
|
|
4482
4521
|
$stateDataLength = this.dataStore.selectSignal(s => s.dataLen);
|
|
4522
|
+
viewPort$ = toObservable(this.viewport).pipe(notNull());
|
|
4523
|
+
$scrolledIndexChange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.scrolledIndexChange)));
|
|
4524
|
+
$renderedRange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.renderedRangeStream)));
|
|
4525
|
+
$virtualScrollOptions = computed(() => this.state.$tableSettings().virtualSettings);
|
|
4483
4526
|
$dataLength = computed(() => {
|
|
4484
4527
|
const paginated = this.$usePaginator() && !this.$showAll();
|
|
4485
4528
|
const pageSize = this.$pageSize();
|
|
@@ -4528,9 +4571,6 @@ class VirtualScrollContainer {
|
|
|
4528
4571
|
this.dataStore.patchState({ virtualScrollOffset: offset });
|
|
4529
4572
|
});
|
|
4530
4573
|
});
|
|
4531
|
-
viewPort$ = toObservable(this.viewport).pipe(notNull());
|
|
4532
|
-
$scrolledIndexChange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.scrolledIndexChange)));
|
|
4533
|
-
$renderedRange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.renderedRangeStream)));
|
|
4534
4574
|
$offset = computed(() => {
|
|
4535
4575
|
const viewport = this.viewport();
|
|
4536
4576
|
const scrolledIndexChange = this.$scrolledIndexChange();
|
|
@@ -4542,40 +4582,78 @@ class VirtualScrollContainer {
|
|
|
4542
4582
|
removeEventListener('resize', this.resizeHandler);
|
|
4543
4583
|
}
|
|
4544
4584
|
setSize(el) {
|
|
4545
|
-
const
|
|
4546
|
-
|
|
4585
|
+
const virtualScrollOptions = this.$virtualScrollOptions();
|
|
4586
|
+
if (virtualScrollOptions.dynamicHeight) {
|
|
4587
|
+
this.calcDynamic(el);
|
|
4588
|
+
return;
|
|
4589
|
+
}
|
|
4547
4590
|
const rowHeight = this.computedRowHeight();
|
|
4548
4591
|
let amountOfVisibleItems = virtualScrollOptions?.amountOfVisibleItems || this.defaultOptions.amountOfVisibleItems;
|
|
4549
|
-
virtualScrollOptions?.amountOfVisibleItems || this.defaultOptions.amountOfVisibleItems;
|
|
4550
4592
|
amountOfVisibleItems = Math.min(amountOfVisibleItems, this.$dataLength());
|
|
4551
4593
|
let height = (rowHeight * amountOfVisibleItems);
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
height += headerHeight;
|
|
4556
|
-
}
|
|
4594
|
+
const footerHeight = this.computedFooterHeight();
|
|
4595
|
+
const headerHeight = this.computedHeaderHeight();
|
|
4596
|
+
height += (footerHeight + headerHeight);
|
|
4557
4597
|
if (virtualScrollOptions?.maxViewPortHeight && virtualScrollOptions.maxViewPortHeight < height)
|
|
4558
4598
|
height = virtualScrollOptions.maxViewPortHeight;
|
|
4599
|
+
this.setHeight(height, el);
|
|
4600
|
+
}
|
|
4601
|
+
calcDynamic$ = new Subject();
|
|
4602
|
+
$calcDynamic = toSignal(this.calcDynamic$.pipe(debounceTime(300)));
|
|
4603
|
+
#onCalcDynamicEffect = effect(() => {
|
|
4604
|
+
const el = this.$calcDynamic();
|
|
4605
|
+
if (!el)
|
|
4606
|
+
return;
|
|
4607
|
+
this.calcDynamic(el);
|
|
4608
|
+
});
|
|
4609
|
+
calcDynamic(el) {
|
|
4610
|
+
const virtualScrollOptions = this.$virtualScrollOptions();
|
|
4611
|
+
const t = this.tableContainer.elementRef.nativeElement.querySelector(`#${TableContainerComponent.headerId}`);
|
|
4612
|
+
const rect = t?.getBoundingClientRect();
|
|
4613
|
+
const viewportHeight = window.innerHeight;
|
|
4614
|
+
const distanceFromBottom = viewportHeight - rect.bottom;
|
|
4615
|
+
const rowHeight = this.computedRowHeight();
|
|
4616
|
+
const footerHeight = this.computedFooterHeight();
|
|
4617
|
+
const headerHeight = this.computedHeaderHeight();
|
|
4618
|
+
let tableSize = distanceFromBottom;
|
|
4619
|
+
if (virtualScrollOptions?.maxViewPortHeight && virtualScrollOptions.maxViewPortHeight < tableSize) {
|
|
4620
|
+
tableSize = virtualScrollOptions.maxViewPortHeight;
|
|
4621
|
+
}
|
|
4622
|
+
const available = (distanceFromBottom - footerHeight) - headerHeight;
|
|
4623
|
+
const amountOfRowsThatWillFit = Math.floor(available / rowHeight);
|
|
4624
|
+
const minAmountOfRows = virtualScrollOptions?.amountOfVisibleItems || this.defaultOptions.amountOfVisibleItems;
|
|
4625
|
+
const amountOfVisibleItems = Math.min(Math.max(amountOfRowsThatWillFit, minAmountOfRows), this.$dataLength());
|
|
4626
|
+
let height = (rowHeight * amountOfVisibleItems);
|
|
4627
|
+
height += (footerHeight + headerHeight) - 10;
|
|
4628
|
+
this.setHeight(height, el);
|
|
4629
|
+
}
|
|
4630
|
+
setHeight(height, el) {
|
|
4631
|
+
const vsViewport = el.nativeElement;
|
|
4559
4632
|
vsViewport.setAttribute('style', `height: ${height}px !important;`);
|
|
4560
4633
|
this.viewport()?.checkViewportSize();
|
|
4561
4634
|
const virtualScrollOffset = this.viewport()?.getOffsetToRenderedContentStart() ?? 0;
|
|
4562
4635
|
this.dataStore.patchState({ virtualScrollOffset });
|
|
4563
4636
|
}
|
|
4564
4637
|
resizeHandler = () => {
|
|
4565
|
-
if (this.viewport()) {
|
|
4638
|
+
if (this.viewport() && this.$virtualScrollOptions().dynamicHeight) {
|
|
4566
4639
|
this.setSize(this.viewport().elementRef);
|
|
4567
4640
|
}
|
|
4568
4641
|
};
|
|
4569
4642
|
computedRowHeight() {
|
|
4570
|
-
const virtualScrollOptions = this.state.$tableSettings().
|
|
4643
|
+
const virtualScrollOptions = this.state.$tableSettings().virtualSettings;
|
|
4571
4644
|
const rowHeight = virtualScrollOptions?.rowHeight || (typeof this.state.$tableSettings().rowHeight === 'number' && this.state.$tableSettings().rowHeight) || this.defaultOptions.rowHeight;
|
|
4572
4645
|
return rowHeight;
|
|
4573
4646
|
}
|
|
4574
4647
|
computedHeaderHeight() {
|
|
4575
|
-
|
|
4648
|
+
if (this.state.$tableSettings().hideHeader)
|
|
4649
|
+
return 0;
|
|
4650
|
+
const virtualScrollOptions = this.state.$tableSettings().virtualSettings;
|
|
4576
4651
|
const headerHeight = virtualScrollOptions?.headerHeight || (typeof this.state.$tableSettings().headerHeight === 'number' && this.state.$tableSettings().headerHeight) || this.defaultOptions.headerHeight;
|
|
4577
4652
|
return headerHeight;
|
|
4578
4653
|
}
|
|
4654
|
+
computedFooterHeight() {
|
|
4655
|
+
return parseFloat(this.genericTable()?.$footerHeight()?.replace('px', '') || '0');
|
|
4656
|
+
}
|
|
4579
4657
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VirtualScrollContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4580
4658
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.0", type: VirtualScrollContainer, isStandalone: true, selector: "tb-virtual-scroll-container", queries: [{ propertyName: "genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
4581
4659
|
<cdk-virtual-scroll-viewport>
|
|
@@ -4622,12 +4700,12 @@ class ProfilesMenuComponent {
|
|
|
4622
4700
|
$defaultProfile = computed(() => this.stateService.$selectLocalProfileDefaultKey(this.$tableId())());
|
|
4623
4701
|
$keys = computed(() => this.stateService.$selectLocalProfileKeys(this.$tableId())());
|
|
4624
4702
|
saveState(key) {
|
|
4625
|
-
const tableState = this.tableStore
|
|
4703
|
+
const tableState = this.tableStore.$savableState();
|
|
4626
4704
|
this.onSaveState.emit(null);
|
|
4627
4705
|
this.stateService.saveTableSettingsToLocalAndStorage(this.$tableId(), key, tableState);
|
|
4628
4706
|
}
|
|
4629
4707
|
addState(key, asDefault) {
|
|
4630
|
-
const tableState = this.tableStore
|
|
4708
|
+
const tableState = this.tableStore.$savableState();
|
|
4631
4709
|
this.stateService.addNewStateToLocalAndStorage(this.$tableId(), key, tableState, asDefault);
|
|
4632
4710
|
}
|
|
4633
4711
|
setDefault(key) {
|
|
@@ -4876,6 +4954,7 @@ const createDataCleaners = (metadatas, mutate = false) => {
|
|
|
4876
4954
|
};
|
|
4877
4955
|
const createCleaners = (metadatas) => {
|
|
4878
4956
|
return metadatas.reduce((transforms, metaData) => {
|
|
4957
|
+
const notNestedKey = metaData.key;
|
|
4879
4958
|
switch (metaData.fieldType) {
|
|
4880
4959
|
case FieldType.Currency:
|
|
4881
4960
|
case FieldType.Number: {
|
|
@@ -4885,14 +4964,13 @@ const createCleaners = (metadatas) => {
|
|
|
4885
4964
|
const val = get(t, metaData.key);
|
|
4886
4965
|
const num = Number(val);
|
|
4887
4966
|
set(t, metaData.key, isNaN(num) || val == null ? null : num);
|
|
4888
|
-
t[metaData.key] = (isNaN(num) || val == null ? null : num);
|
|
4889
4967
|
});
|
|
4890
4968
|
}
|
|
4891
4969
|
else {
|
|
4892
4970
|
transforms.push((t) => {
|
|
4893
|
-
const val = t[
|
|
4971
|
+
const val = t[notNestedKey];
|
|
4894
4972
|
const num = Number(val);
|
|
4895
|
-
t[
|
|
4973
|
+
t[notNestedKey] = (isNaN(num) || val == null ? null : num);
|
|
4896
4974
|
});
|
|
4897
4975
|
}
|
|
4898
4976
|
break;
|
|
@@ -4914,15 +4992,15 @@ const createCleaners = (metadatas) => {
|
|
|
4914
4992
|
}
|
|
4915
4993
|
else {
|
|
4916
4994
|
transforms.push((t) => {
|
|
4917
|
-
const val = t[
|
|
4995
|
+
const val = t[notNestedKey];
|
|
4918
4996
|
const date = Date.parse(val);
|
|
4919
4997
|
if (isNaN(date)) {
|
|
4920
|
-
t[
|
|
4998
|
+
t[notNestedKey] = null;
|
|
4921
4999
|
return;
|
|
4922
5000
|
}
|
|
4923
5001
|
const d = new Date(date);
|
|
4924
5002
|
d.setHours(0, 0, 0, 0);
|
|
4925
|
-
t[
|
|
5003
|
+
t[notNestedKey] = d;
|
|
4926
5004
|
});
|
|
4927
5005
|
}
|
|
4928
5006
|
break;
|
|
@@ -4953,24 +5031,24 @@ const createCleaners = (metadatas) => {
|
|
|
4953
5031
|
}
|
|
4954
5032
|
else {
|
|
4955
5033
|
transforms.push((t) => {
|
|
4956
|
-
const val = t[
|
|
5034
|
+
const val = t[notNestedKey];
|
|
4957
5035
|
const dateTime = Date.parse(val);
|
|
4958
5036
|
if (isNaN(dateTime)) {
|
|
4959
|
-
t[
|
|
5037
|
+
t[notNestedKey] = null;
|
|
4960
5038
|
return;
|
|
4961
5039
|
}
|
|
4962
5040
|
const dt = new Date(dateTime);
|
|
4963
5041
|
if (metaData.additional?.dateTimeOptions?.includeMilliseconds) {
|
|
4964
|
-
t[
|
|
5042
|
+
t[notNestedKey] = dt;
|
|
4965
5043
|
return;
|
|
4966
5044
|
}
|
|
4967
5045
|
if (metaData.additional?.dateTimeOptions?.includeSeconds) {
|
|
4968
5046
|
dt.setMilliseconds(0);
|
|
4969
|
-
t[
|
|
5047
|
+
t[notNestedKey] = dt;
|
|
4970
5048
|
return;
|
|
4971
5049
|
}
|
|
4972
5050
|
dt.setSeconds(0, 0);
|
|
4973
|
-
t[
|
|
5051
|
+
t[notNestedKey] = dt;
|
|
4974
5052
|
});
|
|
4975
5053
|
}
|
|
4976
5054
|
}
|
|
@@ -5053,11 +5131,11 @@ function mergeCustomCellMetaData(metaData1, metaData2) {
|
|
|
5053
5131
|
class TableContainerComponent {
|
|
5054
5132
|
state = inject(TableStore);
|
|
5055
5133
|
dataStore = inject(DataStore);
|
|
5056
|
-
config = inject(TableBuilderConfigToken);
|
|
5057
5134
|
exportToCsvService = inject((ExportToCsvService));
|
|
5058
5135
|
wrapper = inject(TableWrapperDirective, { optional: true });
|
|
5059
5136
|
stateService = inject(TableBuilderStateStore);
|
|
5060
5137
|
injector = inject(Injector);
|
|
5138
|
+
elementRef = inject(ElementRef);
|
|
5061
5139
|
dataSource = new TableBuilderDataSource(this.state, this.dataStore);
|
|
5062
5140
|
$filterDirectives = contentChildren(TableFilterDirective, { descendants: true });
|
|
5063
5141
|
$customFilterDirectives = contentChildren(TableCustomFilterDirective, { descendants: true });
|
|
@@ -5078,7 +5156,7 @@ class TableContainerComponent {
|
|
|
5078
5156
|
$stickyFooter = input(false, { alias: 'stickyFooter' });
|
|
5079
5157
|
$groupHeaderTemplate = input(undefined, { alias: 'groupHeaderTemplate' });
|
|
5080
5158
|
$groupHeaderHeight = input(undefined, { alias: 'groupHeaderHeight' });
|
|
5081
|
-
$pageSize = input(undefined, { alias: '
|
|
5159
|
+
$pageSize = input(undefined, { alias: 'pageSize' });
|
|
5082
5160
|
$props = computed(() => {
|
|
5083
5161
|
const indexColumn = this.$indexColumn();
|
|
5084
5162
|
const selectionColumn = this.$selectionColumn();
|
|
@@ -5091,11 +5169,11 @@ class TableContainerComponent {
|
|
|
5091
5169
|
selection$ = output({ alias: 'selection' });
|
|
5092
5170
|
onStateReset$ = output({ alias: 'onStateReset' });
|
|
5093
5171
|
onSaveState$ = output({ alias: 'onSaveState' });
|
|
5094
|
-
_state$ = toObservable(this.state
|
|
5172
|
+
_state$ = toObservable(this.state.$savableState);
|
|
5095
5173
|
state$ = outputFromObservable(this._state$, { alias: 'state' });
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
$data = toSignal(this.
|
|
5174
|
+
_data$ = new BehaviorSubject([]);
|
|
5175
|
+
data$ = outputFromObservable(this._data$, { alias: 'data' });
|
|
5176
|
+
$data = toSignal(this._data$, { initialValue: [] });
|
|
5099
5177
|
clearSelections() {
|
|
5100
5178
|
this.$genericTable()?.$selection().clear(true);
|
|
5101
5179
|
}
|
|
@@ -5111,7 +5189,10 @@ class TableContainerComponent {
|
|
|
5111
5189
|
};
|
|
5112
5190
|
collapseAllGroups = () => this.state.collapseAll();
|
|
5113
5191
|
$myColumns = computed(() => {
|
|
5114
|
-
return this.state.$metaDataArray().map(metaData => ({
|
|
5192
|
+
return this.state.$metaDataArray().map(metaData => ({
|
|
5193
|
+
metaData,
|
|
5194
|
+
customCell: this.$customCells().filter(cc => cc.$inited()).find(cc => cc.$customCell() === metaData.key)
|
|
5195
|
+
}));
|
|
5115
5196
|
});
|
|
5116
5197
|
$useVirtual = this.state.$isVirtual;
|
|
5117
5198
|
$collapsedFooter = this.state.$footerCollapsed;
|
|
@@ -5137,7 +5218,7 @@ class TableContainerComponent {
|
|
|
5137
5218
|
persistedState.persistedTableSettings = new PersistedTableSettings(persistedState.persistedTableSettings);
|
|
5138
5219
|
this.state.updateStateFromPersistedState(persistedState);
|
|
5139
5220
|
}
|
|
5140
|
-
this.state.setInitializationState(InitializationState.
|
|
5221
|
+
this.state.setInitializationState(InitializationState.LoadedFromStore);
|
|
5141
5222
|
});
|
|
5142
5223
|
});
|
|
5143
5224
|
#setPageSizeFromInputEffect = effect(() => {
|
|
@@ -5227,7 +5308,7 @@ class TableContainerComponent {
|
|
|
5227
5308
|
const tableBuilderMetaData = this.$tableBuilderMetaData();
|
|
5228
5309
|
if (!tableBuilderMetaData)
|
|
5229
5310
|
return;
|
|
5230
|
-
const customCellMetaDatas = this.$customCells().map(cc => cc.$metaData()).filter(d => !!d);
|
|
5311
|
+
const customCellMetaDatas = this.$customCells().filter(cc => cc.$inited()).map(cc => cc.$metaData()).filter(d => !!d);
|
|
5231
5312
|
const mappedCustomCellMetaDatas = customCellMetaDatas.map(md => mergeCustomCellMetaData(md, tableBuilderMetaData.find(item => item.key === md.key)));
|
|
5232
5313
|
return [...tableBuilderMetaData, ...mappedCustomCellMetaDatas];
|
|
5233
5314
|
});
|
|
@@ -5235,7 +5316,7 @@ class TableContainerComponent {
|
|
|
5235
5316
|
ngOnDestroy() {
|
|
5236
5317
|
const tableId = this.$tableId();
|
|
5237
5318
|
if (tableId) {
|
|
5238
|
-
this.stateService.saveTableStateToLocal({ tableId, tableState: this.state
|
|
5319
|
+
this.stateService.saveTableStateToLocal({ tableId, tableState: this.state.$savableState() });
|
|
5239
5320
|
}
|
|
5240
5321
|
}
|
|
5241
5322
|
initializeData() {
|
|
@@ -5250,7 +5331,7 @@ class TableContainerComponent {
|
|
|
5250
5331
|
const sortedAndFilteredData$ = sortAndFilterData(this.$tableBuilder().getData$(), sortsState$, filters$);
|
|
5251
5332
|
const flatGrouped$ = combineLatest([sortedAndFilteredData$.pipe(timestamp$1()), this.state.groupByKeys$.pipe(timestamp$1()), this.state.expandedGroups$.pipe(timestamp$1())]).pipe(scan$1(updateGroupByState, initialGroupByState), map(({ displayData }) => displayData), defaultShareReplay());
|
|
5252
5333
|
this.state.on(sortedAndFilteredData$, (data) => {
|
|
5253
|
-
this.
|
|
5334
|
+
this._data$.next(data);
|
|
5254
5335
|
this.dataStore.patchState({ dataLen: data.length });
|
|
5255
5336
|
});
|
|
5256
5337
|
this.state.on(flatGrouped$, (data) => {
|
|
@@ -5259,12 +5340,14 @@ class TableContainerComponent {
|
|
|
5259
5340
|
});
|
|
5260
5341
|
}
|
|
5261
5342
|
$isInitializationState = (state) => computed(() => this.state.selectSignal(s => s.initializationState >= state)());
|
|
5343
|
+
static headerId = 'tb-header-wrapper';
|
|
5344
|
+
headerId = TableContainerComponent.headerId;
|
|
5262
5345
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5263
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $tableId: { classPropertyName: "$tableId", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumn: { classPropertyName: "$indexColumn", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumn: { classPropertyName: "$selectionColumn", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $isSticky: { classPropertyName: "$isSticky", publicName: "isSticky", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooter: { classPropertyName: "$stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderTemplate: { classPropertyName: "$groupHeaderTemplate", publicName: "groupHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderHeight: { classPropertyName: "$groupHeaderHeight", publicName: "groupHeaderHeight", isSignal: true, isRequired: false, transformFunction: null }, $pageSize: { classPropertyName: "$pageSize", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { $inputFilters: "inputFiltersChange", selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", _data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"header-wrapper\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"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]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [$tableId]=\"tableId\" (onSaveState)=\"onSaveState$.emit($event)\"/>}\r\n </ng-template>\r\n\r\n <ng-template #headerMenuExtra>\r\n <button mat-menu-item (click)=\"resetState()\">\r\n <mat-icon color=\"primary\">autorenew</mat-icon>\r\n <span>Reset table</span>\r\n </button>\r\n @if (!tableSettings.hideExport) {\r\n <button mat-menu-item (click)=\"exportToCsv()\">\r\n <mat-icon color=\"primary\">file_download</mat-icon>\r\n <span>Export Table</span>\r\n </button>\r\n }\r\n @if (tableId) {\r\n <button stop-propagation mat-menu-item (click)=\"pm.trigger()?.toggleMenu()\">\r\n <mat-icon color=\"primary\">people</mat-icon>\r\n <span>Profiles</span>\r\n </button>\r\n <tb-profiles-menu class=\"profiles-menu\" #pm [$tableId]=\"tableId\" (onSaveState)=\"onSaveState$.emit($event)\"/>\r\n }\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1$8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayDataLength", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "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 });
|
|
5346
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $tableId: { classPropertyName: "$tableId", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumn: { classPropertyName: "$indexColumn", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumn: { classPropertyName: "$selectionColumn", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $isSticky: { classPropertyName: "$isSticky", publicName: "isSticky", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooter: { classPropertyName: "$stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderTemplate: { classPropertyName: "$groupHeaderTemplate", publicName: "groupHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderHeight: { classPropertyName: "$groupHeaderHeight", publicName: "groupHeaderHeight", isSignal: true, isRequired: false, transformFunction: null }, $pageSize: { classPropertyName: "$pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { $inputFilters: "inputFiltersChange", selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"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]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [$tableId]=\"tableId\" (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: [".tb-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1$8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayDataLength", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "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 });
|
|
5264
5347
|
}
|
|
5265
5348
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableContainerComponent, decorators: [{
|
|
5266
5349
|
type: Component,
|
|
5267
|
-
args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], imports: containerImports, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"header-wrapper\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"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]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [$tableId]=\"tableId\" (onSaveState)=\"onSaveState$.emit($event)\"/>}\r\n </ng-template>\r\n\r\n <ng-template #headerMenuExtra>\r\n <button mat-menu-item (click)=\"resetState()\">\r\n <mat-icon color=\"primary\">autorenew</mat-icon>\r\n <span>Reset table</span>\r\n </button>\r\n @if (!tableSettings.hideExport) {\r\n <button mat-menu-item (click)=\"exportToCsv()\">\r\n <mat-icon color=\"primary\">file_download</mat-icon>\r\n <span>Export Table</span>\r\n </button>\r\n }\r\n @if (tableId) {\r\n <button stop-propagation mat-menu-item (click)=\"pm.trigger()?.toggleMenu()\">\r\n <mat-icon color=\"primary\">people</mat-icon>\r\n <span>Profiles</span>\r\n </button>\r\n <tb-profiles-menu class=\"profiles-menu\" #pm [$tableId]=\"tableId\" (onSaveState)=\"onSaveState$.emit($event)\"/>\r\n }\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"] }]
|
|
5350
|
+
args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], imports: containerImports, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"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]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [$tableId]=\"tableId\" (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: [".tb-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"] }]
|
|
5268
5351
|
}] });
|
|
5269
5352
|
|
|
5270
5353
|
class TableBuilderModule {
|
|
@@ -5677,5 +5760,5 @@ const setUpStoreFactory = () => {
|
|
|
5677
5760
|
* Generated bundle index. Do not edit.
|
|
5678
5761
|
*/
|
|
5679
5762
|
|
|
5680
|
-
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, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
5763
|
+
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, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
5681
5764
|
//# sourceMappingURL=one-paragon-angular-utilities.mjs.map
|