@kdcloudjs/table 1.2.1-canary.5 → 1.2.1-canary.7

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 (573) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/@kdcloudjs/table.css +1 -1
  4. package/dist/@kdcloudjs/table.css.map +0 -0
  5. package/dist/@kdcloudjs/table.js +4595 -5995
  6. package/dist/@kdcloudjs/table.js.map +1 -1
  7. package/dist/@kdcloudjs/table.min.css +1 -1
  8. package/dist/@kdcloudjs/table.min.js +16 -24
  9. package/dist/@kdcloudjs/table.min.js.map +1 -1
  10. package/dist/default-theme.js +0 -0
  11. package/dist/kd-ui-complete.less +0 -0
  12. package/dist/kd-ui.less +0 -0
  13. package/dist/theme.js +0 -0
  14. package/es/_utils/arrayUtil.d.ts +0 -0
  15. package/es/_utils/arrayUtil.js +0 -3
  16. package/es/_utils/devwarning.d.ts +0 -0
  17. package/es/_utils/devwarning.js +0 -1
  18. package/es/_utils/formatUtil.d.ts +0 -0
  19. package/es/_utils/formatUtil.js +36 -101
  20. package/es/_utils/hooks.d.ts +0 -0
  21. package/es/_utils/hooks.js +21 -45
  22. package/es/_utils/index.d.ts +0 -0
  23. package/es/_utils/index.js +0 -2
  24. package/es/_utils/numberUtil.d.ts +0 -0
  25. package/es/_utils/numberUtil.js +32 -55
  26. package/es/_utils/omit.d.ts +0 -0
  27. package/es/_utils/omit.js +0 -2
  28. package/es/_utils/react-children.d.ts +0 -0
  29. package/es/_utils/react-children.js +0 -0
  30. package/es/_utils/type.d.ts +0 -0
  31. package/es/_utils/type.js +0 -2
  32. package/es/_utils/usePopper.d.ts +0 -0
  33. package/es/_utils/usePopper.js +81 -144
  34. package/es/config-provider/ConfigContext.d.ts +0 -0
  35. package/es/config-provider/ConfigContext.js +0 -0
  36. package/es/config-provider/compDefaultProps.d.ts +0 -0
  37. package/es/config-provider/compDefaultProps.js +0 -1
  38. package/es/config-provider/configProvider.d.ts +0 -0
  39. package/es/config-provider/configProvider.js +2 -7
  40. package/es/config-provider/defaultConfig.d.ts +0 -0
  41. package/es/config-provider/defaultConfig.js +0 -1
  42. package/es/config-provider/index.d.ts +0 -0
  43. package/es/config-provider/index.js +0 -0
  44. package/es/index.d.ts +0 -0
  45. package/es/index.js +0 -2
  46. package/es/locale/index.d.ts +0 -0
  47. package/es/locale/index.js +0 -0
  48. package/es/locale/locale.d.ts +0 -0
  49. package/es/locale/locale.js +9 -48
  50. package/es/locale/zh-CN.d.ts +0 -0
  51. package/es/locale/zh-CN.js +0 -0
  52. package/es/style/color/colors.less +0 -0
  53. package/es/style/core/index.less +0 -0
  54. package/es/style/core/motion/other.less +0 -0
  55. package/es/style/core/motion/slide.less +0 -0
  56. package/es/style/core/motion.less +0 -0
  57. package/es/style/core/reset.less +0 -0
  58. package/es/style/css.js +0 -0
  59. package/es/style/index.css +0 -0
  60. package/es/style/index.d.ts +0 -0
  61. package/es/style/index.js +0 -0
  62. package/es/style/index.less +0 -0
  63. package/es/style/mixins/index.less +0 -0
  64. package/es/style/mixins/overlay.less +0 -0
  65. package/es/style/mixins/reset.less +0 -0
  66. package/es/style/themes/default.less +0 -0
  67. package/es/style/themes/index.less +0 -0
  68. package/es/table/base/calculations.d.ts +0 -0
  69. package/es/table/base/calculations.js +25 -75
  70. package/es/table/base/colgroup.d.ts +0 -0
  71. package/es/table/base/colgroup.js +0 -1
  72. package/es/table/base/empty.d.ts +0 -0
  73. package/es/table/base/empty.js +6 -6
  74. package/es/table/base/header.d.ts +0 -0
  75. package/es/table/base/header.js +21 -76
  76. package/es/table/base/helpers/SpanManager.d.ts +0 -0
  77. package/es/table/base/helpers/SpanManager.js +4 -11
  78. package/es/table/base/helpers/TableDOMUtils.d.ts +0 -0
  79. package/es/table/base/helpers/TableDOMUtils.js +9 -34
  80. package/es/table/base/helpers/__test__/SpanManager.test.d.ts +0 -0
  81. package/es/table/base/helpers/__test__/SpanManager.test.js +2 -2
  82. package/es/table/base/helpers/__test__/TableDOMUtils.test.d.ts +0 -0
  83. package/es/table/base/helpers/__test__/TableDOMUtils.test.js +0 -1
  84. package/es/table/base/helpers/__test__/rowHeightManager.test.d.ts +0 -0
  85. package/es/table/base/helpers/__test__/rowHeightManager.test.js +0 -0
  86. package/es/table/base/helpers/getRichVisibleRectsStream.d.ts +0 -0
  87. package/es/table/base/helpers/getRichVisibleRectsStream.js +13 -45
  88. package/es/table/base/helpers/rowHeightManager.d.ts +0 -0
  89. package/es/table/base/helpers/rowHeightManager.js +0 -28
  90. package/es/table/base/html-table.d.ts +0 -0
  91. package/es/table/base/html-table.js +17 -39
  92. package/es/table/base/index.d.ts +0 -0
  93. package/es/table/base/index.js +0 -0
  94. package/es/table/base/interfaces.d.ts +0 -0
  95. package/es/table/base/interfaces.js +0 -0
  96. package/es/table/base/loading.d.ts +0 -0
  97. package/es/table/base/loading.js +8 -10
  98. package/es/table/base/renderTemplates.d.ts +0 -0
  99. package/es/table/base/renderTemplates.js +41 -59
  100. package/es/table/base/styles.d.ts +0 -0
  101. package/es/table/base/styles.js +0 -9
  102. package/es/table/base/table.d.ts +0 -0
  103. package/es/table/base/table.js +110 -199
  104. package/es/table/base/utils.d.ts +0 -0
  105. package/es/table/base/utils.js +17 -57
  106. package/es/table/common-views.d.ts +0 -0
  107. package/es/table/common-views.js +0 -7
  108. package/es/table/index.d.ts +0 -0
  109. package/es/table/index.js +0 -0
  110. package/es/table/interfaces.d.ts +0 -0
  111. package/es/table/interfaces.js +0 -0
  112. package/es/table/internals.d.ts +0 -0
  113. package/es/table/internals.js +0 -13
  114. package/es/table/pipeline/features/autoFill.d.ts +0 -0
  115. package/es/table/pipeline/features/autoFill.js +11 -40
  116. package/es/table/pipeline/features/autoRowSpan.d.ts +0 -0
  117. package/es/table/pipeline/features/autoRowSpan.js +1 -14
  118. package/es/table/pipeline/features/buildTree.d.ts +0 -0
  119. package/es/table/pipeline/features/buildTree.js +0 -0
  120. package/es/table/pipeline/features/colGroupExtendable.d.ts +0 -0
  121. package/es/table/pipeline/features/colGroupExtendable.js +4 -19
  122. package/es/table/pipeline/features/columnDrag.d.ts +0 -0
  123. package/es/table/pipeline/features/columnDrag.js +41 -97
  124. package/es/table/pipeline/features/columnFilter.d.ts +0 -0
  125. package/es/table/pipeline/features/columnFilter.js +12 -51
  126. package/es/table/pipeline/features/columnHover.d.ts +0 -0
  127. package/es/table/pipeline/features/columnHover.js +1 -7
  128. package/es/table/pipeline/features/columnRangeHover.d.ts +0 -0
  129. package/es/table/pipeline/features/columnRangeHover.js +1 -8
  130. package/es/table/pipeline/features/columnResizeWidth.d.ts +0 -0
  131. package/es/table/pipeline/features/columnResizeWidth.js +13 -39
  132. package/es/table/pipeline/features/contextMenu.d.ts +0 -0
  133. package/es/table/pipeline/features/contextMenu.js +22 -95
  134. package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +0 -0
  135. package/es/table/pipeline/features/filter/DefaultFilterContent.js +14 -30
  136. package/es/table/pipeline/features/filter/DefaultFilterIcon.d.ts +0 -0
  137. package/es/table/pipeline/features/filter/DefaultFilterIcon.js +1 -1
  138. package/es/table/pipeline/features/filter/Filter.d.ts +0 -0
  139. package/es/table/pipeline/features/filter/Filter.js +26 -50
  140. package/es/table/pipeline/features/filter/FilterPanel.d.ts +0 -0
  141. package/es/table/pipeline/features/filter/FilterPanel.js +11 -25
  142. package/es/table/pipeline/features/filter/index.d.ts +0 -0
  143. package/es/table/pipeline/features/filter/index.js +0 -0
  144. package/es/table/pipeline/features/filter/util.d.ts +0 -0
  145. package/es/table/pipeline/features/filter/util.js +0 -4
  146. package/es/table/pipeline/features/footerDataSource.d.ts +0 -0
  147. package/es/table/pipeline/features/footerDataSource.js +0 -3
  148. package/es/table/pipeline/features/index.d.ts +0 -0
  149. package/es/table/pipeline/features/index.js +0 -0
  150. package/es/table/pipeline/features/mergeCellHover.d.ts +0 -0
  151. package/es/table/pipeline/features/mergeCellHover.js +0 -1
  152. package/es/table/pipeline/features/multiSelect.d.ts +0 -0
  153. package/es/table/pipeline/features/multiSelect.js +15 -57
  154. package/es/table/pipeline/features/rangeSelection.d.ts +0 -0
  155. package/es/table/pipeline/features/rangeSelection.js +74 -154
  156. package/es/table/pipeline/features/rowDetail.d.ts +0 -0
  157. package/es/table/pipeline/features/rowDetail.js +4 -43
  158. package/es/table/pipeline/features/rowDrag.d.ts +0 -0
  159. package/es/table/pipeline/features/rowDrag.js +39 -78
  160. package/es/table/pipeline/features/rowGrouping.d.ts +0 -0
  161. package/es/table/pipeline/features/rowGrouping.js +4 -37
  162. package/es/table/pipeline/features/singleSelect.d.ts +0 -0
  163. package/es/table/pipeline/features/singleSelect.js +0 -24
  164. package/es/table/pipeline/features/sort.d.ts +0 -0
  165. package/es/table/pipeline/features/sort.js +38 -96
  166. package/es/table/pipeline/features/tips.d.ts +0 -0
  167. package/es/table/pipeline/features/tips.js +4 -10
  168. package/es/table/pipeline/features/treeMode.d.ts +0 -0
  169. package/es/table/pipeline/features/treeMode.js +14 -49
  170. package/es/table/pipeline/features/treeSelect.d.ts +0 -0
  171. package/es/table/pipeline/features/treeSelect.js +2 -28
  172. package/es/table/pipeline/index.d.ts +0 -0
  173. package/es/table/pipeline/index.js +0 -0
  174. package/es/table/pipeline/pipeline.d.ts +0 -0
  175. package/es/table/pipeline/pipeline.js +12 -53
  176. package/es/table/pivot/cross-table/buildCrossTable.d.ts +0 -0
  177. package/es/table/pivot/cross-table/buildCrossTable.js +21 -72
  178. package/es/table/pivot/cross-table/constants.d.ts +0 -0
  179. package/es/table/pivot/cross-table/constants.js +0 -0
  180. package/es/table/pivot/cross-table/cross-table.d.ts +0 -0
  181. package/es/table/pivot/cross-table/cross-table.js +23 -31
  182. package/es/table/pivot/cross-table/index.d.ts +0 -0
  183. package/es/table/pivot/cross-table/index.js +0 -0
  184. package/es/table/pivot/cross-table/interfaces.d.ts +0 -0
  185. package/es/table/pivot/cross-table/interfaces.js +0 -0
  186. package/es/table/pivot/cross-table/internals.d.ts +0 -0
  187. package/es/table/pivot/cross-table/internals.js +0 -0
  188. package/es/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +0 -0
  189. package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +22 -57
  190. package/es/table/pivot/cross-tree-table/cross-tree-table.d.ts +0 -0
  191. package/es/table/pivot/cross-tree-table/cross-tree-table.js +36 -61
  192. package/es/table/pivot/cross-tree-table/index.d.ts +0 -0
  193. package/es/table/pivot/cross-tree-table/index.js +0 -0
  194. package/es/table/pivot/pivot-utils/buildDrillTree.d.ts +0 -0
  195. package/es/table/pivot/pivot-utils/buildDrillTree.js +10 -23
  196. package/es/table/pivot/pivot-utils/builders.d.ts +0 -0
  197. package/es/table/pivot/pivot-utils/builders.js +34 -74
  198. package/es/table/pivot/pivot-utils/convert-utils.d.ts +0 -0
  199. package/es/table/pivot/pivot-utils/convert-utils.js +16 -42
  200. package/es/table/pivot/pivot-utils/index.d.ts +0 -0
  201. package/es/table/pivot/pivot-utils/index.js +0 -0
  202. package/es/table/pivot/pivot-utils/interfaces.d.ts +0 -0
  203. package/es/table/pivot/pivot-utils/interfaces.js +0 -0
  204. package/es/table/pivot/pivot-utils/simpleEncode.d.ts +0 -0
  205. package/es/table/pivot/pivot-utils/simpleEncode.js +0 -1
  206. package/es/table/style/css.js +0 -0
  207. package/es/table/style/index.css +0 -0
  208. package/es/table/style/index.d.ts +0 -0
  209. package/es/table/style/index.js +0 -0
  210. package/es/table/style/index.less +0 -0
  211. package/es/table/transforms/autoRowSpan.d.ts +0 -0
  212. package/es/table/transforms/autoRowSpan.js +1 -15
  213. package/es/table/transforms/autoWidth.d.ts +0 -0
  214. package/es/table/transforms/autoWidth.js +13 -35
  215. package/es/table/transforms/buildTree.d.ts +0 -0
  216. package/es/table/transforms/buildTree.js +1 -2
  217. package/es/table/transforms/columnHover.d.ts +0 -0
  218. package/es/table/transforms/columnHover.js +9 -15
  219. package/es/table/transforms/columnRangeHover.d.ts +0 -0
  220. package/es/table/transforms/columnRangeHover.js +12 -19
  221. package/es/table/transforms/columnResize.d.ts +0 -0
  222. package/es/table/transforms/columnResize.js +18 -42
  223. package/es/table/transforms/flatten.d.ts +0 -0
  224. package/es/table/transforms/flatten.js +0 -3
  225. package/es/table/transforms/index.d.ts +0 -0
  226. package/es/table/transforms/index.js +0 -0
  227. package/es/table/transforms/orderField.d.ts +0 -0
  228. package/es/table/transforms/orderField.js +0 -3
  229. package/es/table/transforms/sort.d.ts +0 -0
  230. package/es/table/transforms/sort.js +42 -101
  231. package/es/table/transforms/tips.d.ts +0 -0
  232. package/es/table/transforms/tips.js +5 -10
  233. package/es/table/transforms/treeMode.d.ts +0 -0
  234. package/es/table/transforms/treeMode.js +36 -77
  235. package/es/table/transforms/visible.d.ts +0 -0
  236. package/es/table/transforms/visible.js +0 -2
  237. package/es/table/transforms/warnTransformsDeprecated.d.ts +0 -0
  238. package/es/table/transforms/warnTransformsDeprecated.js +0 -0
  239. package/es/table/use/useResizeObserver.d.ts +0 -0
  240. package/es/table/use/useResizeObserver.js +1 -4
  241. package/es/table/utils/applyTransforms.d.ts +0 -0
  242. package/es/table/utils/applyTransforms.js +0 -1
  243. package/es/table/utils/browserType.d.ts +0 -0
  244. package/es/table/utils/browserType.js +17 -20
  245. package/es/table/utils/buildTree.d.ts +0 -0
  246. package/es/table/utils/buildTree.js +7 -22
  247. package/es/table/utils/collectNodes.d.ts +0 -0
  248. package/es/table/utils/collectNodes.js +4 -13
  249. package/es/table/utils/console.d.ts +0 -0
  250. package/es/table/utils/console.js +0 -14
  251. package/es/table/utils/copyToClipboard.d.ts +0 -0
  252. package/es/table/utils/copyToClipboard.js +0 -4
  253. package/es/table/utils/element.d.ts +0 -0
  254. package/es/table/utils/element.js +14 -41
  255. package/es/table/utils/exportTableAsExcel.d.ts +0 -0
  256. package/es/table/utils/exportTableAsExcel.js +7 -43
  257. package/es/table/utils/getTreeDepth.d.ts +0 -0
  258. package/es/table/utils/getTreeDepth.js +4 -12
  259. package/es/table/utils/groupBy.d.ts +0 -0
  260. package/es/table/utils/groupBy.js +4 -13
  261. package/es/table/utils/index.d.ts +0 -0
  262. package/es/table/utils/index.js +0 -0
  263. package/es/table/utils/isGroupColumn.d.ts +0 -0
  264. package/es/table/utils/isGroupColumn.js +0 -0
  265. package/es/table/utils/isLeafNode.d.ts +0 -0
  266. package/es/table/utils/isLeafNode.js +0 -0
  267. package/es/table/utils/keyCode.d.ts +0 -0
  268. package/es/table/utils/keyCode.js +0 -0
  269. package/es/table/utils/layeredFilter.d.ts +0 -0
  270. package/es/table/utils/layeredFilter.js +0 -4
  271. package/es/table/utils/layeredSort.d.ts +0 -0
  272. package/es/table/utils/layeredSort.js +0 -5
  273. package/es/table/utils/makeRecursiveMapper.d.ts +0 -0
  274. package/es/table/utils/makeRecursiveMapper.js +4 -15
  275. package/es/table/utils/mergeCellProps.d.ts +0 -0
  276. package/es/table/utils/mergeCellProps.js +6 -14
  277. package/es/table/utils/others.d.ts +0 -0
  278. package/es/table/utils/others.js +6 -19
  279. package/es/table/utils/proto.d.ts +0 -0
  280. package/es/table/utils/proto.js +2 -30
  281. package/es/table/utils/selectColumn.d.ts +0 -0
  282. package/es/table/utils/selectColumn.js +0 -0
  283. package/es/table/utils/smartCompare.d.ts +0 -0
  284. package/es/table/utils/smartCompare.js +4 -12
  285. package/es/table/utils/traverseColumn.d.ts +0 -0
  286. package/es/table/utils/traverseColumn.js +5 -18
  287. package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +0 -0
  288. package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +8 -30
  289. package/es/table/utils/tree-data-helpers/TreeDataHelper.d.ts +0 -0
  290. package/es/table/utils/tree-data-helpers/TreeDataHelper.js +19 -74
  291. package/es/table/utils/uiDegrade.d.ts +0 -0
  292. package/es/table/utils/uiDegrade.js +0 -5
  293. package/lib/_utils/arrayUtil.d.ts +0 -0
  294. package/lib/_utils/arrayUtil.js +2 -8
  295. package/lib/_utils/devwarning.d.ts +0 -0
  296. package/lib/_utils/devwarning.js +0 -5
  297. package/lib/_utils/formatUtil.d.ts +0 -0
  298. package/lib/_utils/formatUtil.js +36 -105
  299. package/lib/_utils/hooks.d.ts +0 -0
  300. package/lib/_utils/hooks.js +21 -56
  301. package/lib/_utils/index.d.ts +0 -0
  302. package/lib/_utils/index.js +2 -9
  303. package/lib/_utils/numberUtil.d.ts +0 -0
  304. package/lib/_utils/numberUtil.js +32 -63
  305. package/lib/_utils/omit.d.ts +0 -0
  306. package/lib/_utils/omit.js +0 -5
  307. package/lib/_utils/react-children.d.ts +0 -0
  308. package/lib/_utils/react-children.js +0 -5
  309. package/lib/_utils/type.d.ts +0 -0
  310. package/lib/_utils/type.js +3 -11
  311. package/lib/_utils/usePopper.d.ts +0 -0
  312. package/lib/_utils/usePopper.js +86 -173
  313. package/lib/config-provider/ConfigContext.d.ts +0 -0
  314. package/lib/config-provider/ConfigContext.js +2 -6
  315. package/lib/config-provider/compDefaultProps.d.ts +0 -0
  316. package/lib/config-provider/compDefaultProps.js +1 -3
  317. package/lib/config-provider/configProvider.d.ts +0 -0
  318. package/lib/config-provider/configProvider.js +6 -22
  319. package/lib/config-provider/defaultConfig.d.ts +0 -0
  320. package/lib/config-provider/defaultConfig.js +1 -7
  321. package/lib/config-provider/index.d.ts +0 -0
  322. package/lib/config-provider/index.js +1 -8
  323. package/lib/index.d.ts +0 -0
  324. package/lib/index.js +2 -8
  325. package/lib/locale/index.d.ts +0 -0
  326. package/lib/locale/index.js +3 -11
  327. package/lib/locale/locale.d.ts +0 -0
  328. package/lib/locale/locale.js +13 -69
  329. package/lib/locale/zh-CN.d.ts +0 -0
  330. package/lib/locale/zh-CN.js +1 -2
  331. package/lib/style/color/colors.less +0 -0
  332. package/lib/style/components.less +0 -0
  333. package/lib/style/core/index.less +0 -0
  334. package/lib/style/core/motion/other.less +0 -0
  335. package/lib/style/core/motion/slide.less +0 -0
  336. package/lib/style/core/motion.less +0 -0
  337. package/lib/style/core/reset.less +0 -0
  338. package/lib/style/css.js +0 -0
  339. package/lib/style/index.css +0 -0
  340. package/lib/style/index.d.ts +0 -0
  341. package/lib/style/index.js +0 -0
  342. package/lib/style/index.less +0 -0
  343. package/lib/style/mixins/index.less +0 -0
  344. package/lib/style/mixins/overlay.less +0 -0
  345. package/lib/style/mixins/reset.less +0 -0
  346. package/lib/style/themes/default.less +0 -0
  347. package/lib/style/themes/index.less +0 -0
  348. package/lib/table/base/calculations.d.ts +0 -0
  349. package/lib/table/base/calculations.js +25 -86
  350. package/lib/table/base/colgroup.d.ts +0 -0
  351. package/lib/table/base/colgroup.js +0 -5
  352. package/lib/table/base/empty.d.ts +0 -0
  353. package/lib/table/base/empty.js +8 -20
  354. package/lib/table/base/header.d.ts +0 -0
  355. package/lib/table/base/header.js +21 -86
  356. package/lib/table/base/helpers/SpanManager.d.ts +0 -0
  357. package/lib/table/base/helpers/SpanManager.js +6 -16
  358. package/lib/table/base/helpers/TableDOMUtils.d.ts +0 -0
  359. package/lib/table/base/helpers/TableDOMUtils.js +9 -37
  360. package/lib/table/base/helpers/__test__/SpanManager.test.d.ts +0 -0
  361. package/lib/table/base/helpers/__test__/SpanManager.test.js +2 -4
  362. package/lib/table/base/helpers/__test__/TableDOMUtils.test.d.ts +0 -0
  363. package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +0 -5
  364. package/lib/table/base/helpers/__test__/rowHeightManager.test.d.ts +0 -0
  365. package/lib/table/base/helpers/__test__/rowHeightManager.test.js +0 -1
  366. package/lib/table/base/helpers/getRichVisibleRectsStream.d.ts +0 -0
  367. package/lib/table/base/helpers/getRichVisibleRectsStream.js +15 -65
  368. package/lib/table/base/helpers/rowHeightManager.d.ts +0 -0
  369. package/lib/table/base/helpers/rowHeightManager.js +0 -33
  370. package/lib/table/base/html-table.d.ts +0 -0
  371. package/lib/table/base/html-table.js +17 -49
  372. package/lib/table/base/index.d.ts +0 -0
  373. package/lib/table/base/index.js +0 -2
  374. package/lib/table/base/interfaces.d.ts +0 -0
  375. package/lib/table/base/interfaces.js +0 -0
  376. package/lib/table/base/loading.d.ts +0 -0
  377. package/lib/table/base/loading.js +8 -14
  378. package/lib/table/base/renderTemplates.d.ts +0 -0
  379. package/lib/table/base/renderTemplates.js +44 -75
  380. package/lib/table/base/styles.d.ts +0 -0
  381. package/lib/table/base/styles.js +9 -37
  382. package/lib/table/base/table.d.ts +0 -0
  383. package/lib/table/base/table.js +122 -243
  384. package/lib/table/base/utils.d.ts +0 -0
  385. package/lib/table/base/utils.js +27 -109
  386. package/lib/table/common-views.d.ts +0 -0
  387. package/lib/table/common-views.js +4 -24
  388. package/lib/table/index.d.ts +0 -0
  389. package/lib/table/index.js +0 -13
  390. package/lib/table/interfaces.d.ts +0 -0
  391. package/lib/table/interfaces.js +0 -0
  392. package/lib/table/internals.d.ts +0 -0
  393. package/lib/table/internals.js +2 -17
  394. package/lib/table/pipeline/features/autoFill.d.ts +0 -0
  395. package/lib/table/pipeline/features/autoFill.js +14 -53
  396. package/lib/table/pipeline/features/autoRowSpan.d.ts +0 -0
  397. package/lib/table/pipeline/features/autoRowSpan.js +1 -19
  398. package/lib/table/pipeline/features/buildTree.d.ts +0 -0
  399. package/lib/table/pipeline/features/buildTree.js +0 -2
  400. package/lib/table/pipeline/features/colGroupExtendable.d.ts +0 -0
  401. package/lib/table/pipeline/features/colGroupExtendable.js +6 -35
  402. package/lib/table/pipeline/features/columnDrag.d.ts +0 -0
  403. package/lib/table/pipeline/features/columnDrag.js +41 -103
  404. package/lib/table/pipeline/features/columnFilter.d.ts +0 -0
  405. package/lib/table/pipeline/features/columnFilter.js +12 -65
  406. package/lib/table/pipeline/features/columnHover.d.ts +0 -0
  407. package/lib/table/pipeline/features/columnHover.js +1 -11
  408. package/lib/table/pipeline/features/columnRangeHover.d.ts +0 -0
  409. package/lib/table/pipeline/features/columnRangeHover.js +1 -13
  410. package/lib/table/pipeline/features/columnResizeWidth.d.ts +0 -0
  411. package/lib/table/pipeline/features/columnResizeWidth.js +18 -63
  412. package/lib/table/pipeline/features/contextMenu.d.ts +0 -0
  413. package/lib/table/pipeline/features/contextMenu.js +24 -121
  414. package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +0 -0
  415. package/lib/table/pipeline/features/filter/DefaultFilterContent.js +17 -52
  416. package/lib/table/pipeline/features/filter/DefaultFilterIcon.d.ts +0 -0
  417. package/lib/table/pipeline/features/filter/DefaultFilterIcon.js +1 -4
  418. package/lib/table/pipeline/features/filter/Filter.d.ts +0 -0
  419. package/lib/table/pipeline/features/filter/Filter.js +29 -76
  420. package/lib/table/pipeline/features/filter/FilterPanel.d.ts +0 -0
  421. package/lib/table/pipeline/features/filter/FilterPanel.js +14 -44
  422. package/lib/table/pipeline/features/filter/index.d.ts +0 -0
  423. package/lib/table/pipeline/features/filter/index.js +0 -5
  424. package/lib/table/pipeline/features/filter/util.d.ts +0 -0
  425. package/lib/table/pipeline/features/filter/util.js +2 -10
  426. package/lib/table/pipeline/features/footerDataSource.d.ts +0 -0
  427. package/lib/table/pipeline/features/footerDataSource.js +1 -12
  428. package/lib/table/pipeline/features/index.d.ts +0 -0
  429. package/lib/table/pipeline/features/index.js +0 -23
  430. package/lib/table/pipeline/features/mergeCellHover.d.ts +0 -0
  431. package/lib/table/pipeline/features/mergeCellHover.js +0 -5
  432. package/lib/table/pipeline/features/multiSelect.d.ts +0 -0
  433. package/lib/table/pipeline/features/multiSelect.js +15 -71
  434. package/lib/table/pipeline/features/rangeSelection.d.ts +0 -0
  435. package/lib/table/pipeline/features/rangeSelection.js +76 -175
  436. package/lib/table/pipeline/features/rowDetail.d.ts +0 -0
  437. package/lib/table/pipeline/features/rowDetail.js +4 -67
  438. package/lib/table/pipeline/features/rowDrag.d.ts +0 -0
  439. package/lib/table/pipeline/features/rowDrag.js +41 -93
  440. package/lib/table/pipeline/features/rowGrouping.d.ts +0 -0
  441. package/lib/table/pipeline/features/rowGrouping.js +4 -57
  442. package/lib/table/pipeline/features/singleSelect.d.ts +0 -0
  443. package/lib/table/pipeline/features/singleSelect.js +0 -34
  444. package/lib/table/pipeline/features/sort.d.ts +0 -0
  445. package/lib/table/pipeline/features/sort.js +37 -115
  446. package/lib/table/pipeline/features/tips.d.ts +0 -0
  447. package/lib/table/pipeline/features/tips.js +4 -19
  448. package/lib/table/pipeline/features/treeMode.d.ts +0 -0
  449. package/lib/table/pipeline/features/treeMode.js +15 -72
  450. package/lib/table/pipeline/features/treeSelect.d.ts +0 -0
  451. package/lib/table/pipeline/features/treeSelect.js +2 -36
  452. package/lib/table/pipeline/index.d.ts +0 -0
  453. package/lib/table/pipeline/index.js +2 -10
  454. package/lib/table/pipeline/pipeline.d.ts +0 -0
  455. package/lib/table/pipeline/pipeline.js +13 -64
  456. package/lib/table/pivot/cross-table/buildCrossTable.d.ts +0 -0
  457. package/lib/table/pivot/cross-table/buildCrossTable.js +21 -83
  458. package/lib/table/pivot/cross-table/constants.d.ts +0 -0
  459. package/lib/table/pivot/cross-table/constants.js +1 -2
  460. package/lib/table/pivot/cross-table/cross-table.d.ts +0 -0
  461. package/lib/table/pivot/cross-table/cross-table.js +25 -42
  462. package/lib/table/pivot/cross-table/index.d.ts +0 -0
  463. package/lib/table/pivot/cross-table/index.js +0 -4
  464. package/lib/table/pivot/cross-table/interfaces.d.ts +0 -0
  465. package/lib/table/pivot/cross-table/interfaces.js +0 -0
  466. package/lib/table/pivot/cross-table/internals.d.ts +0 -0
  467. package/lib/table/pivot/cross-table/internals.js +0 -0
  468. package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.d.ts +0 -0
  469. package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +22 -70
  470. package/lib/table/pivot/cross-tree-table/cross-tree-table.d.ts +0 -0
  471. package/lib/table/pivot/cross-tree-table/cross-tree-table.js +37 -73
  472. package/lib/table/pivot/cross-tree-table/index.d.ts +0 -0
  473. package/lib/table/pivot/cross-tree-table/index.js +0 -3
  474. package/lib/table/pivot/pivot-utils/buildDrillTree.d.ts +0 -0
  475. package/lib/table/pivot/pivot-utils/buildDrillTree.js +10 -29
  476. package/lib/table/pivot/pivot-utils/builders.d.ts +0 -0
  477. package/lib/table/pivot/pivot-utils/builders.js +34 -85
  478. package/lib/table/pivot/pivot-utils/convert-utils.d.ts +0 -0
  479. package/lib/table/pivot/pivot-utils/convert-utils.js +16 -60
  480. package/lib/table/pivot/pivot-utils/index.d.ts +0 -0
  481. package/lib/table/pivot/pivot-utils/index.js +0 -7
  482. package/lib/table/pivot/pivot-utils/interfaces.d.ts +0 -0
  483. package/lib/table/pivot/pivot-utils/interfaces.js +0 -0
  484. package/lib/table/pivot/pivot-utils/simpleEncode.d.ts +0 -0
  485. package/lib/table/pivot/pivot-utils/simpleEncode.js +0 -2
  486. package/lib/table/style/css.js +0 -1
  487. package/lib/table/style/index.css +0 -0
  488. package/lib/table/style/index.d.ts +0 -0
  489. package/lib/table/style/index.js +0 -1
  490. package/lib/table/style/index.less +0 -0
  491. package/lib/table/transforms/autoRowSpan.d.ts +0 -0
  492. package/lib/table/transforms/autoRowSpan.js +1 -21
  493. package/lib/table/transforms/autoWidth.d.ts +0 -0
  494. package/lib/table/transforms/autoWidth.js +15 -58
  495. package/lib/table/transforms/buildTree.d.ts +0 -0
  496. package/lib/table/transforms/buildTree.js +1 -4
  497. package/lib/table/transforms/columnHover.d.ts +0 -0
  498. package/lib/table/transforms/columnHover.js +9 -22
  499. package/lib/table/transforms/columnRangeHover.d.ts +0 -0
  500. package/lib/table/transforms/columnRangeHover.js +12 -27
  501. package/lib/table/transforms/columnResize.d.ts +0 -0
  502. package/lib/table/transforms/columnResize.js +20 -63
  503. package/lib/table/transforms/flatten.d.ts +0 -0
  504. package/lib/table/transforms/flatten.js +0 -5
  505. package/lib/table/transforms/index.d.ts +0 -0
  506. package/lib/table/transforms/index.js +0 -12
  507. package/lib/table/transforms/orderField.d.ts +0 -0
  508. package/lib/table/transforms/orderField.js +0 -7
  509. package/lib/table/transforms/sort.d.ts +0 -0
  510. package/lib/table/transforms/sort.js +44 -127
  511. package/lib/table/transforms/tips.d.ts +0 -0
  512. package/lib/table/transforms/tips.js +5 -20
  513. package/lib/table/transforms/treeMode.d.ts +0 -0
  514. package/lib/table/transforms/treeMode.js +38 -106
  515. package/lib/table/transforms/visible.d.ts +0 -0
  516. package/lib/table/transforms/visible.js +0 -7
  517. package/lib/table/transforms/warnTransformsDeprecated.d.ts +0 -0
  518. package/lib/table/transforms/warnTransformsDeprecated.js +0 -4
  519. package/lib/table/use/useResizeObserver.d.ts +0 -0
  520. package/lib/table/use/useResizeObserver.js +2 -10
  521. package/lib/table/utils/applyTransforms.d.ts +0 -0
  522. package/lib/table/utils/applyTransforms.js +0 -2
  523. package/lib/table/utils/browserType.d.ts +0 -0
  524. package/lib/table/utils/browserType.js +19 -24
  525. package/lib/table/utils/buildTree.d.ts +0 -0
  526. package/lib/table/utils/buildTree.js +7 -33
  527. package/lib/table/utils/collectNodes.d.ts +0 -0
  528. package/lib/table/utils/collectNodes.js +4 -18
  529. package/lib/table/utils/console.d.ts +0 -0
  530. package/lib/table/utils/console.js +2 -19
  531. package/lib/table/utils/copyToClipboard.d.ts +0 -0
  532. package/lib/table/utils/copyToClipboard.js +1 -8
  533. package/lib/table/utils/element.d.ts +0 -0
  534. package/lib/table/utils/element.js +14 -46
  535. package/lib/table/utils/exportTableAsExcel.d.ts +0 -0
  536. package/lib/table/utils/exportTableAsExcel.js +7 -52
  537. package/lib/table/utils/getTreeDepth.d.ts +0 -0
  538. package/lib/table/utils/getTreeDepth.js +4 -17
  539. package/lib/table/utils/groupBy.d.ts +0 -0
  540. package/lib/table/utils/groupBy.js +4 -17
  541. package/lib/table/utils/index.d.ts +0 -0
  542. package/lib/table/utils/index.js +0 -22
  543. package/lib/table/utils/isGroupColumn.d.ts +0 -0
  544. package/lib/table/utils/isGroupColumn.js +0 -3
  545. package/lib/table/utils/isLeafNode.d.ts +0 -0
  546. package/lib/table/utils/isLeafNode.js +0 -1
  547. package/lib/table/utils/keyCode.d.ts +0 -0
  548. package/lib/table/utils/keyCode.js +1 -2
  549. package/lib/table/utils/layeredFilter.d.ts +0 -0
  550. package/lib/table/utils/layeredFilter.js +0 -10
  551. package/lib/table/utils/layeredSort.d.ts +0 -0
  552. package/lib/table/utils/layeredSort.js +0 -10
  553. package/lib/table/utils/makeRecursiveMapper.d.ts +0 -0
  554. package/lib/table/utils/makeRecursiveMapper.js +4 -24
  555. package/lib/table/utils/mergeCellProps.d.ts +0 -0
  556. package/lib/table/utils/mergeCellProps.js +6 -18
  557. package/lib/table/utils/others.d.ts +0 -0
  558. package/lib/table/utils/others.js +7 -36
  559. package/lib/table/utils/proto.d.ts +0 -0
  560. package/lib/table/utils/proto.js +3 -35
  561. package/lib/table/utils/selectColumn.d.ts +0 -0
  562. package/lib/table/utils/selectColumn.js +2 -5
  563. package/lib/table/utils/smartCompare.d.ts +0 -0
  564. package/lib/table/utils/smartCompare.js +4 -13
  565. package/lib/table/utils/traverseColumn.d.ts +0 -0
  566. package/lib/table/utils/traverseColumn.js +5 -25
  567. package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +0 -0
  568. package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +10 -41
  569. package/lib/table/utils/tree-data-helpers/TreeDataHelper.d.ts +0 -0
  570. package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +21 -90
  571. package/lib/table/utils/uiDegrade.d.ts +0 -0
  572. package/lib/table/utils/uiDegrade.js +1 -8
  573. package/package.json +1 -1
@@ -1,56 +1,32 @@
1
1
  "use strict";
2
2
 
3
3
  var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat-map");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.rowDetail = rowDetail;
11
-
12
9
  var _toArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toArray"));
13
-
14
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
15
-
16
11
  var _extends4 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
17
-
18
12
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
19
-
20
13
  var _symbol = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/symbol"));
21
-
22
14
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
23
-
24
15
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
25
-
26
16
  var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
27
-
28
17
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
29
-
30
18
  var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
31
-
32
19
  var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
33
-
34
20
  var _classnames = _interopRequireDefault(require("classnames"));
35
-
36
21
  var _react = _interopRequireDefault(require("react"));
37
-
38
22
  var _commonViews = require("../../common-views");
39
-
40
23
  var _internals = require("../../internals");
41
-
42
24
  var _utils = require("../../utils");
43
-
44
25
  var _others = require("../../utils/others");
45
-
46
26
  var _console = _interopRequireDefault(require("../../utils/console"));
47
-
48
27
  var _renderTemplates = _interopRequireDefault(require("../../base/renderTemplates"));
49
-
50
28
  var _base = require("../../base");
51
-
52
29
  var rowDetailSymbol = (0, _symbol.default)('row-detail');
53
-
54
30
  var fallbackRenderDetail = function fallbackRenderDetail() {
55
31
  return /*#__PURE__*/_react.default.createElement("div", {
56
32
  style: {
@@ -62,14 +38,11 @@ var fallbackRenderDetail = function fallbackRenderDetail() {
62
38
  }
63
39
  }, "\u8BBE\u7F6E ", /*#__PURE__*/_react.default.createElement("code", null, "rowDetail.renderDetail"), " \u6765\u81EA\u5B9A\u4E49\u8BE6\u60C5\u5185\u5BB9"));
64
40
  };
65
-
66
41
  function rowDetail() {
67
42
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
68
43
  return function rowDetailStep(pipeline) {
69
44
  var _context, _context2;
70
-
71
45
  var _a, _b, _c, _d, _e, _f, _g, _h;
72
-
73
46
  var stateKey = 'rowDetail';
74
47
  var rowDetailMetaKey = (_a = opts.rowDetailMetaKey) !== null && _a !== void 0 ? _a : rowDetailSymbol;
75
48
  var primaryKey = pipeline.ensurePrimaryKey('rowDetail');
@@ -84,33 +57,26 @@ function rowDetail() {
84
57
  var openKeys = (_h = (_g = (_f = opts.openKeys) !== null && _f !== void 0 ? _f : pipeline.getStateAtKey(stateKey)) !== null && _g !== void 0 ? _g : opts.defaultOpenAll ? (0, _map.default)(_context = (0, _filter.default)(_context2 = pipeline.getDataSource()).call(_context2, hasDetail)).call(_context, function (row, rowIndex) {
85
58
  return _internals.internals.safeGetRowKey(primaryKey, row, rowIndex);
86
59
  }) : opts.defaultOpenKeys) !== null && _h !== void 0 ? _h : [];
87
-
88
60
  var onChangeOpenKeys = function onChangeOpenKeys(nextKeys, key, action) {
89
61
  var _a;
90
-
91
62
  (_a = opts.onChangeOpenKeys) === null || _a === void 0 ? void 0 : _a.call(opts, nextKeys, key, action);
92
63
  pipeline.setStateAtKey(stateKey, nextKeys, {
93
64
  key: key,
94
65
  action: action
95
66
  });
96
67
  };
97
-
98
68
  var openKeySet = new _set.default(openKeys);
99
-
100
69
  var toggle = function toggle(rowKey) {
101
70
  var expanded = openKeySet.has(rowKey);
102
-
103
71
  if (expanded) {
104
72
  onChangeOpenKeys((0, _filter.default)(openKeys).call(openKeys, function (key) {
105
73
  return key !== rowKey;
106
74
  }), rowKey, 'collapse');
107
75
  } else {
108
76
  var _context3;
109
-
110
77
  onChangeOpenKeys((0, _concat.default)(_context3 = []).call(_context3, (0, _toConsumableArray2.default)(openKeys), [rowKey]), rowKey, 'expand');
111
78
  }
112
79
  };
113
-
114
80
  var detailPrimaryKey = typeof primaryKey === 'string' ? primaryKey : rowDetailMetaKey.toString() + 'PrimaryKey';
115
81
  return pipeline.dataSource((0, _flatMapInstanceProperty(_others))(pipeline.getDataSource(), function (row, rowIndex) {
116
82
  if (openKeySet.has(_internals.internals.safeGetRowKey(primaryKey, row, rowIndex))) {
@@ -126,35 +92,27 @@ function rowDetail() {
126
92
  };
127
93
  }
128
94
  });
129
-
130
95
  function processColumns(columns) {
131
96
  if (columns.length === 0) {
132
97
  return columns;
133
98
  }
134
-
135
99
  var expandColumnIndex = 0;
136
-
137
100
  if (opts.expandColumnCode) {
138
101
  expandColumnIndex = (0, _findIndex.default)(columns).call(columns, function (col) {
139
102
  return col.code === opts.expandColumnCode;
140
103
  });
141
-
142
104
  if (expandColumnIndex < 0) {
143
105
  _console.default.warn('没找到可展开的列,请检查设置的展开列code');
144
-
145
106
  return columns;
146
107
  }
147
108
  }
148
-
149
109
  var expandCol = columns[expandColumnIndex];
150
110
  var tableColumns = (0, _toConsumableArray2.default)(columns);
151
-
152
111
  var render = function render(value, row, rowIndex) {
153
112
  if (row[rowDetailMetaKey]) {
154
113
  // 第一列内容已经渲染
155
114
  if (expandColumnIndex !== 0) return;
156
115
  var renderRowDetail = (0, _renderTemplates.default)('rowDetail');
157
-
158
116
  if (typeof renderRowDetail === 'function') {
159
117
  return renderRowDetail({
160
118
  row: row,
@@ -163,12 +121,9 @@ function rowDetail() {
163
121
  renderDetail: renderDetail
164
122
  });
165
123
  }
166
-
167
124
  return renderDetail(row, rowIndex);
168
125
  }
169
-
170
126
  var content = _internals.internals.safeRender(expandCol, row, rowIndex);
171
-
172
127
  if (!hasDetail(row, rowIndex)) {
173
128
  return /*#__PURE__*/_react.default.createElement(_commonViews.InlineFlexCell, {
174
129
  style: {
@@ -176,19 +131,14 @@ function rowDetail() {
176
131
  }
177
132
  }, content);
178
133
  }
179
-
180
134
  var rowKey = _internals.internals.safeGetRowKey(primaryKey, row, rowIndex);
181
-
182
135
  var expanded = openKeySet.has(rowKey);
183
-
184
136
  var onClick = function onClick(e) {
185
137
  if (opts.stopClickEventPropagation) {
186
138
  e.stopPropagation();
187
139
  }
188
-
189
140
  toggle(rowKey);
190
141
  };
191
-
192
142
  var expandCls = expanded ? _base.Classes.expanded : _base.Classes.collapsed;
193
143
  var ExpandIcon = opts.expandIcon;
194
144
  return /*#__PURE__*/_react.default.createElement(_commonViews.ExpansionCell, {
@@ -210,10 +160,8 @@ function rowDetail() {
210
160
  onClick: clickArea === 'icon' ? onClick : undefined
211
161
  }), content);
212
162
  };
213
-
214
163
  var getCellProps = function getCellProps(value, row, rowIndex) {
215
164
  var _a;
216
-
217
165
  if (row[rowDetailMetaKey]) {
218
166
  return {
219
167
  style: (0, _extends4.default)({
@@ -222,19 +170,15 @@ function rowDetail() {
222
170
  }, opts.detailCellStyle)
223
171
  };
224
172
  }
225
-
226
173
  var prevProps = (_a = expandCol.getCellProps) === null || _a === void 0 ? void 0 : _a.call(expandCol, value, row, rowIndex);
227
-
228
174
  if (!hasDetail(row, rowIndex)) {
229
175
  return prevProps;
230
176
  }
231
-
232
177
  return (0, _utils.mergeCellProps)(prevProps, {
233
178
  onClick: function onClick(e) {
234
179
  if (opts.stopClickEventPropagation) {
235
180
  e.stopPropagation();
236
181
  }
237
-
238
182
  toggle(_internals.internals.safeGetRowKey(primaryKey, row, rowIndex));
239
183
  },
240
184
  style: {
@@ -242,15 +186,12 @@ function rowDetail() {
242
186
  }
243
187
  });
244
188
  };
245
-
246
189
  var _tableColumns = (0, _toArray2.default)(tableColumns),
247
- firstCol = _tableColumns[0],
248
- others = (0, _slice.default)(_tableColumns).call(_tableColumns, 1);
249
-
190
+ firstCol = _tableColumns[0],
191
+ others = (0, _slice.default)(_tableColumns).call(_tableColumns, 1);
250
192
  var firstColRender = function firstColRender(value, row, rowIndex) {
251
193
  if (row[rowDetailMetaKey]) {
252
194
  var renderRowDetail = (0, _renderTemplates.default)('rowDetail');
253
-
254
195
  if (typeof renderRowDetail === 'function') {
255
196
  return renderRowDetail({
256
197
  row: row,
@@ -259,15 +200,11 @@ function rowDetail() {
259
200
  renderDetail: renderDetail
260
201
  });
261
202
  }
262
-
263
203
  return renderDetail(row, rowIndex);
264
204
  }
265
-
266
205
  var content = _internals.internals.safeRender(firstCol, row, rowIndex);
267
-
268
206
  return content;
269
207
  };
270
-
271
208
  tableColumns[0] = (0, _extends4.default)((0, _extends4.default)({}, firstCol), {
272
209
  render: firstColRender,
273
210
  getSpanRect: function getSpanRect(value, row, rowIndex) {
@@ -283,12 +220,12 @@ function rowDetail() {
283
220
  }
284
221
  });
285
222
  tableColumns[expandColumnIndex] = (0, _extends4.default)((0, _extends4.default)({}, expandCol), {
286
- title: /*#__PURE__*/_react.default.createElement("div", {
223
+ title: ( /*#__PURE__*/_react.default.createElement("div", {
287
224
  style: {
288
225
  display: 'inline-block',
289
226
  marginLeft: textOffset
290
227
  }
291
- }, _internals.internals.safeRenderHeader(expandCol)),
228
+ }, _internals.internals.safeRenderHeader(expandCol))),
292
229
  render: render,
293
230
  getCellProps: clickArea === 'cell' ? getCellProps : expandCol.getCellProps,
294
231
  getSpanRect: function getSpanRect(value, row, rowIndex) {
File without changes
@@ -1,38 +1,24 @@
1
1
  "use strict";
2
2
 
3
3
  var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
4
-
5
4
  var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/map");
6
-
7
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.ROW_DRAG_COLUMN_CODE = void 0;
13
10
  exports.rowDrag = rowDrag;
14
11
  exports.rowDragKey = void 0;
15
-
16
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
17
-
18
13
  var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
19
-
20
14
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
21
-
22
15
  var _react = _interopRequireDefault(require("react"));
23
-
24
16
  var _rxjs = require("rxjs");
25
-
26
17
  var _operators = require("rxjs/operators");
27
-
28
18
  var _classnames = _interopRequireDefault(require("classnames"));
29
-
30
19
  var _styles = require("../../base/styles");
31
-
32
- var ROW_DRAG_COLUMN_CODE = '$_row_drag_column_&';
33
- exports.ROW_DRAG_COLUMN_CODE = ROW_DRAG_COLUMN_CODE;
34
- var rowDragKey = 'rowDragKey';
35
- exports.rowDragKey = rowDragKey;
20
+ var ROW_DRAG_COLUMN_CODE = exports.ROW_DRAG_COLUMN_CODE = '$_row_drag_column_&';
21
+ var rowDragKey = exports.rowDragKey = 'rowDragKey';
36
22
  var SCROLL_OFFSET = 30;
37
23
  var defaultRowDragColumn = {
38
24
  name: '拖拽列',
@@ -60,47 +46,38 @@ var defaultRowDragColumn = {
60
46
  }));
61
47
  }
62
48
  };
63
-
64
49
  function rowDrag(opt) {
65
50
  return function rowDragStep(pipeline) {
66
51
  var _context;
67
-
68
52
  var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
69
53
  var artTable = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.artTable;
70
54
  if (!tableBody) return pipeline;
71
55
  var dataSource = pipeline.getDataSource();
72
56
  var rowHeight = (opt === null || opt === void 0 ? void 0 : opt.rowHeight) || 48;
73
-
74
57
  var handleDragStrat = function handleDragStrat(event) {
75
- var _a; // 开始拖拽
76
-
77
-
58
+ var _a;
59
+ // 开始拖拽
78
60
  artTable.classList.add((0, _classnames.default)(_styles.Classes.rowDragging));
79
61
  (_a = opt === null || opt === void 0 ? void 0 : opt.onDragStart) === null || _a === void 0 ? void 0 : _a.call(opt, event);
80
62
  };
81
-
82
63
  var handleDragMove = function handleDragMove(event) {
83
64
  var _a;
84
-
85
65
  (_a = opt === null || opt === void 0 ? void 0 : opt.onDragMove) === null || _a === void 0 ? void 0 : _a.call(opt, event);
86
66
  pipeline.setStateAtKey(rowDragKey, event);
87
67
  };
88
-
89
68
  var handleDragEnd = function handleDragEnd(event, isValid) {
90
69
  var _a;
91
-
92
70
  artTable.classList.remove((0, _classnames.default)(_styles.Classes.rowDragging));
93
- pipeline.setStateAtKey(rowDragKey, event); // 超出拖拽范围不触发dragend事件
94
-
71
+ pipeline.setStateAtKey(rowDragKey, event);
72
+ // 超出拖拽范围不触发dragend事件
95
73
  if (isValid) {
96
74
  (_a = opt === null || opt === void 0 ? void 0 : opt.onDragEnd) === null || _a === void 0 ? void 0 : _a.call(opt, event);
97
75
  }
98
76
  };
99
-
100
77
  var getDragEvent = function getDragEvent(startRowInfo, endRowInfo, _ref) {
101
78
  var isFinished = _ref.isFinished,
102
- _ref$dragPosition = _ref.dragPosition,
103
- dragPosition = _ref$dragPosition === void 0 ? 'bottom' : _ref$dragPosition;
79
+ _ref$dragPosition = _ref.dragPosition,
80
+ dragPosition = _ref$dragPosition === void 0 ? 'bottom' : _ref$dragPosition;
104
81
  return {
105
82
  startRowIndex: startRowInfo.rowIndex,
106
83
  startRow: startRowInfo.row,
@@ -110,31 +87,26 @@ function rowDrag(opt) {
110
87
  isFinished: isFinished
111
88
  };
112
89
  };
113
-
114
90
  var updateScrollPosition = function updateScrollPosition(mouseMoveEvent) {
115
91
  if (opt === null || opt === void 0 ? void 0 : opt.suppressScrollMove) return;
116
92
  var clientY = mouseMoveEvent.clientY;
117
93
  var tableBodyClientRect = tableBody.getBoundingClientRect();
118
94
  var top = tableBodyClientRect.top,
119
- height = tableBodyClientRect.height;
120
-
95
+ height = tableBodyClientRect.height;
121
96
  if (clientY + SCROLL_OFFSET >= top + height) {
122
97
  pipeline.ref.current.domHelper.tableBody.scrollTop += SCROLL_OFFSET;
123
98
  }
124
-
125
99
  if (clientY + SCROLL_OFFSET <= top) {
126
100
  pipeline.ref.current.domHelper.tableBody.scrollTop -= SCROLL_OFFSET;
127
101
  }
128
102
  };
129
-
130
103
  var onMouseDown = function onMouseDown(mouseDownEvent) {
131
104
  var _a;
132
-
133
105
  var startRowInfo = getTargetRowInfo(mouseDownEvent.target, tableBody, dataSource);
134
106
  var endRowInfo = startRowInfo;
135
107
  if (!startRowInfo || startRowInfo.code !== rowDragColumn.code) return;
136
- if ((_a = opt === null || opt === void 0 ? void 0 : opt.isDisabled) === null || _a === void 0 ? void 0 : _a.call(opt, startRowInfo.row, startRowInfo.rowIndex)) return; // 默认拖拽插入的位置是向下
137
-
108
+ if ((_a = opt === null || opt === void 0 ? void 0 : opt.isDisabled) === null || _a === void 0 ? void 0 : _a.call(opt, startRowInfo.row, startRowInfo.rowIndex)) return;
109
+ // 默认拖拽插入的位置是向下
138
110
  var dragPosition = 'bottom';
139
111
  var isOutOfRange = false;
140
112
  var isValidDrag = false;
@@ -144,12 +116,12 @@ function rowDrag(opt) {
144
116
  });
145
117
  handleDragStrat(dragStartEvent);
146
118
  var tableWidth = tableBody.clientWidth;
147
- var startRowRects = startRowInfo.cell.getBoundingClientRect(); // 光标位置距离初始拖拽行的偏移量
148
-
119
+ var startRowRects = startRowInfo.cell.getBoundingClientRect();
120
+ // 光标位置距离初始拖拽行的偏移量
149
121
  var mouseDownClientY = mouseDownEvent.clientY;
150
122
  var startOffset = mouseDownEvent.clientY - startRowRects.top;
151
- var dragElement = createDragElement(startRowRects, tableWidth, rowHeight); // 可拖拽的范围
152
-
123
+ var dragElement = createDragElement(startRowRects, tableWidth, rowHeight);
124
+ // 可拖拽的范围
153
125
  var dragRange = getDragRange(tableBody, {
154
126
  startOffset: startOffset,
155
127
  rowHeight: rowHeight
@@ -160,7 +132,6 @@ function rowDrag(opt) {
160
132
  };
161
133
  var mousemove$ = (0, _rxjs.fromEvent)(window, 'mousemove');
162
134
  var mouseup$ = (0, _rxjs.fromEvent)(window, 'mouseup');
163
-
164
135
  var scrollCallback = function scrollCallback(event) {
165
136
  // 在当前表格内滚动不处理
166
137
  if (event.target === tableBody) return;
@@ -171,27 +142,23 @@ function rowDrag(opt) {
171
142
  var isOutOfRange = isOutOfDragRange(mousePosition, dragRange);
172
143
  updateCurSorStyle(isOutOfRange);
173
144
  };
174
-
175
145
  document.addEventListener('scroll', scrollCallback, true);
176
146
  var rowDrag$ = mousemove$.pipe((0, _filterInstanceProperty(_operators))(function (mouseMoveEvent) {
177
- var mouseMoveClientY = mouseMoveEvent.clientY; // 上下移动偏移量大于5才是有效的拖拽
178
-
147
+ var mouseMoveClientY = mouseMoveEvent.clientY;
148
+ // 上下移动偏移量大于5才是有效的拖拽
179
149
  if (Math.abs(mouseMoveClientY - mouseDownClientY) > 5) {
180
150
  isValidDrag = true;
181
151
  }
182
-
183
152
  return isValidDrag;
184
153
  }), (0, _mapInstanceProperty(_operators))(function (mouseMoveEvent) {
185
154
  var clientX = mouseMoveEvent.clientX,
186
- clientY = mouseMoveEvent.clientY;
155
+ clientY = mouseMoveEvent.clientY;
187
156
  var tagretRow = getTargetRowInfo(mouseMoveEvent.target, tableBody, dataSource);
188
-
189
157
  if (tagretRow) {
190
158
  endRowInfo = tagretRow;
191
159
  }
192
-
193
- var targetRowRects = endRowInfo.cell.getBoundingClientRect(); // 判断拖拽插入的位置,拖拽框上边框位于目标行之上则向上插入,否则向下插入
194
-
160
+ var targetRowRects = endRowInfo.cell.getBoundingClientRect();
161
+ // 判断拖拽插入的位置,拖拽框上边框位于目标行之上则向上插入,否则向下插入
195
162
  var isMoveToTop = clientY - startOffset < targetRowRects.top;
196
163
  dragPosition = isMoveToTop ? 'top' : 'bottom';
197
164
  isOutOfRange = isOutOfDragRange({
@@ -203,7 +170,6 @@ function rowDrag(opt) {
203
170
  y: clientY
204
171
  };
205
172
  updateScrollPosition(mouseMoveEvent); // 拖拽到底时让滚动条可以滚动
206
-
207
173
  updateDragElementPosition(dragElement, dragRange, {
208
174
  x: clientX,
209
175
  y: clientY,
@@ -219,8 +185,8 @@ function rowDrag(opt) {
219
185
  rowDrag$.subscribe({
220
186
  next: function next(_ref2) {
221
187
  var startRowInfo = _ref2.startRowInfo,
222
- endRowInfo = _ref2.endRowInfo,
223
- dragPosition = _ref2.dragPosition;
188
+ endRowInfo = _ref2.endRowInfo,
189
+ dragPosition = _ref2.dragPosition;
224
190
  var dragMoveEvent = getDragEvent(startRowInfo, endRowInfo, {
225
191
  isFinished: false,
226
192
  dragPosition: dragPosition
@@ -240,7 +206,6 @@ function rowDrag(opt) {
240
206
  }
241
207
  });
242
208
  };
243
-
244
209
  var rowDragColumn = (opt === null || opt === void 0 ? void 0 : opt.rowDragColumn) || defaultRowDragColumn;
245
210
  pipeline.setFeatureOptions('rowDragColumnKey', rowDragColumn.code);
246
211
  var nextColumns = (0, _slice.default)(_context = pipeline.getColumns()).call(_context);
@@ -250,16 +215,14 @@ function rowDrag(opt) {
250
215
  onMouseDown: onMouseDown
251
216
  });
252
217
  pipeline.appendRowPropsGetter(function (row, rowIndex) {
253
- var _cx;
254
-
255
218
  var rowDragEvent = pipeline.getStateAtKey(rowDragKey) || {};
256
219
  var startRowIndex = rowDragEvent.startRowIndex,
257
- endRowIndex = rowDragEvent.endRowIndex,
258
- isFinished = rowDragEvent.isFinished,
259
- dragPosition = rowDragEvent.dragPosition;
220
+ endRowIndex = rowDragEvent.endRowIndex,
221
+ isFinished = rowDragEvent.isFinished,
222
+ dragPosition = rowDragEvent.dragPosition;
260
223
  var isFooterCell = row[pipeline.getFeatureOptions('footerRowMetaKey')];
261
224
  if (isFooterCell || isFinished || rowIndex !== startRowIndex && rowIndex !== endRowIndex) return;
262
- var className = (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragStart, rowIndex === startRowIndex), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEnd, rowIndex === endRowIndex), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEndToTop, rowIndex === endRowIndex && dragPosition === 'top'), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEndToBottom, rowIndex === endRowIndex && dragPosition === 'bottom'), _cx));
225
+ var className = (0, _classnames.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _styles.Classes.rowDragStart, rowIndex === startRowIndex), _styles.Classes.rowDragEnd, rowIndex === endRowIndex), _styles.Classes.rowDragEndToTop, rowIndex === endRowIndex && dragPosition === 'top'), _styles.Classes.rowDragEndToBottom, rowIndex === endRowIndex && dragPosition === 'bottom'));
263
226
  return {
264
227
  className: className
265
228
  };
@@ -267,7 +230,6 @@ function rowDrag(opt) {
267
230
  return pipeline;
268
231
  };
269
232
  }
270
-
271
233
  function getTargetRowInfo(target, tableBody, record) {
272
234
  while (target && tableBody.contains(target)) {
273
235
  if (target.getAttribute('data-role') === 'table-cell') {
@@ -283,41 +245,33 @@ function getTargetRowInfo(target, tableBody, record) {
283
245
  cell: target
284
246
  };
285
247
  }
286
-
287
248
  target = target.parentElement;
288
249
  }
289
-
290
250
  return null;
291
251
  }
292
-
293
252
  function isEleInFooter(target) {
294
253
  while (target && !target.classList.contains(_styles.Classes.artTable)) {
295
254
  if (target.classList.contains(_styles.Classes.tableFooter)) {
296
255
  return true;
297
256
  }
298
-
299
257
  target = target.parentElement;
300
258
  }
301
-
302
259
  return false;
303
260
  }
304
-
305
261
  function createDragElement(rects, tableWidth, rowHeight) {
306
262
  var _context2, _context3, _context4;
307
-
308
263
  var x = rects.x,
309
- y = rects.y;
264
+ y = rects.y;
310
265
  var dragMoveElement = document.createElement('div');
311
266
  dragMoveElement.className = (0, _classnames.default)(_styles.Classes.rowDragElement);
312
267
  dragMoveElement.style.cssText = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "position:fixed;z-index:9999;left:".concat(x, "px;top:")).call(_context4, y, "px;pointer-events:none;width:")).call(_context3, tableWidth, "px;height:")).call(_context2, rowHeight, "px;background:var(--primary-color);opacity: 0.1;");
313
268
  document.body.appendChild(dragMoveElement);
314
269
  return dragMoveElement;
315
270
  }
316
-
317
271
  function updateDragElementPosition(element, dragRange, _ref3) {
318
272
  var x = _ref3.x,
319
- y = _ref3.y,
320
- startOffset = _ref3.startOffset;
273
+ y = _ref3.y,
274
+ startOffset = _ref3.startOffset;
321
275
  var validPosition = getValidPosition({
322
276
  x: x,
323
277
  y: y
@@ -325,11 +279,9 @@ function updateDragElementPosition(element, dragRange, _ref3) {
325
279
  element.style.top = validPosition.y - startOffset + 'px';
326
280
  return element;
327
281
  }
328
-
329
282
  function removeDragElement(element) {
330
283
  document.body.removeChild(element);
331
284
  }
332
-
333
285
  function updateCurSorStyle(isOutOfRange) {
334
286
  if (isOutOfRange) {
335
287
  document.body.style.cursor = 'no-drop';
@@ -337,19 +289,17 @@ function updateCurSorStyle(isOutOfRange) {
337
289
  document.body.style.cursor = 'move';
338
290
  }
339
291
  }
340
-
341
292
  function removeCurSorStyle() {
342
293
  document.body.style.cursor = 'default';
343
294
  }
344
-
345
295
  function getDragRange(tableBody, _ref4) {
346
296
  var startOffset = _ref4.startOffset,
347
- rowHeight = _ref4.rowHeight;
297
+ rowHeight = _ref4.rowHeight;
348
298
  var tableBodyClientRect = tableBody.getBoundingClientRect();
349
299
  var height = tableBodyClientRect.height,
350
- width = tableBodyClientRect.width,
351
- top = tableBodyClientRect.top,
352
- left = tableBodyClientRect.left;
300
+ width = tableBodyClientRect.width,
301
+ top = tableBodyClientRect.top,
302
+ left = tableBodyClientRect.left;
353
303
  return {
354
304
  minX: left,
355
305
  maxX: left + width,
@@ -357,14 +307,13 @@ function getDragRange(tableBody, _ref4) {
357
307
  maxY: top + height + startOffset
358
308
  };
359
309
  }
360
-
361
310
  function getValidPosition(position, dragRange) {
362
311
  var x = position.x,
363
- y = position.y;
312
+ y = position.y;
364
313
  var minX = dragRange.minX,
365
- maxX = dragRange.maxX,
366
- minY = dragRange.minY,
367
- maxY = dragRange.maxY;
314
+ maxX = dragRange.maxX,
315
+ minY = dragRange.minY,
316
+ maxY = dragRange.maxY;
368
317
  var newX = x < minX ? minX : x > maxX ? maxX : x;
369
318
  var newY = y < minY ? minY : y > maxY ? maxY : y;
370
319
  return {
@@ -372,13 +321,12 @@ function getValidPosition(position, dragRange) {
372
321
  y: newY
373
322
  };
374
323
  }
375
-
376
324
  function isOutOfDragRange(position, dragRange) {
377
325
  var x = position.x,
378
- y = position.y;
326
+ y = position.y;
379
327
  var minX = dragRange.minX,
380
- maxX = dragRange.maxX,
381
- minY = dragRange.minY,
382
- maxY = dragRange.maxY;
328
+ maxX = dragRange.maxX,
329
+ minY = dragRange.minY,
330
+ maxY = dragRange.maxY;
383
331
  return x > maxX || x < minX || y > maxY || y < minY;
384
332
  }
File without changes