@operato/dataset 1.0.0-beta.9 → 1.0.0
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 +362 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js +1 -1
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-data-item-spec.js +3 -2
- package/dist/src/grist-editor/ox-popup-data-item-spec.js.map +1 -1
- package/dist/src/index.d.ts +1 -5
- package/dist/src/index.js +1 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-data-entry-form.js +24 -4
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-item-spec.d.ts +2 -2
- package/dist/src/ox-data-item-spec.js +71 -14
- package/dist/src/ox-data-item-spec.js.map +1 -1
- package/dist/src/ox-data-ooc-view.js +73 -14
- package/dist/src/ox-data-ooc-view.js.map +1 -1
- package/dist/src/ox-data-sample-view.d.ts +1 -3
- package/dist/src/ox-data-sample-view.js +40 -38
- package/dist/src/ox-data-sample-view.js.map +1 -1
- package/dist/src/types.d.ts +25 -6
- package/dist/src/types.js.map +1 -1
- package/dist/src/usecase/ccp/index.d.ts +1 -0
- package/dist/src/usecase/ccp/index.js +8 -0
- package/dist/src/usecase/ccp/index.js.map +1 -0
- package/dist/src/usecase/ccp/ox-data-use-case-ccp.d.ts +7 -0
- package/dist/src/usecase/ccp/ox-data-use-case-ccp.js +102 -0
- package/dist/src/usecase/ccp/ox-data-use-case-ccp.js.map +1 -0
- package/dist/src/usecase/ccp/ox-input-ccp-limits.d.ts +44 -0
- package/dist/src/usecase/ccp/ox-input-ccp-limits.js +171 -0
- package/dist/src/usecase/ccp/ox-input-ccp-limits.js.map +1 -0
- package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.d.ts +5 -0
- package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.js +24 -0
- package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.js.map +1 -0
- package/dist/src/{ox-data-use-case.d.ts → usecase/ox-data-use-case.d.ts} +5 -5
- package/dist/src/{ox-data-use-case.js → usecase/ox-data-use-case.js} +22 -34
- package/dist/src/usecase/ox-data-use-case.js.map +1 -0
- package/dist/src/usecase/qc/index.d.ts +1 -0
- package/dist/src/usecase/qc/index.js +8 -0
- package/dist/src/usecase/qc/index.js.map +1 -0
- package/dist/src/usecase/qc/ox-data-use-case-qc.d.ts +7 -0
- package/dist/src/usecase/qc/ox-data-use-case-qc.js +55 -0
- package/dist/src/usecase/qc/ox-data-use-case-qc.js.map +1 -0
- package/dist/src/usecase/qc/ox-input-qc-limits.d.ts +44 -0
- package/dist/src/usecase/qc/ox-input-qc-limits.js +171 -0
- package/dist/src/usecase/qc/ox-input-qc-limits.js.map +1 -0
- package/dist/src/usecase/qc/ox-property-editor-qc-limits.d.ts +5 -0
- package/dist/src/usecase/qc/ox-property-editor-qc-limits.js +24 -0
- package/dist/src/usecase/qc/ox-property-editor-qc-limits.js.map +1 -0
- package/dist/stories/ox-data-entry-form.stories.d.ts +19 -0
- package/dist/stories/ox-data-entry-form.stories.js +152 -0
- package/dist/stories/ox-data-entry-form.stories.js.map +1 -0
- package/dist/stories/ox-data-item-spec.stories.d.ts +26 -0
- package/dist/stories/ox-data-item-spec.stories.js +102 -0
- package/dist/stories/ox-data-item-spec.stories.js.map +1 -0
- package/dist/stories/ox-data-ooc-view.stories.d.ts +19 -0
- package/dist/stories/ox-data-ooc-view.stories.js +242 -0
- package/dist/stories/ox-data-ooc-view.stories.js.map +1 -0
- package/dist/stories/ox-data-sample-view.stories.d.ts +19 -0
- package/dist/stories/ox-data-sample-view.stories.js +213 -0
- package/dist/stories/ox-data-sample-view.stories.js.map +1 -0
- package/dist/stories/ox-grist-editor-data-item-spec.stories.d.ts +27 -0
- package/dist/stories/ox-grist-editor-data-item-spec.stories.js +389 -0
- package/dist/stories/ox-grist-editor-data-item-spec.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -18
- package/src/grist-editor/ox-grist-editor-data-item-spec.ts +1 -1
- package/src/grist-editor/ox-popup-data-item-spec.ts +3 -2
- package/src/index.ts +1 -5
- package/src/ox-data-entry-form.ts +24 -4
- package/src/ox-data-item-spec.ts +73 -16
- package/src/ox-data-ooc-view.ts +73 -14
- package/src/ox-data-sample-view.ts +43 -39
- package/src/types.ts +31 -6
- package/src/usecase/ccp/index.ts +10 -0
- package/src/usecase/ccp/ox-data-use-case-ccp.ts +147 -0
- package/src/usecase/ccp/ox-input-ccp-limits.ts +161 -0
- package/src/usecase/ccp/ox-property-editor-ccp-limits.ts +23 -0
- package/src/{ox-data-use-case.ts → usecase/ox-data-use-case.ts} +27 -41
- package/src/usecase/qc/index.ts +10 -0
- package/src/usecase/qc/ox-data-use-case-qc.ts +72 -0
- package/src/usecase/qc/ox-input-qc-limits.ts +161 -0
- package/src/usecase/qc/ox-property-editor-qc-limits.ts +23 -0
- package/stories/ox-data-entry-form.stories.ts +165 -0
- package/stories/ox-data-item-spec.stories.ts +121 -0
- package/stories/ox-data-ooc-view.stories.ts +256 -0
- package/stories/ox-data-sample-view.stories.ts +227 -0
- package/stories/ox-grist-editor-data-item-spec.stories.ts +409 -0
- package/translations/en.json +26 -8
- package/translations/ko.json +25 -7
- package/translations/ms.json +26 -8
- package/translations/zh.json +25 -7
- package/demo/index.html +0 -28
- package/demo/ox-data-entry-form.html +0 -118
- package/demo/ox-data-item-spec.html +0 -152
- package/demo/ox-data-ooc-view.html +0 -185
- package/demo/ox-data-sample-view.html +0 -150
- package/demo/ox-grist-editor-data-item-spec.html +0 -476
- package/dist/src/ox-data-use-case.js.map +0 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import '@operato/i18n'
|
|
2
|
+
import '../src/ox-data-sample-view.js'
|
|
3
|
+
import '../src/usecase/ccp' /* register usecase CCP */
|
|
4
|
+
import '@material/mwc-icon'
|
|
5
|
+
|
|
6
|
+
import { html, TemplateResult } from 'lit'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'ox-data-sample-view',
|
|
10
|
+
component: 'ox-data-sample-view',
|
|
11
|
+
argTypes: {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Story<T> {
|
|
15
|
+
(args: T): TemplateResult
|
|
16
|
+
args?: Partial<T>
|
|
17
|
+
argTypes?: Record<string, unknown>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface ArgTypes {}
|
|
21
|
+
|
|
22
|
+
const dataSet = {
|
|
23
|
+
name: 'sample',
|
|
24
|
+
description: 'sample description',
|
|
25
|
+
useCase: 'CCP',
|
|
26
|
+
dataItems: [
|
|
27
|
+
{
|
|
28
|
+
name: '창고 온도',
|
|
29
|
+
description: '창고 온도는 섭씨 0도 이하로 유지되어야 합니다.',
|
|
30
|
+
sequence: 1,
|
|
31
|
+
tag: 'temp',
|
|
32
|
+
type: 'number',
|
|
33
|
+
quota: 1,
|
|
34
|
+
active: true,
|
|
35
|
+
unit: '℃',
|
|
36
|
+
spec: {
|
|
37
|
+
CCP: {
|
|
38
|
+
criticalLimits: {
|
|
39
|
+
minimum: 100,
|
|
40
|
+
maximum: 200
|
|
41
|
+
},
|
|
42
|
+
targetLimits: {
|
|
43
|
+
minimum: 120,
|
|
44
|
+
maximum: 180
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: '창고 습도',
|
|
51
|
+
description: '창고 습도는 30% 이하로 유지되어야 합니다.',
|
|
52
|
+
sequence: 2,
|
|
53
|
+
tag: 'humid',
|
|
54
|
+
type: 'number',
|
|
55
|
+
quota: 5,
|
|
56
|
+
active: true,
|
|
57
|
+
unit: '%',
|
|
58
|
+
spec: {
|
|
59
|
+
CCP: {
|
|
60
|
+
criticalLimits: {
|
|
61
|
+
minimum: 10,
|
|
62
|
+
maximum: 50
|
|
63
|
+
},
|
|
64
|
+
targetLimits: {
|
|
65
|
+
minimum: 20,
|
|
66
|
+
maximum: 40
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: '육안 검사',
|
|
73
|
+
description: '육안 검사는 포장전 30분 내로 실행되어야 합니다.',
|
|
74
|
+
sequence: 3,
|
|
75
|
+
tag: 'inspection',
|
|
76
|
+
type: 'boolean',
|
|
77
|
+
quota: 3,
|
|
78
|
+
active: true,
|
|
79
|
+
spec: {
|
|
80
|
+
CCP: {
|
|
81
|
+
criticalLimits: {
|
|
82
|
+
acceptables: true
|
|
83
|
+
},
|
|
84
|
+
targetLimits: {
|
|
85
|
+
acceptables: true
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: '품평',
|
|
92
|
+
description: '품평은 최우수/우수/보통/미달을 포함하여 간단히 평가.',
|
|
93
|
+
sequence: 4,
|
|
94
|
+
tag: 'evaluation',
|
|
95
|
+
type: 'select',
|
|
96
|
+
options: {
|
|
97
|
+
options: [
|
|
98
|
+
{ text: '최우수', value: '최우수' },
|
|
99
|
+
{ text: '우수', value: '우수' },
|
|
100
|
+
{ text: '보통', value: '보통' },
|
|
101
|
+
{ text: '미달', value: '미달' }
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
quota: 3,
|
|
105
|
+
active: true,
|
|
106
|
+
spec: {
|
|
107
|
+
CCP: {
|
|
108
|
+
criticalLimits: {
|
|
109
|
+
acceptables: ['최우수', '우수', '보통']
|
|
110
|
+
},
|
|
111
|
+
targetLimits: {
|
|
112
|
+
acceptables: ['최우수', '우수']
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: '코멘트',
|
|
119
|
+
description: '특이사항을 기록함.',
|
|
120
|
+
sequence: 4,
|
|
121
|
+
tag: 'comment',
|
|
122
|
+
type: 'string',
|
|
123
|
+
quota: 1,
|
|
124
|
+
active: true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: '첨부파일',
|
|
128
|
+
description: '참조 첨부 파일.',
|
|
129
|
+
sequence: 4,
|
|
130
|
+
tag: 'attachment',
|
|
131
|
+
type: 'file',
|
|
132
|
+
quota: 1,
|
|
133
|
+
active: true
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var dataSample = {
|
|
139
|
+
name: 'Data Sample Name',
|
|
140
|
+
description: 'Data Sample이 어쩌구 저쩌구 그래서 중요합니다. 당연히 그래야죠.',
|
|
141
|
+
useCase: 'CCP',
|
|
142
|
+
data: {
|
|
143
|
+
temp: [1000],
|
|
144
|
+
humid: [20, 23, 21, 26, 27],
|
|
145
|
+
inspection: [true, false, true],
|
|
146
|
+
evaluation: ['최우수', '보통', '우수'],
|
|
147
|
+
comment: '이것은 코멘트입니다.'
|
|
148
|
+
},
|
|
149
|
+
spec: {
|
|
150
|
+
temp: {
|
|
151
|
+
name: '창고 온도',
|
|
152
|
+
description: '창고 온도는 섭씨 0도 이하로 유지되어야 합니다.',
|
|
153
|
+
unit: '℃',
|
|
154
|
+
spec: {
|
|
155
|
+
CCP: {
|
|
156
|
+
criticalLimits: {
|
|
157
|
+
minimum: 100,
|
|
158
|
+
maximum: 200
|
|
159
|
+
},
|
|
160
|
+
targetLimits: {
|
|
161
|
+
minimum: 120,
|
|
162
|
+
maximum: 180
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
humid: {
|
|
168
|
+
name: '창고 습도',
|
|
169
|
+
description: '창고 습도는 30% 이하로 유지되어야 합니다.',
|
|
170
|
+
unit: '%',
|
|
171
|
+
spec: {
|
|
172
|
+
CCP: {
|
|
173
|
+
criticalLimits: {
|
|
174
|
+
minimum: 10,
|
|
175
|
+
maximum: 50
|
|
176
|
+
},
|
|
177
|
+
targetLimits: {
|
|
178
|
+
minimum: 20,
|
|
179
|
+
maximum: 40
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
inspection: {
|
|
185
|
+
name: '육안 검사',
|
|
186
|
+
description: '육안 검사는 포장전 30분 내로 실행되어야 합니다.'
|
|
187
|
+
},
|
|
188
|
+
evaluation: {
|
|
189
|
+
name: '품평',
|
|
190
|
+
description: '품평은 최우수/우수/보통/미달을 포함하여 간단히 평가.',
|
|
191
|
+
spec: {
|
|
192
|
+
CCP: {
|
|
193
|
+
criticalLimits: {
|
|
194
|
+
acceptables: ['최우수', '우수', '보통']
|
|
195
|
+
},
|
|
196
|
+
targetLimits: {
|
|
197
|
+
acceptables: ['최우수', '우수']
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
comment: {
|
|
203
|
+
name: '코멘트',
|
|
204
|
+
description: '특이사항을 기록함.'
|
|
205
|
+
},
|
|
206
|
+
attachment: {
|
|
207
|
+
name: '첨부파일',
|
|
208
|
+
description: '참조 첨부 파일.'
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
collectedAt: Date.now()
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const Template: Story<ArgTypes> = ({}: ArgTypes) =>
|
|
215
|
+
html`
|
|
216
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
217
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
218
|
+
<style>
|
|
219
|
+
body {
|
|
220
|
+
}
|
|
221
|
+
</style>
|
|
222
|
+
|
|
223
|
+
<ox-data-sample-view .dataSample=${dataSample}></ox-data-sample-view>
|
|
224
|
+
`
|
|
225
|
+
|
|
226
|
+
export const Regular = Template.bind({})
|
|
227
|
+
Regular.args = {}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import '@material/mwc-icon'
|
|
2
|
+
import '@operato/property-editor/ox-property-editor-checkbox.js'
|
|
3
|
+
import '@operato/property-editor/ox-property-editor-number.js'
|
|
4
|
+
import '@operato/property-editor/ox-property-editor-string.js'
|
|
5
|
+
import '@operato/property-editor/ox-property-editor-options.js'
|
|
6
|
+
import '@operato/property-editor/ox-properties-dynamic-view.js'
|
|
7
|
+
import '@operato/data-grist/ox-filters-form.js'
|
|
8
|
+
import '@operato/data-grist/ox-sorters-control.js'
|
|
9
|
+
import '@operato/grist-editor' /* regiester grist editors */
|
|
10
|
+
/* set grist-editors */
|
|
11
|
+
import '../src/grist-editor/index.js'
|
|
12
|
+
import '../src/usecase/ccp' /* register usecase CCP */
|
|
13
|
+
import '../src/usecase/qc' /* register usecase QC */
|
|
14
|
+
|
|
15
|
+
import { css, html, LitElement, TemplateResult } from 'lit'
|
|
16
|
+
import { state } from 'lit/decorators.js'
|
|
17
|
+
|
|
18
|
+
import { FetchOption, GristRecord } from '@operato/data-grist'
|
|
19
|
+
// import { OxGristEditorCrontab } from '@operato/grist-editor/ox-grist-editor-crontab.js'
|
|
20
|
+
// import { OxGristEditorParameters } from '@operato/grist-editor/ox-grist-editor-parameters.js'
|
|
21
|
+
// import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
|
|
22
|
+
// // import { OxGristRendererCrontab } from '@operato/grist-editor/ox-grist-renderer-crontab.js'
|
|
23
|
+
// import { OxGristEditorValueMap } from '@operato/grist-editor/ox-grist-editor-value-map.js'
|
|
24
|
+
import { i18next } from '@operato/i18n'
|
|
25
|
+
import { OxPropertyEditor } from '@operato/property-editor'
|
|
26
|
+
import { CommonGristStyles } from '@operato/styles'
|
|
27
|
+
|
|
28
|
+
OxPropertyEditor.register({
|
|
29
|
+
number: 'ox-property-editor-number',
|
|
30
|
+
string: 'ox-property-editor-string',
|
|
31
|
+
boolean: 'ox-property-editor-checkbox',
|
|
32
|
+
options: 'ox-property-editor-options'
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// registerEditor('parameters', OxGristEditorParameters)
|
|
36
|
+
// registerEditor('crontab', OxGristEditorCrontab)
|
|
37
|
+
// registerEditor('value-map', OxGristEditorValueMap)
|
|
38
|
+
// registerEditor('partition-keys', OxGristEditorPartitionKeys)
|
|
39
|
+
|
|
40
|
+
const fetchHandler = async ({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) => {
|
|
41
|
+
var total = 10
|
|
42
|
+
var start = (page - 1) * limit
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
total,
|
|
46
|
+
records: Array(limit * page > total ? total % limit : limit)
|
|
47
|
+
.fill('')
|
|
48
|
+
.map((item, idx) => {
|
|
49
|
+
return {
|
|
50
|
+
id: idx,
|
|
51
|
+
name: `name-${start + idx + 1}`,
|
|
52
|
+
description: `description-${start + idx + 1}`,
|
|
53
|
+
sequence: idx + 1,
|
|
54
|
+
active: true,
|
|
55
|
+
tag: `tag-${idx + 1}`,
|
|
56
|
+
type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',
|
|
57
|
+
spec: {
|
|
58
|
+
ccp: {
|
|
59
|
+
criticalLimits: 100,
|
|
60
|
+
targetLimits: 200
|
|
61
|
+
},
|
|
62
|
+
qc: {
|
|
63
|
+
criticalLimits: 300,
|
|
64
|
+
targetLimits: true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
options:
|
|
68
|
+
idx % 2 === 0
|
|
69
|
+
? {
|
|
70
|
+
options: [
|
|
71
|
+
{
|
|
72
|
+
text: 'A',
|
|
73
|
+
value: 'a'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
text: 'B',
|
|
77
|
+
value: 'b'
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
: undefined,
|
|
82
|
+
schedule: '* * * * * *',
|
|
83
|
+
keyvalue: {},
|
|
84
|
+
createdAt: Date.now(),
|
|
85
|
+
updatedAt: Date.now()
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
class GristDemo extends LitElement {
|
|
92
|
+
static styles = [
|
|
93
|
+
CommonGristStyles,
|
|
94
|
+
css`
|
|
95
|
+
:host {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#tailer {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
margin: 0 var(--margin-default);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
#tailer a {
|
|
107
|
+
padding: 0 var(--padding-default) 0 var(--padding-default);
|
|
108
|
+
margin: 0 var(--margin-narrow);
|
|
109
|
+
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
110
|
+
font-size: var(--fontsize-default);
|
|
111
|
+
color: var(--primary-color);
|
|
112
|
+
}
|
|
113
|
+
`
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
@state() mode: String = 'CARD'
|
|
117
|
+
|
|
118
|
+
get grist() {
|
|
119
|
+
return this.renderRoot.querySelector('ox-grist')
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
config: any = {
|
|
123
|
+
list: { fields: ['name', 'description', 'active'] },
|
|
124
|
+
columns: [
|
|
125
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
126
|
+
{
|
|
127
|
+
type: 'gutter',
|
|
128
|
+
gutterName: 'button',
|
|
129
|
+
icon: 'add',
|
|
130
|
+
handlers: {
|
|
131
|
+
click: 'record-copy'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
135
|
+
{
|
|
136
|
+
type: 'gutter',
|
|
137
|
+
gutterName: 'button',
|
|
138
|
+
icon: 'arrow_upward',
|
|
139
|
+
handlers: {
|
|
140
|
+
click: 'move-up'
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: 'gutter',
|
|
145
|
+
gutterName: 'button',
|
|
146
|
+
icon: 'arrow_downward',
|
|
147
|
+
handlers: {
|
|
148
|
+
click: 'move-down'
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: 'number',
|
|
153
|
+
name: 'sequence',
|
|
154
|
+
hidden: true
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'string',
|
|
158
|
+
name: 'id',
|
|
159
|
+
hidden: true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'string',
|
|
163
|
+
name: 'name',
|
|
164
|
+
header: i18next.t('field.name'),
|
|
165
|
+
record: {
|
|
166
|
+
editable: true
|
|
167
|
+
},
|
|
168
|
+
width: 140
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: 'string',
|
|
172
|
+
name: 'description',
|
|
173
|
+
header: i18next.t('field.description'),
|
|
174
|
+
record: {
|
|
175
|
+
editable: true
|
|
176
|
+
},
|
|
177
|
+
width: 180
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'checkbox',
|
|
181
|
+
name: 'active',
|
|
182
|
+
label: true,
|
|
183
|
+
header: i18next.t('field.active'),
|
|
184
|
+
record: {
|
|
185
|
+
editable: true
|
|
186
|
+
},
|
|
187
|
+
sortable: true,
|
|
188
|
+
width: 60
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: 'string',
|
|
192
|
+
name: 'tag',
|
|
193
|
+
header: i18next.t('field.tag'),
|
|
194
|
+
record: {
|
|
195
|
+
editable: true
|
|
196
|
+
},
|
|
197
|
+
width: 180
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
type: 'select',
|
|
201
|
+
name: 'type',
|
|
202
|
+
header: i18next.t('field.type'),
|
|
203
|
+
record: {
|
|
204
|
+
options: ['', 'number', 'text', 'select', 'boolean', 'file'],
|
|
205
|
+
editable: true
|
|
206
|
+
},
|
|
207
|
+
width: 120
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
type: 'crontab',
|
|
211
|
+
name: 'schedule',
|
|
212
|
+
header: i18next.t('field.schedule'),
|
|
213
|
+
record: {
|
|
214
|
+
editable: true
|
|
215
|
+
},
|
|
216
|
+
width: 120
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: 'partition-keys',
|
|
220
|
+
name: 'keyvalue',
|
|
221
|
+
header: i18next.t('field.keyvalue'),
|
|
222
|
+
record: {
|
|
223
|
+
editable: true,
|
|
224
|
+
options: {
|
|
225
|
+
objectified: true,
|
|
226
|
+
valuetype: 'string'
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
width: 120
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
type: 'parameters',
|
|
233
|
+
name: 'options',
|
|
234
|
+
header: i18next.t('field.options'),
|
|
235
|
+
record: {
|
|
236
|
+
editable: true,
|
|
237
|
+
renderer: (value: any) => {
|
|
238
|
+
return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : ''
|
|
239
|
+
},
|
|
240
|
+
options: async (value: any, column: any, record: GristRecord, row: GristRecord, field: any) => {
|
|
241
|
+
return {
|
|
242
|
+
name: record.type,
|
|
243
|
+
help: '',
|
|
244
|
+
spec:
|
|
245
|
+
record.type === 'select'
|
|
246
|
+
? [
|
|
247
|
+
{
|
|
248
|
+
type: 'options',
|
|
249
|
+
name: 'options',
|
|
250
|
+
label: 'options'
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
: [],
|
|
254
|
+
context: this.grist,
|
|
255
|
+
objectified: true /* tell parameters editor not to need to parse */
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
width: 120
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: 'string',
|
|
263
|
+
name: 'unit',
|
|
264
|
+
header: i18next.t('field.unit'),
|
|
265
|
+
record: {
|
|
266
|
+
editable: true
|
|
267
|
+
},
|
|
268
|
+
width: 120
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
type: 'number',
|
|
272
|
+
name: 'quota',
|
|
273
|
+
header: i18next.t('field.quota'),
|
|
274
|
+
record: {
|
|
275
|
+
editable: true
|
|
276
|
+
},
|
|
277
|
+
width: 60
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: 'data-item-spec',
|
|
281
|
+
name: 'spec',
|
|
282
|
+
header: i18next.t('field.spec'),
|
|
283
|
+
record: {
|
|
284
|
+
editable: true,
|
|
285
|
+
options: {
|
|
286
|
+
name,
|
|
287
|
+
objectified: true
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
width: 200
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
rows: {
|
|
294
|
+
selectable: {
|
|
295
|
+
multiple: true
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
pagination: {
|
|
299
|
+
infinite: true
|
|
300
|
+
},
|
|
301
|
+
sorters: [
|
|
302
|
+
{
|
|
303
|
+
name: 'sequence'
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
render() {
|
|
309
|
+
const mode = this.mode || 'CARD'
|
|
310
|
+
|
|
311
|
+
return html`
|
|
312
|
+
<ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>
|
|
313
|
+
<div id="filters" slot="headroom">
|
|
314
|
+
<ox-filters-form @filters-change=${(e: CustomEvent) => console.log('changed', e.detail)}></ox-filters-form>
|
|
315
|
+
</div>
|
|
316
|
+
|
|
317
|
+
<div slot="headroom" id="headroom">
|
|
318
|
+
<div id="modes">
|
|
319
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
|
|
320
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
|
|
321
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</ox-grist>
|
|
325
|
+
`
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
customElements.define('ox-data-items', GristDemo)
|
|
330
|
+
|
|
331
|
+
export default {
|
|
332
|
+
title: 'ox-grist-editor-data-item-spec',
|
|
333
|
+
component: 'ox-grist-editor-data-item-spec',
|
|
334
|
+
argTypes: {}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface Story<T> {
|
|
338
|
+
(args: T): TemplateResult
|
|
339
|
+
args?: Partial<T>
|
|
340
|
+
argTypes?: Record<string, unknown>
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
interface ArgTypes {}
|
|
344
|
+
|
|
345
|
+
const Template: Story<ArgTypes> = ({}: ArgTypes) =>
|
|
346
|
+
html`
|
|
347
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
348
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
349
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
|
350
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
|
351
|
+
|
|
352
|
+
<style>
|
|
353
|
+
[slot='headroom'] {
|
|
354
|
+
display: flex;
|
|
355
|
+
flex-direction: row;
|
|
356
|
+
align-items: center;
|
|
357
|
+
padding: var(--padding-default) var(--padding-wide);
|
|
358
|
+
border-top: 2px solid rgba(0, 0, 0, 0.2);
|
|
359
|
+
background-color: var(--theme-white-color);
|
|
360
|
+
box-shadow: var(--box-shadow);
|
|
361
|
+
|
|
362
|
+
--mdc-icon-size: 24px;
|
|
363
|
+
}
|
|
364
|
+
#sorters mwc-icon,
|
|
365
|
+
#modes mwc-icon {
|
|
366
|
+
--mdc-icon-size: 18px;
|
|
367
|
+
}
|
|
368
|
+
#sorters {
|
|
369
|
+
margin-left: auto;
|
|
370
|
+
margin-right: var(--margin-default);
|
|
371
|
+
padding-left: var(--padding-narrow);
|
|
372
|
+
border-bottom: var(--border-dark-color);
|
|
373
|
+
position: relative;
|
|
374
|
+
color: var(--secondary-color);
|
|
375
|
+
font-size: var(--fontsize-default);
|
|
376
|
+
user-select: none;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
#sorters > * {
|
|
380
|
+
padding: var(--padding-narrow);
|
|
381
|
+
vertical-align: middle;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
#filters {
|
|
385
|
+
display: flex;
|
|
386
|
+
justify-content: center;
|
|
387
|
+
align-items: center;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
#filters * {
|
|
391
|
+
margin-right: var(--margin-default);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
@media only screen and (max-width: 460px) {
|
|
395
|
+
#filters {
|
|
396
|
+
flex-direction: column;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
#modes {
|
|
400
|
+
display: none;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
</style>
|
|
404
|
+
|
|
405
|
+
<ox-data-items mode="LIST"></ox-data-items>
|
|
406
|
+
`
|
|
407
|
+
|
|
408
|
+
export const Regular = Template.bind({})
|
|
409
|
+
Regular.args = {}
|
package/translations/en.json
CHANGED
|
@@ -3,24 +3,28 @@
|
|
|
3
3
|
"button.reviewed": "reviewed",
|
|
4
4
|
"field.appliance": "appliance",
|
|
5
5
|
"field.collected_at": "collected at",
|
|
6
|
+
"field.collected-at": "collected at",
|
|
7
|
+
"field.corrected-at": "corrected at",
|
|
8
|
+
"field.corrective action": "corrective action",
|
|
6
9
|
"field.corrective-action": "corrective action",
|
|
7
10
|
"field.corrector": "corrector",
|
|
8
|
-
"field.
|
|
9
|
-
"field.data": "data",
|
|
11
|
+
"field.critical control point": "critical control point",
|
|
10
12
|
"field.data-sample": "data sample",
|
|
11
13
|
"field.data-set": "data set",
|
|
14
|
+
"field.data": "data",
|
|
12
15
|
"field.device-id": "device id",
|
|
13
16
|
"field.entry-role": "entry role",
|
|
14
17
|
"field.entry-type": "entry type",
|
|
15
18
|
"field.entry-view": "entry view",
|
|
16
19
|
"field.hidden": "hidden",
|
|
20
|
+
"field.item": "item",
|
|
17
21
|
"field.latest-collected-at": "latest collected at",
|
|
18
22
|
"field.monitor-type": "monitor type",
|
|
19
23
|
"field.monitor-view": "monitor view",
|
|
20
24
|
"field.netmask": "network mask",
|
|
21
25
|
"field.next-schedule": "next schedule",
|
|
22
|
-
"field.oos": "out of critical limit",
|
|
23
26
|
"field.ooc": "out of control limit",
|
|
27
|
+
"field.oos": "out of critical limit",
|
|
24
28
|
"field.options": "options",
|
|
25
29
|
"field.partition-keys": "partition keys",
|
|
26
30
|
"field.prev-schedule": "previous schedule",
|
|
@@ -38,20 +42,34 @@
|
|
|
38
42
|
"field.use-case": "use case",
|
|
39
43
|
"field.work-date": "work date",
|
|
40
44
|
"field.work-shift": "work shift",
|
|
45
|
+
"label.acceptables": "acceptables",
|
|
46
|
+
"label.critical-limits": "critical limits",
|
|
47
|
+
"label.maximum value": "maximum value",
|
|
48
|
+
"label.minimum value": "minimum value",
|
|
49
|
+
"label.pass-limits": "pass limits",
|
|
50
|
+
"label.target-limits": "target limits",
|
|
41
51
|
"text.automatically collected": "automatically collected",
|
|
42
|
-
"text.
|
|
52
|
+
"text.control limit": "control limit",
|
|
43
53
|
"text.data ooc updated successfully": "a data ooc updated successfully",
|
|
54
|
+
"text.data sample created successfully": "a data sample created successfully",
|
|
44
55
|
"text.manually collected": "manually collected",
|
|
45
|
-
"
|
|
56
|
+
"text.maximum value": "maximum value",
|
|
57
|
+
"text.measurement": "measurement",
|
|
58
|
+
"text.minimum value": "minimum value",
|
|
59
|
+
"text.observation": "observation",
|
|
60
|
+
"text.operating limit": "operating limit",
|
|
61
|
+
"text.target limit": "target limit",
|
|
46
62
|
"title.data-entry list": "data entry list",
|
|
63
|
+
"title.data-entry-form": "data entry form",
|
|
47
64
|
"title.data-item list": "data item list",
|
|
48
65
|
"title.data-monitor-view": "data monitor view",
|
|
49
|
-
"title.data-report-view": "data report view",
|
|
50
66
|
"title.data-ooc list": "data OOC list",
|
|
51
67
|
"title.data-ooc view": "data OOC view",
|
|
68
|
+
"title.data-report-view": "data report view",
|
|
52
69
|
"title.data-sample list": "data sample list",
|
|
53
70
|
"title.data-sample view": "data sample view",
|
|
54
71
|
"title.data-sensor list": "data sensor list",
|
|
55
72
|
"title.data-set list": "data set list",
|
|
56
|
-
"title.edit code": "edit code"
|
|
57
|
-
|
|
73
|
+
"title.edit code": "edit code",
|
|
74
|
+
"title.history": "history"
|
|
75
|
+
}
|