@enso-ui/uploader 2.0.4 → 2.0.8

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.4",
3
+ "version": "2.0.8",
4
4
  "description": "File Uploader",
5
5
  "main": "bulma/index.js",
6
6
  "scripts": {
@@ -34,7 +34,7 @@
34
34
  "autoprefixer": "^9.6.1",
35
35
  "babel-eslint": "^10.0.1",
36
36
  "cross-env": "^6.0.0",
37
- "eslint": "^8.0.0",
37
+ "eslint": "^7.0.0",
38
38
  "eslint-import-resolver-alias": "^1.1.2",
39
39
  "eslint-plugin-vue": "^8.0.0"
40
40
  }
@@ -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,13 @@ 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
+
53
+ inheritAttrs: false,
54
+
48
55
  data: () => ({
49
56
  formData: new FormData(),
50
57
  succesfull: 0,
@@ -66,7 +73,7 @@ export default {
66
73
  : this.i18n('File');
67
74
  },
68
75
  input() {
69
- return !!this.$el && this.$el.querySelector('input');
76
+ return !!this.$parent.$el && this.$parent.$el.querySelector('input');
70
77
  },
71
78
  },
72
79
 
@@ -157,7 +164,7 @@ export default {
157
164
  return true;
158
165
  },
159
166
  reset() {
160
- this.$el.reset();
167
+ this.$parent.$el.reset();
161
168
  this.formData = new FormData();
162
169
  this.succesfull = 0;
163
170
  this.files = false;