@operato/dataset 1.0.0-alpha.38 → 1.0.0-alpha.40
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 +21 -0
- package/demo/index.html +1 -0
- package/demo/ox-data-ooc-view.html +185 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-data-ooc-view.d.ts +10 -0
- package/dist/src/ox-data-ooc-view.js +69 -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.js +19 -68
- package/dist/src/ox-data-sample-view.js.map +1 -1
- package/dist/src/types.d.ts +14 -0
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -11
- package/src/index.ts +1 -0
- package/src/ox-data-ooc-view.ts +67 -0
- package/src/ox-data-sample-view.ts +19 -68
- package/src/types.ts +16 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js'
|
|
2
|
+
import './ox-data-sample-view'
|
|
3
|
+
|
|
4
|
+
import { DataOoc, DataSet } from './types.js'
|
|
5
|
+
import { LitElement, css, html } from 'lit'
|
|
6
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
7
|
+
|
|
8
|
+
@customElement('ox-data-ooc-view')
|
|
9
|
+
export class OxDataOocView extends LitElement {
|
|
10
|
+
static styles = css`
|
|
11
|
+
:host {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
background-color: var(--main-section-background-color);
|
|
15
|
+
padding: var(--padding-wide);
|
|
16
|
+
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
h3 {
|
|
21
|
+
margin: var(--title-margin);
|
|
22
|
+
padding-top: 12px;
|
|
23
|
+
font: var(--title-font);
|
|
24
|
+
color: var(--title-text-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h3[state] {
|
|
28
|
+
position: absolute;
|
|
29
|
+
|
|
30
|
+
right: 20px;
|
|
31
|
+
top: 25px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[page-description] {
|
|
35
|
+
margin: var(--page-description-margin);
|
|
36
|
+
font: var(--page-description-font);
|
|
37
|
+
color: var(--page-description-color);
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
|
|
41
|
+
@property({ type: Object }) dataSet?: DataSet
|
|
42
|
+
@property({ type: Object }) dataOoc?: DataOoc
|
|
43
|
+
|
|
44
|
+
render() {
|
|
45
|
+
const history = this.dataOoc?.history || []
|
|
46
|
+
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
47
|
+
|
|
48
|
+
return html`
|
|
49
|
+
<ox-data-sample-view .dataSample=${this.dataOoc} .dataSet=${this.dataSet}></ox-data-sample-view>
|
|
50
|
+
|
|
51
|
+
<h3 state>${this.dataOoc?.state || ''}</h3>
|
|
52
|
+
|
|
53
|
+
<h3>history</h3>
|
|
54
|
+
${history.map(
|
|
55
|
+
({ user, state, comment, timestamp }) => html`
|
|
56
|
+
<p page-description>
|
|
57
|
+
${formatter.format(new Date(timestamp))}
|
|
58
|
+
<br />
|
|
59
|
+
${state} by ${user.name}
|
|
60
|
+
<br />
|
|
61
|
+
${comment}
|
|
62
|
+
</p>
|
|
63
|
+
`
|
|
64
|
+
)}
|
|
65
|
+
`
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -13,7 +13,6 @@ export class OxDataSampleView extends LitElement {
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
background-color: var(--main-section-background-color);
|
|
16
|
-
padding: var(--padding-wide);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
form {
|
|
@@ -22,48 +21,7 @@ export class OxDataSampleView extends LitElement {
|
|
|
22
21
|
display: flex;
|
|
23
22
|
flex-direction: column;
|
|
24
23
|
}
|
|
25
|
-
label {
|
|
26
|
-
font: var(--label-font);
|
|
27
|
-
color: var(--label-color);
|
|
28
|
-
}
|
|
29
|
-
label * {
|
|
30
|
-
text-align: middle;
|
|
31
|
-
}
|
|
32
|
-
label:nth-child(even) {
|
|
33
|
-
background-color: var(--main-section-background-color);
|
|
34
|
-
padding: var(--padding-default) 0;
|
|
35
|
-
}
|
|
36
|
-
label mwc-icon {
|
|
37
|
-
position: relative;
|
|
38
|
-
top: 4px;
|
|
39
|
-
font-size: 18px;
|
|
40
|
-
color: var(--status-danger-color);
|
|
41
|
-
}
|
|
42
24
|
|
|
43
|
-
div[name] {
|
|
44
|
-
grid-column: span 2 / auto;
|
|
45
|
-
font: var(--label-font);
|
|
46
|
-
color: var(--label-color);
|
|
47
|
-
text-align: right;
|
|
48
|
-
}
|
|
49
|
-
div[elements] {
|
|
50
|
-
grid-column: span 10 / auto;
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: row;
|
|
53
|
-
flex-wrap: wrap;
|
|
54
|
-
gap: 10px;
|
|
55
|
-
padding-right: var(--padding-default);
|
|
56
|
-
}
|
|
57
|
-
div[elements] * {
|
|
58
|
-
flex: 1;
|
|
59
|
-
}
|
|
60
|
-
div[elements] input,
|
|
61
|
-
div[elements] select {
|
|
62
|
-
border: var(--input-field-border);
|
|
63
|
-
border-radius: var(--input-field-border-radius);
|
|
64
|
-
padding: var(--input-field-padding);
|
|
65
|
-
font: var(--input-field-font);
|
|
66
|
-
}
|
|
67
25
|
h2 {
|
|
68
26
|
margin: var(--title-margin);
|
|
69
27
|
padding-top: 25px;
|
|
@@ -75,6 +33,7 @@ export class OxDataSampleView extends LitElement {
|
|
|
75
33
|
font: var(--page-description-font);
|
|
76
34
|
color: var(--page-description-color);
|
|
77
35
|
}
|
|
36
|
+
|
|
78
37
|
table {
|
|
79
38
|
border-collapse: collapse;
|
|
80
39
|
margin-bottom: var(--margin-default);
|
|
@@ -88,6 +47,12 @@ export class OxDataSampleView extends LitElement {
|
|
|
88
47
|
color: var(--th-color);
|
|
89
48
|
text-align: left;
|
|
90
49
|
}
|
|
50
|
+
th[item] {
|
|
51
|
+
min-width: 100px;
|
|
52
|
+
}
|
|
53
|
+
th[value] {
|
|
54
|
+
min-width: 100px;
|
|
55
|
+
}
|
|
91
56
|
tr {
|
|
92
57
|
background-color: var(--tr-background-color);
|
|
93
58
|
}
|
|
@@ -97,7 +62,8 @@ export class OxDataSampleView extends LitElement {
|
|
|
97
62
|
tr:hover {
|
|
98
63
|
background-color: var(--tr-background-hover-color);
|
|
99
64
|
}
|
|
100
|
-
tr[ooc]
|
|
65
|
+
tr[ooc],
|
|
66
|
+
tr[oos] {
|
|
101
67
|
background-color: #fefbdf;
|
|
102
68
|
}
|
|
103
69
|
td {
|
|
@@ -112,20 +78,9 @@ export class OxDataSampleView extends LitElement {
|
|
|
112
78
|
td mwc-icon {
|
|
113
79
|
color: var(--status-danger-color);
|
|
114
80
|
}
|
|
115
|
-
textarea {
|
|
116
|
-
border: var(--input-field-border);
|
|
117
|
-
border-radius: var(--input-border-radius);
|
|
118
|
-
padding: var(--input-field-padding);
|
|
119
|
-
font: var(--input-field-font);
|
|
120
|
-
}
|
|
121
81
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
grid-column: span 3 / auto;
|
|
125
|
-
}
|
|
126
|
-
div[elements] {
|
|
127
|
-
grid-column: span 9 / auto;
|
|
128
|
-
}
|
|
82
|
+
pre {
|
|
83
|
+
tab-size: 2;
|
|
129
84
|
}
|
|
130
85
|
`
|
|
131
86
|
|
|
@@ -140,39 +95,35 @@ export class OxDataSampleView extends LitElement {
|
|
|
140
95
|
return html` <h2>${this.dataSample?.name}</h2>
|
|
141
96
|
<p page-description>
|
|
142
97
|
${this.dataSample?.description}<br /><br />
|
|
143
|
-
collected at: ${formatter.format(new Date(this.dataSample?.collectedAt!))}
|
|
98
|
+
collected at: ${this.dataSample && formatter.format(new Date(this.dataSample?.collectedAt!))}
|
|
144
99
|
</p>
|
|
145
100
|
|
|
146
101
|
<form @change=${(e: Event) => this.onChange(e)}>
|
|
147
102
|
<table>
|
|
148
103
|
<tr>
|
|
149
|
-
<th>item</th>
|
|
104
|
+
<th item>item</th>
|
|
150
105
|
<th>description</th>
|
|
151
106
|
<th>unit</th>
|
|
152
|
-
<th>value</th>
|
|
107
|
+
<th value>value</th>
|
|
153
108
|
<th>specification</th>
|
|
154
|
-
<th>
|
|
155
|
-
<th>
|
|
109
|
+
<th>OOC</th>
|
|
110
|
+
<th>OOS</th>
|
|
156
111
|
</tr>
|
|
157
112
|
${dataItems.map(dataItem => {
|
|
158
113
|
const { ooc, oos } = this.evaluateOOC(dataItem, data?.[dataItem.tag]) || {}
|
|
159
114
|
return html`
|
|
160
|
-
<tr>
|
|
161
|
-
<!--tr에다가 ooc, oos를 어트리뷰트로 넣어주시면 배경이 살짝 하일라이트 되도록 style 넣어놨습니다 -->
|
|
115
|
+
<tr ?ooc=${ooc} ?oos=${oos}>
|
|
162
116
|
<td name>${dataItem.name}</td>
|
|
163
117
|
<td>${dataItem.description}</td>
|
|
164
118
|
<td>${dataItem.unit}</td>
|
|
165
119
|
<td>${this.buildValue(dataItem)}</td>
|
|
166
120
|
<td><pre>${this.buildSpec(dataItem)}</pre></td>
|
|
167
|
-
<td>${ooc ? html`<mwc-icon>
|
|
168
|
-
<td>${oos ? html`<mwc-icon>
|
|
121
|
+
<td>${ooc ? html`<mwc-icon>done</mwc-icon>` : ''}</td>
|
|
122
|
+
<td>${oos ? html`<mwc-icon>done</mwc-icon>` : ''}</td>
|
|
169
123
|
</tr>
|
|
170
124
|
`
|
|
171
125
|
})}
|
|
172
126
|
</table>
|
|
173
|
-
|
|
174
|
-
<label><mwc-icon>build_circle</mwc-icon> correction activity</label>
|
|
175
|
-
<textarea name="correctionActivity"> </textarea>
|
|
176
127
|
</form>`
|
|
177
128
|
}
|
|
178
129
|
|
package/src/types.ts
CHANGED
|
@@ -51,4 +51,20 @@ export type DataSample = {
|
|
|
51
51
|
collectedAt: Date
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
export type DataOocState = 'CREATED' | 'REVIEWED' | 'CORRECTED'
|
|
55
|
+
|
|
56
|
+
export type DataOoc = DataSample & {
|
|
57
|
+
state: DataOocState
|
|
58
|
+
correctiveAction: string
|
|
59
|
+
history: {
|
|
60
|
+
user: {
|
|
61
|
+
id: string
|
|
62
|
+
name: string
|
|
63
|
+
}
|
|
64
|
+
state: DataOocState
|
|
65
|
+
comment: string
|
|
66
|
+
timestamp: number
|
|
67
|
+
}[]
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
export type EvaluationResult = { oos: boolean; ooc: boolean }
|