vxe-pc-ui 3.20.8 → 3.20.10

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 (141) hide show
  1. package/es/card/src/card.js +2 -1
  2. package/es/date-panel/src/date-panel.js +70 -39
  3. package/es/date-panel/style.css +22 -20
  4. package/es/date-panel/style.min.css +1 -1
  5. package/es/drawer/src/drawer.js +1 -0
  6. package/es/icon/style.css +1 -1
  7. package/es/icon-picker/src/icon-picker.js +11 -3
  8. package/es/icon-picker/style.css +9 -3
  9. package/es/icon-picker/style.min.css +1 -1
  10. package/es/layout-aside/src/layout-aside.js +2 -1
  11. package/es/layout-body/src/layout-body.js +2 -1
  12. package/es/layout-container/src/layout-container.js +9 -2
  13. package/es/list/src/list.js +80 -223
  14. package/es/menu/src/menu.js +1 -0
  15. package/es/modal/src/modal.js +1 -0
  16. package/es/scrollbar/src/scrollbar.js +32 -188
  17. package/es/select/src/select.js +273 -8
  18. package/es/select/style.css +44 -0
  19. package/es/select/style.min.css +1 -1
  20. package/es/style.css +1 -1
  21. package/es/style.min.css +1 -1
  22. package/es/tabs/src/tabs.js +2 -1
  23. package/es/tooltip/src/tooltip.js +7 -6
  24. package/es/tooltip/style.css +2 -0
  25. package/es/tooltip/style.min.css +1 -1
  26. package/es/tree/src/tree.js +85 -228
  27. package/es/ui/index.js +1 -1
  28. package/es/ui/src/log.js +1 -1
  29. package/es/vxe-date-panel/style.css +22 -20
  30. package/es/vxe-date-panel/style.min.css +1 -1
  31. package/es/vxe-icon-picker/style.css +9 -3
  32. package/es/vxe-icon-picker/style.min.css +1 -1
  33. package/es/vxe-select/style.css +44 -0
  34. package/es/vxe-select/style.min.css +1 -1
  35. package/es/vxe-tooltip/style.css +2 -0
  36. package/es/vxe-tooltip/style.min.css +1 -1
  37. package/lib/card/src/card.js +1 -1
  38. package/lib/card/src/card.min.js +1 -1
  39. package/lib/date-panel/src/date-panel.js +74 -43
  40. package/lib/date-panel/src/date-panel.min.js +1 -1
  41. package/lib/date-panel/style/style.css +22 -20
  42. package/lib/date-panel/style/style.min.css +1 -1
  43. package/lib/drawer/src/drawer.js +1 -1
  44. package/lib/drawer/src/drawer.min.js +1 -1
  45. package/lib/icon/style/style.css +1 -1
  46. package/lib/icon/style/style.min.css +1 -1
  47. package/lib/icon-picker/src/icon-picker.js +56 -38
  48. package/lib/icon-picker/src/icon-picker.min.js +1 -1
  49. package/lib/icon-picker/style/style.css +9 -3
  50. package/lib/icon-picker/style/style.min.css +1 -1
  51. package/lib/index.umd.js +894 -816
  52. package/lib/index.umd.min.js +1 -1
  53. package/lib/layout-aside/src/layout-aside.js +1 -1
  54. package/lib/layout-aside/src/layout-aside.min.js +1 -1
  55. package/lib/layout-body/src/layout-body.js +1 -1
  56. package/lib/layout-body/src/layout-body.min.js +1 -1
  57. package/lib/layout-container/src/layout-container.js +13 -3
  58. package/lib/layout-container/src/layout-container.min.js +1 -1
  59. package/lib/list/src/list.js +72 -225
  60. package/lib/list/src/list.min.js +1 -1
  61. package/lib/menu/src/menu.js +1 -1
  62. package/lib/menu/src/menu.min.js +1 -1
  63. package/lib/modal/src/modal.js +1 -1
  64. package/lib/modal/src/modal.min.js +1 -1
  65. package/lib/scrollbar/src/scrollbar.js +29 -192
  66. package/lib/scrollbar/src/scrollbar.min.js +1 -1
  67. package/lib/select/src/select.js +322 -69
  68. package/lib/select/src/select.min.js +1 -1
  69. package/lib/select/style/style.css +44 -0
  70. package/lib/select/style/style.min.css +1 -1
  71. package/lib/style.css +1 -1
  72. package/lib/style.min.css +1 -1
  73. package/lib/tabs/src/tabs.js +1 -1
  74. package/lib/tabs/src/tabs.min.js +1 -1
  75. package/lib/tooltip/src/tooltip.js +5 -6
  76. package/lib/tooltip/src/tooltip.min.js +1 -1
  77. package/lib/tooltip/style/style.css +2 -0
  78. package/lib/tooltip/style/style.min.css +1 -1
  79. package/lib/tree/src/tree.js +77 -229
  80. package/lib/tree/src/tree.min.js +1 -1
  81. package/lib/ui/index.js +1 -1
  82. package/lib/ui/index.min.js +1 -1
  83. package/lib/ui/src/log.js +1 -1
  84. package/lib/ui/src/log.min.js +1 -1
  85. package/lib/vxe-date-panel/style/style.css +22 -20
  86. package/lib/vxe-date-panel/style/style.min.css +1 -1
  87. package/lib/vxe-icon-picker/style/style.css +9 -3
  88. package/lib/vxe-icon-picker/style/style.min.css +1 -1
  89. package/lib/vxe-select/style/style.css +44 -0
  90. package/lib/vxe-select/style/style.min.css +1 -1
  91. package/lib/vxe-tooltip/style/style.css +2 -0
  92. package/lib/vxe-tooltip/style/style.min.css +1 -1
  93. package/package.json +2 -2
  94. package/packages/card/src/card.ts +4 -2
  95. package/packages/date-panel/src/date-panel.ts +70 -39
  96. package/packages/drawer/src/drawer.ts +4 -2
  97. package/packages/icon-picker/src/icon-picker.ts +12 -3
  98. package/packages/layout-aside/src/layout-aside.ts +4 -2
  99. package/packages/layout-body/src/layout-body.ts +4 -2
  100. package/packages/layout-container/src/layout-container.ts +13 -3
  101. package/packages/list/src/list.ts +85 -241
  102. package/packages/menu/src/menu.ts +3 -1
  103. package/packages/modal/src/modal.ts +3 -1
  104. package/packages/scrollbar/src/scrollbar.ts +32 -199
  105. package/packages/select/src/select.ts +304 -11
  106. package/packages/tabs/src/tabs.ts +4 -4
  107. package/packages/tooltip/src/tooltip.ts +10 -8
  108. package/packages/tree/src/tree.ts +90 -247
  109. package/styles/components/date-panel.scss +31 -29
  110. package/styles/components/icon-picker.scss +9 -3
  111. package/styles/components/select.scss +77 -0
  112. package/styles/components/tooltip.scss +1 -0
  113. package/types/components/card.d.ts +2 -2
  114. package/types/components/drawer.d.ts +2 -2
  115. package/types/components/gantt-module/gantt-view.d.ts +8 -17
  116. package/types/components/grid.d.ts +3 -2
  117. package/types/components/icon-picker.d.ts +21 -1
  118. package/types/components/layout-aside.d.ts +2 -2
  119. package/types/components/layout-body.d.ts +2 -2
  120. package/types/components/layout-container.d.ts +3 -1
  121. package/types/components/list.d.ts +6 -2
  122. package/types/components/menu.d.ts +2 -2
  123. package/types/components/modal.d.ts +2 -2
  124. package/types/components/scrollbar.d.ts +17 -14
  125. package/types/components/select.d.ts +28 -3
  126. package/types/components/table.d.ts +26 -22
  127. package/types/components/tabs.d.ts +2 -2
  128. package/types/components/tooltip.d.ts +2 -2
  129. package/types/components/tree.d.ts +8 -17
  130. /package/es/icon/{iconfont.1792115554173.ttf → iconfont.1792219842866.ttf} +0 -0
  131. /package/es/icon/{iconfont.1792115554173.woff → iconfont.1792219842866.woff} +0 -0
  132. /package/es/icon/{iconfont.1792115554173.woff2 → iconfont.1792219842866.woff2} +0 -0
  133. /package/es/{iconfont.1792115554173.ttf → iconfont.1792219842866.ttf} +0 -0
  134. /package/es/{iconfont.1792115554173.woff → iconfont.1792219842866.woff} +0 -0
  135. /package/es/{iconfont.1792115554173.woff2 → iconfont.1792219842866.woff2} +0 -0
  136. /package/lib/icon/style/{iconfont.1792115554173.ttf → iconfont.1792219842866.ttf} +0 -0
  137. /package/lib/icon/style/{iconfont.1792115554173.woff → iconfont.1792219842866.woff} +0 -0
  138. /package/lib/icon/style/{iconfont.1792115554173.woff2 → iconfont.1792219842866.woff2} +0 -0
  139. /package/lib/{iconfont.1792115554173.ttf → iconfont.1792219842866.ttf} +0 -0
  140. /package/lib/{iconfont.1792115554173.woff → iconfont.1792219842866.woff} +0 -0
  141. /package/lib/{iconfont.1792115554173.woff2 → iconfont.1792219842866.woff2} +0 -0
@@ -11,11 +11,9 @@ import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime'
11
11
  import { getItemCacheObj } from './util'
12
12
  import VxeLoadingComponent from '../../loading'
13
13
 
14
- import type { VxeListPropTypes, VxeListEmits, VxeComponentSizeType, ListReactData, VxeListDefines, ValueOf, ListInternalData, VxeListConstructor, VxeListPrivateMethods, VxeComponentStyleType, VxeScrollbarPropTypes } from '../../../types'
14
+ import type { VxeListPropTypes, VxeListEmits, ListReactData, VxeListDefines, ValueOf, ListInternalData, VxeListConstructor, VxeListPrivateMethods, VxeComponentStyleType, VxeScrollbarPropTypes, VxeUseSizeComputed, VxeUseVScrollbarComputed, VxeUseInitVScrollbarComputed } from '../../../types'
15
15
 
16
- const { getConfig, getIcon, getI18n, domUtils, scrollbarUtils, menus, globalEvents, globalResize } = VxeUI
17
-
18
- const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils
16
+ const { getConfig, getIcon, getI18n, domUtils, menus, globalEvents, globalResize } = VxeUI
19
17
 
20
18
  const { warnLog, errLog } = createComponentLog('tree')
21
19
 
@@ -106,7 +104,9 @@ function createInternalData (): ListInternalData {
106
104
  export default /* define-vxe-component start */ defineVxeComponent({
107
105
  name: 'VxeList',
108
106
  mixins: [
109
- globalMixins.sizeMixin
107
+ globalMixins.sizeMixin,
108
+ globalMixins.vScrollbarMixin,
109
+ globalMixins.initVScrollbarMixin
110
110
  ],
111
111
  props: {
112
112
  data: Array as PropType<VxeListPropTypes.Data>,
@@ -162,13 +162,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
162
162
  reactData,
163
163
  crossListDragRowInfo: crossListDragRowGlobal,
164
164
 
165
- reFlag: 0
165
+ reLayoutFlag: 0,
166
+ reScrollFlag: 0
166
167
  }
167
168
  },
168
169
  computed: {
169
- ...({} as {
170
- computeSize(): VxeComponentSizeType
171
- }),
170
+ ...({} as VxeUseSizeComputed & VxeUseVScrollbarComputed & VxeUseInitVScrollbarComputed),
172
171
  computeRowOpts () {
173
172
  const $xeList = this
174
173
  const props = $xeList
@@ -384,6 +383,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
384
383
  }
385
384
  return []
386
385
  },
386
+ getScrollViewElem () {
387
+ const $xeList = this
388
+
389
+ const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
390
+ return viewEl || null
391
+ },
387
392
  getRowId (row: any) {
388
393
  const $xeList = this
389
394
 
@@ -702,8 +707,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
702
707
  updateScrollbar () {
703
708
  const $xeList = this
704
709
 
705
- $xeList.updateThumbSize()
706
- $xeList.updateThumbOffset()
710
+ const isVScrollbar = $xeList.computeIsVScrollbar
711
+ if (isVScrollbar) {
712
+ return $xeList.$nextTick().then(() => {
713
+ $xeList.updateThumbSize()
714
+ $xeList.updateThumbOffset()
715
+ })
716
+ }
717
+ return Promise.resolve()
707
718
  },
708
719
  /**
709
720
  * 重新计算列表
@@ -725,10 +736,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
725
736
  parentHeight = parentEl.clientHeight - Math.ceil(XEUtils.toNumber(parentStyle.paddingLeft) + XEUtils.toNumber(parentStyle.paddingRight))
726
737
  }
727
738
  reactData.parentHeight = parentHeight
728
- $xeList.updateScrollbar()
729
739
  $xeList.updateHeight()
730
740
  if (el.clientWidth && el.clientHeight) {
731
- return $xeList.computeScrollLoad()
741
+ return $xeList.computeScrollLoad().then(() => {
742
+ $xeList.updateScrollbar()
743
+ })
732
744
  }
733
745
  }
734
746
  return $xeList.$nextTick()
@@ -739,7 +751,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
739
751
 
740
752
  const { scrollYStore } = internalData
741
753
  const { startIndex, endIndex, visibleSize, offsetSize, rowHeight } = scrollYStore
742
- const scrollBodyElem = evnt.target as HTMLDivElement
754
+ const scrollBodyElem = evnt.currentTarget as HTMLDivElement
743
755
  const scrollTop = scrollBodyElem.scrollTop
744
756
  const toVisibleIndex = Math.floor(scrollTop / rowHeight)
745
757
  const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize)
@@ -757,7 +769,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
757
769
  const reactData = $xeList.reactData
758
770
  const internalData = $xeList.internalData
759
771
 
760
- const scrollBodyElem = evnt.target as HTMLDivElement
772
+ const scrollBodyElem = evnt.currentTarget as HTMLDivElement
761
773
  const scrollTop = scrollBodyElem.scrollTop
762
774
  const scrollLeft = scrollBodyElem.scrollLeft
763
775
  const isX = scrollLeft !== internalData.lastScrollLeft
@@ -2086,197 +2098,27 @@ export default /* define-vxe-component start */ defineVxeComponent({
2086
2098
  $xeList.dispatchEvent('row-menu', { row }, evnt)
2087
2099
  },
2088
2100
  // 滚动条
2089
- updateThumbSize () {
2090
- const $xeList = this
2091
- const reactData = $xeList.reactData
2092
-
2093
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2094
- if (!viewEl) {
2095
- return
2096
- }
2097
- if (!viewEl.clientHeight || !viewEl.clientHeight) {
2098
- return
2099
- }
2100
- const trackXEl = $xeList.$refs.refTrackXElem as HTMLDivElement
2101
- const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0
2102
- const thumbXElem = $xeList.$refs.refThumbXElem as HTMLDivElement
2103
- if (thumbXElem) {
2104
- thumbXElem.style.width = xThumbWidth + 'px'
2105
- }
2106
- reactData.xThumbWidth = xThumbWidth
2107
-
2108
- const trackYEl = $xeList.$refs.refTrackYElem as HTMLDivElement
2109
-
2110
- const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0
2111
- const thumbYElem = $xeList.$refs.refThumbYElem as HTMLDivElement
2112
- if (thumbYElem) {
2113
- thumbYElem.style.height = yThumbHeight + 'px'
2114
- }
2115
- reactData.yThumbHeight = yThumbHeight
2116
- },
2117
- updateThumbOffset () {
2101
+ bindScrollbarResize () {
2118
2102
  const $xeList = this
2119
- const reactData = $xeList.reactData
2120
2103
  const internalData = $xeList.internalData
2121
2104
 
2122
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2123
- if (!viewEl) {
2124
- return
2125
- }
2126
- if (!viewEl.clientHeight || !viewEl.clientHeight) {
2127
- return
2128
- }
2129
- const { xThumbWidth, yThumbHeight } = reactData
2130
- const trackXEl = $xeList.$refs.refTrackXElem as HTMLDivElement
2131
- const thumbXElem = $xeList.$refs.refThumbXElem as HTMLDivElement
2132
- const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0
2133
- internalData.xThumbLeft = xThumbLeft
2134
- if (thumbXElem && xThumbWidth) {
2135
- thumbXElem.style.width = xThumbWidth + 'px'
2136
- thumbXElem.style.transform = `translateX(${xThumbLeft}px)`
2137
- }
2138
-
2139
- const trackYEl = $xeList.$refs.refTrackYElem as HTMLDivElement
2140
- const thumbYElem = $xeList.$refs.refThumbYElem as HTMLDivElement
2141
- const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0
2142
- internalData.yThumbTop = yThumbTop
2143
- if (thumbYElem && yThumbHeight) {
2144
- thumbYElem.style.height = yThumbHeight + 'px'
2145
- thumbYElem.style.transform = `translateY(${yThumbTop}px)`
2146
- }
2147
- },
2148
- clickTrackXEvent (evnt: MouseEvent) {
2149
- const $xeList = this
2150
- const reactData = $xeList.reactData
2151
-
2152
- const trackEl = evnt.currentTarget as HTMLDivElement
2153
- if (trackEl !== evnt.target) {
2154
- return
2155
- }
2156
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2157
- if (!viewEl) {
2158
- return
2159
- }
2160
- const { xThumbWidth } = reactData
2161
- const trackRect = trackEl.getBoundingClientRect()
2162
- viewEl.scrollTo({
2163
- left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
2164
- behavior: 'auto'
2165
- })
2166
- },
2167
- clickTrackYEvent (evnt: MouseEvent) {
2168
- const $xeList = this
2169
- const reactData = $xeList.reactData
2170
-
2171
- const trackEl = evnt.currentTarget as HTMLDivElement
2172
- if (trackEl !== evnt.target) {
2173
- return
2174
- }
2175
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2176
- if (!viewEl) {
2177
- return
2178
- }
2179
- const { yThumbHeight } = reactData
2180
- const trackRect = trackEl.getBoundingClientRect()
2181
- viewEl.scrollTo({
2182
- top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
2183
- behavior: 'auto'
2184
- })
2185
- },
2186
- pointerdownThumbXEvent (evnt: PointerEvent) {
2187
- const $xeList = this
2188
- const reactData = $xeList.reactData
2189
- const internalData = $xeList.internalData
2190
-
2191
- const thumbEl = evnt.currentTarget as HTMLDivElement
2192
- internalData.isThumbDrag = true
2193
- thumbEl.setPointerCapture(evnt.pointerId)
2194
-
2195
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2196
- if (!viewEl) {
2197
- return
2198
- }
2199
- const { xThumbWidth } = reactData
2200
- const trackEl = thumbEl.parentElement as HTMLDivElement
2201
- const trackRect = trackEl.getBoundingClientRect()
2202
- const pointerPosition = evnt.clientX - trackRect.left
2203
- // 记录 thumb 的偏移
2204
- const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth)
2205
- internalData.thumbDragOffset = pointerPosition - thumbOffset
2206
- },
2207
- pointermoveThumbXEvent (evnt: PointerEvent) {
2208
- const $xeList = this
2209
- const reactData = $xeList.reactData
2210
- const internalData = $xeList.internalData
2211
-
2212
- const thumbEl = evnt.currentTarget as HTMLDivElement
2213
- if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
2214
- return
2215
- }
2216
- const { isThumbDrag, thumbDragOffset } = internalData
2217
- if (isThumbDrag) {
2218
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2219
- if (!viewEl) {
2220
- return
2221
- }
2222
- const { xThumbWidth } = reactData
2223
- const thumbEl = evnt.currentTarget as HTMLDivElement
2224
- const trackEl = thumbEl.parentElement as HTMLDivElement
2225
- const trackRect = trackEl.getBoundingClientRect()
2226
- // 更新偏移
2227
- viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth)
2228
- }
2229
- },
2230
- cleatPointerThumbEvent (evnt: PointerEvent) {
2231
- const $xeList = this
2232
- const internalData = $xeList.internalData
2233
-
2234
- const thumbEl = evnt.currentTarget as HTMLDivElement
2235
- thumbEl.releasePointerCapture(evnt.pointerId)
2236
- internalData.isThumbDrag = false
2237
- },
2238
- pointerdownThumbYEvent (evnt: PointerEvent) {
2239
- const $xeList = this
2240
- const reactData = $xeList.reactData
2241
- const internalData = $xeList.internalData
2242
-
2243
- const thumbEl = evnt.currentTarget as HTMLDivElement
2244
- internalData.isThumbDrag = true
2245
- thumbEl.setPointerCapture(evnt.pointerId)
2246
-
2247
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2248
- if (!viewEl) {
2249
- return
2250
- }
2251
- const { yThumbHeight } = reactData
2252
- const trackEl = thumbEl.parentElement as HTMLDivElement
2253
- const trackRect = trackEl.getBoundingClientRect()
2254
- const pointerPosition = evnt.clientY - trackRect.top
2255
- // 记录 thumb 的偏移
2256
- const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight)
2257
- internalData.thumbDragOffset = pointerPosition - thumbOffset
2258
- },
2259
- pointermoveThumbYEvent (evnt: PointerEvent) {
2260
- const $xeList = this
2261
- const reactData = $xeList.reactData
2262
- const internalData = $xeList.internalData
2263
-
2264
- const thumbEl = evnt.currentTarget as HTMLDivElement
2265
- if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
2266
- return
2267
- }
2268
- const { isThumbDrag, thumbDragOffset } = internalData
2269
- if (isThumbDrag) {
2270
- const viewEl = $xeList.$refs.refVirtualWrapper as HTMLDivElement
2271
- if (!viewEl) {
2272
- return
2105
+ const { scrollObserver } = internalData
2106
+ const isVScrollbar = $xeList.computeIsVScrollbar
2107
+ if (isVScrollbar) {
2108
+ if (!scrollObserver) {
2109
+ const el = $xeList.$refs.refElem as HTMLDivElement
2110
+ const viewInnerEl = $xeList.$refs.refVirtualSpaceElem as HTMLDivElement
2111
+ const scrollObserver = globalResize.create(() => {
2112
+ $xeList.reScrollFlag++
2113
+ })
2114
+ if (el) {
2115
+ scrollObserver.observe(el)
2116
+ }
2117
+ if (viewInnerEl) {
2118
+ scrollObserver.observe(viewInnerEl)
2119
+ }
2120
+ internalData.scrollObserver = scrollObserver
2273
2121
  }
2274
- const { yThumbHeight } = reactData
2275
- const thumbEl = evnt.currentTarget as HTMLDivElement
2276
- const trackEl = thumbEl.parentElement as HTMLDivElement
2277
- const trackRect = trackEl.getBoundingClientRect()
2278
- // 更新偏移
2279
- viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight)
2280
2122
  }
2281
2123
  },
2282
2124
 
@@ -2543,12 +2385,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
2543
2385
  const reactData = $xeList.reactData
2544
2386
  const slots = $xeList.$scopedSlots
2545
2387
 
2546
- const { showCheckbox, className, loading, useScrollbar } = props
2388
+ const { showCheckbox, className, loading } = props
2547
2389
  const { bodyHeight, topSpaceHeight, rowList, isAllChecked, isAllIndeterminate, xThumbWidth, yThumbHeight } = reactData
2548
2390
  const defaultSlot = slots.default
2549
2391
  const headerSlot = slots.header
2550
2392
  const footerSlot = slots.footer
2551
2393
  const vSize = $xeList.computeSize
2394
+ const isVScrollbar = $xeList.computeIsVScrollbar
2552
2395
  const wrapperStyles = $xeList.computeWrapperStyles
2553
2396
  const virtualStyles = $xeList.computeVirtualStyles
2554
2397
  const radioOpts = $xeList.computeRadioOpts
@@ -2578,17 +2421,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
2578
2421
  ref: 'refElem',
2579
2422
  class: [
2580
2423
  'vxe-list',
2581
- useScrollbar ? `ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}` : '',
2582
- useScrollbar ? `ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}` : '',
2583
- useScrollbar ? `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}` : '',
2584
- useScrollbar ? `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}` : '',
2424
+ isVScrollbar ? `ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}` : '',
2425
+ isVScrollbar ? `ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}` : '',
2426
+ isVScrollbar ? `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}` : '',
2427
+ isVScrollbar ? `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}` : '',
2585
2428
  className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '',
2586
2429
  {
2587
2430
  [`size--${vSize}`]: vSize,
2588
- 'is--virtual-scrollbar': useScrollbar,
2589
- 'ov-padding': useScrollbar && scrollbarOpts.padding,
2590
- 'ov-x--auto-hide': useScrollbar && scrollXAutoHide,
2591
- 'ov-y--auto-hide': useScrollbar && scrollYAutoHide,
2431
+ 'is--virtual-scrollbar': isVScrollbar,
2432
+ 'ov-padding': isVScrollbar && scrollbarOpts.padding,
2433
+ 'ov-x--auto-hide': isVScrollbar && scrollXAutoHide,
2434
+ 'ov-y--auto-hide': isVScrollbar && scrollYAutoHide,
2592
2435
  'overflow-y': yThumbHeight,
2593
2436
  'overflow-x': xThumbWidth,
2594
2437
  'is--drag': isDrag,
@@ -2638,6 +2481,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
2638
2481
  }
2639
2482
  }, [
2640
2483
  h('div', {
2484
+ ref: 'refVirtualSpaceElem',
2641
2485
  class: 'vxe-list--y-space',
2642
2486
  style: {
2643
2487
  height: bodyHeight ? `${bodyHeight}px` : ''
@@ -2666,7 +2510,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
2666
2510
  /**
2667
2511
  * 滚动条
2668
2512
  */
2669
- useScrollbar
2513
+ isVScrollbar
2670
2514
  ? h('div', {
2671
2515
  class: scrollbarWrapperClss
2672
2516
  }, [
@@ -2740,59 +2584,71 @@ export default /* define-vxe-component start */ defineVxeComponent({
2740
2584
  height () {
2741
2585
  const $xeList = this
2742
2586
 
2743
- $xeList.reFlag++
2587
+ $xeList.reLayoutFlag++
2744
2588
  },
2745
2589
  maxHeight () {
2746
2590
  const $xeList = this
2747
2591
 
2748
- $xeList.reFlag++
2592
+ $xeList.reLayoutFlag++
2749
2593
  },
2750
2594
  syncResize () {
2751
2595
  const $xeList = this
2752
2596
 
2753
- $xeList.reFlag++
2597
+ $xeList.reLayoutFlag++
2754
2598
  },
2755
- useScrollbar () {
2599
+ computeIsVScrollbar () {
2756
2600
  const $xeList = this
2757
2601
 
2758
- $xeList.reFlag++
2602
+ $xeList.$nextTick(() => {
2603
+ $xeList.bindScrollbarResize()
2604
+ $xeList.$nextTick(() => {
2605
+ $xeList.reLayoutFlag++
2606
+ })
2607
+ })
2759
2608
  },
2760
2609
  computeRowHeight () {
2761
2610
  const $xeList = this
2762
2611
 
2763
- $xeList.reFlag++
2612
+ $xeList.reLayoutFlag++
2764
2613
  },
2765
2614
  computeScrollYWidth () {
2766
2615
  const $xeList = this
2767
2616
 
2768
- $xeList.reFlag++
2617
+ $xeList.reLayoutFlag++
2769
2618
  },
2770
2619
  computeScrollXHeight () {
2771
2620
  const $xeList = this
2772
2621
 
2773
- $xeList.reFlag++
2622
+ $xeList.reLayoutFlag++
2774
2623
  },
2775
2624
  computeScrollXVisible () {
2776
2625
  const $xeList = this
2777
2626
 
2778
2627
  $xeList.$nextTick(() => {
2779
- $xeList.reFlag++
2628
+ $xeList.reLayoutFlag++
2780
2629
  })
2781
2630
  },
2782
2631
  computeScrollYVisible () {
2783
2632
  const $xeList = this
2784
2633
 
2785
2634
  $xeList.$nextTick(() => {
2786
- $xeList.reFlag++
2635
+ $xeList.reLayoutFlag++
2787
2636
  })
2788
2637
  },
2789
- reFlag () {
2638
+ reLayoutFlag () {
2790
2639
  const $xeList = this
2791
2640
 
2792
2641
  $xeList.recalculate().then(() => {
2793
2642
  $xeList.recalculate()
2794
2643
  })
2795
2644
  },
2645
+ reScrollFlag () {
2646
+ const $xeList = this
2647
+
2648
+ $xeList.updateScrollbar().then(() => {
2649
+ $xeList.updateScrollbar()
2650
+ })
2651
+ },
2796
2652
  checkRowKey () {
2797
2653
  const $xeList = this
2798
2654
 
@@ -2818,7 +2674,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
2818
2674
  const props = $xeList
2819
2675
  const internalData = $xeList.internalData
2820
2676
 
2821
- const { showSeq, showRadio, showCheckbox, autoResize, useScrollbar } = props
2677
+ const { showSeq, showRadio, showCheckbox, autoResize } = props
2822
2678
  const rowOpts = $xeList.computeRowOpts
2823
2679
  const { useKey, keyField } = rowOpts
2824
2680
  const isDrag = $xeList.computeIsDrag
@@ -2839,25 +2695,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
2839
2695
  if (useKey && !keyField) {
2840
2696
  errLog('vxe.error.reqSupportProp', ['row-config.useKey', 'row-config.keyField'])
2841
2697
  }
2842
- const el = $xeList.$refs.refElem as HTMLDivElement
2843
- if (useScrollbar) {
2844
- const viewInnerEl = $xeList.$refs.refVirtualBody as HTMLDivElement
2845
- const scrollObserver = globalResize.create(() => {
2846
- $xeList.reFlag++
2847
- })
2848
- if (el) {
2849
- scrollObserver.observe(el)
2850
- }
2851
- if (viewInnerEl) {
2852
- scrollObserver.observe(viewInnerEl)
2853
- }
2854
- internalData.scrollObserver = scrollObserver
2855
- }
2856
2698
  if (autoResize) {
2699
+ const el = $xeList.$refs.refElem as HTMLDivElement
2857
2700
  const parentEl = $xeList.getParentElem()
2858
2701
  const resizeObserver = globalResize.create(() => {
2859
2702
  if (props.autoResize) {
2860
- $xeList.reFlag++
2703
+ $xeList.reLayoutFlag++
2861
2704
  }
2862
2705
  })
2863
2706
  if (el) {
@@ -2869,9 +2712,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
2869
2712
  }
2870
2713
  internalData.resizeObserver = resizeObserver
2871
2714
  }
2872
- $xeList.reFlag++
2715
+ $xeList.reLayoutFlag++
2716
+ $xeList.bindScrollbarResize()
2873
2717
  globalEvents.on($xeList, 'resize', () => {
2874
- $xeList.reFlag++
2718
+ $xeList.reLayoutFlag++
2875
2719
  })
2876
2720
  },
2877
2721
  activated () {
@@ -9,7 +9,7 @@ import { createComponentLog } from '../../ui/src/log'
9
9
  import VxeLoadingComponent from '../../loading'
10
10
  import VxeScrollbarComponent from '../../scrollbar'
11
11
 
12
- import type { VxeMenuDefines, MenuInternalData, MenuReactData, VxeMenuPropTypes, VxeLayoutAsideConstructor, VxeMenuEmits, VxeLayoutAsidePropTypes, VxeComponentPermissionInfo, VxeComponentSizeType, ValueOf, VxeScrollbarInstance } from '../../../types'
12
+ import type { VxeMenuDefines, MenuInternalData, MenuReactData, VxeMenuPropTypes, VxeLayoutAsideConstructor, VxeMenuEmits, VxeLayoutAsidePropTypes, VxeComponentPermissionInfo, VxeComponentSizeType, ValueOf, VxeScrollbarInstance, VxeComponentIsVScrollbar } from '../../../types'
13
13
 
14
14
  const { errLog } = createComponentLog('menu')
15
15
 
@@ -43,6 +43,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
43
43
  name: 'VxeMenu',
44
44
  mixins: [
45
45
  globalMixins.sizeMixin,
46
+ globalMixins.vScrollbarMixin,
46
47
  globalMixins.permissionMixin
47
48
  ],
48
49
  props: {
@@ -105,6 +106,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
105
106
  ...({} as {
106
107
  computePermissionInfo(): VxeComponentPermissionInfo
107
108
  computeSize(): VxeComponentSizeType
109
+ computeIsVScrollbar(): VxeComponentIsVScrollbar
108
110
  $xeLayoutAside(): VxeLayoutAsideConstructor | null
109
111
  }),
110
112
  computePropsOpts () {
@@ -11,7 +11,7 @@ import VxeButtonComponent from '../../button'
11
11
  import VxeLoadingComponent from '../../loading'
12
12
  import VxeScrollbarComponent from '../../scrollbar'
13
13
 
14
- import type { VxeModalConstructor, VxeModalPropTypes, ModalReactData, ModalInternalData, VxeModalMethods, ModalEventTypes, VxeModalEmits, VxeComponentSizeType, VxeComponentPermissionInfo, ValueOf, VxeButtonConstructor, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods } from '../../../types'
14
+ import type { VxeModalConstructor, VxeModalPropTypes, ModalReactData, ModalInternalData, VxeModalMethods, ModalEventTypes, VxeModalEmits, VxeComponentSizeType, VxeComponentPermissionInfo, ValueOf, VxeButtonConstructor, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeComponentIsVScrollbar } from '../../../types'
15
15
  import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
16
16
 
17
17
  const { warnLog, errLog } = createComponentLog('modal')
@@ -49,6 +49,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
49
49
  name: 'VxeModal',
50
50
  mixins: [
51
51
  globalMixins.sizeMixin,
52
+ globalMixins.vScrollbarMixin,
52
53
  globalMixins.permissionMixin
53
54
  ],
54
55
  props: {
@@ -284,6 +285,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
284
285
  ...({} as {
285
286
  computePermissionInfo(): VxeComponentPermissionInfo
286
287
  computeSize(): VxeComponentSizeType
288
+ computeIsVScrollbar(): VxeComponentIsVScrollbar
287
289
  $xeParentModal(): (VxeModalConstructor & VxeModalMethods) | null
288
290
  $xeDrawer(): (VxeDrawerConstructor & VxeDrawerMethods) | null
289
291
  $xeTable(): (VxeTableConstructor & VxeTablePrivateMethods) | null