quasar-ui-danx 0.3.28 → 0.3.30
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/danx.es.js +579 -553
- package/dist/danx.es.js.map +1 -1
- package/dist/danx.umd.js +2 -2
- package/dist/danx.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +49 -49
- package/src/components/ActionTable/Form/Fields/TextField.vue +41 -36
- package/src/helpers/FileUpload.ts +299 -292
- package/src/helpers/files.ts +55 -42
package/src/helpers/files.ts
CHANGED
@@ -3,51 +3,64 @@ import { useCompatibility } from "./compatibility";
|
|
3
3
|
import { FlashMessages } from "./FlashMessages";
|
4
4
|
|
5
5
|
export async function resolveFileLocation(file, waitMessage = null) {
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
if (file.location) {
|
7
|
+
return file.location;
|
8
|
+
}
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
try {
|
11
|
+
const tags = await ExifReader.load(file.blobUrl || file.url, {
|
12
|
+
expanded: true
|
13
|
+
});
|
14
|
+
if (tags.gps) {
|
15
|
+
return {
|
16
|
+
latitude: tags.gps.Latitude,
|
17
|
+
longitude: tags.gps.Longitude
|
18
|
+
};
|
19
|
+
}
|
20
|
+
} catch (error) {
|
21
|
+
console.error("Failed to load EXIF data from file:", error);
|
22
|
+
}
|
20
23
|
|
21
|
-
|
24
|
+
try {
|
25
|
+
const { waitForLocation, location } = useCompatibility();
|
22
26
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
// Show a waiting for location message if we have not returned within 1 second
|
28
|
+
if (waitMessage) {
|
29
|
+
setTimeout(() => {
|
30
|
+
if (!location.value && waitMessage) {
|
31
|
+
FlashMessages.warning(waitMessage);
|
32
|
+
}
|
33
|
+
}, 1000);
|
34
|
+
}
|
31
35
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
// Wait for the browser to return the location (https only as http will not return a location)
|
37
|
+
if (window.location.protocol === "https:") {
|
38
|
+
await waitForLocation();
|
39
|
+
} else if (window.location.href.match("localhost")) {
|
40
|
+
// XXX: Special case for local development so we can test without https
|
41
|
+
return {
|
42
|
+
latitude: 37.7749,
|
43
|
+
longitude: -122.4194,
|
44
|
+
accuracy: 1,
|
45
|
+
altitude: 0,
|
46
|
+
altitudeAccuracy: 0
|
47
|
+
};
|
48
|
+
}
|
49
|
+
// Ignore the wait message if we already returned
|
50
|
+
waitMessage = false;
|
51
|
+
if (!location.value) {
|
52
|
+
return null;
|
53
|
+
}
|
41
54
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
55
|
+
return {
|
56
|
+
latitude: location.value.latitude,
|
57
|
+
longitude: location.value.longitude,
|
58
|
+
accuracy: location.value.accuracy,
|
59
|
+
altitude: location.value.altitude,
|
60
|
+
altitudeAccuracy: location.value.altitudeAccuracy
|
61
|
+
};
|
62
|
+
} catch (error) {
|
63
|
+
console.error(error);
|
64
|
+
return null;
|
65
|
+
}
|
53
66
|
}
|