vxe-table 3.4.14-beta.2 → 3.5.0-beta.0
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.
- package/README.md +2 -6
- package/lib/button/src/button.js +19 -9
- package/lib/button/src/button.min.js +1 -1
- package/lib/checkbox/src/checkbox.js +2 -2
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/edit/src/mixin.js +26 -18
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/export-panel.js +2 -2
- package/lib/export/src/export-panel.min.js +1 -1
- package/lib/export/src/import-panel.js +2 -2
- package/lib/export/src/import-panel.min.js +1 -1
- package/lib/export/src/mixin.js +26 -24
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +28 -21
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +2 -2
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/footer/src/footer.js +7 -4
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form-gather.js +2 -2
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +8 -3
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +48 -38
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +5 -5
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/src/util.js +13 -2
- package/lib/form/src/util.min.js +1 -1
- package/lib/grid/src/grid.js +44 -34
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +10 -8
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.umd.js +2322 -2170
- package/lib/index.umd.min.js +1 -2
- package/lib/input/src/input.js +30 -18
- package/lib/input/src/input.min.js +1 -1
- package/lib/keyboard/src/mixin.js +12 -8
- package/lib/keyboard/src/mixin.min.js +1 -1
- package/lib/list/src/list.js +7 -5
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/mixin.js +24 -14
- package/lib/menu/src/mixin.min.js +1 -1
- package/lib/menu/src/panel.js +3 -3
- package/lib/menu/src/panel.min.js +1 -1
- package/lib/modal/src/modal.js +24 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +16 -12
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +2 -2
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/radio.js +2 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/src/select.js +26 -16
- package/lib/select/src/select.min.js +1 -1
- package/lib/switch/src/switch.js +4 -4
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/table/src/body.js +46 -22
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +19 -11
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -3
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +201 -0
- package/lib/table/src/columnInfo.min.js +1 -0
- package/lib/table/src/methods.js +339 -307
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +80 -62
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +38 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/textarea/src/textarea.js +2 -2
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +16 -10
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/tools/{src/dom.js → dom.js} +12 -1
- package/lib/tools/dom.min.js +1 -0
- package/lib/tools/{src/event.js → event.js} +3 -6
- package/lib/tools/event.min.js +1 -0
- package/lib/tools/log.js +29 -0
- package/lib/tools/log.min.js +1 -0
- package/lib/tools/{src/resize.js → resize.js} +1 -1
- package/lib/tools/resize.min.js +1 -0
- package/lib/tools/utils.js +155 -0
- package/lib/tools/utils.min.js +1 -0
- package/lib/tooltip/src/tooltip.js +89 -50
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/v-x-e-table/index.js +7 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +4 -1
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/interceptor.js +4 -4
- package/lib/v-x-e-table/src/interceptor.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +18 -10
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +3 -3
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/validator/src/mixin.js +4 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +3 -3
- package/packages/button/src/button.js +4 -2
- package/packages/checkbox/src/checkbox.js +2 -2
- package/packages/edit/src/mixin.js +7 -6
- package/packages/export/src/export-panel.js +1 -1
- package/packages/export/src/import-panel.js +1 -1
- package/packages/export/src/mixin.js +20 -19
- package/packages/filter/src/mixin.js +18 -14
- package/packages/filter/src/panel.js +1 -1
- package/packages/footer/src/footer.js +4 -2
- package/packages/form/src/form-gather.js +2 -2
- package/packages/form/src/form-item.js +7 -2
- package/packages/form/src/form.js +29 -23
- package/packages/form/src/render.js +4 -4
- package/packages/form/src/util.js +9 -2
- package/packages/grid/src/grid.js +22 -20
- package/packages/header/src/header.js +3 -2
- package/packages/input/src/input.js +6 -3
- package/packages/keyboard/src/mixin.js +1 -2
- package/packages/list/src/list.js +3 -2
- package/packages/menu/src/mixin.js +5 -3
- package/packages/menu/src/panel.js +3 -3
- package/packages/modal/src/modal.js +7 -4
- package/packages/pulldown/src/pulldown.js +3 -1
- package/packages/radio/src/button.js +2 -2
- package/packages/radio/src/radio.js +2 -2
- package/packages/select/src/select.js +5 -3
- package/packages/switch/src/switch.js +4 -4
- package/packages/table/src/body.js +36 -17
- package/packages/table/src/cell.js +5 -4
- package/packages/table/src/column.js +1 -1
- package/packages/table/src/columnInfo.js +148 -0
- package/packages/table/src/methods.js +100 -75
- package/packages/table/src/table.js +56 -41
- package/packages/table/src/util.js +19 -1
- package/packages/textarea/src/textarea.js +2 -2
- package/packages/toolbar/src/toolbar.js +7 -4
- package/packages/tools/{src/dom.js → dom.js} +13 -1
- package/packages/tools/{src/event.js → event.js} +1 -3
- package/packages/tools/log.js +16 -0
- package/packages/tools/{src/resize.js → resize.js} +1 -1
- package/packages/tools/utils.js +108 -0
- package/packages/tooltip/src/tooltip.js +49 -24
- package/packages/v-x-e-table/index.js +4 -2
- package/packages/v-x-e-table/src/conf.js +4 -1
- package/packages/v-x-e-table/src/interceptor.js +3 -3
- package/packages/v-x-e-table/src/renderer.js +4 -3
- package/packages/v-x-e-table/src/store.js +2 -2
- package/packages/validator/src/mixin.js +3 -3
- package/types/v-x-e-table/index.d.ts +8 -0
- package/README.en.md +0 -170
- package/README.zh-TW.md +0 -174
- package/lib/tools/index.js +0 -76
- package/lib/tools/index.min.js +0 -1
- package/lib/tools/src/dom.min.js +0 -1
- package/lib/tools/src/event.min.js +0 -1
- package/lib/tools/src/resize.min.js +0 -1
- package/lib/tools/src/utils.js +0 -365
- package/lib/tools/src/utils.min.js +0 -1
- package/packages/tools/index.js +0 -14
- package/packages/tools/src/utils.js +0 -272
|
@@ -2,14 +2,14 @@ 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/
|
|
8
|
-
import { browse, getPaddingTopBottomSize, setScrollTop, setScrollLeft } from '../../tools/
|
|
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
|
-
const { calcHeight, hasClass, addClass, removeClass, getEventTargetNode } = DomTools
|
|
12
|
+
const { calcHeight, hasClass, addClass, removeClass, getEventTargetNode, isNodeElement } = DomTools
|
|
13
13
|
|
|
14
14
|
const isWebkit = browse['-webkit'] && !browse.edge
|
|
15
15
|
const debounceScrollYDuration = browse.msie ? 80 : 20
|
|
@@ -301,6 +301,7 @@ const Methods = {
|
|
|
301
301
|
const { scrollXLoad, scrollYLoad } = this
|
|
302
302
|
return this.handleTableData(true).then(() => {
|
|
303
303
|
this.updateFooter()
|
|
304
|
+
this.checkSelectionStatus()
|
|
304
305
|
if (scrollXLoad || scrollYLoad) {
|
|
305
306
|
if (scrollXLoad) {
|
|
306
307
|
this.updateScrollXSpace()
|
|
@@ -310,7 +311,13 @@ const Methods = {
|
|
|
310
311
|
}
|
|
311
312
|
return this.refreshScroll()
|
|
312
313
|
}
|
|
313
|
-
}).then(() =>
|
|
314
|
+
}).then(() => {
|
|
315
|
+
this.updateCellAreas()
|
|
316
|
+
return this.recalculate(true)
|
|
317
|
+
}).then(() => {
|
|
318
|
+
// 存在滚动行为未结束情况
|
|
319
|
+
setTimeout(() => this.recalculate(), 50)
|
|
320
|
+
})
|
|
314
321
|
},
|
|
315
322
|
handleTableData (force) {
|
|
316
323
|
const { scrollYLoad, scrollYStore, fullDataRowIdData, afterFullData } = this
|
|
@@ -353,23 +360,23 @@ const Methods = {
|
|
|
353
360
|
if (treeOpts.transform) {
|
|
354
361
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
355
362
|
if (!treeOpts.rowField) {
|
|
356
|
-
|
|
363
|
+
errLog('vxe.error.reqProp', ['table.tree-config.rowField'])
|
|
357
364
|
}
|
|
358
365
|
if (!treeOpts.parentField) {
|
|
359
|
-
|
|
366
|
+
errLog('vxe.error.reqProp', ['table.tree-config.parentField'])
|
|
360
367
|
}
|
|
361
368
|
if (!treeOpts.children) {
|
|
362
|
-
|
|
369
|
+
errLog('vxe.error.reqProp', ['tree-config.children'])
|
|
363
370
|
}
|
|
364
371
|
if (!treeOpts.mapChildren) {
|
|
365
|
-
|
|
372
|
+
errLog('vxe.error.reqProp', ['tree-config.mapChildren'])
|
|
366
373
|
}
|
|
367
374
|
if (treeOpts.children === treeOpts.mapChildren) {
|
|
368
|
-
|
|
375
|
+
errLog('vxe.error.errConflicts', ['tree-config.children', 'tree-config.mapChildren'])
|
|
369
376
|
}
|
|
370
377
|
fullData.forEach(row => {
|
|
371
378
|
if (row[treeOpts.children] && row[treeOpts.children].length) {
|
|
372
|
-
|
|
379
|
+
warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
|
|
373
380
|
}
|
|
374
381
|
})
|
|
375
382
|
}
|
|
@@ -406,13 +413,13 @@ const Methods = {
|
|
|
406
413
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
407
414
|
if (sYLoad) {
|
|
408
415
|
if (!(this.height || this.maxHeight)) {
|
|
409
|
-
|
|
416
|
+
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}'])
|
|
410
417
|
}
|
|
411
418
|
if (!this.showOverflow) {
|
|
412
|
-
|
|
419
|
+
warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
413
420
|
}
|
|
414
421
|
if (this.spanMethod) {
|
|
415
|
-
|
|
422
|
+
warnLog('vxe.error.scrollErrProp', ['table.span-method'])
|
|
416
423
|
}
|
|
417
424
|
}
|
|
418
425
|
}
|
|
@@ -513,7 +520,7 @@ const Methods = {
|
|
|
513
520
|
this.tableData = tableData.slice(0)
|
|
514
521
|
} else {
|
|
515
522
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
516
|
-
|
|
523
|
+
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
517
524
|
}
|
|
518
525
|
}
|
|
519
526
|
return this.$nextTick()
|
|
@@ -553,7 +560,7 @@ const Methods = {
|
|
|
553
560
|
this.handleTableData(true)
|
|
554
561
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
555
562
|
if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
|
|
556
|
-
|
|
563
|
+
warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
557
564
|
}
|
|
558
565
|
}
|
|
559
566
|
return this.$nextTick().then(() => {
|
|
@@ -653,7 +660,7 @@ const Methods = {
|
|
|
653
660
|
if (property) {
|
|
654
661
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
655
662
|
if (fullColumnFieldData[property]) {
|
|
656
|
-
|
|
663
|
+
warnLog('vxe.error.colRepet', ['field', property])
|
|
657
664
|
}
|
|
658
665
|
}
|
|
659
666
|
fullColumnFieldData[property] = rest
|
|
@@ -664,7 +671,7 @@ const Methods = {
|
|
|
664
671
|
if (treeNode) {
|
|
665
672
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
666
673
|
if (treeNodeColumn) {
|
|
667
|
-
|
|
674
|
+
warnLog('vxe.error.colRepet', ['tree-node', treeNode])
|
|
668
675
|
}
|
|
669
676
|
}
|
|
670
677
|
if (!treeNodeColumn) {
|
|
@@ -673,7 +680,7 @@ const Methods = {
|
|
|
673
680
|
} else if (type === 'expand') {
|
|
674
681
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
675
682
|
if (expandColumn) {
|
|
676
|
-
|
|
683
|
+
warnLog('vxe.error.colRepet', ['type', type])
|
|
677
684
|
}
|
|
678
685
|
}
|
|
679
686
|
if (!expandColumn) {
|
|
@@ -683,14 +690,14 @@ const Methods = {
|
|
|
683
690
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
684
691
|
if (type === 'checkbox') {
|
|
685
692
|
if (checkboxColumn) {
|
|
686
|
-
|
|
693
|
+
warnLog('vxe.error.colRepet', ['type', type])
|
|
687
694
|
}
|
|
688
695
|
if (!checkboxColumn) {
|
|
689
696
|
checkboxColumn = column
|
|
690
697
|
}
|
|
691
698
|
} else if (type === 'radio') {
|
|
692
699
|
if (radioColumn) {
|
|
693
|
-
|
|
700
|
+
warnLog('vxe.error.colRepet', ['type', type])
|
|
694
701
|
}
|
|
695
702
|
if (!radioColumn) {
|
|
696
703
|
radioColumn = column
|
|
@@ -699,20 +706,20 @@ const Methods = {
|
|
|
699
706
|
}
|
|
700
707
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
701
708
|
if (this.showOverflow && column.showOverflow === false) {
|
|
702
|
-
|
|
709
|
+
warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`])
|
|
703
710
|
}
|
|
704
711
|
if (this.showHeaderOverflow && column.showHeaderOverflow === false) {
|
|
705
|
-
|
|
712
|
+
warnLog('vxe.error.errConflicts', [`table.show-header-overflow=${this.showHeaderOverflow}`, `column.show-header-overflow=${column.showHeaderOverflow}`])
|
|
706
713
|
}
|
|
707
714
|
if (this.showFooterOverflow && column.showFooterOverflow === false) {
|
|
708
|
-
|
|
715
|
+
warnLog('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`])
|
|
709
716
|
}
|
|
710
717
|
}
|
|
711
718
|
if (isAllOverflow && column.showOverflow === false) {
|
|
712
719
|
isAllOverflow = false
|
|
713
720
|
}
|
|
714
721
|
if (fullColumnIdData[colid]) {
|
|
715
|
-
|
|
722
|
+
errLog('vxe.error.colRepet', ['colId', colid])
|
|
716
723
|
}
|
|
717
724
|
fullColumnIdData[colid] = rest
|
|
718
725
|
fullColumnMap.set(column, rest)
|
|
@@ -729,7 +736,7 @@ const Methods = {
|
|
|
729
736
|
|
|
730
737
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
731
738
|
if (expandColumn && this.mouseOpts.area) {
|
|
732
|
-
|
|
739
|
+
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
|
|
733
740
|
}
|
|
734
741
|
}
|
|
735
742
|
|
|
@@ -800,7 +807,7 @@ const Methods = {
|
|
|
800
807
|
// 在 v3 中废弃
|
|
801
808
|
_getRowIndex (row) {
|
|
802
809
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
803
|
-
|
|
810
|
+
warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex'])
|
|
804
811
|
}
|
|
805
812
|
return this.getVTRowIndex(row)
|
|
806
813
|
},
|
|
@@ -814,7 +821,7 @@ const Methods = {
|
|
|
814
821
|
// 在 v3 中废弃
|
|
815
822
|
$getRowIndex (row) {
|
|
816
823
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
817
|
-
|
|
824
|
+
warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex'])
|
|
818
825
|
}
|
|
819
826
|
return this.getVMRowIndex(row)
|
|
820
827
|
},
|
|
@@ -835,7 +842,7 @@ const Methods = {
|
|
|
835
842
|
// 在 v3 中废弃
|
|
836
843
|
_getColumnIndex (column) {
|
|
837
844
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
838
|
-
|
|
845
|
+
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex'])
|
|
839
846
|
}
|
|
840
847
|
return this.getVTColumnIndex(column)
|
|
841
848
|
},
|
|
@@ -849,7 +856,7 @@ const Methods = {
|
|
|
849
856
|
// 在 v3 中废弃
|
|
850
857
|
$getColumnIndex (column) {
|
|
851
858
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
852
|
-
|
|
859
|
+
warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex'])
|
|
853
860
|
}
|
|
854
861
|
return this.getVMColumnIndex(column)
|
|
855
862
|
},
|
|
@@ -931,7 +938,7 @@ const Methods = {
|
|
|
931
938
|
const { keepSource, tableSourceData, treeConfig } = this
|
|
932
939
|
if (!keepSource) {
|
|
933
940
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
934
|
-
|
|
941
|
+
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
935
942
|
}
|
|
936
943
|
return this.$nextTick()
|
|
937
944
|
}
|
|
@@ -1423,7 +1430,7 @@ const Methods = {
|
|
|
1423
1430
|
if (customConfig && (isResizable || isVisible)) {
|
|
1424
1431
|
const customMap = {}
|
|
1425
1432
|
if (!id) {
|
|
1426
|
-
|
|
1433
|
+
errLog('vxe.error.reqProp', ['id'])
|
|
1427
1434
|
return
|
|
1428
1435
|
}
|
|
1429
1436
|
if (isResizable) {
|
|
@@ -1486,7 +1493,7 @@ const Methods = {
|
|
|
1486
1493
|
const colHides = []
|
|
1487
1494
|
const colShows = []
|
|
1488
1495
|
if (!id) {
|
|
1489
|
-
|
|
1496
|
+
errLog('vxe.error.reqProp', ['id'])
|
|
1490
1497
|
return
|
|
1491
1498
|
}
|
|
1492
1499
|
XEUtils.eachTree(collectColumn, column => {
|
|
@@ -1517,7 +1524,7 @@ const Methods = {
|
|
|
1517
1524
|
const columnWidthStorageMap = getCustomStorageMap(resizableStorageKey)
|
|
1518
1525
|
let columnWidthStorage
|
|
1519
1526
|
if (!id) {
|
|
1520
|
-
|
|
1527
|
+
errLog('vxe.error.reqProp', ['id'])
|
|
1521
1528
|
return
|
|
1522
1529
|
}
|
|
1523
1530
|
if (!isReset) {
|
|
@@ -1566,7 +1573,7 @@ const Methods = {
|
|
|
1566
1573
|
column.fixed = parent.fixed
|
|
1567
1574
|
}
|
|
1568
1575
|
if (parent && column.fixed !== parent.fixed) {
|
|
1569
|
-
|
|
1576
|
+
errLog('vxe.error.groupFixed')
|
|
1570
1577
|
}
|
|
1571
1578
|
if (isColGroup) {
|
|
1572
1579
|
column.visible = !!XEUtils.findTree(column.children, subColumn => hasChildrenList(subColumn) ? null : subColumn.visible)
|
|
@@ -1613,22 +1620,22 @@ const Methods = {
|
|
|
1613
1620
|
if (scrollXLoad && isGroup) {
|
|
1614
1621
|
scrollXLoad = false
|
|
1615
1622
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
1616
|
-
|
|
1623
|
+
warnLog('vxe.error.scrollXNotGroup')
|
|
1617
1624
|
}
|
|
1618
1625
|
}
|
|
1619
1626
|
if (scrollXLoad) {
|
|
1620
1627
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
1621
1628
|
if (this.showHeader && !this.showHeaderOverflow) {
|
|
1622
|
-
|
|
1629
|
+
warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
1623
1630
|
}
|
|
1624
1631
|
if (this.showFooter && !this.showFooterOverflow) {
|
|
1625
|
-
|
|
1632
|
+
warnLog('vxe.error.reqProp', ['show-footer-overflow'])
|
|
1626
1633
|
}
|
|
1627
1634
|
if (this.spanMethod) {
|
|
1628
|
-
|
|
1635
|
+
warnLog('vxe.error.scrollErrProp', ['span-method'])
|
|
1629
1636
|
}
|
|
1630
1637
|
if (this.footerSpanMethod) {
|
|
1631
|
-
|
|
1638
|
+
warnLog('vxe.error.scrollErrProp', ['footer-span-method'])
|
|
1632
1639
|
}
|
|
1633
1640
|
}
|
|
1634
1641
|
const { visibleSize } = computeVirtualX(this)
|
|
@@ -1700,15 +1707,22 @@ const Methods = {
|
|
|
1700
1707
|
const leftBodyElem = leftBody ? leftBody.$el : null
|
|
1701
1708
|
const rightBodyElem = rightBody ? rightBody.$el : null
|
|
1702
1709
|
const tableFooterElem = tableFooter ? tableFooter.$el : null
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1710
|
+
return new Promise(resolve => {
|
|
1711
|
+
// 还原滚动条位置
|
|
1712
|
+
if (lastScrollLeft || lastScrollTop) {
|
|
1713
|
+
return restoreScrollLocation(this, lastScrollLeft, lastScrollTop).then(() => {
|
|
1714
|
+
// 存在滚动行为未结束情况
|
|
1715
|
+
setTimeout(resolve, 30)
|
|
1716
|
+
})
|
|
1717
|
+
}
|
|
1718
|
+
// 重置
|
|
1719
|
+
setScrollTop(tableBodyElem, lastScrollTop)
|
|
1720
|
+
setScrollTop(leftBodyElem, lastScrollTop)
|
|
1721
|
+
setScrollTop(rightBodyElem, lastScrollTop)
|
|
1722
|
+
setScrollLeft(tableFooterElem, lastScrollLeft)
|
|
1723
|
+
// 存在滚动行为未结束情况
|
|
1724
|
+
setTimeout(resolve, 30)
|
|
1725
|
+
})
|
|
1712
1726
|
},
|
|
1713
1727
|
/**
|
|
1714
1728
|
* 计算单元格列宽,动态分配可用剩余空间
|
|
@@ -1977,7 +1991,7 @@ const Methods = {
|
|
|
1977
1991
|
}
|
|
1978
1992
|
} else if (layout === 'body') {
|
|
1979
1993
|
const emptyBlockElem = elemStore[`${name}-${layout}-emptyBlock`]
|
|
1980
|
-
if (wrapperElem) {
|
|
1994
|
+
if (isNodeElement(wrapperElem)) {
|
|
1981
1995
|
if (customMaxHeight) {
|
|
1982
1996
|
wrapperElem.style.maxHeight = `${fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight}px`
|
|
1983
1997
|
} else {
|
|
@@ -1993,7 +2007,7 @@ const Methods = {
|
|
|
1993
2007
|
if (fixedWrapperElem) {
|
|
1994
2008
|
const isRightFixed = fixedType === 'right'
|
|
1995
2009
|
const fixedColumn = columnStore[`${fixedType}List`]
|
|
1996
|
-
if (wrapperElem) {
|
|
2010
|
+
if (isNodeElement(wrapperElem)) {
|
|
1997
2011
|
wrapperElem.style.top = `${headerHeight}px`
|
|
1998
2012
|
}
|
|
1999
2013
|
fixedWrapperElem.style.height = `${(customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1)}px`
|
|
@@ -2057,7 +2071,7 @@ const Methods = {
|
|
|
2057
2071
|
}
|
|
2058
2072
|
tWidth = tableColumn.reduce((previous, column) => previous + column.renderWidth, 0)
|
|
2059
2073
|
|
|
2060
|
-
if (wrapperElem) {
|
|
2074
|
+
if (isNodeElement(wrapperElem)) {
|
|
2061
2075
|
// 如果是固定列
|
|
2062
2076
|
if (fixedWrapperElem) {
|
|
2063
2077
|
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight}px`
|
|
@@ -2544,18 +2558,29 @@ const Methods = {
|
|
|
2544
2558
|
}, tooltipOpts.leaveDelay)
|
|
2545
2559
|
return false
|
|
2546
2560
|
},
|
|
2547
|
-
handleTargetEnterEvent () {
|
|
2561
|
+
handleTargetEnterEvent (isClear) {
|
|
2562
|
+
const $tooltip = this.$refs.tooltip
|
|
2548
2563
|
clearTimeout(this.tooltipTimeout)
|
|
2549
2564
|
this.tooltipActive = true
|
|
2550
|
-
|
|
2565
|
+
if (isClear) {
|
|
2566
|
+
this.closeTooltip()
|
|
2567
|
+
} else {
|
|
2568
|
+
if ($tooltip) {
|
|
2569
|
+
$tooltip.setActived(true)
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2551
2572
|
},
|
|
2552
2573
|
handleTargetLeaveEvent () {
|
|
2553
2574
|
const tooltipOpts = this.tooltipOpts
|
|
2575
|
+
let $tooltip = this.$refs.tooltip
|
|
2554
2576
|
this.tooltipActive = false
|
|
2577
|
+
if ($tooltip) {
|
|
2578
|
+
$tooltip.setActived(false)
|
|
2579
|
+
}
|
|
2555
2580
|
if (tooltipOpts.enterable) {
|
|
2556
2581
|
this.tooltipTimeout = setTimeout(() => {
|
|
2557
|
-
|
|
2558
|
-
if (tooltip &&
|
|
2582
|
+
$tooltip = this.$refs.tooltip
|
|
2583
|
+
if ($tooltip && !$tooltip.isActived()) {
|
|
2559
2584
|
this.closeTooltip()
|
|
2560
2585
|
}
|
|
2561
2586
|
}, tooltipOpts.leaveDelay)
|
|
@@ -2568,12 +2593,12 @@ const Methods = {
|
|
|
2568
2593
|
const { titleHelp } = column
|
|
2569
2594
|
if (titleHelp.content || titleHelp.message) {
|
|
2570
2595
|
const { $refs, tooltipStore } = this
|
|
2571
|
-
const tooltip = $refs.tooltip
|
|
2572
|
-
const content =
|
|
2573
|
-
this.handleTargetEnterEvent()
|
|
2596
|
+
const $tooltip = $refs.tooltip
|
|
2597
|
+
const content = getFuncText(titleHelp.content || titleHelp.message)
|
|
2598
|
+
this.handleTargetEnterEvent(true)
|
|
2574
2599
|
tooltipStore.visible = true
|
|
2575
|
-
if (tooltip) {
|
|
2576
|
-
tooltip.open(evnt.currentTarget, content)
|
|
2600
|
+
if ($tooltip) {
|
|
2601
|
+
$tooltip.open(evnt.currentTarget, content)
|
|
2577
2602
|
}
|
|
2578
2603
|
}
|
|
2579
2604
|
},
|
|
@@ -2584,7 +2609,7 @@ const Methods = {
|
|
|
2584
2609
|
const { tooltipStore } = this
|
|
2585
2610
|
const { column } = params
|
|
2586
2611
|
const titleElem = evnt.currentTarget
|
|
2587
|
-
this.handleTargetEnterEvent()
|
|
2612
|
+
this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row)
|
|
2588
2613
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
2589
2614
|
this.handleTooltip(evnt, titleElem, titleElem, null, params)
|
|
2590
2615
|
}
|
|
@@ -2597,7 +2622,7 @@ const Methods = {
|
|
|
2597
2622
|
const { actived } = editStore
|
|
2598
2623
|
const { row, column } = params
|
|
2599
2624
|
const cell = evnt.currentTarget
|
|
2600
|
-
this.handleTargetEnterEvent()
|
|
2625
|
+
this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row)
|
|
2601
2626
|
if (isEnableConf(editConfig)) {
|
|
2602
2627
|
if ((editOpts.mode === 'row' && actived.row === row) || (actived.row === row && actived.column === column)) {
|
|
2603
2628
|
return
|
|
@@ -2624,7 +2649,7 @@ const Methods = {
|
|
|
2624
2649
|
const { column } = params
|
|
2625
2650
|
const { tooltipStore } = this
|
|
2626
2651
|
const cell = evnt.currentTarget
|
|
2627
|
-
this.handleTargetEnterEvent()
|
|
2652
|
+
this.handleTargetEnterEvent(true)
|
|
2628
2653
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
2629
2654
|
this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params)
|
|
2630
2655
|
}
|
|
@@ -2701,7 +2726,7 @@ const Methods = {
|
|
|
2701
2726
|
return !this.isAllSelected && this.isIndeterminate
|
|
2702
2727
|
},
|
|
2703
2728
|
isCheckboxIndeterminate () {
|
|
2704
|
-
|
|
2729
|
+
warnLog('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate'])
|
|
2705
2730
|
return this.isAllCheckboxIndeterminate()
|
|
2706
2731
|
},
|
|
2707
2732
|
/**
|
|
@@ -3609,7 +3634,7 @@ const Methods = {
|
|
|
3609
3634
|
// 在 v3 中废弃
|
|
3610
3635
|
getSortColumn () {
|
|
3611
3636
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
3612
|
-
|
|
3637
|
+
warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
|
|
3613
3638
|
}
|
|
3614
3639
|
return XEUtils.find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order)
|
|
3615
3640
|
},
|
|
@@ -3692,7 +3717,7 @@ const Methods = {
|
|
|
3692
3717
|
},
|
|
3693
3718
|
reloadExpandContent (row) {
|
|
3694
3719
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
3695
|
-
|
|
3720
|
+
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
|
|
3696
3721
|
}
|
|
3697
3722
|
// 即将废弃
|
|
3698
3723
|
return this.reloadRowExpand(row)
|
|
@@ -3903,7 +3928,7 @@ const Methods = {
|
|
|
3903
3928
|
},
|
|
3904
3929
|
reloadTreeChilds (row) {
|
|
3905
3930
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
3906
|
-
|
|
3931
|
+
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand'])
|
|
3907
3932
|
}
|
|
3908
3933
|
// 即将废弃
|
|
3909
3934
|
return this.reloadTreeExpand(row)
|
|
@@ -4464,7 +4489,7 @@ const Methods = {
|
|
|
4464
4489
|
*/
|
|
4465
4490
|
setMergeCells (merges) {
|
|
4466
4491
|
if (this.spanMethod) {
|
|
4467
|
-
|
|
4492
|
+
errLog('vxe.error.errConflicts', ['merge-cells', 'span-method'])
|
|
4468
4493
|
}
|
|
4469
4494
|
setMerges(this, merges, this.mergeList, this.afterFullData)
|
|
4470
4495
|
return this.$nextTick().then(() => this.updateCellAreas())
|
|
@@ -4475,7 +4500,7 @@ const Methods = {
|
|
|
4475
4500
|
*/
|
|
4476
4501
|
removeMergeCells (merges) {
|
|
4477
4502
|
if (this.spanMethod) {
|
|
4478
|
-
|
|
4503
|
+
errLog('vxe.error.errConflicts', ['merge-cells', 'span-method'])
|
|
4479
4504
|
}
|
|
4480
4505
|
const rest = removeMerges(this, merges, this.mergeList, this.afterFullData)
|
|
4481
4506
|
return this.$nextTick().then(() => {
|
|
@@ -4501,14 +4526,14 @@ const Methods = {
|
|
|
4501
4526
|
},
|
|
4502
4527
|
setMergeFooterItems (merges) {
|
|
4503
4528
|
if (this.footerSpanMethod) {
|
|
4504
|
-
|
|
4529
|
+
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method'])
|
|
4505
4530
|
}
|
|
4506
4531
|
setMerges(this, merges, this.mergeFooterList, null)
|
|
4507
4532
|
return this.$nextTick().then(() => this.updateCellAreas())
|
|
4508
4533
|
},
|
|
4509
4534
|
removeMergeFooterItems (merges) {
|
|
4510
4535
|
if (this.footerSpanMethod) {
|
|
4511
|
-
|
|
4536
|
+
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method'])
|
|
4512
4537
|
}
|
|
4513
4538
|
const rest = removeMerges(this, merges, this.mergeFooterList, null)
|
|
4514
4539
|
return this.$nextTick().then(() => {
|
|
@@ -4558,7 +4583,7 @@ const Methods = {
|
|
|
4558
4583
|
$toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: this })
|
|
4559
4584
|
this.$toolbar = $toolbar
|
|
4560
4585
|
} else {
|
|
4561
|
-
|
|
4586
|
+
errLog('vxe.error.barUnableLink')
|
|
4562
4587
|
}
|
|
4563
4588
|
return this.$nextTick()
|
|
4564
4589
|
},
|
|
@@ -4629,9 +4654,9 @@ funcs.forEach(name => {
|
|
|
4629
4654
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
4630
4655
|
if (!this[`_${name}`]) {
|
|
4631
4656
|
if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
|
|
4632
|
-
|
|
4657
|
+
errLog('vxe.error.reqModule', ['Export'])
|
|
4633
4658
|
} else if ('clearValidate,fullValidate,validate'.split(',').includes(name)) {
|
|
4634
|
-
|
|
4659
|
+
errLog('vxe.error.reqModule', ['Validator'])
|
|
4635
4660
|
}
|
|
4636
4661
|
}
|
|
4637
4662
|
}
|