@things-factory/lite-menu 4.0.41 → 4.0.45
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/client/actions/lite-menu.js +15 -11
- package/client/bootstrap.js +8 -5
- package/client/pages/addon-menu-setting.js +121 -62
- package/client/viewparts/lite-menu-landscape-styles.js +1 -1
- package/client/viewparts/lite-menu-landscape.js +3 -3
- package/client/viewparts/lite-menu-part.js +4 -4
- package/client/viewparts/lite-menu-portrait-styles.js +1 -1
- package/client/viewparts/lite-menu-portrait.js +6 -3
- package/client/viewparts/top-menu-bar.js +3 -3
- package/package.json +19 -12
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../viewparts/lite-menu-part'
|
|
2
|
+
import '@material/mwc-icon'
|
|
3
|
+
|
|
2
4
|
import gql from 'graphql-tag'
|
|
3
|
-
import {
|
|
4
|
-
import { isMobileDevice } from '@things-factory/utils'
|
|
5
|
-
import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@things-factory/layout-base'
|
|
6
|
-
import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base'
|
|
5
|
+
import { html } from 'lit'
|
|
7
6
|
|
|
8
|
-
import '
|
|
7
|
+
import { client } from '@operato/graphql'
|
|
8
|
+
import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
|
|
9
|
+
import { store } from '@operato/shell'
|
|
10
|
+
import { isMobileDevice } from '@operato/utils'
|
|
11
|
+
import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base'
|
|
9
12
|
|
|
10
13
|
export const UPDATE_ADDON_MENUS = 'UPDATE_ADDON_MENUS'
|
|
11
14
|
export const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE'
|
|
@@ -13,16 +16,17 @@ export const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE'
|
|
|
13
16
|
var HAMBURGER
|
|
14
17
|
|
|
15
18
|
export function setupMenuPart(options) {
|
|
16
|
-
const {
|
|
17
|
-
hovering = isMobileDevice() ? true : false,
|
|
18
|
-
slotTemplate,
|
|
19
|
+
const {
|
|
20
|
+
hovering = isMobileDevice() ? true : false,
|
|
21
|
+
slotTemplate,
|
|
19
22
|
portraitSlotTemplate,
|
|
20
23
|
landscapeSlotTemplate,
|
|
21
|
-
position = VIEWPART_POSITION.NAVBAR
|
|
24
|
+
position = VIEWPART_POSITION.NAVBAR
|
|
22
25
|
} = options || {}
|
|
23
26
|
|
|
24
27
|
const orientation = position == VIEWPART_POSITION.HEADERBAR ? 'landscape' : 'portrait'
|
|
25
|
-
const orientatedSlotTemplate =
|
|
28
|
+
const orientatedSlotTemplate =
|
|
29
|
+
(orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``
|
|
26
30
|
|
|
27
31
|
appendViewpart({
|
|
28
32
|
name: 'lite-menu-part',
|
package/client/bootstrap.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import './route'
|
|
2
|
+
import '@operato/i18n/ox-i18n.js'
|
|
3
|
+
import '@material/mwc-icon'
|
|
4
|
+
|
|
5
|
+
import { html } from 'lit'
|
|
6
|
+
|
|
7
|
+
import { navigate, store } from '@operato/shell'
|
|
3
8
|
import { auth } from '@things-factory/auth-base'
|
|
4
9
|
import { ADD_MORENDA } from '@things-factory/more-base'
|
|
5
10
|
|
|
6
11
|
import { fetchAddonMenus } from './actions/lite-menu'
|
|
7
12
|
import liteMenu from './reducers/lite-menu'
|
|
8
13
|
|
|
9
|
-
import './route'
|
|
10
|
-
|
|
11
14
|
export default function bootstrap() {
|
|
12
15
|
store.addReducers({ liteMenu })
|
|
13
16
|
|
|
@@ -20,7 +23,7 @@ export default function bootstrap() {
|
|
|
20
23
|
type: ADD_MORENDA,
|
|
21
24
|
morenda: {
|
|
22
25
|
icon: html` <mwc-icon>view_list</mwc-icon> `,
|
|
23
|
-
name: html` <i18n
|
|
26
|
+
name: html` <ox-i18n msgid="text.addon-menu management"></ox-i18n> `,
|
|
24
27
|
action: () => {
|
|
25
28
|
navigate('addon-menu-setting')
|
|
26
29
|
}
|
|
@@ -1,33 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import '@operato/data-grist/ox-grist.js'
|
|
2
|
+
import '@operato/data-grist/ox-filters-form.js'
|
|
3
|
+
import '@operato/data-grist/ox-sorters-control.js'
|
|
4
|
+
import '@operato/data-grist/ox-record-creator.js'
|
|
5
|
+
import '@operato/popup/ox-popup.js'
|
|
6
|
+
import '@material/mwc-icon'
|
|
3
7
|
|
|
4
8
|
import gql from 'graphql-tag'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { css, html } from 'lit'
|
|
10
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
11
|
+
|
|
12
|
+
import { getEditor, getRenderer } from '@operato/data-grist'
|
|
13
|
+
import { client } from '@operato/graphql'
|
|
14
|
+
import { i18next, localize } from '@operato/i18n'
|
|
15
|
+
import { PageView, store } from '@operato/shell'
|
|
16
|
+
import { CommonButtonStyles, CommonGristStyles } from '@operato/styles'
|
|
17
|
+
import { isMobileDevice } from '@operato/utils'
|
|
10
18
|
|
|
11
19
|
class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
12
20
|
static get properties() {
|
|
13
21
|
return {
|
|
14
22
|
config: Object,
|
|
15
|
-
menus: Array
|
|
23
|
+
menus: Array,
|
|
24
|
+
mode: String
|
|
16
25
|
}
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
static get styles() {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
return [
|
|
30
|
+
CommonGristStyles,
|
|
31
|
+
css`
|
|
32
|
+
:host {
|
|
33
|
+
display: flex;
|
|
34
|
+
overflow-x: hidden;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
]
|
|
41
|
+
}
|
|
26
42
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
constructor() {
|
|
44
|
+
super()
|
|
45
|
+
|
|
46
|
+
this.mode = isMobileDevice() ? 'CARD' : 'GRID'
|
|
31
47
|
}
|
|
32
48
|
|
|
33
49
|
get context() {
|
|
@@ -68,11 +84,35 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
68
84
|
|
|
69
85
|
render() {
|
|
70
86
|
return html`
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
<ox-grist .mode=${this.mode} .config=${this.config} .fetchHandler=${this.fetchHandler}>
|
|
88
|
+
<div slot="headroom">
|
|
89
|
+
<div id="filters">
|
|
90
|
+
<ox-filters-form></ox-filters-form>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div id="sorters">
|
|
94
|
+
Sort
|
|
95
|
+
<mwc-icon
|
|
96
|
+
@click=${e => {
|
|
97
|
+
const target = e.currentTarget
|
|
98
|
+
this.renderRoot.querySelector('#sorter-control').open({
|
|
99
|
+
right: 0,
|
|
100
|
+
top: target.offsetTop + target.offsetHeight
|
|
101
|
+
})
|
|
102
|
+
}}
|
|
103
|
+
>expand_more</mwc-icon
|
|
104
|
+
>
|
|
105
|
+
<ox-popup id="sorter-control">
|
|
106
|
+
<ox-sorters-control> </ox-sorters-control>
|
|
107
|
+
</ox-popup>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div id="modes">
|
|
111
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${this.mode == 'GRID'}>grid_on</mwc-icon>
|
|
112
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${this.mode == 'CARD'}>apps</mwc-icon>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</ox-grist>
|
|
76
116
|
`
|
|
77
117
|
}
|
|
78
118
|
|
|
@@ -81,7 +121,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
81
121
|
}
|
|
82
122
|
|
|
83
123
|
get grist() {
|
|
84
|
-
return this.shadowRoot.querySelector('
|
|
124
|
+
return this.shadowRoot.querySelector('ox-grist')
|
|
85
125
|
}
|
|
86
126
|
|
|
87
127
|
async onCommit() {
|
|
@@ -113,7 +153,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
113
153
|
|
|
114
154
|
return await client.mutate({
|
|
115
155
|
mutation: gql`
|
|
116
|
-
mutation($name: String!, $patch: LiteMenuPatch!) {
|
|
156
|
+
mutation ($name: String!, $patch: LiteMenuPatch!) {
|
|
117
157
|
updateLiteMenu(name: $name, patch: $patch) {
|
|
118
158
|
id
|
|
119
159
|
name
|
|
@@ -143,7 +183,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
143
183
|
|
|
144
184
|
return await client.mutate({
|
|
145
185
|
mutation: gql`
|
|
146
|
-
mutation($liteMenu: NewLiteMenu!) {
|
|
186
|
+
mutation ($liteMenu: NewLiteMenu!) {
|
|
147
187
|
createLiteMenu(liteMenu: $liteMenu) {
|
|
148
188
|
id
|
|
149
189
|
name
|
|
@@ -175,7 +215,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
175
215
|
|
|
176
216
|
return await client.mutate({
|
|
177
217
|
mutation: gql`
|
|
178
|
-
mutation($name: String!) {
|
|
218
|
+
mutation ($name: String!) {
|
|
179
219
|
deleteLiteMenu(name: $name)
|
|
180
220
|
}
|
|
181
221
|
`,
|
|
@@ -191,6 +231,11 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
191
231
|
|
|
192
232
|
async pageInitialized() {
|
|
193
233
|
this.config = {
|
|
234
|
+
list: {
|
|
235
|
+
thumbnail: 'value',
|
|
236
|
+
fields: ['name', 'description'],
|
|
237
|
+
details: ['type', 'parent', 'rank', 'updatedAt']
|
|
238
|
+
},
|
|
194
239
|
columns: [
|
|
195
240
|
{
|
|
196
241
|
type: 'gutter',
|
|
@@ -217,6 +262,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
217
262
|
record: {
|
|
218
263
|
editable: true
|
|
219
264
|
},
|
|
265
|
+
filter: 'search',
|
|
220
266
|
sortable: true,
|
|
221
267
|
width: 120
|
|
222
268
|
},
|
|
@@ -228,11 +274,13 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
228
274
|
align: 'left',
|
|
229
275
|
editable: true
|
|
230
276
|
},
|
|
277
|
+
filter: 'search',
|
|
231
278
|
width: 200
|
|
232
279
|
},
|
|
233
280
|
{
|
|
234
281
|
type: 'select',
|
|
235
282
|
name: 'parent',
|
|
283
|
+
label: true,
|
|
236
284
|
header: i18next.t('field.parent-menu'),
|
|
237
285
|
record: {
|
|
238
286
|
editable: true,
|
|
@@ -247,6 +295,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
247
295
|
{
|
|
248
296
|
type: 'number',
|
|
249
297
|
name: 'rank',
|
|
298
|
+
label: true,
|
|
250
299
|
header: i18next.t('field.rank'),
|
|
251
300
|
record: {
|
|
252
301
|
align: 'right',
|
|
@@ -258,11 +307,17 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
258
307
|
{
|
|
259
308
|
type: 'select',
|
|
260
309
|
name: 'type',
|
|
310
|
+
label: true,
|
|
261
311
|
header: i18next.t('field.type'),
|
|
262
312
|
record: {
|
|
263
313
|
editable: true,
|
|
264
314
|
options: ['', 'group', 'page', 'board']
|
|
265
315
|
},
|
|
316
|
+
filter: {
|
|
317
|
+
options: ['', 'group', 'page', 'board'],
|
|
318
|
+
multiple: false,
|
|
319
|
+
operator: 'eq'
|
|
320
|
+
},
|
|
266
321
|
width: 80
|
|
267
322
|
},
|
|
268
323
|
{
|
|
@@ -295,10 +350,12 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
295
350
|
{
|
|
296
351
|
type: 'boolean',
|
|
297
352
|
name: 'active',
|
|
353
|
+
label: true,
|
|
298
354
|
header: i18next.t('field.active'),
|
|
299
355
|
record: {
|
|
300
356
|
editable: true
|
|
301
357
|
},
|
|
358
|
+
filter: true,
|
|
302
359
|
sortable: true,
|
|
303
360
|
width: 60
|
|
304
361
|
},
|
|
@@ -354,52 +411,50 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
354
411
|
}
|
|
355
412
|
}
|
|
356
413
|
|
|
357
|
-
async fetchHandler({ page, limit,
|
|
414
|
+
async fetchHandler({ filters = [], page, limit, sortings = [] }) {
|
|
358
415
|
const response = (
|
|
359
416
|
await client.query({
|
|
360
417
|
query: gql`
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
pagination: {
|
|
365
|
-
page,
|
|
366
|
-
limit
|
|
367
|
-
},
|
|
368
|
-
sortings: sorters
|
|
369
|
-
})}) {
|
|
370
|
-
items {
|
|
371
|
-
id
|
|
372
|
-
name
|
|
373
|
-
description
|
|
374
|
-
parent
|
|
375
|
-
rank
|
|
376
|
-
type
|
|
377
|
-
value
|
|
378
|
-
board {
|
|
418
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
419
|
+
responses: liteMenus(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
420
|
+
items {
|
|
379
421
|
id
|
|
380
422
|
name
|
|
381
423
|
description
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
424
|
+
parent
|
|
425
|
+
rank
|
|
426
|
+
type
|
|
427
|
+
value
|
|
428
|
+
board {
|
|
429
|
+
id
|
|
430
|
+
name
|
|
431
|
+
description
|
|
432
|
+
thumbnail
|
|
433
|
+
}
|
|
434
|
+
icon
|
|
435
|
+
active
|
|
436
|
+
createdAt
|
|
437
|
+
updatedAt
|
|
438
|
+
creator {
|
|
439
|
+
id
|
|
440
|
+
name
|
|
441
|
+
}
|
|
442
|
+
updater {
|
|
443
|
+
id
|
|
444
|
+
name
|
|
445
|
+
}
|
|
395
446
|
}
|
|
447
|
+
total
|
|
396
448
|
}
|
|
397
|
-
total
|
|
398
449
|
}
|
|
450
|
+
`,
|
|
451
|
+
variables: {
|
|
452
|
+
filters,
|
|
453
|
+
pagination: { page, limit },
|
|
454
|
+
sortings
|
|
399
455
|
}
|
|
400
|
-
`
|
|
401
456
|
})
|
|
402
|
-
).data.
|
|
457
|
+
).data.responses
|
|
403
458
|
|
|
404
459
|
store.dispatch({
|
|
405
460
|
type: 'UPDATE_ADDON_MENUS',
|
|
@@ -411,6 +466,10 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
|
|
|
411
466
|
total: response.total
|
|
412
467
|
}
|
|
413
468
|
}
|
|
469
|
+
|
|
470
|
+
liteMenuCreationCallback(liteMenu) {
|
|
471
|
+
console.warn('not implemented yet.')
|
|
472
|
+
}
|
|
414
473
|
}
|
|
415
474
|
|
|
416
475
|
window.customElements.define('addon-menu-setting', AddonMenuSetting)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
|
|
3
|
-
import { html, LitElement } from 'lit
|
|
3
|
+
import { html, LitElement } from 'lit'
|
|
4
4
|
import { connect } from 'pwa-helpers'
|
|
5
5
|
|
|
6
|
-
import { navigate, store } from '@
|
|
7
|
-
import { ScrollbarStyles } from '@
|
|
6
|
+
import { navigate, store } from '@operato/shell'
|
|
7
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
8
8
|
|
|
9
9
|
import { LiteMenuLandscapeStyles } from './lite-menu-landscape-styles'
|
|
10
10
|
|
|
@@ -2,11 +2,11 @@ import '@material/mwc-icon'
|
|
|
2
2
|
import './lite-menu-portrait'
|
|
3
3
|
import './lite-menu-landscape'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { ScrollbarStyles } from '@things-factory/styles'
|
|
5
|
+
import { css, html, LitElement } from 'lit'
|
|
8
6
|
import { connect } from 'pwa-helpers'
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
import { store } from '@operato/shell'
|
|
9
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
10
10
|
|
|
11
11
|
export class LiteMenuPart extends connect(store)(LitElement) {
|
|
12
12
|
static get properties() {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
import { html, LitElement } from 'lit'
|
|
4
|
+
|
|
5
|
+
import { navigate } from '@operato/shell'
|
|
6
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
7
|
+
|
|
5
8
|
import { LiteMenuPortraitStyles } from './lite-menu-portrait-styles'
|
|
6
9
|
|
|
7
10
|
export class LiteMenuPortrait extends LitElement {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
|
|
3
|
-
import { css, html, LitElement } from 'lit
|
|
3
|
+
import { css, html, LitElement } from 'lit'
|
|
4
4
|
import { connect } from 'pwa-helpers'
|
|
5
5
|
|
|
6
|
-
import { toggleOverlay } from '@
|
|
7
|
-
import { store } from '@
|
|
6
|
+
import { toggleOverlay } from '@operato/layout'
|
|
7
|
+
import { store } from '@operato/shell'
|
|
8
8
|
|
|
9
9
|
export class TopMenuBar extends connect(store)(LitElement) {
|
|
10
10
|
static get styles() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/lite-menu",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.45",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,16 +24,23 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@things-factory/
|
|
27
|
+
"@operato/data-grist": "^0.3.28",
|
|
28
|
+
"@operato/graphql": "^0.3.28",
|
|
29
|
+
"@operato/i18n": "^0.3.28",
|
|
30
|
+
"@operato/input": "^0.3.28",
|
|
31
|
+
"@operato/layout": "^0.3.28",
|
|
32
|
+
"@operato/popup": "^0.3.28",
|
|
33
|
+
"@operato/shell": "^0.3.28",
|
|
34
|
+
"@operato/styles": "^0.3.28",
|
|
35
|
+
"@operato/utils": "^0.3.28",
|
|
36
|
+
"@things-factory/apptool-base": "^4.0.45",
|
|
37
|
+
"@things-factory/auth-base": "^4.0.45",
|
|
38
|
+
"@things-factory/board-service": "^4.0.45",
|
|
39
|
+
"@things-factory/board-ui": "^4.0.45",
|
|
40
|
+
"@things-factory/grist-ui": "^4.0.45",
|
|
41
|
+
"@things-factory/more-base": "^4.0.45",
|
|
42
|
+
"@things-factory/setting-base": "^4.0.45",
|
|
43
|
+
"@things-factory/utils": "^4.0.45"
|
|
37
44
|
},
|
|
38
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "6c37578551d77fed098e5eed4cd2cc9eb9c0dd4b"
|
|
39
46
|
}
|