@operato/dataset 2.0.0-alpha.23 → 2.0.0-alpha.27
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 +15 -0
- package/dist/src/ox-data-entry-form.js +49 -34
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-entry-subgroup-form.js +2 -0
- package/dist/src/ox-data-entry-subgroup-form.js.map +1 -1
- package/dist/src/ox-data-entry-view.d.ts +2 -2
- package/dist/src/ox-data-entry-view.js +10 -1
- package/dist/src/ox-data-entry-view.js.map +1 -1
- package/dist/src/ox-data-sample-view.js +6 -0
- package/dist/src/ox-data-sample-view.js.map +1 -1
- package/dist/src/ox-data-summary-view.js +6 -0
- package/dist/src/ox-data-summary-view.js.map +1 -1
- package/dist/stories/ox-data-entry-form.stories.js +43 -0
- package/dist/stories/ox-data-entry-form.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/ox-data-entry-form.ts +52 -34
- package/src/ox-data-entry-subgroup-form.ts +2 -0
- package/src/ox-data-entry-view.ts +11 -1
- package/src/ox-data-sample-view.ts +6 -0
- package/src/ox-data-summary-view.ts +6 -0
- package/stories/ox-data-entry-form.stories.ts +44 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/dataset",
|
|
3
3
|
"description": "WebApplication dataset supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "2.0.0-alpha.
|
|
5
|
+
"version": "2.0.0-alpha.27",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -108,13 +108,13 @@
|
|
|
108
108
|
"@material/mwc-button": "^0.27.0",
|
|
109
109
|
"@material/mwc-icon": "^0.27.0",
|
|
110
110
|
"@material/mwc-icon-button": "^0.27.0",
|
|
111
|
-
"@operato/data-grist": "^2.0.0-alpha.
|
|
111
|
+
"@operato/data-grist": "^2.0.0-alpha.27",
|
|
112
112
|
"@operato/graphql": "^2.0.0-alpha.0",
|
|
113
|
-
"@operato/grist-editor": "^2.0.0-alpha.
|
|
113
|
+
"@operato/grist-editor": "^2.0.0-alpha.27",
|
|
114
114
|
"@operato/i18n": "^2.0.0-alpha.0",
|
|
115
115
|
"@operato/input": "^2.0.0-alpha.20",
|
|
116
116
|
"@operato/popup": "^2.0.0-alpha.9",
|
|
117
|
-
"@operato/property-editor": "^2.0.0-alpha.
|
|
117
|
+
"@operato/property-editor": "^2.0.0-alpha.27",
|
|
118
118
|
"@operato/shell": "^2.0.0-alpha.21",
|
|
119
119
|
"@operato/styles": "^2.0.0-alpha.0",
|
|
120
120
|
"@operato/utils": "^2.0.0-alpha.8",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
"prettier --write"
|
|
153
153
|
]
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "95d81f4107ebb154452184d76e6e606037919c5c"
|
|
156
156
|
}
|
|
@@ -40,7 +40,7 @@ export class OxDataEntryForm extends LitElement {
|
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
label {
|
|
43
|
+
form > div[label] {
|
|
44
44
|
display: grid;
|
|
45
45
|
|
|
46
46
|
grid-template-rows: auto 1fr;
|
|
@@ -50,11 +50,11 @@ export class OxDataEntryForm extends LitElement {
|
|
|
50
50
|
grid-gap: 9px;
|
|
51
51
|
align-items: center;
|
|
52
52
|
margin-bottom: var(--margin-default);
|
|
53
|
-
}
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
&:nth-child(odd) {
|
|
55
|
+
background-color: var(--main-section-background-color);
|
|
56
|
+
padding: var(--padding-default) 0;
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
div[name] {
|
|
@@ -69,15 +69,15 @@ export class OxDataEntryForm extends LitElement {
|
|
|
69
69
|
font: var(--item-description-font);
|
|
70
70
|
color: var(--item-description-color);
|
|
71
71
|
text-align: left;
|
|
72
|
-
}
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
* {
|
|
74
|
+
vertical-align: middle;
|
|
75
|
+
}
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
mwc-icon {
|
|
78
|
+
margin-top: -3px;
|
|
79
|
+
font-size: 0.9rem;
|
|
80
|
+
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
div[elements] {
|
|
@@ -87,18 +87,18 @@ export class OxDataEntryForm extends LitElement {
|
|
|
87
87
|
flex-wrap: wrap;
|
|
88
88
|
gap: 10px;
|
|
89
89
|
padding-right: var(--padding-default);
|
|
90
|
-
}
|
|
91
90
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
* {
|
|
92
|
+
flex: 1;
|
|
93
|
+
}
|
|
95
94
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
input,
|
|
96
|
+
select {
|
|
97
|
+
border: var(--input-field-border);
|
|
98
|
+
border-radius: var(--input-field-border-radius);
|
|
99
|
+
padding: var(--input-field-padding);
|
|
100
|
+
font: var(--input-field-font);
|
|
101
|
+
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
div[subgroup] {
|
|
@@ -107,7 +107,7 @@ export class OxDataEntryForm extends LitElement {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
@media only screen and (max-width: 460px) {
|
|
110
|
-
label {
|
|
110
|
+
form > div[label] {
|
|
111
111
|
display: grid;
|
|
112
112
|
|
|
113
113
|
grid-template-rows: auto auto 1fr;
|
|
@@ -199,38 +199,56 @@ export class OxDataEntryForm extends LitElement {
|
|
|
199
199
|
option => html`<option value=${option.value} ?selected=${option.value === v}>${option.text}</option>`
|
|
200
200
|
)}
|
|
201
201
|
</select>`
|
|
202
|
-
|
|
202
|
+
|
|
203
|
+
case 'radio':
|
|
204
|
+
return html`<div
|
|
205
|
+
@change=${(e: Event) => {
|
|
206
|
+
const div = e.currentTarget as HTMLElement
|
|
207
|
+
const inputHidden = div.querySelector(`input[name="${tag}"]`) as HTMLInputElement
|
|
208
|
+
inputHidden.value = (e.target as HTMLInputElement).value
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
<input type="hidden" name=${tag} />
|
|
212
|
+
|
|
213
|
+
${(options.options || []).map(
|
|
214
|
+
option => html`<label>
|
|
215
|
+
<input
|
|
216
|
+
type="radio"
|
|
217
|
+
name=${'$' + tag + '-' + idx}
|
|
218
|
+
.value=${option.value}
|
|
219
|
+
?checked=${option.value === v}
|
|
220
|
+
/>
|
|
221
|
+
${option.text}
|
|
222
|
+
</label>`
|
|
223
|
+
)}
|
|
224
|
+
</div>`
|
|
203
225
|
|
|
204
226
|
case 'boolean':
|
|
205
227
|
return html` <input type="checkbox" name=${tag} .checked=${v} />`
|
|
206
|
-
break
|
|
207
228
|
|
|
208
229
|
case 'number':
|
|
209
|
-
return html` <input type="number" name=${tag} value=${v} />`
|
|
210
|
-
break
|
|
230
|
+
return html` <input type="number" name=${tag} .value=${v} />`
|
|
211
231
|
|
|
212
232
|
case 'date':
|
|
213
|
-
return html` <input type="date" name=${tag} value=${v} />`
|
|
214
|
-
break
|
|
233
|
+
return html` <input type="date" name=${tag} .value=${v} />`
|
|
215
234
|
|
|
216
235
|
case 'datetime':
|
|
217
|
-
return html` <input type="datetime-local" name=${tag} value=${v} />`
|
|
218
|
-
break
|
|
236
|
+
return html` <input type="datetime-local" name=${tag} .value=${v} />`
|
|
219
237
|
|
|
220
238
|
case 'file':
|
|
221
239
|
return html`<ox-input-file name=${tag} label="Attach Files" accept="*/*" multiple="true"></ox-input-file>`
|
|
222
240
|
|
|
223
241
|
case 'string':
|
|
224
242
|
default:
|
|
225
|
-
return html` <input type="text" name=${tag} value=${v} />`
|
|
243
|
+
return html` <input type="text" name=${tag} .value=${v} />`
|
|
226
244
|
}
|
|
227
245
|
})
|
|
228
246
|
|
|
229
|
-
return html` <label .title=${description}>
|
|
247
|
+
return html` <div label .title=${description}>
|
|
230
248
|
<div name>${name}${unit ? `(${unit})` : ''}</div>
|
|
231
249
|
<div description><mwc-icon>info_outline</mwc-icon> ${description}</div>
|
|
232
250
|
<div elements>${elements}</div>
|
|
233
|
-
</
|
|
251
|
+
</div>`
|
|
234
252
|
})
|
|
235
253
|
}
|
|
236
254
|
|
|
@@ -58,6 +58,8 @@ export class OxDataEntrySubgroupForm extends LitElement {
|
|
|
58
58
|
|
|
59
59
|
switch (type) {
|
|
60
60
|
case 'select':
|
|
61
|
+
case 'radio': // 그리드안에 radio가 들어갈수 없어서 select로 변환
|
|
62
|
+
columnConfig.type = 'select'
|
|
61
63
|
columnConfig.record.options = [
|
|
62
64
|
'',
|
|
63
65
|
...(options.options || []).map((option: any) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@operato/input/ox-input-file.js'
|
|
2
2
|
|
|
3
|
-
import { css, html, LitElement } from 'lit'
|
|
3
|
+
import { css, html, LitElement, nothing } from 'lit'
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js'
|
|
5
5
|
|
|
6
6
|
import { i18next } from '@operato/i18n'
|
|
@@ -94,6 +94,12 @@ export class OxDataEntryView extends LitElement {
|
|
|
94
94
|
pre {
|
|
95
95
|
tab-size: 2;
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
@media screen and (max-width: 480px) {
|
|
99
|
+
th {
|
|
100
|
+
min-width: 50px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
97
103
|
`
|
|
98
104
|
|
|
99
105
|
@property({ type: Object }) dataSet?: DataSet
|
|
@@ -162,6 +168,10 @@ export class OxDataEntryView extends LitElement {
|
|
|
162
168
|
}
|
|
163
169
|
|
|
164
170
|
render() {
|
|
171
|
+
if (!this.dataSet) {
|
|
172
|
+
return nothing
|
|
173
|
+
}
|
|
174
|
+
|
|
165
175
|
const { name, description, useCase, dataItems = [] } = this.dataSet!
|
|
166
176
|
|
|
167
177
|
const data = this.value || {}
|
|
@@ -127,6 +127,50 @@ const dataSet = {
|
|
|
127
127
|
quota: 1,
|
|
128
128
|
active: true
|
|
129
129
|
},
|
|
130
|
+
{
|
|
131
|
+
name: '라디오',
|
|
132
|
+
description: '라디오 그룹',
|
|
133
|
+
|
|
134
|
+
group: '측정데이타',
|
|
135
|
+
sequence: 5,
|
|
136
|
+
tag: 'check1',
|
|
137
|
+
type: 'radio',
|
|
138
|
+
options: {
|
|
139
|
+
options: [
|
|
140
|
+
{
|
|
141
|
+
text: '예',
|
|
142
|
+
value: 'Y'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
text: '아니오',
|
|
146
|
+
value: 'N'
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
quota: 3,
|
|
151
|
+
active: true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: '라디오2',
|
|
155
|
+
description: '라디오 그룹2',
|
|
156
|
+
sequence: 5,
|
|
157
|
+
tag: 'check2',
|
|
158
|
+
type: 'radio',
|
|
159
|
+
options: {
|
|
160
|
+
options: [
|
|
161
|
+
{
|
|
162
|
+
text: '예',
|
|
163
|
+
value: 'Y'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
text: '아니오',
|
|
167
|
+
value: 'N'
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
quota: 1,
|
|
172
|
+
active: true
|
|
173
|
+
},
|
|
130
174
|
{
|
|
131
175
|
name: '첨부파일',
|
|
132
176
|
description: '참조 첨부 파일.',
|