@vaadin/vaadin-context-menu
Advanced tools
Comparing version 22.0.0-beta1 to 22.0.0-beta2
{ | ||
"name": "@vaadin/vaadin-context-menu", | ||
"version": "22.0.0-beta1", | ||
"version": "22.0.0-beta2", | ||
"publishConfig": { | ||
@@ -35,5 +35,5 @@ "access": "public" | ||
"dependencies": { | ||
"@vaadin/context-menu": "22.0.0-beta1" | ||
"@vaadin/context-menu": "22.0.0-beta2" | ||
}, | ||
"gitHead": "4cf8a9d0504994200c610e44b3676114fef49c1e" | ||
"gitHead": "f13833683e6667f6ca6678452db14aa6b7eac4a4" | ||
} |
@@ -1,77 +0,10 @@ | ||
# <vaadin-context-menu> | ||
# @vaadin/vaadin-context-menu | ||
[Live Demo ↗](https://vaadin.com/components/vaadin-context-menu/html-examples) | ||
| | ||
[API documentation ↗](https://vaadin.com/components/vaadin-context-menu/html-api) | ||
> ⚠️ Starting from Vaadin 22, this package is deprecated. | ||
> Please use [`@vaadin/context-menu`](https://www.npmjs.com/package/@vaadin/context-menu) instead. | ||
[<vaadin-context-menu>](https://vaadin.com/components/vaadin-context-menu) is a Web Component providing a contextual menu, part of the [Vaadin components](https://vaadin.com/components). | ||
A web component that can be attached to any component to display a context menu. | ||
[](https://www.npmjs.com/package/@vaadin/vaadin-context-menu) | ||
[](https://vaadin.com/directory/component/vaadinvaadin-context-menu) | ||
[](https://discord.gg/PHmkCKC) | ||
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/context-menu) | ||
```html | ||
<vaadin-context-menu> | ||
<span>Open a context menu with <b>right click</b> or with <b>long touch.</b></span> | ||
</vaadin-context-menu> | ||
<script> | ||
const contextMenu = document.querySelector('vaadin-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('vaadin-list-box'); | ||
root.appendChild(listBox); | ||
} | ||
['First', 'Second', 'Third'].forEach(function (name) { | ||
const item = document.createElement('vaadin-item'); | ||
item.textContent = name + ' menu item'; | ||
listBox.appendChild(item); | ||
}); | ||
}; | ||
</script> | ||
``` | ||
[<img src="https://raw.githubusercontent.com/vaadin/vaadin-context-menu/master/screenshot.png" width="493" alt="Screenshot of vaadin-context-menu">](https://vaadin.com/components/vaadin-context-menu) | ||
**Note:** [`<vaadin-list-box>`](https://github.com/vaadin/vaadin-list-box) component used in the above example should be installed and imported separately. | ||
## Installation | ||
Install `vaadin-context-menu`: | ||
```sh | ||
npm i @vaadin/vaadin-context-menu --save | ||
``` | ||
Once installed, import it in your application: | ||
```js | ||
import '@vaadin/vaadin-context-menu/vaadin-context-menu.js'; | ||
``` | ||
## Getting started | ||
Vaadin components use the Lumo theme by default. | ||
To use the Material theme, import the correspondent file from the `theme/material` folder. | ||
## Entry points | ||
- The component with the Lumo theme: | ||
`theme/lumo/vaadin-context-menu.js` | ||
- The component with the Material theme: | ||
`theme/material/vaadin-context-menu.js` | ||
- Alias for `theme/lumo/vaadin-context-menu.js`: | ||
`vaadin-context-menu.js` | ||
## Contributing | ||
@@ -85,2 +18,3 @@ | ||
Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics. | ||
Vaadin collects usage statistics at development time to improve this product.. | ||
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics. |
14099
20
+ Added@open-wc/dedupe-mixin@1.4.0(transitive)
+ Added@vaadin/component-base@22.0.0-beta2(transitive)
+ Added@vaadin/context-menu@22.0.0-beta2(transitive)
+ Added@vaadin/icon@22.0.0-beta2(transitive)
+ Added@vaadin/item@22.0.0-beta2(transitive)
+ Added@vaadin/list-box@22.0.0-beta2(transitive)
+ Added@vaadin/vaadin-list-mixin@22.0.0-beta2(transitive)
+ Added@vaadin/vaadin-lumo-styles@22.0.0-beta2(transitive)
+ Added@vaadin/vaadin-material-styles@22.0.0-beta2(transitive)
+ Added@vaadin/vaadin-overlay@22.0.0-beta2(transitive)
+ Added@vaadin/vaadin-themable-mixin@22.0.0-beta2(transitive)
- Removed@vaadin/component-base@22.0.0-beta1(transitive)
- Removed@vaadin/context-menu@22.0.0-beta1(transitive)
- Removed@vaadin/icon@22.0.0-beta1(transitive)
- Removed@vaadin/item@22.0.0-beta1(transitive)
- Removed@vaadin/list-box@22.0.0-beta1(transitive)
- Removed@vaadin/vaadin-list-mixin@22.0.0-beta1(transitive)
- Removed@vaadin/vaadin-lumo-styles@22.0.0-beta1(transitive)
- Removed@vaadin/vaadin-material-styles@22.0.0-beta1(transitive)
- Removed@vaadin/vaadin-overlay@22.0.0-beta1(transitive)
- Removed@vaadin/vaadin-themable-mixin@22.0.0-beta1(transitive)