@sebgroup/green-angular 1.8.4 → 1.8.5
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 +8 -7
- package/esm2020/lib/context-menu/context-menu.constants.mjs +3 -0
- package/esm2020/lib/modal/modal.component.mjs +7 -2
- package/fesm2015/sebgroup-green-angular.mjs +15 -7
- package/fesm2015/sebgroup-green-angular.mjs.map +1 -1
- package/fesm2020/sebgroup-green-angular.mjs +15 -7
- package/fesm2020/sebgroup-green-angular.mjs.map +1 -1
- package/lib/context-menu/context-menu.component.d.ts +3 -3
- package/lib/context-menu/context-menu.constants.d.ts +2 -0
- package/package.json +3 -3
|
@@ -313,6 +313,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
313
313
|
}]
|
|
314
314
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
315
315
|
|
|
316
|
+
const CONTEXT_MENU_TOP = '0px';
|
|
317
|
+
const CONTEXT_MENU_LEFT = '0px';
|
|
318
|
+
|
|
316
319
|
class NggContextMenuComponent {
|
|
317
320
|
constructor(changeDetectorRef, elementRef, closeContextMenu) {
|
|
318
321
|
this.changeDetectorRef = changeDetectorRef;
|
|
@@ -325,15 +328,14 @@ class NggContextMenuComponent {
|
|
|
325
328
|
this.closeOnScroll = false;
|
|
326
329
|
this.contextMenuItemClicked = new EventEmitter();
|
|
327
330
|
this.isActive = false;
|
|
328
|
-
this.top =
|
|
329
|
-
this.left =
|
|
331
|
+
this.top = CONTEXT_MENU_TOP;
|
|
332
|
+
this.left = CONTEXT_MENU_LEFT;
|
|
330
333
|
}
|
|
331
334
|
onDocumentClick(target) {
|
|
332
335
|
if (!this.isActive) {
|
|
333
336
|
return;
|
|
334
337
|
}
|
|
335
|
-
|
|
336
|
-
if (!contextMenuElement.contains(target)) {
|
|
338
|
+
if (!this.elementRef.nativeElement.contains(target)) {
|
|
337
339
|
this.close();
|
|
338
340
|
}
|
|
339
341
|
}
|
|
@@ -357,8 +359,7 @@ class NggContextMenuComponent {
|
|
|
357
359
|
this.close();
|
|
358
360
|
return;
|
|
359
361
|
}
|
|
360
|
-
const
|
|
361
|
-
const buttonRect = anchor.getBoundingClientRect();
|
|
362
|
+
const buttonRect = this.anchor?.nativeElement.getBoundingClientRect();
|
|
362
363
|
const gapBetweenButtonAndPopover = 3;
|
|
363
364
|
const left = this.calculateLeft(this.direction, buttonRect);
|
|
364
365
|
const top = buttonRect.bottom + gapBetweenButtonAndPopover;
|
|
@@ -368,6 +369,8 @@ class NggContextMenuComponent {
|
|
|
368
369
|
}
|
|
369
370
|
close() {
|
|
370
371
|
this.isActive = false;
|
|
372
|
+
this.top = CONTEXT_MENU_TOP;
|
|
373
|
+
this.left = CONTEXT_MENU_LEFT;
|
|
371
374
|
this.changeDetectorRef.markForCheck();
|
|
372
375
|
}
|
|
373
376
|
onItemClick(item) {
|
|
@@ -977,7 +980,12 @@ class NggModalComponent {
|
|
|
977
980
|
if (this.trapFocus) {
|
|
978
981
|
this.enableFocusTrap();
|
|
979
982
|
}
|
|
980
|
-
disableBodyScroll(this.ref.nativeElement
|
|
983
|
+
disableBodyScroll(this.ref.nativeElement, {
|
|
984
|
+
allowTouchMove: (el) => {
|
|
985
|
+
// Allow touchmove for elements inside modal, its required for scroll to work on iOS devices
|
|
986
|
+
return this.ref.nativeElement.contains(el);
|
|
987
|
+
}
|
|
988
|
+
});
|
|
981
989
|
}
|
|
982
990
|
else {
|
|
983
991
|
this.disableFocusTrap();
|