@things-factory/lite-menu 8.0.5 → 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/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/lite-menu/lite-menu.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -22
- package/client/actions/lite-menu.ts +0 -146
- package/client/bootstrap.ts +0 -16
- package/client/index.ts +0 -2
- package/client/lite-menu-setting-let.ts +0 -86
- package/client/pages/addon-menu-setting.ts +0 -558
- package/client/reducers/lite-menu.ts +0 -83
- package/client/route.ts +0 -7
- package/client/tsconfig.json +0 -13
- package/server/index.ts +0 -1
- package/server/service/index.ts +0 -18
- package/server/service/lite-menu/index.ts +0 -6
- package/server/service/lite-menu/lite-menu-mutation.ts +0 -54
- package/server/service/lite-menu/lite-menu-query.ts +0 -114
- package/server/service/lite-menu/lite-menu-type.ts +0 -92
- package/server/service/lite-menu/lite-menu.ts +0 -149
- package/server/tsconfig.json +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/lite-menu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.10",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -28,26 +28,26 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@material/web": "^2.0.0",
|
|
31
|
-
"@operato/data-grist": "^
|
|
32
|
-
"@operato/graphql": "^
|
|
33
|
-
"@operato/grist-editor": "^
|
|
34
|
-
"@operato/i18n": "^
|
|
35
|
-
"@operato/input": "^
|
|
36
|
-
"@operato/layout": "^
|
|
37
|
-
"@operato/menu": "^
|
|
38
|
-
"@operato/p13n": "^
|
|
39
|
-
"@operato/popup": "^
|
|
40
|
-
"@operato/shell": "^
|
|
41
|
-
"@operato/styles": "^
|
|
42
|
-
"@operato/utils": "^
|
|
43
|
-
"@things-factory/apptool-base": "^
|
|
44
|
-
"@things-factory/auth-base": "^
|
|
45
|
-
"@things-factory/board-service": "^
|
|
46
|
-
"@things-factory/board-ui": "^
|
|
47
|
-
"@things-factory/more-base": "^
|
|
48
|
-
"@things-factory/personalization": "^
|
|
49
|
-
"@things-factory/setting-base": "^
|
|
50
|
-
"@things-factory/utils": "^
|
|
31
|
+
"@operato/data-grist": "^9.0.0-beta",
|
|
32
|
+
"@operato/graphql": "^9.0.0-beta",
|
|
33
|
+
"@operato/grist-editor": "^9.0.0-beta",
|
|
34
|
+
"@operato/i18n": "^9.0.0-beta",
|
|
35
|
+
"@operato/input": "^9.0.0-beta",
|
|
36
|
+
"@operato/layout": "^9.0.0-beta",
|
|
37
|
+
"@operato/menu": "^9.0.0-beta",
|
|
38
|
+
"@operato/p13n": "^9.0.0-beta",
|
|
39
|
+
"@operato/popup": "^9.0.0-beta",
|
|
40
|
+
"@operato/shell": "^9.0.0-beta",
|
|
41
|
+
"@operato/styles": "^9.0.0-beta",
|
|
42
|
+
"@operato/utils": "^9.0.0-beta",
|
|
43
|
+
"@things-factory/apptool-base": "^9.0.0-beta.8",
|
|
44
|
+
"@things-factory/auth-base": "^9.0.0-beta.8",
|
|
45
|
+
"@things-factory/board-service": "^9.0.0-beta.8",
|
|
46
|
+
"@things-factory/board-ui": "^9.0.0-beta.10",
|
|
47
|
+
"@things-factory/more-base": "^9.0.0-beta.8",
|
|
48
|
+
"@things-factory/personalization": "^9.0.0-beta.8",
|
|
49
|
+
"@things-factory/setting-base": "^9.0.0-beta.8",
|
|
50
|
+
"@things-factory/utils": "^9.0.0-beta.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "e2fa10e8d0be8d21c14abb7bada66d1fbb7af051"
|
|
53
53
|
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/menu/ox-menu-part.js'
|
|
3
|
-
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
|
-
import { html } from 'lit'
|
|
6
|
-
|
|
7
|
-
import { store, InheritedValueType, clientSettingStore } from '@operato/shell'
|
|
8
|
-
import { client } from '@operato/graphql'
|
|
9
|
-
import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
|
|
10
|
-
import { isMobileDevice } from '@operato/utils'
|
|
11
|
-
|
|
12
|
-
import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base/client'
|
|
13
|
-
|
|
14
|
-
export const UPDATE_ADDON_MENUS = 'UPDATE_ADDON_MENUS'
|
|
15
|
-
export const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE'
|
|
16
|
-
|
|
17
|
-
var HAMBURGER
|
|
18
|
-
|
|
19
|
-
export async function setupMenuPart(options) {
|
|
20
|
-
var {
|
|
21
|
-
hovering = isMobileDevice() ? true : false,
|
|
22
|
-
slotTemplate,
|
|
23
|
-
portraitSlotTemplate,
|
|
24
|
-
landscapeSlotTemplate,
|
|
25
|
-
position = VIEWPART_POSITION.NAVBAR
|
|
26
|
-
} = options || {}
|
|
27
|
-
|
|
28
|
-
const { hovering: hoveringSetting } = (await clientSettingStore.get('lite-menu'))?.value || {}
|
|
29
|
-
if (hoveringSetting !== undefined) {
|
|
30
|
-
hovering = hoveringSetting
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const orientation = position == VIEWPART_POSITION.HEADERBAR ? 'landscape' : 'portrait'
|
|
34
|
-
const orientatedSlotTemplate =
|
|
35
|
-
(orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``
|
|
36
|
-
|
|
37
|
-
appendViewpart({
|
|
38
|
-
name: 'ox-menu-part',
|
|
39
|
-
viewpart: {
|
|
40
|
-
show: !hovering,
|
|
41
|
-
resizable: true,
|
|
42
|
-
hovering: isMobileDevice() ? true : hovering,
|
|
43
|
-
template: html` <ox-menu-part .orientation=${orientation}>${orientatedSlotTemplate}</ox-menu-part> `
|
|
44
|
-
},
|
|
45
|
-
position
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
// hovering이 true거나 모바일 일때는 계속 햄버거 버튼 표시
|
|
49
|
-
if ((hovering || isMobileDevice()) && orientation == 'portrait') {
|
|
50
|
-
if (!HAMBURGER) {
|
|
51
|
-
HAMBURGER = {
|
|
52
|
-
name: 'hamburger',
|
|
53
|
-
template: html`
|
|
54
|
-
<md-icon
|
|
55
|
-
@click=${e =>
|
|
56
|
-
toggleOverlay('ox-menu-part', {
|
|
57
|
-
backdrop: true
|
|
58
|
-
})}
|
|
59
|
-
>view_headline</md-icon
|
|
60
|
-
>
|
|
61
|
-
`,
|
|
62
|
-
position: TOOL_POSITION.FRONT_END
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
store.dispatch({
|
|
66
|
-
/* incase of mobile : add hamburger tool */
|
|
67
|
-
type: APPEND_APP_TOOL,
|
|
68
|
-
tool: HAMBURGER
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
if (HAMBURGER) {
|
|
73
|
-
store.dispatch({
|
|
74
|
-
type: REMOVE_APP_TOOL,
|
|
75
|
-
name: 'hamburger'
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
HAMBURGER = null
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export async function updateMenuTemplate(template) {
|
|
84
|
-
await fetchAddonMenus()
|
|
85
|
-
|
|
86
|
-
store.dispatch({
|
|
87
|
-
type: UPDATE_MENU_TEMPLATE,
|
|
88
|
-
template
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export async function fetchAddonMenus() {
|
|
93
|
-
var applicationName = (document.querySelector('meta[name="application-name"]') as HTMLMetaElement)?.content
|
|
94
|
-
|
|
95
|
-
var liteMenus = (
|
|
96
|
-
await client.query({
|
|
97
|
-
query: gql`
|
|
98
|
-
query ($filters: [Filter!], $inherited: InheritedValueType) {
|
|
99
|
-
liteMenus: myLiteMenus(filters: $filters, inherited: $inherited) {
|
|
100
|
-
items {
|
|
101
|
-
id
|
|
102
|
-
name
|
|
103
|
-
label
|
|
104
|
-
description
|
|
105
|
-
appName
|
|
106
|
-
parent
|
|
107
|
-
rank
|
|
108
|
-
active
|
|
109
|
-
type
|
|
110
|
-
value
|
|
111
|
-
icon
|
|
112
|
-
help
|
|
113
|
-
}
|
|
114
|
-
total
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
`,
|
|
118
|
-
variables: {
|
|
119
|
-
filters: [
|
|
120
|
-
{
|
|
121
|
-
name: 'active',
|
|
122
|
-
operator: 'eq',
|
|
123
|
-
value: true
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: 'appName',
|
|
127
|
-
operator: 'in',
|
|
128
|
-
value: ['', applicationName]
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
sortings: [
|
|
132
|
-
{
|
|
133
|
-
name: 'rank',
|
|
134
|
-
desc: false
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
inherited: InheritedValueType.Include
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
).data.liteMenus.items
|
|
141
|
-
|
|
142
|
-
store.dispatch({
|
|
143
|
-
type: UPDATE_ADDON_MENUS,
|
|
144
|
-
addon: liteMenus.filter(menu => !menu.appName || menu.appName === applicationName)
|
|
145
|
-
})
|
|
146
|
-
}
|
package/client/bootstrap.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/i18n/ox-i18n.js'
|
|
3
|
-
import './route'
|
|
4
|
-
|
|
5
|
-
import { store } from '@operato/shell'
|
|
6
|
-
|
|
7
|
-
import { registerEditor as registerGristEditor } from '@operato/data-grist'
|
|
8
|
-
import { OxGristEditorI18nLabel } from '@operato/grist-editor/ox-grist-editor-i18n-label.js'
|
|
9
|
-
|
|
10
|
-
import liteMenu from './reducers/lite-menu'
|
|
11
|
-
|
|
12
|
-
export default function bootstrap() {
|
|
13
|
-
registerGristEditor('i18n-label', OxGristEditorI18nLabel)
|
|
14
|
-
|
|
15
|
-
store.addReducers({ liteMenu })
|
|
16
|
-
}
|
package/client/index.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import '@operato/i18n/ox-i18n.js'
|
|
2
|
-
import '@material/web/checkbox/checkbox.js'
|
|
3
|
-
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
import { customElement, query, property, state } from 'lit/decorators.js'
|
|
6
|
-
|
|
7
|
-
import { clientSettingStore } from '@operato/shell'
|
|
8
|
-
import { i18next, localize } from '@operato/i18n'
|
|
9
|
-
|
|
10
|
-
import { setupMenuPart } from './actions/lite-menu'
|
|
11
|
-
|
|
12
|
-
@customElement('lite-menu-setting-let')
|
|
13
|
-
export class LiteMenuSettingLet extends localize(i18next)(LitElement) {
|
|
14
|
-
static styles = [
|
|
15
|
-
css`
|
|
16
|
-
label {
|
|
17
|
-
display: flex;
|
|
18
|
-
gap: 10px;
|
|
19
|
-
align-items: center;
|
|
20
|
-
|
|
21
|
-
font: var(--label-font);
|
|
22
|
-
color: var(--md-sys-color-on-primary-container);
|
|
23
|
-
text-transform: var(--label-text-transform);
|
|
24
|
-
}
|
|
25
|
-
`
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
@property({ type: Boolean }) hovering?: boolean
|
|
29
|
-
|
|
30
|
-
render() {
|
|
31
|
-
const checked = this.hovering === true
|
|
32
|
-
const indeterminate = this.hovering === undefined
|
|
33
|
-
|
|
34
|
-
return html`
|
|
35
|
-
<setting-let>
|
|
36
|
-
<ox-i18n slot="title" msgid="title.lite-menu-setting"></ox-i18n>
|
|
37
|
-
|
|
38
|
-
<div slot="content">
|
|
39
|
-
<label>
|
|
40
|
-
<md-checkbox
|
|
41
|
-
id="hovering"
|
|
42
|
-
@change=${e => this.onChange(e)}
|
|
43
|
-
?checked=${checked}
|
|
44
|
-
?indeterminate=${indeterminate}
|
|
45
|
-
></md-checkbox>
|
|
46
|
-
hovering
|
|
47
|
-
</label>
|
|
48
|
-
</div>
|
|
49
|
-
</setting-let>
|
|
50
|
-
`
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async firstUpdated() {
|
|
54
|
-
this.hovering = ((await clientSettingStore.get('lite-menu'))?.value || {}).hovering
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async onChange(e: Event) {
|
|
58
|
-
if (this.hovering === true) {
|
|
59
|
-
this.hovering = false
|
|
60
|
-
} else if (this.hovering === false) {
|
|
61
|
-
this.hovering = undefined
|
|
62
|
-
} else {
|
|
63
|
-
this.hovering = true
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const { hovering: valueFromStore } = (await clientSettingStore.get('lite-menu'))?.value || {}
|
|
67
|
-
if (this.hovering === valueFromStore) {
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
await clientSettingStore.put({
|
|
73
|
-
key: 'lite-menu',
|
|
74
|
-
value: {
|
|
75
|
-
hovering: this.hovering
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
} catch (e) {
|
|
79
|
-
console.error(e)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
setupMenuPart({
|
|
83
|
-
hovering: this.hovering
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
}
|