@firestitch/common 12.6.1 → 12.6.3
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.
- package/bundles/firestitch-common.umd.js +11 -0
- package/bundles/firestitch-common.umd.js.map +1 -1
- package/esm2015/app/directives/autofocus.directive.js +11 -1
- package/esm2015/libs/util/round/round.js +2 -1
- package/fesm2015/firestitch-common.js +11 -0
- package/fesm2015/firestitch-common.js.map +1 -1
- package/package.json +1 -1
|
@@ -795,12 +795,22 @@
|
|
|
795
795
|
FsAutofocusDirective.prototype.focus = function () {
|
|
796
796
|
var _this = this;
|
|
797
797
|
setTimeout(function () {
|
|
798
|
+
var tmpEl = document.createElement('input');
|
|
799
|
+
tmpEl.style.width = '0';
|
|
800
|
+
tmpEl.style.height = '0';
|
|
801
|
+
tmpEl.style.margin = '0';
|
|
802
|
+
tmpEl.style.padding = '0';
|
|
803
|
+
tmpEl.style.border = '0';
|
|
804
|
+
tmpEl.style.opacity = '0';
|
|
805
|
+
document.body.appendChild(tmpEl);
|
|
806
|
+
tmpEl.focus();
|
|
798
807
|
if (_this._matInput) {
|
|
799
808
|
_this._matInput.focus();
|
|
800
809
|
}
|
|
801
810
|
else if (_this._el.nativeElement.focus) {
|
|
802
811
|
_this._el.nativeElement.focus();
|
|
803
812
|
}
|
|
813
|
+
document.body.removeChild(tmpEl);
|
|
804
814
|
}, 50);
|
|
805
815
|
};
|
|
806
816
|
return FsAutofocusDirective;
|
|
@@ -1722,6 +1732,7 @@
|
|
|
1722
1732
|
|
|
1723
1733
|
function round(num, decimalPlaces) {
|
|
1724
1734
|
if (decimalPlaces === void 0) { decimalPlaces = 0; }
|
|
1735
|
+
num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
|
|
1725
1736
|
var p = Math.pow(10, decimalPlaces);
|
|
1726
1737
|
return Math.round(num * p) / p;
|
|
1727
1738
|
}
|