ngx-contextmenu.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. import { Overlay, ScrollStrategyOptions, OverlayModule } from '@angular/cdk/overlay';
  2. import { CommonModule } from '@angular/common';
  3. import { EventEmitter, Directive, TemplateRef, ElementRef, Input, Output, InjectionToken, QueryList, Component, ChangeDetectorRef, Optional, Inject, ViewChild, ViewChildren, HostListener, Injectable, ViewEncapsulation, ContentChildren, NgModule } from '@angular/core';
  4. import { __assign } from 'tslib';
  5. import { Subscription, Subject } from 'rxjs';
  6. import { first } from 'rxjs/operators';
  7. import { ComponentPortal } from '@angular/cdk/portal';
  8. import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
  9. /**
  10. * @fileoverview added by tsickle
  11. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12. */
  13. var ContextMenuItemDirective = /** @class */ (function () {
  14. function ContextMenuItemDirective(template, elementRef) {
  15. this.template = template;
  16. this.elementRef = elementRef;
  17. this.divider = false;
  18. this.enabled = true;
  19. this.passive = false;
  20. this.visible = true;
  21. this.execute = new EventEmitter();
  22. this.isActive = false;
  23. }
  24. Object.defineProperty(ContextMenuItemDirective.prototype, "disabled", {
  25. get: /**
  26. * @return {?}
  27. */
  28. function () {
  29. return this.passive ||
  30. this.divider ||
  31. !this.evaluateIfFunction(this.enabled, this.currentItem);
  32. },
  33. enumerable: true,
  34. configurable: true
  35. });
  36. /**
  37. * @param {?} value
  38. * @param {?} item
  39. * @return {?}
  40. */
  41. ContextMenuItemDirective.prototype.evaluateIfFunction = /**
  42. * @param {?} value
  43. * @param {?} item
  44. * @return {?}
  45. */
  46. function (value, item) {
  47. if (value instanceof Function) {
  48. return value(item);
  49. }
  50. return value;
  51. };
  52. /**
  53. * @return {?}
  54. */
  55. ContextMenuItemDirective.prototype.setActiveStyles = /**
  56. * @return {?}
  57. */
  58. function () {
  59. this.isActive = true;
  60. };
  61. /**
  62. * @return {?}
  63. */
  64. ContextMenuItemDirective.prototype.setInactiveStyles = /**
  65. * @return {?}
  66. */
  67. function () {
  68. this.isActive = false;
  69. };
  70. /**
  71. * @param {?} item
  72. * @param {?=} $event
  73. * @return {?}
  74. */
  75. ContextMenuItemDirective.prototype.triggerExecute = /**
  76. * @param {?} item
  77. * @param {?=} $event
  78. * @return {?}
  79. */
  80. function (item, $event) {
  81. if (!this.evaluateIfFunction(this.enabled, item)) {
  82. return;
  83. }
  84. this.execute.emit({ event: $event, item: item });
  85. };
  86. ContextMenuItemDirective.decorators = [
  87. { type: Directive, args: [{
  88. /* tslint:disable:directive-selector-type */
  89. selector: '[contextMenuItem]',
  90. },] }
  91. ];
  92. /** @nocollapse */
  93. ContextMenuItemDirective.ctorParameters = function () { return [
  94. { type: TemplateRef },
  95. { type: ElementRef }
  96. ]; };
  97. ContextMenuItemDirective.propDecorators = {
  98. subMenu: [{ type: Input }],
  99. divider: [{ type: Input }],
  100. enabled: [{ type: Input }],
  101. passive: [{ type: Input }],
  102. visible: [{ type: Input }],
  103. execute: [{ type: Output }]
  104. };
  105. return ContextMenuItemDirective;
  106. }());
  107. if (false) {
  108. /** @type {?} */
  109. ContextMenuItemDirective.prototype.subMenu;
  110. /** @type {?} */
  111. ContextMenuItemDirective.prototype.divider;
  112. /** @type {?} */
  113. ContextMenuItemDirective.prototype.enabled;
  114. /** @type {?} */
  115. ContextMenuItemDirective.prototype.passive;
  116. /** @type {?} */
  117. ContextMenuItemDirective.prototype.visible;
  118. /** @type {?} */
  119. ContextMenuItemDirective.prototype.execute;
  120. /** @type {?} */
  121. ContextMenuItemDirective.prototype.currentItem;
  122. /** @type {?} */
  123. ContextMenuItemDirective.prototype.isActive;
  124. /** @type {?} */
  125. ContextMenuItemDirective.prototype.template;
  126. /** @type {?} */
  127. ContextMenuItemDirective.prototype.elementRef;
  128. }
  129. /**
  130. * @fileoverview added by tsickle
  131. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  132. */
  133. /** @type {?} */
  134. var CONTEXT_MENU_OPTIONS = new InjectionToken('CONTEXT_MENU_OPTIONS');
  135. /**
  136. * @fileoverview added by tsickle
  137. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  138. */
  139. /**
  140. * @record
  141. */
  142. function ILinkConfig() { }
  143. if (false) {
  144. /** @type {?} */
  145. ILinkConfig.prototype.click;
  146. /** @type {?|undefined} */
  147. ILinkConfig.prototype.enabled;
  148. /** @type {?} */
  149. ILinkConfig.prototype.html;
  150. }
  151. /** @type {?} */
  152. var ARROW_LEFT_KEYCODE = 37;
  153. var ContextMenuContentComponent = /** @class */ (function () {
  154. function ContextMenuContentComponent(changeDetector, elementRef, options) {
  155. this.changeDetector = changeDetector;
  156. this.elementRef = elementRef;
  157. this.options = options;
  158. this.menuItems = [];
  159. this.isLeaf = false;
  160. this.execute = new EventEmitter();
  161. this.openSubMenu = new EventEmitter();
  162. this.closeLeafMenu = new EventEmitter();
  163. this.closeAllMenus = new EventEmitter();
  164. this.autoFocus = false;
  165. this.useBootstrap4 = false;
  166. this.subscription = new Subscription();
  167. if (options) {
  168. this.autoFocus = options.autoFocus;
  169. this.useBootstrap4 = options.useBootstrap4;
  170. }
  171. }
  172. /**
  173. * @return {?}
  174. */
  175. ContextMenuContentComponent.prototype.ngOnInit = /**
  176. * @return {?}
  177. */
  178. function () {
  179. var _this = this;
  180. this.menuItems.forEach((/**
  181. * @param {?} menuItem
  182. * @return {?}
  183. */
  184. function (menuItem) {
  185. menuItem.currentItem = _this.item;
  186. _this.subscription.add(menuItem.execute.subscribe((/**
  187. * @param {?} event
  188. * @return {?}
  189. */
  190. function (event) {
  191. return _this.execute.emit(__assign({}, event, { menuItem: menuItem }));
  192. })));
  193. }));
  194. /** @type {?} */
  195. var queryList = new QueryList();
  196. queryList.reset(this.menuItems);
  197. this._keyManager = new ActiveDescendantKeyManager(queryList).withWrap();
  198. };
  199. /**
  200. * @return {?}
  201. */
  202. ContextMenuContentComponent.prototype.ngAfterViewInit = /**
  203. * @return {?}
  204. */
  205. function () {
  206. var _this = this;
  207. if (this.autoFocus) {
  208. setTimeout((/**
  209. * @return {?}
  210. */
  211. function () { return _this.focus(); }));
  212. }
  213. this.overlay.updatePosition();
  214. };
  215. /**
  216. * @return {?}
  217. */
  218. ContextMenuContentComponent.prototype.ngOnDestroy = /**
  219. * @return {?}
  220. */
  221. function () {
  222. this.subscription.unsubscribe();
  223. };
  224. /**
  225. * @return {?}
  226. */
  227. ContextMenuContentComponent.prototype.focus = /**
  228. * @return {?}
  229. */
  230. function () {
  231. if (this.autoFocus) {
  232. this.menuElement.nativeElement.focus();
  233. }
  234. };
  235. /**
  236. * @param {?} $event
  237. * @return {?}
  238. */
  239. ContextMenuContentComponent.prototype.stopEvent = /**
  240. * @param {?} $event
  241. * @return {?}
  242. */
  243. function ($event) {
  244. $event.stopPropagation();
  245. };
  246. /**
  247. * @param {?} menuItem
  248. * @return {?}
  249. */
  250. ContextMenuContentComponent.prototype.isMenuItemEnabled = /**
  251. * @param {?} menuItem
  252. * @return {?}
  253. */
  254. function (menuItem) {
  255. return this.evaluateIfFunction(menuItem && menuItem.enabled);
  256. };
  257. /**
  258. * @param {?} menuItem
  259. * @return {?}
  260. */
  261. ContextMenuContentComponent.prototype.isMenuItemVisible = /**
  262. * @param {?} menuItem
  263. * @return {?}
  264. */
  265. function (menuItem) {
  266. return this.evaluateIfFunction(menuItem && menuItem.visible);
  267. };
  268. /**
  269. * @param {?} value
  270. * @return {?}
  271. */
  272. ContextMenuContentComponent.prototype.evaluateIfFunction = /**
  273. * @param {?} value
  274. * @return {?}
  275. */
  276. function (value) {
  277. if (value instanceof Function) {
  278. return value(this.item);
  279. }
  280. return value;
  281. };
  282. /**
  283. * @param {?} link
  284. * @return {?}
  285. */
  286. ContextMenuContentComponent.prototype.isDisabled = /**
  287. * @param {?} link
  288. * @return {?}
  289. */
  290. function (link) {
  291. return link.enabled && !link.enabled(this.item);
  292. };
  293. /**
  294. * @param {?} event
  295. * @return {?}
  296. */
  297. ContextMenuContentComponent.prototype.onKeyEvent = /**
  298. * @param {?} event
  299. * @return {?}
  300. */
  301. function (event) {
  302. if (!this.isLeaf) {
  303. return;
  304. }
  305. this._keyManager.onKeydown(event);
  306. };
  307. /**
  308. * @param {?=} event
  309. * @return {?}
  310. */
  311. ContextMenuContentComponent.prototype.keyboardOpenSubMenu = /**
  312. * @param {?=} event
  313. * @return {?}
  314. */
  315. function (event) {
  316. if (!this.isLeaf) {
  317. return;
  318. }
  319. this.cancelEvent(event);
  320. /** @type {?} */
  321. var menuItem = this.menuItems[this._keyManager.activeItemIndex];
  322. if (menuItem) {
  323. this.onOpenSubMenu(menuItem);
  324. }
  325. };
  326. /**
  327. * @param {?=} event
  328. * @return {?}
  329. */
  330. ContextMenuContentComponent.prototype.keyboardMenuItemSelect = /**
  331. * @param {?=} event
  332. * @return {?}
  333. */
  334. function (event) {
  335. if (!this.isLeaf) {
  336. return;
  337. }
  338. this.cancelEvent(event);
  339. /** @type {?} */
  340. var menuItem = this.menuItems[this._keyManager.activeItemIndex];
  341. if (menuItem) {
  342. this.onMenuItemSelect(menuItem, event);
  343. }
  344. };
  345. /**
  346. * @param {?} event
  347. * @return {?}
  348. */
  349. ContextMenuContentComponent.prototype.onCloseLeafMenu = /**
  350. * @param {?} event
  351. * @return {?}
  352. */
  353. function (event) {
  354. if (!this.isLeaf) {
  355. return;
  356. }
  357. this.cancelEvent(event);
  358. this.closeLeafMenu.emit({
  359. exceptRootMenu: event.keyCode === ARROW_LEFT_KEYCODE,
  360. event: event
  361. });
  362. };
  363. /**
  364. * @param {?} event
  365. * @return {?}
  366. */
  367. ContextMenuContentComponent.prototype.closeMenu = /**
  368. * @param {?} event
  369. * @return {?}
  370. */
  371. function (event) {
  372. if (event.type === 'click' && event.button === 2) {
  373. return;
  374. }
  375. this.closeAllMenus.emit({ event: event });
  376. };
  377. /**
  378. * @param {?} menuItem
  379. * @param {?=} event
  380. * @return {?}
  381. */
  382. ContextMenuContentComponent.prototype.onOpenSubMenu = /**
  383. * @param {?} menuItem
  384. * @param {?=} event
  385. * @return {?}
  386. */
  387. function (menuItem, event) {
  388. /** @type {?} */
  389. var anchorElementRef = this.menuItemElements.toArray()[this._keyManager.activeItemIndex];
  390. /** @type {?} */
  391. var anchorElement = anchorElementRef && anchorElementRef.nativeElement;
  392. this.openSubMenu.emit({
  393. anchorElement: anchorElement,
  394. contextMenu: menuItem.subMenu,
  395. event: event,
  396. item: this.item,
  397. parentContextMenu: this
  398. });
  399. };
  400. /**
  401. * @param {?} menuItem
  402. * @param {?} event
  403. * @return {?}
  404. */
  405. ContextMenuContentComponent.prototype.onMenuItemSelect = /**
  406. * @param {?} menuItem
  407. * @param {?} event
  408. * @return {?}
  409. */
  410. function (menuItem, event) {
  411. event.preventDefault();
  412. event.stopPropagation();
  413. this.onOpenSubMenu(menuItem, event);
  414. if (!menuItem.subMenu) {
  415. menuItem.triggerExecute(this.item, event);
  416. }
  417. };
  418. /**
  419. * @private
  420. * @param {?} event
  421. * @return {?}
  422. */
  423. ContextMenuContentComponent.prototype.cancelEvent = /**
  424. * @private
  425. * @param {?} event
  426. * @return {?}
  427. */
  428. function (event) {
  429. if (!event) {
  430. return;
  431. }
  432. /** @type {?} */
  433. var target = event.target;
  434. if (['INPUT', 'TEXTAREA', 'SELECT'].indexOf(target.tagName) > -1 ||
  435. target.isContentEditable) {
  436. return;
  437. }
  438. event.preventDefault();
  439. event.stopPropagation();
  440. };
  441. ContextMenuContentComponent.decorators = [
  442. { type: Component, args: [{
  443. selector: 'context-menu-content',
  444. template: "\n <div\n class=\"dropdown open show ngx-contextmenu\"\n [ngClass]=\"menuClass\"\n tabindex=\"0\"\n >\n <ul\n #menu\n class=\"dropdown-menu show\"\n style=\"position: static; float: none;\"\n tabindex=\"0\"\n >\n <li\n #li\n *ngFor=\"let menuItem of menuItems; let i = index\"\n [class.disabled]=\"!isMenuItemEnabled(menuItem)\"\n [class.divider]=\"menuItem.divider\"\n [class.dropdown-divider]=\"useBootstrap4 && menuItem.divider\"\n [class.active]=\"menuItem.isActive && isMenuItemEnabled(menuItem)\"\n [attr.role]=\"menuItem.divider ? 'separator' : undefined\"\n >\n <a\n *ngIf=\"!menuItem.divider && !menuItem.passive\"\n href\n [class.dropdown-item]=\"useBootstrap4\"\n [class.active]=\"menuItem.isActive && isMenuItemEnabled(menuItem)\"\n [class.disabled]=\"useBootstrap4 && !isMenuItemEnabled(menuItem)\"\n [class.hasSubMenu]=\"!!menuItem.subMenu\"\n (click)=\"onMenuItemSelect(menuItem, $event)\"\n (mouseenter)=\"onOpenSubMenu(menuItem, $event)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"menuItem.template\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n </a>\n\n <span\n (click)=\"stopEvent($event)\"\n (contextmenu)=\"stopEvent($event)\"\n class=\"passive\"\n *ngIf=\"!menuItem.divider && menuItem.passive\"\n [class.dropdown-item]=\"useBootstrap4\"\n [class.disabled]=\"useBootstrap4 && !isMenuItemEnabled(menuItem)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"menuItem.template\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-template>\n </span>\n </li>\n </ul>\n </div>\n ",
  445. styles: ["\n .passive {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: @line-height-base;\n white-space: nowrap;\n }\n .hasSubMenu:before {\n content: '\u25B6';\n float: right;\n }\n "]
  446. }] }
  447. ];
  448. /** @nocollapse */
  449. ContextMenuContentComponent.ctorParameters = function () { return [
  450. { type: ChangeDetectorRef },
  451. { type: ElementRef },
  452. { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CONTEXT_MENU_OPTIONS,] }] }
  453. ]; };
  454. ContextMenuContentComponent.propDecorators = {
  455. menuItems: [{ type: Input }],
  456. item: [{ type: Input }],
  457. event: [{ type: Input }],
  458. parentContextMenu: [{ type: Input }],
  459. menuClass: [{ type: Input }],
  460. overlay: [{ type: Input }],
  461. isLeaf: [{ type: Input }],
  462. execute: [{ type: Output }],
  463. openSubMenu: [{ type: Output }],
  464. closeLeafMenu: [{ type: Output }],
  465. closeAllMenus: [{ type: Output }],
  466. menuElement: [{ type: ViewChild, args: ['menu', { static: true },] }],
  467. menuItemElements: [{ type: ViewChildren, args: ['li',] }],
  468. onKeyEvent: [{ type: HostListener, args: ['window:keydown.ArrowDown', ['$event'],] }, { type: HostListener, args: ['window:keydown.ArrowUp', ['$event'],] }],
  469. keyboardOpenSubMenu: [{ type: HostListener, args: ['window:keydown.ArrowRight', ['$event'],] }],
  470. keyboardMenuItemSelect: [{ type: HostListener, args: ['window:keydown.Enter', ['$event'],] }, { type: HostListener, args: ['window:keydown.Space', ['$event'],] }],
  471. onCloseLeafMenu: [{ type: HostListener, args: ['window:keydown.Escape', ['$event'],] }, { type: HostListener, args: ['window:keydown.ArrowLeft', ['$event'],] }],
  472. closeMenu: [{ type: HostListener, args: ['document:click', ['$event'],] }, { type: HostListener, args: ['document:contextmenu', ['$event'],] }]
  473. };
  474. return ContextMenuContentComponent;
  475. }());
  476. if (false) {
  477. /** @type {?} */
  478. ContextMenuContentComponent.prototype.menuItems;
  479. /** @type {?} */
  480. ContextMenuContentComponent.prototype.item;
  481. /** @type {?} */
  482. ContextMenuContentComponent.prototype.event;
  483. /** @type {?} */
  484. ContextMenuContentComponent.prototype.parentContextMenu;
  485. /** @type {?} */
  486. ContextMenuContentComponent.prototype.menuClass;
  487. /** @type {?} */
  488. ContextMenuContentComponent.prototype.overlay;
  489. /** @type {?} */
  490. ContextMenuContentComponent.prototype.isLeaf;
  491. /** @type {?} */
  492. ContextMenuContentComponent.prototype.execute;
  493. /** @type {?} */
  494. ContextMenuContentComponent.prototype.openSubMenu;
  495. /** @type {?} */
  496. ContextMenuContentComponent.prototype.closeLeafMenu;
  497. /** @type {?} */
  498. ContextMenuContentComponent.prototype.closeAllMenus;
  499. /** @type {?} */
  500. ContextMenuContentComponent.prototype.menuElement;
  501. /** @type {?} */
  502. ContextMenuContentComponent.prototype.menuItemElements;
  503. /** @type {?} */
  504. ContextMenuContentComponent.prototype.autoFocus;
  505. /** @type {?} */
  506. ContextMenuContentComponent.prototype.useBootstrap4;
  507. /**
  508. * @type {?}
  509. * @private
  510. */
  511. ContextMenuContentComponent.prototype._keyManager;
  512. /**
  513. * @type {?}
  514. * @private
  515. */
  516. ContextMenuContentComponent.prototype.subscription;
  517. /**
  518. * @type {?}
  519. * @private
  520. */
  521. ContextMenuContentComponent.prototype.changeDetector;
  522. /**
  523. * @type {?}
  524. * @private
  525. */
  526. ContextMenuContentComponent.prototype.elementRef;
  527. /**
  528. * @type {?}
  529. * @private
  530. */
  531. ContextMenuContentComponent.prototype.options;
  532. }
  533. /**
  534. * @fileoverview added by tsickle
  535. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  536. */
  537. /**
  538. * @record
  539. */
  540. function IContextMenuClickEvent() { }
  541. if (false) {
  542. /** @type {?|undefined} */
  543. IContextMenuClickEvent.prototype.anchorElement;
  544. /** @type {?|undefined} */
  545. IContextMenuClickEvent.prototype.contextMenu;
  546. /** @type {?|undefined} */
  547. IContextMenuClickEvent.prototype.event;
  548. /** @type {?|undefined} */
  549. IContextMenuClickEvent.prototype.parentContextMenu;
  550. /** @type {?} */
  551. IContextMenuClickEvent.prototype.item;
  552. /** @type {?|undefined} */
  553. IContextMenuClickEvent.prototype.activeMenuItemIndex;
  554. }
  555. /**
  556. * @record
  557. */
  558. function IContextMenuContext() { }
  559. if (false) {
  560. /** @type {?} */
  561. IContextMenuContext.prototype.menuItems;
  562. /** @type {?} */
  563. IContextMenuContext.prototype.menuClass;
  564. }
  565. /**
  566. * @record
  567. */
  568. function CloseLeafMenuEvent() { }
  569. if (false) {
  570. /** @type {?|undefined} */
  571. CloseLeafMenuEvent.prototype.exceptRootMenu;
  572. /** @type {?|undefined} */
  573. CloseLeafMenuEvent.prototype.event;
  574. }
  575. /**
  576. * @record
  577. */
  578. function OverlayRefWithContextMenu() { }
  579. if (false) {
  580. /** @type {?|undefined} */
  581. OverlayRefWithContextMenu.prototype.contextMenu;
  582. }
  583. /**
  584. * @record
  585. */
  586. function CancelContextMenuEvent() { }
  587. if (false) {
  588. /** @type {?} */
  589. CancelContextMenuEvent.prototype.eventType;
  590. /** @type {?|undefined} */
  591. CancelContextMenuEvent.prototype.event;
  592. }
  593. /**
  594. * @record
  595. */
  596. function ExecuteContextMenuEvent() { }
  597. if (false) {
  598. /** @type {?} */
  599. ExecuteContextMenuEvent.prototype.eventType;
  600. /** @type {?|undefined} */
  601. ExecuteContextMenuEvent.prototype.event;
  602. /** @type {?} */
  603. ExecuteContextMenuEvent.prototype.item;
  604. /** @type {?} */
  605. ExecuteContextMenuEvent.prototype.menuItem;
  606. }
  607. var ContextMenuService = /** @class */ (function () {
  608. function ContextMenuService(overlay, scrollStrategy) {
  609. this.overlay = overlay;
  610. this.scrollStrategy = scrollStrategy;
  611. this.isDestroyingLeafMenu = false;
  612. this.show = new Subject();
  613. this.triggerClose = new Subject();
  614. this.close = new Subject();
  615. this.overlays = [];
  616. this.fakeElement = {
  617. getBoundingClientRect: (/**
  618. * @return {?}
  619. */
  620. function () { return ({
  621. bottom: 0,
  622. height: 0,
  623. left: 0,
  624. right: 0,
  625. top: 0,
  626. width: 0,
  627. }); })
  628. };
  629. }
  630. /**
  631. * @param {?} context
  632. * @return {?}
  633. */
  634. ContextMenuService.prototype.openContextMenu = /**
  635. * @param {?} context
  636. * @return {?}
  637. */
  638. function (context) {
  639. var anchorElement = context.anchorElement, event = context.event, parentContextMenu = context.parentContextMenu;
  640. if (!parentContextMenu) {
  641. /** @type {?} */
  642. var mouseEvent_1 = (/** @type {?} */ (event));
  643. this.fakeElement.getBoundingClientRect = (/**
  644. * @return {?}
  645. */
  646. function () { return ({
  647. bottom: mouseEvent_1.clientY,
  648. height: 0,
  649. left: mouseEvent_1.clientX,
  650. right: mouseEvent_1.clientX,
  651. top: mouseEvent_1.clientY,
  652. width: 0,
  653. }); });
  654. this.closeAllContextMenus({ eventType: 'cancel', event: event });
  655. /** @type {?} */
  656. var positionStrategy = this.overlay.position().connectedTo(new ElementRef(anchorElement || this.fakeElement), { originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' })
  657. .withFallbackPosition({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
  658. .withFallbackPosition({ originX: 'end', originY: 'top' }, { overlayX: 'start', overlayY: 'top' })
  659. .withFallbackPosition({ originX: 'start', originY: 'top' }, { overlayX: 'end', overlayY: 'top' })
  660. .withFallbackPosition({ originX: 'end', originY: 'center' }, { overlayX: 'start', overlayY: 'center' })
  661. .withFallbackPosition({ originX: 'start', originY: 'center' }, { overlayX: 'end', overlayY: 'center' });
  662. this.overlays = [this.overlay.create({
  663. positionStrategy: positionStrategy,
  664. panelClass: 'ngx-contextmenu',
  665. scrollStrategy: this.scrollStrategy.close(),
  666. })];
  667. this.attachContextMenu(this.overlays[0], context);
  668. }
  669. else {
  670. /** @type {?} */
  671. var positionStrategy = this.overlay.position().connectedTo(new ElementRef(event ? event.target : anchorElement), { originX: 'end', originY: 'top' }, { overlayX: 'start', overlayY: 'top' })
  672. .withFallbackPosition({ originX: 'start', originY: 'top' }, { overlayX: 'end', overlayY: 'top' })
  673. .withFallbackPosition({ originX: 'end', originY: 'bottom' }, { overlayX: 'start', overlayY: 'bottom' })
  674. .withFallbackPosition({ originX: 'start', originY: 'bottom' }, { overlayX: 'end', overlayY: 'bottom' });
  675. /** @type {?} */
  676. var newOverlay = this.overlay.create({
  677. positionStrategy: positionStrategy,
  678. panelClass: 'ngx-contextmenu',
  679. scrollStrategy: this.scrollStrategy.close(),
  680. });
  681. this.destroySubMenus(parentContextMenu);
  682. this.overlays = this.overlays.concat(newOverlay);
  683. this.attachContextMenu(newOverlay, context);
  684. }
  685. };
  686. /**
  687. * @param {?} overlay
  688. * @param {?} context
  689. * @return {?}
  690. */
  691. ContextMenuService.prototype.attachContextMenu = /**
  692. * @param {?} overlay
  693. * @param {?} context
  694. * @return {?}
  695. */
  696. function (overlay, context) {
  697. var _this = this;
  698. var event = context.event, item = context.item, menuItems = context.menuItems, menuClass = context.menuClass;
  699. /** @type {?} */
  700. var contextMenuContent = overlay.attach(new ComponentPortal(ContextMenuContentComponent));
  701. contextMenuContent.instance.event = event;
  702. contextMenuContent.instance.item = item;
  703. contextMenuContent.instance.menuItems = menuItems;
  704. contextMenuContent.instance.overlay = overlay;
  705. contextMenuContent.instance.isLeaf = true;
  706. contextMenuContent.instance.menuClass = menuClass;
  707. ((/** @type {?} */ (overlay))).contextMenu = contextMenuContent.instance;
  708. /** @type {?} */
  709. var subscriptions = new Subscription();
  710. subscriptions.add(contextMenuContent.instance.execute.asObservable()
  711. .subscribe((/**
  712. * @param {?} executeEvent
  713. * @return {?}
  714. */
  715. function (executeEvent) { return _this.closeAllContextMenus(__assign({ eventType: 'execute' }, executeEvent)); })));
  716. subscriptions.add(contextMenuContent.instance.closeAllMenus.asObservable()
  717. .subscribe((/**
  718. * @param {?} closeAllEvent
  719. * @return {?}
  720. */
  721. function (closeAllEvent) { return _this.closeAllContextMenus(__assign({ eventType: 'cancel' }, closeAllEvent)); })));
  722. subscriptions.add(contextMenuContent.instance.closeLeafMenu.asObservable()
  723. .subscribe((/**
  724. * @param {?} closeLeafMenuEvent
  725. * @return {?}
  726. */
  727. function (closeLeafMenuEvent) { return _this.destroyLeafMenu(closeLeafMenuEvent); })));
  728. subscriptions.add(contextMenuContent.instance.openSubMenu.asObservable()
  729. .subscribe((/**
  730. * @param {?} subMenuEvent
  731. * @return {?}
  732. */
  733. function (subMenuEvent) {
  734. _this.destroySubMenus(contextMenuContent.instance);
  735. if (!subMenuEvent.contextMenu) {
  736. contextMenuContent.instance.isLeaf = true;
  737. return;
  738. }
  739. contextMenuContent.instance.isLeaf = false;
  740. _this.show.next(subMenuEvent);
  741. })));
  742. contextMenuContent.onDestroy((/**
  743. * @return {?}
  744. */
  745. function () {
  746. menuItems.forEach((/**
  747. * @param {?} menuItem
  748. * @return {?}
  749. */
  750. function (menuItem) { return menuItem.isActive = false; }));
  751. subscriptions.unsubscribe();
  752. }));
  753. contextMenuContent.changeDetectorRef.detectChanges();
  754. };
  755. /**
  756. * @param {?} closeEvent
  757. * @return {?}
  758. */
  759. ContextMenuService.prototype.closeAllContextMenus = /**
  760. * @param {?} closeEvent
  761. * @return {?}
  762. */
  763. function (closeEvent) {
  764. if (this.overlays) {
  765. this.close.next(closeEvent);
  766. this.overlays.forEach((/**
  767. * @param {?} overlay
  768. * @param {?} index
  769. * @return {?}
  770. */
  771. function (overlay, index) {
  772. overlay.detach();
  773. overlay.dispose();
  774. }));
  775. }
  776. this.overlays = [];
  777. };
  778. /**
  779. * @return {?}
  780. */
  781. ContextMenuService.prototype.getLastAttachedOverlay = /**
  782. * @return {?}
  783. */
  784. function () {
  785. /** @type {?} */
  786. var overlay = this.overlays[this.overlays.length - 1];
  787. while (this.overlays.length > 1 && overlay && !overlay.hasAttached()) {
  788. overlay.detach();
  789. overlay.dispose();
  790. this.overlays = this.overlays.slice(0, -1);
  791. overlay = this.overlays[this.overlays.length - 1];
  792. }
  793. return overlay;
  794. };
  795. /**
  796. * @param {?=} __0
  797. * @return {?}
  798. */
  799. ContextMenuService.prototype.destroyLeafMenu = /**
  800. * @param {?=} __0
  801. * @return {?}
  802. */
  803. function (_a) {
  804. var _this = this;
  805. var _b = _a === void 0 ? {} : _a, exceptRootMenu = _b.exceptRootMenu, event = _b.event;
  806. if (this.isDestroyingLeafMenu) {
  807. return;
  808. }
  809. this.isDestroyingLeafMenu = true;
  810. setTimeout((/**
  811. * @return {?}
  812. */
  813. function () {
  814. /** @type {?} */
  815. var overlay = _this.getLastAttachedOverlay();
  816. if (_this.overlays.length > 1 && overlay) {
  817. overlay.detach();
  818. overlay.dispose();
  819. }
  820. if (!exceptRootMenu && _this.overlays.length > 0 && overlay) {
  821. _this.close.next({ eventType: 'cancel', event: event });
  822. overlay.detach();
  823. overlay.dispose();
  824. }
  825. /** @type {?} */
  826. var newLeaf = _this.getLastAttachedOverlay();
  827. if (newLeaf) {
  828. newLeaf.contextMenu.isLeaf = true;
  829. }
  830. _this.isDestroyingLeafMenu = false;
  831. }));
  832. };
  833. /**
  834. * @param {?} contextMenu
  835. * @return {?}
  836. */
  837. ContextMenuService.prototype.destroySubMenus = /**
  838. * @param {?} contextMenu
  839. * @return {?}
  840. */
  841. function (contextMenu) {
  842. /** @type {?} */
  843. var overlay = contextMenu.overlay;
  844. /** @type {?} */
  845. var index = this.overlays.indexOf(overlay);
  846. this.overlays.slice(index + 1).forEach((/**
  847. * @param {?} subMenuOverlay
  848. * @return {?}
  849. */
  850. function (subMenuOverlay) {
  851. subMenuOverlay.detach();
  852. subMenuOverlay.dispose();
  853. }));
  854. };
  855. /**
  856. * @param {?} contextMenuContent
  857. * @return {?}
  858. */
  859. ContextMenuService.prototype.isLeafMenu = /**
  860. * @param {?} contextMenuContent
  861. * @return {?}
  862. */
  863. function (contextMenuContent) {
  864. /** @type {?} */
  865. var overlay = this.getLastAttachedOverlay();
  866. return contextMenuContent.overlay === overlay;
  867. };
  868. ContextMenuService.decorators = [
  869. { type: Injectable }
  870. ];
  871. /** @nocollapse */
  872. ContextMenuService.ctorParameters = function () { return [
  873. { type: Overlay },
  874. { type: ScrollStrategyOptions }
  875. ]; };
  876. return ContextMenuService;
  877. }());
  878. if (false) {
  879. /** @type {?} */
  880. ContextMenuService.prototype.isDestroyingLeafMenu;
  881. /** @type {?} */
  882. ContextMenuService.prototype.show;
  883. /** @type {?} */
  884. ContextMenuService.prototype.triggerClose;
  885. /** @type {?} */
  886. ContextMenuService.prototype.close;
  887. /**
  888. * @type {?}
  889. * @private
  890. */
  891. ContextMenuService.prototype.contextMenuContent;
  892. /**
  893. * @type {?}
  894. * @private
  895. */
  896. ContextMenuService.prototype.overlays;
  897. /**
  898. * @type {?}
  899. * @private
  900. */
  901. ContextMenuService.prototype.fakeElement;
  902. /**
  903. * @type {?}
  904. * @private
  905. */
  906. ContextMenuService.prototype.overlay;
  907. /**
  908. * @type {?}
  909. * @private
  910. */
  911. ContextMenuService.prototype.scrollStrategy;
  912. }
  913. /**
  914. * @fileoverview added by tsickle
  915. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  916. */
  917. /**
  918. * @record
  919. */
  920. function ILinkConfig$1() { }
  921. if (false) {
  922. /** @type {?} */
  923. ILinkConfig$1.prototype.click;
  924. /** @type {?|undefined} */
  925. ILinkConfig$1.prototype.enabled;
  926. /** @type {?} */
  927. ILinkConfig$1.prototype.html;
  928. }
  929. /**
  930. * @record
  931. */
  932. function MouseLocation() { }
  933. if (false) {
  934. /** @type {?|undefined} */
  935. MouseLocation.prototype.left;
  936. /** @type {?|undefined} */
  937. MouseLocation.prototype.marginLeft;
  938. /** @type {?|undefined} */
  939. MouseLocation.prototype.marginTop;
  940. /** @type {?|undefined} */
  941. MouseLocation.prototype.top;
  942. }
  943. var ContextMenuComponent = /** @class */ (function () {
  944. function ContextMenuComponent(_contextMenuService, changeDetector, elementRef, options) {
  945. var _this = this;
  946. this._contextMenuService = _contextMenuService;
  947. this.changeDetector = changeDetector;
  948. this.elementRef = elementRef;
  949. this.options = options;
  950. this.menuClass = "";
  951. this.autoFocus = false;
  952. this.useBootstrap4 = false;
  953. this.disabled = false;
  954. this.close = new EventEmitter();
  955. this.open = new EventEmitter();
  956. this.visibleMenuItems = [];
  957. this.links = [];
  958. this.subscription = new Subscription();
  959. if (options) {
  960. this.autoFocus = options.autoFocus;
  961. this.useBootstrap4 = options.useBootstrap4;
  962. }
  963. this.subscription.add(_contextMenuService.show.subscribe((/**
  964. * @param {?} menuEvent
  965. * @return {?}
  966. */
  967. function (menuEvent) {
  968. _this.onMenuEvent(menuEvent);
  969. })));
  970. }
  971. /**
  972. * @return {?}
  973. */
  974. ContextMenuComponent.prototype.ngOnDestroy = /**
  975. * @return {?}
  976. */
  977. function () {
  978. this.subscription.unsubscribe();
  979. };
  980. /**
  981. * @param {?} menuEvent
  982. * @return {?}
  983. */
  984. ContextMenuComponent.prototype.onMenuEvent = /**
  985. * @param {?} menuEvent
  986. * @return {?}
  987. */
  988. function (menuEvent) {
  989. var _this = this;
  990. if (this.disabled) {
  991. return;
  992. }
  993. var contextMenu = menuEvent.contextMenu, event = menuEvent.event, item = menuEvent.item;
  994. if (contextMenu && contextMenu !== this) {
  995. return;
  996. }
  997. this.event = event;
  998. this.item = item;
  999. this.setVisibleMenuItems();
  1000. this._contextMenuService.openContextMenu(__assign({}, menuEvent, { menuItems: this.visibleMenuItems, menuClass: this.menuClass }));
  1001. this._contextMenuService.close.asObservable().pipe(first()).subscribe((/**
  1002. * @param {?} closeEvent
  1003. * @return {?}
  1004. */
  1005. function (closeEvent) { return _this.close.emit(closeEvent); }));
  1006. this.open.next(menuEvent);
  1007. };
  1008. /**
  1009. * @param {?} menuItem
  1010. * @return {?}
  1011. */
  1012. ContextMenuComponent.prototype.isMenuItemVisible = /**
  1013. * @param {?} menuItem
  1014. * @return {?}
  1015. */
  1016. function (menuItem) {
  1017. return this.evaluateIfFunction(menuItem.visible);
  1018. };
  1019. /**
  1020. * @return {?}
  1021. */
  1022. ContextMenuComponent.prototype.setVisibleMenuItems = /**
  1023. * @return {?}
  1024. */
  1025. function () {
  1026. var _this = this;
  1027. this.visibleMenuItems = this.menuItems.filter((/**
  1028. * @param {?} menuItem
  1029. * @return {?}
  1030. */
  1031. function (menuItem) { return _this.isMenuItemVisible(menuItem); }));
  1032. };
  1033. /**
  1034. * @param {?} value
  1035. * @return {?}
  1036. */
  1037. ContextMenuComponent.prototype.evaluateIfFunction = /**
  1038. * @param {?} value
  1039. * @return {?}
  1040. */
  1041. function (value) {
  1042. if (value instanceof Function) {
  1043. return value(this.item);
  1044. }
  1045. return value;
  1046. };
  1047. ContextMenuComponent.decorators = [
  1048. { type: Component, args: [{
  1049. encapsulation: ViewEncapsulation.None,
  1050. selector: 'context-menu',
  1051. template: " ",
  1052. styles: ["\n .cdk-overlay-container {\n position: fixed;\n z-index: 1000;\n pointer-events: none;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n .ngx-contextmenu.cdk-overlay-pane {\n position: absolute;\n pointer-events: auto;\n box-sizing: border-box;\n }\n "]
  1053. }] }
  1054. ];
  1055. /** @nocollapse */
  1056. ContextMenuComponent.ctorParameters = function () { return [
  1057. { type: ContextMenuService },
  1058. { type: ChangeDetectorRef },
  1059. { type: ElementRef },
  1060. { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CONTEXT_MENU_OPTIONS,] }] }
  1061. ]; };
  1062. ContextMenuComponent.propDecorators = {
  1063. menuClass: [{ type: Input }],
  1064. autoFocus: [{ type: Input }],
  1065. useBootstrap4: [{ type: Input }],
  1066. disabled: [{ type: Input }],
  1067. close: [{ type: Output }],
  1068. open: [{ type: Output }],
  1069. menuItems: [{ type: ContentChildren, args: [ContextMenuItemDirective,] }],
  1070. menuElement: [{ type: ViewChild, args: ['menu', { static: false },] }]
  1071. };
  1072. return ContextMenuComponent;
  1073. }());
  1074. if (false) {
  1075. /** @type {?} */
  1076. ContextMenuComponent.prototype.menuClass;
  1077. /** @type {?} */
  1078. ContextMenuComponent.prototype.autoFocus;
  1079. /** @type {?} */
  1080. ContextMenuComponent.prototype.useBootstrap4;
  1081. /** @type {?} */
  1082. ContextMenuComponent.prototype.disabled;
  1083. /** @type {?} */
  1084. ContextMenuComponent.prototype.close;
  1085. /** @type {?} */
  1086. ContextMenuComponent.prototype.open;
  1087. /** @type {?} */
  1088. ContextMenuComponent.prototype.menuItems;
  1089. /** @type {?} */
  1090. ContextMenuComponent.prototype.menuElement;
  1091. /** @type {?} */
  1092. ContextMenuComponent.prototype.visibleMenuItems;
  1093. /** @type {?} */
  1094. ContextMenuComponent.prototype.links;
  1095. /** @type {?} */
  1096. ContextMenuComponent.prototype.item;
  1097. /** @type {?} */
  1098. ContextMenuComponent.prototype.event;
  1099. /**
  1100. * @type {?}
  1101. * @private
  1102. */
  1103. ContextMenuComponent.prototype.subscription;
  1104. /**
  1105. * @type {?}
  1106. * @private
  1107. */
  1108. ContextMenuComponent.prototype._contextMenuService;
  1109. /**
  1110. * @type {?}
  1111. * @private
  1112. */
  1113. ContextMenuComponent.prototype.changeDetector;
  1114. /**
  1115. * @type {?}
  1116. * @private
  1117. */
  1118. ContextMenuComponent.prototype.elementRef;
  1119. /**
  1120. * @type {?}
  1121. * @private
  1122. */
  1123. ContextMenuComponent.prototype.options;
  1124. }
  1125. /**
  1126. * @fileoverview added by tsickle
  1127. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1128. */
  1129. var ContextMenuAttachDirective = /** @class */ (function () {
  1130. function ContextMenuAttachDirective(contextMenuService) {
  1131. this.contextMenuService = contextMenuService;
  1132. }
  1133. /**
  1134. * @param {?} event
  1135. * @return {?}
  1136. */
  1137. ContextMenuAttachDirective.prototype.onContextMenu = /**
  1138. * @param {?} event
  1139. * @return {?}
  1140. */
  1141. function (event) {
  1142. if (!this.contextMenu.disabled) {
  1143. this.contextMenuService.show.next({
  1144. contextMenu: this.contextMenu,
  1145. event: event,
  1146. item: this.contextMenuSubject,
  1147. });
  1148. event.preventDefault();
  1149. event.stopPropagation();
  1150. }
  1151. };
  1152. ContextMenuAttachDirective.decorators = [
  1153. { type: Directive, args: [{
  1154. selector: '[contextMenu]',
  1155. },] }
  1156. ];
  1157. /** @nocollapse */
  1158. ContextMenuAttachDirective.ctorParameters = function () { return [
  1159. { type: ContextMenuService }
  1160. ]; };
  1161. ContextMenuAttachDirective.propDecorators = {
  1162. contextMenuSubject: [{ type: Input }],
  1163. contextMenu: [{ type: Input }],
  1164. onContextMenu: [{ type: HostListener, args: ['contextmenu', ['$event'],] }]
  1165. };
  1166. return ContextMenuAttachDirective;
  1167. }());
  1168. if (false) {
  1169. /** @type {?} */
  1170. ContextMenuAttachDirective.prototype.contextMenuSubject;
  1171. /** @type {?} */
  1172. ContextMenuAttachDirective.prototype.contextMenu;
  1173. /**
  1174. * @type {?}
  1175. * @private
  1176. */
  1177. ContextMenuAttachDirective.prototype.contextMenuService;
  1178. }
  1179. /**
  1180. * @fileoverview added by tsickle
  1181. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1182. */
  1183. var ContextMenuModule = /** @class */ (function () {
  1184. function ContextMenuModule() {
  1185. }
  1186. /**
  1187. * @param {?=} options
  1188. * @return {?}
  1189. */
  1190. ContextMenuModule.forRoot = /**
  1191. * @param {?=} options
  1192. * @return {?}
  1193. */
  1194. function (options) {
  1195. return {
  1196. ngModule: ContextMenuModule,
  1197. providers: [
  1198. ContextMenuService,
  1199. {
  1200. provide: CONTEXT_MENU_OPTIONS,
  1201. useValue: options,
  1202. },
  1203. ],
  1204. };
  1205. };
  1206. ContextMenuModule.decorators = [
  1207. { type: NgModule, args: [{
  1208. declarations: [
  1209. ContextMenuAttachDirective,
  1210. ContextMenuComponent,
  1211. ContextMenuContentComponent,
  1212. ContextMenuItemDirective,
  1213. ],
  1214. entryComponents: [
  1215. ContextMenuContentComponent,
  1216. ],
  1217. exports: [
  1218. ContextMenuAttachDirective,
  1219. ContextMenuComponent,
  1220. ContextMenuItemDirective,
  1221. ],
  1222. imports: [
  1223. CommonModule,
  1224. OverlayModule,
  1225. ],
  1226. },] }
  1227. ];
  1228. return ContextMenuModule;
  1229. }());
  1230. /**
  1231. * @fileoverview added by tsickle
  1232. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1233. */
  1234. /**
  1235. * @record
  1236. */
  1237. function IContextMenuOptions() { }
  1238. if (false) {
  1239. /** @type {?|undefined} */
  1240. IContextMenuOptions.prototype.useBootstrap4;
  1241. /** @type {?|undefined} */
  1242. IContextMenuOptions.prototype.autoFocus;
  1243. }
  1244. /**
  1245. * @fileoverview added by tsickle
  1246. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1247. */
  1248. /**
  1249. * @fileoverview added by tsickle
  1250. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1251. */
  1252. export { ContextMenuComponent, ContextMenuModule, ContextMenuService, ContextMenuAttachDirective as ɵa, ContextMenuItemDirective as ɵb, CONTEXT_MENU_OPTIONS as ɵc, ContextMenuContentComponent as ɵd };
  1253. //# sourceMappingURL=ngx-contextmenu.js.map