tomtaw-vxe-table 3.25.13 → 3.25.15

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