@operato/dataset 1.0.0-beta.1 → 1.0.0-beta.12

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.
@@ -1,11 +1,12 @@
1
1
  import '../ox-data-item-spec.js'
2
2
 
3
- import { LitElement, css, html } from 'lit'
3
+ import { css, html, LitElement } from 'lit'
4
4
  import { customElement, property } from 'lit/decorators.js'
5
5
 
6
- import { DataItem } from '../types.js'
7
- import { ScrollbarStyles } from '@operato/styles'
8
6
  import { i18next } from '@operato/i18n'
7
+ import { ScrollbarStyles } from '@operato/styles'
8
+
9
+ import { DataItem } from '../types.js'
9
10
 
10
11
  @customElement('ox-popup-data-item-spec')
11
12
  export class OxPopupDataItemSpec extends LitElement {
@@ -25,6 +26,7 @@ export class OxPopupDataItemSpec extends LitElement {
25
26
  ox-data-item-spec {
26
27
  flex: 1;
27
28
  overflow-y: auto;
29
+ padding: var(--padding-wide);
28
30
  }
29
31
 
30
32
  span {
@@ -11,6 +11,23 @@ export class OxDataEntryForm extends LitElement {
11
11
  :host {
12
12
  display: flex;
13
13
  flex-direction: row;
14
+ --item-description-font: normal 0.8rem/1rem var(--theme-font);
15
+ --item-description-color: var(--page-description-color);
16
+ }
17
+
18
+ h2 {
19
+ margin: var(--title-margin);
20
+ font: var(--title-font);
21
+ color: var(--title-text-color);
22
+ text-transform: capitalize;
23
+ text-align: center;
24
+ }
25
+ h3 {
26
+ margin: var(--page-description-margin);
27
+ font: var(--page-description-font);
28
+ color: var(--page-description-color);
29
+ text-transform: capitalize;
30
+ text-align: center;
14
31
  }
15
32
 
16
33
  form {
@@ -21,24 +38,42 @@ export class OxDataEntryForm extends LitElement {
21
38
  }
22
39
  label {
23
40
  display: grid;
24
- grid-template-columns: repeat(12, 1fr);
25
- gap: 9px;
41
+
42
+ grid-template-rows: auto 1fr;
43
+ grid-template-columns: 1fr 5fr;
44
+ grid-template-areas: 'name description' 'empty inputs';
45
+
46
+ grid-gap: 9px;
26
47
  align-items: center;
27
48
  margin-bottom: var(--margin-default);
28
49
  }
29
- label:nth-child(even) {
50
+ label:nth-child(odd) {
30
51
  background-color: var(--main-section-background-color);
31
52
  padding: var(--padding-default) 0;
32
53
  }
33
54
 
34
55
  div[name] {
35
- grid-column: span 2 / auto;
56
+ grid-area: name;
36
57
  font: var(--label-font);
37
58
  color: var(--label-color);
38
59
  text-align: right;
39
60
  }
61
+ div[description] {
62
+ grid-area: description;
63
+ opacity: 0.7;
64
+ font: var(--item-description-font);
65
+ color: var(--item-description-color);
66
+ text-align: left;
67
+ }
68
+ div[description] * {
69
+ vertical-align: middle;
70
+ }
71
+ div[description] mwc-icon {
72
+ margin-top: -3px;
73
+ font-size: 0.9rem;
74
+ }
40
75
  div[elements] {
41
- grid-column: span 10 / auto;
76
+ grid-area: inputs;
42
77
  display: flex;
43
78
  flex-direction: row;
44
79
  flex-wrap: wrap;
@@ -57,11 +92,20 @@ export class OxDataEntryForm extends LitElement {
57
92
  }
58
93
 
59
94
  @media only screen and (max-width: 460px) {
60
- div[name] {
61
- grid-column: span 3 / auto;
95
+ label {
96
+ display: grid;
97
+
98
+ grid-template-rows: auto auto 1fr;
99
+ grid-template-columns: 1fr;
100
+ grid-template-areas: 'name' 'description' 'inputs';
101
+
102
+ grid-gap: 9px;
103
+ align-items: center;
104
+ margin-bottom: var(--margin-default);
62
105
  }
63
- div[elements] {
64
- grid-column: span 9 / auto;
106
+
107
+ div[name] {
108
+ text-align: left;
65
109
  }
66
110
  }
67
111
  `
@@ -70,7 +114,11 @@ export class OxDataEntryForm extends LitElement {
70
114
  @property({ type: Object }) value?: { [tag: string]: any }
71
115
 
72
116
  render() {
73
- return html`<form @change=${(e: Event) => this.onChange(e)}>${this.buildInputs()}</form>`
117
+ return html` <form @change=${(e: Event) => this.onChange(e)}>
118
+ <h2>${this.dataSet?.name || ''}</h2>
119
+ <h3>${this.dataSet?.description || ''}</h3>
120
+ ${this.buildInputs()}
121
+ </form>`
74
122
  }
75
123
 
76
124
  private onChange(e: Event) {
@@ -132,6 +180,7 @@ export class OxDataEntryForm extends LitElement {
132
180
 
133
181
  return html` <label .title=${description}>
134
182
  <div name>${name}${unit ? `(${unit})` : ''}</div>
183
+ <div description><mwc-icon>info_outline</mwc-icon> ${description}</div>
135
184
  <div elements>${elements}</div>
136
185
  </label>`
137
186
  })
@@ -1,10 +1,14 @@
1
1
  import '@operato/input/ox-input-file.js'
2
2
  import './ox-data-sample-view'
3
+ import '@material/mwc-icon'
3
4
 
4
- import { DataOoc, DataSet } from './types.js'
5
- import { LitElement, css, html } from 'lit'
5
+ import { css, html, LitElement } from 'lit'
6
6
  import { customElement, property } from 'lit/decorators.js'
7
7
 
8
+ import { i18next } from '@operato/i18n'
9
+
10
+ import { DataOoc, DataSet } from './types.js'
11
+
8
12
  @customElement('ox-data-ooc-view')
9
13
  export class OxDataOocView extends LitElement {
10
14
  static styles = css`
@@ -26,15 +30,74 @@ export class OxDataOocView extends LitElement {
26
30
 
27
31
  h3[state] {
28
32
  position: absolute;
33
+ margin: 0;
34
+ padding: 0;
35
+ right: 10px;
36
+ width: 90px;
37
+ text-align: center;
38
+ }
29
39
 
30
- right: 20px;
31
- top: 25px;
40
+ mwc-icon {
41
+ font-size: 16px;
42
+ }
43
+ [state] mwc-icon {
44
+ font-size: 80px;
45
+ opacity: 0.4;
46
+ color: var(--primary-background-color);
32
47
  }
33
48
 
34
- [page-description] {
49
+ [state] div {
50
+ position: absolute;
51
+ top: 22px;
52
+ left: 0;
53
+ right: 0;
54
+ font-size: 10px;
55
+ color: var(--theme-white-color);
56
+ }
57
+ [state] [field-state] {
58
+ display: block;
59
+ border-radius: 4px;
60
+ background-color: var(--primary-color);
61
+ box-shadow: var(--box-shadow);
62
+ margin-top: var(--margin-narrow);
63
+ padding: 1px 3px;
64
+ font-size: 0.8rem;
65
+ }
66
+ [danger] [field-state] {
67
+ background-color: var(--status-danger-color);
68
+ }
69
+ [complate] [field-state] {
70
+ background-color: var(--status-info-color);
71
+ }
72
+ [page-history] [field-state] {
73
+ border-radius: 2px;
74
+ background-color: var(--primary-color);
75
+ margin-left: var(--margin-default);
76
+ padding: 1px 2px;
77
+ font-size: 0.7rem;
78
+ color: var(--theme-white-color);
79
+ }
80
+ [page-history] {
81
+ background-color: var(--theme-white-color);
82
+ box-shadow: var(--box-shadow);
83
+ border-radius: var(--border-radius);
35
84
  margin: var(--page-description-margin);
85
+ padding: var(--padding-default);
36
86
  font: var(--page-description-font);
37
- color: var(--page-description-color);
87
+ color: var(--secondary-color);
88
+ }
89
+ [page-history] mwc-icon {
90
+ position: relative;
91
+ top: 3px;
92
+ margin: 0 2px 0 10px;
93
+ }
94
+ [field-info] {
95
+ opacity: 0.7;
96
+ }
97
+ [page-history] strong {
98
+ display: block;
99
+ font-weight: bold;
100
+ font-size: 0.9rem;
38
101
  }
39
102
  `
40
103
 
@@ -48,17 +111,22 @@ export class OxDataOocView extends LitElement {
48
111
  return html`
49
112
  <ox-data-sample-view .dataSample=${this.dataOoc} .dataSet=${this.dataSet}></ox-data-sample-view>
50
113
 
51
- <h3 state>${this.dataOoc?.state || ''}</h3>
114
+ <h3 state>
115
+ <!--상태에 따라 추가로 danger, complate를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->
116
+ <mwc-icon>shield</mwc-icon>
117
+ <div>${i18next.t('field.name')} <span field-state>${this.dataOoc?.state || ''}</span></div>
118
+ </h3>
52
119
 
53
- <h3>history</h3>
120
+ <h3>${i18next.t('title.history')}</h3>
54
121
  ${history.map(
55
122
  ({ 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}
123
+ <p page-history>
124
+ <!--상태에 따라 추가로 danger, complate를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->
125
+ <span field-info
126
+ >${formatter.format(new Date(timestamp))} <mwc-icon>account_circle</mwc-icon>${user.name}</span
127
+ >
128
+ <span field-state>${state}</span>
129
+ <strong>${comment}</strong>
62
130
  </p>
63
131
  `
64
132
  )}
@@ -3,6 +3,8 @@ import '@operato/input/ox-input-file.js'
3
3
  import { css, html, LitElement } from 'lit'
4
4
  import { customElement, property } from 'lit/decorators.js'
5
5
 
6
+ import { i18next } from '@operato/i18n'
7
+
6
8
  import { OxDataUseCase } from './ox-data-use-case.js'
7
9
  import { DataItem, DataSample, DataSet } from './types.js'
8
10
 
@@ -12,7 +14,6 @@ export class OxDataSampleView extends LitElement {
12
14
  :host {
13
15
  display: flex;
14
16
  flex-direction: column;
15
- background-color: var(--main-section-background-color);
16
17
  }
17
18
 
18
19
  form {
@@ -24,13 +25,23 @@ export class OxDataSampleView extends LitElement {
24
25
 
25
26
  h2 {
26
27
  margin: var(--title-margin);
27
- padding-top: 25px;
28
28
  font: var(--title-font);
29
29
  color: var(--title-text-color);
30
+ text-transform: capitalize;
30
31
  }
31
32
  [page-description] {
32
33
  margin: var(--page-description-margin);
34
+ opacity: 0.7;
33
35
  font: var(--page-description-font);
36
+ color: var(--secondary-color);
37
+ text-transform: capitalize;
38
+ }
39
+ [page-description] * {
40
+ vertical-align: middle;
41
+ }
42
+ [page-description] mwc-icon {
43
+ margin-top: -2px;
44
+ font-size: 0.9rem;
34
45
  color: var(--page-description-color);
35
46
  }
36
47
 
@@ -94,23 +105,24 @@ export class OxDataSampleView extends LitElement {
94
105
 
95
106
  const { name, description, collectedAt, workDate, workShift } = this.dataSample || {}
96
107
 
97
- return html` <h2>${name}</h2>
108
+ return html` <h2>${i18next.t('field.name')}</h2>
98
109
  <p page-description>
99
- ${description}<br /><br />
100
- work date: ${workDate} ${workShift}<br />
101
- collected at: ${formatter.format(new Date(collectedAt!))}
110
+ <mwc-icon>info_outline</mwc-icon> ${i18next.t('field.description')}<br />
111
+ <mwc-icon>alarm</mwc-icon> ${i18next.t('field.work-date')}: ${workDate} ${workShift} |
112
+ <mwc-icon>pending_actions</mwc-icon> ${i18next.t('field.collected-at')}:
113
+ ${formatter.format(new Date(collectedAt!))}
102
114
  </p>
103
115
 
104
116
  <form @change=${(e: Event) => this.onChange(e)}>
105
117
  <table>
106
118
  <tr>
107
- <th item>item</th>
108
- <th>description</th>
109
- <th>unit</th>
110
- <th value>value</th>
111
- <th>specification</th>
112
- <th>OOC</th>
113
- <th>OOS</th>
119
+ <th item>${i18next.t('field.item')}</th>
120
+ <th>${i18next.t('field.description')}</th>
121
+ <th>${i18next.t('field.unit')}</th>
122
+ <th value>${i18next.t('field.value')}</th>
123
+ <th>${i18next.t('field.spec')}</th>
124
+ <th>${i18next.t('field.ooc')}</th>
125
+ <th>${i18next.t('field.oos')}</th>
114
126
  </tr>
115
127
  ${dataItems.map(dataItem => {
116
128
  const { ooc, oos } = this.evaluateOOC(dataItem, data?.[dataItem.tag]) || {}
@@ -1 +1,57 @@
1
- {}
1
+ {
2
+ "button.corrected": "corrected",
3
+ "button.reviewed": "reviewed",
4
+ "field.appliance": "appliance",
5
+ "field.collected_at": "collected at",
6
+ "field.corrective-action": "corrective action",
7
+ "field.corrector": "corrector",
8
+ "field.corrected-at": "corrected at",
9
+ "field.data": "data",
10
+ "field.data-sample": "data sample",
11
+ "field.data-set": "data set",
12
+ "field.device-id": "device id",
13
+ "field.entry-role": "entry role",
14
+ "field.entry-type": "entry type",
15
+ "field.entry-view": "entry view",
16
+ "field.hidden": "hidden",
17
+ "field.latest-collected-at": "latest collected at",
18
+ "field.monitor-type": "monitor type",
19
+ "field.monitor-view": "monitor view",
20
+ "field.netmask": "network mask",
21
+ "field.next-schedule": "next schedule",
22
+ "field.oos": "out of critical limit",
23
+ "field.ooc": "out of control limit",
24
+ "field.options": "options",
25
+ "field.partition-keys": "partition keys",
26
+ "field.prev-schedule": "previous schedule",
27
+ "field.quota": "sampling #",
28
+ "field.raw-data": "raw data",
29
+ "field.ref-by": "ref. by",
30
+ "field.report-type": "report type",
31
+ "field.report-view": "report view",
32
+ "field.serial-no": "serial #",
33
+ "field.spec": "spec",
34
+ "field.state": "state",
35
+ "field.supervisory-role": "supervisory role",
36
+ "field.tag": "tag name",
37
+ "field.unit": "unit",
38
+ "field.use-case": "use case",
39
+ "field.work-date": "work date",
40
+ "field.work-shift": "work shift",
41
+ "text.automatically collected": "automatically collected",
42
+ "text.data sample created successfully": "a data sample created successfully",
43
+ "text.data ooc updated successfully": "a data ooc updated successfully",
44
+ "text.manually collected": "manually collected",
45
+ "title.data-entry-form": "data entry form",
46
+ "title.data-entry list": "data entry list",
47
+ "title.data-item list": "data item list",
48
+ "title.data-monitor-view": "data monitor view",
49
+ "title.data-report-view": "data report view",
50
+ "title.data-ooc list": "data OOC list",
51
+ "title.data-ooc view": "data OOC view",
52
+ "title.data-sample list": "data sample list",
53
+ "title.data-sample view": "data sample view",
54
+ "title.data-sensor list": "data sensor list",
55
+ "title.data-set list": "data set list",
56
+ "title.edit code": "edit code"
57
+ }
@@ -1 +1,56 @@
1
- {}
1
+ {
2
+ "button.corrected": "조치완료",
3
+ "button.reviewed": "검토완료",
4
+ "field.appliance": "어플라이언스",
5
+ "field.collected_at": "수집일시",
6
+ "field.corrective-action": "조치 활동",
7
+ "field.corrector": "조치자",
8
+ "field.corrected-at": "조치 시간",
9
+ "field.data": "데이타",
10
+ "field.data-sample": "데이타 샘플",
11
+ "field.data-set": "데이타셋",
12
+ "field.device-id": "디바이스 아이디",
13
+ "field.entry-role": "입력담당 역할",
14
+ "field.entry-type": "입력용 화면종류",
15
+ "field.entry-view": "입력용 화면",
16
+ "field.hidden": "숨기기",
17
+ "field.latest-collected-at": "최근 수집 시간",
18
+ "field.monitor-type": "모니터용 화면종류",
19
+ "field.monitor-view": "모니터용 화면",
20
+ "field.netmask": "네트워크마스크",
21
+ "field.next-schedule": "다음 수집계획",
22
+ "field.oos": "허용한계 이탈여부",
23
+ "field.ooc": "관리한계 이탈여부",
24
+ "field.options": "선택옵션",
25
+ "field.partition-keys": "파티션 키",
26
+ "field.prev-schedule": "이전 수집계획",
27
+ "field.quota": "샘플수",
28
+ "field.raw-data": "데이타 원본",
29
+ "field.ref-by": "참조아이템",
30
+ "field.report-type": "리포트용 화면종류",
31
+ "field.report-view": "리포트용 화면",
32
+ "field.serial-no": "시리얼번호",
33
+ "field.spec": "명세",
34
+ "field.state": "상태",
35
+ "field.supervisory-role": "관리자 역할",
36
+ "field.tag": "태그이름",
37
+ "field.unit": "단위",
38
+ "field.use-case": "사용 사례",
39
+ "field.work-date": "작업기준일",
40
+ "field.work-shift": "교대근무조",
41
+ "text.automatically collected": "자동 수집",
42
+ "text.data sample created successfully": "데이타 샘플이 성공적으로 생성되었습니다",
43
+ "text.data ooc updated successfully": "이탈데이타 내용이 수정되었습니다",
44
+ "text.manually collected": "수동 수집",
45
+ "title.data-entry-form": "데이타 입력",
46
+ "title.data-item list": "데이타 아이템 조회",
47
+ "title.data-monitor-view": "데이타 모니터",
48
+ "title.data-report-view": "데이타 리포트",
49
+ "title.data-ooc list": "데이타 이탈점 조회",
50
+ "title.data-ooc view": "데이타 이탈점 상세",
51
+ "title.data-sample list": "데이타 샘플 조회",
52
+ "title.data-sample view": "데이타 샘플 상세",
53
+ "title.data-sensor list": "데이타 센서 조회",
54
+ "title.data-set list": "데이타 셋 조회",
55
+ "title.edit code": "코드 편집"
56
+ }
@@ -1 +1,56 @@
1
- {}
1
+ {
2
+ "button.corrected": "corrected",
3
+ "button.reviewed": "reviewed",
4
+ "field.appliance": "appliance",
5
+ "field.collected_at": "collected at",
6
+ "field.corrective-action": "corrective action",
7
+ "field.corrector": "corrector",
8
+ "field.corrected-at": "corrected at",
9
+ "field.data": "data",
10
+ "field.data-sample": "data sample",
11
+ "field.data-set": "data set",
12
+ "field.device-id": "device id",
13
+ "field.entry-role": "entry role",
14
+ "field.entry-type": "entry type",
15
+ "field.entry-view": "entry view",
16
+ "field.latest-collected-at": "latest collected at",
17
+ "field.monitor-type": "monitor type",
18
+ "field.monitor-view": "monitor view",
19
+ "field.netmask": "network mask",
20
+ "field.next-schedule": "next schedule",
21
+ "field.oos": "out of critical limit",
22
+ "field.ooc": "out of control limit",
23
+ "field.options": "options",
24
+ "field.hidden": "hidden",
25
+ "field.partition-keys": "partition keys",
26
+ "field.prev-schedule": "previous schedule",
27
+ "field.quota": "sampling #",
28
+ "field.raw-data": "raw data",
29
+ "field.ref-by": "ref. by",
30
+ "field.report-type": "report type",
31
+ "field.report-view": "report view",
32
+ "field.serial-no": "serial #",
33
+ "field.spec": "spec",
34
+ "field.state": "keadaan",
35
+ "field.supervisory-role": "supervisory role",
36
+ "field.tag": "tag name",
37
+ "field.unit": "unit",
38
+ "field.use-case": "use case",
39
+ "field.work-date": "work date",
40
+ "field.work-shift": "work shift",
41
+ "text.automatically collected": "automatically collected",
42
+ "text.data sample created successfully": "a data sample created successfully",
43
+ "text.data ooc updated successfully": "a data ooc updated successfully",
44
+ "text.manually collected": "manually collected",
45
+ "title.data-entry-form": "data entry form",
46
+ "title.data-item list": "data item list",
47
+ "title.data-monitor-view": "data monitor view",
48
+ "title.data-report-view": "data report view",
49
+ "title.data-ooc list": "data OOC list",
50
+ "title.data-ooc view": "data OOC view",
51
+ "title.data-sample list": "data sample list",
52
+ "title.data-sample view": "data sample view",
53
+ "title.data-sensor list": "data sensor list",
54
+ "title.data-set list": "data set list",
55
+ "title.edit code": "edit code"
56
+ }
@@ -1 +1,56 @@
1
- {}
1
+ {
2
+ "button.corrected": "corrected",
3
+ "button.reviewed": "reviewed",
4
+ "field.appliance": "appliance",
5
+ "field.collected_at": "collected at",
6
+ "field.corrective-action": "corrective action",
7
+ "field.corrector": "corrector",
8
+ "field.corrected-at": "corrected at",
9
+ "field.data": "data",
10
+ "field.data-sample": "data sample",
11
+ "field.data-set": "data set",
12
+ "field.device-id": "device id",
13
+ "field.entry-role": "entry role",
14
+ "field.entry-type": "entry type",
15
+ "field.entry-view": "entry view",
16
+ "field.hidden": "hidden",
17
+ "field.latest-collected-at": "latest collected at",
18
+ "field.monitor-type": "monitor type",
19
+ "field.monitor-view": "monitor view",
20
+ "field.netmask": "network mask",
21
+ "field.next-schedule": "next schedule",
22
+ "field.oos": "out of critical limit",
23
+ "field.ooc": "out of control limit",
24
+ "field.options": "options",
25
+ "field.partition-keys": "partition keys",
26
+ "field.prev-schedule": "previous schedule",
27
+ "field.quota": "sampling #",
28
+ "field.raw-data": "raw data",
29
+ "field.ref-by": "ref. by",
30
+ "field.report-type": "report type",
31
+ "field.report-view": "report view",
32
+ "field.serial-no": "serial #",
33
+ "field.spec": "spec",
34
+ "field.state": "状态",
35
+ "field.supervisory-role": "supervisory role",
36
+ "field.tag": "tag name",
37
+ "field.unit": "unit",
38
+ "field.use-case": "use case",
39
+ "field.work-date": "work date",
40
+ "field.work-shift": "work shift",
41
+ "text.automatically collected": "automatically collected",
42
+ "text.data sample created successfully": "a data sample created successfully",
43
+ "text.data ooc updated successfully": "a data ooc updated successfully",
44
+ "text.manually collected": "manually collected",
45
+ "title.data-entry-form": "data entry form",
46
+ "title.data-item list": "data item list",
47
+ "title.data-monitor-view": "data monitor view",
48
+ "title.data-report-view": "data report view",
49
+ "title.data-ooc list": "data OOC list",
50
+ "title.data-ooc view": "data OOC view",
51
+ "title.data-sample list": "data sample list",
52
+ "title.data-sample view": "data sample view",
53
+ "title.data-sensor list": "data sensor list",
54
+ "title.data-set list": "data set list",
55
+ "title.edit code": "edit code"
56
+ }