@one-paragon/angular-utilities 2.1.6 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3954,7 +3954,8 @@ const tbGroupBy = (data, groupByKeys, level = 1, parentGroupName) => {
3954
3954
  return groupedDataArr;
3955
3955
  };
3956
3956
  function groupData(groupByKey, groupData, level = 1, parentGroupName) {
3957
- const groupedDataDict = supportsGroupBy ? Object.groupBy(groupData, d => d[groupByKey]) : groupBy(groupData, groupByKey);
3957
+ const getter = getFactory(groupByKey);
3958
+ const groupedDataDict = supportsGroupBy ? Object.groupBy(groupData, d => getter(d) ?? 'BLANK') : groupBy(groupData, groupByKey);
3958
3959
  const groupedDataArr = Object.entries(groupedDataDict).map(([name, groupData]) => {
3959
3960
  const uniqueName = parentGroupName ? `${parentGroupName}-${name}` : `${name}`;
3960
3961
  return {
@@ -4270,7 +4271,7 @@ class GenericTableComponent {
4270
4271
  if (val == undefined || val === 'null')
4271
4272
  return '';
4272
4273
  try {
4273
- return createTransformer(this.state.$getMetaData(key)(), this.config, true, true)({ [`${key}`]: val });
4274
+ return createTransformer(this.state.$getMetaData(key)(), this.config, true, true)({ [`${key}`]: val }) || val;
4274
4275
  }
4275
4276
  catch (error) {
4276
4277
  return signal(val);
@@ -4786,20 +4787,20 @@ const _sortAndFilterData = (data, sortState, filterState) => combineLatest([
4786
4787
  ]).pipe(scan((mappedData, [data, sort, f], index) => {
4787
4788
  return mapDataSortsAndFilters(data, f, sort, index === 0, mappedData);
4788
4789
  }, [])).pipe(map$1((resultData) => resultData.filter(item => !item[tbNoShowSymbol])), defaultShareReplay());
4789
- const mapDataSortsAndFilters = (allData, filters, sort, firstRun, filteredData) => {
4790
+ const mapDataSortsAndFilters = (allData, filters, sort, firstRun, filteredAndSortedData) => {
4790
4791
  const fresh = firstRun || (allData.timestamp > sort.timestamp && allData.timestamp > filters.timestamp);
4791
4792
  const sortChanged = !fresh && sort.timestamp > filters.timestamp;
4792
4793
  const filterRemoved = !fresh && !sortChanged && !filters.value.onlyAddedFilters;
4793
4794
  const runAllOnAllData = fresh || filterRemoved;
4794
4795
  const resetFilters = !fresh && filterRemoved;
4795
4796
  if (runAllOnAllData) {
4796
- const filteredData = filterData(sortData(allData.value, sort.value.sortsToRun), filters.value.allFilters, resetFilters);
4797
+ const filteredData = filterData(sortData(allData.value, sort.value.allSorts), filters.value.allFilters, resetFilters);
4797
4798
  return filteredData;
4798
4799
  }
4799
4800
  if (sortChanged) {
4800
- return (sortData(filteredData, sort.value.sortsToRun));
4801
+ return (sortData(filteredAndSortedData, sort.value.sortsToRun));
4801
4802
  }
4802
- return (filterData(filteredData, filters.value.onlyAddedFilters || filters.value.allFilters, resetFilters));
4803
+ return (filterData(filteredAndSortedData, filters.value.onlyAddedFilters || filters.value.allFilters, resetFilters));
4803
4804
  };
4804
4805
  const sortAndFilterData = (data, filters, sort, firstRun, resultData) => {
4805
4806
  const markedAndSortedData = mapDataSortsAndFilters(data, filters, sort, firstRun, resultData);
@@ -5053,14 +5054,21 @@ function mergeCustomCellMetaData(metaData1, metaData2) {
5053
5054
 
5054
5055
  class GroupByListComponent {
5055
5056
  tableStore = inject(TableStore);
5057
+ $groups = computed(() => {
5058
+ const dict = this.tableStore.$metaData();
5059
+ return this.tableStore.$groupByKeys().map(gbk => ({
5060
+ key: gbk,
5061
+ name: dict[gbk].displayName || gbk
5062
+ }));
5063
+ });
5056
5064
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: GroupByListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5057
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", 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 });
5065
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", 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 (groupBy of $groups(); track groupBy.key)\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(groupBy.key)\">\r\n {{groupBy.name | 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 });
5058
5066
  }
5059
5067
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: GroupByListComponent, decorators: [{
5060
5068
  type: Component,
5061
5069
  args: [{ selector: 'group-by-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
5062
5070
  MatChipsModule, MatIconModule, SpaceCasePipe
5063
- ], 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"] }]
5071
+ ], template: "<span class=\"tb-group-label\">Group By:</span>\r\n<mat-chip-set>\r\n @for (groupBy of $groups(); track groupBy.key)\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(groupBy.key)\">\r\n {{groupBy.name | 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"] }]
5064
5072
  }] });
5065
5073
 
5066
5074
  class ProfilesMenuComponent {