vxe-table 4.13.27 → 4.13.29
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/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/filter/hook.js +1 -0
- package/es/table/src/table.js +90 -50
- package/es/table/style.css +6 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +6 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +13 -11
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/filter/hook.js +1 -0
- package/lib/table/src/table.js +10 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +6 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +6 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/filter/hook.ts +1 -0
- package/packages/table/src/table.ts +91 -50
- package/styles/components/table.scss +14 -0
- /package/es/{iconfont.1747176259693.ttf → iconfont.1747286444797.ttf} +0 -0
- /package/es/{iconfont.1747176259693.woff → iconfont.1747286444797.woff} +0 -0
- /package/es/{iconfont.1747176259693.woff2 → iconfont.1747286444797.woff2} +0 -0
- /package/lib/{iconfont.1747176259693.ttf → iconfont.1747286444797.ttf} +0 -0
- /package/lib/{iconfont.1747176259693.woff → iconfont.1747286444797.woff} +0 -0
- /package/lib/{iconfont.1747176259693.woff2 → iconfont.1747286444797.woff2} +0 -0
|
@@ -9,7 +9,7 @@ import TableHeaderComponent from './header'
|
|
|
9
9
|
import TableFooterComponent from './footer'
|
|
10
10
|
import tableProps from './props'
|
|
11
11
|
import tableEmits from './emits'
|
|
12
|
-
import { getRowUniqueId, clearTableAllStatus, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCellHeight } from './util'
|
|
12
|
+
import { getRowUniqueId, clearTableAllStatus, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCellHeight } from './util'
|
|
13
13
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
14
14
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
15
15
|
import TableCustomPanelComponent from '../module/custom/panel'
|
|
@@ -987,7 +987,7 @@ export default defineComponent({
|
|
|
987
987
|
|
|
988
988
|
const getNextSortOrder = (column: VxeTableDefines.ColumnInfo) => {
|
|
989
989
|
const sortOpts = computeSortOpts.value
|
|
990
|
-
const { orders } = sortOpts
|
|
990
|
+
const { orders = [] } = sortOpts
|
|
991
991
|
const currOrder = column.order || null
|
|
992
992
|
const oIndex = orders.indexOf(currOrder) + 1
|
|
993
993
|
return orders[oIndex < orders.length ? oIndex : 0]
|
|
@@ -1399,6 +1399,54 @@ export default defineComponent({
|
|
|
1399
1399
|
return rest
|
|
1400
1400
|
}
|
|
1401
1401
|
|
|
1402
|
+
const handleSortEvent = (evnt: Event | null, sortConfs: VxeTableDefines.SortConfs | VxeTableDefines.SortConfs[], isUpdate?: boolean) => {
|
|
1403
|
+
const sortOpts = computeSortOpts.value
|
|
1404
|
+
const { multiple, remote, orders } = sortOpts
|
|
1405
|
+
if (!XEUtils.isArray(sortConfs)) {
|
|
1406
|
+
sortConfs = [sortConfs]
|
|
1407
|
+
}
|
|
1408
|
+
if (sortConfs && sortConfs.length) {
|
|
1409
|
+
if (!multiple) {
|
|
1410
|
+
sortConfs = [sortConfs[0]]
|
|
1411
|
+
clearAllSort()
|
|
1412
|
+
}
|
|
1413
|
+
let firstColumn: any = null
|
|
1414
|
+
sortConfs.forEach((confs: any, index: number) => {
|
|
1415
|
+
let { field, order } = confs
|
|
1416
|
+
let column = field
|
|
1417
|
+
if (XEUtils.isString(field)) {
|
|
1418
|
+
column = $xeTable.getColumnByField(field)
|
|
1419
|
+
}
|
|
1420
|
+
if (!firstColumn) {
|
|
1421
|
+
firstColumn = column
|
|
1422
|
+
}
|
|
1423
|
+
if (column && column.sortable) {
|
|
1424
|
+
if (orders && orders.indexOf(order) === -1) {
|
|
1425
|
+
order = getNextSortOrder(column)
|
|
1426
|
+
}
|
|
1427
|
+
if (column.order !== order) {
|
|
1428
|
+
column.order = order
|
|
1429
|
+
}
|
|
1430
|
+
column.sortTime = Date.now() + index
|
|
1431
|
+
}
|
|
1432
|
+
})
|
|
1433
|
+
if (isUpdate) {
|
|
1434
|
+
if (!remote) {
|
|
1435
|
+
$xeTable.handleTableData(true)
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
if (evnt) {
|
|
1439
|
+
$xeTable.handleColumnSortEvent(evnt, firstColumn)
|
|
1440
|
+
}
|
|
1441
|
+
return nextTick().then(() => {
|
|
1442
|
+
updateRowOffsetTop()
|
|
1443
|
+
$xeTable.updateCellAreas()
|
|
1444
|
+
return updateStyle()
|
|
1445
|
+
})
|
|
1446
|
+
}
|
|
1447
|
+
return nextTick()
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1402
1450
|
const clearAllSort = () => {
|
|
1403
1451
|
const { tableFullColumn } = internalData
|
|
1404
1452
|
tableFullColumn.forEach((column) => {
|
|
@@ -3868,7 +3916,7 @@ export default defineComponent({
|
|
|
3868
3916
|
}
|
|
3869
3917
|
|
|
3870
3918
|
const checkLastSyncScroll = (isRollX: boolean, isRollY: boolean) => {
|
|
3871
|
-
const { scrollXLoad, scrollYLoad } = reactData
|
|
3919
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData
|
|
3872
3920
|
const { lcsTimeout } = internalData
|
|
3873
3921
|
if (lcsTimeout) {
|
|
3874
3922
|
clearTimeout(lcsTimeout)
|
|
@@ -3884,13 +3932,19 @@ export default defineComponent({
|
|
|
3884
3932
|
internalData.inFooterScroll = false
|
|
3885
3933
|
internalData.scrollRenderType = ''
|
|
3886
3934
|
|
|
3887
|
-
|
|
3935
|
+
if (!isAllOverflow) {
|
|
3936
|
+
calcCellHeight()
|
|
3937
|
+
updateRowOffsetTop()
|
|
3938
|
+
}
|
|
3888
3939
|
if (isRollX && scrollXLoad) {
|
|
3889
3940
|
$xeTable.updateScrollXData()
|
|
3890
3941
|
}
|
|
3891
3942
|
if (isRollY && scrollYLoad) {
|
|
3892
3943
|
$xeTable.updateScrollYData().then(() => {
|
|
3893
|
-
|
|
3944
|
+
if (!isAllOverflow) {
|
|
3945
|
+
calcCellHeight()
|
|
3946
|
+
updateRowOffsetTop()
|
|
3947
|
+
}
|
|
3894
3948
|
$xeTable.updateScrollYSpace()
|
|
3895
3949
|
})
|
|
3896
3950
|
}
|
|
@@ -4921,6 +4975,7 @@ export default defineComponent({
|
|
|
4921
4975
|
}
|
|
4922
4976
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4923
4977
|
column.fixed = fixed
|
|
4978
|
+
column.renderFixed = fixed
|
|
4924
4979
|
})
|
|
4925
4980
|
tablePrivateMethods.saveCustomStore('update:fixed')
|
|
4926
4981
|
if (!status) {
|
|
@@ -4945,6 +5000,7 @@ export default defineComponent({
|
|
|
4945
5000
|
if (targetColumn && targetColumn.fixed) {
|
|
4946
5001
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4947
5002
|
column.fixed = null
|
|
5003
|
+
column.renderFixed = null
|
|
4948
5004
|
})
|
|
4949
5005
|
tablePrivateMethods.saveCustomStore('update:fixed')
|
|
4950
5006
|
if (!status) {
|
|
@@ -5723,49 +5779,11 @@ export default defineComponent({
|
|
|
5723
5779
|
return nextTick()
|
|
5724
5780
|
},
|
|
5725
5781
|
setSort (sortConfs, isUpdate) {
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
if (sortConfs && sortConfs.length) {
|
|
5732
|
-
if (!multiple) {
|
|
5733
|
-
sortConfs = [sortConfs[0]]
|
|
5734
|
-
clearAllSort()
|
|
5735
|
-
}
|
|
5736
|
-
let firstColumn: any = null
|
|
5737
|
-
sortConfs.forEach((confs: any, index: number) => {
|
|
5738
|
-
let { field, order } = confs
|
|
5739
|
-
let column = field
|
|
5740
|
-
if (XEUtils.isString(field)) {
|
|
5741
|
-
column = tableMethods.getColumnByField(field)
|
|
5742
|
-
}
|
|
5743
|
-
if (!firstColumn) {
|
|
5744
|
-
firstColumn = column
|
|
5745
|
-
}
|
|
5746
|
-
if (column && column.sortable) {
|
|
5747
|
-
if (orders && orders.indexOf(order) === -1) {
|
|
5748
|
-
order = getNextSortOrder(column)
|
|
5749
|
-
}
|
|
5750
|
-
if (column.order !== order) {
|
|
5751
|
-
column.order = order
|
|
5752
|
-
}
|
|
5753
|
-
column.sortTime = Date.now() + index
|
|
5754
|
-
}
|
|
5755
|
-
})
|
|
5756
|
-
if (isUpdate) {
|
|
5757
|
-
if (!remote) {
|
|
5758
|
-
$xeTable.handleTableData(true)
|
|
5759
|
-
}
|
|
5760
|
-
$xeTable.handleColumnSortEvent(new Event('click'), firstColumn)
|
|
5761
|
-
}
|
|
5762
|
-
return nextTick().then(() => {
|
|
5763
|
-
updateRowOffsetTop()
|
|
5764
|
-
tableMethods.updateCellAreas()
|
|
5765
|
-
return updateStyle()
|
|
5766
|
-
})
|
|
5767
|
-
}
|
|
5768
|
-
return nextTick()
|
|
5782
|
+
// 已废弃,即将去掉事件触发 new Event('click') -> null
|
|
5783
|
+
return handleSortEvent(new Event('click'), sortConfs, isUpdate)
|
|
5784
|
+
},
|
|
5785
|
+
setSortByEvent (evnt, sortConfs, isUpdate) {
|
|
5786
|
+
return handleSortEvent(evnt, sortConfs, isUpdate)
|
|
5769
5787
|
},
|
|
5770
5788
|
/**
|
|
5771
5789
|
* 清空指定列的排序条件
|
|
@@ -5847,6 +5865,16 @@ export default defineComponent({
|
|
|
5847
5865
|
}
|
|
5848
5866
|
return sortList
|
|
5849
5867
|
},
|
|
5868
|
+
setFilterByEvent (evnt, fieldOrColumn, options, isUpdate) {
|
|
5869
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
5870
|
+
if (column && column.filters) {
|
|
5871
|
+
column.filters = toFilters(options || [])
|
|
5872
|
+
if (isUpdate) {
|
|
5873
|
+
return $xeTable.handleColumnConfirmFilter(column, evnt)
|
|
5874
|
+
}
|
|
5875
|
+
}
|
|
5876
|
+
return nextTick()
|
|
5877
|
+
},
|
|
5850
5878
|
/**
|
|
5851
5879
|
* 关闭筛选
|
|
5852
5880
|
* @param {Event} evnt 事件
|
|
@@ -8558,10 +8586,14 @@ export default defineComponent({
|
|
|
8558
8586
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
8559
8587
|
const ctEl = tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper')
|
|
8560
8588
|
let ovEl = null
|
|
8589
|
+
let tipEl = tdEl.querySelector<HTMLElement>(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label')
|
|
8561
8590
|
if (column.treeNode) {
|
|
8562
8591
|
ovEl = tdEl.querySelector<HTMLElement>('.vxe-tree-cell')
|
|
8563
8592
|
}
|
|
8564
|
-
|
|
8593
|
+
if (!tipEl) {
|
|
8594
|
+
tipEl = ctEl
|
|
8595
|
+
}
|
|
8596
|
+
handleTooltip(evnt, tdEl, ovEl || ctEl, tipEl, params)
|
|
8565
8597
|
}
|
|
8566
8598
|
},
|
|
8567
8599
|
/**
|
|
@@ -8573,7 +8605,16 @@ export default defineComponent({
|
|
|
8573
8605
|
const tdEl = evnt.currentTarget as HTMLTableCellElement
|
|
8574
8606
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row)
|
|
8575
8607
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
8576
|
-
|
|
8608
|
+
const ctEl = tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper')
|
|
8609
|
+
let ovEl = null
|
|
8610
|
+
let tipEl = tdEl.querySelector<HTMLElement>(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label')
|
|
8611
|
+
if (column.type === 'html') {
|
|
8612
|
+
ovEl = tdEl.querySelector<HTMLElement>('.vxe-cell--html')
|
|
8613
|
+
}
|
|
8614
|
+
if (!tipEl) {
|
|
8615
|
+
tipEl = ctEl
|
|
8616
|
+
}
|
|
8617
|
+
handleTooltip(evnt, tdEl, ovEl || ctEl, tipEl, params)
|
|
8577
8618
|
}
|
|
8578
8619
|
},
|
|
8579
8620
|
handleTargetLeaveEvent () {
|
|
@@ -1050,6 +1050,20 @@ $btnThemeList: (
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
}
|
|
1053
|
+
.vxe-header--column {
|
|
1054
|
+
&.col--ellipsis {
|
|
1055
|
+
&.col--center {
|
|
1056
|
+
.vxe-cell--wrapper {
|
|
1057
|
+
justify-content: center;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
&.col--right {
|
|
1061
|
+
.vxe-cell--wrapper {
|
|
1062
|
+
justify-content: right;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1053
1067
|
.vxe-header--column,
|
|
1054
1068
|
.vxe-footer--column {
|
|
1055
1069
|
&.col--ellipsis {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|