@vtx/components 3.1.149 → 3.1.151

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 (311) hide show
  1. package/lib/_util/filterSpecialCharacters.js +60 -49
  2. package/lib/_util/filterSpecialCharacters.js.map +1 -1
  3. package/lib/_util/getComponentProps.js +1 -4
  4. package/lib/_util/getComponentProps.js.map +1 -1
  5. package/lib/_util/getToken.js +8 -16
  6. package/lib/_util/getToken.js.map +1 -1
  7. package/lib/_util/getUrlParam.js +2 -9
  8. package/lib/_util/getUrlParam.js.map +1 -1
  9. package/lib/_util/isFunction.js +0 -1
  10. package/lib/_util/isFunction.js.map +1 -1
  11. package/lib/_util/isObject.js +0 -1
  12. package/lib/_util/isObject.js.map +1 -1
  13. package/lib/_util/useColSize.js +3 -13
  14. package/lib/_util/useColSize.js.map +1 -1
  15. package/lib/_util/useInterval.js +0 -3
  16. package/lib/_util/useInterval.js.map +1 -1
  17. package/lib/_util/useSet.js +26 -42
  18. package/lib/_util/useSet.js.map +1 -1
  19. package/lib/config.js +1 -2
  20. package/lib/config.js.map +1 -1
  21. package/lib/index.js +1 -30
  22. package/lib/index.js.map +1 -1
  23. package/lib/style/index.less +2 -2
  24. package/lib/style/themes/compact.less +1 -1
  25. package/lib/style/themes/dark.less +9 -9
  26. package/lib/style/themes/default.less +7 -7
  27. package/lib/style/themes/index.less +1 -1
  28. package/lib/style/themes/variable.less +5 -5
  29. package/lib/vtx-color-picker/index.js +14 -33
  30. package/lib/vtx-color-picker/index.js.map +1 -1
  31. package/lib/vtx-color-picker/style/css.js +0 -2
  32. package/lib/vtx-color-picker/style/css.js.map +1 -1
  33. package/lib/vtx-color-picker/style/index.js +0 -2
  34. package/lib/vtx-color-picker/style/index.js.map +1 -1
  35. package/lib/vtx-combogrid/Combogrid.js +55 -96
  36. package/lib/vtx-combogrid/Combogrid.js.map +1 -1
  37. package/lib/vtx-combogrid/index.js +41 -66
  38. package/lib/vtx-combogrid/index.js.map +1 -1
  39. package/lib/vtx-combogrid/style/css.js +0 -7
  40. package/lib/vtx-combogrid/style/css.js.map +1 -1
  41. package/lib/vtx-combogrid/style/index.js +0 -7
  42. package/lib/vtx-combogrid/style/index.js.map +1 -1
  43. package/lib/vtx-datagrid/Alert.js +6 -15
  44. package/lib/vtx-datagrid/Alert.js.map +1 -1
  45. package/lib/vtx-datagrid/CheckboxList.js +35 -71
  46. package/lib/vtx-datagrid/CheckboxList.js.map +1 -1
  47. package/lib/vtx-datagrid/ColumnSetting.js +58 -105
  48. package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
  49. package/lib/vtx-datagrid/ResizeableTitle.js +6 -18
  50. package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
  51. package/lib/vtx-datagrid/index.js +138 -217
  52. package/lib/vtx-datagrid/index.js.map +1 -1
  53. package/lib/vtx-datagrid/renderColumnButtons.js +15 -46
  54. package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
  55. package/lib/vtx-datagrid/style/css.js +0 -10
  56. package/lib/vtx-datagrid/style/css.js.map +1 -1
  57. package/lib/vtx-datagrid/style/index.js +0 -10
  58. package/lib/vtx-datagrid/style/index.js.map +1 -1
  59. package/lib/vtx-date-picker/QdatePicker.js +28 -58
  60. package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
  61. package/lib/vtx-date-picker/generatePicker.js +35 -77
  62. package/lib/vtx-date-picker/generatePicker.js.map +1 -1
  63. package/lib/vtx-date-picker/index.js +2 -8
  64. package/lib/vtx-date-picker/index.js.map +1 -1
  65. package/lib/vtx-date-picker/style/css.js +0 -1
  66. package/lib/vtx-date-picker/style/css.js.map +1 -1
  67. package/lib/vtx-date-picker/style/index.js +0 -1
  68. package/lib/vtx-date-picker/style/index.js.map +1 -1
  69. package/lib/vtx-date-picker/style/index.less +39 -39
  70. package/lib/vtx-editor/index.js +13 -32
  71. package/lib/vtx-editor/index.js.map +1 -1
  72. package/lib/vtx-editor/style/css.js +0 -1
  73. package/lib/vtx-editor/style/css.js.map +1 -1
  74. package/lib/vtx-editor/style/index.js +0 -1
  75. package/lib/vtx-editor/style/index.js.map +1 -1
  76. package/lib/vtx-editor/style/index.less +8 -8
  77. package/lib/vtx-ellipsis-text/index.js +16 -29
  78. package/lib/vtx-ellipsis-text/index.js.map +1 -1
  79. package/lib/vtx-ellipsis-text/style/css.js +0 -1
  80. package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
  81. package/lib/vtx-ellipsis-text/style/index.js +0 -1
  82. package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
  83. package/lib/vtx-ellipsis-text/style/index.less +13 -13
  84. package/lib/vtx-export/index.js +38 -73
  85. package/lib/vtx-export/index.js.map +1 -1
  86. package/lib/vtx-export/style/css.js +0 -5
  87. package/lib/vtx-export/style/css.js.map +1 -1
  88. package/lib/vtx-export/style/index.js +0 -5
  89. package/lib/vtx-export/style/index.js.map +1 -1
  90. package/lib/vtx-export-async/ColumnsSelect.js +11 -23
  91. package/lib/vtx-export-async/ColumnsSelect.js.map +1 -1
  92. package/lib/vtx-export-async/History.js +75 -117
  93. package/lib/vtx-export-async/History.js.map +1 -1
  94. package/lib/vtx-export-async/index.js +72 -116
  95. package/lib/vtx-export-async/index.js.map +1 -1
  96. package/lib/vtx-export-async/style/css.js.map +1 -1
  97. package/lib/vtx-export-async/style/index.js.map +1 -1
  98. package/lib/vtx-export-async/util.js +9 -21
  99. package/lib/vtx-export-async/util.js.map +1 -1
  100. package/lib/vtx-form-layout/Card.js +17 -39
  101. package/lib/vtx-form-layout/Card.js.map +1 -1
  102. package/lib/vtx-form-layout/Divider.js +6 -12
  103. package/lib/vtx-form-layout/Divider.js.map +1 -1
  104. package/lib/vtx-form-layout/FormItem.js +19 -50
  105. package/lib/vtx-form-layout/FormItem.js.map +1 -1
  106. package/lib/vtx-form-layout/Pane.js +4 -10
  107. package/lib/vtx-form-layout/Pane.js.map +1 -1
  108. package/lib/vtx-form-layout/Row.js +2 -9
  109. package/lib/vtx-form-layout/Row.js.map +1 -1
  110. package/lib/vtx-form-layout/context.js +1 -4
  111. package/lib/vtx-form-layout/context.js.map +1 -1
  112. package/lib/vtx-form-layout/demo/Modal.less +43 -43
  113. package/lib/vtx-form-layout/index.js +10 -25
  114. package/lib/vtx-form-layout/index.js.map +1 -1
  115. package/lib/vtx-form-layout/style/css.js +0 -7
  116. package/lib/vtx-form-layout/style/css.js.map +1 -1
  117. package/lib/vtx-form-layout/style/index.js +0 -7
  118. package/lib/vtx-form-layout/style/index.js.map +1 -1
  119. package/lib/vtx-form-layout/style/index.less +220 -220
  120. package/lib/vtx-image/Image.js +77 -117
  121. package/lib/vtx-image/Image.js.map +1 -1
  122. package/lib/vtx-image/Preview.js +34 -63
  123. package/lib/vtx-image/Preview.js.map +1 -1
  124. package/lib/vtx-image/PreviewGroup.js +24 -54
  125. package/lib/vtx-image/PreviewGroup.js.map +1 -1
  126. package/lib/vtx-image/index.js +4 -11
  127. package/lib/vtx-image/index.js.map +1 -1
  128. package/lib/vtx-image/style/css.js +0 -1
  129. package/lib/vtx-image/style/css.js.map +1 -1
  130. package/lib/vtx-image/style/index.js +0 -1
  131. package/lib/vtx-image/style/index.js.map +1 -1
  132. package/lib/vtx-import/index.js +91 -143
  133. package/lib/vtx-import/index.js.map +1 -1
  134. package/lib/vtx-import/result.js +15 -33
  135. package/lib/vtx-import/result.js.map +1 -1
  136. package/lib/vtx-import/style/css.js +0 -3
  137. package/lib/vtx-import/style/css.js.map +1 -1
  138. package/lib/vtx-import/style/index.js +0 -3
  139. package/lib/vtx-import/style/index.js.map +1 -1
  140. package/lib/vtx-import/style/index.less +8 -8
  141. package/lib/vtx-import2/CheckResult.js +2 -9
  142. package/lib/vtx-import2/CheckResult.js.map +1 -1
  143. package/lib/vtx-import2/Content.js +16 -38
  144. package/lib/vtx-import2/Content.js.map +1 -1
  145. package/lib/vtx-import2/DownloadSvg.js +2 -7
  146. package/lib/vtx-import2/DownloadSvg.js.map +1 -1
  147. package/lib/vtx-import2/ImportResult.js +8 -15
  148. package/lib/vtx-import2/ImportResult.js.map +1 -1
  149. package/lib/vtx-import2/UploadSvg.js +2 -7
  150. package/lib/vtx-import2/UploadSvg.js.map +1 -1
  151. package/lib/vtx-import2/index.js +91 -176
  152. package/lib/vtx-import2/index.js.map +1 -1
  153. package/lib/vtx-import2/style/css.js +0 -3
  154. package/lib/vtx-import2/style/css.js.map +1 -1
  155. package/lib/vtx-import2/style/index.js +0 -3
  156. package/lib/vtx-import2/style/index.js.map +1 -1
  157. package/lib/vtx-import2/style/index.less +102 -102
  158. package/lib/vtx-input/TextArea.js +14 -31
  159. package/lib/vtx-input/TextArea.js.map +1 -1
  160. package/lib/vtx-input/index.js +24 -49
  161. package/lib/vtx-input/index.js.map +1 -1
  162. package/lib/vtx-input/style/css.js +0 -1
  163. package/lib/vtx-input/style/css.js.map +1 -1
  164. package/lib/vtx-input/style/index.js +0 -1
  165. package/lib/vtx-input/style/index.js.map +1 -1
  166. package/lib/vtx-input/style/index.less +24 -24
  167. package/lib/vtx-input/useLength.js +10 -23
  168. package/lib/vtx-input/useLength.js.map +1 -1
  169. package/lib/vtx-modal/Title.js +3 -9
  170. package/lib/vtx-modal/Title.js.map +1 -1
  171. package/lib/vtx-modal/index.js +52 -85
  172. package/lib/vtx-modal/index.js.map +1 -1
  173. package/lib/vtx-modal/style/css.js +0 -1
  174. package/lib/vtx-modal/style/css.js.map +1 -1
  175. package/lib/vtx-modal/style/index.js +0 -1
  176. package/lib/vtx-modal/style/index.js.map +1 -1
  177. package/lib/vtx-page-layout/Basic.js +4 -9
  178. package/lib/vtx-page-layout/Basic.js.map +1 -1
  179. package/lib/vtx-page-layout/Content.js +16 -27
  180. package/lib/vtx-page-layout/Content.js.map +1 -1
  181. package/lib/vtx-page-layout/Pane.js +4 -13
  182. package/lib/vtx-page-layout/Pane.js.map +1 -1
  183. package/lib/vtx-page-layout/TableLayout.js +34 -64
  184. package/lib/vtx-page-layout/TableLayout.js.map +1 -1
  185. package/lib/vtx-page-layout/TableWrap.js +12 -23
  186. package/lib/vtx-page-layout/TableWrap.js.map +1 -1
  187. package/lib/vtx-page-layout/container.js +32 -61
  188. package/lib/vtx-page-layout/container.js.map +1 -1
  189. package/lib/vtx-page-layout/index.js +2 -11
  190. package/lib/vtx-page-layout/index.js.map +1 -1
  191. package/lib/vtx-page-layout/style/css.js.map +1 -1
  192. package/lib/vtx-page-layout/style/index.js.map +1 -1
  193. package/lib/vtx-page-layout/style/index.less +138 -138
  194. package/lib/vtx-rps-frame/index.js +38 -58
  195. package/lib/vtx-rps-frame/index.js.map +1 -1
  196. package/lib/vtx-rps-frame/style/css.js.map +1 -1
  197. package/lib/vtx-rps-frame/style/index.js.map +1 -1
  198. package/lib/vtx-scrollable-row/index.js +34 -68
  199. package/lib/vtx-scrollable-row/index.js.map +1 -1
  200. package/lib/vtx-scrollable-row/style/css.js.map +1 -1
  201. package/lib/vtx-scrollable-row/style/index.js.map +1 -1
  202. package/lib/vtx-scrollable-row/style/index.less +113 -113
  203. package/lib/vtx-search/VtxCol.js +8 -27
  204. package/lib/vtx-search/VtxCol.js.map +1 -1
  205. package/lib/vtx-search/VtxRow.js +8 -15
  206. package/lib/vtx-search/VtxRow.js.map +1 -1
  207. package/lib/vtx-search/index.js +67 -112
  208. package/lib/vtx-search/index.js.map +1 -1
  209. package/lib/vtx-search/style/css.js +0 -4
  210. package/lib/vtx-search/style/css.js.map +1 -1
  211. package/lib/vtx-search/style/index.js +0 -4
  212. package/lib/vtx-search/style/index.js.map +1 -1
  213. package/lib/vtx-search-map-input/index.js +63 -98
  214. package/lib/vtx-search-map-input/index.js.map +1 -1
  215. package/lib/vtx-search-map-input/style/css.js +0 -2
  216. package/lib/vtx-search-map-input/style/css.js.map +1 -1
  217. package/lib/vtx-search-map-input/style/index.js +0 -2
  218. package/lib/vtx-search-map-input/style/index.js.map +1 -1
  219. package/lib/vtx-select/index.js +47 -99
  220. package/lib/vtx-select/index.js.map +1 -1
  221. package/lib/vtx-select/style/css.js +0 -8
  222. package/lib/vtx-select/style/css.js.map +1 -1
  223. package/lib/vtx-select/style/index.js +0 -8
  224. package/lib/vtx-select/style/index.js.map +1 -1
  225. package/lib/vtx-select/style/index.less +68 -68
  226. package/lib/vtx-signature/index.js +19 -34
  227. package/lib/vtx-signature/index.js.map +1 -1
  228. package/lib/vtx-signature/style/css.js +0 -2
  229. package/lib/vtx-signature/style/css.js.map +1 -1
  230. package/lib/vtx-signature/style/index.js +0 -2
  231. package/lib/vtx-signature/style/index.js.map +1 -1
  232. package/lib/vtx-signature/style/index.less +33 -33
  233. package/lib/vtx-split-pane/Pane.js +12 -23
  234. package/lib/vtx-split-pane/Pane.js.map +1 -1
  235. package/lib/vtx-split-pane/Resizer.js +21 -41
  236. package/lib/vtx-split-pane/Resizer.js.map +1 -1
  237. package/lib/vtx-split-pane/SplitPane.js +55 -111
  238. package/lib/vtx-split-pane/SplitPane.js.map +1 -1
  239. package/lib/vtx-split-pane/index.js +2 -7
  240. package/lib/vtx-split-pane/index.js.map +1 -1
  241. package/lib/vtx-split-pane/style/css.js +0 -3
  242. package/lib/vtx-split-pane/style/css.js.map +1 -1
  243. package/lib/vtx-split-pane/style/index.js +0 -3
  244. package/lib/vtx-split-pane/style/index.js.map +1 -1
  245. package/lib/vtx-split-pane/style/index.less +76 -76
  246. package/lib/vtx-statistics-column/Back.js +4 -11
  247. package/lib/vtx-statistics-column/Back.js.map +1 -1
  248. package/lib/vtx-statistics-column/Item.js +16 -32
  249. package/lib/vtx-statistics-column/Item.js.map +1 -1
  250. package/lib/vtx-statistics-column/Total.js +15 -31
  251. package/lib/vtx-statistics-column/Total.js.map +1 -1
  252. package/lib/vtx-statistics-column/context.js +1 -4
  253. package/lib/vtx-statistics-column/context.js.map +1 -1
  254. package/lib/vtx-statistics-column/index.js +2 -19
  255. package/lib/vtx-statistics-column/index.js.map +1 -1
  256. package/lib/vtx-statistics-column/style/css.js +0 -1
  257. package/lib/vtx-statistics-column/style/css.js.map +1 -1
  258. package/lib/vtx-statistics-column/style/index.js +0 -1
  259. package/lib/vtx-statistics-column/style/index.js.map +1 -1
  260. package/lib/vtx-statistics-column/style/index.less +59 -59
  261. package/lib/vtx-time-picker/index.js +8 -22
  262. package/lib/vtx-time-picker/index.js.map +1 -1
  263. package/lib/vtx-time-picker/style/css.js.map +1 -1
  264. package/lib/vtx-time-picker/style/index.js.map +1 -1
  265. package/lib/vtx-tree/index.js +83 -153
  266. package/lib/vtx-tree/index.js.map +1 -1
  267. package/lib/vtx-tree/style/css.js +0 -2
  268. package/lib/vtx-tree/style/css.js.map +1 -1
  269. package/lib/vtx-tree/style/index.js +0 -2
  270. package/lib/vtx-tree/style/index.js.map +1 -1
  271. package/lib/vtx-tree/utils.js +10 -31
  272. package/lib/vtx-tree/utils.js.map +1 -1
  273. package/lib/vtx-tree-select/index.js +37 -81
  274. package/lib/vtx-tree-select/index.js.map +1 -1
  275. package/lib/vtx-tree-select/style/css.js +0 -4
  276. package/lib/vtx-tree-select/style/css.js.map +1 -1
  277. package/lib/vtx-tree-select/style/index.js +0 -4
  278. package/lib/vtx-tree-select/style/index.js.map +1 -1
  279. package/lib/vtx-upload/FilePreview.js +17 -35
  280. package/lib/vtx-upload/FilePreview.js.map +1 -1
  281. package/lib/vtx-upload/index.js +90 -167
  282. package/lib/vtx-upload/index.js.map +1 -1
  283. package/lib/vtx-upload/style/css.js +0 -6
  284. package/lib/vtx-upload/style/css.js.map +1 -1
  285. package/lib/vtx-upload/style/index.js +0 -6
  286. package/lib/vtx-upload/style/index.js.map +1 -1
  287. package/lib/vtx-upload/style/index.less +61 -61
  288. package/lib/vtx-wang-editor/index.js +84 -126
  289. package/lib/vtx-wang-editor/index.js.map +1 -1
  290. package/lib/vtx-wang-editor/style/css.js +0 -1
  291. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  292. package/lib/vtx-wang-editor/style/index.js +0 -1
  293. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  294. package/lib/vtx-wang-editor/style/index.less +12 -12
  295. package/lib/vtx-wang-editor/wangEditorUtil.js +80 -141
  296. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  297. package/lib/vtx-ztree/index.js +77 -138
  298. package/lib/vtx-ztree/index.js.map +1 -1
  299. package/lib/vtx-ztree/style/css.js +0 -1
  300. package/lib/vtx-ztree/style/css.js.map +1 -1
  301. package/lib/vtx-ztree/style/index.js +0 -1
  302. package/lib/vtx-ztree/style/index.js.map +1 -1
  303. package/lib/vtx-ztree/style/index.less +45 -45
  304. package/lib/vtx-ztree-select/index.js +91 -159
  305. package/lib/vtx-ztree-select/index.js.map +1 -1
  306. package/lib/vtx-ztree-select/style/css.js +0 -3
  307. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  308. package/lib/vtx-ztree-select/style/index.js +0 -3
  309. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  310. package/lib/vtx-ztree-select/style/index.less +109 -109
  311. package/package.json +122 -122
@@ -1,90 +1,61 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports["default"] = void 0;
9
-
10
7
  var _react = _interopRequireWildcard(require("react"));
11
-
12
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
9
  var _antd = require("antd");
15
-
16
10
  var _Content = _interopRequireDefault(require("./Content"));
17
-
18
11
  var _ImportResult = _interopRequireDefault(require("./ImportResult"));
19
-
20
12
  var _ahooks = require("ahooks");
21
-
22
13
  var _getToken = _interopRequireDefault(require("../_util/getToken"));
23
-
24
14
  var _getSignature = _interopRequireDefault(require("@vtx/utils/lib/getSignature"));
25
-
26
15
  var _useSet3 = _interopRequireDefault(require("../_util/useSet"));
27
-
28
16
  var _md = _interopRequireDefault(require("md5"));
29
-
30
17
  var _utils = require("@vtx/utils");
31
-
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
-
34
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
-
36
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
37
-
38
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
39
-
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
21
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
22
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
40
23
  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."); }
41
-
42
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
43
-
44
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
45
-
46
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
47
-
24
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
25
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
26
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
48
27
  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."); }
49
-
50
- 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); }
51
-
52
- 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; }
53
-
54
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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; }
55
-
56
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
57
-
58
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
59
-
60
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
61
-
62
- 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; }
63
-
28
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
29
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
30
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
31
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
32
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
36
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
64
37
  function getFileName() {
65
38
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
66
39
  var index = name.lastIndexOf('.');
67
40
  var suffix = name.substring(index);
68
41
  return name.substring(0, index) + '(错误文件)' + suffix;
69
42
  }
70
-
71
43
  var VtxImport2 = function VtxImport2(props) {
72
44
  var visible = props.visible,
73
- close = props.close,
74
- title = props.title,
75
- accept = props.accept,
76
- fileKey = props.fileKey,
77
- uploadURL = props.uploadURL,
78
- postData = props.postData,
79
- errorURL = props.errorURL,
80
- templateURL = props.templateURL,
81
- afterUpload = props.afterUpload,
82
- errorDownloadName = props.errorDownloadName,
83
- customText = props.customText,
84
- _props$customEnumText = props.customEnumText,
85
- customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
86
- beforeUpload = props.beforeUpload;
87
-
45
+ close = props.close,
46
+ title = props.title,
47
+ accept = props.accept,
48
+ fileKey = props.fileKey,
49
+ uploadURL = props.uploadURL,
50
+ postData = props.postData,
51
+ errorURL = props.errorURL,
52
+ templateURL = props.templateURL,
53
+ afterUpload = props.afterUpload,
54
+ errorDownloadName = props.errorDownloadName,
55
+ customText = props.customText,
56
+ _props$customEnumText = props.customEnumText,
57
+ customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
58
+ beforeUpload = props.beforeUpload;
88
59
  var TextEnum = _objectSpread({
89
60
  headSubTitleText: '导入',
90
61
  btnCloseText: '关闭',
@@ -102,89 +73,73 @@ var VtxImport2 = function VtxImport2(props) {
102
73
  resultInfoDataText: '条数据',
103
74
  resultNetworkErrorText: '服务器异常'
104
75
  }, customEnumText);
105
-
106
76
  var _useState = (0, _react.useState)(0),
107
- _useState2 = _slicedToArray(_useState, 2),
108
- status = _useState2[0],
109
- setStatus = _useState2[1]; // 0:首页,1:结果页
110
-
111
-
77
+ _useState2 = _slicedToArray(_useState, 2),
78
+ status = _useState2[0],
79
+ setStatus = _useState2[1]; // 0:首页,1:结果页
112
80
  var _useState3 = (0, _react.useState)(false),
113
- _useState4 = _slicedToArray(_useState3, 2),
114
- result = _useState4[0],
115
- setResult = _useState4[1];
116
-
81
+ _useState4 = _slicedToArray(_useState3, 2),
82
+ result = _useState4[0],
83
+ setResult = _useState4[1];
117
84
  var _useState5 = (0, _react.useState)(5),
118
- _useState6 = _slicedToArray(_useState5, 2),
119
- countdown = _useState6[0],
120
- setCountdown = _useState6[1];
121
-
85
+ _useState6 = _slicedToArray(_useState5, 2),
86
+ countdown = _useState6[0],
87
+ setCountdown = _useState6[1];
122
88
  var _useState7 = (0, _react.useState)([]),
123
- _useState8 = _slicedToArray(_useState7, 2),
124
- fileList = _useState8[0],
125
- setFileList = _useState8[1];
126
-
89
+ _useState8 = _slicedToArray(_useState7, 2),
90
+ fileList = _useState8[0],
91
+ setFileList = _useState8[1];
127
92
  var _useState9 = (0, _react.useState)(undefined),
128
- _useState10 = _slicedToArray(_useState9, 2),
129
- interval = _useState10[0],
130
- setInterval = _useState10[1];
131
-
93
+ _useState10 = _slicedToArray(_useState9, 2),
94
+ interval = _useState10[0],
95
+ setInterval = _useState10[1];
132
96
  var _useState11 = (0, _react.useState)(''),
133
- _useState12 = _slicedToArray(_useState11, 2),
134
- errorFile = _useState12[0],
135
- setErrorFile = _useState12[1];
136
-
97
+ _useState12 = _slicedToArray(_useState11, 2),
98
+ errorFile = _useState12[0],
99
+ setErrorFile = _useState12[1];
137
100
  var _useState13 = (0, _react.useState)(false),
138
- _useState14 = _slicedToArray(_useState13, 2),
139
- uploading = _useState14[0],
140
- setUploading = _useState14[1];
141
-
101
+ _useState14 = _slicedToArray(_useState13, 2),
102
+ uploading = _useState14[0],
103
+ setUploading = _useState14[1];
142
104
  var _useState15 = (0, _react.useState)(0),
143
- _useState16 = _slicedToArray(_useState15, 2),
144
- count = _useState16[0],
145
- setCount = _useState16[1];
146
-
105
+ _useState16 = _slicedToArray(_useState15, 2),
106
+ count = _useState16[0],
107
+ setCount = _useState16[1];
147
108
  var fileInputRef = (0, _react.useRef)();
148
109
  var fileName = (0, _react.useRef)('');
149
110
  var indexRef = (0, _react.useRef)(0);
150
-
151
111
  var _useSet = (0, _useSet3["default"])({
152
- step: 1,
153
- chunkSize: props.chunkSize || 10 * 1024 * 1024,
154
- totalChunk: 0,
155
- currentIndex: 0,
156
- chunkId: '',
157
- chunks: []
158
- }),
159
- _useSet2 = _slicedToArray(_useSet, 2),
160
- state = _useSet2[0],
161
- setState = _useSet2[1];
162
-
112
+ step: 1,
113
+ chunkSize: props.chunkSize || 10 * 1024 * 1024,
114
+ totalChunk: 0,
115
+ currentIndex: 0,
116
+ chunkId: '',
117
+ chunks: []
118
+ }),
119
+ _useSet2 = _slicedToArray(_useSet, 2),
120
+ state = _useSet2[0],
121
+ setState = _useSet2[1];
163
122
  var token = (0, _getToken["default"])();
164
-
165
123
  if (!token) {
166
124
  token = props.token;
167
125
  }
168
-
169
126
  var newErrorDownloadName = errorDownloadName;
170
-
171
127
  if (!errorDownloadName) {
172
128
  newErrorDownloadName = fileName.current;
173
129
  }
174
-
175
130
  (0, _ahooks.useInterval)(function () {
176
131
  if (countdown === 0) {
177
132
  return close();
178
133
  }
179
-
180
134
  setCountdown(countdown - 1);
181
135
  }, interval);
182
136
  (0, _react.useEffect)(function () {
183
137
  if (fileList.length !== 0) {
184
138
  fileName.current = getFileName(fileList[0].name);
185
139
  }
186
- }, [fileList]); // 开始准备文件
140
+ }, [fileList]);
187
141
 
142
+ // 开始准备文件
188
143
  function checkFile(file) {
189
144
  if (file.size <= state.chunkSize) {
190
145
  upload(file);
@@ -200,15 +155,14 @@ var VtxImport2 = function VtxImport2(props) {
200
155
  step: 2
201
156
  });
202
157
  }
203
- } // 开始上传
204
-
205
-
158
+ }
159
+ // 开始上传
206
160
  function startUpload() {
207
161
  var dataArr = [];
208
162
  state.chunks.forEach(function (e, i) {
209
163
  //创建formdata对象
210
- var data = new FormData(); // data.append("totalNumber", state.chunks.length)
211
-
164
+ var data = new FormData();
165
+ // data.append("totalNumber", state.chunks.length)
212
166
  data.append('chunkSize', state.chunks.length);
213
167
  data.append('chunkNo', i + 1);
214
168
  data.append('chunkId', state.chunkId);
@@ -217,13 +171,11 @@ var VtxImport2 = function VtxImport2(props) {
217
171
  dataArr.push(data);
218
172
  });
219
173
  uploadAsync(dataArr);
220
- } // 上传
221
-
222
-
174
+ }
175
+ // 上传
223
176
  function uploadAsync(list) {
224
177
  if (indexRef.current < list.length) {
225
178
  var xhr = new XMLHttpRequest();
226
-
227
179
  xhr.onload = function () {
228
180
  if (xhr.status === 200) {
229
181
  setState({
@@ -233,42 +185,35 @@ var VtxImport2 = function VtxImport2(props) {
233
185
  uploadAsync(list);
234
186
  }
235
187
  };
236
-
237
188
  xhr.onerror = function () {
238
189
  _antd.message.error('上传失败');
239
- }; // 发送请求
240
-
241
-
190
+ };
191
+ // 发送请求
242
192
  xhr.open('POST', '/cloudFile/common/uploadChunk', true);
243
193
  xhr.send(list[indexRef.current]);
244
194
  } else {
245
195
  mergeFile();
246
196
  }
247
- } // 合并分片
248
-
249
-
197
+ }
198
+ // 合并分片
250
199
  function mergeFile() {
251
- var xhr = new XMLHttpRequest(); // 当上传完成时调用
252
-
200
+ var xhr = new XMLHttpRequest();
201
+ // 当上传完成时调用
253
202
  xhr.onload = function () {
254
203
  if (xhr.status === 200) {
255
204
  var res = JSON.parse(xhr.responseText);
256
-
257
205
  if ((res === null || res === void 0 ? void 0 : res.result) == 0) {
258
206
  _antd.message.success('上传成功');
259
-
260
207
  chunkUpload(res.data);
261
208
  } else {
262
209
  _antd.message.error((res === null || res === void 0 ? void 0 : res.msg) || '上传失败');
263
210
  }
264
211
  }
265
212
  };
266
-
267
213
  xhr.onerror = function () {
268
214
  _antd.message.error('上传失败');
269
- }; // 发送请求
270
-
271
-
215
+ };
216
+ // 发送请求
272
217
  xhr.open('POST', '/cloudFile/common/mergeChunk', true);
273
218
  var data = new FormData();
274
219
  data.append('chunkId', state.chunkId);
@@ -276,9 +221,8 @@ var VtxImport2 = function VtxImport2(props) {
276
221
  data.append('chunkSize', state.chunks.length);
277
222
  data.append('fileName', fileList[0].name);
278
223
  xhr.send(data);
279
- } // 合并切片后上传
280
-
281
-
224
+ }
225
+ // 合并切片后上传
282
226
  function chunkUpload(data) {
283
227
  var postUrl = getPostURL();
284
228
  var fmd = new FormData();
@@ -286,23 +230,18 @@ var VtxImport2 = function VtxImport2(props) {
286
230
  var request = new XMLHttpRequest();
287
231
  request.open('POST', postUrl);
288
232
  var signature = (0, _getSignature["default"])(postData);
289
-
290
233
  for (var key in signature) {
291
234
  request.setRequestHeader(key, signature[key]);
292
235
  }
293
-
294
236
  request.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
295
237
  request.setRequestHeader('access_token', token ? "".concat(token) : '');
296
-
297
238
  request.onreadystatechange = function (e) {
298
239
  if (e.target.readyState == 4) {
299
240
  dealResult(e.target.response);
300
241
  }
301
242
  };
302
-
303
243
  request.send(fmd);
304
244
  }
305
-
306
245
  function upload(files) {
307
246
  var postUrl = getPostURL();
308
247
  var fmd = new FormData();
@@ -310,61 +249,49 @@ var VtxImport2 = function VtxImport2(props) {
310
249
  var request = new XMLHttpRequest();
311
250
  request.open('POST', postUrl);
312
251
  var signature = (0, _getSignature["default"])(postData);
313
-
314
252
  for (var key in signature) {
315
253
  request.setRequestHeader(key, signature[key]);
316
254
  }
317
-
318
255
  request.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
319
256
  request.setRequestHeader('access_token', token ? "".concat(token) : '');
320
-
321
257
  request.onreadystatechange = function (e) {
322
258
  if (e.target.readyState == 4) {
323
259
  dealResult(e.target.response);
324
260
  }
325
261
  };
326
-
327
262
  request.send(fmd);
328
- } // 切片文件
329
-
330
-
263
+ }
264
+ // 切片文件
331
265
  function spreadFile(file) {
332
266
  var chunks = [];
333
267
  var start = 0;
334
268
  var end;
335
-
336
269
  while (start < file.size) {
337
270
  end = Math.min(start + state.chunkSize, file.size);
338
271
  chunks.push(file.slice(start, end));
339
272
  start = end;
340
273
  }
341
-
342
274
  return chunks;
343
- } // 获取上传地址(拼接参数)
344
-
275
+ }
345
276
 
277
+ // 获取上传地址(拼接参数)
346
278
  var getPostURL = function getPostURL() {
347
279
  var postUrl = uploadURL;
348
280
  var postArray = [];
349
-
350
281
  for (var k in postData) {
351
282
  if (postData[k] !== undefined && postData[k] !== null && postData[k] !== '') {
352
283
  postArray.push("".concat(k, "=").concat(encodeURIComponent(postData[k])));
353
284
  }
354
285
  }
355
-
356
286
  return postArray.length > 0 ? "".concat(postUrl, "?").concat(postArray.join('&')) : postUrl;
357
287
  };
358
-
359
288
  var dealResult = function dealResult(response) {
360
289
  setUploading(false);
361
290
  var parseData = JSON.parse(response);
362
291
  setStatus(1);
363
-
364
292
  if (typeof props.afterUpload === 'function') {
365
293
  afterUpload(parseData);
366
294
  }
367
-
368
295
  if (parseData.result === 0) {
369
296
  setResult(true);
370
297
  setCountdown(5);
@@ -373,7 +300,6 @@ var VtxImport2 = function VtxImport2(props) {
373
300
  } else if (parseData.result === 1) {
374
301
  setResult(false);
375
302
  setFileList([]);
376
-
377
303
  if (parseData.data) {
378
304
  setErrorFile(parseData.data);
379
305
  } else {
@@ -381,44 +307,35 @@ var VtxImport2 = function VtxImport2(props) {
381
307
  }
382
308
  }
383
309
  };
384
-
385
310
  var onUpload = function onUpload(_ref) {
386
311
  var _ref$files = _ref.files,
387
- files = _ref$files === void 0 ? fileList : _ref$files;
388
-
312
+ files = _ref$files === void 0 ? fileList : _ref$files;
389
313
  if (typeof props.beforeUpload === 'function') {
390
314
  var flag = beforeUpload(files[0]);
391
-
392
315
  if (!flag) {
393
316
  setFileList([]);
394
317
  return;
395
318
  }
396
319
  }
397
-
398
320
  if (files.length === 0) {
399
321
  return _antd.message.info(TextEnum.msgUploadWarningText);
400
322
  }
401
-
402
- setUploading(true); // 上传文件
403
-
323
+ setUploading(true);
324
+ // 上传文件
404
325
  checkFile(files[0]);
405
326
  };
406
-
407
327
  var againUpload = function againUpload() {
408
328
  setInterval(undefined);
409
329
  setFileList([]);
410
330
  fileInputRef.current && fileInputRef.current.click();
411
331
  };
412
-
413
332
  var onFileChange = function onFileChange() {
414
333
  var fileList = _toConsumableArray(fileInputRef.current.files);
415
-
416
334
  setFileList(fileList);
417
335
  onUpload({
418
336
  files: fileList
419
337
  });
420
338
  };
421
-
422
339
  (0, _react.useEffect)(function () {
423
340
  if (state.chunkId) {
424
341
  startUpload();
@@ -474,7 +391,6 @@ var VtxImport2 = function VtxImport2(props) {
474
391
  value: fileList.length === 0 ? '' : fileList[0].fileName
475
392
  }));
476
393
  };
477
-
478
394
  VtxImport2.defaultProps = {
479
395
  fileKey: 'file',
480
396
  accept: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv',
@@ -498,6 +414,5 @@ VtxImport2.propTypes = {
498
414
  beforeUpload: _propTypes["default"].func,
499
415
  chunkSize: _propTypes["default"].number
500
416
  };
501
- var _default = VtxImport2;
502
- exports["default"] = _default;
417
+ var _default = exports["default"] = VtxImport2;
503
418
  //# sourceMappingURL=index.js.map