ng-tailwind 2.24.327 → 2.24.330
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/ng-tailwind.umd.js +29 -9
- package/bundles/ng-tailwind.umd.js.map +1 -1
- package/components/ngt-dropdown/ngt-dropdown.component.d.ts +2 -0
- package/components/ngt-dropzone/ngt-dropzone-file-viewer/ngt-dropzone-file-viewer.component.d.ts +5 -2
- package/esm2015/components/ngt-dropdown/ngt-dropdown.component.js +10 -4
- package/esm2015/components/ngt-dropzone/ngt-dropzone-file-viewer/ngt-dropzone-file-viewer.component.js +22 -8
- package/fesm2015/ng-tailwind.js +29 -10
- package/fesm2015/ng-tailwind.js.map +1 -1
- package/ng-tailwind.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1767,6 +1767,8 @@
|
|
|
1767
1767
|
this.name = uuid();
|
|
1768
1768
|
this.isYPositionReversed = false;
|
|
1769
1769
|
this.isXPositionReversed = false;
|
|
1770
|
+
this.isBindingYPosition = true;
|
|
1771
|
+
this.isBindingXPosition = true;
|
|
1770
1772
|
this.subscriptions = [];
|
|
1771
1773
|
if (this.ngtDropdownContainer) {
|
|
1772
1774
|
this.subscriptions.push(this.ngtDropdownContainer.onActiveDropdownChange.subscribe(function (activeDropdown) {
|
|
@@ -1836,25 +1838,27 @@
|
|
|
1836
1838
|
if (this.isOpen) {
|
|
1837
1839
|
this.bindContainerXPosition();
|
|
1838
1840
|
this.isXPositionReversed = !(this.containerXPosition > document.documentElement.clientWidth);
|
|
1839
|
-
return this.isXPositionReversed;
|
|
1841
|
+
return !this.isBindingXPosition && this.isXPositionReversed;
|
|
1840
1842
|
}
|
|
1841
1843
|
};
|
|
1842
1844
|
NgtDropdownComponent.prototype.shouldReverseYPosition = function () {
|
|
1843
1845
|
if (!this.autoYReverse || this.reverseYPosition !== undefined) {
|
|
1844
1846
|
return this.reverseYPosition;
|
|
1845
1847
|
}
|
|
1846
|
-
this.bindContainerYPosition();
|
|
1847
1848
|
if (this.isOpen) {
|
|
1849
|
+
this.bindContainerYPosition();
|
|
1848
1850
|
this.isYPositionReversed = this.containerYPosition > (document.documentElement.clientHeight * 0.9);
|
|
1849
|
-
return this.isYPositionReversed;
|
|
1851
|
+
return !this.isBindingYPosition && this.isYPositionReversed;
|
|
1850
1852
|
}
|
|
1851
1853
|
};
|
|
1852
1854
|
NgtDropdownComponent.prototype.bindContainerXPosition = function () {
|
|
1853
1855
|
var _this = this;
|
|
1854
1856
|
if (!this.containerXPosition && this.containerRef.nativeElement.offsetWidth) {
|
|
1857
|
+
this.isBindingXPosition = true;
|
|
1855
1858
|
setTimeout(function () {
|
|
1856
1859
|
_this.containerXPosition = _this.containerRef.nativeElement.getBoundingClientRect().x
|
|
1857
1860
|
+ _this.containerRef.nativeElement.offsetWidth;
|
|
1861
|
+
_this.isBindingXPosition = false;
|
|
1858
1862
|
});
|
|
1859
1863
|
}
|
|
1860
1864
|
};
|
|
@@ -1862,9 +1866,11 @@
|
|
|
1862
1866
|
var _this = this;
|
|
1863
1867
|
var _a;
|
|
1864
1868
|
if (!this.containerYPosition && ((_a = this.containerRef) === null || _a === void 0 ? void 0 : _a.nativeElement.offsetHeight)) {
|
|
1869
|
+
this.isBindingYPosition = true;
|
|
1865
1870
|
setTimeout(function () {
|
|
1866
1871
|
_this.containerYPosition = _this.containerRef.nativeElement.getBoundingClientRect().y
|
|
1867
1872
|
+ _this.containerRef.nativeElement.offsetHeight;
|
|
1873
|
+
_this.isBindingYPosition = false;
|
|
1868
1874
|
});
|
|
1869
1875
|
}
|
|
1870
1876
|
};
|
|
@@ -6931,10 +6937,7 @@
|
|
|
6931
6937
|
|
|
6932
6938
|
var NgtDropzoneFileViewerComponent = /** @class */ (function () {
|
|
6933
6939
|
function NgtDropzoneFileViewerComponent() {
|
|
6934
|
-
this.url = '';
|
|
6935
|
-
this.fileName = '';
|
|
6936
6940
|
this.onClose = new core.EventEmitter();
|
|
6937
|
-
this.canShowViewer = false;
|
|
6938
6941
|
}
|
|
6939
6942
|
NgtDropzoneFileViewerComponent.prototype.keyEvent = function (event) {
|
|
6940
6943
|
var _this = this;
|
|
@@ -6946,7 +6949,9 @@
|
|
|
6946
6949
|
}
|
|
6947
6950
|
};
|
|
6948
6951
|
NgtDropzoneFileViewerComponent.prototype.init = function () {
|
|
6952
|
+
this.loading = true;
|
|
6949
6953
|
this.canShowViewer = true;
|
|
6954
|
+
this.initReloadInterval();
|
|
6950
6955
|
};
|
|
6951
6956
|
NgtDropzoneFileViewerComponent.prototype.close = function () {
|
|
6952
6957
|
this.canShowViewer = false;
|
|
@@ -6959,17 +6964,32 @@
|
|
|
6959
6964
|
file.setAttribute("download", this.fileName);
|
|
6960
6965
|
file.click();
|
|
6961
6966
|
};
|
|
6967
|
+
NgtDropzoneFileViewerComponent.prototype.initReloadInterval = function () {
|
|
6968
|
+
var _this = this;
|
|
6969
|
+
var reloadInterval = setInterval(function () {
|
|
6970
|
+
var _a;
|
|
6971
|
+
(_a = _this.ngxDocViewer) === null || _a === void 0 ? void 0 : _a.iframes.forEach(function (iframe) {
|
|
6972
|
+
if (iframe.nativeElement.contentDocument) {
|
|
6973
|
+
_this.ngxDocViewer.reloadIFrame(iframe.nativeElement);
|
|
6974
|
+
}
|
|
6975
|
+
else {
|
|
6976
|
+
clearInterval(reloadInterval);
|
|
6977
|
+
_this.loading = false;
|
|
6978
|
+
}
|
|
6979
|
+
});
|
|
6980
|
+
}, 1000);
|
|
6981
|
+
};
|
|
6962
6982
|
return NgtDropzoneFileViewerComponent;
|
|
6963
6983
|
}());
|
|
6964
6984
|
NgtDropzoneFileViewerComponent.decorators = [
|
|
6965
6985
|
{ type: core.Component, args: [{
|
|
6966
6986
|
selector: 'ngt-dropzone-file-viewer',
|
|
6967
|
-
template: "<div style=\"width:100%; height: 100%;\">\n <div style=\"width:100%; height: 100%;\">\n <div class=\"w-full py-5 pr-10\">\n <div class=\"w-full flex justify-end text-2xl\">\n <div class=\"cursor-pointer\" (click)=\"downloadFile()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n <path fill=\"#fff\" d=\"M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z\" />\n </svg>\n </div>\n \n <div class=\"cursor-pointer\" (click)=\"close()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path fill=\"#fff\"\n d=\"M24 2.42l-2.42 -2.42 -9.58 9.58 -9.58 -9.58 -2.42 2.42 9.58 9.58 -9.58 9.58 2.42 2.42 9.58 -9.58 9.58 9.58 2.42 -2.42 -9.58 -9.58 9.58 -9.58z\" />\n </svg>\n </div>\n\n </div>\n <div class=\"w-full justify-center text-center text-2xl font-mono text-white\">\n {{ fileName }}\n </div>\n </div>\n <div class=\"px-10\" style=\"width:100%; height: 83%;\" *ngIf=\"canShowViewer\">\n <ngx-doc-viewer class=\"h-full w-full\" [url]=\"url\">\n </ngx-doc-viewer>\n </div>\n </div>\n</div>",
|
|
6968
|
-
styles: [":host{background:rgba(0,0,0,.5);color:#fff;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:10000000}"]
|
|
6987
|
+
template: "<div style=\"width:100%; height: 100%;\">\n <div style=\"width:100%; height: 100%;\">\n <div class=\"w-full py-5 pr-10\">\n <div class=\"w-full flex justify-end text-2xl\">\n <div class=\"cursor-pointer\" (click)=\"downloadFile()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n <path fill=\"#fff\" d=\"M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z\" />\n </svg>\n </div>\n \n <div class=\"cursor-pointer\" (click)=\"close()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path fill=\"#fff\"\n d=\"M24 2.42l-2.42 -2.42 -9.58 9.58 -9.58 -9.58 -2.42 2.42 9.58 9.58 -9.58 9.58 2.42 2.42 9.58 -9.58 9.58 9.58 2.42 -2.42 -9.58 -9.58 9.58 -9.58z\" />\n </svg>\n </div>\n\n </div>\n <div class=\"w-full justify-center text-center text-2xl font-mono text-white\">\n {{ fileName }}\n </div>\n </div>\n <div class=\"px-10\" style=\"width:100%; height: 83%;\" *ngIf=\"canShowViewer\">\n <ngx-doc-viewer class=\"h-full w-full\" [url]=\"url\">\n </ngx-doc-viewer>\n </div>\n </div>\n</div>\n\n<div *ngIf=\"loading\" class=\"flex fixed inset-0 justify-center items-center w-full h-full cursor-wait z-50\">\n <div class=\"div-loader\"></div>\n</div>",
|
|
6988
|
+
styles: [":host{background:rgba(0,0,0,.5);color:#fff;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:10000000}.div-loader{width:5rem;height:5rem;border:5px solid #89c43f38;border-top-color:#89c43f;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}"]
|
|
6969
6989
|
},] }
|
|
6970
6990
|
];
|
|
6971
|
-
NgtDropzoneFileViewerComponent.ctorParameters = function () { return []; };
|
|
6972
6991
|
NgtDropzoneFileViewerComponent.propDecorators = {
|
|
6992
|
+
ngxDocViewer: [{ type: core.ViewChild, args: [ngxDocViewer.NgxDocViewerComponent,] }],
|
|
6973
6993
|
url: [{ type: core.Input }],
|
|
6974
6994
|
fileName: [{ type: core.Input }],
|
|
6975
6995
|
onClose: [{ type: core.Output }],
|