formiojs-eorion 0.0.9 → 0.1.0
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/Formio.js +1 -1
- package/components/FileDownload/FileDownload.js +10 -1
- package/dist/formio.contrib.js +2 -2
- package/dist/formio.contrib.min.js +1 -1
- package/dist/formio.contrib.min.js.LICENSE.txt +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/package.json +1 -1
- package/utils/utils.js +43 -0
package/Formio.js
CHANGED
|
@@ -1724,7 +1724,7 @@ Formio.projectUrlSet = false;
|
|
|
1724
1724
|
Formio.plugins = [];
|
|
1725
1725
|
Formio.cache = {};
|
|
1726
1726
|
Formio.Providers = _providers.default;
|
|
1727
|
-
Formio.version = '0.0
|
|
1727
|
+
Formio.version = '0.1.0';
|
|
1728
1728
|
Formio.pathType = '';
|
|
1729
1729
|
Formio.events = new _EventEmitter.default();
|
|
1730
1730
|
Formio.cdn = new _CDN.default();
|
|
@@ -14,6 +14,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
14
14
|
value: true
|
|
15
15
|
});
|
|
16
16
|
exports.default = void 0;
|
|
17
|
+
require("core-js/modules/es.string.ends-with.js");
|
|
18
|
+
require("core-js/modules/es.array.concat.js");
|
|
17
19
|
require("core-js/modules/es.array.iterator.js");
|
|
18
20
|
require("core-js/modules/es.object.to-string.js");
|
|
19
21
|
require("core-js/modules/es.string.iterator.js");
|
|
@@ -23,7 +25,7 @@ require("core-js/modules/web.url-search-params.js");
|
|
|
23
25
|
require("core-js/modules/es.object.get-prototype-of.js");
|
|
24
26
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
25
27
|
var _Field = _interopRequireDefault(require("../_classes/field/Field"));
|
|
26
|
-
var
|
|
28
|
+
var _utils = require("../../utils/utils");
|
|
27
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
30
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
31
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
@@ -93,6 +95,13 @@ var FileDownload = /*#__PURE__*/function (_Component) {
|
|
|
93
95
|
var result = xhr.response;
|
|
94
96
|
var blob = new Blob([result]);
|
|
95
97
|
var fileName = file.filename;
|
|
98
|
+
// 自动添加文件后缀
|
|
99
|
+
if (file.mimeType) {
|
|
100
|
+
var extension = (0, _utils.getExtensionFromMimeType)(file.mimeType);
|
|
101
|
+
if (extension && extension.length > 0 && !fileName.endsWith(extension)) {
|
|
102
|
+
fileName = "".concat(fileName, ".").concat(extension);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
96
105
|
var elink = document.createElement('a');
|
|
97
106
|
elink.download = fileName;
|
|
98
107
|
elink.style.display = 'none';
|