@annalib/anna-core 35.5.0 → 35.5.1
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.
|
@@ -570,19 +570,23 @@ class ShowEllipsisTextOnHoverDirective {
|
|
|
570
570
|
}
|
|
571
571
|
onMouseEnter() {
|
|
572
572
|
const domElement = this.elementRef.nativeElement;
|
|
573
|
-
const clone = document.createElement(
|
|
574
|
-
clone.style.visibility =
|
|
575
|
-
clone.style.whiteSpace =
|
|
576
|
-
clone.style.position =
|
|
573
|
+
const clone = document.createElement("span");
|
|
574
|
+
clone.style.visibility = "hidden";
|
|
575
|
+
clone.style.whiteSpace = "nowrap";
|
|
576
|
+
clone.style.position = "absolute";
|
|
577
577
|
clone.style.font = window?.getComputedStyle(domElement)?.font;
|
|
578
578
|
clone.textContent = domElement.textContent;
|
|
579
579
|
document.body.appendChild(clone);
|
|
580
580
|
const fullWidth = clone.offsetWidth;
|
|
581
|
-
if (domElement.offsetWidth < domElement.scrollWidth ||
|
|
581
|
+
if (domElement.offsetWidth < domElement.scrollWidth ||
|
|
582
|
+
this.checkPositionsInDecimals(domElement) ||
|
|
583
|
+
fullWidth > domElement.offsetWidth) {
|
|
582
584
|
domElement.title = domElement.textContent === "" ? domElement.value : domElement.textContent;
|
|
583
585
|
}
|
|
584
|
-
else if (domElement.title)
|
|
586
|
+
else if (domElement.title) {
|
|
585
587
|
domElement.removeAttribute("title");
|
|
588
|
+
}
|
|
589
|
+
document.body.removeChild(clone);
|
|
586
590
|
}
|
|
587
591
|
checkPositionsInDecimals(domElement) {
|
|
588
592
|
// if we don't have any children element Then we can't calculate
|
|
@@ -6313,7 +6317,9 @@ class AnnaNumberFormatService {
|
|
|
6313
6317
|
const result = AnnaNumberFormatService.GetValueInUnits(Math.abs(inputValue));
|
|
6314
6318
|
let value = result[0];
|
|
6315
6319
|
const unit = result[1];
|
|
6316
|
-
|
|
6320
|
+
const factor = 10 ** digitsToRoundDecimalPoint;
|
|
6321
|
+
value = Math.round(((+value) + Number.EPSILON) * factor) / factor;
|
|
6322
|
+
// value = +(+value).toFixed(digitsToRoundDecimalPoint);
|
|
6317
6323
|
if (inputValue < 0) {
|
|
6318
6324
|
value *= -1;
|
|
6319
6325
|
}
|