@operato/dataset 2.0.0-alpha.11 → 2.0.0-alpha.110
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 +597 -0
- package/demo/favicon.ico +0 -0
- package/demo/index.html +349 -0
- package/demo/ox-data-ooc-brief-view-test.html +349 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.d.ts +1 -1
- package/dist/src/grist-editor/ox-popup-data-item-spec.d.ts +2 -1
- package/dist/src/grist-editor/ox-popup-data-item-spec.js +7 -8
- package/dist/src/grist-editor/ox-popup-data-item-spec.js.map +1 -1
- package/dist/src/ox-data-entry-form.js +49 -37
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-entry-subgroup-form.d.ts +1 -1
- package/dist/src/ox-data-entry-subgroup-form.js +2 -0
- package/dist/src/ox-data-entry-subgroup-form.js.map +1 -1
- package/dist/src/ox-data-entry-view.d.ts +3 -3
- package/dist/src/ox-data-entry-view.js +17 -7
- package/dist/src/ox-data-entry-view.js.map +1 -1
- package/dist/src/ox-data-item-spec.d.ts +1 -1
- package/dist/src/ox-data-item-spec.js +7 -7
- package/dist/src/ox-data-item-spec.js.map +1 -1
- package/dist/src/ox-data-ooc-badge.d.ts +9 -0
- package/dist/src/ox-data-ooc-badge.js +67 -0
- package/dist/src/ox-data-ooc-badge.js.map +1 -0
- package/dist/src/ox-data-ooc-brief-view.d.ts +4 -2
- package/dist/src/ox-data-ooc-brief-view.js +9 -111
- package/dist/src/ox-data-ooc-brief-view.js.map +1 -1
- package/dist/src/ox-data-ooc-correction-part.d.ts +9 -0
- package/dist/src/ox-data-ooc-correction-part.js +99 -0
- package/dist/src/ox-data-ooc-correction-part.js.map +1 -0
- package/dist/src/ox-data-ooc-history.d.ts +10 -0
- package/dist/src/ox-data-ooc-history.js +72 -0
- package/dist/src/ox-data-ooc-history.js.map +1 -0
- package/dist/src/ox-data-ooc-view.d.ts +3 -2
- package/dist/src/ox-data-ooc-view.js +7 -90
- package/dist/src/ox-data-ooc-view.js.map +1 -1
- package/dist/src/ox-data-sample-subgroup-view.d.ts +1 -1
- package/dist/src/ox-data-sample-subgroup-view.js +9 -9
- package/dist/src/ox-data-sample-subgroup-view.js.map +1 -1
- package/dist/src/ox-data-sample-view.d.ts +1 -1
- package/dist/src/ox-data-sample-view.js +52 -35
- package/dist/src/ox-data-sample-view.js.map +1 -1
- package/dist/src/ox-data-summary-view.d.ts +1 -1
- package/dist/src/ox-data-summary-view.js +10 -4
- package/dist/src/ox-data-summary-view.js.map +1 -1
- package/dist/src/types.d.ts +57 -9
- package/dist/src/types.js.map +1 -1
- package/dist/src/usecase/ccp/ox-input-ccp-limits.d.ts +1 -1
- package/dist/src/usecase/qc/ox-input-qc-limits.d.ts +1 -1
- package/dist/src/usecase/spc/index.d.ts +1 -0
- package/dist/src/usecase/spc/index.js +8 -0
- package/dist/src/usecase/spc/index.js.map +1 -0
- package/dist/src/usecase/spc/ox-data-use-case-spc.d.ts +7 -0
- package/dist/src/usecase/spc/ox-data-use-case-spc.js +102 -0
- package/dist/src/usecase/spc/ox-data-use-case-spc.js.map +1 -0
- package/dist/src/usecase/spc/ox-input-spc-limits.d.ts +44 -0
- package/dist/src/usecase/spc/ox-input-spc-limits.js +193 -0
- package/dist/src/usecase/spc/ox-input-spc-limits.js.map +1 -0
- package/dist/src/usecase/spc/ox-property-editor-spc-limits.d.ts +6 -0
- package/dist/src/usecase/spc/ox-property-editor-spc-limits.js +24 -0
- package/dist/src/usecase/spc/ox-property-editor-spc-limits.js.map +1 -0
- package/dist/stories/ox-data-entry-form.stories.d.ts +1 -1
- package/dist/stories/ox-data-entry-form.stories.js +73 -17
- package/dist/stories/ox-data-entry-form.stories.js.map +1 -1
- package/dist/stories/ox-data-item-spec.stories.d.ts +1 -1
- package/dist/stories/ox-data-item-spec.stories.js +14 -2
- package/dist/stories/ox-data-item-spec.stories.js.map +1 -1
- package/dist/stories/ox-data-ooc-brief-view.stories.d.ts +1 -1
- package/dist/stories/ox-data-ooc-brief-view.stories.js +25 -13
- package/dist/stories/ox-data-ooc-brief-view.stories.js.map +1 -1
- package/dist/stories/ox-data-ooc-view.stories.d.ts +1 -1
- package/dist/stories/ox-data-ooc-view.stories.js +27 -13
- package/dist/stories/ox-data-ooc-view.stories.js.map +1 -1
- package/dist/stories/ox-data-sample-view.stories.d.ts +1 -1
- package/dist/stories/ox-data-sample-view.stories.js +21 -9
- package/dist/stories/ox-data-sample-view.stories.js.map +1 -1
- package/dist/stories/ox-grist-editor-data-item-spec.stories.d.ts +1 -1
- package/dist/stories/ox-grist-editor-data-item-spec.stories.js +66 -54
- package/dist/stories/ox-grist-editor-data-item-spec.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -26
- package/src/grist-editor/ox-popup-data-item-spec.ts +7 -8
- package/src/ox-data-entry-form.ts +66 -47
- package/src/ox-data-entry-subgroup-form.ts +2 -0
- package/src/ox-data-entry-view.ts +18 -7
- package/src/ox-data-item-spec.ts +9 -8
- package/src/ox-data-ooc-badge.ts +65 -0
- package/src/ox-data-ooc-brief-view.ts +10 -121
- package/src/ox-data-ooc-correction-part.ts +107 -0
- package/src/ox-data-ooc-history.ts +74 -0
- package/src/ox-data-ooc-view.ts +7 -92
- package/src/ox-data-sample-subgroup-view.ts +16 -17
- package/src/ox-data-sample-view.ts +52 -35
- package/src/ox-data-summary-view.ts +10 -4
- package/src/types.ts +76 -27
- package/src/usecase/spc/index.ts +10 -0
- package/src/usecase/spc/ox-data-use-case-spc.ts +147 -0
- package/src/usecase/spc/ox-input-spc-limits.ts +182 -0
- package/src/usecase/spc/ox-property-editor-spc-limits.ts +23 -0
- package/stories/ox-data-entry-form.stories.ts +78 -22
- package/stories/ox-data-item-spec.stories.ts +14 -2
- package/stories/ox-data-ooc-brief-view.stories.ts +26 -15
- package/stories/ox-data-ooc-view.stories.ts +28 -15
- package/stories/ox-data-sample-view.stories.ts +22 -11
- package/stories/ox-grist-editor-data-item-spec.stories.ts +67 -56
- package/themes/grist-theme.css +3 -1
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +142 -70
- package/translations/zh.json +146 -75
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/dataset",
|
|
3
3
|
"description": "WebApplication dataset supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "2.0.0-alpha.
|
|
5
|
+
"version": "2.0.0-alpha.110",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"./ox-data-item-spec.js": "./dist/src/ox-data-item-spec.js",
|
|
17
17
|
"./ox-data-ooc-brief-view.js": "./dist/src/ox-data-ooc-brief-view.js",
|
|
18
18
|
"./ox-data-ooc-view.js": "./dist/src/ox-data-ooc-view.js",
|
|
19
|
+
"./ox-data-ooc-correction-part.js": "./dist/src/ox-data-ooc-correction-part.js",
|
|
20
|
+
"./ox-data-ooc-badge.js": "./dist/src/ox-data-ooc-badge.js",
|
|
21
|
+
"./ox-data-ooc-history.js": "./dist/src/ox-data-ooc-history.js",
|
|
19
22
|
"./ox-data-sample-view.js": "./dist/src/ox-data-sample-view.js",
|
|
20
23
|
"./ox-data-summary-view.js": "./dist/src/ox-data-summary-view.js",
|
|
21
24
|
"./ox-input-ccp-limits.js": "./dist/src/usecase/ccp/ox-input-ccp-limits.js",
|
|
@@ -47,6 +50,18 @@
|
|
|
47
50
|
"ox-data-ooc-view.js": [
|
|
48
51
|
"dist/src/ox-data-ooc-view.d.ts"
|
|
49
52
|
],
|
|
53
|
+
"ox-data-ooc-brief-view.js": [
|
|
54
|
+
"dist/src/ox-data-ooc-brief-view.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"ox-data-ooc-correction-part.js": [
|
|
57
|
+
"dist/src/ox-data-ooc-correction-part.d.ts"
|
|
58
|
+
],
|
|
59
|
+
"ox-data-ooc-badge.js": [
|
|
60
|
+
"dist/src/ox-data-ooc-badge.d.ts"
|
|
61
|
+
],
|
|
62
|
+
"ox-data-ooc-history.js": [
|
|
63
|
+
"dist/src/ox-data-ooc-history.d.ts"
|
|
64
|
+
],
|
|
50
65
|
"ox-data-sample-view.js": [
|
|
51
66
|
"dist/src/ox-data-sample-view.d.ts"
|
|
52
67
|
],
|
|
@@ -90,37 +105,35 @@
|
|
|
90
105
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
91
106
|
},
|
|
92
107
|
"dependencies": {
|
|
93
|
-
"@material/
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"@operato/
|
|
97
|
-
"@operato/
|
|
98
|
-
"@operato/
|
|
99
|
-
"@operato/
|
|
100
|
-
"@operato/
|
|
101
|
-
"@operato/
|
|
102
|
-
"@operato/
|
|
103
|
-
"@operato/
|
|
104
|
-
"
|
|
105
|
-
"@operato/utils": "^2.0.0-alpha.8",
|
|
106
|
-
"lit": "^2.5.0"
|
|
108
|
+
"@material/web": "^1.4.0",
|
|
109
|
+
"@operato/data-grist": "^2.0.0-alpha.110",
|
|
110
|
+
"@operato/graphql": "^2.0.0-alpha.110",
|
|
111
|
+
"@operato/grist-editor": "^2.0.0-alpha.110",
|
|
112
|
+
"@operato/i18n": "^2.0.0-alpha.110",
|
|
113
|
+
"@operato/input": "^2.0.0-alpha.110",
|
|
114
|
+
"@operato/popup": "^2.0.0-alpha.110",
|
|
115
|
+
"@operato/property-editor": "^2.0.0-alpha.110",
|
|
116
|
+
"@operato/shell": "^2.0.0-alpha.110",
|
|
117
|
+
"@operato/styles": "^2.0.0-alpha.110",
|
|
118
|
+
"@operato/utils": "^2.0.0-alpha.110",
|
|
119
|
+
"lit": "^3.1.2"
|
|
107
120
|
},
|
|
108
121
|
"devDependencies": {
|
|
109
|
-
"@custom-elements-manifest/analyzer": "^0.
|
|
122
|
+
"@custom-elements-manifest/analyzer": "^0.9.2",
|
|
110
123
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
111
|
-
"@open-wc/eslint-config": "^
|
|
124
|
+
"@open-wc/eslint-config": "^12.0.3",
|
|
112
125
|
"@open-wc/testing": "^3.1.6",
|
|
113
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
114
|
-
"@typescript-eslint/parser": "^
|
|
126
|
+
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
127
|
+
"@typescript-eslint/parser": "^7.0.1",
|
|
115
128
|
"@web/dev-server": "^0.3.0",
|
|
116
|
-
"@web/dev-server-storybook": "^0.
|
|
117
|
-
"@web/test-runner": "^0.
|
|
129
|
+
"@web/dev-server-storybook": "^2.0.1",
|
|
130
|
+
"@web/test-runner": "^0.18.0",
|
|
118
131
|
"concurrently": "^8.0.1",
|
|
119
132
|
"eslint": "^8.39.0",
|
|
120
|
-
"eslint-config-prettier": "^
|
|
121
|
-
"husky": "^
|
|
122
|
-
"lint-staged": "^
|
|
123
|
-
"prettier": "^2.
|
|
133
|
+
"eslint-config-prettier": "^9.1.0",
|
|
134
|
+
"husky": "^9.0.11",
|
|
135
|
+
"lint-staged": "^15.2.2",
|
|
136
|
+
"prettier": "^3.2.5",
|
|
124
137
|
"tslib": "^2.3.1",
|
|
125
138
|
"typescript": "^5.0.4"
|
|
126
139
|
},
|
|
@@ -137,5 +150,5 @@
|
|
|
137
150
|
"prettier --write"
|
|
138
151
|
]
|
|
139
152
|
},
|
|
140
|
-
"gitHead": "
|
|
153
|
+
"gitHead": "e5ca3caf4c975c3f195efe9ea2c1659cf6a70642"
|
|
141
154
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '../ox-data-item-spec.js'
|
|
2
3
|
|
|
3
4
|
import { css, html, LitElement } from 'lit'
|
|
@@ -5,13 +6,14 @@ import { customElement, property } from 'lit/decorators.js'
|
|
|
5
6
|
|
|
6
7
|
import { i18next } from '@operato/i18n'
|
|
7
8
|
import { closePopup } from '@operato/popup'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
9
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
9
10
|
|
|
10
11
|
import { DataItem } from '../types.js'
|
|
11
12
|
|
|
12
13
|
@customElement('ox-popup-data-item-spec')
|
|
13
14
|
export class OxPopupDataItemSpec extends LitElement {
|
|
14
15
|
static styles = [
|
|
16
|
+
ButtonContainerStyles,
|
|
15
17
|
ScrollbarStyles,
|
|
16
18
|
css`
|
|
17
19
|
:host {
|
|
@@ -39,11 +41,6 @@ export class OxPopupDataItemSpec extends LitElement {
|
|
|
39
41
|
|
|
40
42
|
color: var(--primary-color);
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
.button-container {
|
|
44
|
-
display: flex;
|
|
45
|
-
margin-left: auto;
|
|
46
|
-
}
|
|
47
44
|
`
|
|
48
45
|
]
|
|
49
46
|
|
|
@@ -59,8 +56,10 @@ export class OxPopupDataItemSpec extends LitElement {
|
|
|
59
56
|
</ox-data-item-spec>
|
|
60
57
|
|
|
61
58
|
<div class="button-container">
|
|
62
|
-
<
|
|
63
|
-
|
|
59
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
60
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
61
|
+
</button>
|
|
62
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
64
63
|
</div>
|
|
65
64
|
`
|
|
66
65
|
}
|
|
@@ -11,8 +11,6 @@ import { OxDataEntrySubgroupForm } from './ox-data-entry-subgroup-form.js'
|
|
|
11
11
|
export class OxDataEntryForm extends LitElement {
|
|
12
12
|
static styles = css`
|
|
13
13
|
:host {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: row;
|
|
16
14
|
--item-description-font: normal 0.8rem/1rem var(--theme-font);
|
|
17
15
|
--item-description-color: var(--page-description-color);
|
|
18
16
|
}
|
|
@@ -34,13 +32,12 @@ export class OxDataEntryForm extends LitElement {
|
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
form {
|
|
37
|
-
flex: 1;
|
|
38
|
-
|
|
39
35
|
display: flex;
|
|
40
36
|
flex-direction: column;
|
|
37
|
+
overflow: hidden;
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
label {
|
|
40
|
+
form > div[label] {
|
|
44
41
|
display: grid;
|
|
45
42
|
|
|
46
43
|
grid-template-rows: auto 1fr;
|
|
@@ -50,11 +47,11 @@ export class OxDataEntryForm extends LitElement {
|
|
|
50
47
|
grid-gap: 9px;
|
|
51
48
|
align-items: center;
|
|
52
49
|
margin-bottom: var(--margin-default);
|
|
53
|
-
}
|
|
54
50
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
&:nth-child(odd) {
|
|
52
|
+
background-color: var(--main-section-background-color);
|
|
53
|
+
padding: var(--padding-default) 0;
|
|
54
|
+
}
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
div[name] {
|
|
@@ -69,15 +66,15 @@ export class OxDataEntryForm extends LitElement {
|
|
|
69
66
|
font: var(--item-description-font);
|
|
70
67
|
color: var(--item-description-color);
|
|
71
68
|
text-align: left;
|
|
72
|
-
}
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
* {
|
|
71
|
+
vertical-align: middle;
|
|
72
|
+
}
|
|
77
73
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
md-icon {
|
|
75
|
+
margin-top: -3px;
|
|
76
|
+
font-size: 0.9rem;
|
|
77
|
+
}
|
|
81
78
|
}
|
|
82
79
|
|
|
83
80
|
div[elements] {
|
|
@@ -87,18 +84,18 @@ export class OxDataEntryForm extends LitElement {
|
|
|
87
84
|
flex-wrap: wrap;
|
|
88
85
|
gap: 10px;
|
|
89
86
|
padding-right: var(--padding-default);
|
|
90
|
-
}
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
* {
|
|
89
|
+
flex: 1;
|
|
90
|
+
}
|
|
95
91
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
input,
|
|
93
|
+
select {
|
|
94
|
+
border: var(--input-field-border);
|
|
95
|
+
border-radius: var(--input-field-border-radius);
|
|
96
|
+
padding: var(--input-field-padding);
|
|
97
|
+
font: var(--input-field-font);
|
|
98
|
+
}
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
div[subgroup] {
|
|
@@ -107,7 +104,7 @@ export class OxDataEntryForm extends LitElement {
|
|
|
107
104
|
}
|
|
108
105
|
|
|
109
106
|
@media only screen and (max-width: 460px) {
|
|
110
|
-
label {
|
|
107
|
+
form > div[label] {
|
|
111
108
|
display: grid;
|
|
112
109
|
|
|
113
110
|
grid-template-rows: auto auto 1fr;
|
|
@@ -168,7 +165,7 @@ export class OxDataEntryForm extends LitElement {
|
|
|
168
165
|
|
|
169
166
|
private buildInputs4Subgroup(subgroup: string, dataItems: DataItem[], value: { [tag: string]: any }): TemplateResult {
|
|
170
167
|
return html`
|
|
171
|
-
<label>
|
|
168
|
+
<div label>
|
|
172
169
|
<div name>${subgroup}</div>
|
|
173
170
|
<div subgroup>
|
|
174
171
|
<ox-data-entry-subgroup-form
|
|
@@ -177,7 +174,7 @@ export class OxDataEntryForm extends LitElement {
|
|
|
177
174
|
.value=${value}
|
|
178
175
|
></ox-data-entry-subgroup-form>
|
|
179
176
|
</div>
|
|
180
|
-
</
|
|
177
|
+
</div>
|
|
181
178
|
`
|
|
182
179
|
}
|
|
183
180
|
|
|
@@ -199,23 +196,42 @@ export class OxDataEntryForm extends LitElement {
|
|
|
199
196
|
option => html`<option value=${option.value} ?selected=${option.value === v}>${option.text}</option>`
|
|
200
197
|
)}
|
|
201
198
|
</select>`
|
|
202
|
-
|
|
199
|
+
|
|
200
|
+
case 'radio':
|
|
201
|
+
return html`<div
|
|
202
|
+
@change=${(e: Event) => {
|
|
203
|
+
const div = e.currentTarget as HTMLElement
|
|
204
|
+
const inputHidden = div.querySelector(`input[name="${tag}"]`) as HTMLInputElement
|
|
205
|
+
inputHidden.value = (e.target as HTMLInputElement).value
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
<input type="hidden" name=${tag} />
|
|
209
|
+
|
|
210
|
+
${(options.options || []).map(
|
|
211
|
+
option =>
|
|
212
|
+
html`<label>
|
|
213
|
+
<input
|
|
214
|
+
type="radio"
|
|
215
|
+
name=${'$' + tag + '-' + idx}
|
|
216
|
+
.value=${option.value}
|
|
217
|
+
?checked=${option.value === v}
|
|
218
|
+
/>
|
|
219
|
+
${option.text}
|
|
220
|
+
</label>`
|
|
221
|
+
)}
|
|
222
|
+
</div>`
|
|
203
223
|
|
|
204
224
|
case 'boolean':
|
|
205
225
|
return html` <input type="checkbox" name=${tag} .checked=${v} />`
|
|
206
|
-
break
|
|
207
226
|
|
|
208
227
|
case 'number':
|
|
209
228
|
return html` <input type="number" name=${tag} value=${v} />`
|
|
210
|
-
break
|
|
211
229
|
|
|
212
230
|
case 'date':
|
|
213
231
|
return html` <input type="date" name=${tag} value=${v} />`
|
|
214
|
-
break
|
|
215
232
|
|
|
216
233
|
case 'datetime':
|
|
217
234
|
return html` <input type="datetime-local" name=${tag} value=${v} />`
|
|
218
|
-
break
|
|
219
235
|
|
|
220
236
|
case 'file':
|
|
221
237
|
return html`<ox-input-file name=${tag} label="Attach Files" accept="*/*" multiple="true"></ox-input-file>`
|
|
@@ -226,11 +242,11 @@ export class OxDataEntryForm extends LitElement {
|
|
|
226
242
|
}
|
|
227
243
|
})
|
|
228
244
|
|
|
229
|
-
return html` <label
|
|
245
|
+
return html` <div label>
|
|
230
246
|
<div name>${name}${unit ? `(${unit})` : ''}</div>
|
|
231
|
-
<div description><
|
|
247
|
+
<div description><md-icon>info</md-icon> ${description}</div>
|
|
232
248
|
<div elements>${elements}</div>
|
|
233
|
-
</
|
|
249
|
+
</div>`
|
|
234
250
|
})
|
|
235
251
|
}
|
|
236
252
|
|
|
@@ -238,19 +254,22 @@ export class OxDataEntryForm extends LitElement {
|
|
|
238
254
|
const dataItems = this.dataSet!.dataItems
|
|
239
255
|
const nonGroupDataItems = dataItems.filter(dataItem => !dataItem.group)
|
|
240
256
|
|
|
241
|
-
const nonGroupValue = (nonGroupDataItems || []).reduce(
|
|
242
|
-
|
|
257
|
+
const nonGroupValue = (nonGroupDataItems || []).reduce(
|
|
258
|
+
(sum, dataItem) => {
|
|
259
|
+
const { tag, type } = dataItem
|
|
243
260
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
261
|
+
const editors = Array.prototype.slice.call(
|
|
262
|
+
this.renderRoot.querySelectorAll(`[name=${tag}]`) as NodeListOf<HTMLInputElement>
|
|
263
|
+
) as HTMLInputElement[]
|
|
247
264
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
265
|
+
if (editors.length > 0) {
|
|
266
|
+
sum[tag] = editors.map(editor => (type === 'boolean' ? editor.checked : editor.value))
|
|
267
|
+
}
|
|
251
268
|
|
|
252
|
-
|
|
253
|
-
|
|
269
|
+
return sum
|
|
270
|
+
},
|
|
271
|
+
{} as { [tag: string]: any }
|
|
272
|
+
)
|
|
254
273
|
|
|
255
274
|
return Array.from(this.subgroups).reduce((value, subgroup) => {
|
|
256
275
|
return {
|
|
@@ -58,6 +58,8 @@ export class OxDataEntrySubgroupForm extends LitElement {
|
|
|
58
58
|
|
|
59
59
|
switch (type) {
|
|
60
60
|
case 'select':
|
|
61
|
+
case 'radio': // 그리드안에 radio가 들어갈수 없어서 select로 변환
|
|
62
|
+
columnConfig.type = 'select'
|
|
61
63
|
columnConfig.record.options = [
|
|
62
64
|
'',
|
|
63
65
|
...(options.options || []).map((option: any) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@operato/input/ox-input-file.js'
|
|
2
2
|
|
|
3
|
-
import { css, html, LitElement } from 'lit'
|
|
3
|
+
import { css, html, LitElement, nothing } from 'lit'
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js'
|
|
5
5
|
|
|
6
6
|
import { i18next } from '@operato/i18n'
|
|
@@ -39,7 +39,7 @@ export class OxDataEntryView extends LitElement {
|
|
|
39
39
|
[page-description] * {
|
|
40
40
|
vertical-align: middle;
|
|
41
41
|
}
|
|
42
|
-
[page-description]
|
|
42
|
+
[page-description] md-icon {
|
|
43
43
|
margin-top: -2px;
|
|
44
44
|
font-size: 0.9rem;
|
|
45
45
|
color: var(--page-description-color);
|
|
@@ -57,6 +57,7 @@ export class OxDataEntryView extends LitElement {
|
|
|
57
57
|
font: var(--th-font);
|
|
58
58
|
color: var(--th-color);
|
|
59
59
|
text-align: left;
|
|
60
|
+
white-space: nowrap;
|
|
60
61
|
}
|
|
61
62
|
th[item] {
|
|
62
63
|
min-width: 100px;
|
|
@@ -86,13 +87,19 @@ export class OxDataEntryView extends LitElement {
|
|
|
86
87
|
td[name] {
|
|
87
88
|
font-weight: bold;
|
|
88
89
|
}
|
|
89
|
-
td
|
|
90
|
+
td md-icon {
|
|
90
91
|
color: var(--status-danger-color);
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
pre {
|
|
94
95
|
tab-size: 2;
|
|
95
96
|
}
|
|
97
|
+
|
|
98
|
+
@media screen and (max-width: 480px) {
|
|
99
|
+
th {
|
|
100
|
+
min-width: 50px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
96
103
|
`
|
|
97
104
|
|
|
98
105
|
@property({ type: Object }) dataSet?: DataSet
|
|
@@ -154,20 +161,24 @@ export class OxDataEntryView extends LitElement {
|
|
|
154
161
|
|
|
155
162
|
return html` <label .title=${description}>
|
|
156
163
|
<div name>${name}${unit ? `(${unit})` : ''}</div>
|
|
157
|
-
<div description><
|
|
164
|
+
<div description><md-icon>info</md-icon> ${description}</div>
|
|
158
165
|
<div elements>${elements}</div>
|
|
159
166
|
</label>`
|
|
160
167
|
})
|
|
161
168
|
}
|
|
162
169
|
|
|
163
170
|
render() {
|
|
171
|
+
if (!this.dataSet) {
|
|
172
|
+
return nothing
|
|
173
|
+
}
|
|
174
|
+
|
|
164
175
|
const { name, description, useCase, dataItems = [] } = this.dataSet!
|
|
165
176
|
|
|
166
177
|
const data = this.value || {}
|
|
167
178
|
const useCaseNames = useCase?.split(',').filter(useCase => useCase.trim()) || []
|
|
168
179
|
|
|
169
180
|
return html` <h2>${name}</h2>
|
|
170
|
-
<p page-description><
|
|
181
|
+
<p page-description><md-icon>info</md-icon> ${description}<br /></p>
|
|
171
182
|
|
|
172
183
|
<form>
|
|
173
184
|
<table>
|
|
@@ -194,8 +205,8 @@ export class OxDataEntryView extends LitElement {
|
|
|
194
205
|
<td>${unit}</td>
|
|
195
206
|
<td>${this.buildValue(type, value)}</td>
|
|
196
207
|
<td><pre>${this.buildSpec(useCaseNames, spec)}</pre></td>
|
|
197
|
-
<td>${ooc ? html`<
|
|
198
|
-
<td>${oos ? html`<
|
|
208
|
+
<td>${ooc ? html`<md-icon>done</md-icon>` : ''}</td>
|
|
209
|
+
<td>${oos ? html`<md-icon>done</md-icon>` : ''}</td>
|
|
199
210
|
</tr>
|
|
200
211
|
`
|
|
201
212
|
})}
|
package/src/ox-data-item-spec.ts
CHANGED
|
@@ -52,14 +52,14 @@ export class OxDataItemSpec extends LitElement {
|
|
|
52
52
|
div[description] * {
|
|
53
53
|
vertical-align: middle;
|
|
54
54
|
}
|
|
55
|
-
div[description]
|
|
55
|
+
div[description] md-icon {
|
|
56
56
|
margin-top: -3px;
|
|
57
57
|
font-size: 0.9rem;
|
|
58
58
|
}
|
|
59
59
|
ox-properties-dynamic-view {
|
|
60
60
|
grid-area: inputs;
|
|
61
61
|
display: flex;
|
|
62
|
-
flex-direction:
|
|
62
|
+
flex-direction: column;
|
|
63
63
|
flex-wrap: wrap;
|
|
64
64
|
gap: 10px;
|
|
65
65
|
padding-right: var(--padding-default);
|
|
@@ -94,12 +94,13 @@ export class OxDataItemSpec extends LitElement {
|
|
|
94
94
|
render() {
|
|
95
95
|
return html`<form @property-change=${(e: Event) => this.onChange(e)}>
|
|
96
96
|
${this.dataItemSpecSets.map(
|
|
97
|
-
({ name, description, specs }) =>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
({ name, description, specs }) =>
|
|
98
|
+
html` <label
|
|
99
|
+
><div name>${name}</div>
|
|
100
|
+
<div description><md-icon>info</md-icon> ${description}</div>
|
|
101
|
+
<ox-properties-dynamic-view data-name=${name} .props=${specs} .value=${this.value?.[name]}>
|
|
102
|
+
</ox-properties-dynamic-view
|
|
103
|
+
></label>`
|
|
103
104
|
)}
|
|
104
105
|
</form>`
|
|
105
106
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@operato/input/ox-input-file.js'
|
|
3
|
+
import './ox-data-sample-view'
|
|
4
|
+
|
|
5
|
+
import { css, html, LitElement, nothing } from 'lit'
|
|
6
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
7
|
+
|
|
8
|
+
@customElement('ox-data-ooc-badge')
|
|
9
|
+
export class OxDataOocBadge extends LitElement {
|
|
10
|
+
static styles = css`
|
|
11
|
+
h3 {
|
|
12
|
+
margin: var(--title-margin);
|
|
13
|
+
font: var(--title-font);
|
|
14
|
+
color: var(--title-text-color);
|
|
15
|
+
text-align: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
md-icon {
|
|
19
|
+
--md-icon-size: 80px;
|
|
20
|
+
opacity: 0.4;
|
|
21
|
+
color: var(--primary-background-color);
|
|
22
|
+
font-variation-settings: 'FILL' 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
div {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 22px;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
font-size: 10px;
|
|
31
|
+
color: var(--theme-white-color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[field-state] {
|
|
35
|
+
display: block;
|
|
36
|
+
border-radius: 4px;
|
|
37
|
+
background-color: var(--primary-color);
|
|
38
|
+
box-shadow: var(--box-shadow);
|
|
39
|
+
margin-top: var(--margin-narrow);
|
|
40
|
+
padding: 1px 3px;
|
|
41
|
+
font-size: 0.8rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[danger] [field-state] {
|
|
45
|
+
background-color: var(--status-danger-color);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[complete] [field-state] {
|
|
49
|
+
background-color: var(--status-info-color);
|
|
50
|
+
}
|
|
51
|
+
`
|
|
52
|
+
|
|
53
|
+
@property({ type: String }) state?: string
|
|
54
|
+
|
|
55
|
+
render() {
|
|
56
|
+
const state = this.state
|
|
57
|
+
|
|
58
|
+
return html`
|
|
59
|
+
<h3 ?danger=${state != 'CORRECTED'} ?complete=${state == 'CORRECTED'}>
|
|
60
|
+
<md-icon>shield</md-icon>
|
|
61
|
+
<div>DATA OOC <span field-state>${state || ''}</span></div>
|
|
62
|
+
</h3>
|
|
63
|
+
`
|
|
64
|
+
}
|
|
65
|
+
}
|