@datarailsshared/datarailsshared 1.3.36 → 1.3.37

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.
@@ -2926,6 +2926,7 @@
2926
2926
  if (data) {
2927
2927
  this.option = data.option;
2928
2928
  this.position = data.position;
2929
+ this.drDropdownInHover = data.drDropdownInHover;
2929
2930
  this.containerClass = data.class;
2930
2931
  this.list = data.list || [];
2931
2932
  this.list.forEach(function (item) {
@@ -2944,6 +2945,10 @@
2944
2945
  enumerable: false,
2945
2946
  configurable: true
2946
2947
  });
2948
+ DrDropdownComponent.prototype.onMouseLeave = function () {
2949
+ if (this.drDropdownInHover)
2950
+ this.menuService.destroy();
2951
+ };
2947
2952
  DrDropdownComponent.prototype.onClickedOutside = function () {
2948
2953
  if (this.firstInit) {
2949
2954
  this.menuService.destroy();
@@ -3008,7 +3013,7 @@
3008
3013
  DrDropdownComponent.decorators = [
3009
3014
  { type: i0.Component, args: [{
3010
3015
  selector: 'dr-dropdown',
3011
- template: "<div #menuContainer\r\n (clickOutside)=\"onClickedOutside()\"\r\n [drDropdownPosition]=\"option\"\r\n #dropdownPosition=\"dropdownPosition\"\r\n [position]=\"position\"\r\n [class]=\"containerClass\"\r\n class=\"dr-dropdown\">\r\n <div class=\"dr-dropdown__container\">\r\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\r\n (click)=\"action(act)\"\r\n [drTooltip]=\"tooltipToShow(act)\"\r\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\r\n [drTooltipOptions]=\"{ withoutArrow: true }\"\r\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\r\n class=\"dr-dropdown__container__item\"\r\n [class.item-disabled]=\"disabled(act)\"\r\n [class.item-selected]=\"selected(act)\">\r\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\r\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\r\n <i *ngFor=\"let actionIcon of act.actionIcons\"\r\n [class]=\"actionIcon.icon\"\r\n [class.showOnHover]=\"actionIcon.showOnHover\"\r\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\r\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\r\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\r\n </div>\r\n </div>\r\n</div>\r\n",
3016
+ template: "<div #menuContainer\r\n (mouseleave)=\"onMouseLeave()\"\r\n (clickOutside)=\"onClickedOutside()\"\r\n [drDropdownPosition]=\"option\"\r\n #dropdownPosition=\"dropdownPosition\"\r\n [position]=\"position\"\r\n [class]=\"containerClass\"\r\n class=\"dr-dropdown\">\r\n <div class=\"dr-dropdown__container\">\r\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\r\n (click)=\"action(act)\"\r\n [drTooltip]=\"tooltipToShow(act)\"\r\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\r\n [drTooltipOptions]=\"{ withoutArrow: true }\"\r\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\r\n class=\"dr-dropdown__container__item\"\r\n [class.item-disabled]=\"disabled(act)\"\r\n [class.item-selected]=\"selected(act)\">\r\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\r\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\r\n <i *ngFor=\"let actionIcon of act.actionIcons\"\r\n [class]=\"actionIcon.icon\"\r\n [class.showOnHover]=\"actionIcon.showOnHover\"\r\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\r\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\r\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\r\n </div>\r\n </div>\r\n</div>\r\n",
3012
3017
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
3013
3018
  styles: ["::ng-deep .dr-dropdown__container__item .dr-dropdown{visibility:hidden}::ng-deep .dr-dropdown__container__item:hover .dr-dropdown{visibility:visible}::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:hover{background-color:#f6f7f8}.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 .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(45%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
3014
3019
  },] }
@@ -3032,7 +3037,18 @@
3032
3037
  this._document = _document;
3033
3038
  this.position = 'left';
3034
3039
  }
3040
+ DrDropdownDirective.prototype.elementHover = function () {
3041
+ if (!this.drDropdownInHover)
3042
+ return;
3043
+ this.openDropdown();
3044
+ };
3035
3045
  DrDropdownDirective.prototype.elementClick = function () {
3046
+ this.openDropdown();
3047
+ };
3048
+ DrDropdownDirective.prototype.documentClick = function (e) {
3049
+ this.closeDropdown(e);
3050
+ };
3051
+ DrDropdownDirective.prototype.openDropdown = function () {
3036
3052
  var option = this.el.nativeElement.getBoundingClientRect();
3037
3053
  this._document.querySelectorAll('dr-dropdown').forEach(function (item) { return item.remove(); });
3038
3054
  if (this.contentCmpRef && this.contentCmpRef.destroyCbs) {
@@ -3043,13 +3059,14 @@
3043
3059
  this.service.destroy();
3044
3060
  this.showMenu({
3045
3061
  option: option,
3062
+ drDropdownInHover: this.drDropdownInHover,
3046
3063
  position: this.position,
3047
3064
  list: this.drDropdown,
3048
3065
  class: this.drDropdownClass
3049
3066
  });
3050
3067
  }
3051
3068
  };
3052
- DrDropdownDirective.prototype.documentClick = function (e) {
3069
+ DrDropdownDirective.prototype.closeDropdown = function (e) {
3053
3070
  var menuItem = e.target.classList;
3054
3071
  if (menuItem.contains('dr-dropdown__container__item') || menuItem.contains('dr-dropdown__container__item__text')) {
3055
3072
  return;
@@ -3090,7 +3107,9 @@
3090
3107
  position: [{ type: i0.Input }],
3091
3108
  drDropdown: [{ type: i0.Input }],
3092
3109
  drDropdownClass: [{ type: i0.Input }],
3110
+ drDropdownInHover: [{ type: i0.Input }],
3093
3111
  contentCmpRef: [{ type: i0.ViewChild, args: [DrDropdownComponent, { static: true, read: i0.ViewContainerRef },] }],
3112
+ elementHover: [{ type: i0.HostListener, args: ['mouseenter',] }],
3094
3113
  elementClick: [{ type: i0.HostListener, args: ['click',] }],
3095
3114
  documentClick: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
3096
3115
  };