vxe-table 4.3.13 → 4.4.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 +1 -1
- package/es/form/src/form-config-item.js +7 -2
- package/es/form/src/form-item.js +7 -2
- package/es/grid/src/grid.js +1 -1
- package/es/icon/style.css +1 -1
- package/es/select/src/select.js +7 -3
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +4 -3
- package/es/table/src/table.js +6 -3
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/lib/form/src/form-config-item.js +7 -2
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-item.js +7 -2
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +32 -16
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +5 -3
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +4 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +6 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/form/src/form-config-item.ts +7 -2
- package/packages/form/src/form-item.ts +7 -2
- package/packages/grid/src/grid.ts +4 -4
- package/packages/select/src/select.ts +7 -3
- package/packages/table/src/body.ts +4 -3
- package/packages/table/src/column.ts +3 -3
- package/packages/table/src/props.ts +3 -3
- package/packages/table/src/table.ts +10 -7
- package/types/column.d.ts +71 -72
- package/types/component.d.ts +1 -7
- package/types/edit.d.ts +22 -22
- package/types/filter.d.ts +3 -3
- package/types/grid.d.ts +258 -250
- package/types/plugins/pro.d.ts +275 -275
- package/types/select.d.ts +20 -1
- package/types/table.d.ts +667 -630
- package/types/toolbar.d.ts +1 -1
- package/types/v-x-e-table/menus.d.ts +10 -10
- package/types/v-x-e-table/renderer.d.ts +51 -43
- package/types/validator.d.ts +22 -21
- /package/es/icon/style/{iconfont.1683246853825.ttf → iconfont.1684467973646.ttf} +0 -0
- /package/es/icon/style/{iconfont.1683246853825.woff → iconfont.1684467973646.woff} +0 -0
- /package/es/icon/style/{iconfont.1683246853825.woff2 → iconfont.1684467973646.woff2} +0 -0
- /package/es/{iconfont.1683246853825.ttf → iconfont.1684467973646.ttf} +0 -0
- /package/es/{iconfont.1683246853825.woff → iconfont.1684467973646.woff} +0 -0
- /package/es/{iconfont.1683246853825.woff2 → iconfont.1684467973646.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1683246853825.ttf → iconfont.1684467973646.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1683246853825.woff → iconfont.1684467973646.woff} +0 -0
- /package/lib/icon/style/{iconfont.1683246853825.woff2 → iconfont.1684467973646.woff2} +0 -0
- /package/lib/{iconfont.1683246853825.ttf → iconfont.1684467973646.ttf} +0 -0
- /package/lib/{iconfont.1683246853825.woff → iconfont.1684467973646.woff} +0 -0
- /package/lib/{iconfont.1683246853825.woff2 → iconfont.1684467973646.woff2} +0 -0
|
@@ -80,6 +80,9 @@ export default defineComponent({
|
|
|
80
80
|
const { slots, title, visible, folding, field, collapseNode, itemRender, showError, errRule, className, titleOverflow } = item
|
|
81
81
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
82
82
|
const itemClassName = compConf ? compConf.itemClassName : ''
|
|
83
|
+
const itemStyle = compConf ? compConf.itemStyle : null
|
|
84
|
+
const itemContentClassName = compConf ? compConf.itemContentClassName : ''
|
|
85
|
+
const itemContentStyle = compConf ? compConf.itemContentStyle : null
|
|
83
86
|
const defaultSlot = slots ? slots.default : null
|
|
84
87
|
const titleSlot = slots ? slots.title : null
|
|
85
88
|
const span = item.span || props.span
|
|
@@ -160,7 +163,8 @@ export default defineComponent({
|
|
|
160
163
|
'is--active': isActivetem($xeform, item),
|
|
161
164
|
'is--error': showError
|
|
162
165
|
}
|
|
163
|
-
]
|
|
166
|
+
],
|
|
167
|
+
style: XEUtils.isFunction(itemStyle) ? itemStyle(params) : itemStyle
|
|
164
168
|
}, [
|
|
165
169
|
h('div', {
|
|
166
170
|
class: 'vxe-form--item-inner'
|
|
@@ -176,7 +180,8 @@ export default defineComponent({
|
|
|
176
180
|
...ons
|
|
177
181
|
}, renderTitle($xeform, item)) : null,
|
|
178
182
|
h('div', {
|
|
179
|
-
class: ['vxe-form--item-content', align ? `align--${align}` :
|
|
183
|
+
class: ['vxe-form--item-content', align ? `align--${align}` : '', itemContentClassName ? (XEUtils.isFunction(itemContentClassName) ? itemContentClassName(params) : itemContentClassName) : ''],
|
|
184
|
+
style: XEUtils.isFunction(itemContentStyle) ? itemContentStyle(params) : itemContentStyle
|
|
180
185
|
}, contentVNs)
|
|
181
186
|
])
|
|
182
187
|
])
|
|
@@ -15,7 +15,7 @@ import { TableMethods, VxeGridConstructor, VxeGridEmits, GridReactData, VxeGridP
|
|
|
15
15
|
|
|
16
16
|
const tableComponentPropKeys = Object.keys(tableComponentProps as any)
|
|
17
17
|
|
|
18
|
-
const tableComponentMethodKeys: (keyof TableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'openTooltip', 'focus', 'blur', 'connect']
|
|
18
|
+
const tableComponentMethodKeys: (keyof TableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'openTooltip', 'focus', 'blur', 'connect']
|
|
19
19
|
|
|
20
20
|
const gridComponentEmits: VxeGridEmits = [
|
|
21
21
|
...tableComponentEmits,
|
|
@@ -37,9 +37,9 @@ export default defineComponent({
|
|
|
37
37
|
name: 'VxeGrid',
|
|
38
38
|
props: {
|
|
39
39
|
...tableComponentProps,
|
|
40
|
-
columns: Array as PropType<VxeGridPropTypes.Columns
|
|
40
|
+
columns: Array as PropType<VxeGridPropTypes.Columns<any>>,
|
|
41
41
|
pagerConfig: Object as PropType<VxeGridPropTypes.PagerConfig>,
|
|
42
|
-
proxyConfig: Object as PropType<VxeGridPropTypes.ProxyConfig
|
|
42
|
+
proxyConfig: Object as PropType<VxeGridPropTypes.ProxyConfig<any>>,
|
|
43
43
|
toolbarConfig: Object as PropType<VxeGridPropTypes.ToolbarConfig>,
|
|
44
44
|
formConfig: Object as PropType<VxeGridPropTypes.FormConfig>,
|
|
45
45
|
zoomConfig: Object as PropType<VxeGridPropTypes.ZoomConfig>,
|
|
@@ -70,7 +70,7 @@ export default defineComponent({
|
|
|
70
70
|
pageSize: GlobalConfig.pager.pageSize || 10,
|
|
71
71
|
currentPage: 1
|
|
72
72
|
}
|
|
73
|
-
} as GridReactData)
|
|
73
|
+
} as GridReactData<any>)
|
|
74
74
|
|
|
75
75
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
76
76
|
const refTable = ref() as Ref<ComponentPublicInstance<VxeTableProps, VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods>>
|
|
@@ -52,7 +52,9 @@ export default defineComponent({
|
|
|
52
52
|
emits: [
|
|
53
53
|
'update:modelValue',
|
|
54
54
|
'change',
|
|
55
|
-
'clear'
|
|
55
|
+
'clear',
|
|
56
|
+
'blur',
|
|
57
|
+
'focus'
|
|
56
58
|
] as VxeSelectEmits,
|
|
57
59
|
setup (props, context) {
|
|
58
60
|
const { slots, emit } = context
|
|
@@ -635,14 +637,16 @@ export default defineComponent({
|
|
|
635
637
|
}
|
|
636
638
|
}
|
|
637
639
|
|
|
638
|
-
const focusEvent = () => {
|
|
640
|
+
const focusEvent = (evnt: FocusEvent) => {
|
|
639
641
|
if (!props.disabled) {
|
|
640
642
|
reactData.isActivated = true
|
|
641
643
|
}
|
|
644
|
+
selectMethods.dispatchEvent('focus', {}, evnt)
|
|
642
645
|
}
|
|
643
646
|
|
|
644
|
-
const blurEvent = () => {
|
|
647
|
+
const blurEvent = (evnt: FocusEvent) => {
|
|
645
648
|
reactData.isActivated = false
|
|
649
|
+
selectMethods.dispatchEvent('blur', {}, evnt)
|
|
646
650
|
}
|
|
647
651
|
|
|
648
652
|
const modelSearchEvent = (value: string) => {
|
|
@@ -139,7 +139,8 @@ export default defineComponent({
|
|
|
139
139
|
const { height: rowHeight } = rowOpts
|
|
140
140
|
const renderOpts = editRender || cellRender
|
|
141
141
|
const compConf = renderOpts ? VXETable.renderer.get(renderOpts.name) : null
|
|
142
|
-
const
|
|
142
|
+
const compCellClassName = compConf ? compConf.cellClassName : ''
|
|
143
|
+
const compCellStyle = compConf ? compConf.cellStyle : ''
|
|
143
144
|
const showAllTip = tooltipOpts.showAll
|
|
144
145
|
const columnIndex = $xetable.getColumnIndex(column)
|
|
145
146
|
const _columnIndex = $xetable.getVTColumnIndex(column)
|
|
@@ -303,7 +304,7 @@ export default defineComponent({
|
|
|
303
304
|
'col--valid-error': hasValidError,
|
|
304
305
|
'col--current': currentColumn === column
|
|
305
306
|
},
|
|
306
|
-
getPropClass(
|
|
307
|
+
getPropClass(compCellClassName, params),
|
|
307
308
|
getPropClass(className, params),
|
|
308
309
|
getPropClass(allCellClassName, params)
|
|
309
310
|
],
|
|
@@ -311,7 +312,7 @@ export default defineComponent({
|
|
|
311
312
|
...attrs,
|
|
312
313
|
style: Object.assign({
|
|
313
314
|
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
314
|
-
},
|
|
315
|
+
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
|
|
315
316
|
...tdOns
|
|
316
317
|
}, tdVNs)
|
|
317
318
|
}
|
|
@@ -42,7 +42,7 @@ export const columnProps = {
|
|
|
42
42
|
// 给表尾单元格附加 className
|
|
43
43
|
footerClassName: [String, Function] as PropType<VxeColumnPropTypes.FooterClassName>,
|
|
44
44
|
// 格式化显示内容
|
|
45
|
-
formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter
|
|
45
|
+
formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
|
|
46
46
|
// 是否允许排序
|
|
47
47
|
sortable: Boolean as PropType<VxeColumnPropTypes.Sortable>,
|
|
48
48
|
// 自定义排序的属性
|
|
@@ -54,7 +54,7 @@ export const columnProps = {
|
|
|
54
54
|
// 筛选是否允许多选
|
|
55
55
|
filterMultiple: { type: Boolean as PropType<VxeColumnPropTypes.FilterMultiple>, default: true },
|
|
56
56
|
// 自定义筛选方法
|
|
57
|
-
filterMethod: Function as PropType<VxeColumnPropTypes.FilterMethod
|
|
57
|
+
filterMethod: Function as PropType<VxeColumnPropTypes.FilterMethod<any>>,
|
|
58
58
|
// 筛选重置方法
|
|
59
59
|
filterResetMethod: Function as PropType<VxeColumnPropTypes.FilterResetMethod>,
|
|
60
60
|
// 筛选复原方法
|
|
@@ -76,7 +76,7 @@ export const columnProps = {
|
|
|
76
76
|
// 单元格值类型
|
|
77
77
|
cellType: String as PropType<VxeColumnPropTypes.CellType>,
|
|
78
78
|
// 单元格渲染配置项
|
|
79
|
-
cellRender: Object as PropType<VxeColumnPropTypes.CellRender
|
|
79
|
+
cellRender: Object as PropType<VxeColumnPropTypes.CellRender<any>>,
|
|
80
80
|
// 单元格编辑渲染配置项
|
|
81
81
|
editRender: Object as PropType<VxeColumnPropTypes.EditRender>,
|
|
82
82
|
// 内容渲染配置项
|
|
@@ -138,13 +138,13 @@ export default {
|
|
|
138
138
|
// 区域配置项
|
|
139
139
|
areaConfig: Object as PropType<VxeTablePropTypes.AreaConfig>,
|
|
140
140
|
// 按键配置项
|
|
141
|
-
keyboardConfig: Object as PropType<VxeTablePropTypes.KeyboardConfig
|
|
141
|
+
keyboardConfig: Object as PropType<VxeTablePropTypes.KeyboardConfig<any>>,
|
|
142
142
|
// 复制粘/贴配置项
|
|
143
|
-
clipConfig: Object as PropType<VxeTablePropTypes.ClipConfig
|
|
143
|
+
clipConfig: Object as PropType<VxeTablePropTypes.ClipConfig<any>>,
|
|
144
144
|
// 查找/替换配置项
|
|
145
145
|
fnrConfig: Object as PropType<VxeTablePropTypes.FNRConfig>,
|
|
146
146
|
// 编辑配置项
|
|
147
|
-
editConfig: Object as PropType<VxeTablePropTypes.EditConfig
|
|
147
|
+
editConfig: Object as PropType<VxeTablePropTypes.EditConfig<any>>,
|
|
148
148
|
// 校验配置项
|
|
149
149
|
validConfig: Object as PropType<VxeTablePropTypes.ValidConfig>,
|
|
150
150
|
// 校验规则配置项
|
|
@@ -18,7 +18,7 @@ import VxeLoading from '../../loading/index'
|
|
|
18
18
|
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, restoreScrollListener, XEBodyScrollElement } from './util'
|
|
19
19
|
import { getSlotVNs } from '../../tools/vn'
|
|
20
20
|
|
|
21
|
-
import { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, VxeTooltipInstance, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, VxeTableMethods, TableMethods, VxeMenuPanelInstance, VxeTableDefines, VxeTableProps, VxeColumnPropTypes } from '../../../types/all'
|
|
21
|
+
import { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, VxeTooltipInstance, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, VxeTableMethods, TableMethods, VxeMenuPanelInstance, VxeTableDefines, VxeTableProps, VxeColumnPropTypes, VxeTableDataRow } from '../../../types/all'
|
|
22
22
|
|
|
23
23
|
const isWebkit = browse['-webkit'] && !browse.edge
|
|
24
24
|
|
|
@@ -420,7 +420,7 @@ export default defineComponent({
|
|
|
420
420
|
})
|
|
421
421
|
|
|
422
422
|
const computeClipOpts = computed(() => {
|
|
423
|
-
return Object.assign({}, GlobalConfig.table.clipConfig, props.clipConfig)
|
|
423
|
+
return Object.assign({}, GlobalConfig.table.clipConfig, props.clipConfig)
|
|
424
424
|
})
|
|
425
425
|
|
|
426
426
|
const computeFNROpts = computed(() => {
|
|
@@ -3116,7 +3116,7 @@ export default defineComponent({
|
|
|
3116
3116
|
return new Promise(resolve => {
|
|
3117
3117
|
// 还原滚动条位置
|
|
3118
3118
|
if (lastScrollLeft || lastScrollTop) {
|
|
3119
|
-
return restoreScrollLocation($xetable, lastScrollLeft, lastScrollTop).then(
|
|
3119
|
+
return restoreScrollLocation($xetable, lastScrollLeft, lastScrollTop).then().then(() => {
|
|
3120
3120
|
// 存在滚动行为未结束情况
|
|
3121
3121
|
setTimeout(resolve, 30)
|
|
3122
3122
|
})
|
|
@@ -3560,13 +3560,16 @@ export default defineComponent({
|
|
|
3560
3560
|
* 判断指定列是否为筛选状态,如果为空则判断所有列
|
|
3561
3561
|
* @param {String} fieldOrColumn 字段名
|
|
3562
3562
|
*/
|
|
3563
|
-
|
|
3563
|
+
isActiveFilterByColumn (fieldOrColumn) {
|
|
3564
3564
|
const column = handleFieldOrColumn($xetable, fieldOrColumn)
|
|
3565
3565
|
if (column) {
|
|
3566
3566
|
return column.filters && column.filters.some((option) => option.checked)
|
|
3567
3567
|
}
|
|
3568
3568
|
return $xetable.getCheckedFilters().length > 0
|
|
3569
3569
|
},
|
|
3570
|
+
isFilter (fieldOrColumn) {
|
|
3571
|
+
return tableMethods.isActiveFilterByColumn(fieldOrColumn)
|
|
3572
|
+
},
|
|
3570
3573
|
/**
|
|
3571
3574
|
* 判断展开行是否懒加载完成
|
|
3572
3575
|
* @param {Row} row 行对象
|
|
@@ -4413,7 +4416,7 @@ export default defineComponent({
|
|
|
4413
4416
|
if (keyboardOpts.isDel && (selected.row || selected.column)) {
|
|
4414
4417
|
if (delMethod) {
|
|
4415
4418
|
delMethod({
|
|
4416
|
-
row: selected.row,
|
|
4419
|
+
row: selected.row as VxeTableDataRow,
|
|
4417
4420
|
rowIndex: tableMethods.getRowIndex(selected.row),
|
|
4418
4421
|
column: selected.column,
|
|
4419
4422
|
columnIndex: tableMethods.getColumnIndex(selected.column),
|
|
@@ -4425,7 +4428,7 @@ export default defineComponent({
|
|
|
4425
4428
|
if (isBack) {
|
|
4426
4429
|
if (backMethod) {
|
|
4427
4430
|
backMethod({
|
|
4428
|
-
row: selected.row,
|
|
4431
|
+
row: selected.row as VxeTableDataRow,
|
|
4429
4432
|
rowIndex: tableMethods.getRowIndex(selected.row),
|
|
4430
4433
|
column: selected.column,
|
|
4431
4434
|
columnIndex: tableMethods.getColumnIndex(selected.column),
|
|
@@ -5103,7 +5106,7 @@ export default defineComponent({
|
|
|
5103
5106
|
const { column } = params
|
|
5104
5107
|
const { tooltipStore } = reactData
|
|
5105
5108
|
const cell = evnt.currentTarget as HTMLTableCellElement
|
|
5106
|
-
handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row)
|
|
5109
|
+
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row)
|
|
5107
5110
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
5108
5111
|
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') as HTMLElement || cell.children[0], null, params)
|
|
5109
5112
|
}
|
package/types/column.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { VNode } from 'vue'
|
|
2
1
|
import { VXEComponent, SlotVNodeType } from './component'
|
|
3
|
-
import { VxeTableConstructor, VxeTableDefines, VxeTablePropTypes } from './table'
|
|
2
|
+
import { VxeTableConstructor, VxeTableDataRow, VxeTableDefines, VxeTablePropTypes } from './table'
|
|
4
3
|
import { VxeGlobalRendererHandles } from './v-x-e-table'
|
|
5
4
|
import { VxeFilterPanel } from './filter'
|
|
6
5
|
import { VxeTooltipPropTypes } from './tooltip'
|
|
@@ -11,11 +10,11 @@ import { VxeTooltipPropTypes } from './tooltip'
|
|
|
11
10
|
* 组件 - 表格列
|
|
12
11
|
* @example import { VxeColumn } from 'vxe-table'
|
|
13
12
|
*/
|
|
14
|
-
export const VxeColumn: VXEComponent<VxeColumnProps
|
|
13
|
+
export const VxeColumn: VXEComponent<VxeColumnProps<any>>
|
|
15
14
|
/**
|
|
16
15
|
* 组件 - 表格列
|
|
17
16
|
*/
|
|
18
|
-
export const Column: VXEComponent<VxeColumnProps
|
|
17
|
+
export const Column: VXEComponent<VxeColumnProps<any>>
|
|
19
18
|
|
|
20
19
|
export namespace VxeColumnPropTypes {
|
|
21
20
|
export type ColId = string | number
|
|
@@ -33,20 +32,20 @@ export namespace VxeColumnPropTypes {
|
|
|
33
32
|
export type ShowOverflow = VxeTablePropTypes.ShowOverflow
|
|
34
33
|
export type ShowHeaderOverflow = ShowOverflow
|
|
35
34
|
export type ShowFooterOverflow = ShowOverflow
|
|
36
|
-
export type ClassName = string | ((params: VxeGlobalRendererHandles.RenderCellParams) => string | any[] | { [key: string]: boolean })
|
|
37
|
-
export type HeaderClassName = string | ((params: VxeGlobalRendererHandles.RenderHeaderParams) => string | any[] | { [key: string]: boolean })
|
|
38
|
-
export type FooterClassName = string | ((params: VxeGlobalRendererHandles.RenderFooterParams) => string | any[] | { [key: string]: boolean })
|
|
35
|
+
export type ClassName<D = VxeTableDataRow> = string | ((params: VxeGlobalRendererHandles.RenderCellParams<D>) => string | any[] | { [key: string]: boolean })
|
|
36
|
+
export type HeaderClassName<D = VxeTableDataRow> = string | ((params: VxeGlobalRendererHandles.RenderHeaderParams<D>) => string | any[] | { [key: string]: boolean })
|
|
37
|
+
export type FooterClassName<D = VxeTableDataRow> = string | ((params: VxeGlobalRendererHandles.RenderFooterParams<D>) => string | any[] | { [key: string]: boolean })
|
|
39
38
|
|
|
40
|
-
export type Formatter = ((params: {
|
|
39
|
+
export type Formatter<D = VxeTableDataRow> = ((params: {
|
|
41
40
|
cellValue: any
|
|
42
|
-
column: VxeTableDefines.ColumnInfo
|
|
43
|
-
row:
|
|
41
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
42
|
+
row: D
|
|
44
43
|
}) => string | number) | any[] | string
|
|
45
44
|
|
|
46
45
|
export type Sortable = boolean
|
|
47
|
-
export type SortBy = string | ((params: {
|
|
48
|
-
row:
|
|
49
|
-
column: VxeTableDefines.ColumnInfo
|
|
46
|
+
export type SortBy<D = VxeTableDataRow> = string | ((params: {
|
|
47
|
+
row: D
|
|
48
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
50
49
|
}) => string | number)
|
|
51
50
|
export type SortType = 'auto' | 'string' | 'number' | null
|
|
52
51
|
|
|
@@ -61,27 +60,27 @@ export namespace VxeColumnPropTypes {
|
|
|
61
60
|
|
|
62
61
|
export type FilterMultiple = boolean
|
|
63
62
|
|
|
64
|
-
interface FilterMethodParams {
|
|
65
|
-
$table: VxeTableConstructor
|
|
63
|
+
interface FilterMethodParams<D = VxeTableDataRow> {
|
|
64
|
+
$table: VxeTableConstructor<D>,
|
|
66
65
|
value: any
|
|
67
66
|
option: VxeTableDefines.FilterOption
|
|
68
67
|
cellValue: any
|
|
69
|
-
row:
|
|
70
|
-
column: VxeTableDefines.ColumnInfo
|
|
68
|
+
row: D
|
|
69
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
71
70
|
}
|
|
72
|
-
export type FilterMethod = (params: FilterMethodParams) => boolean
|
|
71
|
+
export type FilterMethod<D = VxeTableDataRow> = (params: FilterMethodParams<D>) => boolean
|
|
73
72
|
|
|
74
|
-
interface FilterResetMethodParams {
|
|
73
|
+
interface FilterResetMethodParams<D = VxeTableDataRow> {
|
|
75
74
|
options: VxeTableDefines.FilterOption[]
|
|
76
|
-
column: VxeTableDefines.ColumnInfo
|
|
75
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
77
76
|
}
|
|
78
77
|
export type FilterResetMethod = (params: FilterResetMethodParams) => void
|
|
79
78
|
|
|
80
|
-
interface FilterRecoverMethodParams {
|
|
79
|
+
interface FilterRecoverMethodParams<D = VxeTableDataRow> {
|
|
81
80
|
option: VxeTableDefines.FilterOption
|
|
82
|
-
column: VxeTableDefines.ColumnInfo
|
|
81
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
83
82
|
}
|
|
84
|
-
export type FilterRecoverMethod = (params: FilterRecoverMethodParams) => void
|
|
83
|
+
export type FilterRecoverMethod<D = VxeTableDataRow> = (params: FilterRecoverMethodParams<D>) => void
|
|
85
84
|
|
|
86
85
|
/**
|
|
87
86
|
* 筛选渲染配置项
|
|
@@ -97,20 +96,20 @@ export namespace VxeColumnPropTypes {
|
|
|
97
96
|
export type TreeNode = boolean
|
|
98
97
|
export type Visible = boolean
|
|
99
98
|
|
|
100
|
-
interface ExportMethodParams {
|
|
101
|
-
$table: VxeTableConstructor
|
|
102
|
-
row:
|
|
103
|
-
column: VxeTableDefines.ColumnInfo
|
|
99
|
+
interface ExportMethodParams<D = VxeTableDataRow> {
|
|
100
|
+
$table: VxeTableConstructor<D>,
|
|
101
|
+
row: D
|
|
102
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
104
103
|
}
|
|
105
|
-
export type ExportMethod = (params: ExportMethodParams) => string | number
|
|
104
|
+
export type ExportMethod<D = VxeTableDataRow> = (params: ExportMethodParams<D>) => string | number
|
|
106
105
|
|
|
107
|
-
interface FooterExportParams {
|
|
108
|
-
$table: VxeTableConstructor
|
|
106
|
+
interface FooterExportParams<D = VxeTableDataRow> {
|
|
107
|
+
$table: VxeTableConstructor<D>,
|
|
109
108
|
items: any[]
|
|
110
|
-
column: VxeTableDefines.ColumnInfo
|
|
109
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
111
110
|
_columnIndex: number
|
|
112
111
|
}
|
|
113
|
-
export type FooterExportMethod = (params: FooterExportParams) => string | number
|
|
112
|
+
export type FooterExportMethod<D = VxeTableDataRow> = (params: FooterExportParams<D>) => string | number
|
|
114
113
|
|
|
115
114
|
export interface TitlePrefix {
|
|
116
115
|
useHTML?: VxeTooltipPropTypes.UseHTML
|
|
@@ -128,8 +127,8 @@ export namespace VxeColumnPropTypes {
|
|
|
128
127
|
|
|
129
128
|
export type CellType = 'auto' | 'number' | 'string'
|
|
130
129
|
|
|
131
|
-
export interface CellRender extends VxeGlobalRendererHandles.RenderOptions {
|
|
132
|
-
events?: { [key: string]: (cellParams: DefaultSlotParams
|
|
130
|
+
export interface CellRender<D = VxeTableDataRow> extends VxeGlobalRendererHandles.RenderOptions {
|
|
131
|
+
events?: { [key: string]: (cellParams: DefaultSlotParams<D>, ...args: any[]) => any }
|
|
133
132
|
options?: any[]
|
|
134
133
|
optionProps?: VxeGlobalRendererHandles.RenderOptionProps
|
|
135
134
|
optionGroups?: any[]
|
|
@@ -140,7 +139,7 @@ export namespace VxeColumnPropTypes {
|
|
|
140
139
|
/**
|
|
141
140
|
* 编辑渲染配置项
|
|
142
141
|
*/
|
|
143
|
-
export interface EditRender extends VxeGlobalRendererHandles.RenderOptions {
|
|
142
|
+
export interface EditRender<D = VxeTableDataRow> extends VxeGlobalRendererHandles.RenderOptions {
|
|
144
143
|
events?: { [key: string]: (cellParams: EditSlotParams, ...args: any[]) => any }
|
|
145
144
|
enabled?: boolean
|
|
146
145
|
options?: any[]
|
|
@@ -149,7 +148,7 @@ export namespace VxeColumnPropTypes {
|
|
|
149
148
|
optionGroupProps?: VxeGlobalRendererHandles.RenderOptionGroupProps
|
|
150
149
|
autofocus?: string
|
|
151
150
|
autoselect?: boolean
|
|
152
|
-
defaultValue?: ((params: { column: VxeTableDefines.ColumnInfo }) => any) | null | undefined | string | number | RegExp | object | any[] | Date
|
|
151
|
+
defaultValue?: ((params: { column: VxeTableDefines.ColumnInfo<D> }) => any) | null | undefined | string | number | RegExp | object | any[] | Date
|
|
153
152
|
immediate?: boolean
|
|
154
153
|
content?: string
|
|
155
154
|
placeholder?: string
|
|
@@ -167,42 +166,42 @@ export namespace VxeColumnPropTypes {
|
|
|
167
166
|
|
|
168
167
|
export type Params = any
|
|
169
168
|
|
|
170
|
-
interface FilterSlotParams {
|
|
169
|
+
interface FilterSlotParams<D = VxeTableDataRow> {
|
|
171
170
|
$panel: VxeFilterPanel
|
|
172
171
|
column: {
|
|
173
172
|
filters: VxeTableDefines.FilterOption[]
|
|
174
|
-
} & VxeTableDefines.ColumnInfo
|
|
173
|
+
} & VxeTableDefines.ColumnInfo<D>
|
|
175
174
|
columnIndex: number
|
|
176
175
|
$columnIndex: number
|
|
177
176
|
$rowIndex: number
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
interface EditSlotParams {
|
|
181
|
-
column: VxeTableDefines.ColumnInfo
|
|
179
|
+
interface EditSlotParams<D = VxeTableDataRow> {
|
|
180
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
182
181
|
columnIndex: number
|
|
183
182
|
$columnIndex: number
|
|
184
|
-
row:
|
|
183
|
+
row: D
|
|
185
184
|
rowIndex: number
|
|
186
185
|
$rowIndex: number
|
|
187
186
|
}
|
|
188
187
|
|
|
189
|
-
interface FooterSlotParams {
|
|
190
|
-
column: VxeTableDefines.ColumnInfo
|
|
188
|
+
interface FooterSlotParams<D = VxeTableDataRow> {
|
|
189
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
191
190
|
columnIndex: number
|
|
192
191
|
_columnIndex: number
|
|
193
192
|
$columnIndex: number
|
|
194
193
|
$rowIndex: number
|
|
195
194
|
items: any[]
|
|
196
|
-
data:
|
|
195
|
+
data: D[][]
|
|
197
196
|
}
|
|
198
197
|
|
|
199
|
-
interface HeaderSlotParams extends VxeTableDefines.CellRenderHeaderParams { }
|
|
198
|
+
interface HeaderSlotParams<D = VxeTableDataRow> extends VxeTableDefines.CellRenderHeaderParams<D> { }
|
|
200
199
|
|
|
201
|
-
interface ContentSlotParams {
|
|
202
|
-
column: VxeTableDefines.ColumnInfo
|
|
200
|
+
interface ContentSlotParams<D = VxeTableDataRow> {
|
|
201
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
203
202
|
columnIndex: number
|
|
204
203
|
$columnIndex: number
|
|
205
|
-
row:
|
|
204
|
+
row: D
|
|
206
205
|
rowIndex: number
|
|
207
206
|
$rowIndex: number
|
|
208
207
|
isHidden: boolean
|
|
@@ -210,25 +209,25 @@ export namespace VxeColumnPropTypes {
|
|
|
210
209
|
type: string
|
|
211
210
|
}
|
|
212
211
|
|
|
213
|
-
interface DefaultSlotParams extends VxeTableDefines.CellRenderBodyParams { }
|
|
212
|
+
interface DefaultSlotParams<D = VxeTableDataRow> extends VxeTableDefines.CellRenderBodyParams<D> { }
|
|
214
213
|
|
|
215
|
-
interface IconSlotParams extends DefaultSlotParams { }
|
|
214
|
+
interface IconSlotParams<D = VxeTableDataRow> extends DefaultSlotParams<D> { }
|
|
216
215
|
|
|
217
|
-
export type Slots = {
|
|
218
|
-
title?: string | ((params: HeaderSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
219
|
-
radio?: string | ((params: DefaultSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
220
|
-
checkbox?: string | ((params: DefaultSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
221
|
-
default?: string | ((params: DefaultSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
222
|
-
header?: string | ((params: HeaderSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
223
|
-
footer?: string | ((params: FooterSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
224
|
-
content?: string | ((params: ContentSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
225
|
-
filter?: string | ((params: FilterSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
226
|
-
edit?: string | ((params: EditSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
227
|
-
icon?: string | ((params: IconSlotParams) => SlotVNodeType[] | SlotVNodeType) | null
|
|
216
|
+
export type Slots<D = VxeTableDataRow> = {
|
|
217
|
+
title?: string | ((params: HeaderSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
218
|
+
radio?: string | ((params: DefaultSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
219
|
+
checkbox?: string | ((params: DefaultSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
220
|
+
default?: string | ((params: DefaultSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
221
|
+
header?: string | ((params: HeaderSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
222
|
+
footer?: string | ((params: FooterSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
223
|
+
content?: string | ((params: ContentSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
224
|
+
filter?: string | ((params: FilterSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
225
|
+
edit?: string | ((params: EditSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
226
|
+
icon?: string | ((params: IconSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
229
|
|
|
231
|
-
export type VxeColumnProps = {
|
|
230
|
+
export type VxeColumnProps<D = VxeTableDataRow> = {
|
|
232
231
|
colId?: VxeColumnPropTypes.ColId
|
|
233
232
|
/**
|
|
234
233
|
* 渲染类型
|
|
@@ -289,19 +288,19 @@ export type VxeColumnProps = {
|
|
|
289
288
|
/**
|
|
290
289
|
* 给单元格附加 className
|
|
291
290
|
*/
|
|
292
|
-
className?: VxeColumnPropTypes.ClassName
|
|
291
|
+
className?: VxeColumnPropTypes.ClassName<D>
|
|
293
292
|
/**
|
|
294
293
|
* 给表头单元格附加 className
|
|
295
294
|
*/
|
|
296
|
-
headerClassName?: VxeColumnPropTypes.HeaderClassName
|
|
295
|
+
headerClassName?: VxeColumnPropTypes.HeaderClassName<D>
|
|
297
296
|
/**
|
|
298
297
|
* 给表尾单元格附加 className
|
|
299
298
|
*/
|
|
300
|
-
footerClassName?: VxeColumnPropTypes.FooterClassName
|
|
299
|
+
footerClassName?: VxeColumnPropTypes.FooterClassName<D>
|
|
301
300
|
/**
|
|
302
301
|
* 格式化显示内容
|
|
303
302
|
*/
|
|
304
|
-
formatter?: VxeColumnPropTypes.Formatter
|
|
303
|
+
formatter?: VxeColumnPropTypes.Formatter<D>
|
|
305
304
|
/**
|
|
306
305
|
* 是否允许排序
|
|
307
306
|
*/
|
|
@@ -309,7 +308,7 @@ export type VxeColumnProps = {
|
|
|
309
308
|
/**
|
|
310
309
|
* 自定义排序的属性
|
|
311
310
|
*/
|
|
312
|
-
sortBy?: VxeColumnPropTypes.SortBy
|
|
311
|
+
sortBy?: VxeColumnPropTypes.SortBy<D>
|
|
313
312
|
/**
|
|
314
313
|
* 排序的字段类型,比如字符串转数值等
|
|
315
314
|
*/
|
|
@@ -325,7 +324,7 @@ export type VxeColumnProps = {
|
|
|
325
324
|
/**
|
|
326
325
|
* 自定义筛选方法
|
|
327
326
|
*/
|
|
328
|
-
filterMethod?: VxeColumnPropTypes.FilterMethod
|
|
327
|
+
filterMethod?: VxeColumnPropTypes.FilterMethod<D>
|
|
329
328
|
/**
|
|
330
329
|
* 筛选模板配置项
|
|
331
330
|
*/
|
|
@@ -341,11 +340,11 @@ export type VxeColumnProps = {
|
|
|
341
340
|
/**
|
|
342
341
|
* 自定义单元格数据导出方法
|
|
343
342
|
*/
|
|
344
|
-
exportMethod?: VxeColumnPropTypes.ExportMethod
|
|
343
|
+
exportMethod?: VxeColumnPropTypes.ExportMethod<D>
|
|
345
344
|
/**
|
|
346
345
|
* 自定义表尾单元格数据导出方法
|
|
347
346
|
*/
|
|
348
|
-
footerExportMethod?: VxeColumnPropTypes.FooterExportMethod
|
|
347
|
+
footerExportMethod?: VxeColumnPropTypes.FooterExportMethod<D>
|
|
349
348
|
/**
|
|
350
349
|
* 已废弃,被 titlePrefix 替换
|
|
351
350
|
* @deprecated
|
|
@@ -362,11 +361,11 @@ export type VxeColumnProps = {
|
|
|
362
361
|
/**
|
|
363
362
|
* 单元格渲染配置项
|
|
364
363
|
*/
|
|
365
|
-
cellRender?: VxeColumnPropTypes.CellRender
|
|
364
|
+
cellRender?: VxeColumnPropTypes.CellRender<D>
|
|
366
365
|
/**
|
|
367
366
|
* 单元格编辑渲染配置项
|
|
368
367
|
*/
|
|
369
|
-
editRender?: VxeColumnPropTypes.EditRender
|
|
368
|
+
editRender?: VxeColumnPropTypes.EditRender<D>
|
|
370
369
|
/**
|
|
371
370
|
* 内容渲染配置项
|
|
372
371
|
*/
|
package/types/component.d.ts
CHANGED
|
@@ -15,17 +15,11 @@ export interface VxeComponentBase {
|
|
|
15
15
|
xID: string
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export interface RecordInfo {
|
|
19
|
-
[key: string]: any
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
export interface VxeEvent {
|
|
23
19
|
$event: Event
|
|
24
20
|
[key: string]: any
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
export type VNodeStyle =
|
|
28
|
-
[key: string]: string | number
|
|
29
|
-
}
|
|
23
|
+
export type VNodeStyle = Record<string, string | number>
|
|
30
24
|
|
|
31
25
|
export type SlotVNodeType = JSX.Element | VNode | string | number
|