vxe-pc-ui 4.20.1 → 4.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 (96) hide show
  1. package/dist/all.esm.js +226 -83
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/card/src/card.js +2 -1
  5. package/es/drawer/src/drawer.js +59 -15
  6. package/es/drawer/style.css +13 -6
  7. package/es/drawer/style.min.css +1 -1
  8. package/es/icon/style.css +1 -1
  9. package/es/layout-aside/src/layout-aside.js +2 -1
  10. package/es/layout-body/src/layout-body.js +2 -1
  11. package/es/list/src/list.js +49 -23
  12. package/es/menu/src/menu.js +2 -2
  13. package/es/modal/src/modal.js +56 -12
  14. package/es/modal/style.css +15 -4
  15. package/es/modal/style.min.css +1 -1
  16. package/es/scrollbar/src/scrollbar.js +16 -4
  17. package/es/style.css +1 -1
  18. package/es/style.min.css +1 -1
  19. package/es/tabs/src/tabs.js +2 -2
  20. package/es/tree/src/tree.js +43 -24
  21. package/es/ui/index.js +1 -1
  22. package/es/ui/src/log.js +1 -1
  23. package/es/vxe-drawer/style.css +13 -6
  24. package/es/vxe-drawer/style.min.css +1 -1
  25. package/es/vxe-modal/style.css +15 -4
  26. package/es/vxe-modal/style.min.css +1 -1
  27. package/lib/card/src/card.js +2 -1
  28. package/lib/card/src/card.min.js +1 -1
  29. package/lib/drawer/src/drawer.js +64 -11
  30. package/lib/drawer/src/drawer.min.js +1 -1
  31. package/lib/drawer/style/style.css +13 -6
  32. package/lib/drawer/style/style.min.css +1 -1
  33. package/lib/icon/style/style.css +1 -1
  34. package/lib/icon/style/style.min.css +1 -1
  35. package/lib/index.umd.js +318 -84
  36. package/lib/index.umd.min.js +1 -1
  37. package/lib/layout-aside/src/layout-aside.js +2 -1
  38. package/lib/layout-aside/src/layout-aside.min.js +1 -1
  39. package/lib/layout-body/src/layout-body.js +2 -1
  40. package/lib/layout-body/src/layout-body.min.js +1 -1
  41. package/lib/list/src/list.js +49 -24
  42. package/lib/list/src/list.min.js +1 -1
  43. package/lib/menu/src/menu.js +1 -1
  44. package/lib/menu/src/menu.min.js +1 -1
  45. package/lib/modal/src/modal.js +61 -10
  46. package/lib/modal/src/modal.min.js +1 -1
  47. package/lib/modal/style/style.css +15 -4
  48. package/lib/modal/style/style.min.css +1 -1
  49. package/lib/scrollbar/src/scrollbar.js +16 -4
  50. package/lib/scrollbar/src/scrollbar.min.js +1 -1
  51. package/lib/style.css +1 -1
  52. package/lib/style.min.css +1 -1
  53. package/lib/tabs/src/tabs.js +1 -1
  54. package/lib/tabs/src/tabs.min.js +1 -1
  55. package/lib/tree/src/tree.js +43 -25
  56. package/lib/tree/src/tree.min.js +1 -1
  57. package/lib/ui/index.js +1 -1
  58. package/lib/ui/index.min.js +1 -1
  59. package/lib/ui/src/log.js +1 -1
  60. package/lib/ui/src/log.min.js +1 -1
  61. package/lib/vxe-drawer/style/style.css +13 -6
  62. package/lib/vxe-drawer/style/style.min.css +1 -1
  63. package/lib/vxe-modal/style/style.css +15 -4
  64. package/lib/vxe-modal/style/style.min.css +1 -1
  65. package/package.json +2 -2
  66. package/packages/card/src/card.ts +2 -1
  67. package/packages/drawer/src/drawer.ts +73 -16
  68. package/packages/layout-aside/src/layout-aside.ts +2 -1
  69. package/packages/layout-body/src/layout-body.ts +2 -1
  70. package/packages/list/src/list.ts +53 -23
  71. package/packages/menu/src/menu.ts +2 -2
  72. package/packages/modal/src/modal.ts +71 -14
  73. package/packages/scrollbar/src/scrollbar.ts +18 -4
  74. package/packages/tabs/src/tabs.ts +2 -2
  75. package/packages/tree/src/tree.ts +46 -24
  76. package/styles/components/drawer.scss +13 -6
  77. package/styles/components/modal.scss +12 -4
  78. package/types/components/drawer.d.ts +20 -0
  79. package/types/components/gantt-module/gantt-view.d.ts +24 -1
  80. package/types/components/gantt.d.ts +2 -0
  81. package/types/components/list.d.ts +3 -1
  82. package/types/components/modal.d.ts +20 -0
  83. package/types/components/table.d.ts +33 -2
  84. package/types/components/tree.d.ts +3 -1
  85. /package/es/icon/{iconfont.1791950625324.ttf → iconfont.1792034967421.ttf} +0 -0
  86. /package/es/icon/{iconfont.1791950625324.woff → iconfont.1792034967421.woff} +0 -0
  87. /package/es/icon/{iconfont.1791950625324.woff2 → iconfont.1792034967421.woff2} +0 -0
  88. /package/es/{iconfont.1791950625324.ttf → iconfont.1792034967421.ttf} +0 -0
  89. /package/es/{iconfont.1791950625324.woff → iconfont.1792034967421.woff} +0 -0
  90. /package/es/{iconfont.1791950625324.woff2 → iconfont.1792034967421.woff2} +0 -0
  91. /package/lib/icon/style/{iconfont.1791950625324.ttf → iconfont.1792034967421.ttf} +0 -0
  92. /package/lib/icon/style/{iconfont.1791950625324.woff → iconfont.1792034967421.woff} +0 -0
  93. /package/lib/icon/style/{iconfont.1791950625324.woff2 → iconfont.1792034967421.woff2} +0 -0
  94. /package/lib/{iconfont.1791950625324.ttf → iconfont.1792034967421.ttf} +0 -0
  95. /package/lib/{iconfont.1791950625324.woff → iconfont.1792034967421.woff} +0 -0
  96. /package/lib/{iconfont.1791950625324.woff2 → iconfont.1792034967421.woff2} +0 -0
@@ -2,13 +2,14 @@ import { h, Teleport, ref, Ref, inject, computed, reactive, provide, nextTick, w
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { getEventTargetNode, getPopupContainer, getPopupWrapperElement, isScale, toCssUnit } from '../../ui/src/dom'
5
- import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue } from '../../ui/src/utils'
5
+ import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { VxeUI, getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent, useSize, renderEmptyElement } from '../../ui'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
  import { createComponentLog } from '../../ui/src/log'
9
9
  import { allActiveModals } from './store'
10
10
  import VxeButtonComponent from '../../button'
11
11
  import VxeLoadingComponent from '../../loading'
12
+ import VxeScrollbarComponent from '../../scrollbar'
12
13
 
13
14
  import type { VxeModalConstructor, VxeModalPropTypes, ModalReactData, ModalInternalData, VxeModalEmits, VxeModalPrivateComputed, ModalEventTypes, VxeButtonInstance, ModalMethods, ModalPrivateRef, VxeModalMethods, ValueOf, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods } from '../../../types'
14
15
  import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
@@ -223,6 +224,11 @@ export default defineVxeComponent({
223
224
  },
224
225
  beforeHideMethod: Function as PropType<VxeModalPropTypes.BeforeHideMethod>,
225
226
  slots: Object as PropType<VxeModalPropTypes.Slots>,
227
+ useScrollbar: {
228
+ type: Boolean as PropType<VxeModalPropTypes.UseScrollbar>,
229
+ default: () => getDefaultConfig(getConfig().modal.useScrollbar, getConfig().useScrollbar)
230
+ },
231
+ scrollbarConfig: Object as PropType<VxeModalPropTypes.ScrollbarConfig>,
226
232
 
227
233
  /**
228
234
  * 已废弃
@@ -310,6 +316,27 @@ export default defineVxeComponent({
310
316
  return Object.assign({}, getConfig().modal.zoomConfig, props.zoomConfig)
311
317
  })
312
318
 
319
+ const computeScrollbarOpts = computed(() => {
320
+ return Object.assign({}, getConfig().modal.scrollbarConfig, props.scrollbarConfig)
321
+ })
322
+
323
+ const computeScrollbarProps = computed(() => {
324
+ const scrollbarOpts = computeScrollbarOpts.value
325
+ const { viewClassName, viewInnerClassName } = scrollbarOpts
326
+ return {
327
+ width: scrollbarOpts.width,
328
+ height: scrollbarOpts.height,
329
+ autoHide: scrollbarOpts.autoHide,
330
+ visible: scrollbarOpts.visible,
331
+ xConfig: scrollbarOpts.xConfig,
332
+ yConfig: scrollbarOpts.yConfig,
333
+ className: scrollbarOpts.className,
334
+ viewAttrs: scrollbarOpts.viewAttrs,
335
+ viewClassName: 'vxe-modal--scrollbar-content-view' + (viewClassName ? (' ' + viewClassName) : ''),
336
+ viewInnerClassName: 'vxe-modal--scrollbar-content-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
337
+ }
338
+ })
339
+
313
340
  const computeMaps: VxeModalPrivateComputed = {
314
341
  computeSize,
315
342
  computeZoomOpts
@@ -1371,9 +1398,10 @@ export default defineVxeComponent({
1371
1398
  }
1372
1399
 
1373
1400
  const renderBody = () => {
1374
- const { slots: propSlots = {}, status, message, iconStatus, useHtml } = props
1401
+ const { slots: propSlots = {}, status, message, iconStatus, useScrollbar, useHtml } = props
1375
1402
  const content = props.content || message
1376
1403
  const isMsg = computeIsMsg.value
1404
+ const scrollbarProps = computeScrollbarProps.value
1377
1405
  const defaultSlot = slots.default || propSlots.default
1378
1406
  const leftSlot = slots.left || propSlots.left
1379
1407
  const rightSlot = slots.right || propSlots.right
@@ -1389,18 +1417,47 @@ export default defineVxeComponent({
1389
1417
  ])
1390
1418
  )
1391
1419
  }
1392
- contVNs.push(
1393
- useHtml && !defaultSlot
1394
- ? h('div', {
1395
- key: 'hc',
1396
- class: 'vxe-modal--content',
1397
- innerHTML: getFuncText(content)
1398
- })
1399
- : h('div', {
1400
- key: 'dc',
1401
- class: 'vxe-modal--content'
1402
- }, defaultSlot ? getSlotVNs(defaultSlot({ $modal: $xeModal })) : getFuncText(content))
1403
- )
1420
+
1421
+ if (useHtml && !defaultSlot) {
1422
+ contVNs.push(
1423
+ useScrollbar
1424
+ ? h(VxeScrollbarComponent, {
1425
+ key: 'shc',
1426
+ class: 'vxe-modal--scrollbar-content',
1427
+ ...scrollbarProps
1428
+ }, {
1429
+ default () {
1430
+ return [
1431
+ h('div', {
1432
+ class: 'vxe-modal--scrollbar-content-html',
1433
+ innerHTML: getFuncText(content)
1434
+ })
1435
+ ]
1436
+ }
1437
+ })
1438
+ : h('div', {
1439
+ key: 'hc',
1440
+ class: 'vxe-modal--content',
1441
+ innerHTML: getFuncText(content)
1442
+ })
1443
+ )
1444
+ } else {
1445
+ contVNs.push(
1446
+ useScrollbar
1447
+ ? h(VxeScrollbarComponent, {
1448
+ key: 'sdc',
1449
+ class: 'vxe-modal--scrollbar-content',
1450
+ ...scrollbarProps
1451
+ }, {
1452
+ default: () => defaultSlot ? getSlotVNs(defaultSlot({ $modal: $xeModal })) : getFuncText(content)
1453
+ })
1454
+ : h('div', {
1455
+ key: 'dc',
1456
+ class: 'vxe-modal--content'
1457
+ }, defaultSlot ? getSlotVNs(defaultSlot({ $modal: $xeModal })) : getFuncText(content))
1458
+ )
1459
+ }
1460
+
1404
1461
  return h('div', {
1405
1462
  class: 'vxe-modal--body'
1406
1463
  }, [
@@ -105,10 +105,8 @@ export default defineVxeComponent({
105
105
 
106
106
  const computeWrapperStyle = computed(() => {
107
107
  const { width, height, minWidth, minHeight, maxWidth, maxHeight } = props
108
- const xOpts = computeXOpts.value
109
- const yOpts = computeYOpts.value
110
- const barWidth = yOpts.width
111
- const barHeight = xOpts.height
108
+ const barWidth = computeYWidth.value
109
+ const barHeight = computeXHeight.value
112
110
  const stys: VxeComponentStyleType = {}
113
111
  if (width) {
114
112
  stys.width = toCssUnit(width)
@@ -135,6 +133,16 @@ export default defineVxeComponent({
135
133
  return stys
136
134
  })
137
135
 
136
+ const computeXHeight = computed(() => {
137
+ const xOpts = computeXOpts.value
138
+ return xOpts.height
139
+ })
140
+
141
+ const computeYWidth = computed(() => {
142
+ const yOpts = computeYOpts.value
143
+ return yOpts.width
144
+ })
145
+
138
146
  const computeXVisible = computed(() => {
139
147
  const { visible } = props
140
148
  const xOpts = computeXOpts.value
@@ -642,6 +650,12 @@ export default defineVxeComponent({
642
650
  watch(() => props.syncResize, () => {
643
651
  reFlag.value++
644
652
  })
653
+ watch(computeYWidth, () => {
654
+ reFlag.value++
655
+ })
656
+ watch(computeXHeight, () => {
657
+ reFlag.value++
658
+ })
645
659
  watch(computeXVisible, () => {
646
660
  nextTick(() => {
647
661
  reFlag.value++
@@ -3,7 +3,7 @@ import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import { createEvent, getConfig, getIcon, globalEvents, permission, useSize, renderEmptyElement } from '../../ui'
4
4
  import { getSlotVNs } from '../../ui/src/vn'
5
5
  import { toCssUnit, addClass, removeClass } from '../../ui/src/dom'
6
- import { isEnableConf } from '../../ui/src/utils'
6
+ import { getDefaultConfig, isEnableConf } from '../../ui/src/utils'
7
7
  import { createComponentLog } from '../../ui/src/log'
8
8
  import XEUtils from 'xe-utils'
9
9
  import VxeLoadingComponent from '../../loading'
@@ -55,7 +55,7 @@ export default defineVxeComponent({
55
55
  },
56
56
  useScrollbar: {
57
57
  type: Boolean as PropType<VxeTabsPropTypes.UseScrollbar>,
58
- default: () => getConfig().tabs.useScrollbar
58
+ default: () => getDefaultConfig(getConfig().tabs.useScrollbar, getConfig().useScrollbar)
59
59
  },
60
60
  scrollbarConfig: Object as PropType<VxeTabsPropTypes.ScrollbarConfig>,
61
61
  // 已废弃
@@ -70,8 +70,10 @@ function createInternalData (): TreeInternalData {
70
70
  treeExpandedMaps: {},
71
71
  treeExpandLazyLoadedMaps: {},
72
72
 
73
- // 滚动条
74
73
  // resizeObserver: undefined,
74
+
75
+ // 滚动条
76
+ // scrollObserver: undefined,
75
77
  // isThumbDrag: false,
76
78
  thumbDragOffset: 0,
77
79
  yThumbTop: 0,
@@ -236,7 +238,7 @@ export default defineVxeComponent({
236
238
  virtualYConfig: Object as PropType<VxeTreePropTypes.VirtualYConfig>,
237
239
  useScrollbar: {
238
240
  type: Boolean as PropType<VxeTreePropTypes.UseScrollbar>,
239
- default: () => getConfig().tree.useScrollbar
241
+ default: () => getDefaultConfig(getConfig().tree.useScrollbar, getConfig().useScrollbar)
240
242
  },
241
243
  scrollbarConfig: Object as PropType<VxeTreePropTypes.ScrollbarConfig>
242
244
  },
@@ -373,11 +375,8 @@ export default defineVxeComponent({
373
375
  })
374
376
 
375
377
  const computeWrapperStyles = computed(() => {
376
- const scrollbarOpts = computeScrollbarOpts.value
377
- const scrollbarXOpts = computeScrollbarXOpts.value
378
- const scrollbarYOpts = computeScrollbarYOpts.value
379
- const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
380
- const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
378
+ const barWidth = computeScrollYWidth.value
379
+ const barHeight = computeScrollXHeight.value
381
380
  const stys: VxeComponentStyleType = {}
382
381
  if (barWidth || barHeight) {
383
382
  stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight)
@@ -436,6 +435,18 @@ export default defineVxeComponent({
436
435
  return Object.assign({}, getConfig().scrollbar.yConfig, scrollbarOpts.yConfig)
437
436
  })
438
437
 
438
+ const computeScrollXHeight = computed(() => {
439
+ const scrollbarOpts = computeScrollbarOpts.value
440
+ const scrollbarXOpts = computeScrollbarXOpts.value
441
+ return getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
442
+ })
443
+
444
+ const computeScrollYWidth = computed(() => {
445
+ const scrollbarOpts = computeScrollbarOpts.value
446
+ const scrollbarYOpts = computeScrollbarYOpts.value
447
+ return getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
448
+ })
449
+
439
450
  const computeScrollXVisible = computed(() => {
440
451
  const scrollbarOpts = computeScrollbarOpts.value
441
452
  const scrollbarXOpts = computeScrollbarXOpts.value
@@ -461,15 +472,11 @@ export default defineVxeComponent({
461
472
  })
462
473
 
463
474
  const computeScrollbarWrapperClss = computed(() => {
464
- const scrollbarOpts = computeScrollbarOpts.value
465
- const { padding } = scrollbarOpts
466
475
  const { yThumbHeight, xThumbWidth } = reactData
467
476
  const scrollbarXToTop = computeScrollbarXToTop.value
468
477
  const scrollbarYToLeft = computeScrollbarYToLeft.value
469
478
  const scrollXVisible = computeScrollXVisible.value
470
479
  const scrollYVisible = computeScrollYVisible.value
471
- const scrollXAutoHide = computeScrollXAutoHide.value
472
- const scrollYAutoHide = computeScrollYAutoHide.value
473
480
  return domUtils.buildClass([
474
481
  'vxe-scrollbar is--virtual',
475
482
  `ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
@@ -477,9 +484,6 @@ export default defineVxeComponent({
477
484
  `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
478
485
  `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
479
486
  ], {
480
- 'is--padding': padding,
481
- 'ov-x--auto-hide': scrollXAutoHide,
482
- 'ov-y--auto-hide': scrollYAutoHide,
483
487
  'overflow-y': yThumbHeight,
484
488
  'overflow-x': xThumbWidth
485
489
  })
@@ -3855,6 +3859,12 @@ export default defineVxeComponent({
3855
3859
  watch(() => props.useScrollbar, () => {
3856
3860
  reFlag.value++
3857
3861
  })
3862
+ watch(computeScrollYWidth, () => {
3863
+ reFlag.value++
3864
+ })
3865
+ watch(computeScrollXHeight, () => {
3866
+ reFlag.value++
3867
+ })
3858
3868
  watch(computeScrollXVisible, () => {
3859
3869
  nextTick(() => {
3860
3870
  reFlag.value++
@@ -3893,23 +3903,32 @@ export default defineVxeComponent({
3893
3903
  if (menuConfig && !VxeUIContextMenu) {
3894
3904
  errLog('vxe.error.reqComp', ['vxe-context-menu'])
3895
3905
  }
3906
+ const el = refElem.value
3896
3907
  if (useScrollbar || autoResize) {
3897
- const el = refElem.value
3898
3908
  const viewInnerEl = refVirtualBody.value
3909
+ const scrollObserver = globalResize.create(() => {
3910
+ updateScrollbar()
3911
+ })
3912
+ if (el) {
3913
+ scrollObserver.observe(el)
3914
+ }
3915
+ if (viewInnerEl) {
3916
+ scrollObserver.observe(viewInnerEl)
3917
+ }
3918
+ internalData.scrollObserver = scrollObserver
3919
+ }
3920
+ if (autoResize) {
3899
3921
  const parentEl = getParentElem()
3900
3922
  const resizeObserver = globalResize.create(() => {
3901
- reFlag.value++
3923
+ if (props.autoResize) {
3924
+ reFlag.value++
3925
+ }
3902
3926
  })
3903
3927
  if (el) {
3904
3928
  resizeObserver.observe(el)
3905
- if (autoResize) {
3906
- if (parentEl) {
3907
- resizeObserver.observe(parentEl)
3908
- }
3909
- }
3910
3929
  }
3911
- if (viewInnerEl) {
3912
- resizeObserver.observe(viewInnerEl)
3930
+ if (parentEl) {
3931
+ resizeObserver.observe(parentEl)
3913
3932
  }
3914
3933
  internalData.resizeObserver = resizeObserver
3915
3934
  }
@@ -3921,10 +3940,13 @@ export default defineVxeComponent({
3921
3940
  })
3922
3941
 
3923
3942
  onBeforeUnmount(() => {
3924
- const { resizeObserver } = internalData
3943
+ const { scrollObserver, resizeObserver } = internalData
3925
3944
  if (resizeObserver) {
3926
3945
  resizeObserver.disconnect()
3927
3946
  }
3947
+ if (scrollObserver) {
3948
+ scrollObserver.disconnect()
3949
+ }
3928
3950
  globalEvents.off($xeTree, 'resize')
3929
3951
  XEUtils.assign(reactData, createReactData())
3930
3952
  XEUtils.assign(internalData, createInternalData())
@@ -181,8 +181,8 @@
181
181
  &.is--drag {
182
182
  cursor: move;
183
183
  transition: none;
184
- .vxe-modal--body,
185
- .vxe-modal--footer {
184
+ .vxe-drawer--body,
185
+ .vxe-drawer--footer {
186
186
  &:after {
187
187
  content: "";
188
188
  position: absolute;
@@ -192,9 +192,10 @@
192
192
  height: 100%;
193
193
  }
194
194
  }
195
- .vxe-modal--body {
195
+ .vxe-drawer--body {
196
196
  overflow: hidden;
197
- .vxe-modal--content {
197
+ .vxe-drawer--content,
198
+ .vxe-drawer--scrollbar-content {
198
199
  overflow: hidden;
199
200
  }
200
201
  }
@@ -213,7 +214,8 @@
213
214
  overflow: auto;
214
215
  outline: 0;
215
216
  }
216
- .vxe-drawer--content {
217
+ .vxe-drawer--content,
218
+ .vxe-drawer--scrollbar-content {
217
219
  flex-grow: 1;
218
220
  white-space: pre-line;
219
221
  }
@@ -227,7 +229,8 @@
227
229
  flex-grow: 1;
228
230
  overflow: auto;
229
231
  outline: 0;
230
- .vxe-drawer--content {
232
+ .vxe-drawer--content,
233
+ .vxe-drawer--scrollbar-content {
231
234
  overflow: auto;
232
235
  }
233
236
  }
@@ -349,3 +352,7 @@
349
352
  overflow: hidden;
350
353
  }
351
354
  }
355
+
356
+ .vxe-drawer--scrollbar-content {
357
+ width: 100%;
358
+ }
@@ -52,7 +52,8 @@ html[data-vxe-lock-scroll] {
52
52
  }
53
53
  .vxe-modal--body {
54
54
  overflow: hidden;
55
- .vxe-modal--content {
55
+ .vxe-modal--content,
56
+ .vxe-modal--scrollbar-content {
56
57
  overflow: hidden;
57
58
  }
58
59
  }
@@ -74,7 +75,8 @@ html[data-vxe-lock-scroll] {
74
75
  align-items: center;
75
76
  font-size: 1.6em;
76
77
  }
77
- .vxe-modal--content {
78
+ .vxe-modal--content,
79
+ .vxe-modal--scrollbar-content {
78
80
  flex-grow: 1;
79
81
  white-space: pre-line;
80
82
  }
@@ -447,7 +449,8 @@ html[data-vxe-lock-scroll] {
447
449
  visibility: hidden;
448
450
  }
449
451
  }
450
- .vxe-modal--content {
452
+ .vxe-modal--content,
453
+ .vxe-modal--scrollbar-content {
451
454
  max-width: 800px;
452
455
  float: left;
453
456
  }
@@ -478,7 +481,8 @@ html[data-vxe-lock-scroll] {
478
481
  }
479
482
  .vxe-modal--body {
480
483
  overflow: auto;
481
- .vxe-modal--content {
484
+ .vxe-modal--content,
485
+ .vxe-modal--scrollbar-content {
482
486
  overflow: auto;
483
487
  }
484
488
  }
@@ -538,3 +542,7 @@ html[data-vxe-lock-scroll] {
538
542
  overflow: hidden;
539
543
  }
540
544
  }
545
+
546
+ .vxe-modal--scrollbar-content {
547
+ width: 100%;
548
+ }
@@ -1,5 +1,6 @@
1
1
  import { RenderFunction, SetupContext, Ref } from 'vue'
2
2
  import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, VxeComponentSizeType, VxeComponentSlotType, ValueOf } from '@vxe-ui/core'
3
+ import { VxeScrollbarProps } from './scrollbar'
3
4
 
4
5
  /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
5
6
 
@@ -73,6 +74,17 @@ export namespace VxeDrawerPropTypes {
73
74
  export type Padding = boolean
74
75
  export type BeforeHideMethod = (params: VxeDrawerDefines.DrawerVisibleParams) => Promise<any>
75
76
  export type Slots = VxeDrawerSlots
77
+ export type UseScrollbar = boolean
78
+ export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
79
+ /**
80
+ * 滚动条宽度
81
+ */
82
+ width?: number | string
83
+ /**
84
+ * 滚动条高度
85
+ */
86
+ height?: number | string
87
+ }
76
88
  }
77
89
 
78
90
  export interface VxeDrawerProps {
@@ -125,6 +137,14 @@ export interface VxeDrawerProps {
125
137
  padding?: VxeDrawerPropTypes.Padding
126
138
  beforeHideMethod?: VxeDrawerPropTypes.BeforeHideMethod
127
139
  slots?: VxeDrawerPropTypes.Slots
140
+ /**
141
+ * 使用虚拟滚动条
142
+ */
143
+ useScrollbar?: VxeDrawerPropTypes.UseScrollbar
144
+ /**
145
+ * 滚动条配置项
146
+ */
147
+ scrollbarConfig?: VxeDrawerPropTypes.ScrollbarConfig
128
148
  }
129
149
 
130
150
  export interface DrawerPrivateComputed {
@@ -2,6 +2,7 @@ import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue'
2
2
  import { VxeComponentBaseOptions, DefineVxeComponentInstance } from '@vxe-ui/core'
3
3
  import { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from '../table'
4
4
  import { VxeGanttDefines } from '../gantt'
5
+ import { VxeScrollbarPropTypes } from '../scrollbar'
5
6
 
6
7
  /* eslint-disable no-use-before-define */
7
8
 
@@ -37,6 +38,10 @@ export interface GanttViewReactData {
37
38
  lastScrollTime: number
38
39
  lazScrollLoading: boolean
39
40
 
41
+ // 滚动条
42
+ yThumbHeight: number
43
+ xThumbWidth: number
44
+
40
45
  scrollVMLoading: boolean
41
46
  scrollYHeight: number
42
47
  scrollYTop: number
@@ -75,7 +80,13 @@ export interface GanttViewInternalData {
75
80
  startIndex: number
76
81
  endIndex: number
77
82
  }
78
- // 最后滚动位置
83
+
84
+ // 滚动条
85
+ scrollObserver?: ResizeObserver
86
+ isThumbDrag?: boolean
87
+ thumbDragOffset: number
88
+ yThumbTop: number
89
+ xThumbLeft: number
79
90
  lastScrollLeft: number
80
91
  lastScrollTop: number
81
92
 
@@ -111,6 +122,14 @@ export interface GanttViewPrivateRef {
111
122
  }
112
123
 
113
124
  export interface GanttViewPrivateComputed {
125
+ computeScrollXHeight: ComputedRef<number | undefined>
126
+ computeScrollYWidth: ComputedRef<number | undefined>
127
+ computeScrollXVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
128
+ computeScrollYVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
129
+ computeScrollXAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
130
+ computeScrollYAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
131
+ computeScrollbarXToTop: ComputedRef<boolean>
132
+ computeScrollbarYToLeft: ComputedRef<boolean>
114
133
  computeScaleDateList: ComputedRef<Date[]>
115
134
  computeNowLineLeft: ComputedRef<number>
116
135
  }
@@ -164,6 +183,10 @@ export interface VxeGanttViewPrivateMethods {
164
183
  * @private
165
184
  */
166
185
  handleUpdateSYStatus(scrollYLoad: boolean): void
186
+ /**
187
+ * @private
188
+ */
189
+ updateScrollbar(): void
167
190
  }
168
191
 
169
192
  export interface VxeGanttViewMethods {
@@ -731,6 +731,8 @@ export interface GanttPrivateComputed<D = any> extends GridPrivateComputed<D> {
731
731
  computeTypeField: ComputedRef<string>
732
732
  computeProgressField: ComputedRef<string>
733
733
  computeScrollbarOpts: ComputedRef<VxeTablePropTypes.ScrollbarConfig>
734
+ computeScrollbarXOpts: ComputedRef<VxeTablePropTypes.ScrollbarXConfig>
735
+ computeScrollbarYOpts: ComputedRef<VxeTablePropTypes.ScrollbarYConfig>
734
736
  computeScrollbarXToTop: ComputedRef<boolean>
735
737
  computeScrollbarYToLeft: ComputedRef<boolean>
736
738
  }
@@ -314,8 +314,10 @@ export interface ListInternalData {
314
314
  fullKeyMaps: Record<string, any>
315
315
  rowMaps: Record<string, VxeListDefines.RowCacheItem>
316
316
 
317
- // 滚动条
318
317
  resizeObserver?: ResizeObserver
318
+
319
+ // 滚动条
320
+ scrollObserver?: ResizeObserver
319
321
  isThumbDrag?: boolean
320
322
  thumbDragOffset: number
321
323
  yThumbTop: number
@@ -1,5 +1,6 @@
1
1
  import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue'
2
2
  import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentSizeType, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf, VxeComponentSlotType } from '@vxe-ui/core'
3
+ import { VxeScrollbarProps } from './scrollbar'
3
4
 
4
5
  /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
5
6
 
@@ -126,6 +127,17 @@ export namespace VxeModalPropTypes {
126
127
  type: ModalEventTypes
127
128
  }) => Promise<any>
128
129
  export type Slots = VxeModalSlots
130
+ export type UseScrollbar = boolean
131
+ export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
132
+ /**
133
+ * 滚动条宽度
134
+ */
135
+ width?: number | string
136
+ /**
137
+ * 滚动条高度
138
+ */
139
+ height?: number | string
140
+ }
129
141
  }
130
142
 
131
143
  export interface VxeModalProps {
@@ -194,6 +206,14 @@ export interface VxeModalProps {
194
206
  animat?: VxeModalPropTypes.Animat
195
207
  padding?: VxeModalPropTypes.Padding
196
208
  beforeHideMethod?: VxeModalPropTypes.BeforeHideMethod
209
+ /**
210
+ * 使用虚拟滚动条
211
+ */
212
+ useScrollbar?: VxeModalPropTypes.UseScrollbar
213
+ /**
214
+ * 滚动条配置项
215
+ */
216
+ scrollbarConfig?: VxeModalPropTypes.ScrollbarConfig
197
217
  slots?: VxeModalPropTypes.Slots
198
218
  /**
199
219
  * @deprecated 已废弃,请使用 content
@@ -10,6 +10,7 @@ import { VxeToolbarConstructor, VxeToolbarInstance } from './toolbar'
10
10
  import { VxeTableCustomPanelConstructor } from './table-module/custom'
11
11
  import { VxeGanttConstructor, VxeGanttPrivateMethods } from './gantt'
12
12
  import { VxeGanttViewConstructor, VxeGanttViewInstance, VxeGanttViewPrivateMethods } from './gantt-module/gantt-view'
13
+ import { VxeScrollbarPropTypes } from './scrollbar'
13
14
 
14
15
  /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
15
16
 
@@ -3999,8 +4000,15 @@ export interface TablePrivateComputed<D = any> {
3999
4000
  computeScrollbarOpts: ComputedRef<VxeTablePropTypes.ScrollbarConfig>
4000
4001
  computeScrollbarXOpts: ComputedRef<VxeTablePropTypes.ScrollbarXConfig>
4001
4002
  computeScrollbarYOpts: ComputedRef<VxeTablePropTypes.ScrollbarYConfig>
4003
+ computeScrollXHeight: ComputedRef<number | undefined>
4004
+ computeScrollYWidth: ComputedRef<number | undefined>
4005
+ computeScrollXVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
4006
+ computeScrollYVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
4007
+ computeScrollXAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
4008
+ computeScrollYAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
4002
4009
  computeScrollbarXToTop: ComputedRef<boolean>
4003
4010
  computeScrollbarYToLeft: ComputedRef<boolean>
4011
+ computeScrollbarWrapperClss: ComputedRef<string>
4004
4012
  computeColumnOpts: ComputedRef<VxeTablePropTypes.ColumnOpts>
4005
4013
  computeCurrentColumnOpts: ComputedRef<VxeTablePropTypes.CurrentColumnConfig>
4006
4014
  computeScrollXThreshold: ComputedRef<number>
@@ -4119,6 +4127,11 @@ export interface TableReactData<D = any> {
4119
4127
  scrollbarWidth: number
4120
4128
  // 横向滚动条的高度
4121
4129
  scrollbarHeight: number
4130
+
4131
+ // 滚动条
4132
+ yThumbHeight: number
4133
+ xThumbWidth: number
4134
+
4122
4135
  /**
4123
4136
  * 行高
4124
4137
  * @deprecated
@@ -4360,9 +4373,17 @@ export interface TableInternalData<D = any> {
4360
4373
  currentRow: D | null
4361
4374
  currentCol: VxeTableDefines.ColumnInfo | null
4362
4375
 
4363
- // 最后滚动位置
4364
- lastScrollLeft: number
4376
+ resizeObserver?: ResizeObserver
4377
+
4378
+ // 滚动条
4379
+ scrollObserver?: ResizeObserver
4380
+ isThumbDrag?: boolean
4381
+ thumbDragOffset: number
4382
+ yThumbTop: number
4383
+ xThumbLeft: number
4365
4384
  lastScrollTop: number
4385
+ lastScrollLeft: number
4386
+
4366
4387
  // 单选框属性,已选中保留的行
4367
4388
  radioReserveRow: any
4368
4389
  // 复选框属性,已选中保留的行
@@ -5959,6 +5980,16 @@ export interface TablePrivateMethods<D = any> {
5959
5980
  row: any
5960
5981
  column: VxeTableDefines.ColumnInfo
5961
5982
  }, cellValue?: any): Promise<any>
5983
+ /**
5984
+ * 内部方法
5985
+ * @private
5986
+ */
5987
+ updateScrollbar(): void
5988
+ /**
5989
+ * 内部方法
5990
+ * @private
5991
+ */
5992
+ updateThumbOffset(): void
5962
5993
  /**
5963
5994
  * 内部方法
5964
5995
  * @private
@@ -487,8 +487,10 @@ export interface TreeInternalData {
487
487
  treeExpandedMaps: Record<string, boolean>
488
488
  treeExpandLazyLoadedMaps: Record<string, boolean>
489
489
 
490
- // 滚动条
491
490
  resizeObserver?: ResizeObserver
491
+
492
+ // 滚动条
493
+ scrollObserver?: ResizeObserver
492
494
  isThumbDrag?: boolean
493
495
  thumbDragOffset: number
494
496
  yThumbTop: number