@things-factory/import-ui 4.0.27 → 4.0.32
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/client/bootstrap.js +10 -6
- package/package.json +7 -7
package/client/bootstrap.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { html } from 'lit-html'
|
|
2
|
-
|
|
3
1
|
import '@material/mwc-icon'
|
|
4
2
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { html } from 'lit-html'
|
|
4
|
+
|
|
7
5
|
import { APPEND_CONTEXT_TOOL } from '@things-factory/context-base'
|
|
8
6
|
import { IMPORT } from '@things-factory/import-base'
|
|
7
|
+
import { TOOL_POSITION } from '@things-factory/layout-base'
|
|
8
|
+
import { store } from '@things-factory/shell'
|
|
9
9
|
|
|
10
10
|
function onFileChanged(event) {
|
|
11
11
|
const fileObj = event.currentTarget.files[0]
|
|
@@ -14,7 +14,7 @@ function onFileChanged(event) {
|
|
|
14
14
|
const reader = new FileReader()
|
|
15
15
|
|
|
16
16
|
// Ready The Event For When A File Gets Selected
|
|
17
|
-
reader.onload = function(e) {
|
|
17
|
+
reader.onload = function (e) {
|
|
18
18
|
const data = e.target.result
|
|
19
19
|
const state = store.getState()
|
|
20
20
|
|
|
@@ -29,7 +29,11 @@ function onFileChanged(event) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// Tell JS To Start Reading The File.. You could delay this if desired
|
|
32
|
-
extension === 'xlsx'
|
|
32
|
+
extension === 'xlsx'
|
|
33
|
+
? reader.readAsArrayBuffer(fileObj)
|
|
34
|
+
: extension === 'json' || extension === 'json5'
|
|
35
|
+
? reader.readAsText(fileObj)
|
|
36
|
+
: reader.readAsBinaryString(fileObj)
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
function uploadFile() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/import-ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.32",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/context-base": "^4.0.
|
|
28
|
-
"@things-factory/grist-ui": "^4.0.
|
|
29
|
-
"@things-factory/i18n-base": "^4.0.
|
|
30
|
-
"@things-factory/import-base": "^4.0.
|
|
31
|
-
"@things-factory/layout-base": "^4.0.
|
|
27
|
+
"@things-factory/context-base": "^4.0.32",
|
|
28
|
+
"@things-factory/grist-ui": "^4.0.32",
|
|
29
|
+
"@things-factory/i18n-base": "^4.0.32",
|
|
30
|
+
"@things-factory/import-base": "^4.0.32",
|
|
31
|
+
"@things-factory/layout-base": "^4.0.32"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "a1a16e7d4531ae3ff035295fc7bf05bf0d3153a7"
|
|
34
34
|
}
|