@things-factory/context-ui 6.1.66 → 6.1.70
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/bootstrap.js +0 -53
- package/client/index.js +83 -0
- package/package.json +3 -3
package/client/bootstrap.js
CHANGED
|
@@ -1,62 +1,9 @@
|
|
|
1
|
-
import '@operato/context/ox-title-bar.js'
|
|
2
|
-
import '@operato/context/ox-page-action-context-bar.js'
|
|
3
|
-
import '@operato/context/ox-context-toolbar.js'
|
|
4
|
-
|
|
5
|
-
import { html } from 'lit-html'
|
|
6
|
-
|
|
7
|
-
import { appendViewpart, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
|
|
8
|
-
import { APPEND_APP_TOOL } from '@things-factory/apptool-base'
|
|
9
1
|
import { store } from '@operato/shell'
|
|
10
2
|
|
|
11
|
-
import { APPEND_CONTEXT_TOOL } from './actions/context.js'
|
|
12
3
|
import context from './reducers/context'
|
|
13
4
|
|
|
14
5
|
export default function bootstrap() {
|
|
15
6
|
store.addReducers({
|
|
16
7
|
context
|
|
17
8
|
})
|
|
18
|
-
|
|
19
|
-
/* add title app-tool */
|
|
20
|
-
store.dispatch({
|
|
21
|
-
type: APPEND_APP_TOOL,
|
|
22
|
-
tool: {
|
|
23
|
-
name: 'title-bar',
|
|
24
|
-
template: html` <ox-title-bar></ox-title-bar> `,
|
|
25
|
-
position: TOOL_POSITION.CENTER
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
/*
|
|
30
|
-
* footerbar 에 append 하는 순서가 중요하다.
|
|
31
|
-
* footerbar는 아래에서 위로 올라가는 stack 형태의 순서이므로,
|
|
32
|
-
* context-toolbar가 먼저, 그리고 context-toolbar-overlay 가 나중에 올라간다.
|
|
33
|
-
*/
|
|
34
|
-
appendViewpart({
|
|
35
|
-
name: 'context-toolbar',
|
|
36
|
-
viewpart: {
|
|
37
|
-
show: true,
|
|
38
|
-
template: html` <ox-context-toolbar></ox-context-toolbar> `
|
|
39
|
-
},
|
|
40
|
-
position: VIEWPART_POSITION.FOOTERBAR
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
appendViewpart({
|
|
44
|
-
name: 'context-toolbar-overlay',
|
|
45
|
-
viewpart: {
|
|
46
|
-
show: false,
|
|
47
|
-
hovering: 'next',
|
|
48
|
-
backdrop: true,
|
|
49
|
-
template: html``
|
|
50
|
-
},
|
|
51
|
-
position: VIEWPART_POSITION.FOOTERBAR
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
store.dispatch({
|
|
55
|
-
type: APPEND_CONTEXT_TOOL,
|
|
56
|
-
tool: {
|
|
57
|
-
template: html` <ox-page-action-context-bar></ox-page-action-context-bar> `,
|
|
58
|
-
position: TOOL_POSITION.CENTER,
|
|
59
|
-
context: 'actions'
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
9
|
}
|
package/client/index.js
CHANGED
|
@@ -1 +1,84 @@
|
|
|
1
1
|
export * from './actions/context'
|
|
2
|
+
|
|
3
|
+
import '@operato/context/ox-title-bar.js'
|
|
4
|
+
import '@operato/context/ox-page-action-context-bar.js'
|
|
5
|
+
import '@operato/context/ox-context-toolbar.js'
|
|
6
|
+
|
|
7
|
+
import { html } from 'lit-html'
|
|
8
|
+
|
|
9
|
+
import { store, clientSettingStore } from '@operato/shell'
|
|
10
|
+
import { appendViewpart, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
|
|
11
|
+
import { isMobileDevice } from '@operato/utils'
|
|
12
|
+
import { APPEND_APP_TOOL, APPEND_PAGE_TOOL } from '@things-factory/apptool-base'
|
|
13
|
+
import { ADD_SETTING } from '@things-factory/setting-base'
|
|
14
|
+
import { APPEND_CONTEXT_TOOL } from './actions/context.js'
|
|
15
|
+
|
|
16
|
+
export async function setupContextUIPart({
|
|
17
|
+
titlebar = 'header',
|
|
18
|
+
contextToolbar = 'page-footer'
|
|
19
|
+
}: {
|
|
20
|
+
titlebar?: 'header' | 'page-header'
|
|
21
|
+
contextToolbar?: 'footer' | 'page-header' | 'page-footer'
|
|
22
|
+
}) {
|
|
23
|
+
|
|
24
|
+
if (titlebar == 'header') {
|
|
25
|
+
/* add title app-tool */
|
|
26
|
+
store.dispatch({
|
|
27
|
+
type: APPEND_APP_TOOL,
|
|
28
|
+
tool: {
|
|
29
|
+
name: 'title-bar',
|
|
30
|
+
template: html` <ox-title-bar></ox-title-bar> `,
|
|
31
|
+
position: TOOL_POSITION.CENTER
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
} else if (titlebar == 'page-header') {
|
|
35
|
+
store.dispatch({
|
|
36
|
+
type: APPEND_PAGE_TOOL,
|
|
37
|
+
tool: {
|
|
38
|
+
name: 'title-bar',
|
|
39
|
+
template: html` <ox-title-bar></ox-title-bar> `,
|
|
40
|
+
position: TOOL_POSITION.FRONT
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* footerbar 에 append 하는 순서가 중요하다.
|
|
47
|
+
* footerbar는 아래에서 위로 올라가는 stack 형태의 순서이므로,
|
|
48
|
+
* context-toolbar가 먼저, 그리고 context-toolbar-overlay 가 나중에 올라간다.
|
|
49
|
+
*/
|
|
50
|
+
if(contextToolbar) {
|
|
51
|
+
const position = contextToolbar == 'footer' ? VIEWPART_POSITION.FOOTERBAR
|
|
52
|
+
: contextToolbar == 'page-header' ? VIEWPART_POSITION.PAGE_HEADERBAR
|
|
53
|
+
: VIEWPART_POSITION.PAGE_FOOTERBAR
|
|
54
|
+
|
|
55
|
+
appendViewpart({
|
|
56
|
+
name: 'context-toolbar',
|
|
57
|
+
viewpart: {
|
|
58
|
+
show: true,
|
|
59
|
+
template: html` <ox-context-toolbar></ox-context-toolbar> `
|
|
60
|
+
},
|
|
61
|
+
position
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
appendViewpart({
|
|
65
|
+
name: 'context-toolbar-overlay',
|
|
66
|
+
viewpart: {
|
|
67
|
+
show: false,
|
|
68
|
+
hovering: 'next',
|
|
69
|
+
backdrop: true,
|
|
70
|
+
template: html``
|
|
71
|
+
},
|
|
72
|
+
position
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
store.dispatch({
|
|
76
|
+
type: APPEND_CONTEXT_TOOL,
|
|
77
|
+
tool: {
|
|
78
|
+
template: html` <ox-page-action-context-bar></ox-page-action-context-bar> `,
|
|
79
|
+
position: TOOL_POSITION.CENTER,
|
|
80
|
+
context: 'actions'
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/context-ui",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.70",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@material/mwc-icon": "^0.27.0",
|
|
28
28
|
"@operato/context": "^1.1.19",
|
|
29
29
|
"@operato/layout": "^1.1.15",
|
|
30
|
-
"@things-factory/apptool-base": "^6.1.
|
|
30
|
+
"@things-factory/apptool-base": "^6.1.68"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "c597a3f5a31397aa9132c5ad96dc64a2b13bbf23"
|
|
33
33
|
}
|