vxe-pc-ui 3.20.9 → 3.20.11
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/date-panel/src/date-panel.js +70 -39
- package/es/date-panel/style.css +22 -20
- package/es/date-panel/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +11 -3
- package/es/icon-picker/style.css +9 -3
- package/es/icon-picker/style.min.css +1 -1
- package/es/list/src/list.js +12 -183
- package/es/scrollbar/src/scrollbar.js +24 -188
- package/es/select/src/select.js +276 -8
- package/es/select/style.css +44 -0
- package/es/select/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tooltip/src/tooltip.js +2 -4
- package/es/tooltip/style.css +2 -0
- package/es/tooltip/style.min.css +1 -1
- package/es/tree/src/tree.js +21 -191
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-date-panel/style.css +22 -20
- package/es/vxe-date-panel/style.min.css +1 -1
- package/es/vxe-icon-picker/style.css +9 -3
- package/es/vxe-icon-picker/style.min.css +1 -1
- package/es/vxe-select/style.css +44 -0
- package/es/vxe-select/style.min.css +1 -1
- package/es/vxe-tooltip/style.css +2 -0
- package/es/vxe-tooltip/style.min.css +1 -1
- package/lib/date-panel/src/date-panel.js +74 -43
- package/lib/date-panel/src/date-panel.min.js +1 -1
- package/lib/date-panel/style/style.css +22 -20
- package/lib/date-panel/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/icon-picker/src/icon-picker.js +56 -38
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/icon-picker/style/style.css +9 -3
- package/lib/icon-picker/style/style.min.css +1 -1
- package/lib/index.umd.js +726 -743
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +10 -189
- package/lib/list/src/list.min.js +1 -1
- package/lib/scrollbar/src/scrollbar.js +21 -192
- package/lib/scrollbar/src/scrollbar.min.js +1 -1
- package/lib/select/src/select.js +325 -69
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +44 -0
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tooltip/src/tooltip.js +2 -4
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +2 -0
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/tree/src/tree.js +20 -197
- 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-date-panel/style/style.css +22 -20
- package/lib/vxe-date-panel/style/style.min.css +1 -1
- package/lib/vxe-icon-picker/style/style.css +9 -3
- package/lib/vxe-icon-picker/style/style.min.css +1 -1
- package/lib/vxe-select/style/style.css +44 -0
- package/lib/vxe-select/style/style.min.css +1 -1
- package/lib/vxe-tooltip/style/style.css +2 -0
- package/lib/vxe-tooltip/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/date-panel/src/date-panel.ts +70 -39
- package/packages/icon-picker/src/icon-picker.ts +12 -3
- package/packages/list/src/list.ts +15 -203
- package/packages/scrollbar/src/scrollbar.ts +24 -199
- package/packages/select/src/select.ts +307 -11
- package/packages/tabs/src/tabs.ts +2 -4
- package/packages/tooltip/src/tooltip.ts +2 -4
- package/packages/tree/src/tree.ts +24 -212
- package/styles/components/date-panel.scss +31 -29
- package/styles/components/icon-picker.scss +9 -3
- package/styles/components/select.scss +77 -0
- package/styles/components/tooltip.scss +1 -0
- package/types/components/gantt-module/gantt-view.d.ts +17 -17
- package/types/components/icon-picker.d.ts +21 -1
- package/types/components/list.d.ts +4 -0
- package/types/components/scrollbar.d.ts +7 -14
- package/types/components/select.d.ts +28 -3
- package/types/components/table.d.ts +30 -20
- package/types/components/tree.d.ts +7 -16
- /package/es/icon/{iconfont.1792139429655.ttf → iconfont.1792226835421.ttf} +0 -0
- /package/es/icon/{iconfont.1792139429655.woff → iconfont.1792226835421.woff} +0 -0
- /package/es/icon/{iconfont.1792139429655.woff2 → iconfont.1792226835421.woff2} +0 -0
- /package/es/{iconfont.1792139429655.ttf → iconfont.1792226835421.ttf} +0 -0
- /package/es/{iconfont.1792139429655.woff → iconfont.1792226835421.woff} +0 -0
- /package/es/{iconfont.1792139429655.woff2 → iconfont.1792226835421.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1792139429655.ttf → iconfont.1792226835421.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1792139429655.woff → iconfont.1792226835421.woff} +0 -0
- /package/lib/icon/style/{iconfont.1792139429655.woff2 → iconfont.1792226835421.woff2} +0 -0
- /package/lib/{iconfont.1792139429655.ttf → iconfont.1792226835421.ttf} +0 -0
- /package/lib/{iconfont.1792139429655.woff → iconfont.1792226835421.woff} +0 -0
- /package/lib/{iconfont.1792139429655.woff2 → iconfont.1792226835421.woff2} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropType, CreateElement, VNode } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
-
import { VxeUI,
|
|
4
|
+
import { VxeUI, globalMixins } from '../../ui'
|
|
5
5
|
import { getEventTargetNode, getPopupAppendElement, toCssUnit, updatePanelPlacement } from '../../ui/src/dom'
|
|
6
6
|
import { getLastZIndex, nextZIndex, getFuncText, eqEmptyValue } from '../../ui/src/utils'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
@@ -9,9 +9,12 @@ import { createComponentLog } from '../../ui/src/log'
|
|
|
9
9
|
import VxeInputComponent from '../../input'
|
|
10
10
|
import VxeButtonComponent from '../../button'
|
|
11
11
|
|
|
12
|
-
import type { VxeSelectPropTypes, SelectInternalData, ValueOf,
|
|
12
|
+
import type { VxeSelectPropTypes, SelectInternalData, ValueOf, VxeUseSizeComputed, VxeUseVScrollbarComputed, VxeUseInitVScrollbarComputed, SelectReactData, VxeSelectEmits, VxeButtonDefines, VxeInputDefines, VxeSelectDefines, VxeOptionProps, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeInputConstructor, VxeComponentSlotType, VxeComponentStyleType, VxeCardConstructor, VxeCardPrivateMethods, VxeScrollbarPropTypes } from '../../../types'
|
|
13
13
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
14
14
|
|
|
15
|
+
const { getConfig, getIcon, getI18n, baseUtils, domUtils, globalEvents, GLOBAL_EVENT_KEYS, globalResize, createEvent, renderEmptyElement } = VxeUI
|
|
16
|
+
const { getDefVal } = baseUtils
|
|
17
|
+
|
|
15
18
|
const { errLog } = createComponentLog('select')
|
|
16
19
|
|
|
17
20
|
function isOptionVisible (option: any) {
|
|
@@ -36,6 +39,10 @@ function createReactData (): SelectReactData {
|
|
|
36
39
|
searchValue: '',
|
|
37
40
|
searchLoading: false,
|
|
38
41
|
|
|
42
|
+
// 滚动条
|
|
43
|
+
yThumbHeight: 0,
|
|
44
|
+
xThumbWidth: 0,
|
|
45
|
+
|
|
39
46
|
panelIndex: 0,
|
|
40
47
|
panelStyle: {},
|
|
41
48
|
panelPlacement: null,
|
|
@@ -57,8 +64,15 @@ function createInternalData (): SelectInternalData {
|
|
|
57
64
|
optFullValMaps: {},
|
|
58
65
|
remoteValMaps: {},
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
// 滚动条
|
|
68
|
+
// scrollObserver: undefined,
|
|
69
|
+
// isThumbDrag: false,
|
|
70
|
+
thumbDragOffset: 0,
|
|
71
|
+
yThumbTop: 0,
|
|
72
|
+
xThumbLeft: 0,
|
|
61
73
|
lastScrollTop: 0,
|
|
74
|
+
lastScrollLeft: 0,
|
|
75
|
+
|
|
62
76
|
scrollYStore: {
|
|
63
77
|
startIndex: 0,
|
|
64
78
|
endIndex: 0,
|
|
@@ -75,7 +89,9 @@ function createInternalData (): SelectInternalData {
|
|
|
75
89
|
export default /* define-vxe-component start */ defineVxeComponent({
|
|
76
90
|
name: 'VxeSelect',
|
|
77
91
|
mixins: [
|
|
78
|
-
globalMixins.sizeMixin
|
|
92
|
+
globalMixins.sizeMixin,
|
|
93
|
+
globalMixins.vScrollbarMixin,
|
|
94
|
+
globalMixins.initVScrollbarMixin
|
|
79
95
|
],
|
|
80
96
|
model: {
|
|
81
97
|
prop: 'value',
|
|
@@ -190,6 +206,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
190
206
|
popupConfig: Object as PropType<VxeSelectPropTypes.PopupConfig>,
|
|
191
207
|
virtualYConfig: Object as PropType<VxeSelectPropTypes.VirtualYConfig>,
|
|
192
208
|
scrollY: Object as PropType<VxeSelectPropTypes.ScrollY>,
|
|
209
|
+
useScrollbar: {
|
|
210
|
+
type: Boolean as PropType<VxeSelectPropTypes.UseScrollbar>,
|
|
211
|
+
default: () => getDefVal(getConfig().select.useScrollbar, getConfig().useScrollbar)
|
|
212
|
+
},
|
|
213
|
+
scrollbarConfig: Object as PropType<VxeSelectPropTypes.ScrollbarConfig>,
|
|
193
214
|
|
|
194
215
|
/**
|
|
195
216
|
* 已废弃,被 remote-config.queryMethod 替换
|
|
@@ -243,12 +264,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
243
264
|
internalData: SelectInternalData
|
|
244
265
|
}),
|
|
245
266
|
xID,
|
|
246
|
-
reactData
|
|
267
|
+
reactData,
|
|
268
|
+
|
|
269
|
+
reLayoutFlag: 0,
|
|
270
|
+
reScrollFlag: 0
|
|
247
271
|
}
|
|
248
272
|
},
|
|
249
273
|
computed: {
|
|
250
|
-
...({} as {
|
|
251
|
-
computeSize(): VxeComponentSizeType
|
|
274
|
+
...({} as VxeUseSizeComputed & VxeUseVScrollbarComputed & VxeUseInitVScrollbarComputed & {
|
|
252
275
|
$xeModal(): (VxeModalConstructor & VxeModalMethods) | null
|
|
253
276
|
$xeDrawer(): (VxeDrawerConstructor & VxeDrawerMethods) | null
|
|
254
277
|
$xeTable(): (VxeTableConstructor & VxeTablePrivateMethods) | null
|
|
@@ -500,6 +523,100 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
500
523
|
return `${labels.slice(0, multiMaxCharNum)}...`
|
|
501
524
|
}
|
|
502
525
|
return labels.join(', ')
|
|
526
|
+
},
|
|
527
|
+
computeScrollbarOpts () {
|
|
528
|
+
const $xeSelect = this
|
|
529
|
+
const props = $xeSelect
|
|
530
|
+
|
|
531
|
+
return Object.assign({}, getConfig().tree.scrollbarConfig, props.scrollbarConfig)
|
|
532
|
+
},
|
|
533
|
+
computeScrollbarXOpts () {
|
|
534
|
+
const $xeSelect = this
|
|
535
|
+
|
|
536
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
537
|
+
return Object.assign({}, getConfig().scrollbar.xConfig, scrollbarOpts.xConfig, {
|
|
538
|
+
visible: false
|
|
539
|
+
})
|
|
540
|
+
},
|
|
541
|
+
computeScrollbarYOpts () {
|
|
542
|
+
const $xeSelect = this
|
|
543
|
+
|
|
544
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
545
|
+
return Object.assign({}, getConfig().scrollbar.yConfig, scrollbarOpts.yConfig)
|
|
546
|
+
},
|
|
547
|
+
computeScrollXHeight () {
|
|
548
|
+
const $xeSelect = this
|
|
549
|
+
|
|
550
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
551
|
+
const scrollbarXOpts = $xeSelect.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
552
|
+
return getDefVal(getDefVal(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
553
|
+
},
|
|
554
|
+
computeScrollYWidth () {
|
|
555
|
+
const $xeSelect = this
|
|
556
|
+
|
|
557
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
558
|
+
const scrollbarYOpts = $xeSelect.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
559
|
+
return getDefVal(getDefVal(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
560
|
+
},
|
|
561
|
+
computeScrollXVisible () {
|
|
562
|
+
const $xeSelect = this
|
|
563
|
+
|
|
564
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
565
|
+
const scrollbarXOpts = $xeSelect.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
566
|
+
return getDefVal(scrollbarXOpts.visible, scrollbarOpts.visible)
|
|
567
|
+
},
|
|
568
|
+
computeScrollYVisible () {
|
|
569
|
+
const $xeSelect = this
|
|
570
|
+
|
|
571
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
572
|
+
const scrollbarYOpts = $xeSelect.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
573
|
+
return getDefVal(scrollbarYOpts.visible, scrollbarOpts.visible)
|
|
574
|
+
},
|
|
575
|
+
computeScrollXAutoHide () {
|
|
576
|
+
const $xeSelect = this
|
|
577
|
+
|
|
578
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
579
|
+
const scrollbarXOpts = $xeSelect.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
580
|
+
return getDefVal(getDefVal(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), getConfig().scrollbar.autoHide)
|
|
581
|
+
},
|
|
582
|
+
computeScrollYAutoHide () {
|
|
583
|
+
const $xeSelect = this
|
|
584
|
+
|
|
585
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts as VxeSelectPropTypes.ScrollbarConfig
|
|
586
|
+
const scrollbarYOpts = $xeSelect.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
587
|
+
return getDefVal(getDefVal(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), getConfig().scrollbar.autoHide)
|
|
588
|
+
},
|
|
589
|
+
computeScrollbarWrapperClss () {
|
|
590
|
+
const $xeSelect = this
|
|
591
|
+
const reactData = ($xeSelect as any).reactData as SelectReactData
|
|
592
|
+
|
|
593
|
+
const { yThumbHeight, xThumbWidth } = reactData
|
|
594
|
+
const scrollbarXToTop = $xeSelect.computeScrollbarXToTop
|
|
595
|
+
const scrollbarYToLeft = $xeSelect.computeScrollbarYToLeft
|
|
596
|
+
const scrollXVisible = $xeSelect.computeScrollXVisible
|
|
597
|
+
const scrollYVisible = $xeSelect.computeScrollYVisible
|
|
598
|
+
return domUtils.buildClass([
|
|
599
|
+
'vxe-scrollbar is--virtual',
|
|
600
|
+
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
601
|
+
`ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}`,
|
|
602
|
+
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
603
|
+
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
604
|
+
], {
|
|
605
|
+
'overflow-y': yThumbHeight,
|
|
606
|
+
'overflow-x': xThumbWidth
|
|
607
|
+
})
|
|
608
|
+
},
|
|
609
|
+
computeScrollbarXToTop () {
|
|
610
|
+
const $xeSelect = this
|
|
611
|
+
|
|
612
|
+
const scrollbarXOpts = $xeSelect.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
613
|
+
return scrollbarXOpts.position === 'top'
|
|
614
|
+
},
|
|
615
|
+
computeScrollbarYToLeft () {
|
|
616
|
+
const $xeSelect = this
|
|
617
|
+
|
|
618
|
+
const scrollbarYOpts = $xeSelect.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
619
|
+
return scrollbarYOpts.position === 'left'
|
|
503
620
|
}
|
|
504
621
|
},
|
|
505
622
|
methods: {
|
|
@@ -526,6 +643,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
526
643
|
$xeSelect.emitModel(value)
|
|
527
644
|
$xeSelect.dispatchEvent('default-change', { value }, null)
|
|
528
645
|
},
|
|
646
|
+
getScrollViewElem () {
|
|
647
|
+
const $xeSelect = this
|
|
648
|
+
|
|
649
|
+
const viewEl = $xeSelect.$refs.refVirtualWrapper as HTMLDivElement
|
|
650
|
+
return viewEl || null
|
|
651
|
+
},
|
|
529
652
|
isPanelVisible () {
|
|
530
653
|
const $xeSelect = this
|
|
531
654
|
const reactData = $xeSelect.reactData
|
|
@@ -1547,6 +1670,18 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1547
1670
|
}
|
|
1548
1671
|
})
|
|
1549
1672
|
},
|
|
1673
|
+
updateScrollbar () {
|
|
1674
|
+
const $xeSelect = this
|
|
1675
|
+
|
|
1676
|
+
const isVScrollbar = $xeSelect.computeIsVScrollbar
|
|
1677
|
+
if (isVScrollbar) {
|
|
1678
|
+
return $xeSelect.$nextTick().then(() => {
|
|
1679
|
+
$xeSelect.updateThumbSize()
|
|
1680
|
+
$xeSelect.updateThumbOffset()
|
|
1681
|
+
})
|
|
1682
|
+
}
|
|
1683
|
+
return Promise.resolve()
|
|
1684
|
+
},
|
|
1550
1685
|
/**
|
|
1551
1686
|
* 重新计算列表
|
|
1552
1687
|
*/
|
|
@@ -1555,7 +1690,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1555
1690
|
|
|
1556
1691
|
const el = $xeSelect.$refs.refElem as HTMLDivElement
|
|
1557
1692
|
if (el && el.clientWidth && el.clientHeight) {
|
|
1558
|
-
return $xeSelect.computeScrollLoad()
|
|
1693
|
+
return $xeSelect.computeScrollLoad().then(() => {
|
|
1694
|
+
return $xeSelect.updateScrollbar()
|
|
1695
|
+
})
|
|
1559
1696
|
}
|
|
1560
1697
|
return Promise.resolve()
|
|
1561
1698
|
},
|
|
@@ -1595,6 +1732,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1595
1732
|
const scrollBodyElem = evnt.target as HTMLDivElement
|
|
1596
1733
|
const scrollTop = scrollBodyElem.scrollTop
|
|
1597
1734
|
const scrollLeft = scrollBodyElem.scrollLeft
|
|
1735
|
+
const isVScrollbar = $xeSelect.computeIsVScrollbar
|
|
1736
|
+
if (isVScrollbar) {
|
|
1737
|
+
$xeSelect.updateThumbOffset()
|
|
1738
|
+
}
|
|
1598
1739
|
const isX = scrollLeft !== internalData.lastScrollLeft
|
|
1599
1740
|
const isY = scrollTop !== internalData.lastScrollTop
|
|
1600
1741
|
internalData.lastScrollTop = scrollTop
|
|
@@ -1686,6 +1827,30 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1686
1827
|
const { optGroupKeyMaps } = internalData
|
|
1687
1828
|
return !!optGroupKeyMaps[optid]
|
|
1688
1829
|
},
|
|
1830
|
+
// 滚动条
|
|
1831
|
+
bindScrollbarResize () {
|
|
1832
|
+
const $xeSelect = this
|
|
1833
|
+
const internalData = $xeSelect.internalData
|
|
1834
|
+
|
|
1835
|
+
const isVScrollbar = $xeSelect.computeIsVScrollbar
|
|
1836
|
+
const { scrollObserver } = internalData
|
|
1837
|
+
if (isVScrollbar) {
|
|
1838
|
+
if (!scrollObserver) {
|
|
1839
|
+
const el = $xeSelect.$refs.refElem as HTMLDivElement
|
|
1840
|
+
const viewInnerEl = $xeSelect.$refs.refVirtualSpaceElem as HTMLDivElement
|
|
1841
|
+
const scrollObserver = globalResize.create(() => {
|
|
1842
|
+
$xeSelect.reScrollFlag++
|
|
1843
|
+
})
|
|
1844
|
+
if (el) {
|
|
1845
|
+
scrollObserver.observe(el)
|
|
1846
|
+
}
|
|
1847
|
+
if (viewInnerEl) {
|
|
1848
|
+
scrollObserver.observe(viewInnerEl)
|
|
1849
|
+
}
|
|
1850
|
+
internalData.scrollObserver = scrollObserver
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
},
|
|
1689
1854
|
|
|
1690
1855
|
//
|
|
1691
1856
|
// Render
|
|
@@ -1909,8 +2074,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1909
2074
|
const reactData = $xeSelect.reactData
|
|
1910
2075
|
|
|
1911
2076
|
const { className, multiple, loading, filterable, showTotalButton, showCheckedButton, showClearButton, showCloseButton } = props
|
|
1912
|
-
const { initialized, isActivated, isAniVisible, optList, visiblePanel, bodyHeight, topSpaceHeight } = reactData
|
|
2077
|
+
const { initialized, isActivated, isAniVisible, optList, visiblePanel, bodyHeight, topSpaceHeight, xThumbWidth, yThumbHeight } = reactData
|
|
1913
2078
|
const vSize = $xeSelect.computeSize
|
|
2079
|
+
const isVScrollbar = $xeSelect.computeIsVScrollbar
|
|
1914
2080
|
const isDisabled = $xeSelect.computeIsDisabled
|
|
1915
2081
|
const selectLabel = $xeSelect.computeSelectLabel
|
|
1916
2082
|
const fullLabel = $xeSelect.computeFullLabel
|
|
@@ -1943,6 +2109,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1943
2109
|
const footerSlot = slots.footer
|
|
1944
2110
|
const prefixSlot = slots.prefix
|
|
1945
2111
|
const ppClassName = popupOpts.className || props.popupClassName
|
|
2112
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts
|
|
2113
|
+
const scrollXVisible = $xeSelect.computeScrollXVisible
|
|
2114
|
+
const scrollYVisible = $xeSelect.computeScrollYVisible
|
|
2115
|
+
const scrollbarXToTop = $xeSelect.computeScrollbarXToTop
|
|
2116
|
+
const scrollbarYToLeft = $xeSelect.computeScrollbarYToLeft
|
|
2117
|
+
const scrollXAutoHide = $xeSelect.computeScrollXAutoHide
|
|
2118
|
+
const scrollYAutoHide = $xeSelect.computeScrollYAutoHide
|
|
2119
|
+
const scrollbarWrapperClss = $xeSelect.computeScrollbarWrapperClss
|
|
1946
2120
|
return h('div', {
|
|
1947
2121
|
ref: 'refElem',
|
|
1948
2122
|
class: ['vxe-select', className ? (XEUtils.isFunction(className) ? className({ $select: $xeSelect }) : className) : '', {
|
|
@@ -2068,7 +2242,22 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2068
2242
|
])
|
|
2069
2243
|
: renderEmptyElement($xeSelect),
|
|
2070
2244
|
h('div', {
|
|
2071
|
-
class:
|
|
2245
|
+
class: [
|
|
2246
|
+
'vxe-select--panel-body',
|
|
2247
|
+
isVScrollbar ? `ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}` : '',
|
|
2248
|
+
isVScrollbar ? `ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}` : '',
|
|
2249
|
+
isVScrollbar ? `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}` : '',
|
|
2250
|
+
isVScrollbar ? `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}` : '',
|
|
2251
|
+
{
|
|
2252
|
+
|
|
2253
|
+
'is--virtual-scrollbar': isVScrollbar,
|
|
2254
|
+
'ov-padding': isVScrollbar && scrollbarOpts.padding,
|
|
2255
|
+
'ov-x--auto-hide': isVScrollbar && scrollXAutoHide,
|
|
2256
|
+
'ov-y--auto-hide': isVScrollbar && scrollYAutoHide,
|
|
2257
|
+
'overflow-y': yThumbHeight,
|
|
2258
|
+
'overflow-x': xThumbWidth
|
|
2259
|
+
}
|
|
2260
|
+
]
|
|
2072
2261
|
}, [
|
|
2073
2262
|
h('div', {
|
|
2074
2263
|
ref: 'refVirtualWrapper',
|
|
@@ -2078,6 +2267,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2078
2267
|
}
|
|
2079
2268
|
}, [
|
|
2080
2269
|
h('div', {
|
|
2270
|
+
ref: 'refVirtualSpaceElem',
|
|
2081
2271
|
class: 'vxe-select--y-space',
|
|
2082
2272
|
style: {
|
|
2083
2273
|
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
@@ -2090,7 +2280,58 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2090
2280
|
transform: `translateY(${topSpaceHeight}px)`
|
|
2091
2281
|
}
|
|
2092
2282
|
}, $xeSelect.renderOpts(h))
|
|
2093
|
-
])
|
|
2283
|
+
]),
|
|
2284
|
+
/**
|
|
2285
|
+
* 滚动条
|
|
2286
|
+
*/
|
|
2287
|
+
isVScrollbar
|
|
2288
|
+
? h('div', {
|
|
2289
|
+
class: scrollbarWrapperClss
|
|
2290
|
+
}, [
|
|
2291
|
+
scrollXVisible === false
|
|
2292
|
+
? renderEmptyElement($xeSelect)
|
|
2293
|
+
: h('div', {
|
|
2294
|
+
ref: 'refTrackXElem',
|
|
2295
|
+
class: 'vxe-scrollbar--track-x',
|
|
2296
|
+
on: {
|
|
2297
|
+
click: $xeSelect.clickTrackXEvent
|
|
2298
|
+
}
|
|
2299
|
+
}, [
|
|
2300
|
+
h('div', {
|
|
2301
|
+
ref: 'refThumbXElem',
|
|
2302
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
2303
|
+
on: {
|
|
2304
|
+
pointerdown: $xeSelect.pointerdownThumbXEvent,
|
|
2305
|
+
pointermove: $xeSelect.pointermoveThumbXEvent,
|
|
2306
|
+
pointerup: $xeSelect.cleatPointerThumbEvent,
|
|
2307
|
+
pointercancel: $xeSelect.cleatPointerThumbEvent,
|
|
2308
|
+
lostpointercapture: $xeSelect.cleatPointerThumbEvent
|
|
2309
|
+
}
|
|
2310
|
+
})
|
|
2311
|
+
]),
|
|
2312
|
+
scrollYVisible === false
|
|
2313
|
+
? renderEmptyElement($xeSelect)
|
|
2314
|
+
: h('div', {
|
|
2315
|
+
ref: 'refTrackYElem',
|
|
2316
|
+
class: 'vxe-scrollbar--track-y',
|
|
2317
|
+
on: {
|
|
2318
|
+
click: $xeSelect.clickTrackYEvent
|
|
2319
|
+
}
|
|
2320
|
+
}, [
|
|
2321
|
+
h('div', {
|
|
2322
|
+
ref: 'refThumbYElem',
|
|
2323
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
2324
|
+
on: {
|
|
2325
|
+
pointerdown: $xeSelect.pointerdownThumbYEvent,
|
|
2326
|
+
pointermove: $xeSelect.pointermoveThumbYEvent,
|
|
2327
|
+
pointerup: $xeSelect.cleatPointerThumbEvent,
|
|
2328
|
+
pointercancel: $xeSelect.cleatPointerThumbEvent,
|
|
2329
|
+
lostpointercapture: $xeSelect.cleatPointerThumbEvent
|
|
2330
|
+
}
|
|
2331
|
+
})
|
|
2332
|
+
])
|
|
2333
|
+
])
|
|
2334
|
+
: renderEmptyElement($xeSelect)
|
|
2094
2335
|
]),
|
|
2095
2336
|
footerSlot || showTotalButton || (showCloseButton && multiple)
|
|
2096
2337
|
? h('div', {
|
|
@@ -2145,6 +2386,54 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2145
2386
|
const $xeSelect = this
|
|
2146
2387
|
|
|
2147
2388
|
$xeSelect.loadData(val)
|
|
2389
|
+
},
|
|
2390
|
+
computeIsVScrollbar () {
|
|
2391
|
+
const $xeSelect = this
|
|
2392
|
+
|
|
2393
|
+
$xeSelect.$nextTick(() => {
|
|
2394
|
+
$xeSelect.bindScrollbarResize()
|
|
2395
|
+
$xeSelect.$nextTick(() => {
|
|
2396
|
+
$xeSelect.reLayoutFlag++
|
|
2397
|
+
})
|
|
2398
|
+
})
|
|
2399
|
+
},
|
|
2400
|
+
computeScrollYWidth () {
|
|
2401
|
+
const $xeSelect = this
|
|
2402
|
+
|
|
2403
|
+
$xeSelect.reLayoutFlag++
|
|
2404
|
+
},
|
|
2405
|
+
computeScrollXHeight () {
|
|
2406
|
+
const $xeSelect = this
|
|
2407
|
+
|
|
2408
|
+
$xeSelect.reLayoutFlag++
|
|
2409
|
+
},
|
|
2410
|
+
computeScrollXVisible () {
|
|
2411
|
+
const $xeSelect = this
|
|
2412
|
+
|
|
2413
|
+
$xeSelect.$nextTick(() => {
|
|
2414
|
+
$xeSelect.reLayoutFlag++
|
|
2415
|
+
})
|
|
2416
|
+
},
|
|
2417
|
+
computeScrollYVisible () {
|
|
2418
|
+
const $xeSelect = this
|
|
2419
|
+
|
|
2420
|
+
$xeSelect.$nextTick(() => {
|
|
2421
|
+
$xeSelect.reLayoutFlag++
|
|
2422
|
+
})
|
|
2423
|
+
},
|
|
2424
|
+
reLayoutFlag () {
|
|
2425
|
+
const $xeSelect = this
|
|
2426
|
+
|
|
2427
|
+
$xeSelect.recalculate().then(() => {
|
|
2428
|
+
$xeSelect.recalculate()
|
|
2429
|
+
})
|
|
2430
|
+
},
|
|
2431
|
+
reScrollFlag () {
|
|
2432
|
+
const $xeSelect = this
|
|
2433
|
+
|
|
2434
|
+
$xeSelect.updateScrollbar().then(() => {
|
|
2435
|
+
$xeSelect.updateScrollbar()
|
|
2436
|
+
})
|
|
2148
2437
|
}
|
|
2149
2438
|
},
|
|
2150
2439
|
created () {
|
|
@@ -2164,6 +2453,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2164
2453
|
$xeSelect.loadData(options)
|
|
2165
2454
|
}
|
|
2166
2455
|
})
|
|
2456
|
+
$xeSelect.reLayoutFlag++
|
|
2457
|
+
$xeSelect.bindScrollbarResize()
|
|
2167
2458
|
globalEvents.on($xeSelect, 'mousedown', $xeSelect.handleGlobalMousedownEvent)
|
|
2168
2459
|
globalEvents.on($xeSelect, 'keydown', $xeSelect.handleGlobalKeydownEvent)
|
|
2169
2460
|
globalEvents.on($xeSelect, 'blur', $xeSelect.handleGlobalBlurEvent)
|
|
@@ -2172,11 +2463,16 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2172
2463
|
},
|
|
2173
2464
|
beforeDestroy () {
|
|
2174
2465
|
const $xeSelect = this
|
|
2466
|
+
const internalData = $xeSelect.internalData
|
|
2175
2467
|
|
|
2468
|
+
const { scrollObserver } = internalData
|
|
2176
2469
|
const panelElem = $xeSelect.$refs.refOptionPanel as HTMLElement | undefined
|
|
2177
2470
|
if (panelElem && panelElem.parentNode) {
|
|
2178
2471
|
panelElem.parentNode.removeChild(panelElem)
|
|
2179
2472
|
}
|
|
2473
|
+
if (scrollObserver) {
|
|
2474
|
+
scrollObserver.disconnect()
|
|
2475
|
+
}
|
|
2180
2476
|
globalEvents.off($xeSelect, 'mousedown')
|
|
2181
2477
|
globalEvents.off($xeSelect, 'keydown')
|
|
2182
2478
|
globalEvents.off($xeSelect, 'blur')
|
|
@@ -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 { VxeTabsPropTypes, VxeTabPaneProps, VxeTabsEmits, TabsInternalData, TabsReactData,
|
|
12
|
+
import type { VxeTabsPropTypes, VxeTabPaneProps, VxeTabsEmits, TabsInternalData, TabsReactData, VxeUseSizeComputed, VxeUseInitVScrollbarComputed, VxeTabsConstructor, VxeTabsPrivateMethods, VxeTabPaneDefines, ValueOf, VxeComponentStyleType } from '../../../types'
|
|
13
13
|
|
|
14
14
|
const { baseUtils, createEvent, getConfig, getIcon, globalEvents, permission, renderEmptyElement } = VxeUI
|
|
15
15
|
const { getDefVal } = baseUtils
|
|
@@ -106,9 +106,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
computed: {
|
|
109
|
-
...({} as {
|
|
110
|
-
computeSize(): VxeComponentSizeType
|
|
111
|
-
computeIsVScrollbar(): VxeComponentIsVScrollbar
|
|
109
|
+
...({} as VxeUseSizeComputed & VxeUseInitVScrollbarComputed & {
|
|
112
110
|
$xeParentTabs():(VxeTabsConstructor & VxeTabsPrivateMethods) | null
|
|
113
111
|
}),
|
|
114
112
|
computeParentTabsResizeFlag () {
|
|
@@ -298,9 +298,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
298
298
|
return $xeTooltip.updateTipStyle().then(() => {
|
|
299
299
|
return $xeTooltip.updateTipStyle()
|
|
300
300
|
}).then(() => {
|
|
301
|
-
|
|
302
|
-
return $xeTooltip.updateTipStyle()
|
|
303
|
-
}, 15)
|
|
301
|
+
return $xeTooltip.updateTipStyle()
|
|
304
302
|
})
|
|
305
303
|
},
|
|
306
304
|
isActived () {
|
|
@@ -640,7 +638,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
640
638
|
|
|
641
639
|
const $scrollbar = $xeTooltip.$refs.contentScrollbar as VxeScrollbarInstance
|
|
642
640
|
if ($scrollbar) {
|
|
643
|
-
const viewEl = $scrollbar.
|
|
641
|
+
const viewEl = $scrollbar.getScrollViewElem()
|
|
644
642
|
if (viewEl) {
|
|
645
643
|
viewEl.addEventListener('wheel', $xeTooltip.wheelEvent, { passive: false })
|
|
646
644
|
internalData.scrollbarViewEl = viewEl
|