vxe-table 4.23.11 → 4.23.13

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