@operato/dataset 1.0.0-alpha.9 → 1.0.0-beta.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 +404 -0
- package/demo/index.html +8 -90
- package/demo/ox-data-entry-form.html +118 -0
- package/demo/ox-data-item-spec.html +152 -0
- package/demo/ox-data-ooc-view.html +185 -0
- package/demo/ox-data-sample-view.html +150 -0
- package/demo/ox-grist-editor-data-item-spec.html +476 -0
- package/dist/src/grist-editor/index.d.ts +1 -0
- package/dist/src/grist-editor/index.js +7 -0
- package/dist/src/grist-editor/index.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.d.ts +11 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js +77 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-data-item-spec.d.ts +13 -0
- package/dist/src/grist-editor/ox-popup-data-item-spec.js +90 -0
- package/dist/src/grist-editor/ox-popup-data-item-spec.js.map +1 -0
- package/dist/src/index.d.ts +6 -1
- package/dist/src/index.js +6 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-data-entry-form.d.ts +1 -24
- package/dist/src/ox-data-entry-form.js +12 -16
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-item-spec.d.ts +18 -0
- package/dist/src/ox-data-item-spec.js +77 -0
- package/dist/src/ox-data-item-spec.js.map +1 -0
- package/dist/src/ox-data-ooc-view.d.ts +10 -0
- package/dist/src/ox-data-ooc-view.js +69 -0
- package/dist/src/ox-data-ooc-view.js.map +1 -0
- package/dist/src/ox-data-sample-view copy.d.ts +13 -0
- package/dist/src/ox-data-sample-view copy.js +214 -0
- package/dist/src/ox-data-sample-view copy.js.map +1 -0
- package/dist/src/ox-data-sample-view.d.ts +13 -0
- package/dist/src/ox-data-sample-view.js +168 -0
- package/dist/src/ox-data-sample-view.js.map +1 -0
- package/dist/src/ox-data-use-case.d.ts +16 -0
- package/dist/src/ox-data-use-case.js +111 -0
- package/dist/src/ox-data-use-case.js.map +1 -0
- package/dist/src/types.d.ts +78 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -12
- package/src/grist-editor/index.ts +10 -0
- package/src/grist-editor/ox-grist-editor-data-item-spec.ts +92 -0
- package/src/grist-editor/ox-popup-data-item-spec.ts +90 -0
- package/src/index.ts +6 -1
- package/src/ox-data-entry-form.ts +13 -37
- package/src/ox-data-item-spec.ts +74 -0
- package/src/ox-data-ooc-view.ts +67 -0
- package/src/ox-data-sample-view.ts +175 -0
- package/src/ox-data-use-case.ts +147 -0
- package/src/types.ts +72 -0
- package/themes/grist-theme.css +194 -0
- package/themes/oops-theme.css +26 -0
- package/themes/report-theme.css +47 -0
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '../ox-data-item-spec.js';
|
|
3
|
+
import { LitElement, css, html } from 'lit';
|
|
4
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
6
|
+
import { i18next } from '@operato/i18n';
|
|
7
|
+
let OxPopupDataItemSpec = class OxPopupDataItemSpec extends LitElement {
|
|
8
|
+
render() {
|
|
9
|
+
var dataItem = this.dataItem || {};
|
|
10
|
+
return html `
|
|
11
|
+
<ox-data-item-spec .value=${this.value} .dataItem=${dataItem} @change=${this.onChange.bind(this)}>
|
|
12
|
+
</ox-data-item-spec>
|
|
13
|
+
|
|
14
|
+
<div class="button-container">
|
|
15
|
+
<mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
|
|
16
|
+
<mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
onChange(e) {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
/*
|
|
23
|
+
주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
|
|
24
|
+
layout의 구성에 변화가 발생하면, 다시 render된다.
|
|
25
|
+
이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
|
|
26
|
+
이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
|
|
27
|
+
만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
|
|
28
|
+
따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
|
|
29
|
+
(이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
|
|
30
|
+
=>
|
|
31
|
+
이런 이유로, Object.assign(...)을 사용하였다.
|
|
32
|
+
*/
|
|
33
|
+
this.value = e.detail;
|
|
34
|
+
}
|
|
35
|
+
onCancel(e) {
|
|
36
|
+
history.back();
|
|
37
|
+
}
|
|
38
|
+
onConfirm(e) {
|
|
39
|
+
this.confirmCallback && this.confirmCallback(this.value);
|
|
40
|
+
history.back();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
OxPopupDataItemSpec.styles = [
|
|
44
|
+
ScrollbarStyles,
|
|
45
|
+
css `
|
|
46
|
+
:host {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
|
|
50
|
+
background-color: #fff;
|
|
51
|
+
|
|
52
|
+
width: var(--overlay-center-normal-width, 50%);
|
|
53
|
+
height: var(--overlay-center-normal-height, 50%);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ox-data-item-spec {
|
|
57
|
+
flex: 1;
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
span {
|
|
62
|
+
flex: 1;
|
|
63
|
+
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
|
|
68
|
+
color: var(--primary-color);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.button-container {
|
|
72
|
+
display: flex;
|
|
73
|
+
margin-left: auto;
|
|
74
|
+
}
|
|
75
|
+
`
|
|
76
|
+
];
|
|
77
|
+
__decorate([
|
|
78
|
+
property({ type: Object })
|
|
79
|
+
], OxPopupDataItemSpec.prototype, "value", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: Object })
|
|
82
|
+
], OxPopupDataItemSpec.prototype, "dataItem", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
property({ type: Object })
|
|
85
|
+
], OxPopupDataItemSpec.prototype, "confirmCallback", void 0);
|
|
86
|
+
OxPopupDataItemSpec = __decorate([
|
|
87
|
+
customElement('ox-popup-data-item-spec')
|
|
88
|
+
], OxPopupDataItemSpec);
|
|
89
|
+
export { OxPopupDataItemSpec };
|
|
90
|
+
//# sourceMappingURL=ox-popup-data-item-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-popup-data-item-spec.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-popup-data-item-spec.ts"],"names":[],"mappings":";AAAA,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,UAAU;IAwCjD,MAAM;QACJ,IAAI,QAAQ,GAAG,IAA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'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { DataItem } from '../types.js'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-popup-data-item-spec')\nexport class OxPopupDataItemSpec extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-data-item-spec {\n flex: 1;\n overflow-y: auto;\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) dataItem?: DataItem\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n var dataItem = this.dataItem || {}\n\n return html`\n <ox-data-item-spec .value=${this.value} .dataItem=${dataItem} @change=${this.onChange.bind(this)}>\n </ox-data-item-spec>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n private onChange(e: CustomEvent) {\n e.stopPropagation()\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n this.value = e.detail\n }\n\n private onCancel(e: Event) {\n history.back()\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n history.back()\n }\n}\n"]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export * from './ox-data-entry-form';
|
|
1
|
+
export * from './ox-data-entry-form.js';
|
|
2
|
+
export * from './ox-data-sample-view.js';
|
|
3
|
+
export * from './ox-data-ooc-view.js';
|
|
4
|
+
export * from './ox-data-item-spec.js';
|
|
5
|
+
export * from './ox-data-use-case';
|
|
6
|
+
export * from './types.js';
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export * from './ox-data-entry-form';
|
|
1
|
+
export * from './ox-data-entry-form.js';
|
|
2
|
+
export * from './ox-data-sample-view.js';
|
|
3
|
+
export * from './ox-data-ooc-view.js';
|
|
4
|
+
export * from './ox-data-item-spec.js';
|
|
5
|
+
export * from './ox-data-use-case';
|
|
6
|
+
export * from './types.js';
|
|
2
7
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA","sourcesContent":["export * from './ox-data-entry-form.js'\nexport * from './ox-data-sample-view.js'\nexport * from './ox-data-ooc-view.js'\nexport * from './ox-data-item-spec.js'\nexport * from './ox-data-use-case'\nexport * from './types.js'\n"]}
|
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
import '@operato/input/ox-input-file.js';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
|
|
4
|
-
text: string;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
declare type SelectOptions = SelectOption[];
|
|
8
|
-
declare type TypeOptions = {
|
|
9
|
-
options?: SelectOptions;
|
|
10
|
-
[prop: string]: any;
|
|
11
|
-
};
|
|
12
|
-
export declare type DataItem = {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
sequence: number;
|
|
16
|
-
tag: string;
|
|
17
|
-
type: string;
|
|
18
|
-
options: TypeOptions;
|
|
19
|
-
quota: number;
|
|
20
|
-
};
|
|
21
|
-
export declare type DataSet = {
|
|
22
|
-
name: string;
|
|
23
|
-
description: string;
|
|
24
|
-
dataItems: DataItem[];
|
|
25
|
-
};
|
|
3
|
+
import { DataSet } from './types.js';
|
|
26
4
|
export declare class OxDataEntryForm extends LitElement {
|
|
27
5
|
static styles: import("lit").CSSResult;
|
|
28
6
|
dataSet?: DataSet;
|
|
@@ -34,4 +12,3 @@ export declare class OxDataEntryForm extends LitElement {
|
|
|
34
12
|
private buildInputs;
|
|
35
13
|
private buildValue;
|
|
36
14
|
}
|
|
37
|
-
export {};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import '@operato/input/ox-input-file.js';
|
|
3
|
-
import {
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
5
|
let OxDataEntryForm = class OxDataEntryForm extends LitElement {
|
|
6
6
|
render() {
|
|
7
7
|
return html `<form @change=${(e) => this.onChange(e)}>${this.buildInputs()}</form>`;
|
|
8
8
|
}
|
|
9
9
|
onChange(e) {
|
|
10
|
-
|
|
10
|
+
this.value = this.buildValue();
|
|
11
11
|
this.dispatchEvent(new CustomEvent('change', {
|
|
12
12
|
bubbles: true,
|
|
13
13
|
composed: true,
|
|
14
|
-
detail: value
|
|
14
|
+
detail: this.value
|
|
15
15
|
}));
|
|
16
16
|
}
|
|
17
17
|
buildInputs() {
|
|
18
|
-
const dataItems = this.dataSet.dataItems;
|
|
18
|
+
const dataItems = this.dataSet.dataItems.filter(item => item.active);
|
|
19
19
|
return (dataItems || []).map(dataItem => {
|
|
20
|
-
|
|
21
|
-
const { name, description, tag, type, quota = 1, options = {} } = dataItem;
|
|
20
|
+
const { name, description, tag, type, quota = 1, options = {}, unit } = dataItem;
|
|
22
21
|
const samples = new Array(quota).fill(0);
|
|
23
|
-
const value =
|
|
22
|
+
const value = this.value && this.value[tag];
|
|
24
23
|
const elements = samples.map((_, idx) => {
|
|
25
|
-
const v =
|
|
24
|
+
const v = value instanceof Array ? value[idx] : idx === 0 ? value : undefined;
|
|
26
25
|
switch (type) {
|
|
27
26
|
case 'select':
|
|
28
27
|
return html ` <select .name=${tag}>
|
|
@@ -50,7 +49,7 @@ let OxDataEntryForm = class OxDataEntryForm extends LitElement {
|
|
|
50
49
|
}
|
|
51
50
|
});
|
|
52
51
|
return html ` <label .title=${description}>
|
|
53
|
-
<div name>${name}</div>
|
|
52
|
+
<div name>${name}${unit ? `(${unit})` : ''}</div>
|
|
54
53
|
<div elements>${elements}</div>
|
|
55
54
|
</label>`;
|
|
56
55
|
});
|
|
@@ -58,15 +57,10 @@ let OxDataEntryForm = class OxDataEntryForm extends LitElement {
|
|
|
58
57
|
buildValue() {
|
|
59
58
|
const dataItems = this.dataSet.dataItems;
|
|
60
59
|
return (dataItems || []).reduce((sum, dataItem) => {
|
|
61
|
-
const { tag,
|
|
60
|
+
const { tag, type } = dataItem;
|
|
62
61
|
const editors = Array.prototype.slice.call(this.renderRoot.querySelectorAll(`[name=${tag}]`));
|
|
63
62
|
if (editors.length > 0) {
|
|
64
|
-
sum[tag] =
|
|
65
|
-
editors.length > 1
|
|
66
|
-
? editors.map(editor => (type === 'boolean' ? editor.checked : editor.value))
|
|
67
|
-
: type === 'boolean'
|
|
68
|
-
? editors[0].checked
|
|
69
|
-
: editors[0].value;
|
|
63
|
+
sum[tag] = editors.map(editor => (type === 'boolean' ? editor.checked : editor.value));
|
|
70
64
|
}
|
|
71
65
|
return sum;
|
|
72
66
|
}, {});
|
|
@@ -95,6 +89,7 @@ OxDataEntryForm.styles = css `
|
|
|
95
89
|
background-color: var(--main-section-background-color);
|
|
96
90
|
padding: var(--padding-default) 0;
|
|
97
91
|
}
|
|
92
|
+
|
|
98
93
|
div[name] {
|
|
99
94
|
grid-column: span 2 / auto;
|
|
100
95
|
font: var(--label-font);
|
|
@@ -119,6 +114,7 @@ OxDataEntryForm.styles = css `
|
|
|
119
114
|
padding: var(--input-field-padding);
|
|
120
115
|
font: var(--input-field-font);
|
|
121
116
|
}
|
|
117
|
+
|
|
122
118
|
@media only screen and (max-width: 460px) {
|
|
123
119
|
div[name] {
|
|
124
120
|
grid-column: span 3 / auto;
|
|
@@ -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,
|
|
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;AAK3D,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,UAAU;IA+D7C,MAAM;QACJ,OAAO,IAAI,CAAA,iBAAiB,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,SAAS,CAAA;IAC3F,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,IA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AAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;aACvF;YAED,OAAO,GAAG,CAAA;QACZ,CAAC,EAAE,EAA4B,CAAC,CAAA;IAClC,CAAC;CACF,CAAA;AAnJQ,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA+B;AA7D/C,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CAoJ3B;SApJY,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 }\n\n form {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n label {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n gap: 9px;\n align-items: center;\n margin-bottom: var(--margin-default);\n }\n label:nth-child(even) {\n background-color: var(--main-section-background-color);\n padding: var(--padding-default) 0;\n }\n\n div[name] {\n grid-column: span 2 / auto;\n font: var(--label-font);\n color: var(--label-color);\n text-align: right;\n }\n div[elements] {\n grid-column: span 10 / auto;\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 div[name] {\n grid-column: span 3 / auto;\n }\n div[elements] {\n grid-column: span 9 / auto;\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)}>${this.buildInputs()}</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=\"string\" name=${tag} value=${v} />`\n }\n })\n\n return html` <label .title=${description}>\n <div name>${name}${unit ? `(${unit})` : ''}</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,18 @@
|
|
|
1
|
+
import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
2
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
+
import { DataItem, DataItemSpecSet } from './types.js';
|
|
4
|
+
export declare class OxDataItemSpec extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
value?: {
|
|
7
|
+
[specSetName: string]: any;
|
|
8
|
+
};
|
|
9
|
+
dataItem?: DataItem;
|
|
10
|
+
dataItemSpecSets: DataItemSpecSet[];
|
|
11
|
+
specSetViews: NodeListOf<HTMLElement & {
|
|
12
|
+
value: any;
|
|
13
|
+
}>;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
updated(changes: PropertyValues<this>): void;
|
|
16
|
+
private onChange;
|
|
17
|
+
private buildValue;
|
|
18
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { customElement, property, queryAll, state } from 'lit/decorators.js';
|
|
5
|
+
import { OxDataUseCase } from './ox-data-use-case.js';
|
|
6
|
+
let OxDataItemSpec = class OxDataItemSpec extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.dataItemSpecSets = [];
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return html `<form @property-change=${(e) => this.onChange(e)}>
|
|
13
|
+
${this.dataItemSpecSets.map(({ name, description, specs }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
return html ` <div specName>${name}</div>
|
|
16
|
+
<div description>${description}</div>
|
|
17
|
+
<ox-properties-dynamic-view data-name=${name} .props=${specs} .value=${(_a = this.value) === null || _a === void 0 ? void 0 : _a[name]}>
|
|
18
|
+
</ox-properties-dynamic-view>`;
|
|
19
|
+
})}
|
|
20
|
+
</form>`;
|
|
21
|
+
}
|
|
22
|
+
updated(changes) {
|
|
23
|
+
if (changes.has('dataItem')) {
|
|
24
|
+
this.dataItemSpecSets = OxDataUseCase.getUseCases().map(useCase => useCase.getSpecification(this.dataItem));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
onChange(e) {
|
|
28
|
+
this.value = this.buildValue();
|
|
29
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
30
|
+
bubbles: true,
|
|
31
|
+
composed: true,
|
|
32
|
+
detail: { ...this.value }
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
buildValue() {
|
|
36
|
+
var value = {};
|
|
37
|
+
this.specSetViews.forEach(view => (value[view.getAttribute('data-name')] = view.value));
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
OxDataItemSpec.styles = css `
|
|
42
|
+
:host {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
border-bottom: var(--border-dark-color);
|
|
46
|
+
padding: var(--margin-default) 0;
|
|
47
|
+
}
|
|
48
|
+
[specName] {
|
|
49
|
+
font: var(--legend-font);
|
|
50
|
+
color: var(--legend-text-color);
|
|
51
|
+
}
|
|
52
|
+
[description] {
|
|
53
|
+
font: var(--form-sublabel-font);
|
|
54
|
+
opacity: 0.8;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
form {
|
|
58
|
+
flex: 1;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
__decorate([
|
|
62
|
+
property({ type: Object })
|
|
63
|
+
], OxDataItemSpec.prototype, "value", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property({ type: Object })
|
|
66
|
+
], OxDataItemSpec.prototype, "dataItem", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
state()
|
|
69
|
+
], OxDataItemSpec.prototype, "dataItemSpecSets", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
queryAll('ox-properties-dynamic-view')
|
|
72
|
+
], OxDataItemSpec.prototype, "specSetViews", void 0);
|
|
73
|
+
OxDataItemSpec = __decorate([
|
|
74
|
+
customElement('ox-data-item-spec')
|
|
75
|
+
], OxDataItemSpec);
|
|
76
|
+
export { OxDataItemSpec };
|
|
77
|
+
//# sourceMappingURL=ox-data-item-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-data-item-spec.js","sourceRoot":"","sources":["../../src/ox-data-item-spec.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAE/D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAIrD,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,UAAU;IAA9C;;QAyBW,qBAAgB,GAAsB,EAAE,CAAA;IAuCnD,CAAC;IAnCC,MAAM;QACJ,OAAO,IAAI,CAAA,0BAA0B,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,gBAAgB,CAAC,GAAG,CACzB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE;;YAAC,OAAA,IAAI,CAAA,kBAAkB,IAAI;6BACvC,WAAW;kDACU,IAAI,WAAW,KAAK,WAAW,MAAA,IAAI,CAAC,KAAK,0CAAG,IAAI,CAAC;wCAC3D,CAAA;SAAA,CACjC;YACK,CAAA;IACV,CAAC;IAED,OAAO,CAAC,OAA6B;QACnC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC3B,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAS,CAAC,CAAC,CAAA;SAC7G;IACH,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;QAE9B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE;SAC1B,CAAC,CACH,CAAA;IACH,CAAC;IAEO,UAAU;QAChB,IAAI,KAAK,GAAG,EAAS,CAAA;QACrB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;QAExF,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAA;AA/DQ,qBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;GAmBlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAuC;AACtC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAoB;AAEtC;IAAR,KAAK,EAAE;wDAAyC;AAET;IAAvC,QAAQ,CAAC,4BAA4B,CAAC;oDAAwD;AA3BpF,cAAc;IAD1B,aAAa,CAAC,mBAAmB,CAAC;GACtB,cAAc,CAgE1B;SAhEY,cAAc","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, queryAll, state } from 'lit/decorators.js'\n\nimport { OxDataUseCase } from './ox-data-use-case.js'\nimport { DataItem, DataItemSpecSet } from './types.js'\n\n@customElement('ox-data-item-spec')\nexport class OxDataItemSpec extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: row;\n border-bottom: var(--border-dark-color);\n padding: var(--margin-default) 0;\n }\n [specName] {\n font: var(--legend-font);\n color: var(--legend-text-color);\n }\n [description] {\n font: var(--form-sublabel-font);\n opacity: 0.8;\n }\n\n form {\n flex: 1;\n }\n `\n\n @property({ type: Object }) value?: { [specSetName: string]: any }\n @property({ type: Object }) dataItem?: DataItem\n\n @state() dataItemSpecSets: DataItemSpecSet[] = []\n\n @queryAll('ox-properties-dynamic-view') specSetViews!: NodeListOf<HTMLElement & { value: any }>\n\n render() {\n return html`<form @property-change=${(e: Event) => this.onChange(e)}>\n ${this.dataItemSpecSets.map(\n ({ name, description, specs }) => html` <div specName>${name}</div>\n <div description>${description}</div>\n <ox-properties-dynamic-view data-name=${name} .props=${specs} .value=${this.value?.[name]}>\n </ox-properties-dynamic-view>`\n )}\n </form>`\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('dataItem')) {\n this.dataItemSpecSets = OxDataUseCase.getUseCases().map(useCase => useCase.getSpecification(this.dataItem!))\n }\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 buildValue() {\n var value = {} as any\n this.specSetViews.forEach(view => (value[view.getAttribute('data-name')!] = view.value))\n\n return value\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js';
|
|
2
|
+
import './ox-data-sample-view';
|
|
3
|
+
import { DataOoc, DataSet } from './types.js';
|
|
4
|
+
import { LitElement } from 'lit';
|
|
5
|
+
export declare class OxDataOocView extends LitElement {
|
|
6
|
+
static styles: import("lit").CSSResult;
|
|
7
|
+
dataSet?: DataSet;
|
|
8
|
+
dataOoc?: DataOoc;
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/input/ox-input-file.js';
|
|
3
|
+
import './ox-data-sample-view';
|
|
4
|
+
import { LitElement, css, html } from 'lit';
|
|
5
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
+
let OxDataOocView = class OxDataOocView extends LitElement {
|
|
7
|
+
render() {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
const history = ((_a = this.dataOoc) === null || _a === void 0 ? void 0 : _a.history) || [];
|
|
10
|
+
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
11
|
+
return html `
|
|
12
|
+
<ox-data-sample-view .dataSample=${this.dataOoc} .dataSet=${this.dataSet}></ox-data-sample-view>
|
|
13
|
+
|
|
14
|
+
<h3 state>${((_b = this.dataOoc) === null || _b === void 0 ? void 0 : _b.state) || ''}</h3>
|
|
15
|
+
|
|
16
|
+
<h3>history</h3>
|
|
17
|
+
${history.map(({ user, state, comment, timestamp }) => html `
|
|
18
|
+
<p page-description>
|
|
19
|
+
${formatter.format(new Date(timestamp))}
|
|
20
|
+
<br />
|
|
21
|
+
${state} by ${user.name}
|
|
22
|
+
<br />
|
|
23
|
+
${comment}
|
|
24
|
+
</p>
|
|
25
|
+
`)}
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
OxDataOocView.styles = css `
|
|
30
|
+
:host {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
background-color: var(--main-section-background-color);
|
|
34
|
+
padding: var(--padding-wide);
|
|
35
|
+
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h3 {
|
|
40
|
+
margin: var(--title-margin);
|
|
41
|
+
padding-top: 12px;
|
|
42
|
+
font: var(--title-font);
|
|
43
|
+
color: var(--title-text-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
h3[state] {
|
|
47
|
+
position: absolute;
|
|
48
|
+
|
|
49
|
+
right: 20px;
|
|
50
|
+
top: 25px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[page-description] {
|
|
54
|
+
margin: var(--page-description-margin);
|
|
55
|
+
font: var(--page-description-font);
|
|
56
|
+
color: var(--page-description-color);
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ type: Object })
|
|
61
|
+
], OxDataOocView.prototype, "dataSet", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
property({ type: Object })
|
|
64
|
+
], OxDataOocView.prototype, "dataOoc", void 0);
|
|
65
|
+
OxDataOocView = __decorate([
|
|
66
|
+
customElement('ox-data-ooc-view')
|
|
67
|
+
], OxDataOocView);
|
|
68
|
+
export { OxDataOocView };
|
|
69
|
+
//# sourceMappingURL=ox-data-ooc-view.js.map
|
|
@@ -0,0 +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;AAG9B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG3D,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,UAAU;IAmC3C,MAAM;;QACJ,MAAM,OAAO,GAAG,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,KAAI,EAAE,CAAA;QAC3C,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,aAAa,IAAI,CAAC,OAAO;;kBAE5D,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,KAAK,KAAI,EAAE;;;QAGnC,OAAO,CAAC,GAAG,CACX,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,IAAI,CAAA;;cAEvC,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;;cAErC,KAAK,OAAO,IAAI,CAAC,IAAI;;cAErB,OAAO;;SAEZ,CACF;KACF,CAAA;IACH,CAAC;CACF,CAAA;AAzDQ,oBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAkB;AAjClC,aAAa;IADzB,aAAa,CAAC,kBAAkB,CAAC;GACrB,aAAa,CA0DzB;SA1DY,aAAa","sourcesContent":["import '@operato/input/ox-input-file.js'\nimport './ox-data-sample-view'\n\nimport { DataOoc, DataSet } from './types.js'\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\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 padding: var(--padding-wide);\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\n right: 20px;\n top: 25px;\n }\n\n [page-description] {\n margin: var(--page-description-margin);\n font: var(--page-description-font);\n color: var(--page-description-color);\n }\n `\n\n @property({ type: Object }) dataSet?: DataSet\n @property({ type: Object }) dataOoc?: DataOoc\n\n render() {\n const history = this.dataOoc?.history || []\n const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\n return html`\n <ox-data-sample-view .dataSample=${this.dataOoc} .dataSet=${this.dataSet}></ox-data-sample-view>\n\n <h3 state>${this.dataOoc?.state || ''}</h3>\n\n <h3>history</h3>\n ${history.map(\n ({ user, state, comment, timestamp }) => html`\n <p page-description>\n ${formatter.format(new Date(timestamp))}\n <br />\n ${state} by ${user.name}\n <br />\n ${comment}\n </p>\n `\n )}\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js';
|
|
2
|
+
import { DataSample, DataSet } from './types.js';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
export declare class OxDataSampleView extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
dataSet?: DataSet;
|
|
7
|
+
dataSample?: DataSample;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
private onChange;
|
|
10
|
+
private buildSpec;
|
|
11
|
+
private buildValue;
|
|
12
|
+
private evaluateOOC;
|
|
13
|
+
}
|