@annalib/anna-core 4.2.0 → 4.2.2

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.
@@ -379,6 +379,12 @@ class AnnaDateTimeFormatService {
379
379
  ? moment(value, ["HH:mm:ss"]).format("hA").slice(0, -1)
380
380
  : moment(value, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
381
381
  }
382
+ static formatTwelveHourTimeToHHMMAFormat(value) {
383
+ value = moment(value, ["HH:mm:A"]).format("HH:mm:ss");
384
+ return value[3] == "0" && value[4] == "0"
385
+ ? moment(value, ["HH:mm:ss"]).format("hA").slice(0, -1)
386
+ : moment(value, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
387
+ }
382
388
  formatDateAndHHMMATimeToStandardFormat(dateAndTime) {
383
389
  let standardFormat, date, time;
384
390
  if (dateAndTime.includes("|")) {
@@ -1180,14 +1186,18 @@ class AnnaFilterService {
1180
1186
  return val;
1181
1187
  };
1182
1188
  this.currencyTranslateFunction = (data) => {
1183
- if (data >= 1000) {
1184
- const val = (data / 1000).toFixed(1) + "k";
1185
- return "$" + val;
1189
+ if (Math.abs(data) >= 1000) {
1190
+ let isNegVal = data < 0;
1191
+ const val = "$" + (Math.abs(data) / 1000).toFixed(1);
1192
+ +"k";
1193
+ return isNegVal ? "-" + val : val;
1186
1194
  }
1187
- else if (data != Math.floor(data)) {
1188
- return data.toFixed(1).toString();
1195
+ else {
1196
+ let isNegVal = data < 0;
1197
+ let isWholeNum = parseInt(data.toString()) == data;
1198
+ let val = isWholeNum ? Math.abs(data).toString() : Math.abs(data).toFixed(1);
1199
+ return isNegVal ? "-$" + val : "$" + val;
1189
1200
  }
1190
- return "$" + data;
1191
1201
  };
1192
1202
  this.normalTranslateFunction = (data) => {
1193
1203
  if (data >= 1000) {
@@ -1742,7 +1752,7 @@ class AnnaNonEditableGenericTableComponent {
1742
1752
  this.isNoDataToDisplaySubject$.next(false);
1743
1753
  this.annaFilterService.initialValueMap = new Map();
1744
1754
  }
1745
- else if (changes["percentDone"] || changes["downloadInProgress"] || changes["starredInProgress"]) {
1755
+ else if (changes["percentDone"] || changes["downloadInProgress"] || (changes["starredInProgress"] && changes["starredInProgress"].currentValue != undefined)) {
1746
1756
  console.log("do nothing");
1747
1757
  }
1748
1758
  else {
@@ -2309,7 +2319,7 @@ class AnnaNonEditableGenericTableComponent {
2309
2319
  this.sliderEnteredMinValue = parseInt(val);
2310
2320
  this.isMinTextBoxEmpty = false;
2311
2321
  if (this.isMaxTextBoxEmpty) {
2312
- if (this.sliderEnteredMinValue > this.options.ceil) {
2322
+ if ((this.sliderEnteredMinValue > this.options.ceil) || (this.sliderEnteredMinValue < this.options.floor)) {
2313
2323
  this.showSliderMinValueError = true;
2314
2324
  this.disableSliderApplyButton = true;
2315
2325
  this.incorrectSliderInput = true;
@@ -2363,7 +2373,7 @@ class AnnaNonEditableGenericTableComponent {
2363
2373
  this.sliderEnteredMaxValue = parseInt(val);
2364
2374
  this.isMaxTextBoxEmpty = false;
2365
2375
  if (this.isMinTextBoxEmpty) {
2366
- if (this.sliderEnteredMaxValue < this.options.floor) {
2376
+ if ((this.sliderEnteredMaxValue < this.options.floor) || (this.sliderEnteredMaxValue > this.options.ceil)) {
2367
2377
  this.showSliderMaxValueError = true;
2368
2378
  this.disableSliderApplyButton = true;
2369
2379
  this.incorrectSliderInput = true;
@@ -2773,7 +2783,10 @@ class AnnaNonEditableGenericTableComponent {
2773
2783
  }
2774
2784
  else {
2775
2785
  values = this.tableData.map((u) => u[key]);
2776
- if (uniq(values).filter(n => n != null).length > 1) {
2786
+ if (item.filter == "CHECKBOX" && uniq(values).filter(n => n != null).length > 1) {
2787
+ item.disableTooltipIcon = false;
2788
+ }
2789
+ else if (item.filter != "CHECKBOX" && uniq(values).filter(n => n != null && n != "-").length > 1) {
2777
2790
  item.disableTooltipIcon = false;
2778
2791
  }
2779
2792
  }
@@ -3274,10 +3287,7 @@ class AnnaNonEditableGenericTableComponent {
3274
3287
  }
3275
3288
  setInitialRowsForTable() {
3276
3289
  this.resetIndex();
3277
- console.log(this.start);
3278
- console.log(this.end);
3279
3290
  this.renderedData = this.getTableData(this.start, this.end);
3280
- console.log(this.renderedData);
3281
3291
  this.updateIndex();
3282
3292
  }
3283
3293
  spotDetailsDownloadClicked(parentChildOrTotalRow, rowdata) {