vxe-table 4.7.73 → 4.7.75
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/locale/lang/en-US.js +6 -1
- package/es/locale/lang/es-ES.js +6 -1
- package/es/locale/lang/hu-HU.js +6 -1
- package/es/locale/lang/ja-JP.js +6 -1
- package/es/locale/lang/ko-KR.js +6 -1
- package/es/locale/lang/pt-BR.js +6 -1
- package/es/locale/lang/ru-RU.js +6 -1
- package/es/locale/lang/vi-VN.js +6 -1
- package/es/locale/lang/zh-CN.js +6 -1
- package/es/locale/lang/zh-TC.js +6 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/index.js +5 -0
- package/es/table/module/custom/hook.js +1 -1
- package/es/table/module/custom/panel.js +19 -7
- package/es/table/module/edit/hook.js +8 -2
- package/es/table/module/keyboard/hook.js +1 -1
- package/es/table/module/validator/hook.js +1 -1
- package/es/table/src/body.js +1 -1
- package/es/table/src/cell.js +7 -5
- package/es/table/src/table.js +8 -8
- package/es/table/src/use/cell-view.js +34 -0
- package/es/table/src/use/index.js +1 -0
- package/es/table/style.css +5 -9
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +5 -9
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.umd.js +115 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +6 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -1
- package/lib/locale/lang/es-ES.js +6 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +6 -1
- package/lib/locale/lang/hu-HU.js +6 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +6 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +6 -1
- package/lib/locale/lang/ko-KR.js +6 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +6 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +6 -1
- package/lib/locale/lang/ru-RU.js +6 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/vi-VN.js +6 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +6 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +6 -1
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +6 -1
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +6 -1
- package/lib/locale/lang/zh-TC.js +6 -1
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +6 -1
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +6 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +5 -0
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/hook.js +1 -1
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +18 -7
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +8 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +1 -1
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +1 -1
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/body.js +1 -0
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +10 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +8 -8
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/use/cell-view.js +57 -0
- package/lib/table/src/use/cell-view.min.js +1 -0
- package/lib/table/src/use/index.js +16 -0
- package/lib/table/src/use/index.min.js +1 -0
- package/lib/table/style/style.css +5 -9
- package/lib/table/style/style.min.css +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 +5 -9
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +6 -1
- package/packages/locale/lang/es-ES.ts +6 -1
- package/packages/locale/lang/hu-HU.ts +6 -1
- package/packages/locale/lang/ja-JP.ts +6 -1
- package/packages/locale/lang/ko-KR.ts +6 -1
- package/packages/locale/lang/pt-BR.ts +6 -1
- package/packages/locale/lang/ru-RU.ts +6 -1
- package/packages/locale/lang/vi-VN.ts +6 -1
- package/packages/locale/lang/zh-CN.ts +6 -1
- package/packages/locale/lang/zh-TC.ts +6 -1
- package/packages/table/index.ts +8 -0
- package/packages/table/module/custom/hook.ts +1 -1
- package/packages/table/module/custom/panel.ts +18 -7
- package/packages/table/module/edit/hook.ts +8 -2
- package/packages/table/module/keyboard/hook.ts +1 -1
- package/packages/table/module/validator/hook.ts +1 -1
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/cell.ts +7 -5
- package/packages/table/src/table.ts +8 -8
- package/packages/table/src/use/cell-view.ts +44 -0
- package/packages/table/src/use/index.ts +1 -0
- package/styles/components/table.scss +4 -9
- /package/es/{iconfont.1724892633863.ttf → iconfont.1725105214157.ttf} +0 -0
- /package/es/{iconfont.1724892633863.woff → iconfont.1725105214157.woff} +0 -0
- /package/es/{iconfont.1724892633863.woff2 → iconfont.1725105214157.woff2} +0 -0
- /package/lib/{iconfont.1724892633863.ttf → iconfont.1725105214157.ttf} +0 -0
- /package/lib/{iconfont.1724892633863.woff → iconfont.1725105214157.woff} +0 -0
- /package/lib/{iconfont.1724892633863.woff2 → iconfont.1725105214157.woff2} +0 -0
|
@@ -60,7 +60,10 @@ export default defineComponent({
|
|
|
60
60
|
const customOpts = computeCustomOpts.value
|
|
61
61
|
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
|
|
62
62
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
63
|
-
if (
|
|
63
|
+
if (parent) {
|
|
64
|
+
// 更新子列信息
|
|
65
|
+
column.fixed = parent.fixed
|
|
66
|
+
} else {
|
|
64
67
|
if (allowSort) {
|
|
65
68
|
const sortIndex = index + 1
|
|
66
69
|
column.renderSortNumber = sortIndex
|
|
@@ -181,22 +184,30 @@ export default defineComponent({
|
|
|
181
184
|
const customOpts = computeCustomOpts.value
|
|
182
185
|
if (customOpts.immediate) {
|
|
183
186
|
if (column.renderFixed === colFixed) {
|
|
184
|
-
column
|
|
185
|
-
|
|
187
|
+
XEUtils.eachTree([column], col => {
|
|
188
|
+
col.fixed = ''
|
|
189
|
+
col.renderFixed = ''
|
|
190
|
+
})
|
|
186
191
|
} else {
|
|
187
192
|
if (!isMaxFixedColumn || column.renderFixed) {
|
|
188
|
-
column
|
|
189
|
-
|
|
193
|
+
XEUtils.eachTree([column], col => {
|
|
194
|
+
col.fixed = colFixed
|
|
195
|
+
col.renderFixed = colFixed
|
|
196
|
+
})
|
|
190
197
|
}
|
|
191
198
|
}
|
|
192
199
|
$xeTable.handleCustom()
|
|
193
200
|
$xeTable.saveCustomStore('update:fixed')
|
|
194
201
|
} else {
|
|
195
202
|
if (column.renderFixed === colFixed) {
|
|
196
|
-
column
|
|
203
|
+
XEUtils.eachTree([column], col => {
|
|
204
|
+
col.renderFixed = ''
|
|
205
|
+
})
|
|
197
206
|
} else {
|
|
198
207
|
if (!isMaxFixedColumn || column.renderFixed) {
|
|
199
|
-
column
|
|
208
|
+
XEUtils.eachTree([column], col => {
|
|
209
|
+
col.renderFixed = colFixed
|
|
210
|
+
})
|
|
200
211
|
}
|
|
201
212
|
}
|
|
202
213
|
}
|
|
@@ -613,7 +613,7 @@ hooks.add('tableEditModule', {
|
|
|
613
613
|
return $xeTable.scrollToRow(row, column).then(() => {
|
|
614
614
|
const cell = $xeTable.getCellElement(row, column)
|
|
615
615
|
if (cell) {
|
|
616
|
-
editPrivateMethods.
|
|
616
|
+
editPrivateMethods.handleEdit({
|
|
617
617
|
row,
|
|
618
618
|
rowIndex: $xeTable.getRowIndex(row),
|
|
619
619
|
column,
|
|
@@ -657,7 +657,7 @@ hooks.add('tableEditModule', {
|
|
|
657
657
|
/**
|
|
658
658
|
* 处理激活编辑
|
|
659
659
|
*/
|
|
660
|
-
|
|
660
|
+
handleEdit (params, evnt) {
|
|
661
661
|
const { editConfig, mouseConfig } = props
|
|
662
662
|
const { editStore, tableColumn } = reactData
|
|
663
663
|
const editOpts = computeEditOpts.value
|
|
@@ -756,6 +756,12 @@ hooks.add('tableEditModule', {
|
|
|
756
756
|
}
|
|
757
757
|
return nextTick()
|
|
758
758
|
},
|
|
759
|
+
/**
|
|
760
|
+
* @deprecated
|
|
761
|
+
*/
|
|
762
|
+
handleActived (params, evnt) {
|
|
763
|
+
return editPrivateMethods.handleEdit(params, evnt)
|
|
764
|
+
},
|
|
759
765
|
/**
|
|
760
766
|
* 处理聚焦
|
|
761
767
|
*/
|
|
@@ -280,7 +280,7 @@ hooks.add('tableKeyboardModule', {
|
|
|
280
280
|
if (editConfig) {
|
|
281
281
|
if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
|
|
282
282
|
if (editOpts.mode === 'row') {
|
|
283
|
-
$xeTable.
|
|
283
|
+
$xeTable.handleEdit(params, evnt)
|
|
284
284
|
} else {
|
|
285
285
|
$xeTable.scrollToRow(params.row, params.column)
|
|
286
286
|
.then(() => $xeTable.handleSelected(params, evnt))
|
|
@@ -66,7 +66,7 @@ hooks.add('tableValidatorModule', {
|
|
|
66
66
|
$xeTable.dispatchEvent('valid-error', params, null)
|
|
67
67
|
resolve()
|
|
68
68
|
} else {
|
|
69
|
-
$xeTable.
|
|
69
|
+
$xeTable.handleEdit(params, { type: 'valid-error', trigger: 'call' }).then(() => {
|
|
70
70
|
resolve(validatorPrivateMethods.showValidTooltip(params))
|
|
71
71
|
})
|
|
72
72
|
}
|
|
@@ -162,7 +162,7 @@ export default defineComponent({
|
|
|
162
162
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`]
|
|
163
163
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline')
|
|
164
164
|
const attrs: any = { colid }
|
|
165
|
-
const params: VxeTableDefines.CellRenderBodyParams = { $table: $xeTable, $grid: $xeTable.xegrid, seq, rowid, row, rowIndex, $rowIndex, _rowIndex, column, columnIndex, $columnIndex, _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items }
|
|
165
|
+
const params: VxeTableDefines.CellRenderBodyParams = { $table: $xeTable, $grid: $xeTable.xegrid, isEdit: false, seq, rowid, row, rowIndex, $rowIndex, _rowIndex, column, columnIndex, $columnIndex, _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items }
|
|
166
166
|
// 虚拟滚动不支持动态高度
|
|
167
167
|
if (scrollYLoad && !hasEllipsis) {
|
|
168
168
|
showEllipsis = hasEllipsis = true
|
|
@@ -893,26 +893,28 @@ export const Cell = {
|
|
|
893
893
|
const editSlot = slots ? slots.edit : null
|
|
894
894
|
const compConf = renderer.get(editRender.name)
|
|
895
895
|
const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null
|
|
896
|
+
const cellParams = Object.assign({ $type: '', isEdit }, params)
|
|
896
897
|
if (isEdit) {
|
|
898
|
+
cellParams.$type = 'edit'
|
|
897
899
|
if (editSlot) {
|
|
898
|
-
return $table.callSlot(editSlot,
|
|
900
|
+
return $table.callSlot(editSlot, cellParams)
|
|
899
901
|
}
|
|
900
902
|
if (rtEdit) {
|
|
901
|
-
return getSlotVNs(rtEdit(editRender,
|
|
903
|
+
return getSlotVNs(rtEdit(editRender, cellParams))
|
|
902
904
|
}
|
|
903
905
|
return []
|
|
904
906
|
}
|
|
905
907
|
if (defaultSlot) {
|
|
906
|
-
return $table.callSlot(defaultSlot,
|
|
908
|
+
return $table.callSlot(defaultSlot, cellParams)
|
|
907
909
|
}
|
|
908
910
|
if (formatter) {
|
|
909
911
|
return [
|
|
910
912
|
h('span', {
|
|
911
913
|
class: 'vxe-cell--label'
|
|
912
|
-
}, getDefaultCellLabel(
|
|
914
|
+
}, getDefaultCellLabel(cellParams))
|
|
913
915
|
]
|
|
914
916
|
}
|
|
915
|
-
return Cell.renderDefaultCell(
|
|
917
|
+
return Cell.renderDefaultCell(cellParams)
|
|
916
918
|
}
|
|
917
919
|
}
|
|
918
920
|
|
|
@@ -1773,7 +1773,7 @@ export default defineComponent({
|
|
|
1773
1773
|
checkValidate('blur')
|
|
1774
1774
|
.catch((e: any) => e)
|
|
1775
1775
|
.then(() => {
|
|
1776
|
-
$xeTable.
|
|
1776
|
+
$xeTable.handleEdit(params, evnt)
|
|
1777
1777
|
.then(() => checkValidate('change'))
|
|
1778
1778
|
.catch((e: any) => e)
|
|
1779
1779
|
})
|
|
@@ -3514,8 +3514,8 @@ export default defineComponent({
|
|
|
3514
3514
|
* 将固定的列左边、右边分别靠边
|
|
3515
3515
|
* 如果传 true 则会检查列顺序并排序
|
|
3516
3516
|
*/
|
|
3517
|
-
refreshColumn (
|
|
3518
|
-
if (
|
|
3517
|
+
refreshColumn (initOrder) {
|
|
3518
|
+
if (initOrder) {
|
|
3519
3519
|
const columnList = XEUtils.orderBy(internalData.collectColumn, 'renderSortNumber')
|
|
3520
3520
|
internalData.collectColumn = columnList
|
|
3521
3521
|
const tableFullColumn = getColumnList(columnList)
|
|
@@ -5027,7 +5027,7 @@ export default defineComponent({
|
|
|
5027
5027
|
// 如果按下了 F2 键
|
|
5028
5028
|
if (selected.row && selected.column) {
|
|
5029
5029
|
evnt.preventDefault()
|
|
5030
|
-
$xeTable.
|
|
5030
|
+
$xeTable.handleEdit(selected.args, evnt)
|
|
5031
5031
|
}
|
|
5032
5032
|
}
|
|
5033
5033
|
} else if (isContextMenu) {
|
|
@@ -5144,7 +5144,7 @@ export default defineComponent({
|
|
|
5144
5144
|
backMethod(params)
|
|
5145
5145
|
} else {
|
|
5146
5146
|
setCellValue(selected.row, selected.column, null)
|
|
5147
|
-
$xeTable.
|
|
5147
|
+
$xeTable.handleEdit(selected.args, evnt)
|
|
5148
5148
|
}
|
|
5149
5149
|
$xeTable.dispatchEvent('cell-backspace-value', params, evnt)
|
|
5150
5150
|
}
|
|
@@ -5188,7 +5188,7 @@ export default defineComponent({
|
|
|
5188
5188
|
editMethod(params)
|
|
5189
5189
|
} else {
|
|
5190
5190
|
setCellValue(selected.row, selected.column, null)
|
|
5191
|
-
$xeTable.
|
|
5191
|
+
$xeTable.handleEdit(selected.args, evnt)
|
|
5192
5192
|
}
|
|
5193
5193
|
const afterEditMethod = editOpts.afterEditMethod
|
|
5194
5194
|
if (afterEditMethod) {
|
|
@@ -6071,12 +6071,12 @@ export default defineComponent({
|
|
|
6071
6071
|
checkValidate('blur')
|
|
6072
6072
|
.catch((e) => e)
|
|
6073
6073
|
.then(() => {
|
|
6074
|
-
$xeTable.
|
|
6074
|
+
$xeTable.handleEdit(params, evnt)
|
|
6075
6075
|
.then(() => checkValidate('change'))
|
|
6076
6076
|
.catch((e) => e)
|
|
6077
6077
|
})
|
|
6078
6078
|
} else if (editOpts.mode === 'cell') {
|
|
6079
|
-
$xeTable.
|
|
6079
|
+
$xeTable.handleEdit(params, evnt)
|
|
6080
6080
|
.then(() => checkValidate('change'))
|
|
6081
6081
|
.catch((e) => e)
|
|
6082
6082
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
|
|
4
|
+
import type { VxeTableDefines, VxeGlobalRendererHandles } from '../../../../types'
|
|
5
|
+
|
|
6
|
+
export function useCellView <D = any, P = Record<string, any>> (props: {
|
|
7
|
+
renderOpts: VxeGlobalRendererHandles.RenderTableCellOptions | VxeGlobalRendererHandles.RenderTableEditOptions
|
|
8
|
+
renderParams: VxeGlobalRendererHandles.RenderTableCellParams | VxeGlobalRendererHandles.RenderTableEditParams
|
|
9
|
+
}) {
|
|
10
|
+
const currColumn = computed<VxeTableDefines.ColumnInfo<D>>(() => {
|
|
11
|
+
const { renderParams } = props
|
|
12
|
+
return renderParams.column
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const currRow = computed<D>(() => {
|
|
16
|
+
const { renderParams } = props
|
|
17
|
+
return renderParams.row
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const cellOptions = computed<P>(() => {
|
|
21
|
+
const { renderOpts } = props
|
|
22
|
+
return renderOpts.props as any || {}
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const cellModel = computed({
|
|
26
|
+
get () {
|
|
27
|
+
const { renderParams } = props
|
|
28
|
+
const { row, column } = renderParams
|
|
29
|
+
return XEUtils.get(row, column.field)
|
|
30
|
+
},
|
|
31
|
+
set (value) {
|
|
32
|
+
const { renderParams } = props
|
|
33
|
+
const { row, column } = renderParams
|
|
34
|
+
return XEUtils.set(row, column.field, value)
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
currColumn,
|
|
40
|
+
currRow,
|
|
41
|
+
cellModel,
|
|
42
|
+
cellOptions
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cell-view'
|
|
@@ -89,6 +89,9 @@
|
|
|
89
89
|
.vxe-default-textarea {
|
|
90
90
|
resize: none;
|
|
91
91
|
vertical-align: middle;
|
|
92
|
+
&:not([rows]) {
|
|
93
|
+
height: var(--vxe-ui-input-height-default);
|
|
94
|
+
}
|
|
92
95
|
}
|
|
93
96
|
& > .vxe-input,
|
|
94
97
|
& > .vxe-textarea,
|
|
@@ -1219,6 +1222,7 @@
|
|
|
1219
1222
|
/*暂无数据*/
|
|
1220
1223
|
.vxe-table--empty-placeholder,
|
|
1221
1224
|
.vxe-table--empty-block {
|
|
1225
|
+
color: var(--vxe-ui-input-placeholder-color);
|
|
1222
1226
|
min-height: var(--vxe-ui-table-row-height-default);
|
|
1223
1227
|
justify-content: center;
|
|
1224
1228
|
align-items: center;
|
|
@@ -1430,21 +1434,12 @@
|
|
|
1430
1434
|
border: 0;
|
|
1431
1435
|
padding: 0;
|
|
1432
1436
|
}
|
|
1433
|
-
.vxe-default-input {
|
|
1434
|
-
height: var(--vxe-ui-table-row-line-height);
|
|
1435
|
-
}
|
|
1436
1437
|
.vxe-input {
|
|
1437
1438
|
.vxe-input--inner {
|
|
1438
1439
|
border: 0;
|
|
1439
1440
|
padding-left: 0;
|
|
1440
1441
|
}
|
|
1441
1442
|
}
|
|
1442
|
-
.vxe-textarea {
|
|
1443
|
-
height: calc(var(--vxe-ui-table-row-line-height) - 1px);
|
|
1444
|
-
.vxe-textarea--inner {
|
|
1445
|
-
border: 0;
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
1443
|
}
|
|
1449
1444
|
}
|
|
1450
1445
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|