@things-factory/form-ui 4.0.0-y.0 → 4.0.5
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, html, LitElement } from 'lit-element'
|
|
2
|
+
|
|
2
3
|
import { FileDropHelper } from '@things-factory/utils'
|
|
3
4
|
|
|
4
5
|
export class FileUploader extends LitElement {
|
|
@@ -90,6 +91,22 @@ export class FileUploader extends LitElement {
|
|
|
90
91
|
hidden
|
|
91
92
|
@change=${e => {
|
|
92
93
|
const fileInput = e.currentTarget
|
|
94
|
+
|
|
95
|
+
//// Temporary Validation preventing file size more than 10mb to be uploaded
|
|
96
|
+
for (let index = 0; index < fileInput.files.length; index++) {
|
|
97
|
+
if (fileInput.files[index].size > 9999999) {
|
|
98
|
+
document.dispatchEvent(
|
|
99
|
+
new CustomEvent('notify', {
|
|
100
|
+
detail: {
|
|
101
|
+
type: 'error',
|
|
102
|
+
message: 'File size must be less than 10 MB.'
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
)
|
|
106
|
+
throw new Error('File size must be less than 10 MB.')
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
93
110
|
this._files = [...files, ...Array.from(fileInput.files)]
|
|
94
111
|
|
|
95
112
|
this.dispatchEvent(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/form-ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/layout-base": "^4.0.
|
|
27
|
+
"@things-factory/layout-base": "^4.0.5"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "b7b2976818dceab74a34903499d408eed5d45b04"
|
|
30
30
|
}
|