@datarailsshared/datarailsshared 1.4.52-dragons → 1.4.53-dragons
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/datarailsshared-datarailsshared.umd.js +27 -6
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.53-dragons.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +6 -2
- package/esm2015/lib/dr-dropdown/dr-dropdown.directive.js +21 -5
- package/fesm2015/datarailsshared-datarailsshared.js +25 -5
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-dropdown/dr-dropdown.component.d.ts +2 -0
- package/lib/dr-dropdown/dr-dropdown.directive.d.ts +2 -0
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.52-dragons.tgz +0 -0
|
@@ -2755,6 +2755,7 @@
|
|
|
2755
2755
|
this.menuService = menuService;
|
|
2756
2756
|
this.cdr = cdr;
|
|
2757
2757
|
this.position = 'left';
|
|
2758
|
+
this.wasHovered = false;
|
|
2758
2759
|
}
|
|
2759
2760
|
Object.defineProperty(DrDropdownComponent.prototype, "options", {
|
|
2760
2761
|
set: function (data) {
|
|
@@ -2780,6 +2781,9 @@
|
|
|
2780
2781
|
enumerable: false,
|
|
2781
2782
|
configurable: true
|
|
2782
2783
|
});
|
|
2784
|
+
DrDropdownComponent.prototype.onMouseEnter = function () {
|
|
2785
|
+
this.wasHovered = true;
|
|
2786
|
+
};
|
|
2783
2787
|
DrDropdownComponent.prototype.onMouseLeave = function () {
|
|
2784
2788
|
if (this.drDropdownInHover)
|
|
2785
2789
|
this.menuService.destroy();
|
|
@@ -2848,7 +2852,7 @@
|
|
|
2848
2852
|
DrDropdownComponent.decorators = [
|
|
2849
2853
|
{ type: i0.Component, args: [{
|
|
2850
2854
|
selector: 'dr-dropdown',
|
|
2851
|
-
template: "<div #menuContainer\n (mouseleave)=\"onMouseLeave()\"\n (clickOutside)=\"onClickedOutside()\"\n [drDropdownPosition]=\"option\"\n #dropdownPosition=\"dropdownPosition\"\n [position]=\"position\"\n [class]=\"containerClass\"\n class=\"dr-dropdown\">\n <div class=\"dr-dropdown__container\">\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\n (click)=\"action(act)\"\n [drTooltip]=\"tooltipToShow(act)\"\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\n class=\"dr-dropdown__container__item\"\n [class.item-disabled]=\"disabled(act)\"\n [class.item-selected]=\"selected(act)\"\n [class.separate-line]=\"act.separateLine\">\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\n <i *ngFor=\"let actionIcon of act.actionIcons\"\n [class]=\"actionIcon.icon\"\n [class.showOnHover]=\"actionIcon.showOnHover\"\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\n </div>\n </div>\n</div>\n",
|
|
2855
|
+
template: "<div #menuContainer\n (mouseleave)=\"onMouseLeave()\"\n (mouseenter)=\"onMouseEnter()\"\n (clickOutside)=\"onClickedOutside()\"\n [drDropdownPosition]=\"option\"\n #dropdownPosition=\"dropdownPosition\"\n [position]=\"position\"\n [class]=\"containerClass\"\n class=\"dr-dropdown\">\n <div class=\"dr-dropdown__container\">\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\n (click)=\"action(act)\"\n [drTooltip]=\"tooltipToShow(act)\"\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\n class=\"dr-dropdown__container__item\"\n [class.item-disabled]=\"disabled(act)\"\n [class.item-selected]=\"selected(act)\"\n [class.separate-line]=\"act.separateLine\">\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\n <i *ngFor=\"let actionIcon of act.actionIcons\"\n [class]=\"actionIcon.icon\"\n [class.showOnHover]=\"actionIcon.showOnHover\"\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\n </div>\n </div>\n</div>\n",
|
|
2852
2856
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2853
2857
|
styles: ["::ng-deep .dr-dropdown__container__item .dr-dropdown{visibility:hidden;transition-delay:.2s}::ng-deep .dr-dropdown__container__item:hover>*>.dr-dropdown{visibility:visible;transition-delay:0s}::ng-deep .dr-dropdown__tooltip>.default-content{max-width:300px;white-space:normal!important}.dr-dropdown{position:absolute;z-index:-1;top:0;left:0;width:auto}.dr-dropdown__container{display:flex;flex-direction:column;background:#fff;border-radius:4px;box-shadow:0 4px 8px 1px #00000040;padding:8px 0;overflow-y:auto;max-height:60vh}.dr-dropdown__container__item{display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}.dr-dropdown__container__item.separate-line{border-top:1px solid #BCBCBC}.dr-dropdown__container__item:hover{background-color:#f9faff}.dr-dropdown__container__item:hover .showOnHover{visibility:visible}.dr-dropdown__container__item.item-selected{background:#F3F7FF}.dr-dropdown__container__item.item-disabled,.dr-dropdown__container__item.item-disabled i,.dr-dropdown__container__item.item-disabled .dr-dropdown__container__item__text{color:#bcbcbc}.dr-dropdown__container__item i:first-child{margin-right:8px}.dr-dropdown__container__item__text{margin-right:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown__container__item i{color:#4e566c}.dr-dropdown__container__item i:hover{color:#4646ce}.dr-dropdown__container__item .showOnHover{visibility:hidden}.dr-dropdown.content-top{transform:translate(-50%,-100%)}.dr-dropdown.content-top-left{transform:translate(-100%,-100%)}.dr-dropdown.content-bottom{transform:translate(-50%,50%)}.dr-dropdown.content-bottom-left{transform:translate(-90%,35%)}.dr-dropdown.content-bottom-right{transform:translateY(15%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
|
|
2854
2858
|
},] }
|
|
@@ -2871,6 +2875,7 @@
|
|
|
2871
2875
|
this.el = el;
|
|
2872
2876
|
this._document = _document;
|
|
2873
2877
|
this.position = 'left';
|
|
2878
|
+
this.mouseleaveTimeout = 200;
|
|
2874
2879
|
}
|
|
2875
2880
|
DrDropdownDirective.prototype.elementHover = function () {
|
|
2876
2881
|
if (!this.drDropdownInHover)
|
|
@@ -2880,6 +2885,17 @@
|
|
|
2880
2885
|
DrDropdownDirective.prototype.elementClick = function () {
|
|
2881
2886
|
this.openDropdown();
|
|
2882
2887
|
};
|
|
2888
|
+
DrDropdownDirective.prototype.leaveDropdownTriggerElement = function () {
|
|
2889
|
+
var _this = this;
|
|
2890
|
+
if (this.drDropdownInHover) {
|
|
2891
|
+
setTimeout(function (_) {
|
|
2892
|
+
if (_this.contentCmpRef && !_this.contentCmpRef.instance.wasHovered) {
|
|
2893
|
+
_this.contentCmpRef.destroy();
|
|
2894
|
+
_this.contentCmpRef = null;
|
|
2895
|
+
}
|
|
2896
|
+
}, this.mouseleaveTimeout);
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2883
2899
|
DrDropdownDirective.prototype.documentClick = function (e) {
|
|
2884
2900
|
this.closeDropdown(e);
|
|
2885
2901
|
};
|
|
@@ -2902,13 +2918,17 @@
|
|
|
2902
2918
|
}
|
|
2903
2919
|
};
|
|
2904
2920
|
DrDropdownDirective.prototype.closeDropdown = function (e) {
|
|
2905
|
-
|
|
2906
|
-
if (menuItem.contains('dr-dropdown__container__item') || menuItem.contains('dr-dropdown__container__item__text')) {
|
|
2921
|
+
if (!this.contentCmpRef) {
|
|
2907
2922
|
return;
|
|
2908
2923
|
}
|
|
2909
|
-
var
|
|
2910
|
-
|
|
2911
|
-
|
|
2924
|
+
var clickTarget = e.target;
|
|
2925
|
+
var triggerElement = this.el.nativeElement;
|
|
2926
|
+
var dropdownElement = this.contentCmpRef.location.nativeElement;
|
|
2927
|
+
var isClickTriggerElement = triggerElement.contains(clickTarget) || triggerElement === clickTarget;
|
|
2928
|
+
var isClickDropdownContents = dropdownElement.contains(clickTarget);
|
|
2929
|
+
if (!isClickTriggerElement && !isClickDropdownContents) {
|
|
2930
|
+
var elems_1 = this._document.querySelectorAll('dr-dropdown');
|
|
2931
|
+
setTimeout(function () { return elems_1.forEach(function (item) { return item.remove(); }); }, 100);
|
|
2912
2932
|
}
|
|
2913
2933
|
};
|
|
2914
2934
|
DrDropdownDirective.prototype.showMenu = function (options) {
|
|
@@ -2946,6 +2966,7 @@
|
|
|
2946
2966
|
contentCmpRef: [{ type: i0.ViewChild, args: [DrDropdownComponent, { static: true, read: i0.ViewContainerRef },] }],
|
|
2947
2967
|
elementHover: [{ type: i0.HostListener, args: ['mouseenter',] }],
|
|
2948
2968
|
elementClick: [{ type: i0.HostListener, args: ['click',] }],
|
|
2969
|
+
leaveDropdownTriggerElement: [{ type: i0.HostListener, args: ['mouseleave',] }],
|
|
2949
2970
|
documentClick: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
2950
2971
|
};
|
|
2951
2972
|
|