@ewc-lib/ewc-menu
Advanced tools
Comparing version 0.1.6-alpha to 0.1.7-alpha
{ | ||
"name": "@ewc-lib/ewc-menu", | ||
"version": "0.1.6-alpha", | ||
"version": "0.1.7-alpha", | ||
"description": "", | ||
"main": "src/main.mjs", | ||
"main": "src/main.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ }, |
@@ -9,7 +9,10 @@ # Screenshot | ||
- **data** - expects a map, key=main-menu item, value=[array of sub-menu items]. see example below. | ||
- **select** - expects a key of the map or the id of a sub-menu | ||
- **data** - set contents of the menu. expects a map, key=main-menu item, value=[array of sub-menu items]. see example below. | ||
- **select** - sets currently selected item. expects a key of the map or the id of a sub-menu. | ||
- **onSelect** - a callback which is called when a menu/submenu item was selected | ||
- callback signature: myCallback(subMenuId, menuId, isMainMenuItem) | ||
- isMainMenuItem === true means, main-menu item was selected | ||
- Note: subMenuId === menuId in that case | ||
Note that any menu-item-id === name/text of item. | ||
Note: Any menu-item-id === name/text of the item. | ||
@@ -21,3 +24,3 @@ # Usage with WebPack | ||
"dependencies": { | ||
"@ewc-lib/ewc-menu": "^0.1.0" | ||
"@ewc-lib/ewc-menu": "latest" | ||
} | ||
@@ -27,4 +30,2 @@ | ||
const CopyPlugin = require("copy-webpack-plugin") | ||
... | ||
@@ -42,10 +43,3 @@ | ||
] | ||
}, | ||
plugins: [ | ||
new CopyPlugin({ | ||
patterns: [ | ||
{ from: "./node_modules/@ewc-lib/ewc-menu/assets/*", to: "./assets/[name][ext]" } | ||
], | ||
}), | ||
], | ||
} | ||
@@ -64,3 +58,4 @@ ## index.html | ||
el.data = d | ||
el.onSelect = (subMenuId, menuId) => console.log(`Menu selection: ${menuId} ${subMenuId} `) | ||
el.onSelect = (subMenuId, menuId, isMainMenuItem) => | ||
alert(`Menu selection: ${menuId} ${subMenuId}\nWas a main menu item selected? -> ${isMainMenuItem}`) | ||
el.select = "Cut" | ||
@@ -71,5 +66,5 @@ }) | ||
## index.js | ||
## main.js | ||
import "@ewc-lib/ewc-menu" | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48596
65
1