vxe-table 3.15.39 → 3.15.41

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 (186) hide show
  1. package/es/grid/src/grid.js +73 -49
  2. package/es/{iconfont.1749800510225.ttf → iconfont.1750153781820.ttf} +0 -0
  3. package/es/iconfont.1750153781820.woff +0 -0
  4. package/es/iconfont.1750153781820.woff2 +0 -0
  5. package/es/index.css +1 -1
  6. package/es/index.min.css +1 -1
  7. package/es/locale/lang/ar-EG.js +6 -0
  8. package/es/locale/lang/de-DE.js +6 -0
  9. package/es/locale/lang/en-US.js +6 -0
  10. package/es/locale/lang/es-ES.js +6 -0
  11. package/es/locale/lang/fr-FR.js +6 -0
  12. package/es/locale/lang/hu-HU.js +6 -0
  13. package/es/locale/lang/hy-AM.js +6 -0
  14. package/es/locale/lang/id-ID.js +6 -0
  15. package/es/locale/lang/it-IT.js +6 -0
  16. package/es/locale/lang/ja-JP.js +6 -0
  17. package/es/locale/lang/ko-KR.js +6 -0
  18. package/es/locale/lang/ms-MY.js +6 -0
  19. package/es/locale/lang/nb-NO.js +6 -0
  20. package/es/locale/lang/pt-BR.js +6 -0
  21. package/es/locale/lang/ru-RU.js +6 -0
  22. package/es/locale/lang/th-TH.js +6 -0
  23. package/es/locale/lang/ug-CN.js +6 -0
  24. package/es/locale/lang/uk-UA.js +6 -0
  25. package/es/locale/lang/uz-UZ.js +6 -0
  26. package/es/locale/lang/vi-VN.js +6 -0
  27. package/es/locale/lang/zh-CHT.js +6 -0
  28. package/es/locale/lang/zh-CN.js +6 -0
  29. package/es/style.css +1 -1
  30. package/es/style.min.css +1 -1
  31. package/es/table/module/custom/mixin.js +29 -3
  32. package/es/table/module/custom/panel.js +118 -105
  33. package/es/table/src/body.js +8 -5
  34. package/es/table/src/cell.js +12 -12
  35. package/es/table/src/methods.js +34 -26
  36. package/es/table/src/props.js +32 -8
  37. package/es/table/src/table.js +57 -38
  38. package/es/table/style.css +22 -3
  39. package/es/table/style.min.css +1 -1
  40. package/es/toolbar/src/toolbar.js +163 -63
  41. package/es/ui/index.js +12 -1
  42. package/es/ui/src/log.js +1 -1
  43. package/es/vxe-table/style.css +22 -3
  44. package/es/vxe-table/style.min.css +1 -1
  45. package/lib/grid/src/grid.js +81 -82
  46. package/lib/grid/src/grid.min.js +1 -1
  47. package/lib/{iconfont.1749800510225.ttf → iconfont.1750153781820.ttf} +0 -0
  48. package/lib/iconfont.1750153781820.woff +0 -0
  49. package/lib/iconfont.1750153781820.woff2 +0 -0
  50. package/lib/index.css +1 -1
  51. package/lib/index.min.css +1 -1
  52. package/lib/index.umd.js +495 -288
  53. package/lib/index.umd.min.js +1 -1
  54. package/lib/locale/lang/ar-EG.js +6 -0
  55. package/lib/locale/lang/ar-EG.min.js +1 -1
  56. package/lib/locale/lang/ar-EG.umd.js +6 -0
  57. package/lib/locale/lang/de-DE.js +6 -0
  58. package/lib/locale/lang/de-DE.min.js +1 -1
  59. package/lib/locale/lang/de-DE.umd.js +6 -0
  60. package/lib/locale/lang/en-US.js +6 -0
  61. package/lib/locale/lang/en-US.min.js +1 -1
  62. package/lib/locale/lang/en-US.umd.js +6 -0
  63. package/lib/locale/lang/es-ES.js +6 -0
  64. package/lib/locale/lang/es-ES.min.js +1 -1
  65. package/lib/locale/lang/es-ES.umd.js +6 -0
  66. package/lib/locale/lang/fr-FR.js +6 -0
  67. package/lib/locale/lang/fr-FR.min.js +1 -1
  68. package/lib/locale/lang/fr-FR.umd.js +6 -0
  69. package/lib/locale/lang/hu-HU.js +6 -0
  70. package/lib/locale/lang/hu-HU.min.js +1 -1
  71. package/lib/locale/lang/hu-HU.umd.js +6 -0
  72. package/lib/locale/lang/hy-AM.js +6 -0
  73. package/lib/locale/lang/hy-AM.min.js +1 -1
  74. package/lib/locale/lang/hy-AM.umd.js +6 -0
  75. package/lib/locale/lang/id-ID.js +6 -0
  76. package/lib/locale/lang/id-ID.min.js +1 -1
  77. package/lib/locale/lang/id-ID.umd.js +6 -0
  78. package/lib/locale/lang/it-IT.js +6 -0
  79. package/lib/locale/lang/it-IT.min.js +1 -1
  80. package/lib/locale/lang/it-IT.umd.js +6 -0
  81. package/lib/locale/lang/ja-JP.js +6 -0
  82. package/lib/locale/lang/ja-JP.min.js +1 -1
  83. package/lib/locale/lang/ja-JP.umd.js +6 -0
  84. package/lib/locale/lang/ko-KR.js +6 -0
  85. package/lib/locale/lang/ko-KR.min.js +1 -1
  86. package/lib/locale/lang/ko-KR.umd.js +6 -0
  87. package/lib/locale/lang/ms-MY.js +6 -0
  88. package/lib/locale/lang/ms-MY.min.js +1 -1
  89. package/lib/locale/lang/ms-MY.umd.js +6 -0
  90. package/lib/locale/lang/nb-NO.js +6 -0
  91. package/lib/locale/lang/nb-NO.min.js +1 -1
  92. package/lib/locale/lang/nb-NO.umd.js +6 -0
  93. package/lib/locale/lang/pt-BR.js +6 -0
  94. package/lib/locale/lang/pt-BR.min.js +1 -1
  95. package/lib/locale/lang/pt-BR.umd.js +6 -0
  96. package/lib/locale/lang/ru-RU.js +6 -0
  97. package/lib/locale/lang/ru-RU.min.js +1 -1
  98. package/lib/locale/lang/ru-RU.umd.js +6 -0
  99. package/lib/locale/lang/th-TH.js +6 -0
  100. package/lib/locale/lang/th-TH.min.js +1 -1
  101. package/lib/locale/lang/th-TH.umd.js +6 -0
  102. package/lib/locale/lang/ug-CN.js +6 -0
  103. package/lib/locale/lang/ug-CN.min.js +1 -1
  104. package/lib/locale/lang/ug-CN.umd.js +6 -0
  105. package/lib/locale/lang/uk-UA.js +6 -0
  106. package/lib/locale/lang/uk-UA.min.js +1 -1
  107. package/lib/locale/lang/uk-UA.umd.js +6 -0
  108. package/lib/locale/lang/uz-UZ.js +6 -0
  109. package/lib/locale/lang/uz-UZ.min.js +1 -1
  110. package/lib/locale/lang/uz-UZ.umd.js +6 -0
  111. package/lib/locale/lang/vi-VN.js +6 -0
  112. package/lib/locale/lang/vi-VN.min.js +1 -1
  113. package/lib/locale/lang/vi-VN.umd.js +6 -0
  114. package/lib/locale/lang/zh-CHT.js +6 -0
  115. package/lib/locale/lang/zh-CHT.min.js +1 -1
  116. package/lib/locale/lang/zh-CHT.umd.js +6 -0
  117. package/lib/locale/lang/zh-CN.js +6 -0
  118. package/lib/locale/lang/zh-CN.min.js +1 -1
  119. package/lib/locale/lang/zh-CN.umd.js +6 -0
  120. package/lib/style.css +1 -1
  121. package/lib/style.min.css +1 -1
  122. package/lib/table/module/custom/mixin.js +32 -5
  123. package/lib/table/module/custom/mixin.min.js +1 -1
  124. package/lib/table/module/custom/panel.js +14 -2
  125. package/lib/table/module/custom/panel.min.js +1 -1
  126. package/lib/table/src/body.js +11 -11
  127. package/lib/table/src/body.min.js +1 -1
  128. package/lib/table/src/cell.js +14 -14
  129. package/lib/table/src/cell.min.js +1 -1
  130. package/lib/table/src/methods.js +38 -25
  131. package/lib/table/src/methods.min.js +1 -1
  132. package/lib/table/src/props.js +32 -8
  133. package/lib/table/src/table.js +64 -50
  134. package/lib/table/src/table.min.js +1 -1
  135. package/lib/table/style/style.css +22 -3
  136. package/lib/table/style/style.min.css +1 -1
  137. package/lib/toolbar/src/toolbar.js +189 -88
  138. package/lib/toolbar/src/toolbar.min.js +1 -1
  139. package/lib/ui/index.js +12 -1
  140. package/lib/ui/index.min.js +1 -1
  141. package/lib/ui/src/log.js +1 -1
  142. package/lib/ui/src/log.min.js +1 -1
  143. package/lib/vxe-table/style/style.css +22 -3
  144. package/lib/vxe-table/style/style.min.css +1 -1
  145. package/package.json +1 -1
  146. package/packages/grid/src/grid.ts +93 -54
  147. package/packages/locale/lang/ar-EG.ts +6 -0
  148. package/packages/locale/lang/de-DE.ts +6 -0
  149. package/packages/locale/lang/en-US.ts +6 -0
  150. package/packages/locale/lang/es-ES.ts +6 -0
  151. package/packages/locale/lang/fr-FR.ts +6 -0
  152. package/packages/locale/lang/hu-HU.ts +6 -0
  153. package/packages/locale/lang/hy-AM.ts +6 -0
  154. package/packages/locale/lang/id-ID.ts +6 -0
  155. package/packages/locale/lang/it-IT.ts +6 -0
  156. package/packages/locale/lang/ja-JP.ts +6 -0
  157. package/packages/locale/lang/ko-KR.ts +6 -0
  158. package/packages/locale/lang/ms-MY.ts +6 -0
  159. package/packages/locale/lang/nb-NO.ts +6 -0
  160. package/packages/locale/lang/pt-BR.ts +6 -0
  161. package/packages/locale/lang/ru-RU.ts +6 -0
  162. package/packages/locale/lang/th-TH.ts +6 -0
  163. package/packages/locale/lang/ug-CN.ts +6 -0
  164. package/packages/locale/lang/uk-UA.ts +6 -0
  165. package/packages/locale/lang/uz-UZ.ts +6 -0
  166. package/packages/locale/lang/vi-VN.ts +6 -0
  167. package/packages/locale/lang/zh-CHT.ts +6 -0
  168. package/packages/locale/lang/zh-CN.ts +6 -0
  169. package/packages/table/module/custom/mixin.ts +27 -3
  170. package/packages/table/module/custom/panel.ts +119 -106
  171. package/packages/table/src/body.ts +13 -10
  172. package/packages/table/src/cell.ts +12 -12
  173. package/packages/table/src/methods.ts +35 -26
  174. package/packages/table/src/props.ts +32 -8
  175. package/packages/table/src/table.ts +76 -49
  176. package/packages/toolbar/src/toolbar.ts +167 -62
  177. package/packages/ui/index.ts +11 -0
  178. package/styles/components/icon.scss +13 -1
  179. package/styles/components/table-module/custom.scss +9 -2
  180. package/styles/icon/iconfont.ttf +0 -0
  181. package/styles/icon/iconfont.woff +0 -0
  182. package/styles/icon/iconfont.woff2 +0 -0
  183. package/es/iconfont.1749800510225.woff +0 -0
  184. package/es/iconfont.1749800510225.woff2 +0 -0
  185. package/lib/iconfont.1749800510225.woff +0 -0
  186. package/lib/iconfont.1749800510225.woff2 +0 -0
@@ -90,27 +90,31 @@ function renderFixed (h: CreateElement, $xeTable: VxeTableConstructor & VxeTable
90
90
  ])
91
91
  }
92
92
 
93
- function renderEmptyBody (h: CreateElement, _vm: any) {
94
- const { $scopedSlots, emptyOpts } = _vm
93
+ function renderEmptyBody (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
94
+ const slots = $xeTable.$scopedSlots
95
+ const $xeGrid = $xeTable.$xeGrid
96
+
97
+ const emptyOpts = $xeTable.computeEmptyOpts
98
+ const emptySlot = slots.empty
95
99
  let emptyContent: any = ''
96
- const params = { $table: _vm }
97
- if ($scopedSlots.empty) {
98
- emptyContent = $scopedSlots.empty.call(_vm, params, h)
100
+ const emptyParams = { $table: $xeTable, $grid: $xeGrid }
101
+ if (emptySlot) {
102
+ emptyContent = emptySlot.call($xeTable, emptyParams)
99
103
  } else {
100
104
  const compConf = emptyOpts.name ? renderer.get(emptyOpts.name) : null
101
105
  const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null
102
106
  if (rtEmptyView) {
103
- emptyContent = getSlotVNs(rtEmptyView.call(_vm, h, emptyOpts, params))
107
+ emptyContent = getSlotVNs(rtEmptyView.call($xeTable, h, emptyOpts, emptyParams))
104
108
  } else {
105
- emptyContent = getFuncText(_vm.emptyText) || getI18n('vxe.table.emptyText')
109
+ emptyContent = getFuncText($xeTable.emptyText) || getI18n('vxe.table.emptyText')
106
110
  }
107
111
  }
108
112
  return emptyContent
109
113
  }
110
114
 
111
- const renderDragTipContents = (h: CreateElement, $xeTable: any) => {
115
+ const renderDragTipContents = (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) => {
112
116
  const props = $xeTable
113
- const reactData = $xeTable
117
+ const reactData = $xeTable as unknown as TableReactData
114
118
 
115
119
  const { dragConfig } = props
116
120
  const { dragRow, dragCol, dragTipText } = reactData
@@ -130,8 +134,8 @@ const renderDragTipContents = (h: CreateElement, $xeTable: any) => {
130
134
  return [h('span', dragTipText)]
131
135
  }
132
136
 
133
- const renderDragTip = (h: CreateElement, $xeTable: any) => {
134
- const reactData = $xeTable
137
+ const renderDragTip = (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) => {
138
+ const reactData = $xeTable as unknown as TableReactData
135
139
 
136
140
  const { dragRow, dragCol } = reactData
137
141
  const rowOpts = $xeTable.computeRowOpts
@@ -187,10 +191,10 @@ const renderDragTip = (h: CreateElement, $xeTable: any) => {
187
191
  return renderEmptyElement($xeTable)
188
192
  }
189
193
 
190
- function handleUpdateResize (_vm: any) {
191
- const { $el } = _vm
192
- if ($el && $el.clientWidth && $el.clientHeight) {
193
- _vm.recalculate()
194
+ function handleUpdateResize ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
195
+ const el = $xeTable.$refs.refElem as HTMLDivElement
196
+ if (el && el.clientWidth && el.clientHeight) {
197
+ $xeTable.recalculate()
194
198
  }
195
199
  }
196
200
 
@@ -672,6 +676,8 @@ export default {
672
676
  visiblwRowsFlag: 1,
673
677
 
674
678
  isRowGroupStatus: false,
679
+ rowGroupList: [],
680
+ aggHandleFields: [],
675
681
 
676
682
  rowGroupExpandedFlag: 1,
677
683
  rowExpandedFlag: 1,
@@ -729,17 +735,21 @@ export default {
729
735
  return this.computeTableId
730
736
  },
731
737
  computeTableId () {
732
- const { id } = this
738
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
739
+ const props = $xeTable
740
+ const $xeGrid = $xeTable.$xeGrid
741
+
742
+ const { id } = props
733
743
  if (id) {
734
744
  if (XEUtils.isFunction(id)) {
735
- return `${id({ $table: this }) || ''}`
745
+ return `${id({ $table: $xeTable, $grid: $xeGrid }) || ''}`
736
746
  }
737
747
  return `${id}`
738
748
  }
739
749
  return ''
740
750
  },
741
751
  computeRowField () {
742
- const $xeTable = this
752
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
743
753
  const props = $xeTable
744
754
 
745
755
  const rowOpts = $xeTable.computeRowOpts
@@ -749,7 +759,10 @@ export default {
749
759
  return this.computeValidOpts
750
760
  },
751
761
  computeValidOpts () {
752
- return Object.assign({ message: 'default' }, getConfig().table.validConfig, this.validConfig)
762
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
763
+ const props = $xeTable
764
+
765
+ return Object.assign({}, getConfig().table.validConfig, props.validConfig)
753
766
  },
754
767
  sXOpts () {
755
768
  return this.computeVirtualXOpts
@@ -758,7 +771,7 @@ export default {
758
771
  return this.computeVirtualXOpts
759
772
  },
760
773
  computeScrollXThreshold () {
761
- const $xeTable = this
774
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
762
775
 
763
776
  const virtualXOpts = $xeTable.computeVirtualXOpts
764
777
  const { threshold } = virtualXOpts
@@ -774,37 +787,37 @@ export default {
774
787
  return this.computeVirtualYOpts
775
788
  },
776
789
  computeVirtualXOpts () {
777
- const $xeTable = this
790
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
778
791
  const props = $xeTable
779
792
 
780
793
  return Object.assign({}, getConfig().table.virtualXConfig || getConfig().table.scrollX, props.virtualXConfig || props.scrollX)
781
794
  },
782
795
  computeVirtualYOpts () {
783
- const $xeTable = this
796
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
784
797
  const props = $xeTable
785
798
 
786
799
  return Object.assign({}, getConfig().table.virtualYConfig || getConfig().table.scrollY, props.virtualYConfig || props.scrollY)
787
800
  },
788
801
  computeScrollbarOpts () {
789
- const $xeTable = this
802
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
790
803
  const props = $xeTable
791
804
 
792
805
  return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig)
793
806
  },
794
807
  computeScrollbarXToTop () {
795
- const $xeTable = this
808
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
796
809
 
797
810
  const scrollbarOpts = $xeTable.computeScrollbarOpts
798
811
  return !!(scrollbarOpts.x && scrollbarOpts.x.position === 'top')
799
812
  },
800
813
  computeScrollbarYToLeft () {
801
- const $xeTable = this
814
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
802
815
 
803
816
  const scrollbarOpts = $xeTable.computeScrollbarOpts
804
817
  return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left')
805
818
  },
806
819
  computeScrollYThreshold () {
807
- const $xeTable = this
820
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
808
821
 
809
822
  const virtualYOpts = $xeTable.computeVirtualYOpts
810
823
  const { threshold } = virtualYOpts
@@ -1176,26 +1189,18 @@ export default {
1176
1189
  },
1177
1190
  computeTableRowExpandedList () {
1178
1191
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1179
- const props = $xeTable
1180
1192
  const reactData = $xeTable as unknown as TableReactData
1181
1193
  const internalData = $xeTable as unknown as TableInternalData
1182
1194
 
1183
- const { treeConfig } = props
1184
- const { rowExpandedFlag, expandColumn, rowGroupExpandedFlag, treeExpandedFlag, isRowGroupStatus } = reactData
1195
+ const { rowExpandedFlag, expandColumn, rowGroupExpandedFlag, treeExpandedFlag } = reactData
1185
1196
  const { visibleDataRowIdData, rowExpandedMaps } = internalData
1186
- const treeOpts = $xeTable.computeTreeOpts
1187
- const { transform } = treeOpts
1188
1197
  const expandList: any[] = []
1189
1198
  if (expandColumn && rowExpandedFlag && rowGroupExpandedFlag && treeExpandedFlag) {
1190
- if (isRowGroupStatus || (treeConfig && transform)) {
1191
- XEUtils.each(rowExpandedMaps, (row, rowid) => {
1192
- if (visibleDataRowIdData[rowid]) {
1193
- expandList.push(row)
1194
- }
1195
- })
1196
- } else {
1197
- return XEUtils.values(rowExpandedMaps)
1198
- }
1199
+ XEUtils.each(rowExpandedMaps, (row, rowid) => {
1200
+ if (visibleDataRowIdData[rowid]) {
1201
+ expandList.push(row)
1202
+ }
1203
+ })
1199
1204
  }
1200
1205
  return expandList
1201
1206
  },
@@ -1287,6 +1292,22 @@ export default {
1287
1292
  const aggregateOpts = $xeTable.computeAggregateOpts
1288
1293
  return aggregateOpts.groupFields
1289
1294
  },
1295
+ computeRowGroupColumns () {
1296
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1297
+ const reactData = $xeTable as unknown as TableReactData
1298
+ const internalData = $xeTable as unknown as TableInternalData
1299
+
1300
+ const { rowGroupList } = reactData
1301
+ const { fullColumnFieldData } = internalData
1302
+ const rgColumns: VxeTableDefines.ColumnInfo[] = []
1303
+ rowGroupList.forEach(aggConf => {
1304
+ const colRest = fullColumnFieldData[aggConf.field]
1305
+ if (colRest) {
1306
+ rgColumns.push(colRest.column)
1307
+ }
1308
+ })
1309
+ return rgColumns
1310
+ },
1290
1311
  tabsResizeFlag () {
1291
1312
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1292
1313
  const $xeTabs = $xeTable.$xeTabs
@@ -1391,11 +1412,13 @@ export default {
1391
1412
  },
1392
1413
 
1393
1414
  syncResize (value: any) {
1415
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1416
+
1394
1417
  if (value) {
1395
- handleUpdateResize(this)
1396
- this.$nextTick(() => {
1397
- handleUpdateResize(this)
1398
- setTimeout(() => handleUpdateResize(this))
1418
+ handleUpdateResize($xeTable)
1419
+ $xeTable.$nextTick(() => {
1420
+ handleUpdateResize($xeTable)
1421
+ setTimeout(() => handleUpdateResize($xeTable))
1399
1422
  })
1400
1423
  }
1401
1424
  },
@@ -1403,12 +1426,16 @@ export default {
1403
1426
  this.handleGlobalResizeEvent()
1404
1427
  },
1405
1428
  mergeCells (value: any) {
1406
- this.clearMergeCells()
1407
- this.$nextTick(() => this.setMergeCells(value))
1429
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1430
+
1431
+ $xeTable.clearMergeCells()
1432
+ $xeTable.$nextTick(() => $xeTable.setMergeCells(value))
1408
1433
  },
1409
1434
  mergeFooterItems (value: any) {
1410
- this.clearMergeFooterItems()
1411
- this.$nextTick(() => this.setMergeFooterItems(value))
1435
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1436
+
1437
+ $xeTable.clearMergeFooterItems()
1438
+ $xeTable.$nextTick(() => $xeTable.setMergeFooterItems(value))
1412
1439
  },
1413
1440
 
1414
1441
  computeRowGroupFields (val: any) {
@@ -2022,7 +2049,7 @@ export default {
2022
2049
  }, [
2023
2050
  h('div', {
2024
2051
  class: 'vxe-table--empty-content'
2025
- }, renderEmptyBody(h, this))
2052
+ }, renderEmptyBody(h, $xeTable))
2026
2053
  ]),
2027
2054
  /**
2028
2055
  * 边框线
@@ -5,7 +5,7 @@ import { VxeUI } from '../../ui'
5
5
  import { getSlotVNs } from '../../ui/src/vn'
6
6
  import { warnLog, errLog } from '../../ui/src/log'
7
7
 
8
- import type { ValueOf, VxeButtonComponent, VxeComponentSizeType, VxeComponentSlotType } from 'vxe-pc-ui'
8
+ import type { ValueOf, VxeButtonComponent, VxeComponentSizeType, VxeComponentSlotType, VxeButtonDefines } from 'vxe-pc-ui'
9
9
  import type { VxeGridConstructor, GridPrivateMethods, ToolbarInternalData, VxeTableDefines, VxeToolbarEmits, VxeToolbarPropTypes, VxeTablePropTypes, ToolbarReactData, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
10
10
 
11
11
  const { getConfig, getIcon, getI18n, renderer, commands, createEvent, globalMixins, renderEmptyElement } = VxeUI
@@ -18,11 +18,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
18
18
  props: {
19
19
  loading: Boolean,
20
20
  refresh: [Boolean, Object] as PropType<VxeToolbarPropTypes.Refresh>,
21
+ refreshOptions: Object as PropType<VxeToolbarPropTypes.RefreshOptions>,
21
22
  import: [Boolean, Object] as PropType<VxeToolbarPropTypes.Import>,
23
+ importOptions: Object as PropType<VxeToolbarPropTypes.ImportOptions>,
22
24
  export: [Boolean, Object] as PropType<VxeToolbarPropTypes.Export>,
25
+ exportOptions: Object as PropType<VxeToolbarPropTypes.ExportOptions>,
23
26
  print: [Boolean, Object] as PropType<VxeToolbarPropTypes.Print>,
27
+ printOptions: Object as PropType<VxeToolbarPropTypes.PrintOptions>,
24
28
  zoom: [Boolean, Object] as PropType< VxeToolbarPropTypes.Zoom>,
29
+ zoomOptions: Object as PropType< VxeToolbarPropTypes.ZoomOptions>,
25
30
  custom: [Boolean, Object] as PropType<VxeToolbarPropTypes.Custom>,
31
+ customOptions: Object as PropType<VxeToolbarPropTypes.CustomOptions>,
26
32
  buttons: {
27
33
  type: Array as PropType<VxeToolbarPropTypes.Buttons>,
28
34
  default: () => getConfig().toolbar.buttons
@@ -71,37 +77,37 @@ export default /* define-vxe-component start */ defineVxeComponent({
71
77
  const $xeToolbar = this
72
78
  const props = $xeToolbar
73
79
 
74
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refresh) as VxeToolbarPropTypes.RefreshOpts
80
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh) as VxeToolbarPropTypes.RefreshOptions
75
81
  },
76
82
  computeImportOpts () {
77
83
  const $xeToolbar = this
78
84
  const props = $xeToolbar
79
85
 
80
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.import) as VxeToolbarPropTypes.ImportOpts
86
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.importOptions, props.import) as VxeToolbarPropTypes.ImportOptions
81
87
  },
82
88
  computeExportOpts () {
83
89
  const $xeToolbar = this
84
90
  const props = $xeToolbar
85
91
 
86
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.export) as VxeToolbarPropTypes.ExportOpts
92
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.exportOptions, props.export) as VxeToolbarPropTypes.ExportOptions
87
93
  },
88
94
  computePrintOpts () {
89
95
  const $xeToolbar = this
90
96
  const props = $xeToolbar
91
97
 
92
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.print) as VxeToolbarPropTypes.PrintOpts
98
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.printOptions, props.print) as VxeToolbarPropTypes.PrintOptions
93
99
  },
94
100
  computeZoomOpts () {
95
101
  const $xeToolbar = this
96
102
  const props = $xeToolbar
97
103
 
98
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoom) as VxeToolbarPropTypes.ZoomOpts
104
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom) as VxeToolbarPropTypes.ZoomOptions
99
105
  },
100
106
  computeCustomOpts () {
101
107
  const $xeToolbar = this
102
108
  const props = $xeToolbar
103
109
 
104
- return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.custom) as VxeToolbarPropTypes.CustomOpts
110
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom) as VxeToolbarPropTypes.CustomOptions
105
111
  },
106
112
  computeTableCustomOpts (this: any) {
107
113
  const $xeToolbar = this
@@ -230,73 +236,47 @@ export default /* define-vxe-component start */ defineVxeComponent({
230
236
 
231
237
  if ($xeGrid) {
232
238
  $xeGrid.triggerZoomEvent($event)
239
+ } else {
240
+ warnLog('vxe.error.notProp', ['zoom'])
233
241
  }
234
242
  },
235
- btnEvent (evnt: Event, item: VxeToolbarPropTypes.ButtonConfig) {
243
+ importEvent () {
236
244
  const $xeToolbar = this
237
245
  const internalData = $xeToolbar.internalData
238
- const $xeGrid = $xeToolbar.$xeGrid
239
246
 
240
- const { connectTable } = internalData
241
- const $table = connectTable
242
- const { code } = item
243
- if (code) {
244
- if ($xeGrid) {
245
- $xeGrid.triggerToolbarBtnEvent(item, evnt)
246
- } else {
247
- const gCommandOpts = commands.get(code)
248
- const params = { code, button: item, $table: $table!, $grid: $xeGrid, $event: evnt }
249
- if (gCommandOpts) {
250
- const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
251
- if (tCommandMethod) {
252
- tCommandMethod(params)
253
- } else {
254
- errLog('vxe.error.notCommands', [code])
255
- }
256
- }
257
- $xeToolbar.dispatchEvent('button-click', params, evnt)
247
+ if ($xeToolbar.checkTable()) {
248
+ const { connectTable } = internalData
249
+ const $table: any = connectTable
250
+ if ($table) {
251
+ $table.importData()
258
252
  }
259
253
  }
260
254
  },
261
- tolEvent (evnt: Event, item: VxeToolbarPropTypes.ButtonConfig) {
255
+ openImportEvent () {
262
256
  const $xeToolbar = this
263
257
  const internalData = $xeToolbar.internalData
264
- const $xeGrid = $xeToolbar.$xeGrid
265
258
 
266
- const { connectTable } = internalData
267
- const $table = connectTable
268
- const { code } = item
269
- if (code) {
270
- if ($xeGrid) {
271
- $xeGrid.triggerToolbarTolEvent(item, evnt)
272
- } else {
273
- const gCommandOpts = commands.get(code)
274
- const params = { code, button: null, tool: item, $table: $table!, $grid: $xeGrid, $event: evnt }
275
- if (gCommandOpts) {
276
- const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
277
- if (tCommandMethod) {
278
- tCommandMethod(params)
279
- } else {
280
- errLog('vxe.error.notCommands', [code])
281
- }
282
- }
283
- $xeToolbar.dispatchEvent('tool-click', params, evnt)
259
+ if ($xeToolbar.checkTable()) {
260
+ const { connectTable } = internalData
261
+ const $table: any = connectTable
262
+ if ($table) {
263
+ $table.openImport()
284
264
  }
285
265
  }
286
266
  },
287
- importEvent () {
267
+ exportEvent () {
288
268
  const $xeToolbar = this
289
269
  const internalData = $xeToolbar.internalData
290
270
 
291
271
  if ($xeToolbar.checkTable()) {
292
- const { connectTable } = internalData
293
- const $table: any = connectTable
272
+ const { connectTable } = internalData as any
273
+ const $table = connectTable
294
274
  if ($table) {
295
- $table.openImport()
275
+ $table.exportData()
296
276
  }
297
277
  }
298
278
  },
299
- exportEvent () {
279
+ openExportEvent () {
300
280
  const $xeToolbar = this
301
281
  const internalData = $xeToolbar.internalData
302
282
 
@@ -312,6 +292,18 @@ export default /* define-vxe-component start */ defineVxeComponent({
312
292
  const $xeToolbar = this
313
293
  const internalData = $xeToolbar.internalData
314
294
 
295
+ if ($xeToolbar.checkTable()) {
296
+ const { connectTable } = internalData as any
297
+ const $table = connectTable
298
+ if ($table) {
299
+ $table.print()
300
+ }
301
+ }
302
+ },
303
+ openPrintEvent () {
304
+ const $xeToolbar = this
305
+ const internalData = $xeToolbar.internalData
306
+
315
307
  if ($xeToolbar.checkTable()) {
316
308
  const { connectTable } = internalData as any
317
309
  const $table = connectTable
@@ -320,6 +312,100 @@ export default /* define-vxe-component start */ defineVxeComponent({
320
312
  }
321
313
  }
322
314
  },
315
+ handleDefaultCodeEvent (eventParams: VxeButtonDefines.ClickEventParams, item: VxeToolbarPropTypes.ButtonConfig | VxeToolbarPropTypes.ToolConfig, cb: () => void) {
316
+ const $xeToolbar = this
317
+
318
+ switch (item.code) {
319
+ case 'print':
320
+ $xeToolbar.printEvent()
321
+ break
322
+ case 'open_print':
323
+ $xeToolbar.openPrintEvent()
324
+ break
325
+ case 'custom':
326
+ $xeToolbar.handleClickSettingEvent(eventParams)
327
+ break
328
+ case 'export':
329
+ $xeToolbar.exportEvent()
330
+ break
331
+ case 'open_export':
332
+ $xeToolbar.openExportEvent()
333
+ break
334
+ case 'import':
335
+ $xeToolbar.importEvent()
336
+ break
337
+ case 'open_import':
338
+ $xeToolbar.openImportEvent()
339
+ break
340
+ case 'zoom':
341
+ $xeToolbar.zoomEvent(eventParams)
342
+ break
343
+ case 'refresh':
344
+ $xeToolbar.refreshEvent(eventParams)
345
+ break
346
+ default:
347
+ cb()
348
+ break
349
+ }
350
+ },
351
+ btnEvent (eventParams: VxeButtonDefines.ClickEventParams, item: VxeToolbarPropTypes.ButtonConfig) {
352
+ const $xeToolbar = this
353
+ const internalData = $xeToolbar.internalData
354
+ const $xeGrid = $xeToolbar.$xeGrid
355
+
356
+ const { $event } = eventParams
357
+ const { connectTable } = internalData
358
+ const $table = connectTable
359
+ const { code } = item
360
+ if (code) {
361
+ $xeToolbar.handleDefaultCodeEvent(eventParams, item, () => {
362
+ if ($xeGrid) {
363
+ $xeGrid.triggerToolbarBtnEvent(item, $event)
364
+ } else {
365
+ const gCommandOpts = commands.get(code)
366
+ const params = { code, button: item, $table: $table!, $grid: $xeGrid, $event }
367
+ if (gCommandOpts) {
368
+ const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
369
+ if (tCommandMethod) {
370
+ tCommandMethod(params)
371
+ } else {
372
+ errLog('vxe.error.notCommands', [code])
373
+ }
374
+ }
375
+ $xeToolbar.dispatchEvent('button-click', params, $event)
376
+ }
377
+ })
378
+ }
379
+ },
380
+ tolEvent (eventParams: VxeButtonDefines.ClickEventParams, item: VxeToolbarPropTypes.ToolConfig) {
381
+ const $xeToolbar = this
382
+ const internalData = $xeToolbar.internalData
383
+ const $xeGrid = $xeToolbar.$xeGrid
384
+
385
+ const { $event } = eventParams
386
+ const { connectTable } = internalData
387
+ const $table = connectTable
388
+ const { code } = item
389
+ if (code) {
390
+ $xeToolbar.handleDefaultCodeEvent(eventParams, item, () => {
391
+ if ($xeGrid) {
392
+ $xeGrid.triggerToolbarTolEvent(item, $event)
393
+ } else {
394
+ const gCommandOpts = commands.get(code)
395
+ const params = { code, button: null, tool: item, $table: $table!, $grid: $xeGrid, $event }
396
+ if (gCommandOpts) {
397
+ const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
398
+ if (tCommandMethod) {
399
+ tCommandMethod(params)
400
+ } else {
401
+ errLog('vxe.error.notCommands', [code])
402
+ }
403
+ }
404
+ $xeToolbar.dispatchEvent('tool-click', params, $event)
405
+ }
406
+ })
407
+ }
408
+ },
323
409
 
324
410
  //
325
411
  // Render
@@ -357,7 +443,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
357
443
  suffixTooltip: child.suffixTooltip
358
444
  },
359
445
  on: {
360
- click: ({ $event }: any) => isBtn ? $xeToolbar.btnEvent($event, child) : $xeToolbar.tolEvent($event, child)
446
+ click: (eventParams: VxeButtonDefines.ClickEventParams) => isBtn ? $xeToolbar.btnEvent(eventParams, child) : $xeToolbar.tolEvent(eventParams, child)
361
447
  }
362
448
  })
363
449
  : renderEmptyElement($xeToolbar)
@@ -424,11 +510,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
424
510
  transfer: item.transfer
425
511
  },
426
512
  on: {
427
- click: ({ $event }: any) => this.btnEvent($event, item)
513
+ click: (eventParams: VxeButtonDefines.ClickEventParams) => $xeToolbar.btnEvent(eventParams, item)
428
514
  },
429
515
  scopedSlots: dropdowns && dropdowns.length
430
516
  ? {
431
- dropdowns: () => this.renderDropdowns(h, item, true)
517
+ dropdowns: () => $xeToolbar.renderDropdowns(h, item, true)
432
518
  }
433
519
  : {}
434
520
  })
@@ -505,7 +591,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
505
591
  transfer: item.transfer
506
592
  },
507
593
  on: {
508
- click: ({ $event }: any) => $xeToolbar.tolEvent($event, item)
594
+ click: (eventParams: VxeButtonDefines.ClickEventParams) => $xeToolbar.tolEvent(eventParams, item)
509
595
  },
510
596
  scopedSlots: dropdowns && dropdowns.length
511
597
  ? {
@@ -540,7 +626,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
540
626
  title: getI18n('vxe.toolbar.import')
541
627
  },
542
628
  on: {
543
- click: $xeToolbar.importEvent
629
+ click: $xeToolbar.openImportEvent
544
630
  }
545
631
  })
546
632
  : renderEmptyElement($xeToolbar)
@@ -561,7 +647,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
561
647
  title: getI18n('vxe.toolbar.export')
562
648
  },
563
649
  on: {
564
- click: $xeToolbar.exportEvent
650
+ click: $xeToolbar.openExportEvent
565
651
  }
566
652
  })
567
653
  : renderEmptyElement($xeToolbar)
@@ -582,7 +668,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
582
668
  title: getI18n('vxe.toolbar.print')
583
669
  },
584
670
  on: {
585
- click: $xeToolbar.printEvent
671
+ click: $xeToolbar.openPrintEvent
586
672
  }
587
673
  })
588
674
  : renderEmptyElement($xeToolbar)
@@ -713,13 +799,32 @@ export default /* define-vxe-component start */ defineVxeComponent({
713
799
  const $xeGrid = $xeToolbar.$xeGrid
714
800
 
715
801
  $xeToolbar.$nextTick(() => {
716
- const { refresh } = props
717
802
  const refreshOpts = $xeToolbar.computeRefreshOpts
718
- const $xeTable = this.fintTable() as any
803
+ const $xeTable = $xeToolbar.fintTable() as any
719
804
  const queryMethod = refreshOpts.queryMethod || refreshOpts.query
720
- if (refresh && !$xeGrid && !queryMethod) {
805
+ if (props.refresh && !$xeGrid && !queryMethod) {
721
806
  warnLog('vxe.error.notFunc', ['queryMethod'])
722
807
  }
808
+
809
+ if (XEUtils.isPlainObject(props.custom)) {
810
+ warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}'])
811
+ }
812
+ if (XEUtils.isPlainObject(props.print)) {
813
+ warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}'])
814
+ }
815
+ if (XEUtils.isPlainObject(props.export)) {
816
+ warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}'])
817
+ }
818
+ if (XEUtils.isPlainObject(props.import)) {
819
+ warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}'])
820
+ }
821
+ if (XEUtils.isPlainObject(props.refresh)) {
822
+ warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}'])
823
+ }
824
+ if (XEUtils.isPlainObject(props.refresh)) {
825
+ warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}'])
826
+ }
827
+
723
828
  if ($xeTable) {
724
829
  $xeTable.connect(this)
725
830
  }
@@ -101,6 +101,14 @@ VxeUI.setConfig({
101
101
  showFooter: true,
102
102
  placement: 'top-right',
103
103
  // storage: false,
104
+ storeOptions: {
105
+ visible: true,
106
+ resizable: true,
107
+ sort: true,
108
+ fixed: true
109
+ // rowGroup: false,
110
+ // aggFunc: false
111
+ },
104
112
  // checkMethod () {},
105
113
  modalOptions: {
106
114
  showMaximize: true,
@@ -309,6 +317,9 @@ VxeUI.setIcon({
309
317
  TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
310
318
  TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
311
319
  TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
320
+ TABLE_AGGREGATION_GROUPING: iconPrefix + 'grouping',
321
+ TABLE_AGGREGATION_VALUES: iconPrefix + 'values',
322
+ TABLE_AGGREGATION_DELETE: iconPrefix + 'close',
312
323
 
313
324
  // toolbar
314
325
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',