quasar-ui-danx 0.3.38 → 0.3.40
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/danx.es.js +16 -11
- 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/helpers/FileUpload.ts +40 -29
package/dist/danx.es.js
CHANGED
@@ -9715,17 +9715,22 @@ class fs {
|
|
9715
9715
|
*/
|
9716
9716
|
async upload() {
|
9717
9717
|
console.log && console.log("FileUploader@upload():", this.fileUploads, this.options);
|
9718
|
-
for (const e of this.fileUploads)
|
9719
|
-
|
9720
|
-
|
9721
|
-
|
9722
|
-
|
9718
|
+
for (const e of this.fileUploads)
|
9719
|
+
try {
|
9720
|
+
const n = e.file.mimeType || e.file.type, r = this.options.presignedUploadUrl(this.options.directory, e.file.name, n);
|
9721
|
+
console.log("calling presigned URL", r);
|
9722
|
+
const i = await fetch(r).then((l) => l.json());
|
9723
|
+
if (console.log("loaded presignedUrl: fileResource", i), !i.url) {
|
9724
|
+
bt.error("Could not fetch presigned upload URL for file " + e.file.name);
|
9725
|
+
continue;
|
9726
|
+
}
|
9727
|
+
const o = !i.url.match("upload-presigned-url-contents");
|
9728
|
+
e.file.resource_id = i.id;
|
9729
|
+
const s = new XMLHttpRequest();
|
9730
|
+
o ? (console.log("uploading S3", s), s.open("PUT", i.url), console.log("setting content type to", n), s.setRequestHeader("Content-Type", n), e.body = e.file) : (s.open("POST", i.url), e.body = e.formData), e.xhr = s;
|
9731
|
+
} catch (n) {
|
9732
|
+
console.error && console.error("FileUploader@upload():", "Failed to fetch presigned upload URL", n), this.errorHandler(null, e.file, n);
|
9723
9733
|
}
|
9724
|
-
const o = !i.url.match("upload-presigned-url-contents");
|
9725
|
-
e.file.resource_id = i.id;
|
9726
|
-
const s = new XMLHttpRequest();
|
9727
|
-
o ? (s.open("PUT", i.url), s.setRequestHeader("Content-Type", n), e.body = e.file) : (s.open("POST", i.url), e.body = e.formData), e.xhr = s;
|
9728
|
-
}
|
9729
9734
|
this.setXhrCallbacks(), console.log && console.log("FileUploader@upload():", "sending uploads");
|
9730
9735
|
for (const e of this.fileUploads)
|
9731
9736
|
e.xhr.send(e.body);
|
@@ -19426,7 +19431,7 @@ const VS = {
|
|
19426
19431
|
});
|
19427
19432
|
};
|
19428
19433
|
}
|
19429
|
-
}, pT = "quasar-ui-danx", gT = "0.3.
|
19434
|
+
}, pT = "quasar-ui-danx", gT = "0.3.40", bT = "Dan <dan@flytedesk.com>", yT = "DanX Vue / Quasar component library", xT = "MIT", vT = "module", wT = "dist/danx.es.js", ST = "dist/danx.es.js", TT = {
|
19430
19435
|
dev: "cd dev && quasar dev && cd ..",
|
19431
19436
|
build: "vite build",
|
19432
19437
|
preview: "vite preview",
|