@operato/dataset 7.1.30 → 7.1.32

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +12 -12
  4. package/.editorconfig +0 -29
  5. package/.storybook/main.js +0 -3
  6. package/.storybook/preview.js +0 -52
  7. package/.storybook/server.mjs +0 -8
  8. package/demo/favicon.ico +0 -0
  9. package/demo/index.html +0 -349
  10. package/demo/ox-data-ooc-brief-view-test.html +0 -349
  11. package/src/grist-editor/index.ts +0 -10
  12. package/src/grist-editor/ox-grist-editor-data-item-spec.ts +0 -93
  13. package/src/grist-editor/ox-popup-data-item-spec.ts +0 -93
  14. package/src/index.ts +0 -2
  15. package/src/ox-data-entry-form.ts +0 -303
  16. package/src/ox-data-entry-subgroup-form.ts +0 -157
  17. package/src/ox-data-entry-subgroup-view.ts +0 -221
  18. package/src/ox-data-entry-view.ts +0 -241
  19. package/src/ox-data-item-spec.ts +0 -131
  20. package/src/ox-data-ooc-badge.ts +0 -73
  21. package/src/ox-data-ooc-brief-view.ts +0 -43
  22. package/src/ox-data-ooc-correction-part.ts +0 -107
  23. package/src/ox-data-ooc-history.ts +0 -74
  24. package/src/ox-data-ooc-view.ts +0 -51
  25. package/src/ox-data-sample-subgroup-view.ts +0 -210
  26. package/src/ox-data-sample-view.ts +0 -271
  27. package/src/ox-data-summary-view.ts +0 -198
  28. package/src/types.ts +0 -178
  29. package/src/usecase/ccp/index.ts +0 -10
  30. package/src/usecase/ccp/ox-data-use-case-ccp.ts +0 -147
  31. package/src/usecase/ccp/ox-input-ccp-limits.ts +0 -184
  32. package/src/usecase/ccp/ox-property-editor-ccp-limits.ts +0 -23
  33. package/src/usecase/ox-data-use-case.ts +0 -178
  34. package/src/usecase/qc/index.ts +0 -10
  35. package/src/usecase/qc/ox-data-use-case-qc.ts +0 -76
  36. package/src/usecase/qc/ox-input-qc-limits.ts +0 -183
  37. package/src/usecase/qc/ox-property-editor-qc-limits.ts +0 -23
  38. package/src/usecase/spc/index.ts +0 -10
  39. package/src/usecase/spc/ox-data-use-case-spc.ts +0 -147
  40. package/src/usecase/spc/ox-input-spc-limits.ts +0 -184
  41. package/src/usecase/spc/ox-property-editor-spc-limits.ts +0 -23
  42. package/stories/ox-data-entry-form.stories.ts +0 -253
  43. package/stories/ox-data-item-spec.stories.ts +0 -257
  44. package/stories/ox-data-ooc-brief-view.stories.ts +0 -333
  45. package/stories/ox-data-ooc-view.stories.ts +0 -327
  46. package/stories/ox-data-sample-view.stories.ts +0 -313
  47. package/stories/ox-grist-editor-data-item-spec.stories.ts +0 -412
  48. package/tsconfig.json +0 -24
  49. package/web-dev-server.config.mjs +0 -27
  50. package/web-test-runner.config.mjs +0 -41
@@ -1,349 +0,0 @@
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, maximum-scale=1, user-scalable=no" />
6
- <style>
7
- body {
8
- /* box-sizing: border-box; */
9
- margin: 0;
10
- padding: 0;
11
- overflow: hidden;
12
-
13
- /* This is a font-stack that tries to use the system-default sans-serifs first */
14
- font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
15
- line-height: 1.5;
16
- -webkit-font-smoothing: antialiased;
17
- }
18
-
19
- #app {
20
- width: 100vw;
21
- height: 100dvh;
22
- overflow: auto;
23
-
24
- display: flex;
25
- flex-direction: column;
26
- }
27
-
28
- #demo {
29
- flex: 1;
30
-
31
- display: flex;
32
- flex-direction: column;
33
- }
34
-
35
- @media print {
36
- #app {
37
- height: unset;
38
- }
39
- }
40
- </style>
41
- <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
42
- <link
43
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
44
- rel="stylesheet"
45
- />
46
- <link
47
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
48
- rel="stylesheet"
49
- />
50
- <link
51
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
52
- rel="stylesheet"
53
- />
54
-
55
- <link href="/themes/app-theme.css" rel="stylesheet" />
56
- <link href="/themes/oops-theme.css" rel="stylesheet" />
57
- </head>
58
-
59
- <body>
60
- <script type="module">
61
- import { LitElement, html, css, render } from 'lit'
62
- import '../dist/src/index.js'
63
- import '../dist/src/usecase/ccp/index.js'
64
- import '../dist/src/ox-data-ooc-brief-view.js'
65
-
66
- const dataSet = {
67
- name: 'sample',
68
- description: 'sample description',
69
- type: 'manual',
70
- useCase: 'CCP',
71
- dataItems: [
72
- {
73
- name: '창고 온도',
74
- description: '창고 온도는 섭씨 0도 이하로 유지되어야 합니다.',
75
- sequence: 1,
76
- tag: 'temp',
77
- group: '측정데이타',
78
- type: 'number',
79
- quota: 1,
80
- active: true,
81
- unit: '℃',
82
- spec: {
83
- CCP: {
84
- criticalLimits: {
85
- minimum: 100,
86
- maximum: 200
87
- },
88
- targetLimits: {
89
- minimum: 120,
90
- maximum: 180
91
- }
92
- }
93
- }
94
- },
95
- {
96
- name: '창고 습도',
97
- description: '창고 습도는 30% 이하로 유지되어야 합니다.',
98
- sequence: 2,
99
- tag: 'humid',
100
- group: '측정데이타',
101
- type: 'number',
102
- quota: 5,
103
- active: true,
104
- unit: '%',
105
- spec: {
106
- CCP: {
107
- criticalLimits: {
108
- minimum: 10,
109
- maximum: 50
110
- },
111
- targetLimits: {
112
- minimum: 20,
113
- maximum: 40
114
- }
115
- }
116
- }
117
- },
118
- {
119
- name: '육안 검사',
120
- description: '육안 검사는 포장전 30분 내로 실행되어야 합니다.',
121
- sequence: 3,
122
- tag: 'inspection',
123
- group: '측정데이타',
124
- type: 'boolean',
125
- quota: 3,
126
- active: true,
127
- spec: {
128
- CCP: {
129
- criticalLimits: {
130
- acceptables: true
131
- },
132
- targetLimits: {
133
- acceptables: true
134
- }
135
- }
136
- }
137
- },
138
- {
139
- name: '품평',
140
- description: '품평은 최우수/우수/보통/미달을 포함하여 간단히 평가.',
141
- sequence: 4,
142
- tag: 'evaluation',
143
- group: '측정데이타',
144
- type: 'select',
145
- options: {
146
- options: [
147
- { text: '최우수', value: '최우수' },
148
- { text: '우수', value: '우수' },
149
- { text: '보통', value: '보통' },
150
- { text: '미달', value: '미달' }
151
- ]
152
- },
153
- quota: 3,
154
- active: true,
155
- spec: {
156
- CCP: {
157
- criticalLimits: {
158
- acceptables: ['최우수', '우수', '보통']
159
- },
160
- targetLimits: {
161
- acceptables: ['최우수', '우수']
162
- }
163
- }
164
- }
165
- },
166
- {
167
- name: '코멘트',
168
- description: '특이사항을 기록함.',
169
- sequence: 4,
170
- tag: 'comment',
171
- type: 'string',
172
- quota: 1,
173
- active: true
174
- },
175
- {
176
- name: '첨부파일',
177
- description: '참조 첨부 파일.',
178
- sequence: 4,
179
- tag: 'attachment',
180
- type: 'file',
181
- quota: 1,
182
- active: true
183
- }
184
- ]
185
- }
186
-
187
- var dataOoc = {
188
- name: 'Data Sample Name',
189
- description: 'Data Sample이 어쩌구 저쩌구 그래서 중요합니다. 당연히 그래야죠.',
190
- state: 'CORRECTED',
191
- useCase: 'CCP',
192
- judgment: {
193
- temp: {
194
- ooc: true,
195
- oos: false
196
- },
197
- humid: {
198
- ooc: false,
199
- oos: true
200
- }
201
- },
202
- data: {
203
- temp: [1000, 1023, 1027, 997, 981],
204
- humid: [20, 23, 21, 26, 27],
205
- inspection: [true, false, true, false, false],
206
- evaluation: ['최우수', '보통', '우수', '보통', '최우수'],
207
- comment: '이것은 코멘트입니다.'
208
- },
209
- dataItems: dataSet.dataItems,
210
- spec: {
211
- temp: {
212
- name: '창고 온도',
213
- description: '창고 온도는 섭씨 0도 이하로 유지되어야 합니다.',
214
- spec: {
215
- CCP: {
216
- criticalLimits: {
217
- minimum: 100,
218
- maximum: 200
219
- },
220
- targetLimits: {
221
- minimum: 120,
222
- maximum: 180
223
- }
224
- }
225
- }
226
- },
227
- humid: {
228
- name: '창고 습도',
229
- description: '창고 습도는 30% 이하로 유지되어야 합니다.',
230
- spec: {
231
- CCP: {
232
- criticalLimits: {
233
- minimum: 10,
234
- maximum: 50
235
- },
236
- targetLimits: {
237
- minimum: 20,
238
- maximum: 40
239
- }
240
- }
241
- }
242
- },
243
- inspection: {
244
- name: '육안 검사',
245
- description: '육안 검사는 포장전 30분 내로 실행되어야 합니다.'
246
- },
247
- evaluation: {
248
- name: '품평',
249
- description: '품평은 최우수/우수/보통/미달을 포함하여 간단히 평가.',
250
- spec: {
251
- CCP: {
252
- criticalLimits: {
253
- acceptables: ['최우수', '우수', '보통']
254
- },
255
- targetLimits: {
256
- acceptables: ['최우수', '우수']
257
- }
258
- }
259
- }
260
- },
261
- comment: {
262
- name: '코멘트',
263
- description: '특이사항을 기록함.'
264
- },
265
- attachment: {
266
- name: '첨부파일',
267
- description: '참조 첨부 파일.'
268
- }
269
- },
270
- collectedAt: Date.now(),
271
- reviewer: {
272
- name: '남상혁'
273
- },
274
- reviewedAt: Date.now(),
275
- correctiveInstruction: '바지틀고서 만나오리오. 쿠투추파',
276
- corrector: {
277
- name: '남상혁'
278
- },
279
- correctedAt: Date.now(),
280
- correctiveAction: '바지틀고서 만나오리오. 쿠투추파',
281
- history: [
282
- {
283
- user: {
284
- id: 0,
285
- name: 'shnam'
286
- },
287
- state: 'ISSUED',
288
- timestamp: Date.now()
289
- },
290
- {
291
- user: {
292
- id: 0,
293
- name: 'shnam'
294
- },
295
- state: 'REVIEWED',
296
- comment: '금일 생산한 제품은 전량 폐기합니다',
297
- timestamp: Date.now()
298
- },
299
- {
300
- user: {
301
- id: 0,
302
- name: 'shnam'
303
- },
304
- state: 'CORRECTED',
305
- timestamp: Date.now()
306
- }
307
- ]
308
- }
309
-
310
- class OxDataOocViewDemo extends LitElement {
311
- static styles = [
312
- css`
313
- :host {
314
- display: block;
315
- }
316
-
317
- ox-data-ooc-brief-view {
318
- page-break-after: always;
319
- }
320
- `
321
- ]
322
-
323
- render() {
324
- return Array(10)
325
- .fill(null)
326
- .map(
327
- () => html`
328
- <ox-data-ooc-brief-view
329
- .dataSet=${dataSet}
330
- .dataOoc=${dataOoc}
331
- @change=${e => console.log(e.detail)}
332
- ></ox-data-ooc-brief-view>
333
- `
334
- )
335
- }
336
- }
337
-
338
- customElements.define('ox-data-ooc-brief-view-demo', OxDataOocViewDemo)
339
-
340
- setTimeout(() => {
341
- render(html` <ox-data-ooc-brief-view-demo></ox-data-ooc-brief-view-demo> `, document.querySelector('#demo'))
342
- })
343
- </script>
344
-
345
- <div id="app">
346
- <div id="demo"></div>
347
- </div>
348
- </body>
349
- </html>
@@ -1,10 +0,0 @@
1
- import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
2
-
3
- import { OxGristEditorDataItemSpec } from './ox-grist-editor-data-item-spec'
4
-
5
- /* register grist renderer/editor for id */
6
- registerEditor('data-item-spec', OxGristEditorDataItemSpec)
7
-
8
- registerRenderer('data-item-spec', OxGristRendererJson5)
9
-
10
- export * from './ox-grist-editor-data-item-spec'
@@ -1,93 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import './ox-popup-data-item-spec.js'
6
-
7
- import { html } from 'lit'
8
- import { customElement } from 'lit/decorators.js'
9
- import { cloneDeep } from 'lodash-es'
10
-
11
- import { OxGristEditor } from '@operato/data-grist'
12
- import { i18next } from '@operato/i18n'
13
- import { openPopup, PopupHandle } from '@operato/popup'
14
-
15
- @customElement('ox-grist-editor-data-item-spec')
16
- export class OxGristEditorDataItemSpec extends OxGristEditor {
17
- private popup?: PopupHandle
18
-
19
- get editorTemplate() {
20
- const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value
21
- return html`<div tabindex="0">${value || ''}</div> `
22
- }
23
-
24
- _onclick(e: Event): void {
25
- e.stopPropagation()
26
- this.openSelector()
27
- }
28
-
29
- _onkeydown(e: KeyboardEvent): void {
30
- const key = e.key
31
- if (key == 'Enter') {
32
- e.stopPropagation()
33
- this.openSelector()
34
- }
35
- }
36
-
37
- async openSelector() {
38
- if (this.popup) {
39
- delete this.popup
40
- }
41
-
42
- var { options } = this.column.record
43
-
44
- if (typeof options === 'function') {
45
- options = await options.call(this, this.value, this.column, this.record, this.row, this.field)
46
- }
47
-
48
- const { name, help, objectified = false } = options
49
-
50
- const confirmCallback = (newval: any) => {
51
- this.dispatchEvent(
52
- new CustomEvent('field-change', {
53
- bubbles: true,
54
- composed: true,
55
- detail: {
56
- before: this.value,
57
- after: !objectified ? JSON.stringify(newval) : newval,
58
- record: this.record,
59
- column: this.column,
60
- row: this.row
61
- }
62
- })
63
- )
64
- }
65
-
66
- try {
67
- var value: any =
68
- !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {})
69
- } catch (e) {
70
- var value: any = {}
71
- }
72
-
73
- /*
74
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
75
- layout의 구성에 변화가 발생하면, 다시 render된다.
76
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
77
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
78
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
79
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
80
- */
81
- var template = html`
82
- <ox-popup-data-item-spec .value=${value} .dataItem=${this.record} .confirmCallback=${confirmCallback}>
83
- </ox-popup-data-item-spec>
84
- `
85
-
86
- this.popup = openPopup(template, {
87
- backdrop: true,
88
- size: 'large',
89
- title: `${name?.toUpperCase() || ''} ${i18next.t('field.spec')}`,
90
- help
91
- })
92
- }
93
- }
@@ -1,93 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '../ox-data-item-spec.js'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
-
7
- import { i18next } from '@operato/i18n'
8
- import { closePopup } from '@operato/popup'
9
- import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
10
-
11
- import { DataItem } from '../types.js'
12
-
13
- @customElement('ox-popup-data-item-spec')
14
- export class OxPopupDataItemSpec extends LitElement {
15
- static styles = [
16
- CommonHeaderStyles,
17
- ScrollbarStyles,
18
- css`
19
- :host {
20
- display: flex;
21
- flex-direction: column;
22
-
23
- background-color: var(--md-sys-color-surface);
24
-
25
- width: var(--overlay-center-normal-width, 50%);
26
- height: var(--overlay-center-normal-height, 50%);
27
- }
28
-
29
- ox-data-item-spec {
30
- flex: 1;
31
- overflow-y: auto;
32
- padding: var(--spacing-large);
33
- }
34
-
35
- span {
36
- flex: 1;
37
-
38
- display: flex;
39
- align-items: center;
40
- justify-content: center;
41
-
42
- color: var(--md-sys-color-on-primary-container);
43
- }
44
- `
45
- ]
46
-
47
- @property({ type: Object }) value: any
48
- @property({ type: Object }) dataItem?: DataItem
49
- @property({ type: Object }) confirmCallback!: (newval: any) => void
50
-
51
- render() {
52
- var dataItem = this.dataItem || {}
53
-
54
- return html`
55
- <ox-data-item-spec .value=${this.value} .dataItem=${dataItem as any} @change=${this.onChange.bind(this)}>
56
- </ox-data-item-spec>
57
-
58
- <div class="footer">
59
- <div filler></div>
60
- <button @click=${this.onCancel.bind(this)} danger>
61
- <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
62
- </button>
63
- <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
64
- </div>
65
- `
66
- }
67
-
68
- private onChange(e: CustomEvent) {
69
- e.stopPropagation()
70
-
71
- /*
72
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
73
- layout의 구성에 변화가 발생하면, 다시 render된다.
74
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
75
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
76
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
77
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
78
- (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
79
- =>
80
- 이런 이유로, Object.assign(...)을 사용하였다.
81
- */
82
- this.value = e.detail
83
- }
84
-
85
- private onCancel(e: Event) {
86
- closePopup(this)
87
- }
88
-
89
- private onConfirm(e: Event) {
90
- this.confirmCallback && this.confirmCallback(this.value)
91
- closePopup(this)
92
- }
93
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './types.js'
2
- export * from './usecase/ox-data-use-case.js'