@annalib/anna-core 7.3.18 → 7.3.19

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.
@@ -1104,7 +1104,9 @@ class AnnaSortService {
1104
1104
  });
1105
1105
  }
1106
1106
  else {
1107
- data.sort((a, b) => {
1107
+ let dataWithoutEmptyOrHyphenValues = data.filter(n => n[key] != "-");
1108
+ let rowsWithHyphenOrZeroValues = data.filter(n => n[key] == "-");
1109
+ dataWithoutEmptyOrHyphenValues.sort((a, b) => {
1108
1110
  param1 = a[key];
1109
1111
  param2 = b[key];
1110
1112
  if (param1 !== param2) {
@@ -1112,7 +1114,10 @@ class AnnaSortService {
1112
1114
  }
1113
1115
  return 0;
1114
1116
  });
1117
+ data = isAsc ? [...rowsWithHyphenOrZeroValues, ...dataWithoutEmptyOrHyphenValues] :
1118
+ [...dataWithoutEmptyOrHyphenValues, ...rowsWithHyphenOrZeroValues];
1115
1119
  }
1120
+ console.log(data.map(n => n[key]));
1116
1121
  return data;
1117
1122
  }
1118
1123
  sortEnterEditLurAndCsrPage(isAsc, data, key) {