@drax/media-vue 2.0.3 → 2.2.1
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.2.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"vue-tsc": "^3.2.4",
|
|
47
47
|
"vuetify": "^3.11.8"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "28b52dd92f9f23ccc40315f284861ce1ba3fed51"
|
|
50
50
|
}
|
|
@@ -15,7 +15,6 @@ const {dir, readonly, timeout} = defineProps({
|
|
|
15
15
|
hideDetails: {type: Boolean, default: false},
|
|
16
16
|
singleLine: {type: Boolean, default: false},
|
|
17
17
|
clearable: {type: Boolean, default: false},
|
|
18
|
-
disableRules: {type: Boolean, default: false},
|
|
19
18
|
parentField: {type: String, default: null, required: false},
|
|
20
19
|
index: {type: Number, default: null, required: false},
|
|
21
20
|
name: {type: String, default: 'file'},
|
|
@@ -18,7 +18,6 @@ const {dir, readonly, timeout} = defineProps({
|
|
|
18
18
|
hideDetails: {type: Boolean, default: false},
|
|
19
19
|
singleLine: {type: Boolean, default: false},
|
|
20
20
|
clearable: {type: Boolean, default: false},
|
|
21
|
-
disableRules: {type: Boolean, default: false},
|
|
22
21
|
parentField: {type: String, default: null, required: false},
|
|
23
22
|
index: {type: Number, default: null, required: false},
|
|
24
23
|
name: {type: String, default: 'file'},
|
|
@@ -49,7 +48,7 @@ function onFileClick() {
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
const valueModelUrl = computed(() =>
|
|
52
|
-
valueModel.value
|
|
51
|
+
valueModel.value?.url || '')
|
|
53
52
|
|
|
54
53
|
async function onFileChanged(e: Event) {
|
|
55
54
|
if (e.target && (e.target as HTMLInputElement).files) {
|
|
@@ -102,12 +101,12 @@ defineEmits(['updateValue'])
|
|
|
102
101
|
|
|
103
102
|
const isImage = computed(() => {
|
|
104
103
|
|
|
105
|
-
if (typeof valueModel.value
|
|
104
|
+
if (valueModel.value && (typeof valueModel.value?.url !== 'string' || !valueModel.value?.url.trim())) return false;
|
|
106
105
|
|
|
107
106
|
// supports optional query/hash: ".../file.jpg?x=1#y"
|
|
108
107
|
const imageExtRegex = /\.(?:jpe?g|png|gif|webp|bmp|svg|tiff?|avif|ico)(?:[?#].*)?$/i;
|
|
109
108
|
|
|
110
|
-
return imageExtRegex.test(valueModel.value
|
|
109
|
+
return imageExtRegex.test(valueModel.value?.url);
|
|
111
110
|
});
|
|
112
111
|
|
|
113
112
|
</script>
|
|
@@ -158,7 +157,7 @@ const isImage = computed(() => {
|
|
|
158
157
|
<v-btn @click="onFileClick" :loading="loading" density="compact" color="grey" variant="text">Click | Drag & Drop</v-btn>
|
|
159
158
|
|
|
160
159
|
<template v-if="preview && isImage">
|
|
161
|
-
<v-img :src="valueModel
|
|
160
|
+
<v-img :src="valueModel?.url" alt="Preview" :height="previewHeight" class="mt-4"></v-img>
|
|
162
161
|
</template>
|
|
163
162
|
|
|
164
163
|
</div>
|