@things-factory/operato-tools 7.0.1-alpha.3 → 7.0.1-alpha.4

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.
@@ -1,228 +1,228 @@
1
- import { html } from 'lit-element'
1
+ import { html } from 'lit'
2
2
 
3
3
  import { MetaApi } from '@things-factory/meta-ui/client/utils/meta-api'
4
4
  import { TermsUtil } from '@things-factory/meta-ui/client/utils/terms-util'
5
5
 
6
- export const TabConfigTabMixin = (baseElement) => class extends baseElement {
7
- setTabConfigTabValues(data) {
8
- let convData = data?.map((column, index) => {
9
- let rank = index + 1;
10
- let retData = {};
6
+ export const TabConfigTabMixin = baseElement =>
7
+ class extends baseElement {
8
+ setTabConfigTabValues(data) {
9
+ let convData = data?.map((column, index) => {
10
+ let rank = index + 1
11
+ let retData = {}
11
12
 
12
- retData.rank = rank * 10;
13
- retData.id = rank;
14
- retData.name = column.name;
15
- retData.display = column.display;
16
- retData.tagname = column.tagname;
17
- retData.icon = column.icon;
18
- retData.location = column.location;
19
- retData.parent_field = column.parent_field;
20
- retData.param_field = column.param_field;
21
- retData.menu = column.menu;
13
+ retData.rank = rank * 10
14
+ retData.id = rank
15
+ retData.name = column.name
16
+ retData.display = column.display
17
+ retData.tagname = column.tagname
18
+ retData.icon = column.icon
19
+ retData.location = column.location
20
+ retData.parent_field = column.parent_field
21
+ retData.param_field = column.param_field
22
+ retData.menu = column.menu
22
23
 
23
- return retData;
24
- })
24
+ return retData
25
+ })
25
26
 
26
- this.viewTabData = convData || [];
27
- this.tabTabGrist?.fetch();
28
- }
27
+ this.viewTabData = convData || []
28
+ this.tabTabGrist?.fetch()
29
+ }
29
30
 
30
- getTabConfigTabValues() {
31
- // 기본 return object
32
- let retObject = {
33
- tab: []
34
- };
31
+ getTabConfigTabValues() {
32
+ // 기본 return object
33
+ let retObject = {
34
+ tab: []
35
+ }
35
36
 
36
- // grid 에서 데이터 가져오기
37
- let gridValue = this.getElementValueById('tab-tab-grid');
37
+ // grid 에서 데이터 가져오기
38
+ let gridValue = this.getElementValueById('tab-tab-grid')
38
39
 
39
- // rank 로 정렬
40
- this.sortRecordByRank(gridValue)?.forEach(x => {
41
- var {
42
- name = undefined,
43
- display = undefined,
44
- tagname = undefined,
45
- location = undefined,
46
- parent_field = undefined,
47
- param_field = undefined,
48
- menu = undefined,
49
- icon = undefined
50
- } = x;
40
+ // rank 로 정렬
41
+ this.sortRecordByRank(gridValue)?.forEach(x => {
42
+ var {
43
+ name = undefined,
44
+ display = undefined,
45
+ tagname = undefined,
46
+ location = undefined,
47
+ parent_field = undefined,
48
+ param_field = undefined,
49
+ menu = undefined,
50
+ icon = undefined
51
+ } = x
51
52
 
52
- if (!name) return;
53
- if (!tagname) return;
54
- if (!location) return;
55
- if (!menu) return;
56
- if (!display) display = name;
57
- if (!parent_field) parent_field = "id";
58
- if (!param_field) param_field = "param_field";
53
+ if (!name) return
54
+ if (!tagname) return
55
+ if (!location) return
56
+ if (!menu) return
57
+ if (!display) display = name
58
+ if (!parent_field) parent_field = 'id'
59
+ if (!param_field) param_field = 'param_field'
59
60
 
60
- retObject.tab.push({
61
- name: name,
62
- display: display,
63
- tagname: tagname,
64
- location: location,
65
- parent_field: parent_field,
66
- param_field: param_field,
67
- menu: menu,
68
- icon: icon
69
- });
70
- });
61
+ retObject.tab.push({
62
+ name: name,
63
+ display: display,
64
+ tagname: tagname,
65
+ location: location,
66
+ parent_field: parent_field,
67
+ param_field: param_field,
68
+ menu: menu,
69
+ icon: icon
70
+ })
71
+ })
71
72
 
72
- return retObject;
73
- }
73
+ return retObject
74
+ }
74
75
 
75
- renderTabConfigTab() {
76
- return html`
77
- <ox-grist auto-fetch id="tab-tab-grid" .config=${this.tabTabGridConfig} .mode='GRID'
78
- .fetchHandler=${this.fetchTabTabHandler.bind(this)}>
79
- </ox-grist>`
80
- }
76
+ renderTabConfigTab() {
77
+ return html` <ox-grist auto-fetch id="tab-tab-grid" .config=${this.tabTabGridConfig} .mode="GRID" .fetchHandler=${this.fetchTabTabHandler.bind(this)}> </ox-grist>`
78
+ }
81
79
 
82
- get tabTabGrist() {
83
- return this.shadowRoot.querySelector('#tab-tab-grid')
84
- }
80
+ get tabTabGrist() {
81
+ return this.shadowRoot.querySelector('#tab-tab-grid')
82
+ }
85
83
 
86
- async fetchTabTabHandler() {
87
- return {
88
- total: 0,
89
- records: this.viewTabData || []
84
+ async fetchTabTabHandler() {
85
+ return {
86
+ total: 0,
87
+ records: this.viewTabData || []
88
+ }
90
89
  }
91
- }
92
90
 
93
- async setTabConfigTabConfig() {
94
- // 그리드 설정
95
- this.tabTabGridConfig = {
96
- rows: MetaApi.getGristSelectableConfig(true),
97
- pagination: { infinite: true },
98
- sorters: [{ name: 'rank', desc: false }],
99
- appendable: true,
100
- columns: [
101
- ...MetaApi.getGristGuttersConfig(false, false),
102
- {
103
- type: 'gutter', gutterName: 'button', icon: 'delete',
104
- handlers: {
105
- click: (_columns, _data, _column, record, _rowIndex) => {
106
- if (record.id) {
107
- this.deleteRow(this.tabTabGrist, record);
91
+ async setTabConfigTabConfig() {
92
+ // 그리드 설정
93
+ this.tabTabGridConfig = {
94
+ rows: MetaApi.getGristSelectableConfig(true),
95
+ pagination: { infinite: true },
96
+ sorters: [{ name: 'rank', desc: false }],
97
+ appendable: true,
98
+ columns: [
99
+ ...MetaApi.getGristGuttersConfig(false, false),
100
+ {
101
+ type: 'gutter',
102
+ gutterName: 'button',
103
+ icon: 'delete',
104
+ handlers: {
105
+ click: (_columns, _data, _column, record, _rowIndex) => {
106
+ if (record.id) {
107
+ this.deleteRow(this.tabTabGrist, record)
108
+ }
108
109
  }
109
110
  }
110
111
  },
111
- },
112
- {
113
- type: 'string',
114
- name: 'id',
115
- hidden: true
116
- },
117
- {
118
- type: 'integer',
119
- name: 'rank',
120
- header: TermsUtil.tLabel('rank'),
121
- sortable: false,
122
- width: 50,
123
- record: {
124
- align: 'right',
125
- editable: true,
126
- mandatory: true
127
- }
128
- },
129
- {
130
- type: 'string',
131
- name: 'name',
132
- header: TermsUtil.tLabel('name'),
133
- sortable: false,
134
- width: 110,
135
- record: {
136
- align: 'left',
137
- editable: true,
138
- mandatory: true
139
- }
140
- },
141
- {
142
- type: 'string',
143
- name: 'display',
144
- header: TermsUtil.tLabel('display'),
145
- sortable: false,
146
- width: 110,
147
- record: {
148
- align: 'left',
149
- editable: true,
150
- mandatory: true
151
- }
152
- },
153
- {
154
- type: 'string',
155
- name: 'icon',
156
- header: TermsUtil.tLabel('icon'),
157
- sortable: true,
158
- width: 85,
159
- record: {
160
- align: 'left',
161
- editable: true,
162
- mandatory: true
163
- }
164
- },
165
- {
166
- type: 'string',
167
- name: 'menu',
168
- header: TermsUtil.tLabel('routing'),
169
- sortable: false,
170
- width: 150,
171
- record: {
172
- align: 'left',
173
- editable: true,
174
- mandatory: true
175
- }
176
- },
177
- {
178
- type: 'string',
179
- name: 'tagname',
180
- header: TermsUtil.tLabel('tag'),
181
- sortable: false,
182
- width: 150,
183
- record: {
184
- align: 'left',
185
- editable: true,
186
- mandatory: true
187
- }
188
- },
189
- {
190
- type: 'string',
191
- name: 'location',
192
- header: TermsUtil.tLabel('page_location'),
193
- sortable: false,
194
- width: 325,
195
- record: {
196
- align: 'left',
197
- editable: true,
198
- mandatory: true
199
- }
200
- },
201
- {
202
- type: 'string',
203
- name: 'parent_field',
204
- header: TermsUtil.tLabel('parent_id'),
205
- sortable: false,
206
- width: 100,
207
- record: {
208
- align: 'left',
209
- editable: true,
210
- mandatory: true
211
- }
212
- },
213
- {
214
- type: 'string',
215
- name: 'param_field',
216
- header: TermsUtil.tLabel('params'),
217
- sortable: false,
218
- width: 90,
219
- record: {
220
- align: 'left',
221
- editable: true,
222
- mandatory: true
112
+ {
113
+ type: 'string',
114
+ name: 'id',
115
+ hidden: true
116
+ },
117
+ {
118
+ type: 'integer',
119
+ name: 'rank',
120
+ header: TermsUtil.tLabel('rank'),
121
+ sortable: false,
122
+ width: 50,
123
+ record: {
124
+ align: 'right',
125
+ editable: true,
126
+ mandatory: true
127
+ }
128
+ },
129
+ {
130
+ type: 'string',
131
+ name: 'name',
132
+ header: TermsUtil.tLabel('name'),
133
+ sortable: false,
134
+ width: 110,
135
+ record: {
136
+ align: 'left',
137
+ editable: true,
138
+ mandatory: true
139
+ }
140
+ },
141
+ {
142
+ type: 'string',
143
+ name: 'display',
144
+ header: TermsUtil.tLabel('display'),
145
+ sortable: false,
146
+ width: 110,
147
+ record: {
148
+ align: 'left',
149
+ editable: true,
150
+ mandatory: true
151
+ }
152
+ },
153
+ {
154
+ type: 'string',
155
+ name: 'icon',
156
+ header: TermsUtil.tLabel('icon'),
157
+ sortable: true,
158
+ width: 85,
159
+ record: {
160
+ align: 'left',
161
+ editable: true,
162
+ mandatory: true
163
+ }
164
+ },
165
+ {
166
+ type: 'string',
167
+ name: 'menu',
168
+ header: TermsUtil.tLabel('routing'),
169
+ sortable: false,
170
+ width: 150,
171
+ record: {
172
+ align: 'left',
173
+ editable: true,
174
+ mandatory: true
175
+ }
176
+ },
177
+ {
178
+ type: 'string',
179
+ name: 'tagname',
180
+ header: TermsUtil.tLabel('tag'),
181
+ sortable: false,
182
+ width: 150,
183
+ record: {
184
+ align: 'left',
185
+ editable: true,
186
+ mandatory: true
187
+ }
188
+ },
189
+ {
190
+ type: 'string',
191
+ name: 'location',
192
+ header: TermsUtil.tLabel('page_location'),
193
+ sortable: false,
194
+ width: 325,
195
+ record: {
196
+ align: 'left',
197
+ editable: true,
198
+ mandatory: true
199
+ }
200
+ },
201
+ {
202
+ type: 'string',
203
+ name: 'parent_field',
204
+ header: TermsUtil.tLabel('parent_id'),
205
+ sortable: false,
206
+ width: 100,
207
+ record: {
208
+ align: 'left',
209
+ editable: true,
210
+ mandatory: true
211
+ }
212
+ },
213
+ {
214
+ type: 'string',
215
+ name: 'param_field',
216
+ header: TermsUtil.tLabel('params'),
217
+ sortable: false,
218
+ width: 90,
219
+ record: {
220
+ align: 'left',
221
+ editable: true,
222
+ mandatory: true
223
+ }
223
224
  }
224
- }
225
- ]
225
+ ]
226
+ }
226
227
  }
227
228
  }
228
- }
@@ -1,4 +1,4 @@
1
- import { html, css } from 'lit-element'
1
+ import { html, css } from 'lit'
2
2
  import { connect } from 'pwa-helpers/connect-mixin.js'
3
3
  import { store, PageView } from '@things-factory/shell'
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-tools",
3
- "version": "7.0.1-alpha.3",
3
+ "version": "7.0.1-alpha.4",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@things-factory/builder": "^7.0.1-alpha.0",
44
- "@things-factory/meta-ui": "^7.0.1-alpha.3"
44
+ "@things-factory/meta-ui": "^7.0.1-alpha.4"
45
45
  },
46
- "gitHead": "baf6ac016669c52f9d6798ea94e774785a8e5ab1"
46
+ "gitHead": "41b951d71135f4e9ae936a85a3cd7a374c5664cc"
47
47
  }