rapid-spreadjs 1.0.22 → 1.0.23

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/index.cjs.js CHANGED
@@ -25,27 +25,6 @@ function _interopNamespaceDefault(e) {
25
25
  var echarts__namespace = /*#__PURE__*/_interopNamespaceDefault(echarts);
26
26
  var math__namespace = /*#__PURE__*/_interopNamespaceDefault(math);
27
27
 
28
- /**
29
- * 公用工具函数属性
30
- */
31
- const CommonUtils = {
32
- /**
33
- * 获取列的英文字母
34
- * @param colIndex 列的索引
35
- * @returns 返回英文字母
36
- */
37
- getColLetterName: (colIndex) => {
38
- colIndex += 1;
39
- let letter = "";
40
- while (colIndex > 0) {
41
- const remainder = (colIndex - 1) % 26;
42
- letter = String.fromCharCode(remainder + 65) + letter;
43
- colIndex = Math.floor((colIndex - 1) / 26);
44
- }
45
- return letter.toUpperCase();
46
- },
47
- };
48
-
49
28
  /******************************************************************************
50
29
  Copyright (c) Microsoft Corporation.
51
30
 
@@ -78,6 +57,45 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
78
57
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
79
58
  };
80
59
 
60
+ /**
61
+ * 公用工具函数属性
62
+ */
63
+ const CommonUtils = {
64
+ /**
65
+ * 获取文件的字节流对象
66
+ * @param fileUrl 在线文件地址
67
+ * @returns 文件的字节流对象
68
+ */
69
+ getFileBlob: (fileUrl) => __awaiter(void 0, void 0, void 0, function* () {
70
+ // 获取文件响应结果
71
+ const response = yield fetch(fileUrl, { method: 'GET' });
72
+ // 获取成功
73
+ if (response.ok) {
74
+ // 文件的字节流对象
75
+ const blob = yield response.blob();
76
+ return blob;
77
+ }
78
+ else {
79
+ return null;
80
+ }
81
+ }),
82
+ /**
83
+ * 获取列的英文字母
84
+ * @param colIndex 列的索引
85
+ * @returns 返回英文字母
86
+ */
87
+ getColLetterName: (colIndex) => {
88
+ colIndex += 1;
89
+ let letter = '';
90
+ while (colIndex > 0) {
91
+ const remainder = (colIndex - 1) % 26;
92
+ letter = String.fromCharCode(remainder + 65) + letter;
93
+ colIndex = Math.floor((colIndex - 1) / 26);
94
+ }
95
+ return letter.toUpperCase();
96
+ },
97
+ };
98
+
81
99
  /**
82
100
  * 公用方法,如:修约计算等
83
101
  */