vxe-pc-ui 4.6.3 → 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/print/src/print.js +2 -2
- package/es/print/src/util.js +72 -40
- 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 +333 -670
- package/lib/index.umd.min.js +1 -1
- package/lib/print/src/print.js +1 -1
- package/lib/print/src/print.min.js +1 -1
- package/lib/print/src/util.js +54 -38
- package/lib/print/src/util.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/print/src/print.ts +2 -2
- package/packages/print/src/util.ts +73 -39
- 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 +96 -1
- 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/print.d.ts +21 -0
- package/types/components/table.d.ts +51 -0
- /package/es/icon/{iconfont.1747005800508.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/es/icon/{iconfont.1747005800508.woff → iconfont.1747094595378.woff} +0 -0
- /package/es/icon/{iconfont.1747005800508.woff2 → iconfont.1747094595378.woff2} +0 -0
- /package/es/{iconfont.1747005800508.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/es/{iconfont.1747005800508.woff → iconfont.1747094595378.woff} +0 -0
- /package/es/{iconfont.1747005800508.woff2 → iconfont.1747094595378.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1747005800508.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1747005800508.woff → iconfont.1747094595378.woff} +0 -0
- /package/lib/icon/style/{iconfont.1747005800508.woff2 → iconfont.1747094595378.woff2} +0 -0
- /package/lib/{iconfont.1747005800508.ttf → iconfont.1747094595378.ttf} +0 -0
- /package/lib/{iconfont.1747005800508.woff → iconfont.1747094595378.woff} +0 -0
- /package/lib/{iconfont.1747005800508.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, ref, h, reactive, PropType, provide, createCommentVNode } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getConfig, createEvent } from '../../ui'
|
|
4
|
-
import { printHtml } from './util'
|
|
4
|
+
import { printHtml, trimHtml } from './util'
|
|
5
5
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
6
6
|
|
|
7
7
|
import type { VxePrintPropTypes, PrintReactData, PrintPrivateRef, VxePrintEmits, PrintPrivateMethods, ValueOf, VxePrintPrivateComputed, VxePrintConstructor, VxePrintPrivateMethods, PrintMethods } from '../../../types'
|
|
@@ -87,7 +87,7 @@ export default defineComponent({
|
|
|
87
87
|
const elem = refElem.value
|
|
88
88
|
return printHtml(Object.assign({}, props, {
|
|
89
89
|
_pageBreaks: !!reactData.staticPageBreaks.length,
|
|
90
|
-
html: (elem ? elem.outerHTML : '') || props.html || props.content || ''
|
|
90
|
+
html: trimHtml(elem ? elem.outerHTML : '') || props.html || props.content || ''
|
|
91
91
|
}))
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -9,7 +9,11 @@ const browseObj = XEUtils.browse()
|
|
|
9
9
|
let printFrame: any
|
|
10
10
|
|
|
11
11
|
// 默认导出或打印的 HTML 样式
|
|
12
|
-
const defaultHtmlStyle = 'body{
|
|
12
|
+
const defaultHtmlStyle = 'body{padding:0;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table:not(.is--print){table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{border-color:#D0D0D0;border-style:solid;border-width:0}.vxe-table.is--print{width:100%}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:.5em .4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table:not(.is--print) .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}'
|
|
13
|
+
|
|
14
|
+
export function trimHtml (html: string) {
|
|
15
|
+
return `${html}`.replace(/(<!---->)/, '')
|
|
16
|
+
}
|
|
13
17
|
|
|
14
18
|
export function createPrintFrame () {
|
|
15
19
|
const frame = document.createElement('iframe')
|
|
@@ -44,60 +48,90 @@ function getExportBlobByString (str: string, type: string) {
|
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
const defaultPrintMargin = 50
|
|
51
|
+
const defaultFontColor = '#000000'
|
|
47
52
|
|
|
48
|
-
function
|
|
53
|
+
function parsePageStyle (val?: VxePrintPropTypes.PageStyle) {
|
|
54
|
+
const styOpts = Object.assign({}, val)
|
|
55
|
+
const headStyOpts = Object.assign({}, styOpts.header)
|
|
56
|
+
const titStyOpts = Object.assign({}, styOpts.title)
|
|
57
|
+
const footStyOpts = Object.assign({}, styOpts.footer)
|
|
58
|
+
const pnStyOpts = Object.assign({}, styOpts.pageNumber)
|
|
49
59
|
let mVal: string | number = defaultPrintMargin
|
|
50
|
-
let
|
|
51
|
-
let
|
|
52
|
-
let
|
|
53
|
-
let
|
|
54
|
-
if (XEUtils.
|
|
55
|
-
mVal =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} else if (XEUtils.isPlainObject(val)) {
|
|
61
|
-
if (val.margin) {
|
|
62
|
-
mVal = val.margin
|
|
63
|
-
top = mVal
|
|
64
|
-
bottom = mVal
|
|
65
|
-
left = mVal
|
|
66
|
-
right = mVal
|
|
67
|
-
}
|
|
68
|
-
if (val.marginTop) {
|
|
69
|
-
top = val.marginTop
|
|
70
|
-
}
|
|
71
|
-
if (val.marginBottom) {
|
|
72
|
-
bottom = val.marginBottom
|
|
73
|
-
}
|
|
74
|
-
if (val.marginLeft) {
|
|
75
|
-
left = val.marginLeft
|
|
76
|
-
}
|
|
77
|
-
if (val.marginRight) {
|
|
78
|
-
right = val.marginRight
|
|
79
|
-
}
|
|
60
|
+
let marginTop: string | number = mVal
|
|
61
|
+
let marginBottom: string | number = mVal
|
|
62
|
+
let marginLeft: string | number = mVal
|
|
63
|
+
let marginRight: string | number = mVal
|
|
64
|
+
if (XEUtils.isNumber(styOpts.margin) || XEUtils.isString(styOpts.margin)) {
|
|
65
|
+
mVal = styOpts.margin
|
|
66
|
+
marginTop = mVal
|
|
67
|
+
marginBottom = mVal
|
|
68
|
+
marginLeft = mVal
|
|
69
|
+
marginRight = mVal
|
|
80
70
|
}
|
|
81
71
|
return {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
marginTop: toCssUnit(styOpts.marginTop || marginTop),
|
|
73
|
+
marginBottom: toCssUnit(styOpts.marginBottom || marginBottom),
|
|
74
|
+
marginLeft: toCssUnit(styOpts.marginLeft || marginLeft),
|
|
75
|
+
marginRight: toCssUnit(styOpts.marginRight || marginRight),
|
|
76
|
+
fontSize: toCssUnit(styOpts.fontSize),
|
|
77
|
+
color: styOpts.color,
|
|
78
|
+
textAlign: styOpts.textAlign,
|
|
79
|
+
header: {
|
|
80
|
+
height: toCssUnit(headStyOpts.height),
|
|
81
|
+
textAlign: headStyOpts.textAlign
|
|
82
|
+
},
|
|
83
|
+
title: {
|
|
84
|
+
color: titStyOpts.color,
|
|
85
|
+
fontSize: toCssUnit(titStyOpts.fontSize),
|
|
86
|
+
textAlign: titStyOpts.textAlign
|
|
87
|
+
},
|
|
88
|
+
footer: {
|
|
89
|
+
height: toCssUnit(footStyOpts.height),
|
|
90
|
+
textAlign: footStyOpts.textAlign
|
|
91
|
+
},
|
|
92
|
+
pageNumber: {
|
|
93
|
+
color: pnStyOpts.color,
|
|
94
|
+
fontSize: toCssUnit(pnStyOpts.fontSize),
|
|
95
|
+
textAlign: pnStyOpts.textAlign
|
|
96
|
+
}
|
|
86
97
|
}
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
function createHtmlPage (opts: VxePrintProps & { _pageBreaks: boolean }, printHtml: string): string {
|
|
90
101
|
const { pageStyle, customStyle } = opts
|
|
91
|
-
const
|
|
102
|
+
const pageStyObj = parsePageStyle(pageStyle)
|
|
103
|
+
const headStyOpts = pageStyObj.header
|
|
104
|
+
const titStyOpts = pageStyObj.title
|
|
105
|
+
const footStyOpts = pageStyObj.header
|
|
106
|
+
const pnStyOpts = pageStyObj.pageNumber
|
|
107
|
+
const isPbMode = opts._pageBreaks || (opts.pageBreaks && opts.pageBreaks.length)
|
|
92
108
|
return [
|
|
93
109
|
'<!DOCTYPE html><html>',
|
|
94
110
|
'<head>',
|
|
95
111
|
'<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',
|
|
96
112
|
`<title>${opts.title || ''}</title>`,
|
|
97
|
-
|
|
98
|
-
`<style
|
|
113
|
+
'<style media="print">@page{size:auto;margin: 0mm;}</style>',
|
|
114
|
+
`<style>body{font-size:${pageStyObj.fontSize || '14px'};color:${pageStyObj.color || defaultFontColor};text-align:${pageStyObj.textAlign || 'left'};}</style>`,
|
|
115
|
+
'<style>',
|
|
116
|
+
'.vxe-print-slots{display:none;}',
|
|
117
|
+
'.vxe-print-page-break.align--center{text-align:center;}',
|
|
118
|
+
'.vxe-print-page-break.align--left{text-align:left;}',
|
|
119
|
+
'.vxe-print-page-break.align--right{text-align:right;}',
|
|
120
|
+
'.vxe-print-page-break{break-before:always;page-break-before:always;display:flex;flex-direction:column;height:100vh;overflow:hidden;}',
|
|
121
|
+
'.vxe-print-page-break--body{display:flex;flex-direction:row;flex-grow:1;overflow:hidden;}',
|
|
122
|
+
'.vxe-print-page-break--left,.vxe-print-page-break--right{flex-shrink:0;height:100%;}',
|
|
123
|
+
`.vxe-print-page-break--left{width:${pageStyObj.marginLeft};}`,
|
|
124
|
+
`.vxe-print-page-break--right{width:${pageStyObj.marginRight};}`,
|
|
125
|
+
'.vxe-print-page-break--header,.vxe-print-page-break--footer{display:flex;justify-content:center;flex-direction:column;flex-shrink:0;width:100%;}',
|
|
126
|
+
`.vxe-print-page-break--header{height:${headStyOpts.height || pageStyObj.marginTop};padding:0 ${pageStyObj.marginLeft} 0 ${pageStyObj.marginRight};text-align:${headStyOpts.textAlign || 'left'};}`,
|
|
127
|
+
`.vxe-print-page-break--header-title{font-size:${titStyOpts.fontSize || '1.6em'};color:${titStyOpts.color || defaultFontColor};text-align:${opts.headerAlign || pnStyOpts.textAlign || 'center'};}`,
|
|
128
|
+
`.vxe-print-page-break--footer{height:${footStyOpts.height || pageStyObj.marginBottom};padding:0 ${pageStyObj.marginLeft} 0 ${pageStyObj.marginRight};text-align:${footStyOpts.textAlign || 'left'};}`,
|
|
129
|
+
'.vxe-print-page-break--content{flex-grow:1;overflow:hidden;}',
|
|
130
|
+
`.vxe-print-page-break--footer-page-number{font-size:${pnStyOpts.fontSize || '1.2em'};color:${pnStyOpts.color || defaultFontColor};text-align:${opts.footerAlign || pnStyOpts.textAlign || 'center'};}`,
|
|
131
|
+
'</style>',
|
|
99
132
|
'<style>.vxe-table{white-space:pre;}</style>',
|
|
100
133
|
`<style>${defaultHtmlStyle}</style>`,
|
|
134
|
+
isPbMode ? '<style>body{margin:0;}</style>' : `<style>body{margin:${pageStyObj.marginTop} ${pageStyObj.marginRight} ${pageStyObj.marginBottom} ${pageStyObj.marginLeft};}</style>`,
|
|
101
135
|
customStyle ? `<style>${customStyle}</style>` : '',
|
|
102
136
|
'</head>',
|
|
103
137
|
'<body>',
|
|
@@ -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 = () => {
|