{"_id":"@avdbrink/ngx-contextmenu","_rev":"3-3d8a1b70ea3fe1174dc9c0ccbf3a869e","name":"@avdbrink/ngx-contextmenu","dist-tags":{"latest":"5.2.2"},"versions":{"5.2.0":{"name":"@avdbrink/ngx-contextmenu","version":"5.2.0","description":"An Angular component to show a context menu on an arbitrary component","keywords":["angular2","contextmenu","angular2-contextmenu","ngx-contextmenu","ngx","ng2","ng2-contextmenu"],"author":{"name":"Isaac Mann","email":"isaacplmann@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/avdbrink/ngx-contextmenu.git"},"peerDependencies":{"@angular/cdk":">=6.0.0 <9.0.0","@angular/common":">=6.0.0 <9.0.0","@angular/core":">=6.0.0 <9.0.0"},"bugs":{"url":"https://github.com/avdbrink/ngx-contextmenu/issues"},"homepage":"https://github.com/avdbrink/ngx-contextmenu#readme","_id":"@avdbrink/ngx-contextmenu@5.2.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/PmVWAcAkayMhkUCIhM2A7T7Qg+esxWzbJbyId52EVRx5jwGD5xYPkvp6inx/FnMGHmVvAbPjhv/cRNR5myZgw==","shasum":"db290c033775d9f4f6c3734760750cca101c2ffb","tarball":"https://registry.npmjs.org/@avdbrink/ngx-contextmenu/-/ngx-contextmenu-5.2.0.tgz","fileCount":17,"unpackedSize":29263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdi4B9CRA9TVsSAnZWagAAo/cP/iMPOTl61y6/GFLh42tL\ngaes+grNMCHQA2zqpQ1CLdbfQ8TKPX2L6KfT9CnYDSFp811raFddwUz+9mo5\n8FqxhOBYTnQ3iB4YWML3o/NJxkIqYAM/wjASAd6NI1PNdkP3g33ebst6czWC\nGJp5M/VQvSJ0Nhz2Oo+datAh48f/C5JzH+Qv7JjA86fKBR/syba3FKDs5XU2\naXrTG5IwkFDo4xA38H1jKfQPfF81jeRTsIyfhj7bXcSWW34f+FYGP61F5w/Y\nkBjgRFCCL1epUltdoAOKsEoeaaylZz2OUzjWts5MvyGruEqTIqy54PcYRopG\nYMqdCzyuYn2iEf10cDSdAWq+j8uyu0q2BJQcR5fiZPRPIWgehTyw+TwI7cp1\nbeNgI9QqGxiWPgvaiWlm+7tLYM78ETVeCadejjbiUu9tfgl7gI0GRZKmEoTr\nqiQxS9L3BMXknRzsGFozVETDWyEAZFe0i+uDWh2BhX/LKljvwMEjszaKiczr\nz+HEI5BJ1m6KXM1ZD6KRQj3iG9067Mi86qqCqCg4ST1Do/Qid+8Am0nqOCRa\n4tO4QC6bUwACWVKyYibVu2Zr9kCF79NFGl37erP01MccBhfYqSnP72NGPh9B\nalWrGfIIBiTGxnfQswIMubGqw3HDS9oAxGBbu7Wt5WCzl4tszz/e+Jc9HCOK\n0L+b\r\n=cmTx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHt3eu4rBvg3WvkH0DYCcRybAR0rUfFPfybhKdob+DIFAiEAjRvo/b2nng9PUXX/GkQ25S2kFIJElFeyB3rLXbecpCs="}]},"maintainers":[{"name":"avdbrink","email":"avdbrink@gmail.com"}],"_npmUser":{"name":"avdbrink","email":"avdbrink@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-contextmenu_5.2.0_1569423484946_0.9412038032364394"},"_hasShrinkwrap":false},"5.2.1":{"name":"@avdbrink/ngx-contextmenu","version":"5.2.1","description":"An Angular component to show a context menu on an arbitrary component","keywords":["angular2","contextmenu","angular2-contextmenu","ngx-contextmenu","ngx","ng2","ng2-contextmenu"],"author":{"name":"Arno van den Brink","email":"avdbrink@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/avdbrink/ngx-contextmenu.git"},"peerDependencies":{"@angular/cdk":">=6.0.0 <9.0.0","@angular/common":">=6.0.0 <9.0.0","@angular/core":">=6.0.0 <9.0.0"},"main":"bundles/avdbrink-ngx-contextmenu.umd.js","module":"fesm5/avdbrink-ngx-contextmenu.js","es2015":"fesm2015/avdbrink-ngx-contextmenu.js","esm5":"esm5/avdbrink-ngx-contextmenu.js","esm2015":"esm2015/avdbrink-ngx-contextmenu.js","fesm5":"fesm5/avdbrink-ngx-contextmenu.js","fesm2015":"fesm2015/avdbrink-ngx-contextmenu.js","typings":"avdbrink-ngx-contextmenu.d.ts","metadata":"avdbrink-ngx-contextmenu.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"bugs":{"url":"https://github.com/avdbrink/ngx-contextmenu/issues"},"homepage":"https://github.com/avdbrink/ngx-contextmenu#readme","_id":"@avdbrink/ngx-contextmenu@5.2.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-t4MKrJxCTWGC2lqPK3ilGELYiYTUcraQ8h8VhaZnC5hQE4W+4m2CTY5l7SfKeXKVe5j7lvu9dvQTfdureAXC6g==","shasum":"ff75e637b3a98c05524389af35568a0b65afd33c","tarball":"https://registry.npmjs.org/@avdbrink/ngx-contextmenu/-/ngx-contextmenu-5.2.1.tgz","fileCount":54,"unpackedSize":1226741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjG4LCRA9TVsSAnZWagAAjbwP/j/cmjTgXhSfTCzmwBzB\nE8CAjFMBhEK6AZ0RMhdhldF75lxKFJlwx9DPZsozlpw5RItbpcwC5ExIqp9T\njFXyJ0YjBXJWkyJ+roUDiDIq4Isj0owMg0/qApEVJbhAcAo0Qq7XtzjxjNZm\nDdDAVq4Qub9s4C02oEwMON4DoNw57de/B9RXsAQoFC6a/Fyei3/67Nik0+ls\nRRw8CsZM1PHvq72B+HgCbKns1b0l17Ru2iud9tQTZ/5eSaO8Ky3UqRTy6hR5\n4xHhZNSnC7CdrdbPdcAUv8vqYReAjQ445f6Cwty0MNoBRsT5BZiv0KiLxQH9\nzkAnfBtc13X9MD70AfLzkfX2zmtGcSXKZ1SydYPCzynwIDykO5+mytecszNT\n0j8MY1tekmNzHk1E/AJ+Msz01H3v6ApwpsbqBg+fPkDLajgX8TGVLarGa3mq\n0vWKJvPPuVlRZ+u5AbXKbNEXt379ZT8zoJWYYGdhp/Oeu2lHXoJEt59lPJEZ\njJVoKstbhtxzFym9IfMVv8S8dMXAOOGlZ5lnUQmQc5Co1Y/Z6rAX6P6nBXt3\nVsJj6KSiSj4GHnb7Gyg0YVTOgfK4mcjBQCvAELvOq7rRc6Nec+lz627c+UP0\nfX9Bvpz6BXOSZ+Kcg5ZxDIyc3Nrccd8PKNZDSNogBOjSEejNFclyB1CVw9lm\nTyR8\r\n=/khA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAvyI96ns4Y7Uayd5FM9fFfxKA2Sw4cEiSgMFhkLI+fYAiAb1pKBR0qy9SAAwv/9DhjeBMiqkHwAkS1JVkhN19oUew=="}]},"maintainers":[{"name":"avdbrink","email":"avdbrink@gmail.com"}],"_npmUser":{"name":"avdbrink","email":"avdbrink@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-contextmenu_5.2.1_1569484298294_0.513466050747033"},"_hasShrinkwrap":false},"5.2.2":{"name":"@avdbrink/ngx-contextmenu","version":"5.2.2","description":"An Angular component to show a context menu on an arbitrary component","keywords":["angular2","contextmenu","angular2-contextmenu","ngx-contextmenu","ngx","ng2","ng2-contextmenu"],"author":{"name":"Arno van den Brink","email":"avdbrink@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/avdbrink/ngx-contextmenu.git"},"peerDependencies":{"@angular/cdk":">=6.0.0 <9.0.0","@angular/common":">=6.0.0 <9.0.0","@angular/core":">=6.0.0 <9.0.0"},"main":"bundles/avdbrink-ngx-contextmenu.umd.js","module":"fesm5/avdbrink-ngx-contextmenu.js","es2015":"fesm2015/avdbrink-ngx-contextmenu.js","esm5":"esm5/avdbrink-ngx-contextmenu.js","esm2015":"esm2015/avdbrink-ngx-contextmenu.js","fesm5":"fesm5/avdbrink-ngx-contextmenu.js","fesm2015":"fesm2015/avdbrink-ngx-contextmenu.js","typings":"avdbrink-ngx-contextmenu.d.ts","metadata":"avdbrink-ngx-contextmenu.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"bugs":{"url":"https://github.com/avdbrink/ngx-contextmenu/issues"},"homepage":"https://github.com/avdbrink/ngx-contextmenu#readme","_id":"@avdbrink/ngx-contextmenu@5.2.2","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-HzEZBmv3jIX4HYt/wd1UY2aQrkllvIQOZ5n96J143K2DcMc8skCU717MV3QZOt0A8utkXI9DUMdNuVznSsuxzA==","shasum":"208adebf16dc0c44bf46cde2a1b29e09492c2105","tarball":"https://registry.npmjs.org/@avdbrink/ngx-contextmenu/-/ngx-contextmenu-5.2.2.tgz","fileCount":54,"unpackedSize":1227175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnuTBCRA9TVsSAnZWagAAs98P/i3hv6k+QRGmQDgFOofK\nwLJV+n9XmIuYHVAMTGR5MLJbt/OSvWz+foBAE3myQwNLOT77ir1wQ4AlK/Yj\nkb/ISpSh/ILmnJZTnXmxsho4Ru49ACstvi5wGSi2EXuYn4Y+1YzTryMUanxb\nHViuA5gfOXf7U7HTFebnAb/dP8OFobKjCeGCaT+r5Y9VV4Bmt9IGiEU41BjH\nh5zA7HNuBMzLcKsw/Vpk9UV+mzfeloqw4e9ilIF0sR7DHzGx8DyP/HAAcK9E\nou1IG33WNQbXTSfgQZ+8JuXN3jF/Ryp+ITnPE+wHdnw65QCx6q746N5mrR9/\njNRTdmYyb014UzwaP/hCAklPtB0FWckN8U4kxCUHcz7hZsA/7QdvMhce04MH\nLQd0Jmnn1jPuDh8XmzBIALkeAvg8gbxzKOKTQb50J0HmlMlqGUP48Grh/GzI\nYUeBRdz+hAUzyvX218gcGuRT0mVs6mDYQC0biPMkPa5B/KvixvTKZzU0jchW\nCn3detAIhsw6tmJsmv205vUa41yyp4ePsr/topZX2xLfu8B9ouRucRwXtgyL\n+cWZEVHzY04EI63wi34n0QqrhAveshGlPn+8qzZGpnXZsEknlnrNje3ia1lZ\nyVzTFJt++MQf28bJRGWYPGOa0y3DFt+PiaRt1zp0n2rgtUqTRhHsiKIzU8kP\n5eZU\r\n=N9HN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLw7H67tKg+m9ZEN5ng1p+X5FKQ/dMDUToY7cjMZ1yUgIgY+Rtr0u4fkWGGuMyWBlZgab8iy0MeUl3zvdcFTCjzHg="}]},"maintainers":[{"name":"avdbrink","email":"avdbrink@gmail.com"}],"_npmUser":{"name":"avdbrink","email":"avdbrink@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-contextmenu_5.2.2_1570694336749_0.34043080039432816"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-25T14:58:04.712Z","5.2.0":"2019-09-25T14:58:05.187Z","modified":"2022-04-04T16:45:08.623Z","5.2.1":"2019-09-26T07:51:38.472Z","5.2.2":"2019-10-10T07:58:56.956Z"},"maintainers":[{"name":"avdbrink","email":"avdbrink@gmail.com"}],"description":"An Angular component to show a context menu on an arbitrary component","homepage":"https://github.com/avdbrink/ngx-contextmenu#readme","keywords":["angular2","contextmenu","angular2-contextmenu","ngx-contextmenu","ngx","ng2","ng2-contextmenu"],"repository":{"type":"git","url":"git+ssh://git@github.com/avdbrink/ngx-contextmenu.git"},"author":{"name":"Arno van den Brink","email":"avdbrink@gmail.com"},"bugs":{"url":"https://github.com/avdbrink/ngx-contextmenu/issues"},"license":"MIT","readme":"# ngx-contextmenu\n\nA context menu built with Angular (6) inspired by [ui.bootstrap.contextMenu](https://github.com/Templarian/ui.bootstrap.contextMenu).  Bootstrap classes are included in the markup, but there is no explicit dependency on Bootstrap. [Demo](https://isaacplmann.github.io/ngx-contextmenu/) [Stackblitz example](https://stackblitz.com/edit/ngx-contextmenu-example)\nOriginally created by [Isaac Mann](isaacplmann@gmail.com), just slightly edited by me.\nChanges are:\n- Option to enable trace of selection path\n\nWhen selecting a subMenu item the parent item will stay highlighted.\n\nUsage:\nIn your module import set the highlightParentItems option to true:\n  \n```js \n    ContextMenuModule.forRoot({ highlightParentItems: true }),\n```\n\nToDo:\nThe component seems to \"remember\" the last selected item, so when the menu is closed and reopend the last selected menu  item is still highlighted.\n\n## Installation\n\n- `npm install ngx-contextmenu @angular/cdk`\n- import ContextMenuModule.forRoot() into your app module\n- Make sure to include `<!doctype html>` at the top of your `index.html`\n\n## Usage\n\n### Angular 5 support\n\nPlease use ngx-contextmenu@4.2.0 with Angular 5 projects.\n\n### Template\n\n```html\n<ul>\n    <li *ngFor=\"let item of items\" [contextMenu]=\"basicMenu\" [contextMenuSubject]=\"item\">Right Click: {{item?.name}}</li>\n</ul>\n<context-menu>\n  <ng-template contextMenuItem (execute)=\"showMessage('Hi, ' + $event.item.name)\">\n    Say hi!\n  </ng-template>\n  <ng-template contextMenuItem divider=\"true\"></ng-template>\n  <ng-template contextMenuItem let-item (execute)=\"showMessage($event.item.name + ' said: ' + $event.item.otherProperty)\">\n    Bye, {{item?.name}}\n  </ng-template>\n  <ng-template contextMenuItem passive=\"true\">\n    Input something: <input type=\"text\">\n  </ng-template>\n</context-menu>\n```\n\n### Component Code\n\n```js\n@Component({\n  ...\n})\nexport class MyContextMenuClass {\n  public items = [\n      { name: 'John', otherProperty: 'Foo' },\n      { name: 'Joe', otherProperty: 'Bar' }\n  ];\n  @ViewChild(ContextMenuComponent) public basicMenu: ContextMenuComponent;\n}\n```\n\n## Context Menu Items\n\n- Each context menu item is a `<ng-template>` element with the `contextMenuItem` attribute directive applied.\n- If the `item` object is used in the context menu item template, the `let-item` attribute must be applied to the `<ng-template>` element. \n  ** Note: ** Make sure to use the `item?.property` syntax in the template rather than `item.property` as the item will be initially `undefined`.\n- Every context menu item emits `execute` events. The `$event` object is of the form `{ event: MouseEvent, item: any }` where `event` is the mouse click event\n  that triggered the execution and `item` is the current item.\n- The `divider` input parameter is optional.  Items default to normal menu items.  If `divider` is `true`, all the other inputs are ignored.\n- The `passive` input parameter is optional.  If `passive` is `true`, the menu item will not emit execute events or close\n  the context menu when clicked.\n- The `enabled` input parameter is optional.  Items are enabled by default.\n  This can be a boolean value or a function definition that takes an item and returns a boolean.\n- The `visible` input parameter is optional.  Items are visible by default.  This property enables you to show certain context menu items based on what the data item is.\n  This can be a boolean value or a function definition that takes an item and returns a boolean.\n- Within the template, you have access to any components and variables available in the outer context.\n\n```html\n<context-menu>\n  <ng-template contextMenuItem let-item [visible]=\"isMenuItemType1\" [enabled]=\"false\" (execute)=\"showMessage('Hi, ' + $event.item.name)\">\n    Say hi, {{item?.name}}!  <my-component [attribute]=\"item\"></my-component>\n    With access to the outside context: {{ outsideValue }}\n  </ng-template>\n</context-menu>\n```\n```js\npublic outsideValue = \"something\";\npublic isMenuItemType1(item: any): boolean {\n  return item.type === 'type1';\n}\n```\n\n## Sub-menus\n\nYou can specify sub-menus like this:\n\n```html\n<ul>\n    <li *ngFor=\"let item of items\" [contextMenu]=\"basicMenu\" [contextMenuSubject]=\"item\">Right Click: {{item?.name}}</li>\n</ul>\n<context-menu>\n  <ng-template contextMenuItem [subMenu]=\"saySubMenu\">\n    Say...\n  </ng-template>\n  <context-menu #saySubMenu>\n    <ng-template contextMenuItem (execute)=\"showMessage('Hi, ' + $event.item.name)\">\n      ...hi!\n    </ng-template>\n    <ng-template contextMenuItem (execute)=\"showMessage('Hola, ' + $event.item.name)\">\n      ...hola!\n    </ng-template>\n    <ng-template contextMenuItem (execute)=\"showMessage('Salut, ' + $event.item.name)\">\n      ...salut!\n    </ng-template>\n  </context-menu>\n  <ng-template contextMenuItem divider=\"true\"></ng-template>\n  <ng-template contextMenuItem let-item (execute)=\"showMessage($event.item.name + ' said: ' + $event.item.otherProperty)\">\n    Bye, {{item?.name}}\n  </ng-template>\n  <ng-template contextMenuItem passive=\"true\">\n    Input something: <input type=\"text\">\n  </ng-template>\n</context-menu>\n```\n\nNotes:\n1. The sub `<context-menu>` can not be placed inside the `<ng-template>` that references it.\n2. Sub-menus may be nested as deeply as you wish.\n\n## Upgrade from angular2-contextmenu 0.x\n\n1. Change `package.json` to reference `ngx-contextmenu` instead of `angular2-contextmenu`\n2. Upgrade to `@angular` 4.x\n3. Use `<ng-template>` instead of `<template>`\n4. Update any styles that referenced `.angular2-contextmenu` to use `.ngx-contextmenu` instead\n\n**Note:** The imperative way of declaring context menu items has been removed.  i.e. You can't pass an `actions` property to `contextMenuService.show.next()`.\n\n## Using `visible` and `enabled` functions\n\nIf you need access to properties in your component from within the `enabled` or `visible` functions, you can pass in an arrow function.\n\n```html\n<ng-template ... [visible]=\"isMenuItemOutsideValue\">\n```\n```js\npublic outsideValue = \"something\";\npublic isMenuItemOutsideValue = (item: any): boolean => {\n  return item.type === this.outsideValue;\n}\n```\n\n## Multiple Context Menus\nYou can use multiple context menus in the same component if you would like.\n\n```html\n<ul>\n    <li *ngFor=\"let item of items\" [contextMenu]=\"basicMenu\" [contextMenuSubject]=\"item\">{{item?.name}}</li>\n</ul>\n<context-menu #basicMenu>\n  ...\n</context-menu>\n\n<ul>\n    <li *ngFor=\"let item of items\" [contextMenu]=\"otherMenu\" [contextMenuSubject]=\"item\">{{item?.name}}</li>\n</ul>\n<context-menu #otherMenu>\n  ...\n</context-menu>\n```\n\n```js\n@ViewChild('basicMenu') public basicMenu: ContextMenuComponent;\n@ViewChild('otherMenu') public otherMenu: ContextMenuComponent;\n```\n\n## Context Menu In a Different Component\nIf your `<context-menu>` component is in a different component from your list, you'll need to wire up the context menu event yourself.\n\n```html\n<ul>\n    <li *ngFor=\"let item of items\" (contextmenu)=\"onContextMenu($event, item)\">Right Click: {{item.name}}</li>\n</ul>\n```\n\n```js\nimport { ContextMenuService } from 'ngx-contextmenu';\n\n@Component({\n  ...\n})\nexport class MyContextMenuClass {\n  public items = [\n      { name: 'John', otherProperty: 'Foo' },\n      { name: 'Joe', otherProperty: 'Bar' }\n  ];\n\n  // Optional\n  @Input() contextMenu: ContextMenuComponent;\n\n  constructor(private contextMenuService: ContextMenuService) {}\n\n  public onContextMenu($event: MouseEvent, item: any): void {\n    this.contextMenuService.show.next({\n      // Optional - if unspecified, all context menu components will open\n      contextMenu: this.contextMenu,\n      event: $event,\n      item: item,\n    });\n    $event.preventDefault();\n    $event.stopPropagation();\n  }\n}\n```\n\n## Triggering the Context Menu with a Different Event\nThe context menu can be triggered at any point using the method above.  For instance, to trigger the context menu\nwith a left click instead of a right click, use this html:\n\n```html\n<ul>\n    <li *ngFor=\"let item of items\" (click)=\"onContextMenu($event, item)\">Left Click: {{item.name}}</li>\n</ul>\n```\n\nThis could be `(keydown)`, `(mouseover)`, or `(myCustomEvent)` as well.\n\n## Positioning the Context Menu around an element\nIf you want to override the context menu positioning to be appended to an element instead of based on mouse position,\nprovide an `anchorElement` to the `contextMenuService`.  This makes sense if you want to trigger the context menu with\na non-MouseEvent.\n\n```ts\npublic onContextMenu($event: KeyboardEvent, item: any): void {\n  this.contextMenuService.show.next({\n    anchorElement: $event.target,\n    // Optional - if unspecified, all context menu components will open\n    contextMenu: this.contextMenu,\n    event: <any>$event,\n    item: item,\n  });\n  $event.preventDefault();\n  $event.stopPropagation();\n}\n```\n\n## Custom Styles\n\nThe html that is generated for the context menu looks like this:\n\n```html\n<div class=\"dropdown ngx-contextmenu\">\n  <ul class=\"dropdown-menu\">\n    <li>\n      <a><!-- the template for each context menu item goes here --></a>\n      <span><!-- the template for each passive context menu item goes here --></span>\n    </li>\n  </ul>\n</div>\n```\n\nYou can key off of the `ngx-contextmenu` class to create your own styles.  Note that the `ul.dropdown-menu` will have inline styles applied for `position`, `display`, `left` and `top` so that it will be positioned at the cursor when you right-click.\n\n```css\n.ngx-contextmenu .dropdown-menu {\n  border: solid 1px chartreuse;\n  background-color: darkgreen;\n  padding: 0;\n}\n.ngx-contextmenu li {\n  display: block;\n  border-top: solid 1px chartreuse;\n  text-transform: uppercase;\n  text-align: center;\n}\n.ngx-contextmenu li:first-child {\n  border-top:none;\n}\n.ngx-contextmenu a {\n  color:chartreuse;\n  display: block;\n  padding: 0.5em 1em;\n}\n.ngx-contextmenu a:hover {\n  color:darkgreen;\n  background-color:chartreuse;\n}\n```\n\n## Bootstrap 4\n\nIf you're using Bootstrap 4, you can specify a `useBootstrap4` property in the `forRoot` function of the `ContextMenuModule` in order to get the appropriate class names.  Like this:\n\n```js\n@NgModule({\n  import: [\n    ContextMenuModule.forRoot({\n      useBootstrap4: true,\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n**Or, if you want to repeat yourself,** you can add a `useBootstrap4` attribute to each `context-menu` component.  Like this:\n\n```html\n<context-menu [useBootstrap4]=\"true\"></context-menu>\n```\n\n## Different styling on menus\n\nIf you want to style one menu differently than other menus, you can add a custom style to the menu.\n\n```html\n<context-menu [menuClass]=\"'mystyle'\"></context-menu>\n```\n\nPlease note that the style needs to be global to affect the menu, since the menu element is added to the page outside the component that triggers the menu.\n\n## AutoFocus\n\nYou can optionally set focus on the context menu whenever it opens.  This enables a user to easily tab through the context menu items and press enter to select them.\n\n```js\n@NgModule({\n  import: [\n    ContextMenuModule.forRoot({\n      autoFocus: true,\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n## Keyboard navigation\n\nYou can use the keyboard to manipulate the context menu.  Note: Keyboard navigation should be used in conjunction with `autoFocus`, since key events are only captured when the context menu is focused.\n\n| Key            | Action                                         |\n|:--------------:|------------------------------------------------|\n| ArrowDown      | Move to next menu item (wrapping)              |\n| ArrowUp        | Move to previous menu item (wrapping)          |\n| ArrowRight     | Open submenu of current menu item if present   |\n| ArrowLeft      | Close current menu unless already at root menu |\n| Enter \\| Space | Open submenu or execute current menu item      |\n| Esc            | Close current menu                             |\n\n## Disable Context Menu\n\nIf you need to disable the context menu, you can pass a `boolean` to the `[disabled]` input:\n\n```html\n<context-menu [disabled]=\"true\"></context-menu>\n```\n\n## Close event emitter\n\nThere is a `(close)` output EventEmitter that you can subscribe to for notifications when the context menu closes (either by clicking outside or choosing a menu item).\n\n```html\n<context-menu (close)=\"processContextMenuCloseEvent()\"></context-menu>\n```\n\n## Dynamic context menu\n\nThe items in the context menu are completely controlled by the `contextMenuActions` object.\n\n```html\n<ul>\n    <li *ngFor=\"item in items\" [contextMenu]=\"myContextMenu\" [contextMenuSubject]=\"item\">Right Click: {{item.name}}</li>\n</ul>\n<context-menu #myContextMenu>\n  <ng-template *ngFor=\"let action of contextMenuActions\" contextMenuItem let-item\n    [visible]=\"action.visible\" [enabled]=\"action.enabled\" [divider]=\"action.divider\"\n    (execute)=\"action.click($event.item)\">\n    {{ action.html($event.item) }}\n  </ng-template>\n</context-menu>\n```\n\n```ts\n@Component({\n  ...\n})\nexport class MyContextMenuClass {\n  public items = [\n      { name: 'John', otherProperty: 'Foo', type: 'type1' },\n      { name: 'Joe', otherProperty: 'Bar', type: 'type2' }\n  ];\n  @ViewChild(ContextMenuComponent) public contextMenu: ContextMenuComponent;\n  public contextMenuActions = [\n        {\n          html: (item) => `Say hi!`,\n          click: (item) => alert('Hi, ' + item.name),\n          enabled: (item) => true,\n          visible: (item) => item.type === 'type1',\n        },\n        {\n          divider: true,\n          visible: true,\n        },\n        {\n          html: (item) => `Something else`,\n          click: (item) => alert('Or not...'),\n          enabled: (item) => false,\n          visible: (item) => item.type === 'type1',\n        },\n      ];\n}\n```\n","readmeFilename":"README.md"}