@vtx/components 3.1.104 → 3.1.106

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 (307) hide show
  1. package/lib/_util/filterSpecialCharacters.js +44 -55
  2. package/lib/_util/filterSpecialCharacters.js.map +1 -1
  3. package/lib/_util/getComponentProps.js +4 -1
  4. package/lib/_util/getComponentProps.js.map +1 -1
  5. package/lib/_util/getToken.js +15 -7
  6. package/lib/_util/getToken.js.map +1 -1
  7. package/lib/_util/getUrlParam.js +8 -1
  8. package/lib/_util/getUrlParam.js.map +1 -1
  9. package/lib/_util/isFunction.js +1 -0
  10. package/lib/_util/isFunction.js.map +1 -1
  11. package/lib/_util/isObject.js +1 -0
  12. package/lib/_util/isObject.js.map +1 -1
  13. package/lib/_util/useColSize.js +12 -2
  14. package/lib/_util/useColSize.js.map +1 -1
  15. package/lib/_util/useInterval.js +3 -0
  16. package/lib/_util/useInterval.js.map +1 -1
  17. package/lib/_util/useSet.js +39 -23
  18. package/lib/_util/useSet.js.map +1 -1
  19. package/lib/config.js +2 -1
  20. package/lib/config.js.map +1 -1
  21. package/lib/index.js +29 -0
  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 +29 -10
  30. package/lib/vtx-color-picker/index.js.map +1 -1
  31. package/lib/vtx-color-picker/style/css.js +2 -0
  32. package/lib/vtx-color-picker/style/css.js.map +1 -1
  33. package/lib/vtx-color-picker/style/index.js +2 -0
  34. package/lib/vtx-color-picker/style/index.js.map +1 -1
  35. package/lib/vtx-combogrid/Combogrid.js +86 -46
  36. package/lib/vtx-combogrid/Combogrid.js.map +1 -1
  37. package/lib/vtx-combogrid/index.js +58 -32
  38. package/lib/vtx-combogrid/index.js.map +1 -1
  39. package/lib/vtx-combogrid/style/css.js +7 -0
  40. package/lib/vtx-combogrid/style/css.js.map +1 -1
  41. package/lib/vtx-combogrid/style/index.js +7 -0
  42. package/lib/vtx-combogrid/style/index.js.map +1 -1
  43. package/lib/vtx-datagrid/Alert.js +14 -5
  44. package/lib/vtx-datagrid/Alert.js.map +1 -1
  45. package/lib/vtx-datagrid/ColumnSetting.js +76 -37
  46. package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
  47. package/lib/vtx-datagrid/ResizeableTitle.js +15 -3
  48. package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
  49. package/lib/vtx-datagrid/index.js +188 -117
  50. package/lib/vtx-datagrid/index.js.map +1 -1
  51. package/lib/vtx-datagrid/renderColumnButtons.js +38 -7
  52. package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
  53. package/lib/vtx-datagrid/style/css.js +10 -0
  54. package/lib/vtx-datagrid/style/css.js.map +1 -1
  55. package/lib/vtx-datagrid/style/index.js +10 -0
  56. package/lib/vtx-datagrid/style/index.js.map +1 -1
  57. package/lib/vtx-date-picker/QdatePicker.js +51 -21
  58. package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
  59. package/lib/vtx-date-picker/generatePicker.js +65 -24
  60. package/lib/vtx-date-picker/generatePicker.js.map +1 -1
  61. package/lib/vtx-date-picker/index.js +7 -1
  62. package/lib/vtx-date-picker/index.js.map +1 -1
  63. package/lib/vtx-date-picker/style/css.js +1 -0
  64. package/lib/vtx-date-picker/style/css.js.map +1 -1
  65. package/lib/vtx-date-picker/style/index.js +1 -0
  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 +28 -9
  69. package/lib/vtx-editor/index.js.map +1 -1
  70. package/lib/vtx-editor/style/css.js +1 -0
  71. package/lib/vtx-editor/style/css.js.map +1 -1
  72. package/lib/vtx-editor/style/index.js +1 -0
  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 +27 -14
  76. package/lib/vtx-ellipsis-text/index.js.map +1 -1
  77. package/lib/vtx-ellipsis-text/style/css.js +1 -0
  78. package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
  79. package/lib/vtx-ellipsis-text/style/index.js +1 -0
  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 +69 -36
  83. package/lib/vtx-export/index.js.map +1 -1
  84. package/lib/vtx-export/style/css.js +5 -0
  85. package/lib/vtx-export/style/css.js.map +1 -1
  86. package/lib/vtx-export/style/index.js +5 -0
  87. package/lib/vtx-export/style/index.js.map +1 -1
  88. package/lib/vtx-export-async/History.js +106 -61
  89. package/lib/vtx-export-async/History.js.map +1 -1
  90. package/lib/vtx-export-async/index.js +114 -67
  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 +13 -2
  95. package/lib/vtx-export-async/util.js.map +1 -1
  96. package/lib/vtx-form-layout/Card.js +33 -11
  97. package/lib/vtx-form-layout/Card.js.map +1 -1
  98. package/lib/vtx-form-layout/Divider.js +11 -5
  99. package/lib/vtx-form-layout/Divider.js.map +1 -1
  100. package/lib/vtx-form-layout/FormItem.js +34 -12
  101. package/lib/vtx-form-layout/FormItem.js.map +1 -1
  102. package/lib/vtx-form-layout/Pane.js +9 -3
  103. package/lib/vtx-form-layout/Pane.js.map +1 -1
  104. package/lib/vtx-form-layout/Row.js +8 -1
  105. package/lib/vtx-form-layout/Row.js.map +1 -1
  106. package/lib/vtx-form-layout/context.js +4 -1
  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 +24 -9
  110. package/lib/vtx-form-layout/index.js.map +1 -1
  111. package/lib/vtx-form-layout/style/css.js +7 -0
  112. package/lib/vtx-form-layout/style/css.js.map +1 -1
  113. package/lib/vtx-form-layout/style/index.js +7 -0
  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 +113 -73
  117. package/lib/vtx-image/Image.js.map +1 -1
  118. package/lib/vtx-image/Preview.js +59 -30
  119. package/lib/vtx-image/Preview.js.map +1 -1
  120. package/lib/vtx-image/PreviewGroup.js +47 -17
  121. package/lib/vtx-image/PreviewGroup.js.map +1 -1
  122. package/lib/vtx-image/index.js +11 -4
  123. package/lib/vtx-image/index.js.map +1 -1
  124. package/lib/vtx-image/style/css.js +1 -0
  125. package/lib/vtx-image/style/css.js.map +1 -1
  126. package/lib/vtx-image/style/index.js +1 -0
  127. package/lib/vtx-image/style/index.js.map +1 -1
  128. package/lib/vtx-import/index.js +78 -45
  129. package/lib/vtx-import/index.js.map +1 -1
  130. package/lib/vtx-import/result.js +28 -10
  131. package/lib/vtx-import/result.js.map +1 -1
  132. package/lib/vtx-import/style/css.js +3 -0
  133. package/lib/vtx-import/style/css.js.map +1 -1
  134. package/lib/vtx-import/style/index.js +3 -0
  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 +8 -1
  138. package/lib/vtx-import2/CheckResult.js.map +1 -1
  139. package/lib/vtx-import2/Content.js +33 -11
  140. package/lib/vtx-import2/Content.js.map +1 -1
  141. package/lib/vtx-import2/DownloadSvg.js +6 -1
  142. package/lib/vtx-import2/DownloadSvg.js.map +1 -1
  143. package/lib/vtx-import2/ImportResult.js +14 -7
  144. package/lib/vtx-import2/ImportResult.js.map +1 -1
  145. package/lib/vtx-import2/UploadSvg.js +6 -1
  146. package/lib/vtx-import2/UploadSvg.js.map +1 -1
  147. package/lib/vtx-import2/index.js +107 -51
  148. package/lib/vtx-import2/index.js.map +1 -1
  149. package/lib/vtx-import2/style/css.js +3 -0
  150. package/lib/vtx-import2/style/css.js.map +1 -1
  151. package/lib/vtx-import2/style/index.js +3 -0
  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 +27 -10
  155. package/lib/vtx-input/TextArea.js.map +1 -1
  156. package/lib/vtx-input/index.js +45 -20
  157. package/lib/vtx-input/index.js.map +1 -1
  158. package/lib/vtx-input/style/css.js +1 -0
  159. package/lib/vtx-input/style/css.js.map +1 -1
  160. package/lib/vtx-input/style/index.js +1 -0
  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 +20 -7
  164. package/lib/vtx-input/useLength.js.map +1 -1
  165. package/lib/vtx-modal/Title.js +8 -2
  166. package/lib/vtx-modal/Title.js.map +1 -1
  167. package/lib/vtx-modal/index.js +82 -49
  168. package/lib/vtx-modal/index.js.map +1 -1
  169. package/lib/vtx-modal/style/css.js +1 -0
  170. package/lib/vtx-modal/style/css.js.map +1 -1
  171. package/lib/vtx-modal/style/index.js +1 -0
  172. package/lib/vtx-modal/style/index.js.map +1 -1
  173. package/lib/vtx-page-layout/Basic.js +8 -3
  174. package/lib/vtx-page-layout/Basic.js.map +1 -1
  175. package/lib/vtx-page-layout/Content.js +26 -15
  176. package/lib/vtx-page-layout/Content.js.map +1 -1
  177. package/lib/vtx-page-layout/Pane.js +12 -3
  178. package/lib/vtx-page-layout/Pane.js.map +1 -1
  179. package/lib/vtx-page-layout/TableLayout.js +60 -30
  180. package/lib/vtx-page-layout/TableLayout.js.map +1 -1
  181. package/lib/vtx-page-layout/TableWrap.js +22 -11
  182. package/lib/vtx-page-layout/TableWrap.js.map +1 -1
  183. package/lib/vtx-page-layout/container.js +51 -23
  184. package/lib/vtx-page-layout/container.js.map +1 -1
  185. package/lib/vtx-page-layout/index.js +10 -1
  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 +57 -37
  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 +64 -30
  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 +26 -7
  200. package/lib/vtx-search/VtxCol.js.map +1 -1
  201. package/lib/vtx-search/VtxRow.js +14 -7
  202. package/lib/vtx-search/VtxRow.js.map +1 -1
  203. package/lib/vtx-search/index.js +106 -61
  204. package/lib/vtx-search/index.js.map +1 -1
  205. package/lib/vtx-search/style/css.js +4 -0
  206. package/lib/vtx-search/style/css.js.map +1 -1
  207. package/lib/vtx-search/style/index.js +4 -0
  208. package/lib/vtx-search/style/index.js.map +1 -1
  209. package/lib/vtx-search-map-input/index.js +95 -60
  210. package/lib/vtx-search-map-input/index.js.map +1 -1
  211. package/lib/vtx-search-map-input/style/css.js +2 -0
  212. package/lib/vtx-search-map-input/style/css.js.map +1 -1
  213. package/lib/vtx-search-map-input/style/index.js +2 -0
  214. package/lib/vtx-search-map-input/style/index.js.map +1 -1
  215. package/lib/vtx-select/index.js +91 -39
  216. package/lib/vtx-select/index.js.map +1 -1
  217. package/lib/vtx-select/style/css.js +8 -0
  218. package/lib/vtx-select/style/css.js.map +1 -1
  219. package/lib/vtx-select/style/index.js +8 -0
  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 +33 -18
  223. package/lib/vtx-signature/index.js.map +1 -1
  224. package/lib/vtx-signature/style/css.js +2 -0
  225. package/lib/vtx-signature/style/css.js.map +1 -1
  226. package/lib/vtx-signature/style/index.js +2 -0
  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 +22 -11
  230. package/lib/vtx-split-pane/Pane.js.map +1 -1
  231. package/lib/vtx-split-pane/Resizer.js +39 -19
  232. package/lib/vtx-split-pane/Resizer.js.map +1 -1
  233. package/lib/vtx-split-pane/SplitPane.js +107 -51
  234. package/lib/vtx-split-pane/SplitPane.js.map +1 -1
  235. package/lib/vtx-split-pane/index.js +6 -1
  236. package/lib/vtx-split-pane/index.js.map +1 -1
  237. package/lib/vtx-split-pane/style/css.js +3 -0
  238. package/lib/vtx-split-pane/style/css.js.map +1 -1
  239. package/lib/vtx-split-pane/style/index.js +3 -0
  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 +9 -2
  243. package/lib/vtx-statistics-column/Back.js.map +1 -1
  244. package/lib/vtx-statistics-column/Item.js +31 -15
  245. package/lib/vtx-statistics-column/Item.js.map +1 -1
  246. package/lib/vtx-statistics-column/Total.js +30 -14
  247. package/lib/vtx-statistics-column/Total.js.map +1 -1
  248. package/lib/vtx-statistics-column/context.js +4 -1
  249. package/lib/vtx-statistics-column/context.js.map +1 -1
  250. package/lib/vtx-statistics-column/index.js +18 -1
  251. package/lib/vtx-statistics-column/index.js.map +1 -1
  252. package/lib/vtx-statistics-column/style/css.js +1 -0
  253. package/lib/vtx-statistics-column/style/css.js.map +1 -1
  254. package/lib/vtx-statistics-column/style/index.js +1 -0
  255. package/lib/vtx-statistics-column/style/index.js.map +1 -1
  256. package/lib/vtx-statistics-column/style/index.less +59 -59
  257. package/lib/vtx-time-picker/index.js +18 -4
  258. package/lib/vtx-time-picker/index.js.map +1 -1
  259. package/lib/vtx-time-picker/style/css.js.map +1 -1
  260. package/lib/vtx-time-picker/style/index.js.map +1 -1
  261. package/lib/vtx-tree/index.js +114 -49
  262. package/lib/vtx-tree/index.js.map +1 -1
  263. package/lib/vtx-tree/style/css.js +2 -0
  264. package/lib/vtx-tree/style/css.js.map +1 -1
  265. package/lib/vtx-tree/style/index.js +2 -0
  266. package/lib/vtx-tree/style/index.js.map +1 -1
  267. package/lib/vtx-tree/utils.js +27 -6
  268. package/lib/vtx-tree/utils.js.map +1 -1
  269. package/lib/vtx-tree-select/index.js +71 -27
  270. package/lib/vtx-tree-select/index.js.map +1 -1
  271. package/lib/vtx-tree-select/style/css.js +4 -0
  272. package/lib/vtx-tree-select/style/css.js.map +1 -1
  273. package/lib/vtx-tree-select/style/index.js +4 -0
  274. package/lib/vtx-tree-select/style/index.js.map +1 -1
  275. package/lib/vtx-upload/FilePreview.js +33 -15
  276. package/lib/vtx-upload/FilePreview.js.map +1 -1
  277. package/lib/vtx-upload/index.js +156 -79
  278. package/lib/vtx-upload/index.js.map +1 -1
  279. package/lib/vtx-upload/style/css.js +6 -0
  280. package/lib/vtx-upload/style/css.js.map +1 -1
  281. package/lib/vtx-upload/style/index.js +6 -0
  282. package/lib/vtx-upload/style/index.js.map +1 -1
  283. package/lib/vtx-upload/style/index.less +61 -61
  284. package/lib/vtx-wang-editor/index.js +116 -74
  285. package/lib/vtx-wang-editor/index.js.map +1 -1
  286. package/lib/vtx-wang-editor/style/css.js +1 -0
  287. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  288. package/lib/vtx-wang-editor/style/index.js +1 -0
  289. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  290. package/lib/vtx-wang-editor/style/index.less +12 -12
  291. package/lib/vtx-wang-editor/wangEditorUtil.js +136 -75
  292. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  293. package/lib/vtx-ztree/index.js +119 -69
  294. package/lib/vtx-ztree/index.js.map +1 -1
  295. package/lib/vtx-ztree/style/css.js +1 -0
  296. package/lib/vtx-ztree/style/css.js.map +1 -1
  297. package/lib/vtx-ztree/style/index.js +1 -0
  298. package/lib/vtx-ztree/style/index.js.map +1 -1
  299. package/lib/vtx-ztree/style/index.less +45 -45
  300. package/lib/vtx-ztree-select/index.js +143 -76
  301. package/lib/vtx-ztree-select/index.js.map +1 -1
  302. package/lib/vtx-ztree-select/style/css.js +3 -0
  303. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  304. package/lib/vtx-ztree-select/style/index.js +3 -0
  305. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  306. package/lib/vtx-ztree-select/style/index.less +109 -109
  307. package/package.json +121 -121
@@ -4,20 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _reactResizable = require("react-resizable");
11
+
9
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
10
14
  var _excluded = ["onResize", "width"];
15
+
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
12
18
  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; }
19
+
13
20
  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; }
21
+
14
22
  var ResizeableTitle = function ResizeableTitle(props) {
15
23
  var onResize = props.onResize,
16
- width = props.width,
17
- restProps = _objectWithoutProperties(props, _excluded);
24
+ width = props.width,
25
+ restProps = _objectWithoutProperties(props, _excluded);
26
+
18
27
  if (!width) {
19
28
  return /*#__PURE__*/_react["default"].createElement("th", restProps);
20
29
  }
30
+
21
31
  return /*#__PURE__*/_react["default"].createElement(_reactResizable.Resizable, {
22
32
  width: width,
23
33
  height: 0,
@@ -27,9 +37,11 @@ var ResizeableTitle = function ResizeableTitle(props) {
27
37
  }
28
38
  }, /*#__PURE__*/_react["default"].createElement("th", restProps));
29
39
  };
40
+
30
41
  ResizeableTitle.propTypes = {
31
42
  onResize: _propTypes["default"].func,
32
43
  width: _propTypes["default"].number
33
44
  };
34
- var _default = exports["default"] = ResizeableTitle;
45
+ var _default = ResizeableTitle;
46
+ exports["default"] = _default;
35
47
  //# sourceMappingURL=ResizeableTitle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResizeableTitle.js","names":["_react","_interopRequireDefault","require","_reactResizable","_propTypes","_excluded","obj","__esModule","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","key","i","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","prototype","propertyIsEnumerable","call","sourceKeys","keys","ResizeableTitle","props","onResize","width","restProps","createElement","Resizable","height","draggableOpts","enableUserSelectHack","propTypes","PropTypes","func","number","_default","exports"],"sources":["vtx-datagrid/ResizeableTitle.jsx"],"sourcesContent":["import React from 'react';\nimport { Resizable } from 'react-resizable';\nimport PropTypes from 'prop-types';\n\nconst ResizeableTitle = props => {\n const { onResize, width, ...restProps } = props;\n\n if (!width) {\n return <th {...restProps} />;\n }\n\n return (\n <Resizable\n width={width}\n height={0}\n onResize={onResize}\n draggableOpts={{ enableUserSelectHack: false }}\n >\n <th {...restProps} />\n </Resizable>\n );\n};\n\nResizeableTitle.propTypes = {\n onResize: PropTypes.func,\n width: PropTypes.number,\n};\n\nexport default ResizeableTitle;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmC,IAAAG,SAAA;AAAA,SAAAJ,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,GAAAC,6BAAA,CAAAH,MAAA,EAAAC,QAAA,OAAAG,GAAA,EAAAC,CAAA,MAAAC,MAAA,CAAAC,qBAAA,QAAAC,gBAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAP,MAAA,QAAAK,CAAA,MAAAA,CAAA,GAAAG,gBAAA,CAAAC,MAAA,EAAAJ,CAAA,MAAAD,GAAA,GAAAI,gBAAA,CAAAH,CAAA,OAAAJ,QAAA,CAAAS,OAAA,CAAAN,GAAA,uBAAAE,MAAA,CAAAK,SAAA,CAAAC,oBAAA,CAAAC,IAAA,CAAAb,MAAA,EAAAI,GAAA,aAAAF,MAAA,CAAAE,GAAA,IAAAJ,MAAA,CAAAI,GAAA,cAAAF,MAAA;AAAA,SAAAC,8BAAAH,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,WAAAY,UAAA,GAAAR,MAAA,CAAAS,IAAA,CAAAf,MAAA,OAAAI,GAAA,EAAAC,CAAA,OAAAA,CAAA,MAAAA,CAAA,GAAAS,UAAA,CAAAL,MAAA,EAAAJ,CAAA,MAAAD,GAAA,GAAAU,UAAA,CAAAT,CAAA,OAAAJ,QAAA,CAAAS,OAAA,CAAAN,GAAA,kBAAAF,MAAA,CAAAE,GAAA,IAAAJ,MAAA,CAAAI,GAAA,YAAAF,MAAA;AAEnC,IAAMc,eAAe,GAAG,SAAlBA,eAAeA,CAAGC,KAAK,EAAI;EAC7B,IAAQC,QAAQ,GAA0BD,KAAK,CAAvCC,QAAQ;IAAEC,KAAK,GAAmBF,KAAK,CAA7BE,KAAK;IAAKC,SAAS,GAAArB,wBAAA,CAAKkB,KAAK,EAAArB,SAAA;EAE/C,IAAI,CAACuB,KAAK,EAAE;IACR,oBAAO5B,MAAA,YAAA8B,aAAA,OAAQD,SAAY,CAAC;EAChC;EAEA,oBACI7B,MAAA,YAAA8B,aAAA,CAAC3B,eAAA,CAAA4B,SAAS;IACNH,KAAK,EAAEA,KAAM;IACbI,MAAM,EAAE,CAAE;IACVL,QAAQ,EAAEA,QAAS;IACnBM,aAAa,EAAE;MAAEC,oBAAoB,EAAE;IAAM;EAAE,gBAE/ClC,MAAA,YAAA8B,aAAA,OAAQD,SAAY,CACb,CAAC;AAEpB,CAAC;AAEDJ,eAAe,CAACU,SAAS,GAAG;EACxBR,QAAQ,EAAES,qBAAS,CAACC,IAAI;EACxBT,KAAK,EAAEQ,qBAAS,CAACE;AACrB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaf,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"ResizeableTitle.js","names":["ResizeableTitle","props","onResize","width","restProps","enableUserSelectHack","propTypes","PropTypes","func","number"],"sources":["vtx-datagrid/ResizeableTitle.jsx"],"sourcesContent":["import React from 'react';\nimport { Resizable } from 'react-resizable';\nimport PropTypes from 'prop-types';\n\nconst ResizeableTitle = props => {\n const { onResize, width, ...restProps } = props;\n\n if (!width) {\n return <th {...restProps} />;\n }\n\n return (\n <Resizable\n width={width}\n height={0}\n onResize={onResize}\n draggableOpts={{ enableUserSelectHack: false }}\n >\n <th {...restProps} />\n </Resizable>\n );\n};\n\nResizeableTitle.propTypes = {\n onResize: PropTypes.func,\n width: PropTypes.number,\n};\n\nexport default ResizeableTitle;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;EAC7B,IAAQC,QAAR,GAA0CD,KAA1C,CAAQC,QAAR;EAAA,IAAkBC,KAAlB,GAA0CF,KAA1C,CAAkBE,KAAlB;EAAA,IAA4BC,SAA5B,4BAA0CH,KAA1C;;EAEA,IAAI,CAACE,KAAL,EAAY;IACR,oBAAO,sCAAQC,SAAR,CAAP;EACH;;EAED,oBACI,gCAAC,yBAAD;IACI,KAAK,EAAED,KADX;IAEI,MAAM,EAAE,CAFZ;IAGI,QAAQ,EAAED,QAHd;IAII,aAAa,EAAE;MAAEG,oBAAoB,EAAE;IAAxB;EAJnB,gBAMI,sCAAQD,SAAR,CANJ,CADJ;AAUH,CAjBD;;AAmBAJ,eAAe,CAACM,SAAhB,GAA4B;EACxBJ,QAAQ,EAAEK,qBAAA,CAAUC,IADI;EAExBL,KAAK,EAAEI,qBAAA,CAAUE;AAFO,CAA5B;eAKeT,e"}
@@ -1,128 +1,172 @@
1
1
  "use strict";
2
2
 
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); }
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
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = VtxDatagrid;
9
+
8
10
  var _react = _interopRequireWildcard(require("react"));
11
+
9
12
  var _classnames2 = _interopRequireDefault(require("classnames"));
13
+
10
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
+
11
16
  var _table = _interopRequireDefault(require("antd/lib/table"));
17
+
12
18
  var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
19
+
13
20
  var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
21
+
14
22
  var _menu = _interopRequireDefault(require("antd/lib/menu"));
23
+
15
24
  var _empty = _interopRequireDefault(require("antd/lib/empty"));
25
+
16
26
  var _RedoOutlined = _interopRequireDefault(require("@ant-design/icons/RedoOutlined"));
27
+
17
28
  var _ColumnHeightOutlined = _interopRequireDefault(require("@ant-design/icons/ColumnHeightOutlined"));
29
+
18
30
  var _SettingOutlined = _interopRequireDefault(require("@ant-design/icons/SettingOutlined"));
31
+
19
32
  var _Alert = _interopRequireDefault(require("./Alert"));
33
+
20
34
  var _ColumnSetting = _interopRequireDefault(require("./ColumnSetting"));
35
+
21
36
  var _ResizeableTitle = _interopRequireDefault(require("./ResizeableTitle"));
37
+
22
38
  var _renderColumnButtons = _interopRequireDefault(require("./renderColumnButtons"));
39
+
23
40
  var _useSet3 = _interopRequireDefault(require("../_util/useSet"));
41
+
24
42
  var _isFunction = _interopRequireDefault(require("../_util/isFunction"));
43
+
25
44
  var _axios = _interopRequireDefault(require("axios"));
45
+
26
46
  var _ahooks = require("ahooks");
47
+
27
48
  var _excluded = ["prefixCls", "toolbar", "toolbarClassName", "toolbarTilte", "buttonGroup", "refreshIconVisible", "hideColumnSetting", "hideColumnHeight", "visibleColumnKeys", "defaultVisibleColumnKeys", "onVisibleColumnsChange", "onRefresh", "indexColumn", "indexFixed", "bordered", "indexTitle", "startIndex", "autoFit", "headFootHeight", "columnResizable", "components", "className", "style", "emptyText", "onRowSelectionClear", "disabledColumnKeys", "onColumnsSave", "uniqueKey", "prefixUrl", "customEnumText", "hideSelectionClear"];
49
+
28
50
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
- 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); }
30
- 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; }
51
+
52
+ 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); }
53
+
54
+ 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; }
55
+
31
56
  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); }
57
+
32
58
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
59
+
33
60
  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."); }
61
+
34
62
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
63
+
35
64
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
36
- 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; }
37
- 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; }
38
- 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; }
39
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
40
- 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); }
65
+
66
+ 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; }
67
+
68
+ 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; }
69
+
70
+ 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; }
71
+
41
72
  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; }
73
+
42
74
  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; }
75
+
43
76
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
77
+
44
78
  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."); }
79
+
45
80
  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); }
46
- 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; }
47
- 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; } }
81
+
82
+ 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; }
83
+
84
+ 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; }
85
+
48
86
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
87
+
49
88
  var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
89
+
50
90
  function VtxDatagrid(props) {
51
- var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _rest$rowSelection3, _dataSource3;
91
+ var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _classnames, _rest$rowSelection3, _dataSource3;
92
+
52
93
  var _useSet = (0, _useSet3["default"])({
53
- // 显示列
54
- visibleColumns: [],
55
- // 列设置选中的列
56
- checkedColumnKeys: [],
57
- // 列设置选项
58
- columnSettingOptions: [],
59
- datagridId: "vtx-datagrid-".concat(new Date().getTime()),
60
- scrollY: 0,
61
- size: 'middle',
62
- projectKey: ''
63
- }),
64
- _useSet2 = _slicedToArray(_useSet, 2),
65
- state = _useSet2[0],
66
- setState = _useSet2[1];
94
+ // 显示列
95
+ visibleColumns: [],
96
+ // 列设置选中的列
97
+ checkedColumnKeys: [],
98
+ // 列设置选项
99
+ columnSettingOptions: [],
100
+ datagridId: "vtx-datagrid-".concat(new Date().getTime()),
101
+ scrollY: 0,
102
+ size: 'middle',
103
+ projectKey: ''
104
+ }),
105
+ _useSet2 = _slicedToArray(_useSet, 2),
106
+ state = _useSet2[0],
107
+ setState = _useSet2[1];
108
+
67
109
  var visibleColumns = state.visibleColumns,
68
- checkedColumnKeys = state.checkedColumnKeys,
69
- columnSettingOptions = state.columnSettingOptions,
70
- datagridId = state.datagridId,
71
- scrollY = state.scrollY,
72
- size = state.size;
73
- var datagridRef = (0, _react.useRef)(null);
74
- // 列设置提示高度
75
- var alertHeight = (0, _react.useRef)(0);
76
- // 工具栏高度
77
- var toolbarHeight = (0, _react.useRef)(0);
78
- // 列接口显示字段
110
+ checkedColumnKeys = state.checkedColumnKeys,
111
+ columnSettingOptions = state.columnSettingOptions,
112
+ datagridId = state.datagridId,
113
+ scrollY = state.scrollY,
114
+ size = state.size;
115
+ var datagridRef = (0, _react.useRef)(null); // 列设置提示高度
116
+
117
+ var alertHeight = (0, _react.useRef)(0); // 工具栏高度
118
+
119
+ var toolbarHeight = (0, _react.useRef)(0); // 列接口显示字段
120
+
79
121
  var settingRef = (0, _react.useRef)();
122
+
80
123
  var _props$prefixCls = props.prefixCls,
81
- prefixCls = _props$prefixCls === void 0 ? 'vtx-datagrid' : _props$prefixCls,
82
- _props$toolbar = props.toolbar,
83
- toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
84
- toolbarClassName = props.toolbarClassName,
85
- _props$toolbarTilte = props.toolbarTilte,
86
- toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
87
- buttonGroup = props.buttonGroup,
88
- _props$refreshIconVis = props.refreshIconVisible,
89
- refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
90
- hideColumnSetting = props.hideColumnSetting,
91
- hideColumnHeight = props.hideColumnHeight,
92
- visibleColumnKeys = props.visibleColumnKeys,
93
- defaultVisibleColumnKeys = props.defaultVisibleColumnKeys,
94
- onVisibleColumnsChange = props.onVisibleColumnsChange,
95
- onRefresh = props.onRefresh,
96
- _props$indexColumn = props.indexColumn,
97
- indexColumn = _props$indexColumn === void 0 ? true : _props$indexColumn,
98
- _props$indexFixed = props.indexFixed,
99
- indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
100
- _props$bordered = props.bordered,
101
- bordered = _props$bordered === void 0 ? true : _props$bordered,
102
- _props$indexTitle = props.indexTitle,
103
- indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
104
- _props$startIndex = props.startIndex,
105
- startIndex = _props$startIndex === void 0 ? 1 : _props$startIndex,
106
- _props$autoFit = props.autoFit,
107
- autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
108
- _props$headFootHeight = props.headFootHeight,
109
- headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
110
- columnResizable = props.columnResizable,
111
- components = props.components,
112
- className = props.className,
113
- style = props.style,
114
- _props$emptyText = props.emptyText,
115
- emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
116
- onRowSelectionClear = props.onRowSelectionClear,
117
- disabledColumnKeys = props.disabledColumnKeys,
118
- onColumnsSave = props.onColumnsSave,
119
- uniqueKey = props.uniqueKey,
120
- prefixUrl = props.prefixUrl,
121
- _props$customEnumText = props.customEnumText,
122
- customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
123
- _props$hideSelectionC = props.hideSelectionClear,
124
- hideSelectionClear = _props$hideSelectionC === void 0 ? false : _props$hideSelectionC,
125
- rest = _objectWithoutProperties(props, _excluded);
124
+ prefixCls = _props$prefixCls === void 0 ? 'vtx-datagrid' : _props$prefixCls,
125
+ _props$toolbar = props.toolbar,
126
+ toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
127
+ toolbarClassName = props.toolbarClassName,
128
+ _props$toolbarTilte = props.toolbarTilte,
129
+ toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
130
+ buttonGroup = props.buttonGroup,
131
+ _props$refreshIconVis = props.refreshIconVisible,
132
+ refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
133
+ hideColumnSetting = props.hideColumnSetting,
134
+ hideColumnHeight = props.hideColumnHeight,
135
+ visibleColumnKeys = props.visibleColumnKeys,
136
+ defaultVisibleColumnKeys = props.defaultVisibleColumnKeys,
137
+ onVisibleColumnsChange = props.onVisibleColumnsChange,
138
+ onRefresh = props.onRefresh,
139
+ _props$indexColumn = props.indexColumn,
140
+ indexColumn = _props$indexColumn === void 0 ? true : _props$indexColumn,
141
+ _props$indexFixed = props.indexFixed,
142
+ indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
143
+ _props$bordered = props.bordered,
144
+ bordered = _props$bordered === void 0 ? true : _props$bordered,
145
+ _props$indexTitle = props.indexTitle,
146
+ indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
147
+ _props$startIndex = props.startIndex,
148
+ startIndex = _props$startIndex === void 0 ? 1 : _props$startIndex,
149
+ _props$autoFit = props.autoFit,
150
+ autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
151
+ _props$headFootHeight = props.headFootHeight,
152
+ headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
153
+ columnResizable = props.columnResizable,
154
+ components = props.components,
155
+ className = props.className,
156
+ style = props.style,
157
+ _props$emptyText = props.emptyText,
158
+ emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
159
+ onRowSelectionClear = props.onRowSelectionClear,
160
+ disabledColumnKeys = props.disabledColumnKeys,
161
+ onColumnsSave = props.onColumnsSave,
162
+ uniqueKey = props.uniqueKey,
163
+ prefixUrl = props.prefixUrl,
164
+ _props$customEnumText = props.customEnumText,
165
+ customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
166
+ _props$hideSelectionC = props.hideSelectionClear,
167
+ hideSelectionClear = _props$hideSelectionC === void 0 ? false : _props$hideSelectionC,
168
+ rest = _objectWithoutProperties(props, _excluded);
169
+
126
170
  var TextEnum = _objectSpread({
127
171
  refreshText: '刷新',
128
172
  densityDefaultText: '默认',
@@ -139,17 +183,19 @@ function VtxDatagrid(props) {
139
183
  alartAlreadyChooseUnitText: '项',
140
184
  messageSuccessText: '操作成功',
141
185
  messageWarningOneText: '至少勾选一列保存'
142
- }, customEnumText);
186
+ }, customEnumText); // 规则,菜单根目录_页面路由
187
+
143
188
 
144
- // 规则,菜单根目录_页面路由
145
189
  function getUniqueKey() {
146
190
  var route = location.href.match(/#\/(\S*)\?/);
191
+
147
192
  if (route) {
148
193
  (0, _axios["default"])({
149
194
  method: 'GET',
150
195
  url: "".concat(location.pathname, "resources/json/menu.json")
151
196
  }).then(function (res) {
152
197
  var _res$data;
198
+
153
199
  if ((res === null || res === void 0 ? void 0 : res.status) == 200 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.key) {
154
200
  setState({
155
201
  projectKey: "".concat(res.data.key, "_").concat(route ? route[1] : 'test')
@@ -157,41 +203,46 @@ function VtxDatagrid(props) {
157
203
  }
158
204
  });
159
205
  }
160
- }
206
+ } // 高度计算
207
+
161
208
 
162
- // 高度计算
163
209
  var _useThrottleFn = (0, _ahooks.useThrottleFn)(function () {
164
- var _datagridRef$current;
165
- if (!datagridRef.current) {
166
- return null;
167
- }
168
- var bodyHeight = ((_datagridRef$current = datagridRef.current) === null || _datagridRef$current === void 0 ? void 0 : _datagridRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
169
- var divs = datagridRef.current.getElementsByTagName('div');
170
- var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
171
- return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
172
- })[0];
173
- bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
174
- setState({
175
- scrollY: bodyHeight
176
- });
177
- }, {
178
- wait: 350
179
- }),
180
- calculateHeight = _useThrottleFn.run;
210
+ var _datagridRef$current;
211
+
212
+ if (!datagridRef.current) {
213
+ return null;
214
+ }
215
+
216
+ var bodyHeight = ((_datagridRef$current = datagridRef.current) === null || _datagridRef$current === void 0 ? void 0 : _datagridRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
217
+ var divs = datagridRef.current.getElementsByTagName('div');
218
+ var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
219
+ return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
220
+ })[0];
221
+ bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
222
+ setState({
223
+ scrollY: bodyHeight
224
+ });
225
+ }, {
226
+ wait: 350
227
+ }),
228
+ calculateHeight = _useThrottleFn.run;
229
+
181
230
  (0, _react.useEffect)(function () {
182
231
  // 当没有传入唯一值而且没有自定义列保存的时候根据规则自动生成唯一值
183
232
  if (!uniqueKey && !onColumnsSave) {
184
233
  getUniqueKey();
185
234
  }
235
+
186
236
  var resizeObserver = new ResizeObserver(function () {
187
237
  calculateHeight();
188
- });
189
- // componentDidMount
238
+ }); // componentDidMount
239
+
190
240
  if (autoFit && datagridRef.current) {
191
241
  resizeObserver.observe(datagridRef.current, {
192
242
  box: 'border-box'
193
243
  });
194
244
  }
245
+
195
246
  return function () {
196
247
  // componentWillUnmount
197
248
  if (autoFit) {
@@ -206,6 +257,7 @@ function VtxDatagrid(props) {
206
257
  }, [(_rest$dataSource = rest.dataSource) === null || _rest$dataSource === void 0 ? void 0 : _rest$dataSource.length, (((_rest$rowSelection = rest.rowSelection) === null || _rest$rowSelection === void 0 ? void 0 : _rest$rowSelection.selectedRowKeys) || []).join(',')]);
207
258
  (0, _react.useEffect)(function () {
208
259
  var _rest$columns;
260
+
209
261
  parseColumns();
210
262
  setState({
211
263
  columnSettingOptions: (_rest$columns = rest.columns) === null || _rest$columns === void 0 ? void 0 : _rest$columns.map(function (col) {
@@ -215,12 +267,15 @@ function VtxDatagrid(props) {
215
267
  })
216
268
  });
217
269
  }, [rest.columns]);
270
+
218
271
  var parseColumns = function parseColumns(type) {
219
272
  // 显示工具栏的同时并显示列设置
220
273
  if (toolbar && !hideColumnSetting) {
221
274
  var _settingRef$current;
275
+
222
276
  if (defaultVisibleColumnKeys || visibleColumnKeys || (_settingRef$current = settingRef.current) !== null && _settingRef$current !== void 0 && _settingRef$current.showColumns) {
223
277
  var _settingRef$current2, _rest$columns2;
278
+
224
279
  var columnKeys = type === 'reset' ? defaultVisibleColumnKeys : ((_settingRef$current2 = settingRef.current) === null || _settingRef$current2 === void 0 ? void 0 : _settingRef$current2.showColumns) || visibleColumnKeys || defaultVisibleColumnKeys;
225
280
  setState({
226
281
  checkedColumnKeys: columnKeys,
@@ -230,6 +285,7 @@ function VtxDatagrid(props) {
230
285
  });
231
286
  } else {
232
287
  var _rest$columns3;
288
+
233
289
  setState({
234
290
  checkedColumnKeys: (_rest$columns3 = rest.columns) === null || _rest$columns3 === void 0 ? void 0 : _rest$columns3.map(function (item) {
235
291
  return item.dataIndex || item.key;
@@ -243,13 +299,14 @@ function VtxDatagrid(props) {
243
299
  });
244
300
  }
245
301
  };
302
+
246
303
  var hasAlert = (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
247
304
  alertHeight.current = !hideSelectionClear && hasAlert ? 49 : 0;
248
- toolbarHeight.current = toolbar ? 56 : 0;
305
+ toolbarHeight.current = toolbar ? 56 : 0; // 列设置回调
249
306
 
250
- // 列设置回调
251
307
  var handleChangeColumns = function handleChangeColumns(keys) {
252
308
  var _rest$columns4;
309
+
253
310
  var columnKeys = keys || ((_rest$columns4 = rest.columns) === null || _rest$columns4 === void 0 ? void 0 : _rest$columns4.map(function (item) {
254
311
  return item.dataIndex || item.key;
255
312
  }));
@@ -260,10 +317,11 @@ function VtxDatagrid(props) {
260
317
  })
261
318
  });
262
319
  onVisibleColumnsChange && onVisibleColumnsChange(columnKeys);
263
- };
320
+ }; // 工具栏
321
+
264
322
 
265
- // 工具栏
266
323
  var toolbarRender;
324
+
267
325
  if (toolbar) {
268
326
  toolbarRender = /*#__PURE__*/_react["default"].createElement("div", {
269
327
  className: (0, _classnames2["default"])("".concat(prefixCls, "-toolbar"), toolbarClassName)
@@ -325,13 +383,14 @@ function VtxDatagrid(props) {
325
383
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
326
384
  title: TextEnum.columnSettingText
327
385
  }, /*#__PURE__*/_react["default"].createElement(_SettingOutlined["default"], null)))))));
328
- }
386
+ } // 分页
387
+
329
388
 
330
- // 分页
331
389
  var getPagination = function getPagination(pagination) {
332
390
  if (typeof pagination === 'boolean' && !pagination) {
333
391
  return pagination;
334
392
  }
393
+
335
394
  return _objectSpread({
336
395
  pageSizeOptions: ['10', '20', '30', '40', '50'],
337
396
  showSizeChanger: true,
@@ -340,17 +399,20 @@ function VtxDatagrid(props) {
340
399
  return "\u5171 ".concat(total, " \u6761");
341
400
  }
342
401
  }, pagination);
343
- };
402
+ }; // 处理操作按钮
403
+
344
404
 
345
- // 处理操作按钮
346
405
  var columns = (visibleColumns || []).map(function (column) {
347
406
  var newColumn = _objectSpread({}, column);
407
+
348
408
  if (newColumn.renderButtons) {
349
409
  delete newColumn.renderButtons;
350
410
  }
411
+
351
412
  if (newColumn.renderButtonsVisibleNum) {
352
413
  delete newColumn.renderButtonsVisibleNum;
353
414
  }
415
+
354
416
  return _objectSpread(_objectSpread({}, newColumn), {}, {
355
417
  render: (0, _isFunction["default"])(column.renderButtons) ? function (text, record, index) {
356
418
  return (0, _renderColumnButtons["default"])(column.renderButtons, column.renderButtonsVisibleNum, text, record, index, TextEnum);
@@ -358,8 +420,8 @@ function VtxDatagrid(props) {
358
420
  return ['', null, undefined].includes(text) ? '-' : text;
359
421
  }
360
422
  });
361
- });
362
- // 配置了列可伸缩
423
+ }); // 配置了列可伸缩
424
+
363
425
  if (columnResizable) {
364
426
  columns = columns.map(function (col, index) {
365
427
  return _objectSpread(_objectSpread({}, col), {}, {
@@ -371,12 +433,15 @@ function VtxDatagrid(props) {
371
433
  }
372
434
  });
373
435
  });
436
+
374
437
  var handleResize = function handleResize(index) {
375
438
  return function (e, _ref2) {
376
439
  var size = _ref2.size;
377
440
  setState(function (_ref3) {
378
441
  var visibleColumns = _ref3.visibleColumns;
442
+
379
443
  var nextColumns = _toConsumableArray(visibleColumns);
444
+
380
445
  nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
381
446
  width: size.width
382
447
  });
@@ -386,12 +451,14 @@ function VtxDatagrid(props) {
386
451
  });
387
452
  };
388
453
  };
389
- }
454
+ } // 序号添加
455
+
390
456
 
391
- // 序号添加
392
457
  var dataSource = rest.dataSource;
458
+
393
459
  if (indexColumn) {
394
460
  var _dataSource;
461
+
395
462
  columns = [{
396
463
  title: indexTitle,
397
464
  dataIndex: '_serialNum',
@@ -405,15 +472,18 @@ function VtxDatagrid(props) {
405
472
  });
406
473
  });
407
474
  }
475
+
408
476
  var scroll = rest.scroll || {};
477
+
409
478
  if (autoFit) {
410
479
  scroll = _objectSpread(_objectSpread({}, scroll), {}, {
411
480
  y: scrollY - (rest.scrollY || 0)
412
481
  });
413
482
  }
483
+
414
484
  return /*#__PURE__*/_react["default"].createElement("div", {
415
485
  id: datagridId,
416
- className: (0, _classnames2["default"])(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-fit"), autoFit), "".concat(prefixCls, "-noFit"), !autoFit), "".concat(prefixCls, "-nodata"), !((_dataSource2 = dataSource) !== null && _dataSource2 !== void 0 && _dataSource2.length)), "".concat(prefixCls, "-userAgent-mac"), isMac)),
486
+ className: (0, _classnames2["default"])(prefixCls, className, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-fit"), autoFit), _defineProperty(_classnames, "".concat(prefixCls, "-noFit"), !autoFit), _defineProperty(_classnames, "".concat(prefixCls, "-nodata"), !((_dataSource2 = dataSource) !== null && _dataSource2 !== void 0 && _dataSource2.length)), _defineProperty(_classnames, "".concat(prefixCls, "-userAgent-mac"), isMac), _classnames)),
417
487
  style: style,
418
488
  ref: datagridRef
419
489
  }, toolbarRender, !hideSelectionClear && hasAlert ? /*#__PURE__*/_react["default"].createElement("div", {
@@ -446,6 +516,7 @@ function VtxDatagrid(props) {
446
516
  }) : components
447
517
  })));
448
518
  }
519
+
449
520
  VtxDatagrid.propTypes = {
450
521
  prefixCls: _propTypes["default"].string,
451
522
  refreshIconVisible: _propTypes["default"].bool,