@vtx/components 3.1.78 → 3.1.80

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 (306) 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 -29
  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 +30 -56
  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 +36 -75
  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 +100 -170
  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 +70 -95
  89. package/lib/vtx-export-async/History.js.map +1 -1
  90. package/lib/vtx-export-async/index.js +81 -105
  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 -107
  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-tree/index.js +49 -114
  260. package/lib/vtx-tree/index.js.map +1 -1
  261. package/lib/vtx-tree/style/css.js +0 -2
  262. package/lib/vtx-tree/style/css.js.map +1 -1
  263. package/lib/vtx-tree/style/index.js +0 -2
  264. package/lib/vtx-tree/style/index.js.map +1 -1
  265. package/lib/vtx-tree/style/index.less +53 -53
  266. package/lib/vtx-tree/utils.js +6 -27
  267. package/lib/vtx-tree/utils.js.map +1 -1
  268. package/lib/vtx-tree-select/index.js +27 -71
  269. package/lib/vtx-tree-select/index.js.map +1 -1
  270. package/lib/vtx-tree-select/style/css.js +0 -3
  271. package/lib/vtx-tree-select/style/css.js.map +1 -1
  272. package/lib/vtx-tree-select/style/index.js +0 -3
  273. package/lib/vtx-tree-select/style/index.js.map +1 -1
  274. package/lib/vtx-upload/FilePreview.js +15 -33
  275. package/lib/vtx-upload/FilePreview.js.map +1 -1
  276. package/lib/vtx-upload/index.js +86 -153
  277. package/lib/vtx-upload/index.js.map +1 -1
  278. package/lib/vtx-upload/style/css.js +0 -6
  279. package/lib/vtx-upload/style/css.js.map +1 -1
  280. package/lib/vtx-upload/style/index.js +0 -6
  281. package/lib/vtx-upload/style/index.js.map +1 -1
  282. package/lib/vtx-upload/style/index.less +61 -61
  283. package/lib/vtx-wang-editor/index.js +74 -116
  284. package/lib/vtx-wang-editor/index.js.map +1 -1
  285. package/lib/vtx-wang-editor/style/css.js +0 -1
  286. package/lib/vtx-wang-editor/style/css.js.map +1 -1
  287. package/lib/vtx-wang-editor/style/index.js +0 -1
  288. package/lib/vtx-wang-editor/style/index.js.map +1 -1
  289. package/lib/vtx-wang-editor/style/index.less +12 -12
  290. package/lib/vtx-wang-editor/wangEditorUtil.js +75 -136
  291. package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
  292. package/lib/vtx-ztree/index.js +69 -119
  293. package/lib/vtx-ztree/index.js.map +1 -1
  294. package/lib/vtx-ztree/style/css.js +0 -1
  295. package/lib/vtx-ztree/style/css.js.map +1 -1
  296. package/lib/vtx-ztree/style/index.js +0 -1
  297. package/lib/vtx-ztree/style/index.js.map +1 -1
  298. package/lib/vtx-ztree/style/index.less +45 -45
  299. package/lib/vtx-ztree-select/index.js +73 -142
  300. package/lib/vtx-ztree-select/index.js.map +1 -1
  301. package/lib/vtx-ztree-select/style/css.js +0 -3
  302. package/lib/vtx-ztree-select/style/css.js.map +1 -1
  303. package/lib/vtx-ztree-select/style/index.js +0 -3
  304. package/lib/vtx-ztree-select/style/index.js.map +1 -1
  305. package/lib/vtx-ztree-select/style/index.less +107 -107
  306. package/package.json +121 -127
@@ -4,64 +4,43 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _input = _interopRequireDefault(require("antd/lib/input"));
11
-
12
9
  var _lodash = _interopRequireDefault(require("lodash.isequal"));
13
-
14
10
  var _lodash2 = _interopRequireDefault(require("lodash.merge"));
15
-
16
11
  var _lodash3 = _interopRequireDefault(require("lodash.debounce"));
17
-
18
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
-
20
13
  var _classnames2 = _interopRequireDefault(require("classnames"));
21
-
22
14
  var _config = _interopRequireDefault(require("../config"));
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
30
- 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); }
31
-
16
+ 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; }
17
+ 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; }
18
+ 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); }
32
19
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
35
-
20
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
36
21
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
39
-
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
43
-
22
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
44
23
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
45
-
46
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
49
-
24
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
50
25
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
- 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; }
53
-
54
- var VtxZtree = /*#__PURE__*/function (_React$Component) {
26
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+ 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; }
30
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
31
+ 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); } /*
32
+ * @Author: yemu
33
+ * @Date: 2021-04-08 22:03:07
34
+ * @LastEditTime: 2021-04-09 10:36:45
35
+ * @LastEditors: yemu
36
+ * @Description: 树形控件
37
+ */
38
+ var VtxZtree = exports["default"] = /*#__PURE__*/function (_React$Component) {
55
39
  _inherits(VtxZtree, _React$Component);
56
-
57
- var _super = _createSuper(VtxZtree);
58
-
59
40
  function VtxZtree(props) {
60
41
  var _this;
61
-
62
42
  _classCallCheck(this, VtxZtree);
63
-
64
- _this = _super.call(this, props);
43
+ _this = _callSuper(this, VtxZtree, [props]);
65
44
  _this.treeId = "tree-".concat(new Date().getTime(), "-").concat(parseInt(Math.random() * 10000));
66
45
  _this.zTreeObj = null;
67
46
  _this.treeSetting = {};
@@ -76,7 +55,6 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
76
55
  };
77
56
  return _this;
78
57
  }
79
-
80
58
  _createClass(VtxZtree, [{
81
59
  key: "loadTreeResource",
82
60
  value: function loadTreeResource() {
@@ -104,10 +82,8 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
104
82
  key: "componentDidMount",
105
83
  value: function componentDidMount() {
106
84
  var _this2 = this;
107
-
108
85
  this.loadPromise.then(function () {
109
86
  _this2.loadComplete = true;
110
-
111
87
  _this2.refreshTree(_this2.props);
112
88
  });
113
89
  }
@@ -115,7 +91,6 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
115
91
  key: "componentDidUpdate",
116
92
  value: function componentDidUpdate(prevProps) {
117
93
  if (!this.loadComplete) return;
118
-
119
94
  if (!(0, _lodash["default"])(prevProps.refreshFlag, this.props.refreshFlag) || !(0, _lodash["default"])(prevProps.data, this.props.data)) {
120
95
  this.refreshTree(this.props);
121
96
  }
@@ -124,13 +99,14 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
124
99
  key: "componentWillUnmount",
125
100
  value: function componentWillUnmount() {
126
101
  this.zTreeObj && this.zTreeObj.destroy();
127
- } // 初始化树的配置
102
+ }
128
103
 
104
+ // 初始化树的配置
129
105
  }, {
130
106
  key: "initTreeSetting",
131
107
  value: function initTreeSetting(props) {
132
- var t = this; // 初始化树的配置
133
-
108
+ var t = this;
109
+ // 初始化树的配置
134
110
  this.treeSetting = {
135
111
  check: {
136
112
  enable: !!props.checkable,
@@ -243,32 +219,30 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
243
219
  }
244
220
  }
245
221
  }
246
- }; // 继承外部配置
247
-
222
+ };
223
+ // 继承外部配置
248
224
  if (_typeof(this.props.customCfg) == 'object') {
249
225
  (0, _lodash2["default"])(this.treeSetting, this.props.customCfg);
250
226
  }
251
- } // 初始化树的数据,对expandedKeys,checkedKeys做处理
227
+ }
252
228
 
229
+ // 初始化树的数据,对expandedKeys,checkedKeys做处理
253
230
  }, {
254
231
  key: "initTreeNodes",
255
232
  value: function initTreeNodes(props) {
256
233
  var t = this;
257
234
  this.keyNameMapping = {};
258
-
259
235
  if (!Array.isArray(props.data)) {
260
236
  this.treeNodes = [];
261
237
  } else {
262
238
  var checkedKeys = props.checkedKeys || [];
263
239
  var expandedKeys = props.expandedKeys || [];
264
240
  var chkDisabled = !!props.disableCheckboxAll;
265
-
266
241
  this.treeNodes = function genNodes(nodes) {
267
242
  return nodes.map(function (item) {
268
243
  var checked = checkedKeys.indexOf(item.key) != -1;
269
244
  var open = expandedKeys.indexOf(item.key) != -1;
270
245
  t.keyNameMapping[item.key] = item.name;
271
-
272
246
  if (Array.isArray(item.children) && item.children.length > 0) {
273
247
  return _objectSpread(_objectSpread({
274
248
  chkDisabled: chkDisabled,
@@ -289,22 +263,19 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
289
263
  }
290
264
  }).map(function (item) {
291
265
  if (Array.isArray(item.children) && item.children.length > 0) {
292
- var newNode = _objectSpread({}, item); // 如果子节点全部被勾选,父节点自动勾选
293
-
294
-
266
+ var newNode = _objectSpread({}, item);
267
+ // 如果子节点全部被勾选,父节点自动勾选
295
268
  if (item.children.every(function (item) {
296
269
  return item.checked;
297
270
  })) {
298
271
  newNode.checked = true;
299
- } // 如果配置了自动展开父节点,父节点自动展开
300
-
301
-
272
+ }
273
+ // 如果配置了自动展开父节点,父节点自动展开
302
274
  if (props.autoExpandParent && item.children.some(function (item) {
303
275
  return item.open;
304
276
  })) {
305
277
  newNode.open = true;
306
278
  }
307
-
308
279
  return newNode;
309
280
  } else {
310
281
  return item;
@@ -312,8 +283,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
312
283
  });
313
284
  }(props.data);
314
285
  }
315
- } // 重新生成树
286
+ }
316
287
 
288
+ // 重新生成树
317
289
  }, {
318
290
  key: "refreshTree",
319
291
  value: function refreshTree(newProps) {
@@ -321,65 +293,62 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
321
293
  this.initTreeSetting(newProps);
322
294
  this.initTreeNodes(newProps);
323
295
  this.zTreeObj = $.fn.zTree.init($("#".concat(this.treeId)), this.treeSetting, this.treeNodes);
324
-
325
296
  if (Array.isArray(newProps.selectedKeys)) {
326
297
  this.selectNodes(newProps.selectedKeys, newProps.multiple);
327
- } // 初始化全展开判断
328
-
329
-
298
+ }
299
+ // 初始化全展开判断
330
300
  if (newProps.defaultExpandAll && !newProps.expandedKeys) {
331
301
  this.zTreeObj.expandAll(true);
332
302
  }
333
- } // 展开或折叠相关节点,expandFlag为true表示展开,false表示折叠
303
+ }
334
304
 
305
+ // 展开或折叠相关节点,expandFlag为true表示展开,false表示折叠
335
306
  }, {
336
307
  key: "expandNodes",
337
308
  value: function expandNodes(expandedKeys) {
338
309
  var expandFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
339
-
340
310
  for (var i = 0, len = expandedKeys.length; i < len; i++) {
341
311
  var node = this.zTreeObj.getNodesByParam('key', expandedKeys[i]).pop();
342
-
343
312
  if (node) {
344
313
  this.zTreeObj.expandNode(node, expandFlag, false, false);
345
314
  }
346
315
  }
347
- } // 勾选节点, checkedFlag为true表示勾选,false表示取消勾选
316
+ }
348
317
 
318
+ // 勾选节点, checkedFlag为true表示勾选,false表示取消勾选
349
319
  }, {
350
320
  key: "checkNodes",
351
321
  value: function checkNodes(checkedKeys) {
352
322
  var checkedFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
353
-
354
323
  for (var i = 0, len = checkedKeys.length; i < len; i++) {
355
324
  var node = this.zTreeObj.getNodesByParam('key', checkedKeys[i]).pop();
356
-
357
325
  if (node) {
358
326
  // 隐藏节点的勾选状态也要改变
359
327
  node.checked = checkedFlag;
360
- this.zTreeObj.updateNode(node, true); // this.zTreeObj.checkNode(node,checkedFlag,false);
328
+ this.zTreeObj.updateNode(node, true);
329
+ // this.zTreeObj.checkNode(node,checkedFlag,false);
361
330
  }
362
331
  }
363
- } // 点击选择节点
332
+ }
364
333
 
334
+ // 点击选择节点
365
335
  }, {
366
336
  key: "selectNodes",
367
337
  value: function selectNodes(selectedKeys, multiple) {
368
338
  for (var i = 0, len = selectedKeys.length; i < len; i++) {
369
339
  var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
370
-
371
340
  if (node) {
372
341
  this.zTreeObj.selectNode(node, multiple, true);
373
342
  }
374
343
  }
375
- } // 取消选择节点
344
+ }
376
345
 
346
+ // 取消选择节点
377
347
  }, {
378
348
  key: "cancelSelectedNodes",
379
349
  value: function cancelSelectedNodes(selectedKeys) {
380
350
  for (var i = 0, len = selectedKeys.length; i < len; i++) {
381
351
  var node = this.zTreeObj.getNodesByParam('key', selectedKeys[i]).pop();
382
-
383
352
  if (node) {
384
353
  this.zTreeObj.cancelSelectedNode(node);
385
354
  }
@@ -393,38 +362,34 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
393
362
  var nameKey = this.zTreeObj.setting.data.key.name; // get the key of the node name
394
363
  // isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
395
364
  // isExpand = isExpand?true:false; // not to expand in default
396
-
397
365
  this.zTreeObj.setting.view.nameIsHTML = isHighLight; // allow use html in node name for highlight use
398
366
 
399
367
  var metaChar = '[\\[\\]\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; // js meta characters
400
-
401
368
  var rexMeta = new RegExp(metaChar, 'gi'); // regular expression to match meta characters
369
+
402
370
  // searchNodeLazy(keyworld);
371
+ ztreeFilter(t.zTreeObj, keyworld);
403
372
 
404
- ztreeFilter(t.zTreeObj, keyworld); // -----------------------------内部函数----------------------------------
373
+ // -----------------------------内部函数----------------------------------
405
374
  // keywords filter function
406
-
407
375
  function ztreeFilter(zTreeObj, _keywords) {
408
376
  if (!_keywords) {
409
377
  _keywords = ''; // default blank for _keywords
410
- } // function to find the matching node
411
-
378
+ }
412
379
 
380
+ // function to find the matching node
413
381
  function filterFunc(node) {
414
382
  if (node && node.oldname && node.oldname.length > 0) {
415
383
  node[nameKey] = node.oldname; // recover oldname of the node if exist
416
384
  }
417
-
418
385
  zTreeObj.updateNode(node); // update node to for modifications take effect
419
-
420
386
  if (_keywords.length == 0) {
421
387
  // return true to show all nodes if the keyword is blank
422
- zTreeObj.showNode(node); // zTreeObj.expandNode(node,isExpand);
423
-
388
+ zTreeObj.showNode(node);
389
+ // zTreeObj.expandNode(node,isExpand);
424
390
  return true;
425
- } // transform node name and keywords to lowercase
426
-
427
-
391
+ }
392
+ // transform node name and keywords to lowercase
428
393
  if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase()) != -1) {
429
394
  if (isHighLight) {
430
395
  // highlight process
@@ -435,12 +400,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
435
400
  // add escape character before meta characters
436
401
  return '\\' + matchStr;
437
402
  });
438
-
439
403
  node.oldname = node[nameKey]; // store the old name
440
-
441
404
  var rexGlobal = new RegExp(newKeywords, 'gi'); // 'g' for global,'i' for ignore case
442
405
  // use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
443
-
444
406
  node[nameKey] = node.oldname.replace(rexGlobal, function (originalText) {
445
407
  // highlight the matching words in node name
446
408
  var highLightText = '<span style="color: whitesmoke;background-color:#f50;">' + originalText + '</span>';
@@ -448,38 +410,29 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
448
410
  });
449
411
  zTreeObj.updateNode(node); // update node for modifications take effect
450
412
  }
451
-
452
413
  zTreeObj.showNode(node); // show node with matching keywords
453
-
454
414
  return true; // return true and show this node
455
415
  }
456
-
457
416
  zTreeObj.hideNode(node); // hide node that not matched
458
-
459
417
  return false; // return false for node not matched
460
418
  }
461
-
462
419
  var nodesShow = zTreeObj.getNodesByFilter(filterFunc); // get all nodes that would be shown
463
-
464
420
  processShowNodes(zTreeObj, nodesShow, _keywords); // nodes should be reprocessed to show correctly
465
421
  }
422
+
466
423
  /**
467
424
  * reprocess of nodes before showing
468
425
  */
469
-
470
-
471
426
  function processShowNodes(zTreeObj, nodesShow, _keywords) {
472
427
  if (nodesShow && nodesShow.length > 0) {
473
428
  // process the ancient nodes if _keywords is not blank
474
429
  if (_keywords.length > 0) {
475
430
  $.each(nodesShow, function (n, obj) {
476
431
  var pathOfOne = obj.getPath(); // get all the ancient nodes including current node
477
-
478
432
  if (pathOfOne && pathOfOne.length > 0) {
479
433
  // i < pathOfOne.length-1 process every node in path except self
480
434
  for (var i = 0; i < pathOfOne.length - 1; i++) {
481
435
  zTreeObj.showNode(pathOfOne[i]); // show node
482
-
483
436
  zTreeObj.expandNode(pathOfOne[i], true); // expand node
484
437
  }
485
438
  }
@@ -487,15 +440,15 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
487
440
  } else {
488
441
  // show all nodes when _keywords is blank and expand the root nodes
489
442
  var rootNodes = zTreeObj.getNodesByParam('level', '0'); // get all root nodes
490
-
491
443
  $.each(rootNodes, function (n, obj) {
492
444
  zTreeObj.expandNode(obj, true); // expand all root nodes
493
445
  });
494
446
  }
495
447
  }
496
448
  }
497
- } // 清空搜索框数据(供外部调用)
449
+ }
498
450
 
451
+ // 清空搜索框数据(供外部调用)
499
452
  }, {
500
453
  key: "clearSearch",
501
454
  value: function clearSearch() {
@@ -504,13 +457,13 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
504
457
  searchVal: ''
505
458
  });
506
459
  this.refreshTree(this.props);
507
- } // 获取所有已被勾选的节点
460
+ }
508
461
 
462
+ // 获取所有已被勾选的节点
509
463
  }, {
510
464
  key: "getCheckedNodes",
511
465
  value: function getCheckedNodes() {
512
466
  var _this3 = this;
513
-
514
467
  return this.zTreeObj.getNodesByFilter(function (node) {
515
468
  // 节点被勾选(非半勾状态)
516
469
  if (_this3.props.checkStrictly) return node.checked;
@@ -518,11 +471,11 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
518
471
  }).map(function (item) {
519
472
  return _objectSpread(_objectSpread({}, item), {}, {
520
473
  name: item.oldname || item.name // 搜索树会改变节点的name
521
-
522
474
  });
523
475
  });
524
- } // 获取所有已被点击选中的节点
476
+ }
525
477
 
478
+ // 获取所有已被点击选中的节点
526
479
  }, {
527
480
  key: "getSelectedNodes",
528
481
  value: function getSelectedNodes() {
@@ -531,14 +484,16 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
531
484
  name: item.oldname || item.name
532
485
  });
533
486
  });
534
- } // 展开所有节点(供外部调用)
487
+ }
535
488
 
489
+ // 展开所有节点(供外部调用)
536
490
  }, {
537
491
  key: "expandAll",
538
492
  value: function expandAll() {
539
493
  this.zTreeObj.expandAll(true);
540
- } // 收起所有节点(供外部调用)
494
+ }
541
495
 
496
+ // 收起所有节点(供外部调用)
542
497
  }, {
543
498
  key: "collapseAll",
544
499
  value: function collapseAll() {
@@ -549,9 +504,9 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
549
504
  value: function render() {
550
505
  var t = this;
551
506
  var _t$props = t.props,
552
- prefixCls = _t$props.prefixCls,
553
- showSearch = _t$props.showSearch,
554
- searchPlaceholder = _t$props.searchPlaceholder;
507
+ prefixCls = _t$props.prefixCls,
508
+ showSearch = _t$props.showSearch,
509
+ searchPlaceholder = _t$props.searchPlaceholder;
555
510
  return /*#__PURE__*/_react["default"].createElement("div", {
556
511
  className: (0, _classnames2["default"])("".concat(prefixCls, "-wraaper"), _defineProperty({}, "".concat(prefixCls, "-has-search"), showSearch))
557
512
  }, showSearch && /*#__PURE__*/_react["default"].createElement("div", {
@@ -571,17 +526,12 @@ var VtxZtree = /*#__PURE__*/function (_React$Component) {
571
526
  }));
572
527
  }
573
528
  }]);
574
-
575
529
  return VtxZtree;
576
530
  }(_react["default"].Component);
577
-
578
- exports["default"] = VtxZtree;
579
-
580
531
  _defineProperty(VtxZtree, "defaultProps", {
581
532
  showSearch: true,
582
533
  prefixCls: 'vtx-ztree'
583
534
  });
584
-
585
535
  VtxZtree.propTypes = {
586
536
  showSearch: _propTypes["default"].bool,
587
537
  searchPlaceholder: _propTypes["default"].string,