vxe-table 3.11.30 → 3.11.31

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.
@@ -23,7 +23,7 @@ import keyboardMixin from '../module/keyboard/mixin'
23
23
  import validatorMixin from '../module/validator/mixin'
24
24
  import customMixin from '../module/custom/mixin'
25
25
 
26
- import type { VxeLoadingComponent, VxeTooltipComponent, VxeTabsConstructor, VxeTabsPrivateMethods } from 'vxe-pc-ui'
26
+ import type { VxeLoadingComponent, VxeTooltipComponent, VxeTabsConstructor, VxeTabsPrivateMethods, VxeComponentStyleType } from 'vxe-pc-ui'
27
27
 
28
28
  const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI
29
29
 
@@ -291,8 +291,6 @@ export default {
291
291
  reColumnFlag: 0,
292
292
  // 已标记的对象集
293
293
  pendingRowMaps: {},
294
- // 已标记的行
295
- pendingRowList: [],
296
294
  // 自定义列相关的信息
297
295
  customStore: {
298
296
  btnEl: null,
@@ -777,6 +775,18 @@ export default {
777
775
  y: overflowY && scrollYLoad
778
776
  }
779
777
  },
778
+ computeTableStyle () {
779
+ const $xeTable = this
780
+ const reactData = $xeTable
781
+
782
+ const { tableData } = reactData
783
+ const columnOpts = $xeTable.computeColumnOpts
784
+ const stys: VxeComponentStyleType = {}
785
+ if (columnOpts.drag) {
786
+ stys['--vxe-ui-table-drag-column-move-delay'] = `${Math.max(0.06, Math.min(0.3, tableData.length / 800))}s`
787
+ }
788
+ return stys
789
+ },
780
790
  tabsResizeFlag () {
781
791
  const $xeTable = this
782
792
  const $xeTabs = $xeTable.$xeTabs
@@ -786,16 +796,13 @@ export default {
786
796
  } as any,
787
797
  watch: {
788
798
  data (value: any) {
789
- const { inited, initStatus } = this
799
+ const { initStatus } = this
790
800
  this.loadTableData(value).then(() => {
791
801
  this.inited = true
792
802
  this.initStatus = true
793
803
  if (!initStatus) {
794
804
  this.handleLoadDefaults()
795
805
  }
796
- if (!inited) {
797
- this.handleInitDefaults()
798
- }
799
806
  // const checkboxColumn = this.tableFullColumn.find(column => column.type === 'checkbox')
800
807
  // if (checkboxColumn && this.tableFullData.length > 300 && !this.checkboxOpts.checkField) {
801
808
  // warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
@@ -1089,8 +1096,8 @@ export default {
1089
1096
  this.inited = true
1090
1097
  this.initStatus = true
1091
1098
  this.handleLoadDefaults()
1092
- this.handleInitDefaults()
1093
1099
  }
1100
+ this.handleInitDefaults()
1094
1101
  this.updateStyle()
1095
1102
  })
1096
1103
  globalEvents.on(this, 'paste', this.handleGlobalPasteEvent)
@@ -1245,6 +1252,7 @@ export default {
1245
1252
  const vSize = computeSize
1246
1253
  const virtualScrollBars = $xeTable.computeVirtualScrollBars
1247
1254
  const isArea = mouseConfig && mouseOpts.area
1255
+ const tableStyle = $xeTable.computeTableStyle
1248
1256
  return h('div', {
1249
1257
  ref: 'refElem',
1250
1258
  class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
@@ -1277,9 +1285,7 @@ export default {
1277
1285
  'is--virtual-x': scrollXLoad,
1278
1286
  'is--virtual-y': scrollYLoad
1279
1287
  }],
1280
- style: {
1281
- '--vxe-ui-table-drag-column-move-delay': `${Math.max(0.05, Math.min(0.3, tableData.length / 800))}s`
1282
- },
1288
+ style: tableStyle,
1283
1289
  attrs: {
1284
1290
  spellcheck: false
1285
1291
  },