@trudb/tru-common-lib 0.1.803 → 0.1.804
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.
|
@@ -3944,8 +3944,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3944
3944
|
|
|
3945
3945
|
class TruToolbarMenuItem {
|
|
3946
3946
|
config;
|
|
3947
|
+
isMouseDown = false;
|
|
3947
3948
|
maxHeight = 200;
|
|
3948
|
-
constructor() {
|
|
3949
|
+
constructor() {
|
|
3950
|
+
document.addEventListener('mousedown', this.mouseDown);
|
|
3951
|
+
document.addEventListener('mouseup', this.mouseUp);
|
|
3952
|
+
document.addEventListener('mousemove', this.mouseMove);
|
|
3953
|
+
}
|
|
3954
|
+
mouseDown = (event) => {
|
|
3955
|
+
this.isMouseDown = true;
|
|
3956
|
+
};
|
|
3957
|
+
mouseUp = (event) => {
|
|
3958
|
+
this.isMouseDown = false;
|
|
3959
|
+
};
|
|
3960
|
+
mouseMove = (event) => {
|
|
3961
|
+
let target = event.target;
|
|
3962
|
+
if (target && target.classList.contains('desktop-window-resizable-handle') && this.isMouseDown) {
|
|
3963
|
+
this.maxHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) - 40;
|
|
3964
|
+
console.log(event);
|
|
3965
|
+
}
|
|
3966
|
+
};
|
|
3949
3967
|
onClick = (event) => {
|
|
3950
3968
|
var target = event.target;
|
|
3951
3969
|
var isActive = target.classList.contains('is-active');
|
|
@@ -3955,8 +3973,12 @@ class TruToolbarMenuItem {
|
|
|
3955
3973
|
else {
|
|
3956
3974
|
target.classList.add('is-active');
|
|
3957
3975
|
}
|
|
3958
|
-
this.maxHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) - 40;
|
|
3959
3976
|
};
|
|
3977
|
+
ngOnDestroy() {
|
|
3978
|
+
document.removeEventListener('mousedown', this.mouseDown);
|
|
3979
|
+
document.removeEventListener('mousemove', this.mouseMove);
|
|
3980
|
+
document.removeEventListener('mouseup', this.mouseUp);
|
|
3981
|
+
}
|
|
3960
3982
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruToolbarMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3961
3983
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruToolbarMenuItem, isStandalone: true, selector: "tru-toolbar-menu-item", inputs: { config: "config" }, ngImport: i0, template: "<div (click)=\"onClick($event)\">\r\n <p *ngIf=\"config.menuLabel\">{{config.menuLabel}}</p>\r\n <i *ngIf=\"config.menuIcon\" class=\"{{config.menuIcon}} sub-menu-icon\" tabindex=\"-1\"></i>\r\n <div class=\"sub-menu\" *ngIf=\"config.choices\" [style.maxHeight.px]=\"[maxHeight]\">\r\n <ul class=\"sub-menu-nav\">\r\n <li *ngFor=\"let choice of config.choices\">\r\n <p *ngIf=\"choice.separator && choice.title\" class=\"separator-title\">{{choice.title}}</p>\r\n <hr *ngIf=\"choice.separator\" />\r\n <div style=\"display: none\" *ngIf=\"choice?.openOnStart\">{{choice?.openOnStart | openOnStart}}</div>\r\n <button *ngIf=\"!choice.separator\" tabindex=\"-1\" (click)=\"choice.fire()\" [disabled]=\"!choice.enabled()\">{{choice.label}}</button>\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n", styles: [".menu{padding:0 10px;border-bottom:1px solid #6b6b6b;background:#f7f7f7;height:26px}.menu,.menu a{color:#000}.menu-nav{float:left;height:26px}.menu-nav>*{margin-right:0}.menu-nav>*>a{padding:0 10px;height:20px;line-height:19px;display:block;margin:3px 2px 2px}.menu-nav>*>a:hover{background:#959595}.menu-nav>*:active>a{color:#fff}.menu-nav select::-ms-expand{display:none}.menu-nav{margin:0;list-style:none;padding:0}.menu-nav>*{float:left;position:relative;margin:0 .5em 0 0;line-height:1}.menu-nav>*:last-child{margin-right:0}li.has-sub-menu{padding:0 5px}.has-sub-menu{position:relative;cursor:pointer}.has-sub-menu button{background:transparent;border:none;text-decoration:none;cursor:pointer;display:block;width:100%;text-align:left;outline:none;padding:0 10px!important}.has-sub-menu p{background:transparent;border:none;text-decoration:none;cursor:pointer;display:block;width:100%;text-align:left;outline:none;padding:0 10px!important;line-height:26px;pointer-events:none}.has-sub-menu p.separator-title{padding:0!important;font-size:12px;color:#ababab}.has-sub-menu:hover{background:#959595}\n", "p{margin:0;line-height:26px;pointer-events:none}.sub-menu{display:none;position:absolute;left:-1px;min-width:200px;padding:5px 0;background:#fff;border:1px solid #d5d5d5;border-top:none;z-index:99999999;overflow-y:auto}.sub-menu-nav a{display:block;padding:0 20px;line-height:1.5}.sub-menu-nav a:hover{background:#959595;color:#fff}.sub-menu-nav hr{margin:0;color:#dedede}.sub-menu button{background:#fff;border:none;text-decoration:none;cursor:pointer;display:block;padding:0 20px!important;line-height:1.5;width:100%;text-align:left;outline:none;white-space:nowrap;overflow:hidden;font-size:12px}.sub-menu button:hover{background:#959595;color:#fff}.sub-menu button:disabled{background:#fff;color:#000;opacity:.5}.sub-menu-nav>li{position:relative;padding:0 3px}.sub-menu-nav>li:hover>.sub-menu{display:block;top:-6px;left:190px;border:1px solid #d5d5d5}.sub-menu-nav{margin:0;padding:0;list-style:none}.sub-menu-nav>*+*{display:block;margin-top:5px}.sub-menu-icon{font-size:18px;line-height:22px;vertical-align:middle;pointer-events:none}.is-active div.sub-menu{display:block}.sub-menu-nav p.separator-title{padding:0!important;font-size:12px;color:#ababab}.sub-menu-nav hr{margin:0;color:#dedede;border:0;border-top:1px solid #dfdfdf;border-bottom:1px solid #fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: TruOpenOnStart, name: "openOnStart" }] });
|
|
3962
3984
|
}
|