ng-tailwind 2.30.357 → 2.30.358
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 +26 -22
- package/bundles/ng-tailwind.umd.js.map +1 -1
- package/components/ngt-dropdown/ngt-dropdown.component.d.ts +3 -3
- package/components/ngt-popover/ngt-popover.component.d.ts +2 -0
- package/esm2015/components/ngt-dropdown/ngt-dropdown.component.js +16 -17
- package/esm2015/components/ngt-popover/ngt-popover.component.js +12 -6
- package/fesm2015/ng-tailwind.js +26 -21
- package/fesm2015/ng-tailwind.js.map +1 -1
- package/ng-tailwind.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1763,6 +1763,7 @@
|
|
|
1763
1763
|
var _this = this;
|
|
1764
1764
|
this.ngtDropdownContainer = ngtDropdownContainer;
|
|
1765
1765
|
this.autoYReverse = true;
|
|
1766
|
+
this.closeTimeout = 1000;
|
|
1766
1767
|
this.openMethod = exports.NgtDropdownOpenMethod.HOVER;
|
|
1767
1768
|
this.onToggle = new core.EventEmitter();
|
|
1768
1769
|
this.onHostClick = new core.EventEmitter();
|
|
@@ -1797,15 +1798,9 @@
|
|
|
1797
1798
|
}
|
|
1798
1799
|
};
|
|
1799
1800
|
NgtDropdownComponent.prototype.close = function () {
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
}
|
|
1804
|
-
if (this.closeTimeout) {
|
|
1805
|
-
this.closeTimeoutInstance = setTimeout(function () { return _this.hideContainer(); }, this.closeTimeout);
|
|
1806
|
-
return;
|
|
1807
|
-
}
|
|
1808
|
-
this.hideContainer();
|
|
1801
|
+
this.isOpen = false;
|
|
1802
|
+
this.containerXPosition = null;
|
|
1803
|
+
this.containerYPosition = null;
|
|
1809
1804
|
};
|
|
1810
1805
|
NgtDropdownComponent.prototype.toggle = function () {
|
|
1811
1806
|
var _this = this;
|
|
@@ -1825,14 +1820,17 @@
|
|
|
1825
1820
|
this.watchHover(host, container);
|
|
1826
1821
|
}
|
|
1827
1822
|
};
|
|
1828
|
-
NgtDropdownComponent.prototype.onClick = function (event) {
|
|
1823
|
+
NgtDropdownComponent.prototype.onClick = function (event, host, container) {
|
|
1829
1824
|
var _a;
|
|
1830
1825
|
(_a = this.onHostClick) === null || _a === void 0 ? void 0 : _a.emit();
|
|
1831
|
-
if (this.
|
|
1826
|
+
if (this.isClickMethod()) {
|
|
1832
1827
|
event.preventDefault();
|
|
1833
1828
|
event.stopPropagation();
|
|
1834
1829
|
this.toggle();
|
|
1835
1830
|
}
|
|
1831
|
+
if (this.openMethod == exports.NgtDropdownOpenMethod.POPOVER_CLICK) {
|
|
1832
|
+
this.watchHover(host, container);
|
|
1833
|
+
}
|
|
1836
1834
|
};
|
|
1837
1835
|
NgtDropdownComponent.prototype.onRightClick = function (event) {
|
|
1838
1836
|
if (this.openMethod == exports.NgtDropdownOpenMethod.RIGHT_CLICK) {
|
|
@@ -1891,7 +1889,7 @@
|
|
|
1891
1889
|
_this.close();
|
|
1892
1890
|
clearInterval(interval);
|
|
1893
1891
|
}
|
|
1894
|
-
},
|
|
1892
|
+
}, this.closeTimeout);
|
|
1895
1893
|
};
|
|
1896
1894
|
NgtDropdownComponent.prototype.isInHover = function (host, container) {
|
|
1897
1895
|
return host.parentElement.querySelector(':hover') == host ||
|
|
@@ -1901,17 +1899,16 @@
|
|
|
1901
1899
|
this.subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
|
|
1902
1900
|
this.subscriptions = [];
|
|
1903
1901
|
};
|
|
1904
|
-
NgtDropdownComponent.prototype.
|
|
1905
|
-
this.
|
|
1906
|
-
|
|
1907
|
-
this.containerYPosition = null;
|
|
1902
|
+
NgtDropdownComponent.prototype.isClickMethod = function () {
|
|
1903
|
+
return this.openMethod == exports.NgtDropdownOpenMethod.CLICK
|
|
1904
|
+
|| this.openMethod == exports.NgtDropdownOpenMethod.POPOVER_CLICK;
|
|
1908
1905
|
};
|
|
1909
1906
|
return NgtDropdownComponent;
|
|
1910
1907
|
}());
|
|
1911
1908
|
NgtDropdownComponent.decorators = [
|
|
1912
1909
|
{ type: core.Component, args: [{
|
|
1913
1910
|
selector: 'ngt-dropdown',
|
|
1914
|
-
template: "<div class=\"sm:relative\">\n <div (mouseenter)=\"onHover(host, container)\" (click)=\"onClick($event)\" (contextmenu)=\"onRightClick($event)\" #host>\n <ng-content select='[host]'></ng-content>\n </div>\n\n <div [hidden]='!isOpen'\n class=\"{{ shouldReverseYPosition() ? 'mb-12 bottom-0' : 'mt-4' }} {{ shouldReverseXPosition() ? 'left-0': 'right-0' }} ngt-dropdown-container sm:mr-0 mr-3 max-w-xs absolute\"\n [@openClose]=\"isOpen ? 'open' : 'closed'\" (mouseenter)=\"onHover(host, container)\"\n (click)='closeOnSelectOption()' style=\"z-index: 1100 !important;\" #container>\n\n <ng-content select='[container]'></ng-content>\n </div>\n</div>\n\n<button *ngIf=\"isOpen && openMethod != 'HOVER'\" class=\"fixed z-40 inset-0 h-full w-full opacity-0 cursor-default\"\n (click)='toggle()'>\n</button
|
|
1911
|
+
template: "<div class=\"sm:relative\">\n <div (mouseenter)=\"onHover(host, container)\" (click)=\"onClick($event, host, container)\" (contextmenu)=\"onRightClick($event)\" #host>\n <ng-content select='[host]'></ng-content>\n </div>\n\n <div [hidden]='!isOpen'\n class=\"{{ shouldReverseYPosition() ? 'mb-12 bottom-0' : 'mt-4' }} {{ shouldReverseXPosition() ? 'left-0': 'right-0' }} ngt-dropdown-container sm:mr-0 mr-3 max-w-xs absolute\"\n [@openClose]=\"isOpen ? 'open' : 'closed'\" (mouseenter)=\"onHover(host, container)\"\n (click)='closeOnSelectOption()' style=\"z-index: 1100 !important;\" #container>\n\n <ng-content select='[container]'></ng-content>\n </div>\n</div>\n\n<button *ngIf=\"isOpen && openMethod != 'HOVER'\" class=\"fixed z-40 inset-0 h-full w-full opacity-0 cursor-default\"\n (click)='toggle()'>\n</button>\n",
|
|
1915
1912
|
animations: [
|
|
1916
1913
|
animations.trigger('openClose', [
|
|
1917
1914
|
animations.state('open', animations.style({ opacity: 1, transform: 'translateY(0px)' })),
|
|
@@ -1942,6 +1939,7 @@
|
|
|
1942
1939
|
exports.NgtDropdownOpenMethod = void 0;
|
|
1943
1940
|
(function (NgtDropdownOpenMethod) {
|
|
1944
1941
|
NgtDropdownOpenMethod["CLICK"] = "CLICK";
|
|
1942
|
+
NgtDropdownOpenMethod["POPOVER_CLICK"] = "POPOVER_CLICK";
|
|
1945
1943
|
NgtDropdownOpenMethod["RIGHT_CLICK"] = "RIGHT_CLICK";
|
|
1946
1944
|
NgtDropdownOpenMethod["HOVER"] = "HOVER";
|
|
1947
1945
|
})(exports.NgtDropdownOpenMethod || (exports.NgtDropdownOpenMethod = {}));
|
|
@@ -7708,20 +7706,24 @@
|
|
|
7708
7706
|
this.injector = injector;
|
|
7709
7707
|
this.openMethod = exports.NgtPopoverOpenMethod.HOVER;
|
|
7710
7708
|
this.onClick = new core.EventEmitter();
|
|
7711
|
-
this.stylesToCompile = ['h', 'w', 'px', 'py', 'shadow', 'text', 'border', 'color.border', 'color.bg', 'color.text'];
|
|
7709
|
+
this.stylesToCompile = ['h', 'w', 'px', 'py', 'm', 'mx', 'my', 'shadow', 'text', 'border', 'color.border', 'color.bg', 'color.text'];
|
|
7712
7710
|
if (this.ngtStylizableDirective) {
|
|
7713
7711
|
this.ngtStyle = this.ngtStylizableDirective.getNgtStylizableService();
|
|
7714
7712
|
}
|
|
7715
7713
|
else {
|
|
7716
7714
|
this.ngtStyle = new NgtStylizableService();
|
|
7717
7715
|
}
|
|
7718
|
-
this.ngtStyle.load(this.injector, '
|
|
7716
|
+
this.ngtStyle.load(this.injector, 'NgtPopover', {
|
|
7719
7717
|
text: 'text-sm',
|
|
7720
7718
|
fontCase: '',
|
|
7719
|
+
py: 'py-3',
|
|
7720
|
+
px: 'px-2',
|
|
7721
|
+
border: 'border',
|
|
7721
7722
|
color: {
|
|
7723
|
+
border: 'border-gray-400',
|
|
7722
7724
|
text: 'text-black',
|
|
7723
|
-
bg: 'bg-
|
|
7724
|
-
}
|
|
7725
|
+
bg: 'bg-white'
|
|
7726
|
+
},
|
|
7725
7727
|
});
|
|
7726
7728
|
}
|
|
7727
7729
|
NgtPopoverComponent.prototype.fireClickEvent = function () {
|
|
@@ -7739,7 +7741,7 @@
|
|
|
7739
7741
|
NgtPopoverComponent.decorators = [
|
|
7740
7742
|
{ type: core.Component, args: [{
|
|
7741
7743
|
selector: 'ngt-popover',
|
|
7742
|
-
template: "<ngt-dropdown class=\"flex w-full hover:opacity-100\" [closeOnClick]=\"closeOnClick\" [openMethod]=\"openMethod\"\n [autoYReverse]=\"false\" [reverseXPosition]=\"
|
|
7744
|
+
template: "<ngt-dropdown class=\"flex w-full hover:opacity-100\" [closeOnClick]=\"closeOnClick\" [openMethod]=\"openMethod\"\n [autoYReverse]=\"false\" [reverseXPosition]=\"!placeOnLeft\" [reverseYPosition]=\"!placeOnBottom\"\n [closeTimeout]=\"closeTimeout\" (onHostClick)=\"fireClickEvent()\" #dropdownRef>\n <div #hostDiv host>\n <ng-content></ng-content>\n </div>\n\n <div class=\"bg-gray-100 rounded-lg hover:opacity-100 text-gray-800 shadow-lg -mb-4\"\n [ngClass]=\"ngtStyle.compile(stylesToCompile)\" container>\n\n <ng-content select=\"[popover-content]\"></ng-content>\n </div>\n</ngt-dropdown>\n"
|
|
7743
7745
|
},] }
|
|
7744
7746
|
];
|
|
7745
7747
|
NgtPopoverComponent.ctorParameters = function () { return [
|
|
@@ -7754,11 +7756,13 @@
|
|
|
7754
7756
|
openMethod: [{ type: core.Input }],
|
|
7755
7757
|
closeOnClick: [{ type: core.Input }],
|
|
7756
7758
|
placeOnBottom: [{ type: core.Input }],
|
|
7759
|
+
placeOnLeft: [{ type: core.Input }],
|
|
7757
7760
|
onClick: [{ type: core.Output }]
|
|
7758
7761
|
};
|
|
7759
7762
|
exports.NgtPopoverOpenMethod = void 0;
|
|
7760
7763
|
(function (NgtPopoverOpenMethod) {
|
|
7761
7764
|
NgtPopoverOpenMethod["CLICK"] = "CLICK";
|
|
7765
|
+
NgtPopoverOpenMethod["POPOVER_CLICK"] = "POPOVER_CLICK";
|
|
7762
7766
|
NgtPopoverOpenMethod["RIGHT_CLICK"] = "RIGHT_CLICK";
|
|
7763
7767
|
NgtPopoverOpenMethod["HOVER"] = "HOVER";
|
|
7764
7768
|
})(exports.NgtPopoverOpenMethod || (exports.NgtPopoverOpenMethod = {}));
|