@weni/unnnic-system 3.1.2-alpha.1 → 3.1.2-alpha.2

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": "@weni/unnnic-system",
3
- "version": "3.1.2-alpha.1",
3
+ "version": "3.1.2-alpha.2",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -11,7 +11,7 @@
11
11
  @dragleave.stop.prevent="dragleave"
12
12
  @dragend.stop.prevent="dragend"
13
13
  @drop.stop.prevent="drop"
14
- @click="() => $refs.file.click()"
14
+ @click="handleDropzoneClick"
15
15
  >
16
16
  <UnnnicIcon
17
17
  class="unnnic-upload-area__dropzone__icon"
@@ -64,7 +64,7 @@
64
64
  </template>
65
65
 
66
66
  <script setup>
67
- import { ref, computed, getCurrentInstance } from 'vue';
67
+ import { ref, computed, getCurrentInstance, useTemplateRef } from 'vue';
68
68
  import mime from 'mime';
69
69
 
70
70
  import UnnnicIcon from '../Icon.vue';
@@ -73,6 +73,7 @@ const isDragging = ref(false);
73
73
  const hasError = ref(false);
74
74
  const dragEnterCounter = ref(0);
75
75
  const file = ref();
76
+ const fileRef = useTemplateRef('file');
76
77
 
77
78
  const props = defineProps({
78
79
  acceptMultiple: {
@@ -179,6 +180,12 @@ function drop(event) {
179
180
  }
180
181
  }
181
182
 
183
+ function handleDropzoneClick() {
184
+ if (props.disabled) return;
185
+
186
+ fileRef.value.click();
187
+ }
188
+
182
189
  function handleFileChange(event) {
183
190
  if (props.disabled) return;
184
191