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
|
@@ -7,18 +7,17 @@ import { createComponentLog } from '../../ui/src/log'
|
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { crossTreeDragNodeGlobal, getCrossTreeDragNodeInfo } from './store'
|
|
9
9
|
import { toCssUnit, isScale, getPaddingTopBottomSize, addClass, removeClass, getTpImg, hasControlKey, getEventTargetNode, hasClass } from '../../ui/src/dom'
|
|
10
|
-
import { isEnableConf, enModelValue, deModelValue, getText
|
|
10
|
+
import { isEnableConf, enModelValue, deModelValue, getText } from '../../ui/src/utils'
|
|
11
11
|
import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime'
|
|
12
12
|
import VxeLoadingComponent from '../../loading'
|
|
13
13
|
import VxeTooltipComponent from '../../tooltip'
|
|
14
14
|
|
|
15
|
-
import type { TreeReactData, VxeTreeEmits, VxeTreeConstructor, VxeTreePropTypes, TreeInternalData, VxeTreeDefines, VxeTreePrivateMethods,
|
|
15
|
+
import type { TreeReactData, VxeTreeEmits, VxeTreeConstructor, VxeTreePropTypes, TreeInternalData, VxeTreeDefines, VxeTreePrivateMethods, ValueOf, VxeTooltipInstance, VxeComponentStyleType, VxeScrollbarPropTypes, VxeUseSizeComputed, VxeUseVScrollbarComputed, VxeUseInitVScrollbarComputed } from '../../../types'
|
|
16
16
|
|
|
17
17
|
const { warnLog, errLog } = createComponentLog('tree')
|
|
18
18
|
|
|
19
|
-
const { menus,
|
|
20
|
-
|
|
21
|
-
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils
|
|
19
|
+
const { menus, getConfig, getI18n, getIcon, baseUtils } = VxeUI
|
|
20
|
+
const { getDefVal } = baseUtils
|
|
22
21
|
|
|
23
22
|
let crossTreeDragNodeObj: {
|
|
24
23
|
$oldTree: VxeTreeConstructor & VxeTreePrivateMethods
|
|
@@ -620,7 +619,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
620
619
|
name: 'VxeTree',
|
|
621
620
|
mixins: [
|
|
622
621
|
globalMixins.sizeMixin,
|
|
623
|
-
globalMixins.vScrollbarMixin
|
|
622
|
+
globalMixins.vScrollbarMixin,
|
|
623
|
+
globalMixins.initVScrollbarMixin
|
|
624
624
|
],
|
|
625
625
|
props: {
|
|
626
626
|
data: Array as PropType<VxeTreePropTypes.Data>,
|
|
@@ -752,7 +752,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
752
752
|
virtualYConfig: Object as PropType<VxeTreePropTypes.VirtualYConfig>,
|
|
753
753
|
useScrollbar: {
|
|
754
754
|
type: Boolean as PropType<VxeTreePropTypes.UseScrollbar>,
|
|
755
|
-
default: () =>
|
|
755
|
+
default: () => getDefVal(getConfig().tree.useScrollbar, getConfig().useScrollbar)
|
|
756
756
|
},
|
|
757
757
|
scrollbarConfig: Object as PropType<VxeTreePropTypes.ScrollbarConfig>
|
|
758
758
|
},
|
|
@@ -779,10 +779,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
779
779
|
}
|
|
780
780
|
},
|
|
781
781
|
computed: {
|
|
782
|
-
...({} as
|
|
783
|
-
computeSize(): VxeComponentSizeType,
|
|
784
|
-
computeIsVScrollbar(): VxeComponentIsVScrollbar
|
|
785
|
-
}),
|
|
782
|
+
...({} as VxeUseSizeComputed & VxeUseVScrollbarComputed & VxeUseInitVScrollbarComputed),
|
|
786
783
|
computeTitleField () {
|
|
787
784
|
const $xeTree = this
|
|
788
785
|
const props = $xeTree
|
|
@@ -972,42 +969,42 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
972
969
|
|
|
973
970
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
974
971
|
const scrollbarXOpts = $xeTree.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
975
|
-
return
|
|
972
|
+
return getDefVal(getDefVal(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
976
973
|
},
|
|
977
974
|
computeScrollYWidth () {
|
|
978
975
|
const $xeTree = this
|
|
979
976
|
|
|
980
977
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
981
978
|
const scrollbarYOpts = $xeTree.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
982
|
-
return
|
|
979
|
+
return getDefVal(getDefVal(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
983
980
|
},
|
|
984
981
|
computeScrollXVisible () {
|
|
985
982
|
const $xeTree = this
|
|
986
983
|
|
|
987
984
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
988
985
|
const scrollbarXOpts = $xeTree.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
989
|
-
return
|
|
986
|
+
return getDefVal(scrollbarXOpts.visible, scrollbarOpts.visible)
|
|
990
987
|
},
|
|
991
988
|
computeScrollYVisible () {
|
|
992
989
|
const $xeTree = this
|
|
993
990
|
|
|
994
991
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
995
992
|
const scrollbarYOpts = $xeTree.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
996
|
-
return
|
|
993
|
+
return getDefVal(scrollbarYOpts.visible, scrollbarOpts.visible)
|
|
997
994
|
},
|
|
998
995
|
computeScrollXAutoHide () {
|
|
999
996
|
const $xeTree = this
|
|
1000
997
|
|
|
1001
998
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
1002
999
|
const scrollbarXOpts = $xeTree.computeScrollbarXOpts as VxeScrollbarPropTypes.XConfig
|
|
1003
|
-
return
|
|
1000
|
+
return getDefVal(getDefVal(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), getConfig().scrollbar.autoHide)
|
|
1004
1001
|
},
|
|
1005
1002
|
computeScrollYAutoHide () {
|
|
1006
1003
|
const $xeTree = this
|
|
1007
1004
|
|
|
1008
1005
|
const scrollbarOpts = $xeTree.computeScrollbarOpts as VxeTreePropTypes.ScrollbarConfig
|
|
1009
1006
|
const scrollbarYOpts = $xeTree.computeScrollbarYOpts as VxeScrollbarPropTypes.YConfig
|
|
1010
|
-
return
|
|
1007
|
+
return getDefVal(getDefVal(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), getConfig().scrollbar.autoHide)
|
|
1011
1008
|
},
|
|
1012
1009
|
computeScrollbarWrapperClss () {
|
|
1013
1010
|
const $xeTree = this
|
|
@@ -1050,6 +1047,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1050
1047
|
const $xeTree = this
|
|
1051
1048
|
$xeTree.$emit(type, createEvent(evnt, { $tree: $xeTree }, params))
|
|
1052
1049
|
},
|
|
1050
|
+
getScrollViewElem () {
|
|
1051
|
+
const $xeTree = this
|
|
1052
|
+
|
|
1053
|
+
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
1054
|
+
return viewEl || null
|
|
1055
|
+
},
|
|
1053
1056
|
getNodeId (node: any) {
|
|
1054
1057
|
const $xeTree = this
|
|
1055
1058
|
|
|
@@ -1777,7 +1780,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1777
1780
|
const scrollLeft = scrollBodyElem.scrollLeft
|
|
1778
1781
|
const isX = scrollLeft !== internalData.lastScrollLeft
|
|
1779
1782
|
const isY = scrollTop !== internalData.lastScrollTop
|
|
1780
|
-
$xeTree.
|
|
1783
|
+
const isVScrollbar = $xeTree.computeIsVScrollbar
|
|
1784
|
+
if (isVScrollbar) {
|
|
1785
|
+
$xeTree.updateThumbOffset()
|
|
1786
|
+
}
|
|
1781
1787
|
internalData.lastScrollTop = scrollTop
|
|
1782
1788
|
internalData.lastScrollLeft = scrollLeft
|
|
1783
1789
|
if (reactData.scrollYLoad) {
|
|
@@ -3459,7 +3465,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3459
3465
|
}, evnt)
|
|
3460
3466
|
}
|
|
3461
3467
|
},
|
|
3462
|
-
|
|
3463
3468
|
// 滚动条
|
|
3464
3469
|
bindScrollbarResize () {
|
|
3465
3470
|
const $xeTree = this
|
|
@@ -3484,199 +3489,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3484
3489
|
}
|
|
3485
3490
|
}
|
|
3486
3491
|
},
|
|
3487
|
-
updateThumbSize () {
|
|
3488
|
-
const $xeTree = this
|
|
3489
|
-
const reactData = $xeTree.reactData
|
|
3490
|
-
|
|
3491
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3492
|
-
if (!viewEl) {
|
|
3493
|
-
return
|
|
3494
|
-
}
|
|
3495
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
3496
|
-
return
|
|
3497
|
-
}
|
|
3498
|
-
const trackXEl = $xeTree.$refs.refTrackXElem as HTMLDivElement
|
|
3499
|
-
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0
|
|
3500
|
-
const thumbXElem = $xeTree.$refs.refThumbXElem as HTMLDivElement
|
|
3501
|
-
if (thumbXElem) {
|
|
3502
|
-
thumbXElem.style.width = xThumbWidth + 'px'
|
|
3503
|
-
}
|
|
3504
|
-
reactData.xThumbWidth = xThumbWidth
|
|
3505
|
-
|
|
3506
|
-
const trackYEl = $xeTree.$refs.refTrackYElem as HTMLDivElement
|
|
3507
|
-
|
|
3508
|
-
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0
|
|
3509
|
-
const thumbYElem = $xeTree.$refs.refThumbYElem as HTMLDivElement
|
|
3510
|
-
if (thumbYElem) {
|
|
3511
|
-
thumbYElem.style.height = yThumbHeight + 'px'
|
|
3512
|
-
}
|
|
3513
|
-
reactData.yThumbHeight = yThumbHeight
|
|
3514
|
-
},
|
|
3515
|
-
updateThumbOffset () {
|
|
3516
|
-
const $xeTree = this
|
|
3517
|
-
const reactData = $xeTree.reactData
|
|
3518
|
-
const internalData = $xeTree.internalData
|
|
3519
|
-
|
|
3520
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3521
|
-
if (!viewEl) {
|
|
3522
|
-
return
|
|
3523
|
-
}
|
|
3524
|
-
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
3525
|
-
return
|
|
3526
|
-
}
|
|
3527
|
-
const { xThumbWidth, yThumbHeight } = reactData
|
|
3528
|
-
const trackXEl = $xeTree.$refs.refTrackXElem as HTMLDivElement
|
|
3529
|
-
const thumbXElem = $xeTree.$refs.refThumbXElem as HTMLDivElement
|
|
3530
|
-
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0
|
|
3531
|
-
internalData.xThumbLeft = xThumbLeft
|
|
3532
|
-
if (thumbXElem && xThumbWidth) {
|
|
3533
|
-
thumbXElem.style.width = xThumbWidth + 'px'
|
|
3534
|
-
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`
|
|
3535
|
-
}
|
|
3536
|
-
|
|
3537
|
-
const trackYEl = $xeTree.$refs.refTrackYElem as HTMLDivElement
|
|
3538
|
-
const thumbYElem = $xeTree.$refs.refThumbYElem as HTMLDivElement
|
|
3539
|
-
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0
|
|
3540
|
-
internalData.yThumbTop = yThumbTop
|
|
3541
|
-
if (thumbYElem && yThumbHeight) {
|
|
3542
|
-
thumbYElem.style.height = yThumbHeight + 'px'
|
|
3543
|
-
thumbYElem.style.transform = `translateY(${yThumbTop}px)`
|
|
3544
|
-
}
|
|
3545
|
-
},
|
|
3546
|
-
clickTrackXEvent (evnt: MouseEvent) {
|
|
3547
|
-
const $xeTree = this
|
|
3548
|
-
const reactData = $xeTree.reactData
|
|
3549
|
-
|
|
3550
|
-
const trackEl = evnt.currentTarget as HTMLDivElement
|
|
3551
|
-
if (trackEl !== evnt.target) {
|
|
3552
|
-
return
|
|
3553
|
-
}
|
|
3554
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3555
|
-
if (!viewEl) {
|
|
3556
|
-
return
|
|
3557
|
-
}
|
|
3558
|
-
const { xThumbWidth } = reactData
|
|
3559
|
-
const trackRect = trackEl.getBoundingClientRect()
|
|
3560
|
-
viewEl.scrollTo({
|
|
3561
|
-
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
3562
|
-
behavior: 'auto'
|
|
3563
|
-
})
|
|
3564
|
-
},
|
|
3565
|
-
clickTrackYEvent (evnt: MouseEvent) {
|
|
3566
|
-
const $xeTree = this
|
|
3567
|
-
const reactData = $xeTree.reactData
|
|
3568
|
-
|
|
3569
|
-
const trackEl = evnt.currentTarget as HTMLDivElement
|
|
3570
|
-
if (trackEl !== evnt.target) {
|
|
3571
|
-
return
|
|
3572
|
-
}
|
|
3573
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3574
|
-
if (!viewEl) {
|
|
3575
|
-
return
|
|
3576
|
-
}
|
|
3577
|
-
const { yThumbHeight } = reactData
|
|
3578
|
-
const trackRect = trackEl.getBoundingClientRect()
|
|
3579
|
-
viewEl.scrollTo({
|
|
3580
|
-
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
3581
|
-
behavior: 'auto'
|
|
3582
|
-
})
|
|
3583
|
-
},
|
|
3584
|
-
pointerdownThumbXEvent (evnt: PointerEvent) {
|
|
3585
|
-
const $xeTree = this
|
|
3586
|
-
const reactData = $xeTree.reactData
|
|
3587
|
-
const internalData = $xeTree.internalData
|
|
3588
|
-
|
|
3589
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3590
|
-
internalData.isThumbDrag = true
|
|
3591
|
-
thumbEl.setPointerCapture(evnt.pointerId)
|
|
3592
|
-
|
|
3593
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3594
|
-
if (!viewEl) {
|
|
3595
|
-
return
|
|
3596
|
-
}
|
|
3597
|
-
const { xThumbWidth } = reactData
|
|
3598
|
-
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
3599
|
-
const trackRect = trackEl.getBoundingClientRect()
|
|
3600
|
-
const pointerPosition = evnt.clientX - trackRect.left
|
|
3601
|
-
// 记录 thumb 的偏移
|
|
3602
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth)
|
|
3603
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset
|
|
3604
|
-
},
|
|
3605
|
-
pointermoveThumbXEvent (evnt: PointerEvent) {
|
|
3606
|
-
const $xeTree = this
|
|
3607
|
-
const reactData = $xeTree.reactData
|
|
3608
|
-
const internalData = $xeTree.internalData
|
|
3609
|
-
|
|
3610
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3611
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
3612
|
-
return
|
|
3613
|
-
}
|
|
3614
|
-
const { isThumbDrag, thumbDragOffset } = internalData
|
|
3615
|
-
if (isThumbDrag) {
|
|
3616
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3617
|
-
if (!viewEl) {
|
|
3618
|
-
return
|
|
3619
|
-
}
|
|
3620
|
-
const { xThumbWidth } = reactData
|
|
3621
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3622
|
-
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
3623
|
-
const trackRect = trackEl.getBoundingClientRect()
|
|
3624
|
-
// 更新偏移
|
|
3625
|
-
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth)
|
|
3626
|
-
}
|
|
3627
|
-
},
|
|
3628
|
-
cleatPointerThumbEvent (evnt: PointerEvent) {
|
|
3629
|
-
const $xeTree = this
|
|
3630
|
-
const internalData = $xeTree.internalData
|
|
3631
|
-
|
|
3632
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3633
|
-
thumbEl.releasePointerCapture(evnt.pointerId)
|
|
3634
|
-
internalData.isThumbDrag = false
|
|
3635
|
-
},
|
|
3636
|
-
pointerdownThumbYEvent (evnt: PointerEvent) {
|
|
3637
|
-
const $xeTree = this
|
|
3638
|
-
const reactData = $xeTree.reactData
|
|
3639
|
-
const internalData = $xeTree.internalData
|
|
3640
|
-
|
|
3641
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3642
|
-
internalData.isThumbDrag = true
|
|
3643
|
-
thumbEl.setPointerCapture(evnt.pointerId)
|
|
3644
|
-
|
|
3645
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3646
|
-
if (!viewEl) {
|
|
3647
|
-
return
|
|
3648
|
-
}
|
|
3649
|
-
const { yThumbHeight } = reactData
|
|
3650
|
-
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
3651
|
-
const trackRect = trackEl.getBoundingClientRect()
|
|
3652
|
-
const pointerPosition = evnt.clientY - trackRect.top
|
|
3653
|
-
// 记录 thumb 的偏移
|
|
3654
|
-
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight)
|
|
3655
|
-
internalData.thumbDragOffset = pointerPosition - thumbOffset
|
|
3656
|
-
},
|
|
3657
|
-
pointermoveThumbYEvent (evnt: PointerEvent) {
|
|
3658
|
-
const $xeTree = this
|
|
3659
|
-
const reactData = $xeTree.reactData
|
|
3660
|
-
const internalData = $xeTree.internalData
|
|
3661
|
-
|
|
3662
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3663
|
-
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
3664
|
-
return
|
|
3665
|
-
}
|
|
3666
|
-
const { isThumbDrag, thumbDragOffset } = internalData
|
|
3667
|
-
if (isThumbDrag) {
|
|
3668
|
-
const viewEl = $xeTree.$refs.refVirtualWrapper as HTMLDivElement
|
|
3669
|
-
if (!viewEl) {
|
|
3670
|
-
return
|
|
3671
|
-
}
|
|
3672
|
-
const { yThumbHeight } = reactData
|
|
3673
|
-
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
3674
|
-
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
3675
|
-
const trackRect = trackEl.getBoundingClientRect()
|
|
3676
|
-
// 更新偏移
|
|
3677
|
-
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight)
|
|
3678
|
-
}
|
|
3679
|
-
},
|
|
3680
3492
|
|
|
3681
3493
|
//
|
|
3682
3494
|
// Render
|
|
@@ -434,41 +434,22 @@
|
|
|
434
434
|
flex-grow: 1;
|
|
435
435
|
border-radius: var(--vxe-ui-base-border-radius);
|
|
436
436
|
user-select: none;
|
|
437
|
-
|
|
437
|
+
.vxe-date-panel--time-hour-list,
|
|
438
|
+
.vxe-date-panel--time-minute-list,
|
|
439
|
+
.vxe-date-panel--time-second-list {
|
|
438
440
|
height: 100%;
|
|
439
441
|
overflow: hidden;
|
|
440
442
|
margin: 0;
|
|
441
443
|
padding: 0;
|
|
442
|
-
width:
|
|
444
|
+
width: 3em;
|
|
445
|
+
}
|
|
446
|
+
.vxe-date-panel--time-list-inner {
|
|
443
447
|
&:before,
|
|
444
448
|
&:after {
|
|
445
449
|
content: " ";
|
|
446
450
|
display: block;
|
|
447
451
|
height: 6em;
|
|
448
452
|
}
|
|
449
|
-
&:hover {
|
|
450
|
-
overflow-y: auto;
|
|
451
|
-
}
|
|
452
|
-
& > li {
|
|
453
|
-
display: block;
|
|
454
|
-
height: 2em;
|
|
455
|
-
line-height: 2em;
|
|
456
|
-
padding-left: 0.4em;
|
|
457
|
-
&:not(.is--disabled) {
|
|
458
|
-
&:hover {
|
|
459
|
-
background-color: var(--vxe-ui-input-date-picker-hover-background-color);
|
|
460
|
-
cursor: pointer;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
&.is--selected {
|
|
464
|
-
font-weight: 700;
|
|
465
|
-
color: var(--vxe-ui-font-primary-color);
|
|
466
|
-
}
|
|
467
|
-
&.is--disabled {
|
|
468
|
-
color: var(--vxe-ui-font-disabled-color);
|
|
469
|
-
cursor: no-drop;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
453
|
}
|
|
473
454
|
.vxe-date-panel--time-minute-list {
|
|
474
455
|
border-left: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
@@ -476,16 +457,37 @@
|
|
|
476
457
|
.vxe-date-panel--time-second-list {
|
|
477
458
|
border-left: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
478
459
|
}
|
|
460
|
+
.vxe-date-panel--time-item {
|
|
461
|
+
display: block;
|
|
462
|
+
height: 2em;
|
|
463
|
+
line-height: 2em;
|
|
464
|
+
text-align: center;
|
|
465
|
+
&:not(.is--disabled) {
|
|
466
|
+
&:hover {
|
|
467
|
+
background-color: var(--vxe-ui-input-date-picker-hover-background-color);
|
|
468
|
+
cursor: pointer;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
&.is--selected {
|
|
472
|
+
font-weight: 700;
|
|
473
|
+
color: var(--vxe-ui-font-primary-color);
|
|
474
|
+
}
|
|
475
|
+
&.is--disabled {
|
|
476
|
+
color: var(--vxe-ui-font-disabled-color);
|
|
477
|
+
cursor: no-drop;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
479
480
|
}
|
|
480
481
|
.vxe-date-panel {
|
|
481
482
|
&.type--time {
|
|
482
483
|
.vxe-date-panel--time-body {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
.vxe-date-panel--time-hour-list,
|
|
485
|
+
.vxe-date-panel--time-minute-list,
|
|
486
|
+
.vxe-date-panel--time-second-list {
|
|
487
|
+
width: 3.6em;
|
|
488
|
+
.vxe-date-panel--time-item {
|
|
486
489
|
height: 2.2em;
|
|
487
490
|
line-height: 2.2em;
|
|
488
|
-
padding-left: 0.8em;
|
|
489
491
|
}
|
|
490
492
|
}
|
|
491
493
|
}
|
|
@@ -122,14 +122,20 @@
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.vxe-ico-picker--list-wrapper
|
|
125
|
+
.vxe-ico-picker--list-wrapper,
|
|
126
|
+
.vxe-ico-picker--scrollbar-list-wrapper {
|
|
126
127
|
overflow-x: hidden;
|
|
127
128
|
overflow-y: auto;
|
|
128
129
|
height: var(--vxe-ui-icon-picker-panel-height);
|
|
129
|
-
max-height: var(--vxe-ui-icon-picker-panel-max-height, var(--vxe-ui-icon-picker-panel-height, 22.3em));
|
|
130
130
|
padding: var(--vxe-ui-layout-padding-qtr);
|
|
131
131
|
}
|
|
132
|
-
.vxe-ico-picker--list
|
|
132
|
+
.vxe-ico-picker--list-wrapper,
|
|
133
|
+
.vxe-ico-picker--scrollbar-list-wrapper-view {
|
|
134
|
+
max-height: var(--vxe-ui-icon-picker-panel-max-height, var(--vxe-ui-icon-picker-panel-height, 22.6em));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.vxe-ico-picker--list,
|
|
138
|
+
.vxe-ico-picker--scrollbar-list-wrapper-inner {
|
|
133
139
|
display: flex;
|
|
134
140
|
flex-direction: row;
|
|
135
141
|
flex-wrap: wrap;
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.vxe-select--panel-body {
|
|
115
|
+
position: relative;
|
|
115
116
|
display: flex;
|
|
116
117
|
flex-direction: row;
|
|
117
118
|
flex-grow: 1;
|
|
@@ -259,3 +260,79 @@
|
|
|
259
260
|
.vxe-select--empty-placeholder {
|
|
260
261
|
line-height: var(--vxe-ui-select-current-option-height);
|
|
261
262
|
}
|
|
263
|
+
|
|
264
|
+
// 滚动条
|
|
265
|
+
.vxe-select--panel-body {
|
|
266
|
+
&.ov-padding {
|
|
267
|
+
&.overflow-x {
|
|
268
|
+
&.sx-pos--top {
|
|
269
|
+
padding-top: var(--vxe-ui-scrollbar-x-height);
|
|
270
|
+
}
|
|
271
|
+
&.sx-pos--bottom {
|
|
272
|
+
padding-bottom: var(--vxe-ui-scrollbar-x-height);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
&.overflow-y {
|
|
276
|
+
&.sy-pos--left {
|
|
277
|
+
padding-left: var(--vxe-ui-scrollbar-y-width);
|
|
278
|
+
}
|
|
279
|
+
&.sy-pos--right {
|
|
280
|
+
padding-right: var(--vxe-ui-scrollbar-y-width);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
&.ov-x--hidden {
|
|
285
|
+
& > .vxe-select-option--wrapper {
|
|
286
|
+
overflow-x: hidden;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
&.ov-y--hidden {
|
|
290
|
+
& > .vxe-select-option--wrapper {
|
|
291
|
+
overflow-y: hidden;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
&.is--virtual-scrollbar {
|
|
295
|
+
&.ov-x--auto-hide {
|
|
296
|
+
&:hover {
|
|
297
|
+
& > .vxe-scrollbar {
|
|
298
|
+
& > .vxe-scrollbar--track-x {
|
|
299
|
+
opacity: 1;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
& > .vxe-scrollbar {
|
|
304
|
+
& > .vxe-scrollbar--track-x {
|
|
305
|
+
opacity: 0;
|
|
306
|
+
@include baseMixin.createAnimationTransition(opacity, 0.8s);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
&.ov-y--auto-hide {
|
|
311
|
+
&:hover {
|
|
312
|
+
& > .vxe-scrollbar {
|
|
313
|
+
& > .vxe-scrollbar--track-y {
|
|
314
|
+
opacity: 1;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
& > .vxe-scrollbar {
|
|
319
|
+
& > .vxe-scrollbar--track-y {
|
|
320
|
+
opacity: 0;
|
|
321
|
+
@include baseMixin.createAnimationTransition(opacity, 0.8s);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
& > .vxe-scrollbar {
|
|
327
|
+
position: unset;
|
|
328
|
+
}
|
|
329
|
+
&.is--virtual-scrollbar {
|
|
330
|
+
& > .vxe-select-option--wrapper {
|
|
331
|
+
scrollbar-width: none;
|
|
332
|
+
-ms-overflow-style: none;
|
|
333
|
+
}
|
|
334
|
+
& > .vxe-select-option--wrapper::-webkit-scrollbar {
|
|
335
|
+
display: none;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefineVxeComponentInstance } from '@vxe-ui/core'
|
|
1
|
+
import { DefineVxeComponentInstance, VxeUseInitVScrollbarResult, VxeUseInitVScrollbarReactData, VxeUseInitVScrollbarInternalData } from '@vxe-ui/core'
|
|
2
2
|
import { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from '../table'
|
|
3
3
|
import { VxeGanttDefines, VxeGanttConstructor } from '../gantt'
|
|
4
4
|
import { VxeScrollbarPropTypes } from '../scrollbar'
|
|
@@ -17,7 +17,7 @@ export type VxeGanttViewConstructor = VxeGanttViewInstance
|
|
|
17
17
|
interface VxeGanttViewProps {
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export interface GanttViewReactData {
|
|
20
|
+
export interface GanttViewReactData extends VxeUseInitVScrollbarReactData {
|
|
21
21
|
// 是否启用了横向 X 可视渲染方式加载
|
|
22
22
|
scrollXLoad: boolean
|
|
23
23
|
// 是否启用了纵向 Y 可视渲染方式加载
|
|
@@ -35,10 +35,6 @@ export interface GanttViewReactData {
|
|
|
35
35
|
lastScrollTime: number
|
|
36
36
|
lazScrollLoading: boolean
|
|
37
37
|
|
|
38
|
-
// 滚动条
|
|
39
|
-
yThumbHeight: number
|
|
40
|
-
xThumbWidth: number
|
|
41
|
-
|
|
42
38
|
scrollVMLoading: boolean
|
|
43
39
|
scrollYHeight: number
|
|
44
40
|
scrollYTop: number
|
|
@@ -56,7 +52,7 @@ export interface GanttViewReactData {
|
|
|
56
52
|
viewCellWidth: number
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
export interface GanttViewInternalData {
|
|
55
|
+
export interface GanttViewInternalData extends VxeUseInitVScrollbarInternalData {
|
|
60
56
|
xeTable: (VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods) | null
|
|
61
57
|
// 渲染所有列
|
|
62
58
|
visibleColumn: VxeGanttDefines.ViewColumn[]
|
|
@@ -78,15 +74,6 @@ export interface GanttViewInternalData {
|
|
|
78
74
|
endIndex: number
|
|
79
75
|
}
|
|
80
76
|
|
|
81
|
-
// 滚动条
|
|
82
|
-
scrollObserver?: ResizeObserver
|
|
83
|
-
isThumbDrag?: boolean
|
|
84
|
-
thumbDragOffset: number
|
|
85
|
-
yThumbTop: number
|
|
86
|
-
xThumbLeft: number
|
|
87
|
-
lastScrollLeft: number
|
|
88
|
-
lastScrollTop: number
|
|
89
|
-
|
|
90
77
|
// 刷新布局
|
|
91
78
|
rceTimeout?: undefined | number
|
|
92
79
|
rceRunTime?: undefined | number
|
|
@@ -100,6 +87,9 @@ export interface GanttViewInternalData {
|
|
|
100
87
|
inBodyScroll?: boolean
|
|
101
88
|
inFooterScroll?: boolean
|
|
102
89
|
scrollRenderType?: '' | 'left' | 'right'
|
|
90
|
+
|
|
91
|
+
isSyncTableScrollTop?: boolean
|
|
92
|
+
|
|
103
93
|
// 同步滚动
|
|
104
94
|
lcsTimeout?: undefined | number
|
|
105
95
|
lcsRunTime?: undefined | number
|
|
@@ -145,6 +135,12 @@ export interface VxeGanttViewPrivateMethods {
|
|
|
145
135
|
* @private
|
|
146
136
|
*/
|
|
147
137
|
handleLazyRecalculate(): Promise<void>
|
|
138
|
+
/**
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
handleSyncScrollTop(params: {
|
|
142
|
+
scrollTop: number
|
|
143
|
+
}): void
|
|
148
144
|
/**
|
|
149
145
|
* @private
|
|
150
146
|
*/
|
|
@@ -183,7 +179,11 @@ export interface VxeGanttViewPrivateMethods {
|
|
|
183
179
|
updateScrollbar(): void
|
|
184
180
|
}
|
|
185
181
|
|
|
186
|
-
export interface VxeGanttViewMethods {
|
|
182
|
+
export interface VxeGanttViewMethods extends VxeUseInitVScrollbarResult {
|
|
183
|
+
/**
|
|
184
|
+
* 获取滚动视图元素
|
|
185
|
+
*/
|
|
186
|
+
getScrollViewElem(): HTMLElement | null | undefined
|
|
187
187
|
refreshData(): Promise<void>
|
|
188
188
|
updateViewData(force?: boolean): Promise<void>
|
|
189
189
|
connectUpdate(params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, ValueOf, VxeComponentStyleType, VxeComponentSizeType } from '@vxe-ui/core'
|
|
1
|
+
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, ValueOf, VxeComponentIsVScrollbar, VxeComponentStyleType, VxeComponentSizeType } from '@vxe-ui/core'
|
|
2
2
|
import { VxeIconPropTypes } from './icon'
|
|
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
|
|
|
@@ -86,6 +87,17 @@ export namespace VxeIconPickerPropTypes {
|
|
|
86
87
|
className?: string | ((params: { $iconPicker: VxeIconPickerConstructor }) => string)
|
|
87
88
|
}
|
|
88
89
|
export type Transfer = boolean
|
|
90
|
+
export type UseScrollbar = VxeComponentIsVScrollbar
|
|
91
|
+
export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
|
|
92
|
+
/**
|
|
93
|
+
* 滚动条宽度
|
|
94
|
+
*/
|
|
95
|
+
width?: number | string
|
|
96
|
+
/**
|
|
97
|
+
* 滚动条高度
|
|
98
|
+
*/
|
|
99
|
+
height?: number | string
|
|
100
|
+
}
|
|
89
101
|
}
|
|
90
102
|
|
|
91
103
|
export interface VxeIconPickerProps {
|
|
@@ -112,6 +124,14 @@ export interface VxeIconPickerProps {
|
|
|
112
124
|
placement?: VxeIconPickerPropTypes.Placement
|
|
113
125
|
popupConfig?: VxeIconPickerPropTypes.PopupConfig
|
|
114
126
|
transfer?: VxeIconPickerPropTypes.Transfer
|
|
127
|
+
/**
|
|
128
|
+
* 使用虚拟滚动条
|
|
129
|
+
*/
|
|
130
|
+
useScrollbar?: VxeIconPickerPropTypes.UseScrollbar
|
|
131
|
+
/**
|
|
132
|
+
* 滚动条配置项
|
|
133
|
+
*/
|
|
134
|
+
scrollbarConfig?: VxeIconPickerPropTypes.ScrollbarConfig
|
|
115
135
|
}
|
|
116
136
|
|
|
117
137
|
export interface IconPickerPrivateComputed {
|
|
@@ -351,6 +351,10 @@ export interface ListInternalData {
|
|
|
351
351
|
|
|
352
352
|
export interface ListMethods<D = any> {
|
|
353
353
|
dispatchEvent(type: ValueOf<VxeListEmits>, params: Record<string, any>, evnt: Event | null): void
|
|
354
|
+
/**
|
|
355
|
+
* 获取滚动视图元素
|
|
356
|
+
*/
|
|
357
|
+
getScrollViewElem(): HTMLElement | null | undefined
|
|
354
358
|
/**
|
|
355
359
|
* 加载数据
|
|
356
360
|
* @param data 列表数据
|