@vtx/components 3.1.76 → 3.1.78

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