@things-factory/meta-ui 7.0.1-alpha.23 → 7.0.1-alpha.26

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.
Files changed (59) hide show
  1. package/client/actions/main.js +4 -3
  2. package/client/bootstrap.ts +10 -8
  3. package/client/component/popup/code-input-editor-popup.js +33 -39
  4. package/client/component/popup/file-upload-popup.js +6 -4
  5. package/client/component/popup/meta-object-selector-popup.js +110 -125
  6. package/client/component/popup/record-based-code-editor-popup.js +35 -40
  7. package/client/pages/activity/meta-activity-define-page.js +26 -25
  8. package/client/pages/entity/config-entity.js +15 -12
  9. package/client/pages/entity/main-menu-selector.js +7 -11
  10. package/client/pages/menu/dynamic-menu-template.js +1 -4
  11. package/client/pages/menu/dynamic-menu.js +8 -6
  12. package/client/pages/menu/export-menu-popup.js +3 -1
  13. package/client/pages/personalize/personal-column-selector.js +7 -5
  14. package/client/pages/terms/config-terminology.js +27 -25
  15. package/client/utils/meta-ui-util.js +62 -60
  16. package/client/viewparts/dynamic-menu-part.js +0 -1
  17. package/dist-client/actions/main.js +3 -3
  18. package/dist-client/actions/main.js.map +1 -1
  19. package/dist-client/bootstrap.d.ts +1 -0
  20. package/dist-client/bootstrap.js +9 -8
  21. package/dist-client/bootstrap.js.map +1 -1
  22. package/dist-client/component/popup/code-input-editor-popup.js +6 -11
  23. package/dist-client/component/popup/code-input-editor-popup.js.map +1 -1
  24. package/dist-client/component/popup/file-upload-popup.js +4 -3
  25. package/dist-client/component/popup/file-upload-popup.js.map +1 -1
  26. package/dist-client/component/popup/meta-object-selector-popup.js +24 -29
  27. package/dist-client/component/popup/meta-object-selector-popup.js.map +1 -1
  28. package/dist-client/component/popup/record-based-code-editor-popup.js +15 -20
  29. package/dist-client/component/popup/record-based-code-editor-popup.js.map +1 -1
  30. package/dist-client/pages/activity/meta-activity-define-page.js +11 -8
  31. package/dist-client/pages/activity/meta-activity-define-page.js.map +1 -1
  32. package/dist-client/pages/entity/config-entity.js +14 -12
  33. package/dist-client/pages/entity/config-entity.js.map +1 -1
  34. package/dist-client/pages/entity/main-menu-selector.js +6 -11
  35. package/dist-client/pages/entity/main-menu-selector.js.map +1 -1
  36. package/dist-client/pages/menu/dynamic-menu-template.js +1 -4
  37. package/dist-client/pages/menu/dynamic-menu-template.js.map +1 -1
  38. package/dist-client/pages/menu/dynamic-menu.js +7 -6
  39. package/dist-client/pages/menu/dynamic-menu.js.map +1 -1
  40. package/dist-client/pages/menu/export-menu-popup.js +2 -1
  41. package/dist-client/pages/menu/export-menu-popup.js.map +1 -1
  42. package/dist-client/pages/personalize/personal-column-selector.js +6 -5
  43. package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
  44. package/dist-client/pages/terms/config-terminology.js +13 -11
  45. package/dist-client/pages/terms/config-terminology.js.map +1 -1
  46. package/dist-client/tsconfig.tsbuildinfo +1 -1
  47. package/dist-client/utils/meta-ui-util.js +58 -57
  48. package/dist-client/utils/meta-ui-util.js.map +1 -1
  49. package/dist-client/viewparts/dynamic-menu-part.js +0 -1
  50. package/dist-client/viewparts/dynamic-menu-part.js.map +1 -1
  51. package/dist-server/tsconfig.tsbuildinfo +1 -1
  52. package/package.json +10 -9
  53. package/translations/en.json +2 -12
  54. package/translations/ko.json +2 -12
  55. package/translations/ms.json +2 -12
  56. package/translations/zh.json +2 -12
  57. package/dist-server/constants/error-code.js +0 -6
  58. package/dist-server/constants/error-code.js.map +0 -1
  59. package/server/constants/error-code.ts +0 -2
@@ -1,4 +1,5 @@
1
- import '@material/mwc-icon'
1
+ import '@material/web/icon/icon.js'
2
+
2
3
  import '../viewparts/dynamic-menu-part'
3
4
 
4
5
  import gql from 'graphql-tag'
@@ -43,12 +44,12 @@ export async function setupMenuPart(options) {
43
44
  HAMBURGER = {
44
45
  name: 'hamburger',
45
46
  template: html`
46
- <mwc-icon
47
+ <md-icon
47
48
  @click=${e =>
48
49
  toggleOverlay('dynamic-menu-part', {
49
50
  backdrop: true
50
51
  })}
51
- >view_headline</mwc-icon
52
+ >view_headline</md-icon
52
53
  >
53
54
  `,
54
55
  position: TOOL_POSITION.FRONT_END
@@ -1,3 +1,5 @@
1
+ import '@material/web/icon/icon.js'
2
+
1
3
  import { html } from 'lit-html'
2
4
 
3
5
  import { navigate, store } from '@operato/shell'
@@ -81,7 +83,7 @@ export default async function bootstrap(module) {
81
83
  store.dispatch({
82
84
  type: ADD_MORENDA,
83
85
  morenda: {
84
- icon: html`<mwc-icon>auto_fix_high</mwc-icon>`,
86
+ icon: html`<md-icon>auto_fix_high</md-icon>`,
85
87
  name: html`<ox-i18n msgid="title.dynamic_menu"></ox-i18n>`,
86
88
  action: () => {
87
89
  navigate('dynamic-menu')
@@ -93,7 +95,7 @@ export default async function bootstrap(module) {
93
95
  store.dispatch({
94
96
  type: ADD_MORENDA,
95
97
  morenda: {
96
- icon: html`<mwc-icon>filter_tilt_shift</mwc-icon>`,
98
+ icon: html`<md-icon>filter_tilt_shift</md-icon>`,
97
99
  name: html`<ox-i18n msgid="title.entity"></ox-i18n>`,
98
100
  action: () => {
99
101
  navigate('config-entity')
@@ -105,7 +107,7 @@ export default async function bootstrap(module) {
105
107
  store.dispatch({
106
108
  type: ADD_MORENDA,
107
109
  morenda: {
108
- icon: html`<mwc-icon>speaker_notes</mwc-icon>`,
110
+ icon: html`<md-icon>speaker_notes</md-icon>`,
109
111
  name: html`<ox-i18n msgid="title.terminology"></ox-i18n>`,
110
112
  action: () => {
111
113
  navigate('config-terminology')
@@ -117,7 +119,7 @@ export default async function bootstrap(module) {
117
119
  store.dispatch({
118
120
  type: ADD_MORENDA,
119
121
  morenda: {
120
- icon: html`<mwc-icon>code</mwc-icon>`,
122
+ icon: html`<md-icon>code</md-icon>`,
121
123
  name: html`<ox-i18n msgid="title.code_management"></ox-i18n>`,
122
124
  action: () => {
123
125
  navigate('codes')
@@ -129,7 +131,7 @@ export default async function bootstrap(module) {
129
131
  store.dispatch({
130
132
  type: ADD_MORENDA,
131
133
  morenda: {
132
- icon: html`<mwc-icon>business_center</mwc-icon>`,
134
+ icon: html`<md-icon>business_center</md-icon>`,
133
135
  name: html`<ox-i18n msgid="title.meta_activity_list"></ox-i18n>`,
134
136
  action: () => {
135
137
  navigate('meta-activity-list')
@@ -140,7 +142,7 @@ export default async function bootstrap(module) {
140
142
  store.dispatch({
141
143
  type: ADD_MORENDA,
142
144
  morenda: {
143
- icon: html`<mwc-icon>margin</mwc-icon>`,
145
+ icon: html`<md-icon>margin</md-icon>`,
144
146
  name: html`<ox-i18n msgid="title.meta_activity_define"></ox-i18n>`,
145
147
  action: () => {
146
148
  navigate('meta-activity-define')
@@ -151,7 +153,7 @@ export default async function bootstrap(module) {
151
153
  store.dispatch({
152
154
  type: ADD_MORENDA,
153
155
  morenda: {
154
- icon: html`<mwc-icon>work</mwc-icon>`,
156
+ icon: html`<md-icon>work</md-icon>`,
155
157
  name: html`<ox-i18n msgid="title.activity_list"></ox-i18n>`,
156
158
  action: () => {
157
159
  navigate('activity-list')
@@ -162,7 +164,7 @@ export default async function bootstrap(module) {
162
164
  store.dispatch({
163
165
  type: ADD_MORENDA,
164
166
  morenda: {
165
- icon: html` <mwc-icon>dataset</mwc-icon> `,
167
+ icon: html` <md-icon>dataset</md-icon> `,
166
168
  name: html` <ox-i18n msgid="text.attribute management"></ox-i18n> `,
167
169
  action: () => {
168
170
  navigate('attributes')
@@ -1,7 +1,9 @@
1
+ import '@material/web/button/elevated-button.js'
2
+
1
3
  import { css, html, LitElement } from 'lit'
2
4
  import { CommonGristStyles, ButtonContainerStyles } from '@operato/styles'
3
- import { TermsUtil } from '../../utils/terms-util';
4
- import { MetaApi } from "../../utils/meta-api"
5
+ import { TermsUtil } from '../../utils/terms-util'
6
+ import { MetaApi } from '../../utils/meta-api'
5
7
  import '@operato/input/ox-input-code.js'
6
8
  import { closePopup } from '@operato/popup'
7
9
 
@@ -24,7 +26,7 @@ export class CodeInputEditorPopup extends LitElement {
24
26
  }
25
27
 
26
28
  ox-input-code {
27
- margin:10px;
29
+ margin: 10px;
28
30
  overflow-y: auto;
29
31
  flex: 1;
30
32
  }
@@ -36,35 +38,27 @@ export class CodeInputEditorPopup extends LitElement {
36
38
  `
37
39
  ]
38
40
 
39
- async connectedCallback(){
40
-
41
- if(typeof this.value === 'object'){
42
- this.codeVlaue = JSON.stringify(this.value, 0, 2);
41
+ async connectedCallback() {
42
+ if (typeof this.value === 'object') {
43
+ this.codeVlaue = JSON.stringify(this.value, 0, 2)
43
44
  } else {
44
- this.codeVlaue = this.value;
45
-
45
+ this.codeVlaue = this.value
46
46
  }
47
47
 
48
- await super.connectedCallback();
48
+ await super.connectedCallback()
49
49
  }
50
50
 
51
- async firstUpdated(){
52
- await super.firstUpdated();
51
+ async firstUpdated() {
52
+ await super.firstUpdated()
53
53
  }
54
54
 
55
- render(){
55
+ render() {
56
56
  return html`
57
57
  <ox-input-code mode="javascript" value=${this.codeVlaue} tab-size="2" tab-as-space="true"></ox-input-code>
58
58
  <div id="button-container" class="button-container">
59
- <mwc-button raised label="${TermsUtil.tButton('empty')}" style="margin-left:7px;margin-top:7px;"
60
- @click=${this.clickEmpty.bind(this)}>
61
- </mwc-button>
62
- <mwc-button raised label="${TermsUtil.tButton('cancel')}" style="margin-left:7px;margin-top:7px;"
63
- @click=${this.clickCancel.bind(this)}>
64
- </mwc-button>
65
- <mwc-button raised label="${TermsUtil.tButton('confirm')}" style="margin-left:7px;margin-top:7px;"
66
- @click=${this.clickConfirm.bind(this)}>
67
- </mwc-button>
59
+ <md-elevated-button style="margin-left:7px;margin-top:7px;" @click=${this.clickEmpty.bind(this)}> ${TermsUtil.tButton('empty')} </md-elevated-button>
60
+ <md-elevated-button style="margin-left:7px;margin-top:7px;" @click=${this.clickCancel.bind(this)}> ${TermsUtil.tButton('cancel')} </md-elevated-button>
61
+ <md-elevated-button style="margin-left:7px;margin-top:7px;" @click=${this.clickConfirm.bind(this)}> ${TermsUtil.tButton('confirm')} </md-elevated-button>
68
62
  </div>
69
63
  `
70
64
  }
@@ -76,42 +70,42 @@ export class CodeInputEditorPopup extends LitElement {
76
70
  /**
77
71
  * @description 비우기
78
72
  ***************************
79
- * @returns
73
+ * @returns
80
74
  */
81
- async clickEmpty(e){
75
+ async clickEmpty(e) {
82
76
  this.confirmCallback && this.confirmCallback(null)
83
77
  closePopup(this)
84
78
  }
85
79
  /**
86
- * @description 취소
80
+ * @description 취소
87
81
  ***************************
88
- * @returns
82
+ * @returns
89
83
  */
90
- async clickCancel(e){
84
+ async clickCancel(e) {
91
85
  closePopup(this)
92
86
  }
93
87
  /**
94
- * @description 확인
88
+ * @description 확인
95
89
  ***************************
96
- * @returns
90
+ * @returns
97
91
  */
98
- async clickConfirm(e){
99
- if(this.codeVlaue === this.codeEditor.value){
100
- MetaApi.showToast('info', TermsUtil.tText('NOTHING_CHANGED'));
101
- return;
92
+ async clickConfirm(e) {
93
+ if (this.codeVlaue === this.codeEditor.value) {
94
+ MetaApi.showToast('info', TermsUtil.tText('NOTHING_CHANGED'))
95
+ return
102
96
  }
103
- this.changedValue(this.codeEditor.value);
97
+ this.changedValue(this.codeEditor.value)
104
98
  }
105
99
 
106
100
  /**
107
- * @description 확정
101
+ * @description 확정
108
102
  ***************************
109
- * @param {*} record
103
+ * @param {*} record
110
104
  */
111
- async changedValue(value){
105
+ async changedValue(value) {
112
106
  this.confirmCallback && this.confirmCallback(value)
113
107
  closePopup(this)
114
108
  }
115
109
  }
116
-
117
- customElements.define('code-input-editor-popup', CodeInputEditorPopup)
110
+
111
+ customElements.define('code-input-editor-popup', CodeInputEditorPopup)
@@ -1,13 +1,15 @@
1
+ import '@material/web/button/elevated-button.js'
2
+
1
3
  import { client, gqlContext } from '@things-factory/shell'
2
4
  import { css, html, LitElement } from 'lit'
3
5
  import { SingleColumnFormStyles } from '@things-factory/form-ui'
4
6
  import { CommonGristStyles, ButtonContainerStyles } from '@operato/styles'
5
7
  import gql from 'graphql-tag'
6
- import { TermsUtil } from '../../utils/terms-util';
8
+ import { TermsUtil } from '../../utils/terms-util'
7
9
  import { ValueUtil } from '../../utils/value-util'
8
10
  import { ServiceUtil } from '../../utils/service-util'
9
- import { MetaApi } from "../../utils/meta-api"
10
- import { MetaUiUtil } from "../../utils/meta-ui-util"
11
+ import { MetaApi } from '../../utils/meta-api'
12
+ import { MetaUiUtil } from '../../utils/meta-ui-util'
11
13
  import { isMobileDevice } from '@operato/utils'
12
14
  import { closePopup } from '@operato/popup'
13
15
 
@@ -84,7 +86,7 @@ class FileUploadPopup extends LitElement {
84
86
  </div>
85
87
 
86
88
  <div class="button-container">
87
- <mwc-button raised @click="${this._createAttachment}" label="${TermsUtil.tButton('create')}"></mwc-button>
89
+ <md-elevated-button @click=${this._createAttachment}>${TermsUtil.tButton('create')}</md-elevated-button>
88
90
  </div>
89
91
  `
90
92
  }
@@ -1,6 +1,8 @@
1
+ import '@material/web/button/elevated-button.js'
2
+
1
3
  import { css, html, LitElement } from 'lit'
2
4
  import { CommonGristStyles, ButtonContainerStyles } from '@operato/styles'
3
- import { TermsUtil } from '../../utils/terms-util';
5
+ import { TermsUtil } from '../../utils/terms-util'
4
6
  import { ValueUtil } from '../../utils/value-util'
5
7
  import { ServiceUtil } from '../../utils/service-util'
6
8
  import { MetaApi } from '../../utils/meta-api'
@@ -8,7 +10,6 @@ import { MetaUiUtil } from '../../utils/meta-ui-util'
8
10
  import { isMobileDevice } from '@operato/utils'
9
11
  import { closePopup } from '@operato/popup'
10
12
 
11
-
12
13
  export class MetaObjectSelectorPopup extends LitElement {
13
14
  static styles = [
14
15
  CommonGristStyles,
@@ -36,16 +37,13 @@ export class MetaObjectSelectorPopup extends LitElement {
36
37
  ]
37
38
 
38
39
  async connectedCallback() {
39
-
40
40
  // 숨김 검색 조건
41
- this.search_hidden_fields = this.options.filters
42
- ? this.options.filters
43
- : (this.basicArgs && this.basicArgs.filters ? this.basicArgs.filters : []);
41
+ this.search_hidden_fields = this.options.filters ? this.options.filters : this.basicArgs && this.basicArgs.filters ? this.basicArgs.filters : []
44
42
 
45
43
  this.search_hidden_fields = this.search_hidden_fields.map(x => {
46
- let {name, operator, value} = x;
44
+ let { name, operator, value } = x
47
45
 
48
- if(value.startsWith('::')) {
46
+ if (value.startsWith('::')) {
49
47
  value = ValueUtil.getParams(this.record, ...value.substring(2).split('.'))
50
48
  }
51
49
 
@@ -56,29 +54,27 @@ export class MetaObjectSelectorPopup extends LitElement {
56
54
  }
57
55
  })
58
56
 
57
+ // 기본 정렬
58
+ let sortFields = this.options.sorters ? this.options.sorters : this.basicArgs && this.basicArgs.sorters ? this.basicArgs.sorters : []
59
59
 
60
- // 기본 정렬
61
- let sortFields = this.options.sorters
62
- ? this.options.sorters
63
- : (this.basicArgs && this.basicArgs.sorters ? this.basicArgs.sorters : []);
64
-
65
-
66
- // 기본 검색 조건
60
+ // 기본 검색 조건
67
61
  let filterFields = this.options.filterFields
68
- ? this.options.filterFields
69
- : (this.options.menu_template?.search && this.options.menu_template?.search.length > 0 ? this.options.menu_template.search : []);
62
+ ? this.options.filterFields
63
+ : this.options.menu_template?.search && this.options.menu_template?.search.length > 0
64
+ ? this.options.menu_template.search
65
+ : []
70
66
 
71
- // 그리드 컬럼
72
- let gridColumns = this.options.select ;
67
+ // 그리드 컬럼
68
+ let gridColumns = this.options.select
73
69
 
74
70
  // 기본 검색 조건이 없으면 코드 (code-selector), 또는 이름 (object-selector)
75
- if(!filterFields || filterFields.length == 0){
76
- let defaultFilter = undefined;
77
-
78
- if(this.options.codeField) defaultFilter = this.options.codeField;
79
- if(this.options.nameField) defaultFilter = this.options.nameField;
71
+ if (!filterFields || filterFields.length == 0) {
72
+ let defaultFilter = undefined
80
73
 
81
- if(defaultFilter){
74
+ if (this.options.codeField) defaultFilter = this.options.codeField
75
+ if (this.options.nameField) defaultFilter = this.options.nameField
76
+
77
+ if (defaultFilter) {
82
78
  filterFields.push({
83
79
  name: defaultFilter,
84
80
  operator: 'eq'
@@ -86,97 +82,96 @@ export class MetaObjectSelectorPopup extends LitElement {
86
82
  }
87
83
  }
88
84
 
89
- let selectFields = [...MetaApi.getGristGuttersConfig(true, false)];
85
+ let selectFields = [...MetaApi.getGristGuttersConfig(true, false)]
90
86
 
91
- if(gridColumns && gridColumns.length > 0){
92
- for(let idx = 0 ; idx < gridColumns.length; idx++){
87
+ if (gridColumns && gridColumns.length > 0) {
88
+ for (let idx = 0; idx < gridColumns.length; idx++) {
93
89
  let {
94
90
  type = 'string',
95
91
  name,
96
92
  hidden = false,
97
- record = { align: 'left'},
93
+ record = { align: 'left' },
98
94
  header = undefined,
99
- sortable= false,
100
- width= 135,
95
+ sortable = false,
96
+ width = 135,
101
97
  options = undefined,
102
98
  select_opt = undefined,
103
99
  object_opt = undefined
104
- } = gridColumns[idx];
100
+ } = gridColumns[idx]
105
101
 
106
- if(select_opt) options = select_opt;
107
- if(object_opt) options = object_opt;
102
+ if (select_opt) options = select_opt
103
+ if (object_opt) options = object_opt
108
104
 
109
- if(['resource-object','object'].includes(type)){
110
- type = 'meta-object-selector';
111
- } else if (['resource-code-selector'].includes(type)){
112
- type = 'meta-code-selector';
105
+ if (['resource-object', 'object'].includes(type)) {
106
+ type = 'meta-object-selector'
107
+ } else if (['resource-code-selector'].includes(type)) {
108
+ type = 'meta-code-selector'
113
109
  }
114
110
 
115
- if(name == 'id'){
111
+ if (name == 'id') {
116
112
  selectFields.push({
117
113
  type: 'string',
118
114
  name: name,
119
115
  hidden: true
120
116
  })
121
117
  } else {
122
- if(type == 'boolean-all'){
123
- type = 'boolean';
118
+ if (type == 'boolean-all') {
119
+ type = 'boolean'
124
120
  }
125
121
 
126
- let columnConfig = MetaApi.getGristColumnConfig2(type, name, header?header:name, record.align ? record.align : 'left', false, sortable, width);
127
-
122
+ let columnConfig = MetaApi.getGristColumnConfig2(type, name, header ? header : name, record.align ? record.align : 'left', false, sortable, width)
128
123
 
129
- if(type.startsWith('meta-') && object_opt && object_opt.menu){
130
- options = await MetaUiUtil.getGristMetaObjectOptions(type, options);
124
+ if (type.startsWith('meta-') && object_opt && object_opt.menu) {
125
+ options = await MetaUiUtil.getGristMetaObjectOptions(type, options)
131
126
  }
132
127
 
133
- if (type === 'select'){
128
+ if (type === 'select') {
134
129
  if (Array.isArray(options)) {
135
- columnConfig.record.options = options;
130
+ columnConfig.record.options = options
136
131
  } else {
137
- if (options.type === 'code') { // 공통 코드
138
- columnConfig.record.options = await ServiceUtil.getCodeSelectorData(options.values? options.values : options.name);
139
- } else if (options.type === 'scenario') { // 시나리오
140
- columnConfig.record.options = await ServiceUtil.getCodeByScenario(options.name, options.args);
141
- } else if (options.type === 'entity'){ // 엔티티
132
+ if (options.type === 'code') {
133
+ // 공통 코드
134
+ columnConfig.record.options = await ServiceUtil.getCodeSelectorData(options.values ? options.values : options.name)
135
+ } else if (options.type === 'scenario') {
136
+ // 시나리오
137
+ columnConfig.record.options = await ServiceUtil.getCodeByScenario(options.name, options.args)
138
+ } else if (options.type === 'entity') {
139
+ // 엔티티
142
140
  columnConfig.record.options = await ServiceUtil.getCodeByEntity(options.args)
143
141
  }
144
142
  }
145
143
  } else if (type === 'meta-object-selector') {
146
144
  // object-option
147
- columnConfig.record.options = {...options};
148
-
149
- } else if( type == 'meta-code-selector'){
150
- if(options.dispField){
151
- options.codes = await ServiceUtil.getCodeByEntity(options);
145
+ columnConfig.record.options = { ...options }
146
+ } else if (type == 'meta-code-selector') {
147
+ if (options.dispField) {
148
+ options.codes = await ServiceUtil.getCodeByEntity(options)
152
149
  }
153
150
 
154
- columnConfig.record.options = {...options};
151
+ columnConfig.record.options = { ...options }
155
152
  }
156
153
 
154
+ columnConfig.hidden = hidden
157
155
 
158
- columnConfig.hidden = hidden;
159
-
160
- selectFields.push(columnConfig);
156
+ selectFields.push(columnConfig)
161
157
  }
162
158
  }
163
159
  } else {
164
- selectFields.push(MetaApi.getGristColumnConfig2('string', this.options.codeField, this.options.codeField, 'left', false, true, 180));
160
+ selectFields.push(MetaApi.getGristColumnConfig2('string', this.options.codeField, this.options.codeField, 'left', false, true, 180))
165
161
 
166
- if(this.options.dispField){
167
- selectFields.push(MetaApi.getGristColumnConfig2('string', this.options.dispField, this.options.dispField, 'left', false, true, 300));
162
+ if (this.options.dispField) {
163
+ selectFields.push(MetaApi.getGristColumnConfig2('string', this.options.dispField, this.options.dispField, 'left', false, true, 300))
168
164
  }
169
165
  }
170
166
 
171
- selectFields.forEach(x=>{
172
- let filters = filterFields.filter(y => typeof y === 'string' ? x.name == y : x.name == y.name);
167
+ selectFields.forEach(x => {
168
+ let filters = filterFields.filter(y => (typeof y === 'string' ? x.name == y : x.name == y.name))
173
169
 
174
- if(filters && filters.length > 0 ){
175
- x.filter = typeof filters[0] === 'string' ? 'search' : filters[0];
170
+ if (filters && filters.length > 0) {
171
+ x.filter = typeof filters[0] === 'string' ? 'search' : filters[0]
176
172
  }
177
173
  })
178
174
 
179
-
180
175
  let gridConfig = {
181
176
  rows: MetaApi.getGristSelectableConfig(false),
182
177
  pagination: MetaApi.getGristPagination100Config(),
@@ -184,28 +179,27 @@ export class MetaObjectSelectorPopup extends LitElement {
184
179
  sorters: [...sortFields]
185
180
  }
186
181
 
187
- gridConfig.rows.handlers = {
182
+ gridConfig.rows.handlers = {
188
183
  click: 'select-row-toggle',
189
- dblclick: ((columns, data, column, record, rowIndex, field) => {
184
+ dblclick: (columns, data, column, record, rowIndex, field) => {
190
185
  this.selectRecord(record)
191
- })
192
- }
186
+ }
187
+ }
193
188
 
194
- gridConfig.rows.appendable = false;
189
+ gridConfig.rows.appendable = false
195
190
 
196
- this.gridConfig = gridConfig;
191
+ this.gridConfig = gridConfig
197
192
 
198
- await super.connectedCallback();
193
+ await super.connectedCallback()
199
194
  }
200
195
 
201
- async firstUpdated(){
202
- await super.firstUpdated();
196
+ async firstUpdated() {
197
+ await super.firstUpdated()
203
198
  }
204
199
 
205
- render(){
200
+ render() {
206
201
  return html`
207
- <ox-grist id="ox-grist" .config=${this.gridConfig} .mode=${isMobileDevice() ? 'LIST' : 'GRID'} auto-fetch
208
- .fetchHandler=${this.fetchHandler.bind(this)}>
202
+ <ox-grist id="ox-grist" .config=${this.gridConfig} .mode=${isMobileDevice() ? 'LIST' : 'GRID'} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>
209
203
  <div slot="headroom">
210
204
  <div id="filters">
211
205
  <ox-filters-form></ox-filters-form>
@@ -213,102 +207,93 @@ export class MetaObjectSelectorPopup extends LitElement {
213
207
  </div>
214
208
  </ox-grist>
215
209
  <div id="button-container" class="button-container">
216
- <mwc-button raised label="${TermsUtil.tButton('empty')}" style="margin-left:7px;margin-top:7px;"
217
- @click=${this.clickEmpty.bind(this)}>
218
- </mwc-button>
219
- <mwc-button raised label="${TermsUtil.tButton('cancel')}" style="margin-left:7px;margin-top:7px;"
220
- @click=${this.clickCancel.bind(this)}>
221
- </mwc-button>
222
- <mwc-button raised label="${TermsUtil.tButton('select')}" style="margin-left:7px;margin-top:7px;"
223
- @click=${this.clickSelect.bind(this)}>
224
- </mwc-button>
210
+ <md-elevated-button style="margin-left:7px;margin-top:7px;" @click=${this.clickEmpty.bind(this)}> ${TermsUtil.tButton('empty')} </md-elevated-button>
211
+ <md-elevated-button style="margin-left:7px;margin-top:7px;" @click=${this.clickCancel.bind(this)}> ${TermsUtil.tButton('cancel')} </md-elevated-button>
212
+ <md-elevated-button style="margin-left:7px;margin-top:7px;" @click=${this.clickSelect.bind(this)}> ${TermsUtil.tButton('select')} </md-elevated-button>
225
213
  </div>
226
214
  `
227
215
  }
228
216
 
229
-
230
217
  /**
231
218
  * @description 그리드 리턴
232
219
  **************************
233
220
  * @returns {Object} 그리드
234
221
  */
235
- get grist() {
222
+ get grist() {
236
223
  return this.shadowRoot.querySelector('#ox-grist')
237
224
  }
238
225
 
239
226
  /**
240
- * @description 컬럼 조회
227
+ * @description 컬럼 조회
241
228
  ***************************
242
- * @returns
229
+ * @returns
243
230
  */
244
- async fetchHandler({ page= 0, limit= 0, sorters= [], filters= [] }) {
231
+ async fetchHandler({ page = 0, limit = 0, sorters = [], filters = [] }) {
232
+ let resFilter = [...this.search_hidden_fields]
245
233
 
246
- let resFilter = [...this.search_hidden_fields];
247
-
248
- filters.forEach(x=>{
249
- let dupFilter = resFilter.filter(y=> x.name == y.name)
250
- if(dupFilter && dupFilter.length > 0){
251
- delete resFilter[x.name];
234
+ filters.forEach(x => {
235
+ let dupFilter = resFilter.filter(y => x.name == y.name)
236
+ if (dupFilter && dupFilter.length > 0) {
237
+ delete resFilter[x.name]
252
238
  }
253
239
 
254
- resFilter.push(x);
240
+ resFilter.push(x)
255
241
  })
256
242
 
257
-
258
- let queryAfterSetFields = ValueUtil.getParams((this.options.menu_template ? this.options.menu_template.gql||{} : {}), 'query', 'after_set_fields');
243
+ let queryAfterSetFields = ValueUtil.getParams(this.options.menu_template ? this.options.menu_template.gql || {} : {}, 'query', 'after_set_fields')
259
244
  let selectSkipFields = Object.keys(queryAfterSetFields || {})
260
245
 
261
246
  // 조회 컬럼 추출 후 조회
262
247
  let selectFields = MetaApi.getSelectColumns(this.gridConfig.columns.filter(x => !selectSkipFields.includes(x.name)))
263
248
 
264
- // 조회 실행
249
+ // 조회 실행
265
250
  let result = await MetaApi.searchByPagination(this.options.queryName, resFilter, sorters, page, limit, selectFields)
266
251
 
267
- return result;
268
- }
252
+ return result
253
+ }
269
254
 
270
255
  /**
271
256
  * @description 비우기
272
257
  ***************************
273
- * @returns
258
+ * @returns
274
259
  */
275
- async clickEmpty(e){
260
+ async clickEmpty(e) {
276
261
  this.confirmCallback && this.confirmCallback(null)
277
262
  closePopup(this)
278
263
  }
279
264
  /**
280
- * @description 취소
265
+ * @description 취소
281
266
  ***************************
282
- * @returns
267
+ * @returns
283
268
  */
284
- async clickCancel(e){
269
+ async clickCancel(e) {
285
270
  closePopup(this)
286
271
  }
287
272
  /**
288
- * @description 선택
273
+ * @description 선택
289
274
  ***************************
290
- * @returns
275
+ * @returns
291
276
  */
292
- async clickSelect(e){
293
- let selected = this.grist.selected;
277
+ async clickSelect(e) {
278
+ let selected = this.grist.selected
294
279
 
295
- if(!selected || selected.length == 0){
296
- MetaApi.showToast('info', TermsUtil.tText('NOTHING_SELECTED'));
297
- return;
280
+ if (!selected || selected.length == 0) {
281
+ MetaApi.showToast('info', TermsUtil.tText('NOTHING_SELECTED'))
282
+ return
298
283
  }
299
284
 
300
- this.selectRecord(selected[0]);
285
+ this.selectRecord(selected[0])
301
286
  }
302
287
 
303
288
  /**
304
- * @description 확정
289
+ * @description 확정
305
290
  ***************************
306
- * @param {*} record
291
+ * @param {*} record
307
292
  */
308
- async selectRecord(record){
293
+ async selectRecord(record) {
309
294
  this.confirmCallback && this.confirmCallback(record)
310
295
  closePopup(this)
311
296
  }
312
297
  }
313
-
314
- customElements.define('meta-object-selector-popup', MetaObjectSelectorPopup)
298
+
299
+ customElements.define('meta-object-selector-popup', MetaObjectSelectorPopup)