@things-factory/meta-ui 5.0.0-zeta.1
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/CHANGELOG.md +8 -0
- package/LICENSE.md +21 -0
- package/client/actions/main.js +1 -0
- package/client/bootstrap.js +8 -0
- package/client/index.js +23 -0
- package/client/mixin/handler-basic-button-mixin.js +202 -0
- package/client/mixin/handler-common-button-mixin.js +90 -0
- package/client/mixin/handler-custom-button-mixin.js +127 -0
- package/client/mixin/handler-graphql-mixin.js +297 -0
- package/client/mixin/handler-grist-button-mixin.js +119 -0
- package/client/mixin/meta-set-mixin.js +69 -0
- package/client/mixin/meta-util-mixin.js +577 -0
- package/client/mixin/render-basic-form-mixin.js +264 -0
- package/client/mixin/render-basic-grist-mixin.js +85 -0
- package/client/mixin/render-button-mixin.js +163 -0
- package/client/mixin/render-grist-mixin.js +478 -0
- package/client/mixin/render-search-mixin.js +37 -0
- package/client/pages/basic-form-element.js +9 -0
- package/client/pages/basic-grist-element.js +11 -0
- package/client/pages/basic-grist-page.js +12 -0
- package/client/pages/main.js +27 -0
- package/client/reducers/main.js +17 -0
- package/client/route.js +7 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/index.js +20 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.js +25 -0
- package/dist-server/routes.js.map +1 -0
- package/package.json +30 -0
- package/server/controllers/index.ts +0 -0
- package/server/index.ts +4 -0
- package/server/middlewares/index.ts +3 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +28 -0
- package/things-factory.config.js +13 -0
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import '@material/mwc-icon'
|
|
2
|
+
|
|
3
|
+
import { CommonGristStyles } from '@operato/styles'
|
|
4
|
+
import { css, html } from 'lit'
|
|
5
|
+
import { isMobileDevice } from '@operato/utils'
|
|
6
|
+
|
|
7
|
+
import { RenderSearchMixin } from "./render-search-mixin";
|
|
8
|
+
import { remove } from 'lodash';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 메타 정보를 이용해 그리드를 렌더함.
|
|
12
|
+
******************************************************
|
|
13
|
+
* @param {Object} baseElement
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export const RenderGristMixin = (baseElement) => class extends RenderSearchMixin(baseElement) {
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 그리스트 스타일
|
|
20
|
+
* @returns {Array}
|
|
21
|
+
*/
|
|
22
|
+
static gristStyles() {
|
|
23
|
+
return [
|
|
24
|
+
CommonGristStyles,
|
|
25
|
+
css`
|
|
26
|
+
:host {
|
|
27
|
+
--grid-record-emphasized-background-color: red;
|
|
28
|
+
--grid-record-emphasized-color: yellow;
|
|
29
|
+
}
|
|
30
|
+
`
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/************************************************************************************************************************
|
|
35
|
+
* 그리드 render
|
|
36
|
+
*************************************************************************************************************************/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 그리드 렌더링
|
|
41
|
+
* @returns {HTML}
|
|
42
|
+
*/
|
|
43
|
+
getGristHtml() {
|
|
44
|
+
// explicit-fetch
|
|
45
|
+
|
|
46
|
+
return html`
|
|
47
|
+
<ox-grist id="ox-grist" .config=${this.gristConfigSet} .mode=${this.grid_mode} auto-fetch
|
|
48
|
+
.fetchHandler=${this.fetchHandler.bind(this)}>
|
|
49
|
+
${this.getGridDetailHtml()}
|
|
50
|
+
</ox-grist>
|
|
51
|
+
`
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 그리드 상세 내용 html 생성
|
|
56
|
+
* @returns {HTML}
|
|
57
|
+
*/
|
|
58
|
+
getGridDetailHtml() {
|
|
59
|
+
return html `
|
|
60
|
+
<div slot="headroom">
|
|
61
|
+
<div id="filters"><ox-filters-form></ox-filters-form></div>
|
|
62
|
+
<div id="sorters">
|
|
63
|
+
<mwc-icon @click=${e=> {
|
|
64
|
+
const target = e.currentTarget
|
|
65
|
+
this.renderRoot.querySelector('#sorter-control').open({
|
|
66
|
+
right: 0,
|
|
67
|
+
top: target.offsetTop + target.offsetHeight
|
|
68
|
+
})
|
|
69
|
+
}}
|
|
70
|
+
>sort</mwc-icon>
|
|
71
|
+
<ox-popup id="sorter-control">
|
|
72
|
+
<ox-sorters-control> </ox-sorters-control>
|
|
73
|
+
</ox-popup>
|
|
74
|
+
</div>
|
|
75
|
+
${this.getGridViewOption()}
|
|
76
|
+
<ox-record-creator id="add" ?hidden="${!this.use_button_add}" .callback=${this.recordCreationCallback.bind(this)}> <button><mwc-icon>add</mwc-icon></button></ox-record-creator>
|
|
77
|
+
</div>
|
|
78
|
+
` ;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 그리드 보기 옵션 버튼을 그린다.
|
|
83
|
+
*/
|
|
84
|
+
getGridViewOption() {
|
|
85
|
+
if (this.isEmpty(this.grid_view_options) || this.grid_view_options.length == 1) {
|
|
86
|
+
return html``;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return html`
|
|
90
|
+
<div id="modes">
|
|
91
|
+
${this.grid_view_options.includes('GRID')
|
|
92
|
+
? html`<mwc-icon @click="${() => (this.grid_mode = 'GRID')}" ?active="${this.grid_mode == 'GRID'}">grid_on</mwc-icon>`
|
|
93
|
+
: ``}
|
|
94
|
+
${this.grid_view_options.includes('LIST')
|
|
95
|
+
? html`<mwc-icon @click="${() => (this.grid_mode = 'LIST')}" ?active="${this.grid_mode == 'LIST'}">format_list_bulleted</mwc-icon>`
|
|
96
|
+
: ``}
|
|
97
|
+
${this.grid_view_options.includes('CARD')
|
|
98
|
+
? html`<mwc-icon @click="${() => (this.grid_mode = 'CARD')}" ?active="${this.grid_mode == 'CARD'}">apps</mwc-icon>`
|
|
99
|
+
: ``}
|
|
100
|
+
</div>
|
|
101
|
+
`
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/************************************************************************************************************************
|
|
106
|
+
* 그리드 config
|
|
107
|
+
*************************************************************************************************************************/
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 메뉴 메타 정보를 기반으로 그리드 설정 셋을 생성 한다.
|
|
111
|
+
************************************************
|
|
112
|
+
* @returns {Object} 그리드 설정 셋
|
|
113
|
+
*/
|
|
114
|
+
async getGristConfigSet() {
|
|
115
|
+
// 그리드 구성시 내보내기 옵션 포함 여부, 추가 버튼 사용 여부 판단.
|
|
116
|
+
if(this.isEmpty(this.use_button_export)){
|
|
117
|
+
this.use_button_export = this.isNotEmpty(this.buttonConfig.filter( x=> x.name === 'export'));
|
|
118
|
+
}
|
|
119
|
+
if(this.isEmpty(this.use_button_add)){
|
|
120
|
+
this.use_button_add = this.isNotEmpty(this.buttonConfig.filter( x=> x.name === 'add'));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
// 1. 그리드 옵션
|
|
126
|
+
let gridOption = this.getGridOptionSet();
|
|
127
|
+
|
|
128
|
+
// 2. 그리드 리스트 설정
|
|
129
|
+
let gridList = this.getGridListSet();
|
|
130
|
+
|
|
131
|
+
// 3. 그리드 row 설정
|
|
132
|
+
let gridRow = this.getGridRowSet();
|
|
133
|
+
|
|
134
|
+
// 4. 그리드 버튼 설정
|
|
135
|
+
let gridButton = this.getGridButtonSet();
|
|
136
|
+
|
|
137
|
+
// 5. 그리드 컬럼 설정
|
|
138
|
+
let gridColumn = await this.getGridColumnSet();
|
|
139
|
+
|
|
140
|
+
// 6. default 그리드 gutter
|
|
141
|
+
let defGutter = [
|
|
142
|
+
{ type: 'gutter', gutterName: 'dirty' },
|
|
143
|
+
{ type: 'gutter', gutterName: 'sequence' }
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
// 7. filter-form 에 검색 조건 필드 정의
|
|
147
|
+
gridColumn = this.setGridColumnSearchOption(gridColumn);
|
|
148
|
+
|
|
149
|
+
// 그리드 로우 체크 박스
|
|
150
|
+
if (gridOption.use_row_checker) {
|
|
151
|
+
defGutter.push({ type: 'gutter', gutterName: 'row-selector', multiple: gridRow.selectable.multiple })
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
// 최종 그리드 컨픽
|
|
156
|
+
let gridConfigSet = {
|
|
157
|
+
list: gridList,
|
|
158
|
+
pagination: gridOption.pages,
|
|
159
|
+
sorters: gridOption.sorters,
|
|
160
|
+
rows: gridRow,
|
|
161
|
+
columns: [
|
|
162
|
+
...defGutter,
|
|
163
|
+
...gridButton,
|
|
164
|
+
...gridColumn
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
};
|
|
168
|
+
return gridConfigSet;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 메타 데이터의 서치 설정 정보를 그리드 컬럼 설정에 반영
|
|
174
|
+
**********************************************
|
|
175
|
+
* @param {Array} columns 그리드 컬럼 설정
|
|
176
|
+
*/
|
|
177
|
+
setGridColumnSearchOption(columns) {
|
|
178
|
+
|
|
179
|
+
// 서치 설정 Loop
|
|
180
|
+
this.searchConfig.forEach(x => {
|
|
181
|
+
if (typeof x === 'string') {
|
|
182
|
+
columns.filter(col => col.name == x).map(col => {
|
|
183
|
+
col.filter = 'search';
|
|
184
|
+
return col;
|
|
185
|
+
})
|
|
186
|
+
} else if (typeof x === 'object') {
|
|
187
|
+
columns.filter(col => col.name == x.name).map(col => {
|
|
188
|
+
col.filter = x;
|
|
189
|
+
return col;
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
return columns;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* 메타 데이터에서 그리드 렌더링 config 을 생성
|
|
200
|
+
***********************************************
|
|
201
|
+
* @returns {Array}
|
|
202
|
+
*/
|
|
203
|
+
async getGridColumnSet() {
|
|
204
|
+
// 메타에 그리드 컬럼 정보가 없으면
|
|
205
|
+
if (this.isEmpty(this.gridColumnConfig)) {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let columns = [];
|
|
210
|
+
for (let idx = 0; idx < this.gridColumnConfig.length; idx++) {
|
|
211
|
+
var {
|
|
212
|
+
type = "string",
|
|
213
|
+
name = undefined,
|
|
214
|
+
header = undefined,
|
|
215
|
+
hidden = false,
|
|
216
|
+
editable = true,
|
|
217
|
+
mandatory = false,
|
|
218
|
+
sortable = false,
|
|
219
|
+
align = "left",
|
|
220
|
+
width = 0,
|
|
221
|
+
exportable = false,
|
|
222
|
+
select_opt = undefined,
|
|
223
|
+
object_opt = undefined
|
|
224
|
+
} = this.gridColumnConfig[idx];
|
|
225
|
+
|
|
226
|
+
// 컬럼 config 으로 변경 및 문자열 처리
|
|
227
|
+
let column = {
|
|
228
|
+
type: type,
|
|
229
|
+
name: name,
|
|
230
|
+
header: this.isEmpty(header) ? this.convertMsgCode(`field.${name}`) : this.convertMsgCode(header),
|
|
231
|
+
hidden: hidden,
|
|
232
|
+
sortable: sortable,
|
|
233
|
+
width: width,
|
|
234
|
+
record: { editable: editable, mandatory: mandatory, align: align }
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// select-option
|
|
238
|
+
if (type === 'select' && this.isNotEmpty(select_opt)) {
|
|
239
|
+
if (Array.isArray(select_opt)) {
|
|
240
|
+
column.record.options = select_opt;
|
|
241
|
+
} else {
|
|
242
|
+
if(select_opt.type === 'code'){ // 공통 코드
|
|
243
|
+
column.record.options = await this.getCommonCodesByName(select_opt.name);
|
|
244
|
+
} else if(select_opt.type === 'scenario') { // 시나리오
|
|
245
|
+
column.record.options = await this.getCodeByScenario(select_opt.name, select_opt.args)
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// 내보내기 버튼 사용 , 컬럼 내보내기 옵션
|
|
251
|
+
if (this.use_button_export === true && exportable === true) {
|
|
252
|
+
let imexKey = column.name;
|
|
253
|
+
column.imex = { header: column.header, key: imexKey, width: column.width / 6, type: column.type }
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
// object-option
|
|
258
|
+
if(type === 'object' && this.isNotEmpty(object_opt)){
|
|
259
|
+
column.record.options = object_opt;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
columns.push(column);
|
|
263
|
+
}
|
|
264
|
+
return columns;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* 메타 설정에서 그리드 버튼 옵션을 추출 한다.
|
|
269
|
+
* @returns {Array}
|
|
270
|
+
*/
|
|
271
|
+
getGridButtonSet() {
|
|
272
|
+
// 메타에 그리드 버튼 정보가 없으면
|
|
273
|
+
if (this.isEmpty(this.gridConfig.button)) {
|
|
274
|
+
return [];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
let buttons = [];
|
|
278
|
+
this.gridConfig.button.forEach(x => {
|
|
279
|
+
// 기본 그리드 버튼
|
|
280
|
+
let button = {
|
|
281
|
+
type: 'gutter',
|
|
282
|
+
gutterName: 'button',
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
if(this.isNotEmpty(x.icon)){
|
|
286
|
+
// 아이콘이 Array 타입
|
|
287
|
+
if(Array.isArray(x.icon)){
|
|
288
|
+
// 지정 된 조건에 따라 아이콘을 바꾼다.
|
|
289
|
+
button.icon = (record) => {
|
|
290
|
+
|
|
291
|
+
if(this.isEmpty(record)){
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// 지정된 조건 Loop
|
|
296
|
+
for(let idx = 0; idx < x.icon.length; idx++){
|
|
297
|
+
let logic = x.icon[idx];
|
|
298
|
+
let useIcon = this.compareObjectValues(logic, record, Object.keys(logic).filter(key => key != 'icon'));
|
|
299
|
+
if(useIcon === true){
|
|
300
|
+
return logic.icon;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
} else {
|
|
305
|
+
button.icon = x.icon;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// 이름이 지정되어 있으면 변환
|
|
310
|
+
if (this.isNotEmpty(x.name)) {
|
|
311
|
+
// TODO Tooltip
|
|
312
|
+
button = this.setParams(button, x, 'name', true);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// type 이 basic 이면 ( 그리스트 기본 제공 기능 및 추가 기능 )
|
|
316
|
+
if (x.type === 'basic') {
|
|
317
|
+
button.handlers = {
|
|
318
|
+
click: this.getParams(x, "logic")
|
|
319
|
+
}
|
|
320
|
+
} else {
|
|
321
|
+
// type == custom
|
|
322
|
+
button.handlers = {
|
|
323
|
+
click: (_columns, _data, _column, record, _rowIndex) => {
|
|
324
|
+
if (record.id) this.gristButtonHandler(x, record);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
buttons.push(button);
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
return buttons;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* 메타 설정에서 그리드 Row 옵션 을 추출 한다.
|
|
337
|
+
* @returns {Object}
|
|
338
|
+
*/
|
|
339
|
+
getGridRowSet() {
|
|
340
|
+
// 기본 옵션
|
|
341
|
+
// 메타와 상관 없이 그리드 로우 멀티 셀렉트는 false , click 이벤트는 없다.
|
|
342
|
+
var { multiple_select = false,
|
|
343
|
+
click = undefined } = this.isEmpty(this.gridConfig.row) ? {} : this.gridConfig.row;
|
|
344
|
+
|
|
345
|
+
let retObject = {
|
|
346
|
+
selectable: { multiple: multiple_select },
|
|
347
|
+
appendable: this.use_button_add
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (this.isNotEmpty(click)) {
|
|
351
|
+
retObject.handlers = {};
|
|
352
|
+
retObject.handlers.click = click;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return retObject
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* 메타 설정에서 그리드 옵션 을 추출 한다.
|
|
360
|
+
* @returns {Object}
|
|
361
|
+
*/
|
|
362
|
+
getGridOptionSet() {
|
|
363
|
+
// 기본 option
|
|
364
|
+
// mobile, desk , view_mode 설정
|
|
365
|
+
// row_checker 기본은 사용 안함 ( 그리드 앞 체크 박스 )
|
|
366
|
+
// 기본 소터 조건 없음
|
|
367
|
+
// pagination 은 기본 20, 50, 100, 500
|
|
368
|
+
var { mobile_mode = "LIST",
|
|
369
|
+
desk_mode = "GRID",
|
|
370
|
+
view_mode = [],
|
|
371
|
+
use_row_checker = true,
|
|
372
|
+
sorters = [],
|
|
373
|
+
pages = [20, 50, 100, 500] } = this.isEmpty(this.gridConfig.option) ? {} : this.gridConfig.option;
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
// 페이지 설정 변환
|
|
377
|
+
if (pages === 'unlimited') {
|
|
378
|
+
this.infinity_page = true;
|
|
379
|
+
|
|
380
|
+
pages = { infinite: true };
|
|
381
|
+
} else {
|
|
382
|
+
this.infinity_page = false;
|
|
383
|
+
|
|
384
|
+
pages.sort(function (a, b) {
|
|
385
|
+
return a - b;
|
|
386
|
+
});
|
|
387
|
+
pages = { pages: pages };
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// 모바일 데스크 뷰 모드
|
|
391
|
+
if (this.isNotEmpty(view_mode)) {
|
|
392
|
+
if (view_mode.length == 1) {
|
|
393
|
+
desk_mode = view_mode[0];
|
|
394
|
+
mobile_mode = view_mode[0];
|
|
395
|
+
} else if (view_mode.length >= 2) {
|
|
396
|
+
if (view_mode.includes(mobile_mode) == false) {
|
|
397
|
+
mobile_mode = view_mode[1];
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (view_mode.includes(desk_mode) == false) {
|
|
401
|
+
desk_mode = view_mode[0];
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
this.grid_mobile_mode = mobile_mode;
|
|
407
|
+
this.grid_desk_mode = desk_mode;
|
|
408
|
+
this.grid_view_options = view_mode;
|
|
409
|
+
|
|
410
|
+
this.grid_mode = isMobileDevice() ? this.grid_mobile_mode : this.grid_desk_mode;
|
|
411
|
+
|
|
412
|
+
return {
|
|
413
|
+
use_row_checker: use_row_checker,
|
|
414
|
+
sorters: sorters,
|
|
415
|
+
pages: pages
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 메타 설정에서 그리드 리스트 설정을 추출 한다.
|
|
421
|
+
* @returns {Object}
|
|
422
|
+
*/
|
|
423
|
+
getGridListSet() {
|
|
424
|
+
let gridList = {
|
|
425
|
+
fields: [this.getParams(this.menuInfo, "name"), this.getParams(this.menuInfo, "desc")]
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
// 기본 리스트 설정 과 메타에서 가져온 설정 merge
|
|
429
|
+
if (this.gridConfig.list) {
|
|
430
|
+
Object.assign(gridList, this.gridConfig.list);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return gridList;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**********************************
|
|
437
|
+
* Etc
|
|
438
|
+
***********************************/
|
|
439
|
+
|
|
440
|
+
get grist() {
|
|
441
|
+
return this.renderRoot.querySelector('ox-grist')
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* 그리드에서 신규/ 변경 된 레코드를 가져온다
|
|
446
|
+
* @returns
|
|
447
|
+
*/
|
|
448
|
+
getPatches() {
|
|
449
|
+
let patches = this.grist.exportPatchList({ flagName: 'cuFlag' })
|
|
450
|
+
if (patches && patches.length) {
|
|
451
|
+
return patches;
|
|
452
|
+
}
|
|
453
|
+
return undefined;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**********************************
|
|
457
|
+
* LifeCycle
|
|
458
|
+
***********************************/
|
|
459
|
+
|
|
460
|
+
async connectedCallback() {
|
|
461
|
+
if (super.connectedCallback) {
|
|
462
|
+
await super.connectedCallback();
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
async firstUpdated() {
|
|
467
|
+
if (super.firstUpdated) {
|
|
468
|
+
await super.firstUpdated();
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
async pageInitialized() {
|
|
473
|
+
if (super.pageInitialized) {
|
|
474
|
+
await super.pageInitialized();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RenderButtonMixin } from "./render-button-mixin";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 메타 서비스를 이용 서치폼 렌더링
|
|
5
|
+
* 사용하는 서치폼에 따라 옵션 처리
|
|
6
|
+
******************************************************
|
|
7
|
+
* @param {Object} baseElement
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export const RenderSearchMixin = (baseElement) => class extends RenderButtonMixin(baseElement) {
|
|
11
|
+
|
|
12
|
+
get filterForm() {
|
|
13
|
+
return this.shadowRoot?.querySelector('ox-filters-form');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**********************************
|
|
17
|
+
* LifeCycle
|
|
18
|
+
***********************************/
|
|
19
|
+
|
|
20
|
+
async connectedCallback() {
|
|
21
|
+
if (super.connectedCallback) {
|
|
22
|
+
await super.connectedCallback();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async firstUpdated() {
|
|
27
|
+
if (super.firstUpdated) {
|
|
28
|
+
await super.firstUpdated();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async pageInitialized() {
|
|
33
|
+
if (super.pageInitialized) {
|
|
34
|
+
await super.pageInitialized();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { i18next, localize } from '@operato/i18n'
|
|
4
|
+
import { RenderBasicFormMixin } from './../mixin/render-basic-form-mixin'
|
|
5
|
+
|
|
6
|
+
export class BasicFormElement extends RenderBasicFormMixin(localize(i18next)(LitElement)) {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
customElements.define('basic-form-element', BasicFormElement)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { i18next, localize } from '@operato/i18n'
|
|
4
|
+
|
|
5
|
+
import { RenderBasicGristMixin } from './../mixin/render-basic-grist-mixin.js'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class BasicGristElement extends RenderBasicGristMixin(localize(i18next)(LitElement)) {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
customElements.define('basic-grist-element', BasicGristElement)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { i18next, localize } from '@operato/i18n'
|
|
4
|
+
import { PageView } from '@things-factory/shell'
|
|
5
|
+
|
|
6
|
+
import { RenderBasicGristMixin } from './../mixin/render-basic-grist-mixin.js'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export class BasicGristPage extends RenderBasicGristMixin(localize(i18next)(PageView)) {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
customElements.define('basic-grist-page', BasicGristPage)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { html } from 'lit-element'
|
|
2
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
3
|
+
import { store, PageView } from '@things-factory/shell'
|
|
4
|
+
|
|
5
|
+
import logo from '../../assets/images/hatiolab-logo.png'
|
|
6
|
+
|
|
7
|
+
class MetaUiMain extends connect(store)(PageView) {
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
metaUi: String
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return html`
|
|
15
|
+
<section>
|
|
16
|
+
<h2>MetaUi</h2>
|
|
17
|
+
<img src=${logo}>
|
|
18
|
+
</section>
|
|
19
|
+
`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
stateChanged(state) {
|
|
23
|
+
this.metaUi = state.metaUi.state_main
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
window.customElements.define('meta-ui-main', MetaUiMain)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UPDATE_META_UI } from '../actions/main'
|
|
2
|
+
|
|
3
|
+
const INITIAL_STATE = {
|
|
4
|
+
metaUi: 'ABC'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const metaUi = (state = INITIAL_STATE, action) => {
|
|
8
|
+
switch (action.type) {
|
|
9
|
+
case UPDATE_META_UI:
|
|
10
|
+
return { ...state }
|
|
11
|
+
|
|
12
|
+
default:
|
|
13
|
+
return state
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default metaUi
|
package/client/route.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./migrations"), exports);
|
|
18
|
+
__exportStar(require("./middlewares"), exports);
|
|
19
|
+
require("./routes");
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,gDAA6B;AAE7B,oBAAiB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initMiddlewares = void 0;
|
|
4
|
+
function initMiddlewares(app) {
|
|
5
|
+
/* can add middlewares into app */
|
|
6
|
+
}
|
|
7
|
+
exports.initMiddlewares = initMiddlewares;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAAC,GAAG;IACjC,kCAAkC;AACpC,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrations = void 0;
|
|
4
|
+
const glob = require('glob');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
exports.migrations = [];
|
|
7
|
+
glob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function (file) {
|
|
8
|
+
if (file.indexOf('index.js') !== -1)
|
|
9
|
+
return;
|
|
10
|
+
exports.migrations = exports.migrations.concat(Object.values(require(path.resolve(file))) || []);
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
|