@operato/board 7.0.2 → 7.0.7
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 +17 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +7 -3
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -1
- package/dist/src/ox-board-viewer.d.ts +1 -0
- package/dist/src/ox-board-viewer.js +15 -0
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -12
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +9 -5
- package/src/ox-board-viewer.ts +16 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@operato/board",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.7",
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
5
5
|
"author": "heartyoh",
|
6
6
|
"main": "dist/src/index.js",
|
@@ -95,18 +95,18 @@
|
|
95
95
|
"dependencies": {
|
96
96
|
"@material/web": "^1.5.0",
|
97
97
|
"@open-wc/scoped-elements": "^2.1.3",
|
98
|
-
"@operato/app": "^7.0.
|
99
|
-
"@operato/data-grist": "^7.0.
|
100
|
-
"@operato/font": "^7.0.
|
101
|
-
"@operato/graphql": "^7.0.
|
98
|
+
"@operato/app": "^7.0.5",
|
99
|
+
"@operato/data-grist": "^7.0.5",
|
100
|
+
"@operato/font": "^7.0.5",
|
101
|
+
"@operato/graphql": "^7.0.5",
|
102
102
|
"@operato/i18n": "^7.0.0",
|
103
|
-
"@operato/input": "^7.0.
|
104
|
-
"@operato/layout": "^7.0.
|
103
|
+
"@operato/input": "^7.0.5",
|
104
|
+
"@operato/layout": "^7.0.5",
|
105
105
|
"@operato/markdown": "^7.0.0",
|
106
|
-
"@operato/popup": "^7.0.
|
107
|
-
"@operato/property-editor": "^7.0.
|
106
|
+
"@operato/popup": "^7.0.5",
|
107
|
+
"@operato/property-editor": "^7.0.5",
|
108
108
|
"@operato/styles": "^7.0.0",
|
109
|
-
"@operato/utils": "^7.0.
|
109
|
+
"@operato/utils": "^7.0.5",
|
110
110
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
111
111
|
"@types/file-saver": "^2.0.4",
|
112
112
|
"@types/sortablejs": "^1.10.7",
|
@@ -114,7 +114,8 @@
|
|
114
114
|
"file-saver": "^2.0.5",
|
115
115
|
"lit": "^3.1.2",
|
116
116
|
"lodash-es": "^4.17.21",
|
117
|
-
"sortablejs": "^1.15.2"
|
117
|
+
"sortablejs": "^1.15.2",
|
118
|
+
"xlsx": "^0.18.5"
|
118
119
|
},
|
119
120
|
"devDependencies": {
|
120
121
|
"@custom-elements-manifest/analyzer": "^0.9.2",
|
@@ -154,5 +155,5 @@
|
|
154
155
|
"prettier --write"
|
155
156
|
]
|
156
157
|
},
|
157
|
-
"gitHead": "
|
158
|
+
"gitHead": "6f41df0039b072b17fa4c9af28869a3f5469750d"
|
158
159
|
}
|
@@ -76,6 +76,7 @@ export class PropertyEventTap extends LitElement {
|
|
76
76
|
<option value="partial-value-set">set partial value to target component value</option>
|
77
77
|
<option value="start-scenario">start the given scenario</option>
|
78
78
|
<option value="run-scenario">run the given scenario</option>
|
79
|
+
<option value="export-data">export data</option>
|
79
80
|
</select>
|
80
81
|
|
81
82
|
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
@@ -129,11 +130,11 @@ export class PropertyEventTap extends LitElement {
|
|
129
130
|
}
|
130
131
|
`
|
131
132
|
: SETS_ACTION.indexOf(action) != -1
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
? html`
|
134
|
+
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
135
|
+
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
136
|
+
`
|
137
|
+
: html``}
|
137
138
|
`
|
138
139
|
}
|
139
140
|
|
@@ -142,6 +143,8 @@ export class PropertyEventTap extends LitElement {
|
|
142
143
|
case 'link-open':
|
143
144
|
case 'link-move':
|
144
145
|
return 'http://www.hatiolab.com/'
|
146
|
+
case 'export-data':
|
147
|
+
return 'abc.xlsx'
|
145
148
|
default:
|
146
149
|
return ''
|
147
150
|
}
|
@@ -184,6 +187,7 @@ export class PropertyEventTap extends LitElement {
|
|
184
187
|
return this.scenarios
|
185
188
|
case 'goto-playlist':
|
186
189
|
return this.playlists
|
190
|
+
case 'export-data':
|
187
191
|
default:
|
188
192
|
return []
|
189
193
|
}
|
package/src/ox-board-viewer.ts
CHANGED
@@ -4,6 +4,7 @@ import './ox-board-component-info.js'
|
|
4
4
|
|
5
5
|
import { css, html, LitElement, PropertyValues } from 'lit'
|
6
6
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
7
|
+
import * as XLSX from 'xlsx'
|
7
8
|
|
8
9
|
import { Component, create, ReferenceProvider, SCENE_MODE } from '@hatiolab/things-scene'
|
9
10
|
import { isIOS, togglefullscreen } from '@operato/utils'
|
@@ -390,6 +391,7 @@ export class BoardViewer extends LitElement {
|
|
390
391
|
this._scene.on('route-page', this.onRoutePage, this)
|
391
392
|
this._scene.on('start-scenario', this.onStartScenario, this)
|
392
393
|
this._scene.on('run-scenario', this.onRunScenario, this)
|
394
|
+
this._scene.on('export-data', this.onExportData, this)
|
393
395
|
this._scene.on('click', this.onClickEvent, this)
|
394
396
|
}
|
395
397
|
|
@@ -402,6 +404,7 @@ export class BoardViewer extends LitElement {
|
|
402
404
|
scene.off('route-page', this.onRoutePage, this)
|
403
405
|
scene.off('start-scenario', this.onStartScenario, this)
|
404
406
|
scene.off('run-scenario', this.onRunScenario, this)
|
407
|
+
scene.off('export-data', this.onExportData, this)
|
405
408
|
scene.off('click', this.onClickEvent, this)
|
406
409
|
}
|
407
410
|
|
@@ -556,6 +559,19 @@ export class BoardViewer extends LitElement {
|
|
556
559
|
}
|
557
560
|
}
|
558
561
|
|
562
|
+
async onExportData(filename: string, value: string | number | object, component: Component) {
|
563
|
+
try {
|
564
|
+
const data = component.data
|
565
|
+
|
566
|
+
const worksheet = XLSX.utils.json_to_sheet(data)
|
567
|
+
const workbook = XLSX.utils.book_new()
|
568
|
+
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
|
569
|
+
XLSX.writeFile(workbook, filename || 'export-data.xlsx')
|
570
|
+
} catch (e) {
|
571
|
+
console.error(e)
|
572
|
+
}
|
573
|
+
}
|
574
|
+
|
559
575
|
onClickEvent(e: MouseEvent, hint: any) {
|
560
576
|
const component = hint.origin
|
561
577
|
|