vxe-table 3.4.14-beta.3 → 3.5.0-beta.1

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 (171) hide show
  1. package/README.md +2 -6
  2. package/helper/vetur/attributes.json +30 -10
  3. package/helper/vetur/tags.json +7 -2
  4. package/lib/button/src/button.js +19 -9
  5. package/lib/button/src/button.min.js +1 -1
  6. package/lib/checkbox/src/checkbox.js +2 -2
  7. package/lib/checkbox/src/checkbox.min.js +1 -1
  8. package/lib/edit/src/mixin.js +26 -18
  9. package/lib/edit/src/mixin.min.js +1 -1
  10. package/lib/export/src/export-panel.js +2 -2
  11. package/lib/export/src/export-panel.min.js +1 -1
  12. package/lib/export/src/import-panel.js +2 -2
  13. package/lib/export/src/import-panel.min.js +1 -1
  14. package/lib/export/src/mixin.js +26 -24
  15. package/lib/export/src/mixin.min.js +1 -1
  16. package/lib/filter/src/mixin.js +4 -4
  17. package/lib/filter/src/mixin.min.js +1 -1
  18. package/lib/filter/src/panel.js +2 -2
  19. package/lib/filter/src/panel.min.js +1 -1
  20. package/lib/footer/src/footer.js +7 -4
  21. package/lib/footer/src/footer.min.js +1 -1
  22. package/lib/form/src/form-gather.js +2 -2
  23. package/lib/form/src/form-gather.min.js +1 -1
  24. package/lib/form/src/form-item.js +10 -5
  25. package/lib/form/src/form-item.min.js +1 -1
  26. package/lib/form/src/form.js +72 -83
  27. package/lib/form/src/form.min.js +1 -1
  28. package/lib/form/src/render.js +17 -14
  29. package/lib/form/src/render.min.js +1 -1
  30. package/lib/form/src/util.js +13 -2
  31. package/lib/form/src/util.min.js +1 -1
  32. package/lib/grid/src/grid.js +44 -34
  33. package/lib/grid/src/grid.min.js +1 -1
  34. package/lib/header/src/header.js +10 -8
  35. package/lib/header/src/header.min.js +1 -1
  36. package/lib/index.css +1 -1
  37. package/lib/index.umd.js +2301 -2267
  38. package/lib/index.umd.min.js +1 -2
  39. package/lib/input/src/input.js +30 -18
  40. package/lib/input/src/input.min.js +1 -1
  41. package/lib/keyboard/src/mixin.js +12 -8
  42. package/lib/keyboard/src/mixin.min.js +1 -1
  43. package/lib/list/src/list.js +7 -5
  44. package/lib/list/src/list.min.js +1 -1
  45. package/lib/menu/src/mixin.js +24 -14
  46. package/lib/menu/src/mixin.min.js +1 -1
  47. package/lib/menu/src/panel.js +3 -3
  48. package/lib/menu/src/panel.min.js +1 -1
  49. package/lib/modal/src/modal.js +24 -12
  50. package/lib/modal/src/modal.min.js +1 -1
  51. package/lib/pulldown/src/pulldown.js +16 -12
  52. package/lib/pulldown/src/pulldown.min.js +1 -1
  53. package/lib/radio/src/button.js +2 -2
  54. package/lib/radio/src/button.min.js +1 -1
  55. package/lib/radio/src/radio.js +2 -2
  56. package/lib/radio/src/radio.min.js +1 -1
  57. package/lib/select/src/select.js +26 -16
  58. package/lib/select/src/select.min.js +1 -1
  59. package/lib/select/style/style.css +1 -1
  60. package/lib/select/style/style.min.css +1 -1
  61. package/lib/style.css +1 -1
  62. package/lib/style.min.css +1 -1
  63. package/lib/switch/src/switch.js +4 -4
  64. package/lib/switch/src/switch.min.js +1 -1
  65. package/lib/table/src/body.js +36 -38
  66. package/lib/table/src/body.min.js +1 -1
  67. package/lib/table/src/cell.js +22 -14
  68. package/lib/table/src/cell.min.js +1 -1
  69. package/lib/table/src/column.js +6 -4
  70. package/lib/table/src/column.min.js +1 -1
  71. package/lib/table/src/columnInfo.js +202 -0
  72. package/lib/table/src/columnInfo.min.js +1 -0
  73. package/lib/table/src/methods.js +241 -242
  74. package/lib/table/src/methods.min.js +1 -1
  75. package/lib/table/src/table.js +99 -124
  76. package/lib/table/src/table.min.js +1 -1
  77. package/lib/table/src/util.js +38 -3
  78. package/lib/table/src/util.min.js +1 -1
  79. package/lib/textarea/src/textarea.js +2 -2
  80. package/lib/textarea/src/textarea.min.js +1 -1
  81. package/lib/toolbar/src/toolbar.js +16 -10
  82. package/lib/toolbar/src/toolbar.min.js +1 -1
  83. package/lib/tools/{src/dom.js → dom.js} +6 -8
  84. package/lib/tools/dom.min.js +1 -0
  85. package/lib/tools/{src/event.js → event.js} +3 -6
  86. package/lib/tools/event.min.js +1 -0
  87. package/lib/tools/log.js +29 -0
  88. package/lib/tools/log.min.js +1 -0
  89. package/lib/tools/{src/resize.js → resize.js} +1 -1
  90. package/lib/tools/resize.min.js +1 -0
  91. package/lib/tools/utils.js +155 -0
  92. package/lib/tools/utils.min.js +1 -0
  93. package/lib/tooltip/src/tooltip.js +138 -76
  94. package/lib/tooltip/src/tooltip.min.js +1 -1
  95. package/lib/tooltip/style/style.css +1 -1
  96. package/lib/tooltip/style/style.min.css +1 -1
  97. package/lib/v-x-e-table/index.js +7 -4
  98. package/lib/v-x-e-table/index.min.js +1 -1
  99. package/lib/v-x-e-table/src/conf.js +12 -7
  100. package/lib/v-x-e-table/src/conf.min.js +1 -1
  101. package/lib/v-x-e-table/src/interceptor.js +4 -4
  102. package/lib/v-x-e-table/src/interceptor.min.js +1 -1
  103. package/lib/v-x-e-table/src/renderer.js +18 -10
  104. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  105. package/lib/v-x-e-table/src/store.js +3 -3
  106. package/lib/v-x-e-table/src/store.min.js +1 -1
  107. package/lib/validator/src/mixin.js +4 -4
  108. package/lib/validator/src/mixin.min.js +1 -1
  109. package/package.json +3 -3
  110. package/packages/button/src/button.js +4 -2
  111. package/packages/checkbox/src/checkbox.js +2 -2
  112. package/packages/edit/src/mixin.js +7 -6
  113. package/packages/export/src/export-panel.js +1 -1
  114. package/packages/export/src/import-panel.js +1 -1
  115. package/packages/export/src/mixin.js +20 -19
  116. package/packages/filter/src/mixin.js +3 -3
  117. package/packages/filter/src/panel.js +1 -1
  118. package/packages/footer/src/footer.js +4 -2
  119. package/packages/form/src/form-gather.js +2 -2
  120. package/packages/form/src/form-item.js +9 -4
  121. package/packages/form/src/form.js +41 -48
  122. package/packages/form/src/render.js +9 -9
  123. package/packages/form/src/util.js +9 -2
  124. package/packages/grid/src/grid.js +22 -20
  125. package/packages/header/src/header.js +3 -2
  126. package/packages/input/src/input.js +6 -3
  127. package/packages/keyboard/src/mixin.js +1 -2
  128. package/packages/list/src/list.js +3 -2
  129. package/packages/menu/src/mixin.js +5 -3
  130. package/packages/menu/src/panel.js +3 -3
  131. package/packages/modal/src/modal.js +7 -4
  132. package/packages/pulldown/src/pulldown.js +3 -1
  133. package/packages/radio/src/button.js +2 -2
  134. package/packages/radio/src/radio.js +2 -2
  135. package/packages/select/src/select.js +5 -3
  136. package/packages/switch/src/switch.js +4 -4
  137. package/packages/table/src/body.js +25 -27
  138. package/packages/table/src/cell.js +8 -7
  139. package/packages/table/src/column.js +4 -2
  140. package/packages/table/src/columnInfo.js +149 -0
  141. package/packages/table/src/methods.js +90 -101
  142. package/packages/table/src/table.js +68 -98
  143. package/packages/table/src/util.js +19 -1
  144. package/packages/textarea/src/textarea.js +2 -2
  145. package/packages/toolbar/src/toolbar.js +7 -4
  146. package/packages/tools/{src/dom.js → dom.js} +6 -6
  147. package/packages/tools/{src/event.js → event.js} +1 -3
  148. package/packages/tools/log.js +16 -0
  149. package/packages/tools/{src/resize.js → resize.js} +1 -1
  150. package/packages/tools/utils.js +108 -0
  151. package/packages/tooltip/src/tooltip.js +90 -46
  152. package/packages/v-x-e-table/index.js +4 -2
  153. package/packages/v-x-e-table/src/conf.js +12 -7
  154. package/packages/v-x-e-table/src/interceptor.js +3 -3
  155. package/packages/v-x-e-table/src/renderer.js +4 -3
  156. package/packages/v-x-e-table/src/store.js +2 -2
  157. package/packages/validator/src/mixin.js +3 -3
  158. package/styles/select.scss +1 -1
  159. package/styles/tooltip.scss +1 -1
  160. package/types/v-x-e-table/index.d.ts +8 -0
  161. package/README.en.md +0 -170
  162. package/README.zh-TW.md +0 -174
  163. package/lib/tools/index.js +0 -76
  164. package/lib/tools/index.min.js +0 -1
  165. package/lib/tools/src/dom.min.js +0 -1
  166. package/lib/tools/src/event.min.js +0 -1
  167. package/lib/tools/src/resize.min.js +0 -1
  168. package/lib/tools/src/utils.js +0 -365
  169. package/lib/tools/src/utils.min.js +0 -1
  170. package/packages/tools/index.js +0 -14
  171. package/packages/tools/src/utils.js +0 -272
@@ -2,11 +2,11 @@ import XEUtils from 'xe-utils'
2
2
  import GlobalConfig from '../../v-x-e-table/src/conf'
3
3
  import Cell from './cell'
4
4
  import VXETable from '../../v-x-e-table'
5
- import { UtilTools, DomTools } from '../../tools'
6
5
  import { clearTableAllStatus, handleFieldOrColumn, restoreScrollLocation, restoreScrollListener, toTreePathSeq } from './util'
7
- import { eqEmptyValue, isEnableConf } from '../../tools/src/utils'
8
- import { browse, getPaddingTopBottomSize, setScrollTop, setScrollLeft } from '../../tools/src/dom'
6
+ import UtilTools, { eqEmptyValue, isEnableConf, getFuncText } from '../../tools/utils'
7
+ import DomTools, { browse, getPaddingTopBottomSize, setScrollTop, setScrollLeft } from '../../tools/dom'
9
8
  import { formats } from '../../v-x-e-table/src/formats'
9
+ import { warnLog, errLog } from '../../tools/log'
10
10
 
11
11
  const { getRowid, getRowkey, setCellValue, hasChildrenList, getColumnList } = UtilTools
12
12
  const { calcHeight, hasClass, addClass, removeClass, getEventTargetNode, isNodeElement } = DomTools
@@ -360,23 +360,23 @@ const Methods = {
360
360
  if (treeOpts.transform) {
361
361
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
362
362
  if (!treeOpts.rowField) {
363
- UtilTools.error('vxe.error.reqProp', ['table.tree-config.rowField'])
363
+ errLog('vxe.error.reqProp', ['table.tree-config.rowField'])
364
364
  }
365
365
  if (!treeOpts.parentField) {
366
- UtilTools.error('vxe.error.reqProp', ['table.tree-config.parentField'])
366
+ errLog('vxe.error.reqProp', ['table.tree-config.parentField'])
367
367
  }
368
368
  if (!treeOpts.children) {
369
- UtilTools.error('vxe.error.reqProp', ['tree-config.children'])
369
+ errLog('vxe.error.reqProp', ['tree-config.children'])
370
370
  }
371
371
  if (!treeOpts.mapChildren) {
372
- UtilTools.error('vxe.error.reqProp', ['tree-config.mapChildren'])
372
+ errLog('vxe.error.reqProp', ['tree-config.mapChildren'])
373
373
  }
374
374
  if (treeOpts.children === treeOpts.mapChildren) {
375
- UtilTools.error('vxe.error.errConflicts', ['tree-config.children', 'tree-config.mapChildren'])
375
+ errLog('vxe.error.errConflicts', ['tree-config.children', 'tree-config.mapChildren'])
376
376
  }
377
377
  fullData.forEach(row => {
378
378
  if (row[treeOpts.children] && row[treeOpts.children].length) {
379
- UtilTools.warn('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
379
+ warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
380
380
  }
381
381
  })
382
382
  }
@@ -413,13 +413,13 @@ const Methods = {
413
413
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
414
414
  if (sYLoad) {
415
415
  if (!(this.height || this.maxHeight)) {
416
- UtilTools.error('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}'])
416
+ errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}'])
417
417
  }
418
418
  if (!this.showOverflow) {
419
- UtilTools.warn('vxe.error.reqProp', ['table.show-overflow'])
419
+ warnLog('vxe.error.reqProp', ['table.show-overflow'])
420
420
  }
421
421
  if (this.spanMethod) {
422
- UtilTools.warn('vxe.error.scrollErrProp', ['table.span-method'])
422
+ warnLog('vxe.error.scrollErrProp', ['table.span-method'])
423
423
  }
424
424
  }
425
425
  }
@@ -520,7 +520,7 @@ const Methods = {
520
520
  this.tableData = tableData.slice(0)
521
521
  } else {
522
522
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
523
- UtilTools.warn('vxe.error.reqProp', ['keep-source'])
523
+ warnLog('vxe.error.reqProp', ['keep-source'])
524
524
  }
525
525
  }
526
526
  return this.$nextTick()
@@ -560,7 +560,7 @@ const Methods = {
560
560
  this.handleTableData(true)
561
561
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
562
562
  if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
563
- UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand'])
563
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
564
564
  }
565
565
  }
566
566
  return this.$nextTick().then(() => {
@@ -660,7 +660,7 @@ const Methods = {
660
660
  if (property) {
661
661
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
662
662
  if (fullColumnFieldData[property]) {
663
- UtilTools.warn('vxe.error.colRepet', ['field', property])
663
+ warnLog('vxe.error.colRepet', ['field', property])
664
664
  }
665
665
  }
666
666
  fullColumnFieldData[property] = rest
@@ -671,7 +671,7 @@ const Methods = {
671
671
  if (treeNode) {
672
672
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
673
673
  if (treeNodeColumn) {
674
- UtilTools.warn('vxe.error.colRepet', ['tree-node', treeNode])
674
+ warnLog('vxe.error.colRepet', ['tree-node', treeNode])
675
675
  }
676
676
  }
677
677
  if (!treeNodeColumn) {
@@ -680,7 +680,7 @@ const Methods = {
680
680
  } else if (type === 'expand') {
681
681
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
682
682
  if (expandColumn) {
683
- UtilTools.warn('vxe.error.colRepet', ['type', type])
683
+ warnLog('vxe.error.colRepet', ['type', type])
684
684
  }
685
685
  }
686
686
  if (!expandColumn) {
@@ -690,14 +690,14 @@ const Methods = {
690
690
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
691
691
  if (type === 'checkbox') {
692
692
  if (checkboxColumn) {
693
- UtilTools.warn('vxe.error.colRepet', ['type', type])
693
+ warnLog('vxe.error.colRepet', ['type', type])
694
694
  }
695
695
  if (!checkboxColumn) {
696
696
  checkboxColumn = column
697
697
  }
698
698
  } else if (type === 'radio') {
699
699
  if (radioColumn) {
700
- UtilTools.warn('vxe.error.colRepet', ['type', type])
700
+ warnLog('vxe.error.colRepet', ['type', type])
701
701
  }
702
702
  if (!radioColumn) {
703
703
  radioColumn = column
@@ -706,20 +706,20 @@ const Methods = {
706
706
  }
707
707
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
708
708
  if (this.showOverflow && column.showOverflow === false) {
709
- UtilTools.warn('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`])
709
+ warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`])
710
710
  }
711
711
  if (this.showHeaderOverflow && column.showHeaderOverflow === false) {
712
- UtilTools.warn('vxe.error.errConflicts', [`table.show-header-overflow=${this.showHeaderOverflow}`, `column.show-header-overflow=${column.showHeaderOverflow}`])
712
+ warnLog('vxe.error.errConflicts', [`table.show-header-overflow=${this.showHeaderOverflow}`, `column.show-header-overflow=${column.showHeaderOverflow}`])
713
713
  }
714
714
  if (this.showFooterOverflow && column.showFooterOverflow === false) {
715
- UtilTools.warn('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`])
715
+ warnLog('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`])
716
716
  }
717
717
  }
718
718
  if (isAllOverflow && column.showOverflow === false) {
719
719
  isAllOverflow = false
720
720
  }
721
721
  if (fullColumnIdData[colid]) {
722
- UtilTools.error('vxe.error.colRepet', ['colId', colid])
722
+ errLog('vxe.error.colRepet', ['colId', colid])
723
723
  }
724
724
  fullColumnIdData[colid] = rest
725
725
  fullColumnMap.set(column, rest)
@@ -736,7 +736,7 @@ const Methods = {
736
736
 
737
737
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
738
738
  if (expandColumn && this.mouseOpts.area) {
739
- UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
739
+ errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
740
740
  }
741
741
  }
742
742
 
@@ -807,7 +807,7 @@ const Methods = {
807
807
  // 在 v3 中废弃
808
808
  _getRowIndex (row) {
809
809
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
810
- UtilTools.warn('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex'])
810
+ warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex'])
811
811
  }
812
812
  return this.getVTRowIndex(row)
813
813
  },
@@ -821,7 +821,7 @@ const Methods = {
821
821
  // 在 v3 中废弃
822
822
  $getRowIndex (row) {
823
823
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
824
- UtilTools.warn('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex'])
824
+ warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex'])
825
825
  }
826
826
  return this.getVMRowIndex(row)
827
827
  },
@@ -842,7 +842,7 @@ const Methods = {
842
842
  // 在 v3 中废弃
843
843
  _getColumnIndex (column) {
844
844
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
845
- UtilTools.warn('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex'])
845
+ warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex'])
846
846
  }
847
847
  return this.getVTColumnIndex(column)
848
848
  },
@@ -856,7 +856,7 @@ const Methods = {
856
856
  // 在 v3 中废弃
857
857
  $getColumnIndex (column) {
858
858
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
859
- UtilTools.warn('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex'])
859
+ warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex'])
860
860
  }
861
861
  return this.getVMColumnIndex(column)
862
862
  },
@@ -938,7 +938,7 @@ const Methods = {
938
938
  const { keepSource, tableSourceData, treeConfig } = this
939
939
  if (!keepSource) {
940
940
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
941
- UtilTools.warn('vxe.error.reqProp', ['keep-source'])
941
+ warnLog('vxe.error.reqProp', ['keep-source'])
942
942
  }
943
943
  return this.$nextTick()
944
944
  }
@@ -1430,7 +1430,7 @@ const Methods = {
1430
1430
  if (customConfig && (isResizable || isVisible)) {
1431
1431
  const customMap = {}
1432
1432
  if (!id) {
1433
- UtilTools.error('vxe.error.reqProp', ['id'])
1433
+ errLog('vxe.error.reqProp', ['id'])
1434
1434
  return
1435
1435
  }
1436
1436
  if (isResizable) {
@@ -1493,7 +1493,7 @@ const Methods = {
1493
1493
  const colHides = []
1494
1494
  const colShows = []
1495
1495
  if (!id) {
1496
- UtilTools.error('vxe.error.reqProp', ['id'])
1496
+ errLog('vxe.error.reqProp', ['id'])
1497
1497
  return
1498
1498
  }
1499
1499
  XEUtils.eachTree(collectColumn, column => {
@@ -1524,7 +1524,7 @@ const Methods = {
1524
1524
  const columnWidthStorageMap = getCustomStorageMap(resizableStorageKey)
1525
1525
  let columnWidthStorage
1526
1526
  if (!id) {
1527
- UtilTools.error('vxe.error.reqProp', ['id'])
1527
+ errLog('vxe.error.reqProp', ['id'])
1528
1528
  return
1529
1529
  }
1530
1530
  if (!isReset) {
@@ -1573,7 +1573,7 @@ const Methods = {
1573
1573
  column.fixed = parent.fixed
1574
1574
  }
1575
1575
  if (parent && column.fixed !== parent.fixed) {
1576
- UtilTools.error('vxe.error.groupFixed')
1576
+ errLog('vxe.error.groupFixed')
1577
1577
  }
1578
1578
  if (isColGroup) {
1579
1579
  column.visible = !!XEUtils.findTree(column.children, subColumn => hasChildrenList(subColumn) ? null : subColumn.visible)
@@ -1620,22 +1620,22 @@ const Methods = {
1620
1620
  if (scrollXLoad && isGroup) {
1621
1621
  scrollXLoad = false
1622
1622
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1623
- UtilTools.warn('vxe.error.scrollXNotGroup')
1623
+ warnLog('vxe.error.scrollXNotGroup')
1624
1624
  }
1625
1625
  }
1626
1626
  if (scrollXLoad) {
1627
1627
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1628
1628
  if (this.showHeader && !this.showHeaderOverflow) {
1629
- UtilTools.warn('vxe.error.reqProp', ['show-header-overflow'])
1629
+ warnLog('vxe.error.reqProp', ['show-header-overflow'])
1630
1630
  }
1631
1631
  if (this.showFooter && !this.showFooterOverflow) {
1632
- UtilTools.warn('vxe.error.reqProp', ['show-footer-overflow'])
1632
+ warnLog('vxe.error.reqProp', ['show-footer-overflow'])
1633
1633
  }
1634
1634
  if (this.spanMethod) {
1635
- UtilTools.warn('vxe.error.scrollErrProp', ['span-method'])
1635
+ warnLog('vxe.error.scrollErrProp', ['span-method'])
1636
1636
  }
1637
1637
  if (this.footerSpanMethod) {
1638
- UtilTools.warn('vxe.error.scrollErrProp', ['footer-span-method'])
1638
+ warnLog('vxe.error.scrollErrProp', ['footer-span-method'])
1639
1639
  }
1640
1640
  }
1641
1641
  const { visibleSize } = computeVirtualX(this)
@@ -1902,10 +1902,6 @@ const Methods = {
1902
1902
  footerSpanMethod,
1903
1903
  isAllOverflow,
1904
1904
  visibleColumn
1905
- // isMergeLeftFixedExceeded,
1906
- // isMergeRightFixedExceeded,
1907
- // isMergeFooterLeftFixedExceeded,
1908
- // isMergeFooterRightFixedExceeded
1909
1905
  } = this
1910
1906
  const containerList = ['main', 'left', 'right']
1911
1907
  const emptyPlaceholderElem = $refs.emptyPlaceholder
@@ -2023,14 +2019,6 @@ const Methods = {
2023
2019
  tableColumn = fixedColumn
2024
2020
  } else {
2025
2021
  tableColumn = visibleColumn
2026
- // 检查固定列是否被合并,合并范围是否超出固定列
2027
- // if (mergeList.length && !isMergeLeftFixedExceeded && fixedType === 'left') {
2028
- // tableColumn = fixedColumn
2029
- // } else if (mergeList.length && !isMergeRightFixedExceeded && fixedType === 'right') {
2030
- // tableColumn = fixedColumn
2031
- // } else {
2032
- // tableColumn = visibleColumn
2033
- // }
2034
2022
  }
2035
2023
  } else {
2036
2024
  tableColumn = visibleColumn
@@ -2056,14 +2044,6 @@ const Methods = {
2056
2044
  tableColumn = fixedColumn
2057
2045
  } else {
2058
2046
  tableColumn = visibleColumn
2059
- // 检查固定列是否被合并,合并范围是否超出固定列
2060
- // if (mergeFooterList.length && !isMergeFooterLeftFixedExceeded && fixedType === 'left') {
2061
- // tableColumn = fixedColumn
2062
- // } else if (mergeFooterList.length && !isMergeFooterRightFixedExceeded && fixedType === 'right') {
2063
- // tableColumn = fixedColumn
2064
- // } else {
2065
- // tableColumn = visibleColumn
2066
- // }
2067
2047
  }
2068
2048
  } else {
2069
2049
  tableColumn = visibleColumn
@@ -2284,6 +2264,7 @@ const Methods = {
2284
2264
  const isEsc = keyCode === 27
2285
2265
  if (isEsc) {
2286
2266
  this.preventEvent(evnt, 'event.keydown', null, () => {
2267
+ this.emitEvent('keydown-start', {}, evnt)
2287
2268
  if (keyboardConfig && mouseConfig && mouseOpts.area && this.handleKeyboardEvent) {
2288
2269
  this.handleKeyboardEvent(evnt)
2289
2270
  } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
@@ -2304,6 +2285,7 @@ const Methods = {
2304
2285
  }
2305
2286
  }
2306
2287
  this.emitEvent('keydown', {}, evnt)
2288
+ this.emitEvent('keydown-end', {}, evnt)
2307
2289
  })
2308
2290
  }
2309
2291
  },
@@ -2549,27 +2531,27 @@ const Methods = {
2549
2531
  this.updateCellAreas()
2550
2532
  this.recalculate(true)
2551
2533
  },
2552
- handleTooltipLeaveMethod () {
2553
- const tooltipOpts = this.tooltipOpts
2554
- setTimeout(() => {
2555
- if (!this.tooltipActive) {
2556
- this.closeTooltip()
2557
- }
2558
- }, tooltipOpts.leaveDelay)
2559
- return false
2560
- },
2561
- handleTargetEnterEvent () {
2534
+ handleTargetEnterEvent (isClear) {
2535
+ const $tooltip = this.$refs.tooltip
2562
2536
  clearTimeout(this.tooltipTimeout)
2563
- this.tooltipActive = true
2564
- this.closeTooltip()
2537
+ if (isClear) {
2538
+ this.closeTooltip()
2539
+ } else {
2540
+ if ($tooltip) {
2541
+ $tooltip.setActived(true)
2542
+ }
2543
+ }
2565
2544
  },
2566
2545
  handleTargetLeaveEvent () {
2567
2546
  const tooltipOpts = this.tooltipOpts
2568
- this.tooltipActive = false
2547
+ let $tooltip = this.$refs.tooltip
2548
+ if ($tooltip) {
2549
+ $tooltip.setActived(false)
2550
+ }
2569
2551
  if (tooltipOpts.enterable) {
2570
2552
  this.tooltipTimeout = setTimeout(() => {
2571
- const tooltip = this.$refs.tooltip
2572
- if (tooltip && !tooltip.isHover) {
2553
+ $tooltip = this.$refs.tooltip
2554
+ if ($tooltip && !$tooltip.isActived()) {
2573
2555
  this.closeTooltip()
2574
2556
  }
2575
2557
  }, tooltipOpts.leaveDelay)
@@ -2579,16 +2561,19 @@ const Methods = {
2579
2561
  },
2580
2562
  triggerHeaderHelpEvent (evnt, params) {
2581
2563
  const { column } = params
2582
- const { titleHelp } = column
2583
- if (titleHelp.content || titleHelp.message) {
2564
+ const titlePrefix = column.titlePrefix || column.titleHelp
2565
+ if (titlePrefix.content || titlePrefix.message) {
2584
2566
  const { $refs, tooltipStore } = this
2585
- const tooltip = $refs.tooltip
2586
- const content = UtilTools.getFuncText(titleHelp.content || titleHelp.message)
2587
- this.handleTargetEnterEvent()
2567
+ const content = getFuncText(titlePrefix.content || titlePrefix.message)
2568
+ this.handleTargetEnterEvent(true)
2588
2569
  tooltipStore.visible = true
2589
- if (tooltip) {
2590
- tooltip.open(evnt.currentTarget, content)
2591
- }
2570
+ tooltipStore.currOpts = { ...titlePrefix, content: null }
2571
+ this.$nextTick(() => {
2572
+ const $tooltip = $refs.tooltip
2573
+ if ($tooltip) {
2574
+ $tooltip.open(evnt.currentTarget, content)
2575
+ }
2576
+ })
2592
2577
  }
2593
2578
  },
2594
2579
  /**
@@ -2598,7 +2583,7 @@ const Methods = {
2598
2583
  const { tooltipStore } = this
2599
2584
  const { column } = params
2600
2585
  const titleElem = evnt.currentTarget
2601
- this.handleTargetEnterEvent()
2586
+ this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row)
2602
2587
  if (tooltipStore.column !== column || !tooltipStore.visible) {
2603
2588
  this.handleTooltip(evnt, titleElem, titleElem, null, params)
2604
2589
  }
@@ -2611,7 +2596,7 @@ const Methods = {
2611
2596
  const { actived } = editStore
2612
2597
  const { row, column } = params
2613
2598
  const cell = evnt.currentTarget
2614
- this.handleTargetEnterEvent()
2599
+ this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row)
2615
2600
  if (isEnableConf(editConfig)) {
2616
2601
  if ((editOpts.mode === 'row' && actived.row === row) || (actived.row === row && actived.column === column)) {
2617
2602
  return
@@ -2638,7 +2623,7 @@ const Methods = {
2638
2623
  const { column } = params
2639
2624
  const { tooltipStore } = this
2640
2625
  const cell = evnt.currentTarget
2641
- this.handleTargetEnterEvent()
2626
+ this.handleTargetEnterEvent(true)
2642
2627
  if (tooltipStore.column !== column || !tooltipStore.visible) {
2643
2628
  this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params)
2644
2629
  }
@@ -2654,7 +2639,6 @@ const Methods = {
2654
2639
  const { $refs, tooltipOpts, tooltipStore } = this
2655
2640
  const { column, row } = params
2656
2641
  const { showAll, enabled, contentMethod } = tooltipOpts
2657
- const tooltip = $refs.tooltip
2658
2642
  const customContent = contentMethod ? contentMethod(params) : null
2659
2643
  const useCustom = contentMethod && !XEUtils.eqNull(customContent)
2660
2644
  const content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim()
@@ -2663,11 +2647,15 @@ const Methods = {
2663
2647
  Object.assign(tooltipStore, {
2664
2648
  row,
2665
2649
  column,
2666
- visible: true
2650
+ visible: true,
2651
+ currOpts: null
2652
+ })
2653
+ this.$nextTick(() => {
2654
+ const $tooltip = $refs.tooltip
2655
+ if ($tooltip) {
2656
+ $tooltip.open(isCellOverflow ? overflowElem : (tipElem || overflowElem), UtilTools.formatText(content))
2657
+ }
2667
2658
  })
2668
- if (tooltip) {
2669
- tooltip.open(isCellOverflow ? overflowElem : (tipElem || overflowElem), UtilTools.formatText(content))
2670
- }
2671
2659
  }
2672
2660
  return this.$nextTick()
2673
2661
  },
@@ -2691,7 +2679,8 @@ const Methods = {
2691
2679
  row: null,
2692
2680
  column: null,
2693
2681
  content: null,
2694
- visible: false
2682
+ visible: false,
2683
+ currOpts: null
2695
2684
  })
2696
2685
  if (tooltip) {
2697
2686
  tooltip.close()
@@ -2715,7 +2704,7 @@ const Methods = {
2715
2704
  return !this.isAllSelected && this.isIndeterminate
2716
2705
  },
2717
2706
  isCheckboxIndeterminate () {
2718
- UtilTools.warn('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate'])
2707
+ warnLog('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate'])
2719
2708
  return this.isAllCheckboxIndeterminate()
2720
2709
  },
2721
2710
  /**
@@ -3623,7 +3612,7 @@ const Methods = {
3623
3612
  // 在 v3 中废弃
3624
3613
  getSortColumn () {
3625
3614
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
3626
- UtilTools.warn('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
3615
+ warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
3627
3616
  }
3628
3617
  return XEUtils.find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order)
3629
3618
  },
@@ -3706,7 +3695,7 @@ const Methods = {
3706
3695
  },
3707
3696
  reloadExpandContent (row) {
3708
3697
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
3709
- UtilTools.warn('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
3698
+ warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
3710
3699
  }
3711
3700
  // 即将废弃
3712
3701
  return this.reloadRowExpand(row)
@@ -3917,7 +3906,7 @@ const Methods = {
3917
3906
  },
3918
3907
  reloadTreeChilds (row) {
3919
3908
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
3920
- UtilTools.warn('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand'])
3909
+ warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand'])
3921
3910
  }
3922
3911
  // 即将废弃
3923
3912
  return this.reloadTreeExpand(row)
@@ -4478,7 +4467,7 @@ const Methods = {
4478
4467
  */
4479
4468
  setMergeCells (merges) {
4480
4469
  if (this.spanMethod) {
4481
- UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method'])
4470
+ errLog('vxe.error.errConflicts', ['merge-cells', 'span-method'])
4482
4471
  }
4483
4472
  setMerges(this, merges, this.mergeList, this.afterFullData)
4484
4473
  return this.$nextTick().then(() => this.updateCellAreas())
@@ -4489,7 +4478,7 @@ const Methods = {
4489
4478
  */
4490
4479
  removeMergeCells (merges) {
4491
4480
  if (this.spanMethod) {
4492
- UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method'])
4481
+ errLog('vxe.error.errConflicts', ['merge-cells', 'span-method'])
4493
4482
  }
4494
4483
  const rest = removeMerges(this, merges, this.mergeList, this.afterFullData)
4495
4484
  return this.$nextTick().then(() => {
@@ -4515,14 +4504,14 @@ const Methods = {
4515
4504
  },
4516
4505
  setMergeFooterItems (merges) {
4517
4506
  if (this.footerSpanMethod) {
4518
- UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method'])
4507
+ errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method'])
4519
4508
  }
4520
4509
  setMerges(this, merges, this.mergeFooterList, null)
4521
4510
  return this.$nextTick().then(() => this.updateCellAreas())
4522
4511
  },
4523
4512
  removeMergeFooterItems (merges) {
4524
4513
  if (this.footerSpanMethod) {
4525
- UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method'])
4514
+ errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method'])
4526
4515
  }
4527
4516
  const rest = removeMerges(this, merges, this.mergeFooterList, null)
4528
4517
  return this.$nextTick().then(() => {
@@ -4572,7 +4561,7 @@ const Methods = {
4572
4561
  $toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: this })
4573
4562
  this.$toolbar = $toolbar
4574
4563
  } else {
4575
- UtilTools.error('vxe.error.barUnableLink')
4564
+ errLog('vxe.error.barUnableLink')
4576
4565
  }
4577
4566
  return this.$nextTick()
4578
4567
  },
@@ -4643,9 +4632,9 @@ funcs.forEach(name => {
4643
4632
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
4644
4633
  if (!this[`_${name}`]) {
4645
4634
  if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
4646
- UtilTools.error('vxe.error.reqModule', ['Export'])
4635
+ errLog('vxe.error.reqModule', ['Export'])
4647
4636
  } else if ('clearValidate,fullValidate,validate'.split(',').includes(name)) {
4648
- UtilTools.error('vxe.error.reqModule', ['Validator'])
4637
+ errLog('vxe.error.reqModule', ['Validator'])
4649
4638
  }
4650
4639
  }
4651
4640
  }