vxe-pc-ui 4.1.19 → 4.1.21
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/README.md +83 -2
- package/es/anchor/src/anchor-link.js +1 -1
- package/es/anchor/src/anchor.js +1 -1
- package/es/breadcrumb/src/breadcrumb.js +1 -1
- package/es/button/src/button-group.js +4 -1
- package/es/button/src/button.js +2 -1
- package/es/calendar/src/calendar.js +64 -32
- package/es/card/src/card.js +4 -3
- package/es/carousel/src/carousel-item.js +13 -3
- package/es/carousel/src/carousel.js +16 -8
- package/es/checkbox/src/checkbox.js +30 -14
- package/es/checkbox/src/group.js +17 -8
- package/es/collapse-pane/index.js +1 -1
- package/es/countdown/src/countdown.js +17 -8
- package/es/date-picker/src/date-picker.js +148 -69
- package/es/drawer/src/drawer.js +86 -46
- package/es/form/render/index.js +1 -2
- package/es/form/src/form-config-item.js +4 -3
- package/es/form/src/form-gather.js +5 -3
- package/es/form/src/form-item.js +15 -10
- package/es/form/src/form.js +11 -8
- package/es/form/src/render.js +2 -1
- package/es/form/src/util.js +2 -1
- package/es/icon/src/icon.js +3 -0
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +24 -11
- package/es/image/src/group.js +4 -1
- package/es/image/src/preview.js +1 -1
- package/es/input/src/input.js +131 -66
- package/es/layout-aside/src/layout-aside.js +1 -1
- package/es/list/src/list.js +7 -5
- package/es/list-design/src/list-design.js +1 -1
- package/es/list-design/src/list-view.js +1 -1
- package/es/loading/src/loading.js +4 -1
- package/es/menu/src/menu.js +4 -3
- package/es/number-input/src/number-input.js +100 -77
- package/es/pager/src/pager.js +85 -45
- package/es/password-input/src/password-input.js +2 -2
- package/es/print/src/page-break.js +11 -2
- package/es/print/src/print.js +6 -4
- package/es/pulldown/src/pulldown.js +19 -13
- package/es/radio/src/button.js +2 -2
- package/es/radio/src/group.js +8 -4
- package/es/row/src/row.js +1 -1
- package/es/select/src/optgroup.js +19 -10
- package/es/select/src/option.js +17 -9
- package/es/select/src/select.js +64 -41
- package/es/select/src/util.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tab-pane.js +13 -3
- package/es/tabs/src/tabs.js +57 -47
- package/es/textarea/src/textarea.js +28 -10
- package/es/tooltip/src/tooltip.js +107 -78
- package/es/tree/src/tree.js +6 -3
- package/es/tree-select/src/tree-select.js +18 -10
- package/es/ui/index.js +1 -7
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +5 -5
- package/lib/anchor/src/anchor-link.js +1 -1
- package/lib/anchor/src/anchor-link.min.js +1 -1
- package/lib/anchor/src/anchor.js +1 -1
- package/lib/anchor/src/anchor.min.js +1 -1
- package/lib/breadcrumb/src/breadcrumb.js +1 -1
- package/lib/breadcrumb/src/breadcrumb.min.js +1 -1
- package/lib/button/src/button-group.js +4 -1
- package/lib/button/src/button-group.min.js +1 -1
- package/lib/button/src/button.js +2 -1
- package/lib/button/src/button.min.js +1 -1
- package/lib/calendar/src/calendar.js +42 -24
- package/lib/calendar/src/calendar.min.js +1 -1
- package/lib/card/src/card.js +6 -5
- package/lib/card/src/card.min.js +1 -1
- package/lib/carousel/src/carousel-item.js +16 -3
- package/lib/carousel/src/carousel-item.min.js +1 -1
- package/lib/carousel/src/carousel.js +18 -8
- package/lib/carousel/src/carousel.min.js +1 -1
- package/lib/checkbox/src/checkbox.js +16 -12
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/checkbox/src/group.js +10 -7
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/collapse-pane/index.js +1 -1
- package/lib/collapse-pane/index.min.js +1 -1
- package/lib/countdown/src/countdown.js +15 -7
- package/lib/countdown/src/countdown.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +124 -62
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/drawer/src/drawer.js +15 -30
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/form/render/index.js +1 -4
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/src/form-config-item.js +4 -5
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-gather.js +11 -9
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +11 -12
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +7 -7
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +2 -1
- package/lib/form/src/util.js +2 -1
- package/lib/icon/src/icon.js +3 -0
- package/lib/icon/src/icon.min.js +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 +22 -12
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/image/src/group.js +4 -1
- package/lib/image/src/group.min.js +1 -1
- package/lib/image/src/preview.js +1 -1
- package/lib/image/src/preview.min.js +1 -1
- package/lib/index.umd.js +884 -649
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +79 -51
- package/lib/input/src/input.min.js +1 -1
- package/lib/layout-aside/src/layout-aside.js +1 -1
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/list/src/list.js +9 -5
- package/lib/list/src/list.min.js +1 -1
- package/lib/list-design/src/list-design.js +1 -1
- package/lib/list-design/src/list-design.min.js +1 -1
- package/lib/list-design/src/list-view.js +1 -1
- package/lib/list-design/src/list-view.min.js +1 -1
- package/lib/loading/src/loading.js +4 -1
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/menu/src/menu.js +4 -3
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/number-input/src/number-input.js +67 -69
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/pager/src/pager.js +40 -39
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/password-input/src/password-input.js +2 -2
- package/lib/print/src/page-break.js +14 -2
- package/lib/print/src/page-break.min.js +1 -1
- package/lib/print/src/print.js +8 -6
- package/lib/print/src/print.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +19 -13
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +2 -2
- package/lib/radio/src/group.js +8 -4
- package/lib/radio/src/group.min.js +1 -1
- package/lib/row/src/row.js +1 -1
- package/lib/row/src/row.min.js +1 -1
- package/lib/select/src/optgroup.js +12 -9
- package/lib/select/src/optgroup.min.js +1 -1
- package/lib/select/src/option.js +9 -7
- package/lib/select/src/option.min.js +1 -1
- package/lib/select/src/select.js +52 -41
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/src/util.js +2 -2
- package/lib/select/src/util.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tab-pane.js +16 -3
- package/lib/tabs/src/tab-pane.min.js +1 -1
- package/lib/tabs/src/tabs.js +62 -50
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/textarea/src/textarea.js +4 -4
- package/lib/tooltip/src/tooltip.js +96 -88
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tree/src/tree.js +2 -2
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree-select/src/tree-select.js +13 -8
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/ui/index.js +3 -10
- 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/upload/src/upload.js +5 -5
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +2 -2
- package/packages/anchor/src/anchor-link.ts +2 -2
- package/packages/anchor/src/anchor.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb.ts +2 -2
- package/packages/button/src/button-group.ts +4 -1
- package/packages/button/src/button.ts +6 -5
- package/packages/calendar/src/calendar.ts +67 -35
- package/packages/card/src/card.ts +6 -4
- package/packages/carousel/src/carousel-item.ts +19 -4
- package/packages/carousel/src/carousel.ts +19 -11
- package/packages/checkbox/src/checkbox.ts +34 -15
- package/packages/checkbox/src/group.ts +22 -10
- package/packages/collapse-pane/index.ts +1 -1
- package/packages/countdown/src/countdown.ts +20 -11
- package/packages/date-picker/src/date-picker.ts +160 -80
- package/packages/drawer/src/drawer.ts +91 -50
- package/packages/form/render/index.ts +1 -3
- package/packages/form/src/form-config-item.ts +4 -3
- package/packages/form/src/form-gather.ts +5 -3
- package/packages/form/src/form-item.ts +15 -10
- package/packages/form/src/form.ts +12 -10
- package/packages/form/src/render.ts +2 -1
- package/packages/form/src/util.ts +2 -1
- package/packages/icon/src/icon.ts +3 -0
- package/packages/icon-picker/src/icon-picker.ts +31 -17
- package/packages/image/src/group.ts +4 -1
- package/packages/image/src/preview.ts +2 -2
- package/packages/input/src/input.ts +138 -75
- package/packages/layout-aside/src/layout-aside.ts +2 -2
- package/packages/list/src/list.ts +12 -11
- package/packages/list-design/src/list-design.ts +2 -2
- package/packages/list-design/src/list-view.ts +2 -2
- package/packages/loading/src/loading.ts +5 -2
- package/packages/menu/src/menu.ts +5 -4
- package/packages/number-input/src/number-input.ts +102 -79
- package/packages/pager/src/pager.ts +91 -50
- package/packages/password-input/src/password-input.ts +2 -2
- package/packages/print/src/page-break.ts +18 -4
- package/packages/print/src/print.ts +10 -5
- package/packages/pulldown/src/pulldown.ts +28 -22
- package/packages/radio/src/button.ts +2 -2
- package/packages/radio/src/group.ts +9 -5
- package/packages/row/src/row.ts +2 -2
- package/packages/select/src/optgroup.ts +22 -13
- package/packages/select/src/option.ts +18 -10
- package/packages/select/src/select.ts +79 -52
- package/packages/select/src/util.ts +3 -3
- package/packages/tabs/src/tab-pane.ts +20 -5
- package/packages/tabs/src/tabs.ts +59 -49
- package/packages/textarea/src/textarea.ts +28 -10
- package/packages/tooltip/src/tooltip.ts +118 -84
- package/packages/tree/src/tree.ts +7 -4
- package/packages/tree-select/src/tree-select.ts +25 -16
- package/packages/ui/index.ts +0 -7
- package/packages/upload/src/upload.ts +6 -6
- package/types/components/calendar.d.ts +6 -0
- package/types/components/carousel.d.ts +5 -0
- package/types/components/countdown.d.ts +4 -0
- package/types/components/date-picker.d.ts +23 -5
- package/types/components/drawer.d.ts +0 -1
- package/types/components/form.d.ts +4 -2
- package/types/components/icon-picker.d.ts +4 -0
- package/types/components/input.d.ts +9 -1
- package/types/components/list.d.ts +1 -0
- package/types/components/number-input.d.ts +6 -2
- package/types/components/optgroup.d.ts +10 -4
- package/types/components/pulldown.d.ts +5 -1
- package/types/components/select.d.ts +4 -0
- package/types/components/tabs.d.ts +4 -0
- package/types/components/toolbar.d.ts +5 -0
- package/types/components/tooltip.d.ts +4 -0
- package/types/components/tree-select.d.ts +4 -0
- package/types/ui/index.d.ts +0 -22
- /package/es/{collapse-pane → collapse}/src/collapse-pane.js +0 -0
- /package/es/icon/style/{iconfont.1725597808239.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725597808239.woff → iconfont.1725941866604.woff} +0 -0
- /package/es/icon/style/{iconfont.1725597808239.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/es/{iconfont.1725597808239.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/es/{iconfont.1725597808239.woff → iconfont.1725941866604.woff} +0 -0
- /package/es/{iconfont.1725597808239.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/lib/{collapse-pane → collapse}/src/collapse-pane.js +0 -0
- /package/lib/{collapse-pane → collapse}/src/collapse-pane.min.js +0 -0
- /package/lib/icon/style/{iconfont.1725597808239.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725597808239.woff → iconfont.1725941866604.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725597808239.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/lib/{iconfont.1725597808239.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/lib/{iconfont.1725597808239.woff → iconfont.1725941866604.woff} +0 -0
- /package/lib/{iconfont.1725597808239.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/packages/{collapse-pane → collapse}/src/collapse-pane.ts +0 -0
|
@@ -118,7 +118,7 @@ export default defineComponent({
|
|
|
118
118
|
emitInputEvent(value, evnt)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
const
|
|
121
|
+
const handleChange = (value: string, evnt: Event | { type: string }) => {
|
|
122
122
|
reactData.inputValue = value
|
|
123
123
|
emit('update:modelValue', value)
|
|
124
124
|
passwordInputMethods.dispatchEvent('input', { value }, evnt as any)
|
|
@@ -165,7 +165,7 @@ export default defineComponent({
|
|
|
165
165
|
|
|
166
166
|
const clearValueEvent = (evnt: Event, value: VxePasswordInputPropTypes.ModelValue) => {
|
|
167
167
|
focus()
|
|
168
|
-
|
|
168
|
+
handleChange('', evnt)
|
|
169
169
|
passwordInputMethods.dispatchEvent('clear', { value }, evnt)
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { defineComponent, ref, h, reactive, inject, onMounted, onUnmounted, createCommentVNode } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
+
import { createEvent } from '../../ui'
|
|
3
4
|
import { assemblePageBreak, destroyPageBreak } from './util'
|
|
4
5
|
|
|
5
|
-
import type { PrintPageBreakReactData, PrintPageBreakPrivateRef, VxePrintPageBreakEmits, VxePrintDefines, VxePrintPageBreakPrivateComputed, VxePrintConstructor, VxePrintPrivateMethods, VxePrintPageBreakConstructor, VxePrintPageBreakPrivateMethods } from '../../../types'
|
|
6
|
+
import type { PrintPageBreakReactData, PrintPageBreakPrivateRef, ValueOf, PrintPageBreakPrivateMethods, PrintPageBreakMethods, VxePrintPageBreakEmits, VxePrintDefines, VxePrintPageBreakPrivateComputed, VxePrintConstructor, VxePrintPrivateMethods, VxePrintPageBreakConstructor, VxePrintPageBreakPrivateMethods } from '../../../types'
|
|
6
7
|
|
|
7
8
|
export default defineComponent({
|
|
8
9
|
name: 'VxePrintPageBreak',
|
|
9
10
|
props: {},
|
|
10
11
|
emits: [] as VxePrintPageBreakEmits,
|
|
11
12
|
setup (props, context) {
|
|
12
|
-
const { slots } = context
|
|
13
|
+
const { slots, emit } = context
|
|
13
14
|
|
|
14
15
|
const xID = XEUtils.uniqueId()
|
|
15
16
|
const $xePrint = inject<(VxePrintConstructor & VxePrintPrivateMethods) | null>('$xePrint', null)
|
|
@@ -41,6 +42,19 @@ export default defineComponent({
|
|
|
41
42
|
getComputeMaps: () => computeMaps
|
|
42
43
|
} as unknown as VxePrintPageBreakConstructor & VxePrintPageBreakPrivateMethods
|
|
43
44
|
|
|
45
|
+
const dispatchEvent = (type: ValueOf<VxePrintPageBreakEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
46
|
+
emit(type, createEvent(evnt, { $print: $xePrint }, params))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const printPageBreakMethods: PrintPageBreakMethods = {
|
|
50
|
+
dispatchEvent
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const printPageBreakPrivateMethods: PrintPageBreakPrivateMethods = {
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Object.assign($xePrintPageBreak, printPageBreakMethods, printPageBreakPrivateMethods)
|
|
57
|
+
|
|
44
58
|
if (!$xePrint) {
|
|
45
59
|
$xePrintPageBreak.renderVN = () => {
|
|
46
60
|
return createCommentVNode()
|
|
@@ -54,8 +68,6 @@ export default defineComponent({
|
|
|
54
68
|
})
|
|
55
69
|
}
|
|
56
70
|
|
|
57
|
-
$xePrintPageBreak.renderVN = renderVN
|
|
58
|
-
|
|
59
71
|
onMounted(() => {
|
|
60
72
|
const elem = refElem.value
|
|
61
73
|
if ($xePrint && elem) {
|
|
@@ -69,6 +81,8 @@ export default defineComponent({
|
|
|
69
81
|
}
|
|
70
82
|
})
|
|
71
83
|
|
|
84
|
+
$xePrintPageBreak.renderVN = renderVN
|
|
85
|
+
|
|
72
86
|
return $xePrintPageBreak
|
|
73
87
|
},
|
|
74
88
|
render () {
|
|
@@ -4,7 +4,7 @@ import { getConfig, createEvent } from '../../ui'
|
|
|
4
4
|
import { printHtml } from './util'
|
|
5
5
|
import { getSlotVNs } from '../..//ui/src/vn'
|
|
6
6
|
|
|
7
|
-
import type { VxePrintPropTypes, PrintReactData, PrintPrivateRef, VxePrintEmits, VxePrintPrivateComputed, VxePrintConstructor, VxePrintPrivateMethods, PrintMethods } from '../../../types'
|
|
7
|
+
import type { VxePrintPropTypes, PrintReactData, PrintPrivateRef, VxePrintEmits, PrintPrivateMethods, ValueOf, VxePrintPrivateComputed, VxePrintConstructor, VxePrintPrivateMethods, PrintMethods } from '../../../types'
|
|
8
8
|
|
|
9
9
|
export default defineComponent({
|
|
10
10
|
name: 'VxePrint',
|
|
@@ -73,10 +73,12 @@ export default defineComponent({
|
|
|
73
73
|
getComputeMaps: () => computeMaps
|
|
74
74
|
} as unknown as VxePrintConstructor & VxePrintPrivateMethods
|
|
75
75
|
|
|
76
|
+
const dispatchEvent = (type: ValueOf<VxePrintEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
77
|
+
emit(type, createEvent(evnt, { $print: $xePrint }, params))
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
const printMethods: PrintMethods = {
|
|
77
|
-
dispatchEvent
|
|
78
|
-
emit(type, createEvent(evnt, { $print: $xePrint }, params))
|
|
79
|
-
},
|
|
81
|
+
dispatchEvent,
|
|
80
82
|
print () {
|
|
81
83
|
const elem = refElem.value
|
|
82
84
|
return printHtml(Object.assign({}, props, {
|
|
@@ -86,7 +88,10 @@ export default defineComponent({
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
const printPrivateMethods: PrintPrivateMethods = {
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Object.assign($xePrint, printMethods, printPrivateMethods)
|
|
90
95
|
|
|
91
96
|
const renderPageConfigLayouts = () => {
|
|
92
97
|
const { title, showPageNumber, showAllPageTitle, align, headerAlign, footerAlign } = props
|
|
@@ -4,7 +4,7 @@ import { getConfig, globalEvents, createEvent, useSize, VxeComponentStyleType, V
|
|
|
4
4
|
import { getAbsolutePos, getEventTargetNode } from '../../ui/src/dom'
|
|
5
5
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
6
6
|
|
|
7
|
-
import type { VxePulldownConstructor, VxePulldownPropTypes, VxePulldownEmits, PulldownReactData, PulldownMethods, PulldownPrivateRef, VxePulldownMethods, VxeTableConstructor, VxeTablePrivateMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods } from '../../../types'
|
|
7
|
+
import type { VxePulldownConstructor, VxePulldownPropTypes, PulldownInternalData, VxePulldownEmits, PulldownReactData, PulldownMethods, PulldownPrivateRef, VxePulldownMethods, VxeTableConstructor, VxeTablePrivateMethods, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods } from '../../../types'
|
|
8
8
|
|
|
9
9
|
export default defineComponent({
|
|
10
10
|
name: 'VxePulldown',
|
|
@@ -42,9 +42,10 @@ export default defineComponent({
|
|
|
42
42
|
setup (props, context) {
|
|
43
43
|
const { slots, emit } = context
|
|
44
44
|
|
|
45
|
-
const $xeModal = inject<VxeModalConstructor & VxeModalMethods | null>('$xeModal', null)
|
|
46
|
-
const $
|
|
47
|
-
const $
|
|
45
|
+
const $xeModal = inject<(VxeModalConstructor & VxeModalMethods) | null>('$xeModal', null)
|
|
46
|
+
const $xeDrawer = inject<(VxeDrawerConstructor & VxeDrawerMethods) | null>('$xeDrawer', null)
|
|
47
|
+
const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
48
|
+
const $xeForm = inject<(VxeFormConstructor & VxeFormPrivateMethods) | null>('$xeForm', null)
|
|
48
49
|
|
|
49
50
|
const xID = XEUtils.uniqueId()
|
|
50
51
|
|
|
@@ -53,16 +54,20 @@ export default defineComponent({
|
|
|
53
54
|
const reactData = reactive<PulldownReactData>({
|
|
54
55
|
initialized: false,
|
|
55
56
|
panelIndex: 0,
|
|
56
|
-
panelStyle:
|
|
57
|
+
panelStyle: {},
|
|
57
58
|
panelPlacement: null,
|
|
58
59
|
visiblePanel: false,
|
|
59
60
|
visibleAnimate: false,
|
|
60
61
|
isActivated: false
|
|
61
62
|
})
|
|
62
63
|
|
|
64
|
+
const internalData: PulldownInternalData = {
|
|
65
|
+
hpTimeout: undefined
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
64
|
-
const
|
|
65
|
-
const
|
|
69
|
+
const refPulldownContent = ref() as Ref<HTMLDivElement>
|
|
70
|
+
const refPulldownPanel = ref() as Ref<HTMLDivElement>
|
|
66
71
|
|
|
67
72
|
const computeBtnTransfer = computed(() => {
|
|
68
73
|
const { transfer } = props
|
|
@@ -71,7 +76,7 @@ export default defineComponent({
|
|
|
71
76
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
72
77
|
return globalTransfer
|
|
73
78
|
}
|
|
74
|
-
if ($xeTable || $xeModal || $xeForm) {
|
|
79
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
75
80
|
return true
|
|
76
81
|
}
|
|
77
82
|
}
|
|
@@ -87,6 +92,7 @@ export default defineComponent({
|
|
|
87
92
|
props,
|
|
88
93
|
context,
|
|
89
94
|
reactData,
|
|
95
|
+
internalData,
|
|
90
96
|
getRefMaps: () => refMaps
|
|
91
97
|
} as unknown as VxePulldownConstructor & VxePulldownMethods
|
|
92
98
|
|
|
@@ -111,8 +117,8 @@ export default defineComponent({
|
|
|
111
117
|
const { panelIndex, visiblePanel } = reactData
|
|
112
118
|
const btnTransfer = computeBtnTransfer.value
|
|
113
119
|
if (visiblePanel) {
|
|
114
|
-
const targetElem =
|
|
115
|
-
const panelElem =
|
|
120
|
+
const targetElem = refPulldownContent.value
|
|
121
|
+
const panelElem = refPulldownPanel.value
|
|
116
122
|
if (panelElem && targetElem) {
|
|
117
123
|
const targetHeight = targetElem.offsetHeight
|
|
118
124
|
const targetWidth = targetElem.offsetWidth
|
|
@@ -178,18 +184,18 @@ export default defineComponent({
|
|
|
178
184
|
})
|
|
179
185
|
}
|
|
180
186
|
|
|
181
|
-
let hidePanelTimeout: number
|
|
182
|
-
|
|
183
187
|
/**
|
|
184
188
|
* 显示下拉面板
|
|
185
189
|
*/
|
|
186
|
-
const showPanel = ()
|
|
190
|
+
const showPanel = () => {
|
|
187
191
|
if (!reactData.initialized) {
|
|
188
192
|
reactData.initialized = true
|
|
189
193
|
}
|
|
190
|
-
return new Promise(resolve => {
|
|
194
|
+
return new Promise<void>(resolve => {
|
|
191
195
|
if (!props.disabled) {
|
|
192
|
-
|
|
196
|
+
if (internalData.hpTimeout) {
|
|
197
|
+
clearTimeout(internalData.hpTimeout)
|
|
198
|
+
}
|
|
193
199
|
reactData.isActivated = true
|
|
194
200
|
reactData.visibleAnimate = true
|
|
195
201
|
setTimeout(() => {
|
|
@@ -212,12 +218,12 @@ export default defineComponent({
|
|
|
212
218
|
/**
|
|
213
219
|
* 隐藏下拉面板
|
|
214
220
|
*/
|
|
215
|
-
const hidePanel = ()
|
|
221
|
+
const hidePanel = () => {
|
|
216
222
|
reactData.visiblePanel = false
|
|
217
223
|
emit('update:modelValue', false)
|
|
218
|
-
return new Promise(resolve => {
|
|
224
|
+
return new Promise<void>(resolve => {
|
|
219
225
|
if (reactData.visibleAnimate) {
|
|
220
|
-
|
|
226
|
+
internalData.hpTimeout = window.setTimeout(() => {
|
|
221
227
|
reactData.visibleAnimate = false
|
|
222
228
|
nextTick(() => {
|
|
223
229
|
resolve()
|
|
@@ -263,7 +269,7 @@ export default defineComponent({
|
|
|
263
269
|
const handleGlobalMousewheelEvent = (evnt: Event) => {
|
|
264
270
|
const { disabled } = props
|
|
265
271
|
const { visiblePanel } = reactData
|
|
266
|
-
const panelElem =
|
|
272
|
+
const panelElem = refPulldownPanel.value
|
|
267
273
|
if (!disabled) {
|
|
268
274
|
if (visiblePanel) {
|
|
269
275
|
if (getEventTargetNode(evnt, panelElem).flag) {
|
|
@@ -280,7 +286,7 @@ export default defineComponent({
|
|
|
280
286
|
const { disabled } = props
|
|
281
287
|
const { visiblePanel } = reactData
|
|
282
288
|
const el = refElem.value
|
|
283
|
-
const panelElem =
|
|
289
|
+
const panelElem = refPulldownPanel.value
|
|
284
290
|
if (!disabled) {
|
|
285
291
|
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag
|
|
286
292
|
if (visiblePanel && !reactData.isActivated) {
|
|
@@ -369,7 +375,7 @@ export default defineComponent({
|
|
|
369
375
|
}]
|
|
370
376
|
}, [
|
|
371
377
|
h('div', {
|
|
372
|
-
ref:
|
|
378
|
+
ref: refPulldownContent,
|
|
373
379
|
class: 'vxe-pulldown--content',
|
|
374
380
|
onClick: clickTargetEvent
|
|
375
381
|
}, defaultSlot ? defaultSlot({ $pulldown: $xePulldown }) : []),
|
|
@@ -378,7 +384,7 @@ export default defineComponent({
|
|
|
378
384
|
disabled: btnTransfer ? !initialized : true
|
|
379
385
|
}, [
|
|
380
386
|
h('div', {
|
|
381
|
-
ref:
|
|
387
|
+
ref: refPulldownPanel,
|
|
382
388
|
class: ['vxe-table--ignore-clear vxe-pulldown--panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $pulldown: $xePulldown }) : popupClassName) : '', {
|
|
383
389
|
[`size--${vSize}`]: vSize,
|
|
384
390
|
'is--shadow': showPopupShadow,
|
|
@@ -122,7 +122,7 @@ export default defineComponent({
|
|
|
122
122
|
const vSize = computeSize.value
|
|
123
123
|
const isDisabled = computeIsDisabled.value
|
|
124
124
|
const name = computeName.value
|
|
125
|
-
const
|
|
125
|
+
const isChecked = computeChecked.value
|
|
126
126
|
|
|
127
127
|
return h('label', {
|
|
128
128
|
class: ['vxe-radio', 'vxe-radio-button', {
|
|
@@ -135,7 +135,7 @@ export default defineComponent({
|
|
|
135
135
|
class: 'vxe-radio--input',
|
|
136
136
|
type: 'radio',
|
|
137
137
|
name,
|
|
138
|
-
checked,
|
|
138
|
+
checked: isChecked,
|
|
139
139
|
disabled: isDisabled,
|
|
140
140
|
onChange: changeEvent,
|
|
141
141
|
onClick: clickEvent
|
|
@@ -97,11 +97,12 @@ export default defineComponent({
|
|
|
97
97
|
|
|
98
98
|
const radioGroupPrivateMethods: RadioGroupPrivateMethods = {
|
|
99
99
|
handleChecked (params, evnt) {
|
|
100
|
-
|
|
100
|
+
const value = params.label
|
|
101
|
+
emit('update:modelValue', value)
|
|
101
102
|
dispatchEvent('change', params, evnt)
|
|
102
103
|
// 自动更新校验状态
|
|
103
104
|
if ($xeForm && formItemInfo) {
|
|
104
|
-
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field,
|
|
105
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
}
|
|
@@ -131,10 +132,13 @@ export default defineComponent({
|
|
|
131
132
|
: []))
|
|
132
133
|
}
|
|
133
134
|
|
|
134
|
-
$xeRadioGroup.renderVN = renderVN
|
|
135
|
-
|
|
136
135
|
provide('$xeRadioGroup', $xeRadioGroup)
|
|
137
136
|
|
|
138
|
-
|
|
137
|
+
$xeRadioGroup.renderVN = renderVN
|
|
138
|
+
|
|
139
|
+
return $xeRadioGroup
|
|
140
|
+
},
|
|
141
|
+
render () {
|
|
142
|
+
return this.renderVN()
|
|
139
143
|
}
|
|
140
144
|
})
|
package/packages/row/src/row.ts
CHANGED
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
import { defineComponent, h, onUnmounted, provide, inject, ref, Ref, onMounted, PropType } from 'vue'
|
|
2
2
|
import { XEOptionProvide, createOption, watchOption, destroyOption, assembleOption } from './util'
|
|
3
3
|
|
|
4
|
-
import type { VxeSelectConstructor,
|
|
4
|
+
import type { VxeSelectConstructor, VxeOptgroupEmits, VxeOptgroupPropTypes } from '../../../types'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
7
7
|
name: 'VxeOptgroup',
|
|
8
8
|
props: {
|
|
9
|
-
label: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
label: {
|
|
10
|
+
type: [String, Number, Boolean] as PropType<VxeOptgroupPropTypes.Label>,
|
|
11
|
+
default: ''
|
|
12
|
+
},
|
|
13
|
+
visible: {
|
|
14
|
+
type: Boolean as PropType<VxeOptgroupPropTypes.Visible>,
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
className: [String, Function] as PropType<VxeOptgroupPropTypes.ClassName>,
|
|
18
|
+
disabled: Boolean as PropType<VxeOptgroupPropTypes.Disabled>
|
|
13
19
|
},
|
|
20
|
+
emits: [] as VxeOptgroupEmits,
|
|
14
21
|
setup (props, { slots }) {
|
|
15
22
|
const elem = ref() as Ref<HTMLDivElement>
|
|
16
23
|
const $xeSelect = inject('$xeSelect', {} as VxeSelectConstructor)
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
24
|
+
const optionConfig = createOption($xeSelect, props)
|
|
25
|
+
const $xeOptgroup: XEOptionProvide = { optionConfig }
|
|
26
|
+
optionConfig.options = []
|
|
20
27
|
|
|
21
|
-
provide('
|
|
28
|
+
provide('$xeOptgroup', $xeOptgroup)
|
|
22
29
|
|
|
23
|
-
watchOption(props,
|
|
30
|
+
watchOption(props, optionConfig)
|
|
24
31
|
|
|
25
32
|
onMounted(() => {
|
|
26
|
-
|
|
33
|
+
const el = elem.value
|
|
34
|
+
assembleOption($xeSelect, el, optionConfig)
|
|
27
35
|
})
|
|
28
36
|
|
|
29
37
|
onUnmounted(() => {
|
|
30
|
-
destroyOption($xeSelect,
|
|
38
|
+
destroyOption($xeSelect, optionConfig)
|
|
31
39
|
})
|
|
32
40
|
|
|
33
41
|
return () => {
|
|
42
|
+
const defaultSlot = slots.default
|
|
34
43
|
return h('div', {
|
|
35
44
|
ref: elem
|
|
36
|
-
},
|
|
45
|
+
}, defaultSlot ? defaultSlot({}) : [])
|
|
37
46
|
}
|
|
38
47
|
}
|
|
39
48
|
})
|
|
@@ -1,32 +1,40 @@
|
|
|
1
1
|
import { defineComponent, h, onUnmounted, inject, ref, Ref, onMounted, PropType } from 'vue'
|
|
2
2
|
import { XEOptionProvide, createOption, watchOption, destroyOption, assembleOption } from './util'
|
|
3
3
|
|
|
4
|
-
import type { VxeSelectConstructor, VxeOptionPropTypes } from '../../../types'
|
|
4
|
+
import type { VxeSelectConstructor, VxeOptionEmits, VxeOptionPropTypes } from '../../../types'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
7
7
|
name: 'VxeOption',
|
|
8
8
|
props: {
|
|
9
|
-
value:
|
|
10
|
-
label: {
|
|
11
|
-
|
|
9
|
+
value: [String, Number, Boolean] as PropType<VxeOptionPropTypes.Value>,
|
|
10
|
+
label: {
|
|
11
|
+
type: [String, Number, Boolean] as PropType<VxeOptionPropTypes.Label>,
|
|
12
|
+
default: ''
|
|
13
|
+
},
|
|
14
|
+
visible: {
|
|
15
|
+
type: Boolean as PropType<VxeOptionPropTypes.Visible>,
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
12
18
|
className: [String, Function] as PropType<VxeOptionPropTypes.ClassName>,
|
|
13
19
|
disabled: Boolean as PropType<VxeOptionPropTypes.Disabled>
|
|
14
20
|
},
|
|
21
|
+
emits: [] as VxeOptionEmits,
|
|
15
22
|
setup (props, { slots }) {
|
|
16
23
|
const elem = ref() as Ref<HTMLDivElement>
|
|
17
24
|
const $xeSelect = inject('$xeSelect', {} as VxeSelectConstructor)
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
25
|
+
const $xeOptgroup = inject<XEOptionProvide | null>('$xeOptgroup', null)
|
|
26
|
+
const optionConfig = createOption($xeSelect, props)
|
|
27
|
+
optionConfig.slots = slots
|
|
21
28
|
|
|
22
|
-
watchOption(props,
|
|
29
|
+
watchOption(props, optionConfig)
|
|
23
30
|
|
|
24
31
|
onMounted(() => {
|
|
25
|
-
|
|
32
|
+
const el = elem.value
|
|
33
|
+
assembleOption($xeSelect, el, optionConfig, $xeOptgroup)
|
|
26
34
|
})
|
|
27
35
|
|
|
28
36
|
onUnmounted(() => {
|
|
29
|
-
destroyOption($xeSelect,
|
|
37
|
+
destroyOption($xeSelect, optionConfig)
|
|
30
38
|
})
|
|
31
39
|
|
|
32
40
|
return () => {
|