vxe-table 3.20.13 → 3.21.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/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +33 -12
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/src/cell.js +3 -3
- package/es/table/src/column.js +6 -3
- package/es/table/src/group.js +6 -3
- package/es/table/src/methods.js +365 -165
- package/es/table/src/props.js +2 -2
- package/es/table/src/table.js +13 -6
- package/es/table/src/util.js +12 -3
- package/es/ui/index.js +3 -3
- package/es/ui/src/dom.js +4 -0
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +364 -302
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +39 -12
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/column.js +6 -3
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/group.js +6 -3
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/methods.js +35 -29
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +15 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +12 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +3 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +5 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +3 -3
- package/packages/table/module/edit/mixin.ts +47 -12
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/src/cell.ts +5 -5
- package/packages/table/src/column.ts +10 -7
- package/packages/table/src/group.ts +10 -6
- package/packages/table/src/methods.ts +376 -161
- package/packages/table/src/props.ts +3 -3
- package/packages/table/src/table.ts +13 -6
- package/packages/table/src/util.ts +16 -6
- package/packages/ui/index.ts +2 -2
- package/packages/ui/src/dom.ts +5 -0
- /package/es/{iconfont.1776926445391.ttf → iconfont.1777796331871.ttf} +0 -0
- /package/es/{iconfont.1776926445391.woff → iconfont.1777796331871.woff} +0 -0
- /package/es/{iconfont.1776926445391.woff2 → iconfont.1777796331871.woff2} +0 -0
- /package/lib/{iconfont.1776926445391.ttf → iconfont.1777796331871.ttf} +0 -0
- /package/lib/{iconfont.1776926445391.woff → iconfont.1777796331871.woff} +0 -0
- /package/lib/{iconfont.1776926445391.woff2 → iconfont.1777796331871.woff2} +0 -0
|
@@ -182,7 +182,7 @@ export const tableProps = {
|
|
|
182
182
|
* @deprecated
|
|
183
183
|
*/
|
|
184
184
|
rowId: { type: String, default: () => getConfig().table.rowId },
|
|
185
|
-
zIndex: Number
|
|
185
|
+
zIndex: Number as PropType<VxeTablePropTypes.ZIndex>,
|
|
186
186
|
emptyText: { type: String, default: () => getConfig().table.emptyText },
|
|
187
187
|
keepSource: { type: Boolean, default: () => getConfig().table.keepSource },
|
|
188
188
|
// 是否自动监听父容器变化去更新响应式表格宽高
|
|
@@ -300,8 +300,8 @@ export const tableProps = {
|
|
|
300
300
|
virtualYConfig: Object as PropType<VxeTablePropTypes.VirtualYConfig>,
|
|
301
301
|
// 滚动条配置项
|
|
302
302
|
scrollbarConfig: Object as PropType<VxeTablePropTypes.ScrollbarConfig>,
|
|
303
|
-
//
|
|
304
|
-
|
|
303
|
+
// 撤销/恢复历史配置项
|
|
304
|
+
undoRedoHistoryConfig: Object as PropType<VxeTablePropTypes.UndoRedoHistoryConfig>,
|
|
305
305
|
// (即将废弃)优化相关
|
|
306
306
|
animat: { type: Boolean, default: () => getConfig().table.animat },
|
|
307
307
|
// (可能会被废弃的参数,不要使用)
|
|
@@ -1451,11 +1451,11 @@ export default {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
return []
|
|
1453
1453
|
},
|
|
1454
|
-
|
|
1454
|
+
computeUndoRedoHistoryOpts () {
|
|
1455
1455
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1456
1456
|
const props = $xeTable
|
|
1457
1457
|
|
|
1458
|
-
return Object.assign({}, getConfig().table.
|
|
1458
|
+
return Object.assign({}, getConfig().table.undoRedoHistoryConfig, props.undoRedoHistoryConfig)
|
|
1459
1459
|
},
|
|
1460
1460
|
tabsResizeFlag () {
|
|
1461
1461
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -1662,7 +1662,7 @@ export default {
|
|
|
1662
1662
|
|
|
1663
1663
|
handleKeyField($xeTable)
|
|
1664
1664
|
|
|
1665
|
-
const { exportConfig, importConfig, treeConfig, minHeight } = props
|
|
1665
|
+
const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource } = props
|
|
1666
1666
|
const { scrollXStore, scrollYStore } = internalData
|
|
1667
1667
|
const columnOpts = $xeTable.computeColumnOpts
|
|
1668
1668
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
@@ -1698,8 +1698,15 @@ export default {
|
|
|
1698
1698
|
if (!(props.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || treeOpts.expandRowKeys)) {
|
|
1699
1699
|
warnLog('vxe.error.reqProp', ['row-config.keyField'])
|
|
1700
1700
|
}
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1701
|
+
if (editConfig) {
|
|
1702
|
+
if (!keepSource) {
|
|
1703
|
+
if (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) {
|
|
1704
|
+
warnLog('vxe.error.reqSupportProp', ['edit-config.showStatus | showUpdateStatus | showInsertStatus', 'keep-source'])
|
|
1705
|
+
}
|
|
1706
|
+
// if (keyboardOpts.isUndoRedo) {
|
|
1707
|
+
// warnLog('vxe.error.reqSupportProp', ['keyboard-config.isUndoRedo', 'keep-source'])
|
|
1708
|
+
// }
|
|
1709
|
+
}
|
|
1703
1710
|
}
|
|
1704
1711
|
// if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
|
|
1705
1712
|
// warnLog('vxe.error.reqProp', ['show-overflow'])
|
|
@@ -1773,7 +1780,7 @@ export default {
|
|
|
1773
1780
|
if (rowOpts.height && !this.showOverflow) {
|
|
1774
1781
|
warnLog('vxe.error.notProp', ['table.show-overflow'])
|
|
1775
1782
|
}
|
|
1776
|
-
if (!$xeTable.
|
|
1783
|
+
if (!$xeTable.triggerCelllAreaMnEvent) {
|
|
1777
1784
|
if (props.areaConfig) {
|
|
1778
1785
|
warnLog('vxe.error.notProp', ['area-config'])
|
|
1779
1786
|
}
|
|
@@ -143,6 +143,11 @@ export function createInternalData (): TableInternalData {
|
|
|
143
143
|
// 表尾高度
|
|
144
144
|
tFooterHeight: 0,
|
|
145
145
|
|
|
146
|
+
stackHistoryStore: {
|
|
147
|
+
undoStacks: [],
|
|
148
|
+
redoStacks: []
|
|
149
|
+
},
|
|
150
|
+
|
|
146
151
|
teleportToWrapperElem: null,
|
|
147
152
|
popupToWrapperElem: null,
|
|
148
153
|
customPopupToElem: null,
|
|
@@ -299,7 +304,7 @@ export function createReactData (): TableReactData {
|
|
|
299
304
|
tooltipStore: {
|
|
300
305
|
row: null,
|
|
301
306
|
column: null,
|
|
302
|
-
content:
|
|
307
|
+
content: '',
|
|
303
308
|
visible: false,
|
|
304
309
|
type: null,
|
|
305
310
|
currOpts: {}
|
|
@@ -833,12 +838,17 @@ export function getLastChildColumn (column: VxeTableDefines.ColumnInfo): VxeTabl
|
|
|
833
838
|
return column
|
|
834
839
|
}
|
|
835
840
|
|
|
836
|
-
export function getCellValue (row: any, column:
|
|
837
|
-
|
|
841
|
+
export function getCellValue (row: any, column: VxeTableDefines.ColumnInfo | null) {
|
|
842
|
+
if (column) {
|
|
843
|
+
return XEUtils.get(row, column.field)
|
|
844
|
+
}
|
|
845
|
+
return null
|
|
838
846
|
}
|
|
839
847
|
|
|
840
|
-
export function setCellValue (row: any, column:
|
|
841
|
-
|
|
848
|
+
export function setCellValue (row: any, column: VxeTableDefines.ColumnInfo | null, value: any) {
|
|
849
|
+
if (column) {
|
|
850
|
+
XEUtils.set(row, column.field, value)
|
|
851
|
+
}
|
|
842
852
|
}
|
|
843
853
|
|
|
844
854
|
export function getRefElem (refEl: any) {
|
|
@@ -907,7 +917,7 @@ export function getColumnList (columns: VxeTableDefines.ColumnInfo[]) {
|
|
|
907
917
|
return result
|
|
908
918
|
}
|
|
909
919
|
|
|
910
|
-
export function createColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, options:
|
|
920
|
+
export function createColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, options: VxeTableDefines.ColumnOptions | VxeTableDefines.ColumnInfo, renderOptions: any): any {
|
|
911
921
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions)
|
|
912
922
|
}
|
|
913
923
|
|
package/packages/ui/index.ts
CHANGED
package/packages/ui/src/dom.ts
CHANGED
|
@@ -190,6 +190,11 @@ export function getAbsolutePos (elem: any) {
|
|
|
190
190
|
return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth }
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
export function hasEventInputTarget (target: EventTarget | Element | null) {
|
|
194
|
+
const tagName = target ? (target as Element).tagName : ''
|
|
195
|
+
return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()))
|
|
196
|
+
}
|
|
197
|
+
|
|
193
198
|
const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded'
|
|
194
199
|
const scrollIntoView = 'scrollIntoView'
|
|
195
200
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|