@sebgroup/green-angular 1.8.2 → 1.8.4
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/esm2020/lib/context-menu/context-menu.component.mjs +6 -9
- package/fesm2015/sebgroup-green-angular.mjs +5 -8
- package/fesm2015/sebgroup-green-angular.mjs.map +1 -1
- package/fesm2020/sebgroup-green-angular.mjs +5 -8
- package/fesm2020/sebgroup-green-angular.mjs.map +1 -1
- package/lib/context-menu/context-menu.component.d.ts +0 -1
- package/package.json +2 -2
|
@@ -359,11 +359,11 @@ class NggContextMenuComponent {
|
|
|
359
359
|
}
|
|
360
360
|
const anchor = this.anchor?.nativeElement;
|
|
361
361
|
const buttonRect = anchor.getBoundingClientRect();
|
|
362
|
-
const left = this.calculateLeft(this.direction, buttonRect);
|
|
363
|
-
const top = this.calculateTop(buttonRect.bottom);
|
|
364
362
|
const gapBetweenButtonAndPopover = 3;
|
|
363
|
+
const left = this.calculateLeft(this.direction, buttonRect);
|
|
364
|
+
const top = buttonRect.bottom + gapBetweenButtonAndPopover;
|
|
365
365
|
this.left = `${left}px`;
|
|
366
|
-
this.top = `${top
|
|
366
|
+
this.top = `${top}px`;
|
|
367
367
|
this.isActive = true;
|
|
368
368
|
}
|
|
369
369
|
close() {
|
|
@@ -385,9 +385,6 @@ class NggContextMenuComponent {
|
|
|
385
385
|
break;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
calculateTop(buttonRectBottom) {
|
|
389
|
-
return buttonRectBottom + window.pageYOffset;
|
|
390
|
-
}
|
|
391
388
|
calculateLeft(direction, buttonRect) {
|
|
392
389
|
const popover = this.popover?.nativeElement;
|
|
393
390
|
const popoverWidth = popover?.offsetWidth || 0;
|
|
@@ -405,10 +402,10 @@ class NggContextMenuComponent {
|
|
|
405
402
|
}
|
|
406
403
|
}
|
|
407
404
|
NggContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NggContextMenuComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: ON_SCROLL_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
408
|
-
NggContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NggContextMenuComponent, selector: "ngg-context-menu", inputs: { direction: "direction", menuItems: "menuItems", menuItemTemplate: "menuItemTemplate", menuAnchorTemplate: "menuAnchorTemplate", closeOnScroll: "closeOnScroll" }, outputs: { contextMenuItemClicked: "contextMenuItemClicked" }, host: { listeners: { "document:click": "onDocumentClick($event.target)" } }, viewQueries: [{ propertyName: "popover", first: true, predicate: ["contextMenuPopover"], descendants: true }, { propertyName: "anchor", first: true, predicate: ["contextMenuAnchor"], descendants: true }], ngImport: i0, template: "<button\n #contextMenuAnchor\n class=\"ghost small px-3\"\n [class.active]=\"isActive\"\n (click)=\"open()\"\n>\n <ng-container\n [ngTemplateOutlet]=\"menuAnchorTemplate ?? defaultButtonTemplate\"\n >\n </ng-container>\n</button>\n\n<div\n class=\"popover popover-context-menu\"\n
|
|
405
|
+
NggContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NggContextMenuComponent, selector: "ngg-context-menu", inputs: { direction: "direction", menuItems: "menuItems", menuItemTemplate: "menuItemTemplate", menuAnchorTemplate: "menuAnchorTemplate", closeOnScroll: "closeOnScroll" }, outputs: { contextMenuItemClicked: "contextMenuItemClicked" }, host: { listeners: { "document:click": "onDocumentClick($event.target)" } }, viewQueries: [{ propertyName: "popover", first: true, predicate: ["contextMenuPopover"], descendants: true }, { propertyName: "anchor", first: true, predicate: ["contextMenuAnchor"], descendants: true }], ngImport: i0, template: "<button\n #contextMenuAnchor\n class=\"ghost small px-3\"\n [class.active]=\"isActive\"\n (click)=\"open()\"\n>\n <ng-container\n [ngTemplateOutlet]=\"menuAnchorTemplate ?? defaultButtonTemplate\"\n >\n </ng-container>\n</button>\n\n<div class=\"context-menu-overlay\">\n <div\n class=\"popover popover-context-menu\"\n [class.active]=\"isActive\"\n [style.top]=\"top\"\n [style.left]=\"left\"\n #contextMenuPopover\n >\n <ul role=\"listbox\">\n <li\n *ngFor=\"let menuItem of menuItems\"\n (click)=\"onItemClick(menuItem)\"\n tabindex=\"0\"\n (keydown)=\"onMenuItemKeyDown($event, menuItem)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"menuItemTemplate ?? defaultMenuItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: menuItem }\"\n >\n </ng-container>\n </li>\n </ul>\n </div>\n</div>\n\n<ng-template #defaultMenuItemTemplate let-menuItem>\n <span>{{ menuItem.label }}</span>\n</ng-template>\n\n<ng-template #defaultButtonTemplate>\n <i class=\"sg-icon sg-icon-ellipsis\">Open context menu</i>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
409
406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NggContextMenuComponent, decorators: [{
|
|
410
407
|
type: Component,
|
|
411
|
-
args: [{ selector: 'ngg-context-menu', template: "<button\n #contextMenuAnchor\n class=\"ghost small px-3\"\n [class.active]=\"isActive\"\n (click)=\"open()\"\n>\n <ng-container\n [ngTemplateOutlet]=\"menuAnchorTemplate ?? defaultButtonTemplate\"\n >\n </ng-container>\n</button>\n\n<div\n class=\"popover popover-context-menu\"\n
|
|
408
|
+
args: [{ selector: 'ngg-context-menu', template: "<button\n #contextMenuAnchor\n class=\"ghost small px-3\"\n [class.active]=\"isActive\"\n (click)=\"open()\"\n>\n <ng-container\n [ngTemplateOutlet]=\"menuAnchorTemplate ?? defaultButtonTemplate\"\n >\n </ng-container>\n</button>\n\n<div class=\"context-menu-overlay\">\n <div\n class=\"popover popover-context-menu\"\n [class.active]=\"isActive\"\n [style.top]=\"top\"\n [style.left]=\"left\"\n #contextMenuPopover\n >\n <ul role=\"listbox\">\n <li\n *ngFor=\"let menuItem of menuItems\"\n (click)=\"onItemClick(menuItem)\"\n tabindex=\"0\"\n (keydown)=\"onMenuItemKeyDown($event, menuItem)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"menuItemTemplate ?? defaultMenuItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: menuItem }\"\n >\n </ng-container>\n </li>\n </ul>\n </div>\n</div>\n\n<ng-template #defaultMenuItemTemplate let-menuItem>\n <span>{{ menuItem.label }}</span>\n</ng-template>\n\n<ng-template #defaultButtonTemplate>\n <i class=\"sg-icon sg-icon-ellipsis\">Open context menu</i>\n</ng-template>\n" }]
|
|
412
409
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2.Subject, decorators: [{
|
|
413
410
|
type: Optional
|
|
414
411
|
}, {
|