wave-ui 3.4.5 → 3.4.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/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.es.js +15 -13
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +2 -2
- package/src/wave-ui/components/w-input.vue +10 -3
package/dist/wave-ui.es.js
CHANGED
|
@@ -3073,7 +3073,7 @@ const xl = {
|
|
|
3073
3073
|
computed: {
|
|
3074
3074
|
attrs() {
|
|
3075
3075
|
const { class: e, ...t } = this.$attrs;
|
|
3076
|
-
return t;
|
|
3076
|
+
return this.type === "file" && !this.inputFiles.length && (t.value = null), t;
|
|
3077
3077
|
},
|
|
3078
3078
|
listeners() {
|
|
3079
3079
|
const { input: e, focus: t, blur: l, ...a } = this.$attrs;
|
|
@@ -3159,20 +3159,22 @@ const xl = {
|
|
|
3159
3159
|
this.isFocused = !1, this.$emit("blur", e);
|
|
3160
3160
|
},
|
|
3161
3161
|
onFileChange(e) {
|
|
3162
|
-
this.inputFiles = [...e.target.files].map((
|
|
3163
|
-
const [,
|
|
3164
|
-
name:
|
|
3165
|
-
base:
|
|
3166
|
-
extension:
|
|
3167
|
-
type:
|
|
3168
|
-
size:
|
|
3169
|
-
lastModified:
|
|
3162
|
+
this.inputFiles = [...e.target.files].map((l) => {
|
|
3163
|
+
const [, a = "", r = "", i = ""] = l.name.match(/^(.*?)\.([^.]*)$|(.*)/), o = Q({
|
|
3164
|
+
name: l.name,
|
|
3165
|
+
base: a || i,
|
|
3166
|
+
extension: r,
|
|
3167
|
+
type: l.type,
|
|
3168
|
+
size: l.size,
|
|
3169
|
+
lastModified: l.lastModified,
|
|
3170
3170
|
preview: null,
|
|
3171
3171
|
progress: 0,
|
|
3172
|
-
file:
|
|
3172
|
+
file: l
|
|
3173
3173
|
});
|
|
3174
|
-
return this.readFile(
|
|
3175
|
-
})
|
|
3174
|
+
return this.readFile(l, o), o;
|
|
3175
|
+
});
|
|
3176
|
+
const t = this.multiple ? this.inputFiles : this.inputFiles[0];
|
|
3177
|
+
this.$emit("update:modelValue", t), this.$emit("input", t);
|
|
3176
3178
|
},
|
|
3177
3179
|
readFile(e, t) {
|
|
3178
3180
|
const l = new FileReader(), a = typeof this.preview == "string", r = e.type && e.type.startsWith("image/");
|
|
@@ -3190,7 +3192,7 @@ const xl = {
|
|
|
3190
3192
|
},
|
|
3191
3193
|
watch: {
|
|
3192
3194
|
modelValue(e) {
|
|
3193
|
-
this.inputValue = e, !e && e !== 0 && (this.isAutofilled = !1);
|
|
3195
|
+
this.inputValue = e, !e && e !== 0 && (this.isAutofilled = !1, this.inputFiles = []);
|
|
3194
3196
|
}
|
|
3195
3197
|
}
|
|
3196
3198
|
}, Pl = /* @__PURE__ */ v(xl, [["render", Ll]]);
|