vxe-pc-ui 3.0.1 → 3.0.2
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 +23 -25
- package/es/calendar/index.js +12 -0
- package/es/calendar/src/calendar.js +1227 -0
- package/es/calendar/style.css +247 -0
- package/es/calendar/style.min.css +1 -0
- package/es/checkbox/src/checkbox.js +6 -1
- package/es/checkbox/src/group.js +6 -1
- package/es/collapse/index.js +12 -0
- package/es/collapse/src/collapse-pane.js +39 -0
- package/es/collapse/src/collapse.js +39 -0
- package/es/collapse/style.css +0 -0
- package/es/collapse/style.min.css +0 -0
- package/es/collapse-pane/index.js +12 -0
- package/es/collapse-pane/style.css +0 -0
- package/es/collapse-pane/style.min.css +0 -0
- package/es/components.js +27 -27
- package/es/date-picker/src/date-picker.js +17 -13
- package/es/drawer/src/drawer.js +17 -12
- package/es/form/index.js +13 -0
- package/es/form/render/index.js +461 -0
- package/es/form/src/form-config-item.js +201 -0
- package/es/form/src/form-gather.js +87 -0
- package/es/form/src/form-item.js +291 -0
- package/es/form/src/form.js +762 -0
- package/es/form/src/itemInfo.js +43 -0
- package/es/form/src/render.js +78 -0
- package/es/form/src/util.js +66 -0
- package/es/form/style.css +470 -0
- package/es/form/style.min.css +1 -0
- package/es/form-gather/index.js +12 -0
- package/es/form-gather/style.css +0 -0
- package/es/form-gather/style.min.css +0 -0
- package/es/form-item/index.js +12 -0
- package/es/form-item/style.css +0 -0
- package/es/form-item/style.min.css +0 -0
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +5 -1
- package/es/image/src/preview.js +1 -2
- package/es/input/src/input.js +19 -15
- package/es/list/index.js +12 -0
- package/es/list/src/list.js +373 -0
- package/es/list/style.css +28 -0
- package/es/list/style.min.css +1 -0
- package/es/loading/src/loading.js +5 -0
- package/es/menu/src/menu.js +6 -2
- package/es/modal/src/modal.js +7 -4
- package/es/number-input/src/number-input.js +11 -7
- package/es/pager/style.css +303 -0
- package/es/pager/style.min.css +1 -0
- package/es/password-input/src/password-input.js +7 -3
- package/es/pulldown/src/pulldown.js +6 -2
- package/es/radio/src/button.js +6 -2
- package/es/radio/src/group.js +6 -2
- package/es/radio/src/radio.js +6 -2
- package/es/select/src/select.js +16 -1
- package/es/select/src/util.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/switch/src/switch.js +6 -2
- package/es/tabs/src/tabs.js +8 -3
- package/es/textarea/src/textarea.js +9 -5
- package/es/tooltip/src/tooltip.js +6 -1
- package/es/tree/index.js +12 -0
- package/es/tree/src/tree.js +1216 -0
- package/es/tree/style.css +219 -0
- package/es/tree/style.min.css +1 -0
- package/es/tree-select/index.js +12 -0
- package/es/tree-select/src/tree-select.js +685 -0
- package/es/tree-select/style.css +129 -0
- package/es/tree-select/style.min.css +1 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.js +1 -1
- package/es/upload/src/upload.js +9 -5
- package/es/vxe-calendar/index.js +3 -0
- package/es/vxe-calendar/style.css +247 -0
- package/es/vxe-calendar/style.min.css +1 -0
- package/es/vxe-collapse/index.js +3 -0
- package/es/vxe-collapse/style.css +0 -0
- package/es/vxe-collapse/style.min.css +0 -0
- package/es/vxe-collapse-pane/index.js +3 -0
- package/es/vxe-collapse-pane/style.css +0 -0
- package/es/vxe-collapse-pane/style.min.css +0 -0
- package/es/vxe-form/index.js +3 -0
- package/es/vxe-form/style.css +470 -0
- package/es/vxe-form/style.min.css +1 -0
- package/es/vxe-form-gather/index.js +3 -0
- package/es/vxe-form-gather/style.css +0 -0
- package/es/vxe-form-gather/style.min.css +0 -0
- package/es/vxe-form-item/index.js +3 -0
- package/es/vxe-form-item/style.css +0 -0
- package/es/vxe-form-item/style.min.css +0 -0
- package/es/vxe-list/index.js +3 -0
- package/es/vxe-list/style.css +28 -0
- package/es/vxe-list/style.min.css +1 -0
- package/es/vxe-pager/index.js +3 -0
- package/es/vxe-pager/style.css +303 -0
- package/es/vxe-pager/style.min.css +1 -0
- package/es/vxe-tree/index.js +3 -0
- package/es/vxe-tree/style.css +219 -0
- package/es/vxe-tree/style.min.css +1 -0
- package/es/vxe-tree-select/index.js +3 -0
- package/es/vxe-tree-select/style.css +129 -0
- package/es/vxe-tree-select/style.min.css +1 -0
- package/lib/calendar/index.js +19 -0
- package/lib/calendar/index.min.js +1 -0
- package/lib/calendar/src/calendar.js +1286 -0
- package/lib/calendar/src/calendar.min.js +1 -0
- package/lib/calendar/style/index.js +1 -0
- package/lib/calendar/style/style.css +247 -0
- package/lib/calendar/style/style.min.css +1 -0
- package/lib/checkbox/src/checkbox.js +6 -1
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/checkbox/src/group.js +6 -1
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/collapse/index.js +19 -0
- package/lib/collapse/index.min.js +1 -0
- package/lib/collapse/src/collapse-pane.js +48 -0
- package/lib/collapse/src/collapse-pane.min.js +1 -0
- package/lib/collapse/src/collapse.js +48 -0
- package/lib/collapse/src/collapse.min.js +1 -0
- package/lib/collapse/style/index.js +1 -0
- package/lib/collapse/style/style.css +0 -0
- package/lib/collapse/style/style.min.css +0 -0
- package/lib/collapse-pane/index.js +19 -0
- package/lib/collapse-pane/index.min.js +1 -0
- package/lib/collapse-pane/style/index.js +1 -0
- package/lib/collapse-pane/style/style.css +0 -0
- package/lib/collapse-pane/style/style.min.css +0 -0
- package/lib/components.js +114 -39
- package/lib/components.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +17 -13
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/drawer/src/drawer.js +17 -12
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/form/index.js +20 -0
- package/lib/form/index.min.js +1 -0
- package/lib/form/render/index.js +509 -0
- package/lib/form/render/index.min.js +1 -0
- package/lib/form/src/form-config-item.js +210 -0
- package/lib/form/src/form-config-item.min.js +1 -0
- package/lib/form/src/form-gather.js +99 -0
- package/lib/form/src/form-gather.min.js +1 -0
- package/lib/form/src/form-item.js +299 -0
- package/lib/form/src/form-item.min.js +1 -0
- package/lib/form/src/form.js +856 -0
- package/lib/form/src/form.min.js +1 -0
- package/lib/form/src/itemInfo.js +60 -0
- package/lib/form/src/itemInfo.min.js +1 -0
- package/lib/form/src/render.js +94 -0
- package/lib/form/src/render.min.js +1 -0
- package/lib/form/src/util.js +93 -0
- package/lib/form/src/util.min.js +1 -0
- package/lib/form/style/index.js +1 -0
- package/lib/form/style/style.css +470 -0
- package/lib/form/style/style.min.css +1 -0
- package/lib/form-gather/index.js +19 -0
- package/lib/form-gather/index.min.js +1 -0
- package/lib/form-gather/style/index.js +1 -0
- package/lib/form-gather/style/style.css +0 -0
- package/lib/form-gather/style/style.min.css +0 -0
- package/lib/form-item/index.js +19 -0
- package/lib/form-item/index.min.js +1 -0
- package/lib/form-item/style/index.js +1 -0
- package/lib/form-item/style/style.css +0 -0
- package/lib/form-item/style/style.min.css +0 -0
- 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 +5 -1
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/image/src/preview.js +1 -2
- package/lib/image/src/preview.min.js +1 -1
- package/lib/index.umd.js +11284 -5009
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +19 -15
- package/lib/input/src/input.min.js +1 -1
- package/lib/list/index.js +19 -0
- package/lib/list/index.min.js +1 -0
- package/lib/list/src/list.js +415 -0
- package/lib/list/src/list.min.js +1 -0
- package/lib/list/style/index.js +1 -0
- package/lib/list/style/style.css +28 -0
- package/lib/list/style/style.min.css +1 -0
- package/lib/loading/src/loading.js +5 -0
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/menu/src/menu.js +6 -2
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +7 -4
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/number-input/src/number-input.js +11 -7
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/pager/style/index.js +1 -0
- package/lib/pager/style/style.css +303 -0
- package/lib/pager/style/style.min.css +1 -0
- package/lib/password-input/src/password-input.js +7 -3
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +6 -2
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +6 -2
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +6 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio/src/radio.js +6 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/src/select.js +16 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/src/util.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/src/switch.js +6 -2
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/tabs/src/tabs.js +8 -3
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/textarea/src/textarea.js +9 -5
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +6 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tree/index.js +19 -0
- package/lib/tree/index.min.js +1 -0
- package/lib/tree/src/tree.js +1324 -0
- package/lib/tree/src/tree.min.js +1 -0
- package/lib/tree/style/index.js +1 -0
- package/lib/tree/style/style.css +219 -0
- package/lib/tree/style/style.min.css +1 -0
- package/lib/tree-select/index.js +19 -0
- package/lib/tree-select/index.min.js +1 -0
- package/lib/tree-select/src/tree-select.js +695 -0
- package/lib/tree-select/src/tree-select.min.js +1 -0
- package/lib/tree-select/style/index.js +1 -0
- package/lib/tree-select/style/style.css +129 -0
- package/lib/tree-select/style/style.min.css +1 -0
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/vn.js +1 -1
- package/lib/ui/src/vn.min.js +1 -1
- package/lib/upload/src/upload.js +9 -5
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/vxe-calendar/index.js +23 -0
- package/lib/vxe-calendar/index.min.js +1 -0
- package/lib/vxe-calendar/style/index.js +1 -0
- package/lib/vxe-calendar/style/style.css +247 -0
- package/lib/vxe-calendar/style/style.min.css +1 -0
- package/lib/vxe-collapse/index.js +23 -0
- package/lib/vxe-collapse/index.min.js +1 -0
- package/lib/vxe-collapse/style/index.js +1 -0
- package/lib/vxe-collapse/style/style.css +0 -0
- package/lib/vxe-collapse/style/style.min.css +0 -0
- package/lib/vxe-collapse-pane/index.js +23 -0
- package/lib/vxe-collapse-pane/index.min.js +1 -0
- package/lib/vxe-collapse-pane/style/index.js +1 -0
- package/lib/vxe-collapse-pane/style/style.css +0 -0
- package/lib/vxe-collapse-pane/style/style.min.css +0 -0
- package/lib/vxe-form/index.js +23 -0
- package/lib/vxe-form/index.min.js +1 -0
- package/lib/vxe-form/style/index.js +1 -0
- package/lib/vxe-form/style/style.css +470 -0
- package/lib/vxe-form/style/style.min.css +1 -0
- package/lib/vxe-form-gather/index.js +23 -0
- package/lib/vxe-form-gather/index.min.js +1 -0
- package/lib/vxe-form-gather/style/index.js +1 -0
- package/lib/vxe-form-gather/style/style.css +0 -0
- package/lib/vxe-form-gather/style/style.min.css +0 -0
- package/lib/vxe-form-item/index.js +23 -0
- package/lib/vxe-form-item/index.min.js +1 -0
- package/lib/vxe-form-item/style/index.js +1 -0
- package/lib/vxe-form-item/style/style.css +0 -0
- package/lib/vxe-form-item/style/style.min.css +0 -0
- package/lib/vxe-list/index.js +23 -0
- package/lib/vxe-list/index.min.js +1 -0
- package/lib/vxe-list/style/index.js +1 -0
- package/lib/vxe-list/style/style.css +28 -0
- package/lib/vxe-list/style/style.min.css +1 -0
- package/lib/vxe-pager/index.js +23 -0
- package/lib/vxe-pager/index.min.js +1 -0
- package/lib/vxe-pager/style/index.js +1 -0
- package/lib/vxe-pager/style/style.css +303 -0
- package/lib/vxe-pager/style/style.min.css +1 -0
- package/lib/vxe-tree/index.js +23 -0
- package/lib/vxe-tree/index.min.js +1 -0
- package/lib/vxe-tree/style/index.js +1 -0
- package/lib/vxe-tree/style/style.css +219 -0
- package/lib/vxe-tree/style/style.min.css +1 -0
- package/lib/vxe-tree-select/index.js +23 -0
- package/lib/vxe-tree-select/index.min.js +1 -0
- package/lib/vxe-tree-select/style/index.js +1 -0
- package/lib/vxe-tree-select/style/style.css +129 -0
- package/lib/vxe-tree-select/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/calendar/index.ts +16 -0
- package/packages/calendar/src/calendar.ts +1281 -0
- package/packages/checkbox/src/checkbox.ts +7 -1
- package/packages/checkbox/src/group.ts +8 -2
- package/packages/collapse/index.ts +16 -0
- package/packages/collapse/src/collapse-pane.ts +47 -0
- package/packages/collapse/src/collapse.ts +47 -0
- package/packages/collapse-pane/index.ts +16 -0
- package/packages/components.ts +27 -27
- package/packages/date-picker/src/date-picker.ts +18 -13
- package/packages/drawer/src/drawer.ts +18 -12
- package/packages/form/index.ts +17 -0
- package/packages/form/render/index.ts +499 -0
- package/packages/form/src/form-config-item.ts +219 -0
- package/packages/form/src/form-gather.ts +104 -0
- package/packages/form/src/form-item.ts +322 -0
- package/packages/form/src/form.ts +809 -0
- package/packages/form/src/itemInfo.ts +47 -0
- package/packages/form/src/render.ts +98 -0
- package/packages/form/src/util.ts +80 -0
- package/packages/form-gather/index.ts +16 -0
- package/packages/form-item/index.ts +16 -0
- package/packages/icon-picker/src/icon-picker.ts +6 -1
- package/packages/image/src/preview.ts +1 -2
- package/packages/input/src/input.ts +20 -15
- package/packages/layout-footer/src/layout-footer.ts +1 -0
- package/packages/list/index.ts +16 -0
- package/packages/list/src/list.ts +403 -0
- package/packages/loading/src/loading.ts +6 -0
- package/packages/menu/src/menu.ts +7 -2
- package/packages/modal/src/modal.ts +8 -4
- package/packages/number-input/src/number-input.ts +12 -7
- package/packages/password-input/src/password-input.ts +8 -3
- package/packages/pulldown/src/pulldown.ts +7 -2
- package/packages/radio/src/button.ts +7 -2
- package/packages/radio/src/group.ts +7 -2
- package/packages/radio/src/radio.ts +7 -2
- package/packages/select/src/select.ts +17 -1
- package/packages/select/src/util.ts +4 -3
- package/packages/switch/src/switch.ts +7 -2
- package/packages/tabs/src/tabs.ts +9 -3
- package/packages/textarea/src/textarea.ts +10 -5
- package/packages/tooltip/src/tooltip.ts +7 -1
- package/packages/tree/index.ts +16 -0
- package/packages/tree/src/tree.ts +1292 -0
- package/packages/tree-select/index.ts +16 -0
- package/packages/tree-select/src/tree-select.ts +743 -0
- package/packages/ui/src/vn.ts +1 -1
- package/packages/upload/src/upload.ts +10 -5
- package/types/components/calendar.d.ts +6 -0
- package/types/components/colgroup.d.ts +1 -0
- package/types/components/column.d.ts +1 -0
- package/types/components/drawer.d.ts +11 -10
- package/types/components/form-item.d.ts +1 -1
- package/types/components/form.d.ts +8 -1
- package/types/components/list.d.ts +1 -0
- package/types/components/table.d.ts +43 -4
- package/types/components/toolbar.d.ts +5 -0
- package/types/components/tree-select.d.ts +4 -0
- package/types/ui/index.d.ts +0 -5
- package/types/ui/renderer.d.ts +37 -36
- package/types/handles/form-design.d.ts +0 -4
- package/types/handles/index.d.ts +0 -3
- package/types/handles/list-design.d.ts +0 -4
- package/types/handles/table.d.ts +0 -4
- /package/es/icon/style/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/es/icon/style/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/es/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/es/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/es/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/lib/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/lib/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/lib/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { PropType, CreateElement, VNode } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { getConfig, globalEvents, globalResize, createEvent, globalMixins } from '../../ui'
|
|
5
|
+
import { browse } from '../../ui/src/dom'
|
|
6
|
+
import VxeLoadingComponent from '../../loading/src/loading'
|
|
7
|
+
|
|
8
|
+
import type { VxeListPropTypes, VxeListEmits, VxeComponentSizeType, ListReactData, ValueOf, ListInternalData } from '../../../types'
|
|
9
|
+
|
|
10
|
+
export default defineVxeComponent({
|
|
11
|
+
name: 'VxeList',
|
|
12
|
+
mixins: [
|
|
13
|
+
globalMixins.sizeMixin
|
|
14
|
+
],
|
|
15
|
+
props: {
|
|
16
|
+
data: Array as PropType<VxeListPropTypes.Data>,
|
|
17
|
+
height: [Number, String] as PropType<VxeListPropTypes.Height>,
|
|
18
|
+
maxHeight: [Number, String] as PropType<VxeListPropTypes.MaxHeight>,
|
|
19
|
+
loading: Boolean as PropType<VxeListPropTypes.Loading>,
|
|
20
|
+
className: [String, Function] as PropType<VxeListPropTypes.ClassName>,
|
|
21
|
+
size: { type: String as PropType<VxeListPropTypes.Size>, default: () => getConfig().list.size || getConfig().size },
|
|
22
|
+
autoResize: { type: Boolean as PropType<VxeListPropTypes.AutoResize>, default: () => getConfig().list.autoResize },
|
|
23
|
+
syncResize: [Boolean, String, Number] as PropType<VxeListPropTypes.SyncResize>,
|
|
24
|
+
scrollY: Object as PropType<VxeListPropTypes.ScrollY>
|
|
25
|
+
},
|
|
26
|
+
data () {
|
|
27
|
+
const xID = XEUtils.uniqueId()
|
|
28
|
+
const reactData: ListReactData = {
|
|
29
|
+
scrollYLoad: false,
|
|
30
|
+
bodyHeight: 0,
|
|
31
|
+
rowHeight: 0,
|
|
32
|
+
topSpaceHeight: 0,
|
|
33
|
+
items: []
|
|
34
|
+
}
|
|
35
|
+
const internalData: ListInternalData = {
|
|
36
|
+
resizeObserver: undefined,
|
|
37
|
+
fullData: [],
|
|
38
|
+
lastScrollLeft: 0,
|
|
39
|
+
lastScrollTop: 0,
|
|
40
|
+
scrollYStore: {
|
|
41
|
+
startIndex: 0,
|
|
42
|
+
endIndex: 0,
|
|
43
|
+
visibleSize: 0,
|
|
44
|
+
offsetSize: 0,
|
|
45
|
+
rowHeight: 0
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
xID,
|
|
50
|
+
reactData,
|
|
51
|
+
internalData
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
...({} as {
|
|
56
|
+
computeSize(): VxeComponentSizeType
|
|
57
|
+
}),
|
|
58
|
+
computeSYOpts () {
|
|
59
|
+
const $xeList = this
|
|
60
|
+
const props = $xeList
|
|
61
|
+
|
|
62
|
+
return Object.assign({} as { gt: number }, getConfig().list.scrollY, props.scrollY)
|
|
63
|
+
},
|
|
64
|
+
computeStyles () {
|
|
65
|
+
const $xeList = this
|
|
66
|
+
const props = $xeList
|
|
67
|
+
|
|
68
|
+
const { height, maxHeight } = props
|
|
69
|
+
const style: { [key: string]: string | number } = {}
|
|
70
|
+
if (height) {
|
|
71
|
+
style.height = `${isNaN(height as number) ? height : `${height}px`}`
|
|
72
|
+
} else if (maxHeight) {
|
|
73
|
+
style.height = 'auto'
|
|
74
|
+
style.maxHeight = `${isNaN(maxHeight as number) ? maxHeight : `${maxHeight}px`}`
|
|
75
|
+
}
|
|
76
|
+
return style
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
//
|
|
82
|
+
// Method
|
|
83
|
+
//
|
|
84
|
+
dispatchEvent (type: ValueOf<VxeListEmits>, params: Record<string, any>, evnt: Event | null) {
|
|
85
|
+
const $xeList = this
|
|
86
|
+
$xeList.$emit(type, createEvent(evnt, { $list: $xeList }, params))
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* 加载数据
|
|
90
|
+
* @param {Array} datas 数据
|
|
91
|
+
*/
|
|
92
|
+
loadData (datas: any) {
|
|
93
|
+
const $xeList = this
|
|
94
|
+
const reactData = $xeList.reactData
|
|
95
|
+
const internalData = $xeList.internalData
|
|
96
|
+
|
|
97
|
+
const { scrollYStore } = internalData
|
|
98
|
+
const sYOpts = $xeList.computeSYOpts
|
|
99
|
+
const fullData = datas || []
|
|
100
|
+
Object.assign(scrollYStore, {
|
|
101
|
+
startIndex: 0,
|
|
102
|
+
endIndex: 1,
|
|
103
|
+
visibleSize: 0
|
|
104
|
+
})
|
|
105
|
+
internalData.fullData = fullData
|
|
106
|
+
// 如果gt为0,则总是启用
|
|
107
|
+
reactData.scrollYLoad = !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= fullData.length)
|
|
108
|
+
$xeList.handleData()
|
|
109
|
+
return $xeList.computeScrollLoad().then(() => {
|
|
110
|
+
$xeList.refreshScroll()
|
|
111
|
+
})
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* 重新加载数据
|
|
115
|
+
* @param {Array} datas 数据
|
|
116
|
+
*/
|
|
117
|
+
reloadData (datas: any) {
|
|
118
|
+
const $xeList = this
|
|
119
|
+
|
|
120
|
+
$xeList.clearScroll()
|
|
121
|
+
return $xeList.loadData(datas)
|
|
122
|
+
},
|
|
123
|
+
updateYSpace () {
|
|
124
|
+
const $xeList = this
|
|
125
|
+
const reactData = $xeList.reactData
|
|
126
|
+
const internalData = $xeList.internalData
|
|
127
|
+
|
|
128
|
+
const { scrollYLoad } = reactData
|
|
129
|
+
const { scrollYStore, fullData } = internalData
|
|
130
|
+
reactData.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0
|
|
131
|
+
reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0
|
|
132
|
+
},
|
|
133
|
+
handleData () {
|
|
134
|
+
const $xeList = this
|
|
135
|
+
const reactData = $xeList.reactData
|
|
136
|
+
const internalData = $xeList.internalData
|
|
137
|
+
|
|
138
|
+
const { scrollYLoad } = reactData
|
|
139
|
+
const { fullData, scrollYStore } = internalData
|
|
140
|
+
reactData.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0)
|
|
141
|
+
return $xeList.$nextTick()
|
|
142
|
+
},
|
|
143
|
+
updateYData () {
|
|
144
|
+
const $xeList = this
|
|
145
|
+
|
|
146
|
+
$xeList.handleData()
|
|
147
|
+
$xeList.updateYSpace()
|
|
148
|
+
},
|
|
149
|
+
computeScrollLoad () {
|
|
150
|
+
const $xeList = this
|
|
151
|
+
const reactData = $xeList.reactData
|
|
152
|
+
const internalData = $xeList.internalData
|
|
153
|
+
|
|
154
|
+
return $xeList.$nextTick().then(() => {
|
|
155
|
+
const { scrollYLoad } = reactData
|
|
156
|
+
const { scrollYStore } = internalData
|
|
157
|
+
const virtualBodyElem = $xeList.$refs.refVirtualBody as HTMLElement
|
|
158
|
+
const sYOpts = $xeList.computeSYOpts
|
|
159
|
+
let rowHeight = 0
|
|
160
|
+
let firstItemElem: HTMLElement | undefined
|
|
161
|
+
if (virtualBodyElem) {
|
|
162
|
+
if (sYOpts.sItem) {
|
|
163
|
+
firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem) as HTMLElement
|
|
164
|
+
}
|
|
165
|
+
if (!firstItemElem) {
|
|
166
|
+
firstItemElem = virtualBodyElem.children[0] as HTMLElement
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (firstItemElem) {
|
|
170
|
+
rowHeight = firstItemElem.offsetHeight
|
|
171
|
+
}
|
|
172
|
+
rowHeight = Math.max(20, rowHeight)
|
|
173
|
+
scrollYStore.rowHeight = rowHeight
|
|
174
|
+
// 计算 Y 逻辑
|
|
175
|
+
if (scrollYLoad) {
|
|
176
|
+
const scrollBodyElem = $xeList.$refs.refVirtualWrapper as HTMLElement
|
|
177
|
+
const visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight))
|
|
178
|
+
const offsetYSize = sYOpts.oSize ? XEUtils.toNumber(sYOpts.oSize) : (browse.edge ? 10 : 0)
|
|
179
|
+
scrollYStore.offsetSize = offsetYSize
|
|
180
|
+
scrollYStore.visibleSize = visibleYSize
|
|
181
|
+
scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex)
|
|
182
|
+
$xeList.updateYData()
|
|
183
|
+
} else {
|
|
184
|
+
$xeList.updateYSpace()
|
|
185
|
+
}
|
|
186
|
+
reactData.rowHeight = rowHeight
|
|
187
|
+
})
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* 清除滚动条
|
|
191
|
+
*/
|
|
192
|
+
clearScroll () {
|
|
193
|
+
const $xeList = this
|
|
194
|
+
|
|
195
|
+
const scrollBodyElem = $xeList.$refs.refVirtualWrapper as HTMLElement
|
|
196
|
+
if (scrollBodyElem) {
|
|
197
|
+
scrollBodyElem.scrollTop = 0
|
|
198
|
+
}
|
|
199
|
+
return $xeList.$nextTick()
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* 如果有滚动条,则滚动到对应的位置
|
|
203
|
+
* @param {Number} scrollLeft 左距离
|
|
204
|
+
* @param {Number} scrollTop 上距离
|
|
205
|
+
*/
|
|
206
|
+
scrollTo (scrollLeft: number | null, scrollTop?: number | null) {
|
|
207
|
+
const $xeList = this
|
|
208
|
+
const reactData = $xeList.reactData
|
|
209
|
+
|
|
210
|
+
const scrollBodyElem = $xeList.$refs.refVirtualWrapper as HTMLElement
|
|
211
|
+
if (XEUtils.isNumber(scrollLeft)) {
|
|
212
|
+
scrollBodyElem.scrollLeft = scrollLeft
|
|
213
|
+
}
|
|
214
|
+
if (XEUtils.isNumber(scrollTop)) {
|
|
215
|
+
scrollBodyElem.scrollTop = scrollTop
|
|
216
|
+
}
|
|
217
|
+
if (reactData.scrollYLoad) {
|
|
218
|
+
return new Promise<void>(resolve => {
|
|
219
|
+
setTimeout(() => {
|
|
220
|
+
$xeList.$nextTick(() => {
|
|
221
|
+
resolve()
|
|
222
|
+
})
|
|
223
|
+
}, 50)
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
return $xeList.$nextTick()
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* 刷新滚动条
|
|
230
|
+
*/
|
|
231
|
+
refreshScroll () {
|
|
232
|
+
const $xeList = this
|
|
233
|
+
const internalData = $xeList.internalData
|
|
234
|
+
|
|
235
|
+
const { lastScrollLeft, lastScrollTop } = internalData
|
|
236
|
+
return $xeList.clearScroll().then(() => {
|
|
237
|
+
if (lastScrollLeft || lastScrollTop) {
|
|
238
|
+
internalData.lastScrollLeft = 0
|
|
239
|
+
internalData.lastScrollTop = 0
|
|
240
|
+
return scrollTo(lastScrollLeft, lastScrollTop)
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* 重新计算列表
|
|
246
|
+
*/
|
|
247
|
+
recalculate () {
|
|
248
|
+
const $xeList = this
|
|
249
|
+
|
|
250
|
+
const el = $xeList.$refs.refElem as HTMLDivElement
|
|
251
|
+
if (el.clientWidth && el.clientHeight) {
|
|
252
|
+
return $xeList.computeScrollLoad()
|
|
253
|
+
}
|
|
254
|
+
return Promise.resolve()
|
|
255
|
+
},
|
|
256
|
+
loadYData (evnt: Event) {
|
|
257
|
+
const $xeList = this
|
|
258
|
+
const internalData = $xeList.internalData
|
|
259
|
+
|
|
260
|
+
const { scrollYStore } = internalData
|
|
261
|
+
const { startIndex, endIndex, visibleSize, offsetSize, rowHeight } = scrollYStore
|
|
262
|
+
const scrollBodyElem = evnt.target as HTMLDivElement
|
|
263
|
+
const scrollTop = scrollBodyElem.scrollTop
|
|
264
|
+
const toVisibleIndex = Math.floor(scrollTop / rowHeight)
|
|
265
|
+
const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize)
|
|
266
|
+
const offsetEndIndex = toVisibleIndex + visibleSize + offsetSize
|
|
267
|
+
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
268
|
+
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
269
|
+
scrollYStore.startIndex = offsetStartIndex
|
|
270
|
+
scrollYStore.endIndex = offsetEndIndex
|
|
271
|
+
$xeList.updateYData()
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
scrollEvent (evnt: Event) {
|
|
276
|
+
const $xeList = this
|
|
277
|
+
const reactData = $xeList.reactData
|
|
278
|
+
const internalData = $xeList.internalData
|
|
279
|
+
|
|
280
|
+
const scrollBodyElem = evnt.target as HTMLDivElement
|
|
281
|
+
const scrollTop = scrollBodyElem.scrollTop
|
|
282
|
+
const scrollLeft = scrollBodyElem.scrollLeft
|
|
283
|
+
const isX = scrollLeft !== internalData.lastScrollLeft
|
|
284
|
+
const isY = scrollTop !== internalData.lastScrollTop
|
|
285
|
+
internalData.lastScrollTop = scrollTop
|
|
286
|
+
internalData.lastScrollLeft = scrollLeft
|
|
287
|
+
if (reactData.scrollYLoad) {
|
|
288
|
+
$xeList.loadYData(evnt)
|
|
289
|
+
}
|
|
290
|
+
$xeList.dispatchEvent('scroll', { scrollLeft, scrollTop, isX, isY }, evnt)
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
//
|
|
294
|
+
// Render
|
|
295
|
+
//
|
|
296
|
+
renderVN (h: CreateElement): VNode {
|
|
297
|
+
const $xeList = this
|
|
298
|
+
const props = $xeList
|
|
299
|
+
const reactData = $xeList.reactData
|
|
300
|
+
const slots = $xeList.$scopedSlots
|
|
301
|
+
|
|
302
|
+
const { className, loading } = props
|
|
303
|
+
const { bodyHeight, topSpaceHeight, items } = reactData
|
|
304
|
+
const defaultSlot = slots.default
|
|
305
|
+
const vSize = $xeList.computeSize
|
|
306
|
+
const styles = $xeList.computeStyles
|
|
307
|
+
return h('div', {
|
|
308
|
+
ref: 'refElem',
|
|
309
|
+
class: ['vxe-list', className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '', {
|
|
310
|
+
[`size--${vSize}`]: vSize,
|
|
311
|
+
'is--loading': loading
|
|
312
|
+
}]
|
|
313
|
+
}, [
|
|
314
|
+
h('div', {
|
|
315
|
+
ref: 'refVirtualWrapper',
|
|
316
|
+
class: 'vxe-list--virtual-wrapper',
|
|
317
|
+
style: styles,
|
|
318
|
+
on: {
|
|
319
|
+
scroll: $xeList.scrollEvent
|
|
320
|
+
}
|
|
321
|
+
}, [
|
|
322
|
+
h('div', {
|
|
323
|
+
class: 'vxe-list--y-space',
|
|
324
|
+
style: {
|
|
325
|
+
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
326
|
+
}
|
|
327
|
+
}),
|
|
328
|
+
h('div', {
|
|
329
|
+
ref: 'refVirtualBody',
|
|
330
|
+
class: 'vxe-list--body',
|
|
331
|
+
style: {
|
|
332
|
+
marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
|
|
333
|
+
}
|
|
334
|
+
}, defaultSlot ? defaultSlot({ items, $list: $xeList }) : [])
|
|
335
|
+
]),
|
|
336
|
+
/**
|
|
337
|
+
* 加载中
|
|
338
|
+
*/
|
|
339
|
+
h(VxeLoadingComponent, {
|
|
340
|
+
class: 'vxe-list--loading',
|
|
341
|
+
props: {
|
|
342
|
+
value: loading
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
])
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
watch: {
|
|
349
|
+
data () {
|
|
350
|
+
const $xeList = this
|
|
351
|
+
const props = $xeList
|
|
352
|
+
|
|
353
|
+
$xeList.loadData(props.data || [])
|
|
354
|
+
},
|
|
355
|
+
syncResize (val) {
|
|
356
|
+
const $xeList = this
|
|
357
|
+
|
|
358
|
+
if (val) {
|
|
359
|
+
$xeList.recalculate()
|
|
360
|
+
$xeList.$nextTick(() => setTimeout(() => $xeList.recalculate()))
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
created () {
|
|
365
|
+
const $xeList = this
|
|
366
|
+
const props = $xeList
|
|
367
|
+
|
|
368
|
+
globalEvents.on($xeList, 'resize', () => {
|
|
369
|
+
$xeList.recalculate()
|
|
370
|
+
})
|
|
371
|
+
$xeList.loadData(props.data || [])
|
|
372
|
+
},
|
|
373
|
+
mounted () {
|
|
374
|
+
const $xeList = this
|
|
375
|
+
const props = $xeList
|
|
376
|
+
const internalData = $xeList.internalData
|
|
377
|
+
|
|
378
|
+
if (props.autoResize) {
|
|
379
|
+
const el = $xeList.$refs.refElem as HTMLDivElement
|
|
380
|
+
const resizeObserver = globalResize.create(() => $xeList.recalculate())
|
|
381
|
+
resizeObserver.observe(el)
|
|
382
|
+
internalData.resizeObserver = resizeObserver
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
activated () {
|
|
386
|
+
const $xeList = this
|
|
387
|
+
|
|
388
|
+
$xeList.recalculate().then(() => $xeList.refreshScroll())
|
|
389
|
+
},
|
|
390
|
+
beforeDestroy () {
|
|
391
|
+
const $xeList = this
|
|
392
|
+
const internalData = $xeList.internalData
|
|
393
|
+
|
|
394
|
+
const { resizeObserver } = internalData
|
|
395
|
+
if (resizeObserver) {
|
|
396
|
+
resizeObserver.disconnect()
|
|
397
|
+
}
|
|
398
|
+
globalEvents.off($xeList, 'resize')
|
|
399
|
+
},
|
|
400
|
+
render (this: any, h) {
|
|
401
|
+
return this.renderVN(h)
|
|
402
|
+
}
|
|
403
|
+
})
|
|
@@ -76,6 +76,12 @@ export default defineVxeComponent({
|
|
|
76
76
|
const $xeLoading = this
|
|
77
77
|
$xeLoading.$emit(type, createEvent(evnt, { $loading: $xeLoading }, params))
|
|
78
78
|
},
|
|
79
|
+
emitModel (value: any) {
|
|
80
|
+
const $xeLoading = this
|
|
81
|
+
|
|
82
|
+
$xeLoading.$emit('input', value)
|
|
83
|
+
$xeLoading.$emit('modelValue', value)
|
|
84
|
+
},
|
|
79
85
|
handleInit () {
|
|
80
86
|
const $xeLoading = this
|
|
81
87
|
const reactData = $xeLoading.reactData
|
|
@@ -88,6 +88,12 @@ export default defineVxeComponent({
|
|
|
88
88
|
const $xeMenu = this
|
|
89
89
|
$xeMenu.$emit(type, createEvent(evnt, { $menu: $xeMenu }, params))
|
|
90
90
|
},
|
|
91
|
+
emitModel (value: any) {
|
|
92
|
+
const $xeMenu = this
|
|
93
|
+
|
|
94
|
+
$xeMenu.$emit('input', value)
|
|
95
|
+
$xeMenu.$emit('modelValue', value)
|
|
96
|
+
},
|
|
91
97
|
getMenuTitle (item: VxeMenuPropTypes.MenuOption) {
|
|
92
98
|
return `${item.title || item.name}`
|
|
93
99
|
},
|
|
@@ -184,8 +190,7 @@ export default defineVxeComponent({
|
|
|
184
190
|
if (routerLink) {
|
|
185
191
|
const value = item.itemKey
|
|
186
192
|
reactData.activeName = value
|
|
187
|
-
$xeMenu
|
|
188
|
-
$xeMenu.$emit('modelValue', value)
|
|
193
|
+
$xeMenu.emitModel(value)
|
|
189
194
|
} else {
|
|
190
195
|
if (hasChild) {
|
|
191
196
|
$xeMenu.handleClickIconCollapse(evnt, item)
|
|
@@ -263,6 +263,12 @@ export default defineVxeComponent({
|
|
|
263
263
|
const $xeModal = this
|
|
264
264
|
$xeModal.$emit(type, createEvent(evnt, { $modal: $xeModal }, params))
|
|
265
265
|
},
|
|
266
|
+
emitModel (value: any) {
|
|
267
|
+
const $xeModal = this
|
|
268
|
+
|
|
269
|
+
$xeModal.$emit('input', value)
|
|
270
|
+
$xeModal.$emit('modelValue', value)
|
|
271
|
+
},
|
|
266
272
|
open () {
|
|
267
273
|
const $xeModal = this
|
|
268
274
|
|
|
@@ -454,8 +460,7 @@ export default defineVxeComponent({
|
|
|
454
460
|
$xeModal.dispatchEvent('before-hide', params, null)
|
|
455
461
|
setTimeout(() => {
|
|
456
462
|
reactData.visible = false
|
|
457
|
-
$xeModal
|
|
458
|
-
$xeModal.$emit('modelValue', false)
|
|
463
|
+
$xeModal.emitModel(false)
|
|
459
464
|
$xeModal.dispatchEvent('hide', params, null)
|
|
460
465
|
}, 200)
|
|
461
466
|
$xeModal.removeBodyLockScroll()
|
|
@@ -780,8 +785,7 @@ export default defineVxeComponent({
|
|
|
780
785
|
}
|
|
781
786
|
const type = ''
|
|
782
787
|
const params = { type }
|
|
783
|
-
$xeModal
|
|
784
|
-
$xeModal.$emit('modelValue', true)
|
|
788
|
+
$xeModal.emitModel(true)
|
|
785
789
|
$xeModal.dispatchEvent('show', params, null)
|
|
786
790
|
})
|
|
787
791
|
}, 10)
|
|
@@ -265,6 +265,11 @@ export default defineVxeComponent({
|
|
|
265
265
|
const $xeNumberInput = this
|
|
266
266
|
$xeNumberInput.$emit(type, createEvent(evnt, { $numberInput: $xeNumberInput }, params))
|
|
267
267
|
},
|
|
268
|
+
emitModel (value: any) {
|
|
269
|
+
const $xeModal = this
|
|
270
|
+
|
|
271
|
+
$xeModal.$emit('modelValue', value)
|
|
272
|
+
},
|
|
268
273
|
focus () {
|
|
269
274
|
const $xeNumberInput = this
|
|
270
275
|
const reactData = $xeNumberInput.reactData
|
|
@@ -312,7 +317,7 @@ export default defineVxeComponent({
|
|
|
312
317
|
const { inputValue } = reactData
|
|
313
318
|
$xeNumberInput.dispatchEvent(evnt.type, { value: inputValue }, evnt)
|
|
314
319
|
},
|
|
315
|
-
|
|
320
|
+
handleChange (val: number | null, inputValue: string, evnt: Event | { type: string }) {
|
|
316
321
|
const $xeNumberInput = this
|
|
317
322
|
const props = $xeNumberInput
|
|
318
323
|
const reactData = $xeNumberInput.reactData
|
|
@@ -323,7 +328,7 @@ export default defineVxeComponent({
|
|
|
323
328
|
const isChange = value !== props.value
|
|
324
329
|
if (isChange) {
|
|
325
330
|
reactData.inputValue = inputValue || ''
|
|
326
|
-
$xeNumberInput
|
|
331
|
+
$xeNumberInput.emitModel(value)
|
|
327
332
|
}
|
|
328
333
|
$xeNumberInput.dispatchEvent('input', { value }, evnt as Event)
|
|
329
334
|
if (isChange) {
|
|
@@ -342,7 +347,7 @@ export default defineVxeComponent({
|
|
|
342
347
|
const value = inputValue ? XEUtils.toNumber(inputValue) : null
|
|
343
348
|
reactData.inputValue = inputValue
|
|
344
349
|
if (inpImmediate) {
|
|
345
|
-
$xeNumberInput.
|
|
350
|
+
$xeNumberInput.handleChange(value, inputValue, evnt)
|
|
346
351
|
} else {
|
|
347
352
|
$xeNumberInput.dispatchEvent('input', { value }, evnt)
|
|
348
353
|
}
|
|
@@ -383,7 +388,7 @@ export default defineVxeComponent({
|
|
|
383
388
|
const $xeNumberInput = this
|
|
384
389
|
|
|
385
390
|
$xeNumberInput.focus()
|
|
386
|
-
$xeNumberInput.
|
|
391
|
+
$xeNumberInput.handleChange(null, '', evnt)
|
|
387
392
|
$xeNumberInput.dispatchEvent('clear', { value }, evnt)
|
|
388
393
|
},
|
|
389
394
|
clickSuffixEvent (evnt: Event) {
|
|
@@ -416,7 +421,7 @@ export default defineVxeComponent({
|
|
|
416
421
|
validValue = Number(textValue)
|
|
417
422
|
}
|
|
418
423
|
if (inputValue !== validValue) {
|
|
419
|
-
$xeNumberInput.
|
|
424
|
+
$xeNumberInput.handleChange(validValue, textValue, { type: 'init' })
|
|
420
425
|
}
|
|
421
426
|
}
|
|
422
427
|
}
|
|
@@ -456,7 +461,7 @@ export default defineVxeComponent({
|
|
|
456
461
|
}
|
|
457
462
|
}
|
|
458
463
|
const inpValue = $xeNumberInput.getNumberValue(inpNumVal)
|
|
459
|
-
$xeNumberInput.
|
|
464
|
+
$xeNumberInput.handleChange(inpValue === null ? null : Number(inpValue), inpValue, { type: 'check' })
|
|
460
465
|
}
|
|
461
466
|
}
|
|
462
467
|
},
|
|
@@ -468,7 +473,7 @@ export default defineVxeComponent({
|
|
|
468
473
|
const inpImmediate = $xeNumberInput.computeInpImmediate
|
|
469
474
|
const value = inputValue ? Number(inputValue) : null
|
|
470
475
|
if (!inpImmediate) {
|
|
471
|
-
$xeNumberInput.
|
|
476
|
+
$xeNumberInput.handleChange(value, `${inputValue || ''}`, evnt)
|
|
472
477
|
}
|
|
473
478
|
$xeNumberInput.afterCheckValue()
|
|
474
479
|
reactData.isActivated = false
|
|
@@ -109,6 +109,11 @@ export default defineVxeComponent({
|
|
|
109
109
|
const $xePasswordInput = this
|
|
110
110
|
$xePasswordInput.$emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params))
|
|
111
111
|
},
|
|
112
|
+
emitModel (value: any) {
|
|
113
|
+
const $xeModal = this
|
|
114
|
+
|
|
115
|
+
$xeModal.$emit('modelValue', value)
|
|
116
|
+
},
|
|
112
117
|
focus () {
|
|
113
118
|
const $xePasswordInput = this
|
|
114
119
|
const reactData = $xePasswordInput.reactData
|
|
@@ -157,7 +162,7 @@ export default defineVxeComponent({
|
|
|
157
162
|
const value = inputElem.value
|
|
158
163
|
$xePasswordInput.emitInputEvent(value, evnt)
|
|
159
164
|
},
|
|
160
|
-
|
|
165
|
+
handleChange (value: string, evnt: Event | { type: string }) {
|
|
161
166
|
const $xePasswordInput = this
|
|
162
167
|
const props = $xePasswordInput
|
|
163
168
|
const reactData = $xePasswordInput.reactData
|
|
@@ -165,7 +170,7 @@ export default defineVxeComponent({
|
|
|
165
170
|
const formItemInfo = $xePasswordInput.formItemInfo
|
|
166
171
|
|
|
167
172
|
reactData.inputValue = value
|
|
168
|
-
$xePasswordInput
|
|
173
|
+
$xePasswordInput.emitModel(value)
|
|
169
174
|
$xePasswordInput.dispatchEvent('input', { value }, evnt as any)
|
|
170
175
|
if (XEUtils.toValueString(props.value) !== value) {
|
|
171
176
|
$xePasswordInput.dispatchEvent('change', { value }, evnt as any)
|
|
@@ -223,7 +228,7 @@ export default defineVxeComponent({
|
|
|
223
228
|
const $xePasswordInput = this
|
|
224
229
|
|
|
225
230
|
$xePasswordInput.focus()
|
|
226
|
-
$xePasswordInput.
|
|
231
|
+
$xePasswordInput.handleChange('', evnt)
|
|
227
232
|
$xePasswordInput.dispatchEvent('clear', { value }, evnt)
|
|
228
233
|
},
|
|
229
234
|
clickSuffixEvent (evnt: Event) {
|
|
@@ -113,6 +113,11 @@ export default defineVxeComponent({
|
|
|
113
113
|
const $xePulldown = this
|
|
114
114
|
$xePulldown.$emit(type, createEvent(evnt, { $pulldown: $xePulldown }, params))
|
|
115
115
|
},
|
|
116
|
+
emitModel (value: any) {
|
|
117
|
+
const $xePulldown = this
|
|
118
|
+
|
|
119
|
+
$xePulldown.$emit('modelValue', value)
|
|
120
|
+
},
|
|
116
121
|
updateZindex () {
|
|
117
122
|
const $xePulldown = this
|
|
118
123
|
const reactData = $xePulldown.reactData
|
|
@@ -234,7 +239,7 @@ export default defineVxeComponent({
|
|
|
234
239
|
reactData.visibleAnimate = true
|
|
235
240
|
setTimeout(() => {
|
|
236
241
|
reactData.visiblePanel = true
|
|
237
|
-
$xePulldown
|
|
242
|
+
$xePulldown.emitModel(true)
|
|
238
243
|
$xePulldown.updatePlacement()
|
|
239
244
|
setTimeout(() => {
|
|
240
245
|
resolve($xePulldown.updatePlacement())
|
|
@@ -257,7 +262,7 @@ export default defineVxeComponent({
|
|
|
257
262
|
const internalData = $xePulldown.internalData
|
|
258
263
|
|
|
259
264
|
reactData.visiblePanel = false
|
|
260
|
-
$xePulldown
|
|
265
|
+
$xePulldown.emitModel(false)
|
|
261
266
|
return new Promise<void>(resolve => {
|
|
262
267
|
if (reactData.visibleAnimate) {
|
|
263
268
|
internalData.hpTimeout = window.setTimeout(() => {
|
|
@@ -103,6 +103,12 @@ export default defineVxeComponent({
|
|
|
103
103
|
const $xeRadioButton = this
|
|
104
104
|
$xeRadioButton.$emit(type, createEvent(evnt, { $radioButton: $xeRadioButton }, params))
|
|
105
105
|
},
|
|
106
|
+
emitModel (value: any) {
|
|
107
|
+
const $xeRadioButton = this
|
|
108
|
+
|
|
109
|
+
$xeRadioButton.$emit('input', value)
|
|
110
|
+
$xeRadioButton.$emit('modelValue', value)
|
|
111
|
+
},
|
|
106
112
|
handleValue (label: VxeRadioButtonPropTypes.Label, evnt: Event) {
|
|
107
113
|
const $xeRadioButton = this
|
|
108
114
|
const $xeForm = $xeRadioButton.$xeForm
|
|
@@ -112,8 +118,7 @@ export default defineVxeComponent({
|
|
|
112
118
|
if ($xeRadioGroup) {
|
|
113
119
|
$xeRadioGroup.handleChecked({ label }, evnt)
|
|
114
120
|
} else {
|
|
115
|
-
$xeRadioButton
|
|
116
|
-
$xeRadioButton.$emit('modelValue', label)
|
|
121
|
+
$xeRadioButton.emitModel(label)
|
|
117
122
|
$xeRadioButton.dispatchEvent('change', { label }, evnt)
|
|
118
123
|
// 自动更新校验状态
|
|
119
124
|
if ($xeForm && formItemInfo) {
|
|
@@ -110,6 +110,12 @@ export default defineVxeComponent({
|
|
|
110
110
|
|
|
111
111
|
$xeRadioGroup.$emit(type, createEvent(evnt, { $radioGroup: $xeRadioGroup }, params))
|
|
112
112
|
},
|
|
113
|
+
emitModel (value: any) {
|
|
114
|
+
const $xeRadioGroup = this
|
|
115
|
+
|
|
116
|
+
$xeRadioGroup.$emit('input', value)
|
|
117
|
+
$xeRadioGroup.$emit('modelValue', value)
|
|
118
|
+
},
|
|
113
119
|
handleChecked (params: {
|
|
114
120
|
label: any
|
|
115
121
|
}, evnt: Event) {
|
|
@@ -118,8 +124,7 @@ export default defineVxeComponent({
|
|
|
118
124
|
const formItemInfo = $xeRadioGroup.formItemInfo
|
|
119
125
|
|
|
120
126
|
const value = params.label
|
|
121
|
-
$xeRadioGroup
|
|
122
|
-
$xeRadioGroup.$emit('modelValue', value)
|
|
127
|
+
$xeRadioGroup.emitModel(value)
|
|
123
128
|
$xeRadioGroup.dispatchEvent('change', params, evnt)
|
|
124
129
|
// 自动更新校验状态
|
|
125
130
|
if ($xeForm && formItemInfo) {
|
|
@@ -105,6 +105,12 @@ export default defineVxeComponent({
|
|
|
105
105
|
const $xeRadio = this
|
|
106
106
|
$xeRadio.$emit(type, createEvent(evnt, { $radio: $xeRadio }, params))
|
|
107
107
|
},
|
|
108
|
+
emitModel (value: any) {
|
|
109
|
+
const $xeRadio = this
|
|
110
|
+
|
|
111
|
+
$xeRadio.$emit('input', value)
|
|
112
|
+
$xeRadio.$emit('modelValue', value)
|
|
113
|
+
},
|
|
108
114
|
handleValue (label: VxeRadioPropTypes.Label, evnt: Event) {
|
|
109
115
|
const $xeRadio = this
|
|
110
116
|
const formItemInfo = $xeRadio.formItemInfo
|
|
@@ -114,8 +120,7 @@ export default defineVxeComponent({
|
|
|
114
120
|
if ($xeRadioGroup) {
|
|
115
121
|
$xeRadioGroup.handleChecked({ label }, evnt)
|
|
116
122
|
} else {
|
|
117
|
-
$xeRadio
|
|
118
|
-
$xeRadio.$emit('modelValue', label)
|
|
123
|
+
$xeRadio.emitModel(label)
|
|
119
124
|
$xeRadio.dispatchEvent('change', { label }, evnt)
|
|
120
125
|
// 自动更新校验状态
|
|
121
126
|
if ($xeForm && formItemInfo) {
|