@operato/dataset 1.0.0-alpha.21 → 1.0.0-alpha.22
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 +14 -0
- package/demo/data-item-grist.html +343 -0
- package/demo/index.html +3 -2
- package/demo/{data-entry-form.html → ox-data-entry-form.html} +0 -0
- package/demo/{data-item-spec.html → ox-data-item-spec.html} +1 -1
- package/dist/src/grist-editor/index.d.ts +1 -0
- package/dist/src/grist-editor/index.js +7 -0
- package/dist/src/grist-editor/index.js.map +1 -0
- package/dist/src/grist-editor/ox-data-item-spec-editor-popup.d.ts +12 -0
- package/dist/src/grist-editor/ox-data-item-spec-editor-popup.js +94 -0
- package/dist/src/grist-editor/ox-data-item-spec-editor-popup.js.map +1 -0
- package/dist/src/grist-editor/ox-data-item-spec-editor.d.ts +18 -0
- package/dist/src/grist-editor/ox-data-item-spec-editor.js +98 -0
- package/dist/src/grist-editor/ox-data-item-spec-editor.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -11
- package/src/grist-editor/index.ts +10 -0
- package/src/grist-editor/ox-data-item-spec-editor-popup.ts +93 -0
- package/src/grist-editor/ox-data-item-spec-editor.ts +105 -0
- package/themes/grist-theme.css +194 -0
- package/themes/oops-theme.css +26 -0
- package/themes/report-theme.css +47 -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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.0-alpha.22](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2022-03-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* ccp demo ([67b7d65](https://github.com/hatiolab/operato/commit/67b7d65b48d0ca7b3350684a45a396c0538c4902))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### :rocket: New Features
|
|
15
|
+
|
|
16
|
+
* added data-item-spec-editor for grist ([8376e14](https://github.com/hatiolab/operato/commit/8376e142d894a709e60ed676e917d5a26e01e374))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## [1.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2022-03-16)
|
|
7
21
|
|
|
8
22
|
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" />
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
/* box-sizing: border-box; */
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
|
|
13
|
+
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
14
|
+
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
-webkit-font-smoothing: antialiased;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
#app {
|
|
20
|
+
width: 100vw;
|
|
21
|
+
height: 100vh;
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#demo {
|
|
28
|
+
flex: 1;
|
|
29
|
+
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
grist-demo {
|
|
36
|
+
flex: 1;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
41
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
42
|
+
|
|
43
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
44
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
|
45
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
// HACK(keanulee): The Redux package assumes `process` exists - mock it here before
|
|
49
|
+
// the module is loaded.
|
|
50
|
+
window.process = {
|
|
51
|
+
env: {
|
|
52
|
+
NODE_ENV: 'production'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
</head>
|
|
57
|
+
|
|
58
|
+
<body>
|
|
59
|
+
<script type="module">
|
|
60
|
+
import { LitElement, html, css, render } from 'lit'
|
|
61
|
+
import '@operato/data-grist'
|
|
62
|
+
import '@operato/data-grist/ox-filters-form.js'
|
|
63
|
+
import '@operato/data-grist/ox-sorters-control.js'
|
|
64
|
+
import '@material/mwc-icon'
|
|
65
|
+
import { CommonGristStyles } from '@operato/styles'
|
|
66
|
+
import { i18next } from '@operato/i18n'
|
|
67
|
+
|
|
68
|
+
/* set grist-editors */
|
|
69
|
+
import '../dist/src/grist-editor/index.js'
|
|
70
|
+
|
|
71
|
+
const fetchHandler = async ({ page, limit, sorters = [] }) => {
|
|
72
|
+
var total = 10
|
|
73
|
+
var start = (page - 1) * limit
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
total,
|
|
77
|
+
records: Array(limit * page > total ? total % limit : limit)
|
|
78
|
+
.fill()
|
|
79
|
+
.map((item, idx) => {
|
|
80
|
+
return {
|
|
81
|
+
id: idx,
|
|
82
|
+
name: `name-${start + idx + 1}`,
|
|
83
|
+
description: `description-${start + idx + 1}`,
|
|
84
|
+
sequence: idx + 1,
|
|
85
|
+
active: true,
|
|
86
|
+
tag: `tag-${idx + 1}`,
|
|
87
|
+
type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',
|
|
88
|
+
createdAt: Date.now(),
|
|
89
|
+
updatedAt: Date.now()
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var config = {
|
|
96
|
+
list: { fields: ['name', 'description', 'active'] },
|
|
97
|
+
columns: [
|
|
98
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
99
|
+
{
|
|
100
|
+
type: 'gutter',
|
|
101
|
+
gutterName: 'button',
|
|
102
|
+
icon: 'add',
|
|
103
|
+
handlers: {
|
|
104
|
+
click: 'record-copy'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
108
|
+
{
|
|
109
|
+
type: 'gutter',
|
|
110
|
+
gutterName: 'button',
|
|
111
|
+
icon: 'arrow_upward',
|
|
112
|
+
handlers: {
|
|
113
|
+
click: 'move-up'
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: 'gutter',
|
|
118
|
+
gutterName: 'button',
|
|
119
|
+
icon: 'arrow_downward',
|
|
120
|
+
handlers: {
|
|
121
|
+
click: 'move-down'
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'number',
|
|
126
|
+
name: 'sequence',
|
|
127
|
+
hidden: true
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: 'string',
|
|
131
|
+
name: 'id',
|
|
132
|
+
hidden: true
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'string',
|
|
136
|
+
name: 'name',
|
|
137
|
+
header: i18next.t('field.name'),
|
|
138
|
+
record: {
|
|
139
|
+
editable: true
|
|
140
|
+
},
|
|
141
|
+
width: 140
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: 'string',
|
|
145
|
+
name: 'description',
|
|
146
|
+
header: i18next.t('field.description'),
|
|
147
|
+
record: {
|
|
148
|
+
editable: true
|
|
149
|
+
},
|
|
150
|
+
width: 180
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: 'checkbox',
|
|
154
|
+
name: 'active',
|
|
155
|
+
label: true,
|
|
156
|
+
header: i18next.t('field.active'),
|
|
157
|
+
record: {
|
|
158
|
+
editable: true
|
|
159
|
+
},
|
|
160
|
+
sortable: true,
|
|
161
|
+
width: 60
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: 'string',
|
|
165
|
+
name: 'tag',
|
|
166
|
+
header: i18next.t('field.tag'),
|
|
167
|
+
record: {
|
|
168
|
+
editable: true
|
|
169
|
+
},
|
|
170
|
+
width: 180
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'select',
|
|
174
|
+
name: 'type',
|
|
175
|
+
header: i18next.t('field.type'),
|
|
176
|
+
record: {
|
|
177
|
+
options: ['', 'number', 'text', 'select', 'boolean', 'file'],
|
|
178
|
+
editable: true
|
|
179
|
+
},
|
|
180
|
+
width: 120
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
type: 'parameters',
|
|
184
|
+
name: 'options',
|
|
185
|
+
header: i18next.t('field.options'),
|
|
186
|
+
record: {
|
|
187
|
+
editable: true,
|
|
188
|
+
renderer: (value, column, record, rowIndex, field) => {
|
|
189
|
+
return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : ''
|
|
190
|
+
},
|
|
191
|
+
options: async (value, column, record, row, field) => {
|
|
192
|
+
return {
|
|
193
|
+
name: record.type,
|
|
194
|
+
help: '',
|
|
195
|
+
spec:
|
|
196
|
+
record.type === 'select'
|
|
197
|
+
? [
|
|
198
|
+
{
|
|
199
|
+
type: 'options',
|
|
200
|
+
name: 'options',
|
|
201
|
+
label: 'options'
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
: [],
|
|
205
|
+
context: this.grist,
|
|
206
|
+
objectified: true
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
width: 120
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: 'string',
|
|
214
|
+
name: 'unit',
|
|
215
|
+
header: i18next.t('field.unit'),
|
|
216
|
+
record: {
|
|
217
|
+
editable: true
|
|
218
|
+
},
|
|
219
|
+
width: 120
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
type: 'number',
|
|
223
|
+
name: 'quota',
|
|
224
|
+
header: i18next.t('field.quota'),
|
|
225
|
+
record: {
|
|
226
|
+
editable: true
|
|
227
|
+
},
|
|
228
|
+
width: 60
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: 'data-item-spec',
|
|
232
|
+
name: 'spec',
|
|
233
|
+
header: i18next.t('field.spec'),
|
|
234
|
+
record: {
|
|
235
|
+
editable: true,
|
|
236
|
+
options: {
|
|
237
|
+
name,
|
|
238
|
+
objectified: true
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
width: 200
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
rows: {
|
|
245
|
+
selectable: {
|
|
246
|
+
multiple: true
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
pagination: {
|
|
250
|
+
infinite: true
|
|
251
|
+
},
|
|
252
|
+
sorters: [
|
|
253
|
+
{
|
|
254
|
+
name: 'sequence'
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
class GristDemo extends LitElement {
|
|
260
|
+
static styles = [
|
|
261
|
+
CommonGristStyles,
|
|
262
|
+
css`
|
|
263
|
+
:host {
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
#tailer {
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-direction: row;
|
|
271
|
+
margin: 0 var(--margin-default);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
#tailer a {
|
|
275
|
+
padding: 0 var(--padding-default) 0 var(--padding-default);
|
|
276
|
+
margin: 0 var(--margin-narrow);
|
|
277
|
+
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
278
|
+
font-size: var(--fontsize-default);
|
|
279
|
+
color: var(--primary-color);
|
|
280
|
+
}
|
|
281
|
+
`
|
|
282
|
+
]
|
|
283
|
+
|
|
284
|
+
static get properties() {
|
|
285
|
+
return {
|
|
286
|
+
mode: String
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
get grist() {
|
|
291
|
+
return this.renderRoot.querySelector('ox-grist')
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
render() {
|
|
295
|
+
const mode = this.mode || 'CARD'
|
|
296
|
+
|
|
297
|
+
return html`
|
|
298
|
+
<ox-grist .config=${config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>
|
|
299
|
+
<div id="filters" slot="headroom">
|
|
300
|
+
<ox-filters-form @filters-change=${e => console.log('changed', e.detail)}></ox-filters-form>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div slot="headroom" id="headroom">
|
|
304
|
+
<div id="sorters">
|
|
305
|
+
Sort
|
|
306
|
+
<mwc-icon
|
|
307
|
+
@click=${e => {
|
|
308
|
+
const target = e.currentTarget
|
|
309
|
+
this.renderRoot.querySelector('#sorter-control').open({
|
|
310
|
+
right: 0,
|
|
311
|
+
top: target.offsetTop + target.offsetHeight
|
|
312
|
+
})
|
|
313
|
+
}}
|
|
314
|
+
>expand_more</mwc-icon
|
|
315
|
+
>
|
|
316
|
+
<ox-popup id="sorter-control">
|
|
317
|
+
<ox-sorters-control> </ox-sorters-control>
|
|
318
|
+
</ox-popup>
|
|
319
|
+
</div>
|
|
320
|
+
|
|
321
|
+
<div id="modes">
|
|
322
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
|
|
323
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
|
|
324
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</ox-grist>
|
|
328
|
+
`
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
customElements.define('ox-data-items', GristDemo)
|
|
333
|
+
|
|
334
|
+
setTimeout(() => {
|
|
335
|
+
render(html` <ox-data-items mode="LIST"></ox-data-items> `, document.querySelector('#demo'))
|
|
336
|
+
})
|
|
337
|
+
</script>
|
|
338
|
+
|
|
339
|
+
<div id="app">
|
|
340
|
+
<div id="demo"></div>
|
|
341
|
+
</div>
|
|
342
|
+
</body>
|
|
343
|
+
</html>
|
package/demo/index.html
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
<link href="/themes/form-theme.css" rel="stylesheet" />
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
|
22
|
-
<a href="./data-entry-form.html">ox-data-entry-form</a>
|
|
23
|
-
<a href="./data-item-spec.html">ox-data-item-spec</a>
|
|
22
|
+
<a href="./ox-data-entry-form.html">ox-data-entry-form</a>
|
|
23
|
+
<a href="./ox-data-item-spec.html">ox-data-item-spec</a>
|
|
24
|
+
<a href="./data-item-grist.html">data-item-grist</a>
|
|
24
25
|
</body>
|
|
25
26
|
</html>
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ox-data-item-spec-editor';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Json5Renderer, registerEditor, registerRenderer } from '@operato/data-grist';
|
|
2
|
+
import { OxDataItemSpecEditor } from './ox-data-item-spec-editor';
|
|
3
|
+
/* register grist renderer/editor for id */
|
|
4
|
+
registerEditor('data-item-spec', OxDataItemSpecEditor);
|
|
5
|
+
registerRenderer('data-item-spec', Json5Renderer);
|
|
6
|
+
export * from './ox-data-item-spec-editor';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grist-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAErF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEjE,2CAA2C;AAC3C,cAAc,CAAC,gBAAgB,EAAE,oBAA2B,CAAC,CAAA;AAE7D,gBAAgB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA;AAEjD,cAAc,4BAA4B,CAAA","sourcesContent":["import { Json5Renderer, registerEditor, registerRenderer } from '@operato/data-grist'\n\nimport { OxDataItemSpecEditor } from './ox-data-item-spec-editor'\n\n/* register grist renderer/editor for id */\nregisterEditor('data-item-spec', OxDataItemSpecEditor as any)\n\nregisterRenderer('data-item-spec', Json5Renderer)\n\nexport * from './ox-data-item-spec-editor'\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '../ox-data-item-spec.js';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
export declare class OxDataItemSpecEditorPopup extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
value: any;
|
|
6
|
+
dataItem: any;
|
|
7
|
+
confirmCallback: (newval: any) => void;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
private onChange;
|
|
10
|
+
private onCancel;
|
|
11
|
+
private onConfirm;
|
|
12
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '../ox-data-item-spec.js';
|
|
3
|
+
import { LitElement, css, html } from 'lit';
|
|
4
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
6
|
+
import { i18next } from '@operato/i18n';
|
|
7
|
+
let OxDataItemSpecEditorPopup = class OxDataItemSpecEditorPopup extends LitElement {
|
|
8
|
+
render() {
|
|
9
|
+
var dataItem = this.dataItem instanceof Array ? this.dataItem : [];
|
|
10
|
+
return html `
|
|
11
|
+
${dataItem.length > 0
|
|
12
|
+
? html `
|
|
13
|
+
<ox-data-item-spec .value=${this.value} .dataItem=${dataItem} @change=${this.onChange.bind(this)}>
|
|
14
|
+
</ox-data-item-spec>
|
|
15
|
+
`
|
|
16
|
+
: html ` <span><i18n-msg msgid="text.no properties to set"></i18n-msg></span> `}
|
|
17
|
+
|
|
18
|
+
<div class="button-container">
|
|
19
|
+
<mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
|
|
20
|
+
<mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
onChange(e) {
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
/*
|
|
27
|
+
주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
|
|
28
|
+
layout의 구성에 변화가 발생하면, 다시 render된다.
|
|
29
|
+
이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
|
|
30
|
+
이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
|
|
31
|
+
만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
|
|
32
|
+
따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
|
|
33
|
+
(이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
|
|
34
|
+
=>
|
|
35
|
+
이런 이유로, Object.assign(...)을 사용하였다.
|
|
36
|
+
*/
|
|
37
|
+
this.value = e.detail;
|
|
38
|
+
}
|
|
39
|
+
onCancel(e) {
|
|
40
|
+
history.back();
|
|
41
|
+
}
|
|
42
|
+
onConfirm(e) {
|
|
43
|
+
this.confirmCallback && this.confirmCallback(this.value);
|
|
44
|
+
history.back();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
OxDataItemSpecEditorPopup.styles = [
|
|
48
|
+
ScrollbarStyles,
|
|
49
|
+
css `
|
|
50
|
+
:host {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
|
|
54
|
+
background-color: #fff;
|
|
55
|
+
|
|
56
|
+
width: var(--overlay-center-normal-width, 50%);
|
|
57
|
+
height: var(--overlay-center-normal-height, 50%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ox-data-item-spec {
|
|
61
|
+
flex: 1;
|
|
62
|
+
overflow-y: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
span {
|
|
66
|
+
flex: 1;
|
|
67
|
+
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
|
|
72
|
+
color: var(--primary-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.button-container {
|
|
76
|
+
display: flex;
|
|
77
|
+
margin-left: auto;
|
|
78
|
+
}
|
|
79
|
+
`
|
|
80
|
+
];
|
|
81
|
+
__decorate([
|
|
82
|
+
property({ type: Object })
|
|
83
|
+
], OxDataItemSpecEditorPopup.prototype, "value", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: Object })
|
|
86
|
+
], OxDataItemSpecEditorPopup.prototype, "dataItem", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: Object })
|
|
89
|
+
], OxDataItemSpecEditorPopup.prototype, "confirmCallback", void 0);
|
|
90
|
+
OxDataItemSpecEditorPopup = __decorate([
|
|
91
|
+
customElement('ox-data-item-spec-editor-popup')
|
|
92
|
+
], OxDataItemSpecEditorPopup);
|
|
93
|
+
export { OxDataItemSpecEditorPopup };
|
|
94
|
+
//# sourceMappingURL=ox-data-item-spec-editor-popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-data-item-spec-editor-popup.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-data-item-spec-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,IAAa,yBAAyB,GAAtC,MAAa,yBAA0B,SAAQ,UAAU;IAwCvD,MAAM;QACJ,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;QAElE,OAAO,IAAI,CAAA;QACP,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,CAAC,CAAC,IAAI,CAAA;wCAC0B,IAAI,CAAC,KAAK,cAAc,QAAQ,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;WAEjG;YACH,CAAC,CAAC,IAAI,CAAA,wEAAwE;;;6BAGzD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;6BACtD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;KAEhF,CAAA;IACH,CAAC;IAEO,QAAQ,CAAC,CAAc;QAC7B,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB;;;;;;;;;;UAUE;QACF,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAA;IACvB,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;IAEO,SAAS,CAAC,CAAQ;QACxB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxD,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;CACF,CAAA;AAlFQ,gCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kEAAwC;AAtCxD,yBAAyB;IADrC,aAAa,CAAC,gCAAgC,CAAC;GACnC,yBAAyB,CAmFrC;SAnFY,yBAAyB","sourcesContent":["import '../ox-data-item-spec.js'\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-data-item-spec-editor-popup')\nexport class OxDataItemSpecEditorPopup extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-data-item-spec {\n flex: 1;\n overflow-y: auto;\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) dataItem: any\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n var dataItem = this.dataItem instanceof Array ? this.dataItem : []\n\n return html`\n ${dataItem.length > 0\n ? html`\n <ox-data-item-spec .value=${this.value} .dataItem=${dataItem} @change=${this.onChange.bind(this)}>\n </ox-data-item-spec>\n `\n : html` <span><i18n-msg msgid=\"text.no properties to set\"></i18n-msg></span> `}\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n private onChange(e: CustomEvent) {\n e.stopPropagation()\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n this.value = e.detail\n }\n\n private onCancel(e: Event) {\n history.back()\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n history.back()\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import './ox-data-item-spec-editor-popup.js';
|
|
5
|
+
import { ColumnConfig, GristRecord } from '@operato/data-grist';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
export declare class OxDataItemSpecEditor extends LitElement {
|
|
8
|
+
static styles: import("lit").CSSResult;
|
|
9
|
+
value: any;
|
|
10
|
+
column: ColumnConfig;
|
|
11
|
+
record: GristRecord;
|
|
12
|
+
row: number;
|
|
13
|
+
field: any;
|
|
14
|
+
private popup?;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
firstUpdated(): Promise<void>;
|
|
17
|
+
openSelector(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import './ox-data-item-spec-editor-popup.js';
|
|
6
|
+
import { LitElement, css, html } from 'lit';
|
|
7
|
+
import { openPopup } from '@operato/layout';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { i18next } from '@operato/i18n';
|
|
10
|
+
let OxDataItemSpecEditor = class OxDataItemSpecEditor extends LitElement {
|
|
11
|
+
render() {
|
|
12
|
+
const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value;
|
|
13
|
+
return html ` ${value || ''} `;
|
|
14
|
+
}
|
|
15
|
+
async firstUpdated() {
|
|
16
|
+
await this.updateComplete;
|
|
17
|
+
this.renderRoot.addEventListener('click', e => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
this.openSelector();
|
|
20
|
+
});
|
|
21
|
+
this.openSelector();
|
|
22
|
+
}
|
|
23
|
+
async openSelector() {
|
|
24
|
+
if (this.popup) {
|
|
25
|
+
delete this.popup;
|
|
26
|
+
}
|
|
27
|
+
var { options } = this.column.record;
|
|
28
|
+
if (typeof options === 'function') {
|
|
29
|
+
options = await options.call(this, this.value, this.column, this.record, this.row, this.field);
|
|
30
|
+
}
|
|
31
|
+
const { name, help, objectified = false } = options;
|
|
32
|
+
const confirmCallback = (newval) => {
|
|
33
|
+
this.dispatchEvent(new CustomEvent('field-change', {
|
|
34
|
+
bubbles: true,
|
|
35
|
+
composed: true,
|
|
36
|
+
detail: {
|
|
37
|
+
before: this.value,
|
|
38
|
+
after: !objectified ? JSON.stringify(newval) : newval,
|
|
39
|
+
record: this.record,
|
|
40
|
+
column: this.column,
|
|
41
|
+
row: this.row
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
var value = !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : this.value;
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
var value = {};
|
|
50
|
+
}
|
|
51
|
+
/*
|
|
52
|
+
주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
|
|
53
|
+
layout의 구성에 변화가 발생하면, 다시 render된다.
|
|
54
|
+
이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
|
|
55
|
+
이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
|
|
56
|
+
만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
|
|
57
|
+
따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
|
|
58
|
+
*/
|
|
59
|
+
var template = html `
|
|
60
|
+
<ox-data-item-spec-editor-popup .value=${value} .dataItem=${this.record} .confirmCallback=${confirmCallback}>
|
|
61
|
+
</ox-data-item-spec-editor-popup>
|
|
62
|
+
`;
|
|
63
|
+
this.popup = openPopup(template, {
|
|
64
|
+
backdrop: true,
|
|
65
|
+
size: 'large',
|
|
66
|
+
title: `${(name === null || name === void 0 ? void 0 : name.toUpperCase()) || ''} ${i18next.t('field.spec')}`,
|
|
67
|
+
help
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
OxDataItemSpecEditor.styles = css `
|
|
72
|
+
:host {
|
|
73
|
+
color: black;
|
|
74
|
+
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Object })
|
|
81
|
+
], OxDataItemSpecEditor.prototype, "value", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: Object })
|
|
84
|
+
], OxDataItemSpecEditor.prototype, "column", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ type: Object })
|
|
87
|
+
], OxDataItemSpecEditor.prototype, "record", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: Number })
|
|
90
|
+
], OxDataItemSpecEditor.prototype, "row", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
property({ type: Object })
|
|
93
|
+
], OxDataItemSpecEditor.prototype, "field", void 0);
|
|
94
|
+
OxDataItemSpecEditor = __decorate([
|
|
95
|
+
customElement('ox-data-item-spec-editor')
|
|
96
|
+
], OxDataItemSpecEditor);
|
|
97
|
+
export { OxDataItemSpecEditor };
|
|
98
|
+
//# sourceMappingURL=ox-data-item-spec-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-data-item-spec-editor.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-data-item-spec-editor.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-data-item-spec-editor-popup.js'\n\nimport { ColumnConfig, GristRecord } from '@operato/data-grist'\nimport { LitElement, css, html } from 'lit'\nimport { PopupHandle, openPopup } from '@operato/layout'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-data-item-spec-editor')\nexport class OxDataItemSpecEditor extends LitElement {\n static styles = css`\n :host {\n color: black;\n\n overflow: hidden;\n text-overflow: ellipsis;\n }\n `\n\n @property({ type: Object }) value: any\n @property({ type: Object }) column!: ColumnConfig\n @property({ type: Object }) record!: GristRecord\n @property({ type: Number }) row!: number\n @property({ type: Object }) field!: any\n\n private popup?: PopupHandle\n\n render() {\n const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html` ${value || ''} `\n }\n\n async firstUpdated() {\n await this.updateComplete\n\n this.renderRoot.addEventListener('click', e => {\n e.stopPropagation()\n\n this.openSelector()\n })\n\n this.openSelector()\n }\n\n async openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n var { options } = this.column.record\n\n if (typeof options === 'function') {\n options = await options.call(this, this.value, this.column, this.record, this.row, this.field)\n }\n\n const { name, help, objectified = false } = options\n\n const confirmCallback = (newval: any) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: !objectified ? JSON.stringify(newval) : newval,\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n try {\n var value: any = !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : this.value\n } catch (e) {\n var value: any = {}\n }\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n */\n var template = html`\n <ox-data-item-spec-editor-popup .value=${value} .dataItem=${this.record} .confirmCallback=${confirmCallback}>\n </ox-data-item-spec-editor-popup>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || ''} ${i18next.t('field.spec')}`,\n help\n })\n }\n}\n"]}
|