vxe-pc-ui 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.
- package/es/card/src/card.js +2 -1
- package/es/drawer/src/drawer.js +75 -16
- package/es/drawer/style.css +13 -6
- package/es/drawer/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/layout-aside/src/layout-aside.js +2 -1
- package/es/layout-body/src/layout-body.js +2 -1
- package/es/list/src/list.js +54 -23
- package/es/menu/src/menu.js +2 -2
- package/es/modal/src/modal.js +73 -14
- package/es/modal/style.css +4 -0
- package/es/modal/style.min.css +1 -1
- package/es/scrollbar/src/scrollbar.js +20 -4
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +2 -2
- package/es/tree/src/tree.js +48 -25
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-drawer/style.css +13 -6
- package/es/vxe-drawer/style.min.css +1 -1
- package/es/vxe-modal/style.css +4 -0
- package/es/vxe-modal/style.min.css +1 -1
- package/lib/card/src/card.js +2 -1
- package/lib/card/src/card.min.js +1 -1
- package/lib/drawer/src/drawer.js +76 -12
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/drawer/style/style.css +13 -6
- package/lib/drawer/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +356 -86
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-aside/src/layout-aside.js +2 -1
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +2 -1
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/list/src/list.js +55 -23
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/menu.js +1 -1
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +74 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +4 -0
- package/lib/modal/style/style.min.css +1 -1
- package/lib/scrollbar/src/scrollbar.js +20 -4
- package/lib/scrollbar/src/scrollbar.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +1 -1
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tree/src/tree.js +49 -25
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-drawer/style/style.css +13 -6
- package/lib/vxe-drawer/style/style.min.css +1 -1
- package/lib/vxe-modal/style/style.css +4 -0
- package/lib/vxe-modal/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/card/src/card.ts +2 -1
- package/packages/drawer/src/drawer.ts +80 -16
- package/packages/layout-aside/src/layout-aside.ts +2 -1
- package/packages/layout-body/src/layout-body.ts +2 -1
- package/packages/list/src/list.ts +61 -23
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +83 -19
- package/packages/scrollbar/src/scrollbar.ts +24 -4
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tree/src/tree.ts +57 -29
- package/styles/components/drawer.scss +13 -6
- package/styles/components/modal.scss +4 -0
- package/types/components/drawer.d.ts +20 -0
- package/types/components/gantt-module/gantt-view.d.ts +24 -1
- package/types/components/gantt.d.ts +2 -0
- package/types/components/list.d.ts +3 -1
- package/types/components/modal.d.ts +20 -0
- package/types/components/table.d.ts +33 -2
- package/types/components/tree.d.ts +3 -1
- /package/es/icon/{iconfont.1791950618327.ttf → iconfont.1792034961185.ttf} +0 -0
- /package/es/icon/{iconfont.1791950618327.woff → iconfont.1792034961185.woff} +0 -0
- /package/es/icon/{iconfont.1791950618327.woff2 → iconfont.1792034961185.woff2} +0 -0
- /package/es/{iconfont.1791950618327.ttf → iconfont.1792034961185.ttf} +0 -0
- /package/es/{iconfont.1791950618327.woff → iconfont.1792034961185.woff} +0 -0
- /package/es/{iconfont.1791950618327.woff2 → iconfont.1792034961185.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1791950618327.ttf → iconfont.1792034961185.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1791950618327.woff → iconfont.1792034961185.woff} +0 -0
- /package/lib/icon/style/{iconfont.1791950618327.woff2 → iconfont.1792034961185.woff2} +0 -0
- /package/lib/{iconfont.1791950618327.ttf → iconfont.1792034961185.ttf} +0 -0
- /package/lib/{iconfont.1791950618327.woff → iconfont.1792034961185.woff} +0 -0
- /package/lib/{iconfont.1791950618327.woff2 → iconfont.1792034961185.woff2} +0 -0
|
@@ -3,12 +3,13 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI, getConfig, getI18n, getIcon, createEvent, globalEvents, globalMixins, renderEmptyElement, GLOBAL_EVENT_KEYS } from '../../ui'
|
|
5
5
|
import { getEventTargetNode, getPopupAppendElement, getPopupWrapperElement, isScale, toCssUnit } from '../../ui/src/dom'
|
|
6
|
-
import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue } from '../../ui/src/utils'
|
|
6
|
+
import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue, getDefaultConfig } from '../../ui/src/utils'
|
|
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, VxeModalMethods, ModalEventTypes, VxeModalEmits, VxeComponentSizeType, VxeComponentPermissionInfo, ValueOf, VxeButtonConstructor, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods } from '../../../types'
|
|
14
15
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
@@ -227,6 +228,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
227
228
|
},
|
|
228
229
|
beforeHideMethod: Function as PropType<VxeModalPropTypes.BeforeHideMethod>,
|
|
229
230
|
slots: Object as PropType<VxeModalPropTypes.Slots>,
|
|
231
|
+
useScrollbar: {
|
|
232
|
+
type: Boolean as PropType<VxeModalPropTypes.UseScrollbar>,
|
|
233
|
+
default: () => getDefaultConfig(getConfig().modal.useScrollbar, getConfig().useScrollbar)
|
|
234
|
+
},
|
|
235
|
+
scrollbarConfig: Object as PropType<VxeModalPropTypes.ScrollbarConfig>,
|
|
230
236
|
|
|
231
237
|
/**
|
|
232
238
|
* 已废弃
|
|
@@ -316,23 +322,47 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
316
322
|
|
|
317
323
|
return props.type === 'modal'
|
|
318
324
|
},
|
|
319
|
-
computeIsMinimizeStatus
|
|
325
|
+
computeIsMinimizeStatus () {
|
|
320
326
|
const $xeModal = this
|
|
321
327
|
const reactData = $xeModal.reactData as ModalReactData
|
|
322
328
|
|
|
323
329
|
return reactData.zoomStatus === 'minimize'
|
|
324
330
|
},
|
|
325
|
-
computeIsMaximizeStatus
|
|
331
|
+
computeIsMaximizeStatus () {
|
|
326
332
|
const $xeModal = this
|
|
327
333
|
const reactData = $xeModal.reactData as ModalReactData
|
|
328
334
|
|
|
329
335
|
return reactData.zoomStatus === 'maximize'
|
|
330
336
|
},
|
|
331
|
-
computeZoomOpts
|
|
337
|
+
computeZoomOpts () {
|
|
332
338
|
const $xeModal = this
|
|
333
339
|
const props = $xeModal
|
|
334
340
|
|
|
335
341
|
return Object.assign({}, getConfig().modal.zoomConfig, props.zoomConfig)
|
|
342
|
+
},
|
|
343
|
+
computeScrollbarOpts () {
|
|
344
|
+
const $xeModal = this
|
|
345
|
+
const props = $xeModal
|
|
346
|
+
|
|
347
|
+
return Object.assign({}, getConfig().modal.scrollbarConfig, props.scrollbarConfig)
|
|
348
|
+
},
|
|
349
|
+
computeScrollbarProps () {
|
|
350
|
+
const $xeModal = this
|
|
351
|
+
|
|
352
|
+
const scrollbarOpts = $xeModal.computeScrollbarOpts as VxeModalPropTypes.ScrollbarConfig
|
|
353
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts
|
|
354
|
+
return {
|
|
355
|
+
width: scrollbarOpts.width,
|
|
356
|
+
height: scrollbarOpts.height,
|
|
357
|
+
autoHide: scrollbarOpts.autoHide,
|
|
358
|
+
visible: scrollbarOpts.visible,
|
|
359
|
+
xConfig: scrollbarOpts.xConfig,
|
|
360
|
+
yConfig: scrollbarOpts.yConfig,
|
|
361
|
+
className: scrollbarOpts.className,
|
|
362
|
+
viewAttrs: scrollbarOpts.viewAttrs,
|
|
363
|
+
viewClassName: 'vxe-modal--scrollbar-content-view' + (viewClassName ? (' ' + viewClassName) : ''),
|
|
364
|
+
viewInnerClassName: 'vxe-modal--scrollbar-content-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
|
|
365
|
+
}
|
|
336
366
|
}
|
|
337
367
|
},
|
|
338
368
|
watch: {
|
|
@@ -1539,9 +1569,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1539
1569
|
const props = $xeModal
|
|
1540
1570
|
const slots = $xeModal.$scopedSlots
|
|
1541
1571
|
|
|
1542
|
-
const { slots: propSlots = {}, status, message, iconStatus, useHtml } = props
|
|
1572
|
+
const { slots: propSlots = {}, status, message, iconStatus, useScrollbar, useHtml } = props
|
|
1543
1573
|
const content = props.content || message
|
|
1544
1574
|
const isMsg = $xeModal.computeIsMsg
|
|
1575
|
+
const scrollbarProps = $xeModal.computeScrollbarProps
|
|
1545
1576
|
const defaultSlot = slots.default || propSlots.default
|
|
1546
1577
|
const leftSlot = slots.left || propSlots.left
|
|
1547
1578
|
const rightSlot = slots.right || propSlots.right
|
|
@@ -1557,20 +1588,53 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1557
1588
|
])
|
|
1558
1589
|
)
|
|
1559
1590
|
}
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1591
|
+
|
|
1592
|
+
if (useHtml && !defaultSlot) {
|
|
1593
|
+
contVNs.push(
|
|
1594
|
+
useScrollbar
|
|
1595
|
+
? h(VxeScrollbarComponent, {
|
|
1596
|
+
key: 'shc',
|
|
1597
|
+
class: 'vxe-modal--scrollbar-content',
|
|
1598
|
+
props: scrollbarProps,
|
|
1599
|
+
scopedSlots: {
|
|
1600
|
+
default () {
|
|
1601
|
+
return [
|
|
1602
|
+
h('div', {
|
|
1603
|
+
class: 'vxe-modal--scrollbar-content-html',
|
|
1604
|
+
domProps: {
|
|
1605
|
+
innerHTML: getFuncText(content)
|
|
1606
|
+
}
|
|
1607
|
+
})
|
|
1608
|
+
]
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
})
|
|
1612
|
+
: h('div', {
|
|
1613
|
+
key: 'hc',
|
|
1614
|
+
class: 'vxe-modal--content',
|
|
1615
|
+
domProps: {
|
|
1616
|
+
innerHTML: getFuncText(content)
|
|
1617
|
+
}
|
|
1618
|
+
})
|
|
1619
|
+
)
|
|
1620
|
+
} else {
|
|
1621
|
+
contVNs.push(
|
|
1622
|
+
useScrollbar
|
|
1623
|
+
? h(VxeScrollbarComponent, {
|
|
1624
|
+
key: 'sdc',
|
|
1625
|
+
class: 'vxe-modal--scrollbar-content',
|
|
1626
|
+
props: scrollbarProps,
|
|
1627
|
+
scopedSlots: {
|
|
1628
|
+
default: () => defaultSlot ? $xeModal.callSlot(defaultSlot, { $modal: $xeModal }, h) : getFuncText(content)
|
|
1629
|
+
}
|
|
1630
|
+
})
|
|
1631
|
+
: h('div', {
|
|
1632
|
+
key: 'dc',
|
|
1633
|
+
class: 'vxe-modal--content'
|
|
1634
|
+
}, defaultSlot ? $xeModal.callSlot(defaultSlot, { $modal: $xeModal }, h) : getFuncText(content))
|
|
1635
|
+
)
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1574
1638
|
return h('div', {
|
|
1575
1639
|
class: 'vxe-modal--body'
|
|
1576
1640
|
}, [
|
|
@@ -103,10 +103,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
103
103
|
const props = $xeScrollbar
|
|
104
104
|
|
|
105
105
|
const { width, height, minWidth, minHeight, maxWidth, maxHeight } = props
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const barWidth = yOpts.width
|
|
109
|
-
const barHeight = xOpts.height
|
|
106
|
+
const barWidth = $xeScrollbar.computeYWidth
|
|
107
|
+
const barHeight = $xeScrollbar.computeXHeight
|
|
110
108
|
const stys: VxeComponentStyleType = {}
|
|
111
109
|
if (width) {
|
|
112
110
|
stys.width = toCssUnit(width)
|
|
@@ -132,6 +130,18 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
132
130
|
}
|
|
133
131
|
return stys
|
|
134
132
|
},
|
|
133
|
+
computeXHeight () {
|
|
134
|
+
const $xeScrollbar = this
|
|
135
|
+
|
|
136
|
+
const xOpts = ($xeScrollbar as any).computeXOpts as VxeScrollbarPropTypes.XConfig
|
|
137
|
+
return xOpts.height
|
|
138
|
+
},
|
|
139
|
+
computeYWidth () {
|
|
140
|
+
const $xeScrollbar = this
|
|
141
|
+
|
|
142
|
+
const yOpts = ($xeScrollbar as any).computeYOpts as VxeScrollbarPropTypes.YConfig
|
|
143
|
+
return yOpts.width
|
|
144
|
+
},
|
|
135
145
|
computeXVisible () {
|
|
136
146
|
const $xeScrollbar = this
|
|
137
147
|
const props = $xeScrollbar
|
|
@@ -710,6 +720,16 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
710
720
|
|
|
711
721
|
$xeScrollbar.reFlag++
|
|
712
722
|
},
|
|
723
|
+
computeYWidth () {
|
|
724
|
+
const $xeScrollbar = this
|
|
725
|
+
|
|
726
|
+
$xeScrollbar.reFlag++
|
|
727
|
+
},
|
|
728
|
+
computeXHeight () {
|
|
729
|
+
const $xeScrollbar = this
|
|
730
|
+
|
|
731
|
+
$xeScrollbar.reFlag++
|
|
732
|
+
},
|
|
713
733
|
computeXVisible () {
|
|
714
734
|
const $xeScrollbar = this
|
|
715
735
|
|
|
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils'
|
|
|
4
4
|
import { createEvent, getConfig, getIcon, globalEvents, globalMixins, permission, renderEmptyElement } from '../../ui'
|
|
5
5
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
6
6
|
import { toCssUnit, addClass, removeClass } from '../../ui/src/dom'
|
|
7
|
-
import { isEnableConf } from '../../ui/src/utils'
|
|
7
|
+
import { getDefaultConfig, isEnableConf } from '../../ui/src/utils'
|
|
8
8
|
import { createComponentLog } from '../../ui/src/log'
|
|
9
9
|
import VxeLoadingComponent from '../../loading'
|
|
10
10
|
import VxeScrollbarComponent from '../../scrollbar'
|
|
@@ -58,7 +58,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
58
58
|
},
|
|
59
59
|
useScrollbar: {
|
|
60
60
|
type: Boolean as PropType<VxeTabsPropTypes.UseScrollbar>,
|
|
61
|
-
default: () => getConfig().tabs.useScrollbar
|
|
61
|
+
default: () => getDefaultConfig(getConfig().tabs.useScrollbar, getConfig().useScrollbar)
|
|
62
62
|
},
|
|
63
63
|
scrollbarConfig: Object as PropType<VxeTabsPropTypes.ScrollbarConfig>,
|
|
64
64
|
// 已废弃
|
|
@@ -584,8 +584,10 @@ function createInternalData (): TreeInternalData {
|
|
|
584
584
|
treeExpandedMaps: {},
|
|
585
585
|
treeExpandLazyLoadedMaps: {},
|
|
586
586
|
|
|
587
|
-
// 滚动条
|
|
588
587
|
// resizeObserver: undefined,
|
|
588
|
+
|
|
589
|
+
// 滚动条
|
|
590
|
+
// scrollObserver: undefined,
|
|
589
591
|
// isThumbDrag: false,
|
|
590
592
|
thumbDragOffset: 0,
|
|
591
593
|
yThumbTop: 0,
|
|
@@ -748,7 +750,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
748
750
|
virtualYConfig: Object as PropType<VxeTreePropTypes.VirtualYConfig>,
|
|
749
751
|
useScrollbar: {
|
|
750
752
|
type: Boolean as PropType<VxeTreePropTypes.UseScrollbar>,
|
|
751
|
-
default: () => getConfig().tree.useScrollbar
|
|
753
|
+
default: () => getDefaultConfig(getConfig().tree.useScrollbar, getConfig().useScrollbar)
|
|
752
754
|
},
|
|
753
755
|
scrollbarConfig: Object as PropType<VxeTreePropTypes.ScrollbarConfig>
|
|
754
756
|
},
|
|
@@ -893,11 +895,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
893
895
|
computeWrapperStyles () {
|
|
894
896
|
const $xeTree = this
|
|
895
897
|
|
|
896
|
-
const
|
|
897
|
-
const
|
|
898
|
-
const scrollbarYOpts = $xeTree.computeScrollbarYOpts
|
|
899
|
-
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
900
|
-
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
898
|
+
const barWidth = $xeTree.computeScrollYWidth
|
|
899
|
+
const barHeight = $xeTree.computeScrollXHeight
|
|
901
900
|
const stys: VxeComponentStyleType = {}
|
|
902
901
|
if (barWidth || barHeight) {
|
|
903
902
|
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight)
|
|
@@ -944,13 +943,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
944
943
|
|
|
945
944
|
return Object.assign({}, getConfig().tree.filterConfig, props.filterConfig)
|
|
946
945
|
},
|
|
947
|
-
computeScrollbarOpts
|
|
946
|
+
computeScrollbarOpts () {
|
|
948
947
|
const $xeTree = this
|
|
949
948
|
const props = $xeTree
|
|
950
949
|
|
|
951
950
|
return Object.assign({}, getConfig().tree.scrollbarConfig, props.scrollbarConfig)
|
|
952
951
|
},
|
|
953
|
-
computeScrollbarXOpts
|
|
952
|
+
computeScrollbarXOpts () {
|
|
954
953
|
const $xeTree = this
|
|
955
954
|
|
|
956
955
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
@@ -958,12 +957,26 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
958
957
|
visible: false
|
|
959
958
|
})
|
|
960
959
|
},
|
|
961
|
-
computeScrollbarYOpts
|
|
960
|
+
computeScrollbarYOpts () {
|
|
962
961
|
const $xeTree = this
|
|
963
962
|
|
|
964
963
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
965
964
|
return Object.assign({}, getConfig().scrollbar.yConfig, scrollbarOpts.yConfig)
|
|
966
965
|
},
|
|
966
|
+
computeScrollXHeight () {
|
|
967
|
+
const $xeTree = this
|
|
968
|
+
|
|
969
|
+
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
970
|
+
const scrollbarXOpts = $xeTree.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
971
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
972
|
+
},
|
|
973
|
+
computeScrollYWidth () {
|
|
974
|
+
const $xeTree = this
|
|
975
|
+
|
|
976
|
+
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
977
|
+
const scrollbarYOpts = $xeTree.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
978
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
979
|
+
},
|
|
967
980
|
computeScrollXVisible () {
|
|
968
981
|
const $xeTree = this
|
|
969
982
|
|
|
@@ -994,17 +1007,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
994
1007
|
},
|
|
995
1008
|
computeScrollbarWrapperClss () {
|
|
996
1009
|
const $xeTree = this
|
|
997
|
-
const reactData = ($xeTree as any).reactData
|
|
1010
|
+
const reactData = ($xeTree as any).reactData as TreeReactData
|
|
998
1011
|
|
|
999
|
-
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
1000
|
-
const { padding } = scrollbarOpts
|
|
1001
1012
|
const { yThumbHeight, xThumbWidth } = reactData
|
|
1002
1013
|
const scrollbarXToTop = $xeTree.computeScrollbarXToTop
|
|
1003
1014
|
const scrollbarYToLeft = $xeTree.computeScrollbarYToLeft
|
|
1004
1015
|
const scrollXVisible = $xeTree.computeScrollXVisible
|
|
1005
1016
|
const scrollYVisible = $xeTree.computeScrollYVisible
|
|
1006
|
-
const scrollXAutoHide = $xeTree.computeScrollXAutoHide as boolean
|
|
1007
|
-
const scrollYAutoHide = $xeTree.computeScrollYAutoHide as boolean
|
|
1008
1017
|
return domUtils.buildClass([
|
|
1009
1018
|
'vxe-scrollbar is--virtual',
|
|
1010
1019
|
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
@@ -1012,9 +1021,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1012
1021
|
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
1013
1022
|
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
1014
1023
|
], {
|
|
1015
|
-
'is--padding': padding,
|
|
1016
|
-
'ov-x--auto-hide': scrollXAutoHide,
|
|
1017
|
-
'ov-y--auto-hide': scrollYAutoHide,
|
|
1018
1024
|
'overflow-y': yThumbHeight,
|
|
1019
1025
|
'overflow-x': xThumbWidth
|
|
1020
1026
|
})
|
|
@@ -4262,6 +4268,16 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
4262
4268
|
|
|
4263
4269
|
$xeTree.reFlag++
|
|
4264
4270
|
},
|
|
4271
|
+
computeScrollYWidth () {
|
|
4272
|
+
const $xeTree = this
|
|
4273
|
+
|
|
4274
|
+
$xeTree.reFlag++
|
|
4275
|
+
},
|
|
4276
|
+
computeScrollXHeight () {
|
|
4277
|
+
const $xeTree = this
|
|
4278
|
+
|
|
4279
|
+
$xeTree.reFlag++
|
|
4280
|
+
},
|
|
4265
4281
|
computeScrollXVisible () {
|
|
4266
4282
|
const $xeTree = this
|
|
4267
4283
|
|
|
@@ -4320,23 +4336,32 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
4320
4336
|
if (menuConfig && !VxeUIContextMenu) {
|
|
4321
4337
|
errLog('vxe.error.reqComp', ['vxe-context-menu'])
|
|
4322
4338
|
}
|
|
4323
|
-
|
|
4324
|
-
|
|
4339
|
+
const el = $xeTree.$refs.refElem as HTMLDivElement
|
|
4340
|
+
if (useScrollbar) {
|
|
4325
4341
|
const viewInnerEl = $xeTree.$refs.refVirtualBody as HTMLDivElement
|
|
4342
|
+
const scrollObserver = globalResize.create(() => {
|
|
4343
|
+
$xeTree.updateScrollbar()
|
|
4344
|
+
})
|
|
4345
|
+
if (el) {
|
|
4346
|
+
scrollObserver.observe(el)
|
|
4347
|
+
}
|
|
4348
|
+
if (viewInnerEl) {
|
|
4349
|
+
scrollObserver.observe(viewInnerEl)
|
|
4350
|
+
}
|
|
4351
|
+
internalData.scrollObserver = scrollObserver
|
|
4352
|
+
}
|
|
4353
|
+
if (autoResize) {
|
|
4326
4354
|
const parentEl = $xeTree.getParentElem()
|
|
4327
4355
|
const resizeObserver = globalResize.create(() => {
|
|
4328
|
-
|
|
4356
|
+
if (props.autoResize) {
|
|
4357
|
+
$xeTree.reFlag++
|
|
4358
|
+
}
|
|
4329
4359
|
})
|
|
4330
4360
|
if (el) {
|
|
4331
4361
|
resizeObserver.observe(el)
|
|
4332
|
-
if (autoResize) {
|
|
4333
|
-
if (parentEl) {
|
|
4334
|
-
resizeObserver.observe(parentEl)
|
|
4335
|
-
}
|
|
4336
|
-
}
|
|
4337
4362
|
}
|
|
4338
|
-
if (
|
|
4339
|
-
resizeObserver.observe(
|
|
4363
|
+
if (parentEl) {
|
|
4364
|
+
resizeObserver.observe(parentEl)
|
|
4340
4365
|
}
|
|
4341
4366
|
internalData.resizeObserver = resizeObserver
|
|
4342
4367
|
}
|
|
@@ -4351,10 +4376,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
4351
4376
|
const reactData = $xeTree.reactData
|
|
4352
4377
|
const internalData = $xeTree.internalData
|
|
4353
4378
|
|
|
4354
|
-
const { resizeObserver } = internalData
|
|
4379
|
+
const { scrollObserver, resizeObserver } = internalData
|
|
4355
4380
|
if (resizeObserver) {
|
|
4356
4381
|
resizeObserver.disconnect()
|
|
4357
4382
|
}
|
|
4383
|
+
if (scrollObserver) {
|
|
4384
|
+
scrollObserver.disconnect()
|
|
4385
|
+
}
|
|
4358
4386
|
globalEvents.off($xeTree, 'resize')
|
|
4359
4387
|
XEUtils.assign(reactData, createReactData())
|
|
4360
4388
|
XEUtils.assign(internalData, createInternalData())
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
&.is--drag {
|
|
182
182
|
cursor: move;
|
|
183
183
|
transition: none;
|
|
184
|
-
.vxe-
|
|
185
|
-
.vxe-
|
|
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-
|
|
195
|
+
.vxe-drawer--body {
|
|
196
196
|
overflow: hidden;
|
|
197
|
-
.vxe-
|
|
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
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CreateElement } from 'vue'
|
|
2
2
|
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, VxeComponentSizeType, VxeComponentSlotType, ValueOf } from '@vxe-ui/core'
|
|
3
|
+
import { VxeScrollbarProps } from './scrollbar'
|
|
3
4
|
|
|
4
5
|
/* eslint-disable @typescript-eslint/no-empty-interface,no-use-before-define,@typescript-eslint/ban-types */
|
|
5
6
|
|
|
@@ -67,6 +68,17 @@ export namespace VxeDrawerPropTypes {
|
|
|
67
68
|
export type Padding = boolean
|
|
68
69
|
export type BeforeHideMethod = (params: VxeDrawerDefines.DrawerVisibleParams) => Promise<any>
|
|
69
70
|
export type Slots = VxeDrawerSlots
|
|
71
|
+
export type UseScrollbar = boolean
|
|
72
|
+
export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
|
|
73
|
+
/**
|
|
74
|
+
* 滚动条宽度
|
|
75
|
+
*/
|
|
76
|
+
width?: number | string
|
|
77
|
+
/**
|
|
78
|
+
* 滚动条高度
|
|
79
|
+
*/
|
|
80
|
+
height?: number | string
|
|
81
|
+
}
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
export interface VxeDrawerProps {
|
|
@@ -119,6 +131,14 @@ export interface VxeDrawerProps {
|
|
|
119
131
|
padding?: VxeDrawerPropTypes.Padding
|
|
120
132
|
beforeHideMethod?: VxeDrawerPropTypes.BeforeHideMethod
|
|
121
133
|
slots?: VxeDrawerPropTypes.Slots
|
|
134
|
+
/**
|
|
135
|
+
* 使用虚拟滚动条
|
|
136
|
+
*/
|
|
137
|
+
useScrollbar?: VxeDrawerPropTypes.UseScrollbar
|
|
138
|
+
/**
|
|
139
|
+
* 滚动条配置项
|
|
140
|
+
*/
|
|
141
|
+
scrollbarConfig?: VxeDrawerPropTypes.ScrollbarConfig
|
|
122
142
|
}
|
|
123
143
|
|
|
124
144
|
export interface DrawerPrivateComputed {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DefineVxeComponentInstance } from '@vxe-ui/core'
|
|
2
2
|
import { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from '../table'
|
|
3
3
|
import { VxeGanttDefines, VxeGanttConstructor } from '../gantt'
|
|
4
|
+
import { VxeScrollbarPropTypes } from '../scrollbar'
|
|
4
5
|
|
|
5
6
|
/* eslint-disable no-use-before-define */
|
|
6
7
|
|
|
@@ -34,6 +35,10 @@ export interface GanttViewReactData {
|
|
|
34
35
|
lastScrollTime: number
|
|
35
36
|
lazScrollLoading: boolean
|
|
36
37
|
|
|
38
|
+
// 滚动条
|
|
39
|
+
yThumbHeight: number
|
|
40
|
+
xThumbWidth: number
|
|
41
|
+
|
|
37
42
|
scrollVMLoading: boolean
|
|
38
43
|
scrollYHeight: number
|
|
39
44
|
scrollYTop: number
|
|
@@ -72,7 +77,13 @@ export interface GanttViewInternalData {
|
|
|
72
77
|
startIndex: number
|
|
73
78
|
endIndex: number
|
|
74
79
|
}
|
|
75
|
-
|
|
80
|
+
|
|
81
|
+
// 滚动条
|
|
82
|
+
scrollObserver?: ResizeObserver
|
|
83
|
+
isThumbDrag?: boolean
|
|
84
|
+
thumbDragOffset: number
|
|
85
|
+
yThumbTop: number
|
|
86
|
+
xThumbLeft: number
|
|
76
87
|
lastScrollLeft: number
|
|
77
88
|
lastScrollTop: number
|
|
78
89
|
|
|
@@ -105,6 +116,14 @@ export interface GanttViewPrivateRef {
|
|
|
105
116
|
}
|
|
106
117
|
|
|
107
118
|
export interface GanttViewPrivateComputed {
|
|
119
|
+
computeScrollXHeight: number | undefined
|
|
120
|
+
computeScrollYWidth: number | undefined
|
|
121
|
+
computeScrollXVisible: 'auto' | 'visible' | 'hidden' | boolean | undefined
|
|
122
|
+
computeScrollYVisible: 'auto' | 'visible' | 'hidden' | boolean | undefined
|
|
123
|
+
computeScrollXAutoHide: VxeScrollbarPropTypes.AutoHide | undefined
|
|
124
|
+
computeScrollYAutoHide: VxeScrollbarPropTypes.AutoHide | undefined
|
|
125
|
+
computeScrollbarXToTop: boolean
|
|
126
|
+
computeScrollbarYToLeft: boolean
|
|
108
127
|
computeScaleDateList: Date[]
|
|
109
128
|
computeNowLineLeft: number
|
|
110
129
|
}
|
|
@@ -158,6 +177,10 @@ export interface VxeGanttViewPrivateMethods {
|
|
|
158
177
|
* @private
|
|
159
178
|
*/
|
|
160
179
|
handleUpdateSYStatus(scrollYLoad: boolean): void
|
|
180
|
+
/**
|
|
181
|
+
* @private
|
|
182
|
+
*/
|
|
183
|
+
updateScrollbar(): void
|
|
161
184
|
}
|
|
162
185
|
|
|
163
186
|
export interface VxeGanttViewMethods {
|
|
@@ -723,6 +723,8 @@ export interface GanttPrivateComputed<D = any> extends GridPrivateComputed<D> {
|
|
|
723
723
|
computeTypeField: string
|
|
724
724
|
computeProgressField: string
|
|
725
725
|
computeScrollbarOpts: VxeTablePropTypes.ScrollbarConfig
|
|
726
|
+
computeScrollbarXOpts: VxeTablePropTypes.ScrollbarXConfig
|
|
727
|
+
computeScrollbarYOpts: VxeTablePropTypes.ScrollbarYConfig
|
|
726
728
|
computeScrollbarXToTop: boolean
|
|
727
729
|
computeScrollbarYToLeft: boolean
|
|
728
730
|
}
|
|
@@ -306,8 +306,10 @@ export interface ListInternalData {
|
|
|
306
306
|
fullKeyMaps: Record<string, any>
|
|
307
307
|
rowMaps: Record<string, VxeListDefines.RowCacheItem>
|
|
308
308
|
|
|
309
|
-
// 滚动条
|
|
310
309
|
resizeObserver?: ResizeObserver
|
|
310
|
+
|
|
311
|
+
// 滚动条
|
|
312
|
+
scrollObserver?: ResizeObserver
|
|
311
313
|
isThumbDrag?: boolean
|
|
312
314
|
thumbDragOffset: number
|
|
313
315
|
yThumbTop: number
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CreateElement } from 'vue'
|
|
2
2
|
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentSizeType, VxeComponentEventParams, ValueOf, VxeComponentSlotType } from '@vxe-ui/core'
|
|
3
|
+
import { VxeScrollbarProps } from './scrollbar'
|
|
3
4
|
|
|
4
5
|
/* eslint-disable @typescript-eslint/no-empty-interface,no-use-before-define,@typescript-eslint/ban-types */
|
|
5
6
|
|
|
@@ -120,6 +121,17 @@ export namespace VxeModalPropTypes {
|
|
|
120
121
|
type: ModalEventTypes
|
|
121
122
|
}) => Promise<any>
|
|
122
123
|
export type Slots = VxeModalSlots
|
|
124
|
+
export type UseScrollbar = boolean
|
|
125
|
+
export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
|
|
126
|
+
/**
|
|
127
|
+
* 滚动条宽度
|
|
128
|
+
*/
|
|
129
|
+
width?: number | string
|
|
130
|
+
/**
|
|
131
|
+
* 滚动条高度
|
|
132
|
+
*/
|
|
133
|
+
height?: number | string
|
|
134
|
+
}
|
|
123
135
|
}
|
|
124
136
|
|
|
125
137
|
export interface VxeModalProps {
|
|
@@ -189,6 +201,14 @@ export interface VxeModalProps {
|
|
|
189
201
|
padding?: VxeModalPropTypes.Padding
|
|
190
202
|
beforeHideMethod?: VxeModalPropTypes.BeforeHideMethod
|
|
191
203
|
slots?: VxeModalPropTypes.Slots
|
|
204
|
+
/**
|
|
205
|
+
* 使用虚拟滚动条
|
|
206
|
+
*/
|
|
207
|
+
useScrollbar?: VxeModalPropTypes.UseScrollbar
|
|
208
|
+
/**
|
|
209
|
+
* 滚动条配置项
|
|
210
|
+
*/
|
|
211
|
+
scrollbarConfig?: VxeModalPropTypes.ScrollbarConfig
|
|
192
212
|
/**
|
|
193
213
|
* @deprecated 已废弃,请使用 content
|
|
194
214
|
*/
|