vxe-table 4.23.4 → 4.23.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/dist/all.esm.js +32459 -33908
  2. package/dist/style.css +4501 -1
  3. package/dist/style.mini.css +1 -0
  4. package/es/colgroup/index.d.ts +760 -0
  5. package/es/colgroup/index.js +16 -13
  6. package/es/column/index.d.ts +760 -0
  7. package/es/column/index.js +16 -13
  8. package/es/components.d.ts +9 -0
  9. package/es/components.js +29 -29
  10. package/es/grid/index.d.ts +2824 -0
  11. package/es/grid/index.js +14 -9
  12. package/es/grid/src/emits.d.ts +2 -0
  13. package/es/grid/src/emits.js +18 -15
  14. package/es/grid/src/grid.d.ts +556 -0
  15. package/es/grid/src/grid.js +1695 -1758
  16. package/es/grid/src/props.d.ts +200 -0
  17. package/es/grid/src/props.js +19 -6
  18. package/es/{vxe-grid/style.min.css → grid/style.mini.css} +1 -1
  19. package/es/index.d.ts +3 -0
  20. package/es/index.esm.js +6 -3
  21. package/es/index.js +6 -0
  22. package/es/locale/lang/ar-EG.d.ts +908 -2
  23. package/es/locale/lang/ar-EG.js +906 -903
  24. package/es/locale/lang/de-DE.d.ts +908 -2
  25. package/es/locale/lang/de-DE.js +906 -903
  26. package/es/locale/lang/en-US.d.ts +908 -2
  27. package/es/locale/lang/en-US.js +906 -903
  28. package/es/locale/lang/es-ES.d.ts +908 -2
  29. package/es/locale/lang/es-ES.js +906 -903
  30. package/es/locale/lang/fr-FR.d.ts +908 -2
  31. package/es/locale/lang/fr-FR.js +906 -903
  32. package/es/locale/lang/hu-HU.d.ts +908 -2
  33. package/es/locale/lang/hu-HU.js +906 -903
  34. package/es/locale/lang/hy-AM.d.ts +908 -2
  35. package/es/locale/lang/hy-AM.js +906 -903
  36. package/es/locale/lang/id-ID.d.ts +908 -2
  37. package/es/locale/lang/id-ID.js +906 -903
  38. package/es/locale/lang/it-IT.d.ts +908 -2
  39. package/es/locale/lang/it-IT.js +906 -903
  40. package/es/locale/lang/ja-JP.d.ts +908 -2
  41. package/es/locale/lang/ja-JP.js +906 -903
  42. package/es/locale/lang/ko-KR.d.ts +908 -2
  43. package/es/locale/lang/ko-KR.js +906 -903
  44. package/es/locale/lang/ms-MY.d.ts +908 -2
  45. package/es/locale/lang/ms-MY.js +906 -903
  46. package/es/locale/lang/nb-NO.d.ts +908 -2
  47. package/es/locale/lang/nb-NO.js +906 -903
  48. package/es/locale/lang/pt-BR.d.ts +908 -2
  49. package/es/locale/lang/pt-BR.js +906 -903
  50. package/es/locale/lang/ru-RU.d.ts +908 -2
  51. package/es/locale/lang/ru-RU.js +906 -903
  52. package/es/locale/lang/th-TH.d.ts +908 -2
  53. package/es/locale/lang/th-TH.js +906 -903
  54. package/es/locale/lang/ug-CN.d.ts +908 -2
  55. package/es/locale/lang/ug-CN.js +906 -903
  56. package/es/locale/lang/uk-UA.d.ts +908 -2
  57. package/es/locale/lang/uk-UA.js +906 -903
  58. package/es/locale/lang/uz-UZ.d.ts +908 -2
  59. package/es/locale/lang/uz-UZ.js +906 -903
  60. package/es/locale/lang/vi-VN.d.ts +908 -2
  61. package/es/locale/lang/vi-VN.js +906 -903
  62. package/es/locale/lang/zh-CHT.d.ts +908 -2
  63. package/es/locale/lang/zh-CHT.js +906 -903
  64. package/es/locale/lang/zh-CN.d.ts +908 -2
  65. package/es/locale/lang/zh-CN.js +906 -903
  66. package/es/locale/lang/zh-HK.d.ts +908 -2
  67. package/es/locale/lang/zh-HK.js +910 -2
  68. package/es/locale/lang/zh-MO.d.ts +908 -2
  69. package/es/locale/lang/zh-MO.js +910 -2
  70. package/es/locale/lang/zh-TC.d.ts +908 -0
  71. package/es/locale/lang/zh-TC.js +910 -2
  72. package/es/locale/lang/zh-TW.d.ts +908 -2
  73. package/es/locale/lang/zh-TW.js +910 -2
  74. package/es/table/index.d.ts +2672 -0
  75. package/es/table/index.js +16 -11
  76. package/es/table/module/custom/hook.d.ts +1 -0
  77. package/es/table/module/custom/hook.js +462 -483
  78. package/es/table/module/custom/panel.d.ts +17 -0
  79. package/es/table/module/custom/panel.js +1482 -1559
  80. package/es/table/module/edit/hook.d.ts +1 -0
  81. package/es/table/module/edit/hook.js +1008 -1078
  82. package/es/table/module/export/export-panel.d.ts +27 -0
  83. package/es/table/module/export/export-panel.js +523 -575
  84. package/es/table/module/export/hook.d.ts +1 -0
  85. package/es/table/module/export/hook.js +1805 -1884
  86. package/es/table/module/export/import-panel.d.ts +27 -0
  87. package/es/table/module/export/import-panel.js +244 -252
  88. package/es/table/module/export/util.d.ts +5 -0
  89. package/es/table/module/export/util.js +20 -17
  90. package/es/table/module/filter/hook.d.ts +1 -0
  91. package/es/table/module/filter/hook.js +472 -487
  92. package/es/table/module/filter/panel.d.ts +16 -0
  93. package/es/table/module/filter/panel.js +251 -275
  94. package/es/table/module/keyboard/hook.d.ts +1 -0
  95. package/es/table/module/keyboard/hook.js +445 -497
  96. package/es/table/module/menu/hook.d.ts +1 -0
  97. package/es/table/module/menu/hook.js +295 -315
  98. package/es/table/module/menu/panel.d.ts +2 -0
  99. package/es/table/module/menu/panel.js +164 -183
  100. package/es/table/module/validator/hook.d.ts +1 -0
  101. package/es/table/module/validator/hook.js +522 -571
  102. package/es/table/render/index.d.ts +1 -0
  103. package/es/table/render/index.js +1402 -1362
  104. package/es/table/src/body.d.ts +24 -0
  105. package/es/table/src/body.js +850 -865
  106. package/es/table/src/cell.d.ts +192 -0
  107. package/es/table/src/cell.js +1209 -1207
  108. package/es/table/src/column.d.ts +263 -0
  109. package/es/table/src/column.js +178 -174
  110. package/es/table/src/columnInfo.d.ts +13 -0
  111. package/es/table/src/columnInfo.js +202 -196
  112. package/es/table/src/emits.d.ts +2 -0
  113. package/es/table/src/emits.js +126 -119
  114. package/es/table/src/footer.d.ts +45 -0
  115. package/es/table/src/footer.js +336 -340
  116. package/es/table/src/group.d.ts +178 -0
  117. package/es/table/src/group.js +49 -46
  118. package/es/table/src/header.d.ts +26 -0
  119. package/es/table/src/header.js +517 -519
  120. package/es/table/src/props.d.ts +238 -0
  121. package/es/table/src/props.js +331 -328
  122. package/es/table/src/store.d.ts +6 -0
  123. package/es/table/src/store.js +9 -6
  124. package/es/table/src/table.d.ts +539 -0
  125. package/es/table/src/table.js +14064 -15041
  126. package/es/table/src/use/cell-view.d.ts +10 -0
  127. package/es/table/src/use/cell-view.js +36 -33
  128. package/es/table/src/use/index.d.ts +1 -0
  129. package/es/table/src/use/index.js +1 -1
  130. package/es/table/src/util.d.ts +74 -0
  131. package/es/table/src/util.js +1038 -1026
  132. package/es/table/style.css +1 -1
  133. package/es/table/style.mini.css +1 -0
  134. package/es/toolbar/index.d.ts +340 -0
  135. package/es/toolbar/index.js +14 -9
  136. package/es/toolbar/src/toolbar.d.ts +75 -0
  137. package/es/toolbar/src/toolbar.js +605 -613
  138. package/es/toolbar/{style.min.css → style.mini.css} +1 -1
  139. package/es/ui/index.d.ts +86 -0
  140. package/es/ui/index.js +457 -501
  141. package/es/ui/src/anime.d.ts +10 -0
  142. package/es/ui/src/anime.js +40 -40
  143. package/es/ui/src/comp.d.ts +2 -0
  144. package/es/ui/src/comp.js +5 -2
  145. package/es/ui/src/dom.d.ts +80 -0
  146. package/es/ui/src/dom.js +377 -380
  147. package/es/ui/src/log.d.ts +6 -0
  148. package/es/ui/src/log.js +18 -13
  149. package/es/ui/src/utils.d.ts +23 -0
  150. package/es/ui/src/utils.js +57 -53
  151. package/es/ui/src/vn.d.ts +7 -0
  152. package/es/ui/src/vn.js +49 -42
  153. package/es/v-x-e-table/index.d.ts +3 -0
  154. package/es/v-x-e-table/index.js +6 -3
  155. package/es/vxe-colgroup/index.d.ts +3 -0
  156. package/es/vxe-colgroup/index.js +6 -3
  157. package/es/vxe-column/index.d.ts +3 -0
  158. package/es/vxe-column/index.js +6 -3
  159. package/es/vxe-grid/index.d.ts +3 -0
  160. package/es/vxe-grid/index.js +6 -3
  161. package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
  162. package/es/vxe-table/index.d.ts +3 -0
  163. package/es/vxe-table/index.js +6 -3
  164. package/es/vxe-table/style.css +1 -1
  165. package/es/vxe-table/style.mini.css +1 -0
  166. package/es/vxe-toolbar/index.d.ts +3 -0
  167. package/es/vxe-toolbar/index.js +6 -3
  168. package/es/vxe-toolbar/{style.min.css → style.mini.css} +1 -1
  169. package/es/vxe-ui/index.d.ts +3 -0
  170. package/es/vxe-ui/index.js +6 -3
  171. package/lib/colgroup/index.js +44 -18
  172. package/lib/colgroup/style/index.js +1 -1
  173. package/lib/column/index.js +44 -18
  174. package/lib/column/style/index.js +1 -1
  175. package/lib/components.js +58 -92
  176. package/lib/grid/index.js +42 -14
  177. package/lib/grid/src/emits.js +37 -6
  178. package/lib/grid/src/grid.js +850 -1195
  179. package/lib/grid/src/props.js +27 -11
  180. package/lib/grid/style/index.js +1 -1
  181. package/lib/{vxe-grid/style/style.min.css → grid/style/style.mini.css} +1 -1
  182. package/lib/iconfont.1792977622800.ttf +0 -0
  183. package/lib/iconfont.1792977622800.woff +0 -0
  184. package/lib/iconfont.1792977622800.woff2 +0 -0
  185. package/lib/index.common.js +35 -19
  186. package/lib/index.js +37 -0
  187. package/lib/index.umd.js +30586 -24322
  188. package/lib/index.umd.min.js +3 -1
  189. package/lib/locale/ar-EG.umd.js +948 -0
  190. package/lib/locale/de-DE.umd.js +948 -0
  191. package/lib/locale/en-US.umd.js +948 -0
  192. package/lib/locale/es-ES.umd.js +948 -0
  193. package/lib/locale/fr-FR.umd.js +948 -0
  194. package/lib/locale/hu-HU.umd.js +948 -0
  195. package/lib/locale/hy-AM.umd.js +948 -0
  196. package/lib/locale/id-ID.umd.js +948 -0
  197. package/lib/locale/it-IT.umd.js +948 -0
  198. package/lib/locale/ja-JP.umd.js +948 -0
  199. package/lib/locale/ko-KR.umd.js +948 -0
  200. package/lib/locale/lang/ar-EG.js +681 -664
  201. package/lib/locale/lang/ar-EG.umd.js +913 -892
  202. package/lib/locale/lang/de-DE.js +681 -664
  203. package/lib/locale/lang/de-DE.umd.js +913 -892
  204. package/lib/locale/lang/en-US.js +678 -661
  205. package/lib/locale/lang/en-US.umd.js +913 -892
  206. package/lib/locale/lang/es-ES.js +681 -664
  207. package/lib/locale/lang/es-ES.umd.js +913 -892
  208. package/lib/locale/lang/fr-FR.js +654 -637
  209. package/lib/locale/lang/fr-FR.umd.js +913 -892
  210. package/lib/locale/lang/hu-HU.js +681 -664
  211. package/lib/locale/lang/hu-HU.umd.js +913 -892
  212. package/lib/locale/lang/hy-AM.js +681 -664
  213. package/lib/locale/lang/hy-AM.umd.js +913 -892
  214. package/lib/locale/lang/id-ID.js +681 -664
  215. package/lib/locale/lang/id-ID.umd.js +913 -892
  216. package/lib/locale/lang/it-IT.js +661 -644
  217. package/lib/locale/lang/it-IT.umd.js +912 -891
  218. package/lib/locale/lang/ja-JP.js +710 -693
  219. package/lib/locale/lang/ja-JP.umd.js +913 -892
  220. package/lib/locale/lang/ko-KR.js +681 -664
  221. package/lib/locale/lang/ko-KR.umd.js +913 -892
  222. package/lib/locale/lang/ms-MY.js +681 -664
  223. package/lib/locale/lang/ms-MY.umd.js +913 -892
  224. package/lib/locale/lang/nb-NO.js +681 -664
  225. package/lib/locale/lang/nb-NO.umd.js +913 -892
  226. package/lib/locale/lang/pt-BR.js +681 -664
  227. package/lib/locale/lang/pt-BR.umd.js +913 -892
  228. package/lib/locale/lang/ru-RU.js +690 -673
  229. package/lib/locale/lang/ru-RU.umd.js +913 -892
  230. package/lib/locale/lang/th-TH.js +681 -664
  231. package/lib/locale/lang/th-TH.umd.js +913 -892
  232. package/lib/locale/lang/ug-CN.js +681 -664
  233. package/lib/locale/lang/ug-CN.umd.js +913 -892
  234. package/lib/locale/lang/uk-UA.js +674 -657
  235. package/lib/locale/lang/uk-UA.umd.js +913 -892
  236. package/lib/locale/lang/uz-UZ.js +583 -566
  237. package/lib/locale/lang/uz-UZ.umd.js +908 -887
  238. package/lib/locale/lang/vi-VN.js +681 -664
  239. package/lib/locale/lang/vi-VN.umd.js +913 -892
  240. package/lib/locale/lang/zh-CHT.js +681 -664
  241. package/lib/locale/lang/zh-CHT.umd.js +913 -892
  242. package/lib/locale/lang/zh-CN.js +681 -664
  243. package/lib/locale/lang/zh-CN.umd.js +913 -892
  244. package/lib/locale/lang/zh-HK.js +928 -7
  245. package/lib/locale/lang/zh-HK.umd.js +945 -20
  246. package/lib/locale/lang/zh-MO.js +928 -7
  247. package/lib/locale/lang/zh-MO.umd.js +945 -20
  248. package/lib/locale/lang/zh-TC.js +928 -7
  249. package/lib/locale/lang/zh-TC.umd.js +948 -0
  250. package/lib/locale/lang/zh-TW.js +928 -7
  251. package/lib/locale/lang/zh-TW.umd.js +945 -20
  252. package/lib/locale/ms-MY.umd.js +948 -0
  253. package/lib/locale/nb-NO.umd.js +948 -0
  254. package/lib/locale/pt-BR.umd.js +948 -0
  255. package/lib/locale/ru-RU.umd.js +948 -0
  256. package/lib/locale/th-TH.umd.js +948 -0
  257. package/lib/locale/ug-CN.umd.js +948 -0
  258. package/lib/locale/uk-UA.umd.js +948 -0
  259. package/lib/locale/uz-UZ.umd.js +948 -0
  260. package/lib/locale/vi-VN.umd.js +948 -0
  261. package/lib/locale/zh-CHT.umd.js +948 -0
  262. package/lib/locale/zh-CN.umd.js +948 -0
  263. package/lib/locale/zh-HK.umd.js +948 -0
  264. package/lib/locale/zh-MO.umd.js +948 -0
  265. package/lib/locale/zh-TC.umd.js +948 -0
  266. package/lib/locale/zh-TW.umd.js +948 -0
  267. package/lib/style.css +4501 -1
  268. package/lib/style.mini.css +1 -0
  269. package/lib/table/index.js +45 -17
  270. package/lib/table/module/custom/hook.js +132 -252
  271. package/lib/table/module/custom/panel.js +919 -970
  272. package/lib/table/module/edit/hook.js +250 -620
  273. package/lib/table/module/export/export-panel.js +390 -347
  274. package/lib/table/module/export/hook.js +745 -1179
  275. package/lib/table/module/export/import-panel.js +170 -136
  276. package/lib/table/module/export/util.js +37 -14
  277. package/lib/table/module/filter/hook.js +127 -227
  278. package/lib/table/module/filter/panel.js +177 -208
  279. package/lib/table/module/keyboard/hook.js +93 -172
  280. package/lib/table/module/menu/hook.js +86 -165
  281. package/lib/table/module/menu/panel.js +176 -141
  282. package/lib/table/module/validator/hook.js +164 -271
  283. package/lib/table/render/index.js +700 -1147
  284. package/lib/table/src/body.js +426 -559
  285. package/lib/table/src/cell.js +619 -987
  286. package/lib/table/src/column.js +55 -30
  287. package/lib/table/src/columnInfo.js +88 -110
  288. package/lib/table/src/emits.js +145 -13
  289. package/lib/table/src/footer.js +181 -240
  290. package/lib/table/src/group.js +56 -34
  291. package/lib/table/src/header.js +292 -367
  292. package/lib/table/src/props.js +27 -12
  293. package/lib/table/src/store.js +25 -9
  294. package/lib/table/src/table.js +14179 -1019
  295. package/lib/table/src/use/cell-view.js +47 -37
  296. package/lib/table/src/use/index.js +17 -15
  297. package/lib/table/src/util.js +236 -337
  298. package/lib/table/style/index.js +1 -1
  299. package/lib/table/style/style.css +1 -1
  300. package/lib/table/style/style.mini.css +1 -0
  301. package/lib/toolbar/index.js +42 -14
  302. package/lib/toolbar/src/toolbar.js +271 -379
  303. package/lib/toolbar/style/index.js +1 -1
  304. package/lib/toolbar/style/{style.min.css → style.mini.css} +1 -1
  305. package/lib/ui/index.js +153 -195
  306. package/lib/ui/src/anime.js +49 -29
  307. package/lib/ui/src/comp.js +23 -6
  308. package/lib/ui/src/dom.js +114 -147
  309. package/lib/ui/src/log.js +34 -18
  310. package/lib/ui/src/utils.js +57 -45
  311. package/lib/ui/src/vn.js +60 -34
  312. package/lib/ui/style/index.js +1 -1
  313. package/lib/v-x-e-table/index.js +35 -19
  314. package/lib/vxe-colgroup/index.js +35 -19
  315. package/lib/vxe-colgroup/style/index.js +1 -1
  316. package/lib/vxe-column/index.js +35 -19
  317. package/lib/vxe-column/style/index.js +1 -1
  318. package/lib/vxe-grid/index.js +35 -19
  319. package/lib/vxe-grid/style/index.js +1 -1
  320. package/{es/grid/style.min.css → lib/vxe-grid/style/style.mini.css} +1 -1
  321. package/lib/vxe-table/index.js +35 -19
  322. package/lib/vxe-table/style/index.js +1 -1
  323. package/lib/vxe-table/style/style.css +1 -1
  324. package/lib/vxe-table/style/style.mini.css +1 -0
  325. package/lib/vxe-toolbar/index.js +35 -19
  326. package/lib/vxe-toolbar/style/index.js +1 -1
  327. package/lib/vxe-toolbar/style/{style.min.css → style.mini.css} +1 -1
  328. package/lib/vxe-ui/index.js +35 -19
  329. package/lib/vxe-ui/style/index.js +1 -1
  330. package/package.json +8 -4
  331. package/packages/locale/lang/zh-HK.ts +907 -3
  332. package/packages/locale/lang/zh-MO.ts +907 -3
  333. package/packages/locale/lang/zh-TC.ts +907 -3
  334. package/packages/locale/lang/zh-TW.ts +907 -3
  335. package/packages/table/module/edit/hook.ts +2 -2
  336. package/packages/table/src/table.ts +64 -28
  337. package/packages/ui/index.ts +1 -28
  338. package/dist/style.min.css +0 -1
  339. package/es/index.css +0 -1
  340. package/es/index.min.css +0 -1
  341. package/es/style.css +0 -1
  342. package/es/style.min.css +0 -1
  343. package/es/table/style.min.css +0 -1
  344. package/es/vxe-table/style.min.css +0 -1
  345. package/es/vxe-v-x-e-table/index.js +0 -3
  346. package/lib/colgroup/index.min.js +0 -1
  347. package/lib/column/index.min.js +0 -1
  348. package/lib/components.min.js +0 -1
  349. package/lib/grid/index.min.js +0 -1
  350. package/lib/grid/src/emits.min.js +0 -1
  351. package/lib/grid/src/grid.min.js +0 -1
  352. package/lib/grid/src/props.min.js +0 -1
  353. package/lib/index.css +0 -1
  354. package/lib/index.min.css +0 -1
  355. package/lib/locale/lang/ar-EG.d.ts +0 -2
  356. package/lib/locale/lang/ar-EG.min.js +0 -1
  357. package/lib/locale/lang/de-DE.d.ts +0 -2
  358. package/lib/locale/lang/de-DE.min.js +0 -1
  359. package/lib/locale/lang/en-US.d.ts +0 -2
  360. package/lib/locale/lang/en-US.min.js +0 -1
  361. package/lib/locale/lang/es-ES.d.ts +0 -2
  362. package/lib/locale/lang/es-ES.min.js +0 -1
  363. package/lib/locale/lang/fr-FR.d.ts +0 -2
  364. package/lib/locale/lang/fr-FR.min.js +0 -1
  365. package/lib/locale/lang/hu-HU.d.ts +0 -2
  366. package/lib/locale/lang/hu-HU.min.js +0 -1
  367. package/lib/locale/lang/hy-AM.d.ts +0 -2
  368. package/lib/locale/lang/hy-AM.min.js +0 -1
  369. package/lib/locale/lang/id-ID.d.ts +0 -2
  370. package/lib/locale/lang/id-ID.min.js +0 -1
  371. package/lib/locale/lang/it-IT.d.ts +0 -2
  372. package/lib/locale/lang/it-IT.min.js +0 -1
  373. package/lib/locale/lang/ja-JP.d.ts +0 -2
  374. package/lib/locale/lang/ja-JP.min.js +0 -1
  375. package/lib/locale/lang/ko-KR.d.ts +0 -2
  376. package/lib/locale/lang/ko-KR.min.js +0 -1
  377. package/lib/locale/lang/ms-MY.d.ts +0 -2
  378. package/lib/locale/lang/ms-MY.min.js +0 -1
  379. package/lib/locale/lang/nb-NO.d.ts +0 -2
  380. package/lib/locale/lang/nb-NO.min.js +0 -1
  381. package/lib/locale/lang/pt-BR.d.ts +0 -2
  382. package/lib/locale/lang/pt-BR.min.js +0 -1
  383. package/lib/locale/lang/ru-RU.d.ts +0 -2
  384. package/lib/locale/lang/ru-RU.min.js +0 -1
  385. package/lib/locale/lang/th-TH.d.ts +0 -2
  386. package/lib/locale/lang/th-TH.min.js +0 -1
  387. package/lib/locale/lang/ug-CN.d.ts +0 -2
  388. package/lib/locale/lang/ug-CN.min.js +0 -1
  389. package/lib/locale/lang/uk-UA.d.ts +0 -2
  390. package/lib/locale/lang/uk-UA.min.js +0 -1
  391. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  392. package/lib/locale/lang/uz-UZ.min.js +0 -1
  393. package/lib/locale/lang/vi-VN.d.ts +0 -2
  394. package/lib/locale/lang/vi-VN.min.js +0 -1
  395. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  396. package/lib/locale/lang/zh-CHT.min.js +0 -1
  397. package/lib/locale/lang/zh-CN.d.ts +0 -2
  398. package/lib/locale/lang/zh-CN.min.js +0 -1
  399. package/lib/locale/lang/zh-HK.d.ts +0 -2
  400. package/lib/locale/lang/zh-HK.min.js +0 -1
  401. package/lib/locale/lang/zh-MO.d.ts +0 -2
  402. package/lib/locale/lang/zh-MO.min.js +0 -1
  403. package/lib/locale/lang/zh-TC.min.js +0 -1
  404. package/lib/locale/lang/zh-TW.d.ts +0 -2
  405. package/lib/locale/lang/zh-TW.min.js +0 -1
  406. package/lib/style.min.css +0 -1
  407. package/lib/table/index.min.js +0 -1
  408. package/lib/table/module/custom/hook.min.js +0 -1
  409. package/lib/table/module/custom/panel.min.js +0 -1
  410. package/lib/table/module/edit/hook.min.js +0 -1
  411. package/lib/table/module/export/export-panel.min.js +0 -1
  412. package/lib/table/module/export/hook.min.js +0 -1
  413. package/lib/table/module/export/import-panel.min.js +0 -1
  414. package/lib/table/module/export/util.min.js +0 -1
  415. package/lib/table/module/filter/hook.min.js +0 -1
  416. package/lib/table/module/filter/panel.min.js +0 -1
  417. package/lib/table/module/keyboard/hook.min.js +0 -1
  418. package/lib/table/module/menu/hook.min.js +0 -1
  419. package/lib/table/module/menu/panel.min.js +0 -1
  420. package/lib/table/module/validator/hook.min.js +0 -1
  421. package/lib/table/render/index.min.js +0 -1
  422. package/lib/table/src/body.min.js +0 -1
  423. package/lib/table/src/cell.min.js +0 -1
  424. package/lib/table/src/column.min.js +0 -1
  425. package/lib/table/src/columnInfo.min.js +0 -1
  426. package/lib/table/src/emits.min.js +0 -1
  427. package/lib/table/src/footer.min.js +0 -1
  428. package/lib/table/src/group.min.js +0 -1
  429. package/lib/table/src/header.min.js +0 -1
  430. package/lib/table/src/props.min.js +0 -1
  431. package/lib/table/src/store.min.js +0 -1
  432. package/lib/table/src/table.min.js +0 -1
  433. package/lib/table/src/use/cell-view.min.js +0 -1
  434. package/lib/table/src/use/index.min.js +0 -1
  435. package/lib/table/src/util.min.js +0 -1
  436. package/lib/table/style/style.min.css +0 -1
  437. package/lib/toolbar/index.min.js +0 -1
  438. package/lib/toolbar/src/toolbar.min.js +0 -1
  439. package/lib/ui/index.min.js +0 -1
  440. package/lib/ui/src/anime.min.js +0 -1
  441. package/lib/ui/src/comp.min.js +0 -1
  442. package/lib/ui/src/dom.min.js +0 -1
  443. package/lib/ui/src/log.min.js +0 -1
  444. package/lib/ui/src/utils.min.js +0 -1
  445. package/lib/ui/src/vn.min.js +0 -1
  446. package/lib/ui/style/style.min.css +0 -0
  447. package/lib/v-x-e-table/index.min.js +0 -1
  448. package/lib/v-x-e-table/style/index.js +0 -1
  449. package/lib/v-x-e-table/style/style.css +0 -0
  450. package/lib/v-x-e-table/style/style.min.css +0 -0
  451. package/lib/vxe-colgroup/index.min.js +0 -1
  452. package/lib/vxe-colgroup/style/style.min.css +0 -0
  453. package/lib/vxe-column/index.min.js +0 -1
  454. package/lib/vxe-column/style/style.min.css +0 -0
  455. package/lib/vxe-grid/index.min.js +0 -1
  456. package/lib/vxe-table/index.min.js +0 -1
  457. package/lib/vxe-table/style/style.min.css +0 -1
  458. package/lib/vxe-toolbar/index.min.js +0 -1
  459. package/lib/vxe-ui/index.min.js +0 -1
  460. package/lib/vxe-ui/style/style.min.css +0 -0
  461. package/lib/vxe-v-x-e-table/index.js +0 -21
  462. package/lib/vxe-v-x-e-table/index.min.js +0 -1
  463. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  464. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  465. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
  466. /package/{es/iconfont.1792740941484.ttf → dist/iconfont.1792977622800.ttf} +0 -0
  467. /package/{es/iconfont.1792740941484.woff → dist/iconfont.1792977622800.woff} +0 -0
  468. /package/{es/iconfont.1792740941484.woff2 → dist/iconfont.1792977622800.woff2} +0 -0
  469. /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
  470. /package/es/column/{style.min.css → style.mini.css} +0 -0
  471. /package/{lib/iconfont.1792740941484.ttf → es/iconfont.1792977622800.ttf} +0 -0
  472. /package/{lib/iconfont.1792740941484.woff → es/iconfont.1792977622800.woff} +0 -0
  473. /package/{lib/iconfont.1792740941484.woff2 → es/iconfont.1792977622800.woff2} +0 -0
  474. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  475. /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
  476. /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
  477. /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
  478. /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
  479. /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
  480. /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
  481. /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
  482. /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
  483. /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
@@ -1,1548 +1,1588 @@
1
- import { h, resolveComponent } from 'vue';
2
- import XEUtils from 'xe-utils';
3
- import { VxeUI } from '../../ui';
4
- import { getCellValue, setCellValue } from '../../table/src/util';
5
- import { getFuncText, formatText, isEmptyValue, hasEnableConf } from '../../ui/src/utils';
6
- import { getOnName, getModelEvent, getChangeEvent, hasInputType } from '../../ui/src/vn';
7
- import { createComponentLog } from '../../ui/src/log';
8
- const { errLog } = createComponentLog('table');
1
+ import { h, resolveComponent } from "vue";
2
+ import XEUtils from "xe-utils";
3
+ import { VxeUI } from "../../ui";
4
+ import { getCellValue, setCellValue } from "../../table/src/util";
5
+ import { getFuncText, formatText, isEmptyValue, hasEnableConf } from "../../ui/src/utils";
6
+ import { getOnName, getModelEvent, getChangeEvent, hasInputType } from "../../ui/src/vn";
7
+ import { createComponentLog } from "../../ui/src/log";
8
+ const { errLog } = createComponentLog("table");
9
9
  const { getConfig, renderer, getI18n, getComponent } = VxeUI;
10
- const componentDefaultModelProp = 'modelValue';
10
+ const componentDefaultModelProp = "modelValue";
11
11
  const defaultCompProps = {};
12
12
  function handleDefaultValue(value, defaultVal, initVal) {
13
- return XEUtils.eqNull(value) ? (XEUtils.eqNull(defaultVal) ? initVal : defaultVal) : value;
13
+ return XEUtils.eqNull(value) ? XEUtils.eqNull(defaultVal) ? initVal : defaultVal : value;
14
14
  }
15
15
  function parseDate(value, props) {
16
- return value && props.valueFormat ? XEUtils.toStringDate(value, props.valueFormat) : value;
16
+ return value && props.valueFormat ? XEUtils.toStringDate(value, props.valueFormat) : value;
17
17
  }
18
18
  function getFormatDate(value, props, defaultFormat) {
19
- const { dateConfig = {} } = props;
20
- return XEUtils.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
19
+ const { dateConfig = {} } = props;
20
+ return XEUtils.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
21
21
  }
22
22
  function getLabelFormatDate(value, props) {
23
- return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || 'date'}`));
23
+ return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || "date"}`));
24
24
  }
25
- /**
26
- * 已废弃
27
- * @deprecated
28
- */
29
25
  function getOldComponentName(name) {
30
- return `vxe-${name.replace('$', '')}`;
26
+ return `vxe-${name.replace("$", "")}`;
31
27
  }
32
28
  function getDefaultComponent({ name }) {
33
- return getComponent(name);
29
+ return getComponent(name);
34
30
  }
35
- /**
36
- * 已废弃
37
- * @deprecated
38
- */
39
31
  function getOldComponent({ name }) {
40
- return resolveComponent(getOldComponentName(name));
32
+ return resolveComponent(getOldComponentName(name));
41
33
  }
42
34
  function updateFilterChangeOption(params, checked, option) {
43
- const { $table } = params;
44
- $table.updateFilterOptionStatus(option, checked);
35
+ const { $table } = params;
36
+ $table.updateFilterOptionStatus(option, checked);
45
37
  }
46
38
  function saveFilterEvent(params) {
47
- const { $table, column } = params;
48
- $table.saveFilterByEvent(new Event('change'), column);
39
+ const { $table, column } = params;
40
+ $table.saveFilterByEvent(new Event("change"), column);
49
41
  }
50
42
  function getNativeAttrs(renderOpts) {
51
- let { name, attrs } = renderOpts;
52
- if (name === 'input') {
53
- attrs = Object.assign({ type: 'text' }, attrs);
54
- }
55
- return attrs;
43
+ let { name, attrs } = renderOpts;
44
+ if (name === "input") {
45
+ attrs = Object.assign({ type: "text" }, attrs);
46
+ }
47
+ return attrs;
56
48
  }
57
49
  function getInputImmediateModel(renderOpts) {
58
- const { name, immediate, props } = renderOpts;
59
- if (!immediate) {
60
- if (name === 'VxeInput' || name === '$input') {
61
- const { type } = props || {};
62
- return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float');
63
- }
64
- if (name === 'input' || name === 'textarea' || name === '$textarea') {
65
- return false;
66
- }
67
- return true;
50
+ const { name, immediate, props } = renderOpts;
51
+ if (!immediate) {
52
+ if (name === "VxeInput" || name === "$input") {
53
+ const { type } = props || {};
54
+ return !(!type || type === "text" || type === "number" || type === "integer" || type === "float");
55
+ }
56
+ if (name === "input" || name === "textarea" || name === "$textarea") {
57
+ return false;
68
58
  }
69
- return immediate;
59
+ return true;
60
+ }
61
+ return immediate;
70
62
  }
71
63
  function getCellEditProps(renderOpts, params, value, defaultProps) {
72
- return XEUtils.assign({ immediate: getInputImmediateModel(renderOpts) }, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
64
+ return XEUtils.assign({ immediate: getInputImmediateModel(renderOpts) }, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
73
65
  }
74
66
  function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
75
- return XEUtils.assign({}, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
67
+ return XEUtils.assign({}, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
76
68
  }
77
69
  function isImmediateCell(renderOpts, params) {
78
- return params.$type === 'cell' || getInputImmediateModel(renderOpts);
70
+ return params.$type === "cell" || getInputImmediateModel(renderOpts);
79
71
  }
80
72
  function getCellLabelVNs(renderOpts, params, cellLabel, opts) {
81
- const { placeholder } = renderOpts;
82
- return [
83
- h('span', {
84
- key: 1,
85
- class: ['vxe-cell--label', opts ? opts.class : '']
86
- }, placeholder && isEmptyValue(cellLabel)
87
- ? [
88
- h('span', {
89
- class: 'vxe-cell--placeholder'
90
- }, formatText(getFuncText(placeholder), 1))
91
- ]
92
- : formatText(cellLabel, 1))
93
- ];
73
+ const { placeholder } = renderOpts;
74
+ return [
75
+ h("span", {
76
+ key: 1,
77
+ class: ["vxe-cell--label", opts ? opts.class : ""]
78
+ }, placeholder && isEmptyValue(cellLabel) ? [
79
+ h("span", {
80
+ class: "vxe-cell--placeholder"
81
+ }, formatText(getFuncText(placeholder), 1))
82
+ ] : formatText(cellLabel, 1))
83
+ ];
94
84
  }
95
- /**
96
- * 原生事件处理
97
- * @param renderOpts
98
- * @param params
99
- * @param modelFunc
100
- * @param changeFunc
101
- */
102
85
  function getNativeElementOns(renderOpts, params, eFns) {
103
- const { events } = renderOpts;
104
- const modelEvent = getModelEvent(renderOpts);
105
- const changeEvent = getChangeEvent(renderOpts);
106
- const { model: modelFunc, change: changeFunc, blur: blurFunc } = eFns || {};
107
- const isSameEvent = changeEvent === modelEvent;
108
- const ons = {};
109
- if (events) {
110
- XEUtils.objectEach(events, (func, key) => {
111
- ons[getOnName(key)] = function (...args) {
112
- func(params, ...args);
113
- };
114
- });
115
- }
116
- if (modelFunc) {
117
- ons[getOnName(modelEvent)] = function (targetEvnt) {
118
- modelFunc(targetEvnt);
119
- if (isSameEvent && changeFunc) {
120
- changeFunc(targetEvnt);
121
- }
122
- if (events && events[modelEvent]) {
123
- events[modelEvent](params, targetEvnt);
124
- }
125
- };
126
- }
127
- if (!isSameEvent && changeFunc) {
128
- ons[getOnName(changeEvent)] = function (evnt) {
129
- changeFunc(evnt);
130
- if (events && events[changeEvent]) {
131
- events[changeEvent](params, evnt);
132
- }
133
- };
134
- }
135
- if (blurFunc) {
136
- ons[getOnName(blurEvent)] = function (evnt) {
137
- blurFunc(evnt);
138
- if (events && events[blurEvent]) {
139
- events[blurEvent](params, evnt);
140
- }
141
- };
142
- }
143
- return ons;
144
- }
145
- const blurEvent = 'blur';
146
- const clearEvent = 'clear';
147
- /**
148
- * 组件事件处理
149
- * @param renderOpts
150
- * @param params
151
- * @param modelFunc
152
- * @param changeFunc
153
- */
154
- function getComponentOns(renderOpts, params, eFns, eventOns) {
155
- const { events } = renderOpts;
156
- const modelEvent = getModelEvent(renderOpts);
157
- const changeEvent = getChangeEvent(renderOpts);
158
- const { model: modelFunc, change: changeFunc, blur: blurFunc, clear: clearFunc } = eFns || {};
159
- const ons = {};
86
+ const { events } = renderOpts;
87
+ const modelEvent = getModelEvent(renderOpts);
88
+ const changeEvent = getChangeEvent(renderOpts);
89
+ const { model: modelFunc, change: changeFunc, blur: blurFunc } = eFns || {};
90
+ const isSameEvent = changeEvent === modelEvent;
91
+ const ons = {};
92
+ if (events) {
160
93
  XEUtils.objectEach(events, (func, key) => {
161
- ons[getOnName(key)] = function (...args) {
162
- if (!XEUtils.isFunction(func)) {
163
- errLog('vxe.error.errFunc', [func]);
164
- }
165
- func(params, ...args);
166
- };
94
+ ons[getOnName(key)] = function(...args) {
95
+ func(params, ...args);
96
+ };
167
97
  });
168
- if (modelFunc) {
169
- ons[getOnName(modelEvent)] = function (targetEvnt) {
170
- modelFunc(targetEvnt);
171
- if (events && events[modelEvent]) {
172
- events[modelEvent](params, targetEvnt);
173
- }
174
- };
175
- }
176
- if (changeFunc) {
177
- ons[getOnName(changeEvent)] = function (...args) {
178
- changeFunc(...args);
179
- if (events && events[changeEvent]) {
180
- events[changeEvent](params, ...args);
181
- }
182
- };
183
- }
184
- if (blurFunc) {
185
- ons[getOnName(blurEvent)] = function (...args) {
186
- blurFunc(...args);
187
- if (events && events[blurEvent]) {
188
- events[blurEvent](params, ...args);
189
- }
190
- };
191
- }
192
- if (clearFunc) {
193
- ons[getOnName(clearEvent)] = function (...args) {
194
- clearFunc(...args);
195
- if (events && events[clearEvent]) {
196
- events[clearEvent](params, ...args);
197
- }
198
- };
199
- }
200
- return eventOns ? Object.assign(ons, eventOns) : ons;
98
+ }
99
+ if (modelFunc) {
100
+ ons[getOnName(modelEvent)] = function(targetEvnt) {
101
+ modelFunc(targetEvnt);
102
+ if (isSameEvent && changeFunc) {
103
+ changeFunc(targetEvnt);
104
+ }
105
+ if (events && events[modelEvent]) {
106
+ events[modelEvent](params, targetEvnt);
107
+ }
108
+ };
109
+ }
110
+ if (!isSameEvent && changeFunc) {
111
+ ons[getOnName(changeEvent)] = function(evnt) {
112
+ changeFunc(evnt);
113
+ if (events && events[changeEvent]) {
114
+ events[changeEvent](params, evnt);
115
+ }
116
+ };
117
+ }
118
+ if (blurFunc) {
119
+ ons[getOnName(blurEvent)] = function(evnt) {
120
+ blurFunc(evnt);
121
+ if (events && events[blurEvent]) {
122
+ events[blurEvent](params, evnt);
123
+ }
124
+ };
125
+ }
126
+ return ons;
127
+ }
128
+ const blurEvent = "blur";
129
+ const clearEvent = "clear";
130
+ function getComponentOns(renderOpts, params, eFns, eventOns) {
131
+ const { events } = renderOpts;
132
+ const modelEvent = getModelEvent(renderOpts);
133
+ const changeEvent = getChangeEvent(renderOpts);
134
+ const { model: modelFunc, change: changeFunc, blur: blurFunc, clear: clearFunc } = eFns || {};
135
+ const ons = {};
136
+ XEUtils.objectEach(events, (func, key) => {
137
+ ons[getOnName(key)] = function(...args) {
138
+ if (!XEUtils.isFunction(func)) {
139
+ errLog("vxe.error.errFunc", [func]);
140
+ }
141
+ func(params, ...args);
142
+ };
143
+ });
144
+ if (modelFunc) {
145
+ ons[getOnName(modelEvent)] = function(targetEvnt) {
146
+ modelFunc(targetEvnt);
147
+ if (events && events[modelEvent]) {
148
+ events[modelEvent](params, targetEvnt);
149
+ }
150
+ };
151
+ }
152
+ if (changeFunc) {
153
+ ons[getOnName(changeEvent)] = function(...args) {
154
+ changeFunc(...args);
155
+ if (events && events[changeEvent]) {
156
+ events[changeEvent](params, ...args);
157
+ }
158
+ };
159
+ }
160
+ if (blurFunc) {
161
+ ons[getOnName(blurEvent)] = function(...args) {
162
+ blurFunc(...args);
163
+ if (events && events[blurEvent]) {
164
+ events[blurEvent](params, ...args);
165
+ }
166
+ };
167
+ }
168
+ if (clearFunc) {
169
+ ons[getOnName(clearEvent)] = function(...args) {
170
+ clearFunc(...args);
171
+ if (events && events[clearEvent]) {
172
+ events[clearEvent](params, ...args);
173
+ }
174
+ };
175
+ }
176
+ return eventOns ? Object.assign(ons, eventOns) : ons;
201
177
  }
202
178
  function getEditOns(renderOpts, params) {
203
- const { $table, row, column } = params;
204
- const { name } = renderOpts;
205
- const { model } = column;
206
- const isImmediate = isImmediateCell(renderOpts, params);
207
- return getComponentOns(renderOpts, params, {
208
- model(cellValue) {
209
- // 处理 model 值双向绑定
210
- model.update = true;
211
- model.value = cellValue;
212
- if (isImmediate) {
213
- setCellValue(row, column, cellValue);
214
- }
215
- },
216
- change(eventParams) {
217
- // 处理 change 事件相关逻辑
218
- if (!isImmediate && name && (['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name))) {
219
- const cellValue = eventParams.value;
220
- model.update = true;
221
- model.value = cellValue;
222
- $table.updateStatus(params, cellValue);
223
- }
224
- else {
225
- $table.updateStatus(params);
226
- }
227
- },
228
- blur() {
229
- if (isImmediate) {
230
- $table.handleCellRuleUpdateStatus('blur', params);
231
- }
232
- else {
233
- $table.handleCellRuleUpdateStatus('blur', params, model.value);
234
- }
235
- }
236
- });
179
+ const { $table, row, column } = params;
180
+ const { name } = renderOpts;
181
+ const { model } = column;
182
+ const isImmediate = isImmediateCell(renderOpts, params);
183
+ return getComponentOns(renderOpts, params, {
184
+ model(cellValue) {
185
+ model.update = true;
186
+ model.value = cellValue;
187
+ if (isImmediate) {
188
+ setCellValue(row, column, cellValue);
189
+ }
190
+ },
191
+ change(eventParams) {
192
+ if (!isImmediate && name && ["VxeInput", "VxeNumberInput", "VxeTextarea", "$input", "$textarea"].includes(name)) {
193
+ const cellValue = eventParams.value;
194
+ model.update = true;
195
+ model.value = cellValue;
196
+ $table.updateStatus(params, cellValue);
197
+ } else {
198
+ $table.updateStatus(params);
199
+ }
200
+ },
201
+ blur() {
202
+ if (isImmediate) {
203
+ $table.handleCellRuleUpdateStatus("blur", params);
204
+ } else {
205
+ $table.handleCellRuleUpdateStatus("blur", params, model.value);
206
+ }
207
+ }
208
+ });
237
209
  }
238
210
  function getFilterOns(renderOpts, params, option) {
239
- return getComponentOns(renderOpts, params, {
240
- model(value) {
241
- // 处理 model 值双向绑定
242
- option.data = value;
243
- },
244
- change() {
245
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
246
- },
247
- blur() {
248
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
249
- }
250
- });
211
+ return getComponentOns(renderOpts, params, {
212
+ model(value) {
213
+ option.data = value;
214
+ },
215
+ change() {
216
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
217
+ },
218
+ blur() {
219
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
220
+ }
221
+ });
251
222
  }
252
223
  function getFloatingFilterOns(renderOpts, params, option) {
253
- const { $table, column } = params;
254
- if (hasInputType(renderOpts)) {
255
- return getComponentOns(renderOpts, params, {
256
- model(value) {
257
- // 处理 model 值双向绑定
258
- option.data = value;
259
- },
260
- change() {
261
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
262
- },
263
- clear() {
264
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
265
- saveFilterEvent(params);
266
- },
267
- blur() {
268
- $table.saveFilterByEvent(new Event('change'), column);
269
- }
270
- }, renderOpts.name === 'VxeNumberInput'
271
- ? {
272
- [getOnName('plus-number')]() {
273
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
274
- saveFilterEvent(params);
275
- },
276
- [getOnName('minus-number')]() {
277
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
278
- saveFilterEvent(params);
279
- }
280
- }
281
- : {});
282
- }
224
+ const { $table, column } = params;
225
+ if (hasInputType(renderOpts)) {
283
226
  return getComponentOns(renderOpts, params, {
284
- model(value) {
285
- // 处理 model 值双向绑定
286
- option.data = value;
287
- },
288
- clear() {
289
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
290
- $table.saveFilterByEvent(new Event('change'), column);
291
- },
292
- change() {
293
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
294
- $table.saveFilterByEvent(new Event('change'), column);
295
- }
296
- });
227
+ model(value) {
228
+ option.data = value;
229
+ },
230
+ change() {
231
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
232
+ },
233
+ clear() {
234
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
235
+ saveFilterEvent(params);
236
+ },
237
+ blur() {
238
+ $table.saveFilterByEvent(new Event("change"), column);
239
+ }
240
+ }, renderOpts.name === "VxeNumberInput" ? {
241
+ [getOnName("plus-number")]() {
242
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
243
+ saveFilterEvent(params);
244
+ },
245
+ [getOnName("minus-number")]() {
246
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
247
+ saveFilterEvent(params);
248
+ }
249
+ } : {});
250
+ }
251
+ return getComponentOns(renderOpts, params, {
252
+ model(value) {
253
+ option.data = value;
254
+ },
255
+ clear() {
256
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
257
+ $table.saveFilterByEvent(new Event("change"), column);
258
+ },
259
+ change() {
260
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
261
+ $table.saveFilterByEvent(new Event("change"), column);
262
+ }
263
+ });
297
264
  }
298
265
  function getNativeEditOns(renderOpts, params) {
299
- const { $table, row, column } = params;
300
- const { model } = column;
301
- return getNativeElementOns(renderOpts, params, {
302
- model(evnt) {
303
- // 处理 model 值双向绑定
304
- const targetEl = evnt.target;
305
- if (targetEl) {
306
- const cellValue = targetEl.value;
307
- if (isImmediateCell(renderOpts, params)) {
308
- setCellValue(row, column, cellValue);
309
- }
310
- else {
311
- model.update = true;
312
- model.value = cellValue;
313
- }
314
- }
315
- },
316
- change(evnt) {
317
- // 处理 change 事件相关逻辑
318
- const targetEl = evnt.target;
319
- if (targetEl) {
320
- const cellValue = targetEl.value;
321
- $table.updateStatus(params, cellValue);
322
- }
323
- },
324
- blur(evnt) {
325
- const targetEl = evnt.target;
326
- if (targetEl) {
327
- const cellValue = targetEl.value;
328
- $table.updateStatus(params, cellValue);
329
- }
266
+ const { $table, row, column } = params;
267
+ const { model } = column;
268
+ return getNativeElementOns(renderOpts, params, {
269
+ model(evnt) {
270
+ const targetEl = evnt.target;
271
+ if (targetEl) {
272
+ const cellValue = targetEl.value;
273
+ if (isImmediateCell(renderOpts, params)) {
274
+ setCellValue(row, column, cellValue);
275
+ } else {
276
+ model.update = true;
277
+ model.value = cellValue;
330
278
  }
331
- });
279
+ }
280
+ },
281
+ change(evnt) {
282
+ const targetEl = evnt.target;
283
+ if (targetEl) {
284
+ const cellValue = targetEl.value;
285
+ $table.updateStatus(params, cellValue);
286
+ }
287
+ },
288
+ blur(evnt) {
289
+ const targetEl = evnt.target;
290
+ if (targetEl) {
291
+ const cellValue = targetEl.value;
292
+ $table.updateStatus(params, cellValue);
293
+ }
294
+ }
295
+ });
332
296
  }
333
297
  function getNativeFilterOns(renderOpts, params, option) {
334
- return getNativeElementOns(renderOpts, params, {
335
- model(evnt) {
336
- // 处理 model 值双向绑定
337
- const targetEl = evnt.target;
338
- if (targetEl) {
339
- option.data = targetEl.value;
340
- }
341
- },
342
- change() {
343
- updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
344
- },
345
- blur() {
346
- updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
347
- }
348
- });
298
+ return getNativeElementOns(renderOpts, params, {
299
+ model(evnt) {
300
+ const targetEl = evnt.target;
301
+ if (targetEl) {
302
+ option.data = targetEl.value;
303
+ }
304
+ },
305
+ change() {
306
+ updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
307
+ },
308
+ blur() {
309
+ updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
310
+ }
311
+ });
349
312
  }
350
313
  function nativeInputCellRender(renderOpts, renderParams) {
351
- const { row, column } = renderParams;
352
- const cellValue = XEUtils.get(row, column.field);
353
- const cellVNs = [
354
- h('span', {
355
- key: 1
356
- }, cellValue)
357
- ];
358
- return getNativeInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
314
+ const { row, column } = renderParams;
315
+ const cellValue = XEUtils.get(row, column.field);
316
+ const cellVNs = [
317
+ h("span", {
318
+ key: 1
319
+ }, cellValue)
320
+ ];
321
+ return getNativeInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
359
322
  }
360
- /**
361
- * 单元格可编辑渲染-原生的标签
362
- * input、textarea
363
- */
364
323
  function nativeInputEditRender(renderOpts, renderParams) {
365
- const { row, column } = renderParams;
366
- const { name } = renderOpts;
367
- const cellValue = isImmediateCell(renderOpts, renderParams) ? getCellValue(row, column) : column.model.value;
368
- return [
369
- h('' + name, Object.assign(Object.assign(Object.assign({ key: 2, class: `vxe-default-${name}` }, getNativeAttrs(renderOpts)), { value: cellValue }), getNativeEditOns(renderOpts, renderParams)))
370
- ];
324
+ const { row, column } = renderParams;
325
+ const { name } = renderOpts;
326
+ const cellValue = isImmediateCell(renderOpts, renderParams) ? getCellValue(row, column) : column.model.value;
327
+ return [
328
+ h("" + name, {
329
+ key: 2,
330
+ class: `vxe-default-${name}`,
331
+ ...getNativeAttrs(renderOpts),
332
+ value: cellValue,
333
+ ...getNativeEditOns(renderOpts, renderParams)
334
+ })
335
+ ];
371
336
  }
372
337
  function buttonCellRender(renderOpts, params) {
373
- return [
374
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, null)), getComponentOns(renderOpts, params)))
375
- ];
338
+ return [
339
+ h(getDefaultComponent(renderOpts), {
340
+ ...getCellEditProps(renderOpts, params, null),
341
+ ...getComponentOns(renderOpts, params)
342
+ })
343
+ ];
376
344
  }
377
345
  function defaultInputEditRender(renderOpts, params) {
378
- const { row, column } = params;
379
- const cellValue = getCellValue(row, column);
380
- return [
381
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({ key: 2 }, getCellEditProps(renderOpts, params, cellValue)), getEditOns(renderOpts, params)))
382
- ];
346
+ const { row, column } = params;
347
+ const cellValue = getCellValue(row, column);
348
+ return [
349
+ h(getDefaultComponent(renderOpts), {
350
+ key: 2,
351
+ ...getCellEditProps(renderOpts, params, cellValue),
352
+ ...getEditOns(renderOpts, params)
353
+ })
354
+ ];
383
355
  }
384
356
  function defaultEditRender(renderOpts, params) {
385
- const { row, column } = params;
386
- const cellValue = getCellValue(row, column);
387
- return [
388
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue)), getEditOns(renderOpts, params)))
389
- ];
357
+ const { row, column } = params;
358
+ const cellValue = getCellValue(row, column);
359
+ return [
360
+ h(getDefaultComponent(renderOpts), {
361
+ ...getCellEditProps(renderOpts, params, cellValue),
362
+ ...getEditOns(renderOpts, params)
363
+ })
364
+ ];
390
365
  }
391
366
  function checkboxEditRender(renderOpts, params) {
392
- const { row, column } = params;
393
- const cellValue = getCellValue(row, column);
394
- return [
395
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue)), getEditOns(renderOpts, params)))
396
- ];
367
+ const { row, column } = params;
368
+ const cellValue = getCellValue(row, column);
369
+ return [
370
+ h(getDefaultComponent(renderOpts), {
371
+ ...getCellEditProps(renderOpts, params, cellValue),
372
+ ...getEditOns(renderOpts, params)
373
+ })
374
+ ];
397
375
  }
398
376
  function radioAndCheckboxGroupEditRender(renderOpts, params) {
399
- const { options } = renderOpts;
400
- const { row, column } = params;
401
- const cellValue = getCellValue(row, column);
402
- return [
403
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({ options }, getCellEditProps(renderOpts, params, cellValue)), getEditOns(renderOpts, params)))
404
- ];
377
+ const { options } = renderOpts;
378
+ const { row, column } = params;
379
+ const cellValue = getCellValue(row, column);
380
+ return [
381
+ h(getDefaultComponent(renderOpts), {
382
+ options,
383
+ ...getCellEditProps(renderOpts, params, cellValue),
384
+ ...getEditOns(renderOpts, params)
385
+ })
386
+ ];
405
387
  }
406
- /**
407
- * 已废弃
408
- * @deprecated
409
- */
410
388
  function oldEditRender(renderOpts, params) {
411
- const { row, column } = params;
412
- const cellValue = getCellValue(row, column);
413
- return [
414
- h(getOldComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue)), getEditOns(renderOpts, params)))
415
- ];
389
+ const { row, column } = params;
390
+ const cellValue = getCellValue(row, column);
391
+ return [
392
+ h(getOldComponent(renderOpts), {
393
+ ...getCellEditProps(renderOpts, params, cellValue),
394
+ ...getEditOns(renderOpts, params)
395
+ })
396
+ ];
416
397
  }
417
- /**
418
- * 已废弃
419
- * @deprecated
420
- */
421
398
  function oldButtonEditRender(renderOpts, params) {
422
- return [
423
- h(getComponent('vxe-button'), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, null)), getComponentOns(renderOpts, params)))
424
- ];
399
+ return [
400
+ h(getComponent("vxe-button"), {
401
+ ...getCellEditProps(renderOpts, params, null),
402
+ ...getComponentOns(renderOpts, params)
403
+ })
404
+ ];
425
405
  }
426
- /**
427
- * 已废弃
428
- * @deprecated
429
- */
430
406
  function oldButtonsEditRender(renderOpts, params) {
431
- const { children } = renderOpts;
432
- return children ? children.map((childRenderOpts) => oldButtonEditRender(childRenderOpts, params)[0]) : [];
407
+ const { children } = renderOpts;
408
+ return children ? children.map((childRenderOpts) => oldButtonEditRender(childRenderOpts, params)[0]) : [];
433
409
  }
434
410
  function renderNativeOptgroups(renderOpts, params, renderOptionsMethods) {
435
- const { optionGroups, optionGroupProps = {} } = renderOpts;
436
- const groupOptions = optionGroupProps.options || 'options';
437
- const groupLabel = optionGroupProps.label || 'label';
438
- if (optionGroups) {
439
- return optionGroups.map((group, gIndex) => {
440
- return h('optgroup', {
441
- key: gIndex,
442
- label: group[groupLabel]
443
- }, renderOptionsMethods(group[groupOptions], renderOpts, params));
444
- });
445
- }
446
- return [];
411
+ const { optionGroups, optionGroupProps = {} } = renderOpts;
412
+ const groupOptions = optionGroupProps.options || "options";
413
+ const groupLabel = optionGroupProps.label || "label";
414
+ if (optionGroups) {
415
+ return optionGroups.map((group, gIndex) => {
416
+ return h("optgroup", {
417
+ key: gIndex,
418
+ label: group[groupLabel]
419
+ }, renderOptionsMethods(group[groupOptions], renderOpts, params));
420
+ });
421
+ }
422
+ return [];
447
423
  }
448
- /**
449
- * 渲染原生的 option 标签
450
- */
451
424
  function renderNativeOptions(options, renderOpts, params) {
452
- const { optionProps = {} } = renderOpts;
453
- const { row, column } = params;
454
- const labelProp = optionProps.label || 'label';
455
- const valueProp = optionProps.value || 'value';
456
- const disabledProp = optionProps.disabled || 'disabled';
457
- const cellValue = isImmediateCell(renderOpts, params) ? getCellValue(row, column) : column.model.value;
458
- if (options) {
459
- return options.map((option, oIndex) => {
460
- return h('option', {
461
- key: oIndex,
462
- value: option[valueProp],
463
- disabled: option[disabledProp],
464
- /* eslint-disable eqeqeq */
465
- selected: option[valueProp] == cellValue
466
- }, option[labelProp]);
467
- });
468
- }
469
- return [];
425
+ const { optionProps = {} } = renderOpts;
426
+ const { row, column } = params;
427
+ const labelProp = optionProps.label || "label";
428
+ const valueProp = optionProps.value || "value";
429
+ const disabledProp = optionProps.disabled || "disabled";
430
+ const cellValue = isImmediateCell(renderOpts, params) ? getCellValue(row, column) : column.model.value;
431
+ if (options) {
432
+ return options.map((option, oIndex) => {
433
+ return h("option", {
434
+ key: oIndex,
435
+ value: option[valueProp],
436
+ disabled: option[disabledProp],
437
+ /* eslint-disable eqeqeq */
438
+ selected: option[valueProp] == cellValue
439
+ }, option[labelProp]);
440
+ });
441
+ }
442
+ return [];
470
443
  }
471
444
  function nativeFilterRender(renderOpts, params) {
472
- const { column } = params;
473
- const { name } = renderOpts;
474
- const attrs = getNativeAttrs(renderOpts);
475
- return column.filters.map((option, oIndex) => {
476
- return h(`${name}`, Object.assign(Object.assign(Object.assign({ key: oIndex, class: `vxe-default-${name}` }, attrs), { value: option.data }), getNativeFilterOns(renderOpts, params, option)));
445
+ const { column } = params;
446
+ const { name } = renderOpts;
447
+ const attrs = getNativeAttrs(renderOpts);
448
+ return column.filters.map((option, oIndex) => {
449
+ return h(`${name}`, {
450
+ key: oIndex,
451
+ class: `vxe-default-${name}`,
452
+ ...attrs,
453
+ value: option.data,
454
+ ...getNativeFilterOns(renderOpts, params, option)
477
455
  });
456
+ });
478
457
  }
479
458
  function defaultFilterRender(renderOpts, params) {
480
- const { column } = params;
481
- return column.filters.map((option, oIndex) => {
482
- const optionValue = option.data;
483
- return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({ key: oIndex }, getCellEditFilterProps(renderOpts, renderOpts, optionValue)), getFilterOns(renderOpts, params, option)));
459
+ const { column } = params;
460
+ return column.filters.map((option, oIndex) => {
461
+ const optionValue = option.data;
462
+ return h(getDefaultComponent(renderOpts), {
463
+ key: oIndex,
464
+ ...getCellEditFilterProps(renderOpts, renderOpts, optionValue),
465
+ ...getFilterOns(renderOpts, params, option)
484
466
  });
467
+ });
485
468
  }
486
469
  function defaultFloatingFilterRender(renderOpts, params) {
487
- const { option } = params;
488
- const optionValue = option.data;
489
- return [
490
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditFilterProps(renderOpts, renderOpts, optionValue)), getFloatingFilterOns(renderOpts, params, option)))
491
- ];
470
+ const { option } = params;
471
+ const optionValue = option.data;
472
+ return [
473
+ h(getDefaultComponent(renderOpts), {
474
+ ...getCellEditFilterProps(renderOpts, renderOpts, optionValue),
475
+ ...getFloatingFilterOns(renderOpts, params, option)
476
+ })
477
+ ];
492
478
  }
493
479
  function defaultFilterOptions() {
494
- return [
495
- { data: null }
496
- ];
480
+ return [
481
+ { data: null }
482
+ ];
497
483
  }
498
- /**
499
- * 已废弃
500
- * @deprecated
501
- */
502
484
  function oldFilterRender(renderOpts, params) {
503
- const { column } = params;
504
- return column.filters.map((option, oIndex) => {
505
- const optionValue = option.data;
506
- return h(getOldComponent(renderOpts), Object.assign(Object.assign({ key: oIndex }, getCellEditFilterProps(renderOpts, renderOpts, optionValue)), getFilterOns(renderOpts, params, option)));
485
+ const { column } = params;
486
+ return column.filters.map((option, oIndex) => {
487
+ const optionValue = option.data;
488
+ return h(getOldComponent(renderOpts), {
489
+ key: oIndex,
490
+ ...getCellEditFilterProps(renderOpts, renderOpts, optionValue),
491
+ ...getFilterOns(renderOpts, params, option)
507
492
  });
493
+ });
508
494
  }
509
495
  function handleFilterMethod({ option, row, column }) {
510
- const { data } = option;
511
- const cellValue = XEUtils.get(row, column.field);
512
- /* eslint-disable eqeqeq */
513
- return cellValue == data;
496
+ const { data } = option;
497
+ const cellValue = XEUtils.get(row, column.field);
498
+ return cellValue == data;
514
499
  }
515
500
  function handleInputFilterMethod({ option, row, column }) {
516
- const { data } = option;
517
- const cellValue = XEUtils.get(row, column.field);
518
- /* eslint-disable eqeqeq */
519
- return XEUtils.toValueString(cellValue).indexOf(data) > -1;
501
+ const { data } = option;
502
+ const cellValue = XEUtils.get(row, column.field);
503
+ return XEUtils.toValueString(cellValue).indexOf(data) > -1;
520
504
  }
521
505
  function nativeSelectEditRender(renderOpts, params) {
522
- return [
523
- h('select', Object.assign(Object.assign({ class: 'vxe-default-select' }, getNativeAttrs(renderOpts)), getNativeEditOns(renderOpts, params)), renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params))
524
- ];
506
+ return [
507
+ h(
508
+ "select",
509
+ {
510
+ class: "vxe-default-select",
511
+ ...getNativeAttrs(renderOpts),
512
+ ...getNativeEditOns(renderOpts, params)
513
+ },
514
+ renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params)
515
+ )
516
+ ];
525
517
  }
526
518
  function defaultSelectEditRender(renderOpts, params) {
527
- const { row, column } = params;
528
- const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
529
- const cellValue = getCellValue(row, column);
530
- return [
531
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps })), getEditOns(renderOpts, params)))
532
- ];
519
+ const { row, column } = params;
520
+ const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
521
+ const cellValue = getCellValue(row, column);
522
+ return [
523
+ h(getDefaultComponent(renderOpts), {
524
+ ...getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps }),
525
+ ...getEditOns(renderOpts, params)
526
+ })
527
+ ];
533
528
  }
534
529
  function defaultTableOrTreeSelectEditRender(renderOpts, params) {
535
- const { row, column } = params;
536
- const { options, optionProps } = renderOpts;
537
- const cellValue = getCellValue(row, column);
538
- return [
539
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, { options, optionProps })), getEditOns(renderOpts, params)))
540
- ];
530
+ const { row, column } = params;
531
+ const { options, optionProps } = renderOpts;
532
+ const cellValue = getCellValue(row, column);
533
+ return [
534
+ h(getDefaultComponent(renderOpts), {
535
+ ...getCellEditProps(renderOpts, params, cellValue, { options, optionProps }),
536
+ ...getEditOns(renderOpts, params)
537
+ })
538
+ ];
541
539
  }
542
- /**
543
- * 已废弃
544
- * @deprecated
545
- */
546
540
  function oldSelectEditRender(renderOpts, params) {
547
- const { row, column } = params;
548
- const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
549
- const cellValue = getCellValue(row, column);
550
- return [
551
- h(getOldComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps })), getEditOns(renderOpts, params)))
552
- ];
541
+ const { row, column } = params;
542
+ const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
543
+ const cellValue = getCellValue(row, column);
544
+ return [
545
+ h(getOldComponent(renderOpts), {
546
+ ...getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps }),
547
+ ...getEditOns(renderOpts, params)
548
+ })
549
+ ];
553
550
  }
554
551
  function handleSelectCellValue(cellValue, renderOpts) {
555
- const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props = {} } = renderOpts;
556
- let selectItem;
557
- const labelProp = optionProps.label || 'label';
558
- const valueProp = optionProps.value || 'value';
559
- if (!(cellValue === null || cellValue === undefined)) {
560
- let vals = [];
561
- if (XEUtils.isArray(cellValue)) {
562
- vals = cellValue;
563
- }
564
- else {
565
- if (props.multiple && `${cellValue}`.indexOf(',') > -1) {
566
- vals = `${cellValue}`.split(',');
567
- }
568
- else {
569
- vals = [cellValue];
570
- }
571
- }
572
- return XEUtils.map(vals, optionGroups
573
- ? (value) => {
574
- const groupOptions = optionGroupProps.options || 'options';
575
- for (let index = 0; index < optionGroups.length; index++) {
576
- /* eslint-disable eqeqeq */
577
- selectItem = XEUtils.find(optionGroups[index][groupOptions], item => item[valueProp] == value);
578
- if (selectItem) {
579
- break;
580
- }
581
- }
582
- return selectItem ? selectItem[labelProp] : value;
583
- }
584
- : (value) => {
585
- /* eslint-disable eqeqeq */
586
- selectItem = XEUtils.find(options, item => item[valueProp] == value);
587
- return selectItem ? selectItem[labelProp] : value;
588
- }).join(', ');
552
+ const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props = {} } = renderOpts;
553
+ let selectItem;
554
+ const labelProp = optionProps.label || "label";
555
+ const valueProp = optionProps.value || "value";
556
+ if (!(cellValue === null || cellValue === void 0)) {
557
+ let vals = [];
558
+ if (XEUtils.isArray(cellValue)) {
559
+ vals = cellValue;
560
+ } else {
561
+ if (props.multiple && `${cellValue}`.indexOf(",") > -1) {
562
+ vals = `${cellValue}`.split(",");
563
+ } else {
564
+ vals = [cellValue];
565
+ }
589
566
  }
590
- return '';
567
+ return XEUtils.map(
568
+ vals,
569
+ optionGroups ? (value) => {
570
+ const groupOptions = optionGroupProps.options || "options";
571
+ for (let index = 0; index < optionGroups.length; index++) {
572
+ selectItem = XEUtils.find(optionGroups[index][groupOptions], (item) => item[valueProp] == value);
573
+ if (selectItem) {
574
+ break;
575
+ }
576
+ }
577
+ return selectItem ? selectItem[labelProp] : value;
578
+ } : (value) => {
579
+ selectItem = XEUtils.find(options, (item) => item[valueProp] == value);
580
+ return selectItem ? selectItem[labelProp] : value;
581
+ }
582
+ ).join(", ");
583
+ }
584
+ return "";
591
585
  }
592
586
  function getSelectCellValue(renderOpts, { row, column }) {
593
- const cellValue = XEUtils.get(row, column.field);
594
- return handleSelectCellValue(cellValue, renderOpts);
587
+ const cellValue = XEUtils.get(row, column.field);
588
+ return handleSelectCellValue(cellValue, renderOpts);
595
589
  }
596
590
  function handleExportSelectMethod(params) {
597
- const { row, column, options } = params;
598
- return options.original ? getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
591
+ const { row, column, options } = params;
592
+ return options.original ? getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
599
593
  }
600
594
  function handleTreeSelectCellValue(cellValue, renderOpts) {
601
- const { options, optionProps = {} } = renderOpts;
602
- const labelProp = optionProps.label || 'label';
603
- const valueProp = optionProps.value || 'value';
604
- const childrenProp = optionProps.children || 'children';
605
- if (!(cellValue === null || cellValue === undefined)) {
606
- const keyMaps = {};
607
- XEUtils.eachTree(options, item => {
608
- keyMaps[XEUtils.get(item, valueProp)] = item;
609
- }, { children: childrenProp });
610
- return XEUtils.map(XEUtils.isArray(cellValue) ? cellValue : [cellValue], (value) => {
611
- const item = keyMaps[value];
612
- return item ? XEUtils.get(item, labelProp) : item;
613
- }).join(', ');
614
- }
615
- return '';
595
+ const { options, optionProps = {} } = renderOpts;
596
+ const labelProp = optionProps.label || "label";
597
+ const valueProp = optionProps.value || "value";
598
+ const childrenProp = optionProps.children || "children";
599
+ if (!(cellValue === null || cellValue === void 0)) {
600
+ const keyMaps = {};
601
+ XEUtils.eachTree(options, (item) => {
602
+ keyMaps[XEUtils.get(item, valueProp)] = item;
603
+ }, { children: childrenProp });
604
+ return XEUtils.map(
605
+ XEUtils.isArray(cellValue) ? cellValue : [cellValue],
606
+ (value) => {
607
+ const item = keyMaps[value];
608
+ return item ? XEUtils.get(item, labelProp) : item;
609
+ }
610
+ ).join(", ");
611
+ }
612
+ return "";
616
613
  }
617
614
  function getTreeSelectCellValue(renderOpts, { row, column }) {
618
- const cellValue = XEUtils.get(row, column.field);
619
- return handleTreeSelectCellValue(cellValue, renderOpts);
615
+ const cellValue = XEUtils.get(row, column.field);
616
+ return handleTreeSelectCellValue(cellValue, renderOpts);
620
617
  }
621
618
  function handleExportTreeSelectMethod(params) {
622
- const { row, column, options } = params;
623
- return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
619
+ const { row, column, options } = params;
620
+ return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
624
621
  }
625
622
  function handleNumberCell(cellValue, renderOpts, params) {
626
- const { props = {}, showNegativeStatus } = renderOpts;
627
- const { type } = props;
628
- let isNegative = false;
629
- if (!isEmptyValue(cellValue)) {
630
- const numberInputConfig = getConfig().numberInput || {};
631
- if (type === 'float') {
632
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
633
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
634
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
635
- if (!autoFill) {
636
- cellValue = XEUtils.toNumber(cellValue);
637
- }
638
- if (showNegativeStatus) {
639
- if (cellValue < 0) {
640
- isNegative = true;
641
- }
642
- }
623
+ const { props = {}, showNegativeStatus } = renderOpts;
624
+ const { type } = props;
625
+ let isNegative = false;
626
+ if (!isEmptyValue(cellValue)) {
627
+ const numberInputConfig = getConfig().numberInput || {};
628
+ if (type === "float") {
629
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
630
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
631
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
632
+ if (!autoFill) {
633
+ cellValue = XEUtils.toNumber(cellValue);
634
+ }
635
+ if (showNegativeStatus) {
636
+ if (cellValue < 0) {
637
+ isNegative = true;
643
638
  }
644
- else if (type === 'amount') {
645
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
646
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
647
- const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
648
- cellValue = XEUtils.toNumber(cellValue);
649
- if (showNegativeStatus) {
650
- if (cellValue < 0) {
651
- isNegative = true;
652
- }
653
- }
654
- cellValue = XEUtils.commafy(cellValue, { digits });
655
- if (!autoFill) {
656
- const [iStr, dStr] = cellValue.split('.');
657
- if (dStr) {
658
- const dRest = dStr.replace(/0+$/, '');
659
- cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
660
- }
661
- }
662
- if (showCurrency) {
663
- cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
664
- }
639
+ }
640
+ } else if (type === "amount") {
641
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
642
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
643
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
644
+ cellValue = XEUtils.toNumber(cellValue);
645
+ if (showNegativeStatus) {
646
+ if (cellValue < 0) {
647
+ isNegative = true;
665
648
  }
666
- else {
667
- if (type === 'integer') {
668
- cellValue = XEUtils.toInteger(cellValue);
669
- }
670
- if (showNegativeStatus) {
671
- if (XEUtils.toNumber(cellValue) < 0) {
672
- isNegative = true;
673
- }
674
- }
649
+ }
650
+ cellValue = XEUtils.commafy(cellValue, { digits });
651
+ if (!autoFill) {
652
+ const [iStr, dStr] = cellValue.split(".");
653
+ if (dStr) {
654
+ const dRest = dStr.replace(/0+$/, "");
655
+ cellValue = dRest ? [iStr, ".", dRest].join("") : iStr;
675
656
  }
676
- }
677
- return getCellLabelVNs(renderOpts, params, cellValue, isNegative
678
- ? {
679
- class: 'is--negative'
657
+ }
658
+ if (showCurrency) {
659
+ cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n("vxe.numberInput.currencySymbol") || ""}${cellValue}`;
660
+ }
661
+ } else {
662
+ if (type === "integer") {
663
+ cellValue = XEUtils.toInteger(cellValue);
664
+ }
665
+ if (showNegativeStatus) {
666
+ if (XEUtils.toNumber(cellValue) < 0) {
667
+ isNegative = true;
680
668
  }
681
- : {});
669
+ }
670
+ }
671
+ }
672
+ return getCellLabelVNs(renderOpts, params, cellValue, isNegative ? {
673
+ class: "is--negative"
674
+ } : {});
682
675
  }
683
676
  function handleFormatDatePicker(renderOpts, renderParams) {
684
- const { props = {} } = renderOpts;
685
- const { cellValue } = renderParams;
686
- if (cellValue) {
687
- if (props.type !== 'time') {
688
- return getLabelFormatDate(cellValue, props);
689
- }
677
+ const { props = {} } = renderOpts;
678
+ const { cellValue } = renderParams;
679
+ if (cellValue) {
680
+ if (props.type !== "time") {
681
+ return getLabelFormatDate(cellValue, props);
690
682
  }
691
- return cellValue;
683
+ }
684
+ return cellValue;
692
685
  }
693
686
  function handleFormatSelect(renderOpts, renderParams) {
694
- const { cellValue } = renderParams;
695
- return handleSelectCellValue(cellValue, renderOpts);
687
+ const { cellValue } = renderParams;
688
+ return handleSelectCellValue(cellValue, renderOpts);
696
689
  }
697
690
  function handleSetSelectValue(renderOpts, renderParams) {
698
- const { row, column, cellValue } = renderParams;
699
- const { field } = column;
700
- if (field) {
701
- const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props } = renderOpts;
702
- if (isEmptyValue(cellValue)) {
703
- XEUtils.set(row, field, props && props.multiple ? [] : null);
691
+ const { row, column, cellValue } = renderParams;
692
+ const { field } = column;
693
+ if (field) {
694
+ const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props } = renderOpts;
695
+ if (isEmptyValue(cellValue)) {
696
+ XEUtils.set(row, field, props && props.multiple ? [] : null);
697
+ return;
698
+ }
699
+ const isMultiVal = XEUtils.indexOf(`${cellValue}`, ",") > -1;
700
+ const labelProp = optionProps.label || "label";
701
+ const valueProp = optionProps.value || "value";
702
+ const labelMpas = {};
703
+ if (optionGroups && optionGroups.length) {
704
+ const groupOptions = optionGroupProps.options || "options";
705
+ for (let i = 0; i < optionGroups.length; i++) {
706
+ const opts = optionGroups[i][groupOptions] || {};
707
+ for (let j = 0; j < opts.length; j++) {
708
+ const item = opts[j];
709
+ if (isMultiVal) {
710
+ labelMpas[item[labelProp]] = item;
711
+ } else if (item[labelProp] == cellValue) {
712
+ XEUtils.set(row, field, item[valueProp]);
704
713
  return;
714
+ }
705
715
  }
706
- const isMultiVal = XEUtils.indexOf(`${cellValue}`, ',') > -1;
707
- const labelProp = optionProps.label || 'label';
708
- const valueProp = optionProps.value || 'value';
709
- const labelMpas = {};
710
- if (optionGroups && optionGroups.length) {
711
- const groupOptions = optionGroupProps.options || 'options';
712
- for (let i = 0; i < optionGroups.length; i++) {
713
- const opts = optionGroups[i][groupOptions] || {};
714
- for (let j = 0; j < opts.length; j++) {
715
- const item = opts[j];
716
- if (isMultiVal) {
717
- labelMpas[item[labelProp]] = item;
718
- /* eslint-disable eqeqeq */
719
- }
720
- else if (item[labelProp] == cellValue) {
721
- XEUtils.set(row, field, item[valueProp]);
722
- return;
723
- }
724
- }
725
- }
726
- }
727
- else {
728
- if (options) {
729
- for (let i = 0; i < options.length; i++) {
730
- const item = options[i];
731
- if (isMultiVal) {
732
- labelMpas[item[labelProp]] = item;
733
- /* eslint-disable eqeqeq */
734
- }
735
- else if (item[labelProp] == cellValue) {
736
- XEUtils.set(row, field, item[valueProp]);
737
- return;
738
- }
739
- }
740
- }
741
- }
742
- if (isMultiVal) {
743
- XEUtils.set(row, field, (isMultiVal
744
- ? cellValue.split(',')
745
- : [cellValue]).map((label) => {
746
- const item = labelMpas[label];
747
- return item ? item[valueProp] : label;
748
- }));
749
- }
750
- else {
751
- XEUtils.set(row, field, cellValue);
716
+ }
717
+ } else {
718
+ if (options) {
719
+ for (let i = 0; i < options.length; i++) {
720
+ const item = options[i];
721
+ if (isMultiVal) {
722
+ labelMpas[item[labelProp]] = item;
723
+ } else if (item[labelProp] == cellValue) {
724
+ XEUtils.set(row, field, item[valueProp]);
725
+ return;
726
+ }
752
727
  }
728
+ }
729
+ }
730
+ if (isMultiVal) {
731
+ XEUtils.set(row, field, (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
732
+ const item = labelMpas[label];
733
+ return item ? item[valueProp] : label;
734
+ }));
735
+ } else {
736
+ XEUtils.set(row, field, cellValue);
753
737
  }
738
+ }
754
739
  }
755
740
  function handleFormatTreeSelect(renderOpts, params) {
756
- const { cellValue } = params;
757
- return handleTreeSelectCellValue(cellValue, renderOpts);
741
+ const { cellValue } = params;
742
+ return handleTreeSelectCellValue(cellValue, renderOpts);
758
743
  }
759
744
  function handleSetTreeSelectValue(renderOpts, params) {
760
- const { row, column, cellValue } = params;
761
- const { field } = column;
762
- if (field) {
763
- const { options, optionProps = {} } = renderOpts;
764
- const labelProp = optionProps.label || 'label';
765
- const valueProp = optionProps.value || 'value';
766
- const childrenProp = optionProps.children || 'children';
767
- const matchRest = XEUtils.findTree(options || [], item => XEUtils.get(item, labelProp) === cellValue, { children: childrenProp });
768
- if (matchRest) {
769
- const selectItem = matchRest.item;
770
- if (selectItem) {
771
- XEUtils.set(row, field, selectItem[valueProp]);
772
- return;
773
- }
774
- }
775
- XEUtils.set(row, field, cellValue);
745
+ const { row, column, cellValue } = params;
746
+ const { field } = column;
747
+ if (field) {
748
+ const { options, optionProps = {} } = renderOpts;
749
+ const labelProp = optionProps.label || "label";
750
+ const valueProp = optionProps.value || "value";
751
+ const childrenProp = optionProps.children || "children";
752
+ const matchRest = XEUtils.findTree(options || [], (item) => XEUtils.get(item, labelProp) === cellValue, { children: childrenProp });
753
+ if (matchRest) {
754
+ const selectItem = matchRest.item;
755
+ if (selectItem) {
756
+ XEUtils.set(row, field, selectItem[valueProp]);
757
+ return;
758
+ }
776
759
  }
760
+ XEUtils.set(row, field, cellValue);
761
+ }
777
762
  }
778
763
  function getNativeInputRenderCellVNs(cellValue, labelVNs, renderOpts, renderParams) {
779
- const { $table, row, column } = renderParams;
780
- const { name } = renderOpts;
781
- const tableProps = $table.props;
782
- const { editConfig, mouseConfig } = tableProps;
783
- const { computeMouseOpts } = $table.getComputeMaps();
784
- const mouseOpts = computeMouseOpts.value;
785
- let isColSelected = false;
786
- let isActiveCellArea = false;
787
- if (editConfig && hasEnableConf(mouseConfig, mouseOpts)) {
788
- const tableReactData = $table.reactData;
789
- const { editStore } = tableReactData;
790
- const { selected } = editStore;
791
- isColSelected = row === selected.row && column === selected.column;
792
- if ($table.getActiveCellArea) {
793
- const activeCellArea = $table.getActiveCellArea();
794
- if (activeCellArea) {
795
- isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
796
- }
797
- }
798
- }
799
- const cellVNs = labelVNs;
800
- if (isActiveCellArea || isColSelected) {
801
- cellVNs.push(h('' + name, Object.assign(Object.assign({ key: 2, class: `vxe-default-${name} vxe-reusekeep-control`, value: cellValue }, getNativeAttrs(renderOpts)), getNativeEditOns(renderOpts, renderParams))));
764
+ const { $table, row, column } = renderParams;
765
+ const { name } = renderOpts;
766
+ const tableProps = $table.props;
767
+ const { editConfig, mouseConfig } = tableProps;
768
+ const { computeMouseOpts } = $table.getComputeMaps();
769
+ const mouseOpts = computeMouseOpts.value;
770
+ let isColSelected = false;
771
+ let isActiveCellArea = false;
772
+ if (editConfig && hasEnableConf(mouseConfig, mouseOpts)) {
773
+ const tableReactData = $table.reactData;
774
+ const { editStore } = tableReactData;
775
+ const { selected } = editStore;
776
+ isColSelected = row === selected.row && column === selected.column;
777
+ if ($table.getActiveCellArea) {
778
+ const activeCellArea = $table.getActiveCellArea();
779
+ if (activeCellArea) {
780
+ isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
781
+ }
802
782
  }
803
- return cellVNs;
783
+ }
784
+ const cellVNs = labelVNs;
785
+ if (isActiveCellArea || isColSelected) {
786
+ cellVNs.push(
787
+ h("" + name, {
788
+ key: 2,
789
+ class: `vxe-default-${name} vxe-reusekeep-control`,
790
+ value: cellValue,
791
+ ...getNativeAttrs(renderOpts),
792
+ ...getNativeEditOns(renderOpts, renderParams)
793
+ })
794
+ );
795
+ }
796
+ return cellVNs;
804
797
  }
805
798
  function getInputRenderCellVNs(cellValue, labelVNs, renderOpts, renderParams) {
806
- const { $table, row, column } = renderParams;
807
- const tableProps = $table.props;
808
- const { editConfig, mouseConfig } = tableProps;
809
- const { computeEditOpts, computeMouseOpts } = $table.getComputeMaps();
810
- const mouseOpts = computeMouseOpts.value;
811
- let isColSelected = false;
812
- let isActiveCellArea = false;
813
- if (editConfig && hasEnableConf(mouseConfig, mouseOpts)) {
814
- const tableReactData = $table.reactData;
815
- const { editStore } = tableReactData;
816
- const editOpts = computeEditOpts.value;
817
- if (editOpts.isReuseKeep) {
818
- const { selected } = editStore;
819
- isColSelected = row === selected.row && column === selected.column;
820
- if ($table.getActiveCellArea) {
821
- const activeCellArea = $table.getActiveCellArea();
822
- if (activeCellArea) {
823
- isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
824
- }
825
- }
799
+ const { $table, row, column } = renderParams;
800
+ const tableProps = $table.props;
801
+ const { editConfig, mouseConfig } = tableProps;
802
+ const { computeEditOpts, computeMouseOpts } = $table.getComputeMaps();
803
+ const mouseOpts = computeMouseOpts.value;
804
+ let isColSelected = false;
805
+ let isActiveCellArea = false;
806
+ if (editConfig && hasEnableConf(mouseConfig, mouseOpts)) {
807
+ const tableReactData = $table.reactData;
808
+ const { editStore } = tableReactData;
809
+ const editOpts = computeEditOpts.value;
810
+ if (editOpts.isReuseKeep) {
811
+ const { selected } = editStore;
812
+ isColSelected = row === selected.row && column === selected.column;
813
+ if ($table.getActiveCellArea) {
814
+ const activeCellArea = $table.getActiveCellArea();
815
+ if (activeCellArea) {
816
+ isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
826
817
  }
818
+ }
827
819
  }
828
- const cellVNs = labelVNs;
829
- if (isActiveCellArea || isColSelected) {
830
- const compProps = getCellEditProps(renderOpts, renderParams, cellValue);
831
- const { className, inputClassName } = compProps;
832
- cellVNs.push(h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({ key: 2 }, compProps), { className: 'vxe-reusekeep-control' + (className ? (' ' + className) : ''), inputClassName: 'vxe-reusekeep-control' + (inputClassName ? (' ' + inputClassName) : '') }), getEditOns(renderOpts, renderParams))));
833
- }
834
- return cellVNs;
820
+ }
821
+ const cellVNs = labelVNs;
822
+ if (isActiveCellArea || isColSelected) {
823
+ const compProps = getCellEditProps(renderOpts, renderParams, cellValue);
824
+ const { className, inputClassName } = compProps;
825
+ cellVNs.push(
826
+ h(getDefaultComponent(renderOpts), {
827
+ key: 2,
828
+ ...compProps,
829
+ className: "vxe-reusekeep-control" + (className ? " " + className : ""),
830
+ inputClassName: "vxe-reusekeep-control" + (inputClassName ? " " + inputClassName : ""),
831
+ ...getEditOns(renderOpts, renderParams)
832
+ })
833
+ );
834
+ }
835
+ return cellVNs;
835
836
  }
836
- /**
837
- * 表格 - 渲染器
838
- */
839
837
  renderer.mixin({
840
- input: {
841
- tableAutoFocus: true,
842
- renderTableEdit: nativeInputEditRender,
843
- renderTableCell: nativeInputCellRender,
844
- renderTableDefault: nativeInputEditRender,
845
- createTableFilterOptions: defaultFilterOptions,
846
- renderTableFilter: nativeFilterRender,
847
- tableFilterDefaultMethod: handleInputFilterMethod
848
- },
849
- textarea: {
850
- tableAutoFocus: true,
851
- renderTableEdit: nativeInputEditRender,
852
- renderTableCell: nativeInputCellRender,
853
- renderTableDefault: nativeInputEditRender
854
- },
855
- select: {
856
- renderTableEdit: nativeSelectEditRender,
857
- renderTableDefault: nativeSelectEditRender,
858
- renderTableCell(renderOpts, params) {
859
- const { options, optionGroups } = renderOpts;
860
- const { $table, row, column } = params;
861
- const opSize = options ? options.length : null;
862
- const ogSize = optionGroups ? optionGroups.length : null;
863
- const { cellResult } = $table.effectCellData(row, column, {
864
- key: 'render_table_cell',
865
- isChanged({ oldValue, cellValue }) {
866
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
867
- },
868
- setValue({ cellValue }) {
869
- return [cellValue, opSize, ogSize];
870
- },
871
- getResult({ cellValue }) {
872
- return handleSelectCellValue(cellValue, renderOpts);
873
- }
874
- });
875
- // const cellResult = getSelectCellValue(renderOpts, params)
876
- return getCellLabelVNs(renderOpts, params, cellResult);
838
+ input: {
839
+ tableAutoFocus: true,
840
+ renderTableEdit: nativeInputEditRender,
841
+ renderTableCell: nativeInputCellRender,
842
+ renderTableDefault: nativeInputEditRender,
843
+ createTableFilterOptions: defaultFilterOptions,
844
+ renderTableFilter: nativeFilterRender,
845
+ tableFilterDefaultMethod: handleInputFilterMethod
846
+ },
847
+ textarea: {
848
+ tableAutoFocus: true,
849
+ renderTableEdit: nativeInputEditRender,
850
+ renderTableCell: nativeInputCellRender,
851
+ renderTableDefault: nativeInputEditRender
852
+ },
853
+ select: {
854
+ renderTableEdit: nativeSelectEditRender,
855
+ renderTableDefault: nativeSelectEditRender,
856
+ renderTableCell(renderOpts, params) {
857
+ const { options, optionGroups } = renderOpts;
858
+ const { $table, row, column } = params;
859
+ const opSize = options ? options.length : null;
860
+ const ogSize = optionGroups ? optionGroups.length : null;
861
+ const { cellResult } = $table.effectCellData(row, column, {
862
+ key: "render_table_cell",
863
+ isChanged({ oldValue, cellValue }) {
864
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
877
865
  },
878
- createTableFilterOptions: defaultFilterOptions,
879
- renderTableFilter(renderOpts, params) {
880
- const { column } = params;
881
- return column.filters.map((option, oIndex) => {
882
- return h('select', Object.assign(Object.assign({ key: oIndex, class: 'vxe-default-select' }, getNativeAttrs(renderOpts)), getNativeFilterOns(renderOpts, params, option)), renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params));
883
- });
866
+ setValue({ cellValue }) {
867
+ return [cellValue, opSize, ogSize];
884
868
  },
885
- tableCellFormatter: handleFormatSelect,
886
- tableCellCopyMethod: handleFormatSelect,
887
- tableCellPasteMethod: handleSetSelectValue,
888
- tableFilterDefaultMethod: handleFilterMethod,
889
- tableExportMethod: handleExportSelectMethod
869
+ getResult({ cellValue }) {
870
+ return handleSelectCellValue(cellValue, renderOpts);
871
+ }
872
+ });
873
+ return getCellLabelVNs(renderOpts, params, cellResult);
890
874
  },
891
- VxeInput: {
892
- tableAutoFocus: true,
893
- renderTableEdit: defaultInputEditRender,
894
- renderTableCell(renderOpts, renderParams) {
895
- const { props = {} } = renderOpts;
896
- const { row, column } = renderParams;
897
- const inputConfig = getConfig().input || {};
898
- const digits = props.digits || inputConfig.digits || 2;
899
- let cellValue = XEUtils.get(row, column.field);
900
- if (cellValue) {
901
- switch (props.type) {
902
- case 'date':
903
- case 'week':
904
- case 'month':
905
- case 'quarter':
906
- case 'year':
907
- cellValue = getLabelFormatDate(cellValue, props);
908
- break;
909
- case 'float':
910
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
911
- break;
912
- }
913
- }
914
- const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
915
- return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
916
- },
917
- renderTableDefault: defaultInputEditRender,
918
- createTableFilterOptions: defaultFilterOptions,
919
- renderTableFilter: defaultFilterRender,
920
- renderTableFloatingFilter: defaultFloatingFilterRender,
921
- tableFilterDefaultMethod: handleInputFilterMethod
875
+ createTableFilterOptions: defaultFilterOptions,
876
+ renderTableFilter(renderOpts, params) {
877
+ const { column } = params;
878
+ return column.filters.map((option, oIndex) => {
879
+ return h(
880
+ "select",
881
+ {
882
+ key: oIndex,
883
+ class: "vxe-default-select",
884
+ ...getNativeAttrs(renderOpts),
885
+ ...getNativeFilterOns(renderOpts, params, option)
886
+ },
887
+ renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params)
888
+ );
889
+ });
922
890
  },
923
- FormatNumberInput: {
924
- renderTableDefault(renderOpts, renderParams) {
925
- const { row, column } = renderParams;
926
- const cellValue = XEUtils.get(row, column.field);
927
- return handleNumberCell(cellValue, renderOpts, renderParams);
928
- },
929
- tableFilterDefaultMethod({ option, row, column }) {
930
- const { data } = option;
931
- const cellValue = XEUtils.get(row, column.field);
932
- /* eslint-disable eqeqeq */
933
- return cellValue == data;
934
- },
935
- tableExportMethod(params) {
936
- const { row, column } = params;
937
- const cellValue = XEUtils.get(row, column.field);
938
- return cellValue;
891
+ tableCellFormatter: handleFormatSelect,
892
+ tableCellCopyMethod: handleFormatSelect,
893
+ tableCellPasteMethod: handleSetSelectValue,
894
+ tableFilterDefaultMethod: handleFilterMethod,
895
+ tableExportMethod: handleExportSelectMethod
896
+ },
897
+ VxeInput: {
898
+ tableAutoFocus: true,
899
+ renderTableEdit: defaultInputEditRender,
900
+ renderTableCell(renderOpts, renderParams) {
901
+ const { props = {} } = renderOpts;
902
+ const { row, column } = renderParams;
903
+ const inputConfig = getConfig().input || {};
904
+ const digits = props.digits || inputConfig.digits || 2;
905
+ let cellValue = XEUtils.get(row, column.field);
906
+ if (cellValue) {
907
+ switch (props.type) {
908
+ case "date":
909
+ case "week":
910
+ case "month":
911
+ case "quarter":
912
+ case "year":
913
+ cellValue = getLabelFormatDate(cellValue, props);
914
+ break;
915
+ case "float":
916
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
917
+ break;
939
918
  }
919
+ }
920
+ const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
921
+ return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
940
922
  },
941
- VxeNumberInput: {
942
- tableAutoFocus: true,
943
- renderTableEdit: defaultInputEditRender,
944
- renderTableCell(renderOpts, renderParams) {
945
- const { row, column } = renderParams;
946
- const cellValue = XEUtils.get(row, column.field);
947
- const cellVNs = handleNumberCell(cellValue, renderOpts, renderParams);
948
- return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
949
- },
950
- renderTableFooter(renderOpts, params) {
951
- const { props = {} } = renderOpts;
952
- const { row, column, _columnIndex } = params;
953
- const { type } = props;
954
- // 兼容老模式
955
- const itemValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field);
956
- if (XEUtils.isNumber(itemValue)) {
957
- const numberInputConfig = getConfig().numberInput || {};
958
- if (type === 'float') {
959
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
960
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
961
- let amountLabel = XEUtils.toFixed(XEUtils.floor(itemValue, digits), digits);
962
- if (!autoFill) {
963
- amountLabel = '' + XEUtils.toNumber(amountLabel);
964
- }
965
- return amountLabel;
966
- }
967
- else if (type === 'amount') {
968
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
969
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
970
- const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
971
- let amountLabel = XEUtils.commafy(XEUtils.toNumber(itemValue), { digits });
972
- if (!autoFill) {
973
- const [iStr, dStr] = amountLabel.split('.');
974
- if (dStr) {
975
- const dRest = dStr.replace(/0+$/, '');
976
- amountLabel = dRest ? [iStr, '.', dRest].join('') : iStr;
977
- }
978
- }
979
- if (showCurrency) {
980
- amountLabel = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${amountLabel}`;
981
- }
982
- return amountLabel;
983
- }
923
+ renderTableDefault: defaultInputEditRender,
924
+ createTableFilterOptions: defaultFilterOptions,
925
+ renderTableFilter: defaultFilterRender,
926
+ renderTableFloatingFilter: defaultFloatingFilterRender,
927
+ tableFilterDefaultMethod: handleInputFilterMethod
928
+ },
929
+ FormatNumberInput: {
930
+ renderTableDefault(renderOpts, renderParams) {
931
+ const { row, column } = renderParams;
932
+ const cellValue = XEUtils.get(row, column.field);
933
+ return handleNumberCell(cellValue, renderOpts, renderParams);
934
+ },
935
+ tableFilterDefaultMethod({ option, row, column }) {
936
+ const { data } = option;
937
+ const cellValue = XEUtils.get(row, column.field);
938
+ return cellValue == data;
939
+ },
940
+ tableExportMethod(params) {
941
+ const { row, column } = params;
942
+ const cellValue = XEUtils.get(row, column.field);
943
+ return cellValue;
944
+ }
945
+ },
946
+ VxeNumberInput: {
947
+ tableAutoFocus: true,
948
+ renderTableEdit: defaultInputEditRender,
949
+ renderTableCell(renderOpts, renderParams) {
950
+ const { row, column } = renderParams;
951
+ const cellValue = XEUtils.get(row, column.field);
952
+ const cellVNs = handleNumberCell(cellValue, renderOpts, renderParams);
953
+ return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
954
+ },
955
+ renderTableFooter(renderOpts, params) {
956
+ const { props = {} } = renderOpts;
957
+ const { row, column, _columnIndex } = params;
958
+ const { type } = props;
959
+ const itemValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field);
960
+ if (XEUtils.isNumber(itemValue)) {
961
+ const numberInputConfig = getConfig().numberInput || {};
962
+ if (type === "float") {
963
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
964
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
965
+ let amountLabel = XEUtils.toFixed(XEUtils.floor(itemValue, digits), digits);
966
+ if (!autoFill) {
967
+ amountLabel = "" + XEUtils.toNumber(amountLabel);
968
+ }
969
+ return amountLabel;
970
+ } else if (type === "amount") {
971
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
972
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
973
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
974
+ let amountLabel = XEUtils.commafy(XEUtils.toNumber(itemValue), { digits });
975
+ if (!autoFill) {
976
+ const [iStr, dStr] = amountLabel.split(".");
977
+ if (dStr) {
978
+ const dRest = dStr.replace(/0+$/, "");
979
+ amountLabel = dRest ? [iStr, ".", dRest].join("") : iStr;
984
980
  }
985
- return getFuncText(itemValue, 1);
986
- },
987
- renderTableDefault: defaultInputEditRender,
988
- createTableFilterOptions: defaultFilterOptions,
989
- renderTableFilter: defaultFilterRender,
990
- renderTableFloatingFilter: defaultFloatingFilterRender,
991
- tableFilterDefaultMethod({ option, row, column }) {
992
- const { data } = option;
993
- const cellValue = XEUtils.get(row, column.field);
994
- /* eslint-disable eqeqeq */
995
- return cellValue == data;
996
- },
997
- tableExportMethod(params) {
998
- const { row, column } = params;
999
- const cellValue = XEUtils.get(row, column.field);
1000
- return cellValue;
981
+ }
982
+ if (showCurrency) {
983
+ amountLabel = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n("vxe.numberInput.currencySymbol") || ""}${amountLabel}`;
984
+ }
985
+ return amountLabel;
1001
986
  }
987
+ }
988
+ return getFuncText(itemValue, 1);
1002
989
  },
1003
- VxeDatePicker: {
1004
- tableAutoFocus: true,
1005
- renderTableEdit: defaultEditRender,
1006
- renderTableCell(renderOpts, params) {
1007
- const props = renderOpts.props || {};
1008
- const { $table, row, column } = params;
1009
- const { cellResult } = $table.effectCellData(row, column, {
1010
- key: 'render_table_cell',
1011
- getResult({ cellValue }) {
1012
- if (cellValue) {
1013
- if (props.type !== 'time') {
1014
- return getLabelFormatDate(cellValue, props);
1015
- }
1016
- }
1017
- return cellValue;
1018
- }
1019
- });
1020
- return getCellLabelVNs(renderOpts, params, cellResult);
1021
- },
1022
- tableCellFormatter: handleFormatDatePicker,
1023
- renderTableDefault: defaultEditRender,
1024
- createTableFilterOptions: defaultFilterOptions,
1025
- renderTableFilter: defaultFilterRender,
1026
- renderTableFloatingFilter: defaultFloatingFilterRender,
1027
- tableFilterDefaultMethod: handleFilterMethod
990
+ renderTableDefault: defaultInputEditRender,
991
+ createTableFilterOptions: defaultFilterOptions,
992
+ renderTableFilter: defaultFilterRender,
993
+ renderTableFloatingFilter: defaultFloatingFilterRender,
994
+ tableFilterDefaultMethod({ option, row, column }) {
995
+ const { data } = option;
996
+ const cellValue = XEUtils.get(row, column.field);
997
+ return cellValue == data;
1028
998
  },
1029
- VxeDateRangePicker: {
1030
- tableAutoFocus: true,
1031
- renderTableEdit(renderOpts, params) {
1032
- const { startField, endField } = renderOpts;
1033
- const { $table, row, column } = params;
1034
- const { model } = column;
1035
- const cellValue = getCellValue(row, column);
1036
- const seProps = {};
1037
- const seOs = {};
1038
- if (startField && endField) {
1039
- seProps.startValue = XEUtils.get(row, startField);
1040
- seProps.endValue = XEUtils.get(row, endField);
1041
- seOs['onUpdate:startValue'] = (value) => {
1042
- if (startField) {
1043
- XEUtils.set(row, startField, value);
1044
- }
1045
- };
1046
- seOs['onUpdate:endValue'] = (value) => {
1047
- if (endField) {
1048
- XEUtils.set(row, endField, value);
1049
- }
1050
- };
1051
- }
1052
- return [
1053
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, seProps)), getComponentOns(renderOpts, params, {
1054
- model(cellValue) {
1055
- model.update = true;
1056
- model.value = cellValue;
1057
- setCellValue(row, column, cellValue);
1058
- },
1059
- change() {
1060
- $table.updateStatus(params);
1061
- },
1062
- blur() {
1063
- $table.handleCellRuleUpdateStatus('blur', params);
1064
- }
1065
- }, seOs)))
1066
- ];
1067
- },
1068
- renderTableDefault(renderOpts, params) {
1069
- const { startField, endField } = renderOpts;
1070
- const { row, column } = params;
1071
- const { model } = column;
1072
- const cellValue = getCellValue(row, column);
1073
- const seProps = {};
1074
- const seOs = {};
1075
- if (startField && endField) {
1076
- seProps.startValue = XEUtils.get(row, startField);
1077
- seProps.endValue = XEUtils.get(row, endField);
1078
- seOs['onUpdate:startValue'] = (value) => {
1079
- if (startField) {
1080
- XEUtils.set(row, startField, value);
1081
- }
1082
- };
1083
- seOs['onUpdate:endValue'] = (value) => {
1084
- if (endField) {
1085
- XEUtils.set(row, endField, value);
1086
- }
1087
- };
1088
- }
1089
- return [
1090
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, seProps)), getComponentOns(renderOpts, params, {
1091
- model(cellValue) {
1092
- model.update = true;
1093
- model.value = cellValue;
1094
- setCellValue(row, column, cellValue);
1095
- }
1096
- }, seOs)))
1097
- ];
1098
- },
1099
- renderTableCell(renderOpts, params) {
1100
- const { startField, endField } = renderOpts;
1101
- const { row, column } = params;
1102
- let startValue = '';
1103
- let endValue = '';
1104
- if (startField && endField) {
1105
- startValue = XEUtils.get(row, startField);
1106
- endValue = XEUtils.get(row, endField);
1107
- }
1108
- else {
1109
- const cellValue = XEUtils.get(row, column.field);
1110
- if (cellValue) {
1111
- if (XEUtils.isArray(cellValue)) {
1112
- startValue = cellValue[0];
1113
- endValue = cellValue[1];
1114
- }
1115
- else {
1116
- const strs = `${cellValue}`.split(',');
1117
- startValue = strs[0];
1118
- endValue = strs[1];
1119
- }
1120
- }
1121
- }
1122
- let cellLabel = '';
1123
- if (startValue && endValue) {
1124
- cellLabel = `${startValue} ~ ${endValue}`;
999
+ tableExportMethod(params) {
1000
+ const { row, column } = params;
1001
+ const cellValue = XEUtils.get(row, column.field);
1002
+ return cellValue;
1003
+ }
1004
+ },
1005
+ VxeDatePicker: {
1006
+ tableAutoFocus: true,
1007
+ renderTableEdit: defaultEditRender,
1008
+ renderTableCell(renderOpts, params) {
1009
+ const props = renderOpts.props || {};
1010
+ const { $table, row, column } = params;
1011
+ const { cellResult } = $table.effectCellData(row, column, {
1012
+ key: "render_table_cell",
1013
+ getResult({ cellValue }) {
1014
+ if (cellValue) {
1015
+ if (props.type !== "time") {
1016
+ return getLabelFormatDate(cellValue, props);
1125
1017
  }
1126
- return getCellLabelVNs(renderOpts, params, cellLabel);
1018
+ }
1019
+ return cellValue;
1127
1020
  }
1021
+ });
1022
+ return getCellLabelVNs(renderOpts, params, cellResult);
1128
1023
  },
1129
- VxeTextarea: {
1130
- tableAutoFocus: true,
1131
- renderTableDefault: defaultInputEditRender,
1132
- renderTableCell(renderOpts, renderParams) {
1133
- const { row, column } = renderParams;
1134
- const cellValue = XEUtils.get(row, column.field);
1135
- const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
1136
- return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
1137
- },
1138
- renderTableEdit: defaultInputEditRender
1024
+ tableCellFormatter: handleFormatDatePicker,
1025
+ renderTableDefault: defaultEditRender,
1026
+ createTableFilterOptions: defaultFilterOptions,
1027
+ renderTableFilter: defaultFilterRender,
1028
+ renderTableFloatingFilter: defaultFloatingFilterRender,
1029
+ tableFilterDefaultMethod: handleFilterMethod
1030
+ },
1031
+ VxeDateRangePicker: {
1032
+ tableAutoFocus: true,
1033
+ renderTableEdit(renderOpts, params) {
1034
+ const { startField, endField } = renderOpts;
1035
+ const { $table, row, column } = params;
1036
+ const { model } = column;
1037
+ const cellValue = getCellValue(row, column);
1038
+ const seProps = {};
1039
+ const seOs = {};
1040
+ if (startField && endField) {
1041
+ seProps.startValue = XEUtils.get(row, startField);
1042
+ seProps.endValue = XEUtils.get(row, endField);
1043
+ seOs["onUpdate:startValue"] = (value) => {
1044
+ if (startField) {
1045
+ XEUtils.set(row, startField, value);
1046
+ }
1047
+ };
1048
+ seOs["onUpdate:endValue"] = (value) => {
1049
+ if (endField) {
1050
+ XEUtils.set(row, endField, value);
1051
+ }
1052
+ };
1053
+ }
1054
+ return [
1055
+ h(getDefaultComponent(renderOpts), {
1056
+ ...getCellEditProps(renderOpts, params, cellValue, seProps),
1057
+ ...getComponentOns(renderOpts, params, {
1058
+ model(cellValue2) {
1059
+ model.update = true;
1060
+ model.value = cellValue2;
1061
+ setCellValue(row, column, cellValue2);
1062
+ },
1063
+ change() {
1064
+ $table.updateStatus(params);
1065
+ },
1066
+ blur() {
1067
+ $table.handleCellRuleUpdateStatus("blur", params);
1068
+ }
1069
+ }, seOs)
1070
+ })
1071
+ ];
1139
1072
  },
1140
- VxeButton: {
1141
- renderTableDefault: buttonCellRender
1073
+ renderTableDefault(renderOpts, params) {
1074
+ const { startField, endField } = renderOpts;
1075
+ const { row, column } = params;
1076
+ const { model } = column;
1077
+ const cellValue = getCellValue(row, column);
1078
+ const seProps = {};
1079
+ const seOs = {};
1080
+ if (startField && endField) {
1081
+ seProps.startValue = XEUtils.get(row, startField);
1082
+ seProps.endValue = XEUtils.get(row, endField);
1083
+ seOs["onUpdate:startValue"] = (value) => {
1084
+ if (startField) {
1085
+ XEUtils.set(row, startField, value);
1086
+ }
1087
+ };
1088
+ seOs["onUpdate:endValue"] = (value) => {
1089
+ if (endField) {
1090
+ XEUtils.set(row, endField, value);
1091
+ }
1092
+ };
1093
+ }
1094
+ return [
1095
+ h(getDefaultComponent(renderOpts), {
1096
+ ...getCellEditProps(renderOpts, params, cellValue, seProps),
1097
+ ...getComponentOns(renderOpts, params, {
1098
+ model(cellValue2) {
1099
+ model.update = true;
1100
+ model.value = cellValue2;
1101
+ setCellValue(row, column, cellValue2);
1102
+ }
1103
+ }, seOs)
1104
+ })
1105
+ ];
1142
1106
  },
1143
- VxeButtonGroup: {
1144
- renderTableDefault(renderOpts, params) {
1145
- const { options } = renderOpts;
1146
- return [
1147
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({ options }, getCellEditProps(renderOpts, params, null)), getComponentOns(renderOpts, params)))
1148
- ];
1107
+ renderTableCell(renderOpts, params) {
1108
+ const { startField, endField } = renderOpts;
1109
+ const { row, column } = params;
1110
+ let startValue = "";
1111
+ let endValue = "";
1112
+ if (startField && endField) {
1113
+ startValue = XEUtils.get(row, startField);
1114
+ endValue = XEUtils.get(row, endField);
1115
+ } else {
1116
+ const cellValue = XEUtils.get(row, column.field);
1117
+ if (cellValue) {
1118
+ if (XEUtils.isArray(cellValue)) {
1119
+ startValue = cellValue[0];
1120
+ endValue = cellValue[1];
1121
+ } else {
1122
+ const strs = `${cellValue}`.split(",");
1123
+ startValue = strs[0];
1124
+ endValue = strs[1];
1125
+ }
1149
1126
  }
1127
+ }
1128
+ let cellLabel = "";
1129
+ if (startValue && endValue) {
1130
+ cellLabel = `${startValue} ~ ${endValue}`;
1131
+ }
1132
+ return getCellLabelVNs(renderOpts, params, cellLabel);
1133
+ }
1134
+ },
1135
+ VxeTextarea: {
1136
+ tableAutoFocus: true,
1137
+ renderTableDefault: defaultInputEditRender,
1138
+ renderTableCell(renderOpts, renderParams) {
1139
+ const { row, column } = renderParams;
1140
+ const cellValue = XEUtils.get(row, column.field);
1141
+ const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
1142
+ return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
1150
1143
  },
1151
- VxeSelect: {
1152
- tableAutoFocus: true,
1153
- renderTableEdit: defaultSelectEditRender,
1154
- renderTableDefault: defaultSelectEditRender,
1155
- renderTableCell(renderOpts, params) {
1156
- const { options, optionGroups } = renderOpts;
1157
- const { $table, row, column } = params;
1158
- const opSize = options ? options.length : null;
1159
- const ogSize = optionGroups ? optionGroups.length : null;
1160
- const { cellResult } = $table.effectCellData(row, column, {
1161
- key: 'render_table_cell',
1162
- isChanged({ oldValue, cellValue }) {
1163
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1164
- },
1165
- setValue({ cellValue }) {
1166
- return [cellValue, opSize, ogSize];
1167
- },
1168
- getResult({ cellValue }) {
1169
- return handleSelectCellValue(cellValue, renderOpts);
1170
- }
1171
- });
1172
- // const cellResult = getSelectCellValue(renderOpts, params)
1173
- return getCellLabelVNs(renderOpts, params, cellResult);
1174
- },
1175
- createTableFilterOptions: defaultFilterOptions,
1176
- renderTableFilter(renderOpts, params) {
1177
- const { column } = params;
1178
- const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
1179
- return column.filters.map((option, oIndex) => {
1180
- const optionValue = option.data;
1181
- return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({ key: oIndex }, getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps })), getFilterOns(renderOpts, params, option)));
1182
- });
1144
+ renderTableEdit: defaultInputEditRender
1145
+ },
1146
+ VxeButton: {
1147
+ renderTableDefault: buttonCellRender
1148
+ },
1149
+ VxeButtonGroup: {
1150
+ renderTableDefault(renderOpts, params) {
1151
+ const { options } = renderOpts;
1152
+ return [
1153
+ h(getDefaultComponent(renderOpts), {
1154
+ options,
1155
+ ...getCellEditProps(renderOpts, params, null),
1156
+ ...getComponentOns(renderOpts, params)
1157
+ })
1158
+ ];
1159
+ }
1160
+ },
1161
+ VxeSelect: {
1162
+ tableAutoFocus: true,
1163
+ renderTableEdit: defaultSelectEditRender,
1164
+ renderTableDefault: defaultSelectEditRender,
1165
+ renderTableCell(renderOpts, params) {
1166
+ const { options, optionGroups } = renderOpts;
1167
+ const { $table, row, column } = params;
1168
+ const opSize = options ? options.length : null;
1169
+ const ogSize = optionGroups ? optionGroups.length : null;
1170
+ const { cellResult } = $table.effectCellData(row, column, {
1171
+ key: "render_table_cell",
1172
+ isChanged({ oldValue, cellValue }) {
1173
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1183
1174
  },
1184
- renderTableFloatingFilter(renderOpts, params) {
1185
- const { option } = params;
1186
- const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
1187
- const optionValue = option.data;
1188
- return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps })), getFloatingFilterOns(renderOpts, params, option)));
1175
+ setValue({ cellValue }) {
1176
+ return [cellValue, opSize, ogSize];
1189
1177
  },
1190
- tableCellFormatter: handleFormatSelect,
1191
- tableCellCopyMethod: handleFormatSelect,
1192
- tableCellPasteMethod: handleSetSelectValue,
1193
- tableFilterDefaultMethod: handleFilterMethod,
1194
- tableExportMethod: handleExportSelectMethod
1195
- },
1196
- VxeText: {
1197
- renderTableDefault(renderOpts, params) {
1198
- const { $table, row, column } = params;
1199
- const { props } = renderOpts;
1200
- const cellLabel = $table.getCellLabel(row, column);
1201
- return [
1202
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, (props || {})), { content: cellLabel }), getComponentOns(renderOpts, params)))
1203
- ];
1178
+ getResult({ cellValue }) {
1179
+ return handleSelectCellValue(cellValue, renderOpts);
1204
1180
  }
1181
+ });
1182
+ return getCellLabelVNs(renderOpts, params, cellResult);
1205
1183
  },
1206
- VxeLink: {
1207
- renderTableDefault(renderOpts, params) {
1208
- const { $table, row, column } = params;
1209
- const { props } = renderOpts;
1210
- const { href } = props || {};
1211
- const cellLabel = $table.getCellLabel(row, column);
1212
- return [
1213
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, (props || {})), { content: cellLabel, href: XEUtils.toFormatString(href, params) }), getComponentOns(renderOpts, params)))
1214
- ];
1215
- }
1184
+ createTableFilterOptions: defaultFilterOptions,
1185
+ renderTableFilter(renderOpts, params) {
1186
+ const { column } = params;
1187
+ const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
1188
+ return column.filters.map((option, oIndex) => {
1189
+ const optionValue = option.data;
1190
+ return h(getDefaultComponent(renderOpts), {
1191
+ key: oIndex,
1192
+ ...getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
1193
+ ...getFilterOns(renderOpts, params, option)
1194
+ });
1195
+ });
1216
1196
  },
1217
- /**
1218
- * 已废弃,被 FormatSelect 替换
1219
- * @deprecated
1220
- */
1221
- formatOption: {
1222
- renderTableDefault(renderOpts, params) {
1223
- return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
1224
- }
1197
+ renderTableFloatingFilter(renderOpts, params) {
1198
+ const { option } = params;
1199
+ const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
1200
+ const optionValue = option.data;
1201
+ return h(getDefaultComponent(renderOpts), {
1202
+ ...getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
1203
+ ...getFloatingFilterOns(renderOpts, params, option)
1204
+ });
1225
1205
  },
1226
- FormatSelect: {
1227
- renderTableDefault(renderOpts, params) {
1228
- const { options, optionGroups } = renderOpts;
1229
- const { $table, row, column } = params;
1230
- const opSize = options ? options.length : null;
1231
- const ogSize = optionGroups ? optionGroups.length : null;
1232
- const { cellResult } = $table.effectCellData(row, column, {
1233
- key: 'render_table_cell',
1234
- isChanged({ oldValue, cellValue }) {
1235
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1236
- },
1237
- setValue({ cellValue }) {
1238
- return [cellValue, opSize, ogSize];
1239
- },
1240
- getResult({ cellValue }) {
1241
- return handleSelectCellValue(cellValue, renderOpts);
1242
- }
1243
- });
1244
- // const cellResult = getSelectCellValue(renderOpts, params)
1245
- return getCellLabelVNs(renderOpts, params, cellResult);
1206
+ tableCellFormatter: handleFormatSelect,
1207
+ tableCellCopyMethod: handleFormatSelect,
1208
+ tableCellPasteMethod: handleSetSelectValue,
1209
+ tableFilterDefaultMethod: handleFilterMethod,
1210
+ tableExportMethod: handleExportSelectMethod
1211
+ },
1212
+ VxeText: {
1213
+ renderTableDefault(renderOpts, params) {
1214
+ const { $table, row, column } = params;
1215
+ const { props } = renderOpts;
1216
+ const cellLabel = $table.getCellLabel(row, column);
1217
+ return [
1218
+ h(getDefaultComponent(renderOpts), {
1219
+ ...props || {},
1220
+ content: cellLabel,
1221
+ ...getComponentOns(renderOpts, params)
1222
+ })
1223
+ ];
1224
+ }
1225
+ },
1226
+ VxeLink: {
1227
+ renderTableDefault(renderOpts, params) {
1228
+ const { $table, row, column } = params;
1229
+ const { props } = renderOpts;
1230
+ const { href } = props || {};
1231
+ const cellLabel = $table.getCellLabel(row, column);
1232
+ return [
1233
+ h(getDefaultComponent(renderOpts), {
1234
+ ...props || {},
1235
+ content: cellLabel,
1236
+ href: XEUtils.toFormatString(href, params),
1237
+ ...getComponentOns(renderOpts, params)
1238
+ })
1239
+ ];
1240
+ }
1241
+ },
1242
+ /**
1243
+ * 已废弃,被 FormatSelect 替换
1244
+ * @deprecated
1245
+ */
1246
+ formatOption: {
1247
+ renderTableDefault(renderOpts, params) {
1248
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
1249
+ }
1250
+ },
1251
+ FormatSelect: {
1252
+ renderTableDefault(renderOpts, params) {
1253
+ const { options, optionGroups } = renderOpts;
1254
+ const { $table, row, column } = params;
1255
+ const opSize = options ? options.length : null;
1256
+ const ogSize = optionGroups ? optionGroups.length : null;
1257
+ const { cellResult } = $table.effectCellData(row, column, {
1258
+ key: "render_table_cell",
1259
+ isChanged({ oldValue, cellValue }) {
1260
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1246
1261
  },
1247
- tableCellFormatter: handleFormatSelect,
1248
- tableCellCopyMethod: handleFormatSelect,
1249
- tableCellPasteMethod: handleSetSelectValue,
1250
- tableFilterDefaultMethod: handleFilterMethod,
1251
- tableExportMethod: handleExportSelectMethod
1252
- },
1253
- VxeTreeSelect: {
1254
- tableAutoFocus: true,
1255
- renderTableEdit: defaultTableOrTreeSelectEditRender,
1256
- renderTableCell(renderOpts, params) {
1257
- const { options, optionGroups } = renderOpts;
1258
- const { $table, row, column } = params;
1259
- const opSize = options ? options.length : null;
1260
- const ogSize = optionGroups ? optionGroups.length : null;
1261
- const { cellResult } = $table.effectCellData(row, column, {
1262
- key: 'render_table_cell',
1263
- isChanged({ oldValue, cellValue }) {
1264
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1265
- },
1266
- setValue({ cellValue }) {
1267
- return [cellValue, opSize, ogSize];
1268
- },
1269
- getResult({ cellValue }) {
1270
- return handleTreeSelectCellValue(cellValue, renderOpts);
1271
- }
1272
- });
1273
- // const cellResult = getTreeSelectCellValue(renderOpts, params)
1274
- return getCellLabelVNs(renderOpts, params, cellResult);
1262
+ setValue({ cellValue }) {
1263
+ return [cellValue, opSize, ogSize];
1275
1264
  },
1276
- tableCellFormatter: handleFormatTreeSelect,
1277
- tableCellCopyMethod: handleFormatTreeSelect,
1278
- tableCellPasteMethod: handleSetTreeSelectValue,
1279
- tableExportMethod: handleExportTreeSelectMethod
1280
- },
1281
- /**
1282
- * 已废弃,被 FormatTreeSelect 替换
1283
- * @deprecated
1284
- */
1285
- formatTree: {
1286
- renderTableDefault(renderOpts, params) {
1287
- return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
1265
+ getResult({ cellValue }) {
1266
+ return handleSelectCellValue(cellValue, renderOpts);
1288
1267
  }
1268
+ });
1269
+ return getCellLabelVNs(renderOpts, params, cellResult);
1289
1270
  },
1290
- FormatTreeSelect: {
1291
- renderTableDefault(renderOpts, params) {
1292
- const { options, optionGroups } = renderOpts;
1293
- const { $table, row, column } = params;
1294
- const opSize = options ? options.length : null;
1295
- const ogSize = optionGroups ? optionGroups.length : null;
1296
- const { cellResult } = $table.effectCellData(row, column, {
1297
- key: 'render_table_cell',
1298
- isChanged({ oldValue, cellValue }) {
1299
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1300
- },
1301
- setValue({ cellValue }) {
1302
- return [cellValue, opSize, ogSize];
1303
- },
1304
- getResult({ cellValue }) {
1305
- return handleTreeSelectCellValue(cellValue, renderOpts);
1306
- }
1307
- });
1308
- // const cellResult = getTreeSelectCellValue(renderOpts, params)
1309
- return getCellLabelVNs(renderOpts, params, cellResult);
1271
+ tableCellFormatter: handleFormatSelect,
1272
+ tableCellCopyMethod: handleFormatSelect,
1273
+ tableCellPasteMethod: handleSetSelectValue,
1274
+ tableFilterDefaultMethod: handleFilterMethod,
1275
+ tableExportMethod: handleExportSelectMethod
1276
+ },
1277
+ VxeTreeSelect: {
1278
+ tableAutoFocus: true,
1279
+ renderTableEdit: defaultTableOrTreeSelectEditRender,
1280
+ renderTableCell(renderOpts, params) {
1281
+ const { options, optionGroups } = renderOpts;
1282
+ const { $table, row, column } = params;
1283
+ const opSize = options ? options.length : null;
1284
+ const ogSize = optionGroups ? optionGroups.length : null;
1285
+ const { cellResult } = $table.effectCellData(row, column, {
1286
+ key: "render_table_cell",
1287
+ isChanged({ oldValue, cellValue }) {
1288
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1310
1289
  },
1311
- tableCellFormatter: handleFormatTreeSelect,
1312
- tableCellCopyMethod: handleFormatTreeSelect,
1313
- tableCellPasteMethod: handleSetTreeSelectValue,
1314
- tableExportMethod: handleExportTreeSelectMethod
1315
- },
1316
- VxeCascader: {
1317
- tableAutoFocus: true,
1318
- renderTableEdit: defaultTableOrTreeSelectEditRender,
1319
- renderTableCell(renderOpts, params) {
1320
- const { options, optionGroups } = renderOpts;
1321
- const { $table, row, column } = params;
1322
- const opSize = options ? options.length : null;
1323
- const ogSize = optionGroups ? optionGroups.length : null;
1324
- const { cellResult } = $table.effectCellData(row, column, {
1325
- key: 'render_table_cell',
1326
- isChanged({ oldValue, cellValue }) {
1327
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1328
- },
1329
- setValue({ cellValue }) {
1330
- return [cellValue, opSize, ogSize];
1331
- },
1332
- getResult({ cellValue }) {
1333
- return handleTreeSelectCellValue(cellValue, renderOpts);
1334
- }
1335
- });
1336
- // const cellResult = getTreeSelectCellValue(renderOpts, params)
1337
- return getCellLabelVNs(renderOpts, params, cellResult);
1290
+ setValue({ cellValue }) {
1291
+ return [cellValue, opSize, ogSize];
1338
1292
  },
1339
- tableCellFormatter: handleFormatTreeSelect,
1340
- tableCellCopyMethod: handleFormatTreeSelect,
1341
- tableCellPasteMethod: handleSetTreeSelectValue,
1342
- tableExportMethod: handleExportTreeSelectMethod
1293
+ getResult({ cellValue }) {
1294
+ return handleTreeSelectCellValue(cellValue, renderOpts);
1295
+ }
1296
+ });
1297
+ return getCellLabelVNs(renderOpts, params, cellResult);
1343
1298
  },
1344
- VxeTableSelect: {
1345
- tableAutoFocus: true,
1346
- renderTableEdit: defaultTableOrTreeSelectEditRender,
1347
- renderTableCell(renderOpts, params) {
1348
- const { options, optionGroups } = renderOpts;
1349
- const { $table, row, column } = params;
1350
- const opSize = options ? options.length : null;
1351
- const ogSize = optionGroups ? optionGroups.length : null;
1352
- const { cellResult } = $table.effectCellData(row, column, {
1353
- key: 'render_table_cell',
1354
- isChanged({ oldValue, cellValue }) {
1355
- return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1356
- },
1357
- setValue({ cellValue }) {
1358
- return [cellValue, opSize, ogSize];
1359
- },
1360
- getResult({ cellValue }) {
1361
- return handleTreeSelectCellValue(cellValue, renderOpts);
1362
- }
1363
- });
1364
- // const cellResult = getTreeSelectCellValue(renderOpts, params)
1365
- return getCellLabelVNs(renderOpts, params, cellResult);
1299
+ tableCellFormatter: handleFormatTreeSelect,
1300
+ tableCellCopyMethod: handleFormatTreeSelect,
1301
+ tableCellPasteMethod: handleSetTreeSelectValue,
1302
+ tableExportMethod: handleExportTreeSelectMethod
1303
+ },
1304
+ /**
1305
+ * 已废弃,被 FormatTreeSelect 替换
1306
+ * @deprecated
1307
+ */
1308
+ formatTree: {
1309
+ renderTableDefault(renderOpts, params) {
1310
+ return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
1311
+ }
1312
+ },
1313
+ FormatTreeSelect: {
1314
+ renderTableDefault(renderOpts, params) {
1315
+ const { options, optionGroups } = renderOpts;
1316
+ const { $table, row, column } = params;
1317
+ const opSize = options ? options.length : null;
1318
+ const ogSize = optionGroups ? optionGroups.length : null;
1319
+ const { cellResult } = $table.effectCellData(row, column, {
1320
+ key: "render_table_cell",
1321
+ isChanged({ oldValue, cellValue }) {
1322
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1366
1323
  },
1367
- tableCellFormatter: handleFormatTreeSelect,
1368
- tableCellCopyMethod: handleFormatTreeSelect,
1369
- tableCellPasteMethod: handleSetTreeSelectValue,
1370
- tableExportMethod: handleExportTreeSelectMethod
1371
- },
1372
- VxeColorPicker: {
1373
- tableAutoFocus: true,
1374
- renderTableEdit(renderOpts, params) {
1375
- const { row, column } = params;
1376
- const { options } = renderOpts;
1377
- const cellValue = getCellValue(row, column);
1378
- return [
1379
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, { colors: options })), getEditOns(renderOpts, params)))
1380
- ];
1324
+ setValue({ cellValue }) {
1325
+ return [cellValue, opSize, ogSize];
1381
1326
  },
1382
- renderTableCell(renderOpts, params) {
1383
- const { $table, row, column } = params;
1384
- const { props } = renderOpts;
1385
- const { computeSize } = $table.getComputeMaps();
1386
- const customSize = props ? props.size : null;
1387
- const vSize = customSize || computeSize.value;
1388
- const cellValue = XEUtils.get(row, column.field);
1389
- return h('span', {
1390
- class: ['vxe-color-picker--readonly', {
1391
- [`size--${vSize}`]: vSize
1392
- }]
1393
- }, [
1394
- h('div', {
1395
- class: ['vxe-color-picker--readonly-color', {
1396
- 'is--empty': !cellValue
1397
- }],
1398
- style: cellValue
1399
- ? {
1400
- backgroundColor: cellValue
1401
- }
1402
- : undefined
1403
- })
1404
- ]);
1327
+ getResult({ cellValue }) {
1328
+ return handleTreeSelectCellValue(cellValue, renderOpts);
1405
1329
  }
1330
+ });
1331
+ return getCellLabelVNs(renderOpts, params, cellResult);
1406
1332
  },
1407
- VxeIconPicker: {
1408
- tableAutoFocus: true,
1409
- renderTableEdit(renderOpts, params) {
1410
- const { row, column } = params;
1411
- const { options } = renderOpts;
1412
- const cellValue = getCellValue(row, column);
1413
- return [
1414
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, { icons: options })), getEditOns(renderOpts, params)))
1415
- ];
1333
+ tableCellFormatter: handleFormatTreeSelect,
1334
+ tableCellCopyMethod: handleFormatTreeSelect,
1335
+ tableCellPasteMethod: handleSetTreeSelectValue,
1336
+ tableExportMethod: handleExportTreeSelectMethod
1337
+ },
1338
+ VxeCascader: {
1339
+ tableAutoFocus: true,
1340
+ renderTableEdit: defaultTableOrTreeSelectEditRender,
1341
+ renderTableCell(renderOpts, params) {
1342
+ const { options, optionGroups } = renderOpts;
1343
+ const { $table, row, column } = params;
1344
+ const opSize = options ? options.length : null;
1345
+ const ogSize = optionGroups ? optionGroups.length : null;
1346
+ const { cellResult } = $table.effectCellData(row, column, {
1347
+ key: "render_table_cell",
1348
+ isChanged({ oldValue, cellValue }) {
1349
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1416
1350
  },
1417
- renderTableCell(renderOpts, params) {
1418
- const { row, column } = params;
1419
- const cellValue = XEUtils.get(row, column.field);
1420
- return h('i', {
1421
- class: cellValue
1422
- });
1423
- }
1424
- },
1425
- VxeRadioGroup: {
1426
- renderTableDefault: radioAndCheckboxGroupEditRender
1427
- },
1428
- VxeCheckbox: {
1429
- renderTableDefault: checkboxEditRender
1430
- },
1431
- VxeCheckboxGroup: {
1432
- renderTableDefault: radioAndCheckboxGroupEditRender
1433
- },
1434
- VxeSwitch: {
1435
- tableAutoFocus: 'button',
1436
- renderTableEdit: defaultEditRender,
1437
- renderTableDefault: defaultEditRender
1438
- },
1439
- VxeUpload: {
1440
- renderTableEdit: defaultEditRender,
1441
- renderTableCell: defaultEditRender,
1442
- renderTableDefault: defaultEditRender
1443
- },
1444
- VxeImage: {
1445
- renderTableDefault(renderOpts, params) {
1446
- const { row, column } = params;
1447
- const { props } = renderOpts;
1448
- const cellValue = getCellValue(row, column);
1449
- return [
1450
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props), { src: cellValue }), getEditOns(renderOpts, params)))
1451
- ];
1452
- }
1453
- },
1454
- VxeImageGroup: {
1455
- renderTableDefault(renderOpts, params) {
1456
- const { row, column } = params;
1457
- const { props } = renderOpts;
1458
- const cellValue = getCellValue(row, column);
1459
- return [
1460
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props), { urlList: cellValue }), getEditOns(renderOpts, params)))
1461
- ];
1462
- }
1463
- },
1464
- VxeTextEllipsis: {
1465
- renderTableDefault(renderOpts, params) {
1466
- const { row, column } = params;
1467
- const { props } = renderOpts;
1468
- const cellValue = getCellValue(row, column);
1469
- return [
1470
- h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props), { content: cellValue }), getEditOns(renderOpts, params)))
1471
- ];
1351
+ setValue({ cellValue }) {
1352
+ return [cellValue, opSize, ogSize];
1353
+ },
1354
+ getResult({ cellValue }) {
1355
+ return handleTreeSelectCellValue(cellValue, renderOpts);
1472
1356
  }
1357
+ });
1358
+ return getCellLabelVNs(renderOpts, params, cellResult);
1473
1359
  },
1474
- VxeRate: {
1475
- renderTableDefault: defaultEditRender
1476
- },
1477
- VxeSlider: {
1478
- renderTableDefault: defaultEditRender
1479
- },
1480
- // 以下已废弃
1481
- $input: {
1482
- tableAutoFocus: 'input',
1483
- renderTableEdit: oldEditRender,
1484
- renderTableCell(renderOpts, params) {
1485
- var _a;
1486
- const { props = {} } = renderOpts;
1487
- const { row, column } = params;
1488
- const digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
1489
- let cellValue = XEUtils.get(row, column.field);
1490
- if (cellValue) {
1491
- switch (props.type) {
1492
- case 'date':
1493
- case 'week':
1494
- case 'month':
1495
- case 'year':
1496
- cellValue = getLabelFormatDate(cellValue, props);
1497
- break;
1498
- case 'float':
1499
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
1500
- break;
1501
- }
1502
- }
1503
- return getCellLabelVNs(renderOpts, params, cellValue);
1360
+ tableCellFormatter: handleFormatTreeSelect,
1361
+ tableCellCopyMethod: handleFormatTreeSelect,
1362
+ tableCellPasteMethod: handleSetTreeSelectValue,
1363
+ tableExportMethod: handleExportTreeSelectMethod
1364
+ },
1365
+ VxeTableSelect: {
1366
+ tableAutoFocus: true,
1367
+ renderTableEdit: defaultTableOrTreeSelectEditRender,
1368
+ renderTableCell(renderOpts, params) {
1369
+ const { options, optionGroups } = renderOpts;
1370
+ const { $table, row, column } = params;
1371
+ const opSize = options ? options.length : null;
1372
+ const ogSize = optionGroups ? optionGroups.length : null;
1373
+ const { cellResult } = $table.effectCellData(row, column, {
1374
+ key: "render_table_cell",
1375
+ isChanged({ oldValue, cellValue }) {
1376
+ return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
1504
1377
  },
1505
- renderTableDefault: oldEditRender,
1506
- renderTableFilter: oldFilterRender,
1507
- tableFilterDefaultMethod: handleInputFilterMethod
1508
- },
1509
- $textarea: {
1510
- tableAutoFocus: 'textarea'
1378
+ setValue({ cellValue }) {
1379
+ return [cellValue, opSize, ogSize];
1380
+ },
1381
+ getResult({ cellValue }) {
1382
+ return handleTreeSelectCellValue(cellValue, renderOpts);
1383
+ }
1384
+ });
1385
+ return getCellLabelVNs(renderOpts, params, cellResult);
1511
1386
  },
1512
- $button: {
1513
- renderTableDefault: oldButtonEditRender
1387
+ tableCellFormatter: handleFormatTreeSelect,
1388
+ tableCellCopyMethod: handleFormatTreeSelect,
1389
+ tableCellPasteMethod: handleSetTreeSelectValue,
1390
+ tableExportMethod: handleExportTreeSelectMethod
1391
+ },
1392
+ VxeColorPicker: {
1393
+ tableAutoFocus: true,
1394
+ renderTableEdit(renderOpts, params) {
1395
+ const { row, column } = params;
1396
+ const { options } = renderOpts;
1397
+ const cellValue = getCellValue(row, column);
1398
+ return [
1399
+ h(getDefaultComponent(renderOpts), {
1400
+ ...getCellEditProps(renderOpts, params, cellValue, { colors: options }),
1401
+ ...getEditOns(renderOpts, params)
1402
+ })
1403
+ ];
1514
1404
  },
1515
- $buttons: {
1516
- renderTableDefault: oldButtonsEditRender
1405
+ renderTableCell(renderOpts, params) {
1406
+ const { $table, row, column } = params;
1407
+ const { props } = renderOpts;
1408
+ const { computeSize } = $table.getComputeMaps();
1409
+ const customSize = props ? props.size : null;
1410
+ const vSize = customSize || computeSize.value;
1411
+ const cellValue = XEUtils.get(row, column.field);
1412
+ return h("span", {
1413
+ class: ["vxe-color-picker--readonly", {
1414
+ [`size--${vSize}`]: vSize
1415
+ }]
1416
+ }, [
1417
+ h("div", {
1418
+ class: ["vxe-color-picker--readonly-color", {
1419
+ "is--empty": !cellValue
1420
+ }],
1421
+ style: cellValue ? {
1422
+ backgroundColor: cellValue
1423
+ } : void 0
1424
+ })
1425
+ ]);
1426
+ }
1427
+ },
1428
+ VxeIconPicker: {
1429
+ tableAutoFocus: true,
1430
+ renderTableEdit(renderOpts, params) {
1431
+ const { row, column } = params;
1432
+ const { options } = renderOpts;
1433
+ const cellValue = getCellValue(row, column);
1434
+ return [
1435
+ h(getDefaultComponent(renderOpts), {
1436
+ ...getCellEditProps(renderOpts, params, cellValue, { icons: options }),
1437
+ ...getEditOns(renderOpts, params)
1438
+ })
1439
+ ];
1517
1440
  },
1518
- $select: {
1519
- tableAutoFocus: 'input',
1520
- renderTableEdit: oldSelectEditRender,
1521
- renderTableDefault: oldSelectEditRender,
1522
- renderTableCell(renderOpts, params) {
1523
- return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
1524
- },
1525
- renderTableFilter(renderOpts, params) {
1526
- const { column } = params;
1527
- const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
1528
- return column.filters.map((option, oIndex) => {
1529
- const optionValue = option.data;
1530
- return h(getOldComponent(renderOpts), Object.assign(Object.assign({ key: oIndex }, getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps })), getFilterOns(renderOpts, params, option)));
1531
- });
1532
- },
1533
- tableFilterDefaultMethod: handleFilterMethod,
1534
- tableExportMethod: handleExportSelectMethod
1441
+ renderTableCell(renderOpts, params) {
1442
+ const { row, column } = params;
1443
+ const cellValue = XEUtils.get(row, column.field);
1444
+ return h("i", {
1445
+ class: cellValue
1446
+ });
1447
+ }
1448
+ },
1449
+ VxeRadioGroup: {
1450
+ renderTableDefault: radioAndCheckboxGroupEditRender
1451
+ },
1452
+ VxeCheckbox: {
1453
+ renderTableDefault: checkboxEditRender
1454
+ },
1455
+ VxeCheckboxGroup: {
1456
+ renderTableDefault: radioAndCheckboxGroupEditRender
1457
+ },
1458
+ VxeSwitch: {
1459
+ tableAutoFocus: "button",
1460
+ renderTableEdit: defaultEditRender,
1461
+ renderTableDefault: defaultEditRender
1462
+ },
1463
+ VxeUpload: {
1464
+ renderTableEdit: defaultEditRender,
1465
+ renderTableCell: defaultEditRender,
1466
+ renderTableDefault: defaultEditRender
1467
+ },
1468
+ VxeImage: {
1469
+ renderTableDefault(renderOpts, params) {
1470
+ const { row, column } = params;
1471
+ const { props } = renderOpts;
1472
+ const cellValue = getCellValue(row, column);
1473
+ return [
1474
+ h(getDefaultComponent(renderOpts), {
1475
+ ...props,
1476
+ src: cellValue,
1477
+ ...getEditOns(renderOpts, params)
1478
+ })
1479
+ ];
1480
+ }
1481
+ },
1482
+ VxeImageGroup: {
1483
+ renderTableDefault(renderOpts, params) {
1484
+ const { row, column } = params;
1485
+ const { props } = renderOpts;
1486
+ const cellValue = getCellValue(row, column);
1487
+ return [
1488
+ h(getDefaultComponent(renderOpts), {
1489
+ ...props,
1490
+ urlList: cellValue,
1491
+ ...getEditOns(renderOpts, params)
1492
+ })
1493
+ ];
1494
+ }
1495
+ },
1496
+ VxeTextEllipsis: {
1497
+ renderTableDefault(renderOpts, params) {
1498
+ const { row, column } = params;
1499
+ const { props } = renderOpts;
1500
+ const cellValue = getCellValue(row, column);
1501
+ return [
1502
+ h(getDefaultComponent(renderOpts), {
1503
+ ...props,
1504
+ content: cellValue,
1505
+ ...getEditOns(renderOpts, params)
1506
+ })
1507
+ ];
1508
+ }
1509
+ },
1510
+ VxeRate: {
1511
+ renderTableDefault: defaultEditRender
1512
+ },
1513
+ VxeSlider: {
1514
+ renderTableDefault: defaultEditRender
1515
+ },
1516
+ // 以下已废弃
1517
+ $input: {
1518
+ tableAutoFocus: "input",
1519
+ renderTableEdit: oldEditRender,
1520
+ renderTableCell(renderOpts, params) {
1521
+ var _a;
1522
+ const { props = {} } = renderOpts;
1523
+ const { row, column } = params;
1524
+ const digits = props.digits || ((_a = getConfig().input) == null ? void 0 : _a.digits) || 2;
1525
+ let cellValue = XEUtils.get(row, column.field);
1526
+ if (cellValue) {
1527
+ switch (props.type) {
1528
+ case "date":
1529
+ case "week":
1530
+ case "month":
1531
+ case "year":
1532
+ cellValue = getLabelFormatDate(cellValue, props);
1533
+ break;
1534
+ case "float":
1535
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
1536
+ break;
1537
+ }
1538
+ }
1539
+ return getCellLabelVNs(renderOpts, params, cellValue);
1535
1540
  },
1536
- $radio: {
1537
- tableAutoFocus: 'input'
1541
+ renderTableDefault: oldEditRender,
1542
+ renderTableFilter: oldFilterRender,
1543
+ tableFilterDefaultMethod: handleInputFilterMethod
1544
+ },
1545
+ $textarea: {
1546
+ tableAutoFocus: "textarea"
1547
+ },
1548
+ $button: {
1549
+ renderTableDefault: oldButtonEditRender
1550
+ },
1551
+ $buttons: {
1552
+ renderTableDefault: oldButtonsEditRender
1553
+ },
1554
+ $select: {
1555
+ tableAutoFocus: "input",
1556
+ renderTableEdit: oldSelectEditRender,
1557
+ renderTableDefault: oldSelectEditRender,
1558
+ renderTableCell(renderOpts, params) {
1559
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
1538
1560
  },
1539
- $checkbox: {
1540
- tableAutoFocus: 'input'
1561
+ renderTableFilter(renderOpts, params) {
1562
+ const { column } = params;
1563
+ const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
1564
+ return column.filters.map((option, oIndex) => {
1565
+ const optionValue = option.data;
1566
+ return h(getOldComponent(renderOpts), {
1567
+ key: oIndex,
1568
+ ...getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
1569
+ ...getFilterOns(renderOpts, params, option)
1570
+ });
1571
+ });
1541
1572
  },
1542
- $switch: {
1543
- tableAutoFocus: 'button',
1544
- renderTableEdit: oldEditRender,
1545
- renderTableDefault: oldEditRender
1546
- }
1547
- // 以上已废弃
1573
+ tableFilterDefaultMethod: handleFilterMethod,
1574
+ tableExportMethod: handleExportSelectMethod
1575
+ },
1576
+ $radio: {
1577
+ tableAutoFocus: "input"
1578
+ },
1579
+ $checkbox: {
1580
+ tableAutoFocus: "input"
1581
+ },
1582
+ $switch: {
1583
+ tableAutoFocus: "button",
1584
+ renderTableEdit: oldEditRender,
1585
+ renderTableDefault: oldEditRender
1586
+ }
1587
+ // 以上已废弃
1548
1588
  });