vxe-table 4.7.65 → 4.7.67
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 +21 -11
- package/es/locale/lang/en-US.js +4 -1
- package/es/locale/lang/es-ES.js +4 -1
- package/es/locale/lang/hu-HU.js +4 -1
- package/es/locale/lang/ja-JP.js +4 -1
- package/es/locale/lang/ko-KR.js +4 -1
- package/es/locale/lang/pt-BR.js +4 -1
- package/es/locale/lang/ru-RU.js +4 -1
- package/es/locale/lang/vi-VN.js +4 -1
- package/es/locale/lang/zh-CN.js +4 -1
- package/es/locale/lang/zh-TC.js +4 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +12 -11
- package/es/table/module/edit/hook.js +11 -10
- package/es/table/module/export/hook.js +10 -6
- package/es/table/render/index.js +95 -84
- package/es/table/src/table.js +51 -29
- package/es/table/style.css +8 -4
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +7 -7
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +8 -4
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +25 -14
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +236 -165
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -1
- package/lib/locale/lang/es-ES.js +4 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -1
- package/lib/locale/lang/hu-HU.js +4 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +4 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -1
- package/lib/locale/lang/ko-KR.js +4 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +4 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -1
- package/lib/locale/lang/ru-RU.js +4 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/vi-VN.js +4 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +4 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -1
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +4 -1
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +4 -1
- package/lib/locale/lang/zh-TC.js +4 -1
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +4 -1
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +4 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +18 -11
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +11 -13
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +12 -6
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/render/index.js +98 -84
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/table.js +48 -26
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +8 -4
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/src/toolbar.js +17 -7
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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 +8 -4
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +22 -11
- package/packages/locale/lang/en-US.ts +4 -1
- package/packages/locale/lang/es-ES.ts +4 -1
- package/packages/locale/lang/hu-HU.ts +4 -1
- package/packages/locale/lang/ja-JP.ts +4 -1
- package/packages/locale/lang/ko-KR.ts +4 -1
- package/packages/locale/lang/pt-BR.ts +4 -1
- package/packages/locale/lang/ru-RU.ts +4 -1
- package/packages/locale/lang/vi-VN.ts +4 -1
- package/packages/locale/lang/zh-CN.ts +4 -1
- package/packages/locale/lang/zh-TC.ts +4 -1
- package/packages/table/module/custom/panel.ts +13 -12
- package/packages/table/module/edit/hook.ts +11 -10
- package/packages/table/module/export/hook.ts +10 -6
- package/packages/table/render/index.ts +95 -84
- package/packages/table/src/table.ts +52 -27
- package/packages/toolbar/src/toolbar.ts +8 -8
- package/styles/components/table.scss +6 -3
- /package/es/{iconfont.1723521776225.ttf → iconfont.1724210671876.ttf} +0 -0
- /package/es/{iconfont.1723521776225.woff → iconfont.1724210671876.woff} +0 -0
- /package/es/{iconfont.1723521776225.woff2 → iconfont.1724210671876.woff2} +0 -0
- /package/lib/{iconfont.1723521776225.ttf → iconfont.1724210671876.ttf} +0 -0
- /package/lib/{iconfont.1723521776225.woff → iconfont.1724210671876.woff} +0 -0
- /package/lib/{iconfont.1723521776225.woff2 → iconfont.1724210671876.woff2} +0 -0
|
@@ -18,7 +18,7 @@ import TableImportPanelComponent from '../module/export/import-panel'
|
|
|
18
18
|
import TableExportPanelComponent from '../module/export/export-panel'
|
|
19
19
|
import TableMenuPanelComponent from '../module/menu/panel'
|
|
20
20
|
|
|
21
|
-
import type { VxeLoadingComponent, VxeTooltipInstance, VxeTooltipComponent } from 'vxe-pc-ui'
|
|
21
|
+
import type { VxeLoadingComponent, VxeTooltipInstance, VxeTooltipComponent, VxeTabsConstructor, VxeTabsPrivateMethods } from 'vxe-pc-ui'
|
|
22
22
|
import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableProps, VxeColumnPropTypes } from '../../../types'
|
|
23
23
|
|
|
24
24
|
const { getConfig, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns } = VxeUI
|
|
@@ -40,6 +40,8 @@ export default defineComponent({
|
|
|
40
40
|
const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
|
|
41
41
|
const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
|
|
42
42
|
|
|
43
|
+
const $xeTabs = inject<(VxeTabsConstructor & VxeTabsPrivateMethods) | null>('$xeTabs', null)
|
|
44
|
+
|
|
43
45
|
const { computeSize } = useFns.useSize(props)
|
|
44
46
|
|
|
45
47
|
const reactData = reactive<TableReactData>({
|
|
@@ -3273,6 +3275,11 @@ export default defineComponent({
|
|
|
3273
3275
|
const fullColumnFieldData = internalData.fullColumnFieldData
|
|
3274
3276
|
return field && fullColumnFieldData[field] ? fullColumnFieldData[field].column : null
|
|
3275
3277
|
},
|
|
3278
|
+
getParentColumn (fieldOrColumn) {
|
|
3279
|
+
const fullColumnIdData = internalData.fullColumnIdData
|
|
3280
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
3281
|
+
return column && column.parentId && fullColumnIdData[column.parentId] ? fullColumnIdData[column.parentId].column : null
|
|
3282
|
+
},
|
|
3276
3283
|
/**
|
|
3277
3284
|
* 获取当前表格的列
|
|
3278
3285
|
* 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
|
|
@@ -3551,10 +3558,14 @@ export default defineComponent({
|
|
|
3551
3558
|
* 计算单元格列宽,动态分配可用剩余空间
|
|
3552
3559
|
* 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
|
|
3553
3560
|
*/
|
|
3554
|
-
recalculate (
|
|
3561
|
+
recalculate (reFull?: boolean) {
|
|
3562
|
+
const el = refElem.value
|
|
3563
|
+
if (!el || !el.clientWidth) {
|
|
3564
|
+
return nextTick()
|
|
3565
|
+
}
|
|
3555
3566
|
calcCellWidth()
|
|
3556
3567
|
autoCellWidth()
|
|
3557
|
-
if (
|
|
3568
|
+
if (reFull === true) {
|
|
3558
3569
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
3559
3570
|
return computeScrollLoad().then(() => {
|
|
3560
3571
|
autoCellWidth()
|
|
@@ -4971,6 +4982,7 @@ export default defineComponent({
|
|
|
4971
4982
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow
|
|
4972
4983
|
const operCtxMenu = isMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow)
|
|
4973
4984
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row
|
|
4985
|
+
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
4974
4986
|
let params: any
|
|
4975
4987
|
if (operCtxMenu) {
|
|
4976
4988
|
// 如果配置了右键菜单; 支持方向键操作、回车
|
|
@@ -5097,18 +5109,21 @@ export default defineComponent({
|
|
|
5097
5109
|
columnIndex: tableMethods.getColumnIndex(selected.column),
|
|
5098
5110
|
$table: $xeTable
|
|
5099
5111
|
}
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5112
|
+
// 是否被禁用
|
|
5113
|
+
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
5114
|
+
if (delMethod) {
|
|
5115
|
+
delMethod(delPaqrams)
|
|
5116
|
+
} else {
|
|
5117
|
+
setCellValue(selected.row, selected.column, null)
|
|
5118
|
+
}
|
|
5119
|
+
// 如果按下 del 键,更新表尾数据
|
|
5120
|
+
tableMethods.updateFooter()
|
|
5121
|
+
$xeTable.dispatchEvent('cell-delete-value', delPaqrams, evnt)
|
|
5104
5122
|
}
|
|
5105
|
-
// 如果按下 del 键,更新表尾数据
|
|
5106
|
-
tableMethods.updateFooter()
|
|
5107
|
-
$xeTable.dispatchEvent('cell-delete-value', delPaqrams, evnt)
|
|
5108
5123
|
}
|
|
5109
5124
|
} else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
5110
5125
|
if (!isEditStatus) {
|
|
5111
|
-
const {
|
|
5126
|
+
const { backMethod } = keyboardOpts
|
|
5112
5127
|
// 如果是删除键
|
|
5113
5128
|
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
5114
5129
|
const delPaqrams = {
|
|
@@ -5118,23 +5133,22 @@ export default defineComponent({
|
|
|
5118
5133
|
columnIndex: tableMethods.getColumnIndex(selected.column),
|
|
5119
5134
|
$table: $xeTable
|
|
5120
5135
|
}
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
$xeTable.
|
|
5136
|
+
// 是否被禁用
|
|
5137
|
+
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
5138
|
+
if (backMethod) {
|
|
5139
|
+
backMethod({
|
|
5140
|
+
row: selected.row,
|
|
5141
|
+
rowIndex: tableMethods.getRowIndex(selected.row),
|
|
5142
|
+
column: selected.column,
|
|
5143
|
+
columnIndex: tableMethods.getColumnIndex(selected.column),
|
|
5144
|
+
$table: $xeTable
|
|
5145
|
+
})
|
|
5146
|
+
} else {
|
|
5147
|
+
setCellValue(selected.row, selected.column, null)
|
|
5148
|
+
$xeTable.handleActived(selected.args, evnt)
|
|
5149
|
+
}
|
|
5150
|
+
$xeTable.dispatchEvent('cell-backspace-value', delPaqrams, evnt)
|
|
5136
5151
|
}
|
|
5137
|
-
$xeTable.dispatchEvent('cell-backspace-value', delPaqrams, evnt)
|
|
5138
5152
|
}
|
|
5139
5153
|
}
|
|
5140
5154
|
} else if (hasBackspaceKey && keyboardConfig && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
@@ -5251,6 +5265,10 @@ export default defineComponent({
|
|
|
5251
5265
|
if ($xeTable.closeMenu) {
|
|
5252
5266
|
$xeTable.closeMenu()
|
|
5253
5267
|
}
|
|
5268
|
+
const el = refElem.value
|
|
5269
|
+
if (!el || !el.clientWidth) {
|
|
5270
|
+
return nextTick()
|
|
5271
|
+
}
|
|
5254
5272
|
tableMethods.updateCellAreas()
|
|
5255
5273
|
tableMethods.recalculate(true)
|
|
5256
5274
|
}
|
|
@@ -6686,6 +6704,12 @@ export default defineComponent({
|
|
|
6686
6704
|
})
|
|
6687
6705
|
})
|
|
6688
6706
|
|
|
6707
|
+
if ($xeTabs) {
|
|
6708
|
+
watch(() => $xeTabs ? $xeTabs.reactData.resizeFlag : null, () => {
|
|
6709
|
+
handleGlobalResizeEvent()
|
|
6710
|
+
})
|
|
6711
|
+
}
|
|
6712
|
+
|
|
6689
6713
|
hooks.forEach((options) => {
|
|
6690
6714
|
const { setupTable } = options
|
|
6691
6715
|
if (setupTable) {
|
|
@@ -6971,6 +6995,7 @@ export default defineComponent({
|
|
|
6971
6995
|
'is--virtual-x': scrollXLoad,
|
|
6972
6996
|
'is--virtual-y': scrollYLoad
|
|
6973
6997
|
}],
|
|
6998
|
+
spellcheck: false,
|
|
6974
6999
|
onKeydown: keydownEvent
|
|
6975
7000
|
}, [
|
|
6976
7001
|
/**
|
|
@@ -4,7 +4,7 @@ import { VxeUI } from '../../ui'
|
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
5
5
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
6
6
|
|
|
7
|
-
import type { VxeButtonComponent } from 'vxe-pc-ui'
|
|
7
|
+
import type { VxeButtonComponent, VxeButtonEvents } from 'vxe-pc-ui'
|
|
8
8
|
import type { VxeGridConstructor, GridPrivateMethods, ToolbarMethods, VxeToolbarConstructor, VxeToolbarEmits, VxeToolbarPropTypes, VxeTableConstructor, ToolbarPrivateRef, VxeTableMethods, VxeTablePrivateMethods, ToolbarReactData } from '../../../types'
|
|
9
9
|
|
|
10
10
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI
|
|
@@ -146,7 +146,7 @@ export default defineComponent({
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
const refreshEvent = (
|
|
149
|
+
const refreshEvent: VxeButtonEvents.Click = ({ $event }) => {
|
|
150
150
|
const { isRefresh } = reactData
|
|
151
151
|
const refreshOpts = computeRefreshOpts.value
|
|
152
152
|
if (!isRefresh) {
|
|
@@ -162,16 +162,16 @@ export default defineComponent({
|
|
|
162
162
|
}
|
|
163
163
|
} else if ($xeGrid) {
|
|
164
164
|
reactData.isRefresh = true
|
|
165
|
-
$xeGrid.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' },
|
|
165
|
+
$xeGrid.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch((e) => e).then(() => {
|
|
166
166
|
reactData.isRefresh = false
|
|
167
167
|
})
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
const zoomEvent = (
|
|
172
|
+
const zoomEvent: VxeButtonEvents.Click = ({ $event }) => {
|
|
173
173
|
if ($xeGrid) {
|
|
174
|
-
$xeGrid.triggerZoomEvent(
|
|
174
|
+
$xeGrid.triggerZoomEvent($event)
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -270,7 +270,7 @@ export default defineComponent({
|
|
|
270
270
|
round: child.round,
|
|
271
271
|
status: child.status,
|
|
272
272
|
content: child.name,
|
|
273
|
-
onClick: (
|
|
273
|
+
onClick: ({ $event }) => isBtn ? btnEvent($event, child) : tolEvent($event, child)
|
|
274
274
|
})
|
|
275
275
|
: createCommentVNode()
|
|
276
276
|
})
|
|
@@ -319,7 +319,7 @@ export default defineComponent({
|
|
|
319
319
|
destroyOnClose: item.destroyOnClose,
|
|
320
320
|
placement: item.placement,
|
|
321
321
|
transfer: item.transfer,
|
|
322
|
-
onClick: (
|
|
322
|
+
onClick: ({ $event }) => btnEvent($event, item)
|
|
323
323
|
}, dropdowns && dropdowns.length
|
|
324
324
|
? {
|
|
325
325
|
dropdowns: () => renderDropdowns(item, true)
|
|
@@ -377,7 +377,7 @@ export default defineComponent({
|
|
|
377
377
|
destroyOnClose: item.destroyOnClose,
|
|
378
378
|
placement: item.placement,
|
|
379
379
|
transfer: item.transfer,
|
|
380
|
-
onClick: (
|
|
380
|
+
onClick: ({ $event }) => tolEvent($event, item)
|
|
381
381
|
}, dropdowns && dropdowns.length
|
|
382
382
|
? {
|
|
383
383
|
dropdowns: () => renderDropdowns(item, false)
|
|
@@ -94,7 +94,8 @@
|
|
|
94
94
|
& > .vxe-select,
|
|
95
95
|
& > .vxe-tree-select,
|
|
96
96
|
& > .vxe-date-picker,
|
|
97
|
-
& > .vxe-number-input
|
|
97
|
+
& > .vxe-number-input,
|
|
98
|
+
& > .vxe-ico-picker {
|
|
98
99
|
width: 100%;
|
|
99
100
|
}
|
|
100
101
|
& > .vxe-input > .vxe-input--inner,
|
|
@@ -111,7 +112,8 @@
|
|
|
111
112
|
.vxe-select,
|
|
112
113
|
.vxe-tree-select,
|
|
113
114
|
.vxe-date-picker,
|
|
114
|
-
.vxe-number-input
|
|
115
|
+
.vxe-number-input,
|
|
116
|
+
.vxe-ico-picker {
|
|
115
117
|
width: 100%;
|
|
116
118
|
}
|
|
117
119
|
.vxe-input > .vxe-input--inner,
|
|
@@ -1277,7 +1279,8 @@
|
|
|
1277
1279
|
.vxe-default-select {
|
|
1278
1280
|
border-color: var(--vxe-ui-table-validate-error-color);
|
|
1279
1281
|
}
|
|
1280
|
-
.vxe-input
|
|
1282
|
+
.vxe-input,
|
|
1283
|
+
.vxe-ico-picker {
|
|
1281
1284
|
border-color: var(--vxe-ui-table-validate-error-color);
|
|
1282
1285
|
}
|
|
1283
1286
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|