@operato/menu 8.0.0 → 9.0.0-beta.10
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.
- package/CHANGELOG.md +208 -20
- package/dist/src/ox-menu-landscape.d.ts +1 -1
- package/dist/src/ox-menu-landscape.js +34 -2
- package/dist/src/ox-menu-landscape.js.map +1 -1
- package/dist/src/ox-menu-part.d.ts +3 -3
- package/dist/src/ox-menu-part.js +62 -6
- package/dist/src/ox-menu-part.js.map +1 -1
- package/dist/src/ox-menu-portrait.d.ts +1 -1
- package/dist/src/ox-menu-portrait.js +35 -3
- package/dist/src/ox-menu-portrait.js.map +1 -1
- package/dist/src/ox-top-menu-bar.d.ts +1 -1
- package/dist/src/ox-top-menu-bar.js +41 -3
- package/dist/src/ox-top-menu-bar.js.map +1 -1
- package/dist/stories/ox-menu-container.d.ts +2 -2
- package/dist/stories/ox-menu-container.js +37 -5
- package/dist/stories/ox-menu-container.js.map +1 -1
- package/dist/stories/ox-menu-portrait.stories.d.ts +2 -2
- package/dist/stories/ox-menu-portrait.stories.js +3 -3
- package/dist/stories/ox-menu-portrait.stories.js.map +1 -1
- package/dist/stories/test-menus.d.ts +1 -1
- package/dist/stories/test-menus.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [
|
|
6
|
+
## [9.0.0-beta.10](https://github.com/hatiolab/operato/compare/v9.0.0-beta.9...v9.0.0-beta.10) (2025-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* tweak tsconfig.json ([3c424b1](https://github.com/hatiolab/operato/commit/3c424b18d046f95d5619076d113d49a4b4dc9bbb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [9.0.0-beta.7](https://github.com/hatiolab/operato/compare/v9.0.0-beta.6...v9.0.0-beta.7) (2025-01-20)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @operato/menu
|
|
9
18
|
|
|
@@ -11,7 +20,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
20
|
|
|
12
21
|
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
|
|
15
24
|
|
|
16
25
|
**Note:** Version bump only for package @operato/menu
|
|
17
26
|
|
|
@@ -19,17 +28,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
28
|
|
|
20
29
|
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
|
23
32
|
|
|
24
33
|
|
|
25
34
|
### :bug: Bug Fix
|
|
26
35
|
|
|
27
|
-
*
|
|
28
|
-
|
|
36
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
|
37
|
+
|
|
38
|
+
|
|
29
39
|
|
|
40
|
+
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
|
30
41
|
|
|
31
42
|
|
|
32
|
-
###
|
|
43
|
+
### :bug: Bug Fix
|
|
44
|
+
|
|
45
|
+
* esm module ([0402232](https://github.com/hatiolab/operato/commit/04022327fa47eac64eaf3c56eeec55b9ace13e0e))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [9.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-beta.11...v9.0.0-beta.0) (2025-01-13)
|
|
33
50
|
|
|
34
51
|
**Note:** Version bump only for package @operato/menu
|
|
35
52
|
|
|
@@ -37,7 +54,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
37
54
|
|
|
38
55
|
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
## [8.0.0-beta.6](https://github.com/hatiolab/operato/compare/v8.0.0-beta.5...v8.0.0-beta.6) (2025-01-11)
|
|
41
58
|
|
|
42
59
|
**Note:** Version bump only for package @operato/menu
|
|
43
60
|
|
|
@@ -45,7 +62,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
45
62
|
|
|
46
63
|
|
|
47
64
|
|
|
48
|
-
|
|
65
|
+
## [8.0.0-beta.5](https://github.com/hatiolab/operato/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2025-01-10)
|
|
49
66
|
|
|
50
67
|
**Note:** Version bump only for package @operato/menu
|
|
51
68
|
|
|
@@ -53,16 +70,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
53
70
|
|
|
54
71
|
|
|
55
72
|
|
|
56
|
-
|
|
73
|
+
## [8.0.0-beta.2](https://github.com/hatiolab/operato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### :bug: Bug Fix
|
|
77
|
+
|
|
78
|
+
* typo .npmignore ([d9c0c8c](https://github.com/hatiolab/operato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## [8.0.0-beta.1](https://github.com/hatiolab/operato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
|
|
57
83
|
|
|
58
84
|
|
|
59
85
|
### :bug: Bug Fix
|
|
60
86
|
|
|
61
|
-
*
|
|
87
|
+
* missing .npmignore ([be05985](https://github.com/hatiolab/operato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
|
|
62
88
|
|
|
63
89
|
|
|
64
90
|
|
|
65
|
-
|
|
91
|
+
## [8.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
|
|
66
92
|
|
|
67
93
|
**Note:** Version bump only for package @operato/menu
|
|
68
94
|
|
|
@@ -70,7 +96,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
70
96
|
|
|
71
97
|
|
|
72
98
|
|
|
73
|
-
|
|
99
|
+
## [8.0.0-alpha.54](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.53...v8.0.0-alpha.54) (2024-12-09)
|
|
74
100
|
|
|
75
101
|
**Note:** Version bump only for package @operato/menu
|
|
76
102
|
|
|
@@ -78,7 +104,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
78
104
|
|
|
79
105
|
|
|
80
106
|
|
|
81
|
-
|
|
107
|
+
## [8.0.0-alpha.52](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.51...v8.0.0-alpha.52) (2024-12-03)
|
|
82
108
|
|
|
83
109
|
**Note:** Version bump only for package @operato/menu
|
|
84
110
|
|
|
@@ -86,7 +112,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
86
112
|
|
|
87
113
|
|
|
88
114
|
|
|
89
|
-
|
|
115
|
+
## [8.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.50...v8.0.0-alpha.51) (2024-11-29)
|
|
90
116
|
|
|
91
117
|
**Note:** Version bump only for package @operato/menu
|
|
92
118
|
|
|
@@ -94,7 +120,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
94
120
|
|
|
95
121
|
|
|
96
122
|
|
|
97
|
-
|
|
123
|
+
## [8.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.49...v8.0.0-alpha.50) (2024-11-16)
|
|
98
124
|
|
|
99
125
|
**Note:** Version bump only for package @operato/menu
|
|
100
126
|
|
|
@@ -102,16 +128,178 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
102
128
|
|
|
103
129
|
|
|
104
130
|
|
|
105
|
-
|
|
131
|
+
## [8.0.0-alpha.49](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.48...v8.0.0-alpha.49) (2024-11-13)
|
|
132
|
+
|
|
133
|
+
**Note:** Version bump only for package @operato/menu
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## [8.0.0-alpha.48](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.47...v8.0.0-alpha.48) (2024-11-13)
|
|
140
|
+
|
|
141
|
+
**Note:** Version bump only for package @operato/menu
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## [8.0.0-alpha.46](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.45...v8.0.0-alpha.46) (2024-10-23)
|
|
148
|
+
|
|
149
|
+
**Note:** Version bump only for package @operato/menu
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
## [8.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.44...v8.0.0-alpha.45) (2024-10-23)
|
|
156
|
+
|
|
157
|
+
**Note:** Version bump only for package @operato/menu
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## [8.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.40...v8.0.0-alpha.41) (2024-10-21)
|
|
164
|
+
|
|
165
|
+
**Note:** Version bump only for package @operato/menu
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## [8.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.36...v8.0.0-alpha.37) (2024-10-20)
|
|
106
172
|
|
|
107
173
|
|
|
108
174
|
### :bug: Bug Fix
|
|
109
175
|
|
|
110
|
-
*
|
|
176
|
+
* update dev-dependencies version ([d6fe342](https://github.com/hatiolab/operato/commit/d6fe342de738c6bad3528550a862b5a1d2573161))
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## [8.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.33...v8.0.0-alpha.34) (2024-10-15)
|
|
181
|
+
|
|
182
|
+
**Note:** Version bump only for package @operato/menu
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
## [8.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.32...v8.0.0-alpha.33) (2024-10-14)
|
|
189
|
+
|
|
190
|
+
**Note:** Version bump only for package @operato/menu
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## [8.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.29...v8.0.0-alpha.30) (2024-10-11)
|
|
197
|
+
|
|
198
|
+
**Note:** Version bump only for package @operato/menu
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
## [8.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.28...v8.0.0-alpha.29) (2024-10-10)
|
|
205
|
+
|
|
206
|
+
**Note:** Version bump only for package @operato/menu
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
## [8.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.26...v8.0.0-alpha.27) (2024-10-06)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### :bug: Bug Fix
|
|
216
|
+
|
|
217
|
+
* calendar css variables ([9ea1918](https://github.com/hatiolab/operato/commit/9ea191844c72de5f920a8da85ad50209ba77cc07))
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## [8.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.25...v8.0.0-alpha.26) (2024-10-06)
|
|
222
|
+
|
|
223
|
+
**Note:** Version bump only for package @operato/menu
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
## [8.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.20...v8.0.0-alpha.21) (2024-10-05)
|
|
230
|
+
|
|
231
|
+
**Note:** Version bump only for package @operato/menu
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
## [8.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.19...v8.0.0-alpha.20) (2024-10-04)
|
|
238
|
+
|
|
239
|
+
**Note:** Version bump only for package @operato/menu
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
## [8.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.18...v8.0.0-alpha.19) (2024-10-04)
|
|
246
|
+
|
|
247
|
+
**Note:** Version bump only for package @operato/menu
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
## [8.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.9...v8.0.0-alpha.10) (2024-09-18)
|
|
254
|
+
|
|
255
|
+
**Note:** Version bump only for package @operato/menu
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
## [8.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.7...v8.0.0-alpha.8) (2024-09-15)
|
|
262
|
+
|
|
263
|
+
**Note:** Version bump only for package @operato/menu
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
## [8.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.5...v8.0.0-alpha.6) (2024-09-14)
|
|
270
|
+
|
|
271
|
+
**Note:** Version bump only for package @operato/menu
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
## [8.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.4...v8.0.0-alpha.5) (2024-09-12)
|
|
278
|
+
|
|
279
|
+
**Note:** Version bump only for package @operato/menu
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
## [8.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.3...v8.0.0-alpha.4) (2024-09-07)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
### :bug: Bug Fix
|
|
289
|
+
|
|
290
|
+
* dataset components & styles ([be44acd](https://github.com/hatiolab/operato/commit/be44acde8f25980e5b27afc481a2c149f8c23dbd))
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## [8.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.2...v8.0.0-alpha.3) (2024-09-06)
|
|
295
|
+
|
|
296
|
+
**Note:** Version bump only for package @operato/menu
|
|
297
|
+
|
|
298
|
+
|
|
111
299
|
|
|
112
300
|
|
|
113
301
|
|
|
114
|
-
|
|
302
|
+
## [8.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2024-09-05)
|
|
115
303
|
|
|
116
304
|
**Note:** Version bump only for package @operato/menu
|
|
117
305
|
|
|
@@ -119,7 +307,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
119
307
|
|
|
120
308
|
|
|
121
309
|
|
|
122
|
-
|
|
310
|
+
## [8.0.0-alpha.1](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2024-09-04)
|
|
123
311
|
|
|
124
312
|
**Note:** Version bump only for package @operato/menu
|
|
125
313
|
|
|
@@ -127,7 +315,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
127
315
|
|
|
128
316
|
|
|
129
317
|
|
|
130
|
-
|
|
318
|
+
## [8.0.0-alpha.0](https://github.com/hatiolab/operato/compare/v7.1.1...v8.0.0-alpha.0) (2024-09-01)
|
|
131
319
|
|
|
132
320
|
**Note:** Version bump only for package @operato/menu
|
|
133
321
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { Menu } from './types';
|
|
3
|
+
import { Menu } from './types.js';
|
|
4
4
|
declare const OxMenuLandscape_base: (new (...args: any[]) => {
|
|
5
5
|
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
6
6
|
connectedCallback(): void;
|
|
@@ -5,8 +5,35 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
5
5
|
import { connect } from 'pwa-helpers';
|
|
6
6
|
import { navigate, store } from '@operato/shell';
|
|
7
7
|
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
-
import { MenuLandscapeStyles } from './menu-landscape-styles';
|
|
8
|
+
import { MenuLandscapeStyles } from './menu-landscape-styles.js';
|
|
9
9
|
let OxMenuLandscape = class OxMenuLandscape extends connect(store)(LitElement) {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
Object.defineProperty(this, "menus", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "activeTopLevel", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "activeMenu", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "path", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: void 0
|
|
35
|
+
});
|
|
36
|
+
}
|
|
10
37
|
render() {
|
|
11
38
|
const { menus = [], activeTopLevel, activeMenu } = this;
|
|
12
39
|
return html `
|
|
@@ -79,7 +106,12 @@ let OxMenuLandscape = class OxMenuLandscape extends connect(store)(LitElement) {
|
|
|
79
106
|
e.preventDefault();
|
|
80
107
|
}
|
|
81
108
|
};
|
|
82
|
-
OxMenuLandscape
|
|
109
|
+
Object.defineProperty(OxMenuLandscape, "styles", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
value: [ScrollbarStyles, MenuLandscapeStyles]
|
|
114
|
+
});
|
|
83
115
|
__decorate([
|
|
84
116
|
property({ type: Array })
|
|
85
117
|
], OxMenuLandscape.prototype, "menus", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-menu-landscape.js","sourceRoot":"","sources":["../../src/ox-menu-landscape.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,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;AAGjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ox-menu-landscape.js","sourceRoot":"","sources":["../../src/ox-menu-landscape.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,E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AAC,UAAU,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE;YACpD,CAAC;YAAC,CAAC,CAAC,MAAsB,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,CAAC,CAAa;QACxB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QAEpC,IAAI,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE,CAAC;YACrC,OAAM;QACR,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAA;QAC/B,MAAM,CAAC,UAAU,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAA;QAEnD,CAAC,CAAC,cAAc,EAAE,CAAA;IACpB,CAAC;;AAzFM;;;;WAAS,CAAC,eAAe,EAAE,mBAAmB,CAAC;EAAzC,CAAyC;AAE3B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAAe;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AAN9B,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA2F3B","sourcesContent":["import '@material/web/icon/icon.js'\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 { Menu } from './types.js'\nimport { MenuLandscapeStyles } from './menu-landscape-styles.js'\n\n@customElement('ox-menu-landscape')\nexport class OxMenuLandscape extends connect(store)(LitElement) {\n static styles = [ScrollbarStyles, MenuLandscapeStyles]\n\n @property({ type: Array }) menus?: Menu[]\n @property({ type: Object }) activeTopLevel?: Menu\n @property({ type: Object }) activeMenu!: Menu\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`<md-icon>${menu.icon}</md-icon>` : html``} ${menu.label || 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.label || menu.name} </a>\n </li>\n `\n )}\n </ul>\n\n <div description>\n ${menu.icon ? html`<md-icon>${menu.icon}</md-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"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
|
-
import './ox-menu-portrait';
|
|
3
|
-
import './ox-menu-landscape';
|
|
2
|
+
import './ox-menu-portrait.js';
|
|
3
|
+
import './ox-menu-landscape.js';
|
|
4
4
|
import { LitElement, PropertyValues } from 'lit';
|
|
5
|
-
import { Menu } from './types';
|
|
5
|
+
import { Menu } from './types.js';
|
|
6
6
|
declare const OxMenuPart_base: (new (...args: any[]) => {
|
|
7
7
|
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
8
8
|
connectedCallback(): void;
|
package/dist/src/ox-menu-part.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
|
-
import './ox-menu-portrait';
|
|
4
|
-
import './ox-menu-landscape';
|
|
3
|
+
import './ox-menu-portrait.js';
|
|
4
|
+
import './ox-menu-landscape.js';
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
7
|
import { connect } from 'pwa-helpers';
|
|
@@ -13,6 +13,57 @@ function isActiveMenu(menu, path) {
|
|
|
13
13
|
(menu.active && typeof menu.active === 'function' && menu.active.call(menu, { path })));
|
|
14
14
|
}
|
|
15
15
|
let OxMenuPart = class OxMenuPart extends connect(store)(LitElement) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
Object.defineProperty(this, "page", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "resourceId", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "menus", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: void 0
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(this, "orientation", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: void 0
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(this, "slotTemplate", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: void 0
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(this, "_activeTopLevel", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: void 0
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(this, "_activeMenu", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: void 0
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(this, "_path", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: void 0
|
|
65
|
+
});
|
|
66
|
+
}
|
|
16
67
|
render() {
|
|
17
68
|
return html `
|
|
18
69
|
<slot name="head"></slot>
|
|
@@ -79,9 +130,13 @@ let OxMenuPart = class OxMenuPart extends connect(store)(LitElement) {
|
|
|
79
130
|
this._activeMenu = activeMenu || this._activeTopLevel;
|
|
80
131
|
}
|
|
81
132
|
};
|
|
82
|
-
OxMenuPart
|
|
83
|
-
|
|
84
|
-
|
|
133
|
+
Object.defineProperty(OxMenuPart, "styles", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
configurable: true,
|
|
136
|
+
writable: true,
|
|
137
|
+
value: [
|
|
138
|
+
ScrollbarStyles,
|
|
139
|
+
css `
|
|
85
140
|
:host {
|
|
86
141
|
display: flex;
|
|
87
142
|
overflow-y: auto;
|
|
@@ -103,7 +158,8 @@ OxMenuPart.styles = [
|
|
|
103
158
|
flex: 1;
|
|
104
159
|
}
|
|
105
160
|
`
|
|
106
|
-
]
|
|
161
|
+
]
|
|
162
|
+
});
|
|
107
163
|
__decorate([
|
|
108
164
|
property({ type: String })
|
|
109
165
|
], OxMenuPart.prototype, "page", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-menu-part.js","sourceRoot":"","sources":["../../src/ox-menu-part.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"ox-menu-part.js","sourceRoot":"","sources":["../../src/ox-menu-part.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAIjD,SAAS,YAAY,CAAC,IAAU,EAAE,IAAY;;IAC5C,OAAO,CACL,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,MAAK,IAAI;QACjC,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CACvF,CAAA;AACH,CAAC;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,OAAO,CAAC,KAA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AC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,WAAW,GAAG,UAAU,IAAI,IAAI,CAAC,eAAe,CAAA;IACvD,CAAC;;AA3GM;;;;WAAS;QACd,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;KACF;EAxBY,CAwBZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAoB;AACpB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAe;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAuC;AAEzD;IAAR,KAAK,EAAE;gDAAkB;AACjB;IAAR,KAAK,EAAE;mDAAuB;AACtB;IAAR,KAAK,EAAE;+CAAmB;AAClB;IAAR,KAAK,EAAE;yCAAe;AAnCZ,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CA6GtB","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-menu-portrait.js'\nimport './ox-menu-landscape.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { Menu } from './types.js'\n\nfunction isActiveMenu(menu: Menu, path: string) {\n return (\n menu.path?.split('?')[0] === path ||\n (menu.active && typeof menu.active === 'function' && menu.active.call(menu, { path }))\n )\n}\n\n@customElement('ox-menu-part')\nexport class OxMenuPart extends connect(store)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n overflow-y: auto;\n flex-direction: column;\n height: 100%;\n min-width: 200px;\n background-color: var(--md-sys-color-surface);\n }\n\n :host([landscape]) {\n overflow-x: auto;\n flex-direction: row;\n width: 100%;\n min-height: 20px;\n }\n\n ox-menu-portrait,\n ox-menu-landscape {\n flex: 1;\n }\n `\n ]\n\n @property({ type: String }) page!: string\n @property({ type: String }) resourceId?: string\n @property({ type: Array }) menus?: Menu[]\n @property({ type: String }) orientation?: 'landscape' | 'portrait'\n\n @state() slotTemplate: any\n @state() _activeTopLevel?: Menu\n @state() _activeMenu?: Menu\n @state() _path?: string\n\n render() {\n return html`\n <slot name=\"head\"></slot>\n ${this.orientation !== 'landscape'\n ? html`<ox-menu-portrait\n .menus=${this.menus}\n .activeTopLevel=${this._activeTopLevel}\n .activeMenu=${this._activeMenu}\n .path=${this._path}\n ></ox-menu-portrait>`\n : html`<ox-menu-landscape\n .menus=${this.menus}\n .activeTopLevel=${this._activeTopLevel}\n .activeMenu=${this._activeMenu}\n .path=${this._path}\n ></ox-menu-landscape>`}\n <slot name=\"tail\"></slot>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('active-toplevel', (e: Event) => {\n e.stopPropagation()\n e.preventDefault()\n\n this._activeTopLevel = (e as CustomEvent).detail\n })\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('menus') || changes.has('page') || changes.has('resourceId')) {\n this.findActivePage()\n }\n\n if (changes.has('orientation')) {\n if (this.orientation == 'portrait') {\n this.removeAttribute('landscape')\n } else {\n this.setAttribute('landscape', '')\n }\n }\n\n if (changes.has('slotTemplate')) {\n this.replaceChild(this.slotTemplate, this.renderRoot)\n }\n }\n\n stateChanged(state: any): void {\n this.page = state.route.page\n this.resourceId = state.route.resourceId\n this.menus = state.liteMenu.menus || []\n this.slotTemplate = state.liteMenu.slotTemplate\n }\n\n private findActivePage() {\n var path = this.resourceId ? `${this.page}/${this.resourceId}` : this.page\n var menus = this.menus || []\n var activeMenu\n\n this._activeTopLevel = menus.find(menu => {\n if (isActiveMenu(menu, path)) {\n activeMenu = menu\n return true\n } else if (menu.menus) {\n activeMenu = menu.menus.find(menu => isActiveMenu(menu, path))\n return !!activeMenu\n }\n })\n\n this._path = path\n this._activeMenu = activeMenu || this._activeTopLevel\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { LitElement, nothing, TemplateResult } from 'lit';
|
|
3
|
-
import { Menu } from './types';
|
|
3
|
+
import { Menu } from './types.js';
|
|
4
4
|
export declare class OxMenuPortrait extends LitElement {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
6
|
menus?: Menu[];
|
|
@@ -4,8 +4,35 @@ import { html, LitElement, nothing } from 'lit';
|
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
5
|
import { navigate } from '@operato/shell';
|
|
6
6
|
import { ScrollbarStyles } from '@operato/styles';
|
|
7
|
-
import { MenuPortraitStyles } from './menu-portrait-styles';
|
|
7
|
+
import { MenuPortraitStyles } from './menu-portrait-styles.js';
|
|
8
8
|
let OxMenuPortrait = class OxMenuPortrait extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
Object.defineProperty(this, "menus", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "activeTopLevel", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "activeMenu", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "path", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
}
|
|
9
36
|
renderMenus(menus, activeTopLevel, activeMenu) {
|
|
10
37
|
if (menus.length == 0) {
|
|
11
38
|
return nothing;
|
|
@@ -15,7 +42,7 @@ let OxMenuPortrait = class OxMenuPortrait extends LitElement {
|
|
|
15
42
|
${menus.map(menu => {
|
|
16
43
|
var { type, name, active, path, label = name, badge, icon, menus = [] } = menu;
|
|
17
44
|
active = active && typeof active === 'function' ? active.call(menu, { path: this.path }) : false;
|
|
18
|
-
badge = typeof badge === 'function' ? badge.call(menu) : badge !== null && badge !== void 0 ? badge : false;
|
|
45
|
+
badge = typeof badge === 'function' ? badge.call(menu) : (badge !== null && badge !== void 0 ? badge : false);
|
|
19
46
|
return type == 'group'
|
|
20
47
|
? html `<li group-label>${label}</li>`
|
|
21
48
|
: html `
|
|
@@ -68,7 +95,12 @@ let OxMenuPortrait = class OxMenuPortrait extends LitElement {
|
|
|
68
95
|
});
|
|
69
96
|
}
|
|
70
97
|
};
|
|
71
|
-
OxMenuPortrait
|
|
98
|
+
Object.defineProperty(OxMenuPortrait, "styles", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
value: [ScrollbarStyles, MenuPortraitStyles]
|
|
103
|
+
});
|
|
72
104
|
__decorate([
|
|
73
105
|
property({ type: Array })
|
|
74
106
|
], OxMenuPortrait.prototype, "menus", void 0);
|