vxe-table 3.13.0-beta.10 → 3.13.0-beta.2

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 (68) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/mixin.js +8 -1
  6. package/es/table/render/index.js +0 -10
  7. package/es/table/src/body.js +2 -4
  8. package/es/table/src/cell.js +0 -3
  9. package/es/table/src/footer.js +2 -4
  10. package/es/table/src/header.js +4 -6
  11. package/es/table/src/methods.js +19 -44
  12. package/es/table/src/table.js +3 -13
  13. package/es/table/style.css +1 -1
  14. package/es/table/style.min.css +1 -1
  15. package/es/ui/index.js +1 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-table/style.css +1 -1
  18. package/es/vxe-table/style.min.css +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +39 -94
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/table/module/edit/mixin.js +10 -1
  26. package/lib/table/module/edit/mixin.min.js +1 -1
  27. package/lib/table/render/index.js +0 -10
  28. package/lib/table/render/index.min.js +1 -1
  29. package/lib/table/src/body.js +1 -4
  30. package/lib/table/src/body.min.js +1 -1
  31. package/lib/table/src/cell.js +0 -3
  32. package/lib/table/src/cell.min.js +1 -1
  33. package/lib/table/src/footer.js +1 -4
  34. package/lib/table/src/footer.min.js +1 -1
  35. package/lib/table/src/header.js +3 -6
  36. package/lib/table/src/header.min.js +1 -1
  37. package/lib/table/src/methods.js +19 -47
  38. package/lib/table/src/methods.min.js +1 -1
  39. package/lib/table/src/table.js +3 -17
  40. package/lib/table/src/table.min.js +1 -1
  41. package/lib/table/style/style.css +1 -1
  42. package/lib/table/style/style.min.css +1 -1
  43. package/lib/ui/index.js +1 -1
  44. package/lib/ui/index.min.js +1 -1
  45. package/lib/ui/src/log.js +1 -1
  46. package/lib/ui/src/log.min.js +1 -1
  47. package/lib/vxe-table/style/style.css +1 -1
  48. package/lib/vxe-table/style/style.min.css +1 -1
  49. package/package.json +2 -2
  50. package/packages/table/module/edit/mixin.ts +8 -1
  51. package/packages/table/render/index.ts +0 -10
  52. package/packages/table/src/body.ts +2 -5
  53. package/packages/table/src/cell.ts +1 -4
  54. package/packages/table/src/footer.ts +2 -5
  55. package/packages/table/src/header.ts +4 -7
  56. package/packages/table/src/methods.ts +21 -53
  57. package/packages/table/src/table.ts +3 -14
  58. package/styles/components/table.scss +1 -1
  59. package/es/locale/lang/id-ID.js +0 -695
  60. package/lib/locale/lang/id-ID.js +0 -701
  61. package/lib/locale/lang/id-ID.min.js +0 -1
  62. package/packages/locale/lang/id-ID.ts +0 -695
  63. /package/es/{iconfont.1739790201341.ttf → iconfont.1739506361723.ttf} +0 -0
  64. /package/es/{iconfont.1739790201341.woff → iconfont.1739506361723.woff} +0 -0
  65. /package/es/{iconfont.1739790201341.woff2 → iconfont.1739506361723.woff2} +0 -0
  66. /package/lib/{iconfont.1739790201341.ttf → iconfont.1739506361723.ttf} +0 -0
  67. /package/lib/{iconfont.1739790201341.woff → iconfont.1739506361723.woff} +0 -0
  68. /package/lib/{iconfont.1739790201341.woff2 → iconfont.1739506361723.woff2} +0 -0
@@ -309,7 +309,7 @@ export default {
309
309
  const { fixedType, fixedColumn, tableColumn } = props
310
310
  const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
311
311
  const { visibleColumn, fullColumnIdData } = tableInternalData
312
- const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
312
+ const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
313
313
 
314
314
  let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
315
315
  let isOptimizeMode = false
@@ -322,11 +322,8 @@ export default {
322
322
  }
323
323
  }
324
324
 
325
- if (fixedType || !overflowX) {
326
- renderColumnList = visibleColumn
327
- }
328
-
329
325
  if (fixedType) {
326
+ renderColumnList = visibleColumn
330
327
  if (isOptimizeMode) {
331
328
  renderColumnList = fixedColumn || []
332
329
  }
@@ -116,8 +116,8 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
116
116
  'is--sortable': column.sortable,
117
117
  'col--filter': !!filters,
118
118
  'is--filter-active': hasFilter,
119
- 'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
120
- 'is--drag-disabled': columnOpts.drag && isDisabledDrag,
119
+ 'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
120
+ 'is--drag-disabled': isDisabledDrag,
121
121
  'col--current': currentColumn === column
122
122
  }, getClass(headerClassName, cellParams), getClass(headerCellClassName, cellParams)],
123
123
  attrs: thAttrs,
@@ -272,7 +272,7 @@ export default {
272
272
  const { headerColumn } = this
273
273
 
274
274
  const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
275
- const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
275
+ const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
276
276
  const { visibleColumn, fullColumnIdData } = tableInternalData
277
277
 
278
278
  const mouseOpts = $xeTable.computeMouseOpts
@@ -292,11 +292,8 @@ export default {
292
292
  }
293
293
  }
294
294
 
295
- if (fixedType || !overflowX) {
296
- renderColumnList = visibleColumn
297
- }
298
-
299
295
  if (fixedType) {
296
+ renderColumnList = visibleColumn
300
297
  // 如果是使用优化模式
301
298
  if (isOptimizeMode) {
302
299
  renderColumnList = fixedColumn || []
@@ -190,7 +190,6 @@ function cacheColumnMap ($xeTable: VxeTableConstructor) {
190
190
  const fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnIdData = {}
191
191
  const fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnFieldData = {}
192
192
  const mouseOpts = $xeTable.computeMouseOpts
193
- const expandOpts = $xeTable.computeExpandOpts
194
193
  const columnOpts = $xeTable.computeColumnOpts
195
194
  const columnDragOpts = $xeTable.computeColumnDragOpts
196
195
  const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
@@ -278,8 +277,10 @@ function cacheColumnMap ($xeTable: VxeTableConstructor) {
278
277
  tableFullColumn.forEach(handleFunc)
279
278
  }
280
279
 
281
- if ((expandColumn && expandOpts.mode !== 'fixed') && mouseOpts.area) {
282
- errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
280
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
281
+ if (expandColumn && mouseOpts.area) {
282
+ errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
283
+ }
283
284
  }
284
285
 
285
286
  if (process.env.VUE_APP_VXE_ENV === 'developmeznt') {
@@ -1711,7 +1712,6 @@ function handleColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
1711
1712
  const reactData = $xeTable as unknown as TableReactData
1712
1713
  const internalData = $xeTable as unknown as TableInternalData
1713
1714
 
1714
- const expandOpts = $xeTable.computeExpandOpts
1715
1715
  internalData.collectColumn = collectColumn
1716
1716
  const tableFullColumn = getColumnList(collectColumn)
1717
1717
  internalData.tableFullColumn = tableFullColumn
@@ -1721,7 +1721,6 @@ function handleColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
1721
1721
  return Promise.resolve(
1722
1722
  restoreCustomStorage($xeTable)
1723
1723
  ).then(() => {
1724
- const { scrollXLoad, scrollYLoad, expandColumn } = reactData
1725
1724
  cacheColumnMap($xeTable)
1726
1725
  parseColumns($xeTable, true).then(() => {
1727
1726
  if (reactData.scrollXLoad) {
@@ -1731,11 +1730,11 @@ function handleColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
1731
1730
  $xeTable.clearMergeCells()
1732
1731
  $xeTable.clearMergeFooterItems()
1733
1732
  $xeTable.handleTableData(true)
1734
-
1735
- if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
1736
- warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
1733
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
1734
+ if ((reactData.scrollXLoad || reactData.scrollYLoad) && reactData.expandColumn) {
1735
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
1736
+ }
1737
1737
  }
1738
-
1739
1738
  return $xeTable.$nextTick().then(() => {
1740
1739
  if ($xeToolbar) {
1741
1740
  $xeToolbar.syncUpdate({
@@ -2021,17 +2020,6 @@ function updateRowExpandStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMe
2021
2020
  }
2022
2021
  }
2023
2022
 
2024
- function handleRowExpandScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
2025
- const internalData = $xeTable as unknown as TableInternalData
2026
-
2027
- const { elemStore } = internalData
2028
- const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
2029
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
2030
- if (rowExpandEl && bodyScrollElem) {
2031
- rowExpandEl.scrollTop = bodyScrollElem.scrollTop
2032
- }
2033
- }
2034
-
2035
2023
  const Methods = {
2036
2024
  callSlot (slotFunc: any, params: any, h: any, vNodes: any) {
2037
2025
  if (slotFunc) {
@@ -5619,7 +5607,7 @@ const Methods = {
5619
5607
  vLen++
5620
5608
  })
5621
5609
 
5622
- const isSelected = rootList.length > 0 ? (vLen > 0 ? (sLen >= vLen) : (sLen >= rootList.length)) : false
5610
+ const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length
5623
5611
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
5624
5612
 
5625
5613
  reactData.isAllSelected = isSelected
@@ -7424,10 +7412,7 @@ const Methods = {
7424
7412
  delete rExpandLazyLoadedMaps[rowid]
7425
7413
  }
7426
7414
  reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
7427
- $xeTable.$nextTick()
7428
- .then(() => $xeTable.recalculate())
7429
- .then(() => $xeTable.updateCellAreas())
7430
- .then(() => resolve())
7415
+ $xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve())
7431
7416
  })
7432
7417
  } else {
7433
7418
  resolve()
@@ -7442,14 +7427,12 @@ const Methods = {
7442
7427
  * @param {Boolean} expanded 是否展开
7443
7428
  */
7444
7429
  setRowExpand (rows: any, expanded: any) {
7445
- const $xeTable = this
7446
-
7447
- const { rowExpandedMaps, fullAllDataRowIdData, rowExpandLazyLoadedMaps, expandOpts, expandColumn } = this
7430
+ const { rowExpandedMaps, fullAllDataRowIdData, rowExpandLazyLoadedMaps, expandOpts, expandColumn: column } = this
7448
7431
  let rExpandedMaps = { ...rowExpandedMaps }
7449
7432
  const { reserve, lazy, accordion, toggleMethod } = expandOpts
7450
7433
  const lazyRests: any[] = []
7451
- const columnIndex = $xeTable.getColumnIndex(expandColumn)
7452
- const $columnIndex = $xeTable.getVMColumnIndex(expandColumn)
7434
+ const columnIndex = this.getColumnIndex(column)
7435
+ const $columnIndex = this.getVMColumnIndex(column)
7453
7436
  if (rows) {
7454
7437
  if (!XEUtils.isArray(rows)) {
7455
7438
  rows = [rows]
@@ -7459,7 +7442,7 @@ const Methods = {
7459
7442
  rExpandedMaps = {}
7460
7443
  rows = rows.slice(rows.length - 1, rows.length)
7461
7444
  }
7462
- const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows
7445
+ const validRows = toggleMethod ? rows.filter((row: any) => toggleMethod({ expanded, column, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows
7463
7446
  if (expanded) {
7464
7447
  validRows.forEach((row: any) => {
7465
7448
  const rowid = getRowid(this, row)
@@ -7474,7 +7457,7 @@ const Methods = {
7474
7457
  }
7475
7458
  })
7476
7459
  } else {
7477
- validRows.forEach((item) => {
7460
+ validRows.forEach((item: any) => {
7478
7461
  const rowid = getRowid(this, item)
7479
7462
  if (rExpandedMaps[rowid]) {
7480
7463
  delete rExpandedMaps[rowid]
@@ -7482,19 +7465,11 @@ const Methods = {
7482
7465
  })
7483
7466
  }
7484
7467
  if (reserve) {
7485
- validRows.forEach((row) => this.handleRowExpandReserve(row, expanded))
7468
+ validRows.forEach((row: any) => this.handleRowExpandReserve(row, expanded))
7486
7469
  }
7487
7470
  }
7488
7471
  this.rowExpandedMaps = rExpandedMaps
7489
- return Promise.all(lazyRests)
7490
- .then(() => $xeTable.recalculate())
7491
- .then(() => {
7492
- if (expandColumn) {
7493
- updateRowExpandStyle($xeTable)
7494
- handleRowExpandScroll($xeTable)
7495
- }
7496
- return $xeTable.updateCellAreas()
7497
- })
7472
+ return Promise.all(lazyRests).then(this.recalculate)
7498
7473
  },
7499
7474
  /**
7500
7475
  * 判断行是否为展开状态
@@ -7516,8 +7491,6 @@ const Methods = {
7516
7491
  * 手动清空展开行状态,数据会恢复成未展开的状态
7517
7492
  */
7518
7493
  clearRowExpand () {
7519
- const $xeTable = this
7520
-
7521
7494
  const { expandOpts, tableFullData } = this
7522
7495
  const { reserve } = expandOpts
7523
7496
  const expList = this.getRowExpandRecords()
@@ -7529,7 +7502,7 @@ const Methods = {
7529
7502
  if (expList.length) {
7530
7503
  this.recalculate()
7531
7504
  }
7532
- }).then(() => $xeTable.updateCellAreas())
7505
+ })
7533
7506
  },
7534
7507
  clearRowExpandReserve () {
7535
7508
  this.rowExpandedReserveRowMap = {}
@@ -8837,15 +8810,10 @@ const Methods = {
8837
8810
  }
8838
8811
  },
8839
8812
  updateCellAreas () {
8840
- const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8841
- const props = $xeTable
8842
-
8843
- const { mouseConfig } = props
8844
- const mouseOpts = $xeTable.computeMouseOpts
8845
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
8846
- return $xeTable.handleRecalculateCellAreaEvent()
8813
+ if (this.mouseConfig && this.mouseOpts.area && this.handleRecalculateCellAreas) {
8814
+ return this.handleRecalculateCellAreas()
8847
8815
  }
8848
- return $xeTable.$nextTick()
8816
+ return this.$nextTick()
8849
8817
  },
8850
8818
  dispatchEvent (type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null) {
8851
8819
  const $xeTable = this
@@ -1180,16 +1180,11 @@ export default {
1180
1180
  } as any,
1181
1181
  watch: {
1182
1182
  data (value: any) {
1183
- const $xeTable = this
1184
- const reactData = $xeTable
1185
-
1186
1183
  const { initStatus } = this
1187
1184
  if (value && value.length >= 50000) {
1188
1185
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
1189
1186
  }
1190
1187
  this.loadTableData(value || [], true).then(() => {
1191
- const { scrollXLoad, scrollYLoad, expandColumn } = reactData
1192
- const expandOpts = $xeTable.computeExpandOpts
1193
1188
  this.inited = true
1194
1189
  this.initStatus = true
1195
1190
  if (!initStatus) {
@@ -1199,9 +1194,9 @@ export default {
1199
1194
  // if (checkboxColumn && this.tableFullData.length > 300 && !this.checkboxOpts.checkField) {
1200
1195
  // warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
1201
1196
  // }
1202
- if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
1203
- warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
1204
- }
1197
+ // if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
1198
+ // warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
1199
+ // }
1205
1200
  this.recalculate()
1206
1201
  })
1207
1202
  },
@@ -1227,12 +1222,6 @@ export default {
1227
1222
  showFooter () {
1228
1223
  this.reScrollFlag++
1229
1224
  },
1230
- overflowX () {
1231
- this.reScrollFlag++
1232
- },
1233
- overflowY () {
1234
- this.reScrollFlag++
1235
- },
1236
1225
  reScrollFlag () {
1237
1226
  const $xeTable = this
1238
1227
 
@@ -271,7 +271,7 @@
271
271
  display: none;
272
272
  position: absolute;
273
273
  pointer-events: none;
274
- z-index: 6;
274
+ z-index: 1;
275
275
  }
276
276
 
277
277
  .vxe-table--header-wrapper {