@things-factory/operato-tools 7.0.1-alpha.3 → 7.0.1-alpha.5
Sign up to get free protection for your applications and to get access to all the features.
- package/client/pages/generator/button-config-tab-mixin.js +288 -300
- package/client/pages/generator/column-config-tab-mixin.js +502 -499
- package/client/pages/generator/etc-config-tab-mixin.js +90 -93
- package/client/pages/generator/form-config-tab-mixin.js +143 -149
- package/client/pages/generator/graphql-config-tab-mixin.js +281 -277
- package/client/pages/generator/grid-config-tab-mixin.js +135 -147
- package/client/pages/generator/grid-emphasized-config-tab-mixin.js +256 -256
- package/client/pages/generator/menu-config-tab-mixin.js +94 -100
- package/client/pages/generator/meta-generator-page.js +179 -174
- package/client/pages/generator/search-config-tab-mixin.js +153 -161
- package/client/pages/generator/tab-config-tab-mixin.js +204 -204
- package/client/pages/main.js +1 -1
- package/package.json +3 -3
@@ -1,307 +1,307 @@
|
|
1
|
-
import { html } from 'lit
|
1
|
+
import { html } from 'lit'
|
2
2
|
|
3
3
|
import { TermsUtil } from '@things-factory/meta-ui/client/utils/terms-util'
|
4
4
|
import { MetaApi } from '@things-factory/meta-ui/client/utils/meta-api'
|
5
5
|
|
6
|
+
export const GridEmphasizedConfigTabMixin = baseElement =>
|
7
|
+
class extends baseElement {
|
8
|
+
setGridEmphasizedConfigTabValues(data) {
|
9
|
+
// 1. 조회 데이터 설정
|
10
|
+
if (data) {
|
11
|
+
this.viewEmphasizedData = {
|
12
|
+
rowEmphasizedData: [],
|
13
|
+
columnEmphasizedData: []
|
14
|
+
}
|
6
15
|
|
7
|
-
|
8
|
-
|
9
|
-
setGridEmphasizedConfigTabValues(data) {
|
10
|
-
// 1. 조회 데이터 설정
|
11
|
-
if (data) {
|
12
|
-
this.viewEmphasizedData = {
|
13
|
-
rowEmphasizedData: [],
|
14
|
-
columnEmphasizedData: [],
|
15
|
-
}
|
16
|
-
|
17
|
-
let idx = 1;
|
18
|
-
this.viewEmphasizedData.rowEmphasizedData
|
19
|
-
= (data.row || []).map(x => {
|
16
|
+
let idx = 1
|
17
|
+
this.viewEmphasizedData.rowEmphasizedData = (data.row || []).map(x => {
|
20
18
|
return {
|
21
19
|
id: idx,
|
22
20
|
rank: idx++,
|
23
21
|
backgroundColor: x.backgroundColor || '',
|
24
22
|
fontColor: x.fontColor || '',
|
25
|
-
logic: x.logic || ''
|
26
|
-
}
|
23
|
+
logic: x.logic || ''
|
24
|
+
}
|
27
25
|
})
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
let columnIdx = 1;
|
27
|
+
idx = 1
|
28
|
+
let columnData = data.column || []
|
29
|
+
Object.keys(columnData).forEach(key => {
|
30
|
+
let columnList = columnData[key] || []
|
31
|
+
let columnIdx = 1
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
33
|
+
columnList.forEach(x => {
|
34
|
+
this.viewEmphasizedData.columnEmphasizedData.push({
|
35
|
+
id: idx++,
|
36
|
+
rank: columnIdx++,
|
37
|
+
column: key,
|
38
|
+
backgroundColor: x.backgroundColor || '',
|
39
|
+
fontColor: x.fontColor || '',
|
40
|
+
logic: x.logic || ''
|
41
|
+
})
|
44
42
|
})
|
45
43
|
})
|
46
|
-
})
|
47
|
-
|
48
44
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
this.emphasizedConfigTabColumnEmphasizedGrist?.fetch()
|
46
|
+
this.emphasizedConfigTabRowEmphasizedGrist?.fetch()
|
47
|
+
} else {
|
48
|
+
this.setGridEmphasizedConfigTabDefaultValues()
|
49
|
+
}
|
53
50
|
}
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
let rowGristData = this.getElementValueById('row-emphasized-grist');
|
60
|
-
let columnGristData = this.getElementValueById('column-emphasized-grist');
|
52
|
+
getGridEmphasizedConfigTabValues() {
|
53
|
+
// 설정 데이터
|
54
|
+
let rowGristData = this.getElementValueById('row-emphasized-grist')
|
55
|
+
let columnGristData = this.getElementValueById('column-emphasized-grist')
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
let rowEmphasized = []
|
58
|
+
this.sortRecordByRank(rowGristData)?.forEach(x => {
|
59
|
+
rowEmphasized.push({
|
60
|
+
backgroundColor: x.backgroundColor,
|
61
|
+
fontColor: x.fontColor,
|
62
|
+
logic: x.logic
|
63
|
+
})
|
68
64
|
})
|
69
|
-
})
|
70
65
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
66
|
+
let columnEmphasized = {}
|
67
|
+
this.sortRecordByRank(columnGristData)?.forEach(x => {
|
68
|
+
if (!columnEmphasized[x.column]) {
|
69
|
+
columnEmphasized[x.column] = []
|
70
|
+
}
|
76
71
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
72
|
+
columnEmphasized[x.column].push({
|
73
|
+
backgroundColor: x.backgroundColor,
|
74
|
+
fontColor: x.fontColor,
|
75
|
+
logic: x.logic
|
76
|
+
})
|
81
77
|
})
|
82
|
-
})
|
83
|
-
|
84
|
-
// 리턴 오브젝트로 가공
|
85
|
-
let retObject = {
|
86
|
-
gridEmphasized: {
|
87
|
-
row: rowEmphasized || [],
|
88
|
-
column: columnEmphasized || {}
|
89
|
-
}
|
90
|
-
};
|
91
|
-
|
92
|
-
return retObject;
|
93
|
-
}
|
94
78
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
79
|
+
// 리턴 오브젝트로 가공
|
80
|
+
let retObject = {
|
81
|
+
gridEmphasized: {
|
82
|
+
row: rowEmphasized || [],
|
83
|
+
column: columnEmphasized || {}
|
84
|
+
}
|
85
|
+
}
|
101
86
|
|
87
|
+
return retObject
|
88
|
+
}
|
102
89
|
|
103
|
-
|
90
|
+
get emphasizedConfigTabRowEmphasizedGrist() {
|
91
|
+
return this.shadowRoot.querySelector('#row-emphasized-grist')
|
92
|
+
}
|
93
|
+
get emphasizedConfigTabColumnEmphasizedGrist() {
|
94
|
+
return this.shadowRoot.querySelector('#column-emphasized-grist')
|
95
|
+
}
|
104
96
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
97
|
+
setGridEmphasizedConfigTabConfig() {
|
98
|
+
// 1. 행 강조 그리드 설정
|
99
|
+
this.rowEmphasizedConfig = {
|
100
|
+
rows: MetaApi.getGristSelectableConfig(false),
|
101
|
+
pagination: { infinite: true },
|
102
|
+
appendable: true,
|
103
|
+
columns: [
|
104
|
+
...MetaApi.getGristGuttersConfig(false, false),
|
105
|
+
{
|
106
|
+
type: 'gutter',
|
107
|
+
gutterName: 'button',
|
108
|
+
icon: 'delete',
|
109
|
+
handlers: {
|
110
|
+
click: (_columns, _data, _column, record, _rowIndex) => {
|
111
|
+
if (record.id) {
|
112
|
+
this.deleteRow(this.emphasizedConfigTabRowEmphasizedGrist, record)
|
113
|
+
}
|
118
114
|
}
|
119
115
|
}
|
120
116
|
},
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
hidden: true
|
126
|
-
},
|
127
|
-
{
|
128
|
-
type: 'integer',
|
129
|
-
name: 'rank',
|
130
|
-
header: TermsUtil.tLabel('rank'),
|
131
|
-
sortable: false,
|
132
|
-
width: 55,
|
133
|
-
record: {
|
134
|
-
align: 'right',
|
135
|
-
editable: true,
|
136
|
-
mandatory: true
|
137
|
-
}
|
138
|
-
},
|
139
|
-
{
|
140
|
-
type: 'string',
|
141
|
-
name: 'backgroundColor',
|
142
|
-
header: TermsUtil.tLabel('background-color'),
|
143
|
-
record: {
|
144
|
-
align: 'left',
|
145
|
-
editable: true,
|
146
|
-
mandatory: true
|
117
|
+
{
|
118
|
+
type: 'string',
|
119
|
+
name: 'id',
|
120
|
+
hidden: true
|
147
121
|
},
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
122
|
+
{
|
123
|
+
type: 'integer',
|
124
|
+
name: 'rank',
|
125
|
+
header: TermsUtil.tLabel('rank'),
|
126
|
+
sortable: false,
|
127
|
+
width: 55,
|
128
|
+
record: {
|
129
|
+
align: 'right',
|
130
|
+
editable: true,
|
131
|
+
mandatory: true
|
132
|
+
}
|
158
133
|
},
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
134
|
+
{
|
135
|
+
type: 'string',
|
136
|
+
name: 'backgroundColor',
|
137
|
+
header: TermsUtil.tLabel('background-color'),
|
138
|
+
record: {
|
139
|
+
align: 'left',
|
140
|
+
editable: true,
|
141
|
+
mandatory: true
|
142
|
+
},
|
143
|
+
width: 130
|
169
144
|
},
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
145
|
+
{
|
146
|
+
type: 'string',
|
147
|
+
name: 'fontColor',
|
148
|
+
header: TermsUtil.tLabel('font-color'),
|
149
|
+
record: {
|
150
|
+
align: 'left',
|
151
|
+
editable: true,
|
152
|
+
mandatory: true
|
153
|
+
},
|
154
|
+
width: 130
|
155
|
+
},
|
156
|
+
{
|
157
|
+
type: 'code-input',
|
158
|
+
name: 'logic',
|
159
|
+
header: TermsUtil.tLabel('logic'),
|
160
|
+
record: {
|
161
|
+
align: 'left',
|
162
|
+
editable: true,
|
163
|
+
mandatory: true
|
164
|
+
},
|
165
|
+
width: 850
|
166
|
+
}
|
167
|
+
]
|
168
|
+
}
|
174
169
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
170
|
+
// 2. 컬럼 강조 그리드 설정
|
171
|
+
this.columnEmphasizedConfig = {
|
172
|
+
rows: MetaApi.getGristSelectableConfig(false),
|
173
|
+
pagination: { infinite: true },
|
174
|
+
appendable: true,
|
175
|
+
columns: [
|
176
|
+
...MetaApi.getGristGuttersConfig(false, false),
|
177
|
+
{
|
178
|
+
type: 'gutter',
|
179
|
+
gutterName: 'button',
|
180
|
+
icon: 'delete',
|
181
|
+
handlers: {
|
182
|
+
click: (_columns, _data, _column, record, _rowIndex) => {
|
183
|
+
if (record.id) {
|
184
|
+
this.deleteRow(this.emphasizedConfigTabColumnEmphasizedGrist, record)
|
185
|
+
}
|
188
186
|
}
|
189
187
|
}
|
190
188
|
},
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
hidden: true
|
196
|
-
},
|
197
|
-
{
|
198
|
-
type: 'integer',
|
199
|
-
name: 'rank',
|
200
|
-
header: TermsUtil.tLabel('rank'),
|
201
|
-
sortable: false,
|
202
|
-
width: 55,
|
203
|
-
record: {
|
204
|
-
align: 'right',
|
205
|
-
editable: true,
|
206
|
-
mandatory: true
|
207
|
-
}
|
208
|
-
},
|
209
|
-
{
|
210
|
-
type: 'string',
|
211
|
-
name: 'column',
|
212
|
-
header: TermsUtil.tLabel('column'),
|
213
|
-
record: {
|
214
|
-
align: 'left',
|
215
|
-
editable: true,
|
216
|
-
mandatory: true
|
189
|
+
{
|
190
|
+
type: 'string',
|
191
|
+
name: 'id',
|
192
|
+
hidden: true
|
217
193
|
},
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
194
|
+
{
|
195
|
+
type: 'integer',
|
196
|
+
name: 'rank',
|
197
|
+
header: TermsUtil.tLabel('rank'),
|
198
|
+
sortable: false,
|
199
|
+
width: 55,
|
200
|
+
record: {
|
201
|
+
align: 'right',
|
202
|
+
editable: true,
|
203
|
+
mandatory: true
|
204
|
+
}
|
228
205
|
},
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
206
|
+
{
|
207
|
+
type: 'string',
|
208
|
+
name: 'column',
|
209
|
+
header: TermsUtil.tLabel('column'),
|
210
|
+
record: {
|
211
|
+
align: 'left',
|
212
|
+
editable: true,
|
213
|
+
mandatory: true
|
214
|
+
},
|
215
|
+
width: 130
|
239
216
|
},
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
217
|
+
{
|
218
|
+
type: 'string',
|
219
|
+
name: 'backgroundColor',
|
220
|
+
header: TermsUtil.tLabel('background-color'),
|
221
|
+
record: {
|
222
|
+
align: 'left',
|
223
|
+
editable: true,
|
224
|
+
mandatory: true
|
225
|
+
},
|
226
|
+
width: 130
|
250
227
|
},
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
228
|
+
{
|
229
|
+
type: 'string',
|
230
|
+
name: 'fontColor',
|
231
|
+
header: TermsUtil.tLabel('font-color'),
|
232
|
+
record: {
|
233
|
+
align: 'left',
|
234
|
+
editable: true,
|
235
|
+
mandatory: true
|
236
|
+
},
|
237
|
+
width: 130
|
238
|
+
},
|
239
|
+
{
|
240
|
+
type: 'code-input',
|
241
|
+
name: 'logic',
|
242
|
+
header: TermsUtil.tLabel('logic'),
|
243
|
+
record: {
|
244
|
+
align: 'left',
|
245
|
+
editable: true,
|
246
|
+
mandatory: true
|
247
|
+
},
|
248
|
+
width: 725
|
249
|
+
}
|
250
|
+
]
|
263
251
|
}
|
264
252
|
}
|
265
|
-
}
|
266
253
|
|
254
|
+
setGridEmphasizedConfigTabDefaultValues() {
|
255
|
+
if (!this.viewEmphasizedData) {
|
256
|
+
this.viewEmphasizedData = {
|
257
|
+
rowEmphasizedData: [],
|
258
|
+
columnEmphasizedData: []
|
259
|
+
}
|
260
|
+
}
|
261
|
+
}
|
267
262
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
let renderHtml = html`
|
273
|
-
<div style='grid-template-rows: 50% 50%;display:grid;flex:1;'>
|
274
|
-
<div field >
|
275
|
-
<h2>
|
276
|
-
<mwc-icon>list_alt</mwc-icon>${TermsUtil.tLabel('grid_row_emphasized_config')}
|
277
|
-
</h2>
|
278
|
-
<ox-grist id="row-emphasized-grist" .config=${this.rowEmphasizedConfig} .mode=${'GRID'} auto-fetch
|
279
|
-
.fetchHandler=${this.fetchRowEmphasized.bind(this)}></ox-grist>
|
280
|
-
</div>
|
281
|
-
<div field >
|
282
|
-
<h2>
|
283
|
-
<mwc-icon>list_alt</mwc-icon>${TermsUtil.tLabel('grid_column_emphasized_config')}
|
284
|
-
</h2>
|
285
|
-
<ox-grist id="column-emphasized-grist" .config=${this.columnEmphasizedConfig} .mode=${'GRID'} auto-fetch
|
286
|
-
.fetchHandler=${this.fetchColumnEmphasized.bind(this)}></ox-grist>
|
287
|
-
</div>
|
288
|
-
</div>
|
289
|
-
`
|
290
|
-
return renderHtml;
|
291
|
-
}
|
263
|
+
// 화면
|
264
|
+
renderGridEmphasizedConfigTab() {
|
265
|
+
this.setGridEmphasizedConfigTabDefaultValues()
|
292
266
|
|
267
|
+
let renderHtml = html`
|
268
|
+
<div style="grid-template-rows: 50% 50%;display:grid;flex:1;">
|
269
|
+
<div field>
|
270
|
+
<h2><mwc-icon>list_alt</mwc-icon>${TermsUtil.tLabel('grid_row_emphasized_config')}</h2>
|
271
|
+
<ox-grist
|
272
|
+
id="row-emphasized-grist"
|
273
|
+
.config=${this.rowEmphasizedConfig}
|
274
|
+
.mode=${'GRID'}
|
275
|
+
auto-fetch
|
276
|
+
.fetchHandler=${this.fetchRowEmphasized.bind(this)}
|
277
|
+
></ox-grist>
|
278
|
+
</div>
|
279
|
+
<div field>
|
280
|
+
<h2><mwc-icon>list_alt</mwc-icon>${TermsUtil.tLabel('grid_column_emphasized_config')}</h2>
|
281
|
+
<ox-grist
|
282
|
+
id="column-emphasized-grist"
|
283
|
+
.config=${this.columnEmphasizedConfig}
|
284
|
+
.mode=${'GRID'}
|
285
|
+
auto-fetch
|
286
|
+
.fetchHandler=${this.fetchColumnEmphasized.bind(this)}
|
287
|
+
></ox-grist>
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
`
|
291
|
+
return renderHtml
|
292
|
+
}
|
293
293
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
294
|
+
async fetchRowEmphasized() {
|
295
|
+
return {
|
296
|
+
records: this.viewEmphasizedData.rowEmphasizedData,
|
297
|
+
total: 0
|
298
|
+
}
|
298
299
|
}
|
299
|
-
}
|
300
300
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
301
|
+
async fetchColumnEmphasized() {
|
302
|
+
return {
|
303
|
+
records: this.viewEmphasizedData.columnEmphasizedData,
|
304
|
+
total: 0
|
305
|
+
}
|
305
306
|
}
|
306
307
|
}
|
307
|
-
}
|