fan-standard-comp 3.1.2 → 3.1.4

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.
Files changed (244) hide show
  1. package/package.json +1 -1
  2. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
  3. package/dist/fan-standard-comp.umd.js +0 -597
  4. package/dist/fonts/iconfont.eot +0 -0
  5. package/dist/fonts/iconfont.ttf +0 -0
  6. package/dist/fonts/iconfont.woff +0 -0
  7. package/es/ButtonGroup/ButtonList.d.ts +0 -2
  8. package/es/ButtonGroup/ButtonList.js +0 -37
  9. package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
  10. package/es/ButtonGroup/ButtonMenu.js +0 -38
  11. package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
  12. package/es/ButtonGroup/PopConfirmTitle.js +0 -37
  13. package/es/ButtonGroup/index.d.ts +0 -30
  14. package/es/ButtonGroup/index.js +0 -374
  15. package/es/ButtonGroup/style/index.less +0 -36
  16. package/es/DragContent/DragBar.js +0 -21
  17. package/es/DragContent/index.d.ts +0 -14
  18. package/es/DragContent/index.js +0 -173
  19. package/es/DragContent/index.less +0 -44
  20. package/es/FormComp/ChunkUploader/api.js +0 -76
  21. package/es/FormComp/ChunkUploader/index.js +0 -391
  22. package/es/FormComp/ChunkUploader/lib.js +0 -96
  23. package/es/FormComp/ChunkUploader/style/style.less +0 -3
  24. package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
  25. package/es/FormComp/ChunkUploader/worker.js +0 -23
  26. package/es/FormComp/EditButton/index.d.ts +0 -26
  27. package/es/FormComp/EditButton/index.js +0 -140
  28. package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
  29. package/es/FormComp/FieldComponent/ReUpload.js +0 -131
  30. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -245
  31. package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
  32. package/es/FormComp/FieldComponent/TitleNode.js +0 -9
  33. package/es/FormComp/FieldComponent/index.d.ts +0 -38
  34. package/es/FormComp/FieldComponent/index.js +0 -413
  35. package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
  36. package/es/FormComp/FieldComponent/style/index.less +0 -116
  37. package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
  38. package/es/FormComp/RenderItemGroup/index.js +0 -234
  39. package/es/FormComp/Uploader/index.d.ts +0 -19
  40. package/es/FormComp/Uploader/index.js +0 -275
  41. package/es/FormComp/Uploader/style/index.less +0 -14
  42. package/es/FormComp/Uploader/util.d.ts +0 -8
  43. package/es/FormComp/Uploader/util.js +0 -38
  44. package/es/FormComp/VarTemplate/index.js +0 -293
  45. package/es/FormComp/index.d.ts +0 -1
  46. package/es/FormComp/index.js +0 -1
  47. package/es/NavLeafScroll/index.js +0 -379
  48. package/es/NavLeafScroll/style/index.less +0 -119
  49. package/es/RefactorTree/data.d.ts +0 -7
  50. package/es/RefactorTree/index.d.ts +0 -40
  51. package/es/RefactorTree/index.js +0 -167
  52. package/es/RefactorTree/indexTreeNode.d.ts +0 -39
  53. package/es/RefactorTree/indexTreeNode.js +0 -237
  54. package/es/RefactorTree/style/index.d.ts +0 -1
  55. package/es/RefactorTree/style/index.js +0 -1
  56. package/es/RefactorTree/style/index.less +0 -22
  57. package/es/RefactorTree/util.d.ts +0 -42
  58. package/es/RefactorTree/util.js +0 -187
  59. package/es/SpecIcon/fonts/demo.css +0 -539
  60. package/es/SpecIcon/fonts/demo_index.html +0 -1315
  61. package/es/SpecIcon/fonts/iconfont.css +0 -211
  62. package/es/SpecIcon/fonts/iconfont.eot +0 -0
  63. package/es/SpecIcon/fonts/iconfont.js +0 -41
  64. package/es/SpecIcon/fonts/iconfont.json +0 -352
  65. package/es/SpecIcon/fonts/iconfont.svg +0 -173
  66. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  67. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  68. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  69. package/es/SpecIcon/index.d.ts +0 -17
  70. package/es/SpecIcon/index.js +0 -77
  71. package/es/SpecIcon/style/iconfont.less +0 -213
  72. package/es/SpecIcon/style/index.less +0 -98
  73. package/es/SplitterLayout/Pane.d.ts +0 -13
  74. package/es/SplitterLayout/Pane.js +0 -36
  75. package/es/SplitterLayout/index.js +0 -375
  76. package/es/SplitterLayout/index.less +0 -58
  77. package/es/StandardContent/SplitterLayout/Pane.js +0 -50
  78. package/es/StandardContent/SplitterLayout/index.js +0 -374
  79. package/es/StandardContent/SplitterLayout/index.less +0 -58
  80. package/es/StandardContent/SubfieldContent.d.ts +0 -17
  81. package/es/StandardContent/SubfieldContent.js +0 -41
  82. package/es/StandardContent/WrapperContent.d.ts +0 -13
  83. package/es/StandardContent/WrapperContent.js +0 -29
  84. package/es/StandardContent/data.d.ts +0 -101
  85. package/es/StandardContent/style/index.less +0 -80
  86. package/es/StandardDragModal/index.d.ts +0 -11
  87. package/es/StandardDragModal/index.js +0 -30
  88. package/es/StandardFilter/index.d.ts +0 -35
  89. package/es/StandardFilter/index.js +0 -253
  90. package/es/StandardFilter/style/index.less +0 -62
  91. package/es/StandardForm/ActionList.js +0 -44
  92. package/es/StandardForm/StepForm.d.ts +0 -19
  93. package/es/StandardForm/StepForm.js +0 -267
  94. package/es/StandardForm/TabForm.d.ts +0 -19
  95. package/es/StandardForm/TabForm.js +0 -122
  96. package/es/StandardForm/index.d.ts +0 -32
  97. package/es/StandardForm/index.js +0 -170
  98. package/es/StandardForm/style/index.less +0 -58
  99. package/es/StandardModal/UpdateFormRef.js +0 -18
  100. package/es/StandardModal/index.d.ts +0 -44
  101. package/es/StandardModal/index.js +0 -495
  102. package/es/StandardModal/style/index.less +0 -50
  103. package/es/StandardPanel/index.d.ts +0 -28
  104. package/es/StandardPanel/index.js +0 -134
  105. package/es/StandardPanel/style/index.less +0 -135
  106. package/es/StandardTable/index.d.ts +0 -22
  107. package/es/StandardTable/index.js +0 -126
  108. package/es/StandardTable/style/index.d.ts +0 -1
  109. package/es/StandardTable/style/index.js +0 -1
  110. package/es/StandardTable/style/index.less +0 -206
  111. package/es/components/IconNode/index.d.ts +0 -16
  112. package/es/components/IconNode/index.js +0 -28
  113. package/es/components/index.d.ts +0 -2
  114. package/es/components/index.js +0 -2
  115. package/es/data/func.code.js +0 -112
  116. package/es/data/general.config.js +0 -172
  117. package/es/data/index.js +0 -3
  118. package/es/index.d.ts +0 -24
  119. package/es/index.js +0 -31
  120. package/es/styles/index.less +0 -0
  121. package/es/theme/spec-variable.less +0 -48
  122. package/es/utils/ValueFormat.js +0 -50
  123. package/es/utils/filterPermission.js +0 -111
  124. package/es/utils/getParentNodes.js +0 -215
  125. package/es/utils/index.js +0 -3
  126. package/lib/ButtonGroup/ButtonList.d.ts +0 -2
  127. package/lib/ButtonGroup/ButtonList.js +0 -55
  128. package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
  129. package/lib/ButtonGroup/ButtonMenu.js +0 -51
  130. package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
  131. package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
  132. package/lib/ButtonGroup/index.d.ts +0 -30
  133. package/lib/ButtonGroup/index.js +0 -405
  134. package/lib/ButtonGroup/style/index.less +0 -36
  135. package/lib/DragContent/DragBar.js +0 -33
  136. package/lib/DragContent/index.d.ts +0 -14
  137. package/lib/DragContent/index.js +0 -191
  138. package/lib/DragContent/index.less +0 -44
  139. package/lib/FormComp/ChunkUploader/api.js +0 -89
  140. package/lib/FormComp/ChunkUploader/index.js +0 -410
  141. package/lib/FormComp/ChunkUploader/lib.js +0 -113
  142. package/lib/FormComp/ChunkUploader/style/style.less +0 -3
  143. package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
  144. package/lib/FormComp/ChunkUploader/worker.js +0 -28
  145. package/lib/FormComp/EditButton/index.d.ts +0 -26
  146. package/lib/FormComp/EditButton/index.js +0 -159
  147. package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
  148. package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
  149. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -268
  150. package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
  151. package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
  152. package/lib/FormComp/FieldComponent/index.d.ts +0 -38
  153. package/lib/FormComp/FieldComponent/index.js +0 -457
  154. package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
  155. package/lib/FormComp/FieldComponent/style/index.less +0 -116
  156. package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
  157. package/lib/FormComp/RenderItemGroup/index.js +0 -255
  158. package/lib/FormComp/Uploader/index.d.ts +0 -19
  159. package/lib/FormComp/Uploader/index.js +0 -301
  160. package/lib/FormComp/Uploader/style/index.less +0 -14
  161. package/lib/FormComp/Uploader/util.d.ts +0 -8
  162. package/lib/FormComp/Uploader/util.js +0 -47
  163. package/lib/FormComp/VarTemplate/index.js +0 -308
  164. package/lib/FormComp/index.d.ts +0 -1
  165. package/lib/FormComp/index.js +0 -15
  166. package/lib/NavLeafScroll/index.js +0 -397
  167. package/lib/NavLeafScroll/style/index.less +0 -119
  168. package/lib/RefactorTree/data.d.ts +0 -7
  169. package/lib/RefactorTree/index.d.ts +0 -40
  170. package/lib/RefactorTree/index.js +0 -190
  171. package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
  172. package/lib/RefactorTree/indexTreeNode.js +0 -260
  173. package/lib/RefactorTree/style/index.d.ts +0 -1
  174. package/lib/RefactorTree/style/index.js +0 -3
  175. package/lib/RefactorTree/style/index.less +0 -22
  176. package/lib/RefactorTree/util.d.ts +0 -42
  177. package/lib/RefactorTree/util.js +0 -195
  178. package/lib/SpecIcon/fonts/demo.css +0 -539
  179. package/lib/SpecIcon/fonts/demo_index.html +0 -1315
  180. package/lib/SpecIcon/fonts/iconfont.css +0 -211
  181. package/lib/SpecIcon/fonts/iconfont.eot +0 -0
  182. package/lib/SpecIcon/fonts/iconfont.js +0 -43
  183. package/lib/SpecIcon/fonts/iconfont.json +0 -352
  184. package/lib/SpecIcon/fonts/iconfont.svg +0 -173
  185. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  186. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  187. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  188. package/lib/SpecIcon/index.d.ts +0 -17
  189. package/lib/SpecIcon/index.js +0 -90
  190. package/lib/SpecIcon/style/iconfont.less +0 -213
  191. package/lib/SpecIcon/style/index.less +0 -98
  192. package/lib/SplitterLayout/Pane.d.ts +0 -13
  193. package/lib/SplitterLayout/Pane.js +0 -48
  194. package/lib/SplitterLayout/index.js +0 -386
  195. package/lib/SplitterLayout/index.less +0 -58
  196. package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
  197. package/lib/StandardContent/SplitterLayout/index.js +0 -387
  198. package/lib/StandardContent/SplitterLayout/index.less +0 -58
  199. package/lib/StandardContent/SubfieldContent.d.ts +0 -17
  200. package/lib/StandardContent/SubfieldContent.js +0 -56
  201. package/lib/StandardContent/WrapperContent.d.ts +0 -13
  202. package/lib/StandardContent/WrapperContent.js +0 -43
  203. package/lib/StandardContent/data.d.ts +0 -101
  204. package/lib/StandardContent/style/index.less +0 -80
  205. package/lib/StandardDragModal/index.d.ts +0 -11
  206. package/lib/StandardDragModal/index.js +0 -43
  207. package/lib/StandardFilter/index.d.ts +0 -35
  208. package/lib/StandardFilter/index.js +0 -272
  209. package/lib/StandardFilter/style/index.less +0 -62
  210. package/lib/StandardForm/ActionList.js +0 -57
  211. package/lib/StandardForm/StepForm.d.ts +0 -19
  212. package/lib/StandardForm/StepForm.js +0 -295
  213. package/lib/StandardForm/TabForm.d.ts +0 -19
  214. package/lib/StandardForm/TabForm.js +0 -148
  215. package/lib/StandardForm/index.d.ts +0 -32
  216. package/lib/StandardForm/index.js +0 -197
  217. package/lib/StandardForm/style/index.less +0 -58
  218. package/lib/StandardModal/UpdateFormRef.js +0 -32
  219. package/lib/StandardModal/index.d.ts +0 -44
  220. package/lib/StandardModal/index.js +0 -525
  221. package/lib/StandardModal/style/index.less +0 -50
  222. package/lib/StandardPanel/index.d.ts +0 -28
  223. package/lib/StandardPanel/index.js +0 -155
  224. package/lib/StandardPanel/style/index.less +0 -135
  225. package/lib/StandardTable/index.d.ts +0 -22
  226. package/lib/StandardTable/index.js +0 -143
  227. package/lib/StandardTable/style/index.d.ts +0 -1
  228. package/lib/StandardTable/style/index.js +0 -3
  229. package/lib/StandardTable/style/index.less +0 -206
  230. package/lib/components/IconNode/index.d.ts +0 -16
  231. package/lib/components/IconNode/index.js +0 -39
  232. package/lib/components/index.d.ts +0 -2
  233. package/lib/components/index.js +0 -15
  234. package/lib/data/func.code.js +0 -119
  235. package/lib/data/general.config.js +0 -179
  236. package/lib/data/index.js +0 -23
  237. package/lib/index.d.ts +0 -24
  238. package/lib/index.js +0 -236
  239. package/lib/styles/index.less +0 -0
  240. package/lib/theme/spec-variable.less +0 -48
  241. package/lib/utils/ValueFormat.js +0 -58
  242. package/lib/utils/filterPermission.js +0 -127
  243. package/lib/utils/getParentNodes.js +0 -226
  244. package/lib/utils/index.js +0 -35
@@ -1,174 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _api = require("./api");
9
-
10
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
-
12
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
-
14
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
-
16
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
-
18
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
-
20
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
21
-
22
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
-
24
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
-
26
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
-
28
- 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, descriptor.key, descriptor); } }
29
-
30
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
31
-
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
34
- var UploadQueue = /*#__PURE__*/function () {
35
- // 上传任务队列存储
36
- // 是否正在上传
37
- // 记录每个文件还剩下多少上传任务,作为判断文件是否完成上传的依据
38
- // 文件完成上传的回调函数
39
- function UploadQueue(_ref) {
40
- var fileFinishCb = _ref.fileFinishCb;
41
-
42
- _classCallCheck(this, UploadQueue);
43
-
44
- _defineProperty(this, "uploadQueue", []);
45
-
46
- _defineProperty(this, "isUploading", false);
47
-
48
- _defineProperty(this, "tasksSizePerFile", {});
49
-
50
- _defineProperty(this, "fileFinishCb", function () {});
51
-
52
- if (!!fileFinishCb && typeof fileFinishCb === 'function') {
53
- this.fileFinishCb = fileFinishCb;
54
- }
55
- }
56
- /**
57
- * 建立上传队列,规则:
58
- * 找出服务端记录里当前该文件所有状态为'wait'的文件分片
59
- * @param {Object} fileInfo 文件上传情况
60
- * @param {Array} chunksArr 分片数组
61
- */
62
-
63
-
64
- _createClass(UploadQueue, [{
65
- key: "addChunksToQueue",
66
- value: function addChunksToQueue(fileInfo, chunksArr) {
67
- console.log('addChunksToQueue=>建立上传队列=>', fileInfo, chunksArr);
68
- var newTasks = fileInfo.chunks.filter(function (chunk) {
69
- return chunk.status === 'wait';
70
- }).map(function (_, index) {
71
- return {
72
- hash: fileInfo.hash,
73
- index: index,
74
- chunk: chunksArr[index]
75
- };
76
- });
77
- /* 添加上传任务到队列中 */
78
-
79
- if (newTasks.length > 0) {
80
- this.uploadQueue = [].concat(_toConsumableArray(this.uploadQueue), _toConsumableArray(newTasks));
81
- this.tasksSizePerFile[newTasks[0].hash] = newTasks.length; // 记录当前文件有多少个上传任务
82
- }
83
- }
84
- /**
85
- * 触发上传
86
- */
87
-
88
- }, {
89
- key: "run",
90
- value: function run() {
91
- if (!this.isUploading) {
92
- this.isUploading = true;
93
- this.uploadNext(); // 开始上传
94
- }
95
- }
96
- /**
97
- * 上传下一个分片
98
- */
99
-
100
- }, {
101
- key: "uploadNext",
102
- value: function () {
103
- var _uploadNext = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
104
- var _this$uploadQueue$shi, chunkIndex, chunk, fileHash, lockResult;
105
-
106
- return regeneratorRuntime.wrap(function _callee$(_context) {
107
- while (1) {
108
- switch (_context.prev = _context.next) {
109
- case 0:
110
- if (!(this.uploadQueue.length === 0)) {
111
- _context.next = 3;
112
- break;
113
- }
114
-
115
- this.isUploading = false;
116
- return _context.abrupt("return");
117
-
118
- case 3:
119
- _this$uploadQueue$shi = this.uploadQueue.shift(), chunkIndex = _this$uploadQueue$shi.index, chunk = _this$uploadQueue$shi.chunk, fileHash = _this$uploadQueue$shi.hash; // 从上传队列里取出一个上传任务
120
-
121
- console.log('请求接口lockChunk=>给分片加锁,避免多个客户端上传同一个分片');
122
- /* 给分片加锁,避免多个客户端上传同一个分片 */
123
-
124
- _context.next = 7;
125
- return (0, _api.lockChunk)(fileHash, chunkIndex);
126
-
127
- case 7:
128
- lockResult = _context.sent;
129
-
130
- if (!lockResult) {
131
- _context.next = 16;
132
- break;
133
- }
134
-
135
- _context.next = 11;
136
- return (0, _api.uploadChunk)(fileHash, chunkIndex, chunk);
137
-
138
- case 11:
139
- console.log('请求接口uploadChunk=>上传分片文件,执行任务数递减', this.tasksSizePerFile);
140
- /* 判断该文件的所有分片是否都上传完(任务数递减为0时) */
141
-
142
- if (--this.tasksSizePerFile[fileHash] === 0) {
143
- this.fileFinishCb(fileHash);
144
- console.log('fileFinishCb=>该文件的所有分片已都上传完');
145
- }
146
-
147
- this.uploadNext();
148
- _context.next = 17;
149
- break;
150
-
151
- case 16:
152
- // 加锁失败,表示已有另一个客户端上传此分片,因此丢弃当前上传任务
153
- this.uploadNext();
154
-
155
- case 17:
156
- case "end":
157
- return _context.stop();
158
- }
159
- }
160
- }, _callee, this);
161
- }));
162
-
163
- function uploadNext() {
164
- return _uploadNext.apply(this, arguments);
165
- }
166
-
167
- return uploadNext;
168
- }()
169
- }]);
170
-
171
- return UploadQueue;
172
- }();
173
-
174
- exports.default = UploadQueue;
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- var _sparkMd = _interopRequireDefault(require("spark-md5"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
- /* eslint-disable no-restricted-globals */
8
- self.addEventListener('message', function (e) {
9
- var chunksArr = e.data.chunksArr; // 收到主线程传递来的文件分片
10
-
11
- console.log('监听\'message\'收到主线程传递来的文件分片', chunksArr);
12
- var spark = new _sparkMd.default.ArrayBuffer();
13
- var fileReader = new FileReader();
14
- fileReader.readAsArrayBuffer(chunksArr.pop());
15
- console.log('创建文件读取', fileReader);
16
-
17
- fileReader.onload = function (e) {
18
- spark.append(e.target.result);
19
-
20
- if (chunksArr.length === 0) {
21
- self.postMessage({
22
- hash: spark.end()
23
- });
24
- } else {
25
- fileReader.readAsArrayBuffer(chunksArr.pop());
26
- }
27
- };
28
- }, false);
@@ -1,26 +0,0 @@
1
- import React, { Component } from 'react';
2
- export interface EditButtonProps {
3
- size?: any;
4
- label?: string;
5
- width?: number;
6
- icon?: React.ReactNode;
7
- disabled?: boolean;
8
- onChange?: (val: any) => void;
9
- onSave?: (val: any) => void;
10
- className?: string;
11
- style?: React.CSSProperties;
12
- }
13
- export interface EditButtonState {
14
- inputValue: string;
15
- inputVisible: boolean;
16
- }
17
- declare class EditButton extends Component<EditButtonProps, EditButtonState> {
18
- constructor(props: EditButtonProps);
19
- private input;
20
- handleClick: () => void;
21
- saveInputRef: (input: any) => void;
22
- handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
23
- handleInputConfirm: () => void;
24
- render(): JSX.Element;
25
- }
26
- export default EditButton;
@@ -1,159 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- require("antd/es/button/style");
11
-
12
- var _button = _interopRequireDefault(require("antd/es/button"));
13
-
14
- require("antd/es/input/style");
15
-
16
- var _input = _interopRequireDefault(require("antd/es/input"));
17
-
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _classnames = _interopRequireDefault(require("classnames"));
21
-
22
- var _icons = require("@ant-design/icons");
23
-
24
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
25
-
26
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
-
32
- 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, descriptor.key, descriptor); } }
33
-
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
-
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
-
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
-
40
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
41
-
42
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
43
-
44
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
-
46
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
47
-
48
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
49
-
50
- var EditButton = /*#__PURE__*/function (_Component) {
51
- _inherits(EditButton, _Component);
52
-
53
- var _super = _createSuper(EditButton);
54
-
55
- function EditButton(props) {
56
- var _this;
57
-
58
- _classCallCheck(this, EditButton);
59
-
60
- _this = _super.call(this, props);
61
-
62
- _this.handleClick = function () {
63
- _this.setState({
64
- inputVisible: true
65
- }, function () {
66
- return _this.input.focus();
67
- });
68
- };
69
-
70
- _this.saveInputRef = function (input) {
71
- _this.input = input;
72
- };
73
-
74
- _this.handleInputChange = function (e) {
75
- _this.setState({
76
- inputValue: e.target.value
77
- });
78
- };
79
-
80
- _this.handleInputConfirm = function () {
81
- var _this$props = _this.props,
82
- onSave = _this$props.onSave,
83
- onChange = _this$props.onChange;
84
- var inputValue = _this.state.inputValue;
85
- if (onSave) onSave(inputValue);
86
- if (onChange) onChange(inputValue);
87
-
88
- _this.setState({
89
- inputVisible: false,
90
- inputValue: ''
91
- });
92
- };
93
-
94
- _this.state = {
95
- inputValue: '',
96
- inputVisible: false
97
- };
98
- return _this;
99
- }
100
-
101
- _createClass(EditButton, [{
102
- key: "render",
103
- value: function render() {
104
- var _this2 = this;
105
-
106
- var _this$props2 = this.props,
107
- _this$props2$size = _this$props2.size,
108
- size = _this$props2$size === void 0 ? 'middle' : _this$props2$size,
109
- label = _this$props2.label,
110
- _this$props2$icon = _this$props2.icon,
111
- icon = _this$props2$icon === void 0 ? /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null) : _this$props2$icon,
112
- style = _this$props2.style,
113
- className = _this$props2.className,
114
- disabled = _this$props2.disabled,
115
- _this$props2$width = _this$props2.width,
116
- width = _this$props2$width === void 0 ? 106 : _this$props2$width;
117
- var _this$state = this.state,
118
- inputValue = _this$state.inputValue,
119
- inputVisible = _this$state.inputVisible;
120
- return /*#__PURE__*/_react.default.createElement("span", {
121
- style: Object.assign({
122
- display: 'inline-block',
123
- width: "".concat(width, "px"),
124
- verticalAlign: 'middle'
125
- }, style),
126
- className: (0, _classnames.default)(className, 'spec-edit-button')
127
- }, inputVisible ? /*#__PURE__*/_react.default.createElement(_input.default, {
128
- ref: this.saveInputRef,
129
- type: "text",
130
- size: size,
131
- style: {
132
- width: '100%'
133
- },
134
- value: inputValue,
135
- onChange: this.handleInputChange,
136
- onBlur: function onBlur() {
137
- return _this2.handleInputConfirm();
138
- },
139
- onPressEnter: function onPressEnter() {
140
- return _this2.handleInputConfirm();
141
- }
142
- }) : /*#__PURE__*/_react.default.createElement(_button.default, {
143
- disabled: disabled,
144
- icon: icon,
145
- size: size,
146
- style: {
147
- borderStyle: 'dashed',
148
- width: '100%'
149
- },
150
- onClick: this.handleClick
151
- }, label));
152
- }
153
- }]);
154
-
155
- return EditButton;
156
- }(_react.Component);
157
-
158
- var _default = EditButton;
159
- exports.default = _default;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- declare const ReUpload: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<unknown>>;
3
- export default ReUpload;
@@ -1,151 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- require("antd/es/upload/style");
11
-
12
- var _upload = _interopRequireDefault(require("antd/es/upload"));
13
-
14
- var _tslib = require("tslib");
15
-
16
- var _react = _interopRequireWildcard(require("react"));
17
-
18
- var _index = _interopRequireDefault(require("../../StandardModal/index"));
19
-
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
-
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
-
28
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
-
30
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
31
-
32
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
33
-
34
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
35
-
36
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
-
38
- function getBase64(file) {
39
- return new Promise(function (resolve, reject) {
40
- var reader = new FileReader();
41
- reader.readAsDataURL(file);
42
-
43
- reader.onload = function () {
44
- return resolve(reader.result);
45
- };
46
-
47
- reader.onerror = function (error) {
48
- return reject(error);
49
- };
50
- });
51
- }
52
-
53
- var ReUpload = /*#__PURE__*/_react.default.forwardRef(function (deProps, ref) {
54
- var viewOnly = deProps.viewOnly,
55
- onChange = deProps.onChange,
56
- value = deProps.value,
57
- otherProps = (0, _tslib.__rest)(deProps, ["viewOnly", "onChange", "value"]);
58
-
59
- var _useState = (0, _react.useState)(),
60
- _useState2 = _slicedToArray(_useState, 2),
61
- fileList = _useState2[0],
62
- setFileList = _useState2[1];
63
-
64
- var _useState3 = (0, _react.useState)({
65
- previewVisible: false,
66
- previewImage: '',
67
- previewTitle: ''
68
- }),
69
- _useState4 = _slicedToArray(_useState3, 2),
70
- previewConfig = _useState4[0],
71
- setPreviewConfig = _useState4[1];
72
-
73
- (0, _react.useEffect)(function () {
74
- setFileList(value);
75
- }, [value]);
76
-
77
- var handlePreview = function handlePreview(file) {
78
- return (0, _tslib.__awaiter)(void 0, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
79
- return regeneratorRuntime.wrap(function _callee$(_context) {
80
- while (1) {
81
- switch (_context.prev = _context.next) {
82
- case 0:
83
- if (!(!file.url && !file.preview)) {
84
- _context.next = 4;
85
- break;
86
- }
87
-
88
- _context.next = 3;
89
- return getBase64(file.originFileObj);
90
-
91
- case 3:
92
- file.preview = _context.sent;
93
-
94
- case 4:
95
- setPreviewConfig({
96
- previewImage: file.url || file.preview,
97
- previewVisible: true,
98
- previewTitle: file.name || file.url.substring(file.url.lastIndexOf('/') + 1)
99
- });
100
-
101
- case 5:
102
- case "end":
103
- return _context.stop();
104
- }
105
- }
106
- }, _callee);
107
- }));
108
- };
109
-
110
- var uploadChange = (0, _react.useCallback)(function (_ref) {
111
- var file = _ref.file,
112
- fileList = _ref.fileList,
113
- event = _ref.event;
114
- setFileList(fileList);
115
- onChange && onChange(fileList, {
116
- file: file,
117
- fileList: fileList,
118
- event: event
119
- });
120
- }, [setFileList]);
121
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_upload.default, Object.assign({}, otherProps, {
122
- fileList: fileList,
123
- onPreview: handlePreview,
124
- onChange: uploadChange,
125
- ref: ref,
126
- className: viewOnly ? 'upload-viewonly' : ''
127
- })), /*#__PURE__*/_react.default.createElement(_index.default, {
128
- visible: previewConfig.previewVisible,
129
- hideFooter: true,
130
- onCancel: function onCancel() {
131
- return setPreviewConfig({
132
- previewVisible: false,
133
- previewImage: '',
134
- previewTitle: ''
135
- });
136
- }
137
- }, /*#__PURE__*/_react.default.createElement("div", {
138
- style: {
139
- textAlign: 'center'
140
- }
141
- }, /*#__PURE__*/_react.default.createElement("img", {
142
- style: {
143
- maxWidth: '100%'
144
- },
145
- src: previewConfig.previewImage,
146
- alt: ""
147
- }))));
148
- });
149
-
150
- var _default = ReUpload;
151
- exports.default = _default;