@operato/dataset 1.0.0-alpha.36 → 1.0.0-alpha.39
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 +37 -0
- package/demo/index.html +2 -0
- package/demo/ox-data-item-spec.html +43 -39
- package/demo/ox-data-ooc-view.html +184 -0
- package/demo/ox-data-sample-view.html +150 -0
- package/demo/ox-grist-editor-data-item-spec.html +43 -39
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js +5 -5
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-data-entry-form.js +4 -9
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-item-spec.d.ts +1 -7
- package/dist/src/ox-data-item-spec.js +5 -15
- package/dist/src/ox-data-item-spec.js.map +1 -1
- package/dist/src/ox-data-ooc-view.d.ts +10 -0
- package/dist/src/ox-data-ooc-view.js +58 -0
- package/dist/src/ox-data-ooc-view.js.map +1 -0
- package/dist/src/ox-data-sample-view copy.d.ts +13 -0
- package/dist/src/ox-data-sample-view copy.js +214 -0
- package/dist/src/ox-data-sample-view copy.js.map +1 -0
- package/dist/src/ox-data-sample-view.d.ts +13 -0
- package/dist/src/ox-data-sample-view.js +165 -0
- package/dist/src/ox-data-sample-view.js.map +1 -0
- package/dist/src/ox-data-use-case.d.ts +16 -0
- package/dist/src/ox-data-use-case.js +111 -0
- package/dist/src/ox-data-use-case.js.map +1 -0
- package/dist/src/types.d.ts +36 -2
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -11
- package/src/grist-editor/ox-grist-editor-data-item-spec.ts +5 -5
- package/src/index.ts +3 -0
- package/src/ox-data-entry-form.ts +4 -9
- package/src/ox-data-item-spec.ts +5 -17
- package/src/ox-data-ooc-view.ts +56 -0
- package/src/ox-data-sample-view.ts +171 -0
- package/src/ox-data-use-case.ts +147 -0
- package/src/types.ts +30 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
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.39](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.38...v1.0.0-alpha.39) (2022-03-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* added ox-data-ooc-view ([6693d0c](https://github.com/hatiolab/operato/commit/6693d0cdea7481c877ded73ab1ca1746f49b5ead))
|
|
12
|
+
* ox-data-sample-view ooc oos style ([7e8bebe](https://github.com/hatiolab/operato/commit/7e8bebe1d08eb60a42823bb1850a8d8738b1bb75))
|
|
13
|
+
* ox-data-sample-view ooc,oos icon checked => done ([3e3e345](https://github.com/hatiolab/operato/commit/3e3e3459104eac47a60fac60ab3c6ceeb933df14))
|
|
14
|
+
* ox-data-sample-view style ([ff0513d](https://github.com/hatiolab/operato/commit/ff0513dbd5f8cc6a72c336c2336f544e463ab78a))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [1.0.0-alpha.38](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2022-03-25)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### :bug: Bug Fix
|
|
22
|
+
|
|
23
|
+
* ox-data-sample-view ([6c998f1](https://github.com/hatiolab/operato/commit/6c998f10dcae30fcf228bfe6f547930d0bfc777c))
|
|
24
|
+
* ox-data-sample-view datetime format ([ca8f7ca](https://github.com/hatiolab/operato/commit/ca8f7ca8c29037d5a5bef518f6dfad2df9363097))
|
|
25
|
+
* ox-data-sample-view style ([ec02b2f](https://github.com/hatiolab/operato/commit/ec02b2fae0084f81229a335216672e1231dede7d))
|
|
26
|
+
* ox-data-sample-view style ([7b7c5ee](https://github.com/hatiolab/operato/commit/7b7c5eed16672a4b97c332b5933cc305208d8553))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2022-03-25)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### :bug: Bug Fix
|
|
34
|
+
|
|
35
|
+
* data-item-spec => data-use-case ([3b5e684](https://github.com/hatiolab/operato/commit/3b5e684362621b89883ea6ed22acb7084678d3a5))
|
|
36
|
+
* data-use-case-xx ([7564cd3](https://github.com/hatiolab/operato/commit/7564cd3bdc9d4f61ac4eba6d382e9066a6d36a90))
|
|
37
|
+
* dataset ox-data-sample-view started ([42ceefe](https://github.com/hatiolab/operato/commit/42ceefe919739bbc9e30e468b3f526831e0a56c8))
|
|
38
|
+
* export some components and remove unused components ([3b9788d](https://github.com/hatiolab/operato/commit/3b9788d9d2a73235a2f96d586dcb02643768f0d6))
|
|
39
|
+
* handling data-use-case acceptables ([9ac1239](https://github.com/hatiolab/operato/commit/9ac12396fe15aebddef52bb0ed7fe1f445a6dbfd))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
## [1.0.0-alpha.36](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2022-03-21)
|
|
7
44
|
|
|
8
45
|
**Note:** Version bump only for package @operato/dataset
|
package/demo/index.html
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
|
22
22
|
<a href="./ox-data-entry-form.html">ox-data-entry-form</a>
|
|
23
|
+
<a href="./ox-data-sample-view.html">ox-data-sample-view</a>
|
|
24
|
+
<a href="./ox-data-ooc-view.html">ox-data-ooc-view</a>
|
|
23
25
|
<a href="./ox-data-item-spec.html">ox-data-item-spec</a>
|
|
24
26
|
<a href="./ox-grist-editor-data-item-spec.html">ox-grist-editor-data-item-spec</a>
|
|
25
27
|
</body>
|
|
@@ -36,55 +36,59 @@
|
|
|
36
36
|
boolean: 'ox-property-editor-checkbox'
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
-
import {
|
|
39
|
+
import { OxDataUseCase } from '../dist/src/ox-data-use-case.js'
|
|
40
40
|
import '../dist/src/ox-data-item-spec.js'
|
|
41
41
|
|
|
42
42
|
const parent = document.querySelector('#demo')
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
const ccpUseCase = {
|
|
45
|
+
getSpecification: dataItem => {
|
|
46
|
+
return {
|
|
47
|
+
name: 'ccp',
|
|
48
|
+
description: 'ccp specs',
|
|
49
|
+
specs: [
|
|
50
|
+
{
|
|
51
|
+
type: 'number',
|
|
52
|
+
label: 'critical limits',
|
|
53
|
+
name: 'criticalLimits',
|
|
54
|
+
property: dataItem
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'string',
|
|
58
|
+
label: 'target limits',
|
|
59
|
+
name: 'targetLimits',
|
|
60
|
+
property: dataItem
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
const qcUseCase = {
|
|
68
|
+
getSpecification: dataItem => {
|
|
69
|
+
return {
|
|
70
|
+
name: 'qc',
|
|
71
|
+
description: 'qc specs',
|
|
72
|
+
specs: [
|
|
73
|
+
{
|
|
74
|
+
type: 'number',
|
|
75
|
+
label: 'critical limits',
|
|
76
|
+
name: 'criticalLimits',
|
|
77
|
+
property: dataItem
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'boolean',
|
|
81
|
+
label: 'target limits',
|
|
82
|
+
name: 'targetLimits',
|
|
83
|
+
property: dataItem
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
OxDataUseCase.registerUseCase('ccp', ccpUseCase)
|
|
91
|
+
OxDataUseCase.registerUseCase('qc', qcUseCase)
|
|
88
92
|
|
|
89
93
|
const dataItemA = {
|
|
90
94
|
name: '창고 온도',
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1" />
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
--ox-checkbox-size: 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#demo {
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
15
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
16
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
17
|
+
<link href="/themes/form-theme.css" rel="stylesheet" />
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<div id="demo"></div>
|
|
21
|
+
|
|
22
|
+
<script type="module">
|
|
23
|
+
import { html, render } from 'lit'
|
|
24
|
+
import '@operato/ccp'
|
|
25
|
+
import '@operato/qc'
|
|
26
|
+
|
|
27
|
+
const parent = document.querySelector('#demo')
|
|
28
|
+
const dataSet = {
|
|
29
|
+
name: 'sample',
|
|
30
|
+
description: 'sample description',
|
|
31
|
+
useCase: 'CCP',
|
|
32
|
+
dataItems: [
|
|
33
|
+
{
|
|
34
|
+
name: '창고 온도',
|
|
35
|
+
description: '창고 온도는 섭씨 0도 이하로 유지되어야 합니다.',
|
|
36
|
+
sequence: 1,
|
|
37
|
+
tag: 'temp',
|
|
38
|
+
type: 'number',
|
|
39
|
+
quota: 1,
|
|
40
|
+
active: true,
|
|
41
|
+
unit: '℃',
|
|
42
|
+
spec: {
|
|
43
|
+
CCP: {
|
|
44
|
+
criticalLimits: {
|
|
45
|
+
minimum: 100,
|
|
46
|
+
maximum: 200
|
|
47
|
+
},
|
|
48
|
+
targetLimits: {
|
|
49
|
+
minimum: 120,
|
|
50
|
+
maximum: 180
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: '창고 습도',
|
|
57
|
+
description: '창고 습도는 30% 이하로 유지되어야 합니다.',
|
|
58
|
+
sequence: 2,
|
|
59
|
+
tag: 'humid',
|
|
60
|
+
type: 'number',
|
|
61
|
+
quota: 5,
|
|
62
|
+
active: true,
|
|
63
|
+
unit: '%',
|
|
64
|
+
spec: {
|
|
65
|
+
CCP: {
|
|
66
|
+
criticalLimits: {
|
|
67
|
+
minimum: 10,
|
|
68
|
+
maximum: 50
|
|
69
|
+
},
|
|
70
|
+
targetLimits: {
|
|
71
|
+
minimum: 20,
|
|
72
|
+
maximum: 40
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: '육안 검사',
|
|
79
|
+
description: '육안 검사는 포장전 30분 내로 실행되어야 합니다.',
|
|
80
|
+
sequence: 3,
|
|
81
|
+
tag: 'inspection',
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
quota: 3,
|
|
84
|
+
active: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: '품평',
|
|
88
|
+
description: '품평은 최우수/우수/보통/미달을 포함하여 간단히 평가.',
|
|
89
|
+
sequence: 4,
|
|
90
|
+
tag: 'evaluation',
|
|
91
|
+
type: 'select',
|
|
92
|
+
options: {
|
|
93
|
+
options: [
|
|
94
|
+
{ text: '최우수', value: '최우수' },
|
|
95
|
+
{ text: '우수', value: '우수' },
|
|
96
|
+
{ text: '보통', value: '보통' },
|
|
97
|
+
{ text: '미달', value: '미달' }
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
quota: 3,
|
|
101
|
+
active: true,
|
|
102
|
+
spec: {
|
|
103
|
+
CCP: {
|
|
104
|
+
criticalLimits: {
|
|
105
|
+
acceptables: ['최우수', '우수', '보통']
|
|
106
|
+
},
|
|
107
|
+
targetLimits: {
|
|
108
|
+
acceptables: ['최우수', '우수']
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: '코멘트',
|
|
115
|
+
description: '특이사항을 기록함.',
|
|
116
|
+
sequence: 4,
|
|
117
|
+
tag: 'comment',
|
|
118
|
+
type: 'string',
|
|
119
|
+
quota: 1,
|
|
120
|
+
active: true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: '첨부파일',
|
|
124
|
+
description: '참조 첨부 파일.',
|
|
125
|
+
sequence: 4,
|
|
126
|
+
tag: 'attachment',
|
|
127
|
+
type: 'file',
|
|
128
|
+
quota: 1,
|
|
129
|
+
active: true
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var dataOoc = {
|
|
135
|
+
name: 'Data Sample Name',
|
|
136
|
+
description: 'Data Sample이 어쩌구 저쩌구 그래서 중요합니다. 당연히 그래야죠.',
|
|
137
|
+
useCase: 'CCP',
|
|
138
|
+
data: {
|
|
139
|
+
temp: [1000],
|
|
140
|
+
humid: [20, 23, 21, 26, 27],
|
|
141
|
+
inspection: [true, false, true],
|
|
142
|
+
evaluation: ['최우수', '보통', '우수']
|
|
143
|
+
},
|
|
144
|
+
collectedAt: Date.now(),
|
|
145
|
+
history: [
|
|
146
|
+
{
|
|
147
|
+
user: {
|
|
148
|
+
id: 0,
|
|
149
|
+
name: 'shnam'
|
|
150
|
+
},
|
|
151
|
+
state: 'CREATED',
|
|
152
|
+
timestamp: Date.now()
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
user: {
|
|
156
|
+
id: 0,
|
|
157
|
+
name: 'shnam'
|
|
158
|
+
},
|
|
159
|
+
state: 'REVIEWED',
|
|
160
|
+
comment: '금일 생산한 제품은 전량 폐기합니다',
|
|
161
|
+
timestamp: Date.now()
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
user: {
|
|
165
|
+
id: 0,
|
|
166
|
+
name: 'shnam'
|
|
167
|
+
},
|
|
168
|
+
state: 'CORRECTED',
|
|
169
|
+
timestamp: Date.now()
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
render(
|
|
175
|
+
html`<ox-data-ooc-view
|
|
176
|
+
.dataSet=${dataSet}
|
|
177
|
+
.dataOoc=${dataOoc}
|
|
178
|
+
@change=${e => console.log(e.detail)}
|
|
179
|
+
></ox-data-ooc-view>`,
|
|
180
|
+
parent
|
|
181
|
+
)
|
|
182
|
+
</script>
|
|
183
|
+
</body>
|
|
184
|
+
</html>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1" />
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
--ox-checkbox-size: 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#demo {
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
15
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
16
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
17
|
+
<link href="/themes/form-theme.css" rel="stylesheet" />
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<div id="demo"></div>
|
|
21
|
+
|
|
22
|
+
<script type="module">
|
|
23
|
+
import { html, render } from 'lit'
|
|
24
|
+
import '@operato/ccp'
|
|
25
|
+
import '@operato/qc'
|
|
26
|
+
|
|
27
|
+
const parent = document.querySelector('#demo')
|
|
28
|
+
const dataSet = {
|
|
29
|
+
name: 'sample',
|
|
30
|
+
description: 'sample description',
|
|
31
|
+
useCase: 'CCP',
|
|
32
|
+
dataItems: [
|
|
33
|
+
{
|
|
34
|
+
name: '창고 온도',
|
|
35
|
+
description: '창고 온도는 섭씨 0도 이하로 유지되어야 합니다.',
|
|
36
|
+
sequence: 1,
|
|
37
|
+
tag: 'temp',
|
|
38
|
+
type: 'number',
|
|
39
|
+
quota: 1,
|
|
40
|
+
active: true,
|
|
41
|
+
unit: '℃',
|
|
42
|
+
spec: {
|
|
43
|
+
CCP: {
|
|
44
|
+
criticalLimits: {
|
|
45
|
+
minimum: 100,
|
|
46
|
+
maximum: 200
|
|
47
|
+
},
|
|
48
|
+
targetLimits: {
|
|
49
|
+
minimum: 120,
|
|
50
|
+
maximum: 180
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: '창고 습도',
|
|
57
|
+
description: '창고 습도는 30% 이하로 유지되어야 합니다.',
|
|
58
|
+
sequence: 2,
|
|
59
|
+
tag: 'humid',
|
|
60
|
+
type: 'number',
|
|
61
|
+
quota: 5,
|
|
62
|
+
active: true,
|
|
63
|
+
unit: '%',
|
|
64
|
+
spec: {
|
|
65
|
+
CCP: {
|
|
66
|
+
criticalLimits: {
|
|
67
|
+
minimum: 10,
|
|
68
|
+
maximum: 50
|
|
69
|
+
},
|
|
70
|
+
targetLimits: {
|
|
71
|
+
minimum: 20,
|
|
72
|
+
maximum: 40
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: '육안 검사',
|
|
79
|
+
description: '육안 검사는 포장전 30분 내로 실행되어야 합니다.',
|
|
80
|
+
sequence: 3,
|
|
81
|
+
tag: 'inspection',
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
quota: 3,
|
|
84
|
+
active: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: '품평',
|
|
88
|
+
description: '품평은 최우수/우수/보통/미달을 포함하여 간단히 평가.',
|
|
89
|
+
sequence: 4,
|
|
90
|
+
tag: 'evaluation',
|
|
91
|
+
type: 'select',
|
|
92
|
+
options: {
|
|
93
|
+
options: [
|
|
94
|
+
{ text: '최우수', value: '최우수' },
|
|
95
|
+
{ text: '우수', value: '우수' },
|
|
96
|
+
{ text: '보통', value: '보통' },
|
|
97
|
+
{ text: '미달', value: '미달' }
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
quota: 3,
|
|
101
|
+
active: true,
|
|
102
|
+
spec: {
|
|
103
|
+
CCP: {
|
|
104
|
+
criticalLimits: {
|
|
105
|
+
acceptables: ['최우수', '우수', '보통']
|
|
106
|
+
},
|
|
107
|
+
targetLimits: {
|
|
108
|
+
acceptables: ['최우수', '우수']
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: '코멘트',
|
|
115
|
+
description: '특이사항을 기록함.',
|
|
116
|
+
sequence: 4,
|
|
117
|
+
tag: 'comment',
|
|
118
|
+
type: 'string',
|
|
119
|
+
quota: 1,
|
|
120
|
+
active: true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: '첨부파일',
|
|
124
|
+
description: '참조 첨부 파일.',
|
|
125
|
+
sequence: 4,
|
|
126
|
+
tag: 'attachment',
|
|
127
|
+
type: 'file',
|
|
128
|
+
quota: 1,
|
|
129
|
+
active: true
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var dataSample = {
|
|
135
|
+
name: 'Data Sample Name',
|
|
136
|
+
description: 'Data Sample이 어쩌구 저쩌구 그래서 중요합니다. 당연히 그래야죠.',
|
|
137
|
+
useCase: 'CCP',
|
|
138
|
+
data: {
|
|
139
|
+
temp: [1000],
|
|
140
|
+
humid: [20, 23, 21, 26, 27],
|
|
141
|
+
inspection: [true, false, true],
|
|
142
|
+
evaluation: ['최우수', '보통', '우수']
|
|
143
|
+
},
|
|
144
|
+
collectedAt: Date.now()
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
render(html`<ox-data-sample-view .dataSet=${dataSet} .dataSample=${dataSample}></ox-data-sample-view>`, parent)
|
|
148
|
+
</script>
|
|
149
|
+
</body>
|
|
150
|
+
</html>
|
|
@@ -98,52 +98,56 @@
|
|
|
98
98
|
/* set grist-editors */
|
|
99
99
|
import '../dist/src/grist-editor/index.js'
|
|
100
100
|
|
|
101
|
-
import {
|
|
101
|
+
import { OxDataUseCase } from '../dist/src/ox-data-use-case.js'
|
|
102
102
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
103
|
+
const ccpUseCase = {
|
|
104
|
+
getSpecification: dataItem => {
|
|
105
|
+
return {
|
|
106
|
+
name: 'ccp',
|
|
107
|
+
description: 'ccp specs',
|
|
108
|
+
specs: [
|
|
109
|
+
{
|
|
110
|
+
type: 'number',
|
|
111
|
+
label: 'critical limits',
|
|
112
|
+
name: 'criticalLimits',
|
|
113
|
+
property: dataItem
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'string',
|
|
117
|
+
label: 'target limits',
|
|
118
|
+
name: 'targetLimits',
|
|
119
|
+
property: dataItem
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
const qcUseCase = {
|
|
127
|
+
getSpecification: dataItem => {
|
|
128
|
+
return {
|
|
129
|
+
name: 'qc',
|
|
130
|
+
description: 'qc specs',
|
|
131
|
+
specs: [
|
|
132
|
+
{
|
|
133
|
+
type: 'number',
|
|
134
|
+
label: 'critical limits',
|
|
135
|
+
name: 'criticalLimits',
|
|
136
|
+
property: dataItem
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'boolean',
|
|
140
|
+
label: 'target limits',
|
|
141
|
+
name: 'targetLimits',
|
|
142
|
+
property: dataItem
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
142
146
|
}
|
|
143
147
|
}
|
|
144
148
|
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
OxDataUseCase.registerUseCase('ccp', ccpUseCase)
|
|
150
|
+
OxDataUseCase.registerUseCase('qc', qcUseCase)
|
|
147
151
|
|
|
148
152
|
const fetchHandler = async ({ page, limit, sorters = [] }) => {
|
|
149
153
|
var total = 10
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
5
|
import './ox-popup-data-item-spec.js';
|
|
6
|
-
import { openPopup } from '@operato/layout';
|
|
7
|
-
import { OxGristEditor } from '@operato/data-grist';
|
|
8
|
-
import { cloneDeep } from 'lodash-es';
|
|
9
|
-
import { customElement } from 'lit/decorators.js';
|
|
10
6
|
import { html } from 'lit';
|
|
7
|
+
import { customElement } from 'lit/decorators.js';
|
|
8
|
+
import { cloneDeep } from 'lodash-es';
|
|
9
|
+
import { OxGristEditor } from '@operato/data-grist';
|
|
11
10
|
import { i18next } from '@operato/i18n';
|
|
11
|
+
import { openPopup } from '@operato/layout';
|
|
12
12
|
let OxGristEditorDataItemSpec = class OxGristEditorDataItemSpec extends OxGristEditor {
|
|
13
13
|
get editorTemplate() {
|
|
14
14
|
const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value;
|
|
@@ -16,7 +16,7 @@ let OxGristEditorDataItemSpec = class OxGristEditorDataItemSpec extends OxGristE
|
|
|
16
16
|
}
|
|
17
17
|
async firstUpdated() {
|
|
18
18
|
await this.updateComplete;
|
|
19
|
-
this.renderRoot.addEventListener('click', e => {
|
|
19
|
+
this.renderRoot.addEventListener('click', (e) => {
|
|
20
20
|
e.stopPropagation();
|
|
21
21
|
this.openSelector();
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-data-item-spec.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-data-item-spec.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,8BAA8B,CAAA;AAErC,OAAO,
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-data-item-spec.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-data-item-spec.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,8BAA8B,CAAA;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,M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AAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA5EY,yBAAyB;IADrC,aAAa,CAAC,gCAAgC,CAAC;GACnC,yBAAyB,CA4ErC;SA5EY,yBAAyB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-popup-data-item-spec.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { cloneDeep } from 'lodash-es'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('ox-grist-editor-data-item-spec')\nexport class OxGristEditorDataItemSpec extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\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: Event) => {\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 =\n !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(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-popup-data-item-spec .value=${value} .dataItem=${this.record} .confirmCallback=${confirmCallback}>\n </ox-popup-data-item-spec>\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"]}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './ox-data-entry-form.js';
|
|
2
|
+
export * from './ox-data-sample-view.js';
|
|
3
|
+
export * from './ox-data-ooc-view.js';
|
|
2
4
|
export * from './ox-data-item-spec.js';
|
|
5
|
+
export * from './ox-data-use-case';
|
|
3
6
|
export * from './types.js';
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA","sourcesContent":["export * from './ox-data-entry-form.js'\nexport * from './ox-data-item-spec.js'\nexport * from './types.js'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA","sourcesContent":["export * from './ox-data-entry-form.js'\nexport * from './ox-data-sample-view.js'\nexport * from './ox-data-ooc-view.js'\nexport * from './ox-data-item-spec.js'\nexport * from './ox-data-use-case'\nexport * from './types.js'\n"]}
|