23.0.11 • Published 1 year ago

@logo-elements/context-menu v23.0.11

Weekly downloads
-
License
https://raw.githu...
Repository
-
Last release
1 year ago

@logo-elements/context-menu

A web component that can be attached to any component to display a context menu.

npm version

<logo-elements-context-menu>
  <span>Open a context menu with <b>right click</b> or with <b>long touch.</b></span>
</logo-elements-context-menu>

<script>
  const contextMenu = document.querySelector('logo-elements-context-menu');
  contextMenu.renderer = function (root) {
    let listBox = root.firstElementChild;
    // Check if there is a list-box generated with the previous renderer call to update its content instead of recreation
    if (listBox) {
      listBox.innerHTML = '';
    } else {
      listBox = document.createElement('logo-elements-list-box');
      root.appendChild(listBox);
    }

    ['First', 'Second', 'Third'].forEach(function (name) {
      const item = document.createElement('logo-elements-item');
      item.textContent = name + ' menu item';
      listBox.appendChild(item);
    });
  };
</script>

Note: <logo-elements-list-box> component used in the above example should be installed and imported separately.

Installation

Install the component:

npm i @logo-elements/context-menu -s

Once installed, import the component in your application:

import '@logo-elements/context-menu';

For more detailed information, please visit:

Logo Elements Documentation ↗

23.0.11

1 year ago

23.0.0

2 years ago

1.2.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.1

2 years ago