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.
Files changed (57) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +33 -12
  3. package/es/table/module/keyboard/mixin.js +2 -2
  4. package/es/table/src/cell.js +3 -3
  5. package/es/table/src/column.js +6 -3
  6. package/es/table/src/group.js +6 -3
  7. package/es/table/src/methods.js +365 -165
  8. package/es/table/src/props.js +2 -2
  9. package/es/table/src/table.js +13 -6
  10. package/es/table/src/util.js +12 -3
  11. package/es/ui/index.js +3 -3
  12. package/es/ui/src/dom.js +4 -0
  13. package/es/ui/src/log.js +1 -1
  14. package/lib/index.umd.js +364 -302
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/table/module/edit/mixin.js +39 -12
  18. package/lib/table/module/edit/mixin.min.js +1 -1
  19. package/lib/table/module/keyboard/mixin.js +2 -2
  20. package/lib/table/module/keyboard/mixin.min.js +1 -1
  21. package/lib/table/src/cell.js +3 -3
  22. package/lib/table/src/column.js +6 -3
  23. package/lib/table/src/column.min.js +1 -1
  24. package/lib/table/src/group.js +6 -3
  25. package/lib/table/src/group.min.js +1 -1
  26. package/lib/table/src/methods.js +35 -29
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/table/src/props.js +2 -2
  29. package/lib/table/src/props.min.js +1 -1
  30. package/lib/table/src/table.js +15 -6
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/src/util.js +12 -3
  33. package/lib/table/src/util.min.js +1 -1
  34. package/lib/ui/index.js +3 -3
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/dom.js +5 -0
  37. package/lib/ui/src/dom.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/package.json +3 -3
  41. package/packages/table/module/edit/mixin.ts +47 -12
  42. package/packages/table/module/keyboard/mixin.ts +2 -2
  43. package/packages/table/src/cell.ts +5 -5
  44. package/packages/table/src/column.ts +10 -7
  45. package/packages/table/src/group.ts +10 -6
  46. package/packages/table/src/methods.ts +376 -161
  47. package/packages/table/src/props.ts +3 -3
  48. package/packages/table/src/table.ts +13 -6
  49. package/packages/table/src/util.ts +16 -6
  50. package/packages/ui/index.ts +2 -2
  51. package/packages/ui/src/dom.ts +5 -0
  52. /package/es/{iconfont.1776926445391.ttf → iconfont.1777796331871.ttf} +0 -0
  53. /package/es/{iconfont.1776926445391.woff → iconfont.1777796331871.woff} +0 -0
  54. /package/es/{iconfont.1776926445391.woff2 → iconfont.1777796331871.woff2} +0 -0
  55. /package/lib/{iconfont.1776926445391.ttf → iconfont.1777796331871.ttf} +0 -0
  56. /package/lib/{iconfont.1776926445391.woff → iconfont.1777796331871.woff} +0 -0
  57. /package/lib/{iconfont.1776926445391.woff2 → iconfont.1777796331871.woff2} +0 -0
@@ -294,8 +294,8 @@ export const tableProps = {
294
294
  virtualYConfig: Object,
295
295
  // 滚动条配置项
296
296
  scrollbarConfig: Object,
297
- // 可撤销配置项
298
- undoHistoryConfig: Object,
297
+ // 撤销/恢复历史配置项
298
+ undoRedoHistoryConfig: Object,
299
299
  // (即将废弃)优化相关
300
300
  animat: { type: Boolean, default: () => getConfig().table.animat },
301
301
  // (可能会被废弃的参数,不要使用)
@@ -1343,10 +1343,10 @@ export default {
1343
1343
  }
1344
1344
  return [];
1345
1345
  },
1346
- computeUndoHistoryOpts() {
1346
+ computeUndoRedoHistoryOpts() {
1347
1347
  const $xeTable = this;
1348
1348
  const props = $xeTable;
1349
- return Object.assign({}, getConfig().table.undoHistoryConfig, props.undoHistoryConfig);
1349
+ return Object.assign({}, getConfig().table.undoRedoHistoryConfig, props.undoRedoHistoryConfig);
1350
1350
  },
1351
1351
  tabsResizeFlag() {
1352
1352
  const $xeTable = this;
@@ -1531,7 +1531,7 @@ export default {
1531
1531
  const internalData = $xeTable;
1532
1532
  XEUtils.assign(internalData, createInternalData());
1533
1533
  handleKeyField($xeTable);
1534
- const { exportConfig, importConfig, treeConfig, minHeight } = props;
1534
+ const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource } = props;
1535
1535
  const { scrollXStore, scrollYStore } = internalData;
1536
1536
  const columnOpts = $xeTable.computeColumnOpts;
1537
1537
  const columnDragOpts = $xeTable.computeColumnDragOpts;
@@ -1566,8 +1566,15 @@ export default {
1566
1566
  if (!(props.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || treeOpts.expandRowKeys)) {
1567
1567
  warnLog('vxe.error.reqProp', ['row-config.keyField']);
1568
1568
  }
1569
- if (props.editConfig && editOpts.showStatus && !props.keepSource) {
1570
- warnLog('vxe.error.reqProp', ['keep-source']);
1569
+ if (editConfig) {
1570
+ if (!keepSource) {
1571
+ if (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) {
1572
+ warnLog('vxe.error.reqSupportProp', ['edit-config.showStatus | showUpdateStatus | showInsertStatus', 'keep-source']);
1573
+ }
1574
+ // if (keyboardOpts.isUndoRedo) {
1575
+ // warnLog('vxe.error.reqSupportProp', ['keyboard-config.isUndoRedo', 'keep-source'])
1576
+ // }
1577
+ }
1571
1578
  }
1572
1579
  // if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
1573
1580
  // warnLog('vxe.error.reqProp', ['show-overflow'])
@@ -1640,7 +1647,7 @@ export default {
1640
1647
  if (rowOpts.height && !this.showOverflow) {
1641
1648
  warnLog('vxe.error.notProp', ['table.show-overflow']);
1642
1649
  }
1643
- if (!$xeTable.triggerClAreaModnEvent) {
1650
+ if (!$xeTable.triggerCelllAreaMnEvent) {
1644
1651
  if (props.areaConfig) {
1645
1652
  warnLog('vxe.error.notProp', ['area-config']);
1646
1653
  }
@@ -130,6 +130,10 @@ export function createInternalData() {
130
130
  tBodyHeight: 0,
131
131
  // 表尾高度
132
132
  tFooterHeight: 0,
133
+ stackHistoryStore: {
134
+ undoStacks: [],
135
+ redoStacks: []
136
+ },
133
137
  teleportToWrapperElem: null,
134
138
  popupToWrapperElem: null,
135
139
  customPopupToElem: null,
@@ -282,7 +286,7 @@ export function createReactData() {
282
286
  tooltipStore: {
283
287
  row: null,
284
288
  column: null,
285
- content: null,
289
+ content: '',
286
290
  visible: false,
287
291
  type: null,
288
292
  currOpts: {}
@@ -769,10 +773,15 @@ export function getLastChildColumn(column) {
769
773
  return column;
770
774
  }
771
775
  export function getCellValue(row, column) {
772
- return XEUtils.get(row, column.field);
776
+ if (column) {
777
+ return XEUtils.get(row, column.field);
778
+ }
779
+ return null;
773
780
  }
774
781
  export function setCellValue(row, column, value) {
775
- return XEUtils.set(row, column.field, value);
782
+ if (column) {
783
+ XEUtils.set(row, column.field, value);
784
+ }
776
785
  }
777
786
  export function getRefElem(refEl) {
778
787
  if (refEl) {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.20.13";
3
+ export const version = "3.21.0-beta.0";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -264,8 +264,8 @@ VxeUI.setConfig({
264
264
  visible: true
265
265
  }
266
266
  },
267
- undoHistoryConfig: {
268
- isEditRow: true
267
+ undoRedoHistoryConfig: {
268
+ stackSize: 20
269
269
  }
270
270
  },
271
271
  grid: {
package/es/ui/src/dom.js CHANGED
@@ -164,6 +164,10 @@ export function getAbsolutePos(elem) {
164
164
  const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
165
165
  return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth };
166
166
  }
167
+ export function hasEventInputTarget(target) {
168
+ const tagName = target ? target.tagName : '';
169
+ return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()));
170
+ }
167
171
  const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
168
172
  const scrollIntoView = 'scrollIntoView';
169
173
  export function scrollToView(elem) {
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.20.13"}`;
3
+ const version = `table v${"3.21.0-beta.0"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);