adminforth 1.15.0-next.19 → 1.15.0-next.20

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,5 +1,6 @@
1
1
  <template>
2
- <div class="flex items-center justify-center w-full"
2
+ <!-- tag form used to reset the input (method .reset() in claer() function) -->
3
+ <form class="flex items-center justify-center w-full"
3
4
  @dragover.prevent="dragging = true"
4
5
  @dragleave.prevent="dragging = false"
5
6
  @drop.prevent="dragging = false; doEmit($event.dataTransfer.files)"
@@ -43,12 +44,12 @@
43
44
  :multiple="props.multiple || false"
44
45
  />
45
46
  </label>
46
- </div>
47
+ </form>
47
48
  </template>
48
49
 
49
50
  <script setup lang="ts">
50
51
  import { humanifySize } from '@/utils';
51
- import { ref, type Ref } from 'vue';
52
+ import { ref, defineExpose, type Ref } from 'vue';
52
53
  import { IconFileSolid } from '@iconify-prerendered/vue-flowbite';
53
54
  import { watch } from 'vue';
54
55
  import adminforth from '@/adminforth';
@@ -125,4 +126,14 @@ function doEmit(filesIn: FileList) {
125
126
 
126
127
  const dragging = ref(false);
127
128
 
129
+ function clear() {
130
+ selectedFiles.value = [];
131
+ emit('update:modelValue', []);
132
+ const form = document.getElementById(id)?.closest('form');
133
+ form?.reset();
134
+ }
135
+
136
+ defineExpose({
137
+ clear,
138
+ });
128
139
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.15.0-next.19",
3
+ "version": "1.15.0-next.20",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",