@operato/board 7.0.9 → 7.0.11
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 +9 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -1
- package/dist/src/ox-board-component-info.js +2 -1
- package/dist/src/ox-board-component-info.js.map +1 -1
- package/dist/src/ox-board-viewer.d.ts +1 -0
- package/dist/src/ox-board-viewer.js +30 -0
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +1 -0
- package/src/ox-board-component-info.ts +2 -1
- package/src/ox-board-viewer.ts +38 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@operato/board",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.11",
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
5
5
|
"author": "heartyoh",
|
6
6
|
"main": "dist/src/index.js",
|
@@ -155,5 +155,5 @@
|
|
155
155
|
"prettier --write"
|
156
156
|
]
|
157
157
|
},
|
158
|
-
"gitHead": "
|
158
|
+
"gitHead": "cbcfab84994b3bd1c2c3993703894249d9210c59"
|
159
159
|
}
|
@@ -77,6 +77,7 @@ export class PropertyEventTap extends LitElement {
|
|
77
77
|
<option value="start-scenario">start the given scenario</option>
|
78
78
|
<option value="run-scenario">run the given scenario</option>
|
79
79
|
<option value="export-data">export data</option>
|
80
|
+
<option value="import-data">import data</option>
|
80
81
|
</select>
|
81
82
|
|
82
83
|
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
@@ -52,6 +52,7 @@ export class BoardComponentInfo extends LitElement {
|
|
52
52
|
background-color: var(--md-sys-color-surface);
|
53
53
|
width: 100%;
|
54
54
|
margin: auto;
|
55
|
+
table-layout: fixed;
|
55
56
|
}
|
56
57
|
|
57
58
|
tr {
|
@@ -67,7 +68,7 @@ export class BoardComponentInfo extends LitElement {
|
|
67
68
|
[subTh] {
|
68
69
|
text-align: center !important;
|
69
70
|
font-weight: bold;
|
70
|
-
|
71
|
+
width: 40px;
|
71
72
|
text-transform: capitalize;
|
72
73
|
background-color: rgba(0, 0, 0, 0.05);
|
73
74
|
}
|
package/src/ox-board-viewer.ts
CHANGED
@@ -392,6 +392,7 @@ export class BoardViewer extends LitElement {
|
|
392
392
|
this._scene.on('start-scenario', this.onStartScenario, this)
|
393
393
|
this._scene.on('run-scenario', this.onRunScenario, this)
|
394
394
|
this._scene.on('export-data', this.onExportData, this)
|
395
|
+
this._scene.on('import-data', this.onImportData, this)
|
395
396
|
this._scene.on('click', this.onClickEvent, this)
|
396
397
|
}
|
397
398
|
|
@@ -405,6 +406,7 @@ export class BoardViewer extends LitElement {
|
|
405
406
|
scene.off('start-scenario', this.onStartScenario, this)
|
406
407
|
scene.off('run-scenario', this.onRunScenario, this)
|
407
408
|
scene.off('export-data', this.onExportData, this)
|
409
|
+
scene.off('import-data', this.onImportData, this)
|
408
410
|
scene.off('click', this.onClickEvent, this)
|
409
411
|
}
|
410
412
|
|
@@ -572,6 +574,42 @@ export class BoardViewer extends LitElement {
|
|
572
574
|
}
|
573
575
|
}
|
574
576
|
|
577
|
+
async onImportData(_: string, value: string | number | object, component: Component) {
|
578
|
+
const fileInput = document.createElement('input')
|
579
|
+
fileInput.type = 'file'
|
580
|
+
fileInput.accept = '.xlsx, .xls'
|
581
|
+
fileInput.style.display = 'none'
|
582
|
+
|
583
|
+
fileInput.addEventListener(
|
584
|
+
'change',
|
585
|
+
(event: Event) => {
|
586
|
+
const input = event.target as HTMLInputElement
|
587
|
+
const file = input.files?.[0]
|
588
|
+
if (!file) {
|
589
|
+
return
|
590
|
+
}
|
591
|
+
|
592
|
+
const reader = new FileReader()
|
593
|
+
reader.onload = function (event) {
|
594
|
+
const data = new Uint8Array(event.target?.result as ArrayBuffer)
|
595
|
+
const workbook = XLSX.read(data, { type: 'array' })
|
596
|
+
|
597
|
+
// 첫 번째 시트의 데이타만 가져온다.
|
598
|
+
const firstSheetName = workbook.SheetNames[0]
|
599
|
+
const worksheet = workbook.Sheets[firstSheetName]
|
600
|
+
component.data = XLSX.utils.sheet_to_json(worksheet)
|
601
|
+
|
602
|
+
input.remove()
|
603
|
+
}
|
604
|
+
reader.readAsArrayBuffer(file)
|
605
|
+
},
|
606
|
+
false
|
607
|
+
)
|
608
|
+
|
609
|
+
document.body.appendChild(fileInput)
|
610
|
+
fileInput.click()
|
611
|
+
}
|
612
|
+
|
575
613
|
onClickEvent(e: MouseEvent, hint: any) {
|
576
614
|
const component = hint.origin
|
577
615
|
|