vxe-table 3.15.28 → 3.15.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/mixin.js +1 -0
- package/es/table/src/methods.js +98 -53
- 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 +112 -61
- 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/mixin.js +1 -0
- package/lib/table/src/methods.js +109 -59
- package/lib/table/src/methods.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/mixin.ts +1 -0
- package/packages/table/src/methods.ts +103 -54
- package/styles/components/table.scss +14 -0
- /package/es/{iconfont.1747176212818.ttf → iconfont.1747286367921.ttf} +0 -0
- /package/es/{iconfont.1747176212818.woff → iconfont.1747286367921.woff} +0 -0
- /package/es/{iconfont.1747176212818.woff2 → iconfont.1747286367921.woff2} +0 -0
- /package/lib/{iconfont.1747176212818.ttf → iconfont.1747286367921.ttf} +0 -0
- /package/lib/{iconfont.1747176212818.woff → iconfont.1747286367921.woff} +0 -0
- /package/lib/{iconfont.1747176212818.woff2 → iconfont.1747286367921.woff2} +0 -0
|
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTarge
|
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import Cell from './cell'
|
|
6
|
-
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem } from './util'
|
|
6
|
+
import { getRowUniqueId, clearTableAllStatus, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
9
9
|
|
|
@@ -30,8 +30,9 @@ function eqCellValue (row1: any, row2: any, field: any) {
|
|
|
30
30
|
return XEUtils.isEqual(val1, val2)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function getNextSortOrder (
|
|
34
|
-
const
|
|
33
|
+
function getNextSortOrder ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, column: any) {
|
|
34
|
+
const sortOpts = $xeTable.computeSortOpts
|
|
35
|
+
const { orders = [] } = sortOpts
|
|
35
36
|
const currOrder = column.order || null
|
|
36
37
|
const oIndex = orders.indexOf(currOrder) + 1
|
|
37
38
|
return orders[oIndex < orders.length ? oIndex : 0]
|
|
@@ -2019,8 +2020,59 @@ function removeFooterMerges ($xeTable: VxeTableConstructor & VxeTablePrivateMeth
|
|
|
2019
2020
|
return rest
|
|
2020
2021
|
}
|
|
2021
2022
|
|
|
2022
|
-
function
|
|
2023
|
-
|
|
2023
|
+
function handleSortEvent ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: Event | null, sortConfs: VxeTableDefines.SortConfs | VxeTableDefines.SortConfs[], isUpdate?: boolean) {
|
|
2024
|
+
const sortOpts = $xeTable.computeSortOpts
|
|
2025
|
+
const { multiple, remote, orders } = sortOpts
|
|
2026
|
+
if (!XEUtils.isArray(sortConfs)) {
|
|
2027
|
+
sortConfs = [sortConfs]
|
|
2028
|
+
}
|
|
2029
|
+
if (sortConfs && sortConfs.length) {
|
|
2030
|
+
if (!multiple) {
|
|
2031
|
+
sortConfs = [sortConfs[0]]
|
|
2032
|
+
clearAllSort($xeTable)
|
|
2033
|
+
}
|
|
2034
|
+
let firstColumn: any = null
|
|
2035
|
+
sortConfs.forEach((confs: any, index: number) => {
|
|
2036
|
+
let { field, order } = confs
|
|
2037
|
+
let column = field
|
|
2038
|
+
if (XEUtils.isString(field)) {
|
|
2039
|
+
column = $xeTable.getColumnByField(field)
|
|
2040
|
+
}
|
|
2041
|
+
if (!firstColumn) {
|
|
2042
|
+
firstColumn = column
|
|
2043
|
+
}
|
|
2044
|
+
if (column && column.sortable) {
|
|
2045
|
+
if (orders && orders.indexOf(order) === -1) {
|
|
2046
|
+
order = getNextSortOrder($xeTable, column)
|
|
2047
|
+
}
|
|
2048
|
+
if (column.order !== order) {
|
|
2049
|
+
column.order = order
|
|
2050
|
+
}
|
|
2051
|
+
column.sortTime = Date.now() + index
|
|
2052
|
+
}
|
|
2053
|
+
})
|
|
2054
|
+
if (isUpdate) {
|
|
2055
|
+
if (!remote) {
|
|
2056
|
+
$xeTable.handleTableData(true)
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
if (evnt) {
|
|
2060
|
+
$xeTable.handleColumnSortEvent(evnt, firstColumn)
|
|
2061
|
+
}
|
|
2062
|
+
return $xeTable.$nextTick().then(() => {
|
|
2063
|
+
updateRowOffsetTop($xeTable)
|
|
2064
|
+
$xeTable.updateCellAreas()
|
|
2065
|
+
return updateStyle($xeTable)
|
|
2066
|
+
})
|
|
2067
|
+
}
|
|
2068
|
+
return $xeTable.$nextTick()
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
function clearAllSort ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
2072
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
2073
|
+
|
|
2074
|
+
const { tableFullColumn } = internalData
|
|
2075
|
+
tableFullColumn.forEach((column: any) => {
|
|
2024
2076
|
column.order = null
|
|
2025
2077
|
})
|
|
2026
2078
|
}
|
|
@@ -3288,7 +3340,7 @@ function checkLastSyncScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
3288
3340
|
const reactData = $xeTable as unknown as TableReactData
|
|
3289
3341
|
const internalData = $xeTable as unknown as TableInternalData
|
|
3290
3342
|
|
|
3291
|
-
const { scrollXLoad, scrollYLoad } = reactData
|
|
3343
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData
|
|
3292
3344
|
const { lcsTimeout } = internalData
|
|
3293
3345
|
if (lcsTimeout) {
|
|
3294
3346
|
clearTimeout(lcsTimeout)
|
|
@@ -3303,13 +3355,19 @@ function checkLastSyncScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
3303
3355
|
internalData.inBodyScroll = false
|
|
3304
3356
|
internalData.inFooterScroll = false
|
|
3305
3357
|
internalData.scrollRenderType = ''
|
|
3306
|
-
|
|
3358
|
+
if (!isAllOverflow) {
|
|
3359
|
+
calcCellHeight($xeTable)
|
|
3360
|
+
updateRowOffsetTop($xeTable)
|
|
3361
|
+
}
|
|
3307
3362
|
if (isRollX && scrollXLoad) {
|
|
3308
3363
|
$xeTable.updateScrollXData()
|
|
3309
3364
|
}
|
|
3310
3365
|
if (isRollY && scrollYLoad) {
|
|
3311
3366
|
$xeTable.updateScrollYData().then(() => {
|
|
3312
|
-
|
|
3367
|
+
if (!isAllOverflow) {
|
|
3368
|
+
calcCellHeight($xeTable)
|
|
3369
|
+
updateRowOffsetTop($xeTable)
|
|
3370
|
+
}
|
|
3313
3371
|
$xeTable.updateScrollYSpace()
|
|
3314
3372
|
})
|
|
3315
3373
|
}
|
|
@@ -4812,6 +4870,7 @@ const Methods = {
|
|
|
4812
4870
|
}
|
|
4813
4871
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4814
4872
|
column.fixed = fixed
|
|
4873
|
+
column.renderFixed = fixed
|
|
4815
4874
|
})
|
|
4816
4875
|
$xeTable.saveCustomStore('update:fixed')
|
|
4817
4876
|
if (!status) {
|
|
@@ -4838,6 +4897,7 @@ const Methods = {
|
|
|
4838
4897
|
if (targetColumn && targetColumn.fixed) {
|
|
4839
4898
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4840
4899
|
column.fixed = null
|
|
4900
|
+
column.renderFixed = null
|
|
4841
4901
|
})
|
|
4842
4902
|
$xeTable.saveCustomStore('update:fixed')
|
|
4843
4903
|
if (!status) {
|
|
@@ -6427,10 +6487,14 @@ const Methods = {
|
|
|
6427
6487
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
6428
6488
|
const ctEl = tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper')
|
|
6429
6489
|
let ovEl = null
|
|
6490
|
+
let tipEl = tdEl.querySelector<HTMLElement>(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label')
|
|
6430
6491
|
if (column.treeNode) {
|
|
6431
6492
|
ovEl = tdEl.querySelector<HTMLElement>('.vxe-tree-cell')
|
|
6432
6493
|
}
|
|
6433
|
-
|
|
6494
|
+
if (!tipEl) {
|
|
6495
|
+
tipEl = ctEl
|
|
6496
|
+
}
|
|
6497
|
+
handleTooltip($xeTable, evnt, tdEl, ovEl || ctEl, tipEl, params)
|
|
6434
6498
|
}
|
|
6435
6499
|
},
|
|
6436
6500
|
/**
|
|
@@ -6445,10 +6509,19 @@ const Methods = {
|
|
|
6445
6509
|
const tdEl = evnt.currentTarget as HTMLTableCellElement
|
|
6446
6510
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row)
|
|
6447
6511
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
6448
|
-
|
|
6512
|
+
const ctEl = tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper')
|
|
6513
|
+
let ovEl = null
|
|
6514
|
+
let tipEl = tdEl.querySelector<HTMLElement>(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label')
|
|
6515
|
+
if (column.type === 'html') {
|
|
6516
|
+
ovEl = tdEl.querySelector<HTMLElement>('.vxe-cell--html')
|
|
6517
|
+
}
|
|
6518
|
+
if (!tipEl) {
|
|
6519
|
+
tipEl = ctEl
|
|
6520
|
+
}
|
|
6521
|
+
handleTooltip($xeTable, evnt, tdEl, ovEl || ctEl, tipEl, params)
|
|
6449
6522
|
}
|
|
6450
6523
|
},
|
|
6451
|
-
openTooltip (target:
|
|
6524
|
+
openTooltip (target: HTMLElement, content: string | number) {
|
|
6452
6525
|
const { $refs } = this
|
|
6453
6526
|
const commTip = $refs.refCommTooltip
|
|
6454
6527
|
if (commTip) {
|
|
@@ -8524,49 +8597,13 @@ const Methods = {
|
|
|
8524
8597
|
setSort (sortConfs: VxeTableDefines.SortConfs | VxeTableDefines.SortConfs[], isUpdate?: boolean) {
|
|
8525
8598
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
8526
8599
|
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
sortConfs = [sortConfs[0]]
|
|
8535
|
-
clearAllSort($xeTable)
|
|
8536
|
-
}
|
|
8537
|
-
let firstColumn: any = null
|
|
8538
|
-
sortConfs.forEach((confs: any, index: number) => {
|
|
8539
|
-
let { field, order } = confs
|
|
8540
|
-
let column = field
|
|
8541
|
-
if (XEUtils.isString(field)) {
|
|
8542
|
-
column = $xeTable.getColumnByField(field)
|
|
8543
|
-
}
|
|
8544
|
-
if (!firstColumn) {
|
|
8545
|
-
firstColumn = column
|
|
8546
|
-
}
|
|
8547
|
-
if (column && column.sortable) {
|
|
8548
|
-
if (orders && orders.indexOf(order) === -1) {
|
|
8549
|
-
order = getNextSortOrder($xeTable, column)
|
|
8550
|
-
}
|
|
8551
|
-
if (column.order !== order) {
|
|
8552
|
-
column.order = order
|
|
8553
|
-
}
|
|
8554
|
-
column.sortTime = Date.now() + index
|
|
8555
|
-
}
|
|
8556
|
-
})
|
|
8557
|
-
if (isUpdate) {
|
|
8558
|
-
if (!remote) {
|
|
8559
|
-
$xeTable.handleTableData(true)
|
|
8560
|
-
}
|
|
8561
|
-
$xeTable.handleColumnSortEvent(new Event('click'), firstColumn)
|
|
8562
|
-
}
|
|
8563
|
-
return $xeTable.$nextTick().then(() => {
|
|
8564
|
-
updateRowOffsetTop($xeTable)
|
|
8565
|
-
$xeTable.updateCellAreas()
|
|
8566
|
-
return updateStyle($xeTable)
|
|
8567
|
-
})
|
|
8568
|
-
}
|
|
8569
|
-
return $xeTable.$nextTick()
|
|
8600
|
+
// 已废弃,即将去掉事件触发 new Event('click') -> null
|
|
8601
|
+
return handleSortEvent($xeTable, new Event('click'), sortConfs, isUpdate)
|
|
8602
|
+
},
|
|
8603
|
+
setSortByEvent (evnt: Event, sortConfs: VxeTableDefines.SortConfs | VxeTableDefines.SortConfs[], isUpdate?: boolean) {
|
|
8604
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
8605
|
+
|
|
8606
|
+
return handleSortEvent($xeTable, evnt, sortConfs, isUpdate)
|
|
8570
8607
|
},
|
|
8571
8608
|
/**
|
|
8572
8609
|
* 清空指定列的排序条件
|
|
@@ -8658,6 +8695,18 @@ const Methods = {
|
|
|
8658
8695
|
}
|
|
8659
8696
|
return sortList
|
|
8660
8697
|
},
|
|
8698
|
+
setFilterByEvent (evnt: Event, fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>, options: VxeColumnPropTypes.FilterItem[], isUpdate?: boolean) {
|
|
8699
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
8700
|
+
|
|
8701
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
8702
|
+
if (column && column.filters) {
|
|
8703
|
+
column.filters = toFilters(options || [])
|
|
8704
|
+
if (isUpdate) {
|
|
8705
|
+
return $xeTable.handleColumnConfirmFilter(column, evnt)
|
|
8706
|
+
}
|
|
8707
|
+
}
|
|
8708
|
+
return $xeTable.$nextTick()
|
|
8709
|
+
},
|
|
8661
8710
|
/**
|
|
8662
8711
|
* 关闭筛选
|
|
8663
8712
|
* @param {Event} evnt 事件
|
|
@@ -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
|