vxe-table 4.23.4 → 4.23.6

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 (483) hide show
  1. package/dist/all.esm.js +32459 -33908
  2. package/dist/style.css +4501 -1
  3. package/dist/style.mini.css +1 -0
  4. package/es/colgroup/index.d.ts +760 -0
  5. package/es/colgroup/index.js +16 -13
  6. package/es/column/index.d.ts +760 -0
  7. package/es/column/index.js +16 -13
  8. package/es/components.d.ts +9 -0
  9. package/es/components.js +29 -29
  10. package/es/grid/index.d.ts +2824 -0
  11. package/es/grid/index.js +14 -9
  12. package/es/grid/src/emits.d.ts +2 -0
  13. package/es/grid/src/emits.js +18 -15
  14. package/es/grid/src/grid.d.ts +556 -0
  15. package/es/grid/src/grid.js +1695 -1758
  16. package/es/grid/src/props.d.ts +200 -0
  17. package/es/grid/src/props.js +19 -6
  18. package/es/{vxe-grid/style.min.css → grid/style.mini.css} +1 -1
  19. package/es/index.d.ts +3 -0
  20. package/es/index.esm.js +6 -3
  21. package/es/index.js +6 -0
  22. package/es/locale/lang/ar-EG.d.ts +908 -2
  23. package/es/locale/lang/ar-EG.js +906 -903
  24. package/es/locale/lang/de-DE.d.ts +908 -2
  25. package/es/locale/lang/de-DE.js +906 -903
  26. package/es/locale/lang/en-US.d.ts +908 -2
  27. package/es/locale/lang/en-US.js +906 -903
  28. package/es/locale/lang/es-ES.d.ts +908 -2
  29. package/es/locale/lang/es-ES.js +906 -903
  30. package/es/locale/lang/fr-FR.d.ts +908 -2
  31. package/es/locale/lang/fr-FR.js +906 -903
  32. package/es/locale/lang/hu-HU.d.ts +908 -2
  33. package/es/locale/lang/hu-HU.js +906 -903
  34. package/es/locale/lang/hy-AM.d.ts +908 -2
  35. package/es/locale/lang/hy-AM.js +906 -903
  36. package/es/locale/lang/id-ID.d.ts +908 -2
  37. package/es/locale/lang/id-ID.js +906 -903
  38. package/es/locale/lang/it-IT.d.ts +908 -2
  39. package/es/locale/lang/it-IT.js +906 -903
  40. package/es/locale/lang/ja-JP.d.ts +908 -2
  41. package/es/locale/lang/ja-JP.js +906 -903
  42. package/es/locale/lang/ko-KR.d.ts +908 -2
  43. package/es/locale/lang/ko-KR.js +906 -903
  44. package/es/locale/lang/ms-MY.d.ts +908 -2
  45. package/es/locale/lang/ms-MY.js +906 -903
  46. package/es/locale/lang/nb-NO.d.ts +908 -2
  47. package/es/locale/lang/nb-NO.js +906 -903
  48. package/es/locale/lang/pt-BR.d.ts +908 -2
  49. package/es/locale/lang/pt-BR.js +906 -903
  50. package/es/locale/lang/ru-RU.d.ts +908 -2
  51. package/es/locale/lang/ru-RU.js +906 -903
  52. package/es/locale/lang/th-TH.d.ts +908 -2
  53. package/es/locale/lang/th-TH.js +906 -903
  54. package/es/locale/lang/ug-CN.d.ts +908 -2
  55. package/es/locale/lang/ug-CN.js +906 -903
  56. package/es/locale/lang/uk-UA.d.ts +908 -2
  57. package/es/locale/lang/uk-UA.js +906 -903
  58. package/es/locale/lang/uz-UZ.d.ts +908 -2
  59. package/es/locale/lang/uz-UZ.js +906 -903
  60. package/es/locale/lang/vi-VN.d.ts +908 -2
  61. package/es/locale/lang/vi-VN.js +906 -903
  62. package/es/locale/lang/zh-CHT.d.ts +908 -2
  63. package/es/locale/lang/zh-CHT.js +906 -903
  64. package/es/locale/lang/zh-CN.d.ts +908 -2
  65. package/es/locale/lang/zh-CN.js +906 -903
  66. package/es/locale/lang/zh-HK.d.ts +908 -2
  67. package/es/locale/lang/zh-HK.js +910 -2
  68. package/es/locale/lang/zh-MO.d.ts +908 -2
  69. package/es/locale/lang/zh-MO.js +910 -2
  70. package/es/locale/lang/zh-TC.d.ts +908 -0
  71. package/es/locale/lang/zh-TC.js +910 -2
  72. package/es/locale/lang/zh-TW.d.ts +908 -2
  73. package/es/locale/lang/zh-TW.js +910 -2
  74. package/es/table/index.d.ts +2672 -0
  75. package/es/table/index.js +16 -11
  76. package/es/table/module/custom/hook.d.ts +1 -0
  77. package/es/table/module/custom/hook.js +462 -483
  78. package/es/table/module/custom/panel.d.ts +17 -0
  79. package/es/table/module/custom/panel.js +1482 -1559
  80. package/es/table/module/edit/hook.d.ts +1 -0
  81. package/es/table/module/edit/hook.js +1008 -1078
  82. package/es/table/module/export/export-panel.d.ts +27 -0
  83. package/es/table/module/export/export-panel.js +523 -575
  84. package/es/table/module/export/hook.d.ts +1 -0
  85. package/es/table/module/export/hook.js +1805 -1884
  86. package/es/table/module/export/import-panel.d.ts +27 -0
  87. package/es/table/module/export/import-panel.js +244 -252
  88. package/es/table/module/export/util.d.ts +5 -0
  89. package/es/table/module/export/util.js +20 -17
  90. package/es/table/module/filter/hook.d.ts +1 -0
  91. package/es/table/module/filter/hook.js +472 -487
  92. package/es/table/module/filter/panel.d.ts +16 -0
  93. package/es/table/module/filter/panel.js +251 -275
  94. package/es/table/module/keyboard/hook.d.ts +1 -0
  95. package/es/table/module/keyboard/hook.js +445 -497
  96. package/es/table/module/menu/hook.d.ts +1 -0
  97. package/es/table/module/menu/hook.js +295 -315
  98. package/es/table/module/menu/panel.d.ts +2 -0
  99. package/es/table/module/menu/panel.js +164 -183
  100. package/es/table/module/validator/hook.d.ts +1 -0
  101. package/es/table/module/validator/hook.js +522 -571
  102. package/es/table/render/index.d.ts +1 -0
  103. package/es/table/render/index.js +1402 -1362
  104. package/es/table/src/body.d.ts +24 -0
  105. package/es/table/src/body.js +850 -865
  106. package/es/table/src/cell.d.ts +192 -0
  107. package/es/table/src/cell.js +1209 -1207
  108. package/es/table/src/column.d.ts +263 -0
  109. package/es/table/src/column.js +178 -174
  110. package/es/table/src/columnInfo.d.ts +13 -0
  111. package/es/table/src/columnInfo.js +202 -196
  112. package/es/table/src/emits.d.ts +2 -0
  113. package/es/table/src/emits.js +126 -119
  114. package/es/table/src/footer.d.ts +45 -0
  115. package/es/table/src/footer.js +336 -340
  116. package/es/table/src/group.d.ts +178 -0
  117. package/es/table/src/group.js +49 -46
  118. package/es/table/src/header.d.ts +26 -0
  119. package/es/table/src/header.js +517 -519
  120. package/es/table/src/props.d.ts +238 -0
  121. package/es/table/src/props.js +331 -328
  122. package/es/table/src/store.d.ts +6 -0
  123. package/es/table/src/store.js +9 -6
  124. package/es/table/src/table.d.ts +539 -0
  125. package/es/table/src/table.js +14064 -15041
  126. package/es/table/src/use/cell-view.d.ts +10 -0
  127. package/es/table/src/use/cell-view.js +36 -33
  128. package/es/table/src/use/index.d.ts +1 -0
  129. package/es/table/src/use/index.js +1 -1
  130. package/es/table/src/util.d.ts +74 -0
  131. package/es/table/src/util.js +1038 -1026
  132. package/es/table/style.css +1 -1
  133. package/es/table/style.mini.css +1 -0
  134. package/es/toolbar/index.d.ts +340 -0
  135. package/es/toolbar/index.js +14 -9
  136. package/es/toolbar/src/toolbar.d.ts +75 -0
  137. package/es/toolbar/src/toolbar.js +605 -613
  138. package/es/toolbar/{style.min.css → style.mini.css} +1 -1
  139. package/es/ui/index.d.ts +86 -0
  140. package/es/ui/index.js +457 -501
  141. package/es/ui/src/anime.d.ts +10 -0
  142. package/es/ui/src/anime.js +40 -40
  143. package/es/ui/src/comp.d.ts +2 -0
  144. package/es/ui/src/comp.js +5 -2
  145. package/es/ui/src/dom.d.ts +80 -0
  146. package/es/ui/src/dom.js +377 -380
  147. package/es/ui/src/log.d.ts +6 -0
  148. package/es/ui/src/log.js +18 -13
  149. package/es/ui/src/utils.d.ts +23 -0
  150. package/es/ui/src/utils.js +57 -53
  151. package/es/ui/src/vn.d.ts +7 -0
  152. package/es/ui/src/vn.js +49 -42
  153. package/es/v-x-e-table/index.d.ts +3 -0
  154. package/es/v-x-e-table/index.js +6 -3
  155. package/es/vxe-colgroup/index.d.ts +3 -0
  156. package/es/vxe-colgroup/index.js +6 -3
  157. package/es/vxe-column/index.d.ts +3 -0
  158. package/es/vxe-column/index.js +6 -3
  159. package/es/vxe-grid/index.d.ts +3 -0
  160. package/es/vxe-grid/index.js +6 -3
  161. package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
  162. package/es/vxe-table/index.d.ts +3 -0
  163. package/es/vxe-table/index.js +6 -3
  164. package/es/vxe-table/style.css +1 -1
  165. package/es/vxe-table/style.mini.css +1 -0
  166. package/es/vxe-toolbar/index.d.ts +3 -0
  167. package/es/vxe-toolbar/index.js +6 -3
  168. package/es/vxe-toolbar/{style.min.css → style.mini.css} +1 -1
  169. package/es/vxe-ui/index.d.ts +3 -0
  170. package/es/vxe-ui/index.js +6 -3
  171. package/lib/colgroup/index.js +44 -18
  172. package/lib/colgroup/style/index.js +1 -1
  173. package/lib/column/index.js +44 -18
  174. package/lib/column/style/index.js +1 -1
  175. package/lib/components.js +58 -92
  176. package/lib/grid/index.js +42 -14
  177. package/lib/grid/src/emits.js +37 -6
  178. package/lib/grid/src/grid.js +850 -1195
  179. package/lib/grid/src/props.js +27 -11
  180. package/lib/grid/style/index.js +1 -1
  181. package/lib/{vxe-grid/style/style.min.css → grid/style/style.mini.css} +1 -1
  182. package/lib/iconfont.1792977622800.ttf +0 -0
  183. package/lib/iconfont.1792977622800.woff +0 -0
  184. package/lib/iconfont.1792977622800.woff2 +0 -0
  185. package/lib/index.common.js +35 -19
  186. package/lib/index.js +37 -0
  187. package/lib/index.umd.js +30586 -24322
  188. package/lib/index.umd.min.js +3 -1
  189. package/lib/locale/ar-EG.umd.js +948 -0
  190. package/lib/locale/de-DE.umd.js +948 -0
  191. package/lib/locale/en-US.umd.js +948 -0
  192. package/lib/locale/es-ES.umd.js +948 -0
  193. package/lib/locale/fr-FR.umd.js +948 -0
  194. package/lib/locale/hu-HU.umd.js +948 -0
  195. package/lib/locale/hy-AM.umd.js +948 -0
  196. package/lib/locale/id-ID.umd.js +948 -0
  197. package/lib/locale/it-IT.umd.js +948 -0
  198. package/lib/locale/ja-JP.umd.js +948 -0
  199. package/lib/locale/ko-KR.umd.js +948 -0
  200. package/lib/locale/lang/ar-EG.js +681 -664
  201. package/lib/locale/lang/ar-EG.umd.js +913 -892
  202. package/lib/locale/lang/de-DE.js +681 -664
  203. package/lib/locale/lang/de-DE.umd.js +913 -892
  204. package/lib/locale/lang/en-US.js +678 -661
  205. package/lib/locale/lang/en-US.umd.js +913 -892
  206. package/lib/locale/lang/es-ES.js +681 -664
  207. package/lib/locale/lang/es-ES.umd.js +913 -892
  208. package/lib/locale/lang/fr-FR.js +654 -637
  209. package/lib/locale/lang/fr-FR.umd.js +913 -892
  210. package/lib/locale/lang/hu-HU.js +681 -664
  211. package/lib/locale/lang/hu-HU.umd.js +913 -892
  212. package/lib/locale/lang/hy-AM.js +681 -664
  213. package/lib/locale/lang/hy-AM.umd.js +913 -892
  214. package/lib/locale/lang/id-ID.js +681 -664
  215. package/lib/locale/lang/id-ID.umd.js +913 -892
  216. package/lib/locale/lang/it-IT.js +661 -644
  217. package/lib/locale/lang/it-IT.umd.js +912 -891
  218. package/lib/locale/lang/ja-JP.js +710 -693
  219. package/lib/locale/lang/ja-JP.umd.js +913 -892
  220. package/lib/locale/lang/ko-KR.js +681 -664
  221. package/lib/locale/lang/ko-KR.umd.js +913 -892
  222. package/lib/locale/lang/ms-MY.js +681 -664
  223. package/lib/locale/lang/ms-MY.umd.js +913 -892
  224. package/lib/locale/lang/nb-NO.js +681 -664
  225. package/lib/locale/lang/nb-NO.umd.js +913 -892
  226. package/lib/locale/lang/pt-BR.js +681 -664
  227. package/lib/locale/lang/pt-BR.umd.js +913 -892
  228. package/lib/locale/lang/ru-RU.js +690 -673
  229. package/lib/locale/lang/ru-RU.umd.js +913 -892
  230. package/lib/locale/lang/th-TH.js +681 -664
  231. package/lib/locale/lang/th-TH.umd.js +913 -892
  232. package/lib/locale/lang/ug-CN.js +681 -664
  233. package/lib/locale/lang/ug-CN.umd.js +913 -892
  234. package/lib/locale/lang/uk-UA.js +674 -657
  235. package/lib/locale/lang/uk-UA.umd.js +913 -892
  236. package/lib/locale/lang/uz-UZ.js +583 -566
  237. package/lib/locale/lang/uz-UZ.umd.js +908 -887
  238. package/lib/locale/lang/vi-VN.js +681 -664
  239. package/lib/locale/lang/vi-VN.umd.js +913 -892
  240. package/lib/locale/lang/zh-CHT.js +681 -664
  241. package/lib/locale/lang/zh-CHT.umd.js +913 -892
  242. package/lib/locale/lang/zh-CN.js +681 -664
  243. package/lib/locale/lang/zh-CN.umd.js +913 -892
  244. package/lib/locale/lang/zh-HK.js +928 -7
  245. package/lib/locale/lang/zh-HK.umd.js +945 -20
  246. package/lib/locale/lang/zh-MO.js +928 -7
  247. package/lib/locale/lang/zh-MO.umd.js +945 -20
  248. package/lib/locale/lang/zh-TC.js +928 -7
  249. package/lib/locale/lang/zh-TC.umd.js +948 -0
  250. package/lib/locale/lang/zh-TW.js +928 -7
  251. package/lib/locale/lang/zh-TW.umd.js +945 -20
  252. package/lib/locale/ms-MY.umd.js +948 -0
  253. package/lib/locale/nb-NO.umd.js +948 -0
  254. package/lib/locale/pt-BR.umd.js +948 -0
  255. package/lib/locale/ru-RU.umd.js +948 -0
  256. package/lib/locale/th-TH.umd.js +948 -0
  257. package/lib/locale/ug-CN.umd.js +948 -0
  258. package/lib/locale/uk-UA.umd.js +948 -0
  259. package/lib/locale/uz-UZ.umd.js +948 -0
  260. package/lib/locale/vi-VN.umd.js +948 -0
  261. package/lib/locale/zh-CHT.umd.js +948 -0
  262. package/lib/locale/zh-CN.umd.js +948 -0
  263. package/lib/locale/zh-HK.umd.js +948 -0
  264. package/lib/locale/zh-MO.umd.js +948 -0
  265. package/lib/locale/zh-TC.umd.js +948 -0
  266. package/lib/locale/zh-TW.umd.js +948 -0
  267. package/lib/style.css +4501 -1
  268. package/lib/style.mini.css +1 -0
  269. package/lib/table/index.js +45 -17
  270. package/lib/table/module/custom/hook.js +132 -252
  271. package/lib/table/module/custom/panel.js +919 -970
  272. package/lib/table/module/edit/hook.js +250 -620
  273. package/lib/table/module/export/export-panel.js +390 -347
  274. package/lib/table/module/export/hook.js +745 -1179
  275. package/lib/table/module/export/import-panel.js +170 -136
  276. package/lib/table/module/export/util.js +37 -14
  277. package/lib/table/module/filter/hook.js +127 -227
  278. package/lib/table/module/filter/panel.js +177 -208
  279. package/lib/table/module/keyboard/hook.js +93 -172
  280. package/lib/table/module/menu/hook.js +86 -165
  281. package/lib/table/module/menu/panel.js +176 -141
  282. package/lib/table/module/validator/hook.js +164 -271
  283. package/lib/table/render/index.js +700 -1147
  284. package/lib/table/src/body.js +426 -559
  285. package/lib/table/src/cell.js +619 -987
  286. package/lib/table/src/column.js +55 -30
  287. package/lib/table/src/columnInfo.js +88 -110
  288. package/lib/table/src/emits.js +145 -13
  289. package/lib/table/src/footer.js +181 -240
  290. package/lib/table/src/group.js +56 -34
  291. package/lib/table/src/header.js +292 -367
  292. package/lib/table/src/props.js +27 -12
  293. package/lib/table/src/store.js +25 -9
  294. package/lib/table/src/table.js +14179 -1019
  295. package/lib/table/src/use/cell-view.js +47 -37
  296. package/lib/table/src/use/index.js +17 -15
  297. package/lib/table/src/util.js +236 -337
  298. package/lib/table/style/index.js +1 -1
  299. package/lib/table/style/style.css +1 -1
  300. package/lib/table/style/style.mini.css +1 -0
  301. package/lib/toolbar/index.js +42 -14
  302. package/lib/toolbar/src/toolbar.js +271 -379
  303. package/lib/toolbar/style/index.js +1 -1
  304. package/lib/toolbar/style/{style.min.css → style.mini.css} +1 -1
  305. package/lib/ui/index.js +153 -195
  306. package/lib/ui/src/anime.js +49 -29
  307. package/lib/ui/src/comp.js +23 -6
  308. package/lib/ui/src/dom.js +114 -147
  309. package/lib/ui/src/log.js +34 -18
  310. package/lib/ui/src/utils.js +57 -45
  311. package/lib/ui/src/vn.js +60 -34
  312. package/lib/ui/style/index.js +1 -1
  313. package/lib/v-x-e-table/index.js +35 -19
  314. package/lib/vxe-colgroup/index.js +35 -19
  315. package/lib/vxe-colgroup/style/index.js +1 -1
  316. package/lib/vxe-column/index.js +35 -19
  317. package/lib/vxe-column/style/index.js +1 -1
  318. package/lib/vxe-grid/index.js +35 -19
  319. package/lib/vxe-grid/style/index.js +1 -1
  320. package/{es/grid/style.min.css → lib/vxe-grid/style/style.mini.css} +1 -1
  321. package/lib/vxe-table/index.js +35 -19
  322. package/lib/vxe-table/style/index.js +1 -1
  323. package/lib/vxe-table/style/style.css +1 -1
  324. package/lib/vxe-table/style/style.mini.css +1 -0
  325. package/lib/vxe-toolbar/index.js +35 -19
  326. package/lib/vxe-toolbar/style/index.js +1 -1
  327. package/lib/vxe-toolbar/style/{style.min.css → style.mini.css} +1 -1
  328. package/lib/vxe-ui/index.js +35 -19
  329. package/lib/vxe-ui/style/index.js +1 -1
  330. package/package.json +8 -4
  331. package/packages/locale/lang/zh-HK.ts +907 -3
  332. package/packages/locale/lang/zh-MO.ts +907 -3
  333. package/packages/locale/lang/zh-TC.ts +907 -3
  334. package/packages/locale/lang/zh-TW.ts +907 -3
  335. package/packages/table/module/edit/hook.ts +2 -2
  336. package/packages/table/src/table.ts +64 -28
  337. package/packages/ui/index.ts +1 -28
  338. package/dist/style.min.css +0 -1
  339. package/es/index.css +0 -1
  340. package/es/index.min.css +0 -1
  341. package/es/style.css +0 -1
  342. package/es/style.min.css +0 -1
  343. package/es/table/style.min.css +0 -1
  344. package/es/vxe-table/style.min.css +0 -1
  345. package/es/vxe-v-x-e-table/index.js +0 -3
  346. package/lib/colgroup/index.min.js +0 -1
  347. package/lib/column/index.min.js +0 -1
  348. package/lib/components.min.js +0 -1
  349. package/lib/grid/index.min.js +0 -1
  350. package/lib/grid/src/emits.min.js +0 -1
  351. package/lib/grid/src/grid.min.js +0 -1
  352. package/lib/grid/src/props.min.js +0 -1
  353. package/lib/index.css +0 -1
  354. package/lib/index.min.css +0 -1
  355. package/lib/locale/lang/ar-EG.d.ts +0 -2
  356. package/lib/locale/lang/ar-EG.min.js +0 -1
  357. package/lib/locale/lang/de-DE.d.ts +0 -2
  358. package/lib/locale/lang/de-DE.min.js +0 -1
  359. package/lib/locale/lang/en-US.d.ts +0 -2
  360. package/lib/locale/lang/en-US.min.js +0 -1
  361. package/lib/locale/lang/es-ES.d.ts +0 -2
  362. package/lib/locale/lang/es-ES.min.js +0 -1
  363. package/lib/locale/lang/fr-FR.d.ts +0 -2
  364. package/lib/locale/lang/fr-FR.min.js +0 -1
  365. package/lib/locale/lang/hu-HU.d.ts +0 -2
  366. package/lib/locale/lang/hu-HU.min.js +0 -1
  367. package/lib/locale/lang/hy-AM.d.ts +0 -2
  368. package/lib/locale/lang/hy-AM.min.js +0 -1
  369. package/lib/locale/lang/id-ID.d.ts +0 -2
  370. package/lib/locale/lang/id-ID.min.js +0 -1
  371. package/lib/locale/lang/it-IT.d.ts +0 -2
  372. package/lib/locale/lang/it-IT.min.js +0 -1
  373. package/lib/locale/lang/ja-JP.d.ts +0 -2
  374. package/lib/locale/lang/ja-JP.min.js +0 -1
  375. package/lib/locale/lang/ko-KR.d.ts +0 -2
  376. package/lib/locale/lang/ko-KR.min.js +0 -1
  377. package/lib/locale/lang/ms-MY.d.ts +0 -2
  378. package/lib/locale/lang/ms-MY.min.js +0 -1
  379. package/lib/locale/lang/nb-NO.d.ts +0 -2
  380. package/lib/locale/lang/nb-NO.min.js +0 -1
  381. package/lib/locale/lang/pt-BR.d.ts +0 -2
  382. package/lib/locale/lang/pt-BR.min.js +0 -1
  383. package/lib/locale/lang/ru-RU.d.ts +0 -2
  384. package/lib/locale/lang/ru-RU.min.js +0 -1
  385. package/lib/locale/lang/th-TH.d.ts +0 -2
  386. package/lib/locale/lang/th-TH.min.js +0 -1
  387. package/lib/locale/lang/ug-CN.d.ts +0 -2
  388. package/lib/locale/lang/ug-CN.min.js +0 -1
  389. package/lib/locale/lang/uk-UA.d.ts +0 -2
  390. package/lib/locale/lang/uk-UA.min.js +0 -1
  391. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  392. package/lib/locale/lang/uz-UZ.min.js +0 -1
  393. package/lib/locale/lang/vi-VN.d.ts +0 -2
  394. package/lib/locale/lang/vi-VN.min.js +0 -1
  395. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  396. package/lib/locale/lang/zh-CHT.min.js +0 -1
  397. package/lib/locale/lang/zh-CN.d.ts +0 -2
  398. package/lib/locale/lang/zh-CN.min.js +0 -1
  399. package/lib/locale/lang/zh-HK.d.ts +0 -2
  400. package/lib/locale/lang/zh-HK.min.js +0 -1
  401. package/lib/locale/lang/zh-MO.d.ts +0 -2
  402. package/lib/locale/lang/zh-MO.min.js +0 -1
  403. package/lib/locale/lang/zh-TC.min.js +0 -1
  404. package/lib/locale/lang/zh-TW.d.ts +0 -2
  405. package/lib/locale/lang/zh-TW.min.js +0 -1
  406. package/lib/style.min.css +0 -1
  407. package/lib/table/index.min.js +0 -1
  408. package/lib/table/module/custom/hook.min.js +0 -1
  409. package/lib/table/module/custom/panel.min.js +0 -1
  410. package/lib/table/module/edit/hook.min.js +0 -1
  411. package/lib/table/module/export/export-panel.min.js +0 -1
  412. package/lib/table/module/export/hook.min.js +0 -1
  413. package/lib/table/module/export/import-panel.min.js +0 -1
  414. package/lib/table/module/export/util.min.js +0 -1
  415. package/lib/table/module/filter/hook.min.js +0 -1
  416. package/lib/table/module/filter/panel.min.js +0 -1
  417. package/lib/table/module/keyboard/hook.min.js +0 -1
  418. package/lib/table/module/menu/hook.min.js +0 -1
  419. package/lib/table/module/menu/panel.min.js +0 -1
  420. package/lib/table/module/validator/hook.min.js +0 -1
  421. package/lib/table/render/index.min.js +0 -1
  422. package/lib/table/src/body.min.js +0 -1
  423. package/lib/table/src/cell.min.js +0 -1
  424. package/lib/table/src/column.min.js +0 -1
  425. package/lib/table/src/columnInfo.min.js +0 -1
  426. package/lib/table/src/emits.min.js +0 -1
  427. package/lib/table/src/footer.min.js +0 -1
  428. package/lib/table/src/group.min.js +0 -1
  429. package/lib/table/src/header.min.js +0 -1
  430. package/lib/table/src/props.min.js +0 -1
  431. package/lib/table/src/store.min.js +0 -1
  432. package/lib/table/src/table.min.js +0 -1
  433. package/lib/table/src/use/cell-view.min.js +0 -1
  434. package/lib/table/src/use/index.min.js +0 -1
  435. package/lib/table/src/util.min.js +0 -1
  436. package/lib/table/style/style.min.css +0 -1
  437. package/lib/toolbar/index.min.js +0 -1
  438. package/lib/toolbar/src/toolbar.min.js +0 -1
  439. package/lib/ui/index.min.js +0 -1
  440. package/lib/ui/src/anime.min.js +0 -1
  441. package/lib/ui/src/comp.min.js +0 -1
  442. package/lib/ui/src/dom.min.js +0 -1
  443. package/lib/ui/src/log.min.js +0 -1
  444. package/lib/ui/src/utils.min.js +0 -1
  445. package/lib/ui/src/vn.min.js +0 -1
  446. package/lib/ui/style/style.min.css +0 -0
  447. package/lib/v-x-e-table/index.min.js +0 -1
  448. package/lib/v-x-e-table/style/index.js +0 -1
  449. package/lib/v-x-e-table/style/style.css +0 -0
  450. package/lib/v-x-e-table/style/style.min.css +0 -0
  451. package/lib/vxe-colgroup/index.min.js +0 -1
  452. package/lib/vxe-colgroup/style/style.min.css +0 -0
  453. package/lib/vxe-column/index.min.js +0 -1
  454. package/lib/vxe-column/style/style.min.css +0 -0
  455. package/lib/vxe-grid/index.min.js +0 -1
  456. package/lib/vxe-table/index.min.js +0 -1
  457. package/lib/vxe-table/style/style.min.css +0 -1
  458. package/lib/vxe-toolbar/index.min.js +0 -1
  459. package/lib/vxe-ui/index.min.js +0 -1
  460. package/lib/vxe-ui/style/style.min.css +0 -0
  461. package/lib/vxe-v-x-e-table/index.js +0 -21
  462. package/lib/vxe-v-x-e-table/index.min.js +0 -1
  463. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  464. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  465. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
  466. /package/{es/iconfont.1792740941484.ttf → dist/iconfont.1792977622800.ttf} +0 -0
  467. /package/{es/iconfont.1792740941484.woff → dist/iconfont.1792977622800.woff} +0 -0
  468. /package/{es/iconfont.1792740941484.woff2 → dist/iconfont.1792977622800.woff2} +0 -0
  469. /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
  470. /package/es/column/{style.min.css → style.mini.css} +0 -0
  471. /package/{lib/iconfont.1792740941484.ttf → es/iconfont.1792977622800.ttf} +0 -0
  472. /package/{lib/iconfont.1792740941484.woff → es/iconfont.1792977622800.woff} +0 -0
  473. /package/{lib/iconfont.1792740941484.woff2 → es/iconfont.1792977622800.woff2} +0 -0
  474. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  475. /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
  476. /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
  477. /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
  478. /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
  479. /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
  480. /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
  481. /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
  482. /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
  483. /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
@@ -1,1104 +1,1116 @@
1
- import { watch, reactive } from 'vue';
2
- import XEUtils from 'xe-utils';
3
- import { ColumnInfo } from './columnInfo';
4
- import { isPx, isScale, queryElement } from '../../ui/src/dom';
5
- import { eqEmptyValue, hasEnableConf } from '../../ui/src/utils';
6
- export function createInternalData() {
7
- return {
8
- tZindex: 0,
9
- currKeyField: '',
10
- isCurrDeepKey: false,
11
- elemStore: {},
12
- // 存放横向 X 虚拟滚动相关的信息
13
- scrollXStore: {
14
- preloadSize: 0,
15
- offsetSize: 0,
16
- visibleSize: 0,
17
- visibleStartIndex: 0,
18
- visibleEndIndex: 0,
19
- startIndex: 0,
20
- endIndex: 0
21
- },
22
- // 存放纵向 Y 虚拟滚动相关信息
23
- scrollYStore: {
24
- preloadSize: 0,
25
- offsetSize: 0,
26
- visibleSize: 0,
27
- visibleStartIndex: 0,
28
- visibleEndIndex: 0,
29
- startIndex: 0,
30
- endIndex: 0
31
- },
32
- // 表格宽度
33
- tableWidth: 0,
34
- // 表格高度
35
- tableHeight: 0,
36
- customHeight: 0,
37
- customMinHeight: 0,
38
- customMaxHeight: 0,
39
- // 当前 hover 行
40
- hoverRow: null,
41
- hoverCol: null,
42
- // 当前行
43
- currentRow: null,
44
- currentCol: null,
45
- // resizeObserver: undefined,
46
- // 滚动条
47
- // scrollObserver: undefined,
48
- // isThumbDrag: false,
49
- thumbDragOffset: 0,
50
- yThumbTop: 0,
51
- xThumbLeft: 0,
52
- lastScrollTop: 0,
53
- lastScrollLeft: 0,
54
- // 单选框属性,已选中保留的行
55
- radioReserveRow: null,
56
- // 复选框属性,已选中保留的行集合
57
- checkboxReserveRowMap: {},
58
- // 行数据,已展开保留的行集合
59
- rowExpandedReserveRowMap: {},
60
- // 树结构数据,已展开保留的行集合
61
- treeExpandedReserveRowMap: {},
62
- // 树结构数据,不确定状态的集合
63
- treeIndeterminateRowMaps: {},
64
- // 列表完整数据、条件处理后
65
- tableFullData: [],
66
- afterFullData: [],
67
- afterTreeFullData: [],
68
- afterGroupFullData: [],
69
- // 列表条件处理后数据集合
70
- afterFullRowMaps: {},
71
- // 树结构完整数据、条件处理后
72
- tableFullTreeData: [],
73
- // 行分组全量数据、条件处理后
74
- tableFullGroupData: [],
75
- tableSynchData: [],
76
- tableSourceData: [],
77
- // 收集的列配置(带分组)
78
- collectColumn: [],
79
- // 完整所有列(不带分组)
80
- tableFullColumn: [],
81
- // 渲染所有列
82
- visibleColumn: [],
83
- // 全量数据集(包括当前和已删除)
84
- fullAllDataRowIdData: {},
85
- // 数据集(仅当前)
86
- fullDataRowIdData: {},
87
- // 数据集(仅可视)
88
- visibleDataRowIdData: {},
89
- keepUpdateFieldMaps: {},
90
- headerFullDataColData: {},
91
- footerFullDataRowData: {},
92
- // 渲染中缓存数据
93
- sourceDataRowIdData: {},
94
- fullColumnIdData: {},
95
- fullColumnFieldData: {},
96
- fullCellHeightMaps: {},
97
- fullCellStoreMaps: {},
98
- // 合并表头单元格的数据
99
- mergeHeaderList: [],
100
- mergeHeaderMaps: {},
101
- // 已合并单元格数据集合
102
- mergeHeaderCellMaps: {},
103
- mergeHeaderRowMaps: {},
104
- mergeHeaderColMaps: {},
105
- // 合并单元格的数据
106
- mergeBodyList: [],
107
- mergeBodyMaps: {},
108
- // 已合并单元格数据集合
109
- mergeBodyCellMaps: {},
110
- mergeBodyRowMaps: {},
111
- mergeBodyColMaps: {},
112
- // 合并表尾的数据
113
- mergeFooterList: [],
114
- mergeFooterMaps: {},
115
- // 已合并表尾数据集合
116
- mergeFooterCellMaps: {},
117
- mergeFooterRowMaps: {},
118
- mergeFooterColMaps: {},
119
- // 已展开的行集合
120
- rowExpandedMaps: {},
121
- // 懒加载中的展开行的集合
122
- rowExpandLazyLoadedMaps: {},
123
- // 已展开的分组行
124
- rowGroupExpandedMaps: {},
125
- // 已展开树节点集合
126
- treeExpandedMaps: {},
127
- // 懒加载中的树节点的集合
128
- treeExpandLazyLoadedMaps: {},
129
- // 复选框属性,已选中的行集合
130
- selectCheckboxMaps: {},
131
- // 已标记的对象集
132
- pendingRowMaps: {},
133
- // 已新增的临时行
134
- insertRowMaps: {},
135
- // 已删除行
136
- removeRowMaps: {},
137
- cvCacheMaps: {},
138
- // 表头高度
139
- tHeaderHeight: 0,
140
- // 表体高度
141
- tBodyHeight: 0,
142
- // 表尾高度
143
- tFooterHeight: 0,
144
- stackHistoryStore: {
145
- undoStacks: [],
146
- redoStacks: []
147
- },
148
- teleportToWrapperElem: null,
149
- popupToWrapperElem: null,
150
- customPopupToElem: null,
151
- lastSTime: 0,
152
- // isCustomDragStatus: false,
153
- inited: false,
154
- tooltipTimeout: null,
155
- initStatus: false,
156
- isActivated: false,
157
- // keyCtxTimeout: undefined,
158
- // 刷新布局
159
- // rceTimeout: undefined,
160
- // rceRunTime: undefined,
161
- rceDelay: 0
162
- // rsePending: false,
163
- // 滚动属性
164
- // intoRunScroll: false,
165
- // inVirtualScroll: false,
166
- // inWheelScroll: false,
167
- // inHeaderScroll: false,
168
- // inBodyScroll: false,
169
- // inFooterScroll: false,
170
- // scrollRenderType?: '',
171
- // isSyncGanttScrollTop: false,
172
- // 同步滚动
173
- // lcsTimeout: undefined,
174
- // lcsRunTime: undefined,
175
- // 横向虚拟
176
- // lxRunTime: undefined,
177
- // lxTimeout: undefined,
178
- // 纵向虚拟
179
- // lyRunTime: undefined,
180
- // lyTimeout: undefined,
181
- // 动态高度
182
- // chRunTime: undefined,
183
- // chTimeout: undefined,
184
- // isResizeCellHeight: false,
185
- // _sToTime: null
186
- };
1
+ import { watch, reactive } from "vue";
2
+ import XEUtils from "xe-utils";
3
+ import { ColumnInfo } from "./columnInfo";
4
+ import { isPx, isScale, queryElement } from "../../ui/src/dom";
5
+ import { eqEmptyValue, hasEnableConf } from "../../ui/src/utils";
6
+ function createInternalData() {
7
+ return {
8
+ tZindex: 0,
9
+ currKeyField: "",
10
+ isCurrDeepKey: false,
11
+ elemStore: {},
12
+ // 存放横向 X 虚拟滚动相关的信息
13
+ scrollXStore: {
14
+ preloadSize: 0,
15
+ offsetSize: 0,
16
+ visibleSize: 0,
17
+ visibleStartIndex: 0,
18
+ visibleEndIndex: 0,
19
+ startIndex: 0,
20
+ endIndex: 0
21
+ },
22
+ // 存放纵向 Y 虚拟滚动相关信息
23
+ scrollYStore: {
24
+ preloadSize: 0,
25
+ offsetSize: 0,
26
+ visibleSize: 0,
27
+ visibleStartIndex: 0,
28
+ visibleEndIndex: 0,
29
+ startIndex: 0,
30
+ endIndex: 0
31
+ },
32
+ // 表格宽度
33
+ tableWidth: 0,
34
+ // 表格高度
35
+ tableHeight: 0,
36
+ customHeight: 0,
37
+ customMinHeight: 0,
38
+ customMaxHeight: 0,
39
+ // 当前 hover 行
40
+ hoverRow: null,
41
+ hoverCol: null,
42
+ // 当前行
43
+ currentRow: null,
44
+ currentCol: null,
45
+ // resizeObserver: undefined,
46
+ // 滚动条
47
+ // scrollObserver: undefined,
48
+ // isThumbDrag: false,
49
+ thumbDragOffset: 0,
50
+ yThumbTop: 0,
51
+ xThumbLeft: 0,
52
+ lastScrollTop: 0,
53
+ lastScrollLeft: 0,
54
+ // 单选框属性,已选中保留的行
55
+ radioReserveRow: null,
56
+ // 复选框属性,已选中保留的行集合
57
+ checkboxReserveRowMap: {},
58
+ // 行数据,已展开保留的行集合
59
+ rowExpandedReserveRowMap: {},
60
+ // 树结构数据,已展开保留的行集合
61
+ treeExpandedReserveRowMap: {},
62
+ // 树结构数据,不确定状态的集合
63
+ treeIndeterminateRowMaps: {},
64
+ // 列表完整数据、条件处理后
65
+ tableFullData: [],
66
+ afterFullData: [],
67
+ afterTreeFullData: [],
68
+ afterGroupFullData: [],
69
+ // 列表条件处理后数据集合
70
+ afterFullRowMaps: {},
71
+ // 树结构完整数据、条件处理后
72
+ tableFullTreeData: [],
73
+ // 行分组全量数据、条件处理后
74
+ tableFullGroupData: [],
75
+ tableSynchData: [],
76
+ tableSourceData: [],
77
+ // 收集的列配置(带分组)
78
+ collectColumn: [],
79
+ // 完整所有列(不带分组)
80
+ tableFullColumn: [],
81
+ // 渲染所有列
82
+ visibleColumn: [],
83
+ // 全量数据集(包括当前和已删除)
84
+ fullAllDataRowIdData: {},
85
+ // 数据集(仅当前)
86
+ fullDataRowIdData: {},
87
+ // 数据集(仅可视)
88
+ visibleDataRowIdData: {},
89
+ keepUpdateFieldMaps: {},
90
+ headerFullDataColData: {},
91
+ footerFullDataRowData: {},
92
+ // 渲染中缓存数据
93
+ sourceDataRowIdData: {},
94
+ fullColumnIdData: {},
95
+ fullColumnFieldData: {},
96
+ fullCellHeightMaps: {},
97
+ fullCellStoreMaps: {},
98
+ // 合并表头单元格的数据
99
+ mergeHeaderList: [],
100
+ mergeHeaderMaps: {},
101
+ // 已合并单元格数据集合
102
+ mergeHeaderCellMaps: {},
103
+ mergeHeaderRowMaps: {},
104
+ mergeHeaderColMaps: {},
105
+ // 合并单元格的数据
106
+ mergeBodyList: [],
107
+ mergeBodyMaps: {},
108
+ // 已合并单元格数据集合
109
+ mergeBodyCellMaps: {},
110
+ mergeBodyRowMaps: {},
111
+ mergeBodyColMaps: {},
112
+ // 合并表尾的数据
113
+ mergeFooterList: [],
114
+ mergeFooterMaps: {},
115
+ // 已合并表尾数据集合
116
+ mergeFooterCellMaps: {},
117
+ mergeFooterRowMaps: {},
118
+ mergeFooterColMaps: {},
119
+ // 已展开的行集合
120
+ rowExpandedMaps: {},
121
+ // 懒加载中的展开行的集合
122
+ rowExpandLazyLoadedMaps: {},
123
+ // 已展开的分组行
124
+ rowGroupExpandedMaps: {},
125
+ // 已展开树节点集合
126
+ treeExpandedMaps: {},
127
+ // 懒加载中的树节点的集合
128
+ treeExpandLazyLoadedMaps: {},
129
+ // 复选框属性,已选中的行集合
130
+ selectCheckboxMaps: {},
131
+ // 已标记的对象集
132
+ pendingRowMaps: {},
133
+ // 已新增的临时行
134
+ insertRowMaps: {},
135
+ // 已删除行
136
+ removeRowMaps: {},
137
+ cvCacheMaps: {},
138
+ // 表头高度
139
+ tHeaderHeight: 0,
140
+ // 表体高度
141
+ tBodyHeight: 0,
142
+ // 表尾高度
143
+ tFooterHeight: 0,
144
+ stackHistoryStore: {
145
+ undoStacks: [],
146
+ redoStacks: []
147
+ },
148
+ teleportToWrapperElem: null,
149
+ popupToWrapperElem: null,
150
+ customPopupToElem: null,
151
+ lastSTime: 0,
152
+ // isCustomDragStatus: false,
153
+ inited: false,
154
+ tooltipTimeout: null,
155
+ initStatus: false,
156
+ isActivated: false,
157
+ // keyCtxTimeout: undefined,
158
+ // 刷新布局
159
+ // rceTimeout: undefined,
160
+ // rceRunTime: undefined,
161
+ rceDelay: 0
162
+ // rsePending: false,
163
+ // 滚动属性
164
+ // intoRunScroll: false,
165
+ // inVirtualScroll: false,
166
+ // inWheelScroll: false,
167
+ // inHeaderScroll: false,
168
+ // inBodyScroll: false,
169
+ // inFooterScroll: false,
170
+ // scrollRenderType?: '',
171
+ // isSyncGanttScrollTop: false,
172
+ // 同步滚动
173
+ // lcsTimeout: undefined,
174
+ // lcsRunTime: undefined,
175
+ // 横向虚拟
176
+ // lxRunTime: undefined,
177
+ // lxTimeout: undefined,
178
+ // 纵向虚拟
179
+ // lyRunTime: undefined,
180
+ // lyTimeout: undefined,
181
+ // 动态高度
182
+ // chRunTime: undefined,
183
+ // chTimeout: undefined,
184
+ // isResizeCellHeight: false,
185
+ // _sToTime: null
186
+ };
187
187
  }
188
- export function createReactData() {
189
- return {
190
- updateColFlag: 0,
191
- // 低性能的静态列
192
- staticColumns: [],
193
- // 渲染的列分组
194
- tableGroupColumn: [],
195
- // 可视区渲染的列
196
- tableColumn: [],
197
- // 渲染中的数据
198
- tableData: [],
199
- // 是否启用了横向 X 可视渲染方式加载
200
- scrollXLoad: false,
201
- // 是否启用了纵向 Y 可视渲染方式加载
202
- scrollYLoad: false,
203
- // 是否存在纵向滚动条
204
- overflowY: true,
205
- // 是否存在横向滚动条
206
- overflowX: false,
207
- // 纵向滚动条的宽度
208
- scrollbarWidth: 0,
209
- // 横向滚动条的高度
210
- scrollbarHeight: 0,
211
- // 滚动条
212
- yThumbHeight: 0,
213
- xThumbWidth: 0,
214
- // 行高
215
- rowHeight: 0,
216
- // 表格父容器的高度
217
- parentHeight: 0,
218
- // 是否使用分组表头
219
- isGroup: false,
220
- isAllOverflow: false,
221
- // 复选框属性,是否全选
222
- isAllSelected: false,
223
- // 复选框属性,有选中且非全选状态
224
- isIndeterminate: false,
225
- // 单选框属性,选中行
226
- selectRadioRow: null,
227
- // 表尾合计数据
228
- footerTableData: [],
229
- // 行分组列信息
230
- rowGroupColumn: null,
231
- // 展开列信息
232
- expandColumn: null,
233
- checkboxColumn: null,
234
- radioColumn: null,
235
- // 树节点列信息
236
- treeNodeColumn: null,
237
- hasFixedColumn: false,
238
- // 刷新列标识,当列筛选被改变时,触发表格刷新数据
239
- upDataFlag: 0,
240
- // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
241
- reColumnFlag: 0,
242
- // 初始化标识
243
- initStore: {
244
- filter: false,
245
- import: false,
246
- export: false,
247
- custom: false
248
- },
249
- // 自定义列相关的信息
250
- customStore: {
251
- btnEl: null,
252
- isAll: false,
253
- isIndeterminate: false,
254
- activeBtn: false,
255
- activeWrapper: false,
256
- visible: false,
257
- maxHeight: null,
258
- defPopupStyle: {},
259
- panePopupStyle: {},
260
- oldSortMaps: {},
261
- oldFixedMaps: {},
262
- oldVisibleMaps: {}
263
- },
264
- customColumnList: [],
265
- // 当前选中的筛选列
266
- filterStore: {
267
- targetEl: null,
268
- isAllSelected: false,
269
- isIndeterminate: false,
270
- style: null,
271
- column: null,
272
- visible: false
273
- },
274
- // 存放列相关的信息
275
- columnStore: {
276
- leftList: [],
277
- centerList: [],
278
- rightList: [],
279
- resizeList: [],
280
- pxList: [],
281
- pxMinList: [],
282
- autoMinList: [],
283
- scaleList: [],
284
- scaleMinList: [],
285
- autoList: [],
286
- remainList: []
287
- },
288
- // 存放快捷菜单的信息
289
- ctxMenuStore: {
290
- selected: null,
291
- visible: false,
292
- showChild: false,
293
- selectChild: null,
294
- list: [],
295
- style: null
296
- },
297
- // 存放可编辑相关信息
298
- editStore: {
299
- indexs: {
300
- columns: []
301
- },
302
- titles: {
303
- columns: []
304
- },
305
- // 选中源
306
- selected: {
307
- row: null,
308
- column: null
309
- },
310
- // 已复制源
311
- copyed: {
312
- cut: false,
313
- rows: [],
314
- columns: []
315
- },
316
- // 激活
317
- actived: {
318
- row: null,
319
- column: null
320
- },
321
- // 当前被强制聚焦单元格,只会在鼠标点击后算聚焦
322
- focused: {
323
- row: null,
324
- column: null
325
- }
326
- },
327
- // 存放 tooltip 相关信息
328
- tooltipStore: {
329
- row: null,
330
- column: null,
331
- content: '',
332
- visible: false,
333
- type: null,
334
- currOpts: {}
335
- },
336
- // 存放数据校验相关信息
337
- validStore: {
338
- visible: false
339
- },
340
- validErrorMaps: {},
341
- // 导入相关信息
342
- importStore: {
343
- inited: false,
344
- file: null,
345
- type: '',
346
- modeList: [],
347
- typeList: [],
348
- filename: '',
349
- visible: false
350
- },
351
- importParams: {
352
- mode: '',
353
- types: null,
354
- message: true
355
- },
356
- // 导出相关信息
357
- exportStore: {
358
- inited: false,
359
- name: '',
360
- modeList: [],
361
- typeList: [],
362
- columns: [],
363
- isPrint: false,
364
- hasFooter: false,
365
- hasMerge: false,
366
- hasTree: false,
367
- hasRowGroup: false,
368
- hasColgroup: false,
369
- visible: false
370
- },
371
- exportParams: {
372
- filename: '',
373
- sheetName: '',
374
- mode: '',
375
- type: '',
376
- isColgroup: false,
377
- isMerge: false,
378
- isTreeAllExpanded: false,
379
- isRowGroupAllExpanded: false,
380
- useStyle: false,
381
- original: false,
382
- message: true,
383
- isHeader: false,
384
- isTitle: false,
385
- isFooter: false
386
- },
387
- visiblwRowsFlag: 1,
388
- isRowGroupStatus: false,
389
- rowGroupList: [],
390
- aggHandleFields: [],
391
- aggHandleAggColumns: [],
392
- rowGroupExpandedFlag: 1,
393
- rowExpandedFlag: 1,
394
- treeExpandedFlag: 1,
395
- updateCheckboxFlag: 1,
396
- pendingRowFlag: 1,
397
- insertRowFlag: 1,
398
- removeRowFlag: 1,
399
- mergeHeadFlag: 1,
400
- mergeBodyFlag: 1,
401
- mergeFootFlag: 1,
402
- rowHeightStore: {
403
- xlarge: 54,
404
- large: 52,
405
- default: 48,
406
- medium: 44,
407
- small: 40,
408
- mini: 36
409
- },
410
- scrollVMLoading: false,
411
- scrollYHeight: 0,
412
- scrollYTop: 0,
413
- isScrollYBig: false,
414
- scrollXLeft: 0,
415
- scrollXWidth: 0,
416
- isScrollXBig: false,
417
- lazScrollLoading: false,
418
- rowExpandHeightFlag: 1,
419
- calcCellHeightFlag: 1,
420
- resizeHeightFlag: 1,
421
- resizeWidthFlag: 1,
422
- isCustomStatus: false,
423
- isCustomDragStatus: true,
424
- ctPopupFlag: 1,
425
- isCrossDragRow: false,
426
- dragRow: null,
427
- isCrossDragCol: false,
428
- dragCol: null,
429
- dragTipText: '',
430
- isDragResize: false,
431
- isRowLoading: false,
432
- isColLoading: false,
433
- currColFlag: 1
434
- };
188
+ function createReactData() {
189
+ return {
190
+ updateColFlag: 0,
191
+ // 低性能的静态列
192
+ staticColumns: [],
193
+ // 渲染的列分组
194
+ tableGroupColumn: [],
195
+ // 可视区渲染的列
196
+ tableColumn: [],
197
+ // 渲染中的数据
198
+ tableData: [],
199
+ // 是否启用了横向 X 可视渲染方式加载
200
+ scrollXLoad: false,
201
+ // 是否启用了纵向 Y 可视渲染方式加载
202
+ scrollYLoad: false,
203
+ // 是否存在纵向滚动条
204
+ overflowY: true,
205
+ // 是否存在横向滚动条
206
+ overflowX: false,
207
+ // 纵向滚动条的宽度
208
+ scrollbarWidth: 0,
209
+ // 横向滚动条的高度
210
+ scrollbarHeight: 0,
211
+ // 滚动条
212
+ yThumbHeight: 0,
213
+ xThumbWidth: 0,
214
+ // 行高
215
+ rowHeight: 0,
216
+ // 表格父容器的高度
217
+ parentHeight: 0,
218
+ // 是否使用分组表头
219
+ isGroup: false,
220
+ isAllOverflow: false,
221
+ // 复选框属性,是否全选
222
+ isAllSelected: false,
223
+ // 复选框属性,有选中且非全选状态
224
+ isIndeterminate: false,
225
+ // 单选框属性,选中行
226
+ selectRadioRow: null,
227
+ // 表尾合计数据
228
+ footerTableData: [],
229
+ // 行分组列信息
230
+ rowGroupColumn: null,
231
+ // 展开列信息
232
+ expandColumn: null,
233
+ checkboxColumn: null,
234
+ radioColumn: null,
235
+ // 树节点列信息
236
+ treeNodeColumn: null,
237
+ hasFixedColumn: false,
238
+ // 刷新列标识,当列筛选被改变时,触发表格刷新数据
239
+ upDataFlag: 0,
240
+ // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
241
+ reColumnFlag: 0,
242
+ // 初始化标识
243
+ initStore: {
244
+ filter: false,
245
+ import: false,
246
+ export: false,
247
+ custom: false
248
+ },
249
+ // 自定义列相关的信息
250
+ customStore: {
251
+ btnEl: null,
252
+ isAll: false,
253
+ isIndeterminate: false,
254
+ activeBtn: false,
255
+ activeWrapper: false,
256
+ visible: false,
257
+ maxHeight: null,
258
+ defPopupStyle: {},
259
+ panePopupStyle: {},
260
+ oldSortMaps: {},
261
+ oldFixedMaps: {},
262
+ oldVisibleMaps: {}
263
+ },
264
+ customColumnList: [],
265
+ // 当前选中的筛选列
266
+ filterStore: {
267
+ targetEl: null,
268
+ isAllSelected: false,
269
+ isIndeterminate: false,
270
+ style: null,
271
+ column: null,
272
+ visible: false
273
+ },
274
+ // 存放列相关的信息
275
+ columnStore: {
276
+ leftList: [],
277
+ centerList: [],
278
+ rightList: [],
279
+ resizeList: [],
280
+ pxList: [],
281
+ pxMinList: [],
282
+ autoMinList: [],
283
+ scaleList: [],
284
+ scaleMinList: [],
285
+ autoList: [],
286
+ remainList: []
287
+ },
288
+ // 存放快捷菜单的信息
289
+ ctxMenuStore: {
290
+ selected: null,
291
+ visible: false,
292
+ showChild: false,
293
+ selectChild: null,
294
+ list: [],
295
+ style: null
296
+ },
297
+ // 存放可编辑相关信息
298
+ editStore: {
299
+ indexs: {
300
+ columns: []
301
+ },
302
+ titles: {
303
+ columns: []
304
+ },
305
+ // 选中源
306
+ selected: {
307
+ row: null,
308
+ column: null
309
+ },
310
+ // 已复制源
311
+ copyed: {
312
+ cut: false,
313
+ rows: [],
314
+ columns: []
315
+ },
316
+ // 激活
317
+ actived: {
318
+ row: null,
319
+ column: null
320
+ },
321
+ // 当前被强制聚焦单元格,只会在鼠标点击后算聚焦
322
+ focused: {
323
+ row: null,
324
+ column: null
325
+ }
326
+ },
327
+ // 存放 tooltip 相关信息
328
+ tooltipStore: {
329
+ row: null,
330
+ column: null,
331
+ content: "",
332
+ visible: false,
333
+ type: null,
334
+ currOpts: {}
335
+ },
336
+ // 存放数据校验相关信息
337
+ validStore: {
338
+ visible: false
339
+ },
340
+ validErrorMaps: {},
341
+ // 导入相关信息
342
+ importStore: {
343
+ inited: false,
344
+ file: null,
345
+ type: "",
346
+ modeList: [],
347
+ typeList: [],
348
+ filename: "",
349
+ visible: false
350
+ },
351
+ importParams: {
352
+ mode: "",
353
+ types: null,
354
+ message: true
355
+ },
356
+ // 导出相关信息
357
+ exportStore: {
358
+ inited: false,
359
+ name: "",
360
+ modeList: [],
361
+ typeList: [],
362
+ columns: [],
363
+ isPrint: false,
364
+ hasFooter: false,
365
+ hasMerge: false,
366
+ hasTree: false,
367
+ hasRowGroup: false,
368
+ hasColgroup: false,
369
+ visible: false
370
+ },
371
+ exportParams: {
372
+ filename: "",
373
+ sheetName: "",
374
+ mode: "",
375
+ type: "",
376
+ isColgroup: false,
377
+ isMerge: false,
378
+ isTreeAllExpanded: false,
379
+ isRowGroupAllExpanded: false,
380
+ useStyle: false,
381
+ original: false,
382
+ message: true,
383
+ isHeader: false,
384
+ isTitle: false,
385
+ isFooter: false
386
+ },
387
+ visiblwRowsFlag: 1,
388
+ isRowGroupStatus: false,
389
+ rowGroupList: [],
390
+ aggHandleFields: [],
391
+ aggHandleAggColumns: [],
392
+ rowGroupExpandedFlag: 1,
393
+ rowExpandedFlag: 1,
394
+ treeExpandedFlag: 1,
395
+ updateCheckboxFlag: 1,
396
+ pendingRowFlag: 1,
397
+ insertRowFlag: 1,
398
+ removeRowFlag: 1,
399
+ mergeHeadFlag: 1,
400
+ mergeBodyFlag: 1,
401
+ mergeFootFlag: 1,
402
+ rowHeightStore: {
403
+ xlarge: 54,
404
+ large: 52,
405
+ default: 48,
406
+ medium: 44,
407
+ small: 40,
408
+ mini: 36
409
+ },
410
+ scrollVMLoading: false,
411
+ scrollYHeight: 0,
412
+ scrollYTop: 0,
413
+ isScrollYBig: false,
414
+ scrollXLeft: 0,
415
+ scrollXWidth: 0,
416
+ isScrollXBig: false,
417
+ lazScrollLoading: false,
418
+ rowExpandHeightFlag: 1,
419
+ calcCellHeightFlag: 1,
420
+ resizeHeightFlag: 1,
421
+ resizeWidthFlag: 1,
422
+ isCustomStatus: false,
423
+ isCustomDragStatus: true,
424
+ ctPopupFlag: 1,
425
+ isCrossDragRow: false,
426
+ dragRow: null,
427
+ isCrossDragCol: false,
428
+ dragCol: null,
429
+ dragTipText: "",
430
+ isDragResize: false,
431
+ isRowLoading: false,
432
+ isColLoading: false,
433
+ currColFlag: 1
434
+ };
435
435
  }
436
- const maxKey = '__max';
437
- export function getRowMaxHeight(chRest, isForce) {
438
- if (isForce || !chRest[maxKey]) {
439
- let max = 0;
440
- for (const key in chRest) {
441
- const val = chRest[key];
442
- if (key !== maxKey && XEUtils.isNumber(val) && val > max) {
443
- max = val;
444
- }
445
- }
446
- chRest[maxKey] = max;
447
- return max;
436
+ const maxKey = "__max";
437
+ function getRowMaxHeight(chRest, isForce) {
438
+ if (isForce || !chRest[maxKey]) {
439
+ let max = 0;
440
+ for (const key in chRest) {
441
+ const val = chRest[key];
442
+ if (key !== maxKey && XEUtils.isNumber(val) && val > max) {
443
+ max = val;
444
+ }
448
445
  }
449
- return chRest[maxKey];
446
+ chRest[maxKey] = max;
447
+ return max;
448
+ }
449
+ return chRest[maxKey];
450
450
  }
451
451
  const getAllConvertColumns = (columns, parentColumn) => {
452
- const result = [];
453
- columns.forEach((column) => {
454
- column.parentId = parentColumn ? parentColumn.id : null;
455
- if (column.visible) {
456
- if (column.children && column.children.length && column.children.some((column) => column.visible)) {
457
- result.push(column);
458
- result.push(...getAllConvertColumns(column.children, column));
459
- }
460
- else {
461
- result.push(column);
462
- }
463
- }
464
- });
465
- return result;
452
+ const result = [];
453
+ columns.forEach((column) => {
454
+ column.parentId = parentColumn ? parentColumn.id : null;
455
+ if (column.visible) {
456
+ if (column.children && column.children.length && column.children.some((column2) => column2.visible)) {
457
+ result.push(column);
458
+ result.push(...getAllConvertColumns(column.children, column));
459
+ } else {
460
+ result.push(column);
461
+ }
462
+ }
463
+ });
464
+ return result;
466
465
  };
467
- export const convertHeaderColumnToRows = (originColumns) => {
468
- let maxLevel = 1;
469
- const traverse = (column, parent) => {
470
- if (parent) {
471
- column.level = parent.level + 1;
472
- if (maxLevel < column.level) {
473
- maxLevel = column.level;
474
- }
475
- }
476
- if (column.children && column.children.length && column.children.some((column) => column.visible)) {
477
- let colSpan = 0;
478
- column.children.forEach((subColumn) => {
479
- if (subColumn.visible) {
480
- traverse(subColumn, column);
481
- colSpan += subColumn.colSpan;
482
- }
483
- });
484
- column.colSpan = colSpan;
485
- }
486
- else {
487
- column.colSpan = 1;
488
- }
489
- };
490
- originColumns.forEach((column) => {
491
- column.level = 1;
492
- traverse(column);
493
- });
494
- const rows = [];
495
- for (let i = 0; i < maxLevel; i++) {
496
- rows.push([]);
466
+ const convertHeaderColumnToRows = (originColumns) => {
467
+ let maxLevel = 1;
468
+ const traverse = (column, parent) => {
469
+ if (parent) {
470
+ column.level = parent.level + 1;
471
+ if (maxLevel < column.level) {
472
+ maxLevel = column.level;
473
+ }
497
474
  }
498
- const allColumns = getAllConvertColumns(originColumns);
499
- allColumns.forEach((column) => {
500
- if (column.children && column.children.length && column.children.some((column) => column.visible)) {
501
- column.rowSpan = 1;
502
- }
503
- else {
504
- column.rowSpan = maxLevel - column.level + 1;
475
+ if (column.children && column.children.length && column.children.some((column2) => column2.visible)) {
476
+ let colSpan = 0;
477
+ column.children.forEach((subColumn) => {
478
+ if (subColumn.visible) {
479
+ traverse(subColumn, column);
480
+ colSpan += subColumn.colSpan;
505
481
  }
506
- rows[column.level - 1].push(column);
507
- });
508
- return rows;
482
+ });
483
+ column.colSpan = colSpan;
484
+ } else {
485
+ column.colSpan = 1;
486
+ }
487
+ };
488
+ originColumns.forEach((column) => {
489
+ column.level = 1;
490
+ traverse(column);
491
+ });
492
+ const rows = [];
493
+ for (let i = 0; i < maxLevel; i++) {
494
+ rows.push([]);
495
+ }
496
+ const allColumns = getAllConvertColumns(originColumns);
497
+ allColumns.forEach((column) => {
498
+ if (column.children && column.children.length && column.children.some((column2) => column2.visible)) {
499
+ column.rowSpan = 1;
500
+ } else {
501
+ column.rowSpan = maxLevel - column.level + 1;
502
+ }
503
+ rows[column.level - 1].push(column);
504
+ });
505
+ return rows;
509
506
  };
510
- export function convertHeaderToGridRows(spanColumns) {
511
- const rSize = spanColumns.length;
512
- const cSize = spanColumns[0].reduce((sum, cell) => sum + cell.colSpan, 0);
513
- const occupiedRows = [];
514
- const fullRows = [];
515
- for (let rIndex = 0; rIndex < rSize; rIndex++) {
516
- const oCols = [];
517
- const dCols = [];
518
- for (let cIndex = 0; cIndex < cSize; cIndex++) {
519
- oCols.push(false);
520
- dCols.push('');
521
- }
522
- occupiedRows.push(oCols);
523
- fullRows.push(dCols);
507
+ function convertHeaderToGridRows(spanColumns) {
508
+ const rSize = spanColumns.length;
509
+ const cSize = spanColumns[0].reduce((sum, cell) => sum + cell.colSpan, 0);
510
+ const occupiedRows = [];
511
+ const fullRows = [];
512
+ for (let rIndex = 0; rIndex < rSize; rIndex++) {
513
+ const oCols = [];
514
+ const dCols = [];
515
+ for (let cIndex = 0; cIndex < cSize; cIndex++) {
516
+ oCols.push(false);
517
+ dCols.push("");
524
518
  }
525
- for (let rIndex = 0; rIndex < rSize; rIndex++) {
526
- let currColIndex = 0;
527
- for (const column of spanColumns[rIndex]) {
528
- const { colSpan, rowSpan } = column;
529
- let startColIndex = -1;
530
- for (let ccIndex = currColIndex; ccIndex <= cSize - colSpan; ccIndex++) {
531
- let oFlag = true;
532
- for (let csIndex = 0; csIndex < colSpan; csIndex++) {
533
- if (occupiedRows[rIndex][ccIndex + csIndex]) {
534
- oFlag = false;
535
- break;
536
- }
537
- }
538
- if (oFlag) {
539
- startColIndex = ccIndex;
540
- break;
541
- }
542
- }
543
- if (startColIndex === -1) {
544
- for (let j = 0; j <= cSize - colSpan; j++) {
545
- let oFlag = true;
546
- for (let k = 0; k < colSpan; k++) {
547
- if (occupiedRows[rIndex][j + k]) {
548
- oFlag = false;
549
- break;
550
- }
551
- }
552
- if (oFlag) {
553
- startColIndex = j;
554
- break;
555
- }
556
- }
557
- if (startColIndex === -1) {
558
- // error
559
- break;
560
- }
561
- }
562
- for (let srIndex = rIndex; srIndex < rIndex + rowSpan; srIndex++) {
563
- for (let scIndex = startColIndex; scIndex < startColIndex + colSpan; scIndex++) {
564
- occupiedRows[srIndex][scIndex] = true;
565
- fullRows[srIndex][scIndex] = column;
566
- }
519
+ occupiedRows.push(oCols);
520
+ fullRows.push(dCols);
521
+ }
522
+ for (let rIndex = 0; rIndex < rSize; rIndex++) {
523
+ let currColIndex = 0;
524
+ for (const column of spanColumns[rIndex]) {
525
+ const { colSpan, rowSpan } = column;
526
+ let startColIndex = -1;
527
+ for (let ccIndex = currColIndex; ccIndex <= cSize - colSpan; ccIndex++) {
528
+ let oFlag = true;
529
+ for (let csIndex = 0; csIndex < colSpan; csIndex++) {
530
+ if (occupiedRows[rIndex][ccIndex + csIndex]) {
531
+ oFlag = false;
532
+ break;
533
+ }
534
+ }
535
+ if (oFlag) {
536
+ startColIndex = ccIndex;
537
+ break;
538
+ }
539
+ }
540
+ if (startColIndex === -1) {
541
+ for (let j = 0; j <= cSize - colSpan; j++) {
542
+ let oFlag = true;
543
+ for (let k = 0; k < colSpan; k++) {
544
+ if (occupiedRows[rIndex][j + k]) {
545
+ oFlag = false;
546
+ break;
567
547
  }
568
- currColIndex = startColIndex + colSpan;
548
+ }
549
+ if (oFlag) {
550
+ startColIndex = j;
551
+ break;
552
+ }
553
+ }
554
+ if (startColIndex === -1) {
555
+ break;
556
+ }
557
+ }
558
+ for (let srIndex = rIndex; srIndex < rIndex + rowSpan; srIndex++) {
559
+ for (let scIndex = startColIndex; scIndex < startColIndex + colSpan; scIndex++) {
560
+ occupiedRows[srIndex][scIndex] = true;
561
+ fullRows[srIndex][scIndex] = column;
569
562
  }
563
+ }
564
+ currColIndex = startColIndex + colSpan;
570
565
  }
571
- return fullRows;
566
+ }
567
+ return fullRows;
572
568
  }
573
- export function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
574
- const internalData = $xeTable.internalData;
575
- if (scrollLeft || scrollTop) {
576
- internalData.intoRunScroll = false;
577
- internalData.inVirtualScroll = false;
578
- internalData.inWheelScroll = false;
579
- internalData.inHeaderScroll = false;
580
- internalData.inBodyScroll = false;
581
- internalData.inFooterScroll = false;
582
- internalData.scrollRenderType = '';
583
- // 还原滚动状态
584
- return $xeTable.scrollTo(scrollLeft, scrollTop);
585
- }
586
- return $xeTable.clearScroll();
569
+ function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
570
+ const internalData = $xeTable.internalData;
571
+ if (scrollLeft || scrollTop) {
572
+ internalData.intoRunScroll = false;
573
+ internalData.inVirtualScroll = false;
574
+ internalData.inWheelScroll = false;
575
+ internalData.inHeaderScroll = false;
576
+ internalData.inBodyScroll = false;
577
+ internalData.inFooterScroll = false;
578
+ internalData.scrollRenderType = "";
579
+ return $xeTable.scrollTo(scrollLeft, scrollTop);
580
+ }
581
+ return $xeTable.clearScroll();
587
582
  }
588
- export function getRowUniqueId() {
589
- return XEUtils.uniqueId('row_');
583
+ function getRowUniqueId() {
584
+ return XEUtils.uniqueId("row_");
590
585
  }
591
- /**
592
- * 生成行的唯一主键
593
- */
594
- export function createRowId(rowOpts, row, keyField) {
595
- const { createKeyMethod } = rowOpts;
596
- if (createKeyMethod) {
597
- return createKeyMethod({ row, keyField });
598
- }
599
- return getRowUniqueId();
586
+ function createRowId(rowOpts, row, keyField) {
587
+ const { createKeyMethod } = rowOpts;
588
+ if (createKeyMethod) {
589
+ return createKeyMethod({ row, keyField });
590
+ }
591
+ return getRowUniqueId();
600
592
  }
601
- export function hasDeepKey(rowKey) {
602
- return rowKey.indexOf('.') > -1;
593
+ function hasDeepKey(rowKey) {
594
+ return rowKey.indexOf(".") > -1;
603
595
  }
604
- // 行主键 key
605
- export function getRowkey($xeTable) {
606
- const { currKeyField } = $xeTable.internalData;
607
- return currKeyField;
596
+ function getRowkey($xeTable) {
597
+ const { currKeyField } = $xeTable.internalData;
598
+ return currKeyField;
608
599
  }
609
- // 行主键 value
610
- export function getRowid($xeTable, row) {
611
- const internalData = $xeTable.internalData;
612
- const { isCurrDeepKey, currKeyField } = internalData;
613
- return row ? encodeRowid((isCurrDeepKey ? getDeepRowIdByKey : getFastRowIdByKey)(row, currKeyField)) : '';
600
+ function getRowid($xeTable, row) {
601
+ const internalData = $xeTable.internalData;
602
+ const { isCurrDeepKey, currKeyField } = internalData;
603
+ return row ? encodeRowid((isCurrDeepKey ? getDeepRowIdByKey : getFastRowIdByKey)(row, currKeyField)) : "";
614
604
  }
615
- export function createHandleUpdateRowId($xeTable) {
616
- const internalData = $xeTable.internalData;
617
- const { isCurrDeepKey, currKeyField } = internalData;
618
- const { computeRowOpts } = $xeTable.getComputeMaps();
619
- const rowOpts = computeRowOpts.value;
620
- const updateRId = isCurrDeepKey ? updateDeepRowKey : updateFastRowKey;
621
- return {
622
- rowKey: currKeyField,
623
- handleUpdateRowId(row) {
624
- return row ? updateRId(rowOpts, row, currKeyField) : '';
625
- }
626
- };
605
+ function createHandleUpdateRowId($xeTable) {
606
+ const internalData = $xeTable.internalData;
607
+ const { isCurrDeepKey, currKeyField } = internalData;
608
+ const { computeRowOpts } = $xeTable.getComputeMaps();
609
+ const rowOpts = computeRowOpts.value;
610
+ const updateRId = isCurrDeepKey ? updateDeepRowKey : updateFastRowKey;
611
+ return {
612
+ rowKey: currKeyField,
613
+ handleUpdateRowId(row) {
614
+ return row ? updateRId(rowOpts, row, currKeyField) : "";
615
+ }
616
+ };
627
617
  }
628
- export function createHandleGetRowId($xeTable) {
629
- const internalData = $xeTable.internalData;
630
- const { isCurrDeepKey, currKeyField } = internalData;
631
- const getRId = isCurrDeepKey ? getDeepRowIdByKey : getFastRowIdByKey;
632
- return {
633
- rowKey: currKeyField,
634
- handleGetRowId(row) {
635
- return row ? encodeRowid(getRId(row, currKeyField)) : '';
636
- }
637
- };
618
+ function createHandleGetRowId($xeTable) {
619
+ const internalData = $xeTable.internalData;
620
+ const { isCurrDeepKey, currKeyField } = internalData;
621
+ const getRId = isCurrDeepKey ? getDeepRowIdByKey : getFastRowIdByKey;
622
+ return {
623
+ rowKey: currKeyField,
624
+ handleGetRowId(row) {
625
+ return row ? encodeRowid(getRId(row, currKeyField)) : "";
626
+ }
627
+ };
638
628
  }
639
- // 编码行主键
640
- export function encodeRowid(rowVal) {
641
- return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
629
+ function encodeRowid(rowVal) {
630
+ return XEUtils.eqNull(rowVal) ? "" : encodeURIComponent(rowVal);
642
631
  }
643
632
  function getDeepRowIdByKey(row, rowKey) {
644
- return XEUtils.get(row, rowKey);
633
+ return XEUtils.get(row, rowKey);
645
634
  }
646
635
  function updateDeepRowKey(rowOpts, row, rowKey) {
647
- let rowid = encodeRowid(getDeepRowIdByKey(row, rowKey));
648
- if (eqEmptyValue(rowid)) {
649
- const newRowid = createRowId(rowOpts, row, rowKey);
650
- rowid = '' + newRowid;
651
- XEUtils.set(row, rowKey, rowid);
652
- }
653
- return rowid;
636
+ let rowid = encodeRowid(getDeepRowIdByKey(row, rowKey));
637
+ if (eqEmptyValue(rowid)) {
638
+ const newRowid = createRowId(rowOpts, row, rowKey);
639
+ rowid = "" + newRowid;
640
+ XEUtils.set(row, rowKey, rowid);
641
+ }
642
+ return rowid;
654
643
  }
655
644
  function getFastRowIdByKey(row, rowKey) {
656
- return row[rowKey];
645
+ return row[rowKey];
657
646
  }
658
647
  function updateFastRowKey(rowOpts, row, rowKey) {
659
- let rowid = encodeRowid(getFastRowIdByKey(row, rowKey));
660
- if (eqEmptyValue(rowid)) {
661
- const newRowid = createRowId(rowOpts, row, rowKey);
662
- rowid = '' + newRowid;
663
- row[rowKey] = newRowid;
664
- }
665
- return rowid;
648
+ let rowid = encodeRowid(getFastRowIdByKey(row, rowKey));
649
+ if (eqEmptyValue(rowid)) {
650
+ const newRowid = createRowId(rowOpts, row, rowKey);
651
+ rowid = "" + newRowid;
652
+ row[rowKey] = newRowid;
653
+ }
654
+ return rowid;
666
655
  }
667
- export function handleFieldOrColumn($xeTable, fieldOrColumn) {
668
- if (fieldOrColumn) {
669
- return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
670
- }
671
- return null;
656
+ function handleFieldOrColumn($xeTable, fieldOrColumn) {
657
+ if (fieldOrColumn) {
658
+ return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
659
+ }
660
+ return null;
672
661
  }
673
- export function handleRowidOrRow($xeTable, rowidOrRow) {
674
- if (rowidOrRow) {
675
- const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
676
- return $xeTable.getRowById(rowid);
677
- }
678
- return null;
662
+ function handleRowidOrRow($xeTable, rowidOrRow) {
663
+ if (rowidOrRow) {
664
+ const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
665
+ return $xeTable.getRowById(rowid);
666
+ }
667
+ return null;
679
668
  }
680
- export function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
681
- const { height, minHeight, maxHeight } = cellOpts;
682
- let cellHeight = rowRest.resizeHeight || height || rowOpts.height || rowRest.height || defaultRowHeight;
683
- if (maxHeight && maxHeight <= cellHeight) {
684
- cellHeight = maxHeight;
685
- }
686
- if (minHeight && minHeight >= cellHeight) {
687
- cellHeight = minHeight;
688
- }
689
- return cellHeight;
669
+ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
670
+ const { height, minHeight, maxHeight } = cellOpts;
671
+ let cellHeight = rowRest.resizeHeight || height || rowOpts.height || rowRest.height || defaultRowHeight;
672
+ if (maxHeight && maxHeight <= cellHeight) {
673
+ cellHeight = maxHeight;
674
+ }
675
+ if (minHeight && minHeight >= cellHeight) {
676
+ cellHeight = minHeight;
677
+ }
678
+ return cellHeight;
690
679
  }
691
680
  function getPaddingLeftRightSize(elem) {
692
- if (elem) {
693
- const computedStyle = getComputedStyle(elem);
694
- const paddingLeft = XEUtils.toNumber(computedStyle.paddingLeft);
695
- const paddingRight = XEUtils.toNumber(computedStyle.paddingRight);
696
- return paddingLeft + paddingRight;
697
- }
698
- return 0;
681
+ if (elem) {
682
+ const computedStyle = getComputedStyle(elem);
683
+ const paddingLeft = XEUtils.toNumber(computedStyle.paddingLeft);
684
+ const paddingRight = XEUtils.toNumber(computedStyle.paddingRight);
685
+ return paddingLeft + paddingRight;
686
+ }
687
+ return 0;
699
688
  }
700
689
  function getElementMarginAndWidth(elem) {
701
- if (elem) {
702
- const computedStyle = getComputedStyle(elem);
703
- const marginLeft = XEUtils.toNumber(computedStyle.marginLeft);
704
- const marginRight = XEUtils.toNumber(computedStyle.marginRight);
705
- return elem.offsetWidth + marginLeft + marginRight;
706
- }
707
- return 0;
690
+ if (elem) {
691
+ const computedStyle = getComputedStyle(elem);
692
+ const marginLeft = XEUtils.toNumber(computedStyle.marginLeft);
693
+ const marginRight = XEUtils.toNumber(computedStyle.marginRight);
694
+ return elem.offsetWidth + marginLeft + marginRight;
695
+ }
696
+ return 0;
708
697
  }
709
- export function toFilters(filters, colid) {
710
- if (filters) {
711
- if (XEUtils.isArray(filters)) {
712
- return filters.map(({ label, value, data, resetValue, checked }) => {
713
- return { label, value, data, resetValue, checked: !!checked, _checked: !!checked, _colId: colid };
714
- });
715
- }
716
- return [];
698
+ function toFilters(filters, colid) {
699
+ if (filters) {
700
+ if (XEUtils.isArray(filters)) {
701
+ return filters.map(({ label, value, data, resetValue, checked }) => {
702
+ return { label, value, data, resetValue, checked: !!checked, _checked: !!checked, _colId: colid };
703
+ });
717
704
  }
718
- return filters;
705
+ return [];
706
+ }
707
+ return filters;
719
708
  }
720
- export function toTreePathSeq(path) {
721
- return path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
709
+ function toTreePathSeq(path) {
710
+ return path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : ".").join("");
722
711
  }
723
- export function getCellValue(row, column) {
724
- if (column) {
725
- return XEUtils.get(row, column.field);
726
- }
727
- return null;
712
+ function getCellValue(row, column) {
713
+ if (column) {
714
+ return XEUtils.get(row, column.field);
715
+ }
716
+ return null;
728
717
  }
729
- export function setCellValue(row, column, value) {
730
- if (column) {
731
- XEUtils.set(row, column.field, value);
732
- }
718
+ function setCellValue(row, column, value) {
719
+ if (column) {
720
+ XEUtils.set(row, column.field, value);
721
+ }
733
722
  }
734
- export function getRefElem(refEl) {
735
- if (refEl) {
736
- const rest = refEl.value;
737
- if (rest) {
738
- return (rest.$el || rest);
739
- }
723
+ function getRefElem(refEl) {
724
+ if (refEl) {
725
+ const rest = refEl.value;
726
+ if (rest) {
727
+ return rest.$el || rest;
740
728
  }
741
- return null;
729
+ }
730
+ return null;
742
731
  }
743
- export function getCalcHeight(height) {
744
- if (height === 'unset') {
745
- return 0;
746
- }
747
- return height || 0;
732
+ function getCalcHeight(height) {
733
+ if (height === "unset") {
734
+ return 0;
735
+ }
736
+ return height || 0;
748
737
  }
749
- /**
750
- * 列宽拖动最大宽度
751
- */
752
- export function getColReMaxWidth(params) {
753
- const { $table, column, cell } = params;
754
- const internalData = $table.internalData;
755
- const { elemStore } = internalData;
756
- const { computeColumnOpts, computeResizableOpts } = $table.getComputeMaps();
757
- const resizableOpts = computeResizableOpts.value;
758
- const columnOpts = computeColumnOpts.value;
759
- const { maxWidth: reMaxWidth } = resizableOpts;
760
- const colMaxWidth = column.maxWidth || columnOpts.maxWidth;
761
- // 如果自定义调整宽度逻辑
762
- if (reMaxWidth) {
763
- const customMaxWidth = XEUtils.isFunction(reMaxWidth) ? reMaxWidth(params) : reMaxWidth;
764
- if (customMaxWidth !== 'auto') {
765
- return Math.max(1, XEUtils.toNumber(customMaxWidth));
766
- }
738
+ function getColReMaxWidth(params) {
739
+ const { $table, column, cell } = params;
740
+ const internalData = $table.internalData;
741
+ const { elemStore } = internalData;
742
+ const { computeColumnOpts, computeResizableOpts } = $table.getComputeMaps();
743
+ const resizableOpts = computeResizableOpts.value;
744
+ const columnOpts = computeColumnOpts.value;
745
+ const { maxWidth: reMaxWidth } = resizableOpts;
746
+ const colMaxWidth = column.maxWidth || columnOpts.maxWidth;
747
+ if (reMaxWidth) {
748
+ const customMaxWidth = XEUtils.isFunction(reMaxWidth) ? reMaxWidth(params) : reMaxWidth;
749
+ if (customMaxWidth !== "auto") {
750
+ return Math.max(1, XEUtils.toNumber(customMaxWidth));
767
751
  }
768
- const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
769
- const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'));
770
- const mWidth = minTitleWidth + paddingLeftRight;
771
- // 如果设置最小宽
772
- if (colMaxWidth) {
773
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
774
- if (bodyScrollElem) {
775
- if (isScale(colMaxWidth)) {
776
- const bodyWidth = bodyScrollElem.clientWidth - 1;
777
- const meanWidth = bodyWidth / 100;
778
- return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMaxWidth) * meanWidth));
779
- }
780
- else if (isPx(colMaxWidth)) {
781
- return Math.max(mWidth, XEUtils.toInteger(colMaxWidth));
782
- }
783
- }
752
+ }
753
+ const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
754
+ const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, ".vxe-cell"));
755
+ const mWidth = minTitleWidth + paddingLeftRight;
756
+ if (colMaxWidth) {
757
+ const bodyScrollElem = getRefElem(elemStore["main-body-scroll"]);
758
+ if (bodyScrollElem) {
759
+ if (isScale(colMaxWidth)) {
760
+ const bodyWidth = bodyScrollElem.clientWidth - 1;
761
+ const meanWidth = bodyWidth / 100;
762
+ return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMaxWidth) * meanWidth));
763
+ } else if (isPx(colMaxWidth)) {
764
+ return Math.max(mWidth, XEUtils.toInteger(colMaxWidth));
765
+ }
784
766
  }
785
- return -1;
767
+ }
768
+ return -1;
786
769
  }
787
- /**
788
- * 列宽拖动最小宽度
789
- */
790
- export function getColReMinWidth(params) {
791
- const { $table, column, cell } = params;
792
- const tableProps = $table.props;
793
- const internalData = $table.internalData;
794
- const { computeColumnOpts, computeResizableOpts } = $table.getComputeMaps();
795
- const resizableOpts = computeResizableOpts.value;
796
- const columnOpts = computeColumnOpts.value;
797
- const { minWidth: reMinWidth } = resizableOpts;
798
- // 如果自定义调整宽度逻辑
799
- if (reMinWidth) {
800
- const customMinWidth = XEUtils.isFunction(reMinWidth) ? reMinWidth(params) : reMinWidth;
801
- if (customMinWidth !== 'auto') {
802
- return Math.max(1, XEUtils.toNumber(customMinWidth));
803
- }
804
- }
805
- const { elemStore } = internalData;
806
- const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
807
- const { showHeaderOverflow } = column;
808
- const colMinWidth = column.minWidth || columnOpts.minWidth;
809
- const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
810
- const showEllipsis = headOverflow === 'ellipsis';
811
- const showTitle = headOverflow === 'title';
812
- const showTooltip = headOverflow === true || headOverflow === 'tooltip';
813
- const hasEllipsis = showTitle || showTooltip || showEllipsis;
814
- const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
815
- const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'));
816
- let mWidth = minTitleWidth + paddingLeftRight;
817
- // 默认最小宽处理
818
- if (hasEllipsis) {
819
- const dragIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--drag-handle'));
820
- const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--checkbox'));
821
- const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--required-icon'));
822
- const editIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--edit-icon'));
823
- const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-prefix-icon'));
824
- const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-suffix-icon'));
825
- const sortIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--sort'));
826
- const filterIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--filter'));
827
- mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth;
770
+ function getColReMinWidth(params) {
771
+ const { $table, column, cell } = params;
772
+ const tableProps = $table.props;
773
+ const internalData = $table.internalData;
774
+ const { computeColumnOpts, computeResizableOpts } = $table.getComputeMaps();
775
+ const resizableOpts = computeResizableOpts.value;
776
+ const columnOpts = computeColumnOpts.value;
777
+ const { minWidth: reMinWidth } = resizableOpts;
778
+ if (reMinWidth) {
779
+ const customMinWidth = XEUtils.isFunction(reMinWidth) ? reMinWidth(params) : reMinWidth;
780
+ if (customMinWidth !== "auto") {
781
+ return Math.max(1, XEUtils.toNumber(customMinWidth));
828
782
  }
829
- // 如果设置最小宽
830
- if (colMinWidth) {
831
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
832
- if (bodyScrollElem) {
833
- if (isScale(colMinWidth)) {
834
- const bodyWidth = bodyScrollElem.clientWidth - 1;
835
- const meanWidth = bodyWidth / 100;
836
- return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMinWidth) * meanWidth));
837
- }
838
- else if (isPx(colMinWidth)) {
839
- return Math.max(mWidth, XEUtils.toInteger(colMinWidth));
840
- }
841
- }
783
+ }
784
+ const { elemStore } = internalData;
785
+ const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
786
+ const { showHeaderOverflow } = column;
787
+ const colMinWidth = column.minWidth || columnOpts.minWidth;
788
+ const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
789
+ const showEllipsis = headOverflow === "ellipsis";
790
+ const showTitle = headOverflow === "title";
791
+ const showTooltip = headOverflow === true || headOverflow === "tooltip";
792
+ const hasEllipsis = showTitle || showTooltip || showEllipsis;
793
+ const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
794
+ const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, ".vxe-cell"));
795
+ let mWidth = minTitleWidth + paddingLeftRight;
796
+ if (hasEllipsis) {
797
+ const dragIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell--drag-handle"));
798
+ const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell--checkbox"));
799
+ const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell--required-icon"));
800
+ const editIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell--edit-icon"));
801
+ const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell-title-prefix-icon"));
802
+ const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell-title-suffix-icon"));
803
+ const sortIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell--sort"));
804
+ const filterIconWidth = getElementMarginAndWidth(queryElement(cell, ".vxe-cell--filter"));
805
+ mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth;
806
+ }
807
+ if (colMinWidth) {
808
+ const bodyScrollElem = getRefElem(elemStore["main-body-scroll"]);
809
+ if (bodyScrollElem) {
810
+ if (isScale(colMinWidth)) {
811
+ const bodyWidth = bodyScrollElem.clientWidth - 1;
812
+ const meanWidth = bodyWidth / 100;
813
+ return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMinWidth) * meanWidth));
814
+ } else if (isPx(colMinWidth)) {
815
+ return Math.max(mWidth, XEUtils.toInteger(colMinWidth));
816
+ }
842
817
  }
843
- return mWidth;
818
+ }
819
+ return mWidth;
844
820
  }
845
- export function isColumnInfo(column) {
846
- return column && (column.constructor === ColumnInfo || column instanceof ColumnInfo);
821
+ function isColumnInfo(column) {
822
+ return column && (column.constructor === ColumnInfo || column instanceof ColumnInfo);
847
823
  }
848
- // 获取所有的列,排除分组
849
- export function getColumnList(columns) {
850
- const result = [];
851
- columns.forEach((column) => {
852
- result.push(...(column.children && column.children.length ? getColumnList(column.children) : [column]));
853
- });
854
- return result;
824
+ function getColumnList(columns) {
825
+ const result = [];
826
+ columns.forEach((column) => {
827
+ result.push(...column.children && column.children.length ? getColumnList(column.children) : [column]);
828
+ });
829
+ return result;
855
830
  }
856
- export function createColumn($xeTable, options, renderOptions) {
857
- return isColumnInfo(options) ? options : reactive(new ColumnInfo($xeTable, options, renderOptions));
831
+ function createColumn($xeTable, options, renderOptions) {
832
+ return isColumnInfo(options) ? options : reactive(new ColumnInfo($xeTable, options, renderOptions));
858
833
  }
859
- export function watchColumn($xeTable, props, column) {
860
- Object.keys(props).forEach(name => {
861
- watch(() => props[name], (value) => {
862
- column.update(name, value);
863
- if ($xeTable) {
864
- if (name === 'filters') {
865
- $xeTable.setFilter(column, value);
866
- $xeTable.handleUpdateDataQueue();
867
- }
868
- else if (['visible', 'fixed', 'width', 'minWidth', 'maxWidth'].includes(name)) {
869
- $xeTable.handleRefreshColumnQueue();
870
- }
871
- }
872
- });
834
+ function watchColumn($xeTable, props, column) {
835
+ Object.keys(props).forEach((name) => {
836
+ watch(() => props[name], (value) => {
837
+ column.update(name, value);
838
+ if ($xeTable) {
839
+ if (name === "filters") {
840
+ $xeTable.setFilter(column, value);
841
+ $xeTable.handleUpdateDataQueue();
842
+ } else if (["visible", "fixed", "width", "minWidth", "maxWidth"].includes(name)) {
843
+ $xeTable.handleRefreshColumnQueue();
844
+ }
845
+ }
873
846
  });
847
+ });
874
848
  }
875
- export function assembleColumn($xeTable, elem, column, colgroup) {
876
- const { reactData } = $xeTable;
877
- const { staticColumns } = reactData;
878
- const parentElem = elem.parentNode;
879
- const parentColumn = colgroup ? colgroup.columnConfig : null;
880
- const parentCols = parentColumn ? parentColumn.children : staticColumns;
881
- if (parentElem && parentCols) {
882
- column.defaultParentId = parentColumn ? parentColumn.id : null;
883
- parentCols.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, column);
884
- reactData.staticColumns = staticColumns.slice(0);
885
- }
886
- }
887
- export function destroyColumn($xeTable, column) {
888
- const { reactData } = $xeTable;
889
- const { staticColumns } = reactData;
890
- const matchObj = XEUtils.findTree(staticColumns, item => item.id === column.id, { children: 'children' });
891
- if (matchObj) {
892
- matchObj.items.splice(matchObj.index, 1);
893
- }
849
+ function assembleColumn($xeTable, elem, column, colgroup) {
850
+ const { reactData } = $xeTable;
851
+ const { staticColumns } = reactData;
852
+ const parentElem = elem.parentNode;
853
+ const parentColumn = colgroup ? colgroup.columnConfig : null;
854
+ const parentCols = parentColumn ? parentColumn.children : staticColumns;
855
+ if (parentElem && parentCols) {
856
+ column.defaultParentId = parentColumn ? parentColumn.id : null;
857
+ parentCols.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, column);
894
858
  reactData.staticColumns = staticColumns.slice(0);
859
+ }
895
860
  }
896
- export function getRootColumn($xeTable, column) {
897
- const { internalData } = $xeTable;
898
- const { fullColumnIdData } = internalData;
899
- if (!column) {
900
- return null;
901
- }
902
- let parentColId = column.parentId;
903
- while (fullColumnIdData[parentColId]) {
904
- const column = fullColumnIdData[parentColId].column;
905
- parentColId = column.parentId;
906
- if (!parentColId) {
907
- return column;
908
- }
909
- }
910
- return column;
861
+ function destroyColumn($xeTable, column) {
862
+ const { reactData } = $xeTable;
863
+ const { staticColumns } = reactData;
864
+ const matchObj = XEUtils.findTree(staticColumns, (item) => item.id === column.id, { children: "children" });
865
+ if (matchObj) {
866
+ matchObj.items.splice(matchObj.index, 1);
867
+ }
868
+ reactData.staticColumns = staticColumns.slice(0);
911
869
  }
912
- export function getFirstChildColumn(column) {
913
- const { children } = column;
914
- if (children && children.length) {
915
- return getFirstChildColumn(XEUtils.first(children));
870
+ function getRootColumn($xeTable, column) {
871
+ const { internalData } = $xeTable;
872
+ const { fullColumnIdData } = internalData;
873
+ if (!column) {
874
+ return null;
875
+ }
876
+ let parentColId = column.parentId;
877
+ while (fullColumnIdData[parentColId]) {
878
+ const column2 = fullColumnIdData[parentColId].column;
879
+ parentColId = column2.parentId;
880
+ if (!parentColId) {
881
+ return column2;
916
882
  }
917
- return column;
883
+ }
884
+ return column;
918
885
  }
919
- export function getLastChildColumn(column) {
920
- const { children } = column;
921
- if (children && children.length) {
922
- return getFirstChildColumn(XEUtils.last(children));
923
- }
924
- return column;
886
+ function getFirstChildColumn(column) {
887
+ const { children } = column;
888
+ if (children && children.length) {
889
+ return getFirstChildColumn(XEUtils.first(children));
890
+ }
891
+ return column;
925
892
  }
926
- export function clearTableDefaultStatus($xeTable) {
927
- const { props, internalData } = $xeTable;
928
- const { keyboardConfig, mouseConfig } = props;
929
- const { computeMouseOpts, computeKeyboardOpts } = $xeTable.getComputeMaps();
930
- const mouseOpts = computeMouseOpts.value;
931
- const keyboardOpts = computeKeyboardOpts.value;
932
- internalData.initStatus = false;
933
- const actionList = [
934
- $xeTable.clearSort(),
935
- $xeTable.clearCurrentRow(),
936
- $xeTable.clearCurrentColumn(),
937
- $xeTable.clearRadioRow(),
938
- $xeTable.clearRadioReserve(),
939
- $xeTable.clearCheckboxRow(),
940
- $xeTable.clearCheckboxReserve(),
941
- $xeTable.clearRowExpand(),
942
- $xeTable.clearTreeExpand(),
943
- $xeTable.clearTreeExpandReserve(),
944
- $xeTable.clearPendingRow()
945
- ];
946
- if ($xeTable.clearFilter) {
947
- actionList.push($xeTable.clearFilter());
948
- }
949
- if ($xeTable.clearSelected && (hasEnableConf(keyboardConfig, keyboardOpts) || hasEnableConf(mouseConfig, mouseOpts))) {
950
- actionList.push($xeTable.clearSelected());
951
- }
952
- if ($xeTable.clearCellAreas && hasEnableConf(mouseConfig, mouseOpts)) {
953
- actionList.push($xeTable.clearCellAreas(), $xeTable.clearCopyCellArea());
954
- }
955
- return Promise.all(actionList).then(() => {
956
- return $xeTable.clearScroll();
957
- });
893
+ function getLastChildColumn(column) {
894
+ const { children } = column;
895
+ if (children && children.length) {
896
+ return getFirstChildColumn(XEUtils.last(children));
897
+ }
898
+ return column;
958
899
  }
959
- export function clearTableAllStatus($xeTable) {
960
- if ($xeTable.clearFilter) {
961
- $xeTable.clearFilter();
962
- }
963
- return clearTableDefaultStatus($xeTable);
900
+ function clearTableDefaultStatus($xeTable) {
901
+ const { props, internalData } = $xeTable;
902
+ const { keyboardConfig, mouseConfig } = props;
903
+ const { computeMouseOpts, computeKeyboardOpts } = $xeTable.getComputeMaps();
904
+ const mouseOpts = computeMouseOpts.value;
905
+ const keyboardOpts = computeKeyboardOpts.value;
906
+ internalData.initStatus = false;
907
+ const actionList = [
908
+ $xeTable.clearSort(),
909
+ $xeTable.clearCurrentRow(),
910
+ $xeTable.clearCurrentColumn(),
911
+ $xeTable.clearRadioRow(),
912
+ $xeTable.clearRadioReserve(),
913
+ $xeTable.clearCheckboxRow(),
914
+ $xeTable.clearCheckboxReserve(),
915
+ $xeTable.clearRowExpand(),
916
+ $xeTable.clearTreeExpand(),
917
+ $xeTable.clearTreeExpandReserve(),
918
+ $xeTable.clearPendingRow()
919
+ ];
920
+ if ($xeTable.clearFilter) {
921
+ actionList.push(
922
+ $xeTable.clearFilter()
923
+ );
924
+ }
925
+ if ($xeTable.clearSelected && (hasEnableConf(keyboardConfig, keyboardOpts) || hasEnableConf(mouseConfig, mouseOpts))) {
926
+ actionList.push(
927
+ $xeTable.clearSelected()
928
+ );
929
+ }
930
+ if ($xeTable.clearCellAreas && hasEnableConf(mouseConfig, mouseOpts)) {
931
+ actionList.push(
932
+ $xeTable.clearCellAreas(),
933
+ $xeTable.clearCopyCellArea()
934
+ );
935
+ }
936
+ return Promise.all(actionList).then(() => {
937
+ return $xeTable.clearScroll();
938
+ });
964
939
  }
965
- export function rowToVisible($xeTable, row) {
966
- const reactData = $xeTable.reactData;
967
- const internalData = $xeTable.internalData;
968
- const { computeLeftFixedWidth, computeRightFixedWidth, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
969
- const { scrollYLoad, scrollYTop, isAllOverflow } = reactData;
970
- const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData;
971
- const rowOpts = computeRowOpts.value;
972
- const cellOpts = computeCellOpts.value;
973
- const defaultRowHeight = computeDefaultRowHeight.value;
974
- const leftFixedWidth = computeLeftFixedWidth.value;
975
- const rightFixedWidth = computeRightFixedWidth.value;
976
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
977
- const rowid = getRowid($xeTable, row);
978
- if (bodyScrollElem) {
979
- const bodyHeight = bodyScrollElem.clientHeight;
980
- const bodyScrollTop = bodyScrollElem.scrollTop;
981
- const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
982
- if (trElem) {
983
- const trOffsetTop = trElem.offsetTop + (scrollYLoad ? scrollYTop : 0);
984
- const trHeight = trElem.clientHeight;
985
- // 检测行是否在可视区中
986
- if (trOffsetTop < bodyScrollTop || trOffsetTop > bodyScrollTop + bodyHeight) {
987
- return $xeTable.scrollTo(null, trOffsetTop);
988
- }
989
- else if (trOffsetTop + trHeight >= bodyHeight + bodyScrollTop) {
990
- return $xeTable.scrollTo(null, bodyScrollTop + trHeight);
991
- }
940
+ function clearTableAllStatus($xeTable) {
941
+ if ($xeTable.clearFilter) {
942
+ $xeTable.clearFilter();
943
+ }
944
+ return clearTableDefaultStatus($xeTable);
945
+ }
946
+ function rowToVisible($xeTable, row) {
947
+ const reactData = $xeTable.reactData;
948
+ const internalData = $xeTable.internalData;
949
+ const { computeLeftFixedWidth, computeRightFixedWidth, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
950
+ const { scrollYLoad, scrollYTop, isAllOverflow } = reactData;
951
+ const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData;
952
+ const rowOpts = computeRowOpts.value;
953
+ const cellOpts = computeCellOpts.value;
954
+ const defaultRowHeight = computeDefaultRowHeight.value;
955
+ const leftFixedWidth = computeLeftFixedWidth.value;
956
+ const rightFixedWidth = computeRightFixedWidth.value;
957
+ const bodyScrollElem = getRefElem(elemStore["main-body-scroll"]);
958
+ const rowid = getRowid($xeTable, row);
959
+ if (bodyScrollElem) {
960
+ const bodyHeight = bodyScrollElem.clientHeight;
961
+ const bodyScrollTop = bodyScrollElem.scrollTop;
962
+ const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
963
+ if (trElem) {
964
+ const trOffsetTop = trElem.offsetTop + (scrollYLoad ? scrollYTop : 0);
965
+ const trHeight = trElem.clientHeight;
966
+ if (trOffsetTop < bodyScrollTop || trOffsetTop > bodyScrollTop + bodyHeight) {
967
+ return $xeTable.scrollTo(null, trOffsetTop);
968
+ } else if (trOffsetTop + trHeight >= bodyHeight + bodyScrollTop) {
969
+ return $xeTable.scrollTo(null, bodyScrollTop + trHeight);
970
+ }
971
+ } else {
972
+ if (scrollYLoad) {
973
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
974
+ if (!isCustomCellHeight && isAllOverflow) {
975
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
992
976
  }
993
- else {
994
- // 如果是虚拟渲染滚动
995
- if (scrollYLoad) {
996
- const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
997
- if (!isCustomCellHeight && isAllOverflow) {
998
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
999
- }
1000
- const rowRest = fullAllDataRowIdData[rowid] || {};
1001
- const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
1002
- const scrollTop = rowRest.oTop;
1003
- if (scrollTop < bodyScrollTop) {
1004
- return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
1005
- }
1006
- return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - rightFixedWidth - 1));
1007
- }
977
+ const rowRest = fullAllDataRowIdData[rowid] || {};
978
+ const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
979
+ const scrollTop = rowRest.oTop;
980
+ if (scrollTop < bodyScrollTop) {
981
+ return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
1008
982
  }
983
+ return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
984
+ }
1009
985
  }
1010
- return Promise.resolve();
986
+ }
987
+ return Promise.resolve();
1011
988
  }
1012
- export function colToVisible($xeTable, isForce, column, row) {
1013
- const reactData = $xeTable.reactData;
1014
- const internalData = $xeTable.internalData;
1015
- const { computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps();
1016
- const { scrollXLoad, scrollXLeft } = reactData;
1017
- const { elemStore, visibleColumn } = internalData;
1018
- const leftFixedWidth = computeLeftFixedWidth.value;
1019
- const rightFixedWidth = computeRightFixedWidth.value;
1020
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
1021
- if (column.fixed) {
1022
- return Promise.resolve();
989
+ function colToVisible($xeTable, isForce, column, row) {
990
+ const reactData = $xeTable.reactData;
991
+ const internalData = $xeTable.internalData;
992
+ const { computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps();
993
+ const { scrollXLoad, scrollXLeft } = reactData;
994
+ const { elemStore, visibleColumn } = internalData;
995
+ const leftFixedWidth = computeLeftFixedWidth.value;
996
+ const rightFixedWidth = computeRightFixedWidth.value;
997
+ const bodyScrollElem = getRefElem(elemStore["main-body-scroll"]);
998
+ if (column.fixed) {
999
+ return Promise.resolve();
1000
+ }
1001
+ if (bodyScrollElem) {
1002
+ const bodyWidth = bodyScrollElem.clientWidth;
1003
+ const bodyScrollLeft = bodyScrollElem.scrollLeft;
1004
+ let tdElem = null;
1005
+ if (row) {
1006
+ const rowid = getRowid($xeTable, row);
1007
+ tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
1023
1008
  }
1024
- if (bodyScrollElem) {
1025
- const bodyWidth = bodyScrollElem.clientWidth;
1026
- const bodyScrollLeft = bodyScrollElem.scrollLeft;
1027
- let tdElem = null;
1028
- if (row) {
1029
- const rowid = getRowid($xeTable, row);
1030
- tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
1031
- }
1032
- if (!tdElem) {
1033
- tdElem = bodyScrollElem.querySelector(`.${column.id}`);
1009
+ if (!tdElem) {
1010
+ tdElem = bodyScrollElem.querySelector(`.${column.id}`);
1011
+ }
1012
+ if (tdElem) {
1013
+ const tdOffsetLeft = tdElem.offsetLeft + (scrollXLoad ? scrollXLeft : 0);
1014
+ const cellWidth = tdElem.clientWidth;
1015
+ if (isForce || !(tdOffsetLeft <= bodyScrollLeft + leftFixedWidth && tdOffsetLeft + cellWidth > bodyScrollLeft + leftFixedWidth) && !(tdOffsetLeft >= bodyScrollLeft + leftFixedWidth && tdOffsetLeft < bodyScrollLeft + bodyWidth - rightFixedWidth)) {
1016
+ if (tdOffsetLeft < bodyScrollLeft + leftFixedWidth) {
1017
+ return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
1018
+ } else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - rightFixedWidth) {
1019
+ return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
1034
1020
  }
1035
- if (tdElem) {
1036
- const tdOffsetLeft = tdElem.offsetLeft + (scrollXLoad ? scrollXLeft : 0);
1037
- const cellWidth = tdElem.clientWidth;
1038
- // 检测是否在可视区中
1039
- if (isForce || (!(tdOffsetLeft <= (bodyScrollLeft + leftFixedWidth) && (tdOffsetLeft + cellWidth) > (bodyScrollLeft + leftFixedWidth)) &&
1040
- !(tdOffsetLeft >= (bodyScrollLeft + leftFixedWidth) && tdOffsetLeft < (bodyScrollLeft + bodyWidth - rightFixedWidth)))) {
1041
- if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
1042
- return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
1043
- }
1044
- else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - rightFixedWidth)) {
1045
- return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
1046
- }
1047
- }
1021
+ }
1022
+ } else {
1023
+ if (scrollXLoad) {
1024
+ let tdOffsetLeft = 0;
1025
+ const cellWidth = column.renderWidth;
1026
+ for (let i = 0; i < visibleColumn.length; i++) {
1027
+ const currCol = visibleColumn[i];
1028
+ if (currCol === column || currCol.id === column.id) {
1029
+ break;
1030
+ }
1031
+ tdOffsetLeft += currCol.renderWidth;
1048
1032
  }
1049
- else {
1050
- if (scrollXLoad) {
1051
- let tdOffsetLeft = 0;
1052
- const cellWidth = column.renderWidth;
1053
- for (let i = 0; i < visibleColumn.length; i++) {
1054
- const currCol = visibleColumn[i];
1055
- if (currCol === column || currCol.id === column.id) {
1056
- break;
1057
- }
1058
- tdOffsetLeft += currCol.renderWidth;
1059
- }
1060
- // 检测是否在可视区中
1061
- if (isForce || (!(tdOffsetLeft <= (bodyScrollLeft + leftFixedWidth) && (tdOffsetLeft + cellWidth) > (bodyScrollLeft + leftFixedWidth)) &&
1062
- !(tdOffsetLeft >= (bodyScrollLeft + leftFixedWidth) && tdOffsetLeft < (bodyScrollLeft + bodyWidth - rightFixedWidth)))) {
1063
- if (tdOffsetLeft < bodyScrollLeft) {
1064
- return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
1065
- }
1066
- return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
1067
- }
1068
- }
1033
+ if (isForce || !(tdOffsetLeft <= bodyScrollLeft + leftFixedWidth && tdOffsetLeft + cellWidth > bodyScrollLeft + leftFixedWidth) && !(tdOffsetLeft >= bodyScrollLeft + leftFixedWidth && tdOffsetLeft < bodyScrollLeft + bodyWidth - rightFixedWidth)) {
1034
+ if (tdOffsetLeft < bodyScrollLeft) {
1035
+ return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
1036
+ }
1037
+ return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
1069
1038
  }
1039
+ }
1070
1040
  }
1071
- return Promise.resolve();
1041
+ }
1042
+ return Promise.resolve();
1072
1043
  }
1073
1044
  function hangleBolleanDefaultValue(currVal, defVal) {
1074
- return XEUtils.isBoolean(currVal) ? currVal : defVal;
1045
+ return XEUtils.isBoolean(currVal) ? currVal : defVal;
1075
1046
  }
1076
- export function handleCustomStoreConfig($xeTable) {
1077
- const { computeCustomOpts } = $xeTable.getComputeMaps();
1078
- const customOpts = computeCustomOpts.value;
1079
- const { storage, storeOptions } = customOpts;
1080
- const isAllCustom = storage === true;
1081
- const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
1082
- const isCustomAlign = hangleBolleanDefaultValue(storageOpts.align, isAllCustom);
1083
- const isCustomHeaderAlign = hangleBolleanDefaultValue(storageOpts.headerAlign, isAllCustom);
1084
- const isCustomFooterAlign = hangleBolleanDefaultValue(storageOpts.footerAlign, isAllCustom);
1085
- const isCustomResizable = hangleBolleanDefaultValue(storageOpts.resizable, isAllCustom);
1086
- const isCustomVisible = hangleBolleanDefaultValue(storageOpts.visible, isAllCustom);
1087
- const isCustomFixed = hangleBolleanDefaultValue(storageOpts.fixed, isAllCustom);
1088
- const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom);
1089
- const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom);
1090
- const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom);
1091
- const isCustomPager = hangleBolleanDefaultValue(storageOpts.pager, isAllCustom);
1092
- return {
1093
- isCustomAlign,
1094
- isCustomHeaderAlign,
1095
- isCustomFooterAlign,
1096
- isCustomResizable,
1097
- isCustomVisible,
1098
- isCustomFixed,
1099
- isCustomSort,
1100
- isCustomAggGroup,
1101
- isCustomAggFunc,
1102
- isCustomPager
1103
- };
1047
+ function handleCustomStoreConfig($xeTable) {
1048
+ const { computeCustomOpts } = $xeTable.getComputeMaps();
1049
+ const customOpts = computeCustomOpts.value;
1050
+ const { storage, storeOptions } = customOpts;
1051
+ const isAllCustom = storage === true;
1052
+ const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
1053
+ const isCustomAlign = hangleBolleanDefaultValue(storageOpts.align, isAllCustom);
1054
+ const isCustomHeaderAlign = hangleBolleanDefaultValue(storageOpts.headerAlign, isAllCustom);
1055
+ const isCustomFooterAlign = hangleBolleanDefaultValue(storageOpts.footerAlign, isAllCustom);
1056
+ const isCustomResizable = hangleBolleanDefaultValue(storageOpts.resizable, isAllCustom);
1057
+ const isCustomVisible = hangleBolleanDefaultValue(storageOpts.visible, isAllCustom);
1058
+ const isCustomFixed = hangleBolleanDefaultValue(storageOpts.fixed, isAllCustom);
1059
+ const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom);
1060
+ const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom);
1061
+ const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom);
1062
+ const isCustomPager = hangleBolleanDefaultValue(storageOpts.pager, isAllCustom);
1063
+ return {
1064
+ isCustomAlign,
1065
+ isCustomHeaderAlign,
1066
+ isCustomFooterAlign,
1067
+ isCustomResizable,
1068
+ isCustomVisible,
1069
+ isCustomFixed,
1070
+ isCustomSort,
1071
+ isCustomAggGroup,
1072
+ isCustomAggFunc,
1073
+ isCustomPager
1074
+ };
1104
1075
  }
1076
+ export {
1077
+ assembleColumn,
1078
+ clearTableAllStatus,
1079
+ clearTableDefaultStatus,
1080
+ colToVisible,
1081
+ convertHeaderColumnToRows,
1082
+ convertHeaderToGridRows,
1083
+ createColumn,
1084
+ createHandleGetRowId,
1085
+ createHandleUpdateRowId,
1086
+ createInternalData,
1087
+ createReactData,
1088
+ createRowId,
1089
+ destroyColumn,
1090
+ encodeRowid,
1091
+ getCalcHeight,
1092
+ getCellRestHeight,
1093
+ getCellValue,
1094
+ getColReMaxWidth,
1095
+ getColReMinWidth,
1096
+ getColumnList,
1097
+ getFirstChildColumn,
1098
+ getLastChildColumn,
1099
+ getRefElem,
1100
+ getRootColumn,
1101
+ getRowMaxHeight,
1102
+ getRowUniqueId,
1103
+ getRowid,
1104
+ getRowkey,
1105
+ handleCustomStoreConfig,
1106
+ handleFieldOrColumn,
1107
+ handleRowidOrRow,
1108
+ hasDeepKey,
1109
+ isColumnInfo,
1110
+ restoreScrollLocation,
1111
+ rowToVisible,
1112
+ setCellValue,
1113
+ toFilters,
1114
+ toTreePathSeq,
1115
+ watchColumn
1116
+ };