vxe-table 3.24.4 → 3.25.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.
- package/es/grid/src/grid.js +15 -2
- package/es/locale/lang/fr-FR.js +29 -29
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +3 -2
- package/es/table/module/edit/mixin.js +5 -4
- package/es/table/module/export/mixin.js +6 -4
- package/es/table/module/filter/mixin.js +2 -2
- package/es/table/module/keyboard/mixin.js +4 -3
- package/es/table/module/menu/mixin.js +3 -3
- package/es/table/render/index.js +5 -3
- package/es/table/src/body.js +4 -4
- package/es/table/src/header.js +4 -3
- package/es/table/src/methods.js +93 -59
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +63 -43
- package/es/table/src/util.js +6 -3
- package/es/ui/index.js +9 -11
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +9 -0
- package/lib/grid/src/grid.js +14 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +170 -110
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/fr-FR.js +29 -29
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +29 -29
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +2 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +4 -3
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +9 -3
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +1 -1
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +4 -3
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +2 -2
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/render/index.js +4 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +3 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/header.js +3 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +36 -34
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +58 -45
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +8 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +9 -11
- 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/ui/src/utils.js +10 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +16 -2
- package/packages/locale/lang/fr-FR.ts +903 -903
- package/packages/table/module/custom/panel.ts +3 -2
- package/packages/table/module/edit/mixin.ts +5 -4
- package/packages/table/module/export/mixin.ts +6 -4
- package/packages/table/module/filter/mixin.ts +2 -2
- package/packages/table/module/keyboard/mixin.ts +4 -3
- package/packages/table/module/menu/mixin.ts +3 -3
- package/packages/table/render/index.ts +5 -3
- package/packages/table/src/body.ts +4 -4
- package/packages/table/src/header.ts +4 -3
- package/packages/table/src/methods.ts +90 -57
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +69 -43
- package/packages/table/src/util.ts +6 -3
- package/packages/ui/index.ts +8 -10
- package/packages/ui/src/utils.ts +10 -0
- /package/es/{iconfont.1791617048832.ttf → iconfont.1791954189007.ttf} +0 -0
- /package/es/{iconfont.1791617048832.woff → iconfont.1791954189007.woff} +0 -0
- /package/es/{iconfont.1791617048832.woff2 → iconfont.1791954189007.woff2} +0 -0
- /package/lib/{iconfont.1791617048832.ttf → iconfont.1791954189007.ttf} +0 -0
- /package/lib/{iconfont.1791617048832.woff → iconfont.1791954189007.woff} +0 -0
- /package/lib/{iconfont.1791617048832.woff2 → iconfont.1791954189007.woff2} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreateElement } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { getFuncText, isEnableConf } from '../../ui/src/utils'
|
|
3
|
+
import { getDefaultConfig, getFuncText, hasEnableConf, isEnableConf } from '../../ui/src/utils'
|
|
4
4
|
import { initTpImg, toCssUnit } from '../../ui/src/dom'
|
|
5
5
|
import { createReactData, createInternalData, createHandleGetRowId, getCalcHeight, hasDeepKey } from './util'
|
|
6
6
|
import { VxeUI } from '../../ui'
|
|
@@ -26,7 +26,7 @@ import keyboardMixin from '../module/keyboard/mixin'
|
|
|
26
26
|
import validatorMixin from '../module/validator/mixin'
|
|
27
27
|
import customMixin from '../module/custom/mixin'
|
|
28
28
|
|
|
29
|
-
import type { VxeTabsConstructor, VxeTabsPrivateMethods, VxeComponentStyleType, VxeModalConstructor, VxeModalMethods } from 'vxe-pc-ui'
|
|
29
|
+
import type { VxeTabsConstructor, VxeTabsPrivateMethods, VxeComponentStyleType, VxeModalConstructor, VxeModalMethods, VxeScrollbarProps } from 'vxe-pc-ui'
|
|
30
30
|
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTablePropTypes, TableInternalData, TableReactData, VxeTableDefines } from '../../../types'
|
|
31
31
|
|
|
32
32
|
const { warnLog, errLog } = createComponentLog('table')
|
|
@@ -121,10 +121,15 @@ function renderViewFixed (h: CreateElement, $xeTable: VxeTableConstructor & VxeT
|
|
|
121
121
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
|
|
122
122
|
return h('div', {
|
|
123
123
|
ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
|
|
124
|
-
class: [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
class: [
|
|
125
|
+
`vxe-table--fixed-${fixedType}-wrapper`,
|
|
126
|
+
`sx--${(scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
127
|
+
`sy--${(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
128
|
+
{
|
|
129
|
+
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
130
|
+
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
131
|
+
}
|
|
132
|
+
]
|
|
128
133
|
}, [
|
|
129
134
|
showHeader
|
|
130
135
|
? h(TableHeaderComponent, {
|
|
@@ -484,7 +489,11 @@ function renderViewport (h: CreateElement, $xeTable: VxeTableConstructor & VxeTa
|
|
|
484
489
|
}]
|
|
485
490
|
}, [
|
|
486
491
|
h('div', {
|
|
487
|
-
class: [
|
|
492
|
+
class: [
|
|
493
|
+
'vxe-table--main-wrapper',
|
|
494
|
+
`sx--${(scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
495
|
+
`sy--${(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') ? 'hidden' : 'visible'}`
|
|
496
|
+
]
|
|
488
497
|
}, [
|
|
489
498
|
/**
|
|
490
499
|
* 表头
|
|
@@ -591,6 +600,9 @@ export default {
|
|
|
591
600
|
const reactData = createReactData()
|
|
592
601
|
|
|
593
602
|
return {
|
|
603
|
+
...({} as {
|
|
604
|
+
scrollDefaultConf: VxeScrollbarProps
|
|
605
|
+
}),
|
|
594
606
|
xID,
|
|
595
607
|
...reactData,
|
|
596
608
|
|
|
@@ -718,17 +730,15 @@ export default {
|
|
|
718
730
|
},
|
|
719
731
|
computeScrollbarXOpts () {
|
|
720
732
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
721
|
-
const props = $xeTable
|
|
722
733
|
|
|
723
734
|
const scrollbarOpts = $xeTable.computeScrollbarOpts
|
|
724
|
-
return Object.assign({}, scrollbarOpts.x,
|
|
735
|
+
return scrollbarOpts.x ? Object.assign({}, scrollbarOpts.x, scrollbarOpts.xConfig) : (scrollbarOpts.xConfig || {})
|
|
725
736
|
},
|
|
726
737
|
computeScrollbarYOpts () {
|
|
727
738
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
728
|
-
const props = $xeTable
|
|
729
739
|
|
|
730
740
|
const scrollbarOpts = $xeTable.computeScrollbarOpts
|
|
731
|
-
return Object.assign({}, scrollbarOpts.y,
|
|
741
|
+
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {})
|
|
732
742
|
},
|
|
733
743
|
computeScrollbarXToTop () {
|
|
734
744
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -1289,17 +1299,21 @@ export default {
|
|
|
1289
1299
|
},
|
|
1290
1300
|
computeTableStyle () {
|
|
1291
1301
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1302
|
+
const scrollDefaultConf = ($xeTable as any).scrollDefaultConf
|
|
1292
1303
|
|
|
1293
1304
|
const scrollbarOpts = $xeTable.computeScrollbarOpts
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
}
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1305
|
+
const scrollbarXOpts = $xeTable.computeScrollbarXOpts
|
|
1306
|
+
const scrollbarYOpts = $xeTable.computeScrollbarYOpts
|
|
1307
|
+
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width)
|
|
1308
|
+
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height)
|
|
1309
|
+
const stys: VxeComponentStyleType = {}
|
|
1310
|
+
if (barWidth || barHeight) {
|
|
1311
|
+
stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight)
|
|
1312
|
+
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight)
|
|
1313
|
+
stys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(barHeight || barWidth)
|
|
1314
|
+
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(barHeight || barWidth)
|
|
1301
1315
|
}
|
|
1302
|
-
return
|
|
1316
|
+
return stys
|
|
1303
1317
|
},
|
|
1304
1318
|
computeTableRowExpandedList () {
|
|
1305
1319
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -1738,11 +1752,12 @@ export default {
|
|
|
1738
1752
|
const props = $xeTable
|
|
1739
1753
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1740
1754
|
|
|
1755
|
+
($xeTable as any).scrollDefaultConf = Object.assign({}, getConfig().scrollbar)
|
|
1741
1756
|
XEUtils.assign(internalData, createInternalData())
|
|
1742
1757
|
|
|
1743
1758
|
handleKeyField($xeTable)
|
|
1744
1759
|
|
|
1745
|
-
const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource } = props
|
|
1760
|
+
const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource, areaConfig } = props
|
|
1746
1761
|
const { scrollXStore, scrollYStore } = internalData
|
|
1747
1762
|
const columnOpts = $xeTable.computeColumnOpts
|
|
1748
1763
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
@@ -1764,6 +1779,7 @@ export default {
|
|
|
1764
1779
|
const areaOpts = $xeTable.computeAreaOpts
|
|
1765
1780
|
const sortOpts = $xeTable.computeSortOpts
|
|
1766
1781
|
const filterOpts = $xeTable.computeFilterOpts
|
|
1782
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts
|
|
1767
1783
|
const { groupFields } = aggregateOpts
|
|
1768
1784
|
|
|
1769
1785
|
if (props.rowId) {
|
|
@@ -1842,13 +1858,13 @@ export default {
|
|
|
1842
1858
|
// warnLog('vxe.error.delProp', ['scroll-x', 'virtual-x-config'])
|
|
1843
1859
|
// }
|
|
1844
1860
|
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
1845
|
-
if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
|
|
1861
|
+
if (hasEnableConf(importConfig, importOpts) && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
|
|
1846
1862
|
warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')])
|
|
1847
1863
|
}
|
|
1848
|
-
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
1864
|
+
if (hasEnableConf(exportConfig, exportOpts) && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
1849
1865
|
warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')])
|
|
1850
1866
|
}
|
|
1851
|
-
if (exportConfig && XEUtils.isBoolean((exportOpts as any).isAllExpand)) {
|
|
1867
|
+
if (hasEnableConf(exportConfig, exportOpts) && XEUtils.isBoolean((exportOpts as any).isAllExpand)) {
|
|
1852
1868
|
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded'])
|
|
1853
1869
|
}
|
|
1854
1870
|
|
|
@@ -1863,8 +1879,8 @@ export default {
|
|
|
1863
1879
|
if (rowOpts.height && !this.showOverflow) {
|
|
1864
1880
|
warnLog('vxe.error.notProp', ['table.show-overflow'])
|
|
1865
1881
|
}
|
|
1866
|
-
if (!$xeTable.
|
|
1867
|
-
if (
|
|
1882
|
+
if (!$xeTable.triggerClAaMnEvent) {
|
|
1883
|
+
if (hasEnableConf(areaConfig, areaOpts)) {
|
|
1868
1884
|
warnLog('vxe.error.notProp', ['area-config'])
|
|
1869
1885
|
}
|
|
1870
1886
|
if (props.clipConfig) {
|
|
@@ -1984,10 +2000,10 @@ export default {
|
|
|
1984
2000
|
if (columnOpts.currentMethod) {
|
|
1985
2001
|
warnLog('vxe.error.delProp', ['row-config.currentMethod', 'current-column-config.beforeSelectMethod'])
|
|
1986
2002
|
}
|
|
1987
|
-
// if ((rowOpts.isCurrent || highlightCurrentRow) &&
|
|
2003
|
+
// if ((rowOpts.isCurrent || highlightCurrentRow) && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isArrow && !XEUtils.isBoolean(currentRowOpts.isFollowSelected)) {
|
|
1988
2004
|
// warnLog('vxe.error.notConflictProp', ['row-config.isCurrent & keyboard-config.isArrow', 'current-row-config.isFollowSelected'])
|
|
1989
2005
|
// }
|
|
1990
|
-
// if ((columnOpts.isCurrent || highlightCurrentColumn) &&
|
|
2006
|
+
// if ((columnOpts.isCurrent || highlightCurrentColumn) && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isArrow && !XEUtils.isBoolean(currentColumnOpts.isFollowSelected)) {
|
|
1991
2007
|
// warnLog('vxe.error.notConflictProp', ['column-config.isCurrent & keyboard-config.isArrow', 'current-column-config.isFollowSelected'])
|
|
1992
2008
|
// }
|
|
1993
2009
|
|
|
@@ -2007,17 +2023,24 @@ export default {
|
|
|
2007
2023
|
// }
|
|
2008
2024
|
|
|
2009
2025
|
// 检查是否有安装需要的模块
|
|
2010
|
-
if (props.editConfig && !$xeTable.insert) {
|
|
2011
|
-
|
|
2012
|
-
}
|
|
2013
|
-
if (props.editRules && !$xeTable.validate) {
|
|
2014
|
-
|
|
2015
|
-
}
|
|
2016
|
-
if ((checkboxOpts.range ||
|
|
2017
|
-
|
|
2026
|
+
// if (props.editConfig && !$xeTable.insert) {
|
|
2027
|
+
// errLog('vxe.error.reqModule', ['Edit'])
|
|
2028
|
+
// }
|
|
2029
|
+
// if (props.editRules && !$xeTable.validate) {
|
|
2030
|
+
// errLog('vxe.error.reqModule', ['Validator'])
|
|
2031
|
+
// }
|
|
2032
|
+
// if ((checkboxOpts.range || hasEnableConf(keyboardConfig, keyboardOpts) || hasEnableConf(mouseConfig, mouseOpts)) && !$xeTable.handleCellMousedownEvent) {
|
|
2033
|
+
// errLog('vxe.error.reqModule', ['Keyboard'])
|
|
2034
|
+
// }
|
|
2035
|
+
// if ((hasEnableConf(printConfig, printOpts) || hasEnableConf(importConfig, importOpts) || hasEnableConf(exportConfig, exportOpts)) && !$xeTable.exportData) {
|
|
2036
|
+
// errLog('vxe.error.reqModule', ['Export'])
|
|
2037
|
+
// }
|
|
2038
|
+
|
|
2039
|
+
if (scrollbarOpts.x) {
|
|
2040
|
+
warnLog('vxe.error.delProp', ['scrollbar-config.x', 'scrollbar-config.xConfig'])
|
|
2018
2041
|
}
|
|
2019
|
-
if (
|
|
2020
|
-
|
|
2042
|
+
if (scrollbarOpts.y) {
|
|
2043
|
+
warnLog('vxe.error.delProp', ['scrollbar-config.y', 'scrollbar-config.yConfig'])
|
|
2021
2044
|
}
|
|
2022
2045
|
|
|
2023
2046
|
Object.assign(scrollYStore, {
|
|
@@ -2248,7 +2271,7 @@ export default {
|
|
|
2248
2271
|
|
|
2249
2272
|
const { xID } = $xeTable
|
|
2250
2273
|
|
|
2251
|
-
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props
|
|
2274
|
+
const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props
|
|
2252
2275
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData
|
|
2253
2276
|
const { leftList, rightList } = columnStore
|
|
2254
2277
|
const loadingSlot = slots.loading
|
|
@@ -2275,10 +2298,13 @@ export default {
|
|
|
2275
2298
|
const isContentMenu = $xeTable.computeIsContentMenu
|
|
2276
2299
|
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading
|
|
2277
2300
|
const resizableOpts = $xeTable.computeResizableOpts
|
|
2278
|
-
const isArea = mouseConfig && mouseOpts.area
|
|
2301
|
+
const isArea = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area
|
|
2279
2302
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
2280
2303
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop
|
|
2281
2304
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
|
|
2305
|
+
const exportOpts = $xeTable.computeExportOpts
|
|
2306
|
+
const importOpts = $xeTable.computeImportOpts
|
|
2307
|
+
const printOpts = $xeTable.computePrintOpts
|
|
2282
2308
|
const { isCrossTableDrag } = rowDragOpts
|
|
2283
2309
|
const tbOns: {
|
|
2284
2310
|
contextmenu: (...args: any[]) => void
|
|
@@ -2293,13 +2319,13 @@ export default {
|
|
|
2293
2319
|
}
|
|
2294
2320
|
return h('div', {
|
|
2295
2321
|
ref: 'refElem',
|
|
2296
|
-
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
2322
|
+
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, useScrollbar ? 'is--virtual-scrollbar' : 'is--native-scrollbar', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
2297
2323
|
[`size--${vSize}`]: vSize,
|
|
2298
2324
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
2299
2325
|
'vxe-editable': !!editConfig,
|
|
2300
2326
|
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete',
|
|
2301
2327
|
'cell--highlight': highlightCell,
|
|
2302
|
-
'cell--selected': mouseConfig && mouseOpts.selected,
|
|
2328
|
+
'cell--selected': hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected,
|
|
2303
2329
|
'cell--area': isArea,
|
|
2304
2330
|
'header-cell--area': isArea && areaOpts.selectCellByHeader,
|
|
2305
2331
|
'body-cell--area': isArea && areaOpts.selectCellByBody,
|
|
@@ -2515,7 +2541,7 @@ export default {
|
|
|
2515
2541
|
/**
|
|
2516
2542
|
* 导入
|
|
2517
2543
|
*/
|
|
2518
|
-
initStore.import &&
|
|
2544
|
+
initStore.import && hasEnableConf(importConfig, importOpts)
|
|
2519
2545
|
? h(TableImportPanelComponent, {
|
|
2520
2546
|
key: 'it',
|
|
2521
2547
|
props: {
|
|
@@ -2527,7 +2553,7 @@ export default {
|
|
|
2527
2553
|
/**
|
|
2528
2554
|
* 导出
|
|
2529
2555
|
*/
|
|
2530
|
-
initStore.export && (
|
|
2556
|
+
initStore.export && (hasEnableConf(exportConfig, exportOpts) || hasEnableConf(printConfig, printOpts))
|
|
2531
2557
|
? h(TableExportPanelComponent, {
|
|
2532
2558
|
key: 'et',
|
|
2533
2559
|
props: {
|
|
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import { ColumnInfo } from './columnInfo'
|
|
3
3
|
import { isScale, isPx, queryElement } from '../../ui/src/dom'
|
|
4
4
|
import { createComponentLog } from '../../ui/src/log'
|
|
5
|
-
import { eqEmptyValue } from '../../ui/src/utils'
|
|
5
|
+
import { eqEmptyValue, hasEnableConf } from '../../ui/src/utils'
|
|
6
6
|
|
|
7
7
|
import type { VxeTableDefines, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePrivateMethods, VxeTablePropTypes } from '../../../types'
|
|
8
8
|
|
|
@@ -949,6 +949,9 @@ export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTabl
|
|
|
949
949
|
const props = $xeTable
|
|
950
950
|
const internalData = $xeTable as unknown as TableInternalData
|
|
951
951
|
|
|
952
|
+
const { keyboardConfig, mouseConfig } = props
|
|
953
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
954
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts
|
|
952
955
|
internalData.initStatus = false
|
|
953
956
|
const actionList = [
|
|
954
957
|
$xeTable.clearSort(),
|
|
@@ -968,12 +971,12 @@ export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTabl
|
|
|
968
971
|
$xeTable.clearFilter()
|
|
969
972
|
)
|
|
970
973
|
}
|
|
971
|
-
if ($xeTable.clearSelected && (
|
|
974
|
+
if ($xeTable.clearSelected && (hasEnableConf(keyboardConfig, keyboardOpts) || hasEnableConf(mouseConfig, mouseOpts))) {
|
|
972
975
|
actionList.push(
|
|
973
976
|
$xeTable.clearSelected()
|
|
974
977
|
)
|
|
975
978
|
}
|
|
976
|
-
if ($xeTable.clearCellAreas &&
|
|
979
|
+
if ($xeTable.clearCellAreas && hasEnableConf(mouseConfig, mouseOpts)) {
|
|
977
980
|
actionList.push(
|
|
978
981
|
$xeTable.clearCellAreas(),
|
|
979
982
|
$xeTable.clearCopyCellArea()
|
package/packages/ui/index.ts
CHANGED
|
@@ -270,16 +270,14 @@ VxeUI.setConfig({
|
|
|
270
270
|
oSize: 0
|
|
271
271
|
},
|
|
272
272
|
scrollbarConfig: {
|
|
273
|
-
//
|
|
274
|
-
//
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
visible: true
|
|
282
|
-
}
|
|
273
|
+
// xConfig: {
|
|
274
|
+
// // position: 'bottom',
|
|
275
|
+
// // visible: true
|
|
276
|
+
// },
|
|
277
|
+
// yConfig: {
|
|
278
|
+
// // position: 'right',
|
|
279
|
+
// // visible: true
|
|
280
|
+
// }
|
|
283
281
|
},
|
|
284
282
|
undoRedoHistoryConfig: {
|
|
285
283
|
stackSize: 50
|
package/packages/ui/src/utils.ts
CHANGED
|
@@ -8,6 +8,16 @@ export function isEnableConf (conf: any): boolean {
|
|
|
8
8
|
return conf && conf.enabled !== false
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* 用于开关类型的配置项
|
|
13
|
+
* 局部启用规则:conf={}
|
|
14
|
+
* 局部禁用规则:conf={enabled:false}
|
|
15
|
+
* 全局默认启用规则:conf.enabled=true
|
|
16
|
+
*/
|
|
17
|
+
export function hasEnableConf (conf: any, opts: any): boolean {
|
|
18
|
+
return opts && (conf ? opts.enabled !== false : opts.enabled)
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
export function isEmptyValue (cellValue: any) {
|
|
12
22
|
return cellValue === null || cellValue === undefined || cellValue === ''
|
|
13
23
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|