vxe-pc-ui 3.20.9 → 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.
- 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 +8 -182
- package/es/scrollbar/src/scrollbar.js +24 -188
- package/es/select/src/select.js +273 -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 +17 -190
- 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 +715 -741
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +6 -188
- 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 +322 -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 +16 -196
- 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 +11 -202
- package/packages/scrollbar/src/scrollbar.ts +24 -199
- package/packages/select/src/select.ts +304 -11
- package/packages/tabs/src/tabs.ts +2 -4
- package/packages/tooltip/src/tooltip.ts +2 -4
- package/packages/tree/src/tree.ts +20 -211
- 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 +8 -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 +20 -20
- package/types/components/tree.d.ts +7 -16
- /package/es/icon/{iconfont.1792139429655.ttf → iconfont.1792219842866.ttf} +0 -0
- /package/es/icon/{iconfont.1792139429655.woff → iconfont.1792219842866.woff} +0 -0
- /package/es/icon/{iconfont.1792139429655.woff2 → iconfont.1792219842866.woff2} +0 -0
- /package/es/{iconfont.1792139429655.ttf → iconfont.1792219842866.ttf} +0 -0
- /package/es/{iconfont.1792139429655.woff → iconfont.1792219842866.woff} +0 -0
- /package/es/{iconfont.1792139429655.woff2 → iconfont.1792219842866.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1792139429655.ttf → iconfont.1792219842866.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1792139429655.woff → iconfont.1792219842866.woff} +0 -0
- /package/lib/icon/style/{iconfont.1792139429655.woff2 → iconfont.1792219842866.woff2} +0 -0
- /package/lib/{iconfont.1792139429655.ttf → iconfont.1792219842866.ttf} +0 -0
- /package/lib/{iconfont.1792139429655.woff → iconfont.1792219842866.woff} +0 -0
- /package/lib/{iconfont.1792139429655.woff2 → iconfont.1792219842866.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,7 @@ 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
|
+
$xeSelect.updateThumbOffset()
|
|
1598
1736
|
const isX = scrollLeft !== internalData.lastScrollLeft
|
|
1599
1737
|
const isY = scrollTop !== internalData.lastScrollTop
|
|
1600
1738
|
internalData.lastScrollTop = scrollTop
|
|
@@ -1686,6 +1824,30 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1686
1824
|
const { optGroupKeyMaps } = internalData
|
|
1687
1825
|
return !!optGroupKeyMaps[optid]
|
|
1688
1826
|
},
|
|
1827
|
+
// 滚动条
|
|
1828
|
+
bindScrollbarResize () {
|
|
1829
|
+
const $xeSelect = this
|
|
1830
|
+
const internalData = $xeSelect.internalData
|
|
1831
|
+
|
|
1832
|
+
const isVScrollbar = $xeSelect.computeIsVScrollbar
|
|
1833
|
+
const { scrollObserver } = internalData
|
|
1834
|
+
if (isVScrollbar) {
|
|
1835
|
+
if (!scrollObserver) {
|
|
1836
|
+
const el = $xeSelect.$refs.refElem as HTMLDivElement
|
|
1837
|
+
const viewInnerEl = $xeSelect.$refs.refVirtualSpaceElem as HTMLDivElement
|
|
1838
|
+
const scrollObserver = globalResize.create(() => {
|
|
1839
|
+
$xeSelect.reScrollFlag++
|
|
1840
|
+
})
|
|
1841
|
+
if (el) {
|
|
1842
|
+
scrollObserver.observe(el)
|
|
1843
|
+
}
|
|
1844
|
+
if (viewInnerEl) {
|
|
1845
|
+
scrollObserver.observe(viewInnerEl)
|
|
1846
|
+
}
|
|
1847
|
+
internalData.scrollObserver = scrollObserver
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
},
|
|
1689
1851
|
|
|
1690
1852
|
//
|
|
1691
1853
|
// Render
|
|
@@ -1909,8 +2071,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1909
2071
|
const reactData = $xeSelect.reactData
|
|
1910
2072
|
|
|
1911
2073
|
const { className, multiple, loading, filterable, showTotalButton, showCheckedButton, showClearButton, showCloseButton } = props
|
|
1912
|
-
const { initialized, isActivated, isAniVisible, optList, visiblePanel, bodyHeight, topSpaceHeight } = reactData
|
|
2074
|
+
const { initialized, isActivated, isAniVisible, optList, visiblePanel, bodyHeight, topSpaceHeight, xThumbWidth, yThumbHeight } = reactData
|
|
1913
2075
|
const vSize = $xeSelect.computeSize
|
|
2076
|
+
const isVScrollbar = $xeSelect.computeIsVScrollbar
|
|
1914
2077
|
const isDisabled = $xeSelect.computeIsDisabled
|
|
1915
2078
|
const selectLabel = $xeSelect.computeSelectLabel
|
|
1916
2079
|
const fullLabel = $xeSelect.computeFullLabel
|
|
@@ -1943,6 +2106,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1943
2106
|
const footerSlot = slots.footer
|
|
1944
2107
|
const prefixSlot = slots.prefix
|
|
1945
2108
|
const ppClassName = popupOpts.className || props.popupClassName
|
|
2109
|
+
const scrollbarOpts = $xeSelect.computeScrollbarOpts
|
|
2110
|
+
const scrollXVisible = $xeSelect.computeScrollXVisible
|
|
2111
|
+
const scrollYVisible = $xeSelect.computeScrollYVisible
|
|
2112
|
+
const scrollbarXToTop = $xeSelect.computeScrollbarXToTop
|
|
2113
|
+
const scrollbarYToLeft = $xeSelect.computeScrollbarYToLeft
|
|
2114
|
+
const scrollXAutoHide = $xeSelect.computeScrollXAutoHide
|
|
2115
|
+
const scrollYAutoHide = $xeSelect.computeScrollYAutoHide
|
|
2116
|
+
const scrollbarWrapperClss = $xeSelect.computeScrollbarWrapperClss
|
|
1946
2117
|
return h('div', {
|
|
1947
2118
|
ref: 'refElem',
|
|
1948
2119
|
class: ['vxe-select', className ? (XEUtils.isFunction(className) ? className({ $select: $xeSelect }) : className) : '', {
|
|
@@ -2068,7 +2239,22 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2068
2239
|
])
|
|
2069
2240
|
: renderEmptyElement($xeSelect),
|
|
2070
2241
|
h('div', {
|
|
2071
|
-
class:
|
|
2242
|
+
class: [
|
|
2243
|
+
'vxe-select--panel-body',
|
|
2244
|
+
isVScrollbar ? `ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}` : '',
|
|
2245
|
+
isVScrollbar ? `ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}` : '',
|
|
2246
|
+
isVScrollbar ? `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}` : '',
|
|
2247
|
+
isVScrollbar ? `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}` : '',
|
|
2248
|
+
{
|
|
2249
|
+
|
|
2250
|
+
'is--virtual-scrollbar': isVScrollbar,
|
|
2251
|
+
'ov-padding': isVScrollbar && scrollbarOpts.padding,
|
|
2252
|
+
'ov-x--auto-hide': isVScrollbar && scrollXAutoHide,
|
|
2253
|
+
'ov-y--auto-hide': isVScrollbar && scrollYAutoHide,
|
|
2254
|
+
'overflow-y': yThumbHeight,
|
|
2255
|
+
'overflow-x': xThumbWidth
|
|
2256
|
+
}
|
|
2257
|
+
]
|
|
2072
2258
|
}, [
|
|
2073
2259
|
h('div', {
|
|
2074
2260
|
ref: 'refVirtualWrapper',
|
|
@@ -2078,6 +2264,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2078
2264
|
}
|
|
2079
2265
|
}, [
|
|
2080
2266
|
h('div', {
|
|
2267
|
+
ref: 'refVirtualSpaceElem',
|
|
2081
2268
|
class: 'vxe-select--y-space',
|
|
2082
2269
|
style: {
|
|
2083
2270
|
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
@@ -2090,7 +2277,58 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2090
2277
|
transform: `translateY(${topSpaceHeight}px)`
|
|
2091
2278
|
}
|
|
2092
2279
|
}, $xeSelect.renderOpts(h))
|
|
2093
|
-
])
|
|
2280
|
+
]),
|
|
2281
|
+
/**
|
|
2282
|
+
* 滚动条
|
|
2283
|
+
*/
|
|
2284
|
+
isVScrollbar
|
|
2285
|
+
? h('div', {
|
|
2286
|
+
class: scrollbarWrapperClss
|
|
2287
|
+
}, [
|
|
2288
|
+
scrollXVisible === false
|
|
2289
|
+
? renderEmptyElement($xeSelect)
|
|
2290
|
+
: h('div', {
|
|
2291
|
+
ref: 'refTrackXElem',
|
|
2292
|
+
class: 'vxe-scrollbar--track-x',
|
|
2293
|
+
on: {
|
|
2294
|
+
click: $xeSelect.clickTrackXEvent
|
|
2295
|
+
}
|
|
2296
|
+
}, [
|
|
2297
|
+
h('div', {
|
|
2298
|
+
ref: 'refThumbXElem',
|
|
2299
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
2300
|
+
on: {
|
|
2301
|
+
pointerdown: $xeSelect.pointerdownThumbXEvent,
|
|
2302
|
+
pointermove: $xeSelect.pointermoveThumbXEvent,
|
|
2303
|
+
pointerup: $xeSelect.cleatPointerThumbEvent,
|
|
2304
|
+
pointercancel: $xeSelect.cleatPointerThumbEvent,
|
|
2305
|
+
lostpointercapture: $xeSelect.cleatPointerThumbEvent
|
|
2306
|
+
}
|
|
2307
|
+
})
|
|
2308
|
+
]),
|
|
2309
|
+
scrollYVisible === false
|
|
2310
|
+
? renderEmptyElement($xeSelect)
|
|
2311
|
+
: h('div', {
|
|
2312
|
+
ref: 'refTrackYElem',
|
|
2313
|
+
class: 'vxe-scrollbar--track-y',
|
|
2314
|
+
on: {
|
|
2315
|
+
click: $xeSelect.clickTrackYEvent
|
|
2316
|
+
}
|
|
2317
|
+
}, [
|
|
2318
|
+
h('div', {
|
|
2319
|
+
ref: 'refThumbYElem',
|
|
2320
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
2321
|
+
on: {
|
|
2322
|
+
pointerdown: $xeSelect.pointerdownThumbYEvent,
|
|
2323
|
+
pointermove: $xeSelect.pointermoveThumbYEvent,
|
|
2324
|
+
pointerup: $xeSelect.cleatPointerThumbEvent,
|
|
2325
|
+
pointercancel: $xeSelect.cleatPointerThumbEvent,
|
|
2326
|
+
lostpointercapture: $xeSelect.cleatPointerThumbEvent
|
|
2327
|
+
}
|
|
2328
|
+
})
|
|
2329
|
+
])
|
|
2330
|
+
])
|
|
2331
|
+
: renderEmptyElement($xeSelect)
|
|
2094
2332
|
]),
|
|
2095
2333
|
footerSlot || showTotalButton || (showCloseButton && multiple)
|
|
2096
2334
|
? h('div', {
|
|
@@ -2145,6 +2383,54 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2145
2383
|
const $xeSelect = this
|
|
2146
2384
|
|
|
2147
2385
|
$xeSelect.loadData(val)
|
|
2386
|
+
},
|
|
2387
|
+
computeIsVScrollbar () {
|
|
2388
|
+
const $xeSelect = this
|
|
2389
|
+
|
|
2390
|
+
$xeSelect.$nextTick(() => {
|
|
2391
|
+
$xeSelect.bindScrollbarResize()
|
|
2392
|
+
$xeSelect.$nextTick(() => {
|
|
2393
|
+
$xeSelect.reLayoutFlag++
|
|
2394
|
+
})
|
|
2395
|
+
})
|
|
2396
|
+
},
|
|
2397
|
+
computeScrollYWidth () {
|
|
2398
|
+
const $xeSelect = this
|
|
2399
|
+
|
|
2400
|
+
$xeSelect.reLayoutFlag++
|
|
2401
|
+
},
|
|
2402
|
+
computeScrollXHeight () {
|
|
2403
|
+
const $xeSelect = this
|
|
2404
|
+
|
|
2405
|
+
$xeSelect.reLayoutFlag++
|
|
2406
|
+
},
|
|
2407
|
+
computeScrollXVisible () {
|
|
2408
|
+
const $xeSelect = this
|
|
2409
|
+
|
|
2410
|
+
$xeSelect.$nextTick(() => {
|
|
2411
|
+
$xeSelect.reLayoutFlag++
|
|
2412
|
+
})
|
|
2413
|
+
},
|
|
2414
|
+
computeScrollYVisible () {
|
|
2415
|
+
const $xeSelect = this
|
|
2416
|
+
|
|
2417
|
+
$xeSelect.$nextTick(() => {
|
|
2418
|
+
$xeSelect.reLayoutFlag++
|
|
2419
|
+
})
|
|
2420
|
+
},
|
|
2421
|
+
reLayoutFlag () {
|
|
2422
|
+
const $xeSelect = this
|
|
2423
|
+
|
|
2424
|
+
$xeSelect.recalculate().then(() => {
|
|
2425
|
+
$xeSelect.recalculate()
|
|
2426
|
+
})
|
|
2427
|
+
},
|
|
2428
|
+
reScrollFlag () {
|
|
2429
|
+
const $xeSelect = this
|
|
2430
|
+
|
|
2431
|
+
$xeSelect.updateScrollbar().then(() => {
|
|
2432
|
+
$xeSelect.updateScrollbar()
|
|
2433
|
+
})
|
|
2148
2434
|
}
|
|
2149
2435
|
},
|
|
2150
2436
|
created () {
|
|
@@ -2164,6 +2450,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2164
2450
|
$xeSelect.loadData(options)
|
|
2165
2451
|
}
|
|
2166
2452
|
})
|
|
2453
|
+
$xeSelect.reLayoutFlag++
|
|
2454
|
+
$xeSelect.bindScrollbarResize()
|
|
2167
2455
|
globalEvents.on($xeSelect, 'mousedown', $xeSelect.handleGlobalMousedownEvent)
|
|
2168
2456
|
globalEvents.on($xeSelect, 'keydown', $xeSelect.handleGlobalKeydownEvent)
|
|
2169
2457
|
globalEvents.on($xeSelect, 'blur', $xeSelect.handleGlobalBlurEvent)
|
|
@@ -2172,11 +2460,16 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2172
2460
|
},
|
|
2173
2461
|
beforeDestroy () {
|
|
2174
2462
|
const $xeSelect = this
|
|
2463
|
+
const internalData = $xeSelect.internalData
|
|
2175
2464
|
|
|
2465
|
+
const { scrollObserver } = internalData
|
|
2176
2466
|
const panelElem = $xeSelect.$refs.refOptionPanel as HTMLElement | undefined
|
|
2177
2467
|
if (panelElem && panelElem.parentNode) {
|
|
2178
2468
|
panelElem.parentNode.removeChild(panelElem)
|
|
2179
2469
|
}
|
|
2470
|
+
if (scrollObserver) {
|
|
2471
|
+
scrollObserver.disconnect()
|
|
2472
|
+
}
|
|
2180
2473
|
globalEvents.off($xeSelect, 'mousedown')
|
|
2181
2474
|
globalEvents.off($xeSelect, 'keydown')
|
|
2182
2475
|
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
|