@vtx/components 3.1.73 → 3.1.74

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 (291) hide show
  1. package/lib/_util/filterSpecialCharacters.js +55 -44
  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 +7 -15
  6. package/lib/_util/getToken.js.map +1 -1
  7. package/lib/_util/getUrlParam.js +1 -8
  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 +2 -12
  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 +23 -39
  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 +0 -27
  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 +9 -26
  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 +46 -86
  36. package/lib/vtx-combogrid/Combogrid.js.map +1 -1
  37. package/lib/vtx-combogrid/index.js +28 -54
  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 +4 -13
  44. package/lib/vtx-datagrid/Alert.js.map +1 -1
  45. package/lib/vtx-datagrid/ColumnSetting.js +43 -79
  46. package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
  47. package/lib/vtx-datagrid/ResizeableTitle.js +3 -15
  48. package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
  49. package/lib/vtx-datagrid/index.js +113 -178
  50. package/lib/vtx-datagrid/index.js.map +1 -1
  51. package/lib/vtx-datagrid/renderColumnButtons.js +7 -38
  52. package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
  53. package/lib/vtx-datagrid/style/css.js +0 -10
  54. package/lib/vtx-datagrid/style/css.js.map +1 -1
  55. package/lib/vtx-datagrid/style/index.js +0 -10
  56. package/lib/vtx-datagrid/style/index.js.map +1 -1
  57. package/lib/vtx-date-picker/QdatePicker.js +21 -51
  58. package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
  59. package/lib/vtx-date-picker/generatePicker.js +24 -65
  60. package/lib/vtx-date-picker/generatePicker.js.map +1 -1
  61. package/lib/vtx-date-picker/index.js +1 -7
  62. package/lib/vtx-date-picker/index.js.map +1 -1
  63. package/lib/vtx-date-picker/style/css.js +0 -1
  64. package/lib/vtx-date-picker/style/css.js.map +1 -1
  65. package/lib/vtx-date-picker/style/index.js +0 -1
  66. package/lib/vtx-date-picker/style/index.js.map +1 -1
  67. package/lib/vtx-date-picker/style/index.less +39 -39
  68. package/lib/vtx-editor/index.js +9 -28
  69. package/lib/vtx-editor/index.js.map +1 -1
  70. package/lib/vtx-editor/style/css.js +0 -1
  71. package/lib/vtx-editor/style/css.js.map +1 -1
  72. package/lib/vtx-editor/style/index.js +0 -1
  73. package/lib/vtx-editor/style/index.js.map +1 -1
  74. package/lib/vtx-editor/style/index.less +8 -8
  75. package/lib/vtx-ellipsis-text/index.js +14 -27
  76. package/lib/vtx-ellipsis-text/index.js.map +1 -1
  77. package/lib/vtx-ellipsis-text/style/css.js +0 -1
  78. package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
  79. package/lib/vtx-ellipsis-text/style/index.js +0 -1
  80. package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
  81. package/lib/vtx-ellipsis-text/style/index.less +13 -13
  82. package/lib/vtx-export/index.js +28 -61
  83. package/lib/vtx-export/index.js.map +1 -1
  84. package/lib/vtx-export/style/css.js +0 -5
  85. package/lib/vtx-export/style/css.js.map +1 -1
  86. package/lib/vtx-export/style/index.js +0 -5
  87. package/lib/vtx-export/style/index.js.map +1 -1
  88. package/lib/vtx-export-async/History.js +56 -93
  89. package/lib/vtx-export-async/History.js.map +1 -1
  90. package/lib/vtx-export-async/index.js +56 -97
  91. package/lib/vtx-export-async/index.js.map +1 -1
  92. package/lib/vtx-export-async/style/css.js.map +1 -1
  93. package/lib/vtx-export-async/style/index.js.map +1 -1
  94. package/lib/vtx-export-async/util.js +2 -13
  95. package/lib/vtx-export-async/util.js.map +1 -1
  96. package/lib/vtx-form-layout/Card.js +11 -33
  97. package/lib/vtx-form-layout/Card.js.map +1 -1
  98. package/lib/vtx-form-layout/Divider.js +5 -11
  99. package/lib/vtx-form-layout/Divider.js.map +1 -1
  100. package/lib/vtx-form-layout/FormItem.js +11 -33
  101. package/lib/vtx-form-layout/FormItem.js.map +1 -1
  102. package/lib/vtx-form-layout/Pane.js +3 -9
  103. package/lib/vtx-form-layout/Pane.js.map +1 -1
  104. package/lib/vtx-form-layout/Row.js +1 -8
  105. package/lib/vtx-form-layout/Row.js.map +1 -1
  106. package/lib/vtx-form-layout/context.js +1 -4
  107. package/lib/vtx-form-layout/context.js.map +1 -1
  108. package/lib/vtx-form-layout/demo/Modal.less +43 -43
  109. package/lib/vtx-form-layout/index.js +9 -24
  110. package/lib/vtx-form-layout/index.js.map +1 -1
  111. package/lib/vtx-form-layout/style/css.js +0 -7
  112. package/lib/vtx-form-layout/style/css.js.map +1 -1
  113. package/lib/vtx-form-layout/style/index.js +0 -7
  114. package/lib/vtx-form-layout/style/index.js.map +1 -1
  115. package/lib/vtx-form-layout/style/index.less +216 -216
  116. package/lib/vtx-image/Image.js +73 -113
  117. package/lib/vtx-image/Image.js.map +1 -1
  118. package/lib/vtx-image/Preview.js +30 -59
  119. package/lib/vtx-image/Preview.js.map +1 -1
  120. package/lib/vtx-image/PreviewGroup.js +17 -47
  121. package/lib/vtx-image/PreviewGroup.js.map +1 -1
  122. package/lib/vtx-image/index.js +4 -11
  123. package/lib/vtx-image/index.js.map +1 -1
  124. package/lib/vtx-image/style/css.js +0 -1
  125. package/lib/vtx-image/style/css.js.map +1 -1
  126. package/lib/vtx-image/style/index.js +0 -1
  127. package/lib/vtx-image/style/index.js.map +1 -1
  128. package/lib/vtx-import/index.js +45 -78
  129. package/lib/vtx-import/index.js.map +1 -1
  130. package/lib/vtx-import/result.js +10 -28
  131. package/lib/vtx-import/result.js.map +1 -1
  132. package/lib/vtx-import/style/css.js +0 -3
  133. package/lib/vtx-import/style/css.js.map +1 -1
  134. package/lib/vtx-import/style/index.js +0 -3
  135. package/lib/vtx-import/style/index.js.map +1 -1
  136. package/lib/vtx-import/style/index.less +8 -8
  137. package/lib/vtx-import2/CheckResult.js +1 -8
  138. package/lib/vtx-import2/CheckResult.js.map +1 -1
  139. package/lib/vtx-import2/Content.js +11 -33
  140. package/lib/vtx-import2/Content.js.map +1 -1
  141. package/lib/vtx-import2/DownloadSvg.js +1 -6
  142. package/lib/vtx-import2/DownloadSvg.js.map +1 -1
  143. package/lib/vtx-import2/ImportResult.js +7 -14
  144. package/lib/vtx-import2/ImportResult.js.map +1 -1
  145. package/lib/vtx-import2/UploadSvg.js +1 -6
  146. package/lib/vtx-import2/UploadSvg.js.map +1 -1
  147. package/lib/vtx-import2/index.js +51 -108
  148. package/lib/vtx-import2/index.js.map +1 -1
  149. package/lib/vtx-import2/style/css.js +0 -3
  150. package/lib/vtx-import2/style/css.js.map +1 -1
  151. package/lib/vtx-import2/style/index.js +0 -3
  152. package/lib/vtx-import2/style/index.js.map +1 -1
  153. package/lib/vtx-import2/style/index.less +102 -102
  154. package/lib/vtx-input/TextArea.js +10 -27
  155. package/lib/vtx-input/TextArea.js.map +1 -1
  156. package/lib/vtx-input/index.js +20 -45
  157. package/lib/vtx-input/index.js.map +1 -1
  158. package/lib/vtx-input/style/css.js +0 -1
  159. package/lib/vtx-input/style/css.js.map +1 -1
  160. package/lib/vtx-input/style/index.js +0 -1
  161. package/lib/vtx-input/style/index.js.map +1 -1
  162. package/lib/vtx-input/style/index.less +24 -24
  163. package/lib/vtx-input/useLength.js +7 -20
  164. package/lib/vtx-input/useLength.js.map +1 -1
  165. package/lib/vtx-modal/Title.js +2 -8
  166. package/lib/vtx-modal/Title.js.map +1 -1
  167. package/lib/vtx-modal/index.js +49 -82
  168. package/lib/vtx-modal/index.js.map +1 -1
  169. package/lib/vtx-modal/style/css.js +0 -1
  170. package/lib/vtx-modal/style/css.js.map +1 -1
  171. package/lib/vtx-modal/style/index.js +0 -1
  172. package/lib/vtx-modal/style/index.js.map +1 -1
  173. package/lib/vtx-page-layout/Basic.js +3 -8
  174. package/lib/vtx-page-layout/Basic.js.map +1 -1
  175. package/lib/vtx-page-layout/Content.js +15 -26
  176. package/lib/vtx-page-layout/Content.js.map +1 -1
  177. package/lib/vtx-page-layout/Pane.js +3 -12
  178. package/lib/vtx-page-layout/Pane.js.map +1 -1
  179. package/lib/vtx-page-layout/TableLayout.js +30 -60
  180. package/lib/vtx-page-layout/TableLayout.js.map +1 -1
  181. package/lib/vtx-page-layout/TableWrap.js +11 -22
  182. package/lib/vtx-page-layout/TableWrap.js.map +1 -1
  183. package/lib/vtx-page-layout/container.js +23 -51
  184. package/lib/vtx-page-layout/container.js.map +1 -1
  185. package/lib/vtx-page-layout/index.js +1 -10
  186. package/lib/vtx-page-layout/index.js.map +1 -1
  187. package/lib/vtx-page-layout/style/css.js.map +1 -1
  188. package/lib/vtx-page-layout/style/index.js.map +1 -1
  189. package/lib/vtx-page-layout/style/index.less +138 -138
  190. package/lib/vtx-rps-frame/index.js +37 -57
  191. package/lib/vtx-rps-frame/index.js.map +1 -1
  192. package/lib/vtx-rps-frame/style/css.js.map +1 -1
  193. package/lib/vtx-rps-frame/style/index.js.map +1 -1
  194. package/lib/vtx-scrollable-row/index.js +30 -64
  195. package/lib/vtx-scrollable-row/index.js.map +1 -1
  196. package/lib/vtx-scrollable-row/style/css.js.map +1 -1
  197. package/lib/vtx-scrollable-row/style/index.js.map +1 -1
  198. package/lib/vtx-scrollable-row/style/index.less +113 -113
  199. package/lib/vtx-search/VtxCol.js +7 -26
  200. package/lib/vtx-search/VtxCol.js.map +1 -1
  201. package/lib/vtx-search/VtxRow.js +7 -14
  202. package/lib/vtx-search/VtxRow.js.map +1 -1
  203. package/lib/vtx-search/index.js +61 -106
  204. package/lib/vtx-search/index.js.map +1 -1
  205. package/lib/vtx-search/style/css.js +0 -4
  206. package/lib/vtx-search/style/css.js.map +1 -1
  207. package/lib/vtx-search/style/index.js +0 -4
  208. package/lib/vtx-search/style/index.js.map +1 -1
  209. package/lib/vtx-search-map-input/index.js +56 -89
  210. package/lib/vtx-search-map-input/index.js.map +1 -1
  211. package/lib/vtx-search-map-input/style/css.js +0 -2
  212. package/lib/vtx-search-map-input/style/css.js.map +1 -1
  213. package/lib/vtx-search-map-input/style/index.js +0 -2
  214. package/lib/vtx-search-map-input/style/index.js.map +1 -1
  215. package/lib/vtx-select/index.js +37 -87
  216. package/lib/vtx-select/index.js.map +1 -1
  217. package/lib/vtx-select/style/css.js +0 -8
  218. package/lib/vtx-select/style/css.js.map +1 -1
  219. package/lib/vtx-select/style/index.js +0 -8
  220. package/lib/vtx-select/style/index.js.map +1 -1
  221. package/lib/vtx-select/style/index.less +68 -68
  222. package/lib/vtx-signature/index.js +18 -33
  223. package/lib/vtx-signature/index.js.map +1 -1
  224. package/lib/vtx-signature/style/css.js +0 -2
  225. package/lib/vtx-signature/style/css.js.map +1 -1
  226. package/lib/vtx-signature/style/index.js +0 -2
  227. package/lib/vtx-signature/style/index.js.map +1 -1
  228. package/lib/vtx-signature/style/index.less +33 -33
  229. package/lib/vtx-split-pane/Pane.js +11 -22
  230. package/lib/vtx-split-pane/Pane.js.map +1 -1
  231. package/lib/vtx-split-pane/Resizer.js +19 -39
  232. package/lib/vtx-split-pane/Resizer.js.map +1 -1
  233. package/lib/vtx-split-pane/SplitPane.js +51 -107
  234. package/lib/vtx-split-pane/SplitPane.js.map +1 -1
  235. package/lib/vtx-split-pane/index.js +1 -6
  236. package/lib/vtx-split-pane/index.js.map +1 -1
  237. package/lib/vtx-split-pane/style/css.js +0 -3
  238. package/lib/vtx-split-pane/style/css.js.map +1 -1
  239. package/lib/vtx-split-pane/style/index.js +0 -3
  240. package/lib/vtx-split-pane/style/index.js.map +1 -1
  241. package/lib/vtx-split-pane/style/index.less +76 -76
  242. package/lib/vtx-statistics-column/Back.js +2 -9
  243. package/lib/vtx-statistics-column/Back.js.map +1 -1
  244. package/lib/vtx-statistics-column/Item.js +14 -30
  245. package/lib/vtx-statistics-column/Item.js.map +1 -1
  246. package/lib/vtx-statistics-column/Total.js +14 -30
  247. package/lib/vtx-statistics-column/Total.js.map +1 -1
  248. package/lib/vtx-statistics-column/context.js +1 -4
  249. package/lib/vtx-statistics-column/context.js.map +1 -1
  250. package/lib/vtx-statistics-column/index.js +1 -18
  251. package/lib/vtx-statistics-column/index.js.map +1 -1
  252. package/lib/vtx-statistics-column/style/css.js.map +1 -1
  253. package/lib/vtx-statistics-column/style/index.js.map +1 -1
  254. package/lib/vtx-statistics-column/style/index.less +59 -59
  255. package/lib/vtx-time-picker/index.js +4 -18
  256. package/lib/vtx-time-picker/index.js.map +1 -1
  257. package/lib/vtx-time-picker/style/css.js.map +1 -1
  258. package/lib/vtx-time-picker/style/index.js.map +1 -1
  259. package/lib/vtx-upload/FilePreview.js +15 -33
  260. package/lib/vtx-upload/FilePreview.js.map +1 -1
  261. package/lib/vtx-upload/index.js +77 -149
  262. package/lib/vtx-upload/index.js.map +1 -1
  263. package/lib/vtx-upload/style/css.js +0 -5
  264. package/lib/vtx-upload/style/css.js.map +1 -1
  265. package/lib/vtx-upload/style/index.js +0 -5
  266. package/lib/vtx-upload/style/index.js.map +1 -1
  267. package/lib/vtx-upload/style/index.less +61 -61
  268. package/lib/vtx-wang-editor/index.js +74 -116
  269. package/lib/vtx-wang-editor/index.js.map +1 -1
  270. package/lib/vtx-wang-editor/style/css.js +0 -1
  271. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  272. package/lib/vtx-wang-editor/style/index.js +0 -1
  273. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  274. package/lib/vtx-wang-editor/style/index.less +12 -12
  275. package/lib/vtx-wang-editor/wangEditorUtil.js +75 -136
  276. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  277. package/lib/vtx-ztree/index.js +69 -119
  278. package/lib/vtx-ztree/index.js.map +1 -1
  279. package/lib/vtx-ztree/style/css.js +0 -1
  280. package/lib/vtx-ztree/style/css.js.map +1 -1
  281. package/lib/vtx-ztree/style/index.js +0 -1
  282. package/lib/vtx-ztree/style/index.js.map +1 -1
  283. package/lib/vtx-ztree/style/index.less +45 -45
  284. package/lib/vtx-ztree-select/index.js +73 -142
  285. package/lib/vtx-ztree-select/index.js.map +1 -1
  286. package/lib/vtx-ztree-select/style/css.js +0 -3
  287. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  288. package/lib/vtx-ztree-select/style/index.js +0 -3
  289. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  290. package/lib/vtx-ztree-select/style/index.less +107 -107
  291. package/package.json +126 -126
@@ -1,86 +1,52 @@
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
-
3
+ 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); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _useSetState3 = _interopRequireDefault(require("ahooks/es/useSetState"));
13
-
14
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
11
  var _viewerjs = _interopRequireDefault(require("viewerjs"));
17
-
18
12
  var _upload = _interopRequireDefault(require("antd/lib/upload"));
19
-
20
13
  var _button = _interopRequireDefault(require("antd/lib/button"));
21
-
22
14
  var _InboxOutlined = _interopRequireDefault(require("@ant-design/icons/InboxOutlined"));
23
-
24
15
  var _PlusOutlined = _interopRequireDefault(require("@ant-design/icons/PlusOutlined"));
25
-
26
16
  var _UploadOutlined = _interopRequireDefault(require("@ant-design/icons/UploadOutlined"));
27
-
28
17
  var _message = _interopRequireDefault(require("antd/lib/message"));
29
-
30
18
  var _downloadFile = _interopRequireDefault(require("@vtx/utils/lib/downloadFile"));
31
-
32
19
  var _lodash = _interopRequireDefault(require("lodash.debounce"));
33
-
34
20
  var _FilePreview = _interopRequireDefault(require("./FilePreview"));
35
-
36
21
  var _getUrlParam = _interopRequireDefault(require("../_util/getUrlParam"));
37
-
38
22
  var _getToken = _interopRequireDefault(require("../_util/getToken"));
39
-
40
23
  var _excluded = ["isDragger", "draggerConfig", "accept", "mode", "viewMode", "showUploadList", "customizedButton", "listType", "onSuccess", "onError", "onRemove", "maxFileSize", "beforeUpload", "maxNum", "flag"];
41
-
42
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
43
-
44
- 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); }
45
-
46
- 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; }
47
-
25
+ 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); }
26
+ 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 && Object.prototype.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; }
48
27
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
49
-
50
28
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
51
-
52
29
  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."); }
53
-
54
30
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
55
-
56
31
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(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
-
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(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
65
-
66
38
  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."); }
67
-
68
39
  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); }
69
-
70
- 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; }
71
-
72
- 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; }
73
-
40
+ 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; }
41
+ 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; } }
74
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
75
-
76
43
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
77
-
78
44
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
79
-
80
45
  var debouncedMessage = (0, _lodash["default"])(function (msg) {
81
46
  _message["default"].error(msg);
82
- }, 500); //文件预览
47
+ }, 500);
83
48
 
49
+ //文件预览
84
50
  var initVPrev = {
85
51
  type: '',
86
52
  //video or file
@@ -92,99 +58,86 @@ var initVPrev = {
92
58
  var initUrl = {
93
59
  action: '/cloudFile/common/uploadFile',
94
60
  downloadUrl: '/cloudFile/common/downloadFile?id=',
95
- thumbnailUrl: '/vortex/rest/cloud/np/file/downloadFileThumbnail?outputQuality=0.5&scale=0.2&id=' //previewUrl: '/onlinePreview',
96
-
97
- }; //禁止上传的文件类型
98
-
61
+ thumbnailUrl: '/vortex/rest/cloud/np/file/downloadFileThumbnail?outputQuality=0.5&scale=0.2&id='
62
+ //previewUrl: '/onlinePreview',
63
+ };
64
+ //禁止上传的文件类型
99
65
  var rejectTypes = ['.asp', '.aspx', '.jsp', '.exe', '.cgi', '.asa', '.cer', '.cdx', '.hta'];
100
66
  var Dragger = _upload["default"].Dragger;
101
67
  var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
102
68
  var _window;
103
-
104
69
  var _props$isDragger = props.isDragger,
105
- isDragger = _props$isDragger === void 0 ? false : _props$isDragger,
106
- _props$draggerConfig = props.draggerConfig,
107
- draggerConfig = _props$draggerConfig === void 0 ? {} : _props$draggerConfig,
108
- accept = props.accept,
109
- _props$mode = props.mode,
110
- mode = _props$mode === void 0 ? 'multiple' : _props$mode,
111
- viewMode = props.viewMode,
112
- showUploadList = props.showUploadList,
113
- customizedButton = props.customizedButton,
114
- _props$listType = props.listType,
115
- listType = _props$listType === void 0 ? 'text' : _props$listType,
116
- onSuccess = props.onSuccess,
117
- onError = props.onError,
118
- _onRemove = props.onRemove,
119
- _props$maxFileSize = props.maxFileSize,
120
- maxFileSize = _props$maxFileSize === void 0 ? 5 * 1024 * 1024 : _props$maxFileSize,
121
- _beforeUpload = props.beforeUpload,
122
- maxNum = props.maxNum,
123
- flag = props.flag,
124
- rest = _objectWithoutProperties(props, _excluded); // 是否使用缩略图
125
-
126
-
70
+ isDragger = _props$isDragger === void 0 ? false : _props$isDragger,
71
+ _props$draggerConfig = props.draggerConfig,
72
+ draggerConfig = _props$draggerConfig === void 0 ? {} : _props$draggerConfig,
73
+ accept = props.accept,
74
+ _props$mode = props.mode,
75
+ mode = _props$mode === void 0 ? 'multiple' : _props$mode,
76
+ viewMode = props.viewMode,
77
+ showUploadList = props.showUploadList,
78
+ customizedButton = props.customizedButton,
79
+ _props$listType = props.listType,
80
+ listType = _props$listType === void 0 ? 'text' : _props$listType,
81
+ onSuccess = props.onSuccess,
82
+ onError = props.onError,
83
+ _onRemove = props.onRemove,
84
+ _props$maxFileSize = props.maxFileSize,
85
+ maxFileSize = _props$maxFileSize === void 0 ? 5 * 1024 * 1024 : _props$maxFileSize,
86
+ _beforeUpload = props.beforeUpload,
87
+ maxNum = props.maxNum,
88
+ flag = props.flag,
89
+ rest = _objectWithoutProperties(props, _excluded);
90
+ // 是否使用缩略图
127
91
  var useThumbnail = (props.useThumbnail === undefined ? true : props.useThumbnail) && (listType == 'picture' || listType == 'picture-card');
128
-
129
92
  var _useState = (0, _react.useState)([]),
130
- _useState2 = _slicedToArray(_useState, 2),
131
- fileList = _useState2[0],
132
- setFileList = _useState2[1]; //初始化文件列表
133
-
134
-
93
+ _useState2 = _slicedToArray(_useState, 2),
94
+ fileList = _useState2[0],
95
+ setFileList = _useState2[1]; //初始化文件列表
135
96
  var _useState3 = (0, _react.useState)(null),
136
- _useState4 = _slicedToArray(_useState3, 2),
137
- imageViewer = _useState4[0],
138
- setImageViewer = _useState4[1]; //图片预览
139
-
140
-
97
+ _useState4 = _slicedToArray(_useState3, 2),
98
+ imageViewer = _useState4[0],
99
+ setImageViewer = _useState4[1]; //图片预览
141
100
  var _useState5 = (0, _react.useState)([]),
142
- _useState6 = _slicedToArray(_useState5, 2),
143
- imageList = _useState6[0],
144
- setImageList = _useState6[1];
145
-
101
+ _useState6 = _slicedToArray(_useState5, 2),
102
+ imageList = _useState6[0],
103
+ setImageList = _useState6[1];
146
104
  var _useState7 = (0, _react.useState)(null),
147
- _useState8 = _slicedToArray(_useState7, 2),
148
- imageCt = _useState8[0],
149
- setImageCt = _useState8[1];
150
-
105
+ _useState8 = _slicedToArray(_useState7, 2),
106
+ imageCt = _useState8[0],
107
+ setImageCt = _useState8[1];
151
108
  var _useSetState = (0, _useSetState3["default"])(initVPrev),
152
- _useSetState2 = _slicedToArray(_useSetState, 2),
153
- vPrev = _useSetState2[0],
154
- setVPrev = _useSetState2[1]; //文件预览相关
155
- // 参数中拼接token
156
-
109
+ _useSetState2 = _slicedToArray(_useSetState, 2),
110
+ vPrev = _useSetState2[0],
111
+ setVPrev = _useSetState2[1]; //文件预览相关
157
112
 
113
+ // 参数中拼接token
158
114
  function joinToken(str) {
159
115
  if (str.indexOf('token=') === -1 && str.indexOf('?') > -1) {
160
116
  return str.replace('?', "?token=".concat((0, _getToken["default"])() || '', "&"));
161
117
  } else if (str.indexOf('?') === -1) {
162
118
  return str + "?token=".concat((0, _getToken["default"])() || '');
163
119
  }
164
-
165
120
  return str;
166
121
  }
167
-
168
122
  var url = {
169
123
  action: props.action || initUrl.action,
170
124
  downloadUrl: joinToken(props.downloadUrl || initUrl.downloadUrl),
171
- thumbnailUrl: joinToken((_window = window) !== null && _window !== void 0 && _window.flsPrefix ? "".concat(window.flsPrefix).concat(initUrl.thumbnailUrl) : "".concat(props.thumbnailUrl || initUrl.thumbnailUrl)) //previewUrl: props.previewUrl || initUrl.previewUrl,
172
-
125
+ thumbnailUrl: joinToken((_window = window) !== null && _window !== void 0 && _window.flsPrefix ? "".concat(window.flsPrefix).concat(initUrl.thumbnailUrl) : "".concat(props.thumbnailUrl || initUrl.thumbnailUrl))
126
+ //previewUrl: props.previewUrl || initUrl.previewUrl,
173
127
  };
174
128
  var action = url.action,
175
- downloadUrl = url.downloadUrl,
176
- thumbnailUrl = url.thumbnailUrl;
129
+ downloadUrl = url.downloadUrl,
130
+ thumbnailUrl = url.thumbnailUrl;
177
131
  (0, _react.useEffect)(function () {
178
132
  setFileList(getSynFileList(props) || []);
179
133
  }, [flag]);
180
134
  (0, _react.useEffect)(function () {
181
135
  if (Array.isArray(fileList)) {
182
136
  // 只有图片的才可以预览,这边需要判断是否是图片
183
- var imagelist = []; // 只能通过后缀来判断
184
-
137
+ var imagelist = [];
138
+ // 只能通过后缀来判断
185
139
  fileList.map(function (file) {
186
140
  var _file$type;
187
-
188
141
  if (((_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf('image')) > -1) {
189
142
  imagelist.push(file);
190
143
  }
@@ -197,10 +150,8 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
197
150
  setImageViewer(new _viewerjs["default"](imageCt, {}));
198
151
  }
199
152
  }, [imageCt]);
200
-
201
153
  var getConfig = function getConfig() {
202
154
  var token = (0, _getToken["default"])() || '';
203
-
204
155
  var config = _objectSpread(_objectSpread({}, rest), {}, {
205
156
  accept: accept,
206
157
  action: action,
@@ -212,18 +163,14 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
212
163
  }, rest.headers),
213
164
  onChange: function onChange(info) {
214
165
  setFileList(info.fileList);
215
-
216
166
  if (info.file.response && info.file.response.result === 1) {
217
167
  _message["default"].error(info.file.response.errMsg || '上传失败!');
218
-
219
168
  var flt = _toConsumableArray(fileList);
220
-
221
169
  flt.pop();
222
170
  setFileList(flt);
223
171
  return;
224
- } // 此处根据后台返回的数据结构取得文件ID
225
-
226
-
172
+ }
173
+ // 此处根据后台返回的数据结构取得文件ID
227
174
  if (info.file.status !== 'uploading' && info.file.status !== 'removed') {
228
175
  var vtxId = info.file.response && Array.isArray(info.file.response.data) && info.file.response.data.length > 0 ? info.file.response.data[0].id : undefined;
229
176
  var newFileList = info.fileList;
@@ -244,23 +191,21 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
244
191
  thumbUrl: useThumbnail ? thumbnailUrl + vtxId : undefined
245
192
  });
246
193
  }
247
-
248
194
  return item;
249
195
  });
250
-
251
196
  if (mode == 'single') {
252
197
  setFileList([newFile]);
253
198
  } else {
254
199
  setFileList(newFileList);
255
- } // 更新组件状态
200
+ }
201
+ // 更新组件状态
256
202
  // if (mode == 'single' && info.file.status === 'done') {
257
203
  // setFileList([newFile]);
258
204
  // } else {
259
205
  // setFileList(newFileList);
260
206
  // }
261
- // 触发外部方法
262
-
263
207
 
208
+ // 触发外部方法
264
209
  if (info.file.status === 'done') {
265
210
  if (typeof onSuccess == 'function') {
266
211
  onSuccess(newFile);
@@ -281,48 +226,37 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
281
226
  //限制文件大小
282
227
  if (maxFileSize && typeof maxFileSize === 'number') {
283
228
  var limit = file.size < maxFileSize;
284
-
285
229
  if (!limit) {
286
230
  _message["default"].error("\u8BF7\u4E0A\u4F20".concat(maxFileSize / 1024 / 1024, "M\u4EE5\u5185\u7684\u6587\u4EF6"));
287
-
288
231
  return false;
289
232
  }
290
- } //限制不允许上传的文件类型(通过文件名后缀)
291
-
292
-
233
+ }
234
+ //限制不允许上传的文件类型(通过文件名后缀)
293
235
  var pointIndex = file.name ? file.name.lastIndexOf('.') : -1;
294
-
295
236
  if (pointIndex > -1) {
296
237
  var fileType = file.name.substring(pointIndex);
297
-
298
238
  if (rejectTypes.includes(fileType)) {
299
239
  _message["default"].error('不支持该文件类型');
300
-
301
240
  return false;
302
241
  }
303
- } // 多选限制文件数量
304
-
305
-
242
+ }
243
+ // 多选限制文件数量
306
244
  if (typeof maxNum === 'number' && afterFileList.length + fileList.length > maxNum) {
307
245
  // 减少提示错误次数, 思路,防抖 这边有个问题 就是防抖的这个方法 return fasle 不上传
308
246
  debouncedMessage("\u6700\u591A\u4E0A\u4F20".concat(maxNum, "\u4E2A"));
309
247
  return false;
310
248
  }
311
-
312
249
  if (typeof _beforeUpload === 'function') {
313
250
  return _beforeUpload(file, afterFileList);
314
251
  }
315
-
316
252
  return true;
317
253
  }
318
254
  });
319
-
320
255
  if (props.onPreview && typeof props.onPreview === 'function') {
321
256
  config.onPreview = props.onPreview;
322
257
  } else {
323
258
  config.onPreview = function (file) {
324
259
  var _file$type2, _file$type3;
325
-
326
260
  if (!file.type) {
327
261
  (0, _downloadFile["default"])(downloadUrl + file.id, {
328
262
  fileName: file.name
@@ -342,7 +276,9 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
342
276
  (0, _downloadFile["default"])(downloadUrl + file.id, {
343
277
  fileName: file.name
344
278
  }, 'blob');
345
- } // TODO 暂无好的文件预览服务,等后续完善,只提供下载
279
+ }
280
+
281
+ // TODO 暂无好的文件预览服务,等后续完善,只提供下载
346
282
  // else if (
347
283
  // file.type == 'application/PDF' ||
348
284
  // file.type == 'application/vnd.ms-excel' ||
@@ -360,6 +296,7 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
360
296
  // '?id=' + file.id + '&fullfilename=' + file.name.replace(/\s*/g, ''),
361
297
  // )}`;
362
298
  // }
299
+
363
300
  // setVPrev({
364
301
  // type: 'file',
365
302
  // name: file.name || '文件预览',
@@ -368,20 +305,17 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
368
305
  // visible: true,
369
306
  // });
370
307
  // }
371
-
372
308
  };
373
- } // viewMode
374
-
309
+ }
375
310
 
311
+ // viewMode
376
312
  if (viewMode) {
377
313
  config.showUploadList = {
378
314
  showRemoveIcon: false
379
315
  };
380
316
  }
381
-
382
317
  return config;
383
318
  };
384
-
385
319
  var handlePreview = function handlePreview(file) {
386
320
  var imageIndex = imageList.map(function (item) {
387
321
  return item.id;
@@ -390,21 +324,18 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
390
324
  imageViewer.update();
391
325
  imageViewer.view(imageIndex);
392
326
  };
393
-
394
327
  var getSynFileList = function getSynFileList(props) {
395
- var processedFileList = props.fileList || []; // 单文件模式只取第一个
396
-
328
+ var processedFileList = props.fileList || [];
329
+ // 单文件模式只取第一个
397
330
  if (props.mode == 'single' && processedFileList.length > 1) {
398
331
  processedFileList = [processedFileList[0]];
399
332
  }
400
-
401
333
  processedFileList = processedFileList.map(function (item, index) {
402
334
  // 将外部传入的简易文件数组处理成为组件需要的数组结构
403
335
  if (item.name === undefined || item.id === undefined) {
404
336
  // eslint-disable-next-line no-console
405
337
  console.error('文件列表的name和id属性不能为空');
406
338
  }
407
-
408
339
  return _objectSpread(_objectSpread({}, item), {}, {
409
340
  uid: -1 - index,
410
341
  status: 'done',
@@ -414,7 +345,6 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
414
345
  });
415
346
  return processedFileList;
416
347
  };
417
-
418
348
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isDragger ? /*#__PURE__*/_react["default"].createElement(Dragger, _extends({}, getConfig(), {
419
349
  ref: ref
420
350
  }), draggerConfig !== null && draggerConfig !== void 0 && draggerConfig.img ? /*#__PURE__*/_react["default"].createElement("img", {
@@ -451,7 +381,6 @@ var VtxUpload = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
451
381
  }
452
382
  }, imageList.filter(function (item) {
453
383
  var _item$type;
454
-
455
384
  return item.type && ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.indexOf('image')) > -1;
456
385
  }).map(function (item, index) {
457
386
  return /*#__PURE__*/_react["default"].createElement("li", {
@@ -490,6 +419,5 @@ VtxUpload.propTypes = {
490
419
  flag: _propTypes["default"].number,
491
420
  useThumbnail: _propTypes["default"].bool
492
421
  };
493
- var _default = VtxUpload;
494
- exports["default"] = _default;
422
+ var _default = exports["default"] = VtxUpload;
495
423
  //# sourceMappingURL=index.js.map