xrk-components 0.5.2 → 0.5.3

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/lib/index.esm.js CHANGED
@@ -46503,7 +46503,7 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
46503
46503
  ((_a = activeFile.response) === null || _a === void 0 ? void 0 : _a.fileUrl) ||
46504
46504
  (activeFile.raw ? window.URL.createObjectURL(activeFile.raw) : ''));
46505
46505
  };
46506
- var checkFile = function (file) { return __awaiter(_this, void 0, void 0, function () {
46506
+ var checkFile = function (file, noEmit) { return __awaiter(_this, void 0, void 0, function () {
46507
46507
  var limit, limitSize, beforeSelected, fileType, fileNameType, allFileType, error_1;
46508
46508
  return __generator(this, function (_a) {
46509
46509
  switch (_a.label) {
@@ -46516,19 +46516,20 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
46516
46516
  if (!fileNameType ||
46517
46517
  (accept.value.indexOf(allFileType) == -1 &&
46518
46518
  accept.value.indexOf(fileNameType) == -1)) {
46519
- emits('error', {
46520
- code: 503,
46521
- msg: "\u4E0D\u652F\u6301\u4E0A\u4F20".concat(fileNameType || '此类', "\u7C7B\u578B\u6587\u4EF6")
46522
- });
46519
+ !noEmit &&
46520
+ emits('error', {
46521
+ code: 503,
46522
+ msg: "\u4E0D\u652F\u6301\u4E0A\u4F20".concat(fileNameType || '此类', "\u7C7B\u578B\u6587\u4EF6")
46523
+ });
46523
46524
  return [2 /*return*/, Promise.reject('file type error')];
46524
46525
  }
46525
46526
  }
46526
46527
  if (limit && fileList.value.length >= limit) {
46527
- emits('error', { code: 502, msg: "\u6700\u591A\u9009\u62E9".concat(limit, "\u4E2A\u6587\u4EF6") });
46528
+ !noEmit && emits('error', { code: 502, msg: "\u6700\u591A\u9009\u62E9".concat(limit, "\u4E2A\u6587\u4EF6") });
46528
46529
  return [2 /*return*/, Promise.reject('count limit exceeded')];
46529
46530
  }
46530
46531
  if (limitSize && file.size > limitSize * 1024 * 1024) {
46531
- emits('error', { code: 501, msg: "\u5355\u4E2A\u6587\u4EF6\u6700\u5927".concat(limitSize, "M") });
46532
+ !noEmit && emits('error', { code: 501, msg: "\u5355\u4E2A\u6587\u4EF6\u6700\u5927".concat(limitSize, "M") });
46532
46533
  return [2 /*return*/, Promise.reject('size limit exceeded')];
46533
46534
  }
46534
46535
  if (!beforeSelected) return [3 /*break*/, 4];
@@ -46559,7 +46560,7 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
46559
46560
  _a.label = 1;
46560
46561
  case 1:
46561
46562
  _a.trys.push([1, 3, , 4]);
46562
- return [4 /*yield*/, checkFile(rawFile)];
46563
+ return [4 /*yield*/, checkFile(rawFile, true)];
46563
46564
  case 2:
46564
46565
  _a.sent();
46565
46566
  return [3 /*break*/, 4];
@@ -46600,7 +46601,6 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
46600
46601
  case 0:
46601
46602
  _allFiles = __spreadArray([], __read(fileList.value), false);
46602
46603
  if (!(activeFile.raw &&
46603
- !props.autoUpload &&
46604
46604
  _allFiles.findIndex(function (i) { return i.raw === activeFile.raw; }) == -1)) return [3 /*break*/, 4];
46605
46605
  _a.label = 1;
46606
46606
  case 1:
package/lib/index.umd.js CHANGED
@@ -46506,7 +46506,7 @@ usage: app.provide(ID_INJECTION_KEY, {
46506
46506
  ((_a = activeFile.response) === null || _a === void 0 ? void 0 : _a.fileUrl) ||
46507
46507
  (activeFile.raw ? window.URL.createObjectURL(activeFile.raw) : ''));
46508
46508
  };
46509
- var checkFile = function (file) { return __awaiter(_this, void 0, void 0, function () {
46509
+ var checkFile = function (file, noEmit) { return __awaiter(_this, void 0, void 0, function () {
46510
46510
  var limit, limitSize, beforeSelected, fileType, fileNameType, allFileType, error_1;
46511
46511
  return __generator(this, function (_a) {
46512
46512
  switch (_a.label) {
@@ -46519,19 +46519,20 @@ usage: app.provide(ID_INJECTION_KEY, {
46519
46519
  if (!fileNameType ||
46520
46520
  (accept.value.indexOf(allFileType) == -1 &&
46521
46521
  accept.value.indexOf(fileNameType) == -1)) {
46522
- emits('error', {
46523
- code: 503,
46524
- msg: "\u4E0D\u652F\u6301\u4E0A\u4F20".concat(fileNameType || '此类', "\u7C7B\u578B\u6587\u4EF6")
46525
- });
46522
+ !noEmit &&
46523
+ emits('error', {
46524
+ code: 503,
46525
+ msg: "\u4E0D\u652F\u6301\u4E0A\u4F20".concat(fileNameType || '此类', "\u7C7B\u578B\u6587\u4EF6")
46526
+ });
46526
46527
  return [2 /*return*/, Promise.reject('file type error')];
46527
46528
  }
46528
46529
  }
46529
46530
  if (limit && fileList.value.length >= limit) {
46530
- emits('error', { code: 502, msg: "\u6700\u591A\u9009\u62E9".concat(limit, "\u4E2A\u6587\u4EF6") });
46531
+ !noEmit && emits('error', { code: 502, msg: "\u6700\u591A\u9009\u62E9".concat(limit, "\u4E2A\u6587\u4EF6") });
46531
46532
  return [2 /*return*/, Promise.reject('count limit exceeded')];
46532
46533
  }
46533
46534
  if (limitSize && file.size > limitSize * 1024 * 1024) {
46534
- emits('error', { code: 501, msg: "\u5355\u4E2A\u6587\u4EF6\u6700\u5927".concat(limitSize, "M") });
46535
+ !noEmit && emits('error', { code: 501, msg: "\u5355\u4E2A\u6587\u4EF6\u6700\u5927".concat(limitSize, "M") });
46535
46536
  return [2 /*return*/, Promise.reject('size limit exceeded')];
46536
46537
  }
46537
46538
  if (!beforeSelected) return [3 /*break*/, 4];
@@ -46562,7 +46563,7 @@ usage: app.provide(ID_INJECTION_KEY, {
46562
46563
  _a.label = 1;
46563
46564
  case 1:
46564
46565
  _a.trys.push([1, 3, , 4]);
46565
- return [4 /*yield*/, checkFile(rawFile)];
46566
+ return [4 /*yield*/, checkFile(rawFile, true)];
46566
46567
  case 2:
46567
46568
  _a.sent();
46568
46569
  return [3 /*break*/, 4];
@@ -46603,7 +46604,6 @@ usage: app.provide(ID_INJECTION_KEY, {
46603
46604
  case 0:
46604
46605
  _allFiles = __spreadArray([], __read(fileList.value), false);
46605
46606
  if (!(activeFile.raw &&
46606
- !props.autoUpload &&
46607
46607
  _allFiles.findIndex(function (i) { return i.raw === activeFile.raw; }) == -1)) return [3 /*break*/, 4];
46608
46608
  _a.label = 1;
46609
46609
  case 1:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xrk-components",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "",
5
5
  "main": "lib/index.esm.js",
6
6
  "typings": "lib/packages/index.d.ts",