@operato/dataset 1.2.17 → 1.2.19
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 +18 -0
- package/dist/src/ox-data-entry-form.js +1 -1
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-entry-view.d.ts +12 -0
- package/dist/src/ox-data-entry-view.js +179 -0
- package/dist/src/ox-data-entry-view.js.map +1 -0
- package/dist/src/ox-data-ooc-brief-view.d.ts +11 -0
- package/dist/src/ox-data-ooc-brief-view.js +143 -0
- package/dist/src/ox-data-ooc-brief-view.js.map +1 -0
- package/dist/src/ox-data-ooc-view.d.ts +3 -0
- package/dist/src/ox-data-ooc-view.js +8 -7
- package/dist/src/ox-data-ooc-view.js.map +1 -1
- package/dist/src/types.d.ts +12 -1
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/src/ox-data-entry-form.ts +1 -1
- package/src/ox-data-entry-view.ts +186 -0
- package/src/ox-data-ooc-brief-view.ts +151 -0
- package/src/ox-data-ooc-view.ts +8 -6
- package/src/types.ts +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [1.2.19](https://github.com/hatiolab/operato/compare/v1.2.18...v1.2.19) (2023-04-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* add ox-data-entry-view ([ab56335](https://github.com/hatiolab/operato/commit/ab5633501b2e9cb39feb200ca022ffaa81da93b7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [1.2.18](https://github.com/hatiolab/operato/compare/v1.2.17...v1.2.18) (2023-04-02)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* modify ooc-view component according to worklist integration ([a09e27d](https://github.com/hatiolab/operato/commit/a09e27d041bdeb48aeb24bc66148cbd023637624))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [1.2.17](https://github.com/hatiolab/operato/compare/v1.2.16...v1.2.17) (2023-04-02)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -51,7 +51,7 @@ let OxDataEntryForm = class OxDataEntryForm extends LitElement {
|
|
|
51
51
|
></ox-input-file>`;
|
|
52
52
|
case 'string':
|
|
53
53
|
default:
|
|
54
|
-
return html ` <input type="
|
|
54
|
+
return html ` <input type="text" name=${tag} value=${v} />`;
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
return html ` <label .title=${description}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-data-entry-form.js","sourceRoot":"","sources":["../../src/ox-data-entry-form.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAKpD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IA2G7C,MAAM;;QACJ,OAAO,IAAI,CAAA,kBAAkB,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnD,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,KAAI,EAAE;YACxB,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,WAAW,KAAI,EAAE;QACnC,IAAI,CAAC,WAAW,EAAE;YACd,CAAA;IACV,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;QAE9B,IAAI,CAAC,aAAa,CACh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GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA+B;AAzG/C,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CAqM3B;SArMY,eAAe","sourcesContent":["import '@operato/input/ox-input-file.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { DataSet } from './types.js'\n\n@customElement('ox-data-entry-form')\nexport class OxDataEntryForm extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: row;\n --item-description-font: normal 0.8rem/1rem var(--theme-font);\n --item-description-color: var(--page-description-color);\n }\n\n h2 {\n margin: var(--title-margin);\n font: var(--title-font);\n color: var(--title-text-color);\n text-transform: capitalize;\n text-align: center;\n }\n h3 {\n margin: var(--page-description-margin);\n font: var(--page-description-font);\n color: var(--page-description-color);\n text-transform: capitalize;\n text-align: center;\n }\n\n form {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n label {\n display: grid;\n\n grid-template-rows: auto 1fr;\n grid-template-columns: 1fr 5fr;\n grid-template-areas: 'name description' 'empty inputs';\n\n grid-gap: 9px;\n align-items: center;\n margin-bottom: var(--margin-default);\n }\n label:nth-child(odd) {\n background-color: var(--main-section-background-color);\n padding: var(--padding-default) 0;\n }\n\n div[name] {\n grid-area: name;\n font: var(--label-font);\n color: var(--label-color);\n text-align: right;\n }\n div[description] {\n grid-area: description;\n opacity: 0.7;\n font: var(--item-description-font);\n color: var(--item-description-color);\n text-align: left;\n }\n div[description] * {\n vertical-align: middle;\n }\n div[description] mwc-icon {\n margin-top: -3px;\n font-size: 0.9rem;\n }\n div[elements] {\n grid-area: inputs;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 10px;\n padding-right: var(--padding-default);\n }\n div[elements] * {\n flex: 1;\n }\n div[elements] input,\n div[elements] select {\n border: var(--input-field-border);\n border-radius: var(--input-field-border-radius);\n padding: var(--input-field-padding);\n font: var(--input-field-font);\n }\n\n @media only screen and (max-width: 460px) {\n label {\n display: grid;\n\n grid-template-rows: auto auto 1fr;\n grid-template-columns: 1fr;\n grid-template-areas: 'name' 'description' 'inputs';\n\n grid-gap: 9px;\n align-items: center;\n margin-bottom: var(--margin-default);\n }\n\n div[name] {\n text-align: left;\n }\n }\n `\n\n @property({ type: Object }) dataSet?: DataSet\n @property({ type: Object }) value?: { [tag: string]: any }\n\n render() {\n return html` <form @change=${(e: Event) => this.onChange(e)}>\n <h2>${this.dataSet?.name || ''}</h2>\n <h3>${this.dataSet?.description || ''}</h3>\n ${this.buildInputs()}\n </form>`\n }\n\n private onChange(e: Event) {\n this.value = this.buildValue()\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n\n private buildInputs() {\n const dataItems = this.dataSet?.dataItems.filter(item => item.active)\n\n return (dataItems || []).map(dataItem => {\n const { name, description, tag, type, quota = 1, options = {}, unit } = dataItem\n\n const samples = new Array(quota).fill(0)\n const value = this.value && this.value[tag]\n\n const elements = samples.map((_, idx) => {\n const v = value instanceof Array ? value[idx] : idx === 0 ? value : undefined\n\n switch (type) {\n case 'select':\n return html` <select .name=${tag}>\n <option value=\"\"></option>\n ${(options.options || []).map(\n option => html`<option value=${option.value} ?selected=${option.value === v}>${option.text}</option>`\n )}\n </select>`\n break\n\n case 'boolean':\n return html` <input type=\"checkbox\" name=${tag} .checked=${v} />`\n break\n\n case 'number':\n return html` <input type=\"number\" name=${tag} value=${v} />`\n break\n\n case 'file':\n return html`<ox-input-file\n name=${tag}\n label=\"Attach Files\"\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n ></ox-input-file>`\n\n case 'string':\n default:\n return html` <input type=\"text\" name=${tag} value=${v} />`\n }\n })\n\n return html` <label .title=${description}>\n <div name>${name}${unit ? `(${unit})` : ''}</div>\n <div description><mwc-icon>info_outline</mwc-icon> ${description}</div>\n <div elements>${elements}</div>\n </label>`\n })\n }\n\n private buildValue() {\n const dataItems = this.dataSet!.dataItems\n\n return (dataItems || []).reduce((sum, dataItem) => {\n const { tag, type } = dataItem\n\n const editors = Array.prototype.slice.call(\n this.renderRoot.querySelectorAll(`[name=${tag}]`) as NodeListOf<HTMLInputElement>\n ) as HTMLInputElement[]\n\n if (editors.length > 0) {\n sum[tag] = editors.map(editor => (type === 'boolean' ? editor.checked : editor.value))\n }\n\n return sum\n }, {} as { [tag: string]: any })\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { DataSet } from './types.js';
|
|
4
|
+
export declare class OxDataEntryView extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
dataSet?: DataSet;
|
|
7
|
+
value?: {
|
|
8
|
+
[tag: string]: any;
|
|
9
|
+
};
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
private buildEntryViews;
|
|
12
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/input/ox-input-file.js';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
+
let OxDataEntryView = class OxDataEntryView extends LitElement {
|
|
6
|
+
render() {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
return html `<form>
|
|
9
|
+
<h2>${((_a = this.dataSet) === null || _a === void 0 ? void 0 : _a.name) || ''}</h2>
|
|
10
|
+
<h3>${((_b = this.dataSet) === null || _b === void 0 ? void 0 : _b.description) || ''}</h3>
|
|
11
|
+
${this.buildEntryViews()}
|
|
12
|
+
</form> `;
|
|
13
|
+
}
|
|
14
|
+
buildEntryViews() {
|
|
15
|
+
var _a;
|
|
16
|
+
const dataItems = (_a = this.dataSet) === null || _a === void 0 ? void 0 : _a.dataItems.filter(item => item.active);
|
|
17
|
+
return (dataItems || []).map(dataItem => {
|
|
18
|
+
const { name, description, tag, type, quota = 1, options = {}, unit } = dataItem;
|
|
19
|
+
const samples = new Array(quota).fill(0);
|
|
20
|
+
const value = this.value && this.value[tag];
|
|
21
|
+
const elements = samples.map((_, idx) => {
|
|
22
|
+
const v = value instanceof Array ? value[idx] : idx === 0 ? value : undefined;
|
|
23
|
+
switch (type) {
|
|
24
|
+
case 'select':
|
|
25
|
+
return html ` <select .name=${tag} disabled>
|
|
26
|
+
<option value=""></option>
|
|
27
|
+
${(options.options || []).map(option => html `<option value=${option.value} ?selected=${option.value === v}>${option.text}</option>`)}
|
|
28
|
+
</select>`;
|
|
29
|
+
break;
|
|
30
|
+
case 'boolean':
|
|
31
|
+
return html ` <input type="checkbox" name=${tag} .checked=${v} disabled />`;
|
|
32
|
+
break;
|
|
33
|
+
case 'number':
|
|
34
|
+
return html ` <input type="number" name=${tag} value=${v} disabled />`;
|
|
35
|
+
break;
|
|
36
|
+
case 'file':
|
|
37
|
+
return html `<ox-input-file
|
|
38
|
+
name=${tag}
|
|
39
|
+
label="Attach Files"
|
|
40
|
+
accept="*/*"
|
|
41
|
+
multiple="true"
|
|
42
|
+
hide-filelist
|
|
43
|
+
disabled
|
|
44
|
+
></ox-input-file>`;
|
|
45
|
+
case 'string':
|
|
46
|
+
default:
|
|
47
|
+
return html ` <input type="text" name=${tag} value=${v} disabled />`;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return html ` <label .title=${description}>
|
|
51
|
+
<div name>${name}${unit ? `(${unit})` : ''}</div>
|
|
52
|
+
<div description><mwc-icon>info_outline</mwc-icon> ${description}</div>
|
|
53
|
+
<div elements>${elements}</div>
|
|
54
|
+
</label>`;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
OxDataEntryView.styles = css `
|
|
59
|
+
:host {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
|
|
63
|
+
--item-description-font: normal 0.8rem/1rem var(--theme-font);
|
|
64
|
+
--item-description-color: var(--page-description-color);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
h2 {
|
|
68
|
+
margin: var(--title-margin);
|
|
69
|
+
font: var(--title-font);
|
|
70
|
+
color: var(--title-text-color);
|
|
71
|
+
text-transform: capitalize;
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
h3 {
|
|
75
|
+
margin: var(--page-description-margin);
|
|
76
|
+
font: var(--page-description-font);
|
|
77
|
+
color: var(--page-description-color);
|
|
78
|
+
text-transform: capitalize;
|
|
79
|
+
text-align: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
form {
|
|
83
|
+
flex: 1;
|
|
84
|
+
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
label {
|
|
90
|
+
display: grid;
|
|
91
|
+
|
|
92
|
+
grid-template-rows: auto 1fr;
|
|
93
|
+
grid-template-columns: 1fr 5fr;
|
|
94
|
+
grid-template-areas: 'name description' 'empty inputs';
|
|
95
|
+
|
|
96
|
+
grid-gap: 9px;
|
|
97
|
+
align-items: center;
|
|
98
|
+
margin-bottom: var(--margin-default);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
label:nth-child(odd) {
|
|
102
|
+
background-color: var(--main-section-background-color);
|
|
103
|
+
padding: var(--padding-default) 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
div[name] {
|
|
107
|
+
grid-area: name;
|
|
108
|
+
font: var(--label-font);
|
|
109
|
+
color: var(--label-color);
|
|
110
|
+
text-align: right;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
div[description] {
|
|
114
|
+
grid-area: description;
|
|
115
|
+
opacity: 0.7;
|
|
116
|
+
font: var(--item-description-font);
|
|
117
|
+
color: var(--item-description-color);
|
|
118
|
+
text-align: left;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
div[description] * {
|
|
122
|
+
vertical-align: middle;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
div[description] mwc-icon {
|
|
126
|
+
margin-top: -3px;
|
|
127
|
+
font-size: 0.9rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
div[elements] {
|
|
131
|
+
grid-area: inputs;
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: row;
|
|
134
|
+
flex-wrap: wrap;
|
|
135
|
+
gap: 10px;
|
|
136
|
+
padding-right: var(--padding-default);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
div[elements] * {
|
|
140
|
+
flex: 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
div[elements] input,
|
|
144
|
+
div[elements] select {
|
|
145
|
+
border: var(--input-field-border);
|
|
146
|
+
border-radius: var(--input-field-border-radius);
|
|
147
|
+
padding: var(--input-field-padding);
|
|
148
|
+
font: var(--input-field-font);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@media only screen and (max-width: 460px) {
|
|
152
|
+
label {
|
|
153
|
+
display: grid;
|
|
154
|
+
|
|
155
|
+
grid-template-rows: auto auto 1fr;
|
|
156
|
+
grid-template-columns: 1fr;
|
|
157
|
+
grid-template-areas: 'name' 'description' 'inputs';
|
|
158
|
+
|
|
159
|
+
grid-gap: 9px;
|
|
160
|
+
align-items: center;
|
|
161
|
+
margin-bottom: var(--margin-default);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
div[name] {
|
|
165
|
+
text-align: left;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
__decorate([
|
|
170
|
+
property({ type: Object })
|
|
171
|
+
], OxDataEntryView.prototype, "dataSet", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
property({ type: Object })
|
|
174
|
+
], OxDataEntryView.prototype, "value", void 0);
|
|
175
|
+
OxDataEntryView = __decorate([
|
|
176
|
+
customElement('ox-data-entry-view')
|
|
177
|
+
], OxDataEntryView);
|
|
178
|
+
export { OxDataEntryView };
|
|
179
|
+
//# sourceMappingURL=ox-data-entry-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-data-entry-view.js","sourceRoot":"","sources":["../../src/ox-data-entry-view.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAKpD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAoH7C,MAAM;;QACJ,OAAO,IAAI,CAAA;YACH,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,KAAI,EAAE;YACxB,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,WAAW,KAAI,EAAE;QACnC,IAAI,CAAC,eAAe,EAAE;aACjB,CAAA;IACX,CAAC;IAEO,eAAe;;QACrB,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAErE,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACtC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAA;YAEhF,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,C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AW;wBAChD,QAAQ;eACjB,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC;;AA/KM,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA+B;AAlH/C,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CAiL3B;SAjLY,eAAe","sourcesContent":["import '@operato/input/ox-input-file.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { DataSet } from './types.js'\n\n@customElement('ox-data-entry-view')\nexport class OxDataEntryView extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: row;\n\n --item-description-font: normal 0.8rem/1rem var(--theme-font);\n --item-description-color: var(--page-description-color);\n }\n\n h2 {\n margin: var(--title-margin);\n font: var(--title-font);\n color: var(--title-text-color);\n text-transform: capitalize;\n text-align: center;\n }\n h3 {\n margin: var(--page-description-margin);\n font: var(--page-description-font);\n color: var(--page-description-color);\n text-transform: capitalize;\n text-align: center;\n }\n\n form {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n\n label {\n display: grid;\n\n grid-template-rows: auto 1fr;\n grid-template-columns: 1fr 5fr;\n grid-template-areas: 'name description' 'empty inputs';\n\n grid-gap: 9px;\n align-items: center;\n margin-bottom: var(--margin-default);\n }\n\n label:nth-child(odd) {\n background-color: var(--main-section-background-color);\n padding: var(--padding-default) 0;\n }\n\n div[name] {\n grid-area: name;\n font: var(--label-font);\n color: var(--label-color);\n text-align: right;\n }\n\n div[description] {\n grid-area: description;\n opacity: 0.7;\n font: var(--item-description-font);\n color: var(--item-description-color);\n text-align: left;\n }\n\n div[description] * {\n vertical-align: middle;\n }\n\n div[description] mwc-icon {\n margin-top: -3px;\n font-size: 0.9rem;\n }\n\n div[elements] {\n grid-area: inputs;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 10px;\n padding-right: var(--padding-default);\n }\n\n div[elements] * {\n flex: 1;\n }\n\n div[elements] input,\n div[elements] select {\n border: var(--input-field-border);\n border-radius: var(--input-field-border-radius);\n padding: var(--input-field-padding);\n font: var(--input-field-font);\n }\n\n @media only screen and (max-width: 460px) {\n label {\n display: grid;\n\n grid-template-rows: auto auto 1fr;\n grid-template-columns: 1fr;\n grid-template-areas: 'name' 'description' 'inputs';\n\n grid-gap: 9px;\n align-items: center;\n margin-bottom: var(--margin-default);\n }\n\n div[name] {\n text-align: left;\n }\n }\n `\n\n @property({ type: Object }) dataSet?: DataSet\n @property({ type: Object }) value?: { [tag: string]: any }\n\n render() {\n return html`<form>\n <h2>${this.dataSet?.name || ''}</h2>\n <h3>${this.dataSet?.description || ''}</h3>\n ${this.buildEntryViews()}\n </form> `\n }\n\n private buildEntryViews() {\n const dataItems = this.dataSet?.dataItems.filter(item => item.active)\n\n return (dataItems || []).map(dataItem => {\n const { name, description, tag, type, quota = 1, options = {}, unit } = dataItem\n\n const samples = new Array(quota).fill(0)\n const value = this.value && this.value[tag]\n\n const elements = samples.map((_, idx) => {\n const v = value instanceof Array ? value[idx] : idx === 0 ? value : undefined\n\n switch (type) {\n case 'select':\n return html` <select .name=${tag} disabled>\n <option value=\"\"></option>\n ${(options.options || []).map(\n option => html`<option value=${option.value} ?selected=${option.value === v}>${option.text}</option>`\n )}\n </select>`\n break\n\n case 'boolean':\n return html` <input type=\"checkbox\" name=${tag} .checked=${v} disabled />`\n break\n\n case 'number':\n return html` <input type=\"number\" name=${tag} value=${v} disabled />`\n break\n\n case 'file':\n return html`<ox-input-file\n name=${tag}\n label=\"Attach Files\"\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n disabled\n ></ox-input-file>`\n\n case 'string':\n default:\n return html` <input type=\"text\" name=${tag} value=${v} disabled />`\n }\n })\n\n return html` <label .title=${description}>\n <div name>${name}${unit ? `(${unit})` : ''}</div>\n <div description><mwc-icon>info_outline</mwc-icon> ${description}</div>\n <div elements>${elements}</div>\n </label>`\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js';
|
|
2
|
+
import './ox-data-sample-view';
|
|
3
|
+
import '@material/mwc-icon';
|
|
4
|
+
import { LitElement } from 'lit';
|
|
5
|
+
import { DataOoc, DataSet } from './types.js';
|
|
6
|
+
export declare class OxDataOocBriefView extends LitElement {
|
|
7
|
+
static styles: import("lit").CSSResult;
|
|
8
|
+
dataSet?: DataSet;
|
|
9
|
+
dataOoc?: DataOoc;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/input/ox-input-file.js';
|
|
3
|
+
import './ox-data-sample-view';
|
|
4
|
+
import '@material/mwc-icon';
|
|
5
|
+
import { css, html, LitElement } from 'lit';
|
|
6
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
7
|
+
let OxDataOocBriefView = class OxDataOocBriefView extends LitElement {
|
|
8
|
+
render() {
|
|
9
|
+
const { correctiveInstruction = '', correctiveAction = '', reviewer, reviewedAt, corrector, correctedAt, state } = this.dataOoc || {};
|
|
10
|
+
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
11
|
+
return html `
|
|
12
|
+
<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
|
|
13
|
+
|
|
14
|
+
<h3 state ?danger=${state != 'CORRECTED'} ?complete=${state == 'CORRECTED'}>
|
|
15
|
+
<mwc-icon>shield</mwc-icon>
|
|
16
|
+
<div>DATA OOC <span field-state>${state || ''}</span></div>
|
|
17
|
+
</h3>
|
|
18
|
+
|
|
19
|
+
<div instruction>
|
|
20
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective instruction</span></div>
|
|
21
|
+
<div content>${correctiveInstruction}</div>
|
|
22
|
+
${reviewer
|
|
23
|
+
? html `<div>
|
|
24
|
+
<mwc-icon>alarm</mwc-icon> ${formatter.format(new Date(reviewedAt))}
|
|
25
|
+
<mwc-icon>account_circle</mwc-icon>${reviewer.name}
|
|
26
|
+
</div>`
|
|
27
|
+
: html ``}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div action>
|
|
31
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective action</span></div>
|
|
32
|
+
<div content>${correctiveAction}</div>
|
|
33
|
+
${corrector
|
|
34
|
+
? html `<div>
|
|
35
|
+
<mwc-icon>alarm</mwc-icon> ${formatter.format(new Date(correctedAt))}
|
|
36
|
+
<mwc-icon>account_circle</mwc-icon>${corrector.name}
|
|
37
|
+
</div>`
|
|
38
|
+
: html ``}
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
OxDataOocBriefView.styles = css `
|
|
44
|
+
:host {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
background-color: var(--main-section-background-color);
|
|
48
|
+
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
h3 {
|
|
53
|
+
margin: var(--title-margin);
|
|
54
|
+
padding-top: 12px;
|
|
55
|
+
font: var(--title-font);
|
|
56
|
+
color: var(--title-text-color);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
h3[state] {
|
|
60
|
+
position: absolute;
|
|
61
|
+
margin: 0;
|
|
62
|
+
padding: 0;
|
|
63
|
+
right: 10px;
|
|
64
|
+
width: 90px;
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
mwc-icon {
|
|
69
|
+
font-size: 16px;
|
|
70
|
+
}
|
|
71
|
+
[state] mwc-icon {
|
|
72
|
+
font-size: 80px;
|
|
73
|
+
opacity: 0.4;
|
|
74
|
+
color: var(--primary-background-color);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[state] div {
|
|
78
|
+
position: absolute;
|
|
79
|
+
top: 22px;
|
|
80
|
+
left: 0;
|
|
81
|
+
right: 0;
|
|
82
|
+
font-size: 10px;
|
|
83
|
+
color: var(--theme-white-color);
|
|
84
|
+
}
|
|
85
|
+
[state] [field-state] {
|
|
86
|
+
display: block;
|
|
87
|
+
border-radius: 4px;
|
|
88
|
+
background-color: var(--primary-color);
|
|
89
|
+
box-shadow: var(--box-shadow);
|
|
90
|
+
margin-top: var(--margin-narrow);
|
|
91
|
+
padding: 1px 3px;
|
|
92
|
+
font-size: 0.8rem;
|
|
93
|
+
}
|
|
94
|
+
[danger] [field-state] {
|
|
95
|
+
background-color: var(--status-danger-color);
|
|
96
|
+
}
|
|
97
|
+
[complete] [field-state] {
|
|
98
|
+
background-color: var(--status-info-color);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
div[instruction] {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
|
|
105
|
+
padding: var(--padding-wide);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
div[instruction] div {
|
|
109
|
+
display: flex;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
div[instruction] div[content] {
|
|
113
|
+
display: flex;
|
|
114
|
+
min-height: 50px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
div[action] {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
|
|
121
|
+
padding: var(--padding-wide);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
div[action] div {
|
|
125
|
+
display: flex;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
div[action] div[content] {
|
|
129
|
+
display: flex;
|
|
130
|
+
min-height: 50px;
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
__decorate([
|
|
134
|
+
property({ type: Object })
|
|
135
|
+
], OxDataOocBriefView.prototype, "dataSet", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
property({ type: Object })
|
|
138
|
+
], OxDataOocBriefView.prototype, "dataOoc", void 0);
|
|
139
|
+
OxDataOocBriefView = __decorate([
|
|
140
|
+
customElement('ox-data-ooc-brief-view')
|
|
141
|
+
], OxDataOocBriefView);
|
|
142
|
+
export { OxDataOocBriefView };
|
|
143
|
+
//# sourceMappingURL=ox-data-ooc-brief-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-data-ooc-brief-view.js","sourceRoot":"","sources":["../../src/ox-data-ooc-brief-view.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAOpD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IA+FhD,MAAM;QACJ,MAAM,EACJ,qBAAqB,GAAG,EAAE,EAC1B,gBAAgB,GAAG,EAAE,EACrB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EACX,KAAK,EACN,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAA;QACtB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;QAExG,OAAO,IAAI,CAAA;yCAC0B,IAAI,CAAC,OAAO;;0BAE3B,KAAK,IAAI,WAAW,cAAc,KAAK,IAAI,WAAW;;0CAEtC,KAAK,IAAI,EAAE;;;;;uBAK9B,qBAAqB;UAClC,QAAQ;YACR,CAAC,CAAC,IAAI,CAAA;2CAC2B,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAW,CAAC,CAAC;mDAC/B,QAAQ,CAAC,IAAI;mBAC7C;YACT,CAAC,CAAC,IAAI,CAAA,EAAE;;;;;uBAKK,gBAAgB;UAC7B,SAAS;YACT,CAAC,CAAC,IAAI,CAAA;2CAC2B,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,WAAY,CAAC,CAAC;mDAChC,SAAS,CAAC,IAAI;mBAC9C;YACT,CAAC,CAAC,IAAI,CAAA,EAAE;;KAEb,CAAA;IACH,CAAC;;AAxIM,yBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAkB;AA7FlC,kBAAkB;IAD9B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,kBAAkB,CA0I9B;SA1IY,kBAAkB","sourcesContent":["import '@operato/input/ox-input-file.js'\nimport './ox-data-sample-view'\nimport '@material/mwc-icon'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { DataOoc, DataSet } from './types.js'\n\n@customElement('ox-data-ooc-brief-view')\nexport class OxDataOocBriefView extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n\n position: relative;\n }\n\n h3 {\n margin: var(--title-margin);\n padding-top: 12px;\n font: var(--title-font);\n color: var(--title-text-color);\n }\n\n h3[state] {\n position: absolute;\n margin: 0;\n padding: 0;\n right: 10px;\n width: 90px;\n text-align: center;\n }\n\n mwc-icon {\n font-size: 16px;\n }\n [state] mwc-icon {\n font-size: 80px;\n opacity: 0.4;\n color: var(--primary-background-color);\n }\n\n [state] div {\n position: absolute;\n top: 22px;\n left: 0;\n right: 0;\n font-size: 10px;\n color: var(--theme-white-color);\n }\n [state] [field-state] {\n display: block;\n border-radius: 4px;\n background-color: var(--primary-color);\n box-shadow: var(--box-shadow);\n margin-top: var(--margin-narrow);\n padding: 1px 3px;\n font-size: 0.8rem;\n }\n [danger] [field-state] {\n background-color: var(--status-danger-color);\n }\n [complete] [field-state] {\n background-color: var(--status-info-color);\n }\n\n div[instruction] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n div[instruction] div {\n display: flex;\n }\n\n div[instruction] div[content] {\n display: flex;\n min-height: 50px;\n }\n\n div[action] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n div[action] div {\n display: flex;\n }\n\n div[action] div[content] {\n display: flex;\n min-height: 50px;\n }\n `\n\n @property({ type: Object }) dataSet?: DataSet\n @property({ type: Object }) dataOoc?: DataOoc\n\n render() {\n const {\n correctiveInstruction = '',\n correctiveAction = '',\n reviewer,\n reviewedAt,\n corrector,\n correctedAt,\n state\n } = this.dataOoc || {}\n const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\n return html`\n <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>\n\n <h3 state ?danger=${state != 'CORRECTED'} ?complete=${state == 'CORRECTED'}>\n <mwc-icon>shield</mwc-icon>\n <div>DATA OOC <span field-state>${state || ''}</span></div>\n </h3>\n\n <div instruction>\n <div><mwc-icon>build_circle</mwc-icon> <span>corrective instruction</span></div>\n <div content>${correctiveInstruction}</div>\n ${reviewer\n ? html`<div>\n <mwc-icon>alarm</mwc-icon> ${formatter.format(new Date(reviewedAt!))}\n <mwc-icon>account_circle</mwc-icon>${reviewer.name}\n </div>`\n : html``}\n </div>\n\n <div action>\n <div><mwc-icon>build_circle</mwc-icon> <span>corrective action</span></div>\n <div content>${correctiveAction}</div>\n ${corrector\n ? html`<div>\n <mwc-icon>alarm</mwc-icon> ${formatter.format(new Date(correctedAt!))}\n <mwc-icon>account_circle</mwc-icon>${corrector.name}\n </div>`\n : html``}\n </div>\n `\n }\n}\n"]}
|
|
@@ -3,6 +3,9 @@ import './ox-data-sample-view';
|
|
|
3
3
|
import '@material/mwc-icon';
|
|
4
4
|
import { LitElement } from 'lit';
|
|
5
5
|
import { DataOoc, DataSet } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated by ox-data-ooc-brief-view
|
|
8
|
+
*/
|
|
6
9
|
export declare class OxDataOocView extends LitElement {
|
|
7
10
|
static styles: import("lit").CSSResult;
|
|
8
11
|
dataSet?: DataSet;
|
|
@@ -5,24 +5,25 @@ import '@material/mwc-icon';
|
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { customElement, property } from 'lit/decorators.js';
|
|
7
7
|
import { i18next } from '@operato/i18n';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated by ox-data-ooc-brief-view
|
|
10
|
+
*/
|
|
8
11
|
let OxDataOocView = class OxDataOocView extends LitElement {
|
|
9
12
|
render() {
|
|
10
|
-
|
|
11
|
-
const history = ((_a = this.dataOoc) === null || _a === void 0 ? void 0 : _a.history) || [];
|
|
13
|
+
const { history = [], state } = this.dataOoc || {};
|
|
12
14
|
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
13
15
|
return html `
|
|
14
16
|
<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
|
|
15
17
|
|
|
16
|
-
<h3 state>
|
|
17
|
-
<!--상태에 따라 추가로 danger, complate를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->
|
|
18
|
+
<h3 state ?danger=${state != 'CORRECTED'} ?complete=${state == 'CORRECTED'}>
|
|
18
19
|
<mwc-icon>shield</mwc-icon>
|
|
19
|
-
<div
|
|
20
|
+
<div>DATA OOC <span field-state>${state || ''}</span></div>
|
|
20
21
|
</h3>
|
|
21
22
|
|
|
22
23
|
<h3>${i18next.t('title.history')}</h3>
|
|
23
24
|
${history.map(({ user, state, comment, timestamp }) => html `
|
|
24
25
|
<p page-history>
|
|
25
|
-
<!--상태에 따라 추가로 danger,
|
|
26
|
+
<!--상태에 따라 추가로 danger, complete를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->
|
|
26
27
|
<span field-info
|
|
27
28
|
>${formatter.format(new Date(timestamp))} <mwc-icon>account_circle</mwc-icon>${user.name}</span
|
|
28
29
|
>
|
|
@@ -87,7 +88,7 @@ OxDataOocView.styles = css `
|
|
|
87
88
|
[danger] [field-state] {
|
|
88
89
|
background-color: var(--status-danger-color);
|
|
89
90
|
}
|
|
90
|
-
[
|
|
91
|
+
[complete] [field-state] {
|
|
91
92
|
background-color: var(--status-info-color);
|
|
92
93
|
}
|
|
93
94
|
[page-history] [field-state] {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-data-ooc-view.js","sourceRoot":"","sources":["../../src/ox-data-ooc-view.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-data-ooc-view.js","sourceRoot":"","sources":["../../src/ox-data-ooc-view.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,oBAAoB,CAAA;AAE3B,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,EAAE,CAAC;8CAAkB;AA3FlC,aAAa;IADzB,aAAa,CAAC,kBAAkB,CAAC;GACrB,aAAa,CAwHzB;SAxHY,aAAa","sourcesContent":["import '@operato/input/ox-input-file.js'\nimport './ox-data-sample-view'\nimport '@material/mwc-icon'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { DataOoc, DataSet } from './types.js'\n\n/**\n * @deprecated by ox-data-ooc-brief-view\n */\n@customElement('ox-data-ooc-view')\nexport class OxDataOocView extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n\n position: relative;\n }\n\n h3 {\n margin: var(--title-margin);\n padding-top: 12px;\n font: var(--title-font);\n color: var(--title-text-color);\n }\n\n h3[state] {\n position: absolute;\n margin: 0;\n padding: 0;\n right: 10px;\n width: 90px;\n text-align: center;\n }\n\n mwc-icon {\n font-size: 16px;\n }\n [state] mwc-icon {\n font-size: 80px;\n opacity: 0.4;\n color: var(--primary-background-color);\n }\n\n [state] div {\n position: absolute;\n top: 22px;\n left: 0;\n right: 0;\n font-size: 10px;\n color: var(--theme-white-color);\n }\n [state] [field-state] {\n display: block;\n border-radius: 4px;\n background-color: var(--primary-color);\n box-shadow: var(--box-shadow);\n margin-top: var(--margin-narrow);\n padding: 1px 3px;\n font-size: 0.8rem;\n }\n [danger] [field-state] {\n background-color: var(--status-danger-color);\n }\n [complete] [field-state] {\n background-color: var(--status-info-color);\n }\n [page-history] [field-state] {\n border-radius: 2px;\n background-color: var(--primary-color);\n margin-left: var(--margin-default);\n padding: 1px 2px;\n font-size: 0.7rem;\n color: var(--theme-white-color);\n }\n [page-history] {\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n border-radius: var(--border-radius);\n margin: var(--page-description-margin);\n padding: var(--padding-default);\n font: var(--page-description-font);\n color: var(--secondary-color);\n }\n [page-history] mwc-icon {\n position: relative;\n top: 3px;\n margin: 0 2px 0 10px;\n }\n [field-info] {\n opacity: 0.7;\n }\n [page-history] strong {\n display: block;\n font-weight: bold;\n font-size: 0.9rem;\n }\n `\n\n @property({ type: Object }) dataSet?: DataSet\n @property({ type: Object }) dataOoc?: DataOoc\n\n render() {\n const { history = [], state } = this.dataOoc || {}\n const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\n return html`\n <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>\n\n <h3 state ?danger=${state != 'CORRECTED'} ?complete=${state == 'CORRECTED'}>\n <mwc-icon>shield</mwc-icon>\n <div>DATA OOC <span field-state>${state || ''}</span></div>\n </h3>\n\n <h3>${i18next.t('title.history')}</h3>\n ${history.map(\n ({ user, state, comment, timestamp }) => html`\n <p page-history>\n <!--상태에 따라 추가로 danger, complete를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->\n <span field-info\n >${formatter.format(new Date(timestamp))} <mwc-icon>account_circle</mwc-icon>${user.name}</span\n >\n <span field-state>${state}</span>\n <strong>${comment}</strong>\n </p>\n `\n )}\n `\n }\n}\n"]}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -80,7 +80,18 @@ export type DataSample = {
|
|
|
80
80
|
export type DataOocState = 'CREATED' | 'REVIEWED' | 'CORRECTED';
|
|
81
81
|
export type DataOoc = DataSample & {
|
|
82
82
|
state: DataOocState;
|
|
83
|
-
|
|
83
|
+
correctiveInstruction?: string;
|
|
84
|
+
correctiveAction?: string;
|
|
85
|
+
reviewer?: {
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
};
|
|
89
|
+
reviewedAt?: Date;
|
|
90
|
+
corrector?: {
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
};
|
|
94
|
+
correctedAt?: Date;
|
|
84
95
|
history: {
|
|
85
96
|
user: {
|
|
86
97
|
id: string;
|
package/dist/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export type SelectOption = { text: string; value: string }\nexport type SelectOptions = SelectOption[]\nexport type TypeOptions = {\n options?: SelectOptions\n [prop: string]: any\n}\n\nexport type DataItem = {\n name: string\n description: string\n sequence: number\n tag: string\n type: string\n active: boolean\n options: TypeOptions\n unit: string\n quota: number\n spec: {\n [useCase: string]: {\n [limit: string]: number | string | string[] | boolean\n }\n }\n}\n\nexport type DataSet = {\n name: string\n description: string\n type: 'manual' | 'automatic'\n useCase: string\n active: boolean\n dataItems: DataItem[]\n spec: { [dataItem: string]: { [useCase: string]: any } }\n}\n\nexport type DataSpecDefinition = {\n type: string\n label: string\n name: string\n property?: { [option: string]: any }\n}\n\nexport type UseCaseDefinition = {\n name: string\n description: string\n help: string\n specs: DataSpecDefinition[]\n}\n\nexport type DataSpecLimit = {\n [limit: string]: number | string | string[] | boolean\n}\n\nexport type DataSpecLimitSet = {\n [useCase: string]: DataSpecLimit\n}\n\nexport type DataCollection = {\n [tag: string]: any\n}\n\nexport type Judgment = {\n [tag: string]: {\n ooc: boolean\n oos: boolean\n }\n}\n\nexport type DataSample = {\n name: string\n description: string\n useCase: string\n data?: DataCollection\n judgment?: Judgment\n dataItems?: DataItem[]\n quota: number\n workDate: string\n workShift: string\n collectedAt: Date\n}\n\nexport type DataOocState = 'CREATED' | 'REVIEWED' | 'CORRECTED'\n\nexport type DataOoc = DataSample & {\n state: DataOocState\n correctiveAction: string\n history: {\n user: {\n id: string\n name: string\n }\n state: DataOocState\n comment: string\n timestamp: number\n }[]\n}\n\nexport type EvaluationResult = { oos: boolean; ooc: boolean }\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export type SelectOption = { text: string; value: string }\nexport type SelectOptions = SelectOption[]\nexport type TypeOptions = {\n options?: SelectOptions\n [prop: string]: any\n}\n\nexport type DataItem = {\n name: string\n description: string\n sequence: number\n tag: string\n type: string\n active: boolean\n options: TypeOptions\n unit: string\n quota: number\n spec: {\n [useCase: string]: {\n [limit: string]: number | string | string[] | boolean\n }\n }\n}\n\nexport type DataSet = {\n name: string\n description: string\n type: 'manual' | 'automatic'\n useCase: string\n active: boolean\n dataItems: DataItem[]\n spec: { [dataItem: string]: { [useCase: string]: any } }\n}\n\nexport type DataSpecDefinition = {\n type: string\n label: string\n name: string\n property?: { [option: string]: any }\n}\n\nexport type UseCaseDefinition = {\n name: string\n description: string\n help: string\n specs: DataSpecDefinition[]\n}\n\nexport type DataSpecLimit = {\n [limit: string]: number | string | string[] | boolean\n}\n\nexport type DataSpecLimitSet = {\n [useCase: string]: DataSpecLimit\n}\n\nexport type DataCollection = {\n [tag: string]: any\n}\n\nexport type Judgment = {\n [tag: string]: {\n ooc: boolean\n oos: boolean\n }\n}\n\nexport type DataSample = {\n name: string\n description: string\n useCase: string\n data?: DataCollection\n judgment?: Judgment\n dataItems?: DataItem[]\n quota: number\n workDate: string\n workShift: string\n collectedAt: Date\n}\n\nexport type DataOocState = 'CREATED' | 'REVIEWED' | 'CORRECTED'\n\nexport type DataOoc = DataSample & {\n state: DataOocState\n correctiveInstruction?: string\n correctiveAction?: string\n reviewer?: {\n id: string\n name: string\n }\n reviewedAt?: Date\n corrector?: {\n id: string\n name: string\n }\n correctedAt?: Date\n history: {\n user: {\n id: string\n name: string\n }\n state: DataOocState\n comment: string\n timestamp: number\n }[]\n}\n\nexport type EvaluationResult = { oos: boolean; ooc: boolean }\n"]}
|