vxe-pc-ui 4.6.4 → 4.6.5
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/button/src/button.js +20 -73
- package/es/button/style.css +24 -2
- package/es/button/style.min.css +1 -1
- package/es/color-picker/src/color-picker.js +19 -72
- package/es/color-picker/style.css +15 -0
- package/es/color-picker/style.min.css +1 -1
- package/es/date-picker/src/date-picker.js +19 -74
- package/es/date-picker/style.css +3 -2
- package/es/date-picker/style.min.css +1 -1
- package/es/date-range-picker/src/date-range-picker.js +24 -79
- package/es/date-range-picker/style.css +3 -2
- package/es/date-range-picker/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/pulldown/src/pulldown.js +19 -74
- package/es/pulldown/style.css +0 -4
- package/es/pulldown/style.min.css +1 -1
- package/es/select/src/select.js +19 -72
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table-select/src/table-select.js +19 -72
- package/es/table-select/style.css +0 -1
- package/es/table-select/style.min.css +1 -1
- package/es/tree-select/src/tree-select.js +19 -72
- package/es/tree-select/style.css +0 -1
- package/es/tree-select/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +92 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-button/style.css +24 -2
- package/es/vxe-button/style.min.css +1 -1
- package/es/vxe-color-picker/style.css +15 -0
- package/es/vxe-color-picker/style.min.css +1 -1
- package/es/vxe-date-picker/style.css +3 -2
- package/es/vxe-date-picker/style.min.css +1 -1
- package/es/vxe-date-range-picker/style.css +3 -2
- package/es/vxe-date-range-picker/style.min.css +1 -1
- package/es/vxe-pulldown/style.css +0 -4
- package/es/vxe-pulldown/style.min.css +1 -1
- package/es/vxe-table-select/style.css +0 -1
- package/es/vxe-table-select/style.min.css +1 -1
- package/es/vxe-tree-select/style.css +0 -1
- package/es/vxe-tree-select/style.min.css +1 -1
- package/lib/button/src/button.js +23 -79
- package/lib/button/src/button.min.js +1 -1
- package/lib/button/style/style.css +24 -2
- package/lib/button/style/style.min.css +1 -1
- package/lib/color-picker/src/color-picker.js +22 -77
- package/lib/color-picker/src/color-picker.min.js +1 -1
- package/lib/color-picker/style/style.css +15 -0
- package/lib/color-picker/style/style.min.css +1 -1
- package/lib/date-picker/src/date-picker.js +22 -79
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-picker/style/style.css +3 -2
- package/lib/date-picker/style/style.min.css +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +26 -83
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/date-range-picker/style/style.css +3 -2
- package/lib/date-range-picker/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 +279 -631
- package/lib/index.umd.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +22 -80
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/pulldown/style/style.css +0 -4
- package/lib/pulldown/style/style.min.css +1 -1
- package/lib/select/src/select.js +22 -77
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table-select/src/table-select.js +22 -77
- package/lib/table-select/src/table-select.min.js +1 -1
- package/lib/table-select/style/style.css +0 -1
- package/lib/table-select/style/style.min.css +1 -1
- package/lib/tree-select/src/tree-select.js +22 -77
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/tree-select/style/style.css +0 -1
- package/lib/tree-select/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +97 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-button/style/style.css +24 -2
- package/lib/vxe-button/style/style.min.css +1 -1
- package/lib/vxe-color-picker/style/style.css +15 -0
- package/lib/vxe-color-picker/style/style.min.css +1 -1
- package/lib/vxe-date-picker/style/style.css +3 -2
- package/lib/vxe-date-picker/style/style.min.css +1 -1
- package/lib/vxe-date-range-picker/style/style.css +3 -2
- package/lib/vxe-date-range-picker/style/style.min.css +1 -1
- package/lib/vxe-pulldown/style/style.css +0 -4
- package/lib/vxe-pulldown/style/style.min.css +1 -1
- package/lib/vxe-table-select/style/style.css +0 -1
- package/lib/vxe-table-select/style/style.min.css +1 -1
- package/lib/vxe-tree-select/style/style.css +0 -1
- package/lib/vxe-tree-select/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/button/src/button.ts +20 -70
- package/packages/color-picker/src/color-picker.ts +19 -69
- package/packages/date-picker/src/date-picker.ts +20 -72
- package/packages/date-range-picker/src/date-range-picker.ts +24 -76
- package/packages/pulldown/src/pulldown.ts +20 -72
- package/packages/select/src/select.ts +19 -69
- package/packages/table-select/src/table-select.ts +19 -69
- package/packages/tree-select/src/tree-select.ts +19 -69
- package/packages/ui/src/dom.ts +95 -0
- package/styles/components/button.scss +3 -20
- package/styles/components/color-picker.scss +2 -27
- package/styles/components/date-picker.scss +2 -34
- package/styles/components/date-range-picker.scss +2 -34
- package/styles/components/pulldown.scss +2 -41
- package/styles/components/select.scss +2 -35
- package/styles/components/table-select.scss +2 -36
- package/styles/components/tree-select.scss +2 -36
- package/styles/helpers/placement.scss +39 -0
- package/types/components/table.d.ts +51 -0
- /package/es/icon/{iconfont.1747024965925.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/es/icon/{iconfont.1747024965925.woff → iconfont.1747094595378.woff} +0 -0
- /package/es/icon/{iconfont.1747024965925.woff2 → iconfont.1747094595378.woff2} +0 -0
- /package/es/{iconfont.1747024965925.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/es/{iconfont.1747024965925.woff → iconfont.1747094595378.woff} +0 -0
- /package/es/{iconfont.1747024965925.woff2 → iconfont.1747094595378.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1747024965925.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1747024965925.woff → iconfont.1747094595378.woff} +0 -0
- /package/lib/icon/style/{iconfont.1747024965925.woff2 → iconfont.1747094595378.woff2} +0 -0
- /package/lib/{iconfont.1747024965925.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/lib/{iconfont.1747024965925.woff → iconfont.1747094595378.woff} +0 -0
- /package/lib/{iconfont.1747024965925.woff2 → iconfont.1747094595378.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import { defineComponent, h, Teleport, ref, Ref, computed, provide, reactive, in
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getConfig, getIcon, getI18n, commands, createEvent, globalEvents, useSize, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getFuncText, getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils'
|
|
5
|
-
import {
|
|
5
|
+
import { updatePanelPlacement, getEventTargetNode } from '../../ui/src/dom'
|
|
6
6
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
7
7
|
import { parseDateObj, getDateByCode } from '../../date-panel/src/util'
|
|
8
8
|
import { errLog } from '../../ui/src/log'
|
|
@@ -10,7 +10,7 @@ import VxeDatePanelComponent from '../../date-panel/src/date-panel'
|
|
|
10
10
|
import VxeButtonComponent from '../../button/src/button'
|
|
11
11
|
import VxeButtonGroupComponent from '../../button/src/button-group'
|
|
12
12
|
|
|
13
|
-
import type { VxeDatePickerConstructor, VxeDatePickerEmits, DatePickerInternalData, DatePickerReactData,
|
|
13
|
+
import type { VxeDatePickerConstructor, VxeDatePickerEmits, DatePickerInternalData, DatePickerReactData, DatePickerMethods, VxeDatePickerPropTypes, DatePickerPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePickerDefines, VxeButtonGroupEvents, VxeDatePanelConstructor } from '../../../types'
|
|
14
14
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
15
15
|
|
|
16
16
|
export default defineComponent({
|
|
@@ -511,76 +511,24 @@ export default defineComponent({
|
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
const updatePlacement = () => {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
let left = boundingLeft
|
|
533
|
-
let top = boundingTop + targetHeight
|
|
534
|
-
if (placement === 'top') {
|
|
535
|
-
panelPlacement = 'top'
|
|
536
|
-
top = boundingTop - panelHeight
|
|
537
|
-
} else if (!placement) {
|
|
538
|
-
// 如果下面不够放,则向上
|
|
539
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
540
|
-
panelPlacement = 'top'
|
|
541
|
-
top = boundingTop - panelHeight
|
|
542
|
-
}
|
|
543
|
-
// 如果上面不够放,则向下(优先)
|
|
544
|
-
if (top < marginSize) {
|
|
545
|
-
panelPlacement = 'bottom'
|
|
546
|
-
top = boundingTop + targetHeight
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
// 如果溢出右边
|
|
550
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
551
|
-
left -= left + panelWidth + marginSize - visibleWidth
|
|
552
|
-
}
|
|
553
|
-
// 如果溢出左边
|
|
554
|
-
if (left < marginSize) {
|
|
555
|
-
left = marginSize
|
|
556
|
-
}
|
|
557
|
-
Object.assign(panelStyle, {
|
|
558
|
-
left: `${left}px`,
|
|
559
|
-
top: `${top}px`,
|
|
560
|
-
minWidth: `${targetWidth}px`
|
|
561
|
-
})
|
|
562
|
-
} else {
|
|
563
|
-
if (placement === 'top') {
|
|
564
|
-
panelPlacement = 'top'
|
|
565
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
566
|
-
} else if (!placement) {
|
|
567
|
-
// 如果下面不够放,则向上
|
|
568
|
-
panelStyle.top = `${targetHeight}px`
|
|
569
|
-
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
570
|
-
// 如果上面不够放,则向下(优先)
|
|
571
|
-
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
572
|
-
panelPlacement = 'top'
|
|
573
|
-
panelStyle.top = ''
|
|
574
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
reactData.panelStyle = panelStyle
|
|
580
|
-
reactData.panelPlacement = panelPlacement
|
|
581
|
-
return nextTick()
|
|
582
|
-
}
|
|
583
|
-
})
|
|
514
|
+
const { placement } = props
|
|
515
|
+
const { panelIndex } = reactData
|
|
516
|
+
const targetElem = refInputTarget.value
|
|
517
|
+
const panelElem = refInputPanel.value
|
|
518
|
+
const btnTransfer = computeBtnTransfer.value
|
|
519
|
+
const handleStyle = () => {
|
|
520
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
521
|
+
placement,
|
|
522
|
+
teleportTo: btnTransfer
|
|
523
|
+
})
|
|
524
|
+
const panelStyle: { [key: string]: string | number } = Object.assign(ppObj.style, {
|
|
525
|
+
zIndex: panelIndex
|
|
526
|
+
})
|
|
527
|
+
reactData.panelStyle = panelStyle
|
|
528
|
+
reactData.panelPlacement = ppObj.placement
|
|
529
|
+
}
|
|
530
|
+
handleStyle()
|
|
531
|
+
return nextTick().then(handleStyle)
|
|
584
532
|
}
|
|
585
533
|
|
|
586
534
|
const showPanel = () => {
|
|
@@ -2,7 +2,7 @@ import { defineComponent, h, Teleport, ref, Ref, computed, provide, reactive, in
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getConfig, getIcon, getI18n, commands, globalEvents, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getFuncText, getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils'
|
|
5
|
-
import {
|
|
5
|
+
import { updatePanelPlacement, getEventTargetNode } from '../../ui/src/dom'
|
|
6
6
|
import { parseDateString, parseDateObj, getRangeDateByCode } from '../../date-panel/src/util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { errLog } from '../../ui/src/log'
|
|
@@ -10,7 +10,7 @@ import VxeDatePanelComponent from '../../date-panel/src/date-panel'
|
|
|
10
10
|
import VxeButtonComponent from '../../button/src/button'
|
|
11
11
|
import VxeButtonGroupComponent from '../../button/src/button-group'
|
|
12
12
|
|
|
13
|
-
import type { VxeDateRangePickerConstructor, VxeDateRangePickerEmits, DateRangePickerInternalData, DateRangePickerReactData,
|
|
13
|
+
import type { VxeDateRangePickerConstructor, VxeDateRangePickerEmits, DateRangePickerInternalData, DateRangePickerReactData, DateRangePickerMethods, VxeDateRangePickerPropTypes, DateRangePickerPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDateRangePickerDefines, VxeButtonGroupEvents, VxeDatePanelConstructor } from '../../../types'
|
|
14
14
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
15
15
|
|
|
16
16
|
export default defineComponent({
|
|
@@ -242,7 +242,7 @@ export default defineComponent({
|
|
|
242
242
|
if (globalPlaceholder) {
|
|
243
243
|
return getFuncText(globalPlaceholder)
|
|
244
244
|
}
|
|
245
|
-
return getI18n('vxe.
|
|
245
|
+
return getI18n('vxe.dateRangePicker.pleaseRange')
|
|
246
246
|
})
|
|
247
247
|
|
|
248
248
|
const computeInpImmediate = computed(() => {
|
|
@@ -541,11 +541,11 @@ export default defineComponent({
|
|
|
541
541
|
if ($startDatePanel && $endDatePanel) {
|
|
542
542
|
const startValue = $startDatePanel.getModelValue()
|
|
543
543
|
const endValue = $endDatePanel.getModelValue()
|
|
544
|
-
if (startValue && endValue) {
|
|
544
|
+
if ((startValue && !endValue) || (!startValue && endValue)) {
|
|
545
|
+
handleChange('', '', evnt)
|
|
546
|
+
} else {
|
|
545
547
|
$startDatePanel.confirmByEvent(evnt)
|
|
546
548
|
$endDatePanel.confirmByEvent(evnt)
|
|
547
|
-
} else {
|
|
548
|
-
handleChange('', '', evnt)
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
hidePanel()
|
|
@@ -640,76 +640,24 @@ export default defineComponent({
|
|
|
640
640
|
}
|
|
641
641
|
|
|
642
642
|
const updatePlacement = () => {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
let left = boundingLeft
|
|
662
|
-
let top = boundingTop + targetHeight
|
|
663
|
-
if (placement === 'top') {
|
|
664
|
-
panelPlacement = 'top'
|
|
665
|
-
top = boundingTop - panelHeight
|
|
666
|
-
} else if (!placement) {
|
|
667
|
-
// 如果下面不够放,则向上
|
|
668
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
669
|
-
panelPlacement = 'top'
|
|
670
|
-
top = boundingTop - panelHeight
|
|
671
|
-
}
|
|
672
|
-
// 如果上面不够放,则向下(优先)
|
|
673
|
-
if (top < marginSize) {
|
|
674
|
-
panelPlacement = 'bottom'
|
|
675
|
-
top = boundingTop + targetHeight
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
// 如果溢出右边
|
|
679
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
680
|
-
left -= left + panelWidth + marginSize - visibleWidth
|
|
681
|
-
}
|
|
682
|
-
// 如果溢出左边
|
|
683
|
-
if (left < marginSize) {
|
|
684
|
-
left = marginSize
|
|
685
|
-
}
|
|
686
|
-
Object.assign(panelStyle, {
|
|
687
|
-
left: `${left}px`,
|
|
688
|
-
top: `${top}px`,
|
|
689
|
-
minWidth: `${targetWidth}px`
|
|
690
|
-
})
|
|
691
|
-
} else {
|
|
692
|
-
if (placement === 'top') {
|
|
693
|
-
panelPlacement = 'top'
|
|
694
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
695
|
-
} else if (!placement) {
|
|
696
|
-
// 如果下面不够放,则向上
|
|
697
|
-
panelStyle.top = `${targetHeight}px`
|
|
698
|
-
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
699
|
-
// 如果上面不够放,则向下(优先)
|
|
700
|
-
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
701
|
-
panelPlacement = 'top'
|
|
702
|
-
panelStyle.top = ''
|
|
703
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
reactData.panelStyle = panelStyle
|
|
709
|
-
reactData.panelPlacement = panelPlacement
|
|
710
|
-
return nextTick()
|
|
711
|
-
}
|
|
712
|
-
})
|
|
643
|
+
const { placement } = props
|
|
644
|
+
const { panelIndex } = reactData
|
|
645
|
+
const targetElem = refInputTarget.value
|
|
646
|
+
const panelElem = refInputPanel.value
|
|
647
|
+
const btnTransfer = computeBtnTransfer.value
|
|
648
|
+
const handleStyle = () => {
|
|
649
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
650
|
+
placement,
|
|
651
|
+
teleportTo: btnTransfer
|
|
652
|
+
})
|
|
653
|
+
const panelStyle: { [key: string]: string | number } = Object.assign(ppObj.style, {
|
|
654
|
+
zIndex: panelIndex
|
|
655
|
+
})
|
|
656
|
+
reactData.panelStyle = panelStyle
|
|
657
|
+
reactData.panelPlacement = ppObj.placement
|
|
658
|
+
}
|
|
659
|
+
handleStyle()
|
|
660
|
+
return nextTick().then(handleStyle)
|
|
713
661
|
}
|
|
714
662
|
|
|
715
663
|
const showPanel = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, h, Teleport, ref, Ref, onUnmounted, reactive, inject, computed, nextTick, PropType, watch, createCommentVNode } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { getConfig, globalEvents, createEvent, useSize,
|
|
4
|
-
import {
|
|
3
|
+
import { getConfig, globalEvents, createEvent, useSize, ValueOf } from '../../ui'
|
|
4
|
+
import { getEventTargetNode, updatePanelPlacement } from '../../ui/src/dom'
|
|
5
5
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
6
6
|
|
|
7
7
|
import type { VxePulldownConstructor, VxePulldownPropTypes, PulldownInternalData, VxePulldownEmits, PulldownReactData, PulldownMethods, PulldownPrivateRef, VxePulldownMethods, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods } from '../../../types'
|
|
@@ -115,76 +115,24 @@ export default defineComponent({
|
|
|
115
115
|
* 手动更新位置
|
|
116
116
|
*/
|
|
117
117
|
const updatePlacement = () => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (btnTransfer) {
|
|
137
|
-
let left = boundingLeft
|
|
138
|
-
let top = boundingTop + targetHeight
|
|
139
|
-
if (placement === 'top') {
|
|
140
|
-
panelPlacement = 'top'
|
|
141
|
-
top = boundingTop - panelHeight
|
|
142
|
-
} else if (!placement) {
|
|
143
|
-
// 如果下面不够放,则向上
|
|
144
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
145
|
-
panelPlacement = 'top'
|
|
146
|
-
top = boundingTop - panelHeight
|
|
147
|
-
}
|
|
148
|
-
// 如果上面不够放,则向下(优先)
|
|
149
|
-
if (top < marginSize) {
|
|
150
|
-
panelPlacement = 'bottom'
|
|
151
|
-
top = boundingTop + targetHeight
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
// 如果溢出右边
|
|
155
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
156
|
-
left -= left + panelWidth + marginSize - visibleWidth
|
|
157
|
-
}
|
|
158
|
-
// 如果溢出左边
|
|
159
|
-
if (left < marginSize) {
|
|
160
|
-
left = marginSize
|
|
161
|
-
}
|
|
162
|
-
Object.assign(panelStyle, {
|
|
163
|
-
left: `${left}px`,
|
|
164
|
-
top: `${top}px`,
|
|
165
|
-
minWidth: `${targetWidth}px`
|
|
166
|
-
})
|
|
167
|
-
} else {
|
|
168
|
-
if (placement === 'top') {
|
|
169
|
-
panelPlacement = 'top'
|
|
170
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
171
|
-
} else if (!placement) {
|
|
172
|
-
// 如果下面不够放,则向上
|
|
173
|
-
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
174
|
-
// 如果上面不够放,则向下(优先)
|
|
175
|
-
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
176
|
-
panelPlacement = 'top'
|
|
177
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
reactData.panelStyle = panelStyle
|
|
183
|
-
reactData.panelPlacement = panelPlacement
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return nextTick()
|
|
187
|
-
})
|
|
118
|
+
const { placement } = props
|
|
119
|
+
const { panelIndex } = reactData
|
|
120
|
+
const targetElem = refPulldownContent.value
|
|
121
|
+
const panelElem = refPulldownPanel.value
|
|
122
|
+
const btnTransfer = computeBtnTransfer.value
|
|
123
|
+
const handleStyle = () => {
|
|
124
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
125
|
+
placement,
|
|
126
|
+
teleportTo: btnTransfer
|
|
127
|
+
})
|
|
128
|
+
const panelStyle: { [key: string]: string | number } = Object.assign(ppObj.style, {
|
|
129
|
+
zIndex: panelIndex
|
|
130
|
+
})
|
|
131
|
+
reactData.panelStyle = panelStyle
|
|
132
|
+
reactData.panelPlacement = ppObj.placement
|
|
133
|
+
}
|
|
134
|
+
handleStyle()
|
|
135
|
+
return nextTick().then(handleStyle)
|
|
188
136
|
}
|
|
189
137
|
|
|
190
138
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, h, Teleport, PropType, ref, Ref, inject, computed, provide, onUnmounted, reactive, nextTick, watch, onMounted } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
4
|
-
import { getEventTargetNode,
|
|
4
|
+
import { getEventTargetNode, updatePanelPlacement } from '../../ui/src/dom'
|
|
5
5
|
import { getLastZIndex, nextZIndex, getFuncText } from '../../ui/src/utils'
|
|
6
6
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
7
7
|
import VxeInputComponent from '../../input/src/input'
|
|
@@ -412,74 +412,24 @@ export default defineComponent({
|
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
const updatePlacement = () => {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
let left = boundingLeft
|
|
434
|
-
let top = boundingTop + targetHeight
|
|
435
|
-
if (placement === 'top') {
|
|
436
|
-
panelPlacement = 'top'
|
|
437
|
-
top = boundingTop - panelHeight
|
|
438
|
-
} else if (!placement) {
|
|
439
|
-
// 如果下面不够放,则向上
|
|
440
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
441
|
-
panelPlacement = 'top'
|
|
442
|
-
top = boundingTop - panelHeight
|
|
443
|
-
}
|
|
444
|
-
// 如果上面不够放,则向下(优先)
|
|
445
|
-
if (top < marginSize) {
|
|
446
|
-
panelPlacement = 'bottom'
|
|
447
|
-
top = boundingTop + targetHeight
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
// 如果溢出右边
|
|
451
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
452
|
-
left -= left + panelWidth + marginSize - visibleWidth
|
|
453
|
-
}
|
|
454
|
-
// 如果溢出左边
|
|
455
|
-
if (left < marginSize) {
|
|
456
|
-
left = marginSize
|
|
457
|
-
}
|
|
458
|
-
Object.assign(panelStyle, {
|
|
459
|
-
left: `${left}px`,
|
|
460
|
-
top: `${top}px`,
|
|
461
|
-
minWidth: `${targetWidth}px`
|
|
462
|
-
})
|
|
463
|
-
} else {
|
|
464
|
-
if (placement === 'top') {
|
|
465
|
-
panelPlacement = 'top'
|
|
466
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
467
|
-
} else if (!placement) {
|
|
468
|
-
// 如果下面不够放,则向上
|
|
469
|
-
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
470
|
-
// 如果上面不够放,则向下(优先)
|
|
471
|
-
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
472
|
-
panelPlacement = 'top'
|
|
473
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
reactData.panelStyle = panelStyle
|
|
479
|
-
reactData.panelPlacement = panelPlacement
|
|
480
|
-
return nextTick()
|
|
481
|
-
}
|
|
482
|
-
})
|
|
415
|
+
const { placement } = props
|
|
416
|
+
const { panelIndex } = reactData
|
|
417
|
+
const targetElem = refElem.value
|
|
418
|
+
const panelElem = refOptionPanel.value
|
|
419
|
+
const btnTransfer = computeBtnTransfer.value
|
|
420
|
+
const handleStyle = () => {
|
|
421
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
422
|
+
placement,
|
|
423
|
+
teleportTo: btnTransfer
|
|
424
|
+
})
|
|
425
|
+
const panelStyle: { [key: string]: string | number } = Object.assign(ppObj.style, {
|
|
426
|
+
zIndex: panelIndex
|
|
427
|
+
})
|
|
428
|
+
reactData.panelStyle = panelStyle
|
|
429
|
+
reactData.panelPlacement = ppObj.placement
|
|
430
|
+
}
|
|
431
|
+
handleStyle()
|
|
432
|
+
return nextTick().then(handleStyle)
|
|
483
433
|
}
|
|
484
434
|
|
|
485
435
|
const showOptionPanel = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, h, PropType, computed, inject, watch, provide, nextTick, Teleport, onMounted, onUnmounted, reactive } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI, getConfig, getIcon, globalEvents, getI18n, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
4
|
-
import { getEventTargetNode,
|
|
4
|
+
import { getEventTargetNode, updatePanelPlacement, toCssUnit } from '../../ui/src/dom'
|
|
5
5
|
import { getOnName } from '../../ui/src/vn'
|
|
6
6
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
7
7
|
import { errLog } from '../../ui/src/log'
|
|
@@ -340,74 +340,24 @@ export default defineComponent({
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
const updatePlacement = () => {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
let left = boundingLeft
|
|
362
|
-
let top = boundingTop + targetHeight
|
|
363
|
-
if (placement === 'top') {
|
|
364
|
-
panelPlacement = 'top'
|
|
365
|
-
top = boundingTop - panelHeight
|
|
366
|
-
} else if (!placement) {
|
|
367
|
-
// 如果下面不够放,则向上
|
|
368
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
369
|
-
panelPlacement = 'top'
|
|
370
|
-
top = boundingTop - panelHeight
|
|
371
|
-
}
|
|
372
|
-
// 如果上面不够放,则向下(优先)
|
|
373
|
-
if (top < marginSize) {
|
|
374
|
-
panelPlacement = 'bottom'
|
|
375
|
-
top = boundingTop + targetHeight
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
// 如果溢出右边
|
|
379
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
380
|
-
left -= left + panelWidth + marginSize - visibleWidth
|
|
381
|
-
}
|
|
382
|
-
// 如果溢出左边
|
|
383
|
-
if (left < marginSize) {
|
|
384
|
-
left = marginSize
|
|
385
|
-
}
|
|
386
|
-
Object.assign(panelStyle, {
|
|
387
|
-
left: `${left}px`,
|
|
388
|
-
top: `${top}px`,
|
|
389
|
-
minWidth: `${targetWidth}px`
|
|
390
|
-
})
|
|
391
|
-
} else {
|
|
392
|
-
if (placement === 'top') {
|
|
393
|
-
panelPlacement = 'top'
|
|
394
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
395
|
-
} else if (!placement) {
|
|
396
|
-
// 如果下面不够放,则向上
|
|
397
|
-
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
398
|
-
// 如果上面不够放,则向下(优先)
|
|
399
|
-
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
400
|
-
panelPlacement = 'top'
|
|
401
|
-
panelStyle.bottom = `${targetHeight}px`
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
reactData.panelStyle = panelStyle
|
|
407
|
-
reactData.panelPlacement = panelPlacement
|
|
408
|
-
return nextTick()
|
|
409
|
-
}
|
|
410
|
-
})
|
|
343
|
+
const { placement } = props
|
|
344
|
+
const { panelIndex } = reactData
|
|
345
|
+
const targetElem = refElem.value
|
|
346
|
+
const panelElem = refOptionPanel.value
|
|
347
|
+
const btnTransfer = computeBtnTransfer.value
|
|
348
|
+
const handleStyle = () => {
|
|
349
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
350
|
+
placement,
|
|
351
|
+
teleportTo: btnTransfer
|
|
352
|
+
})
|
|
353
|
+
const panelStyle: { [key: string]: string | number } = Object.assign(ppObj.style, {
|
|
354
|
+
zIndex: panelIndex
|
|
355
|
+
})
|
|
356
|
+
reactData.panelStyle = panelStyle
|
|
357
|
+
reactData.panelPlacement = ppObj.placement
|
|
358
|
+
}
|
|
359
|
+
handleStyle()
|
|
360
|
+
return nextTick().then(handleStyle)
|
|
411
361
|
}
|
|
412
362
|
|
|
413
363
|
const showOptionPanel = () => {
|