@annalib/anna-core 5.1.4 → 5.1.6

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.
@@ -1005,6 +1005,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
1005
1005
  type: Output
1006
1006
  }] } });
1007
1007
 
1008
+ var SortTypeEnum;
1009
+ (function (SortTypeEnum) {
1010
+ SortTypeEnum["DEFAULT"] = "DEFAULT";
1011
+ SortTypeEnum["ASC"] = "ASC";
1012
+ SortTypeEnum["DESC"] = "DESC";
1013
+ })(SortTypeEnum || (SortTypeEnum = {}));
1014
+
1008
1015
  class TooltipModel {
1009
1016
  constructor(obj, id) {
1010
1017
  this.label = obj ? obj.toString() : null;
@@ -1303,11 +1310,12 @@ class AnnaFilterService {
1303
1310
  }
1304
1311
  isTooltipActive(header, sortMap) {
1305
1312
  let set = new Set(this.appliedFiltersArray);
1313
+ let isSortMapForHeader0Active = sortMap.get(header[0]) != SortTypeEnum.DEFAULT;
1314
+ let isSortMapForHeader1Active = sortMap.get(header[1]) != SortTypeEnum.DEFAULT;
1306
1315
  if (header.length == 1) {
1307
- return ((sortMap.size > 0 && sortMap.get(header[0]) != "DEFAULT") || set.has(header[0]));
1316
+ return ((sortMap.size > 0 && isSortMapForHeader0Active) || set.has(header[0]));
1308
1317
  }
1309
- // return ( (sortMap.size > 0 && sortMap.get(header[0]) != "DEFAULT") || (sortMap.size > 0 && sortMap.get(header[1]) != "DEFAULT") || set.has(header[0]) || set.has(header[1]));
1310
- return ((sortMap.size > 0 && sortMap.has(header[0]) && sortMap.get(header[0]) != "DEFAULT") || (sortMap.size > 0 && sortMap.has(header[1]) && sortMap.get(header[1]) != "DEFAULT") || set.has(header[0]) || set.has(header[1]));
1318
+ return ((sortMap.size > 0 && sortMap.has(header[0]) && isSortMapForHeader0Active) || (sortMap.size > 0 && sortMap.has(header[1]) && isSortMapForHeader1Active) || set.has(header[0]) || set.has(header[1]));
1311
1319
  }
1312
1320
  clearColumnFilter() {
1313
1321
  if (this.tooltipSelectedMap.has(this.selectedRadio)) {
@@ -1317,7 +1325,7 @@ class AnnaFilterService {
1317
1325
  this.appliedFiltersArray = [...appliedFilterSet];
1318
1326
  }
1319
1327
  if (this.annaSortService.columnSortState.has(this.selectedRadio)) {
1320
- this.annaSortService.columnSortState.set(this.selectedRadio, "DEFAULT");
1328
+ this.annaSortService.columnSortState.delete(this.selectedRadio);
1321
1329
  }
1322
1330
  }
1323
1331
  setOptionValues(minValue, maxValue) {
@@ -1638,17 +1646,17 @@ class AnnaSortComponent {
1638
1646
  this.sortOptionClicked = new EventEmitter();
1639
1647
  this.sortOptions = [
1640
1648
  {
1641
- sortType: 'ASC',
1649
+ sortType: SortTypeEnum.ASC,
1642
1650
  isOptionActive: false,
1643
1651
  text: 'A to Z',
1644
1652
  },
1645
1653
  {
1646
- sortType: 'DESC',
1654
+ sortType: SortTypeEnum.DESC,
1647
1655
  isOptionActive: false,
1648
1656
  text: 'Z to A',
1649
1657
  },
1650
1658
  {
1651
- sortType: 'DEFAULT',
1659
+ sortType: SortTypeEnum.DEFAULT,
1652
1660
  isOptionActive: false,
1653
1661
  text: 'DEFAULT',
1654
1662
  },
@@ -1676,6 +1684,7 @@ class AnnaSortComponent {
1676
1684
  });
1677
1685
  }
1678
1686
  setSortType(option) {
1687
+ option = option ? option : SortTypeEnum.DEFAULT;
1679
1688
  this.sortOptions.forEach(item => item.isOptionActive = false);
1680
1689
  let index = this.sortOptions.findIndex(item => item.sortType == option);
1681
1690
  this.sortOptions[index].isOptionActive = true;
@@ -1782,7 +1791,7 @@ class AnnaNonEditableGenericTableComponent {
1782
1791
  if (changes['tableHeaders'] && !isEqual(changes['tableHeaders'].currentValue, changes['tableHeaders'].previousValue)) {
1783
1792
  this.tableColumns = this.tableHeaders.filter(x => x.visible).map(x => x.headerInfo[0].objectKey);
1784
1793
  this.annaSortService.columnSortState = new Map();
1785
- this.setColumnSortStateMap();
1794
+ // this.setColumnSortStateMap();
1786
1795
  this.setActiveStateObject();
1787
1796
  }
1788
1797
  if (changes['totalRowInfo'] && changes['totalRowInfo'].currentValue) {
@@ -2112,7 +2121,8 @@ class AnnaNonEditableGenericTableComponent {
2112
2121
  }
2113
2122
  disableActiveFilterClearButton() {
2114
2123
  let selectedFilterSet = new Set(this.annaFilterService.appliedFiltersArray);
2115
- let isSortPresent = (this.annaSortService.columnSortState.size > 0 && this.annaSortService.columnSortState.get(this.annaFilterService.selectedRadio) != "DEFAULT");
2124
+ let currentColumnSortFilter = this.getColumnSortStateForSelectedRadio();
2125
+ let isSortPresent = (this.annaSortService.columnSortState.size > 0 && currentColumnSortFilter != SortTypeEnum.DEFAULT);
2116
2126
  this.disableColumnClearAllBtn = selectedFilterSet.has(this.annaFilterService.selectedRadio) || isSortPresent ? false : true;
2117
2127
  }
2118
2128
  getSliderData(header) {
@@ -2584,7 +2594,7 @@ class AnnaNonEditableGenericTableComponent {
2584
2594
  this.applySortingOnFilteredData();
2585
2595
  this.emitData();
2586
2596
  this.setInitialRowsForTable();
2587
- this.annaFilterService.updateStateOfTheCurrentFilterTab(this.annaSortService.columnSortState);
2597
+ this.annaFilterService.updateStateOfAllTheKeys(this.annaSortService.columnSortState);
2588
2598
  this.closeTooltip();
2589
2599
  }
2590
2600
  applySliderFilterOnData() {
@@ -2616,9 +2626,7 @@ class AnnaNonEditableGenericTableComponent {
2616
2626
  this.closeTooltip();
2617
2627
  }
2618
2628
  updateSortMap() {
2619
- for (let [key, value] of this.annaSortService.columnSortState.entries()) {
2620
- this.annaSortService.columnSortState.set(key, "DEFAULT");
2621
- }
2629
+ this.annaSortService.columnSortState = new Map();
2622
2630
  this.annaSortService.columnSortState.set(this.annaFilterService.selectedRadio, this.tempSortOrder);
2623
2631
  this.applySorting(this.annaFilterService.selectedRadio);
2624
2632
  }
@@ -2627,7 +2635,7 @@ class AnnaNonEditableGenericTableComponent {
2627
2635
  this.applySortingOnFilteredData();
2628
2636
  this.emitData();
2629
2637
  this.setInitialRowsForTable();
2630
- this.annaFilterService.updateStateOfTheCurrentFilterTab(this.annaSortService.columnSortState);
2638
+ this.annaFilterService.updateStateOfAllTheKeys(this.annaSortService.columnSortState);
2631
2639
  this.closeTooltip();
2632
2640
  }
2633
2641
  applyDateFilterOnData() {
@@ -2740,7 +2748,7 @@ class AnnaNonEditableGenericTableComponent {
2740
2748
  this.applySortingOnFilteredData();
2741
2749
  this.emitData();
2742
2750
  this.setInitialRowsForTable();
2743
- this.annaFilterService.updateStateOfTheCurrentFilterTab(this.annaSortService.columnSortState);
2751
+ this.annaFilterService.updateStateOfAllTheKeys(this.annaSortService.columnSortState);
2744
2752
  this.closeTooltip();
2745
2753
  }
2746
2754
  applyTimeFilterOnData() {
@@ -2907,19 +2915,19 @@ class AnnaNonEditableGenericTableComponent {
2907
2915
  viewDetailsClicked(rowData) {
2908
2916
  this.gtViewDetailClicked.emit({ data: rowData });
2909
2917
  }
2910
- setColumnSortStateMap() {
2911
- this.tableHeaders.forEach(column => {
2912
- column.headerInfo.forEach((header) => {
2913
- if (header.showTooltipIcon && header.isSortRequired) {
2914
- header.isSortRequired.forEach((item, index) => {
2915
- if (item) {
2916
- this.annaSortService.columnSortState.set(header.filterSortObjectKeys[index], "DEFAULT");
2917
- }
2918
- });
2919
- }
2920
- });
2921
- });
2922
- }
2918
+ // setColumnSortStateMap(){
2919
+ // this.tableHeaders.forEach(column => {
2920
+ // column.headerInfo.forEach( (header) => {
2921
+ // if(header.showTooltipIcon && header.isSortRequired){
2922
+ // header.isSortRequired.forEach( (item,index) => {
2923
+ // if(item){
2924
+ // this.annaSortService.columnSortState.set(header.filterSortObjectKeys[index], "DEFAULT");
2925
+ // }
2926
+ // })
2927
+ // }
2928
+ // })
2929
+ // });
2930
+ // }
2923
2931
  storeSortTypeInTempVariable(event) {
2924
2932
  this.tempSortOrder = event;
2925
2933
  this.disableApplyButtonOfSelectedFilter();
@@ -3261,10 +3269,15 @@ class AnnaNonEditableGenericTableComponent {
3261
3269
  this.annaFilterService.initialValueMap.set(this.annaFilterService.selectedRadio, sliderData);
3262
3270
  }
3263
3271
  checkIfSortingChanged() {
3264
- this.isSortChanged = this.tempSortOrder != null && this.tempSortOrder != this.annaSortService.columnSortState.get(this.annaFilterService.selectedRadio);
3265
- ;
3272
+ let currentColumnSortFilter = this.getColumnSortStateForSelectedRadio();
3273
+ this.isSortChanged = this.tempSortOrder != null && this.tempSortOrder != currentColumnSortFilter;
3266
3274
  return this.isSortChanged;
3267
3275
  }
3276
+ getColumnSortStateForSelectedRadio() {
3277
+ let currentColumnSortFilter = this.annaSortService.columnSortState.get(this.annaFilterService.selectedRadio);
3278
+ currentColumnSortFilter = currentColumnSortFilter ? currentColumnSortFilter : SortTypeEnum.DEFAULT;
3279
+ return currentColumnSortFilter;
3280
+ }
3268
3281
  disableApplyButtonOfSelectedFilter() {
3269
3282
  let header = this.annaFilterService.selectedRadio;
3270
3283
  if (this.annaFilterService.calendarSet.has(header)) {
@@ -3522,9 +3535,7 @@ class AnnaGtHelperService {
3522
3535
  this.annaFilterService.tooltipSelectedMap = new Map();
3523
3536
  this.annaFilterService.selectedRadio = null;
3524
3537
  this.annaFilterService.appliedFiltersArray = [];
3525
- for (let [key, _value] of this.annaSortService.columnSortState.entries()) {
3526
- this.annaSortService.columnSortState.set(key, "DEFAULT");
3527
- }
3538
+ this.annaSortService.columnSortState = new Map();
3528
3539
  this.annaSortService.noSortingAppliedData = cloneDeep(clonedTableData);
3529
3540
  this.annaFilterService.updateStateOfAllTheKeys(this.annaSortService.columnSortState);
3530
3541
  }
@@ -4775,7 +4786,8 @@ Constants.USER_ORIGIN = "ANNA";
4775
4786
  Constants.ACTIVE_USER_STATUS = "active";
4776
4787
  Constants.DELETED_USER_STATUS = "deleted";
4777
4788
  Constants.INACTIVE_USER_STATUS = "inactive";
4778
- Constants.OGAdminRole = "OG-admin";
4789
+ Constants.OGAdminRole = "Ownership Group Admin";
4790
+ Constants.ASARole = "Anna Station Admin";
4779
4791
  Constants.dollars = "$";
4780
4792
  class ErrorCodes {
4781
4793
  }
@@ -4806,5 +4818,5 @@ var Days;
4806
4818
  * Generated bundle index. Do not edit.
4807
4819
  */
4808
4820
 
4809
- export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCalendarFilterComponent, AnnaConvertZeroOrNullOrUndefinedPipe, AnnaCoreModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaFixedRowSizeTableVirtualScrollStrategy, AnnaFixedRowSizeTableVirtualScrollStrategyDirective, AnnaGlobalConfigService, AnnaGtHelperService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNonEditableGenericTableComponent, AnnaNotifyIconTemplateComponent, AnnaNumberFormatService, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaReplaceCharPipe, AnnaSortComponent, AnnaSortService, AnnaTableVirtualScrollViewportComponent, AnnaTypeofDataPipe, AnnaVirtualTableDirective, AnnaWeekCalendarComponent, Constants, Days, DigitOnlyDirective, ErrorCodes, TooltipModel, fixedSizeVirtualScrollStrategyFactory, radioButtonModel, showEllipsisTextOnHoverDirective, tooltipModelForColumnLevelFiltering };
4821
+ export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCalendarFilterComponent, AnnaConvertZeroOrNullOrUndefinedPipe, AnnaCoreModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaFixedRowSizeTableVirtualScrollStrategy, AnnaFixedRowSizeTableVirtualScrollStrategyDirective, AnnaGlobalConfigService, AnnaGtHelperService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNonEditableGenericTableComponent, AnnaNotifyIconTemplateComponent, AnnaNumberFormatService, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaReplaceCharPipe, AnnaSortComponent, AnnaSortService, AnnaTableVirtualScrollViewportComponent, AnnaTypeofDataPipe, AnnaVirtualTableDirective, AnnaWeekCalendarComponent, Constants, Days, DigitOnlyDirective, ErrorCodes, SortTypeEnum, TooltipModel, fixedSizeVirtualScrollStrategyFactory, radioButtonModel, showEllipsisTextOnHoverDirective, tooltipModelForColumnLevelFiltering };
4810
4822
  //# sourceMappingURL=annalib-anna-core.mjs.map