@enso-ui/uploader 2.0.3 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/uploader",
3
- "version": "2.0.3",
3
+ "version": "2.0.7",
4
4
  "description": "File Uploader",
5
5
  "main": "bulma/index.js",
6
6
  "scripts": {
@@ -34,8 +34,8 @@
34
34
  "autoprefixer": "^9.6.1",
35
35
  "babel-eslint": "^10.0.1",
36
36
  "cross-env": "^6.0.0",
37
- "eslint": "^7.0",
37
+ "eslint": "^7.0.0",
38
38
  "eslint-import-resolver-alias": "^1.1.2",
39
- "eslint-plugin-vue": "^7.0.0-beta.4"
39
+ "eslint-plugin-vue": "^8.0.0"
40
40
  }
41
41
  }
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <core-uploader v-bind="$attrs"
3
- ref="uploader">
4
- <template #default="{
2
+ <form class="is-marginless"
3
+ @submit.prevent>
4
+ <core-uploader v-bind="$attrs"
5
+ ref="uploader">
6
+ <template #default="{
5
7
  compact, controlEvents, files, inputBindings, inputEvents, label, manual,
6
8
  }">
7
- <form class="is-marginless"
8
- @submit.prevent>
9
9
  <input class="is-hidden"
10
10
  v-bind="inputBindings"
11
11
  v-on="inputEvents">
@@ -24,9 +24,9 @@
24
24
  </span>
25
25
  </a>
26
26
  </slot>
27
- </form>
28
- </template>
29
- </core-uploader>
27
+ </template>
28
+ </core-uploader>
29
+ </form>
30
30
  </template>
31
31
 
32
32
  <script>
@@ -45,6 +45,11 @@ export default {
45
45
  },
46
46
  },
47
47
 
48
+ emits: [
49
+ 'change', 'input', 'open-file-browser', 'upload-start',
50
+ 'upload-successful', 'upload-error',
51
+ ],
52
+
48
53
  data: () => ({
49
54
  formData: new FormData(),
50
55
  succesfull: 0,
@@ -66,7 +71,7 @@ export default {
66
71
  : this.i18n('File');
67
72
  },
68
73
  input() {
69
- return !!this.$el && this.$el.querySelector('input');
74
+ return !!this.$parent.$el && this.$parent.$el.querySelector('input');
70
75
  },
71
76
  },
72
77
 
@@ -157,7 +162,7 @@ export default {
157
162
  return true;
158
163
  },
159
164
  reset() {
160
- this.$el.reset();
165
+ this.$parent.$el.reset();
161
166
  this.formData = new FormData();
162
167
  this.succesfull = 0;
163
168
  this.files = false;