@formio/js 5.1.0-dev.6074.9c916f1 → 5.1.0-dev.6079.1fdf7d9
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/formio.form.js
CHANGED
@@ -5722,7 +5722,7 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
|
|
5722
5722
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
5723
5723
|
|
5724
5724
|
"use strict";
|
5725
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getFormioUploadAdapterPlugin = void 0;\nconst utils_1 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\n/**\n * UploadAdapter for CKEditor https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html\n */\nclass FormioUploadAdapter {\n constructor(loader, fileService, component) {\n this.loader = loader;\n this.fileService = fileService;\n this.component = component;\n }\n upload() {\n return this.loader.file\n .then(file => new Promise((resolve, reject) => {\n const { uploadStorage, uploadUrl, uploadOptions, uploadDir, fileKey } = this.component.component;\n const uploadParams = [\n uploadStorage,\n file,\n (0, utils_1.uniqueName)(file.name),\n uploadDir || '', //should pass empty string if undefined\n (evt) => this.onUploadProgress(evt),\n uploadUrl,\n uploadOptions,\n fileKey,\n null,\n null\n ];\n const uploadPromise = this.fileService.uploadFile(...uploadParams, () => this.component.emit('fileUploadingStart', uploadPromise)).then((result) => {\n return this.fileService.downloadFile(result);\n }).then((result) => {\n return resolve({\n default: result.url\n });\n }).catch((err) => {\n console.warn('An Error occured while uploading file', err);\n reject(err);\n }).finally(() => {\n this.component.emit('fileUploadingEnd', uploadPromise);\n });\n }));\n }\n abort() { }\n onUploadProgress(evt) {\n if (evt.lengthComputable) {\n this.loader.uploadTotal = evt.total;\n this.loader.uploaded = evt.loaded;\n }\n }\n}\nconst getFormioUploadAdapterPlugin = (fileService, component) => (editor)
|
5725
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getFormioUploadAdapterPlugin = void 0;\nconst utils_1 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\n/**\n * UploadAdapter for CKEditor https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html\n */\nclass FormioUploadAdapter {\n constructor(loader, fileService, component) {\n this.loader = loader;\n this.fileService = fileService;\n this.component = component;\n }\n upload() {\n return this.loader.file\n .then(file => new Promise((resolve, reject) => {\n const { uploadStorage, uploadUrl, uploadOptions, uploadDir, fileKey } = this.component.component;\n const uploadParams = [\n uploadStorage,\n file,\n (0, utils_1.uniqueName)(file.name),\n uploadDir || '', //should pass empty string if undefined\n (evt) => this.onUploadProgress(evt),\n uploadUrl,\n uploadOptions,\n fileKey,\n null,\n null\n ];\n const uploadPromise = this.fileService.uploadFile(...uploadParams, () => this.component.emit('fileUploadingStart', uploadPromise)).then((result) => {\n return this.fileService.downloadFile(result);\n }).then((result) => {\n return resolve({\n default: result.url\n });\n }).catch((err) => {\n console.warn('An Error occured while uploading file', err);\n reject(err);\n }).finally(() => {\n this.component.emit('fileUploadingEnd', uploadPromise);\n });\n }));\n }\n abort() { }\n onUploadProgress(evt) {\n if (evt.lengthComputable) {\n this.loader.uploadTotal = evt.total;\n this.loader.uploaded = evt.loaded;\n }\n }\n}\nconst getFormioUploadAdapterPlugin = (fileService, component) => {\n return function (editor) {\n editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {\n return new FormioUploadAdapter(loader, fileService, component);\n };\n };\n};\nexports.getFormioUploadAdapterPlugin = getFormioUploadAdapterPlugin;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/uploadAdapter.js?");
|
5726
5726
|
|
5727
5727
|
/***/ }),
|
5728
5728
|
|