@one-paragon/angular-utilities 2.0.14 → 2.0.16

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.
Files changed (25) hide show
  1. package/fesm2022/one-paragon-angular-utilities.mjs +587 -517
  2. package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
  3. package/package.json +1 -1
  4. package/table-builder/classes/table-builder-general-settings.d.ts +25 -11
  5. package/table-builder/classes/table-builder.d.ts +14 -9
  6. package/table-builder/classes/table-store.d.ts +7 -5
  7. package/table-builder/components/column-builder/column-builder.component.d.ts +1 -1
  8. package/table-builder/components/generic-table/generic-table.component.d.ts +4 -1
  9. package/table-builder/components/initialization-component/initialization-component.d.ts +9 -9
  10. package/table-builder/components/link-column.component.d.ts +4 -4
  11. package/table-builder/components/reset-menu/reset-menu.component.d.ts +1 -1
  12. package/table-builder/components/scroll-strategy.d.ts +25 -10
  13. package/table-builder/components/table-container/table-container.d.ts +41 -22
  14. package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +3 -2
  15. package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +10 -3
  16. package/table-builder/components/table-container/virtual-scroll-container.d.ts +5 -8
  17. package/table-builder/directives/table-wrapper.directive.d.ts +1 -1
  18. package/table-builder/directives/tb-filter.directive.d.ts +4 -1
  19. package/table-builder/functions/sort-data-function.d.ts +0 -1
  20. package/table-builder/interfaces/report-def.d.ts +3 -3
  21. package/table-builder/services/table-template-service.d.ts +5 -5
  22. package/table-builder/services/transform-creator.d.ts +4 -12
  23. package/table-builder/table-builder.module.d.ts +6 -13
  24. package/utilities/directives/styler.d.ts +4 -4
  25. package/utilities/pipes/phone.pipe.d.ts +1 -0
@@ -1,11 +1,10 @@
1
1
  import * as i0 from '@angular/core';
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, effect, ContentChildren, ChangeDetectorRef, output, ViewChild, EnvironmentInjector, createComponent, viewChild, linkedSignal, contentChild, forwardRef, contentChildren, model, runInInjectionContext, provideAppInitializer } from '@angular/core';
3
- import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, observeOn, debounceTime, scan as scan$1, timestamp as timestamp$1, first as first$1 } from 'rxjs/operators';
2
+ import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, input, signal, Renderer2, ElementRef, booleanAttribute, Pipe, InjectionToken, makeEnvironmentProviders, Component, ChangeDetectionStrategy, HostListener, EventEmitter, untracked, Output, effect, ContentChildren, ChangeDetectorRef, output, viewChild, EnvironmentInjector, createComponent, linkedSignal, contentChild, forwardRef, contentChildren, runInInjectionContext, provideAppInitializer } from '@angular/core';
3
+ import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators';
4
4
  import * as i1 from 'rxjs';
5
- import { Subject, isObservable, of, ReplaySubject, filter as filter$1, first, map as map$1, Observable, combineLatest, Subscription, startWith as startWith$1, pairwise, concatMap, merge, delay, fromEvent, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, timestamp, animationFrameScheduler, debounceTime as debounceTime$1, 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, timestamp } from 'rxjs';
6
6
  import { ComponentStore } from '@ngrx/component-store';
7
7
  import { toObservable, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
8
- import { DatePipe, CurrencyPipe, KeyValuePipe, NgTemplateOutlet, DecimalPipe, CommonModule, AsyncPipe } from '@angular/common';
9
8
  import * as i3$2 from '@angular/material/sort';
10
9
  import { MatSort, MatSortModule } from '@angular/material/sort';
11
10
  import { merge as merge$1, get, sumBy, difference, intersection, groupBy, orderBy, set, isFunction as isFunction$1 } from 'lodash';
@@ -20,11 +19,10 @@ import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
20
19
  import * as i3 from '@angular/forms';
21
20
  import { NgControl, FormsModule, ControlContainer, NgForm, NG_VALUE_ACCESSOR } from '@angular/forms';
22
21
  import * as i9 from '@angular/material/core';
23
- import { MatOption, MatNativeDateModule } from '@angular/material/core';
22
+ import { MatOption } from '@angular/material/core';
23
+ import { DatePipe, CurrencyPipe, KeyValuePipe, NgTemplateOutlet, formatDate, formatCurrency, DecimalPipe, CommonModule, AsyncPipe } from '@angular/common';
24
24
  import * as i5 from '@angular/cdk/drag-drop';
25
25
  import { moveItemInArray, DragDropModule, CDK_DROP_LIST, CdkDropList, transferArrayItem } from '@angular/cdk/drag-drop';
26
- import * as i1$5 from '@angular/router';
27
- import { RouterModule } from '@angular/router';
28
26
  import * as i1$1 from '@angular/material/input';
29
27
  import { MatInputModule, MatInput } from '@angular/material/input';
30
28
  import * as i4 from '@angular/material/datepicker';
@@ -32,7 +30,7 @@ import { MatDatepickerModule } from '@angular/material/datepicker';
32
30
  import * as i6 from '@angular/material/form-field';
33
31
  import * as i1$3 from '@angular/material/card';
34
32
  import { MatCardModule } from '@angular/material/card';
35
- import { MatDialog, MAT_DIALOG_DEFAULT_OPTIONS, MatDialogModule } from '@angular/material/dialog';
33
+ import { MatDialog, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
36
34
  import * as i3$1 from '@angular/material/button';
37
35
  import { MatButtonModule, MatIconButton, MatButton } from '@angular/material/button';
38
36
  import * as i4$1 from '@angular/material/tooltip';
@@ -48,6 +46,8 @@ import { MatChipsModule } from '@angular/material/chips';
48
46
  import * as i1$6 from '@angular/material/table';
49
47
  import { MatTable, MatColumnDef, MatTableModule, MatHeaderRowDef, MatFooterRowDef, MatTableDataSource, MatRowDef } from '@angular/material/table';
50
48
  import { SelectionModel } from '@angular/cdk/collections';
49
+ import * as i1$5 from '@angular/router';
50
+ import { RouterModule } from '@angular/router';
51
51
  import * as i1$7 from '@angular/material/paginator';
52
52
  import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
53
53
  import * as i1$8 from '@angular/cdk/scrolling';
@@ -686,34 +686,6 @@ function getDestroyRef(options) {
686
686
  return destroyRef;
687
687
  }
688
688
 
689
- class SpaceCasePipe {
690
- transform(value) {
691
- return spaceCase(value);
692
- }
693
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
694
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, isStandalone: true, name: "spaceCase" });
695
- }
696
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, decorators: [{
697
- type: Pipe,
698
- args: [{ name: 'spaceCase' }]
699
- }] });
700
- /**
701
- * Adds a space before uppercase letters that either
702
- * 1. follows a lowercase letter or digit
703
- * 2. or precedes a lowercase letter and follows an alpha-numeric character
704
- *
705
- * Uppercases the first digit
706
- *
707
- * Turns underscores into spaces
708
- */
709
- function spaceCase(value) {
710
- const phrase = value?.replace(regex1, '$1$3 $2$4');
711
- // uppercase the first character of every word
712
- return phrase?.replace(regex2, x => x.toUpperCase());
713
- }
714
- const regex1 = /([a-z0-9])([A-Z])|([a-zA-Z0-9])([A-Z])(?=[a-z])|_/g;
715
- const regex2 = /(^| )(\w)/g;
716
-
717
689
  var FieldType;
718
690
  (function (FieldType) {
719
691
  FieldType[FieldType["Unknown"] = 0] = "Unknown";
@@ -771,8 +743,8 @@ class GeneralTableSettings {
771
743
  headerSettings = new TableWrapperHeaderSettings();
772
744
  footerSettings = new TableWrapperFooterSettings();
773
745
  columnHeaderSettings = new TableColumnHeaderSettings();
746
+ columnFooterSettings = new TableColumnFooterSettings();
774
747
  tableSettings = new TableSettings();
775
- injector;
776
748
  }
777
749
  class TableWrapperHeaderSettings {
778
750
  hideExport = false;
@@ -788,10 +760,18 @@ class TableWrapperFooterSettings {
788
760
  collapse = false;
789
761
  }
790
762
  class TableColumnHeaderSettings {
763
+ stickyHeaderRow = true;
791
764
  noFilters = false;
792
765
  noHeader = false;
793
766
  }
767
+ class TableColumnFooterSettings {
768
+ stickyFooterRow = false;
769
+ }
794
770
  class TableSettings {
771
+ tableId = undefined;
772
+ trackBy = undefined;
773
+ includeIndexColumn = false;
774
+ includeSelectionColumn = false;
795
775
  usePaginator = undefined;
796
776
  useVirtualScroll = undefined;
797
777
  paginatorSettings = undefined;
@@ -799,6 +779,8 @@ class TableSettings {
799
779
  rowHeight = undefined;
800
780
  groupHeaderHeight = undefined;
801
781
  minColumnWidth;
782
+ rowClasses;
783
+ rowStyles;
802
784
  }
803
785
  class PersistedTableSettings {
804
786
  constructor(tableSettings) {
@@ -838,6 +820,8 @@ class NotPersistedTableSettings {
838
820
  newNpts.headerHeight = tableSettings.headerSettings?.headerHeight ?? newNpts.headerHeight;
839
821
  newNpts.groupHeaderHeight = tableSettings.tableSettings?.groupHeaderHeight ?? newNpts.groupHeaderHeight;
840
822
  newNpts.minColumnWidth = tableSettings.tableSettings?.minColumnWidth ?? newNpts.minColumnWidth;
823
+ newNpts.rowClasses = tableSettings.tableSettings?.rowClasses ?? newNpts.rowClasses;
824
+ newNpts.rowStyles = tableSettings.tableSettings?.rowStyles ?? newNpts.rowStyles;
841
825
  if (tableSettings.tableSettings?.virtualScrollSettings) {
842
826
  const currVirt = tableSettings.tableSettings?.virtualScrollSettings || newNpts.virtualSettings;
843
827
  if (!currVirt.headerHeight) {
@@ -876,6 +860,8 @@ class NotPersistedTableSettings {
876
860
  rowHeight;
877
861
  headerHeight = undefined;
878
862
  minColumnWidth;
863
+ rowClasses;
864
+ rowStyles;
879
865
  }
880
866
  class VirtualScrollOptions {
881
867
  rowHeight = 48;
@@ -1192,6 +1178,7 @@ class TableFilterDirective {
1192
1178
  this.filterValue = undefined;
1193
1179
  }
1194
1180
  filter$ = new ReplaySubject(1);
1181
+ $filter = toSignal(this.filter$);
1195
1182
  filterType;
1196
1183
  key;
1197
1184
  fieldType;
@@ -1301,6 +1288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1301
1288
  }], ctorParameters: () => [] });
1302
1289
  class TableCustomFilterDirectiveBase extends TableCustomFilterDirective {
1303
1290
  filter$ = new ReplaySubject(1);
1291
+ $filter = toSignal(this.filter$);
1304
1292
  filter;
1305
1293
  _predicate;
1306
1294
  set predicate(val) {
@@ -1532,13 +1520,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1532
1520
 
1533
1521
  class PhoneNumberPipe {
1534
1522
  transform(phoneNum) {
1535
- if (phoneNum) {
1536
- phoneNum = phoneNum.replace(/\D/g, '');
1537
- if (phoneNum[0] === '1') {
1538
- phoneNum = phoneNum.substring(1);
1539
- }
1540
- return '(' + phoneNum.slice(0, 3) + ') ' + phoneNum.slice(3, 6) + '-' + phoneNum.slice(6, 10) + ' ' + phoneNum.slice(10);
1541
- }
1523
+ return phoneFormatter(phoneNum);
1542
1524
  }
1543
1525
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PhoneNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1544
1526
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: PhoneNumberPipe, isStandalone: true, name: "phone" });
@@ -1547,6 +1529,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1547
1529
  type: Pipe,
1548
1530
  args: [{ name: 'phone' }]
1549
1531
  }] });
1532
+ function phoneFormatter(phoneNum) {
1533
+ if (phoneNum) {
1534
+ phoneNum = phoneNum.replace(/\D/g, '');
1535
+ if (phoneNum[0] === '1') {
1536
+ phoneNum = phoneNum.substring(1);
1537
+ }
1538
+ return '(' + phoneNum.slice(0, 3) + ') ' + phoneNum.slice(3, 6) + '-' + phoneNum.slice(6, 10) + ' ' + phoneNum.slice(10);
1539
+ }
1540
+ return '';
1541
+ }
1542
+
1543
+ class SpaceCasePipe {
1544
+ transform(value) {
1545
+ return spaceCase(value);
1546
+ }
1547
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1548
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, isStandalone: true, name: "spaceCase" });
1549
+ }
1550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpaceCasePipe, decorators: [{
1551
+ type: Pipe,
1552
+ args: [{ name: 'spaceCase' }]
1553
+ }] });
1554
+ /**
1555
+ * Adds a space before uppercase letters that either
1556
+ * 1. follows a lowercase letter or digit
1557
+ * 2. or precedes a lowercase letter and follows an alpha-numeric character
1558
+ *
1559
+ * Uppercases the first digit
1560
+ *
1561
+ * Turns underscores into spaces
1562
+ */
1563
+ function spaceCase(value) {
1564
+ const phrase = value?.replace(regex1, '$1$3 $2$4');
1565
+ // uppercase the first character of every word
1566
+ return phrase?.replace(regex2, x => x.toUpperCase());
1567
+ }
1568
+ const regex1 = /([a-z0-9])([A-Z])|([a-zA-Z0-9])([A-Z])(?=[a-z])|_/g;
1569
+ const regex2 = /(^| )(\w)/g;
1550
1570
 
1551
1571
  const defaultConfig = {
1552
1572
  defaultTableSettings: {
@@ -1920,8 +1940,8 @@ class TableStore extends ComponentStore {
1920
1940
  equal: sortsAreSame
1921
1941
  });
1922
1942
  selectSorted$ = this.select(state => state.sorted).pipe(distinctUntilChanged(sortsAreSame));
1923
- sort$ = this.select(state => state.initializationState).pipe(filter(i => i === InitializationState.Ready))
1924
- .pipe(switchMap(() => this.selectSorted$));
1943
+ $getSorts = this.selectSignal(() => this.$initializationState() !== InitializationState.Ready ? [] : this.$selectSorted());
1944
+ sort$ = toObservable(this.$getSorts);
1925
1945
  $getUserDefinedTableWidth = this.selectSignal(state => state.userDefined.table.width);
1926
1946
  getUserDefinedTableWidth$ = this.select(state => state.userDefined.table.width);
1927
1947
  $userDefinedRowHeight = this.selectSignal(state => (state.userDefined.rowHeight));
@@ -1940,6 +1960,11 @@ class TableStore extends ComponentStore {
1940
1960
  const bb = b.flatMap(g => g.expandedHeaders);
1941
1961
  return aa.length === bb.length && aa.every((k) => bb.includes(k));
1942
1962
  }));
1963
+ $expandGroups = this.selectSignal(state => state.groupBy, { equal: (a, b) => {
1964
+ const aa = a.flatMap(g => g.expandedHeaders);
1965
+ const bb = b.flatMap(g => g.expandedHeaders);
1966
+ return aa.length === bb.length && aa.every((k) => bb.includes(k));
1967
+ } });
1943
1968
  $getIsExpanded = (columnKey, groupHeaderKey) => {
1944
1969
  return this.selectSignal(state => !!state.groupBy.filter(g => g.key === columnKey && g.expandedHeaders.includes(groupHeaderKey)).length);
1945
1970
  };
@@ -3166,107 +3191,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
3166
3191
  function isPipe(o) {
3167
3192
  return typeof (o.transform) === 'function';
3168
3193
  }
3169
- class TransformCreator {
3170
- datePipe = inject(DatePipe);
3171
- currencyPipe = inject(CurrencyPipe);
3172
- phonePipe = inject(PhoneNumberPipe);
3173
- config = inject(TableBuilderConfigToken);
3174
- createTransformer(metaData, noIcons = false, forItem = false) {
3175
- const nested = metaData.key.includes('.');
3176
- const defaultFunc = nested ? (value) => get(value, metaData.key) : (value) => value[metaData.key];
3177
- if (metaData.map && !forItem) {
3178
- return (value) => {
3179
- return metaData.map(value);
3180
- };
3181
- }
3182
- if (metaData.mapItem) {
3183
- return (value) => {
3184
- return metaData.mapItem(defaultFunc(value));
3185
- };
3186
- }
3187
- if (metaData.transform) {
3188
- if (isPipe(metaData.transform)) {
3189
- return (value) => metaData.transform.transform(defaultFunc(value));
3190
- }
3191
- return metaData.fieldType === FieldType.Expression ? metaData.transform : (value) => metaData.transform(defaultFunc(value), value);
3192
- }
3193
- if (this.config.transformers && this.config.transformers[metaData.fieldType]) {
3194
- var transformer = this.config.transformers[metaData.fieldType];
3195
- return (value) => transformer(defaultFunc(value));
3196
- }
3197
- const defaultDateFormat = this.config.dateFormats?.dateFormat ?? 'shortDate';
3198
- const defaultDateTimeFormat = this.config.dateFormats?.dateTimeFormat ?? 'short';
3199
- switch (metaData.fieldType) {
3200
- case FieldType.Date:
3201
- const dateFormat = metaData.additional?.dateFormat ?? defaultDateFormat;
3202
- return (value) => this.datePipe.transform(defaultFunc(value), dateFormat);
3203
- case FieldType.DateTime:
3204
- const dateTimeFormat = metaData.additional?.dateTimeOptions?.format ?? defaultDateTimeFormat;
3205
- return (value) => this.datePipe.transform(defaultFunc(value), dateTimeFormat);
3206
- case FieldType.Currency:
3207
- return (value) => this.currencyPipe.transform(defaultFunc(value));
3208
- case FieldType.PhoneNumber:
3209
- return (value) => this.phonePipe.transform(defaultFunc(value));
3210
- case FieldType.Enum:
3211
- return (value) => spaceCase(metaData.additional?.enumMap[defaultFunc(value)]);
3212
- case FieldType.Boolean:
3213
- if (noIcons) {
3214
- return defaultFunc;
3215
- }
3216
- let forTrue = 'check';
3217
- let forFalse = '';
3218
- if (metaData.additional?.boolean?.forTrue) {
3219
- forTrue = metaData?.additional.boolean.forTrue.icon;
3220
- }
3221
- if (metaData.additional?.boolean?.showForFalse === true) {
3222
- forFalse = 'clear';
3223
- }
3224
- else if (metaData.additional?.boolean?.showForFalse?.icon) {
3225
- forFalse = metaData.additional?.boolean?.showForFalse?.icon;
3226
- }
3227
- return (value) => defaultFunc(value) ? forTrue : forFalse;
3228
- }
3229
- return defaultFunc;
3194
+ function createTransformer(metaData, config, noIcons = false, forItem = false) {
3195
+ const nested = metaData.key.includes('.');
3196
+ const defaultFunc = nested ? (value) => get(value, metaData.key) : (value) => value[metaData.key];
3197
+ if (metaData.map && !forItem) {
3198
+ return (value) => {
3199
+ return metaData.map(value);
3200
+ };
3230
3201
  }
3231
- createItemTransformer = (metaData, noIcons = false, mutate = false) => {
3232
- const transform = this.createTransformer(metaData, noIcons);
3233
- return (t) => {
3234
- if (!mutate) {
3235
- t = { ...t };
3236
- }
3237
- t[metaData.key] = transform(t);
3202
+ if (metaData.mapItem) {
3203
+ return (value) => {
3204
+ return metaData.mapItem(defaultFunc(value));
3238
3205
  };
3239
- };
3240
- createItemTransformers = (metaDatas, noIcons = false, mutate = false) => {
3241
- const transformers = metaDatas.map(meta => this.createItemTransformer(meta, noIcons, true));
3242
- return (t) => {
3243
- if (!t)
3244
- return t;
3245
- if (!mutate) {
3246
- t = { ...t };
3206
+ }
3207
+ if (metaData.transform) {
3208
+ if (isPipe(metaData.transform)) {
3209
+ return (value) => metaData.transform.transform(defaultFunc(value));
3210
+ }
3211
+ return metaData.fieldType === FieldType.Expression ? metaData.transform : (value) => metaData.transform(defaultFunc(value), value);
3212
+ }
3213
+ if (config.transformers && config.transformers[metaData.fieldType]) {
3214
+ var transformer = config.transformers[metaData.fieldType];
3215
+ return (value) => transformer(defaultFunc(value));
3216
+ }
3217
+ const defaultDateFormat = config.dateFormats?.dateFormat ?? 'shortDate';
3218
+ const defaultDateTimeFormat = config.dateFormats?.dateTimeFormat ?? 'short';
3219
+ switch (metaData.fieldType) {
3220
+ case FieldType.Date:
3221
+ const dateFormat = metaData.additional?.dateFormat ?? defaultDateFormat;
3222
+ return (value) => dateFormatter(defaultFunc(value), dateFormat);
3223
+ case FieldType.DateTime:
3224
+ const dateTimeFormat = metaData.additional?.dateTimeOptions?.format ?? defaultDateTimeFormat;
3225
+ return (value) => dateFormatter(defaultFunc(value), dateTimeFormat);
3226
+ case FieldType.Currency:
3227
+ return (value) => currencyFormatter(defaultFunc(value));
3228
+ case FieldType.PhoneNumber:
3229
+ return (value) => phoneFormatter(defaultFunc(value));
3230
+ case FieldType.Enum:
3231
+ return (value) => spaceCase(metaData.additional?.enumMap[defaultFunc(value)]);
3232
+ case FieldType.Boolean:
3233
+ if (noIcons) {
3234
+ return defaultFunc;
3235
+ }
3236
+ let forTrue = 'check';
3237
+ let forFalse = '';
3238
+ if (metaData.additional?.boolean?.forTrue) {
3239
+ forTrue = metaData?.additional.boolean.forTrue.icon;
3240
+ }
3241
+ if (metaData.additional?.boolean?.showForFalse === true) {
3242
+ forFalse = 'clear';
3247
3243
  }
3248
- transformers.forEach(m => m(t));
3244
+ else if (metaData.additional?.boolean?.showForFalse?.icon) {
3245
+ forFalse = metaData.additional?.boolean?.showForFalse?.icon;
3246
+ }
3247
+ return (value) => defaultFunc(value) ? forTrue : forFalse;
3248
+ }
3249
+ return defaultFunc;
3250
+ }
3251
+ function createItemTransformer(metaData, config, noIcons = false, mutate = false) {
3252
+ const transform = createTransformer(metaData, config, noIcons);
3253
+ return (t) => {
3254
+ if (!mutate) {
3255
+ t = { ...t };
3256
+ }
3257
+ t[metaData.key] = transform(t);
3258
+ };
3259
+ }
3260
+ function createItemTransformers(metaDatas, config, noIcons = false, mutate = false) {
3261
+ const transformers = metaDatas.map(meta => createItemTransformer(meta, config, noIcons, true));
3262
+ return (t) => {
3263
+ if (!t)
3249
3264
  return t;
3250
- };
3265
+ if (!mutate) {
3266
+ t = { ...t };
3267
+ }
3268
+ transformers.forEach(m => m(t));
3269
+ return t;
3251
3270
  };
3252
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TransformCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3253
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TransformCreator, providedIn: 'root' });
3254
3271
  }
3255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TransformCreator, decorators: [{
3256
- type: Injectable,
3257
- args: [{
3258
- providedIn: 'root',
3259
- }]
3260
- }] });
3272
+ function dateFormatter(date, format) {
3273
+ if (!date)
3274
+ return;
3275
+ return formatDate(date, format, 'en-US');
3276
+ }
3277
+ function currencyFormatter(amt) {
3278
+ return formatCurrency(amt, 'en-US', '$');
3279
+ }
3261
3280
 
3262
3281
  class RouterLinkColumnComponent {
3263
3282
  additional = input.required();
3264
3283
  element = input.required();
3265
- link = computed(() => this.additional().link(this.element()));
3266
3284
  queryParams = computed(() => this.additional().routerLinkOptions.queryParams(this.element()));
3267
3285
  routerLinkOptions = computed(() => this.additional().routerLinkOptions);
3286
+ link = input.required();
3268
3287
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: RouterLinkColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3269
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: RouterLinkColumnComponent, isStandalone: true, selector: "tb-router-link-column", inputs: { additional: { classPropertyName: "additional", publicName: "additional", isSignal: true, isRequired: true, transformFunction: null }, element: { classPropertyName: "element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3288
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: RouterLinkColumnComponent, isStandalone: true, selector: "tb-router-link-column", inputs: { additional: { classPropertyName: "additional", publicName: "additional", isSignal: true, isRequired: true, transformFunction: null }, element: { classPropertyName: "element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3270
3289
  <a target="{{additional().target}}"
3271
3290
  [routerLink]=" [link()]"
3272
3291
  [queryParams]="queryParams()"
@@ -3302,9 +3321,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
3302
3321
  class LinkColumnComponent {
3303
3322
  element = input.required();
3304
3323
  additional = input.required();
3305
- link = computed(() => this.additional().link(this.element()));
3324
+ link = input.required();
3306
3325
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LinkColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3307
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: LinkColumnComponent, isStandalone: true, selector: "tb-link-column", inputs: { element: { classPropertyName: "element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null }, additional: { classPropertyName: "additional", publicName: "additional", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3326
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: LinkColumnComponent, isStandalone: true, selector: "tb-link-column", inputs: { element: { classPropertyName: "element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null }, additional: { classPropertyName: "additional", publicName: "additional", isSignal: true, isRequired: true, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3308
3327
  <a target="{{additional().target}}" href="{{link()}}">
3309
3328
  <ng-content></ng-content>
3310
3329
  </a>
@@ -3373,111 +3392,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
3373
3392
  }] });
3374
3393
 
3375
3394
  class InitializationComponent {
3376
- linkTemplate;
3377
- routerLinkTemplate;
3378
- linkWithIconTemplate;
3379
- routerLinkWithIconTemplate;
3380
- imageUrlTemplate;
3381
- arrayNewLineTemplate;
3382
- arrayCommaTemplate;
3383
- defaultTemplate;
3384
- defaultWithIcon;
3395
+ $linkTemplate = viewChild.required('link');
3396
+ $routerLinkTemplate = viewChild.required('routerLink');
3397
+ $linkWithIconTemplate = viewChild.required('linkWithIcon');
3398
+ $routerLinkWithIconTemplate = viewChild.required('routerLinkWithIcon');
3399
+ $imageUrlTemplate = viewChild.required('imageUrl');
3400
+ $arrayNewLineTemplate = viewChild.required('arrayNewLine');
3401
+ $arrayCommaTemplate = viewChild.required('arrayComma');
3402
+ $defaultTemplate = viewChild.required('default');
3403
+ $defaultWithIcon = viewChild.required('defaultWithIcon');
3385
3404
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: InitializationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3386
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: InitializationComponent, isStandalone: true, selector: "initialization", viewQueries: [{ propertyName: "linkTemplate", first: true, predicate: ["link"], descendants: true, static: true }, { propertyName: "routerLinkTemplate", first: true, predicate: ["routerLink"], descendants: true, static: true }, { propertyName: "linkWithIconTemplate", first: true, predicate: ["linkWithIcon"], descendants: true, static: true }, { propertyName: "routerLinkWithIconTemplate", first: true, predicate: ["routerLinkWithIcon"], descendants: true, static: true }, { propertyName: "imageUrlTemplate", first: true, predicate: ["imageUrl"], descendants: true, static: true }, { propertyName: "arrayNewLineTemplate", first: true, predicate: ["arrayNewLine"], descendants: true, static: true }, { propertyName: "arrayCommaTemplate", first: true, predicate: ["arrayComma"], descendants: true, static: true }, { propertyName: "defaultTemplate", first: true, predicate: ["default"], descendants: true, static: true }, { propertyName: "defaultWithIcon", first: true, predicate: ["defaultWithIcon"], descendants: true, static: true }], ngImport: i0, template: "<ng-template #link let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-link-column>\r\n</ng-template>\r\n\r\n<ng-template #routerLink let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-router-link-column [element]=\"element\" [additional]=\"additional\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-router-link-column>\r\n</ng-template>\r\n\r\n<ng-template #linkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-link-column>\r\n</ng-template>\r\n\r\n<ng-template #routerLinkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-router-link-column [element]=\"element\" [additional]=\"additional\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-router-link-column>\r\n</ng-template>\r\n\r\n<ng-template #imageUrl let-value='value'>\r\n <span>\r\n <img src=\"{{value}}\" height=\"75px\" width=\"75px\" />\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #arrayNewLine let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-new-line-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #arrayComma let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-comma-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #default let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n</ng-template>\r\n\r\n<ng-template #defaultWithIcon let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{value}}</mat-icon>\r\n</ng-template>\r\n", dependencies: [{ kind: "component", type: LinkColumnComponent, selector: "tb-link-column", inputs: ["element", "additional"] }, { kind: "component", type: ArrayCommaColumnComponent, selector: "tb-comma-array-column", inputs: ["value", "additional"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: RouterLinkColumnComponent, selector: "tb-router-link-column", inputs: ["additional", "element"] }, { kind: "component", type: ArrayNewLineColumnComponent, selector: "tb-new-line-array-column", inputs: ["value", "additional"] }, { kind: "directive", type: StylerDirective, selector: "[styler]", inputs: ["element", "styler"] }] });
3405
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: InitializationComponent, isStandalone: true, selector: "initialization", viewQueries: [{ propertyName: "$linkTemplate", first: true, predicate: ["link"], descendants: true, isSignal: true }, { propertyName: "$routerLinkTemplate", first: true, predicate: ["routerLink"], descendants: true, isSignal: true }, { propertyName: "$linkWithIconTemplate", first: true, predicate: ["linkWithIcon"], descendants: true, isSignal: true }, { propertyName: "$routerLinkWithIconTemplate", first: true, predicate: ["routerLinkWithIcon"], descendants: true, isSignal: true }, { propertyName: "$imageUrlTemplate", first: true, predicate: ["imageUrl"], descendants: true, isSignal: true }, { propertyName: "$arrayNewLineTemplate", first: true, predicate: ["arrayNewLine"], descendants: true, isSignal: true }, { propertyName: "$arrayCommaTemplate", first: true, predicate: ["arrayComma"], descendants: true, isSignal: true }, { propertyName: "$defaultTemplate", first: true, predicate: ["default"], descendants: true, isSignal: true }, { propertyName: "$defaultWithIcon", first: true, predicate: ["defaultWithIcon"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #link let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-link-column>\r\n }\r\n @else\r\n {\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #routerLink let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-router-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-router-link-column>\r\n }\r\n @else\r\n {\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n }\r\n\r\n</ng-template>\r\n\r\n<ng-template #linkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-link-column>\r\n }\r\n @else\r\n {\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #routerLinkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-link-column>\r\n }\r\n @else\r\n {\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #imageUrl let-value='value'>\r\n <span>\r\n <img src=\"{{value}}\" height=\"75px\" width=\"75px\" />\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #arrayNewLine let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-new-line-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #arrayComma let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-comma-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #default let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n</ng-template>\r\n\r\n<ng-template #defaultWithIcon let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{value}}</mat-icon>\r\n</ng-template>\r\n", dependencies: [{ kind: "component", type: LinkColumnComponent, selector: "tb-link-column", inputs: ["element", "additional", "link"] }, { kind: "component", type: ArrayCommaColumnComponent, selector: "tb-comma-array-column", inputs: ["value", "additional"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: RouterLinkColumnComponent, selector: "tb-router-link-column", inputs: ["additional", "element", "link"] }, { kind: "component", type: ArrayNewLineColumnComponent, selector: "tb-new-line-array-column", inputs: ["value", "additional"] }, { kind: "directive", type: StylerDirective, selector: "[styler]", inputs: ["element", "styler"] }, { kind: "pipe", type: FunctionPipe, name: "func" }] });
3387
3406
  }
3388
3407
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: InitializationComponent, decorators: [{
3389
3408
  type: Component,
3390
3409
  args: [{ selector: 'initialization', imports: [
3391
3410
  LinkColumnComponent, ArrayCommaColumnComponent, MatIcon,
3392
3411
  RouterLinkColumnComponent, ArrayNewLineColumnComponent,
3393
- StylerDirective
3394
- ], template: "<ng-template #link let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-link-column>\r\n</ng-template>\r\n\r\n<ng-template #routerLink let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-router-link-column [element]=\"element\" [additional]=\"additional\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-router-link-column>\r\n</ng-template>\r\n\r\n<ng-template #linkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-link-column>\r\n</ng-template>\r\n\r\n<ng-template #routerLinkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-router-link-column [element]=\"element\" [additional]=\"additional\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-router-link-column>\r\n</ng-template>\r\n\r\n<ng-template #imageUrl let-value='value'>\r\n <span>\r\n <img src=\"{{value}}\" height=\"75px\" width=\"75px\" />\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #arrayNewLine let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-new-line-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #arrayComma let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-comma-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #default let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n</ng-template>\r\n\r\n<ng-template #defaultWithIcon let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{value}}</mat-icon>\r\n</ng-template>\r\n" }]
3395
- }], propDecorators: { linkTemplate: [{
3396
- type: ViewChild,
3397
- args: ['link', { static: true }]
3398
- }], routerLinkTemplate: [{
3399
- type: ViewChild,
3400
- args: ['routerLink', { static: true }]
3401
- }], linkWithIconTemplate: [{
3402
- type: ViewChild,
3403
- args: ['linkWithIcon', { static: true }]
3404
- }], routerLinkWithIconTemplate: [{
3405
- type: ViewChild,
3406
- args: ['routerLinkWithIcon', { static: true }]
3407
- }], imageUrlTemplate: [{
3408
- type: ViewChild,
3409
- args: ['imageUrl', { static: true }]
3410
- }], arrayNewLineTemplate: [{
3411
- type: ViewChild,
3412
- args: ['arrayNewLine', { static: true }]
3413
- }], arrayCommaTemplate: [{
3414
- type: ViewChild,
3415
- args: ['arrayComma', { static: true }]
3416
- }], defaultTemplate: [{
3417
- type: ViewChild,
3418
- args: ['default', { static: true }]
3419
- }], defaultWithIcon: [{
3420
- type: ViewChild,
3421
- args: ['defaultWithIcon', { static: true }]
3422
- }] } });
3412
+ StylerDirective, FunctionPipe
3413
+ ], template: "<ng-template #link let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-link-column>\r\n }\r\n @else\r\n {\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #routerLink let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-router-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n </tb-router-link-column>\r\n }\r\n @else\r\n {\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n }\r\n\r\n</ng-template>\r\n\r\n<ng-template #linkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-link-column>\r\n }\r\n @else\r\n {\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #routerLinkWithIcon let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n @let link = additional.link | func : element;\r\n @if(link)\r\n {\r\n <tb-link-column [element]=\"element\" [additional]=\"additional\" [link]=\"$any(link)\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n </tb-link-column>\r\n }\r\n @else\r\n {\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{ value}}</mat-icon>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #imageUrl let-value='value'>\r\n <span>\r\n <img src=\"{{value}}\" height=\"75px\" width=\"75px\" />\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #arrayNewLine let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-new-line-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #arrayComma let-value='value' let-element='element' let-additional=\"additional\" let-styles=\"innerStyles\">\r\n <tb-comma-array-column [value]='value' [additional]='additional' [styler]=\"styles\" [element]=\"element\"/>\r\n</ng-template>\r\n\r\n<ng-template #default let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <span [styler]=\"styles\" [element]=\"element\">{{value}}</span>\r\n</ng-template>\r\n\r\n<ng-template #defaultWithIcon let-value='value' let-element='element' let-styles=\"innerStyles\">\r\n <mat-icon [styler]=\"styles\" [element]=\"element\">{{value}}</mat-icon>\r\n</ng-template>\r\n" }]
3414
+ }] });
3423
3415
 
3424
3416
  class TableTemplateService {
3425
- instance;
3426
- templates = {};
3427
- initTemplates() {
3428
- this.templates.NewLineArray = this.instance.arrayNewLineTemplate;
3429
- this.templates.CommaArray = this.instance.arrayCommaTemplate;
3430
- this.templates.Default = this.instance.defaultTemplate;
3431
- this.templates.Icon = this.instance.defaultWithIcon;
3432
- this.templates.ImageUrl = this.instance.imageUrlTemplate;
3433
- this.templates.Link = this.instance.linkTemplate;
3434
- this.templates.RouterLink = this.instance.routerLinkTemplate;
3435
- this.templates.LinkWithIcon = this.instance.linkWithIconTemplate;
3436
- this.templates.RouterLinkWithIcon = this.instance.routerLinkWithIconTemplate;
3437
- }
3417
+ environmentInjector = inject(EnvironmentInjector);
3418
+ tableConfig = inject(TableBuilderConfigToken);
3419
+ initConfig = createComponent(InitializationComponent, {
3420
+ environmentInjector: this.environmentInjector,
3421
+ });
3422
+ initializationComponentInstance = this.initConfig.instance;
3438
3423
  getTemplate(metaData) {
3439
- const arrayStyle = metaData.additional?.arrayStyle ?? this.tableConfig?.arrayDefaults?.arrayStyle;
3440
3424
  if (metaData.fieldType === FieldType.Array) {
3425
+ const arrayStyle = metaData.additional?.arrayStyle ?? this.tableConfig?.arrayDefaults?.arrayStyle;
3441
3426
  return arrayStyle === ArrayStyle.NewLine
3442
- ? this.templates.NewLineArray
3443
- : this.templates.CommaArray;
3427
+ ? this.initializationComponentInstance.$arrayNewLineTemplate()
3428
+ : this.initializationComponentInstance.$arrayCommaTemplate();
3444
3429
  }
3445
3430
  if (metaData.fieldType === FieldType.ImageUrl) {
3446
- return this.templates.ImageUrl;
3431
+ return this.initializationComponentInstance.$imageUrlTemplate();
3447
3432
  }
3448
3433
  const useIcon = metaData.useIcon || metaData.fieldType === FieldType.Boolean;
3449
3434
  if (metaData.fieldType === FieldType.Link || metaData.additional?.link) {
3450
3435
  const router = metaData.additional?.link?.useRouterLink;
3451
3436
  if (router) {
3452
3437
  return useIcon
3453
- ? this.templates.RouterLinkWithIcon
3454
- : this.templates.RouterLink;
3438
+ ? this.initializationComponentInstance.$routerLinkWithIconTemplate()
3439
+ : this.initializationComponentInstance.$routerLinkTemplate();
3455
3440
  }
3456
3441
  return useIcon
3457
- ? this.templates.LinkWithIcon
3458
- : this.templates.Link;
3442
+ ? this.initializationComponentInstance.$linkWithIconTemplate()
3443
+ : this.initializationComponentInstance.$linkTemplate();
3459
3444
  }
3460
3445
  if (useIcon) {
3461
- return this.templates.Icon;
3446
+ return this.initializationComponentInstance.$defaultWithIcon();
3462
3447
  }
3463
- return this.templates.Default;
3448
+ return this.initializationComponentInstance.$defaultTemplate();
3464
3449
  }
3465
- constructor() {
3466
- const ei = inject(EnvironmentInjector);
3467
- const c = createComponent(InitializationComponent, {
3468
- environmentInjector: ei,
3469
- });
3470
- this.instance = c.instance;
3471
- this.initTemplates();
3472
- }
3473
- tableConfig = inject(TableBuilderConfigToken);
3474
3450
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableTemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3475
3451
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableTemplateService, providedIn: 'root' });
3476
3452
  }
3477
3453
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableTemplateService, decorators: [{
3478
3454
  type: Injectable,
3479
3455
  args: [{ providedIn: 'root' }]
3480
- }], ctorParameters: () => [] });
3456
+ }] });
3481
3457
 
3482
3458
  class ColumnHeaderMenuComponent {
3483
3459
  tableState = inject(TableStore);
@@ -3531,14 +3507,14 @@ class ColumnHeaderMenuComponent {
3531
3507
  }
3532
3508
  }
3533
3509
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ColumnHeaderMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3534
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: ColumnHeaderMenuComponent, isStandalone: true, selector: "tb-header-menu", inputs: { $metaData: { classPropertyName: "$metaData", publicName: "metaData", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "$trigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }], ngImport: i0, template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n <div (keydown)=\"$event.stopImmediatePropagation()\">\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n </div>\r\n\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button .chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"], dependencies: [{ kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: InListFilterComponent, selector: "tb-in-list-filter , [tb-in-list-filter]", inputs: ["key"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3510
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: ColumnHeaderMenuComponent, isStandalone: true, selector: "tb-header-menu", inputs: { $metaData: { classPropertyName: "$metaData", publicName: "metaData", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "$trigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }], ngImport: i0, template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n <div (keydown)=\"$event.stopImmediatePropagation()\">\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n </div>\r\n\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;width:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button .chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"], dependencies: [{ kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: InListFilterComponent, selector: "tb-in-list-filter , [tb-in-list-filter]", inputs: ["key"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3535
3511
  }
3536
3512
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ColumnHeaderMenuComponent, decorators: [{
3537
3513
  type: Component,
3538
3514
  args: [{ selector: 'tb-header-menu', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
3539
3515
  MatMenuModule, MatIconModule, MatButtonModule, FormsModule, InListFilterComponent,
3540
3516
  MatInputModule, MatTooltipModule, StopPropagationDirective, MatRadioModule, MatDatepickerModule
3541
- ], template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n <div (keydown)=\"$event.stopImmediatePropagation()\">\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n </div>\r\n\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button .chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"] }]
3517
+ ], template: "@let metaData = $metaData();\r\n@let currentFilterType = $currentFilterType();\r\n\r\n<button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n</button>\r\n<mat-menu #menu=\"matMenu\" >\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <button mat-menu-item (click)=\"tableState.addGroupByKey(metaData.key)\">\r\n <mat-icon color=\"primary\">group</mat-icon>\r\n <span>Group By</span>\r\n </button>\r\n }\r\n <button mat-menu-item (click)=hideField(metaData.key)>\r\n <mat-icon color=\"primary\">visibility_off</mat-icon>\r\n <span>Hide Column</span>\r\n </button>\r\n <div (keydown)=\"$event.stopImmediatePropagation()\">\r\n @if (!(metaData.fieldType === FieldType.NotMapped))\r\n {\r\n <ng-form #myForm=\"ngForm\" (keydown.enter)=\"onEnter(myForm.value)\" class=\"tb-header-filter\">\r\n <input type=\"hidden\" name=\"filterId\" [ngModel]=\"'header-column-' + metaData.key\" />\r\n <input type=\"hidden\" name=\"filterType\" [ngModel]=\"currentFilterType\" />\r\n <input type=\"hidden\" name=\"key\" [ngModel]=\"metaData.key\" />\r\n <input type=\"hidden\" name=\"fieldType\" [ngModel]=\"metaData.fieldType\" />\r\n \r\n @if(currentFilterType === FilterType.Or || currentFilterType === FilterType.In){\r\n <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]=\"undefined\"/>\r\n }\r\n @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {\r\n <mat-form-field stop-propagation class=\"font auto-width\">\r\n <mat-icon matPrefix class=\"search-icon\">search</mat-icon>\r\n <mat-label>{{currentFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\"/>\r\n <span matSuffix [matTooltip]=\"currentFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'\">\r\n <button mat-icon-button color=\"primary\" (click)=\"setStringFilterType()\" class=\"header-filter-icon-button\">\r\n <mat-icon [class]=\"{'chosen-icon': currentFilterType === FilterType.StringDoesNotContain }\">\r\n block\r\n </mat-icon>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {\r\n <mat-form-field class=\"auto-width\" stop-propagation>\r\n <mat-label>{{currentFilterType === FilterType.NumberEquals ? 'Equals...' : currentFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>\r\n <input matInput type='number' name=\"filterValue\" [ngModel]=\"undefined\" />\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberLessThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberLessThan }\">\r\n <mat-icon class=\"suffix-icons\"\r\n >\r\n arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberGreaterThan)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberGreaterThan }\" >\r\n <mat-icon class=\"suffix-icons\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.NumberEquals)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.NumberEquals }\">\r\n <span class=\"suffix-icons\">=</span>\r\n </button>\r\n </span>\r\n </mat-form-field>\r\n }\r\n @else if (metaData.fieldType === FieldType.Boolean) {\r\n <div>\r\n <label>\r\n <mat-icon class=\"search-icon\">filter_list</mat-icon>\r\n </label>\r\n <mat-radio-group stop-propagation #ctrl=\"matRadioGroup\" #boolField='ngModel' class=\"font\" name=\"filterValue\" [ngModel]=\"undefined\" >\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(true);\" [value]=\"true\">True</mat-radio-button><br/>\r\n <mat-radio-button class=\"filter-radio-button\" (click)=\"boolField.control.setValue(false)\" [value]=\"false\">False</mat-radio-button><br/>\r\n </mat-radio-group>\r\n </div>\r\n }\r\n @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {\r\n <mat-form-field class=\"font auto-width\" stop-propagation >\r\n <span matPrefix class=\"tb-header-prefix\">\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrAfter)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrAfter }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_forward_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateOnOrBefore)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateOnOrBefore }\">\r\n <mat-icon class=\"suffix-icons underline\">arrow_back_ios</mat-icon>\r\n </button>\r\n <button mat-icon-button disableRipple class=\"header-filter-icon-button\" (click)=\"setFilterType(FilterType.DateIsOn)\"\r\n [class]=\"{'chosen-icon': currentFilterType === FilterType.DateIsOn }\">\r\n <span class=\"suffix-icons underline\"> =</span>\r\n </button>\r\n </span>\r\n <mat-label>{{currentFilterType === FilterType.DateIsOn ? 'On...' :\r\n currentFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>\r\n <input matInput name=\"filterValue\" [ngModel]=\"undefined\" [matDatepicker]=\"calendar\"\r\n (click)=\"calendar.open()\"/>\r\n <mat-datepicker-toggle class=\"date-toggle header-filter-icon-button\" matSuffix [for]=\"calendar\" preventEnter></mat-datepicker-toggle>\r\n <mat-datepicker #calendar></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n <button mat-button (click)=\"onEnter(myForm.value)\" [disabled]=\"myForm.value.filterValue == undefined\" disableRipple>\r\n Apply\r\n </button>\r\n </ng-form>\r\n }\r\n </div>\r\n\r\n</mat-menu>\r\n", styles: [":host{--mdc-text-button-container-height: 24px}:host{--mdc-filled-button-container-height: 24px}:host{--mdc-protected-button-container-height: 24px}:host{--mdc-outlined-button-container-height: 24px}:host{--mat-text-button-touch-target-display: none}:host{--mat-filled-button-touch-target-display: none}:host{--mat-protected-button-touch-target-display: none}:host{--mat-outlined-button-touch-target-display: none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.menu-icon{font-size:16px;line-height:16px;vertical-align:top;height:16px;width:16px}.search-icon{margin-right:16px;vertical-align:middle;height:24px;width:24px;color:#0000008a;font-size:21px;line-height:1.125}.font{font-size:14px}.filter-radio-button:first-of-type{padding-left:0}.filter-radio-button{padding:10px 40px;min-width:110px}.auto-width{width:260px;margin:5px;display:block;height:55px}.open-menu-icon-button{height:28px;width:28px;padding:6px}.header-filter-icon-button{height:18px;width:18px;font-size:18px;padding:0;margin:0 2px}.header-filter-icon-button ::ng-deep *{line-height:initial;font-size:initial;height:18px;width:18px;font-size:18px;bottom:initial}.header-filter-icon-button .chosen-icon,.header-filter-icon-button.chosen-icon ::ng-deep *{height:22px;width:22px;font-size:22px;color:green}mat-icon.mat-icon.suffix-icons.underline{height:20px;text-decoration:underline .1px solid}.chosen-icon mat-icon.mat-icon.suffix-icons.underline{height:24px}::ng-deep .mat-mdc-form-field-icon-prefix:has(.tb-header-prefix),.tb-header-prefix{padding:0;flex-basis:36%}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper{line-height:0}.tb-header-filter ::ng-deep .mat-mdc-form-field-subscript-wrapper:before{height:0}.date-toggle ::ng-deep svg{position:absolute;left:0;top:0}\n"] }]
3542
3518
  }] });
3543
3519
 
3544
3520
  class ColumnTotalPipe {
@@ -3606,7 +3582,7 @@ const columnsStyles = (metaDatas, userDefinedWidths) => {
3606
3582
 
3607
3583
  class ColumnBuilderComponent {
3608
3584
  FieldType = FieldType;
3609
- transformCreator = inject(TransformCreator);
3585
+ config = inject(TableBuilderConfigToken);
3610
3586
  table = inject(MatTable);
3611
3587
  state = inject(TableStore);
3612
3588
  templateService = inject(TableTemplateService);
@@ -3637,7 +3613,7 @@ class ColumnBuilderComponent {
3637
3613
  const metaData = this.$metaData();
3638
3614
  if (!metaData)
3639
3615
  return;
3640
- return this.transformCreator.createTransformer(metaData);
3616
+ return createTransformer(metaData, this.config);
3641
3617
  });
3642
3618
  $innerTemplate = computed(() => {
3643
3619
  const metaData = this.$metaData();
@@ -3768,7 +3744,7 @@ class GenericTableComponent {
3768
3744
  state = inject(TableStore);
3769
3745
  dataStore = inject(DataStore);
3770
3746
  viewContainer = inject(ViewContainerRef);
3771
- transformCreator = inject(TransformCreator);
3747
+ config = inject(TableBuilderConfigToken);
3772
3748
  _injector = inject(Injector);
3773
3749
  smallFooter = 10;
3774
3750
  $headerRow = viewChild(MatHeaderRowDef);
@@ -3879,8 +3855,9 @@ class GenericTableComponent {
3879
3855
  });
3880
3856
  $usePaginator = computed(() => this.state.$tableSettings().usePaginator);
3881
3857
  $useVirtualScroll = computed(() => this.state.$viewType().includes('virtual'));
3858
+ $virtualStart = this.dataStore.selectSignal(d => d.virtualEnds.start);
3882
3859
  $offsetIndex = computed(() => {
3883
- const virtualStart = this.dataStore.selectSignal(d => d.virtualEnds.start)();
3860
+ const virtualStart = this.$virtualStart();
3884
3861
  const pageSize = this.state.$pageSize();
3885
3862
  const currentPage = this.state.$currentPage();
3886
3863
  if (this.$useVirtualScroll()) {
@@ -3996,7 +3973,7 @@ class GenericTableComponent {
3996
3973
  if (val == undefined || val === 'null')
3997
3974
  return '';
3998
3975
  try {
3999
- return this.transformCreator.createTransformer(this.state.$getMetaData(key)(), true, true)({ [`${key}`]: val });
3976
+ return createTransformer(this.state.$getMetaData(key)(), this.config, true, true)({ [`${key}`]: val });
4000
3977
  }
4001
3978
  catch (error) {
4002
3979
  return val;
@@ -4049,15 +4026,17 @@ class GenericTableComponent {
4049
4026
  }
4050
4027
  });
4051
4028
  $stickyFooter = computed(() => this.state.$props().stickyFooter || this.state.$isVirtual());
4029
+ $rowStyles = computed(() => this.state.$tableSettings().rowStyles || {});
4030
+ $rowClasses = computed(() => this.state.$tableSettings().rowClasses || {});
4052
4031
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GenericTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4053
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { $displayDataLength: { classPropertyName: "$displayDataLength", publicName: "displayDataLength", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, $rows: { classPropertyName: "$rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, transformFunction: null }, $dataSource: { classPropertyName: "$dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection" }, viewQueries: [{ propertyName: "$headerRow", first: true, predicate: MatHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "$footerRow", first: true, predicate: MatFooterRowDef, descendants: true, isSignal: true }, { propertyName: "$table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "$dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index;\" class=\"index-column\">\r\n {{ 1 + i + $offsetIndex() }}\r\n </mat-cell>\r\n <mat-footer-cell *matFooterCellDef class=\"index-column\"></mat-footer-cell>\r\n </ng-container>\r\n\r\n <!-- Grouping -->\r\n <ng-container matColumnDef=\"groupHeader\">\r\n <mat-cell *matCellDef=\"let row\">\r\n @let expanded = (state.$getIsExpanded | func : row.key : row.groupName );\r\n <div [style.paddingLeft]=\"row.padding + 'px !important'\">\r\n <button mat-icon-button (click)=\"setExpanded(row.key, row.groupName, !expanded());\">\r\n @if (!expanded()) {\r\n <mat-icon>chevron_right</mat-icon>\r\n } @else {\r\n <mat-icon>expand_more</mat-icon>\r\n }\r\n </button>\r\n {{ getTransform | func : row.key : row.groupHeaderDisplay }} ({{ row.length }})\r\n </div>\r\n <div style=\"flex-grow: 1\">\r\n <ng-container *ngTemplateOutlet=\"state.$props().groupHeaderTemplate!; context: { element: row }\"></ng-container>\r\n </div>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"/>\r\n <mat-row [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\" style=\"background-color: white;\"/>\r\n</mat-table>\r\n\r\n<mat-header-row [style.height]=\"$headerHeight()\" [style.min-height]=\"$headerHeight()\"\r\n *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$footerHeight()\" [style.min-height]=\"$footerHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: initial}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.mat-mdc-row:nth-child(odd){background-color:var(--tb-odd-row-background-color, #cdeefe)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$6.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$6.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$6.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$6.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "pipe", type: FunctionPipe, name: "func" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4032
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { $displayDataLength: { classPropertyName: "$displayDataLength", publicName: "displayDataLength", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, $rows: { classPropertyName: "$rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, transformFunction: null }, $dataSource: { classPropertyName: "$dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection" }, viewQueries: [{ propertyName: "$headerRow", first: true, predicate: MatHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "$footerRow", first: true, predicate: MatFooterRowDef, descendants: true, isSignal: true }, { propertyName: "$table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "$dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index; let t\" 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\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"\r\n [style.height]=\"$rowHeight()\"\r\n [style.min-height]=\"$rowHeight()\"\r\n [styler]=\"$rowStyles()\"\r\n [element]=\"row\"\r\n [conditionalClasses]=\"$rowClasses()\"\r\n />\r\n\r\n <mat-row [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\" style=\"background-color: white;\"/>\r\n</mat-table>\r\n\r\n<mat-header-row [style.height]=\"$headerHeight()\" [style.min-height]=\"$headerHeight()\"\r\n *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$footerHeight()\" [style.min-height]=\"$footerHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: initial}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.mat-mdc-row:nth-child(odd){background-color:var(--tb-odd-row-background-color, #cdeefe)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$6.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$6.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$6.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$6.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "pipe", type: FunctionPipe, name: "func" }, { kind: "directive", type: StylerDirective, selector: "[styler]", inputs: ["element", "styler"] }, { kind: "directive", type: ConditionalClassesDirective, selector: "[conditionalClasses]", inputs: ["element", "conditionalClasses"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4054
4033
  }
4055
4034
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GenericTableComponent, decorators: [{
4056
4035
  type: Component,
4057
4036
  args: [{ selector: 'tb-generic-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
4058
4037
  MatTableModule, DragDropModule, MatCheckboxModule, MatButtonModule, MatIconModule, NgTemplateOutlet,
4059
- MatTooltipModule, FunctionPipe,
4060
- ], template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index;\" class=\"index-column\">\r\n {{ 1 + i + $offsetIndex() }}\r\n </mat-cell>\r\n <mat-footer-cell *matFooterCellDef class=\"index-column\"></mat-footer-cell>\r\n </ng-container>\r\n\r\n <!-- Grouping -->\r\n <ng-container matColumnDef=\"groupHeader\">\r\n <mat-cell *matCellDef=\"let row\">\r\n @let expanded = (state.$getIsExpanded | func : row.key : row.groupName );\r\n <div [style.paddingLeft]=\"row.padding + 'px !important'\">\r\n <button mat-icon-button (click)=\"setExpanded(row.key, row.groupName, !expanded());\">\r\n @if (!expanded()) {\r\n <mat-icon>chevron_right</mat-icon>\r\n } @else {\r\n <mat-icon>expand_more</mat-icon>\r\n }\r\n </button>\r\n {{ getTransform | func : row.key : row.groupHeaderDisplay }} ({{ row.length }})\r\n </div>\r\n <div style=\"flex-grow: 1\">\r\n <ng-container *ngTemplateOutlet=\"state.$props().groupHeaderTemplate!; context: { element: row }\"></ng-container>\r\n </div>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-row [style.height]=\"$rowHeight()\" [style.min-height]=\"$rowHeight()\"\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"/>\r\n <mat-row [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\" style=\"background-color: white;\"/>\r\n</mat-table>\r\n\r\n<mat-header-row [style.height]=\"$headerHeight()\" [style.min-height]=\"$headerHeight()\"\r\n *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$footerHeight()\" [style.min-height]=\"$footerHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: initial}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.mat-mdc-row:nth-child(odd){background-color:var(--tb-odd-row-background-color, #cdeefe)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"] }]
4038
+ MatTooltipModule, FunctionPipe, StylerDirective, ConditionalClassesDirective
4039
+ ], template: "<mat-table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"table-drag-list\"\r\n #table\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\">\r\n </mat-checkbox>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index; let t\" 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\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"\r\n [style.height]=\"$rowHeight()\"\r\n [style.min-height]=\"$rowHeight()\"\r\n [styler]=\"$rowStyles()\"\r\n [element]=\"row\"\r\n [conditionalClasses]=\"$rowClasses()\"\r\n />\r\n\r\n <mat-row [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\" style=\"background-color: white;\"/>\r\n</mat-table>\r\n\r\n<mat-header-row [style.height]=\"$headerHeight()\" [style.min-height]=\"$headerHeight()\"\r\n *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row [style.height]=\"$footerHeight()\" [style.min-height]=\"$footerHeight()\"\r\n *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: initial}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.mat-mdc-row:nth-child(odd){background-color:var(--tb-odd-row-background-color, #cdeefe)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"] }]
4061
4040
  }] });
4062
4041
 
4063
4042
  function downloadData(data, filename, mimeType) {
@@ -4464,17 +4443,20 @@ const tbGroupBy = (data, groupByKeys, parentGroupName) => {
4464
4443
  };
4465
4444
  });
4466
4445
  };
4467
- function updateGroupByState({ groupedData }, [data, groups, expandedGroups], index) {
4468
- if (index === 0
4469
- || dataUpdated(data, groups, expandedGroups)
4470
- || groupsUpdated(groups, expandedGroups)) {
4446
+ function updateGroupByState(groupedData, { data, groups, expanded }, firstRun) {
4447
+ if (firstRun
4448
+ || dataUpdated(data, groups, expanded)
4449
+ || groupsUpdated(groups, expanded)) {
4471
4450
  groupedData = groups.value.length ? getGroupedData(data.value, groups.value) : data.value;
4472
4451
  }
4473
- const newDisplayData = expandedGroups.value.length === 0
4452
+ const newDisplayData = expanded.value.length === 0
4474
4453
  ? groupedData
4475
- : groupedData.map(group => mapGroupHeader(group, expandedGroups.value)).flat();
4454
+ : groupedData.map(group => mapGroupHeader(group, expanded.value)).flat();
4476
4455
  return ({ displayData: newDisplayData, groupedData });
4477
4456
  }
4457
+ function _updateGroupByState({ groupedData }, [data, groups, expanded], index) {
4458
+ return updateGroupByState(groupedData, { data, groups, expanded }, index === 0);
4459
+ }
4478
4460
  function mapGroupHeader(obj, data) {
4479
4461
  const showChildren = data.find(a => a.expandedHeaders.includes(obj.groupName));
4480
4462
  const children = !showChildren ? [] :
@@ -4511,6 +4493,15 @@ function sortData(data, sorted) {
4511
4493
  return ordered;
4512
4494
  }
4513
4495
  function filterData(data, filters, resetAll = false) {
4496
+ if (filters.length === 0) {
4497
+ if (resetAll) {
4498
+ for (let index = 0; index < data.length; index++) {
4499
+ const element = data[index];
4500
+ element[tbNoShowSymbol] = false;
4501
+ }
4502
+ }
4503
+ return data;
4504
+ }
4514
4505
  for (let index = 0; index < data.length; index++) {
4515
4506
  const element = data[index];
4516
4507
  const hide = !filters.every(filter => filter(element));
@@ -4522,19 +4513,33 @@ function filterData(data, filters, resetAll = false) {
4522
4513
  }
4523
4514
  const tbNoShowSymbol = Symbol('tb_no_show');
4524
4515
 
4525
- const sortAndFilterData = (data, sortState, filterState) => combineLatest([
4516
+ const _sortAndFilterData = (data, sortState, filterState) => combineLatest([
4526
4517
  data.pipe(timestamp()),
4527
4518
  sortState.pipe(timestamp()),
4528
4519
  filterState.pipe(timestamp())
4529
- ]).pipe(scan(({ mappedData: resultData }, [data, sort, f], index) => {
4530
- if (index === 0 || (data.timestamp > sort.timestamp && data.timestamp > f.timestamp)) {
4531
- return ({ mappedData: filterData(sortData(data.value, sort.value.sortsToRun), f.value.allFilters) });
4532
- }
4533
- if (sort.timestamp > f.timestamp) {
4534
- return ({ mappedData: sortData(resultData, sort.value.sortsToRun) });
4535
- }
4536
- return ({ mappedData: filterData(resultData, f.value.onlyAddedFilters || f.value.allFilters, !f.value.onlyAddedFilters) });
4537
- }, { mappedData: [] })).pipe(map$1(({ mappedData: resultData }) => resultData.filter(item => !item[tbNoShowSymbol])), defaultShareReplay());
4520
+ ]).pipe(scan((mappedData, [data, sort, f], index) => {
4521
+ return mapDataSortsAndFilters(data, f, sort, index === 0, mappedData);
4522
+ }, [])).pipe(map$1((resultData) => resultData.filter(item => !item[tbNoShowSymbol])), defaultShareReplay());
4523
+ const mapDataSortsAndFilters = (allData, filters, sort, firstRun, filteredData) => {
4524
+ const fresh = firstRun || (allData.timestamp > sort.timestamp && allData.timestamp > filters.timestamp);
4525
+ const sortChanged = !fresh && sort.timestamp > filters.timestamp;
4526
+ const filterRemoved = !fresh && !sortChanged && !filters.value.onlyAddedFilters;
4527
+ const runAllOnAllData = fresh || filterRemoved;
4528
+ const resetFilters = !fresh && filterRemoved;
4529
+ if (runAllOnAllData) {
4530
+ const filteredData = filterData(sortData(allData.value, sort.value.sortsToRun), filters.value.allFilters, resetFilters);
4531
+ return filteredData;
4532
+ }
4533
+ if (sortChanged) {
4534
+ return (sortData(filteredData, sort.value.sortsToRun));
4535
+ }
4536
+ return (filterData(filteredData, filters.value.onlyAddedFilters || filters.value.allFilters, resetFilters));
4537
+ };
4538
+ const sortAndFilterData = (data, filters, sort, firstRun, resultData) => {
4539
+ const markedAndSortedData = mapDataSortsAndFilters(data, filters, sort, firstRun, resultData);
4540
+ const filteredData = markedAndSortedData.filter(item => !item[tbNoShowSymbol]);
4541
+ return filteredData;
4542
+ };
4538
4543
  const createDataCleaners = (metadatas, mutate = false) => {
4539
4544
  const transforms = createCleaners(metadatas);
4540
4545
  return (data) => {
@@ -4767,7 +4772,7 @@ class TableBuilderDataSource extends MatTableDataSource {
4767
4772
  const $pageSize = state.$pageSize;
4768
4773
  const $virtualEnds = data.selectSignal(d => d.virtualEnds);
4769
4774
  const $dataLength = computed(() => this.#$dataSrc().length);
4770
- const $dataSize = computed(() => {
4775
+ this.$dataSize = computed(() => {
4771
4776
  const viewType = state.$viewType();
4772
4777
  const dataLength = $dataLength();
4773
4778
  const currentPage = $currentPage();
@@ -4785,7 +4790,6 @@ class TableBuilderDataSource extends MatTableDataSource {
4785
4790
  }
4786
4791
  return ({ start: virtualEnds.start, end: virtualEnds.end });
4787
4792
  });
4788
- this.$dataSize = $dataSize;
4789
4793
  }
4790
4794
  connect() {
4791
4795
  return super.connect();
@@ -4821,13 +4825,13 @@ function mergeCustomCellMetaData(metaData1, metaData2) {
4821
4825
  class GroupByListComponent {
4822
4826
  tableStore = inject(TableStore);
4823
4827
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GroupByListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4824
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GroupByListComponent, isStandalone: true, selector: "group-by-list", ngImport: i0, template: "<mat-chip-set>\r\n <span class=\"tb-group-label\">Group By:</span>\r\n @for (groupByKey of tableStore.$groupByKeys(); track groupByKey) {\r\n @if($index > 0){\r\n <mat-icon class=\"nested-arrow\">arrow_right</mat-icon>\r\n }\r\n <mat-chip (removed)=\"tableStore.removeGroupByKey(groupByKey)\">\r\n {{groupByKey | spaceCase}}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n</mat-chip-set>\r\n", styles: [".tb-group-label{padding-right:5px}.nested-arrow{margin-right:-8px;margin-left:-8px}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i4$2.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i4$2.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: SpaceCasePipe, name: "spaceCase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4828
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: GroupByListComponent, isStandalone: true, selector: "group-by-list", ngImport: i0, template: "<span class=\"tb-group-label\">Group By:</span>\r\n<mat-chip-set>\r\n @for (groupByKey of tableStore.$groupByKeys(); track groupByKey)\r\n {\r\n @if($index > 0)\r\n {\r\n <mat-icon class=\"nested-arrow\">arrow_right</mat-icon>\r\n }\r\n <mat-chip (removed)=\"tableStore.removeGroupByKey(groupByKey)\">\r\n {{groupByKey | spaceCase}}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n</mat-chip-set>\r\n", styles: [".tb-group-label{font-weight:bolder;padding-right:15px}:host{display:flex;padding-left:8px;align-items:center}:host mat-chip-set mat-chip{margin:0}:host mat-chip-set .nested-arrow{display:flex;width:15px;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i4$2.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i4$2.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: SpaceCasePipe, name: "spaceCase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4825
4829
  }
4826
4830
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GroupByListComponent, decorators: [{
4827
4831
  type: Component,
4828
4832
  args: [{ selector: 'group-by-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
4829
4833
  MatChipsModule, MatIconModule, SpaceCasePipe
4830
- ], template: "<mat-chip-set>\r\n <span class=\"tb-group-label\">Group By:</span>\r\n @for (groupByKey of tableStore.$groupByKeys(); track groupByKey) {\r\n @if($index > 0){\r\n <mat-icon class=\"nested-arrow\">arrow_right</mat-icon>\r\n }\r\n <mat-chip (removed)=\"tableStore.removeGroupByKey(groupByKey)\">\r\n {{groupByKey | spaceCase}}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n</mat-chip-set>\r\n", styles: [".tb-group-label{padding-right:5px}.nested-arrow{margin-right:-8px;margin-left:-8px}\n"] }]
4834
+ ], template: "<span class=\"tb-group-label\">Group By:</span>\r\n<mat-chip-set>\r\n @for (groupByKey of tableStore.$groupByKeys(); track groupByKey)\r\n {\r\n @if($index > 0)\r\n {\r\n <mat-icon class=\"nested-arrow\">arrow_right</mat-icon>\r\n }\r\n <mat-chip (removed)=\"tableStore.removeGroupByKey(groupByKey)\">\r\n {{groupByKey | spaceCase}}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n }\r\n</mat-chip-set>\r\n", styles: [".tb-group-label{font-weight:bolder;padding-right:15px}:host{display:flex;padding-left:8px;align-items:center}:host mat-chip-set mat-chip{margin:0}:host mat-chip-set .nested-arrow{display:flex;width:15px;justify-content:center}\n"] }]
4831
4835
  }] });
4832
4836
 
4833
4837
  class ProfilesMenuComponent {
@@ -5011,7 +5015,7 @@ class ResetMenuComponent {
5011
5015
  $widthsSet = computed(() => Object.keys(this.state.$getUserDefinedWidths()).length);
5012
5016
  $rowHeightSet = this.state.$userDefinedRowHeight;
5013
5017
  headerHeightSet = this.state.$userDefinedHeaderHeight;
5014
- pageSizeSet = this.state.$userDefinedPageSize;
5018
+ pageSizeSet = computed(() => this.state.$userDefinedPageSize() && this.state.$userDefinedPageSize() !== this.state.selectSignal(s => s.pageSize)());
5015
5019
  showAllSet = this.state.selectSignal(s => s.userDefined.showAll);
5016
5020
  $set = computed(() => {
5017
5021
  const arr = [];
@@ -5088,93 +5092,120 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
5088
5092
  }] });
5089
5093
 
5090
5094
  class TableVirtualScrollStrategy {
5091
- scrolledIndexChange;
5092
- dataLength = 0;
5095
+ constructor(scrollContainer, dataStore) {
5096
+ this.$rowHeight = scrollContainer.computedRowHeight;
5097
+ this.$headerHeight = scrollContainer.computedHeaderHeight;
5098
+ this.viewport = scrollContainer.viewport;
5099
+ this.dataStore = dataStore;
5100
+ this.$dataLength = scrollContainer.$dataLength;
5101
+ }
5102
+ dataStore;
5093
5103
  indexChange = new Subject();
5104
+ scrolledIndexChange = this.indexChange.pipe(distinctUntilChanged());
5094
5105
  viewport;
5106
+ $dataLength;
5107
+ $dataLengthChange = linkedSignal({
5108
+ source: () => this.$dataLength(),
5109
+ computation: (curr, previous) => ({ curr, previous: previous == undefined ? curr : previous.source })
5110
+ });
5095
5111
  $rowHeight;
5096
5112
  $rowHeightChange = linkedSignal({
5097
5113
  source: () => this.$rowHeight(),
5098
- computation: (curr, previous) => ({ curr, previous: previous?.source || curr })
5114
+ computation: (curr, previous) => {
5115
+ return ({ curr, previous: previous == undefined ? curr : previous.source });
5116
+ }
5099
5117
  });
5100
5118
  $headerHeight;
5101
- constructor(scrollContainer) {
5102
- this.scrolledIndexChange = this.indexChange.pipe(distinctUntilChanged());
5103
- this.$rowHeight = scrollContainer.computedRowHeight;
5104
- this.$headerHeight = scrollContainer.computedHeaderHeight;
5105
- }
5106
- attach(viewport) {
5107
- this.viewport = viewport;
5108
- this.onDataLengthChanged();
5109
- }
5119
+ $headerHeightChange = linkedSignal({
5120
+ source: () => this.$headerHeight(),
5121
+ computation: (curr, previous) => ({ curr, previous: previous == undefined ? curr : previous.source })
5122
+ });
5110
5123
  contentScrolled$ = new Subject();
5111
- sub = subscriber(this.contentScrolled$.pipe(observeOn(animationFrameScheduler), debounceTime(20)), () => {
5124
+ sub = subscriber(this.contentScrolled$.pipe(debounceTime(20), distinctUntilChanged()), offset => {
5112
5125
  this.updateContent('scroll');
5113
5126
  });
5114
5127
  onContentScrolled() {
5115
- this.contentScrolled$.next();
5116
- }
5117
- onDataLengthChanged() {
5118
- }
5119
- setDataLength(length) {
5120
- this.dataLength = length;
5121
- if (this.viewport && this.$rowHeight) {
5122
- this.viewport.setTotalContentSize(this.dataLength * this.$rowHeight());
5123
- // this.updateContent('data ' + dataTrigger);
5124
- }
5125
- this.updateContent('data ');
5126
- }
5127
- detach() { }
5128
- onContentRendered() { }
5129
- onRenderedOffsetChanged() {
5130
- }
5131
- scrollToIndex(index, behavior) {
5128
+ this.contentScrolled$.next(this.viewport().measureScrollOffset());
5132
5129
  }
5130
+ #onDataLengthChange = effect(() => {
5131
+ const dataLengthChange = this.$dataLengthChange();
5132
+ untracked(() => {
5133
+ if (dataLengthChange.curr === dataLengthChange.previous)
5134
+ return;
5135
+ this.updateContent('data length');
5136
+ });
5137
+ });
5133
5138
  #onHeaderChange = effect(() => {
5134
- this.$headerHeight && this.$headerHeight();
5135
- this.updateContent('header height');
5139
+ const headerHeightChange = this.$headerHeightChange();
5140
+ untracked(() => {
5141
+ if (headerHeightChange.curr === headerHeightChange.previous)
5142
+ return;
5143
+ this.updateContent('header height');
5144
+ });
5136
5145
  });
5137
5146
  #onRowChange = effect(() => {
5138
- this.$rowHeight && this.$rowHeight();
5139
- this.updateContent('row height');
5147
+ const rowHeightChange = this.$rowHeightChange();
5148
+ untracked(() => {
5149
+ if (rowHeightChange.curr === rowHeightChange.previous)
5150
+ return;
5151
+ this.updateContent('row height');
5152
+ });
5140
5153
  });
5154
+ $currentRange = signal({ start: 0, end: 0 });
5141
5155
  updateContent(trigger) {
5142
- if (!this.viewport || !this.$rowHeight) {
5156
+ const viewport = this.viewport && this.viewport();
5157
+ if (!viewport || !this.$rowHeight) {
5143
5158
  return;
5144
5159
  }
5145
- const currentContentHeight = +this.viewport._totalContentHeight.replace('px', '');
5146
- const newContentHeight = this.dataLength * this.$rowHeight();
5160
+ const currentContentHeight = +viewport._totalContentHeight.replace('px', '');
5161
+ const newContentHeight = this.$dataLength() * this.$rowHeight();
5147
5162
  if (currentContentHeight !== newContentHeight) {
5148
- this.viewport.setTotalContentSize(newContentHeight);
5149
- setTimeout(() => {
5150
- this.update(trigger);
5151
- }, 0);
5163
+ viewport.setTotalContentSize(newContentHeight);
5164
+ this.update(trigger, viewport, true);
5152
5165
  return;
5153
5166
  }
5154
- this.update(trigger);
5167
+ this.update(trigger, viewport);
5155
5168
  }
5156
- update(trigger) {
5157
- if (!this.viewport || !this.$rowHeight) {
5169
+ update(trigger, viewport, needsScroll = false) {
5170
+ if (!viewport.getViewportSize())
5158
5171
  return;
5159
- }
5160
5172
  const rowHeightChangeEvent = this.$rowHeightChange();
5161
5173
  const rowHeight = rowHeightChangeEvent.curr;
5162
5174
  const rowHeightAdjustment = trigger === 'row height' ? rowHeightChangeEvent.curr / rowHeightChangeEvent.previous : 1;
5163
- const amountOfRows = Math.ceil((this.viewport.getViewportSize() - this.$headerHeight()) / rowHeight);
5164
- const f = this.viewport.measureScrollOffset();
5165
- const offset = this.viewport.measureScrollOffset() * rowHeightAdjustment;
5166
- if (offset !== f) {
5167
- this.viewport.scrollToOffset(offset);
5168
- }
5169
- const buffer = 35;
5175
+ const amountOfRows = Math.ceil((viewport.getViewportSize() - this.$headerHeight()) / rowHeight);
5176
+ const f = viewport.measureScrollOffset();
5177
+ const offset = viewport.measureScrollOffset() * rowHeightAdjustment;
5178
+ const buffer = 35 + Math.round((40 - rowHeight) / 10);
5170
5179
  const skip = Math.round(offset / rowHeight);
5171
5180
  const index = skip % 2 === 0 ? skip : skip - 1;
5172
5181
  const start = Math.max(0, index - buffer);
5173
- const end = Math.min(this.dataLength, index + amountOfRows + buffer);
5174
- this.viewport.setRenderedContentOffset(rowHeight * start);
5175
- this.viewport.setRenderedRange({ start, end });
5182
+ const end = Math.min(this.$dataLength(), index + amountOfRows + buffer);
5183
+ if (start > this.$dataLength()) {
5184
+ this.viewport().scrollToOffset(0);
5185
+ }
5186
+ else if (f !== offset) {
5187
+ if (offset < f)
5188
+ viewport.scrollToOffset(offset);
5189
+ else
5190
+ setTimeout(() => {
5191
+ viewport.scrollToOffset(offset);
5192
+ }, 0);
5193
+ }
5194
+ if (this.$currentRange().start === start && this.$currentRange().end === end) {
5195
+ return;
5196
+ }
5197
+ this.$currentRange.set({ start, end });
5198
+ viewport.setRenderedContentOffset(rowHeight * start);
5199
+ this.dataStore.patchState({ virtualScrollOffset: offset });
5200
+ viewport.setRenderedRange({ start, end });
5176
5201
  this.indexChange.next(index);
5177
5202
  }
5203
+ attach(viewport) { }
5204
+ onDataLengthChanged() { }
5205
+ detach() { }
5206
+ onContentRendered() { }
5207
+ onRenderedOffsetChanged() { }
5208
+ scrollToIndex(index, behavior) { }
5178
5209
  }
5179
5210
 
5180
5211
  class VirtualScrollContainer {
@@ -5192,7 +5223,13 @@ class VirtualScrollContainer {
5192
5223
  viewPort$ = toObservable(this.viewport).pipe(notNull());
5193
5224
  $scrolledIndexChange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.scrolledIndexChange)));
5194
5225
  $renderedRange = toSignal(this.viewPort$.pipe(switchMap$1(v => v.renderedRangeStream)));
5195
- $virtualScrollOptions = computed(() => this.state.$tableSettings().virtualSettings);
5226
+ $virtualScrollOptions = computed(() => {
5227
+ if (this.state.$initializationState() >= InitializationState.Ready)
5228
+ return this.state.$tableSettings().virtualSettings;
5229
+ else
5230
+ return undefined;
5231
+ });
5232
+ $optionsSet = computed(() => !!this.$virtualScrollOptions());
5196
5233
  $dataLength = computed(() => {
5197
5234
  const paginated = this.$usePaginator() && !this.$showAll();
5198
5235
  const pageSize = this.$pageSize();
@@ -5205,58 +5242,40 @@ class VirtualScrollContainer {
5205
5242
  constructor() {
5206
5243
  addEventListener('resize', this.resizeHandler);
5207
5244
  }
5208
- setViewportEffect = effect(() => {
5245
+ #setViewportEffect = effect(() => {
5209
5246
  const viewport = this.viewport();
5247
+ const options = this.$optionsSet();
5210
5248
  untracked(() => {
5211
- if (!!viewport) {
5212
- this.setSize(this.viewport().elementRef);
5249
+ if (!!viewport && !!options) {
5250
+ this.setSize(this.viewport().elementRef, 'initial');
5213
5251
  }
5214
5252
  ;
5215
5253
  });
5216
5254
  });
5217
- subscriber = subscriber();
5218
5255
  #onRenderedRangeEffect = effect(() => {
5219
5256
  const renderedRange = this.$renderedRange();
5257
+ const viewport = this.viewport();
5220
5258
  if (!renderedRange)
5221
5259
  return;
5222
5260
  untracked(() => {
5223
5261
  this.dataStore.patchState({
5224
5262
  virtualEnds: {
5225
5263
  start: renderedRange.start,
5226
- end: renderedRange.end + 25,
5264
+ end: renderedRange.end,
5227
5265
  }
5228
5266
  });
5229
- this.setSize(this.viewport().elementRef);
5230
- });
5231
- });
5232
- #onDataLengthEffect = effect(() => {
5233
- const dataLength = this.$dataLength();
5234
- untracked(() => {
5235
- const renderedRange = this.$renderedRange();
5236
- this.scrollStrategy.setDataLength(dataLength);
5237
- if ((renderedRange?.start || 0) > dataLength) {
5238
- this.viewport().scrollToOffset(0);
5239
- }
5240
- });
5241
- });
5242
- #onOffsetEffect = effect(() => {
5243
- const offset = this.$offset();
5244
- untracked(() => {
5245
- this.dataStore.patchState({ virtualScrollOffset: offset });
5267
+ if (!viewport)
5268
+ return;
5269
+ this.setSize(viewport.elementRef, 'rendered range');
5246
5270
  });
5247
5271
  });
5248
- $offset = computed(() => {
5249
- const viewport = this.viewport();
5250
- const scrolledIndexChange = this.$scrolledIndexChange();
5251
- if (!scrolledIndexChange || !viewport)
5252
- return 0;
5253
- return viewport.getOffsetToRenderedContentStart() ?? 0;
5254
- });
5255
5272
  ngOnDestroy() {
5256
5273
  removeEventListener('resize', this.resizeHandler);
5257
5274
  }
5258
- setSize(el) {
5275
+ setSize(el, trigger) {
5259
5276
  const virtualScrollOptions = this.$virtualScrollOptions();
5277
+ if (!virtualScrollOptions)
5278
+ return;
5260
5279
  if (virtualScrollOptions.dynamicHeight) {
5261
5280
  this.calcDynamic(el);
5262
5281
  return;
@@ -5273,18 +5292,10 @@ class VirtualScrollContainer {
5273
5292
  height = maxViewPortHeightPx;
5274
5293
  this.setHeight(height, el);
5275
5294
  }
5276
- calcDynamic$ = new Subject();
5277
- $calcDynamic = toSignal(this.calcDynamic$.pipe(debounceTime$1(300)));
5278
- #onCalcDynamicEffect = effect(() => {
5279
- const el = this.$calcDynamic();
5280
- if (!el)
5281
- return;
5282
- untracked(() => {
5283
- this.calcDynamic(el);
5284
- });
5285
- });
5286
5295
  calcDynamic(el) {
5287
5296
  const virtualScrollOptions = this.$virtualScrollOptions();
5297
+ if (!virtualScrollOptions)
5298
+ return;
5288
5299
  const t = this.tableContainer.elementRef.nativeElement.querySelector(`#${TableContainerComponent.headerId}`);
5289
5300
  const rect = t?.getBoundingClientRect();
5290
5301
  const windowHeight = window.innerHeight;
@@ -5319,8 +5330,8 @@ class VirtualScrollContainer {
5319
5330
  this.dataStore.patchState({ virtualScrollOffset });
5320
5331
  }
5321
5332
  resizeHandler = () => {
5322
- if (this.viewport() && this.$virtualScrollOptions().dynamicHeight) {
5323
- this.setSize(this.viewport().elementRef);
5333
+ if (this.viewport() && this.$virtualScrollOptions()?.dynamicHeight) {
5334
+ this.setSize(this.viewport().elementRef, 'resize');
5324
5335
  }
5325
5336
  };
5326
5337
  computedRowHeight = computed(() => {
@@ -5344,7 +5355,7 @@ class VirtualScrollContainer {
5344
5355
  return 0;
5345
5356
  return parseTbSizeToPixels(virtualScrollOptions.dynamicalHeightBuffer) || 0;
5346
5357
  });
5347
- scrollStrategy = new TableVirtualScrollStrategy(this);
5358
+ scrollStrategy = new TableVirtualScrollStrategy(this, this.dataStore);
5348
5359
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VirtualScrollContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
5349
5360
  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: `
5350
5361
  <cdk-virtual-scroll-viewport>
@@ -5400,35 +5411,24 @@ class TableContainerComponent {
5400
5411
  parent: this.injector
5401
5412
  });
5402
5413
  $tableBuilder = input.required({ alias: 'tableBuilder' });
5403
- $tableId = input(undefined, { alias: 'tableId' });
5404
- $trackBy = input(undefined, { alias: 'trackBy' });
5405
- $inputFilters = model([], { alias: 'inputFilters' });
5406
- predicateInputFilters$ = toObservable(computed(() => this.$inputFilters().filter(isFunction$1)));
5414
+ $tableIdInput = input(undefined, { alias: 'tableId' });
5415
+ $trackByInput = input(undefined, { alias: 'trackBy' });
5416
+ $inputFilters = input([], { alias: 'inputFilters' });
5407
5417
  $filterInfoInputs = computed(() => this.$inputFilters().filter(i => !isFunction$1(i)));
5408
- $indexColumn = input(false, { alias: 'indexColumn' });
5409
- $selectionColumn = input(false, { alias: 'selectionColumn' });
5410
- $isSticky = input(true, { alias: 'isSticky' });
5411
- $stickyFooter = input(false, { alias: 'stickyFooter' });
5418
+ $indexColumnInput = input(false, { alias: 'indexColumn' });
5419
+ $selectionColumnInput = input(false, { alias: 'selectionColumn' });
5420
+ $stickyHeaderInput = input(true, { alias: 'stickyHeader' });
5421
+ $stickyFooterInput = input(false, { alias: 'stickyFooter' });
5412
5422
  $groupHeaderTemplate = input(undefined, { alias: 'groupHeaderTemplate' });
5413
5423
  $groupHeaderHeight = input(undefined, { alias: 'groupHeaderHeight' });
5414
5424
  $pageSize = input(undefined, { alias: 'pageSize' });
5415
- $props = computed(() => {
5416
- const indexColumn = this.$indexColumn();
5417
- const selectionColumn = this.$selectionColumn();
5418
- const isSticky = this.$isSticky();
5419
- const stickyFooter = this.$stickyFooter();
5420
- const groupHeaderTemplate = this.$groupHeaderTemplate();
5421
- const groupHeaderHeight = this.$groupHeaderHeight();
5422
- return ({ indexColumn, selectionColumn, isSticky, stickyFooter, groupHeaderTemplate, groupHeaderHeight });
5423
- });
5424
5425
  selection$ = output({ alias: 'selection' });
5425
5426
  onStateReset$ = output({ alias: 'onStateReset' });
5426
5427
  onSaveState$ = output({ alias: 'onSaveState' });
5427
- _state$ = toObservable(this.state.$savableState);
5428
- state$ = outputFromObservable(this._state$, { alias: 'state' });
5429
- _data$ = new BehaviorSubject([]);
5430
- data$ = outputFromObservable(this._data$, { alias: 'data' });
5431
- $data = toSignal(this._data$, { initialValue: [] });
5428
+ state$ = outputFromObservable(toObservable(this.state.$savableState), { alias: 'state' });
5429
+ $data = computed(() => this.$sortedAndFilteredData()?.value || []);
5430
+ data$ = outputFromObservable(toObservable(this.$data), { alias: 'data' });
5431
+ $displayData = computed(() => this.$tableBuilder() && this.$filteredSortedAndGrouped()?.displayData);
5432
5432
  clearSelections() {
5433
5433
  this.$genericTable()?.$selection().clear(true);
5434
5434
  }
@@ -5452,14 +5452,44 @@ class TableContainerComponent {
5452
5452
  $useVirtual = this.state.$isVirtual;
5453
5453
  $collapsedFooter = this.state.$footerCollapsed;
5454
5454
  $collapsedHeader = this.state.$headerCollapsed;
5455
- $displayDataLength = computed(() => this.$displayData().length);
5455
+ $displayDataLength = computed(() => this.$displayData()?.length || 0);
5456
+ $tableBuilderSettings = computed(() => this.$tableBuilder().$settings());
5457
+ $trackBy = computed(() => this.$trackByInput() || this.$tableBuilderSettings()?.tableSettings?.trackBy);
5458
+ $tableId = computed(() => this.$tableIdInput() || this.$tableBuilderSettings()?.tableSettings?.tableId);
5459
+ $includeSelectionColumn = computed(() => this.$selectionColumnInput() || !!this.$tableBuilderSettings()?.tableSettings?.includeSelectionColumn);
5460
+ $includeIndexColumn = computed(() => this.$indexColumnInput() || !!this.$tableBuilderSettings()?.tableSettings?.includeIndexColumn);
5461
+ $stickyHeader = computed(() => {
5462
+ const settings = this.$tableBuilderSettings()?.columnHeaderSettings?.stickyHeaderRow;
5463
+ if (settings != null) {
5464
+ return settings;
5465
+ }
5466
+ return this.$stickyHeaderInput();
5467
+ });
5468
+ $stickyFooter = computed(() => this.$stickyFooterInput() || !!this.$tableBuilderSettings()?.columnFooterSettings?.stickyFooterRow);
5469
+ $props = computed(() => {
5470
+ const indexColumn = this.$includeIndexColumn();
5471
+ const selectionColumn = this.$includeSelectionColumn();
5472
+ const stickHeader = this.$stickyHeader();
5473
+ const stickyFooter = this.$stickyFooter();
5474
+ const groupHeaderTemplate = this.$groupHeaderTemplate();
5475
+ const groupHeaderHeight = this.$groupHeaderHeight();
5476
+ return ({ indexColumn, selectionColumn, isSticky: stickHeader, stickyFooter, groupHeaderTemplate, groupHeaderHeight });
5477
+ });
5478
+ #initTableBuilderIfNeeded = effect(() => {
5479
+ const tb = this.$tableBuilder();
5480
+ untracked(() => {
5481
+ if (tb)
5482
+ this.$tableBuilder()?.prep(this.injector);
5483
+ });
5484
+ });
5456
5485
  #initializeTableSettingsFromTableBuilderAndPersistedStateEffect = effect(() => {
5457
5486
  const metaLoaded = this.$isInitializationState(InitializationState.MetaDataLoaded)();
5458
5487
  if (!metaLoaded)
5459
5488
  return;
5460
5489
  const persistedState = this.$persistedState();
5490
+ const tbSettings = this.$tableBuilderSettings();
5461
5491
  untracked(() => {
5462
- this.state.setTableSettings(this.$tableBuilder().settings$);
5492
+ this.state.setTableSettings(tbSettings);
5463
5493
  if (persistedState) {
5464
5494
  persistedState.persistedTableSettings = new PersistedTableSettings(persistedState.persistedTableSettings);
5465
5495
  this.state.updateStateFromPersistedState(persistedState);
@@ -5524,14 +5554,32 @@ class TableContainerComponent {
5524
5554
  this.state.setLinkMaps(createLinkCreatorDict(allMetaDatas));
5525
5555
  });
5526
5556
  });
5527
- #initializeDataEffect = effect(() => {
5557
+ #setFilteredDataLengthEffect = effect(() => {
5558
+ const tableBuilder = this.$tableBuilder();
5559
+ const data = this.$sortedAndFilteredData();
5560
+ if (!tableBuilder || !data)
5561
+ return;
5562
+ untracked(() => {
5563
+ this.dataStore.patchState({ sortedFilteredDataLength: data.value.length });
5564
+ });
5565
+ });
5566
+ #setDataSourceDataEffect = effect(() => {
5528
5567
  const tableBuilder = this.$tableBuilder();
5529
- if (!tableBuilder)
5568
+ const flat = this.$filteredSortedAndGrouped();
5569
+ if (!tableBuilder || !flat)
5530
5570
  return;
5531
5571
  untracked(() => {
5532
- this.initializeData();
5572
+ const data = flat.displayData;
5573
+ this.dataSource.setData(data);
5574
+ this.dataStore.patchState({ sortedFilteredGroupedDataLength: data.length });
5533
5575
  });
5534
5576
  });
5577
+ #destroyRef = inject(DestroyRef).onDestroy(() => {
5578
+ const tableId = this.$tableId();
5579
+ if (tableId) {
5580
+ this.stateService.saveTableStateToLocal({ tableId, tableState: this.state.$savableState() });
5581
+ }
5582
+ });
5535
5583
  $persistedState = computed(() => {
5536
5584
  const tableId = this.$tableId();
5537
5585
  if (tableId) {
@@ -5545,12 +5593,7 @@ class TableContainerComponent {
5545
5593
  }
5546
5594
  return [...this.$filterDirectives(), ...this.$customFilterDirectives()];
5547
5595
  });
5548
- allNotSavableFilterDirectivesFilters$ = toObservable(this.$allFilterDirectives).pipe(filterArray(d => !d.savable), switchMap(d => {
5549
- const a = d.map(d => d.filter$);
5550
- return combineLatest(a).pipe(startWith([]));
5551
- }), map(createFilterFuncs));
5552
- tableBuilderMetaData$ = toObservable(this.$tableBuilder).pipe(notNull(), switchMap(tb => tb.metaData$));
5553
- $tableBuilderMetaData = toSignal(this.tableBuilderMetaData$);
5596
+ $tableBuilderMetaData = computed(() => this.$tableBuilder()?.$metaData());
5554
5597
  $allMetaDatas = computed(() => {
5555
5598
  const tableBuilderMetaData = this.$tableBuilderMetaData();
5556
5599
  if (!tableBuilderMetaData)
@@ -5559,47 +5602,118 @@ class TableContainerComponent {
5559
5602
  const mappedCustomCellMetaDatas = customCellMetaDatas.map(md => mergeCustomCellMetaData(md, tableBuilderMetaData.find(item => item.key === md.key)));
5560
5603
  return [...tableBuilderMetaData, ...mappedCustomCellMetaDatas];
5561
5604
  });
5562
- $displayData = signal([]);
5563
- ngOnDestroy() {
5564
- const tableId = this.$tableId();
5565
- if (tableId) {
5566
- this.stateService.saveTableStateToLocal({ tableId, tableState: this.state.$savableState() });
5605
+ $preds = computed(() => {
5606
+ const predicateInputFilters = this.$inputFilters().filter(isFunction$1);
5607
+ const notSavableFilterDirectives = this.$allFilterDirectives()
5608
+ .filter(d => !d.savable)
5609
+ .map(d => d.$filter())
5610
+ .filter(d => !!d && needsFilterCreation(d))
5611
+ .map(d => createFilterFunc(d));
5612
+ return [...predicateInputFilters, ...notSavableFilterDirectives];
5613
+ });
5614
+ $predicateFiltersState = linkedSignal({
5615
+ source: this.$preds,
5616
+ computation: (curr, previous) => {
5617
+ if (!previous?.value)
5618
+ return ({ value: updateFilterPredicateState({ allFilters: [] }, curr), timestamp: new Date().getTime() });
5619
+ return ({ value: updateFilterPredicateState(previous.value.value, curr), timestamp: new Date().getTime() });
5567
5620
  }
5568
- }
5569
- initializeData() {
5570
- const predicateFilters$ = combineLatest([this.predicateInputFilters$.pipe(), this.allNotSavableFilterDirectivesFilters$])
5571
- .pipe(map(([a, b]) => [...a, ...b]));
5572
- const filters$ = combineLatest([
5573
- this.state.filters$.pipe(scan$1(updateFilterInfoState, { allFilters: {} }), timestamp$1()),
5574
- predicateFilters$.pipe(scan$1(updateFilterPredicateState, { allFilters: [] }), timestamp$1())
5575
- ])
5576
- .pipe(map(([filterInfo, pred]) => updateFilterState(filterInfo, pred)));
5577
- const sortsState$ = this.state.sort$.pipe(scan$1(updateSortState, initialSortState));
5578
- const sortedAndFilteredData$ = sortAndFilterData(this.$tableBuilder().getData$(), sortsState$, filters$);
5579
- 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());
5580
- this.state.on(sortedAndFilteredData$, (data) => {
5581
- this._data$.next(data);
5582
- this.dataStore.patchState({ sortedFilteredDataLength: data.length });
5621
+ });
5622
+ $savableFiltersState = linkedSignal({
5623
+ source: this.state.$filters,
5624
+ computation: (curr, previous) => {
5625
+ if (!previous?.value)
5626
+ return ({ value: updateFilterInfoState({ allFilters: {} }, curr), timestamp: new Date().getTime() });
5627
+ return ({ value: updateFilterInfoState(previous.value.value, curr), timestamp: new Date().getTime() });
5628
+ }
5629
+ });
5630
+ $allFilterStatesTimeStamped = computed(() => {
5631
+ if (!this.$isInitializationState(InitializationState.Ready)())
5632
+ return undefined;
5633
+ return ({ value: updateFilterState(this.$savableFiltersState(), this.$predicateFiltersState()), timestamp: new Date().getTime() });
5634
+ });
5635
+ $sortStateTimeStamped = linkedSignal({
5636
+ source: computed(() => this.$isInitializationState(InitializationState.Ready)() && this.state.$getSorts()),
5637
+ computation: (curr, prev) => {
5638
+ if (!curr)
5639
+ return undefined;
5640
+ if (!prev?.value)
5641
+ return ({ value: updateSortState(initialSortState, curr), timestamp: new Date().getTime() });
5642
+ return ({ value: updateSortState(prev.value.value, curr), timestamp: new Date().getTime() });
5643
+ }
5644
+ });
5645
+ $allData = computed(() => this.$tableBuilder()?.$data() || []);
5646
+ $allDataTimeStamped = computed(() => {
5647
+ const data = this.$allData();
5648
+ if (!data)
5649
+ return undefined;
5650
+ return ({
5651
+ value: data,
5652
+ timestamp: new Date().getTime()
5583
5653
  });
5584
- this.state.on(flatGrouped$, (data) => {
5585
- this.dataSource.setData(data);
5586
- this.$displayData.set(data);
5587
- this.dataStore.patchState({ sortedFilteredGroupedDataLength: data.length });
5654
+ });
5655
+ $allTimeStamped = computed(() => {
5656
+ const data = this.$allDataTimeStamped();
5657
+ const sort = this.$sortStateTimeStamped();
5658
+ const filter = this.$allFilterStatesTimeStamped();
5659
+ if (!data?.value || !sort?.value || !filter?.value)
5660
+ return undefined;
5661
+ return ({
5662
+ data,
5663
+ sort,
5664
+ filter
5588
5665
  });
5589
- }
5666
+ });
5667
+ $sortedAndFilteredData = linkedSignal({
5668
+ source: this.$allTimeStamped,
5669
+ computation: (values, prev) => {
5670
+ const init = this.$isInitializationState(InitializationState.Ready);
5671
+ if (!values || !init)
5672
+ return undefined;
5673
+ const { data, filter, sort } = values;
5674
+ const val = prev?.value?.value || data.value;
5675
+ const filteredData = sortAndFilterData(data, filter, sort, !prev?.value, val);
5676
+ return ({ value: filteredData, timestamp: new Date().getTime() });
5677
+ }
5678
+ });
5679
+ $timestampedGroups = computed(() => ({ value: this.state.$groupByKeys(), timestamp: new Date().getTime() }));
5680
+ $timestampedExpanded = computed(() => ({ value: this.state.$expandGroups(), timestamp: new Date().getTime() }));
5681
+ $dataAndGroupsTimestamped = computed(() => {
5682
+ const data = this.$sortedAndFilteredData();
5683
+ const groups = this.$timestampedGroups();
5684
+ const expanded = this.$timestampedExpanded();
5685
+ if (!data)
5686
+ return undefined;
5687
+ return ({
5688
+ data,
5689
+ groups,
5690
+ expanded
5691
+ });
5692
+ });
5693
+ $filteredSortedAndGrouped = linkedSignal({
5694
+ source: this.$dataAndGroupsTimestamped,
5695
+ computation: (curr, prev) => {
5696
+ if (!curr)
5697
+ return undefined;
5698
+ const val = prev?.value?.groupedData || [];
5699
+ return updateGroupByState(val, curr, !prev?.value);
5700
+ }
5701
+ });
5590
5702
  $isInitializationState = (state) => computed(() => this.state.selectSignal(s => s.initializationState >= state)());
5591
5703
  static headerId = 'tb-header-wrapper';
5592
5704
  headerId = TableContainerComponent.headerId;
5593
5705
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5594
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $tableId: { classPropertyName: "$tableId", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumn: { classPropertyName: "$indexColumn", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumn: { classPropertyName: "$selectionColumn", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $isSticky: { classPropertyName: "$isSticky", publicName: "isSticky", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooter: { classPropertyName: "$stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderTemplate: { classPropertyName: "$groupHeaderTemplate", publicName: "groupHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderHeight: { classPropertyName: "$groupHeaderHeight", publicName: "groupHeaderHeight", isSignal: true, isRequired: false, transformFunction: null }, $pageSize: { classPropertyName: "$pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { $inputFilters: "inputFiltersChange", selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }, { propertyName: "$menu", first: true, predicate: MatMenu, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"l.menu()\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n\r\n <lib-table-header-menu #l/>\r\n\r\n }\r\n @else {\r\n <mat-icon color=\"primary\" [matMenuTriggerFor]=\"mainMenu\" class=\"flat-menu-button pointer\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"flex-column\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayDataLength", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "component", type: ProfilesMenuComponent, selector: "tb-profiles-menu", inputs: ["tableId", "isMatMenuChild"] }, { kind: "component", type: TableHeaderMenuComponent, selector: "lib-table-header-menu" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: VirtualScrollContainer, selector: "tb-virtual-scroll-container" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5706
+ 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 }, $tableIdInput: { classPropertyName: "$tableIdInput", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackByInput: { classPropertyName: "$trackByInput", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumnInput: { classPropertyName: "$indexColumnInput", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumnInput: { classPropertyName: "$selectionColumnInput", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $stickyHeaderInput: { classPropertyName: "$stickyHeaderInput", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooterInput: { classPropertyName: "$stickyFooterInput", 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: { selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }, { propertyName: "$menu", first: true, predicate: MatMenu, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed)\r\n {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n </div>\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"l.menu()\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n\r\n <lib-table-header-menu #l/>\r\n\r\n }\r\n @else {\r\n <mat-icon color=\"primary\" [matMenuTriggerFor]=\"mainMenu\" class=\"flat-menu-button pointer\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"flex-column\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-left:auto}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayDataLength", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "component", type: ProfilesMenuComponent, selector: "tb-profiles-menu", inputs: ["tableId", "isMatMenuChild"] }, { kind: "component", type: TableHeaderMenuComponent, selector: "lib-table-header-menu" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: VirtualScrollContainer, selector: "tb-virtual-scroll-container" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5595
5707
  }
5596
5708
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableContainerComponent, decorators: [{
5597
5709
  type: Component,
5598
- args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], imports: [NgTemplateOutlet,
5710
+ args: [{ selector: 'tb-table-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], imports: [
5711
+ NgTemplateOutlet,
5599
5712
  PaginatorComponent,
5600
5713
  MultiSortDirective, GroupByListComponent, FilterChipsComponent, GenFilterDisplayerComponent, GenColDisplayerComponent,
5601
5714
  SortMenuComponent, GenericTableComponent, ProfilesMenuComponent, TableHeaderMenuComponent,
5602
- MatButtonModule, MatMenuModule, MatIconModule, MatTooltipModule, VirtualScrollContainer], template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed) {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n </div>\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"l.menu()\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n\r\n <lib-table-header-menu #l/>\r\n\r\n }\r\n @else {\r\n <mat-icon color=\"primary\" [matMenuTriggerFor]=\"mainMenu\" class=\"flat-menu-button pointer\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"flex-column\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"] }]
5715
+ MatButtonModule, MatMenuModule, MatIconModule, MatTooltipModule, VirtualScrollContainer
5716
+ ], 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 {\r\n <ng-content select=\".tb-header-title\"/>\r\n }\r\n </div>\r\n @if(state.$groupByKeys().length){\r\n <group-by-list />\r\n }\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader) {\r\n @if (!$collapsedHeader()) {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"l.menu()\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n\r\n <lib-table-header-menu #l/>\r\n\r\n }\r\n @else {\r\n <mat-icon color=\"primary\" [matMenuTriggerFor]=\"mainMenu\" class=\"flat-menu-button pointer\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"flex-column\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\" class=\"collapse-icon header\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n (selection)='selection$.emit($event)' [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\" class=\"collapse-icon footer\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n\r\n <ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n </ng-template>\r\n\r\n</ng-container>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-left:auto}.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"] }]
5603
5717
  }] });
5604
5718
 
5605
5719
  class TableBuilderModule {
@@ -5612,102 +5726,38 @@ class TableBuilderModule {
5612
5726
  };
5613
5727
  }
5614
5728
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5615
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, imports: [CommonModule,
5616
- MatDialogModule,
5617
- MatNativeDateModule,
5618
- RouterModule,
5619
- TableContainerComponent,
5620
- GenericTableComponent,
5621
- TableContainerComponent,
5729
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, imports: [TableContainerComponent,
5622
5730
  CustomCellDirective,
5623
- FilterComponent,
5624
- MatSlideToggleTbFilterDirective,
5625
- MatRadioButtonTbFilterDirective,
5626
- MatOptionTbFilterDirective,
5627
- MatCheckboxTbFilterDirective,
5628
- MatButtonToggleFilterDirective,
5629
5731
  TableFilterDirective,
5630
5732
  TableFilterStringContainsDirective,
5631
- TableWrapperDirective,
5632
- ResizeColumnDirective,
5633
- UtilitiesModule], exports: [GenericTableComponent,
5634
- TableContainerComponent,
5733
+ TableWrapperDirective], exports: [TableContainerComponent,
5635
5734
  CustomCellDirective,
5636
- FilterComponent,
5637
- MatSlideToggleTbFilterDirective,
5638
- MatRadioButtonTbFilterDirective,
5639
- MatOptionTbFilterDirective,
5640
- MatCheckboxTbFilterDirective,
5641
- MatButtonToggleFilterDirective,
5642
- TableFilterDirective,
5643
5735
  TableFilterStringContainsDirective,
5644
5736
  TableWrapperDirective,
5645
- ResizeColumnDirective,
5646
5737
  UtilitiesModule] });
5647
5738
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, providers: [
5648
- SpaceCasePipe,
5649
- DatePipe,
5650
- CurrencyPipe,
5651
- PhoneNumberPipe,
5652
5739
  MultiSortDirective,
5653
- TableBuilderStateStore,
5654
- ], imports: [CommonModule,
5655
- MatDialogModule,
5656
- MatNativeDateModule,
5657
- RouterModule,
5658
- TableContainerComponent,
5659
- GenericTableComponent,
5660
- TableContainerComponent,
5661
- FilterComponent,
5662
- UtilitiesModule, UtilitiesModule] });
5740
+ ], imports: [TableContainerComponent, UtilitiesModule] });
5663
5741
  }
5664
5742
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: TableBuilderModule, decorators: [{
5665
5743
  type: NgModule,
5666
5744
  args: [{
5667
5745
  imports: [
5668
- CommonModule,
5669
- MatDialogModule,
5670
- MatNativeDateModule,
5671
- RouterModule,
5672
- TableContainerComponent,
5673
- GenericTableComponent,
5674
5746
  TableContainerComponent,
5675
5747
  CustomCellDirective,
5676
- FilterComponent,
5677
- MatSlideToggleTbFilterDirective,
5678
- MatRadioButtonTbFilterDirective,
5679
- MatOptionTbFilterDirective,
5680
- MatCheckboxTbFilterDirective,
5681
- MatButtonToggleFilterDirective,
5682
5748
  TableFilterDirective,
5683
5749
  TableFilterStringContainsDirective,
5684
5750
  TableWrapperDirective,
5685
- ResizeColumnDirective,
5686
- UtilitiesModule,
5687
5751
  ],
5688
5752
  exports: [
5689
- GenericTableComponent,
5690
5753
  TableContainerComponent,
5691
5754
  CustomCellDirective,
5692
- FilterComponent,
5693
- MatSlideToggleTbFilterDirective,
5694
- MatRadioButtonTbFilterDirective,
5695
- MatOptionTbFilterDirective,
5696
- MatCheckboxTbFilterDirective,
5697
- MatButtonToggleFilterDirective,
5698
- TableFilterDirective,
5699
5755
  TableFilterStringContainsDirective,
5700
5756
  TableWrapperDirective,
5701
- ResizeColumnDirective,
5702
5757
  UtilitiesModule,
5703
5758
  ],
5704
5759
  providers: [
5705
- SpaceCasePipe,
5706
- DatePipe,
5707
- CurrencyPipe,
5708
- PhoneNumberPipe,
5709
5760
  MultiSortDirective,
5710
- TableBuilderStateStore,
5711
5761
  ]
5712
5762
  }]
5713
5763
  }] });
@@ -5735,66 +5785,86 @@ class MatTableObservableDataSource extends MatTableDataSource {
5735
5785
  }
5736
5786
 
5737
5787
  class TableBuilder {
5738
- metaData$;
5739
- data$;
5740
- settings$;
5788
+ data;
5789
+ metaData;
5790
+ settings;
5791
+ #$metaData;
5792
+ #$data;
5793
+ #$settings;
5794
+ $metaData = computed(() => this.$initialized() ? this.#$metaData() : undefined);
5795
+ $settings = computed(() => this.$initialized() ? this.#$settings() : undefined);
5796
+ metaNeedsPrep = false;
5797
+ dataIsObservable = false;
5798
+ settingsIsObservable = false;
5799
+ $initialized = signal(false);
5741
5800
  constructor(data, metaData, settings = new GeneralTableSettings()) {
5742
- this.settings$ = this.coerceSettingsToObservable(settings)
5743
- .pipe(defaultShareReplay());
5744
- this.data$ = this.coerceToObservable(data, this.settings$)
5745
- .pipe(notNull(), defaultShareReplay());
5746
- this.metaData$ = metaData ?
5747
- this.coerceToObservable(metaData, this.settings$).pipe(defaultShareReplay())
5748
- :
5749
- this.data$.pipe(first$1(), map(d => this.createMetaData(d[0])), defaultShareReplay());
5750
- }
5751
- getData$() {
5752
- return this.metaData$.pipe(map(md => createDataCleaners(md)), switchMap(cleaner => this.data$.pipe(map((datas, ii) => {
5753
- return datas.map((data, i) => {
5754
- const cleaned = cleaner(data);
5755
- cleaned[initIndexSymbol] = i * ((ii % 2) + 1);
5756
- return cleaned;
5757
- });
5758
- }))), defaultShareReplay());
5759
- }
5760
- createMetaData(obj) {
5761
- return Object.keys(obj ?? {})
5762
- .map(key => ({
5763
- key,
5764
- fieldType: FieldType.Unknown,
5765
- order: -1
5766
- }));
5767
- }
5768
- coerceToObservable(arg, settings) {
5769
- if (isObservable(arg)) {
5770
- return arg;
5801
+ this.data = data;
5802
+ this.metaData = metaData;
5803
+ this.settings = settings;
5804
+ if (isObservable(data)) {
5805
+ this.dataIsObservable = true;
5771
5806
  }
5772
- else if (isSignal(arg)) {
5773
- return settings.pipe(switchMap(s => {
5774
- this.assertInjector(s);
5775
- return toObservable(arg, { injector: s.injector });
5776
- }));
5807
+ else {
5808
+ this.#$data = isSignal(data) ? data : signal(data);
5809
+ }
5810
+ if (isObservable(metaData) || !metaData) {
5811
+ this.metaNeedsPrep = true;
5777
5812
  }
5778
5813
  else {
5779
- return of(arg);
5814
+ this.#$metaData = isSignal(metaData) ? metaData : signal(metaData);
5780
5815
  }
5781
- }
5782
- coerceSettingsToObservable(settings) {
5783
5816
  if (isObservable(settings)) {
5784
- return settings;
5785
- }
5786
- else if (isSignal(settings)) {
5787
- this.assertInjector(settings());
5788
- return toObservable(settings, { injector: settings().injector });
5817
+ this.settingsIsObservable = true;
5789
5818
  }
5790
5819
  else {
5791
- return of(settings);
5820
+ this.#$settings = isSignal(settings) ? settings : signal(settings);
5821
+ }
5822
+ if (!this.dataIsObservable && !this.settingsIsObservable && !this.metaNeedsPrep) {
5823
+ this.$initialized.set(true);
5792
5824
  }
5793
5825
  }
5794
- assertInjector(s) {
5795
- if (!s.injector) {
5796
- throw new Error('Injector must be provided when passing a signal to table builder');
5826
+ prep(injector) {
5827
+ if (this.settingsIsObservable) {
5828
+ this.#$settings = toSignal(this.settings, { injector, requireSync: true });
5829
+ }
5830
+ if (this.dataIsObservable) {
5831
+ this.#$data = toSignal(this.data, { injector, initialValue: [] });
5797
5832
  }
5833
+ if (this.metaNeedsPrep) {
5834
+ if (this.metaData) {
5835
+ this.#$metaData = toSignal(this.metaData, { injector, initialValue: [] });
5836
+ }
5837
+ else {
5838
+ this.#$metaData = computed(() => this.createMetaData(this.#$data()[0]));
5839
+ }
5840
+ }
5841
+ this.$initialized.set(true);
5842
+ }
5843
+ #dataCleaners = computed(() => {
5844
+ const metaData = this.$metaData();
5845
+ if (!metaData)
5846
+ return undefined;
5847
+ return createDataCleaners(metaData);
5848
+ });
5849
+ $data = computed(() => {
5850
+ const data = this.#$data();
5851
+ const cleaners = this.#dataCleaners();
5852
+ if (!data || !cleaners)
5853
+ return [];
5854
+ const cleanedData = data.map((data, i) => {
5855
+ const cleaned = cleaners(data);
5856
+ cleaned[initIndexSymbol] = i;
5857
+ return cleaned;
5858
+ });
5859
+ return cleanedData;
5860
+ });
5861
+ createMetaData(obj) {
5862
+ return Object.keys(obj ?? {})
5863
+ .map(key => ({
5864
+ key,
5865
+ fieldType: FieldType.Unknown,
5866
+ order: -1
5867
+ }));
5798
5868
  }
5799
5869
  }
5800
5870
  const CreateTableBuilder = (reportDef$) => {
@@ -6020,5 +6090,5 @@ function setUpStoreFactoryOld(store, env) {
6020
6090
  * Generated bundle index. Do not edit.
6021
6091
  */
6022
6092
 
6023
- export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, parseTbSizeToPixels, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, setUpStoreFactoryOld, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
6093
+ export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnFooterSettings, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, parseTbSizeToPixels, phoneFormatter, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, setUpStoreFactoryOld, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
6024
6094
  //# sourceMappingURL=one-paragon-angular-utilities.mjs.map