vxe-table 4.23.5 → 4.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/dist/all.esm.js +32456 -33938
  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/style.css +4501 -1
  75. package/es/style.mini.css +1 -0
  76. package/es/table/index.d.ts +2672 -0
  77. package/es/table/index.js +16 -11
  78. package/es/table/module/custom/hook.d.ts +1 -0
  79. package/es/table/module/custom/hook.js +462 -483
  80. package/es/table/module/custom/panel.d.ts +17 -0
  81. package/es/table/module/custom/panel.js +1482 -1559
  82. package/es/table/module/edit/hook.d.ts +1 -0
  83. package/es/table/module/edit/hook.js +1008 -1078
  84. package/es/table/module/export/export-panel.d.ts +27 -0
  85. package/es/table/module/export/export-panel.js +523 -575
  86. package/es/table/module/export/hook.d.ts +1 -0
  87. package/es/table/module/export/hook.js +1805 -1884
  88. package/es/table/module/export/import-panel.d.ts +27 -0
  89. package/es/table/module/export/import-panel.js +244 -252
  90. package/es/table/module/export/util.d.ts +5 -0
  91. package/es/table/module/export/util.js +20 -17
  92. package/es/table/module/filter/hook.d.ts +1 -0
  93. package/es/table/module/filter/hook.js +472 -487
  94. package/es/table/module/filter/panel.d.ts +16 -0
  95. package/es/table/module/filter/panel.js +251 -275
  96. package/es/table/module/keyboard/hook.d.ts +1 -0
  97. package/es/table/module/keyboard/hook.js +445 -497
  98. package/es/table/module/menu/hook.d.ts +1 -0
  99. package/es/table/module/menu/hook.js +295 -315
  100. package/es/table/module/menu/panel.d.ts +2 -0
  101. package/es/table/module/menu/panel.js +164 -183
  102. package/es/table/module/validator/hook.d.ts +1 -0
  103. package/es/table/module/validator/hook.js +522 -571
  104. package/es/table/render/index.d.ts +1 -0
  105. package/es/table/render/index.js +1402 -1362
  106. package/es/table/src/body.d.ts +24 -0
  107. package/es/table/src/body.js +850 -865
  108. package/es/table/src/cell.d.ts +192 -0
  109. package/es/table/src/cell.js +1209 -1207
  110. package/es/table/src/column.d.ts +263 -0
  111. package/es/table/src/column.js +178 -174
  112. package/es/table/src/columnInfo.d.ts +13 -0
  113. package/es/table/src/columnInfo.js +202 -196
  114. package/es/table/src/emits.d.ts +2 -0
  115. package/es/table/src/emits.js +126 -119
  116. package/es/table/src/footer.d.ts +45 -0
  117. package/es/table/src/footer.js +336 -340
  118. package/es/table/src/group.d.ts +178 -0
  119. package/es/table/src/group.js +49 -46
  120. package/es/table/src/header.d.ts +26 -0
  121. package/es/table/src/header.js +517 -519
  122. package/es/table/src/props.d.ts +238 -0
  123. package/es/table/src/props.js +331 -328
  124. package/es/table/src/store.d.ts +6 -0
  125. package/es/table/src/store.js +9 -6
  126. package/es/table/src/table.d.ts +539 -0
  127. package/es/table/src/table.js +14061 -15071
  128. package/es/table/src/use/cell-view.d.ts +10 -0
  129. package/es/table/src/use/cell-view.js +36 -33
  130. package/es/table/src/use/index.d.ts +1 -0
  131. package/es/table/src/use/index.js +1 -1
  132. package/es/table/src/util.d.ts +74 -0
  133. package/es/table/src/util.js +1038 -1026
  134. package/es/table/style.css +1 -1
  135. package/es/table/style.mini.css +1 -0
  136. package/es/toolbar/index.d.ts +340 -0
  137. package/es/toolbar/index.js +14 -9
  138. package/es/toolbar/src/toolbar.d.ts +75 -0
  139. package/es/toolbar/src/toolbar.js +605 -613
  140. package/es/toolbar/{style.min.css → style.mini.css} +1 -1
  141. package/es/ui/index.d.ts +86 -0
  142. package/es/ui/index.js +457 -501
  143. package/es/ui/src/anime.d.ts +10 -0
  144. package/es/ui/src/anime.js +40 -40
  145. package/es/ui/src/comp.d.ts +2 -0
  146. package/es/ui/src/comp.js +5 -2
  147. package/es/ui/src/dom.d.ts +80 -0
  148. package/es/ui/src/dom.js +377 -380
  149. package/es/ui/src/log.d.ts +6 -0
  150. package/es/ui/src/log.js +18 -13
  151. package/es/ui/src/utils.d.ts +23 -0
  152. package/es/ui/src/utils.js +57 -53
  153. package/es/ui/src/vn.d.ts +7 -0
  154. package/es/ui/src/vn.js +49 -42
  155. package/es/v-x-e-table/index.d.ts +3 -0
  156. package/es/v-x-e-table/index.js +6 -3
  157. package/es/vxe-colgroup/index.d.ts +3 -0
  158. package/es/vxe-colgroup/index.js +6 -3
  159. package/es/vxe-column/index.d.ts +3 -0
  160. package/es/vxe-column/index.js +6 -3
  161. package/es/vxe-grid/index.d.ts +3 -0
  162. package/es/vxe-grid/index.js +6 -3
  163. package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
  164. package/es/vxe-table/index.d.ts +3 -0
  165. package/es/vxe-table/index.js +6 -3
  166. package/es/vxe-table/style.css +1 -1
  167. package/es/vxe-table/style.mini.css +1 -0
  168. package/es/vxe-toolbar/index.d.ts +3 -0
  169. package/es/vxe-toolbar/index.js +6 -3
  170. package/es/vxe-toolbar/{style.min.css → style.mini.css} +1 -1
  171. package/es/vxe-ui/index.d.ts +3 -0
  172. package/es/vxe-ui/index.js +6 -3
  173. package/lib/colgroup/index.js +44 -18
  174. package/lib/colgroup/style/index.js +1 -1
  175. package/lib/column/index.js +44 -18
  176. package/lib/column/style/index.js +1 -1
  177. package/lib/components.js +58 -92
  178. package/lib/grid/index.js +42 -14
  179. package/lib/grid/src/emits.js +37 -6
  180. package/lib/grid/src/grid.js +850 -1195
  181. package/lib/grid/src/props.js +27 -11
  182. package/lib/grid/style/index.js +1 -1
  183. package/lib/{vxe-grid/style/style.min.css → grid/style/style.mini.css} +1 -1
  184. package/lib/iconfont.1792979665397.ttf +0 -0
  185. package/lib/iconfont.1792979665397.woff +0 -0
  186. package/lib/iconfont.1792979665397.woff2 +0 -0
  187. package/lib/index.common.js +35 -19
  188. package/lib/index.js +37 -0
  189. package/lib/index.umd.js +30584 -24324
  190. package/lib/index.umd.min.js +3 -1
  191. package/lib/locale/ar-EG.umd.js +948 -0
  192. package/lib/locale/de-DE.umd.js +948 -0
  193. package/lib/locale/en-US.umd.js +948 -0
  194. package/lib/locale/es-ES.umd.js +948 -0
  195. package/lib/locale/fr-FR.umd.js +948 -0
  196. package/lib/locale/hu-HU.umd.js +948 -0
  197. package/lib/locale/hy-AM.umd.js +948 -0
  198. package/lib/locale/id-ID.umd.js +948 -0
  199. package/lib/locale/it-IT.umd.js +948 -0
  200. package/lib/locale/ja-JP.umd.js +948 -0
  201. package/lib/locale/ko-KR.umd.js +948 -0
  202. package/lib/locale/lang/ar-EG.js +681 -664
  203. package/lib/locale/lang/ar-EG.umd.js +913 -892
  204. package/lib/locale/lang/de-DE.js +681 -664
  205. package/lib/locale/lang/de-DE.umd.js +913 -892
  206. package/lib/locale/lang/en-US.js +678 -661
  207. package/lib/locale/lang/en-US.umd.js +913 -892
  208. package/lib/locale/lang/es-ES.js +681 -664
  209. package/lib/locale/lang/es-ES.umd.js +913 -892
  210. package/lib/locale/lang/fr-FR.js +654 -637
  211. package/lib/locale/lang/fr-FR.umd.js +913 -892
  212. package/lib/locale/lang/hu-HU.js +681 -664
  213. package/lib/locale/lang/hu-HU.umd.js +913 -892
  214. package/lib/locale/lang/hy-AM.js +681 -664
  215. package/lib/locale/lang/hy-AM.umd.js +913 -892
  216. package/lib/locale/lang/id-ID.js +681 -664
  217. package/lib/locale/lang/id-ID.umd.js +913 -892
  218. package/lib/locale/lang/it-IT.js +661 -644
  219. package/lib/locale/lang/it-IT.umd.js +912 -891
  220. package/lib/locale/lang/ja-JP.js +710 -693
  221. package/lib/locale/lang/ja-JP.umd.js +913 -892
  222. package/lib/locale/lang/ko-KR.js +681 -664
  223. package/lib/locale/lang/ko-KR.umd.js +913 -892
  224. package/lib/locale/lang/ms-MY.js +681 -664
  225. package/lib/locale/lang/ms-MY.umd.js +913 -892
  226. package/lib/locale/lang/nb-NO.js +681 -664
  227. package/lib/locale/lang/nb-NO.umd.js +913 -892
  228. package/lib/locale/lang/pt-BR.js +681 -664
  229. package/lib/locale/lang/pt-BR.umd.js +913 -892
  230. package/lib/locale/lang/ru-RU.js +690 -673
  231. package/lib/locale/lang/ru-RU.umd.js +913 -892
  232. package/lib/locale/lang/th-TH.js +681 -664
  233. package/lib/locale/lang/th-TH.umd.js +913 -892
  234. package/lib/locale/lang/ug-CN.js +681 -664
  235. package/lib/locale/lang/ug-CN.umd.js +913 -892
  236. package/lib/locale/lang/uk-UA.js +674 -657
  237. package/lib/locale/lang/uk-UA.umd.js +913 -892
  238. package/lib/locale/lang/uz-UZ.js +583 -566
  239. package/lib/locale/lang/uz-UZ.umd.js +908 -887
  240. package/lib/locale/lang/vi-VN.js +681 -664
  241. package/lib/locale/lang/vi-VN.umd.js +913 -892
  242. package/lib/locale/lang/zh-CHT.js +681 -664
  243. package/lib/locale/lang/zh-CHT.umd.js +913 -892
  244. package/lib/locale/lang/zh-CN.js +681 -664
  245. package/lib/locale/lang/zh-CN.umd.js +913 -892
  246. package/lib/locale/lang/zh-HK.js +928 -7
  247. package/lib/locale/lang/zh-HK.umd.js +945 -20
  248. package/lib/locale/lang/zh-MO.js +928 -7
  249. package/lib/locale/lang/zh-MO.umd.js +945 -20
  250. package/lib/locale/lang/zh-TC.js +928 -7
  251. package/lib/locale/lang/zh-TC.umd.js +948 -0
  252. package/lib/locale/lang/zh-TW.js +928 -7
  253. package/lib/locale/lang/zh-TW.umd.js +945 -20
  254. package/lib/locale/ms-MY.umd.js +948 -0
  255. package/lib/locale/nb-NO.umd.js +948 -0
  256. package/lib/locale/pt-BR.umd.js +948 -0
  257. package/lib/locale/ru-RU.umd.js +948 -0
  258. package/lib/locale/th-TH.umd.js +948 -0
  259. package/lib/locale/ug-CN.umd.js +948 -0
  260. package/lib/locale/uk-UA.umd.js +948 -0
  261. package/lib/locale/uz-UZ.umd.js +948 -0
  262. package/lib/locale/vi-VN.umd.js +948 -0
  263. package/lib/locale/zh-CHT.umd.js +948 -0
  264. package/lib/locale/zh-CN.umd.js +948 -0
  265. package/lib/locale/zh-HK.umd.js +948 -0
  266. package/lib/locale/zh-MO.umd.js +948 -0
  267. package/lib/locale/zh-TC.umd.js +948 -0
  268. package/lib/locale/zh-TW.umd.js +948 -0
  269. package/lib/style.css +4501 -1
  270. package/lib/style.mini.css +1 -0
  271. package/lib/table/index.js +45 -17
  272. package/lib/table/module/custom/hook.js +132 -252
  273. package/lib/table/module/custom/panel.js +919 -970
  274. package/lib/table/module/edit/hook.js +248 -618
  275. package/lib/table/module/export/export-panel.js +390 -347
  276. package/lib/table/module/export/hook.js +745 -1179
  277. package/lib/table/module/export/import-panel.js +170 -136
  278. package/lib/table/module/export/util.js +37 -14
  279. package/lib/table/module/filter/hook.js +127 -227
  280. package/lib/table/module/filter/panel.js +177 -208
  281. package/lib/table/module/keyboard/hook.js +93 -172
  282. package/lib/table/module/menu/hook.js +86 -165
  283. package/lib/table/module/menu/panel.js +176 -141
  284. package/lib/table/module/validator/hook.js +164 -271
  285. package/lib/table/render/index.js +700 -1147
  286. package/lib/table/src/body.js +426 -559
  287. package/lib/table/src/cell.js +619 -987
  288. package/lib/table/src/column.js +55 -30
  289. package/lib/table/src/columnInfo.js +88 -110
  290. package/lib/table/src/emits.js +145 -13
  291. package/lib/table/src/footer.js +181 -240
  292. package/lib/table/src/group.js +56 -34
  293. package/lib/table/src/header.js +292 -367
  294. package/lib/table/src/props.js +27 -12
  295. package/lib/table/src/store.js +25 -9
  296. package/lib/table/src/table.js +14179 -1023
  297. package/lib/table/src/use/cell-view.js +47 -37
  298. package/lib/table/src/use/index.js +17 -15
  299. package/lib/table/src/util.js +236 -337
  300. package/lib/table/style/index.js +1 -1
  301. package/lib/table/style/style.css +1 -1
  302. package/lib/table/style/style.mini.css +1 -0
  303. package/lib/toolbar/index.js +42 -14
  304. package/lib/toolbar/src/toolbar.js +271 -379
  305. package/lib/toolbar/style/index.js +1 -1
  306. package/lib/toolbar/style/{style.min.css → style.mini.css} +1 -1
  307. package/lib/ui/index.js +153 -195
  308. package/lib/ui/src/anime.js +49 -29
  309. package/lib/ui/src/comp.js +23 -6
  310. package/lib/ui/src/dom.js +114 -147
  311. package/lib/ui/src/log.js +34 -18
  312. package/lib/ui/src/utils.js +57 -45
  313. package/lib/ui/src/vn.js +60 -34
  314. package/lib/ui/style/index.js +1 -1
  315. package/lib/v-x-e-table/index.js +35 -19
  316. package/lib/vxe-colgroup/index.js +35 -19
  317. package/lib/vxe-colgroup/style/index.js +1 -1
  318. package/lib/vxe-column/index.js +35 -19
  319. package/lib/vxe-column/style/index.js +1 -1
  320. package/lib/vxe-grid/index.js +35 -19
  321. package/lib/vxe-grid/style/index.js +1 -1
  322. package/{es/grid/style.min.css → lib/vxe-grid/style/style.mini.css} +1 -1
  323. package/lib/vxe-table/index.js +35 -19
  324. package/lib/vxe-table/style/index.js +1 -1
  325. package/lib/vxe-table/style/style.css +1 -1
  326. package/lib/vxe-table/style/style.mini.css +1 -0
  327. package/lib/vxe-toolbar/index.js +35 -19
  328. package/lib/vxe-toolbar/style/index.js +1 -1
  329. package/lib/vxe-toolbar/style/{style.min.css → style.mini.css} +1 -1
  330. package/lib/vxe-ui/index.js +35 -19
  331. package/lib/vxe-ui/style/index.js +1 -1
  332. package/package.json +8 -4
  333. package/packages/locale/lang/zh-HK.ts +907 -3
  334. package/packages/locale/lang/zh-MO.ts +907 -3
  335. package/packages/locale/lang/zh-TC.ts +907 -3
  336. package/packages/locale/lang/zh-TW.ts +907 -3
  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.min.css +0 -1
  342. package/es/table/style.min.css +0 -1
  343. package/es/vxe-table/style.min.css +0 -1
  344. package/es/vxe-v-x-e-table/index.js +0 -3
  345. package/lib/colgroup/index.min.js +0 -1
  346. package/lib/column/index.min.js +0 -1
  347. package/lib/components.min.js +0 -1
  348. package/lib/grid/index.min.js +0 -1
  349. package/lib/grid/src/emits.min.js +0 -1
  350. package/lib/grid/src/grid.min.js +0 -1
  351. package/lib/grid/src/props.min.js +0 -1
  352. package/lib/index.css +0 -1
  353. package/lib/index.min.css +0 -1
  354. package/lib/locale/lang/ar-EG.d.ts +0 -2
  355. package/lib/locale/lang/ar-EG.min.js +0 -1
  356. package/lib/locale/lang/de-DE.d.ts +0 -2
  357. package/lib/locale/lang/de-DE.min.js +0 -1
  358. package/lib/locale/lang/en-US.d.ts +0 -2
  359. package/lib/locale/lang/en-US.min.js +0 -1
  360. package/lib/locale/lang/es-ES.d.ts +0 -2
  361. package/lib/locale/lang/es-ES.min.js +0 -1
  362. package/lib/locale/lang/fr-FR.d.ts +0 -2
  363. package/lib/locale/lang/fr-FR.min.js +0 -1
  364. package/lib/locale/lang/hu-HU.d.ts +0 -2
  365. package/lib/locale/lang/hu-HU.min.js +0 -1
  366. package/lib/locale/lang/hy-AM.d.ts +0 -2
  367. package/lib/locale/lang/hy-AM.min.js +0 -1
  368. package/lib/locale/lang/id-ID.d.ts +0 -2
  369. package/lib/locale/lang/id-ID.min.js +0 -1
  370. package/lib/locale/lang/it-IT.d.ts +0 -2
  371. package/lib/locale/lang/it-IT.min.js +0 -1
  372. package/lib/locale/lang/ja-JP.d.ts +0 -2
  373. package/lib/locale/lang/ja-JP.min.js +0 -1
  374. package/lib/locale/lang/ko-KR.d.ts +0 -2
  375. package/lib/locale/lang/ko-KR.min.js +0 -1
  376. package/lib/locale/lang/ms-MY.d.ts +0 -2
  377. package/lib/locale/lang/ms-MY.min.js +0 -1
  378. package/lib/locale/lang/nb-NO.d.ts +0 -2
  379. package/lib/locale/lang/nb-NO.min.js +0 -1
  380. package/lib/locale/lang/pt-BR.d.ts +0 -2
  381. package/lib/locale/lang/pt-BR.min.js +0 -1
  382. package/lib/locale/lang/ru-RU.d.ts +0 -2
  383. package/lib/locale/lang/ru-RU.min.js +0 -1
  384. package/lib/locale/lang/th-TH.d.ts +0 -2
  385. package/lib/locale/lang/th-TH.min.js +0 -1
  386. package/lib/locale/lang/ug-CN.d.ts +0 -2
  387. package/lib/locale/lang/ug-CN.min.js +0 -1
  388. package/lib/locale/lang/uk-UA.d.ts +0 -2
  389. package/lib/locale/lang/uk-UA.min.js +0 -1
  390. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  391. package/lib/locale/lang/uz-UZ.min.js +0 -1
  392. package/lib/locale/lang/vi-VN.d.ts +0 -2
  393. package/lib/locale/lang/vi-VN.min.js +0 -1
  394. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  395. package/lib/locale/lang/zh-CHT.min.js +0 -1
  396. package/lib/locale/lang/zh-CN.d.ts +0 -2
  397. package/lib/locale/lang/zh-CN.min.js +0 -1
  398. package/lib/locale/lang/zh-HK.d.ts +0 -2
  399. package/lib/locale/lang/zh-HK.min.js +0 -1
  400. package/lib/locale/lang/zh-MO.d.ts +0 -2
  401. package/lib/locale/lang/zh-MO.min.js +0 -1
  402. package/lib/locale/lang/zh-TC.min.js +0 -1
  403. package/lib/locale/lang/zh-TW.d.ts +0 -2
  404. package/lib/locale/lang/zh-TW.min.js +0 -1
  405. package/lib/style.min.css +0 -1
  406. package/lib/table/index.min.js +0 -1
  407. package/lib/table/module/custom/hook.min.js +0 -1
  408. package/lib/table/module/custom/panel.min.js +0 -1
  409. package/lib/table/module/edit/hook.min.js +0 -1
  410. package/lib/table/module/export/export-panel.min.js +0 -1
  411. package/lib/table/module/export/hook.min.js +0 -1
  412. package/lib/table/module/export/import-panel.min.js +0 -1
  413. package/lib/table/module/export/util.min.js +0 -1
  414. package/lib/table/module/filter/hook.min.js +0 -1
  415. package/lib/table/module/filter/panel.min.js +0 -1
  416. package/lib/table/module/keyboard/hook.min.js +0 -1
  417. package/lib/table/module/menu/hook.min.js +0 -1
  418. package/lib/table/module/menu/panel.min.js +0 -1
  419. package/lib/table/module/validator/hook.min.js +0 -1
  420. package/lib/table/render/index.min.js +0 -1
  421. package/lib/table/src/body.min.js +0 -1
  422. package/lib/table/src/cell.min.js +0 -1
  423. package/lib/table/src/column.min.js +0 -1
  424. package/lib/table/src/columnInfo.min.js +0 -1
  425. package/lib/table/src/emits.min.js +0 -1
  426. package/lib/table/src/footer.min.js +0 -1
  427. package/lib/table/src/group.min.js +0 -1
  428. package/lib/table/src/header.min.js +0 -1
  429. package/lib/table/src/props.min.js +0 -1
  430. package/lib/table/src/store.min.js +0 -1
  431. package/lib/table/src/table.min.js +0 -1
  432. package/lib/table/src/use/cell-view.min.js +0 -1
  433. package/lib/table/src/use/index.min.js +0 -1
  434. package/lib/table/src/util.min.js +0 -1
  435. package/lib/table/style/style.min.css +0 -1
  436. package/lib/toolbar/index.min.js +0 -1
  437. package/lib/toolbar/src/toolbar.min.js +0 -1
  438. package/lib/ui/index.min.js +0 -1
  439. package/lib/ui/src/anime.min.js +0 -1
  440. package/lib/ui/src/comp.min.js +0 -1
  441. package/lib/ui/src/dom.min.js +0 -1
  442. package/lib/ui/src/log.min.js +0 -1
  443. package/lib/ui/src/utils.min.js +0 -1
  444. package/lib/ui/src/vn.min.js +0 -1
  445. package/lib/ui/style/style.min.css +0 -0
  446. package/lib/v-x-e-table/index.min.js +0 -1
  447. package/lib/v-x-e-table/style/index.js +0 -1
  448. package/lib/v-x-e-table/style/style.css +0 -0
  449. package/lib/v-x-e-table/style/style.min.css +0 -0
  450. package/lib/vxe-colgroup/index.min.js +0 -1
  451. package/lib/vxe-colgroup/style/style.min.css +0 -0
  452. package/lib/vxe-column/index.min.js +0 -1
  453. package/lib/vxe-column/style/style.min.css +0 -0
  454. package/lib/vxe-grid/index.min.js +0 -1
  455. package/lib/vxe-table/index.min.js +0 -1
  456. package/lib/vxe-table/style/style.min.css +0 -1
  457. package/lib/vxe-toolbar/index.min.js +0 -1
  458. package/lib/vxe-ui/index.min.js +0 -1
  459. package/lib/vxe-ui/style/style.min.css +0 -0
  460. package/lib/vxe-v-x-e-table/index.js +0 -21
  461. package/lib/vxe-v-x-e-table/index.min.js +0 -1
  462. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  463. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  464. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
  465. /package/{es/iconfont.1792838769925.ttf → dist/iconfont.1792979665397.ttf} +0 -0
  466. /package/{es/iconfont.1792838769925.woff → dist/iconfont.1792979665397.woff} +0 -0
  467. /package/{es/iconfont.1792838769925.woff2 → dist/iconfont.1792979665397.woff2} +0 -0
  468. /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
  469. /package/es/column/{style.min.css → style.mini.css} +0 -0
  470. /package/{lib/iconfont.1792838769925.ttf → es/iconfont.1792979665397.ttf} +0 -0
  471. /package/{lib/iconfont.1792838769925.woff → es/iconfont.1792979665397.woff} +0 -0
  472. /package/{lib/iconfont.1792838769925.woff2 → es/iconfont.1792979665397.woff2} +0 -0
  473. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  474. /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
  475. /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
  476. /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
  477. /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
  478. /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
  479. /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
  480. /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
  481. /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
  482. /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
@@ -1,1266 +1,1268 @@
1
- import { h } from 'vue';
2
- import XEUtils from 'xe-utils';
3
- import { VxeUI } from '../../ui';
4
- import { getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
5
- import { updateCellTitle } from '../../ui/src/dom';
6
- import { createColumn, getRowid } from './util';
7
- import { getSlotVNs } from '../../ui/src/vn';
1
+ import { h } from "vue";
2
+ import XEUtils from "xe-utils";
3
+ import { VxeUI } from "../../ui";
4
+ import { getFuncText, isEnableConf, formatText, eqEmptyValue } from "../../ui/src/utils";
5
+ import { updateCellTitle } from "../../ui/src/dom";
6
+ import { createColumn, getRowid } from "./util";
7
+ import { getSlotVNs } from "../../ui/src/vn";
8
8
  const { getConfig, getI18n, getIcon, renderer, renderEmptyElement } = VxeUI;
9
9
  function renderTitlePrefixIcon(params) {
10
- const { $table, column } = params;
11
- const titlePrefix = column.titlePrefix || column.titleHelp;
12
- if (titlePrefix) {
13
- return h('span', {
14
- class: ['vxe-cell-title-prefix-icon', titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ''],
15
- onMouseenter(evnt) {
16
- $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
17
- },
18
- onMouseleave(evnt) {
19
- $table.handleTargetLeaveEvent(evnt);
20
- }
21
- }, [
22
- h('i', {
23
- class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
24
- })
25
- ]);
26
- }
27
- return renderEmptyElement($table);
10
+ const { $table, column } = params;
11
+ const titlePrefix = column.titlePrefix || column.titleHelp;
12
+ if (titlePrefix) {
13
+ return h("span", {
14
+ class: ["vxe-cell-title-prefix-icon", titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ""],
15
+ onMouseenter(evnt) {
16
+ $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
17
+ },
18
+ onMouseleave(evnt) {
19
+ $table.handleTargetLeaveEvent(evnt);
20
+ }
21
+ }, [
22
+ h("i", {
23
+ class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
24
+ })
25
+ ]);
26
+ }
27
+ return renderEmptyElement($table);
28
28
  }
29
29
  function renderTitleSuffixIcon(params) {
30
- const { $table, column } = params;
31
- const titleSuffix = column.titleSuffix;
32
- if (titleSuffix) {
33
- return h('span', {
34
- class: ['vxe-cell-title-suffix-icon', titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ''],
35
- onMouseenter(evnt) {
36
- $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
37
- },
38
- onMouseleave(evnt) {
39
- $table.handleTargetLeaveEvent(evnt);
40
- }
41
- }, [
42
- h('i', {
43
- class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
44
- })
45
- ]);
46
- }
47
- return renderEmptyElement($table);
30
+ const { $table, column } = params;
31
+ const titleSuffix = column.titleSuffix;
32
+ if (titleSuffix) {
33
+ return h("span", {
34
+ class: ["vxe-cell-title-suffix-icon", titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ""],
35
+ onMouseenter(evnt) {
36
+ $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
37
+ },
38
+ onMouseleave(evnt) {
39
+ $table.handleTargetLeaveEvent(evnt);
40
+ }
41
+ }, [
42
+ h("i", {
43
+ class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
44
+ })
45
+ ]);
46
+ }
47
+ return renderEmptyElement($table);
48
48
  }
49
49
  function renderCellDragIcon(params) {
50
- const { $table, column } = params;
51
- const { context } = $table;
52
- const tableSlots = context.slots;
53
- const tableProps = $table.props;
54
- const { slots } = column;
55
- const { dragConfig } = tableProps;
56
- const { computeRowDragOpts } = $table.getComputeMaps();
57
- const rowDragOpts = computeRowDragOpts.value;
58
- const { icon, trigger, disabledMethod } = rowDragOpts;
59
- const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
60
- const isDisabled = rDisabledMethod && rDisabledMethod(params);
61
- const rowDragIconSlot = (slots ? slots.rowDragIcon || slots['row-drag-icon'] : null) || tableSlots.rowDragIcon || tableSlots['row-drag-icon'];
62
- const ons = {};
63
- if (trigger !== 'cell') {
64
- ons.onMousedown = (evnt) => {
65
- if (!isDisabled) {
66
- $table.handleCellDragMousedownEvent(evnt, params);
67
- }
68
- };
69
- ons.onMouseup = $table.handleCellDragMouseupEvent;
70
- }
71
- return h('span', Object.assign({ key: 'dg', class: ['vxe-cell--drag-handle', {
72
- 'is--disabled': isDisabled
73
- }] }, ons), rowDragIconSlot
74
- ? $table.callSlot(rowDragIconSlot, params)
75
- : [
76
- h('i', {
77
- class: icon || (dragConfig ? dragConfig.rowIcon : '') || getIcon().TABLE_DRAG_ROW
78
- })
79
- ]);
50
+ const { $table, column } = params;
51
+ const { context } = $table;
52
+ const tableSlots = context.slots;
53
+ const tableProps = $table.props;
54
+ const { slots } = column;
55
+ const { dragConfig } = tableProps;
56
+ const { computeRowDragOpts } = $table.getComputeMaps();
57
+ const rowDragOpts = computeRowDragOpts.value;
58
+ const { icon, trigger, disabledMethod } = rowDragOpts;
59
+ const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
60
+ const isDisabled = rDisabledMethod && rDisabledMethod(params);
61
+ const rowDragIconSlot = (slots ? slots.rowDragIcon || slots["row-drag-icon"] : null) || tableSlots.rowDragIcon || tableSlots["row-drag-icon"];
62
+ const ons = {};
63
+ if (trigger !== "cell") {
64
+ ons.onMousedown = (evnt) => {
65
+ if (!isDisabled) {
66
+ $table.handleCellDragMousedownEvent(evnt, params);
67
+ }
68
+ };
69
+ ons.onMouseup = $table.handleCellDragMouseupEvent;
70
+ }
71
+ return h("span", {
72
+ key: "dg",
73
+ class: ["vxe-cell--drag-handle", {
74
+ "is--disabled": isDisabled
75
+ }],
76
+ ...ons
77
+ }, rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params) : [
78
+ h("i", {
79
+ class: icon || (dragConfig ? dragConfig.rowIcon : "") || getIcon().TABLE_DRAG_ROW
80
+ })
81
+ ]);
80
82
  }
81
83
  function renderCellBaseVNs(params, content) {
82
- const { $table, column, level } = params;
83
- const { dragSort } = column;
84
- const tableProps = $table.props;
85
- const { treeConfig, dragConfig } = tableProps;
86
- const { computeRowOpts, computeRowDragOpts, computeTreeOpts } = $table.getComputeMaps();
87
- const rowOpts = computeRowOpts.value;
88
- const rowDragOpts = computeRowDragOpts.value;
89
- const treeOpts = computeTreeOpts.value;
90
- const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
91
- const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
92
- const vns = [];
93
- if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
94
- if (treeConfig) {
95
- if (treeOpts.transform && (isPeerDrag || isCrossDrag || !level)) {
96
- vns.push(renderCellDragIcon(params));
97
- }
98
- }
99
- else {
100
- vns.push(renderCellDragIcon(params));
101
- }
84
+ const { $table, column, level } = params;
85
+ const { dragSort } = column;
86
+ const tableProps = $table.props;
87
+ const { treeConfig, dragConfig } = tableProps;
88
+ const { computeRowOpts, computeRowDragOpts, computeTreeOpts } = $table.getComputeMaps();
89
+ const rowOpts = computeRowOpts.value;
90
+ const rowDragOpts = computeRowDragOpts.value;
91
+ const treeOpts = computeTreeOpts.value;
92
+ const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
93
+ const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
94
+ const vns = [];
95
+ if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
96
+ if (treeConfig) {
97
+ if (treeOpts.transform && (isPeerDrag || isCrossDrag || !level)) {
98
+ vns.push(
99
+ renderCellDragIcon(params)
100
+ );
101
+ }
102
+ } else {
103
+ vns.push(
104
+ renderCellDragIcon(params)
105
+ );
102
106
  }
103
- return vns.concat(XEUtils.isArray(content) ? content : [content]);
107
+ }
108
+ return vns.concat(XEUtils.isArray(content) ? content : [content]);
104
109
  }
105
110
  function renderHeaderCellDragIcon(params) {
106
- const { $table, column } = params;
107
- const { context } = $table;
108
- const tableSlots = context.slots;
109
- const { slots } = column;
110
- const { computeColumnOpts, computeColumnDragOpts } = $table.getComputeMaps();
111
- const columnOpts = computeColumnOpts.value;
112
- const columnDragOpts = computeColumnDragOpts.value;
113
- const { showIcon, icon, trigger, isPeerDrag, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts;
114
- if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
115
- if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
116
- const isDisabled = disabledMethod && disabledMethod(params);
117
- const columnDragIconSlot = (slots ? slots.columnDragIcon || slots['column-drag-icon'] : null) || tableSlots.columnDragIcon || tableSlots['column-drag-icon'];
118
- const ons = {};
119
- if (trigger !== 'cell') {
120
- ons.onMousedown = (evnt) => {
121
- if (!isDisabled) {
122
- $table.handleHeaderCellDragMousedownEvent(evnt, params);
123
- }
124
- };
125
- ons.onMouseup = $table.handleHeaderCellDragMouseupEvent;
126
- }
127
- return h('span', Object.assign({ key: 'dg', class: ['vxe-cell--drag-handle', {
128
- 'is--disabled': isDisabled
129
- }] }, ons), columnDragIconSlot
130
- ? $table.callSlot(columnDragIconSlot, params)
131
- : [
132
- h('i', {
133
- class: icon || getIcon().TABLE_DRAG_COLUMN
134
- })
135
- ]);
136
- }
111
+ const { $table, column } = params;
112
+ const { context } = $table;
113
+ const tableSlots = context.slots;
114
+ const { slots } = column;
115
+ const { computeColumnOpts, computeColumnDragOpts } = $table.getComputeMaps();
116
+ const columnOpts = computeColumnOpts.value;
117
+ const columnDragOpts = computeColumnDragOpts.value;
118
+ const { showIcon, icon, trigger, isPeerDrag, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts;
119
+ if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
120
+ if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
121
+ const isDisabled = disabledMethod && disabledMethod(params);
122
+ const columnDragIconSlot = (slots ? slots.columnDragIcon || slots["column-drag-icon"] : null) || tableSlots.columnDragIcon || tableSlots["column-drag-icon"];
123
+ const ons = {};
124
+ if (trigger !== "cell") {
125
+ ons.onMousedown = (evnt) => {
126
+ if (!isDisabled) {
127
+ $table.handleHeaderCellDragMousedownEvent(evnt, params);
128
+ }
129
+ };
130
+ ons.onMouseup = $table.handleHeaderCellDragMouseupEvent;
131
+ }
132
+ return h("span", {
133
+ key: "dg",
134
+ class: ["vxe-cell--drag-handle", {
135
+ "is--disabled": isDisabled
136
+ }],
137
+ ...ons
138
+ }, columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params) : [
139
+ h("i", {
140
+ class: icon || getIcon().TABLE_DRAG_COLUMN
141
+ })
142
+ ]);
137
143
  }
138
- return renderEmptyElement($table);
144
+ }
145
+ return renderEmptyElement($table);
139
146
  }
140
147
  function renderHeaderCellBaseVNs(params, content) {
141
- const vns = [
142
- renderTitlePrefixIcon(params),
143
- renderHeaderCellDragIcon(params),
144
- ...(XEUtils.isArray(content) ? content : [content]),
145
- renderTitleSuffixIcon(params)
146
- ];
147
- return vns;
148
+ const vns = [
149
+ renderTitlePrefixIcon(params),
150
+ renderHeaderCellDragIcon(params),
151
+ ...XEUtils.isArray(content) ? content : [content],
152
+ renderTitleSuffixIcon(params)
153
+ ];
154
+ return vns;
148
155
  }
149
156
  function getRenderDefaultColumnTitle(column, content) {
150
- if (column.type === 'html' && XEUtils.isString(content)) {
151
- return h('span', {
152
- key: 'ch',
153
- innerHTML: content
154
- });
155
- }
156
- return h('span', {
157
- key: 'ct'
158
- }, getSlotVNs(content));
157
+ if (column.type === "html" && XEUtils.isString(content)) {
158
+ return h("span", {
159
+ key: "ch",
160
+ innerHTML: content
161
+ });
162
+ }
163
+ return h("span", {
164
+ key: "ct"
165
+ }, getSlotVNs(content));
159
166
  }
160
167
  function renderTitleContent(params, content) {
161
- const { $table, column } = params;
162
- const tableProps = $table.props;
163
- const tableReactData = $table.reactData;
164
- const { computeHeaderTooltipOpts } = $table.getComputeMaps();
165
- const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
166
- const { isRowGroupStatus } = tableReactData;
167
- const { showHeaderOverflow, slots } = column;
168
- const titleSlot = slots ? slots.title : null;
169
- const headerTooltipOpts = computeHeaderTooltipOpts.value;
170
- const showAllTip = headerTooltipOpts.showAll;
171
- const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
172
- const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title';
173
- const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'tooltip';
174
- const ons = {};
175
- if (showTitle || showTooltip || showAllTip) {
176
- ons.onMouseenter = (evnt) => {
177
- if (tableReactData.isDragResize) {
178
- return;
179
- }
180
- if (showTitle) {
181
- updateCellTitle(evnt.currentTarget, column);
182
- }
183
- else if (showTooltip || showAllTip) {
184
- $table.triggerHeaderTooltipEvent(evnt, params);
185
- }
186
- };
168
+ const { $table, column } = params;
169
+ const tableProps = $table.props;
170
+ const tableReactData = $table.reactData;
171
+ const { computeHeaderTooltipOpts } = $table.getComputeMaps();
172
+ const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
173
+ const { isRowGroupStatus } = tableReactData;
174
+ const { showHeaderOverflow, slots } = column;
175
+ const titleSlot = slots ? slots.title : null;
176
+ const headerTooltipOpts = computeHeaderTooltipOpts.value;
177
+ const showAllTip = headerTooltipOpts.showAll;
178
+ const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
179
+ const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === "title";
180
+ const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === "tooltip";
181
+ const ons = {};
182
+ if (showTitle || showTooltip || showAllTip) {
183
+ ons.onMouseenter = (evnt) => {
184
+ if (tableReactData.isDragResize) {
185
+ return;
186
+ }
187
+ if (showTitle) {
188
+ updateCellTitle(evnt.currentTarget, column);
189
+ } else if (showTooltip || showAllTip) {
190
+ $table.triggerHeaderTooltipEvent(evnt, params);
191
+ }
192
+ };
193
+ }
194
+ if (showTooltip || showAllTip) {
195
+ ons.onMouseleave = (evnt) => {
196
+ if (tableReactData.isDragResize) {
197
+ return;
198
+ }
199
+ if (showTooltip || showAllTip) {
200
+ $table.handleTargetLeaveEvent(evnt);
201
+ }
202
+ };
203
+ }
204
+ const titleVN = getRenderDefaultColumnTitle(column, content);
205
+ return [
206
+ h("span", {
207
+ class: "vxe-cell--title",
208
+ ...ons
209
+ }, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles ? $table.getPivotTableAggregateRenderColTitles(column, titleVN) : titleSlot ? $table.callSlot(titleSlot, params) : [
210
+ titleVN
211
+ ])
212
+ ];
213
+ }
214
+ function getFooterContent(params) {
215
+ const { $table, column, row } = params;
216
+ const tableProps = $table.props;
217
+ const { editConfig } = tableProps;
218
+ const { slots, editRender, cellRender } = column;
219
+ const footerSlot = slots ? slots.footer : null;
220
+ if (footerSlot) {
221
+ return $table.callSlot(footerSlot, params);
222
+ }
223
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
224
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
225
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
226
+ const renderOpts = editRenderOpts || cellRenderOpts;
227
+ const itemValue = $table.getFooterCellLabel(row, column);
228
+ if (renderOpts) {
229
+ const { computeRendererOpts } = $table.getComputeMaps();
230
+ const rendererOpts = computeRendererOpts.value;
231
+ const compConf = renderOpts.name ? rendererOpts[renderOpts.name] || renderer.get(renderOpts.name) : null;
232
+ if (compConf) {
233
+ const rtFooter = compConf.renderTableFooter || compConf.renderFooter;
234
+ if (rtFooter) {
235
+ const footParams = Object.assign(params, {
236
+ cellValue: itemValue,
237
+ itemValue
238
+ });
239
+ return getSlotVNs(rtFooter(renderOpts, footParams));
240
+ }
187
241
  }
188
- if (showTooltip || showAllTip) {
189
- ons.onMouseleave = (evnt) => {
190
- if (tableReactData.isDragResize) {
191
- return;
192
- }
193
- if (showTooltip || showAllTip) {
194
- $table.handleTargetLeaveEvent(evnt);
195
- }
196
- };
242
+ }
243
+ return [
244
+ h("span", {
245
+ class: "vxe-cell--label"
246
+ }, formatText(itemValue, 1))
247
+ ];
248
+ }
249
+ function getDefaultCellLabel(params) {
250
+ const { $table, row, column } = params;
251
+ return formatText($table.getCellLabel(row, column), 1);
252
+ }
253
+ function renderCellHandle(params) {
254
+ const { column, row, $table } = params;
255
+ const tableProps = $table.props;
256
+ const tableReactData = $table.reactData;
257
+ const { isRowGroupStatus } = tableReactData;
258
+ const { editConfig } = tableProps;
259
+ const { type, treeNode, rowGroupNode, editRender } = column;
260
+ const { computeEditOpts, computeCheckboxOpts, computeAggregateOpts } = $table.getComputeMaps();
261
+ const aggregateOpts = computeAggregateOpts.value;
262
+ const { mode } = aggregateOpts;
263
+ const checkboxOpts = computeCheckboxOpts.value;
264
+ const editOpts = computeEditOpts.value;
265
+ const isDeepCell = treeNode || isRowGroupStatus && (mode === "column" ? column.field === row.groupField : rowGroupNode);
266
+ switch (type) {
267
+ case "seq":
268
+ return isDeepCell ? Cell.renderDeepIndexCell(params) : Cell.renderSeqCell(params);
269
+ case "radio":
270
+ return isDeepCell ? Cell.renderDeepRadioCell(params) : Cell.renderRadioCell(params);
271
+ case "checkbox":
272
+ return checkboxOpts.checkField ? isDeepCell ? Cell.renderDeepSelectionCellByProp(params) : Cell.renderCheckboxCellByProp(params) : isDeepCell ? Cell.renderDeepSelectionCell(params) : Cell.renderCheckboxCell(params);
273
+ case "expand":
274
+ return Cell.renderExpandCell(params);
275
+ case "html":
276
+ return isDeepCell ? Cell.renderDeepHTMLCell(params) : Cell.renderHTMLCell(params);
277
+ }
278
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
279
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
280
+ if (editRenderOpts) {
281
+ return editOpts.mode === "cell" ? isDeepCell ? Cell.renderDeepCellEdit(params) : Cell.renderCellEdit(params) : isDeepCell ? Cell.renderDeepRowEdit(params) : Cell.renderRowEdit(params);
282
+ }
283
+ return isDeepCell ? Cell.renderDeepCell(params) : Cell.renderDefaultCell(params);
284
+ }
285
+ function renderHeaderHandle(params) {
286
+ const { column, $table } = params;
287
+ const tableProps = $table.props;
288
+ const { editConfig } = tableProps;
289
+ const { type, filters, sortable, editRender, slots } = column;
290
+ if (getConfig().tableHeadeSlotToTitleSlot !== "obsolete") {
291
+ const headerSlot = slots ? slots.header : null;
292
+ if (headerSlot) {
293
+ return renderTitleContent(params, $table.callSlot(headerSlot, params));
197
294
  }
198
- const titleVN = getRenderDefaultColumnTitle(column, content);
199
- return [
200
- h('span', Object.assign({ class: 'vxe-cell--title' }, ons), isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles
201
- ? $table.getPivotTableAggregateRenderColTitles(column, titleVN)
202
- : titleSlot
203
- ? $table.callSlot(titleSlot, params)
204
- : [
205
- titleVN
206
- ])
207
- ];
295
+ }
296
+ switch (type) {
297
+ case "seq":
298
+ return Cell.renderSeqHeader(params);
299
+ case "radio":
300
+ return Cell.renderRadioHeader(params);
301
+ case "checkbox":
302
+ return Cell.renderCheckboxHeader(params);
303
+ case "html":
304
+ if (filters && sortable) {
305
+ return Cell.renderSortAndFilterHeader(params);
306
+ } else if (sortable) {
307
+ return Cell.renderSortHeader(params);
308
+ } else if (filters) {
309
+ return Cell.renderFilterHeader(params);
310
+ }
311
+ break;
312
+ }
313
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
314
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
315
+ if (editRenderOpts) {
316
+ return Cell.renderEditHeader(params);
317
+ } else if (filters && sortable) {
318
+ return Cell.renderSortAndFilterHeader(params);
319
+ } else if (sortable) {
320
+ return Cell.renderSortHeader(params);
321
+ } else if (filters) {
322
+ return Cell.renderFilterHeader(params);
323
+ }
324
+ return Cell.renderDefaultHeader(params);
208
325
  }
209
- function getFooterContent(params) {
210
- const { $table, column, row } = params;
326
+ function renderFooterHandle(params) {
327
+ return Cell.renderDefaultFooter(params);
328
+ }
329
+ const Cell = {
330
+ createColumn($xeTable, columnOpts) {
331
+ const { type } = columnOpts;
332
+ const renConfs = {
333
+ renderHeader: renderHeaderHandle,
334
+ renderCell: renderCellHandle,
335
+ renderFooter: renderFooterHandle
336
+ };
337
+ if (type === "expand") {
338
+ renConfs.renderData = Cell.renderExpandData;
339
+ }
340
+ return createColumn($xeTable, columnOpts, renConfs);
341
+ },
342
+ /**
343
+ * 列头标题
344
+ */
345
+ renderHeaderTitle(params) {
346
+ const { $table, column } = params;
211
347
  const tableProps = $table.props;
212
348
  const { editConfig } = tableProps;
213
349
  const { slots, editRender, cellRender } = column;
214
- const footerSlot = slots ? slots.footer : null;
215
- if (footerSlot) {
216
- return $table.callSlot(footerSlot, params);
217
- }
218
350
  const isEnableEdit = editConfig && isEnableConf(editConfig);
219
351
  const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
220
352
  const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
221
353
  const renderOpts = editRenderOpts || cellRenderOpts;
222
- const itemValue = $table.getFooterCellLabel(row, column);
354
+ if (getConfig().tableHeadeSlotToTitleSlot === "obsolete") {
355
+ const headerSlot = slots ? slots.header : null;
356
+ if (headerSlot) {
357
+ return renderTitleContent(params, $table.callSlot(headerSlot, params));
358
+ }
359
+ }
223
360
  if (renderOpts) {
224
- const { computeRendererOpts } = $table.getComputeMaps();
225
- const rendererOpts = computeRendererOpts.value;
226
- const compConf = renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
227
- if (compConf) {
228
- const rtFooter = compConf.renderTableFooter || compConf.renderFooter;
229
- if (rtFooter) {
230
- const footParams = Object.assign(params, {
231
- cellValue: itemValue,
232
- itemValue
233
- });
234
- return getSlotVNs(rtFooter(renderOpts, footParams));
235
- }
361
+ const { computeRendererOpts } = $table.getComputeMaps();
362
+ const rendererOpts = computeRendererOpts.value;
363
+ const compConf = renderOpts.name ? rendererOpts[renderOpts.name] || renderer.get(renderOpts.name) : null;
364
+ if (compConf) {
365
+ const rtHeader = compConf.renderTableHeader || compConf.renderHeader;
366
+ if (rtHeader) {
367
+ return renderTitleContent(params, getSlotVNs(rtHeader(renderOpts, params)));
236
368
  }
369
+ }
237
370
  }
238
- return [
239
- h('span', {
240
- class: 'vxe-cell--label'
241
- }, formatText(itemValue, 1))
242
- ];
243
- }
244
- function getDefaultCellLabel(params) {
371
+ return renderTitleContent(params, $table.getHeaderCellLabel(column));
372
+ },
373
+ renderDefaultHeader(params) {
374
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params));
375
+ },
376
+ renderDefaultCell(params) {
245
377
  const { $table, row, column } = params;
246
- return formatText($table.getCellLabel(row, column), 1);
247
- }
248
- function renderCellHandle(params) {
249
- const { column, row, $table } = params;
250
378
  const tableProps = $table.props;
251
379
  const tableReactData = $table.reactData;
380
+ const tableInternalData = $table.internalData;
252
381
  const { isRowGroupStatus } = tableReactData;
253
382
  const { editConfig } = tableProps;
254
- const { type, treeNode, rowGroupNode, editRender } = column;
255
- const { computeEditOpts, computeCheckboxOpts, computeAggregateOpts } = $table.getComputeMaps();
256
- const aggregateOpts = computeAggregateOpts.value;
257
- const { mode } = aggregateOpts;
258
- const checkboxOpts = computeCheckboxOpts.value;
259
- const editOpts = computeEditOpts.value;
260
- const isDeepCell = treeNode || (isRowGroupStatus && (mode === 'column' ? column.field === row.groupField : rowGroupNode));
261
- switch (type) {
262
- case 'seq':
263
- return isDeepCell ? Cell.renderDeepIndexCell(params) : Cell.renderSeqCell(params);
264
- case 'radio':
265
- return isDeepCell ? Cell.renderDeepRadioCell(params) : Cell.renderRadioCell(params);
266
- case 'checkbox':
267
- return checkboxOpts.checkField ? (isDeepCell ? Cell.renderDeepSelectionCellByProp(params) : Cell.renderCheckboxCellByProp(params)) : (isDeepCell ? Cell.renderDeepSelectionCell(params) : Cell.renderCheckboxCell(params));
268
- case 'expand':
269
- return Cell.renderExpandCell(params);
270
- case 'html':
271
- return isDeepCell ? Cell.renderDeepHTMLCell(params) : Cell.renderHTMLCell(params);
272
- }
383
+ const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column;
273
384
  const isEnableEdit = editConfig && isEnableConf(editConfig);
274
385
  const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
275
- if (editRenderOpts) {
276
- return editOpts.mode === 'cell' ? (isDeepCell ? Cell.renderDeepCellEdit(params) : Cell.renderCellEdit(params)) : (isDeepCell ? Cell.renderDeepRowEdit(params) : Cell.renderRowEdit(params));
277
- }
278
- return isDeepCell ? Cell.renderDeepCell(params) : Cell.renderDefaultCell(params);
279
- }
280
- function renderHeaderHandle(params) {
281
- const { column, $table } = params;
282
- const tableProps = $table.props;
283
- const { editConfig } = tableProps;
284
- const { type, filters, sortable, editRender, slots } = column;
285
- // 兼容已废弃方式
286
- if (getConfig().tableHeadeSlotToTitleSlot !== 'obsolete') {
287
- const headerSlot = slots ? slots.header : null;
288
- if (headerSlot) {
289
- return renderTitleContent(params, $table.callSlot(headerSlot, params));
386
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
387
+ const defaultSlot = slots ? slots.default : null;
388
+ const gcSlot = slots ? slots.groupContent || slots["group-content"] : null;
389
+ const gvSlot = slots ? slots.groupValues || slots["group-values"] : null;
390
+ let cellValue = "";
391
+ if (isRowGroupStatus && field && row.isAggregate) {
392
+ const aggRow = row;
393
+ const { fullColumnFieldData } = tableInternalData;
394
+ const { computeAggregateOpts } = $table.getComputeMaps();
395
+ const aggregateOpts = computeAggregateOpts.value;
396
+ const { mode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts;
397
+ const aggData = aggRow.aggData;
398
+ const currAggData = aggData ? aggData[field] : null;
399
+ const groupField = aggRow.groupField;
400
+ const groupContent = aggRow.groupContent;
401
+ const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
402
+ const childCount = aggRow.childCount;
403
+ const colRest = fullColumnFieldData[groupField] || {};
404
+ const ctParams = {
405
+ $table,
406
+ groupField,
407
+ groupColumn: colRest ? colRest.column : null,
408
+ column,
409
+ groupValue: groupContent,
410
+ childList,
411
+ childCount,
412
+ aggValue: null,
413
+ /**
414
+ * 已废弃
415
+ * @deprecated
416
+ */
417
+ children: childList,
418
+ /**
419
+ * 已废弃
420
+ * @deprecated
421
+ */
422
+ totalValue: childCount
423
+ };
424
+ if (mode === "column" ? field === aggRow.groupField : rowGroupNode) {
425
+ cellValue = groupContent;
426
+ if (contentMethod) {
427
+ cellValue = `${contentMethod(ctParams)}`;
290
428
  }
291
- }
292
- switch (type) {
293
- case 'seq':
294
- return Cell.renderSeqHeader(params);
295
- case 'radio':
296
- return Cell.renderRadioHeader(params);
297
- case 'checkbox':
298
- return Cell.renderCheckboxHeader(params);
299
- case 'html':
300
- if (filters && sortable) {
301
- return Cell.renderSortAndFilterHeader(params);
302
- }
303
- else if (sortable) {
304
- return Cell.renderSortHeader(params);
305
- }
306
- else if (filters) {
307
- return Cell.renderFilterHeader(params);
308
- }
309
- break;
310
- }
311
- const isEnableEdit = editConfig && isEnableConf(editConfig);
312
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
313
- if (editRenderOpts) {
314
- return Cell.renderEditHeader(params);
315
- }
316
- else if (filters && sortable) {
317
- return Cell.renderSortAndFilterHeader(params);
318
- }
319
- else if (sortable) {
320
- return Cell.renderSortHeader(params);
321
- }
322
- else if (filters) {
323
- return Cell.renderFilterHeader(params);
324
- }
325
- return Cell.renderDefaultHeader(params);
326
- }
327
- function renderFooterHandle(params) {
328
- return Cell.renderDefaultFooter(params);
329
- }
330
- export const Cell = {
331
- createColumn($xeTable, columnOpts) {
332
- const { type } = columnOpts;
333
- const renConfs = {
334
- renderHeader: renderHeaderHandle,
335
- renderCell: renderCellHandle,
336
- renderFooter: renderFooterHandle
337
- };
338
- if (type === 'expand') {
339
- renConfs.renderData = Cell.renderExpandData;
429
+ if (showTotal) {
430
+ cellValue = getI18n("vxe.table.rowGroupContentTotal", [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
340
431
  }
341
- return createColumn($xeTable, columnOpts, renConfs);
342
- },
343
- /**
344
- * 列头标题
345
- */
346
- renderHeaderTitle(params) {
347
- const { $table, column } = params;
348
- const tableProps = $table.props;
349
- const { editConfig } = tableProps;
350
- const { slots, editRender, cellRender } = column;
351
- const isEnableEdit = editConfig && isEnableConf(editConfig);
352
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
353
- const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
354
- const renderOpts = editRenderOpts || cellRenderOpts;
355
- // 兼容已废弃方式
356
- if (getConfig().tableHeadeSlotToTitleSlot === 'obsolete') {
357
- const headerSlot = slots ? slots.header : null;
358
- if (headerSlot) {
359
- return renderTitleContent(params, $table.callSlot(headerSlot, params));
360
- }
432
+ if (gcSlot) {
433
+ return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
361
434
  }
362
- if (renderOpts) {
363
- const { computeRendererOpts } = $table.getComputeMaps();
364
- const rendererOpts = computeRendererOpts.value;
365
- const compConf = renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
366
- if (compConf) {
367
- const rtHeader = compConf.renderTableHeader || compConf.renderHeader;
368
- if (rtHeader) {
369
- return renderTitleContent(params, getSlotVNs(rtHeader(renderOpts, params)));
370
- }
371
- }
435
+ } else if ($table.getPivotTableAggregateCellAggValue) {
436
+ cellValue = $table.getPivotTableAggregateCellAggValue(params);
437
+ ctParams.aggValue = cellValue;
438
+ if (gvSlot) {
439
+ return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
372
440
  }
373
- return renderTitleContent(params, $table.getHeaderCellLabel(column));
374
- },
375
- renderDefaultHeader(params) {
376
- return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params));
377
- },
378
- renderDefaultCell(params) {
379
- const { $table, row, column } = params;
380
- const tableProps = $table.props;
381
- const tableReactData = $table.reactData;
382
- const tableInternalData = $table.internalData;
383
- const { isRowGroupStatus } = tableReactData;
384
- const { editConfig } = tableProps;
385
- const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column;
386
- const isEnableEdit = editConfig && isEnableConf(editConfig);
387
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
388
- const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
389
- const defaultSlot = slots ? slots.default : null;
390
- const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
391
- const gvSlot = slots ? (slots.groupValues || slots['group-values']) : null;
392
- let cellValue = '';
393
- if (isRowGroupStatus && field && row.isAggregate) {
394
- const aggRow = row;
395
- const { fullColumnFieldData } = tableInternalData;
396
- const { computeAggregateOpts } = $table.getComputeMaps();
397
- const aggregateOpts = computeAggregateOpts.value;
398
- const { mode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts;
399
- const aggData = aggRow.aggData;
400
- const currAggData = aggData ? aggData[field] : null;
401
- const groupField = aggRow.groupField;
402
- const groupContent = aggRow.groupContent;
403
- const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : [];
404
- const childCount = aggRow.childCount;
405
- const colRest = fullColumnFieldData[groupField] || {};
406
- const ctParams = {
407
- $table,
408
- groupField,
409
- groupColumn: (colRest ? colRest.column : null),
410
- column,
411
- groupValue: groupContent,
412
- childList,
413
- childCount,
414
- aggValue: null,
415
- /**
416
- * 已废弃
417
- * @deprecated
418
- */
419
- children: childList,
420
- /**
421
- * 已废弃
422
- * @deprecated
423
- */
424
- totalValue: childCount
425
- };
426
- if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
427
- cellValue = groupContent;
428
- if (contentMethod) {
429
- cellValue = `${contentMethod(ctParams)}`;
430
- }
431
- if (showTotal) {
432
- cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
433
- }
434
- if (gcSlot) {
435
- return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
436
- }
437
- }
438
- else if ($table.getPivotTableAggregateCellAggValue) {
439
- cellValue = $table.getPivotTableAggregateCellAggValue(params);
440
- ctParams.aggValue = cellValue;
441
- if (gvSlot) {
442
- return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
443
- }
444
- }
445
- else if (aggFunc === true || (countFields && countFields.includes(field))) {
446
- cellValue = currAggData ? currAggData.value : childCount;
447
- ctParams.aggValue = cellValue;
448
- if (formatValuesMethod) {
449
- cellValue = formatValuesMethod(ctParams);
450
- }
451
- if (gvSlot) {
452
- return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
453
- }
454
- }
441
+ } else if (aggFunc === true || countFields && countFields.includes(field)) {
442
+ cellValue = currAggData ? currAggData.value : childCount;
443
+ ctParams.aggValue = cellValue;
444
+ if (formatValuesMethod) {
445
+ cellValue = formatValuesMethod(ctParams);
455
446
  }
456
- else {
457
- if (defaultSlot) {
458
- return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
459
- }
460
- const { computeRendererOpts } = $table.getComputeMaps();
461
- const rendererOpts = computeRendererOpts.value;
462
- // 如果是编辑模式-查看:slot default > formatter > cellRender.renderTableDefault > editRender.renderTableCell > editRender.renderTableDefault > cellRender.tableCellFormatter > editRender.tableCellFormatter > field
463
- // 如果是查看表格:slot default > formatter > cellRender.renderTableDefault > cellRender.tableCellFormatter > field
464
- const cellCompConf = cellRenderOpts && cellRenderOpts.name ? (rendererOpts[cellRenderOpts.name] || renderer.get(cellRenderOpts.name)) : null;
465
- if (cellRenderOpts) {
466
- const cellDefaultRenderFn = cellCompConf ? (cellCompConf.renderTableDefault || cellCompConf.renderDefault) : null;
467
- if (cellDefaultRenderFn && cellRenderOpts) {
468
- return renderCellBaseVNs(params, getSlotVNs(cellDefaultRenderFn(cellRenderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))));
469
- }
470
- }
471
- if (editRenderOpts) {
472
- const editCompConf = editRenderOpts && editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
473
- const editCellRenderFn = editCompConf
474
- ? ((editCompConf.renderTableCell || editCompConf.renderCell) ||
475
- (editCompConf.renderTableDefault || editCompConf.renderDefault))
476
- : null;
477
- if (editCellRenderFn) {
478
- return renderCellBaseVNs(params, getSlotVNs(editCellRenderFn(editRenderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))));
479
- }
480
- }
481
- // 如果是编辑模式-查看:cellRender.tableCellFormatter > editRender.tableCellFormatter > field
482
- // 如果是查看表格:cellRender.tableCellFormatter > field
483
- cellValue = $table.getCellLabel(row, column);
447
+ if (gvSlot) {
448
+ return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
484
449
  }
485
- const cellPlaceholder = editRenderOpts ? editRenderOpts.placeholder : '';
486
- return renderCellBaseVNs(params, [
487
- h('span', {
488
- class: 'vxe-cell--label'
489
- }, [
490
- // 如果设置占位符
491
- editRenderOpts && eqEmptyValue(cellValue)
492
- ? h('span', {
493
- class: 'vxe-cell--placeholder'
494
- }, formatText(getFuncText(cellPlaceholder), 1))
495
- : h('span', formatText(cellValue, 1))
496
- ])
497
- ]);
498
- },
499
- renderDeepCell(params) {
500
- return Cell.renderDeepNodeBtn(params, Cell.renderDefaultCell(params));
501
- },
502
- renderDefaultFooter(params) {
503
- return getFooterContent(params);
504
- },
505
- /**
506
- * 行分组
507
- */
508
- renderRowGroupBtn(params, cellVNodes) {
509
- const { $table } = params;
510
- const tableReactData = $table.reactData;
511
- const tableInternalData = $table.internalData;
512
- const { row, level } = params;
513
- const { computeAggregateOpts } = $table.getComputeMaps();
514
- const { rowGroupExpandedFlag } = tableReactData;
515
- const { rowGroupExpandedMaps } = tableInternalData;
516
- const aggregateOpts = computeAggregateOpts.value;
517
- const { mode, padding, indent, showIcon, iconOpen, iconClose } = aggregateOpts;
518
- const rowid = getRowid($table, row);
519
- const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
520
- return h('div', {
521
- class: ['vxe-row-group--tree-node', {
522
- 'is--expanded': isExpand
523
- }],
524
- style: mode !== 'column' && padding && indent
525
- ? {
526
- paddingLeft: `${level * indent}px`
527
- }
528
- : undefined
529
- }, [
530
- showIcon && row.isAggregate
531
- ? h('span', {
532
- class: 'vxe-row-group--node-btn',
533
- onClick(evnt) {
534
- $table.triggerRowGroupExpandEvent(evnt, params);
535
- }
536
- }, [
537
- h('i', {
538
- class: isExpand ? (iconOpen || getIcon().TABLE_ROW_GROUP_OPEN) : (iconClose || getIcon().TABLE_ROW_GROUP_CLOSE)
539
- })
540
- ])
541
- : renderEmptyElement($table),
542
- h('div', {
543
- class: 'vxe-row-group-cell'
544
- }, cellVNodes)
545
- ]);
546
- },
547
- /**
548
- * 树
549
- */
550
- renderTreeNodeBtn(params, cellVNodes) {
551
- const { $table, isHidden } = params;
552
- const tableReactData = $table.reactData;
553
- const tableInternalData = $table.internalData;
554
- const { row, column, level } = params;
555
- const { slots } = column;
556
- const iconSlot = slots ? slots.icon : null;
557
- if (iconSlot) {
558
- return $table.callSlot(iconSlot, params);
450
+ }
451
+ } else {
452
+ if (defaultSlot) {
453
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
454
+ }
455
+ const { computeRendererOpts } = $table.getComputeMaps();
456
+ const rendererOpts = computeRendererOpts.value;
457
+ const cellCompConf = cellRenderOpts && cellRenderOpts.name ? rendererOpts[cellRenderOpts.name] || renderer.get(cellRenderOpts.name) : null;
458
+ if (cellRenderOpts) {
459
+ const cellDefaultRenderFn = cellCompConf ? cellCompConf.renderTableDefault || cellCompConf.renderDefault : null;
460
+ if (cellDefaultRenderFn && cellRenderOpts) {
461
+ return renderCellBaseVNs(params, getSlotVNs(cellDefaultRenderFn(cellRenderOpts, Object.assign({ $type: editRenderOpts ? "edit" : "cell" }, params))));
559
462
  }
560
- const { computeTreeOpts } = $table.getComputeMaps();
561
- const { treeExpandedFlag } = tableReactData;
562
- const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData;
563
- const treeOpts = computeTreeOpts.value;
564
- const { padding, indent, lazy, trigger, visibleMethod, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts;
565
- const childrenField = treeOpts.children || treeOpts.childrenField;
566
- const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
567
- const rowChilds = row[childrenField];
568
- const hasChild = rowChilds && rowChilds.length;
569
- let hasLazyChilds = false;
570
- let isActive = false;
571
- let isLazyLoading = false;
572
- let isLazyLoaded = false;
573
- const ons = {};
574
- if (!isHidden) {
575
- const rowid = getRowid($table, row);
576
- isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
577
- if (lazy) {
578
- const rest = fullAllDataRowIdData[rowid];
579
- isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
580
- hasLazyChilds = row[hasChildField];
581
- isLazyLoaded = !!rest.treeLoaded;
582
- }
463
+ }
464
+ if (editRenderOpts) {
465
+ const editCompConf = editRenderOpts && editRenderOpts.name ? rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name) : null;
466
+ const editCellRenderFn = editCompConf ? editCompConf.renderTableCell || editCompConf.renderCell || (editCompConf.renderTableDefault || editCompConf.renderDefault) : null;
467
+ if (editCellRenderFn) {
468
+ return renderCellBaseVNs(params, getSlotVNs(editCellRenderFn(editRenderOpts, Object.assign({ $type: editRenderOpts ? "edit" : "cell" }, params))));
583
469
  }
584
- if (!trigger || trigger === 'default') {
585
- ons.onClick = (evnt) => {
586
- $table.triggerTreeExpandEvent(evnt, params);
587
- };
470
+ }
471
+ cellValue = $table.getCellLabel(row, column);
472
+ }
473
+ const cellPlaceholder = editRenderOpts ? editRenderOpts.placeholder : "";
474
+ return renderCellBaseVNs(params, [
475
+ h(
476
+ "span",
477
+ {
478
+ class: "vxe-cell--label"
479
+ },
480
+ [
481
+ // 如果设置占位符
482
+ editRenderOpts && eqEmptyValue(cellValue) ? h("span", {
483
+ class: "vxe-cell--placeholder"
484
+ }, formatText(getFuncText(cellPlaceholder), 1)) : h("span", formatText(cellValue, 1))
485
+ ]
486
+ )
487
+ ]);
488
+ },
489
+ renderDeepCell(params) {
490
+ return Cell.renderDeepNodeBtn(params, Cell.renderDefaultCell(params));
491
+ },
492
+ renderDefaultFooter(params) {
493
+ return getFooterContent(params);
494
+ },
495
+ /**
496
+ * 行分组
497
+ */
498
+ renderRowGroupBtn(params, cellVNodes) {
499
+ const { $table } = params;
500
+ const tableReactData = $table.reactData;
501
+ const tableInternalData = $table.internalData;
502
+ const { row, level } = params;
503
+ const { computeAggregateOpts } = $table.getComputeMaps();
504
+ const { rowGroupExpandedFlag } = tableReactData;
505
+ const { rowGroupExpandedMaps } = tableInternalData;
506
+ const aggregateOpts = computeAggregateOpts.value;
507
+ const { mode, padding, indent, showIcon, iconOpen, iconClose } = aggregateOpts;
508
+ const rowid = getRowid($table, row);
509
+ const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
510
+ return h("div", {
511
+ class: ["vxe-row-group--tree-node", {
512
+ "is--expanded": isExpand
513
+ }],
514
+ style: mode !== "column" && padding && indent ? {
515
+ paddingLeft: `${level * indent}px`
516
+ } : void 0
517
+ }, [
518
+ showIcon && row.isAggregate ? h("span", {
519
+ class: "vxe-row-group--node-btn",
520
+ onClick(evnt) {
521
+ $table.triggerRowGroupExpandEvent(evnt, params);
588
522
  }
589
- return h('div', {
590
- class: ['vxe-cell--tree-node', {
591
- 'is--active': isActive
592
- }],
593
- style: padding && indent
594
- ? {
595
- paddingLeft: `${level * indent}px`
596
- }
597
- : undefined
523
+ }, [
524
+ h("i", {
525
+ class: isExpand ? iconOpen || getIcon().TABLE_ROW_GROUP_OPEN : iconClose || getIcon().TABLE_ROW_GROUP_CLOSE
526
+ })
527
+ ]) : renderEmptyElement($table),
528
+ h("div", {
529
+ class: "vxe-row-group-cell"
530
+ }, cellVNodes)
531
+ ]);
532
+ },
533
+ /**
534
+ * 树
535
+ */
536
+ renderTreeNodeBtn(params, cellVNodes) {
537
+ const { $table, isHidden } = params;
538
+ const tableReactData = $table.reactData;
539
+ const tableInternalData = $table.internalData;
540
+ const { row, column, level } = params;
541
+ const { slots } = column;
542
+ const iconSlot = slots ? slots.icon : null;
543
+ if (iconSlot) {
544
+ return $table.callSlot(iconSlot, params);
545
+ }
546
+ const { computeTreeOpts } = $table.getComputeMaps();
547
+ const { treeExpandedFlag } = tableReactData;
548
+ const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData;
549
+ const treeOpts = computeTreeOpts.value;
550
+ const { padding, indent, lazy, trigger, visibleMethod, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts;
551
+ const childrenField = treeOpts.children || treeOpts.childrenField;
552
+ const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
553
+ const rowChilds = row[childrenField];
554
+ const hasChild = rowChilds && rowChilds.length;
555
+ let hasLazyChilds = false;
556
+ let isActive = false;
557
+ let isLazyLoading = false;
558
+ let isLazyLoaded = false;
559
+ const ons = {};
560
+ if (!isHidden) {
561
+ const rowid = getRowid($table, row);
562
+ isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
563
+ if (lazy) {
564
+ const rest = fullAllDataRowIdData[rowid];
565
+ isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
566
+ hasLazyChilds = row[hasChildField];
567
+ isLazyLoaded = !!rest.treeLoaded;
568
+ }
569
+ }
570
+ if (!trigger || trigger === "default") {
571
+ ons.onClick = (evnt) => {
572
+ $table.triggerTreeExpandEvent(evnt, params);
573
+ };
574
+ }
575
+ return h("div", {
576
+ class: ["vxe-cell--tree-node", {
577
+ "is--active": isActive
578
+ }],
579
+ style: padding && indent ? {
580
+ paddingLeft: `${level * indent}px`
581
+ } : void 0
582
+ }, [
583
+ showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) && (!visibleMethod || visibleMethod(params)) ? [
584
+ h("div", {
585
+ class: "vxe-cell--tree-btn",
586
+ ...ons
598
587
  }, [
599
- showIcon && (lazy ? (isLazyLoaded ? hasChild : (hasChild || hasLazyChilds)) : hasChild) && (!visibleMethod || visibleMethod(params))
600
- ? [
601
- h('div', Object.assign({ class: 'vxe-cell--tree-btn' }, ons), [
602
- h('i', {
603
- class: isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_TREE_OPEN) : (iconClose || getIcon().TABLE_TREE_CLOSE))
604
- })
605
- ])
606
- ]
607
- : null,
608
- h('div', {
609
- class: 'vxe-tree-cell'
610
- }, cellVNodes)
611
- ]);
612
- },
613
- /**
614
- * 层级节点。
615
- * 行分组、树结构
616
- */
617
- renderDeepNodeBtn(params, cellVNodes) {
618
- const { $table, row, column } = params;
619
- const { rowGroupNode } = column;
620
- const tableReactData = $table.reactData;
621
- const { rowGroupList } = tableReactData;
622
- if (rowGroupList.length) {
623
- const { computeAggregateOpts } = $table.getComputeMaps();
624
- const aggregateOpts = computeAggregateOpts.value;
625
- const { mode } = aggregateOpts;
626
- if (mode === 'column') {
627
- if (row.groupField && column.field === row.groupField) {
628
- return [Cell.renderRowGroupBtn(params, cellVNodes)];
629
- }
630
- return cellVNodes;
631
- }
632
- else if (rowGroupNode) {
633
- return [Cell.renderRowGroupBtn(params, cellVNodes)];
634
- }
635
- }
636
- return [Cell.renderTreeNodeBtn(params, cellVNodes)];
637
- },
638
- /**
639
- * 序号
640
- */
641
- renderSeqHeader(params) {
642
- const { $table, column } = params;
643
- // 兼容已废弃方式
644
- if (getConfig().tableHeadeSlotToTitleSlot === 'obsolete') {
645
- const { slots } = column;
646
- const headerSlot = slots ? slots.header : null;
647
- return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : $table.getHeaderCellLabel(column)));
648
- }
649
- return renderHeaderCellBaseVNs(params, renderTitleContent(params, $table.getHeaderCellLabel(column)));
650
- },
651
- renderSeqCell(params) {
652
- const { $table, column } = params;
653
- const tableProps = $table.props;
654
- const { treeConfig } = tableProps;
655
- const { computeSeqOpts } = $table.getComputeMaps();
656
- const seqOpts = computeSeqOpts.value;
657
- const { slots } = column;
658
- const defaultSlot = slots ? slots.default : null;
659
- if (defaultSlot) {
660
- return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
661
- }
662
- const { seq } = params;
663
- const seqMd = seqOpts.seqMethod;
664
- return renderCellBaseVNs(params, [
665
- h('span', `${formatText(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
666
- ]);
667
- },
668
- renderDeepIndexCell(params) {
669
- return Cell.renderDeepNodeBtn(params, Cell.renderSeqCell(params));
670
- },
671
- /**
672
- * 单选
673
- */
674
- renderRadioHeader(params) {
675
- const { $table, column } = params;
676
- const { slots } = column;
677
- const titleSlot = slots ? slots.title : null;
678
- // 兼容已废弃方式
679
- if (getConfig().tableHeadeSlotToTitleSlot === 'obsolete') {
680
- const headerSlot = slots ? slots.header : null;
681
- return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot
682
- ? $table.callSlot(headerSlot, params)
683
- : [
684
- h('span', {
685
- class: 'vxe-radio--label'
686
- }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
687
- ]));
688
- }
689
- return renderHeaderCellBaseVNs(params, renderTitleContent(params, [
690
- h('span', {
691
- class: 'vxe-radio--label'
692
- }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
693
- ]));
694
- },
695
- renderRadioCell(params) {
696
- const { $table, column, isHidden } = params;
697
- const tableReactData = $table.reactData;
698
- const { computeRadioOpts } = $table.getComputeMaps();
699
- const { selectRadioRow } = tableReactData;
700
- const radioOpts = computeRadioOpts.value;
701
- const { slots } = column;
702
- const { labelField, checkMethod, visibleMethod } = radioOpts;
703
- const { row } = params;
704
- const defaultSlot = slots ? slots.default : null;
705
- const radioSlot = slots ? slots.radio : null;
706
- const isChecked = $table.eqRow(row, selectRadioRow);
707
- const isVisible = !visibleMethod || visibleMethod({ $table, row });
708
- let isDisabled = !!checkMethod;
709
- let ons;
710
- if (!isHidden) {
711
- ons = {
712
- onClick(evnt) {
713
- if (!isDisabled && isVisible) {
714
- $table.triggerRadioRowEvent(evnt, params);
715
- }
716
- }
717
- };
718
- if (checkMethod) {
719
- isDisabled = !checkMethod({ $table, row });
720
- }
721
- }
722
- const radioParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible });
723
- if (radioSlot) {
724
- return renderCellBaseVNs(params, $table.callSlot(radioSlot, radioParams));
725
- }
726
- const radioVNs = [];
727
- if (isVisible) {
728
- radioVNs.push(h('span', {
729
- class: ['vxe-radio--icon', isChecked ? getIcon().TABLE_RADIO_CHECKED : (isDisabled ? getIcon().TABLE_RADIO_DISABLED_UNCHECKED : getIcon().TABLE_RADIO_UNCHECKED)]
730
- }));
731
- }
732
- if (defaultSlot || labelField) {
733
- radioVNs.push(h('span', {
734
- class: 'vxe-radio--label'
735
- }, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField)));
736
- }
737
- return renderCellBaseVNs(params, [
738
- h('span', Object.assign({ class: ['vxe-cell--radio', {
739
- 'is--checked': isChecked,
740
- 'is--disabled': isDisabled
741
- }] }, ons), radioVNs)
742
- ]);
743
- },
744
- renderDeepRadioCell(params) {
745
- return Cell.renderDeepNodeBtn(params, Cell.renderRadioCell(params));
746
- },
747
- /**
748
- * 多选
749
- */
750
- renderCheckboxHeader(params) {
751
- const { $table, column, isHidden } = params;
752
- const tableReactData = $table.reactData;
753
- const { computeIsAllCheckboxDisabled, computeCheckboxOpts } = $table.getComputeMaps();
754
- const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData;
755
- const isAllCheckboxDisabled = computeIsAllCheckboxDisabled.value;
756
- const { slots } = column;
757
- const titleSlot = slots ? slots.title : null;
758
- const checkboxOpts = computeCheckboxOpts.value;
759
- const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
760
- const colTitle = $table.getHeaderCellLabel(column);
761
- const ons = {};
762
- if (!isHidden) {
763
- ons.onClick = (evnt) => {
764
- if (!isAllCheckboxDisabled) {
765
- $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
766
- }
767
- };
768
- }
769
- const checkboxParams = Object.assign(Object.assign({}, params), { checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate });
770
- // 兼容已废弃方式
771
- if (getConfig().tableHeadeSlotToTitleSlot === 'obsolete') {
772
- const headerSlot = slots ? slots.header : null;
773
- if (headerSlot) {
774
- return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)));
775
- }
776
- }
777
- if (checkStrictly ? !showHeader : showHeader === false) {
778
- return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
779
- h('span', {
780
- class: 'vxe-checkbox--label'
781
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
782
- ]));
783
- }
784
- return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
785
- h('span', Object.assign({ class: ['vxe-cell--checkbox', {
786
- 'is--checked': isAllCheckboxSelected,
787
- 'is--disabled': isAllCheckboxDisabled,
788
- 'is--indeterminate': isAllCheckboxIndeterminate
789
- }], title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}` }, ons), [
790
- h('span', {
791
- class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : (isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED))]
792
- })
793
- ].concat(titleSlot || colTitle
794
- ? [
795
- h('span', {
796
- class: 'vxe-checkbox--label'
797
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
798
- ]
799
- : []))
800
- ]));
801
- },
802
- renderCheckboxCell(params) {
803
- const { $table, row, column, isHidden } = params;
804
- const tableProps = $table.props;
805
- const tableReactData = $table.reactData;
806
- const tableInternalData = $table.internalData;
807
- const { treeConfig } = tableProps;
808
- const { updateCheckboxFlag, isRowGroupStatus } = tableReactData;
809
- const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData;
810
- const { computeCheckboxOpts, computeAggregateOpts } = $table.getComputeMaps();
811
- const aggregateOpts = computeAggregateOpts.value;
812
- const { mapChildrenField } = aggregateOpts;
813
- const checkboxOpts = computeCheckboxOpts.value;
814
- const { labelField, checkMethod, visibleMethod } = checkboxOpts;
815
- const { slots } = column;
816
- const defaultSlot = slots ? slots.default : null;
817
- const checkboxSlot = slots ? slots.checkbox : null;
818
- let indeterminate = false;
819
- let isChecked = false;
820
- let isVisible = true;
821
- let isDisabled = false;
822
- const ons = {};
823
- if (!isHidden) {
824
- const rowid = getRowid($table, row);
825
- isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
826
- if (checkMethod && isRowGroupStatus && $table.isAggregateRecord(row)) {
827
- const childList = row[mapChildrenField || ''];
828
- if (!childList || !childList.length || childList.every(item => !checkMethod({ $table, row: item }))) {
829
- isDisabled = true;
830
- }
831
- }
832
- else {
833
- isVisible = !visibleMethod || visibleMethod({ $table, row });
834
- isDisabled = checkMethod ? !checkMethod({ $table, row }) : !!checkMethod;
835
- }
836
- if (treeConfig || isRowGroupStatus) {
837
- indeterminate = !!treeIndeterminateRowMaps[rowid];
838
- }
839
- ons.onClick = (evnt) => {
840
- if (!isDisabled && isVisible) {
841
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
842
- }
843
- };
844
- }
845
- const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate });
846
- if (checkboxSlot) {
847
- return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
848
- }
849
- const checkVNs = [];
850
- if (isVisible) {
851
- checkVNs.push(h('span', {
852
- class: ['vxe-checkbox--icon', indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : (isDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED))]
853
- }));
854
- }
855
- if (defaultSlot || labelField) {
856
- checkVNs.push(h('span', {
857
- class: 'vxe-checkbox--label'
858
- }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
859
- }
860
- return renderCellBaseVNs(params, [
861
- h('span', Object.assign({ class: ['vxe-cell--checkbox', {
862
- 'is--checked': isChecked,
863
- 'is--disabled': isDisabled,
864
- 'is--indeterminate': indeterminate,
865
- 'is--hidden': !isVisible
866
- }] }, ons), checkVNs)
867
- ]);
868
- },
869
- renderDeepSelectionCell(params) {
870
- return Cell.renderDeepNodeBtn(params, Cell.renderCheckboxCell(params));
871
- },
872
- renderCheckboxCellByProp(params) {
873
- const { $table, row, column, isHidden } = params;
874
- const tableProps = $table.props;
875
- const tableReactData = $table.reactData;
876
- const tableInternalData = $table.internalData;
877
- const { treeConfig } = tableProps;
878
- const { updateCheckboxFlag, isRowGroupStatus } = tableReactData;
879
- const { treeIndeterminateRowMaps } = tableInternalData;
880
- const { computeCheckboxOpts, computeAggregateOpts } = $table.getComputeMaps();
881
- const aggregateOpts = computeAggregateOpts.value;
882
- const { mapChildrenField } = aggregateOpts;
883
- const checkboxOpts = computeCheckboxOpts.value;
884
- const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts;
885
- const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
886
- const { slots } = column;
887
- const defaultSlot = slots ? slots.default : null;
888
- const checkboxSlot = slots ? slots.checkbox : null;
889
- let indeterminate = false;
890
- let isChecked = false;
891
- let isVisible = true;
892
- let isDisabled = false;
893
- const ons = {};
894
- if (!isHidden) {
895
- const rowid = getRowid($table, row);
896
- isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField);
897
- if (checkMethod && isRowGroupStatus && $table.isAggregateRecord(row)) {
898
- const childList = row[mapChildrenField || ''];
899
- if (!childList || !childList.length || childList.every(item => !checkMethod({ $table, row: item }))) {
900
- isDisabled = true;
901
- }
902
- }
903
- else {
904
- isVisible = !visibleMethod || visibleMethod({ $table, row });
905
- isDisabled = checkMethod ? !checkMethod({ $table, row }) : !!checkMethod;
906
- }
907
- if (treeConfig || isRowGroupStatus) {
908
- indeterminate = !!treeIndeterminateRowMaps[rowid];
909
- }
910
- ons.onClick = (evnt) => {
911
- if (!isDisabled && isVisible) {
912
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
913
- }
914
- };
915
- }
916
- const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate });
917
- if (checkboxSlot) {
918
- return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
919
- }
920
- const checkVNs = [];
921
- if (isVisible) {
922
- checkVNs.push(h('span', {
923
- class: ['vxe-checkbox--icon', indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : (isDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED))]
924
- }));
925
- if (defaultSlot || labelField) {
926
- checkVNs.push(h('span', {
927
- class: 'vxe-checkbox--label'
928
- }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
929
- }
930
- }
931
- return renderCellBaseVNs(params, [
932
- h('span', Object.assign({ class: ['vxe-cell--checkbox', {
933
- 'is--checked': isChecked,
934
- 'is--disabled': isDisabled,
935
- 'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : indeterminate,
936
- 'is--hidden': !isVisible
937
- }] }, ons), checkVNs)
938
- ]);
939
- },
940
- renderDeepSelectionCellByProp(params) {
941
- return Cell.renderDeepNodeBtn(params, Cell.renderCheckboxCellByProp(params));
942
- },
943
- /**
944
- * 展开行
945
- */
946
- renderExpandCell(params) {
947
- const { $table, isHidden, row, column } = params;
948
- const tableReactData = $table.reactData;
949
- const tableInternalData = $table.internalData;
950
- const { isRowGroupStatus } = tableReactData;
951
- const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData;
952
- const { computeExpandOpts } = $table.getComputeMaps();
953
- const expandOpts = computeExpandOpts.value;
954
- const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts;
955
- const { slots } = column;
956
- const defaultSlot = slots ? slots.default : null;
957
- const iconSlot = slots ? slots.icon : null;
958
- let isActive = false;
959
- let isLazyLoading = false;
960
- if (isRowGroupStatus && row.isAggregate) {
961
- return renderCellBaseVNs(params, []);
962
- }
963
- if (iconSlot) {
964
- return renderCellBaseVNs(params, $table.callSlot(iconSlot, params));
965
- }
966
- if (!isHidden) {
967
- const rowid = getRowid($table, row);
968
- isActive = !!rowExpandedMaps[rowid];
969
- if (lazy) {
970
- isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
971
- }
972
- }
973
- return renderCellBaseVNs(params, [
974
- showIcon && (!visibleMethod || visibleMethod(params))
975
- ? h('div', {
976
- class: ['vxe-table--expanded', {
977
- 'is--active': isActive
978
- }]
979
- }, [
980
- h('span', {
981
- class: 'vxe-table--expand-btn',
982
- onMousedown(evnt) {
983
- evnt.stopPropagation();
984
- },
985
- onClick(evnt) {
986
- $table.triggerRowExpandEvent(evnt, params);
987
- }
988
- }, [
989
- h('i', {
990
- class: isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))
991
- })
992
- ])
993
- ])
994
- : renderEmptyElement($table),
995
- defaultSlot || labelField
996
- ? h('div', {
997
- class: 'vxe-table--expand-label'
998
- }, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField))
999
- : renderEmptyElement($table)
1000
- ]);
1001
- },
1002
- renderExpandData(params) {
1003
- const { $table, column } = params;
1004
- const { slots, contentRender } = column;
1005
- const contentSlot = slots ? slots.content : null;
1006
- if (contentSlot) {
1007
- return $table.callSlot(contentSlot, params);
1008
- }
1009
- if (contentRender) {
1010
- const { computeRendererOpts } = $table.getComputeMaps();
1011
- const rendererOpts = computeRendererOpts.value;
1012
- const compConf = contentRender.name ? (rendererOpts[contentRender.name] || renderer.get(contentRender.name)) : null;
1013
- if (compConf) {
1014
- const rtExpand = compConf.renderTableExpand || compConf.renderExpand;
1015
- if (rtExpand) {
1016
- return getSlotVNs(rtExpand(contentRender, params));
1017
- }
1018
- }
588
+ h("i", {
589
+ class: isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isActive ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE
590
+ })
591
+ ])
592
+ ] : null,
593
+ h("div", {
594
+ class: "vxe-tree-cell"
595
+ }, cellVNodes)
596
+ ]);
597
+ },
598
+ /**
599
+ * 层级节点。
600
+ * 行分组、树结构
601
+ */
602
+ renderDeepNodeBtn(params, cellVNodes) {
603
+ const { $table, row, column } = params;
604
+ const { rowGroupNode } = column;
605
+ const tableReactData = $table.reactData;
606
+ const { rowGroupList } = tableReactData;
607
+ if (rowGroupList.length) {
608
+ const { computeAggregateOpts } = $table.getComputeMaps();
609
+ const aggregateOpts = computeAggregateOpts.value;
610
+ const { mode } = aggregateOpts;
611
+ if (mode === "column") {
612
+ if (row.groupField && column.field === row.groupField) {
613
+ return [Cell.renderRowGroupBtn(params, cellVNodes)];
1019
614
  }
1020
- return [];
1021
- },
1022
- /**
1023
- * HTML 标签
1024
- */
1025
- renderHTMLCell(params) {
1026
- const { $table, column } = params;
1027
- const { slots } = column;
1028
- const defaultSlot = slots ? slots.default : null;
1029
- if (defaultSlot) {
1030
- return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
615
+ return cellVNodes;
616
+ } else if (rowGroupNode) {
617
+ return [Cell.renderRowGroupBtn(params, cellVNodes)];
618
+ }
619
+ }
620
+ return [Cell.renderTreeNodeBtn(params, cellVNodes)];
621
+ },
622
+ /**
623
+ * 序号
624
+ */
625
+ renderSeqHeader(params) {
626
+ const { $table, column } = params;
627
+ if (getConfig().tableHeadeSlotToTitleSlot === "obsolete") {
628
+ const { slots } = column;
629
+ const headerSlot = slots ? slots.header : null;
630
+ return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : $table.getHeaderCellLabel(column)));
631
+ }
632
+ return renderHeaderCellBaseVNs(params, renderTitleContent(params, $table.getHeaderCellLabel(column)));
633
+ },
634
+ renderSeqCell(params) {
635
+ const { $table, column } = params;
636
+ const tableProps = $table.props;
637
+ const { treeConfig } = tableProps;
638
+ const { computeSeqOpts } = $table.getComputeMaps();
639
+ const seqOpts = computeSeqOpts.value;
640
+ const { slots } = column;
641
+ const defaultSlot = slots ? slots.default : null;
642
+ if (defaultSlot) {
643
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
644
+ }
645
+ const { seq } = params;
646
+ const seqMd = seqOpts.seqMethod;
647
+ return renderCellBaseVNs(params, [
648
+ h("span", `${formatText(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
649
+ ]);
650
+ },
651
+ renderDeepIndexCell(params) {
652
+ return Cell.renderDeepNodeBtn(params, Cell.renderSeqCell(params));
653
+ },
654
+ /**
655
+ * 单选
656
+ */
657
+ renderRadioHeader(params) {
658
+ const { $table, column } = params;
659
+ const { slots } = column;
660
+ const titleSlot = slots ? slots.title : null;
661
+ if (getConfig().tableHeadeSlotToTitleSlot === "obsolete") {
662
+ const headerSlot = slots ? slots.header : null;
663
+ return renderHeaderCellBaseVNs(
664
+ params,
665
+ renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : [
666
+ h("span", {
667
+ class: "vxe-radio--label"
668
+ }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
669
+ ])
670
+ );
671
+ }
672
+ return renderHeaderCellBaseVNs(
673
+ params,
674
+ renderTitleContent(params, [
675
+ h("span", {
676
+ class: "vxe-radio--label"
677
+ }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
678
+ ])
679
+ );
680
+ },
681
+ renderRadioCell(params) {
682
+ const { $table, column, isHidden } = params;
683
+ const tableReactData = $table.reactData;
684
+ const { computeRadioOpts } = $table.getComputeMaps();
685
+ const { selectRadioRow } = tableReactData;
686
+ const radioOpts = computeRadioOpts.value;
687
+ const { slots } = column;
688
+ const { labelField, checkMethod, visibleMethod } = radioOpts;
689
+ const { row } = params;
690
+ const defaultSlot = slots ? slots.default : null;
691
+ const radioSlot = slots ? slots.radio : null;
692
+ const isChecked = $table.eqRow(row, selectRadioRow);
693
+ const isVisible = !visibleMethod || visibleMethod({ $table, row });
694
+ let isDisabled = !!checkMethod;
695
+ let ons;
696
+ if (!isHidden) {
697
+ ons = {
698
+ onClick(evnt) {
699
+ if (!isDisabled && isVisible) {
700
+ $table.triggerRadioRowEvent(evnt, params);
701
+ }
1031
702
  }
1032
- return renderCellBaseVNs(params, [
1033
- h('span', {
1034
- class: 'vxe-cell--html',
1035
- innerHTML: getDefaultCellLabel(params)
1036
- })
1037
- ]);
1038
- },
1039
- renderDeepHTMLCell(params) {
1040
- return Cell.renderDeepNodeBtn(params, Cell.renderHTMLCell(params));
1041
- },
1042
- /**
1043
- * 排序和筛选
1044
- */
1045
- renderSortAndFilterHeader(params) {
1046
- return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params))));
1047
- },
1048
- /**
1049
- * 排序
1050
- */
1051
- renderSortHeader(params) {
1052
- return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params)));
1053
- },
1054
- renderSortIcon(params) {
1055
- const { $table, column } = params;
1056
- const { computeSortOpts } = $table.getComputeMaps();
1057
- const sortOpts = computeSortOpts.value;
1058
- const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
1059
- const { order, slots } = column;
1060
- if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
1061
- const sortSlot = slots ? slots.sort : null;
1062
- return sortSlot
1063
- ? getSlotVNs($table.callSlot(sortSlot, params))
1064
- : [
1065
- h('span', {
1066
- class: ['vxe-cell--sort', `vxe-cell--sort-${iconLayout}-layout`]
1067
- }, [
1068
- h('i', {
1069
- class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
1070
- 'sort--active': order === 'asc'
1071
- }],
1072
- title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`,
1073
- onClick: allowBtn
1074
- ? (evnt) => {
1075
- evnt.stopPropagation();
1076
- $table.triggerSortEvent(evnt, column, 'asc');
1077
- }
1078
- : undefined
1079
- }),
1080
- h('i', {
1081
- class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
1082
- 'sort--active': order === 'desc'
1083
- }],
1084
- title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`,
1085
- onClick: allowBtn
1086
- ? (evnt) => {
1087
- evnt.stopPropagation();
1088
- $table.triggerSortEvent(evnt, column, 'desc');
1089
- }
1090
- : undefined
1091
- })
1092
- ])
1093
- ];
703
+ };
704
+ if (checkMethod) {
705
+ isDisabled = !checkMethod({ $table, row });
706
+ }
707
+ }
708
+ const radioParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible };
709
+ if (radioSlot) {
710
+ return renderCellBaseVNs(params, $table.callSlot(radioSlot, radioParams));
711
+ }
712
+ const radioVNs = [];
713
+ if (isVisible) {
714
+ radioVNs.push(
715
+ h("span", {
716
+ class: ["vxe-radio--icon", isChecked ? getIcon().TABLE_RADIO_CHECKED : isDisabled ? getIcon().TABLE_RADIO_DISABLED_UNCHECKED : getIcon().TABLE_RADIO_UNCHECKED]
717
+ })
718
+ );
719
+ }
720
+ if (defaultSlot || labelField) {
721
+ radioVNs.push(
722
+ h("span", {
723
+ class: "vxe-radio--label"
724
+ }, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField))
725
+ );
726
+ }
727
+ return renderCellBaseVNs(params, [
728
+ h("span", {
729
+ class: ["vxe-cell--radio", {
730
+ "is--checked": isChecked,
731
+ "is--disabled": isDisabled
732
+ }],
733
+ ...ons
734
+ }, radioVNs)
735
+ ]);
736
+ },
737
+ renderDeepRadioCell(params) {
738
+ return Cell.renderDeepNodeBtn(params, Cell.renderRadioCell(params));
739
+ },
740
+ /**
741
+ * 多选
742
+ */
743
+ renderCheckboxHeader(params) {
744
+ const { $table, column, isHidden } = params;
745
+ const tableReactData = $table.reactData;
746
+ const { computeIsAllCheckboxDisabled, computeCheckboxOpts } = $table.getComputeMaps();
747
+ const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData;
748
+ const isAllCheckboxDisabled = computeIsAllCheckboxDisabled.value;
749
+ const { slots } = column;
750
+ const titleSlot = slots ? slots.title : null;
751
+ const checkboxOpts = computeCheckboxOpts.value;
752
+ const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
753
+ const colTitle = $table.getHeaderCellLabel(column);
754
+ const ons = {};
755
+ if (!isHidden) {
756
+ ons.onClick = (evnt) => {
757
+ if (!isAllCheckboxDisabled) {
758
+ $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
1094
759
  }
1095
- return [];
1096
- },
1097
- /**
1098
- * 筛选
1099
- */
1100
- renderFilterHeader(params) {
1101
- return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderFilterIcon(params)));
1102
- },
1103
- renderFilterIcon(params) {
1104
- const { $table, column, hasFilter } = params;
1105
- const tableReactData = $table.reactData;
1106
- const { filterStore } = tableReactData;
1107
- const { computeFilterOpts } = $table.getComputeMaps();
1108
- const filterOpts = computeFilterOpts.value;
1109
- const { showIcon, iconNone, iconMatch, iconVisibleMethod } = filterOpts;
1110
- if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
1111
- return [
1112
- h('span', {
1113
- class: ['vxe-cell--filter', {
1114
- 'is--active': filterStore.visible && filterStore.column === column
1115
- }],
1116
- onClick(evnt) {
1117
- if ($table.triggerFilterEvent) {
1118
- $table.triggerFilterEvent(evnt, params.column, params);
1119
- }
1120
- }
1121
- }, [
1122
- h('i', {
1123
- class: ['vxe-filter--btn', hasFilter ? (iconMatch || getIcon().TABLE_FILTER_MATCH) : (iconNone || getIcon().TABLE_FILTER_NONE)],
1124
- title: getI18n('vxe.table.filter')
1125
- })
1126
- ])
1127
- ];
760
+ };
761
+ }
762
+ const checkboxParams = { ...params, checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate };
763
+ if (getConfig().tableHeadeSlotToTitleSlot === "obsolete") {
764
+ const headerSlot = slots ? slots.header : null;
765
+ if (headerSlot) {
766
+ return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)));
767
+ }
768
+ }
769
+ if (checkStrictly ? !showHeader : showHeader === false) {
770
+ return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
771
+ h("span", {
772
+ class: "vxe-checkbox--label"
773
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
774
+ ]));
775
+ }
776
+ return renderHeaderCellBaseVNs(
777
+ params,
778
+ renderTitleContent(checkboxParams, [
779
+ h("span", {
780
+ class: ["vxe-cell--checkbox", {
781
+ "is--checked": isAllCheckboxSelected,
782
+ "is--disabled": isAllCheckboxDisabled,
783
+ "is--indeterminate": isAllCheckboxIndeterminate
784
+ }],
785
+ title: XEUtils.eqNull(headerTitle) ? getI18n("vxe.table.allTitle") : `${headerTitle || ""}`,
786
+ ...ons
787
+ }, [
788
+ h("span", {
789
+ class: ["vxe-checkbox--icon", isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
790
+ })
791
+ ].concat(titleSlot || colTitle ? [
792
+ h("span", {
793
+ class: "vxe-checkbox--label"
794
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
795
+ ] : []))
796
+ ])
797
+ );
798
+ },
799
+ renderCheckboxCell(params) {
800
+ const { $table, row, column, isHidden } = params;
801
+ const tableProps = $table.props;
802
+ const tableReactData = $table.reactData;
803
+ const tableInternalData = $table.internalData;
804
+ const { treeConfig } = tableProps;
805
+ const { updateCheckboxFlag, isRowGroupStatus } = tableReactData;
806
+ const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData;
807
+ const { computeCheckboxOpts, computeAggregateOpts } = $table.getComputeMaps();
808
+ const aggregateOpts = computeAggregateOpts.value;
809
+ const { mapChildrenField } = aggregateOpts;
810
+ const checkboxOpts = computeCheckboxOpts.value;
811
+ const { labelField, checkMethod, visibleMethod } = checkboxOpts;
812
+ const { slots } = column;
813
+ const defaultSlot = slots ? slots.default : null;
814
+ const checkboxSlot = slots ? slots.checkbox : null;
815
+ let indeterminate = false;
816
+ let isChecked = false;
817
+ let isVisible = true;
818
+ let isDisabled = false;
819
+ const ons = {};
820
+ if (!isHidden) {
821
+ const rowid = getRowid($table, row);
822
+ isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
823
+ if (checkMethod && isRowGroupStatus && $table.isAggregateRecord(row)) {
824
+ const childList = row[mapChildrenField || ""];
825
+ if (!childList || !childList.length || childList.every((item) => !checkMethod({ $table, row: item }))) {
826
+ isDisabled = true;
1128
827
  }
1129
- return [];
1130
- },
1131
- /**
1132
- * 可编辑
1133
- */
1134
- renderEditHeader(params) {
1135
- const { $table, column } = params;
1136
- const tableProps = $table.props;
1137
- const { computeEditOpts } = $table.getComputeMaps();
1138
- const { editConfig, editRules } = tableProps;
1139
- const editOpts = computeEditOpts.value;
1140
- const { sortable, filters, editRender } = column;
1141
- const isEnableEdit = editConfig && isEnableConf(editConfig);
1142
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1143
- let isRequired = false;
1144
- if (editRules) {
1145
- const columnRules = column.rules ? column.rules : XEUtils.get(editRules, column.field);
1146
- if (columnRules) {
1147
- isRequired = columnRules.some((rule) => rule.required);
1148
- }
828
+ } else {
829
+ isVisible = !visibleMethod || visibleMethod({ $table, row });
830
+ isDisabled = checkMethod ? !checkMethod({ $table, row }) : !!checkMethod;
831
+ }
832
+ if (treeConfig || isRowGroupStatus) {
833
+ indeterminate = !!treeIndeterminateRowMaps[rowid];
834
+ }
835
+ ons.onClick = (evnt) => {
836
+ if (!isDisabled && isVisible) {
837
+ $table.triggerCheckRowEvent(evnt, params, !isChecked);
1149
838
  }
1150
- let editIconVNs = [];
1151
- if (isEnableEdit) {
1152
- const { showAsterisk, showIcon, icon } = editOpts;
1153
- editIconVNs = [
1154
- isRequired && showAsterisk
1155
- ? h('span', {
1156
- class: 'vxe-cell--required-icon'
1157
- }, [
1158
- h('i')
1159
- ])
1160
- : renderEmptyElement($table),
1161
- editRenderOpts && showIcon
1162
- ? h('span', {
1163
- class: 'vxe-cell--edit-icon'
1164
- }, XEUtils.isFunction(icon)
1165
- ? getSlotVNs(icon({}))
1166
- : [
1167
- h('i', {
1168
- class: icon || getIcon().TABLE_EDIT
1169
- })
1170
- ])
1171
- : renderEmptyElement($table)
1172
- ];
839
+ };
840
+ }
841
+ const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate };
842
+ if (checkboxSlot) {
843
+ return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
844
+ }
845
+ const checkVNs = [];
846
+ if (isVisible) {
847
+ checkVNs.push(
848
+ h("span", {
849
+ class: ["vxe-checkbox--icon", indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : isDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
850
+ })
851
+ );
852
+ }
853
+ if (defaultSlot || labelField) {
854
+ checkVNs.push(
855
+ h("span", {
856
+ class: "vxe-checkbox--label"
857
+ }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField))
858
+ );
859
+ }
860
+ return renderCellBaseVNs(params, [
861
+ h("span", {
862
+ class: ["vxe-cell--checkbox", {
863
+ "is--checked": isChecked,
864
+ "is--disabled": isDisabled,
865
+ "is--indeterminate": indeterminate,
866
+ "is--hidden": !isVisible
867
+ }],
868
+ ...ons
869
+ }, checkVNs)
870
+ ]);
871
+ },
872
+ renderDeepSelectionCell(params) {
873
+ return Cell.renderDeepNodeBtn(params, Cell.renderCheckboxCell(params));
874
+ },
875
+ renderCheckboxCellByProp(params) {
876
+ const { $table, row, column, isHidden } = params;
877
+ const tableProps = $table.props;
878
+ const tableReactData = $table.reactData;
879
+ const tableInternalData = $table.internalData;
880
+ const { treeConfig } = tableProps;
881
+ const { updateCheckboxFlag, isRowGroupStatus } = tableReactData;
882
+ const { treeIndeterminateRowMaps } = tableInternalData;
883
+ const { computeCheckboxOpts, computeAggregateOpts } = $table.getComputeMaps();
884
+ const aggregateOpts = computeAggregateOpts.value;
885
+ const { mapChildrenField } = aggregateOpts;
886
+ const checkboxOpts = computeCheckboxOpts.value;
887
+ const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts;
888
+ const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
889
+ const { slots } = column;
890
+ const defaultSlot = slots ? slots.default : null;
891
+ const checkboxSlot = slots ? slots.checkbox : null;
892
+ let indeterminate = false;
893
+ let isChecked = false;
894
+ let isVisible = true;
895
+ let isDisabled = false;
896
+ const ons = {};
897
+ if (!isHidden) {
898
+ const rowid = getRowid($table, row);
899
+ isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField);
900
+ if (checkMethod && isRowGroupStatus && $table.isAggregateRecord(row)) {
901
+ const childList = row[mapChildrenField || ""];
902
+ if (!childList || !childList.length || childList.every((item) => !checkMethod({ $table, row: item }))) {
903
+ isDisabled = true;
1173
904
  }
1174
- return renderHeaderCellBaseVNs(params, editIconVNs.concat(Cell.renderHeaderTitle(params))
1175
- .concat(sortable ? Cell.renderSortIcon(params) : [])
1176
- .concat(filters ? Cell.renderFilterIcon(params) : []));
1177
- },
1178
- // 行格编辑模式
1179
- renderRowEdit(params) {
1180
- const { $table, column } = params;
1181
- const tableProps = $table.props;
1182
- const { editConfig } = tableProps;
1183
- const tableReactData = $table.reactData;
1184
- const { editStore } = tableReactData;
1185
- const { actived } = editStore;
1186
- const { editRender } = column;
1187
- const isEnableEdit = editConfig && isEnableConf(editConfig);
1188
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1189
- return Cell.runRenderer(params, !!(editRenderOpts && actived && actived.row === params.row));
1190
- },
1191
- renderDeepRowEdit(params) {
1192
- return Cell.renderDeepNodeBtn(params, Cell.renderRowEdit(params));
1193
- },
1194
- // 单元格编辑模式
1195
- renderCellEdit(params) {
1196
- const { $table, column } = params;
1197
- const tableProps = $table.props;
1198
- const { editConfig } = tableProps;
1199
- const tableReactData = $table.reactData;
1200
- const { editStore } = tableReactData;
1201
- const { actived } = editStore;
1202
- const { editRender } = column;
1203
- const isEnableEdit = editConfig && isEnableConf(editConfig);
1204
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1205
- return Cell.runRenderer(params, !!(editRenderOpts && actived && actived.row === params.row && actived.column === params.column));
1206
- },
1207
- renderDeepCellEdit(params) {
1208
- return Cell.renderDeepNodeBtn(params, Cell.renderCellEdit(params));
1209
- },
1210
- runRenderer(params, isEdit) {
1211
- const { $table, row, column } = params;
1212
- const tableProps = $table.props;
1213
- const { editConfig } = tableProps;
1214
- const tableReactData = $table.reactData;
1215
- const { isRowGroupStatus } = tableReactData;
1216
- const { slots, field, editRender, formatter } = column;
1217
- const isEnableEdit = editConfig && isEnableConf(editConfig);
1218
- const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1219
- const defaultSlot = slots ? slots.default : null;
1220
- const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
1221
- const editSlot = slots ? slots.edit : null;
1222
- const cellParams = Object.assign({ $type: '', isEdit }, params);
1223
- if (isEdit && editRenderOpts) {
1224
- cellParams.$type = 'edit';
1225
- if (editSlot) {
1226
- return $table.callSlot(editSlot, cellParams);
1227
- }
1228
- const { computeRendererOpts } = $table.getComputeMaps();
1229
- const rendererOpts = computeRendererOpts.value;
1230
- const compConf = editRenderOpts.name ? (rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name)) : null;
1231
- const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
1232
- if (rtEdit) {
1233
- return getSlotVNs(rtEdit(editRenderOpts, cellParams));
1234
- }
1235
- return [];
905
+ } else {
906
+ isVisible = !visibleMethod || visibleMethod({ $table, row });
907
+ isDisabled = checkMethod ? !checkMethod({ $table, row }) : !!checkMethod;
908
+ }
909
+ if (treeConfig || isRowGroupStatus) {
910
+ indeterminate = !!treeIndeterminateRowMaps[rowid];
911
+ }
912
+ ons.onClick = (evnt) => {
913
+ if (!isDisabled && isVisible) {
914
+ $table.triggerCheckRowEvent(evnt, params, !isChecked);
1236
915
  }
1237
- if (isRowGroupStatus && field && row.isAggregate) {
1238
- const aggRow = row;
1239
- const { computeAggregateOpts } = $table.getComputeMaps();
1240
- const aggregateOpts = computeAggregateOpts.value;
1241
- const { mapChildrenField } = aggregateOpts;
1242
- const groupField = aggRow.groupField;
1243
- const groupContent = aggRow.groupContent;
1244
- const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : [];
1245
- const childCount = aggRow.childCount;
1246
- if (gcSlot) {
1247
- return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
1248
- }
916
+ };
917
+ }
918
+ const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate };
919
+ if (checkboxSlot) {
920
+ return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
921
+ }
922
+ const checkVNs = [];
923
+ if (isVisible) {
924
+ checkVNs.push(
925
+ h("span", {
926
+ class: ["vxe-checkbox--icon", indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : isDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
927
+ })
928
+ );
929
+ if (defaultSlot || labelField) {
930
+ checkVNs.push(
931
+ h("span", {
932
+ class: "vxe-checkbox--label"
933
+ }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField))
934
+ );
935
+ }
936
+ }
937
+ return renderCellBaseVNs(params, [
938
+ h("span", {
939
+ class: ["vxe-cell--checkbox", {
940
+ "is--checked": isChecked,
941
+ "is--disabled": isDisabled,
942
+ "is--indeterminate": indeterminateField && !isChecked ? row[indeterminateField] : indeterminate,
943
+ "is--hidden": !isVisible
944
+ }],
945
+ ...ons
946
+ }, checkVNs)
947
+ ]);
948
+ },
949
+ renderDeepSelectionCellByProp(params) {
950
+ return Cell.renderDeepNodeBtn(params, Cell.renderCheckboxCellByProp(params));
951
+ },
952
+ /**
953
+ * 展开行
954
+ */
955
+ renderExpandCell(params) {
956
+ const { $table, isHidden, row, column } = params;
957
+ const tableReactData = $table.reactData;
958
+ const tableInternalData = $table.internalData;
959
+ const { isRowGroupStatus } = tableReactData;
960
+ const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData;
961
+ const { computeExpandOpts } = $table.getComputeMaps();
962
+ const expandOpts = computeExpandOpts.value;
963
+ const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts;
964
+ const { slots } = column;
965
+ const defaultSlot = slots ? slots.default : null;
966
+ const iconSlot = slots ? slots.icon : null;
967
+ let isActive = false;
968
+ let isLazyLoading = false;
969
+ if (isRowGroupStatus && row.isAggregate) {
970
+ return renderCellBaseVNs(params, []);
971
+ }
972
+ if (iconSlot) {
973
+ return renderCellBaseVNs(params, $table.callSlot(iconSlot, params));
974
+ }
975
+ if (!isHidden) {
976
+ const rowid = getRowid($table, row);
977
+ isActive = !!rowExpandedMaps[rowid];
978
+ if (lazy) {
979
+ isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
980
+ }
981
+ }
982
+ return renderCellBaseVNs(params, [
983
+ showIcon && (!visibleMethod || visibleMethod(params)) ? h("div", {
984
+ class: ["vxe-table--expanded", {
985
+ "is--active": isActive
986
+ }]
987
+ }, [
988
+ h("span", {
989
+ class: "vxe-table--expand-btn",
990
+ onMousedown(evnt) {
991
+ evnt.stopPropagation();
992
+ },
993
+ onClick(evnt) {
994
+ $table.triggerRowExpandEvent(evnt, params);
995
+ }
996
+ }, [
997
+ h("i", {
998
+ class: isLazyLoading ? iconLoaded || getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || getIcon().TABLE_EXPAND_OPEN : iconClose || getIcon().TABLE_EXPAND_CLOSE
999
+ })
1000
+ ])
1001
+ ]) : renderEmptyElement($table),
1002
+ defaultSlot || labelField ? h("div", {
1003
+ class: "vxe-table--expand-label"
1004
+ }, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField)) : renderEmptyElement($table)
1005
+ ]);
1006
+ },
1007
+ renderExpandData(params) {
1008
+ const { $table, column } = params;
1009
+ const { slots, contentRender } = column;
1010
+ const contentSlot = slots ? slots.content : null;
1011
+ if (contentSlot) {
1012
+ return $table.callSlot(contentSlot, params);
1013
+ }
1014
+ if (contentRender) {
1015
+ const { computeRendererOpts } = $table.getComputeMaps();
1016
+ const rendererOpts = computeRendererOpts.value;
1017
+ const compConf = contentRender.name ? rendererOpts[contentRender.name] || renderer.get(contentRender.name) : null;
1018
+ if (compConf) {
1019
+ const rtExpand = compConf.renderTableExpand || compConf.renderExpand;
1020
+ if (rtExpand) {
1021
+ return getSlotVNs(rtExpand(contentRender, params));
1249
1022
  }
1250
- else {
1251
- if (defaultSlot) {
1252
- return renderCellBaseVNs(params, $table.callSlot(defaultSlot, cellParams));
1023
+ }
1024
+ }
1025
+ return [];
1026
+ },
1027
+ /**
1028
+ * HTML 标签
1029
+ */
1030
+ renderHTMLCell(params) {
1031
+ const { $table, column } = params;
1032
+ const { slots } = column;
1033
+ const defaultSlot = slots ? slots.default : null;
1034
+ if (defaultSlot) {
1035
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
1036
+ }
1037
+ return renderCellBaseVNs(params, [
1038
+ h("span", {
1039
+ class: "vxe-cell--html",
1040
+ innerHTML: getDefaultCellLabel(params)
1041
+ })
1042
+ ]);
1043
+ },
1044
+ renderDeepHTMLCell(params) {
1045
+ return Cell.renderDeepNodeBtn(params, Cell.renderHTMLCell(params));
1046
+ },
1047
+ /**
1048
+ * 排序和筛选
1049
+ */
1050
+ renderSortAndFilterHeader(params) {
1051
+ return renderHeaderCellBaseVNs(
1052
+ params,
1053
+ Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params)))
1054
+ );
1055
+ },
1056
+ /**
1057
+ * 排序
1058
+ */
1059
+ renderSortHeader(params) {
1060
+ return renderHeaderCellBaseVNs(
1061
+ params,
1062
+ Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params))
1063
+ );
1064
+ },
1065
+ renderSortIcon(params) {
1066
+ const { $table, column } = params;
1067
+ const { computeSortOpts } = $table.getComputeMaps();
1068
+ const sortOpts = computeSortOpts.value;
1069
+ const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
1070
+ const { order, slots } = column;
1071
+ if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
1072
+ const sortSlot = slots ? slots.sort : null;
1073
+ return sortSlot ? getSlotVNs($table.callSlot(sortSlot, params)) : [
1074
+ h("span", {
1075
+ class: ["vxe-cell--sort", `vxe-cell--sort-${iconLayout}-layout`]
1076
+ }, [
1077
+ h("i", {
1078
+ class: ["vxe-sort--asc-btn", iconAsc || getIcon().TABLE_SORT_ASC, {
1079
+ "sort--active": order === "asc"
1080
+ }],
1081
+ title: XEUtils.eqNull(ascTitle) ? getI18n("vxe.table.sortAsc") : `${ascTitle || ""}`,
1082
+ onClick: allowBtn ? (evnt) => {
1083
+ evnt.stopPropagation();
1084
+ $table.triggerSortEvent(evnt, column, "asc");
1085
+ } : void 0
1086
+ }),
1087
+ h("i", {
1088
+ class: ["vxe-sort--desc-btn", iconDesc || getIcon().TABLE_SORT_DESC, {
1089
+ "sort--active": order === "desc"
1090
+ }],
1091
+ title: XEUtils.eqNull(descTitle) ? getI18n("vxe.table.sortDesc") : `${descTitle || ""}`,
1092
+ onClick: allowBtn ? (evnt) => {
1093
+ evnt.stopPropagation();
1094
+ $table.triggerSortEvent(evnt, column, "desc");
1095
+ } : void 0
1096
+ })
1097
+ ])
1098
+ ];
1099
+ }
1100
+ return [];
1101
+ },
1102
+ /**
1103
+ * 筛选
1104
+ */
1105
+ renderFilterHeader(params) {
1106
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderFilterIcon(params)));
1107
+ },
1108
+ renderFilterIcon(params) {
1109
+ const { $table, column, hasFilter } = params;
1110
+ const tableReactData = $table.reactData;
1111
+ const { filterStore } = tableReactData;
1112
+ const { computeFilterOpts } = $table.getComputeMaps();
1113
+ const filterOpts = computeFilterOpts.value;
1114
+ const { showIcon, iconNone, iconMatch, iconVisibleMethod } = filterOpts;
1115
+ if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
1116
+ return [
1117
+ h("span", {
1118
+ class: ["vxe-cell--filter", {
1119
+ "is--active": filterStore.visible && filterStore.column === column
1120
+ }],
1121
+ onClick(evnt) {
1122
+ if ($table.triggerFilterEvent) {
1123
+ $table.triggerFilterEvent(evnt, params.column, params);
1253
1124
  }
1254
- }
1255
- // slot default > formatter
1256
- if (formatter) {
1257
- return renderCellBaseVNs(params, [
1258
- h('span', {
1259
- class: 'vxe-cell--label'
1260
- }, getDefaultCellLabel(cellParams))
1261
- ]);
1262
- }
1263
- return Cell.renderDefaultCell(cellParams);
1125
+ }
1126
+ }, [
1127
+ h("i", {
1128
+ class: ["vxe-filter--btn", hasFilter ? iconMatch || getIcon().TABLE_FILTER_MATCH : iconNone || getIcon().TABLE_FILTER_NONE],
1129
+ title: getI18n("vxe.table.filter")
1130
+ })
1131
+ ])
1132
+ ];
1264
1133
  }
1134
+ return [];
1135
+ },
1136
+ /**
1137
+ * 可编辑
1138
+ */
1139
+ renderEditHeader(params) {
1140
+ const { $table, column } = params;
1141
+ const tableProps = $table.props;
1142
+ const { computeEditOpts } = $table.getComputeMaps();
1143
+ const { editConfig, editRules } = tableProps;
1144
+ const editOpts = computeEditOpts.value;
1145
+ const { sortable, filters, editRender } = column;
1146
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1147
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1148
+ let isRequired = false;
1149
+ if (editRules) {
1150
+ const columnRules = column.rules ? column.rules : XEUtils.get(editRules, column.field);
1151
+ if (columnRules) {
1152
+ isRequired = columnRules.some((rule) => rule.required);
1153
+ }
1154
+ }
1155
+ let editIconVNs = [];
1156
+ if (isEnableEdit) {
1157
+ const { showAsterisk, showIcon, icon } = editOpts;
1158
+ editIconVNs = [
1159
+ isRequired && showAsterisk ? h("span", {
1160
+ class: "vxe-cell--required-icon"
1161
+ }, [
1162
+ h("i")
1163
+ ]) : renderEmptyElement($table),
1164
+ editRenderOpts && showIcon ? h("span", {
1165
+ class: "vxe-cell--edit-icon"
1166
+ }, XEUtils.isFunction(icon) ? getSlotVNs(icon({})) : [
1167
+ h("i", {
1168
+ class: icon || getIcon().TABLE_EDIT
1169
+ })
1170
+ ]) : renderEmptyElement($table)
1171
+ ];
1172
+ }
1173
+ return renderHeaderCellBaseVNs(
1174
+ params,
1175
+ editIconVNs.concat(Cell.renderHeaderTitle(params)).concat(sortable ? Cell.renderSortIcon(params) : []).concat(filters ? Cell.renderFilterIcon(params) : [])
1176
+ );
1177
+ },
1178
+ // 行格编辑模式
1179
+ renderRowEdit(params) {
1180
+ const { $table, column } = params;
1181
+ const tableProps = $table.props;
1182
+ const { editConfig } = tableProps;
1183
+ const tableReactData = $table.reactData;
1184
+ const { editStore } = tableReactData;
1185
+ const { actived } = editStore;
1186
+ const { editRender } = column;
1187
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1188
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1189
+ return Cell.runRenderer(params, !!(editRenderOpts && actived && actived.row === params.row));
1190
+ },
1191
+ renderDeepRowEdit(params) {
1192
+ return Cell.renderDeepNodeBtn(params, Cell.renderRowEdit(params));
1193
+ },
1194
+ // 单元格编辑模式
1195
+ renderCellEdit(params) {
1196
+ const { $table, column } = params;
1197
+ const tableProps = $table.props;
1198
+ const { editConfig } = tableProps;
1199
+ const tableReactData = $table.reactData;
1200
+ const { editStore } = tableReactData;
1201
+ const { actived } = editStore;
1202
+ const { editRender } = column;
1203
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1204
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1205
+ return Cell.runRenderer(params, !!(editRenderOpts && actived && actived.row === params.row && actived.column === params.column));
1206
+ },
1207
+ renderDeepCellEdit(params) {
1208
+ return Cell.renderDeepNodeBtn(params, Cell.renderCellEdit(params));
1209
+ },
1210
+ runRenderer(params, isEdit) {
1211
+ const { $table, row, column } = params;
1212
+ const tableProps = $table.props;
1213
+ const { editConfig } = tableProps;
1214
+ const tableReactData = $table.reactData;
1215
+ const { isRowGroupStatus } = tableReactData;
1216
+ const { slots, field, editRender, formatter } = column;
1217
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1218
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1219
+ const defaultSlot = slots ? slots.default : null;
1220
+ const gcSlot = slots ? slots.groupContent || slots["group-content"] : null;
1221
+ const editSlot = slots ? slots.edit : null;
1222
+ const cellParams = Object.assign({ $type: "", isEdit }, params);
1223
+ if (isEdit && editRenderOpts) {
1224
+ cellParams.$type = "edit";
1225
+ if (editSlot) {
1226
+ return $table.callSlot(editSlot, cellParams);
1227
+ }
1228
+ const { computeRendererOpts } = $table.getComputeMaps();
1229
+ const rendererOpts = computeRendererOpts.value;
1230
+ const compConf = editRenderOpts.name ? rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name) : null;
1231
+ const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
1232
+ if (rtEdit) {
1233
+ return getSlotVNs(rtEdit(editRenderOpts, cellParams));
1234
+ }
1235
+ return [];
1236
+ }
1237
+ if (isRowGroupStatus && field && row.isAggregate) {
1238
+ const aggRow = row;
1239
+ const { computeAggregateOpts } = $table.getComputeMaps();
1240
+ const aggregateOpts = computeAggregateOpts.value;
1241
+ const { mapChildrenField } = aggregateOpts;
1242
+ const groupField = aggRow.groupField;
1243
+ const groupContent = aggRow.groupContent;
1244
+ const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
1245
+ const childCount = aggRow.childCount;
1246
+ if (gcSlot) {
1247
+ return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
1248
+ }
1249
+ } else {
1250
+ if (defaultSlot) {
1251
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, cellParams));
1252
+ }
1253
+ }
1254
+ if (formatter) {
1255
+ return renderCellBaseVNs(params, [
1256
+ h("span", {
1257
+ class: "vxe-cell--label"
1258
+ }, getDefaultCellLabel(cellParams))
1259
+ ]);
1260
+ }
1261
+ return Cell.renderDefaultCell(cellParams);
1262
+ }
1263
+ };
1264
+ var cell_default = Cell;
1265
+ export {
1266
+ Cell,
1267
+ cell_default as default
1265
1268
  };
1266
- export default Cell;