vxe-table 3.20.1 → 3.20.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 (49) 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/src/body.js +4 -2
  6. package/es/table/src/methods.js +10 -7
  7. package/es/table/src/table.js +16 -1
  8. package/es/table/src/util.js +1 -2
  9. package/es/table/style.css +2 -2
  10. package/es/table/style.min.css +1 -1
  11. package/es/ui/index.js +1 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-table/style.css +2 -2
  14. package/es/vxe-table/style.min.css +1 -1
  15. package/lib/index.css +1 -1
  16. package/lib/index.min.css +1 -1
  17. package/lib/index.umd.js +31 -11
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/style.css +1 -1
  20. package/lib/style.min.css +1 -1
  21. package/lib/table/src/body.js +5 -2
  22. package/lib/table/src/body.min.js +1 -1
  23. package/lib/table/src/methods.js +5 -5
  24. package/lib/table/src/methods.min.js +1 -1
  25. package/lib/table/src/table.js +18 -0
  26. package/lib/table/src/table.min.js +1 -1
  27. package/lib/table/src/util.js +1 -2
  28. package/lib/table/src/util.min.js +1 -1
  29. package/lib/table/style/style.css +2 -2
  30. package/lib/table/style/style.min.css +1 -1
  31. package/lib/ui/index.js +1 -1
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/lib/vxe-table/style/style.css +2 -2
  36. package/lib/vxe-table/style/style.min.css +1 -1
  37. package/package.json +1 -1
  38. package/packages/table/src/body.ts +4 -2
  39. package/packages/table/src/methods.ts +10 -7
  40. package/packages/table/src/table.ts +18 -2
  41. package/packages/table/src/util.ts +2 -2
  42. package/styles/components/table.scss +2 -2
  43. package/styles/theme/base.scss +3 -0
  44. /package/es/{iconfont.1773109164685.ttf → iconfont.1773303132392.ttf} +0 -0
  45. /package/es/{iconfont.1773109164685.woff → iconfont.1773303132392.woff} +0 -0
  46. /package/es/{iconfont.1773109164685.woff2 → iconfont.1773303132392.woff2} +0 -0
  47. /package/lib/{iconfont.1773109164685.ttf → iconfont.1773303132392.ttf} +0 -0
  48. /package/lib/{iconfont.1773109164685.woff → iconfont.1773303132392.woff} +0 -0
  49. /package/lib/{iconfont.1773109164685.woff2 → iconfont.1773303132392.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.20.1",
3
+ "version": "3.20.2",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -17,10 +17,12 @@ const renderType = 'body'
17
17
  const isVMScrollProcess = ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) => {
18
18
  const tableProps = $xeTable
19
19
  const tableReactData = $xeTable as unknown as TableReactData
20
+ const tableInternalData = $xeTable as unknown as TableInternalData
20
21
 
21
22
  const { delayHover } = tableProps
22
- const { lastScrollTime, isDragResize } = tableReactData
23
- return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
23
+ const { isDragResize } = tableReactData
24
+ const { lastSTime } = tableInternalData
25
+ return !!(isDragResize || (lastSTime && Date.now() < lastSTime + (delayHover as number)))
24
26
  }
25
27
 
26
28
  function renderLine (h: CreateElement, $xeTable : VxeTableConstructor & VxeTablePrivateMethods, rowid: string, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number): VxeComponentSlotType[] {
@@ -3495,7 +3495,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3495
3495
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
3496
3496
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"'])
3497
3497
  }
3498
- if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
3498
+ if (virtualYOpts.mode === 'scroll' && reactData.expandColumn && expandOpts.mode === 'fixed') {
3499
3499
  warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside'])
3500
3500
  }
3501
3501
  // if (showOverflow) {
@@ -4023,7 +4023,7 @@ function handleSyncScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
4023
4023
  return Promise.all([
4024
4024
  xRest,
4025
4025
  yRest,
4026
- $xeTable.updateCellAreas()
4026
+ scrollXLoad || scrollYLoad ? $xeTable.updateCellAreas() : null
4027
4027
  ])
4028
4028
  }
4029
4029
 
@@ -11435,7 +11435,6 @@ const tableMethods: any = {
11435
11435
  handleScrollEvent (evnt: Event, isRollY: boolean, isRollX: boolean, scrollTop: number, scrollLeft: number, params: any) {
11436
11436
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
11437
11437
  const props = $xeTable
11438
- const reactData = $xeTable as unknown as TableReactData
11439
11438
  const internalData = $xeTable as unknown as TableInternalData
11440
11439
 
11441
11440
  const { highlightHoverRow } = props
@@ -11500,7 +11499,7 @@ const tableMethods: any = {
11500
11499
  }
11501
11500
  internalData.lastScrollTop = scrollTop
11502
11501
  }
11503
- reactData.lastScrollTime = Date.now()
11502
+ internalData.lastSTime = Date.now()
11504
11503
  const evntParams = {
11505
11504
  source: sourceType,
11506
11505
  scrollTop,
@@ -11766,7 +11765,7 @@ const tableMethods: any = {
11766
11765
  return
11767
11766
  }
11768
11767
 
11769
- const wheelSpeed = getWheelSpeed(reactData.lastScrollTime)
11768
+ const wheelSpeed = getWheelSpeed(internalData.lastSTime)
11770
11769
  const deltaTop = shiftKey ? 0 : (deltaY * wheelSpeed)
11771
11770
  const deltaLeft = (shiftKey ? (deltaX || deltaY) : deltaX) * wheelSpeed
11772
11771
 
@@ -12274,14 +12273,18 @@ const tableMethods: any = {
12274
12273
  setScrollLeft(bodyScrollElem, scrollLeft)
12275
12274
  setScrollLeft(headerScrollElem, scrollLeft)
12276
12275
  setScrollLeft(footerScrollElem, scrollLeft)
12277
- loadScrollXData($xeTable)
12276
+ if (reactData.scrollXLoad) {
12277
+ loadScrollXData($xeTable)
12278
+ }
12278
12279
  }
12279
12280
  if (XEUtils.isNumber(scrollTop)) {
12280
12281
  setScrollTop(yHandleEl, scrollTop)
12281
12282
  setScrollTop(bodyScrollElem, scrollTop)
12282
12283
  setScrollTop(leftScrollElem, scrollTop)
12283
12284
  setScrollTop(rightScrollElem, scrollTop)
12284
- loadScrollYData($xeTable)
12285
+ if (reactData.scrollYLoad) {
12286
+ loadScrollYData($xeTable)
12287
+ }
12285
12288
  }
12286
12289
  return new Promise<void>(resolve => {
12287
12290
  setTimeout(() => {
@@ -1,7 +1,7 @@
1
1
  import { CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { getFuncText, isEnableConf } from '../../ui/src/utils'
4
- import { initTpImg } from '../../ui/src/dom'
4
+ import { initTpImg, toCssUnit } from '../../ui/src/dom'
5
5
  import { createReactData, createInternalData, createHandleGetRowId, getCalcHeight, hasDeepKey } from './util'
6
6
  import { VxeUI } from '../../ui'
7
7
  import methods from './methods'
@@ -26,7 +26,7 @@ import keyboardMixin from '../module/keyboard/mixin'
26
26
  import validatorMixin from '../module/validator/mixin'
27
27
  import customMixin from '../module/custom/mixin'
28
28
 
29
- import type { VxeTabsConstructor, VxeTabsPrivateMethods } from 'vxe-pc-ui'
29
+ import type { VxeTabsConstructor, VxeTabsPrivateMethods, VxeComponentStyleType } from 'vxe-pc-ui'
30
30
  import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTablePropTypes, TableInternalData, TableReactData, VxeTableDefines } from '../../../types'
31
31
 
32
32
  const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI
@@ -1232,6 +1232,20 @@ export default {
1232
1232
  }
1233
1233
  return ''
1234
1234
  },
1235
+ computeTableStyle () {
1236
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1237
+
1238
+ const scrollbarOpts = $xeTable.computeScrollbarOpts
1239
+ const { width, height } = scrollbarOpts
1240
+ const tStys: VxeComponentStyleType = {}
1241
+ if (width) {
1242
+ tStys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(width)
1243
+ }
1244
+ if (height) {
1245
+ tStys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(height)
1246
+ }
1247
+ return tStys
1248
+ },
1235
1249
  computeTableRowExpandedList () {
1236
1250
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1237
1251
  const reactData = $xeTable as unknown as TableReactData
@@ -2077,6 +2091,7 @@ export default {
2077
2091
  footer: slots.footerTooltip || slots['footer-tooltip']
2078
2092
  }
2079
2093
  const currTooltipSlot = tooltipStore.visible && tooltipStore.type ? tipSlots[tooltipStore.type] : null
2094
+ const tableStyle = ($xeTable as any).computeTableStyle as VxeComponentStyleType
2080
2095
  const rowDragOpts = $xeTable.computeRowDragOpts
2081
2096
  const tableTipConfig = $xeTable.computeTableTipConfig
2082
2097
  const validTipConfig = $xeTable.computeValidTipConfig
@@ -2148,6 +2163,7 @@ export default {
2148
2163
  'is--virtual-x': scrollXLoad,
2149
2164
  'is--virtual-y': scrollYLoad
2150
2165
  }],
2166
+ style: tableStyle,
2151
2167
  attrs: {
2152
2168
  spellcheck: false
2153
2169
  },
@@ -137,6 +137,8 @@ export function createInternalData (): TableInternalData {
137
137
  teleportToWrapperElem: null,
138
138
  popupToWrapperElem: null,
139
139
 
140
+ lastSTime: 0,
141
+
140
142
  inited: false,
141
143
  tooltipTimeout: null,
142
144
  initStatus: false,
@@ -167,8 +169,6 @@ export function createReactData (): TableReactData {
167
169
  scrollbarWidth: 0,
168
170
  // 横向滚动条的高度
169
171
  scrollbarHeight: 0,
170
- // 最后滚动时间戳
171
- lastScrollTime: 0,
172
172
  // 行高
173
173
  rowHeight: 0,
174
174
  // 表格父容器的高度
@@ -912,7 +912,7 @@ $btnThemeList: (
912
912
  .vxe-table--scroll-x-handle {
913
913
  overflow-y: hidden;
914
914
  overflow-x: scroll;
915
- height: 18px;
915
+ height: var(--vxe-ui-table-view-scrollbar-height);
916
916
  }
917
917
  .vxe-table--scroll-y-handle,
918
918
  .vxe-table--scroll-y-wrapper {
@@ -924,7 +924,7 @@ $btnThemeList: (
924
924
  .vxe-table--scroll-y-handle {
925
925
  overflow-y: scroll;
926
926
  overflow-x: hidden;
927
- width: 18px;
927
+ width: var(--vxe-ui-table-view-scrollbar-width);
928
928
  height: 100%;
929
929
  }
930
930
  .vxe-table--scroll-x-space {
@@ -78,6 +78,9 @@
78
78
 
79
79
  --vxe-ui-table-menu-item-width: 198px;
80
80
 
81
+ --vxe-ui-table-view-scrollbar-width: 18px;
82
+ --vxe-ui-table-view-scrollbar-height: 18px;
83
+
81
84
  --vxe-ui-table-validate-error-color: #f56c6c;
82
85
  --vxe-ui-table-validate-error-cell-background-color: rgba(245, 108,108, 0.1);
83
86
  --vxe-ui-table-validate-error-theme-normal-background-color: var(--vxe-ui-layout-background-color);