@things-factory/lite-menu 7.0.0-alpha.9 → 7.0.0

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.
Files changed (74) hide show
  1. package/client/actions/lite-menu.ts +20 -11
  2. package/client/bootstrap.ts +6 -10
  3. package/client/index.ts +0 -3
  4. package/client/lite-menu-setting-let.ts +11 -7
  5. package/client/pages/addon-menu-setting.ts +45 -12
  6. package/client/reducers/lite-menu.ts +7 -5
  7. package/dist-client/actions/lite-menu.d.ts +3 -3
  8. package/dist-client/actions/lite-menu.js +18 -11
  9. package/dist-client/actions/lite-menu.js.map +1 -1
  10. package/dist-client/bootstrap.d.ts +1 -1
  11. package/dist-client/bootstrap.js +4 -6
  12. package/dist-client/bootstrap.js.map +1 -1
  13. package/dist-client/index.d.ts +0 -2
  14. package/dist-client/index.js +0 -2
  15. package/dist-client/index.js.map +1 -1
  16. package/dist-client/lite-menu-setting-let.d.ts +1 -2
  17. package/dist-client/lite-menu-setting-let.js +11 -7
  18. package/dist-client/lite-menu-setting-let.js.map +1 -1
  19. package/dist-client/pages/addon-menu-setting.d.ts +0 -1
  20. package/dist-client/pages/addon-menu-setting.js +40 -10
  21. package/dist-client/pages/addon-menu-setting.js.map +1 -1
  22. package/dist-client/reducers/lite-menu.js +5 -3
  23. package/dist-client/reducers/lite-menu.js.map +1 -1
  24. package/dist-client/route.js.map +1 -1
  25. package/dist-client/tsconfig.tsbuildinfo +1 -1
  26. package/dist-server/index.d.ts +1 -0
  27. package/dist-server/service/index.d.ts +5 -0
  28. package/dist-server/service/lite-menu/index.d.ts +5 -0
  29. package/dist-server/service/lite-menu/lite-menu-mutation.d.ts +7 -0
  30. package/dist-server/service/lite-menu/lite-menu-mutation.js +2 -2
  31. package/dist-server/service/lite-menu/lite-menu-mutation.js.map +1 -1
  32. package/dist-server/service/lite-menu/lite-menu-query.d.ts +15 -0
  33. package/dist-server/service/lite-menu/lite-menu-query.js +17 -4
  34. package/dist-server/service/lite-menu/lite-menu-query.js.map +1 -1
  35. package/dist-server/service/lite-menu/lite-menu-type.d.ts +32 -0
  36. package/dist-server/service/lite-menu/lite-menu-type.js +17 -8
  37. package/dist-server/service/lite-menu/lite-menu-type.js.map +1 -1
  38. package/dist-server/service/lite-menu/lite-menu.d.ts +26 -0
  39. package/dist-server/service/lite-menu/lite-menu.js +14 -8
  40. package/dist-server/service/lite-menu/lite-menu.js.map +1 -1
  41. package/dist-server/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +23 -19
  43. package/server/service/lite-menu/lite-menu-query.ts +14 -3
  44. package/server/service/lite-menu/lite-menu-type.ts +11 -3
  45. package/server/service/lite-menu/lite-menu.ts +11 -5
  46. package/translations/en.json +3 -1
  47. package/translations/ja.json +3 -1
  48. package/translations/ko.json +3 -1
  49. package/translations/ms.json +2 -0
  50. package/translations/zh.json +3 -1
  51. package/client/viewparts/lite-menu-landscape-styles.ts +0 -149
  52. package/client/viewparts/lite-menu-landscape.ts +0 -104
  53. package/client/viewparts/lite-menu-part.ts +0 -129
  54. package/client/viewparts/lite-menu-portrait-styles.ts +0 -147
  55. package/client/viewparts/lite-menu-portrait.ts +0 -86
  56. package/client/viewparts/top-menu-bar.ts +0 -145
  57. package/dist-client/viewparts/lite-menu-landscape-styles.d.ts +0 -1
  58. package/dist-client/viewparts/lite-menu-landscape-styles.js +0 -149
  59. package/dist-client/viewparts/lite-menu-landscape-styles.js.map +0 -1
  60. package/dist-client/viewparts/lite-menu-landscape.d.ts +0 -20
  61. package/dist-client/viewparts/lite-menu-landscape.js +0 -103
  62. package/dist-client/viewparts/lite-menu-landscape.js.map +0 -1
  63. package/dist-client/viewparts/lite-menu-part.d.ts +0 -28
  64. package/dist-client/viewparts/lite-menu-part.js +0 -143
  65. package/dist-client/viewparts/lite-menu-part.js.map +0 -1
  66. package/dist-client/viewparts/lite-menu-portrait-styles.d.ts +0 -1
  67. package/dist-client/viewparts/lite-menu-portrait-styles.js +0 -147
  68. package/dist-client/viewparts/lite-menu-portrait-styles.js.map +0 -1
  69. package/dist-client/viewparts/lite-menu-portrait.d.ts +0 -12
  70. package/dist-client/viewparts/lite-menu-portrait.js +0 -89
  71. package/dist-client/viewparts/lite-menu-portrait.js.map +0 -1
  72. package/dist-client/viewparts/top-menu-bar.d.ts +0 -22
  73. package/dist-client/viewparts/top-menu-bar.js +0 -150
  74. package/dist-client/viewparts/top-menu-bar.js.map +0 -1
@@ -1,147 +0,0 @@
1
- import { css } from 'lit'
2
-
3
- export const LiteMenuPortraitStyles = css`
4
- :host {
5
- display: flex;
6
- overflow-y: auto;
7
- flex-direction: column;
8
- height: 100%;
9
- }
10
-
11
- :host > ul {
12
- margin-block-end: 1.5em;
13
- }
14
-
15
- ul {
16
- list-style: none;
17
- margin: 0;
18
- padding: 0;
19
- }
20
-
21
- [group-label] {
22
- padding: 25px 0 var(--padding-narrow) var(--padding-wide);
23
- border-bottom: var(--border-dark-color);
24
- font: bold 12px var(--theme-font);
25
- color: rgba(var(--primary-color-rgb), 0.9);
26
- text-transform: uppercase;
27
- }
28
-
29
- a {
30
- display: flex;
31
- align-items: center;
32
- border-bottom: 1px solid rgba(0, 0, 0, 0.07);
33
- padding: var(--padding-default) var(--padding-default) var(--padding-default) var(--padding-wide);
34
- text-decoration: none;
35
- font: normal 14px var(--theme-font);
36
- color: var(--secondary-color);
37
- text-transform: capitalize;
38
-
39
- overflow: hidden;
40
- white-space: nowrap;
41
- text-overflow: ellipsis;
42
- }
43
-
44
- a:hover {
45
- color: var(--primary-color);
46
- font-weight: bold;
47
- }
48
-
49
- a * {
50
- vertical-align: middle;
51
- }
52
-
53
- a mwc-icon {
54
- margin-right: var(--margin-narrow);
55
- font-size: 15px;
56
- color: rgba(var(--secondary-color-rgb), 0.7);
57
- }
58
-
59
- a [submenu-button] {
60
- float: left;
61
- font-size: 15px;
62
- max-height: 20px;
63
- }
64
-
65
- a [submenu-button]::before {
66
- content: 'add_box';
67
- }
68
-
69
- li[active] > a [submenu-button]::before {
70
- content: 'indeterminate_check_box';
71
- }
72
-
73
- li[active] > a {
74
- border-left: 3px solid var(--primary-color);
75
- font-weight: bold;
76
- color: var(--primary-color);
77
- }
78
-
79
- li li a {
80
- padding: 7px 0 7px 35px;
81
- font: normal 13px var(--theme-font);
82
- color: var(--secondary-color);
83
- }
84
-
85
- li li[active] a {
86
- background-color: rgba(var(--primary-color-rgb), 0.15);
87
- font: bold 13px var(--theme-font);
88
- color: var(--primary-color);
89
- }
90
-
91
- li > ul {
92
- overflow-y: hidden;
93
- max-height: 0;
94
- background-color: #f6f6f6;
95
-
96
- transition-property: all;
97
- transition-duration: 0.7s;
98
- }
99
-
100
- li[active] > ul {
101
- max-height: 500px;
102
- }
103
-
104
- li[active] > ul[settled] {
105
- overflow-y: auto;
106
- }
107
-
108
- li li a::before {
109
- margin-right: var(--margin-narrow);
110
- }
111
-
112
- a [badge] {
113
- margin-left: auto;
114
- background-color: var(--primary-background-color);
115
- color: white;
116
- border-radius: 999em;
117
- padding: 0px 6px;
118
- }
119
-
120
- @media only screen and (max-width: 460px) {
121
- :host {
122
- min-width: 100vw;
123
- }
124
-
125
- a {
126
- padding: var(--padding-wide);
127
- font: normal 15px var(--theme-font);
128
- }
129
-
130
- li[active] ul {
131
- border-bottom: 2px solid rgba(0, 0, 0, 0.1);
132
- }
133
-
134
- li li a {
135
- display: block;
136
- padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;
137
- overflow: hidden;
138
- text-overflow: ellipsis;
139
- white-space: nowrap;
140
- font: normal 14px var(--theme-font);
141
- }
142
-
143
- li li[active] a {
144
- font: bold 14px var(--theme-font);
145
- }
146
- }
147
- `
@@ -1,86 +0,0 @@
1
- import '@material/mwc-icon'
2
-
3
- import { html, LitElement } from 'lit'
4
- import { customElement, property, query, state } from 'lit/decorators.js'
5
-
6
- import { navigate } from '@operato/shell'
7
- import { ScrollbarStyles } from '@operato/styles'
8
-
9
- import { LiteMenuPortraitStyles } from './lite-menu-portrait-styles'
10
-
11
- @customElement('lite-menu-portrait')
12
- export class LiteMenuPortrait extends LitElement {
13
- static styles = [ScrollbarStyles, LiteMenuPortraitStyles]
14
-
15
- @property({ type: Array }) menus?: any[]
16
- @property({ type: Object }) activeTopLevel: any
17
- @property({ type: Object }) activeMenu: any
18
- @property({ type: String }) path?: string
19
-
20
- renderMenus(menus, activeTopLevel, activeMenu?) {
21
- return html`
22
- <ul>
23
- ${menus.map(menu => {
24
- var { type, active, path, name, badge, icon, menus } = menu
25
- active = active && typeof active === 'function' ? active.call(menu, { path: this.path }) : false
26
- badge = typeof badge === 'function' ? badge.call(menu) : badge ?? false
27
-
28
- return type == 'group'
29
- ? html`<li group-label>${name}</li>`
30
- : html`
31
- <li ?active=${activeTopLevel ? menu === activeTopLevel : active} .menu=${menu} menu>
32
- <a href=${path || '#'}>
33
- ${menus?.length > 0 ? html` <mwc-icon submenu-button></mwc-icon> ` : html``}
34
- <mwc-icon>${icon}</mwc-icon>
35
- ${name} ${badge !== false ? html`<div badge>${badge}</div>` : html``}
36
- </a>
37
- ${menus && this.renderMenus(menus, activeMenu)}
38
- </li>
39
- `
40
- })}
41
- </ul>
42
- `
43
- }
44
-
45
- render() {
46
- const { menus, activeTopLevel, activeMenu } = this
47
- return this.renderMenus(menus, activeTopLevel, activeMenu)
48
- }
49
-
50
- firstUpdated() {
51
- this.renderRoot.addEventListener('click', (e: Event) => {
52
- const menuElement = (e.target as Element)!.closest('[menu]')
53
-
54
- //@ts-ignore
55
- if (menuElement?.menu) {
56
- //@ts-ignore
57
- let menu = menuElement.menu
58
-
59
- if (!menu.path) {
60
- /* protect to act move to href. */
61
- e.stopPropagation()
62
- e.preventDefault()
63
- }
64
-
65
- this.dispatchEvent(
66
- new CustomEvent('active-toplevel', {
67
- bubbles: true,
68
- detail: this.activeTopLevel === menu ? undefined : menu
69
- })
70
- )
71
- }
72
-
73
- /* to respond even if current acting menu is selected */
74
- let href = (e.target as HTMLAnchorElement)!.href
75
- href && location.href === href && navigate(href + '#force', true)
76
- })
77
-
78
- /* to hide scrollbar during transition */
79
- this.renderRoot.addEventListener('transitionstart', e => {
80
- ;(e.target as Element).removeAttribute('settled')
81
- })
82
- this.renderRoot.addEventListener('transitionend', e => {
83
- ;(e.target as Element).setAttribute('settled', '')
84
- })
85
- }
86
- }
@@ -1,145 +0,0 @@
1
- import '@material/mwc-icon'
2
-
3
- import { css, html, LitElement } from 'lit'
4
- import { customElement, property, query, state } from 'lit/decorators.js'
5
- import { connect } from 'pwa-helpers'
6
-
7
- import { toggleOverlay } from '@operato/layout'
8
- import { store } from '@operato/shell'
9
-
10
- @customElement('top-menu-bar')
11
- export class TopMenuBar extends connect(store)(LitElement) {
12
- static styles = [
13
- css`
14
- :host {
15
- display: flex;
16
- flex-direction: row;
17
- }
18
-
19
- span {
20
- flex: 1;
21
- }
22
-
23
- ul {
24
- display: flex;
25
- align-items: center;
26
- list-style: none;
27
- margin: 0;
28
- padding: 0;
29
- }
30
-
31
- li {
32
- display: inline-flex;
33
- flex-direction: row nowrap;
34
- float: left;
35
- overflow: none;
36
- }
37
-
38
- a {
39
- display: inline-block;
40
- white-space: nowrap;
41
- overflow: hidden;
42
- text-overflow: ellipsis;
43
- padding: var(--padding-default) var(--padding-wide) var(--padding-narrow) var(--padding-wide);
44
- text-decoration: none;
45
- color: white;
46
- }
47
- a * {
48
- vertical-align: middle;
49
- }
50
- a mwc-icon {
51
- opacity: 0.5;
52
- position: relative;
53
- top: -2px;
54
- font-size: 1em;
55
- }
56
-
57
- li[active] a {
58
- font-weight: bold;
59
- }
60
- li[active] a mwc-icon {
61
- opacity: 1;
62
- }
63
- `
64
- ]
65
-
66
- @property({ type: String }) page?: string
67
- @property({ type: String }) resourceId?: string
68
- @property({ type: Array }) menus?: any[]
69
-
70
- @state() private slotTemplate: any
71
- @state() private _activeTopLevel: any
72
-
73
- render() {
74
- const { menus = [], _activeTopLevel } = this
75
-
76
- return html`
77
- <slot name="head"></slot>
78
- <ul>
79
- ${menus.map(menu =>
80
- menu.type == 'group'
81
- ? html``
82
- : html`
83
- <li ?active=${menu === _activeTopLevel}>
84
- <a
85
- href="#"
86
- @click=${e => {
87
- e.preventDefault()
88
- toggleOverlay('lite-menu-part', {
89
- backdrop: true
90
- })
91
- }}
92
- >
93
- ${menu.name}
94
- <mwc-icon>expand_more</mwc-icon>
95
- </a>
96
- </li>
97
- `
98
- )}
99
- </ul>
100
- <slot name="tail"></slot>
101
- `
102
- }
103
-
104
- stateChanged(state) {
105
- this.page = state.route.page
106
- this.resourceId = state.route.resourceId
107
- this.menus = state.liteMenu.menus || []
108
- this.slotTemplate = state.liteMenu.slotTemplate
109
- }
110
-
111
- // firstUpdated() {
112
- // this.addEventListener('mousewheel', this.onWheelEvent.bind(this), false)
113
- // }
114
-
115
- updated(changes) {
116
- if (changes.has('menus') || changes.has('page') || changes.has('resourceId')) {
117
- this._findActivePage()
118
- }
119
-
120
- if (changes.has('slotTemplate')) {
121
- this.replaceChild(this.slotTemplate, this.renderRoot)
122
- }
123
- }
124
-
125
- // onWheelEvent(e) {
126
- // var delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail))
127
- // this.scrollLeft -= delta * 40
128
- // console.log('delta', this.scrollLeft, delta, e.wheelDelta || -e.detail)
129
-
130
- // e.preventDefault()
131
- // }
132
-
133
- _findActivePage() {
134
- var path = this.resourceId ? `${this.page}/${this.resourceId}` : this.page
135
- var menus = this.menus || []
136
-
137
- this._activeTopLevel = menus.find(menu => {
138
- if (menu.path?.split('?')[0] === path) {
139
- return true
140
- } else if (menu.menus) {
141
- return !!menu.menus.find(menu => menu.path?.split('?')[0] === path)
142
- }
143
- })
144
- }
145
- }
@@ -1 +0,0 @@
1
- export declare const LiteMenuLandscapeStyles: import("lit").CSSResult;
@@ -1,149 +0,0 @@
1
- import { css } from 'lit';
2
- export const LiteMenuLandscapeStyles = css `
3
- :host {
4
- overflow-x: auto;
5
- background-color: var(--secondary-text-color);
6
- --focus-anchor-color: #e6ffa2;
7
- }
8
-
9
- :host > div {
10
- overflow-x: auto;
11
- }
12
-
13
- :host > div > ul {
14
- display: flex;
15
- flex-direction: row;
16
- list-style: none;
17
- margin: auto;
18
- padding: 0;
19
- border: var(--border-dark-color);
20
- border-width: 0 1px;
21
- max-width: 1250px;
22
- }
23
-
24
- :host > div > ul > li {
25
- flex: 1;
26
-
27
- display: flex;
28
- flex-direction: column;
29
- }
30
- :host > div > ul > li > a {
31
- display: none;
32
- font-weight: bold;
33
- font-size: var(--fontsize-large);
34
- }
35
-
36
- ul[submenus] {
37
- flex: 1;
38
- list-style: none;
39
- overflow-y: hidden;
40
- background-color: var(--primary-color);
41
- margin: 0;
42
- padding: 0;
43
- border-left: var(--border-dark-color);
44
- }
45
-
46
- ul[submenus] li {
47
- min-width: 120px;
48
- max-width: 180px;
49
- }
50
-
51
- a {
52
- display: block;
53
- padding: var(--padding-default) var(--padding-default) var(--padding-narrow) var(--padding-wide);
54
- text-decoration: none;
55
- font: normal 14px var(--theme-font);
56
- color: var(--theme-white-color);
57
- text-transform: capitalize;
58
-
59
- overflow: hidden;
60
- white-space: nowrap;
61
- text-overflow: ellipsis;
62
- }
63
-
64
- a:hover {
65
- font-weight: bold;
66
- }
67
-
68
- ul[submenus] a::before {
69
- content: '';
70
- display: inline-block;
71
- position: relative;
72
- top: -1px;
73
- width: 5px;
74
- height: 5px;
75
- border: 1px solid var(--theme-white-color);
76
- border-radius: 50%;
77
- background-color: transparent;
78
- margin-right: 3px;
79
- }
80
- ul[submenus] a:hover,
81
- ul[submenus] li[active] a {
82
- background-color: rgba(var(--secondary-color-rgb), 0.3);
83
- color: var(--focus-anchor-color);
84
- font-weight: bold;
85
- }
86
-
87
- [description] {
88
- background-color: var(--primary-color);
89
- margin: 0;
90
- padding: var(--padding-default) 0;
91
- border-left: 1px solid rgba(0, 0, 0, 0.1);
92
- color: var(--focus-anchor-color);
93
- font-size: 11px;
94
- }
95
- [description] mwc-icon {
96
- background-color: rgba(0, 0, 0, 0.15);
97
- margin-right: 4px;
98
- padding: var(--padding-narrow);
99
- border-radius: 0 5px 5px 0;
100
- float: left;
101
- font-size: 26px;
102
- }
103
-
104
- @media only screen and (max-width: 460px) {
105
- :host {
106
- min-width: 100vw;
107
- }
108
- :host > div {
109
- display: initial;
110
- }
111
- :host > div > ul {
112
- flex-direction: column;
113
- }
114
- a {
115
- padding: var(--padding-wide);
116
- font: normal 15px var(--theme-font);
117
- }
118
- li[active] ul {
119
- border-bottom: 2px solid rgba(0, 0, 0, 0.1);
120
- }
121
- li li a {
122
- display: block;
123
- padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;
124
- overflow: hidden;
125
- text-overflow: ellipsis;
126
- white-space: nowrap;
127
- font: normal 14px var(--theme-font);
128
- }
129
- li li[active] a {
130
- font: bold 14px var(--theme-font);
131
- }
132
- :host > div > ul > li > a {
133
- display: block;
134
- }
135
- :host > div > ul > li > a mwc-icon {
136
- font-size: 1em;
137
- position: relative;
138
- top: 2px;
139
- }
140
- [description] {
141
- display: none;
142
- }
143
- ul[submenus] a:hover,
144
- ul[submenus] li[active] a {
145
- background-color: rgba(var(--secondary-color-rgb), 0.3);
146
- }
147
- }
148
- `;
149
- //# sourceMappingURL=lite-menu-landscape-styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lite-menu-landscape-styles.js","sourceRoot":"","sources":["../../client/viewparts/lite-menu-landscape-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJzC,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const LiteMenuLandscapeStyles = css`\n :host {\n overflow-x: auto;\n background-color: var(--secondary-text-color);\n --focus-anchor-color: #e6ffa2;\n }\n\n :host > div {\n overflow-x: auto;\n }\n\n :host > div > ul {\n display: flex;\n flex-direction: row;\n list-style: none;\n margin: auto;\n padding: 0;\n border: var(--border-dark-color);\n border-width: 0 1px;\n max-width: 1250px;\n }\n\n :host > div > ul > li {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n :host > div > ul > li > a {\n display: none;\n font-weight: bold;\n font-size: var(--fontsize-large);\n }\n\n ul[submenus] {\n flex: 1;\n list-style: none;\n overflow-y: hidden;\n background-color: var(--primary-color);\n margin: 0;\n padding: 0;\n border-left: var(--border-dark-color);\n }\n\n ul[submenus] li {\n min-width: 120px;\n max-width: 180px;\n }\n\n a {\n display: block;\n padding: var(--padding-default) var(--padding-default) var(--padding-narrow) var(--padding-wide);\n text-decoration: none;\n font: normal 14px var(--theme-font);\n color: var(--theme-white-color);\n text-transform: capitalize;\n\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n a:hover {\n font-weight: bold;\n }\n\n ul[submenus] a::before {\n content: '';\n display: inline-block;\n position: relative;\n top: -1px;\n width: 5px;\n height: 5px;\n border: 1px solid var(--theme-white-color);\n border-radius: 50%;\n background-color: transparent;\n margin-right: 3px;\n }\n ul[submenus] a:hover,\n ul[submenus] li[active] a {\n background-color: rgba(var(--secondary-color-rgb), 0.3);\n color: var(--focus-anchor-color);\n font-weight: bold;\n }\n\n [description] {\n background-color: var(--primary-color);\n margin: 0;\n padding: var(--padding-default) 0;\n border-left: 1px solid rgba(0, 0, 0, 0.1);\n color: var(--focus-anchor-color);\n font-size: 11px;\n }\n [description] mwc-icon {\n background-color: rgba(0, 0, 0, 0.15);\n margin-right: 4px;\n padding: var(--padding-narrow);\n border-radius: 0 5px 5px 0;\n float: left;\n font-size: 26px;\n }\n\n @media only screen and (max-width: 460px) {\n :host {\n min-width: 100vw;\n }\n :host > div {\n display: initial;\n }\n :host > div > ul {\n flex-direction: column;\n }\n a {\n padding: var(--padding-wide);\n font: normal 15px var(--theme-font);\n }\n li[active] ul {\n border-bottom: 2px solid rgba(0, 0, 0, 0.1);\n }\n li li a {\n display: block;\n padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font: normal 14px var(--theme-font);\n }\n li li[active] a {\n font: bold 14px var(--theme-font);\n }\n :host > div > ul > li > a {\n display: block;\n }\n :host > div > ul > li > a mwc-icon {\n font-size: 1em;\n position: relative;\n top: 2px;\n }\n [description] {\n display: none;\n }\n ul[submenus] a:hover,\n ul[submenus] li[active] a {\n background-color: rgba(var(--secondary-color-rgb), 0.3);\n }\n }\n`\n"]}
@@ -1,20 +0,0 @@
1
- import '@material/mwc-icon';
2
- import { LitElement } from 'lit';
3
- declare const LiteMenuLandscape_base: (new (...args: any[]) => {
4
- _storeUnsubscribe: import("redux").Unsubscribe;
5
- connectedCallback(): void;
6
- disconnectedCallback(): void;
7
- stateChanged(_state: unknown): void;
8
- readonly isConnected: boolean;
9
- }) & typeof LitElement;
10
- export declare class LiteMenuLandscape extends LiteMenuLandscape_base {
11
- static styles: import("lit").CSSResult[];
12
- menus?: any[];
13
- activeTopLevel: any;
14
- activeMenu: any;
15
- path?: string;
16
- render(): import("lit-html").TemplateResult<1>;
17
- firstUpdated(): void;
18
- onWheelEvent(e: WheelEvent): void;
19
- }
20
- export {};
@@ -1,103 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import '@material/mwc-icon';
3
- import { html, LitElement } from 'lit';
4
- import { customElement, property } from 'lit/decorators.js';
5
- import { connect } from 'pwa-helpers';
6
- import { navigate, store } from '@operato/shell';
7
- import { ScrollbarStyles } from '@operato/styles';
8
- import { LiteMenuLandscapeStyles } from './lite-menu-landscape-styles';
9
- let LiteMenuLandscape = class LiteMenuLandscape extends connect(store)(LitElement) {
10
- render() {
11
- const { menus = [], activeTopLevel, activeMenu } = this;
12
- return html `
13
- <div id="wrap" @mousewheel=${this.onWheelEvent.bind(this)}>
14
- <ul>
15
- ${menus.map(menu => {
16
- var _a;
17
- return menu.type == 'group'
18
- ? html ``
19
- : html `
20
- <li ?active=${menu === activeTopLevel}>
21
- <a href=${menu.path || '#'}>
22
- ${menu.icon ? html `<mwc-icon>${menu.icon}</mwc-icon>` : html ``} ${menu.name}
23
- </a>
24
-
25
- <ul submenus>
26
- ${(_a = menu.menus) === null || _a === void 0 ? void 0 : _a.map(menu => html `
27
- <li ?active=${menu === activeMenu}>
28
- <a href=${menu.path || '#'}> ${menu.name} </a>
29
- </li>
30
- `)}
31
- </ul>
32
-
33
- <div description>
34
- ${menu.icon ? html `<mwc-icon>${menu.icon}</mwc-icon>` : html ``} ${menu.description || ''}
35
- </div>
36
- </li>
37
- `;
38
- })}
39
- </ul>
40
- </div>
41
- `;
42
- }
43
- firstUpdated() {
44
- this.renderRoot.addEventListener('click', (e) => {
45
- //@ts-ignore
46
- if (e.target.submenu) {
47
- /* protect to act move to href. */
48
- e.stopPropagation();
49
- e.preventDefault();
50
- //@ts-ignore
51
- let menu = e.target.submenu;
52
- this.dispatchEvent(new CustomEvent('active-toplevel', {
53
- bubbles: true,
54
- detail: this.activeTopLevel === menu ? undefined : menu
55
- }));
56
- return;
57
- }
58
- /* to respond even if current acting menu is selected */
59
- let href = e.target.href;
60
- href && location.href === href && navigate(href + '#force', true);
61
- });
62
- /* to hide scrollbar during transition */
63
- this.renderRoot.addEventListener('transitionstart', e => {
64
- ;
65
- e.target.removeAttribute('settled');
66
- });
67
- this.renderRoot.addEventListener('transitionend', e => {
68
- ;
69
- e.target.setAttribute('settled', '');
70
- });
71
- }
72
- onWheelEvent(e) {
73
- const { target, deltaY, detail } = e;
74
- if (!(target instanceof HTMLElement)) {
75
- return;
76
- }
77
- const delta = deltaY || -detail;
78
- target.scrollLeft -= (delta / Math.abs(delta)) * 10;
79
- e.preventDefault();
80
- }
81
- };
82
- LiteMenuLandscape.styles = [ScrollbarStyles, LiteMenuLandscapeStyles];
83
- __decorate([
84
- property({ type: Array }),
85
- __metadata("design:type", Array)
86
- ], LiteMenuLandscape.prototype, "menus", void 0);
87
- __decorate([
88
- property({ type: Object }),
89
- __metadata("design:type", Object)
90
- ], LiteMenuLandscape.prototype, "activeTopLevel", void 0);
91
- __decorate([
92
- property({ type: Object }),
93
- __metadata("design:type", Object)
94
- ], LiteMenuLandscape.prototype, "activeMenu", void 0);
95
- __decorate([
96
- property({ type: String }),
97
- __metadata("design:type", String)
98
- ], LiteMenuLandscape.prototype, "path", void 0);
99
- LiteMenuLandscape = __decorate([
100
- customElement('lite-menu-landscape')
101
- ], LiteMenuLandscape);
102
- export { LiteMenuLandscape };
103
- //# sourceMappingURL=lite-menu-landscape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lite-menu-landscape.js","sourceRoot":"","sources":["../../client/viewparts/lite-menu-landscape.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAgB,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAG/D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAQ/D,MAAM;QACJ,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;QAEvD,OAAO,IAAI,CAAA;mCACoB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;;YAEnD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EA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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAgB;AAC3C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAc;AAN9B,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA2F7B;SA3FY,iBAAiB","sourcesContent":["import '@material/mwc-icon'\n\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { navigate, store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { LiteMenuLandscapeStyles } from './lite-menu-landscape-styles'\n\n@customElement('lite-menu-landscape')\nexport class LiteMenuLandscape extends connect(store)(LitElement) {\n static styles = [ScrollbarStyles, LiteMenuLandscapeStyles]\n\n @property({ type: Array }) menus?: any[]\n @property({ type: Object }) activeTopLevel: any\n @property({ type: Object }) activeMenu: any\n @property({ type: String }) path?: string\n\n render() {\n const { menus = [], activeTopLevel, activeMenu } = this\n\n return html`\n <div id=\"wrap\" @mousewheel=${this.onWheelEvent.bind(this)}>\n <ul>\n ${menus.map(menu =>\n menu.type == 'group'\n ? html``\n : html`\n <li ?active=${menu === activeTopLevel}>\n <a href=${menu.path || '#'}>\n ${menu.icon ? html`<mwc-icon>${menu.icon}</mwc-icon>` : html``} ${menu.name}\n </a>\n\n <ul submenus>\n ${menu.menus?.map(\n menu => html`\n <li ?active=${menu === activeMenu}>\n <a href=${menu.path || '#'}> ${menu.name} </a>\n </li>\n `\n )}\n </ul>\n\n <div description>\n ${menu.icon ? html`<mwc-icon>${menu.icon}</mwc-icon>` : html``} ${menu.description || ''}\n </div>\n </li>\n `\n )}\n </ul>\n </div>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('click', (e: Event) => {\n //@ts-ignore\n if (e.target.submenu) {\n /* protect to act move to href. */\n e.stopPropagation()\n e.preventDefault()\n\n //@ts-ignore\n let menu = e.target.submenu\n\n this.dispatchEvent(\n new CustomEvent('active-toplevel', {\n bubbles: true,\n detail: this.activeTopLevel === menu ? undefined : menu\n })\n )\n\n return\n }\n\n /* to respond even if current acting menu is selected */\n let href = (e.target as HTMLAnchorElement).href\n href && location.href === href && navigate(href + '#force', true)\n })\n\n /* to hide scrollbar during transition */\n this.renderRoot.addEventListener('transitionstart', e => {\n ;(e.target as HTMLElement).removeAttribute('settled')\n })\n this.renderRoot.addEventListener('transitionend', e => {\n ;(e.target as HTMLElement).setAttribute('settled', '')\n })\n }\n\n onWheelEvent(e: WheelEvent) {\n const { target, deltaY, detail } = e\n\n if (!(target instanceof HTMLElement)) {\n return\n }\n\n const delta = deltaY || -detail\n target.scrollLeft -= (delta / Math.abs(delta)) * 10\n\n e.preventDefault()\n }\n}\n"]}