@things-factory/lite-menu 4.1.12 → 4.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,9 +34,11 @@ export class LiteMenuPortrait extends LitElement {
34
34
  : menu.active && typeof menu.active === 'function'
35
35
  ? menu.active.call(menu, { path: this.path })
36
36
  : false}
37
+ .menu=${menu}
38
+ menu
37
39
  >
38
40
  <a href=${menu.path || '#'}>
39
- ${menu.menus?.length > 0 ? html` <mwc-icon .submenu=${menu} submenu-button></mwc-icon> ` : html``}
41
+ ${menu.menus?.length > 0 ? html` <mwc-icon submenu-button></mwc-icon> ` : html``}
40
42
  <mwc-icon>${menu.icon}</mwc-icon>
41
43
  ${menu.name}
42
44
  </a>
@@ -55,12 +57,16 @@ export class LiteMenuPortrait extends LitElement {
55
57
 
56
58
  firstUpdated() {
57
59
  this.renderRoot.addEventListener('click', e => {
58
- if (e.target.submenu) {
59
- /* protect to act move to href. */
60
- e.stopPropagation()
61
- e.preventDefault()
60
+ const menuElement = e.target.closest('[menu]')
62
61
 
63
- let menu = e.target.submenu
62
+ if (menuElement?.menu) {
63
+ let menu = menuElement.menu
64
+
65
+ if (!menu.path) {
66
+ /* protect to act move to href. */
67
+ e.stopPropagation()
68
+ e.preventDefault()
69
+ }
64
70
 
65
71
  this.dispatchEvent(
66
72
  new CustomEvent('active-toplevel', {
@@ -68,8 +74,6 @@ export class LiteMenuPortrait extends LitElement {
68
74
  detail: this.activeTopLevel === menu ? undefined : menu
69
75
  })
70
76
  )
71
-
72
- return
73
77
  }
74
78
 
75
79
  /* to respond even if current acting menu is selected */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/lite-menu",
3
- "version": "4.1.12",
3
+ "version": "4.1.16",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -33,14 +33,14 @@
33
33
  "@operato/shell": "^0.3.28",
34
34
  "@operato/styles": "^0.3.28",
35
35
  "@operato/utils": "^0.3.28",
36
- "@things-factory/apptool-base": "^4.1.12",
37
- "@things-factory/auth-base": "^4.1.12",
38
- "@things-factory/board-service": "^4.1.12",
39
- "@things-factory/board-ui": "^4.1.12",
40
- "@things-factory/grist-ui": "^4.1.12",
41
- "@things-factory/more-base": "^4.1.12",
42
- "@things-factory/setting-base": "^4.1.12",
43
- "@things-factory/utils": "^4.1.12"
36
+ "@things-factory/apptool-base": "^4.1.15",
37
+ "@things-factory/auth-base": "^4.1.15",
38
+ "@things-factory/board-service": "^4.1.15",
39
+ "@things-factory/board-ui": "^4.1.15",
40
+ "@things-factory/grist-ui": "^4.1.15",
41
+ "@things-factory/more-base": "^4.1.15",
42
+ "@things-factory/setting-base": "^4.1.15",
43
+ "@things-factory/utils": "^4.1.15"
44
44
  },
45
- "gitHead": "9055b83aa979f9c2d706b02cf8d73d848522d7dd"
45
+ "gitHead": "b83bcefaad07c80859d8a172e6d5d0adf571500d"
46
46
  }