@things-factory/meta-ui 7.0.1-alpha.4 → 7.0.1-alpha.41
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/main.js +15 -20
- package/client/bootstrap.ts +23 -25
- package/client/component/filter/filter-form-meta-code-select.ts +99 -0
- package/client/component/filter/filter-form-meta-object-select.ts +104 -0
- package/client/component/filter/filter-grist-meta-code-select.ts +97 -0
- package/client/component/filter/filter-grist-meta-object-select.ts +102 -0
- package/client/component/grist/renderer/grist-renderer-meta-object-selector.js +18 -13
- package/client/component/popup/code-input-editor-popup.js +37 -47
- package/client/component/popup/file-upload-popup.js +8 -26
- package/client/component/popup/meta-object-selector-popup.ts +328 -0
- package/client/component/popup/{record-based-code-editor-popup.js → record-based-code-editor-popup.ts} +48 -57
- package/client/index.ts +1 -0
- package/client/mixin/meta-grist-tab-mixin.js +282 -283
- package/client/mixin/meta-main-tab-mixin.js +220 -223
- package/client/mixin/meta-master-detail-mixin.js +347 -348
- package/client/mixin/meta-tab-detail-mixin.js +240 -243
- package/client/mixin/meta-tab-mixin.js +154 -155
- package/client/pages/activity/meta-activity-define-page.js +30 -28
- package/client/pages/activity/meta-activity-list-page.js +71 -78
- package/client/pages/entity/config-entity.js +18 -16
- package/client/pages/entity/main-menu-selector.js +16 -23
- package/client/pages/history/history-copy-list-popup.js +5 -2
- package/client/pages/history/history-json-list-popup.js +4 -0
- package/client/pages/menu/dynamic-menu-template.js +1 -4
- package/client/pages/menu/dynamic-menu.js +12 -10
- package/client/pages/menu/export-menu-popup.js +10 -11
- package/client/pages/meta-grist-page.js +1 -2
- package/client/pages/personalize/personal-column-selector.js +18 -17
- package/client/pages/terms/config-terminology.js +29 -27
- package/client/utils/meta-api.js +13 -1
- package/client/utils/meta-ui-util.js +179 -183
- package/client/utils/rest-service-util.js +328 -0
- package/client/utils/service-util.js +42 -6
- package/client/utils/{terms-util.js → terms-util.ts} +30 -104
- package/client/viewparts/dynamic-menu-part.js +7 -29
- package/dist-client/actions/main.js +6 -5
- package/dist-client/actions/main.js.map +1 -1
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +17 -20
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/component/filter/filter-form-meta-code-select.d.ts +4 -1
- package/dist-client/component/filter/filter-form-meta-code-select.js +21 -18
- package/dist-client/component/filter/filter-form-meta-code-select.js.map +1 -1
- package/dist-client/component/filter/filter-form-meta-object-select.d.ts +4 -1
- package/dist-client/component/filter/filter-form-meta-object-select.js +27 -19
- package/dist-client/component/filter/filter-form-meta-object-select.js.map +1 -1
- package/dist-client/component/filter/filter-grist-meta-code-select.d.ts +3 -1
- package/dist-client/component/filter/filter-grist-meta-code-select.js +19 -18
- package/dist-client/component/filter/filter-grist-meta-code-select.js.map +1 -1
- package/dist-client/component/filter/filter-grist-meta-object-select.d.ts +3 -1
- package/dist-client/component/filter/filter-grist-meta-object-select.js +25 -19
- package/dist-client/component/filter/filter-grist-meta-object-select.js.map +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js +9 -3
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js.map +1 -1
- package/dist-client/component/popup/code-input-editor-popup.js +10 -19
- package/dist-client/component/popup/code-input-editor-popup.js.map +1 -1
- package/dist-client/component/popup/file-upload-popup.js +6 -25
- package/dist-client/component/popup/file-upload-popup.js.map +1 -1
- package/dist-client/component/popup/meta-object-selector-popup.d.ts +27 -22
- package/dist-client/component/popup/meta-object-selector-popup.js +101 -75
- package/dist-client/component/popup/meta-object-selector-popup.js.map +1 -1
- package/dist-client/component/popup/record-based-code-editor-popup.d.ts +10 -11
- package/dist-client/component/popup/record-based-code-editor-popup.js +75 -43
- package/dist-client/component/popup/record-based-code-editor-popup.js.map +1 -1
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +1 -0
- package/dist-client/index.js.map +1 -1
- package/dist-client/mixin/meta-grist-tab-mixin.d.ts +1 -5
- package/dist-client/mixin/meta-grist-tab-mixin.js +5 -5
- package/dist-client/mixin/meta-grist-tab-mixin.js.map +1 -1
- package/dist-client/mixin/meta-main-tab-mixin.d.ts +10 -7
- package/dist-client/mixin/meta-main-tab-mixin.js +4 -6
- package/dist-client/mixin/meta-main-tab-mixin.js.map +1 -1
- package/dist-client/mixin/meta-master-detail-mixin.js +8 -8
- package/dist-client/mixin/meta-master-detail-mixin.js.map +1 -1
- package/dist-client/mixin/meta-tab-detail-mixin.d.ts +1 -5
- package/dist-client/mixin/meta-tab-detail-mixin.js +5 -7
- package/dist-client/mixin/meta-tab-detail-mixin.js.map +1 -1
- package/dist-client/mixin/meta-tab-mixin.d.ts +1 -5
- package/dist-client/mixin/meta-tab-mixin.js +1 -2
- package/dist-client/mixin/meta-tab-mixin.js.map +1 -1
- package/dist-client/pages/activity/meta-activity-define-page.js +15 -11
- package/dist-client/pages/activity/meta-activity-define-page.js.map +1 -1
- package/dist-client/pages/activity/meta-activity-list-page.js +17 -23
- package/dist-client/pages/activity/meta-activity-list-page.js.map +1 -1
- package/dist-client/pages/entity/config-entity.js +17 -16
- package/dist-client/pages/entity/config-entity.js.map +1 -1
- package/dist-client/pages/entity/main-menu-selector.js +15 -23
- package/dist-client/pages/entity/main-menu-selector.js.map +1 -1
- package/dist-client/pages/history/history-copy-list-popup.d.ts +1 -1
- package/dist-client/pages/history/history-copy-list-popup.js +5 -2
- package/dist-client/pages/history/history-copy-list-popup.js.map +1 -1
- package/dist-client/pages/history/history-json-list-popup.d.ts +1 -1
- package/dist-client/pages/history/history-json-list-popup.js +4 -0
- package/dist-client/pages/history/history-json-list-popup.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js +1 -4
- package/dist-client/pages/menu/dynamic-menu-template.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu.js +11 -10
- package/dist-client/pages/menu/dynamic-menu.js.map +1 -1
- package/dist-client/pages/menu/export-menu-popup.js +9 -11
- package/dist-client/pages/menu/export-menu-popup.js.map +1 -1
- package/dist-client/pages/meta-grist-page.js.map +1 -1
- package/dist-client/pages/personalize/personal-column-selector.js +17 -17
- package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
- package/dist-client/pages/terms/config-terminology.js +15 -13
- package/dist-client/pages/terms/config-terminology.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/meta-api.d.ts +11 -2
- package/dist-client/utils/meta-api.js +12 -1
- package/dist-client/utils/meta-api.js.map +1 -1
- package/dist-client/utils/meta-ui-util.js +161 -167
- package/dist-client/utils/meta-ui-util.js.map +1 -1
- package/dist-client/utils/rest-service-util.d.ts +120 -0
- package/dist-client/utils/rest-service-util.js +291 -0
- package/dist-client/utils/rest-service-util.js.map +1 -0
- package/dist-client/utils/service-util.d.ts +11 -1
- package/dist-client/utils/service-util.js +40 -6
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-client/utils/terms-util.d.ts +10 -27
- package/dist-client/utils/terms-util.js +6 -80
- package/dist-client/utils/terms-util.js.map +1 -1
- package/dist-client/viewparts/dynamic-menu-part.js +7 -27
- package/dist-client/viewparts/dynamic-menu-part.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -9
- package/translations/en.json +2 -12
- package/translations/ko.json +2 -12
- package/translations/ms.json +2 -12
- package/translations/zh.json +2 -12
- package/client/component/filter/filter-form-meta-code-select.js +0 -94
- package/client/component/filter/filter-form-meta-object-select.js +0 -94
- package/client/component/filter/filter-grist-meta-code-select.js +0 -95
- package/client/component/filter/filter-grist-meta-object-select.js +0 -95
- package/client/component/popup/meta-object-selector-popup.js +0 -314
- package/client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/client/viewparts/dynamic-menu-landscape.js +0 -106
- package/client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/client/viewparts/dynamic-menu-portrait.js +0 -90
- package/client/viewparts/dynamic-top-menu-bar.js +0 -148
- package/dist-client/viewparts/dynamic-menu-landscape-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape.d.ts +0 -21
- package/dist-client/viewparts/dynamic-menu-landscape.js +0 -87
- package/dist-client/viewparts/dynamic-menu-landscape.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait.d.ts +0 -13
- package/dist-client/viewparts/dynamic-menu-portrait.js +0 -74
- package/dist-client/viewparts/dynamic-menu-portrait.js.map +0 -1
- package/dist-client/viewparts/dynamic-top-menu-bar.d.ts +0 -27
- package/dist-client/viewparts/dynamic-top-menu-bar.js +0 -133
- package/dist-client/viewparts/dynamic-top-menu-bar.js.map +0 -1
- package/dist-server/constants/error-code.js +0 -6
- package/dist-server/constants/error-code.js.map +0 -1
- package/server/constants/error-code.ts +0 -2
package/client/actions/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import '../viewparts/dynamic-menu-part'
|
|
2
|
-
import '@material/mwc-icon'
|
|
3
4
|
|
|
4
5
|
import gql from 'graphql-tag'
|
|
5
6
|
import { html } from 'lit'
|
|
@@ -17,13 +18,7 @@ export const UPDATE_META_MENU_TEMPLATE = 'UPDATE_META_MENU_TEMPLATE'
|
|
|
17
18
|
var HAMBURGER
|
|
18
19
|
|
|
19
20
|
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 || {}
|
|
21
|
+
var { hovering = isMobileDevice() ? true : false, slotTemplate, portraitSlotTemplate, landscapeSlotTemplate, position = VIEWPART_POSITION.NAVBAR } = options || {}
|
|
27
22
|
|
|
28
23
|
const { hovering: hoveringSetting } = (await clientSettingStore.get('dynamic-menu'))?.value || {}
|
|
29
24
|
if (hoveringSetting !== undefined) {
|
|
@@ -31,8 +26,7 @@ export async function setupMenuPart(options) {
|
|
|
31
26
|
}
|
|
32
27
|
|
|
33
28
|
const orientation = position == VIEWPART_POSITION.HEADERBAR ? 'landscape' : 'portrait'
|
|
34
|
-
const orientatedSlotTemplate =
|
|
35
|
-
(orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``
|
|
29
|
+
const orientatedSlotTemplate = (orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``
|
|
36
30
|
|
|
37
31
|
appendViewpart({
|
|
38
32
|
name: 'dynamic-menu-part',
|
|
@@ -50,11 +44,13 @@ export async function setupMenuPart(options) {
|
|
|
50
44
|
HAMBURGER = {
|
|
51
45
|
name: 'hamburger',
|
|
52
46
|
template: html`
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
<md-icon
|
|
48
|
+
@click=${e =>
|
|
49
|
+
toggleOverlay('dynamic-menu-part', {
|
|
50
|
+
backdrop: true
|
|
51
|
+
})}
|
|
52
|
+
>view_headline</md-icon
|
|
53
|
+
>
|
|
58
54
|
`,
|
|
59
55
|
position: TOOL_POSITION.FRONT_END
|
|
60
56
|
}
|
|
@@ -84,8 +80,7 @@ export async function updateMenuTemplate(template) {
|
|
|
84
80
|
await client.query({
|
|
85
81
|
query: gql`
|
|
86
82
|
query ($filters: [Filter!], $sortings: [Sorting!]) {
|
|
87
|
-
liteMenus:
|
|
88
|
-
sortings: $sortings) {
|
|
83
|
+
liteMenus: myLiteMenus(filters: $filters, sortings: $sortings) {
|
|
89
84
|
items {
|
|
90
85
|
id
|
|
91
86
|
name
|
|
@@ -115,10 +110,10 @@ export async function updateMenuTemplate(template) {
|
|
|
115
110
|
value: ['', applicationName]
|
|
116
111
|
}
|
|
117
112
|
],
|
|
118
|
-
sortings:[
|
|
113
|
+
sortings: [
|
|
119
114
|
{
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
name: 'rank',
|
|
116
|
+
desc: false
|
|
122
117
|
}
|
|
123
118
|
]
|
|
124
119
|
}
|
package/client/bootstrap.ts
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import { html } from 'lit-html'
|
|
2
4
|
|
|
3
|
-
import { auth } from '@things-factory/auth-base/dist-client/auth.js'
|
|
4
|
-
import { ADD_MORENDA } from '@things-factory/more-base'
|
|
5
5
|
import { navigate, store } from '@operato/shell'
|
|
6
|
-
|
|
7
|
-
import { updateMenuTemplate } from './actions/main'
|
|
8
|
-
import metaUI from './reducers/main'
|
|
9
|
-
import { TermsUtil } from './utils/terms-util'
|
|
10
|
-
import { GristDefaultValue } from './utils/grist-default-value'
|
|
11
|
-
import { MENUS } from './dynamic-menus'
|
|
12
|
-
|
|
6
|
+
import { i18next } from '@operato/i18n'
|
|
13
7
|
import {
|
|
14
8
|
registerEditor as gristColumnRegisterEditor,
|
|
15
9
|
registerRenderer as gristColumnRegisterRenderer,
|
|
@@ -17,6 +11,14 @@ import {
|
|
|
17
11
|
} from '@operato/data-grist'
|
|
18
12
|
import { registerFilterRenderer as formRegisterFilterRenderer } from '@operato/form'
|
|
19
13
|
|
|
14
|
+
import { auth } from '@things-factory/auth-base/dist-client'
|
|
15
|
+
import { ADD_MORENDA } from '@things-factory/more-base/client'
|
|
16
|
+
|
|
17
|
+
import { updateMenuTemplate } from './actions/main'
|
|
18
|
+
import metaUI from './reducers/main'
|
|
19
|
+
import { GristDefaultValue } from './utils/grist-default-value'
|
|
20
|
+
import { MENUS } from './dynamic-menus'
|
|
21
|
+
|
|
20
22
|
/** GRIST Renderer Compoment */
|
|
21
23
|
import { GristRendererMetaCodeSelector } from './component/grist/renderer/grist-renderer-meta-code-selector'
|
|
22
24
|
import { GristRendererMetaObjectSelector } from './component/grist/renderer/grist-renderer-meta-object-selector'
|
|
@@ -41,7 +43,6 @@ import './pages/history/history-json-list-popup'
|
|
|
41
43
|
|
|
42
44
|
import './pages/activity/meta-activity-writer-element'
|
|
43
45
|
import './pages/activity/meta-activity-viewer-element'
|
|
44
|
-
import { i18next } from '@operato/i18n'
|
|
45
46
|
|
|
46
47
|
export default async function bootstrap(module) {
|
|
47
48
|
// GRIST Renderer
|
|
@@ -69,23 +70,20 @@ export default async function bootstrap(module) {
|
|
|
69
70
|
metaUI
|
|
70
71
|
})
|
|
71
72
|
|
|
72
|
-
// 1. 용어 다운로드
|
|
73
|
-
var locale = i18next.language
|
|
74
|
-
if (locale == 'ko') {
|
|
75
|
-
locale = 'ko-KR'
|
|
76
|
-
}
|
|
77
|
-
await TermsUtil.downloadTerminologies(locale)
|
|
78
|
-
|
|
79
73
|
auth.on('profile', async ({ credential, domains, domain }) => {
|
|
80
74
|
// 2. 메뉴 정보를 서버로 부터 받아서 적용
|
|
81
75
|
const menuRoutes = await MENUS
|
|
82
76
|
updateMenuTemplate(menuRoutes.menus)
|
|
83
77
|
|
|
78
|
+
i18next.on('languageChanged', async () => {
|
|
79
|
+
updateMenuTemplate(menuRoutes.menus)
|
|
80
|
+
})
|
|
81
|
+
|
|
84
82
|
// 3. 동적 메뉴 관리 화면 추가
|
|
85
83
|
store.dispatch({
|
|
86
84
|
type: ADD_MORENDA,
|
|
87
85
|
morenda: {
|
|
88
|
-
icon: html`<
|
|
86
|
+
icon: html`<md-icon>auto_fix_high</md-icon>`,
|
|
89
87
|
name: html`<ox-i18n msgid="title.dynamic_menu"></ox-i18n>`,
|
|
90
88
|
action: () => {
|
|
91
89
|
navigate('dynamic-menu')
|
|
@@ -97,7 +95,7 @@ export default async function bootstrap(module) {
|
|
|
97
95
|
store.dispatch({
|
|
98
96
|
type: ADD_MORENDA,
|
|
99
97
|
morenda: {
|
|
100
|
-
icon: html`<
|
|
98
|
+
icon: html`<md-icon>filter_tilt_shift</md-icon>`,
|
|
101
99
|
name: html`<ox-i18n msgid="title.entity"></ox-i18n>`,
|
|
102
100
|
action: () => {
|
|
103
101
|
navigate('config-entity')
|
|
@@ -109,7 +107,7 @@ export default async function bootstrap(module) {
|
|
|
109
107
|
store.dispatch({
|
|
110
108
|
type: ADD_MORENDA,
|
|
111
109
|
morenda: {
|
|
112
|
-
icon: html`<
|
|
110
|
+
icon: html`<md-icon>speaker_notes</md-icon>`,
|
|
113
111
|
name: html`<ox-i18n msgid="title.terminology"></ox-i18n>`,
|
|
114
112
|
action: () => {
|
|
115
113
|
navigate('config-terminology')
|
|
@@ -121,7 +119,7 @@ export default async function bootstrap(module) {
|
|
|
121
119
|
store.dispatch({
|
|
122
120
|
type: ADD_MORENDA,
|
|
123
121
|
morenda: {
|
|
124
|
-
icon: html`<
|
|
122
|
+
icon: html`<md-icon>code</md-icon>`,
|
|
125
123
|
name: html`<ox-i18n msgid="title.code_management"></ox-i18n>`,
|
|
126
124
|
action: () => {
|
|
127
125
|
navigate('codes')
|
|
@@ -133,7 +131,7 @@ export default async function bootstrap(module) {
|
|
|
133
131
|
store.dispatch({
|
|
134
132
|
type: ADD_MORENDA,
|
|
135
133
|
morenda: {
|
|
136
|
-
icon: html`<
|
|
134
|
+
icon: html`<md-icon>business_center</md-icon>`,
|
|
137
135
|
name: html`<ox-i18n msgid="title.meta_activity_list"></ox-i18n>`,
|
|
138
136
|
action: () => {
|
|
139
137
|
navigate('meta-activity-list')
|
|
@@ -144,7 +142,7 @@ export default async function bootstrap(module) {
|
|
|
144
142
|
store.dispatch({
|
|
145
143
|
type: ADD_MORENDA,
|
|
146
144
|
morenda: {
|
|
147
|
-
icon: html`<
|
|
145
|
+
icon: html`<md-icon>margin</md-icon>`,
|
|
148
146
|
name: html`<ox-i18n msgid="title.meta_activity_define"></ox-i18n>`,
|
|
149
147
|
action: () => {
|
|
150
148
|
navigate('meta-activity-define')
|
|
@@ -155,7 +153,7 @@ export default async function bootstrap(module) {
|
|
|
155
153
|
store.dispatch({
|
|
156
154
|
type: ADD_MORENDA,
|
|
157
155
|
morenda: {
|
|
158
|
-
icon: html`<
|
|
156
|
+
icon: html`<md-icon>work</md-icon>`,
|
|
159
157
|
name: html`<ox-i18n msgid="title.activity_list"></ox-i18n>`,
|
|
160
158
|
action: () => {
|
|
161
159
|
navigate('activity-list')
|
|
@@ -166,7 +164,7 @@ export default async function bootstrap(module) {
|
|
|
166
164
|
store.dispatch({
|
|
167
165
|
type: ADD_MORENDA,
|
|
168
166
|
morenda: {
|
|
169
|
-
icon: html` <
|
|
167
|
+
icon: html` <md-icon>dataset</md-icon> `,
|
|
170
168
|
name: html` <ox-i18n msgid="text.attribute management"></ox-i18n> `,
|
|
171
169
|
action: () => {
|
|
172
170
|
navigate('attributes')
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../popup/meta-object-selector-popup'
|
|
3
|
+
|
|
4
|
+
import { html } from 'lit-html'
|
|
5
|
+
|
|
6
|
+
import { openPopup } from '@operato/layout'
|
|
7
|
+
import { FilterSelectRenderer } from '@operato/form'
|
|
8
|
+
import { TermsUtil } from './../../utils/terms-util'
|
|
9
|
+
|
|
10
|
+
function openMetaCodeSelector(filter, value, confirmCallback) {
|
|
11
|
+
var template = html` <meta-object-selector-popup .value=${value} .options=${filter.options} .confirmCallback=${confirmCallback}> </meta-object-selector-popup> `
|
|
12
|
+
|
|
13
|
+
openPopup(template, {
|
|
14
|
+
backdrop: true,
|
|
15
|
+
size: 'large',
|
|
16
|
+
title: filter.options.selectorName ? TermsUtil.tMenu(filter.options.selectorName) : TermsUtil.tTitle('select_item')
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const FilterFormMetaCodeSelect: FilterSelectRenderer = (filter, value, owner) => {
|
|
21
|
+
const options = filter.options || {}
|
|
22
|
+
const codes = options.codes && options.codes.length > 0 ? options.codes : undefined
|
|
23
|
+
const { operator = 'eq' } = filter
|
|
24
|
+
const hiddenText = value ? value : ''
|
|
25
|
+
|
|
26
|
+
var text = value ? value : ''
|
|
27
|
+
|
|
28
|
+
if (options.dispField && value && codes) {
|
|
29
|
+
let dispCode = codes.filter(x => x.value == value)
|
|
30
|
+
|
|
31
|
+
if (dispCode && dispCode.length > 0) {
|
|
32
|
+
text = dispCode[0].display
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return operator === 'eq'
|
|
37
|
+
? html`
|
|
38
|
+
<input name='${filter.name}' .value=${hiddenText} type="text" hidden></input>
|
|
39
|
+
<input
|
|
40
|
+
type="text"
|
|
41
|
+
readonly
|
|
42
|
+
name='${filter.name}_disp'
|
|
43
|
+
.value=${text}
|
|
44
|
+
@click=${e => {
|
|
45
|
+
e.stopPropagation()
|
|
46
|
+
|
|
47
|
+
const input = e.target
|
|
48
|
+
|
|
49
|
+
const confirmCallback = selected => {
|
|
50
|
+
let code = selected ? selected[options.codeField] : ''
|
|
51
|
+
let disp = code
|
|
52
|
+
|
|
53
|
+
if (selected && options.dispField) {
|
|
54
|
+
let fields = options.dispField.split(',')
|
|
55
|
+
disp = selected[fields[0]]
|
|
56
|
+
|
|
57
|
+
if (fields.length > 1) {
|
|
58
|
+
disp += `(${fields
|
|
59
|
+
.splice(1)
|
|
60
|
+
.map(field => {
|
|
61
|
+
return selected[field]
|
|
62
|
+
})
|
|
63
|
+
.join(',')})`
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
input.value = disp
|
|
68
|
+
|
|
69
|
+
let codeInput =
|
|
70
|
+
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
71
|
+
? //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
72
|
+
owner.renderRoot.querySelector(`[name="${filter.name}"]`)
|
|
73
|
+
: //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
74
|
+
owner.renderRoot.querySelector(`form [name="${filter.name}"]`)
|
|
75
|
+
|
|
76
|
+
codeInput.value = code
|
|
77
|
+
|
|
78
|
+
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
79
|
+
|
|
80
|
+
input.dispatchEvent(
|
|
81
|
+
new CustomEvent('filter-change', {
|
|
82
|
+
bubbles: true,
|
|
83
|
+
composed: true,
|
|
84
|
+
detail: {
|
|
85
|
+
name: filter.name,
|
|
86
|
+
operator,
|
|
87
|
+
value: code
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
openMetaCodeSelector(filter, value, confirmCallback)
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
<md-icon style="--md-icon-size: 18px;margin-left: -24px;">manage_search</md-icon>
|
|
97
|
+
`
|
|
98
|
+
: html``
|
|
99
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../popup/meta-object-selector-popup'
|
|
3
|
+
|
|
4
|
+
import { html } from 'lit-html'
|
|
5
|
+
|
|
6
|
+
import { openPopup } from '@operato/layout'
|
|
7
|
+
import { FilterSelectRenderer } from '@operato/form'
|
|
8
|
+
import { TermsUtil } from '../../utils/terms-util'
|
|
9
|
+
|
|
10
|
+
function openMetaObjectSelector(filter, value, confirmCallback) {
|
|
11
|
+
var template = html` <meta-object-selector-popup .value=${value} .options=${filter.options} .confirmCallback=${confirmCallback}></meta-object-selector-popup> `
|
|
12
|
+
|
|
13
|
+
openPopup(template, {
|
|
14
|
+
backdrop: true,
|
|
15
|
+
size: 'large',
|
|
16
|
+
title: filter.options.selectorName ? TermsUtil.tMenu(filter.options.selectorName) : TermsUtil.tTitle('select_item')
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const FilterFormMetaObjectSelect: FilterSelectRenderer = (filter, value, owner) => {
|
|
21
|
+
const options = filter.options
|
|
22
|
+
const { operator = 'eq' } = filter
|
|
23
|
+
const hiddenText = value ? value.id : ''
|
|
24
|
+
|
|
25
|
+
var text = ''
|
|
26
|
+
|
|
27
|
+
if (value) {
|
|
28
|
+
let fields = options!.nameField.split(',')
|
|
29
|
+
text = value[fields[0]]
|
|
30
|
+
|
|
31
|
+
if (fields.length > 1) {
|
|
32
|
+
text += `(${fields
|
|
33
|
+
.splice(1)
|
|
34
|
+
.map(field => {
|
|
35
|
+
return value[field]
|
|
36
|
+
})
|
|
37
|
+
.join(',')})`
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return operator === 'eq'
|
|
42
|
+
? html`
|
|
43
|
+
<input name='${filter.name}' .value=${hiddenText} type="text" hidden></input>
|
|
44
|
+
<input
|
|
45
|
+
type="text"
|
|
46
|
+
readonly
|
|
47
|
+
name='${filter.name}_disp'
|
|
48
|
+
.value=${text}
|
|
49
|
+
@click=${e => {
|
|
50
|
+
e.stopPropagation()
|
|
51
|
+
|
|
52
|
+
const input = e.target
|
|
53
|
+
|
|
54
|
+
const confirmCallback = selected => {
|
|
55
|
+
let code = selected ? selected.id : ''
|
|
56
|
+
let disp = ''
|
|
57
|
+
|
|
58
|
+
if (selected) {
|
|
59
|
+
let fields = options!.nameField.split(',')
|
|
60
|
+
disp = selected[fields[0]]
|
|
61
|
+
|
|
62
|
+
if (fields.length > 1) {
|
|
63
|
+
disp += `(${fields
|
|
64
|
+
.splice(1)
|
|
65
|
+
.map(field => {
|
|
66
|
+
return selected[field]
|
|
67
|
+
})
|
|
68
|
+
.join(',')})`
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
input.value = disp
|
|
73
|
+
|
|
74
|
+
let codeInput =
|
|
75
|
+
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
76
|
+
? //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
77
|
+
owner.renderRoot.querySelector(`[name="${filter.name}"]`)
|
|
78
|
+
: //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
79
|
+
owner.renderRoot.querySelector(`form [name="${filter.name}"]`)
|
|
80
|
+
|
|
81
|
+
codeInput.value = code
|
|
82
|
+
|
|
83
|
+
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
84
|
+
|
|
85
|
+
input.dispatchEvent(
|
|
86
|
+
new CustomEvent('filter-change', {
|
|
87
|
+
bubbles: true,
|
|
88
|
+
composed: true,
|
|
89
|
+
detail: {
|
|
90
|
+
name: filter.name,
|
|
91
|
+
operator,
|
|
92
|
+
value: code
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
openMetaObjectSelector(filter, value, confirmCallback)
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
<md-icon style="--md-icon-size: 18px;margin-left: -24px;">manage_search</md-icon>
|
|
102
|
+
`
|
|
103
|
+
: html``
|
|
104
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import '../popup/meta-object-selector-popup'
|
|
2
|
+
|
|
3
|
+
import { html } from 'lit-html'
|
|
4
|
+
|
|
5
|
+
import { openPopup } from '@operato/layout'
|
|
6
|
+
import { FilterConfigObject, FilterSelectRenderer } from '@operato/data-grist'
|
|
7
|
+
import { TermsUtil } from '../../utils/terms-util'
|
|
8
|
+
|
|
9
|
+
function openMetaCodeSelector(column, value, confirmCallback) {
|
|
10
|
+
var template = html` <meta-object-selector-popup .value=${value} .options=${column.record.options} .confirmCallback=${confirmCallback}></meta-object-selector-popup> `
|
|
11
|
+
|
|
12
|
+
openPopup(template, {
|
|
13
|
+
backdrop: true,
|
|
14
|
+
size: 'large',
|
|
15
|
+
title: column.record.options.selectorName ? TermsUtil.tMenu(column.record.options.selectorName) : TermsUtil.tTitle('select_item')
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const FilterGristMetaCodeSelect: FilterSelectRenderer = (column, value, owner) => {
|
|
20
|
+
const filter = column.filter
|
|
21
|
+
const options = column.record.options
|
|
22
|
+
const codes = options.codes && options.codes.length > 0 ? options.codes : undefined
|
|
23
|
+
const { operator = 'eq' } = filter as FilterConfigObject
|
|
24
|
+
const hiddenText = value ? value : ''
|
|
25
|
+
|
|
26
|
+
var text = value ? value : ''
|
|
27
|
+
|
|
28
|
+
if (options.dispField && value && codes) {
|
|
29
|
+
let dispCode = codes.filter(x => x.value == value)
|
|
30
|
+
|
|
31
|
+
if (dispCode && dispCode.length > 0) {
|
|
32
|
+
text = dispCode[0].display
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return operator === 'eq'
|
|
37
|
+
? html`
|
|
38
|
+
<input name='${column.name}' .value=${hiddenText} type="text" hidden></input>
|
|
39
|
+
<input
|
|
40
|
+
type="text"
|
|
41
|
+
readonly
|
|
42
|
+
name='${column.name}_disp'
|
|
43
|
+
.value=${text}
|
|
44
|
+
@click=${e => {
|
|
45
|
+
e.stopPropagation()
|
|
46
|
+
|
|
47
|
+
const input = e.target
|
|
48
|
+
|
|
49
|
+
const confirmCallback = selected => {
|
|
50
|
+
let code = selected ? selected[options.codeField] : ''
|
|
51
|
+
let disp = code
|
|
52
|
+
|
|
53
|
+
if (selected && options.dispField) {
|
|
54
|
+
let fields = options.dispField.split(',')
|
|
55
|
+
disp = selected[fields[0]]
|
|
56
|
+
|
|
57
|
+
if (fields.length > 1) {
|
|
58
|
+
disp += `(${fields
|
|
59
|
+
.splice(1)
|
|
60
|
+
.map(field => {
|
|
61
|
+
return selected[field]
|
|
62
|
+
})
|
|
63
|
+
.join(',')})`
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
input.value = disp
|
|
68
|
+
|
|
69
|
+
let codeInput =
|
|
70
|
+
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
71
|
+
? //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
72
|
+
owner.renderRoot.querySelector(`[name="${filter.name}"]`)
|
|
73
|
+
: //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
74
|
+
owner.renderRoot.querySelector(`form [name="${filter.name}"]`)
|
|
75
|
+
codeInput.value = code
|
|
76
|
+
|
|
77
|
+
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
78
|
+
|
|
79
|
+
input.dispatchEvent(
|
|
80
|
+
new CustomEvent('filter-change', {
|
|
81
|
+
bubbles: true,
|
|
82
|
+
composed: true,
|
|
83
|
+
detail: {
|
|
84
|
+
name: column.name,
|
|
85
|
+
operator,
|
|
86
|
+
value: code
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
openMetaCodeSelector(column, value, confirmCallback)
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
`
|
|
96
|
+
: html``
|
|
97
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import '../popup/meta-object-selector-popup'
|
|
2
|
+
|
|
3
|
+
import { html } from 'lit-html'
|
|
4
|
+
|
|
5
|
+
import { openPopup } from '@operato/layout'
|
|
6
|
+
import { FilterConfigObject, FilterSelectRenderer } from '@operato/data-grist'
|
|
7
|
+
import { TermsUtil } from '../../utils/terms-util'
|
|
8
|
+
|
|
9
|
+
function openMetaObjectSelector(column, value, confirmCallback) {
|
|
10
|
+
var template = html` <meta-object-selector-popup .value=${value} .options=${column.record.options} .confirmCallback=${confirmCallback}></meta-object-selector-popup> `
|
|
11
|
+
|
|
12
|
+
openPopup(template, {
|
|
13
|
+
backdrop: true,
|
|
14
|
+
size: 'large',
|
|
15
|
+
title: column.record.options.selectorName ? TermsUtil.tMenu(column.record.options.selectorName) : TermsUtil.tTitle('select_item')
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const FilterGristMetaObjectSelect: FilterSelectRenderer = (column, value, owner) => {
|
|
20
|
+
const filter = column.filter
|
|
21
|
+
const { operator = 'eq' } = filter as FilterConfigObject
|
|
22
|
+
const options = column.record.options
|
|
23
|
+
const hiddenText = value ? value.id : ''
|
|
24
|
+
|
|
25
|
+
var text = ''
|
|
26
|
+
|
|
27
|
+
if (value) {
|
|
28
|
+
let fields = options.nameField.split(',')
|
|
29
|
+
text = value[fields[0]]
|
|
30
|
+
|
|
31
|
+
if (fields.length > 1) {
|
|
32
|
+
text += `(${fields
|
|
33
|
+
.splice(1)
|
|
34
|
+
.map(field => {
|
|
35
|
+
return value[field]
|
|
36
|
+
})
|
|
37
|
+
.join(',')})`
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return operator === 'eq'
|
|
42
|
+
? html`
|
|
43
|
+
<input name='${column.name}' .value=${hiddenText} type="text" hidden></input>
|
|
44
|
+
<input
|
|
45
|
+
type="text"
|
|
46
|
+
readonly
|
|
47
|
+
name='${column.name}_disp'
|
|
48
|
+
.value=${text}
|
|
49
|
+
@click=${e => {
|
|
50
|
+
e.stopPropagation()
|
|
51
|
+
|
|
52
|
+
const input = e.target
|
|
53
|
+
|
|
54
|
+
const confirmCallback = selected => {
|
|
55
|
+
let code = selected ? selected.id : ''
|
|
56
|
+
let disp = ''
|
|
57
|
+
|
|
58
|
+
if (selected) {
|
|
59
|
+
let fields = options.nameField.split(',')
|
|
60
|
+
disp = selected[fields[0]]
|
|
61
|
+
|
|
62
|
+
if (fields.length > 1) {
|
|
63
|
+
disp += `(${fields
|
|
64
|
+
.splice(1)
|
|
65
|
+
.map(field => {
|
|
66
|
+
return selected[field]
|
|
67
|
+
})
|
|
68
|
+
.join(',')})`
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
input.value = disp
|
|
73
|
+
|
|
74
|
+
let codeInput =
|
|
75
|
+
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
76
|
+
? //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
77
|
+
owner.renderRoot.querySelector(`[name="${filter.name}"]`)
|
|
78
|
+
: //@ts-ignore owner element를 전제하지 않는 방법이 필요할 것이다.
|
|
79
|
+
owner.renderRoot.querySelector(`form [name="${filter.name}"]`)
|
|
80
|
+
codeInput.value = code
|
|
81
|
+
|
|
82
|
+
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
83
|
+
|
|
84
|
+
input.dispatchEvent(
|
|
85
|
+
new CustomEvent('filter-change', {
|
|
86
|
+
bubbles: true,
|
|
87
|
+
composed: true,
|
|
88
|
+
detail: {
|
|
89
|
+
name: column.name,
|
|
90
|
+
operator,
|
|
91
|
+
value: code
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
openMetaObjectSelector(column, value, confirmCallback)
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
`
|
|
101
|
+
: html``
|
|
102
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 그리드 Resource-column 타입 셀렉터
|
|
2
|
+
* 그리드 Resource-column 타입 셀렉터
|
|
3
3
|
* @auth yang
|
|
4
4
|
*/
|
|
5
5
|
import { html } from 'lit'
|
|
@@ -7,28 +7,33 @@ import { html } from 'lit'
|
|
|
7
7
|
import { detectOverflow } from '@operato/utils'
|
|
8
8
|
|
|
9
9
|
function onmouseover(e) {
|
|
10
|
-
const element = e.target
|
|
10
|
+
const element = e.target
|
|
11
11
|
if (detectOverflow(element)) {
|
|
12
12
|
element.setAttribute('data-tooltip', element.textContent)
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function onmouseout(e) {
|
|
17
|
-
const element = e.target
|
|
18
|
-
element.removeAttribute('data-tooltip')
|
|
17
|
+
const element = e.target
|
|
18
|
+
element.removeAttribute('data-tooltip')
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const GristRendererMetaObjectSelector = (value, column, record, rowIndex, field) => {
|
|
22
|
+
let text = ''
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
text = value[fields[0]];
|
|
24
|
+
if (value && column.record.options?.nameField) {
|
|
25
|
+
let fields = column.record.options.nameField.split(',')
|
|
26
|
+
text = value[fields[0]]
|
|
27
27
|
|
|
28
|
-
if(fields.length > 1){
|
|
29
|
-
text+= `(${fields
|
|
28
|
+
if (fields.length > 1) {
|
|
29
|
+
text += `(${fields
|
|
30
|
+
.splice(1)
|
|
31
|
+
.map(field => {
|
|
32
|
+
return value[field]
|
|
33
|
+
})
|
|
34
|
+
.join(',')})`
|
|
30
35
|
}
|
|
31
|
-
}
|
|
36
|
+
}
|
|
32
37
|
|
|
33
|
-
return html`<span @mouseover=${onmouseover} @mouseout=${onmouseout}>${text}</span
|
|
34
|
-
}
|
|
38
|
+
return html`<span @mouseover=${onmouseover} @mouseout=${onmouseout}>${text}</span>`
|
|
39
|
+
}
|