vxe-table 4.23.5 → 4.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/dist/all.esm.js +32456 -33938
  2. package/dist/style.css +4501 -1
  3. package/dist/style.mini.css +1 -0
  4. package/es/colgroup/index.d.ts +760 -0
  5. package/es/colgroup/index.js +16 -13
  6. package/es/column/index.d.ts +760 -0
  7. package/es/column/index.js +16 -13
  8. package/es/components.d.ts +9 -0
  9. package/es/components.js +29 -29
  10. package/es/grid/index.d.ts +2824 -0
  11. package/es/grid/index.js +14 -9
  12. package/es/grid/src/emits.d.ts +2 -0
  13. package/es/grid/src/emits.js +18 -15
  14. package/es/grid/src/grid.d.ts +556 -0
  15. package/es/grid/src/grid.js +1695 -1758
  16. package/es/grid/src/props.d.ts +200 -0
  17. package/es/grid/src/props.js +19 -6
  18. package/es/{vxe-grid/style.min.css → grid/style.mini.css} +1 -1
  19. package/es/index.d.ts +3 -0
  20. package/es/index.esm.js +6 -3
  21. package/es/index.js +6 -0
  22. package/es/locale/lang/ar-EG.d.ts +908 -2
  23. package/es/locale/lang/ar-EG.js +906 -903
  24. package/es/locale/lang/de-DE.d.ts +908 -2
  25. package/es/locale/lang/de-DE.js +906 -903
  26. package/es/locale/lang/en-US.d.ts +908 -2
  27. package/es/locale/lang/en-US.js +906 -903
  28. package/es/locale/lang/es-ES.d.ts +908 -2
  29. package/es/locale/lang/es-ES.js +906 -903
  30. package/es/locale/lang/fr-FR.d.ts +908 -2
  31. package/es/locale/lang/fr-FR.js +906 -903
  32. package/es/locale/lang/hu-HU.d.ts +908 -2
  33. package/es/locale/lang/hu-HU.js +906 -903
  34. package/es/locale/lang/hy-AM.d.ts +908 -2
  35. package/es/locale/lang/hy-AM.js +906 -903
  36. package/es/locale/lang/id-ID.d.ts +908 -2
  37. package/es/locale/lang/id-ID.js +906 -903
  38. package/es/locale/lang/it-IT.d.ts +908 -2
  39. package/es/locale/lang/it-IT.js +906 -903
  40. package/es/locale/lang/ja-JP.d.ts +908 -2
  41. package/es/locale/lang/ja-JP.js +906 -903
  42. package/es/locale/lang/ko-KR.d.ts +908 -2
  43. package/es/locale/lang/ko-KR.js +906 -903
  44. package/es/locale/lang/ms-MY.d.ts +908 -2
  45. package/es/locale/lang/ms-MY.js +906 -903
  46. package/es/locale/lang/nb-NO.d.ts +908 -2
  47. package/es/locale/lang/nb-NO.js +906 -903
  48. package/es/locale/lang/pt-BR.d.ts +908 -2
  49. package/es/locale/lang/pt-BR.js +906 -903
  50. package/es/locale/lang/ru-RU.d.ts +908 -2
  51. package/es/locale/lang/ru-RU.js +906 -903
  52. package/es/locale/lang/th-TH.d.ts +908 -2
  53. package/es/locale/lang/th-TH.js +906 -903
  54. package/es/locale/lang/ug-CN.d.ts +908 -2
  55. package/es/locale/lang/ug-CN.js +906 -903
  56. package/es/locale/lang/uk-UA.d.ts +908 -2
  57. package/es/locale/lang/uk-UA.js +906 -903
  58. package/es/locale/lang/uz-UZ.d.ts +908 -2
  59. package/es/locale/lang/uz-UZ.js +906 -903
  60. package/es/locale/lang/vi-VN.d.ts +908 -2
  61. package/es/locale/lang/vi-VN.js +906 -903
  62. package/es/locale/lang/zh-CHT.d.ts +908 -2
  63. package/es/locale/lang/zh-CHT.js +906 -903
  64. package/es/locale/lang/zh-CN.d.ts +908 -2
  65. package/es/locale/lang/zh-CN.js +906 -903
  66. package/es/locale/lang/zh-HK.d.ts +908 -2
  67. package/es/locale/lang/zh-HK.js +910 -2
  68. package/es/locale/lang/zh-MO.d.ts +908 -2
  69. package/es/locale/lang/zh-MO.js +910 -2
  70. package/es/locale/lang/zh-TC.d.ts +908 -0
  71. package/es/locale/lang/zh-TC.js +910 -2
  72. package/es/locale/lang/zh-TW.d.ts +908 -2
  73. package/es/locale/lang/zh-TW.js +910 -2
  74. package/es/style.css +4501 -1
  75. package/es/style.mini.css +1 -0
  76. package/es/table/index.d.ts +2672 -0
  77. package/es/table/index.js +16 -11
  78. package/es/table/module/custom/hook.d.ts +1 -0
  79. package/es/table/module/custom/hook.js +462 -483
  80. package/es/table/module/custom/panel.d.ts +17 -0
  81. package/es/table/module/custom/panel.js +1482 -1559
  82. package/es/table/module/edit/hook.d.ts +1 -0
  83. package/es/table/module/edit/hook.js +1008 -1078
  84. package/es/table/module/export/export-panel.d.ts +27 -0
  85. package/es/table/module/export/export-panel.js +523 -575
  86. package/es/table/module/export/hook.d.ts +1 -0
  87. package/es/table/module/export/hook.js +1805 -1884
  88. package/es/table/module/export/import-panel.d.ts +27 -0
  89. package/es/table/module/export/import-panel.js +244 -252
  90. package/es/table/module/export/util.d.ts +5 -0
  91. package/es/table/module/export/util.js +20 -17
  92. package/es/table/module/filter/hook.d.ts +1 -0
  93. package/es/table/module/filter/hook.js +472 -487
  94. package/es/table/module/filter/panel.d.ts +16 -0
  95. package/es/table/module/filter/panel.js +251 -275
  96. package/es/table/module/keyboard/hook.d.ts +1 -0
  97. package/es/table/module/keyboard/hook.js +445 -497
  98. package/es/table/module/menu/hook.d.ts +1 -0
  99. package/es/table/module/menu/hook.js +295 -315
  100. package/es/table/module/menu/panel.d.ts +2 -0
  101. package/es/table/module/menu/panel.js +164 -183
  102. package/es/table/module/validator/hook.d.ts +1 -0
  103. package/es/table/module/validator/hook.js +522 -571
  104. package/es/table/render/index.d.ts +1 -0
  105. package/es/table/render/index.js +1402 -1362
  106. package/es/table/src/body.d.ts +24 -0
  107. package/es/table/src/body.js +850 -865
  108. package/es/table/src/cell.d.ts +192 -0
  109. package/es/table/src/cell.js +1209 -1207
  110. package/es/table/src/column.d.ts +263 -0
  111. package/es/table/src/column.js +178 -174
  112. package/es/table/src/columnInfo.d.ts +13 -0
  113. package/es/table/src/columnInfo.js +202 -196
  114. package/es/table/src/emits.d.ts +2 -0
  115. package/es/table/src/emits.js +126 -119
  116. package/es/table/src/footer.d.ts +45 -0
  117. package/es/table/src/footer.js +336 -340
  118. package/es/table/src/group.d.ts +178 -0
  119. package/es/table/src/group.js +49 -46
  120. package/es/table/src/header.d.ts +26 -0
  121. package/es/table/src/header.js +517 -519
  122. package/es/table/src/props.d.ts +238 -0
  123. package/es/table/src/props.js +331 -328
  124. package/es/table/src/store.d.ts +6 -0
  125. package/es/table/src/store.js +9 -6
  126. package/es/table/src/table.d.ts +539 -0
  127. package/es/table/src/table.js +14061 -15071
  128. package/es/table/src/use/cell-view.d.ts +10 -0
  129. package/es/table/src/use/cell-view.js +36 -33
  130. package/es/table/src/use/index.d.ts +1 -0
  131. package/es/table/src/use/index.js +1 -1
  132. package/es/table/src/util.d.ts +74 -0
  133. package/es/table/src/util.js +1038 -1026
  134. package/es/table/style.css +1 -1
  135. package/es/table/style.mini.css +1 -0
  136. package/es/toolbar/index.d.ts +340 -0
  137. package/es/toolbar/index.js +14 -9
  138. package/es/toolbar/src/toolbar.d.ts +75 -0
  139. package/es/toolbar/src/toolbar.js +605 -613
  140. package/es/toolbar/{style.min.css → style.mini.css} +1 -1
  141. package/es/ui/index.d.ts +86 -0
  142. package/es/ui/index.js +457 -501
  143. package/es/ui/src/anime.d.ts +10 -0
  144. package/es/ui/src/anime.js +40 -40
  145. package/es/ui/src/comp.d.ts +2 -0
  146. package/es/ui/src/comp.js +5 -2
  147. package/es/ui/src/dom.d.ts +80 -0
  148. package/es/ui/src/dom.js +377 -380
  149. package/es/ui/src/log.d.ts +6 -0
  150. package/es/ui/src/log.js +18 -13
  151. package/es/ui/src/utils.d.ts +23 -0
  152. package/es/ui/src/utils.js +57 -53
  153. package/es/ui/src/vn.d.ts +7 -0
  154. package/es/ui/src/vn.js +49 -42
  155. package/es/v-x-e-table/index.d.ts +3 -0
  156. package/es/v-x-e-table/index.js +6 -3
  157. package/es/vxe-colgroup/index.d.ts +3 -0
  158. package/es/vxe-colgroup/index.js +6 -3
  159. package/es/vxe-column/index.d.ts +3 -0
  160. package/es/vxe-column/index.js +6 -3
  161. package/es/vxe-grid/index.d.ts +3 -0
  162. package/es/vxe-grid/index.js +6 -3
  163. package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
  164. package/es/vxe-table/index.d.ts +3 -0
  165. package/es/vxe-table/index.js +6 -3
  166. package/es/vxe-table/style.css +1 -1
  167. package/es/vxe-table/style.mini.css +1 -0
  168. package/es/vxe-toolbar/index.d.ts +3 -0
  169. package/es/vxe-toolbar/index.js +6 -3
  170. package/es/vxe-toolbar/{style.min.css → style.mini.css} +1 -1
  171. package/es/vxe-ui/index.d.ts +3 -0
  172. package/es/vxe-ui/index.js +6 -3
  173. package/lib/colgroup/index.js +44 -18
  174. package/lib/colgroup/style/index.js +1 -1
  175. package/lib/column/index.js +44 -18
  176. package/lib/column/style/index.js +1 -1
  177. package/lib/components.js +58 -92
  178. package/lib/grid/index.js +42 -14
  179. package/lib/grid/src/emits.js +37 -6
  180. package/lib/grid/src/grid.js +850 -1195
  181. package/lib/grid/src/props.js +27 -11
  182. package/lib/grid/style/index.js +1 -1
  183. package/lib/{vxe-grid/style/style.min.css → grid/style/style.mini.css} +1 -1
  184. package/lib/iconfont.1792979665397.ttf +0 -0
  185. package/lib/iconfont.1792979665397.woff +0 -0
  186. package/lib/iconfont.1792979665397.woff2 +0 -0
  187. package/lib/index.common.js +35 -19
  188. package/lib/index.js +37 -0
  189. package/lib/index.umd.js +30584 -24324
  190. package/lib/index.umd.min.js +3 -1
  191. package/lib/locale/ar-EG.umd.js +948 -0
  192. package/lib/locale/de-DE.umd.js +948 -0
  193. package/lib/locale/en-US.umd.js +948 -0
  194. package/lib/locale/es-ES.umd.js +948 -0
  195. package/lib/locale/fr-FR.umd.js +948 -0
  196. package/lib/locale/hu-HU.umd.js +948 -0
  197. package/lib/locale/hy-AM.umd.js +948 -0
  198. package/lib/locale/id-ID.umd.js +948 -0
  199. package/lib/locale/it-IT.umd.js +948 -0
  200. package/lib/locale/ja-JP.umd.js +948 -0
  201. package/lib/locale/ko-KR.umd.js +948 -0
  202. package/lib/locale/lang/ar-EG.js +681 -664
  203. package/lib/locale/lang/ar-EG.umd.js +913 -892
  204. package/lib/locale/lang/de-DE.js +681 -664
  205. package/lib/locale/lang/de-DE.umd.js +913 -892
  206. package/lib/locale/lang/en-US.js +678 -661
  207. package/lib/locale/lang/en-US.umd.js +913 -892
  208. package/lib/locale/lang/es-ES.js +681 -664
  209. package/lib/locale/lang/es-ES.umd.js +913 -892
  210. package/lib/locale/lang/fr-FR.js +654 -637
  211. package/lib/locale/lang/fr-FR.umd.js +913 -892
  212. package/lib/locale/lang/hu-HU.js +681 -664
  213. package/lib/locale/lang/hu-HU.umd.js +913 -892
  214. package/lib/locale/lang/hy-AM.js +681 -664
  215. package/lib/locale/lang/hy-AM.umd.js +913 -892
  216. package/lib/locale/lang/id-ID.js +681 -664
  217. package/lib/locale/lang/id-ID.umd.js +913 -892
  218. package/lib/locale/lang/it-IT.js +661 -644
  219. package/lib/locale/lang/it-IT.umd.js +912 -891
  220. package/lib/locale/lang/ja-JP.js +710 -693
  221. package/lib/locale/lang/ja-JP.umd.js +913 -892
  222. package/lib/locale/lang/ko-KR.js +681 -664
  223. package/lib/locale/lang/ko-KR.umd.js +913 -892
  224. package/lib/locale/lang/ms-MY.js +681 -664
  225. package/lib/locale/lang/ms-MY.umd.js +913 -892
  226. package/lib/locale/lang/nb-NO.js +681 -664
  227. package/lib/locale/lang/nb-NO.umd.js +913 -892
  228. package/lib/locale/lang/pt-BR.js +681 -664
  229. package/lib/locale/lang/pt-BR.umd.js +913 -892
  230. package/lib/locale/lang/ru-RU.js +690 -673
  231. package/lib/locale/lang/ru-RU.umd.js +913 -892
  232. package/lib/locale/lang/th-TH.js +681 -664
  233. package/lib/locale/lang/th-TH.umd.js +913 -892
  234. package/lib/locale/lang/ug-CN.js +681 -664
  235. package/lib/locale/lang/ug-CN.umd.js +913 -892
  236. package/lib/locale/lang/uk-UA.js +674 -657
  237. package/lib/locale/lang/uk-UA.umd.js +913 -892
  238. package/lib/locale/lang/uz-UZ.js +583 -566
  239. package/lib/locale/lang/uz-UZ.umd.js +908 -887
  240. package/lib/locale/lang/vi-VN.js +681 -664
  241. package/lib/locale/lang/vi-VN.umd.js +913 -892
  242. package/lib/locale/lang/zh-CHT.js +681 -664
  243. package/lib/locale/lang/zh-CHT.umd.js +913 -892
  244. package/lib/locale/lang/zh-CN.js +681 -664
  245. package/lib/locale/lang/zh-CN.umd.js +913 -892
  246. package/lib/locale/lang/zh-HK.js +928 -7
  247. package/lib/locale/lang/zh-HK.umd.js +945 -20
  248. package/lib/locale/lang/zh-MO.js +928 -7
  249. package/lib/locale/lang/zh-MO.umd.js +945 -20
  250. package/lib/locale/lang/zh-TC.js +928 -7
  251. package/lib/locale/lang/zh-TC.umd.js +948 -0
  252. package/lib/locale/lang/zh-TW.js +928 -7
  253. package/lib/locale/lang/zh-TW.umd.js +945 -20
  254. package/lib/locale/ms-MY.umd.js +948 -0
  255. package/lib/locale/nb-NO.umd.js +948 -0
  256. package/lib/locale/pt-BR.umd.js +948 -0
  257. package/lib/locale/ru-RU.umd.js +948 -0
  258. package/lib/locale/th-TH.umd.js +948 -0
  259. package/lib/locale/ug-CN.umd.js +948 -0
  260. package/lib/locale/uk-UA.umd.js +948 -0
  261. package/lib/locale/uz-UZ.umd.js +948 -0
  262. package/lib/locale/vi-VN.umd.js +948 -0
  263. package/lib/locale/zh-CHT.umd.js +948 -0
  264. package/lib/locale/zh-CN.umd.js +948 -0
  265. package/lib/locale/zh-HK.umd.js +948 -0
  266. package/lib/locale/zh-MO.umd.js +948 -0
  267. package/lib/locale/zh-TC.umd.js +948 -0
  268. package/lib/locale/zh-TW.umd.js +948 -0
  269. package/lib/style.css +4501 -1
  270. package/lib/style.mini.css +1 -0
  271. package/lib/table/index.js +45 -17
  272. package/lib/table/module/custom/hook.js +132 -252
  273. package/lib/table/module/custom/panel.js +919 -970
  274. package/lib/table/module/edit/hook.js +248 -618
  275. package/lib/table/module/export/export-panel.js +390 -347
  276. package/lib/table/module/export/hook.js +745 -1179
  277. package/lib/table/module/export/import-panel.js +170 -136
  278. package/lib/table/module/export/util.js +37 -14
  279. package/lib/table/module/filter/hook.js +127 -227
  280. package/lib/table/module/filter/panel.js +177 -208
  281. package/lib/table/module/keyboard/hook.js +93 -172
  282. package/lib/table/module/menu/hook.js +86 -165
  283. package/lib/table/module/menu/panel.js +176 -141
  284. package/lib/table/module/validator/hook.js +164 -271
  285. package/lib/table/render/index.js +700 -1147
  286. package/lib/table/src/body.js +426 -559
  287. package/lib/table/src/cell.js +619 -987
  288. package/lib/table/src/column.js +55 -30
  289. package/lib/table/src/columnInfo.js +88 -110
  290. package/lib/table/src/emits.js +145 -13
  291. package/lib/table/src/footer.js +181 -240
  292. package/lib/table/src/group.js +56 -34
  293. package/lib/table/src/header.js +292 -367
  294. package/lib/table/src/props.js +27 -12
  295. package/lib/table/src/store.js +25 -9
  296. package/lib/table/src/table.js +14179 -1023
  297. package/lib/table/src/use/cell-view.js +47 -37
  298. package/lib/table/src/use/index.js +17 -15
  299. package/lib/table/src/util.js +236 -337
  300. package/lib/table/style/index.js +1 -1
  301. package/lib/table/style/style.css +1 -1
  302. package/lib/table/style/style.mini.css +1 -0
  303. package/lib/toolbar/index.js +42 -14
  304. package/lib/toolbar/src/toolbar.js +271 -379
  305. package/lib/toolbar/style/index.js +1 -1
  306. package/lib/toolbar/style/{style.min.css → style.mini.css} +1 -1
  307. package/lib/ui/index.js +153 -195
  308. package/lib/ui/src/anime.js +49 -29
  309. package/lib/ui/src/comp.js +23 -6
  310. package/lib/ui/src/dom.js +114 -147
  311. package/lib/ui/src/log.js +34 -18
  312. package/lib/ui/src/utils.js +57 -45
  313. package/lib/ui/src/vn.js +60 -34
  314. package/lib/ui/style/index.js +1 -1
  315. package/lib/v-x-e-table/index.js +35 -19
  316. package/lib/vxe-colgroup/index.js +35 -19
  317. package/lib/vxe-colgroup/style/index.js +1 -1
  318. package/lib/vxe-column/index.js +35 -19
  319. package/lib/vxe-column/style/index.js +1 -1
  320. package/lib/vxe-grid/index.js +35 -19
  321. package/lib/vxe-grid/style/index.js +1 -1
  322. package/{es/grid/style.min.css → lib/vxe-grid/style/style.mini.css} +1 -1
  323. package/lib/vxe-table/index.js +35 -19
  324. package/lib/vxe-table/style/index.js +1 -1
  325. package/lib/vxe-table/style/style.css +1 -1
  326. package/lib/vxe-table/style/style.mini.css +1 -0
  327. package/lib/vxe-toolbar/index.js +35 -19
  328. package/lib/vxe-toolbar/style/index.js +1 -1
  329. package/lib/vxe-toolbar/style/{style.min.css → style.mini.css} +1 -1
  330. package/lib/vxe-ui/index.js +35 -19
  331. package/lib/vxe-ui/style/index.js +1 -1
  332. package/package.json +8 -4
  333. package/packages/locale/lang/zh-HK.ts +907 -3
  334. package/packages/locale/lang/zh-MO.ts +907 -3
  335. package/packages/locale/lang/zh-TC.ts +907 -3
  336. package/packages/locale/lang/zh-TW.ts +907 -3
  337. package/packages/ui/index.ts +1 -28
  338. package/dist/style.min.css +0 -1
  339. package/es/index.css +0 -1
  340. package/es/index.min.css +0 -1
  341. package/es/style.min.css +0 -1
  342. package/es/table/style.min.css +0 -1
  343. package/es/vxe-table/style.min.css +0 -1
  344. package/es/vxe-v-x-e-table/index.js +0 -3
  345. package/lib/colgroup/index.min.js +0 -1
  346. package/lib/column/index.min.js +0 -1
  347. package/lib/components.min.js +0 -1
  348. package/lib/grid/index.min.js +0 -1
  349. package/lib/grid/src/emits.min.js +0 -1
  350. package/lib/grid/src/grid.min.js +0 -1
  351. package/lib/grid/src/props.min.js +0 -1
  352. package/lib/index.css +0 -1
  353. package/lib/index.min.css +0 -1
  354. package/lib/locale/lang/ar-EG.d.ts +0 -2
  355. package/lib/locale/lang/ar-EG.min.js +0 -1
  356. package/lib/locale/lang/de-DE.d.ts +0 -2
  357. package/lib/locale/lang/de-DE.min.js +0 -1
  358. package/lib/locale/lang/en-US.d.ts +0 -2
  359. package/lib/locale/lang/en-US.min.js +0 -1
  360. package/lib/locale/lang/es-ES.d.ts +0 -2
  361. package/lib/locale/lang/es-ES.min.js +0 -1
  362. package/lib/locale/lang/fr-FR.d.ts +0 -2
  363. package/lib/locale/lang/fr-FR.min.js +0 -1
  364. package/lib/locale/lang/hu-HU.d.ts +0 -2
  365. package/lib/locale/lang/hu-HU.min.js +0 -1
  366. package/lib/locale/lang/hy-AM.d.ts +0 -2
  367. package/lib/locale/lang/hy-AM.min.js +0 -1
  368. package/lib/locale/lang/id-ID.d.ts +0 -2
  369. package/lib/locale/lang/id-ID.min.js +0 -1
  370. package/lib/locale/lang/it-IT.d.ts +0 -2
  371. package/lib/locale/lang/it-IT.min.js +0 -1
  372. package/lib/locale/lang/ja-JP.d.ts +0 -2
  373. package/lib/locale/lang/ja-JP.min.js +0 -1
  374. package/lib/locale/lang/ko-KR.d.ts +0 -2
  375. package/lib/locale/lang/ko-KR.min.js +0 -1
  376. package/lib/locale/lang/ms-MY.d.ts +0 -2
  377. package/lib/locale/lang/ms-MY.min.js +0 -1
  378. package/lib/locale/lang/nb-NO.d.ts +0 -2
  379. package/lib/locale/lang/nb-NO.min.js +0 -1
  380. package/lib/locale/lang/pt-BR.d.ts +0 -2
  381. package/lib/locale/lang/pt-BR.min.js +0 -1
  382. package/lib/locale/lang/ru-RU.d.ts +0 -2
  383. package/lib/locale/lang/ru-RU.min.js +0 -1
  384. package/lib/locale/lang/th-TH.d.ts +0 -2
  385. package/lib/locale/lang/th-TH.min.js +0 -1
  386. package/lib/locale/lang/ug-CN.d.ts +0 -2
  387. package/lib/locale/lang/ug-CN.min.js +0 -1
  388. package/lib/locale/lang/uk-UA.d.ts +0 -2
  389. package/lib/locale/lang/uk-UA.min.js +0 -1
  390. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  391. package/lib/locale/lang/uz-UZ.min.js +0 -1
  392. package/lib/locale/lang/vi-VN.d.ts +0 -2
  393. package/lib/locale/lang/vi-VN.min.js +0 -1
  394. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  395. package/lib/locale/lang/zh-CHT.min.js +0 -1
  396. package/lib/locale/lang/zh-CN.d.ts +0 -2
  397. package/lib/locale/lang/zh-CN.min.js +0 -1
  398. package/lib/locale/lang/zh-HK.d.ts +0 -2
  399. package/lib/locale/lang/zh-HK.min.js +0 -1
  400. package/lib/locale/lang/zh-MO.d.ts +0 -2
  401. package/lib/locale/lang/zh-MO.min.js +0 -1
  402. package/lib/locale/lang/zh-TC.min.js +0 -1
  403. package/lib/locale/lang/zh-TW.d.ts +0 -2
  404. package/lib/locale/lang/zh-TW.min.js +0 -1
  405. package/lib/style.min.css +0 -1
  406. package/lib/table/index.min.js +0 -1
  407. package/lib/table/module/custom/hook.min.js +0 -1
  408. package/lib/table/module/custom/panel.min.js +0 -1
  409. package/lib/table/module/edit/hook.min.js +0 -1
  410. package/lib/table/module/export/export-panel.min.js +0 -1
  411. package/lib/table/module/export/hook.min.js +0 -1
  412. package/lib/table/module/export/import-panel.min.js +0 -1
  413. package/lib/table/module/export/util.min.js +0 -1
  414. package/lib/table/module/filter/hook.min.js +0 -1
  415. package/lib/table/module/filter/panel.min.js +0 -1
  416. package/lib/table/module/keyboard/hook.min.js +0 -1
  417. package/lib/table/module/menu/hook.min.js +0 -1
  418. package/lib/table/module/menu/panel.min.js +0 -1
  419. package/lib/table/module/validator/hook.min.js +0 -1
  420. package/lib/table/render/index.min.js +0 -1
  421. package/lib/table/src/body.min.js +0 -1
  422. package/lib/table/src/cell.min.js +0 -1
  423. package/lib/table/src/column.min.js +0 -1
  424. package/lib/table/src/columnInfo.min.js +0 -1
  425. package/lib/table/src/emits.min.js +0 -1
  426. package/lib/table/src/footer.min.js +0 -1
  427. package/lib/table/src/group.min.js +0 -1
  428. package/lib/table/src/header.min.js +0 -1
  429. package/lib/table/src/props.min.js +0 -1
  430. package/lib/table/src/store.min.js +0 -1
  431. package/lib/table/src/table.min.js +0 -1
  432. package/lib/table/src/use/cell-view.min.js +0 -1
  433. package/lib/table/src/use/index.min.js +0 -1
  434. package/lib/table/src/util.min.js +0 -1
  435. package/lib/table/style/style.min.css +0 -1
  436. package/lib/toolbar/index.min.js +0 -1
  437. package/lib/toolbar/src/toolbar.min.js +0 -1
  438. package/lib/ui/index.min.js +0 -1
  439. package/lib/ui/src/anime.min.js +0 -1
  440. package/lib/ui/src/comp.min.js +0 -1
  441. package/lib/ui/src/dom.min.js +0 -1
  442. package/lib/ui/src/log.min.js +0 -1
  443. package/lib/ui/src/utils.min.js +0 -1
  444. package/lib/ui/src/vn.min.js +0 -1
  445. package/lib/ui/style/style.min.css +0 -0
  446. package/lib/v-x-e-table/index.min.js +0 -1
  447. package/lib/v-x-e-table/style/index.js +0 -1
  448. package/lib/v-x-e-table/style/style.css +0 -0
  449. package/lib/v-x-e-table/style/style.min.css +0 -0
  450. package/lib/vxe-colgroup/index.min.js +0 -1
  451. package/lib/vxe-colgroup/style/style.min.css +0 -0
  452. package/lib/vxe-column/index.min.js +0 -1
  453. package/lib/vxe-column/style/style.min.css +0 -0
  454. package/lib/vxe-grid/index.min.js +0 -1
  455. package/lib/vxe-table/index.min.js +0 -1
  456. package/lib/vxe-table/style/style.min.css +0 -1
  457. package/lib/vxe-toolbar/index.min.js +0 -1
  458. package/lib/vxe-ui/index.min.js +0 -1
  459. package/lib/vxe-ui/style/style.min.css +0 -0
  460. package/lib/vxe-v-x-e-table/index.js +0 -21
  461. package/lib/vxe-v-x-e-table/index.min.js +0 -1
  462. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  463. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  464. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
  465. /package/{es/iconfont.1792838769925.ttf → dist/iconfont.1792979665397.ttf} +0 -0
  466. /package/{es/iconfont.1792838769925.woff → dist/iconfont.1792979665397.woff} +0 -0
  467. /package/{es/iconfont.1792838769925.woff2 → dist/iconfont.1792979665397.woff2} +0 -0
  468. /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
  469. /package/es/column/{style.min.css → style.mini.css} +0 -0
  470. /package/{lib/iconfont.1792838769925.ttf → es/iconfont.1792979665397.ttf} +0 -0
  471. /package/{lib/iconfont.1792838769925.woff → es/iconfont.1792979665397.woff} +0 -0
  472. /package/{lib/iconfont.1792838769925.woff2 → es/iconfont.1792979665397.woff2} +0 -0
  473. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  474. /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
  475. /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
  476. /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
  477. /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
  478. /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
  479. /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
  480. /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
  481. /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
  482. /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
@@ -1,625 +1,617 @@
1
- import { h, ref, computed, inject, createCommentVNode, reactive, nextTick, onBeforeUnmount } from 'vue';
2
- import { defineVxeComponent } from '../../ui/src/comp';
3
- import XEUtils from 'xe-utils';
4
- import { VxeUI } from '../../ui';
5
- import { getSlotVNs } from '../../ui/src/vn';
6
- import { createComponentLog } from '../../ui/src/log';
7
- const { warnLog, errLog } = createComponentLog('toolbar');
1
+ import { h, ref, computed, inject, createCommentVNode, reactive, nextTick, onBeforeUnmount } from "vue";
2
+ import { defineVxeComponent } from "../../ui/src/comp";
3
+ import XEUtils from "xe-utils";
4
+ import { VxeUI } from "../../ui";
5
+ import { getSlotVNs } from "../../ui/src/vn";
6
+ import { createComponentLog } from "../../ui/src/log";
7
+ const { warnLog, errLog } = createComponentLog("toolbar");
8
8
  const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI;
9
9
  function createReactData() {
10
- return {
11
- isRefresh: false,
12
- connectFlag: 0,
13
- columns: []
14
- };
10
+ return {
11
+ isRefresh: false,
12
+ connectFlag: 0,
13
+ columns: []
14
+ };
15
15
  }
16
16
  function createInternalData() {
17
- return {
18
- connectTable: null
19
- };
17
+ return {
18
+ connectTable: null
19
+ };
20
20
  }
21
- export default defineVxeComponent({
22
- name: 'VxeToolbar',
23
- props: {
24
- loading: Boolean,
25
- refresh: [Boolean, Object],
26
- refreshOptions: Object,
27
- import: [Boolean, Object],
28
- importOptions: Object,
29
- export: [Boolean, Object],
30
- exportOptions: Object,
31
- print: [Boolean, Object],
32
- printOptions: Object,
33
- zoom: [Boolean, Object],
34
- zoomOptions: Object,
35
- custom: [Boolean, Object],
36
- customOptions: Object,
37
- buttons: {
38
- type: Array,
39
- default: () => getConfig().toolbar.buttons
40
- },
41
- tools: {
42
- type: Array,
43
- default: () => getConfig().toolbar.tools
44
- },
45
- perfect: {
46
- type: Boolean,
47
- default: () => getConfig().toolbar.perfect
48
- },
49
- size: {
50
- type: String,
51
- default: () => getConfig().toolbar.size || getConfig().size
52
- },
53
- className: [String, Function]
21
+ var toolbar_default = defineVxeComponent({
22
+ name: "VxeToolbar",
23
+ props: {
24
+ loading: Boolean,
25
+ refresh: [Boolean, Object],
26
+ refreshOptions: Object,
27
+ import: [Boolean, Object],
28
+ importOptions: Object,
29
+ export: [Boolean, Object],
30
+ exportOptions: Object,
31
+ print: [Boolean, Object],
32
+ printOptions: Object,
33
+ zoom: [Boolean, Object],
34
+ zoomOptions: Object,
35
+ custom: [Boolean, Object],
36
+ customOptions: Object,
37
+ buttons: {
38
+ type: Array,
39
+ default: () => getConfig().toolbar.buttons
54
40
  },
55
- emits: [
56
- 'button-click',
57
- 'tool-click'
58
- ],
59
- setup(props, context) {
60
- const { slots, emit } = context;
61
- const xID = XEUtils.uniqueId();
62
- // 使用已安装的组件,如果未安装则不渲染
63
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
64
- const $xeGrid = inject('$xeGrid', null);
65
- const $xeGantt = inject('$xeGantt', null);
66
- const $xeGGWrapper = $xeGrid || $xeGantt;
67
- const { computeSize } = useFns.useSize(props);
68
- const reactData = reactive(createReactData());
69
- const internalData = createInternalData();
70
- const refElem = ref();
71
- const refMaps = {
72
- refElem
73
- };
74
- const $xeToolbar = {
75
- xID,
76
- props,
77
- context,
78
- reactData,
79
- internalData,
80
- getRefMaps: () => refMaps
81
- };
82
- let toolbarMethods = {};
83
- const computeRefreshOpts = computed(() => {
84
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
85
- });
86
- const computeImportOpts = computed(() => {
87
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.importOptions, props.import);
88
- });
89
- const computeExportOpts = computed(() => {
90
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.exportOptions, props.export);
91
- });
92
- const computePrintOpts = computed(() => {
93
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.printOptions, props.print);
94
- });
95
- const computeZoomOpts = computed(() => {
96
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
97
- });
98
- const computeCustomOpts = computed(() => {
99
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom);
41
+ tools: {
42
+ type: Array,
43
+ default: () => getConfig().toolbar.tools
44
+ },
45
+ perfect: {
46
+ type: Boolean,
47
+ default: () => getConfig().toolbar.perfect
48
+ },
49
+ size: {
50
+ type: String,
51
+ default: () => getConfig().toolbar.size || getConfig().size
52
+ },
53
+ className: [String, Function]
54
+ },
55
+ emits: [
56
+ "button-click",
57
+ "tool-click"
58
+ ],
59
+ setup(props, context) {
60
+ const { slots, emit } = context;
61
+ const xID = XEUtils.uniqueId();
62
+ const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
63
+ const $xeGrid = inject("$xeGrid", null);
64
+ const $xeGantt = inject("$xeGantt", null);
65
+ const $xeGGWrapper = $xeGrid || $xeGantt;
66
+ const { computeSize } = useFns.useSize(props);
67
+ const reactData = reactive(createReactData());
68
+ const internalData = createInternalData();
69
+ const refElem = ref();
70
+ const refMaps = {
71
+ refElem
72
+ };
73
+ const $xeToolbar = {
74
+ xID,
75
+ props,
76
+ context,
77
+ reactData,
78
+ internalData,
79
+ getRefMaps: () => refMaps
80
+ };
81
+ let toolbarMethods = {};
82
+ const computeRefreshOpts = computed(() => {
83
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
84
+ });
85
+ const computeImportOpts = computed(() => {
86
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.importOptions, props.import);
87
+ });
88
+ const computeExportOpts = computed(() => {
89
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.exportOptions, props.export);
90
+ });
91
+ const computePrintOpts = computed(() => {
92
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.printOptions, props.print);
93
+ });
94
+ const computeZoomOpts = computed(() => {
95
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
96
+ });
97
+ const computeCustomOpts = computed(() => {
98
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom);
99
+ });
100
+ const computeTableCustomOpts = computed(() => {
101
+ const { connectTable } = internalData;
102
+ const $table = connectTable;
103
+ if (reactData.connectFlag || $table) {
104
+ if ($table) {
105
+ const { computeCustomOpts: computeCustomOpts2 } = $table.getComputeMaps();
106
+ return computeCustomOpts2.value;
107
+ }
108
+ }
109
+ return { trigger: "" };
110
+ });
111
+ const computeTrigger = computed(() => {
112
+ const tableCustomOpts = computeTableCustomOpts.value;
113
+ return tableCustomOpts.trigger;
114
+ });
115
+ const checkTable = () => {
116
+ const { connectTable } = internalData;
117
+ const $table = connectTable;
118
+ if ($table) {
119
+ return true;
120
+ }
121
+ errLog("vxe.error.barUnableLink");
122
+ };
123
+ const handleClickSettingEvent = ({ $event }) => {
124
+ const { connectTable } = internalData;
125
+ const $table = connectTable;
126
+ if ($table) {
127
+ if ($table.triggerCustomEvent) {
128
+ $table.triggerCustomEvent($event);
129
+ }
130
+ }
131
+ };
132
+ const handleMouseenterSettingEvent = ({ $event }) => {
133
+ const { connectTable } = internalData;
134
+ const $table = connectTable;
135
+ if ($table) {
136
+ $table.customOpenEvent($event);
137
+ }
138
+ };
139
+ const handleMouseleaveSettingEvent = ({ $event }) => {
140
+ const { connectTable } = internalData;
141
+ const $table = connectTable;
142
+ if ($table) {
143
+ const { customStore } = $table.reactData;
144
+ customStore.activeBtn = false;
145
+ setTimeout(() => {
146
+ if (!customStore.activeBtn && !customStore.activeWrapper) {
147
+ $table.customCloseEvent($event);
148
+ }
149
+ }, 350);
150
+ }
151
+ };
152
+ const refreshEvent = ({ $event }) => {
153
+ const { isRefresh } = reactData;
154
+ const refreshOpts = computeRefreshOpts.value;
155
+ if (!isRefresh) {
156
+ const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
157
+ if (queryMethod) {
158
+ reactData.isRefresh = true;
159
+ try {
160
+ Promise.resolve(queryMethod({})).catch((e) => e).then(() => {
161
+ reactData.isRefresh = false;
162
+ });
163
+ } catch (e) {
164
+ reactData.isRefresh = false;
165
+ }
166
+ } else if ($xeGGWrapper) {
167
+ reactData.isRefresh = true;
168
+ $xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || "reload" }, $event).catch(() => {
169
+ }).then(() => {
170
+ reactData.isRefresh = false;
171
+ });
172
+ }
173
+ }
174
+ };
175
+ const zoomEvent = ({ $event }) => {
176
+ if ($xeGGWrapper) {
177
+ $xeGGWrapper.triggerZoomEvent($event);
178
+ } else {
179
+ warnLog("vxe.error.notProp", ["zoom"]);
180
+ }
181
+ };
182
+ const importEvent = () => {
183
+ if (checkTable()) {
184
+ const { connectTable } = internalData;
185
+ const $table = connectTable;
186
+ if ($table) {
187
+ $table.importData();
188
+ }
189
+ }
190
+ };
191
+ const openImportEvent = () => {
192
+ if (checkTable()) {
193
+ const { connectTable } = internalData;
194
+ const $table = connectTable;
195
+ if ($table) {
196
+ $table.openImport();
197
+ }
198
+ }
199
+ };
200
+ const exportEvent = () => {
201
+ if (checkTable()) {
202
+ const { connectTable } = internalData;
203
+ const $table = connectTable;
204
+ if ($table) {
205
+ $table.exportData();
206
+ }
207
+ }
208
+ };
209
+ const openExportEvent = () => {
210
+ if (checkTable()) {
211
+ const { connectTable } = internalData;
212
+ const $table = connectTable;
213
+ if ($table) {
214
+ $table.openExport();
215
+ }
216
+ }
217
+ };
218
+ const printEvent = () => {
219
+ if (checkTable()) {
220
+ const { connectTable } = internalData;
221
+ const $table = connectTable;
222
+ if ($table) {
223
+ $table.print();
224
+ }
225
+ }
226
+ };
227
+ const openPrintEvent = () => {
228
+ if (checkTable()) {
229
+ const { connectTable } = internalData;
230
+ const $table = connectTable;
231
+ if ($table) {
232
+ $table.openPrint();
233
+ }
234
+ }
235
+ };
236
+ const handleDefaultCodeEvent = (eventParams, item, cb) => {
237
+ switch (item.code) {
238
+ case "print":
239
+ printEvent();
240
+ break;
241
+ case "open_print":
242
+ openPrintEvent();
243
+ break;
244
+ case "custom":
245
+ handleClickSettingEvent(eventParams);
246
+ break;
247
+ case "export":
248
+ exportEvent();
249
+ break;
250
+ case "open_export":
251
+ openExportEvent();
252
+ break;
253
+ case "import":
254
+ importEvent();
255
+ break;
256
+ case "open_import":
257
+ openImportEvent();
258
+ break;
259
+ case "zoom":
260
+ zoomEvent(eventParams);
261
+ break;
262
+ case "refresh":
263
+ refreshEvent(eventParams);
264
+ break;
265
+ default:
266
+ cb();
267
+ break;
268
+ }
269
+ };
270
+ const btnEvent = (eventParams, item) => {
271
+ const { $event } = eventParams;
272
+ const { connectTable } = internalData;
273
+ const $table = connectTable;
274
+ const { code } = item;
275
+ if (code) {
276
+ handleDefaultCodeEvent(eventParams, item, () => {
277
+ if ($xeGGWrapper) {
278
+ $xeGGWrapper.triggerToolbarBtnEvent(item, $event);
279
+ } else {
280
+ const gCommandOpts = commands.get(code);
281
+ const params = { code, button: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
282
+ if (gCommandOpts) {
283
+ const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
284
+ if (tCommandMethod) {
285
+ tCommandMethod(params);
286
+ } else {
287
+ errLog("vxe.error.notCommands", [code]);
288
+ }
289
+ }
290
+ $xeToolbar.dispatchEvent("button-click", params, $event);
291
+ }
100
292
  });
101
- const computeTableCustomOpts = computed(() => {
102
- const { connectTable } = internalData;
103
- const $table = connectTable;
104
- if (reactData.connectFlag || $table) {
105
- if ($table) {
106
- const { computeCustomOpts } = $table.getComputeMaps();
107
- return computeCustomOpts.value;
108
- }
109
- }
110
- return { trigger: '' };
293
+ }
294
+ };
295
+ const tolEvent = (eventParams, item) => {
296
+ const { $event } = eventParams;
297
+ const { connectTable } = internalData;
298
+ const $table = connectTable;
299
+ const { code } = item;
300
+ if (code) {
301
+ handleDefaultCodeEvent(eventParams, item, () => {
302
+ if ($xeGGWrapper) {
303
+ $xeGGWrapper.triggerToolbarTolEvent(item, $event);
304
+ } else {
305
+ const gCommandOpts = commands.get(code);
306
+ const params = { code, button: null, tool: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
307
+ if (gCommandOpts) {
308
+ const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
309
+ if (tCommandMethod) {
310
+ tCommandMethod(params);
311
+ } else {
312
+ errLog("vxe.error.notCommands", [code]);
313
+ }
314
+ }
315
+ $xeToolbar.dispatchEvent("tool-click", params, $event);
316
+ }
111
317
  });
112
- const computeTrigger = computed(() => {
113
- const tableCustomOpts = computeTableCustomOpts.value;
114
- return tableCustomOpts.trigger;
318
+ }
319
+ };
320
+ const dispatchEvent = (type, params, evnt) => {
321
+ emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params));
322
+ };
323
+ toolbarMethods = {
324
+ dispatchEvent,
325
+ syncUpdate(params) {
326
+ internalData.connectTable = params.$table;
327
+ reactData.columns = params.collectColumn;
328
+ reactData.connectFlag++;
329
+ }
330
+ };
331
+ Object.assign($xeToolbar, toolbarMethods);
332
+ const renderDropdowns = (item, isBtn) => {
333
+ const { dropdowns } = item;
334
+ const downVNs = [];
335
+ if (dropdowns) {
336
+ return dropdowns.map((child, index) => {
337
+ if (child.visible === false) {
338
+ return createCommentVNode();
339
+ }
340
+ return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
341
+ key: index,
342
+ ...Object.assign({}, child, {
343
+ content: child.content || child.name,
344
+ options: void 0
345
+ }),
346
+ onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
347
+ }) : createCommentVNode();
115
348
  });
116
- const checkTable = () => {
117
- const { connectTable } = internalData;
118
- const $table = connectTable;
119
- if ($table) {
120
- return true;
121
- }
122
- errLog('vxe.error.barUnableLink');
123
- };
124
- const handleClickSettingEvent = ({ $event }) => {
125
- const { connectTable } = internalData;
126
- const $table = connectTable;
127
- if ($table) {
128
- if ($table.triggerCustomEvent) {
129
- $table.triggerCustomEvent($event);
130
- }
131
- }
132
- };
133
- const handleMouseenterSettingEvent = ({ $event }) => {
134
- const { connectTable } = internalData;
135
- const $table = connectTable;
136
- if ($table) {
137
- $table.customOpenEvent($event);
138
- }
139
- };
140
- const handleMouseleaveSettingEvent = ({ $event }) => {
141
- const { connectTable } = internalData;
142
- const $table = connectTable;
143
- if ($table) {
144
- const { customStore } = $table.reactData;
145
- customStore.activeBtn = false;
146
- setTimeout(() => {
147
- if (!customStore.activeBtn && !customStore.activeWrapper) {
148
- $table.customCloseEvent($event);
149
- }
150
- }, 350);
151
- }
152
- };
153
- const refreshEvent = ({ $event }) => {
154
- const { isRefresh } = reactData;
155
- const refreshOpts = computeRefreshOpts.value;
156
- if (!isRefresh) {
157
- const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
158
- if (queryMethod) {
159
- reactData.isRefresh = true;
160
- try {
161
- Promise.resolve(queryMethod({})).catch((e) => e).then(() => {
162
- reactData.isRefresh = false;
163
- });
164
- }
165
- catch (e) {
166
- reactData.isRefresh = false;
167
- }
168
- }
169
- else if ($xeGGWrapper) {
170
- reactData.isRefresh = true;
171
- $xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch(() => { }).then(() => {
172
- reactData.isRefresh = false;
173
- });
174
- }
175
- }
176
- };
177
- const zoomEvent = ({ $event }) => {
178
- if ($xeGGWrapper) {
179
- $xeGGWrapper.triggerZoomEvent($event);
180
- }
181
- else {
182
- warnLog('vxe.error.notProp', ['zoom']);
183
- }
184
- };
185
- const importEvent = () => {
186
- if (checkTable()) {
187
- const { connectTable } = internalData;
188
- const $table = connectTable;
189
- if ($table) {
190
- $table.importData();
191
- }
192
- }
193
- };
194
- const openImportEvent = () => {
195
- if (checkTable()) {
196
- const { connectTable } = internalData;
197
- const $table = connectTable;
198
- if ($table) {
199
- $table.openImport();
200
- }
201
- }
202
- };
203
- const exportEvent = () => {
204
- if (checkTable()) {
205
- const { connectTable } = internalData;
206
- const $table = connectTable;
207
- if ($table) {
208
- $table.exportData();
209
- }
210
- }
211
- };
212
- const openExportEvent = () => {
213
- if (checkTable()) {
214
- const { connectTable } = internalData;
215
- const $table = connectTable;
216
- if ($table) {
217
- $table.openExport();
218
- }
219
- }
220
- };
221
- const printEvent = () => {
222
- if (checkTable()) {
223
- const { connectTable } = internalData;
224
- const $table = connectTable;
225
- if ($table) {
226
- $table.print();
227
- }
228
- }
229
- };
230
- const openPrintEvent = () => {
231
- if (checkTable()) {
232
- const { connectTable } = internalData;
233
- const $table = connectTable;
234
- if ($table) {
235
- $table.openPrint();
236
- }
237
- }
238
- };
239
- const handleDefaultCodeEvent = (eventParams, item, cb) => {
240
- switch (item.code) {
241
- case 'print':
242
- printEvent();
243
- break;
244
- case 'open_print':
245
- openPrintEvent();
246
- break;
247
- case 'custom':
248
- handleClickSettingEvent(eventParams);
249
- break;
250
- case 'export':
251
- exportEvent();
252
- break;
253
- case 'open_export':
254
- openExportEvent();
255
- break;
256
- case 'import':
257
- importEvent();
258
- break;
259
- case 'open_import':
260
- openImportEvent();
261
- break;
262
- case 'zoom':
263
- zoomEvent(eventParams);
264
- break;
265
- case 'refresh':
266
- refreshEvent(eventParams);
267
- break;
268
- default:
269
- cb();
270
- break;
271
- }
272
- };
273
- const btnEvent = (eventParams, item) => {
274
- const { $event } = eventParams;
275
- const { connectTable } = internalData;
276
- const $table = connectTable;
277
- const { code } = item;
278
- if (code) {
279
- handleDefaultCodeEvent(eventParams, item, () => {
280
- if ($xeGGWrapper) {
281
- $xeGGWrapper.triggerToolbarBtnEvent(item, $event);
282
- }
283
- else {
284
- const gCommandOpts = commands.get(code);
285
- const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
286
- if (gCommandOpts) {
287
- const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
288
- if (tCommandMethod) {
289
- tCommandMethod(params);
290
- }
291
- else {
292
- errLog('vxe.error.notCommands', [code]);
293
- }
294
- }
295
- $xeToolbar.dispatchEvent('button-click', params, $event);
296
- }
297
- });
298
- }
299
- };
300
- const tolEvent = (eventParams, item) => {
301
- const { $event } = eventParams;
302
- const { connectTable } = internalData;
303
- const $table = connectTable;
304
- const { code } = item;
305
- if (code) {
306
- handleDefaultCodeEvent(eventParams, item, () => {
307
- if ($xeGGWrapper) {
308
- $xeGGWrapper.triggerToolbarTolEvent(item, $event);
309
- }
310
- else {
311
- const gCommandOpts = commands.get(code);
312
- const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
313
- if (gCommandOpts) {
314
- const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
315
- if (tCommandMethod) {
316
- tCommandMethod(params);
317
- }
318
- else {
319
- errLog('vxe.error.notCommands', [code]);
320
- }
321
- }
322
- $xeToolbar.dispatchEvent('tool-click', params, $event);
323
- }
324
- });
325
- }
326
- };
327
- const dispatchEvent = (type, params, evnt) => {
328
- emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params));
329
- };
330
- toolbarMethods = {
331
- dispatchEvent,
332
- syncUpdate(params) {
333
- internalData.connectTable = params.$table;
334
- reactData.columns = params.collectColumn;
335
- reactData.connectFlag++;
336
- }
337
- };
338
- Object.assign($xeToolbar, toolbarMethods);
339
- const renderDropdowns = (item, isBtn) => {
340
- const { dropdowns } = item;
341
- const downVNs = [];
342
- if (dropdowns) {
343
- return dropdowns.map((child, index) => {
344
- if (child.visible === false) {
345
- return createCommentVNode();
346
- }
347
- return VxeUIButtonComponent
348
- ? h(VxeUIButtonComponent, Object.assign(Object.assign({ key: index }, Object.assign({}, child, {
349
- content: child.content || child.name,
350
- options: undefined
351
- })), { onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child) }))
352
- : createCommentVNode();
353
- });
354
- }
355
- return downVNs;
356
- };
357
- /**
358
- * 渲染按钮
359
- */
360
- const renderLeftBtns = () => {
361
- const { buttons } = props;
362
- const { connectTable } = internalData;
363
- const $table = connectTable;
364
- const buttonsSlot = slots.buttons;
365
- const buttonPrefixSlot = slots.buttonPrefix || slots['button-prefix'];
366
- const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
367
- const btnVNs = [];
368
- if (buttons) {
369
- const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
370
- const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
371
- buttons.forEach((item, index) => {
372
- const { dropdowns, buttonRender } = item;
373
- if (item.visible !== false) {
374
- const compConf = buttonRender && buttonRender.name ? (rendererOpts[buttonRender.name] || renderer.get(buttonRender.name)) : null;
375
- if (buttonRender && compConf && compConf.renderToolbarButton) {
376
- const toolbarButtonClassName = compConf.toolbarButtonClassName;
377
- const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
378
- btnVNs.push(h('span', {
379
- key: `br${item.code || index}`,
380
- class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
381
- }, getSlotVNs(compConf.renderToolbarButton(buttonRender, params))));
382
- }
383
- else {
384
- if (VxeUIButtonComponent) {
385
- btnVNs.push(h(VxeUIButtonComponent, Object.assign(Object.assign({ key: `bd${item.code || index}` }, Object.assign({}, item, {
386
- content: item.content || item.name,
387
- options: undefined
388
- })), { onClick: (eventParams) => btnEvent(eventParams, item) }), dropdowns && dropdowns.length
389
- ? {
390
- dropdowns: () => renderDropdowns(item, true)
391
- }
392
- : {}));
393
- }
394
- }
395
- }
396
- });
397
- }
398
- return [
399
- h('div', {
400
- class: 'vxe-button--prefix-wrapper'
401
- }, buttonPrefixSlot ? getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : []),
402
- h('div', {
403
- class: 'vxe-button--item-wrapper'
404
- }, buttonsSlot ? getSlotVNs(buttonsSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs),
405
- h('div', {
406
- class: 'vxe-button--suffix-wrapper'
407
- }, buttonSuffixSlot ? getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : [])
408
- ];
409
- };
410
- /**
411
- * 渲染右侧工具
412
- */
413
- const renderRightTools = () => {
414
- const { tools } = props;
415
- const { connectTable } = internalData;
416
- const $table = connectTable;
417
- const toolsSlot = slots.tools;
418
- const toolPrefixSlot = slots.toolPrefix || slots['tool-prefix'];
419
- const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
420
- const btnVNs = [];
421
- if (tools) {
422
- const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
423
- const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
424
- tools.forEach((item, tIndex) => {
425
- const { dropdowns, toolRender } = item;
426
- if (item.visible !== false) {
427
- const compConf = toolRender && toolRender.name ? (rendererOpts[toolRender.name] || renderer.get(toolRender.name)) : null;
428
- if (toolRender && compConf && compConf.renderToolbarTool) {
429
- const toolbarToolClassName = compConf.toolbarToolClassName;
430
- const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
431
- btnVNs.push(h('span', {
432
- key: tIndex,
433
- class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
434
- }, getSlotVNs(compConf.renderToolbarTool(toolRender, params))));
435
- }
436
- else {
437
- if (VxeUIButtonComponent) {
438
- btnVNs.push(h(VxeUIButtonComponent, Object.assign(Object.assign({ key: tIndex }, Object.assign({}, item, {
439
- content: item.content || item.name,
440
- options: undefined
441
- })), { onClick: (eventParams) => tolEvent(eventParams, item) }), dropdowns && dropdowns.length
442
- ? {
443
- dropdowns: () => renderDropdowns(item, false)
444
- }
445
- : {}));
446
- }
447
- }
448
- }
449
- });
450
- }
451
- return [
452
- h('div', {
453
- class: 'vxe-tool--prefix-wrapper'
454
- }, toolPrefixSlot ? getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : []),
455
- h('div', {
456
- class: 'vxe-tool--item-wrapper'
457
- }, toolsSlot ? getSlotVNs(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs),
458
- h('div', {
459
- class: 'vxe-tool--suffix-wrapper'
460
- }, toolSuffixSlot ? getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : [])
461
- ];
462
- };
463
- const renderToolImport = () => {
464
- const importOpts = computeImportOpts.value;
465
- return VxeUIButtonComponent
466
- ? h(VxeUIButtonComponent, {
467
- key: 'import',
468
- circle: true,
469
- icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
470
- title: getI18n('vxe.toolbar.import'),
471
- onClick: openImportEvent
472
- })
473
- : createCommentVNode();
474
- };
475
- const renderToolExport = () => {
476
- const exportOpts = computeExportOpts.value;
477
- return VxeUIButtonComponent
478
- ? h(VxeUIButtonComponent, {
479
- key: 'export',
480
- circle: true,
481
- icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
482
- title: getI18n('vxe.toolbar.export'),
483
- onClick: openExportEvent
484
- })
485
- : createCommentVNode();
486
- };
487
- const renderToolPrint = () => {
488
- const printOpts = computePrintOpts.value;
489
- return VxeUIButtonComponent
490
- ? h(VxeUIButtonComponent, {
491
- key: 'print',
492
- circle: true,
493
- icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
494
- title: getI18n('vxe.toolbar.print'),
495
- onClick: openPrintEvent
496
- })
497
- : createCommentVNode();
498
- };
499
- const renderToolRefresh = () => {
500
- const refreshOpts = computeRefreshOpts.value;
501
- return VxeUIButtonComponent
502
- ? h(VxeUIButtonComponent, {
503
- key: 'refresh',
504
- circle: true,
505
- icon: reactData.isRefresh ? (refreshOpts.iconLoading || getIcon().TOOLBAR_TOOLS_REFRESH_LOADING) : (refreshOpts.icon || getIcon().TOOLBAR_TOOLS_REFRESH),
506
- title: getI18n('vxe.toolbar.refresh'),
507
- onClick: refreshEvent
508
- })
509
- : createCommentVNode();
510
- };
511
- const renderToolZoom = () => {
512
- const zoomOpts = computeZoomOpts.value;
513
- return $xeGGWrapper && VxeUIButtonComponent
514
- ? h(VxeUIButtonComponent, {
515
- key: 'zoom',
516
- circle: true,
517
- icon: $xeGGWrapper.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
518
- title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? 'Out' : 'In'}`),
519
- onClick: zoomEvent
520
- })
521
- : createCommentVNode();
522
- };
523
- const renderToolCustom = () => {
524
- const customOpts = computeCustomOpts.value;
525
- const btnTrigger = computeTrigger.value;
526
- const customBtnOns = {};
527
- if (btnTrigger === 'manual') {
528
- // 手动触发
529
- }
530
- else if (btnTrigger === 'hover') {
531
- // hover 触发
532
- customBtnOns.onMouseenter = handleMouseenterSettingEvent;
533
- customBtnOns.onMouseleave = handleMouseleaveSettingEvent;
534
- }
535
- else {
536
- // 点击触发
537
- customBtnOns.onClick = handleClickSettingEvent;
538
- }
539
- return VxeUIButtonComponent
540
- ? h(VxeUIButtonComponent, Object.assign({ key: 'custom', circle: true, icon: customOpts.icon || getIcon().TOOLBAR_TOOLS_CUSTOM, title: getI18n('vxe.toolbar.custom'), className: 'vxe-toolbar-custom-target' }, customBtnOns))
541
- : createCommentVNode();
542
- };
543
- const renderVN = () => {
544
- const { perfect, loading, refresh, zoom, custom, className } = props;
545
- const vSize = computeSize.value;
546
- return h('div', {
547
- ref: refElem,
548
- class: ['vxe-toolbar', className ? (XEUtils.isFunction(className) ? className({ $toolbar: $xeToolbar }) : className) : '', {
549
- [`size--${vSize}`]: vSize,
550
- 'is--perfect': perfect,
551
- 'is--loading': loading
552
- }]
553
- }, [
554
- h('div', {
555
- class: 'vxe-buttons--wrapper'
556
- }, renderLeftBtns()),
557
- h('div', {
558
- class: 'vxe-tools--wrapper'
559
- }, renderRightTools()),
560
- h('div', {
561
- class: 'vxe-tools--operate'
562
- }, [
563
- props.import ? renderToolImport() : createCommentVNode(),
564
- props.export ? renderToolExport() : createCommentVNode(),
565
- props.print ? renderToolPrint() : createCommentVNode(),
566
- refresh ? renderToolRefresh() : createCommentVNode(),
567
- zoom && $xeGGWrapper ? renderToolZoom() : createCommentVNode(),
568
- custom ? renderToolCustom() : createCommentVNode()
569
- ])
570
- ]);
571
- };
572
- $xeToolbar.renderVN = renderVN;
573
- nextTick(() => {
574
- const refreshOpts = computeRefreshOpts.value;
575
- const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
576
- if (props.refresh && !$xeGGWrapper && !queryMethod) {
577
- warnLog('vxe.error.notFunc', ['queryMethod']);
578
- }
579
- if (XEUtils.isPlainObject(props.custom)) {
580
- warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}']);
581
- }
582
- if (XEUtils.isPlainObject(props.print)) {
583
- warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}']);
584
- }
585
- if (XEUtils.isPlainObject(props.export)) {
586
- warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}']);
587
- }
588
- if (XEUtils.isPlainObject(props.import)) {
589
- warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}']);
590
- }
591
- if (XEUtils.isPlainObject(props.refresh)) {
592
- warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}']);
593
- }
594
- if (XEUtils.isPlainObject(props.refresh)) {
595
- warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}']);
596
- }
597
- const customOpts = computeCustomOpts.value;
598
- if (customOpts.isFooter) {
599
- warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
600
- }
601
- if (customOpts.showFooter) {
602
- warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
603
- }
604
- if (customOpts.immediate) {
605
- warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
606
- }
607
- if (customOpts.trigger) {
608
- warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
609
- }
610
- if (props.refresh || props.import || props.export || props.print || props.zoom) {
611
- if (!VxeUIButtonComponent) {
612
- errLog('vxe.error.reqComp', ['vxe-button']);
613
- }
614
- }
349
+ }
350
+ return downVNs;
351
+ };
352
+ const renderLeftBtns = () => {
353
+ const { buttons } = props;
354
+ const { connectTable } = internalData;
355
+ const $table = connectTable;
356
+ const buttonsSlot = slots.buttons;
357
+ const buttonPrefixSlot = slots.buttonPrefix || slots["button-prefix"];
358
+ const buttonSuffixSlot = slots.buttonSuffix || slots["button-suffix"];
359
+ const btnVNs = [];
360
+ if (buttons) {
361
+ const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
362
+ const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
363
+ buttons.forEach((item, index) => {
364
+ const { dropdowns, buttonRender } = item;
365
+ if (item.visible !== false) {
366
+ const compConf = buttonRender && buttonRender.name ? rendererOpts[buttonRender.name] || renderer.get(buttonRender.name) : null;
367
+ if (buttonRender && compConf && compConf.renderToolbarButton) {
368
+ const toolbarButtonClassName = compConf.toolbarButtonClassName;
369
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, button: item };
370
+ btnVNs.push(
371
+ h("span", {
372
+ key: `br${item.code || index}`,
373
+ class: ["vxe-button--item", toolbarButtonClassName ? XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName : ""]
374
+ }, getSlotVNs(compConf.renderToolbarButton(buttonRender, params)))
375
+ );
376
+ } else {
377
+ if (VxeUIButtonComponent) {
378
+ btnVNs.push(
379
+ h(VxeUIButtonComponent, {
380
+ key: `bd${item.code || index}`,
381
+ ...Object.assign({}, item, {
382
+ content: item.content || item.name,
383
+ options: void 0
384
+ }),
385
+ onClick: (eventParams) => btnEvent(eventParams, item)
386
+ }, dropdowns && dropdowns.length ? {
387
+ dropdowns: () => renderDropdowns(item, true)
388
+ } : {})
389
+ );
390
+ }
391
+ }
392
+ }
615
393
  });
616
- onBeforeUnmount(() => {
617
- XEUtils.assign(reactData, createReactData());
618
- XEUtils.assign(internalData, createInternalData());
394
+ }
395
+ return [
396
+ h("div", {
397
+ class: "vxe-button--prefix-wrapper"
398
+ }, buttonPrefixSlot ? getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []),
399
+ h("div", {
400
+ class: "vxe-button--item-wrapper"
401
+ }, buttonsSlot ? getSlotVNs(buttonsSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs),
402
+ h("div", {
403
+ class: "vxe-button--suffix-wrapper"
404
+ }, buttonSuffixSlot ? getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : [])
405
+ ];
406
+ };
407
+ const renderRightTools = () => {
408
+ const { tools } = props;
409
+ const { connectTable } = internalData;
410
+ const $table = connectTable;
411
+ const toolsSlot = slots.tools;
412
+ const toolPrefixSlot = slots.toolPrefix || slots["tool-prefix"];
413
+ const toolSuffixSlot = slots.toolSuffix || slots["tool-suffix"];
414
+ const btnVNs = [];
415
+ if (tools) {
416
+ const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
417
+ const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
418
+ tools.forEach((item, tIndex) => {
419
+ const { dropdowns, toolRender } = item;
420
+ if (item.visible !== false) {
421
+ const compConf = toolRender && toolRender.name ? rendererOpts[toolRender.name] || renderer.get(toolRender.name) : null;
422
+ if (toolRender && compConf && compConf.renderToolbarTool) {
423
+ const toolbarToolClassName = compConf.toolbarToolClassName;
424
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, tool: item };
425
+ btnVNs.push(
426
+ h("span", {
427
+ key: tIndex,
428
+ class: ["vxe-tool--item", toolbarToolClassName ? XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName : ""]
429
+ }, getSlotVNs(compConf.renderToolbarTool(toolRender, params)))
430
+ );
431
+ } else {
432
+ if (VxeUIButtonComponent) {
433
+ btnVNs.push(
434
+ h(VxeUIButtonComponent, {
435
+ key: tIndex,
436
+ ...Object.assign({}, item, {
437
+ content: item.content || item.name,
438
+ options: void 0
439
+ }),
440
+ onClick: (eventParams) => tolEvent(eventParams, item)
441
+ }, dropdowns && dropdowns.length ? {
442
+ dropdowns: () => renderDropdowns(item, false)
443
+ } : {})
444
+ );
445
+ }
446
+ }
447
+ }
619
448
  });
620
- return $xeToolbar;
621
- },
622
- render() {
623
- return this.renderVN();
624
- }
449
+ }
450
+ return [
451
+ h("div", {
452
+ class: "vxe-tool--prefix-wrapper"
453
+ }, toolPrefixSlot ? getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []),
454
+ h("div", {
455
+ class: "vxe-tool--item-wrapper"
456
+ }, toolsSlot ? getSlotVNs(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs),
457
+ h("div", {
458
+ class: "vxe-tool--suffix-wrapper"
459
+ }, toolSuffixSlot ? getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : [])
460
+ ];
461
+ };
462
+ const renderToolImport = () => {
463
+ const importOpts = computeImportOpts.value;
464
+ return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
465
+ key: "import",
466
+ circle: true,
467
+ icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
468
+ title: getI18n("vxe.toolbar.import"),
469
+ onClick: openImportEvent
470
+ }) : createCommentVNode();
471
+ };
472
+ const renderToolExport = () => {
473
+ const exportOpts = computeExportOpts.value;
474
+ return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
475
+ key: "export",
476
+ circle: true,
477
+ icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
478
+ title: getI18n("vxe.toolbar.export"),
479
+ onClick: openExportEvent
480
+ }) : createCommentVNode();
481
+ };
482
+ const renderToolPrint = () => {
483
+ const printOpts = computePrintOpts.value;
484
+ return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
485
+ key: "print",
486
+ circle: true,
487
+ icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
488
+ title: getI18n("vxe.toolbar.print"),
489
+ onClick: openPrintEvent
490
+ }) : createCommentVNode();
491
+ };
492
+ const renderToolRefresh = () => {
493
+ const refreshOpts = computeRefreshOpts.value;
494
+ return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
495
+ key: "refresh",
496
+ circle: true,
497
+ icon: reactData.isRefresh ? refreshOpts.iconLoading || getIcon().TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || getIcon().TOOLBAR_TOOLS_REFRESH,
498
+ title: getI18n("vxe.toolbar.refresh"),
499
+ onClick: refreshEvent
500
+ }) : createCommentVNode();
501
+ };
502
+ const renderToolZoom = () => {
503
+ const zoomOpts = computeZoomOpts.value;
504
+ return $xeGGWrapper && VxeUIButtonComponent ? h(VxeUIButtonComponent, {
505
+ key: "zoom",
506
+ circle: true,
507
+ icon: $xeGGWrapper.isMaximized() ? zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN,
508
+ title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? "Out" : "In"}`),
509
+ onClick: zoomEvent
510
+ }) : createCommentVNode();
511
+ };
512
+ const renderToolCustom = () => {
513
+ const customOpts = computeCustomOpts.value;
514
+ const btnTrigger = computeTrigger.value;
515
+ const customBtnOns = {};
516
+ if (btnTrigger === "manual") {
517
+ } else if (btnTrigger === "hover") {
518
+ customBtnOns.onMouseenter = handleMouseenterSettingEvent;
519
+ customBtnOns.onMouseleave = handleMouseleaveSettingEvent;
520
+ } else {
521
+ customBtnOns.onClick = handleClickSettingEvent;
522
+ }
523
+ return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
524
+ key: "custom",
525
+ circle: true,
526
+ icon: customOpts.icon || getIcon().TOOLBAR_TOOLS_CUSTOM,
527
+ title: getI18n("vxe.toolbar.custom"),
528
+ className: "vxe-toolbar-custom-target",
529
+ ...customBtnOns
530
+ }) : createCommentVNode();
531
+ };
532
+ const renderVN = () => {
533
+ const { perfect, loading, refresh, zoom, custom, className } = props;
534
+ const vSize = computeSize.value;
535
+ return h("div", {
536
+ ref: refElem,
537
+ class: ["vxe-toolbar", className ? XEUtils.isFunction(className) ? className({ $toolbar: $xeToolbar }) : className : "", {
538
+ [`size--${vSize}`]: vSize,
539
+ "is--perfect": perfect,
540
+ "is--loading": loading
541
+ }]
542
+ }, [
543
+ h("div", {
544
+ class: "vxe-buttons--wrapper"
545
+ }, renderLeftBtns()),
546
+ h("div", {
547
+ class: "vxe-tools--wrapper"
548
+ }, renderRightTools()),
549
+ h("div", {
550
+ class: "vxe-tools--operate"
551
+ }, [
552
+ props.import ? renderToolImport() : createCommentVNode(),
553
+ props.export ? renderToolExport() : createCommentVNode(),
554
+ props.print ? renderToolPrint() : createCommentVNode(),
555
+ refresh ? renderToolRefresh() : createCommentVNode(),
556
+ zoom && $xeGGWrapper ? renderToolZoom() : createCommentVNode(),
557
+ custom ? renderToolCustom() : createCommentVNode()
558
+ ])
559
+ ]);
560
+ };
561
+ $xeToolbar.renderVN = renderVN;
562
+ nextTick(() => {
563
+ const refreshOpts = computeRefreshOpts.value;
564
+ const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
565
+ if (props.refresh && !$xeGGWrapper && !queryMethod) {
566
+ warnLog("vxe.error.notFunc", ["queryMethod"]);
567
+ }
568
+ if (XEUtils.isPlainObject(props.custom)) {
569
+ warnLog("vxe.error.delProp", ["custom={...}", "custom=boolean & custom-options={...}"]);
570
+ }
571
+ if (XEUtils.isPlainObject(props.print)) {
572
+ warnLog("vxe.error.delProp", ["print={...}", "print=boolean & print-options={...}"]);
573
+ }
574
+ if (XEUtils.isPlainObject(props.export)) {
575
+ warnLog("vxe.error.delProp", ["export={...}", "export=boolean & export-options={...}"]);
576
+ }
577
+ if (XEUtils.isPlainObject(props.import)) {
578
+ warnLog("vxe.error.delProp", ["import={...}", "import=boolean & import-options={...}"]);
579
+ }
580
+ if (XEUtils.isPlainObject(props.refresh)) {
581
+ warnLog("vxe.error.delProp", ["refresh={...}", "refresh=boolean & refresh-options={...}"]);
582
+ }
583
+ if (XEUtils.isPlainObject(props.refresh)) {
584
+ warnLog("vxe.error.delProp", ["zoom={...}", "zoom=boolean & zoom-options={...}"]);
585
+ }
586
+ const customOpts = computeCustomOpts.value;
587
+ if (customOpts.isFooter) {
588
+ warnLog("vxe.error.delProp", ["toolbar.custom.isFooter", "table.custom-config.showFooter"]);
589
+ }
590
+ if (customOpts.showFooter) {
591
+ warnLog("vxe.error.delProp", ["toolbar.custom.showFooter", "table.custom-config.showFooter"]);
592
+ }
593
+ if (customOpts.immediate) {
594
+ warnLog("vxe.error.delProp", ["toolbar.custom.immediate", "table.custom-config.immediate"]);
595
+ }
596
+ if (customOpts.trigger) {
597
+ warnLog("vxe.error.delProp", ["toolbar.custom.trigger", "table.custom-config.trigger"]);
598
+ }
599
+ if (props.refresh || props.import || props.export || props.print || props.zoom) {
600
+ if (!VxeUIButtonComponent) {
601
+ errLog("vxe.error.reqComp", ["vxe-button"]);
602
+ }
603
+ }
604
+ });
605
+ onBeforeUnmount(() => {
606
+ XEUtils.assign(reactData, createReactData());
607
+ XEUtils.assign(internalData, createInternalData());
608
+ });
609
+ return $xeToolbar;
610
+ },
611
+ render() {
612
+ return this.renderVN();
613
+ }
625
614
  });
615
+ export {
616
+ toolbar_default as default
617
+ };