vxe-table 4.16.0-beta.0 → 4.16.0-beta.1

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 (81) hide show
  1. package/es/grid/src/grid.js +1 -0
  2. package/es/style.css +1 -1
  3. package/es/table/module/custom/hook.js +2 -1
  4. package/es/table/module/custom/panel.js +4 -0
  5. package/es/table/module/edit/hook.js +3 -2
  6. package/es/table/module/export/export-panel.js +3 -0
  7. package/es/table/module/export/hook.js +45 -24
  8. package/es/table/module/export/import-panel.js +3 -0
  9. package/es/table/module/menu/hook.js +2 -1
  10. package/es/table/module/validator/hook.js +3 -1
  11. package/es/table/src/body.js +7 -2
  12. package/es/table/src/column.js +1 -0
  13. package/es/table/src/columnInfo.js +5 -3
  14. package/es/table/src/footer.js +2 -0
  15. package/es/table/src/group.js +1 -0
  16. package/es/table/src/header.js +2 -0
  17. package/es/table/src/table.js +28 -22
  18. package/es/ui/index.js +1 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/lib/grid/src/grid.js +1 -0
  21. package/lib/grid/src/grid.min.js +1 -1
  22. package/lib/index.umd.js +113 -45
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/style.css +1 -1
  25. package/lib/table/module/custom/hook.js +2 -1
  26. package/lib/table/module/custom/hook.min.js +1 -1
  27. package/lib/table/module/custom/panel.js +4 -0
  28. package/lib/table/module/custom/panel.min.js +1 -1
  29. package/lib/table/module/edit/hook.js +5 -2
  30. package/lib/table/module/edit/hook.min.js +1 -1
  31. package/lib/table/module/export/export-panel.js +3 -0
  32. package/lib/table/module/export/export-panel.min.js +1 -1
  33. package/lib/table/module/export/hook.js +52 -19
  34. package/lib/table/module/export/hook.min.js +1 -1
  35. package/lib/table/module/export/import-panel.js +3 -0
  36. package/lib/table/module/export/import-panel.min.js +1 -1
  37. package/lib/table/module/menu/hook.js +2 -0
  38. package/lib/table/module/menu/hook.min.js +1 -1
  39. package/lib/table/module/validator/hook.js +3 -1
  40. package/lib/table/module/validator/hook.min.js +1 -1
  41. package/lib/table/src/body.js +8 -2
  42. package/lib/table/src/body.min.js +1 -1
  43. package/lib/table/src/column.js +1 -0
  44. package/lib/table/src/column.min.js +1 -1
  45. package/lib/table/src/columnInfo.js +6 -2
  46. package/lib/table/src/columnInfo.min.js +1 -1
  47. package/lib/table/src/footer.js +2 -0
  48. package/lib/table/src/footer.min.js +1 -1
  49. package/lib/table/src/group.js +1 -0
  50. package/lib/table/src/group.min.js +1 -1
  51. package/lib/table/src/header.js +2 -0
  52. package/lib/table/src/header.min.js +1 -1
  53. package/lib/table/src/table.js +16 -16
  54. package/lib/table/src/table.min.js +1 -1
  55. package/lib/ui/index.js +1 -1
  56. package/lib/ui/index.min.js +1 -1
  57. package/lib/ui/src/log.js +1 -1
  58. package/lib/ui/src/log.min.js +1 -1
  59. package/package.json +1 -1
  60. package/packages/grid/src/grid.ts +1 -0
  61. package/packages/table/module/custom/hook.ts +2 -1
  62. package/packages/table/module/custom/panel.ts +4 -0
  63. package/packages/table/module/edit/hook.ts +3 -2
  64. package/packages/table/module/export/export-panel.ts +3 -0
  65. package/packages/table/module/export/hook.ts +52 -26
  66. package/packages/table/module/export/import-panel.ts +3 -0
  67. package/packages/table/module/menu/hook.ts +2 -1
  68. package/packages/table/module/validator/hook.ts +3 -1
  69. package/packages/table/src/body.ts +7 -2
  70. package/packages/table/src/column.ts +1 -0
  71. package/packages/table/src/columnInfo.ts +5 -3
  72. package/packages/table/src/footer.ts +2 -0
  73. package/packages/table/src/group.ts +1 -0
  74. package/packages/table/src/header.ts +2 -0
  75. package/packages/table/src/table.ts +29 -22
  76. /package/es/{iconfont.1755178488627.ttf → iconfont.1755232625112.ttf} +0 -0
  77. /package/es/{iconfont.1755178488627.woff → iconfont.1755232625112.woff} +0 -0
  78. /package/es/{iconfont.1755178488627.woff2 → iconfont.1755232625112.woff2} +0 -0
  79. /package/lib/{iconfont.1755178488627.ttf → iconfont.1755232625112.ttf} +0 -0
  80. /package/lib/{iconfont.1755178488627.woff → iconfont.1755232625112.woff} +0 -0
  81. /package/lib/{iconfont.1755178488627.woff2 → iconfont.1755232625112.woff2} +0 -0
@@ -362,13 +362,15 @@ export default defineVxeComponent({
362
362
 
363
363
  const $xeGrid = inject<(VxeGridConstructor & VxeGridPrivateMethods) | null>('$xeGrid', null)
364
364
  const $xeGantt = inject('$xeGantt', null)
365
+ const $xeGGWrapper = $xeGrid || $xeGantt
366
+
365
367
  let $xeToolbar: VxeToolbarConstructor
366
368
 
367
369
  const computeTableId = computed(() => {
368
370
  const { id } = props
369
371
  if (id) {
370
372
  if (XEUtils.isFunction(id)) {
371
- return `${id({ $table: $xeTable, $grid: $xeGrid }) || ''}`
373
+ return `${id({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) || ''}`
372
374
  }
373
375
  return `${id}`
374
376
  }
@@ -4250,7 +4252,7 @@ export default defineVxeComponent({
4250
4252
  }
4251
4253
 
4252
4254
  const dispatchEvent = (type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null) => {
4253
- emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid }, params))
4255
+ emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }, params))
4254
4256
  }
4255
4257
 
4256
4258
  const handleScrollToRowColumn = (fieldOrColumn: string | VxeTableDefines.ColumnInfo | null, row?: any) => {
@@ -6895,7 +6897,7 @@ export default defineVxeComponent({
6895
6897
  if (showFooter && footerData && footerData.length) {
6896
6898
  footData = footerData.slice(0)
6897
6899
  } else if (showFooter && footerMethod) {
6898
- footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid }) : []
6900
+ footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : []
6899
6901
  }
6900
6902
  reactData.footerTableData = footData
6901
6903
  $xeTable.handleUpdateFooterMerge()
@@ -7264,7 +7266,7 @@ export default defineVxeComponent({
7264
7266
  }
7265
7267
  }
7266
7268
  } else if (mouseConfig) {
7267
- if (!getEventTargetNode(evnt, el).flag && !($xeGrid && getEventTargetNode(evnt, $xeGrid.getRefMaps().refElem.value).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.getRefMaps().refElem.value).flag) && !($xeToolbar && getEventTargetNode(evnt, $xeToolbar.getRefMaps().refElem.value).flag)) {
7269
+ if (!getEventTargetNode(evnt, el).flag && !($xeGGWrapper && getEventTargetNode(evnt, $xeGGWrapper.getRefMaps().refElem.value).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.getRefMaps().refElem.value).flag) && !($xeToolbar && getEventTargetNode(evnt, $xeToolbar.getRefMaps().refElem.value).flag)) {
7268
7270
  if ($xeTable.clearSelected) {
7269
7271
  $xeTable.clearSelected()
7270
7272
  }
@@ -7288,7 +7290,7 @@ export default defineVxeComponent({
7288
7290
  $xeTable.closeMenu()
7289
7291
  }
7290
7292
  }
7291
- const isActivated = getEventTargetNode(evnt, $xeGrid ? $xeGrid.getRefMaps().refElem.value : el).flag
7293
+ const isActivated = getEventTargetNode(evnt, $xeGGWrapper ? $xeGGWrapper.getRefMaps().refElem.value : el).flag
7292
7294
  // 如果存在校验,点击了表格之外则清除
7293
7295
  if (!isActivated && editRules && validOpts.autoClear) {
7294
7296
  reactData.validErrorMaps = {}
@@ -7561,7 +7563,8 @@ export default defineVxeComponent({
7561
7563
  column: selected.column,
7562
7564
  columnIndex: tableMethods.getColumnIndex(selected.column),
7563
7565
  $table: $xeTable,
7564
- $grid: $xeGrid
7566
+ $grid: $xeGrid,
7567
+ $gantt: $xeGantt
7565
7568
  }
7566
7569
  // 是否被禁用
7567
7570
  if (!beforeEditMethod || beforeEditMethod(params)) {
@@ -7586,7 +7589,8 @@ export default defineVxeComponent({
7586
7589
  column: selected.column,
7587
7590
  columnIndex: $xeTable.getColumnIndex(selected.column),
7588
7591
  $table: $xeTable,
7589
- $grid: $xeGrid
7592
+ $grid: $xeGrid,
7593
+ $gantt: $xeGantt
7590
7594
  }
7591
7595
  // 是否被禁用
7592
7596
  if (!beforeEditMethod || beforeEditMethod(params)) {
@@ -7610,7 +7614,8 @@ export default defineVxeComponent({
7610
7614
  rowIndex: $xeTable.getRowIndex(parentRow),
7611
7615
  $rowIndex: $xeTable.getVMRowIndex(parentRow),
7612
7616
  $table: $xeTable,
7613
- $grid: $xeGrid
7617
+ $grid: $xeGrid,
7618
+ $gantt: $xeGantt
7614
7619
  }
7615
7620
  $xeTable.setTreeExpand(parentRow, false)
7616
7621
  .then(() => $xeTable.scrollToRow(parentRow))
@@ -7631,9 +7636,10 @@ export default defineVxeComponent({
7631
7636
  column: selected.column,
7632
7637
  columnIndex: $xeTable.getColumnIndex(selected.column),
7633
7638
  $table: $xeTable,
7634
- $grid: $xeGrid
7639
+ $grid: $xeGrid,
7640
+ $gantt: $xeGantt
7635
7641
  }
7636
- if (!beforeEditMethod || beforeEditMethod({ ...selected.args, $table: $xeTable, $grid: $xeGrid })) {
7642
+ if (!beforeEditMethod || beforeEditMethod({ ...selected.args, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })) {
7637
7643
  if (editMethod) {
7638
7644
  editMethod(params)
7639
7645
  } else {
@@ -7954,8 +7960,8 @@ export default defineVxeComponent({
7954
7960
 
7955
7961
  const callSlot = <T>(slotFunc: ((params: T) => VxeComponentSlotType | VxeComponentSlotType[]) | string | null, params: T): VxeComponentSlotType[] => {
7956
7962
  if (slotFunc) {
7957
- if ($xeGrid) {
7958
- return $xeGrid.callSlot(slotFunc, params)
7963
+ if ($xeGGWrapper) {
7964
+ return $xeGGWrapper.callSlot(slotFunc, params)
7959
7965
  }
7960
7966
  // if (XEUtils.isString(slotFunc)) {
7961
7967
  // slotFunc = slots[slotFunc] || null
@@ -7981,8 +7987,8 @@ export default defineVxeComponent({
7981
7987
  */
7982
7988
  getParentElem () {
7983
7989
  const el = refElem.value
7984
- if ($xeGrid) {
7985
- const gridEl = $xeGrid.getRefMaps().refElem.value
7990
+ if ($xeGGWrapper) {
7991
+ const gridEl = $xeGGWrapper.getRefMaps().refElem.value
7986
7992
  return gridEl ? gridEl.parentNode as HTMLElement : null
7987
7993
  }
7988
7994
  return el ? el.parentNode as HTMLElement : null
@@ -7998,8 +8004,8 @@ export default defineVxeComponent({
7998
8004
  const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
7999
8005
  let parentWrapperHeight = 0
8000
8006
  if (parentElem) {
8001
- if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
8002
- parentWrapperHeight = $xeGrid.getParentHeight()
8007
+ if ($xeGGWrapper && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
8008
+ parentWrapperHeight = $xeGGWrapper.getParentHeight()
8003
8009
  } else {
8004
8010
  parentWrapperHeight = parentElem.clientHeight
8005
8011
  }
@@ -8014,7 +8020,7 @@ export default defineVxeComponent({
8014
8020
  * 如果存在表尾合计滚动条,则需要排除滚动条高度
8015
8021
  */
8016
8022
  getExcludeHeight () {
8017
- return $xeGrid ? $xeGrid.getExcludeHeight() : 0
8023
+ return $xeGGWrapper ? $xeGGWrapper.getExcludeHeight() : 0
8018
8024
  },
8019
8025
  /**
8020
8026
  * 定义行数据中的列属性,如果不存在则定义
@@ -8671,7 +8677,7 @@ export default defineVxeComponent({
8671
8677
  let isStop = false
8672
8678
  for (let i = 0; i < evntList.length; i++) {
8673
8679
  const func = evntList[i]
8674
- const fnRest = func(Object.assign({ $grid: $xeGrid, $table: $xeTable, $event: evnt }, args))
8680
+ const fnRest = func(Object.assign({ $table: $xeTable, $grid: $xeGrid, gantt: $xeGantt, $event: evnt }, args))
8675
8681
  if (fnRest === false) {
8676
8682
  isStop = true
8677
8683
  break
@@ -11312,7 +11318,7 @@ export default defineVxeComponent({
11312
11318
  const renderEmptyBody = () => {
11313
11319
  const emptyOpts = computeEmptyOpts.value
11314
11320
  const emptySlot = slots.empty
11315
- const emptyParams = { $table: $xeTable, $grid: $xeGrid }
11321
+ const emptyParams = { $table: $xeTable, $grid: $xeGrid, gantt: $xeGantt }
11316
11322
  if (emptySlot) {
11317
11323
  return emptySlot(emptyParams)
11318
11324
  } else {
@@ -11459,8 +11465,9 @@ export default defineVxeComponent({
11459
11465
  _columnIndex = colRest._index
11460
11466
  }
11461
11467
  const expandParams: VxeTableDefines.CellRenderDataParams = {
11462
- $grid: $xeGrid,
11463
11468
  $table: $xeTable,
11469
+ $grid: $xeGrid,
11470
+ $gantt: $xeGantt,
11464
11471
  seq,
11465
11472
  column: expandColumn,
11466
11473
  columnIndex,
@@ -11784,7 +11791,7 @@ export default defineVxeComponent({
11784
11791
  text: loadingOpts.text
11785
11792
  }, loadingSlot
11786
11793
  ? {
11787
- default: () => callSlot(loadingSlot, { $table: $xeTable, $grid: $xeGrid, loading: currLoading })
11794
+ default: () => callSlot(loadingSlot, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, loading: currLoading })
11788
11795
  }
11789
11796
  : {})
11790
11797
  : loadingSlot
@@ -11792,7 +11799,7 @@ export default defineVxeComponent({
11792
11799
  class: ['vxe-loading--custom-wrapper', {
11793
11800
  'is--visible': currLoading
11794
11801
  }]
11795
- }, callSlot(loadingSlot, { $table: $xeTable, $grid: $xeGrid, loading: currLoading }))
11802
+ }, callSlot(loadingSlot, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, loading: currLoading }))
11796
11803
  : renderEmptyElement($xeTable),
11797
11804
  /**
11798
11805
  * 自定义列