vxe-pc-ui 4.11.27 → 4.11.29
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 +6 -0
- package/es/backtop/index.js +12 -0
- package/es/backtop/src/backtop.js +231 -0
- package/es/backtop/style.css +90 -0
- package/es/backtop/style.min.css +1 -0
- package/es/cascader/index.js +12 -0
- package/es/cascader/src/cascader.js +669 -0
- package/es/cascader/style.css +168 -0
- package/es/cascader/style.min.css +1 -0
- package/es/components.js +18 -0
- package/es/date-range-picker/src/date-range-picker.js +2 -1
- package/es/form/render/index.js +3 -3
- package/es/form/src/render.js +4 -2
- package/es/form/style.css +5 -2
- package/es/form/style.min.css +1 -1
- package/es/icon/{iconfont.1767168857404.ttf → iconfont.1767441272505.ttf} +0 -0
- package/es/icon/iconfont.1767441272505.woff +0 -0
- package/es/icon/iconfont.1767441272505.woff2 +0 -0
- package/es/icon/style.css +9 -1
- package/es/icon/style.min.css +1 -1
- package/{lib/icon/style/iconfont.1767168857404.ttf → es/iconfont.1767441272505.ttf} +0 -0
- package/es/iconfont.1767441272505.woff +0 -0
- package/es/iconfont.1767441272505.woff2 +0 -0
- package/es/layout-body/src/layout-body.js +39 -6
- package/es/mention/index.js +12 -0
- package/es/mention/src/mention.js +51 -0
- package/es/mention/style.css +0 -0
- package/es/mention/style.min.css +0 -0
- package/es/radio/src/button.js +7 -5
- package/es/radio/src/group.js +3 -2
- package/es/radio/src/radio.js +3 -2
- package/es/segmented/index.js +12 -0
- package/es/segmented/src/segmented.js +218 -0
- package/es/segmented/style.css +195 -0
- package/es/segmented/style.min.css +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +1 -4
- package/es/timeline/index.js +12 -0
- package/es/timeline/src/timeline-item.js +46 -0
- package/es/timeline/src/timeline.js +51 -0
- package/es/timeline/style.css +0 -0
- package/es/timeline/style.min.css +0 -0
- package/es/timeline-item/index.js +12 -0
- package/es/timeline-item/style.css +0 -0
- package/es/timeline-item/style.min.css +0 -0
- package/es/tour/index.js +12 -0
- package/es/tour/src/tour.js +51 -0
- package/es/tour/style.css +0 -0
- package/es/tour/style.min.css +0 -0
- package/es/ui/index.js +15 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-backtop/index.js +3 -0
- package/es/vxe-backtop/style.css +90 -0
- package/es/vxe-backtop/style.min.css +1 -0
- package/es/vxe-cascader/index.js +3 -0
- package/es/vxe-cascader/style.css +168 -0
- package/es/vxe-cascader/style.min.css +1 -0
- package/es/vxe-form/style.css +5 -2
- package/es/vxe-form/style.min.css +1 -1
- package/es/vxe-icon/style.css +9 -1
- package/es/vxe-icon/style.min.css +1 -1
- package/es/vxe-mention/index.js +3 -0
- package/es/vxe-mention/style.css +0 -0
- package/es/vxe-mention/style.min.css +0 -0
- package/es/vxe-segmented/index.js +3 -0
- package/es/vxe-segmented/style.css +195 -0
- package/es/vxe-segmented/style.min.css +1 -0
- package/es/vxe-timeline/index.js +3 -0
- package/es/vxe-timeline/style.css +0 -0
- package/es/vxe-timeline/style.min.css +0 -0
- package/es/vxe-timeline-item/index.js +3 -0
- package/es/vxe-timeline-item/style.css +0 -0
- package/es/vxe-timeline-item/style.min.css +0 -0
- package/es/vxe-tour/index.js +3 -0
- package/es/vxe-tour/style.css +0 -0
- package/es/vxe-tour/style.min.css +0 -0
- package/lib/backtop/index.js +19 -0
- package/lib/backtop/index.min.js +1 -0
- package/lib/backtop/src/backtop.js +256 -0
- package/lib/backtop/src/backtop.min.js +1 -0
- package/lib/backtop/style/index.js +1 -0
- package/lib/backtop/style/style.css +90 -0
- package/lib/backtop/style/style.min.css +1 -0
- package/lib/cascader/index.js +19 -0
- package/lib/cascader/index.min.js +1 -0
- package/lib/cascader/src/cascader.js +723 -0
- package/lib/cascader/src/cascader.min.js +1 -0
- package/lib/cascader/style/index.js +1 -0
- package/lib/cascader/style/style.css +168 -0
- package/lib/cascader/style/style.min.css +1 -0
- package/lib/components.js +73 -1
- package/lib/components.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +5 -1
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/form/render/index.js +6 -3
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/src/render.js +4 -1
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/style/style.css +5 -2
- package/lib/form/style/style.min.css +1 -1
- package/lib/{iconfont.1767168857404.ttf → icon/style/iconfont.1767441272505.ttf} +0 -0
- package/lib/icon/style/iconfont.1767441272505.woff +0 -0
- package/lib/icon/style/iconfont.1767441272505.woff2 +0 -0
- package/lib/icon/style/style.css +9 -1
- package/lib/icon/style/style.min.css +9 -1
- package/{es/iconfont.1767168857404.ttf → lib/iconfont.1767441272505.ttf} +0 -0
- package/lib/iconfont.1767441272505.woff +0 -0
- package/lib/iconfont.1767441272505.woff2 +0 -0
- package/lib/index.umd.js +5250 -3708
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +34 -4
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/mention/index.js +19 -0
- package/lib/mention/index.min.js +1 -0
- package/lib/mention/src/mention.js +62 -0
- package/lib/mention/src/mention.min.js +1 -0
- package/lib/mention/style/index.js +1 -0
- package/lib/mention/style/style.css +0 -0
- package/lib/mention/style/style.min.css +0 -0
- package/lib/radio/src/button.js +15 -8
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +7 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio/src/radio.js +7 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/segmented/index.js +19 -0
- package/lib/segmented/index.min.js +1 -0
- package/lib/segmented/src/segmented.js +237 -0
- package/lib/segmented/src/segmented.min.js +1 -0
- package/lib/segmented/style/index.js +1 -0
- package/lib/segmented/style/style.css +195 -0
- package/lib/segmented/style/style.min.css +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +1 -5
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/timeline/index.js +19 -0
- package/lib/timeline/index.min.js +1 -0
- package/lib/timeline/src/timeline-item.js +57 -0
- package/lib/timeline/src/timeline-item.min.js +1 -0
- package/lib/timeline/src/timeline.js +62 -0
- package/lib/timeline/src/timeline.min.js +1 -0
- package/lib/timeline/style/index.js +1 -0
- package/lib/timeline/style/style.css +0 -0
- package/lib/timeline/style/style.min.css +0 -0
- package/lib/timeline-item/index.js +19 -0
- package/lib/timeline-item/index.min.js +1 -0
- package/lib/timeline-item/style/index.js +1 -0
- package/lib/timeline-item/style/style.css +0 -0
- package/lib/timeline-item/style/style.min.css +0 -0
- package/lib/tour/index.js +19 -0
- package/lib/tour/index.min.js +1 -0
- package/lib/tour/src/tour.js +62 -0
- package/lib/tour/src/tour.min.js +1 -0
- package/lib/tour/style/index.js +1 -0
- package/lib/tour/style/style.css +0 -0
- package/lib/tour/style/style.min.css +0 -0
- package/lib/ui/index.js +15 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-backtop/index.js +22 -0
- package/lib/vxe-backtop/index.min.js +1 -0
- package/lib/vxe-backtop/style/index.js +1 -0
- package/lib/vxe-backtop/style/style.css +90 -0
- package/lib/vxe-backtop/style/style.min.css +1 -0
- package/lib/vxe-cascader/index.js +22 -0
- package/lib/vxe-cascader/index.min.js +1 -0
- package/lib/vxe-cascader/style/index.js +1 -0
- package/lib/vxe-cascader/style/style.css +168 -0
- package/lib/vxe-cascader/style/style.min.css +1 -0
- package/lib/vxe-form/style/style.css +5 -2
- package/lib/vxe-form/style/style.min.css +1 -1
- package/lib/vxe-icon/style/style.css +9 -1
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/lib/vxe-mention/index.js +22 -0
- package/lib/vxe-mention/index.min.js +1 -0
- package/lib/vxe-mention/style/index.js +1 -0
- package/lib/vxe-mention/style/style.css +0 -0
- package/lib/vxe-mention/style/style.min.css +0 -0
- package/lib/vxe-segmented/index.js +22 -0
- package/lib/vxe-segmented/index.min.js +1 -0
- package/lib/vxe-segmented/style/index.js +1 -0
- package/lib/vxe-segmented/style/style.css +195 -0
- package/lib/vxe-segmented/style/style.min.css +1 -0
- package/lib/vxe-timeline/index.js +22 -0
- package/lib/vxe-timeline/index.min.js +1 -0
- package/lib/vxe-timeline/style/index.js +1 -0
- package/lib/vxe-timeline/style/style.css +0 -0
- package/lib/vxe-timeline/style/style.min.css +0 -0
- package/lib/vxe-timeline-item/index.js +22 -0
- package/lib/vxe-timeline-item/index.min.js +1 -0
- package/lib/vxe-timeline-item/style/index.js +1 -0
- package/lib/vxe-timeline-item/style/style.css +0 -0
- package/lib/vxe-timeline-item/style/style.min.css +0 -0
- package/lib/vxe-tour/index.js +22 -0
- package/lib/vxe-tour/index.min.js +1 -0
- package/lib/vxe-tour/style/index.js +1 -0
- package/lib/vxe-tour/style/style.css +0 -0
- package/lib/vxe-tour/style/style.min.css +0 -0
- package/package.json +1 -1
- package/packages/backtop/index.ts +16 -0
- package/packages/backtop/src/backtop.ts +264 -0
- package/packages/cascader/index.ts +16 -0
- package/packages/cascader/src/cascader.ts +739 -0
- package/packages/components.ts +18 -0
- package/packages/date-range-picker/src/date-range-picker.ts +2 -1
- package/packages/form/render/index.ts +3 -3
- package/packages/form/src/render.ts +4 -2
- package/packages/layout-body/src/layout-body.ts +43 -9
- package/packages/mention/index.ts +16 -0
- package/packages/mention/src/mention.ts +71 -0
- package/packages/radio/src/button.ts +9 -6
- package/packages/radio/src/group.ts +3 -2
- package/packages/radio/src/radio.ts +3 -2
- package/packages/segmented/index.ts +16 -0
- package/packages/segmented/src/segmented.ts +254 -0
- package/packages/tabs/src/tabs.ts +1 -4
- package/packages/timeline/index.ts +16 -0
- package/packages/timeline/src/timeline-item.ts +67 -0
- package/packages/timeline/src/timeline.ts +71 -0
- package/packages/timeline-item/index.ts +16 -0
- package/packages/tour/index.ts +16 -0
- package/packages/tour/src/tour.ts +71 -0
- package/packages/ui/index.ts +15 -1
- package/styles/all.scss +7 -0
- package/styles/components/backtop.scss +111 -0
- package/styles/components/cascader.scss +140 -0
- package/styles/components/form.scss +7 -2
- package/styles/components/icon.scss +9 -2
- package/styles/components/mention.scss +0 -0
- package/styles/components/segmented.scss +214 -0
- package/styles/components/timeline-item.scss +0 -0
- package/styles/components/timeline.scss +0 -0
- package/styles/components/tour.scss +0 -0
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/theme/base.scss +6 -0
- package/types/all.d.ts +21 -0
- package/types/components/backtop.d.ts +111 -0
- package/types/components/cascader.d.ts +255 -0
- package/types/components/date-range-picker.d.ts +3 -1
- package/types/components/form.d.ts +4 -0
- package/types/components/icon.d.ts +2 -2
- package/types/components/layout-body.d.ts +9 -0
- package/types/components/list.d.ts +2 -2
- package/types/components/mention.d.ts +77 -0
- package/types/components/radio-group.d.ts +2 -1
- package/types/components/rate.d.ts +1 -1
- package/types/components/segmented.d.ts +123 -0
- package/types/components/select.d.ts +1 -1
- package/types/components/table.d.ts +15 -6
- package/types/components/timeline-item.d.ts +75 -0
- package/types/components/timeline.d.ts +77 -0
- package/types/components/tour.d.ts +77 -0
- package/types/components/tree-select.d.ts +1 -1
- package/types/components/tree.d.ts +1 -1
- package/types/ui/global-config.d.ts +14 -0
- package/types/ui/global-icon.d.ts +3 -0
- package/es/icon/iconfont.1767168857404.woff +0 -0
- package/es/icon/iconfont.1767168857404.woff2 +0 -0
- package/es/iconfont.1767168857404.woff +0 -0
- package/es/iconfont.1767168857404.woff2 +0 -0
- package/lib/icon/style/iconfont.1767168857404.woff +0 -0
- package/lib/icon/style/iconfont.1767168857404.woff2 +0 -0
- package/lib/iconfont.1767168857404.woff +0 -0
- package/lib/iconfont.1767168857404.woff2 +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { ref, h, reactive, PropType, VNode, watch, computed, nextTick, onMounted, onBeforeUnmount } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { getConfig, createEvent, useSize } from '../../ui'
|
|
5
|
+
import { toCssUnit } from '../../ui/src/dom'
|
|
6
|
+
|
|
7
|
+
import type { SegmentedReactData, VxeSegmentedPropTypes, SegmentedPrivateRef, VxeSegmentedEmits, VxeSegmentedPrivateComputed, SegmentedMethods, SegmentedPrivateMethods, VxeSegmentedConstructor, VxeSegmentedPrivateMethods, VxeComponentStyleType, ValueOf } from '../../../types'
|
|
8
|
+
|
|
9
|
+
function createReactData (): SegmentedReactData {
|
|
10
|
+
return {
|
|
11
|
+
groupName: XEUtils.uniqueId('xe_group_'),
|
|
12
|
+
selectStyle: {
|
|
13
|
+
display: '',
|
|
14
|
+
left: '',
|
|
15
|
+
width: ''
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default defineVxeComponent({
|
|
21
|
+
name: 'VxeSegmented',
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: [String, Number] as PropType<VxeSegmentedPropTypes.ModelValue>,
|
|
24
|
+
name: [String, Number] as PropType<VxeSegmentedPropTypes.Name>,
|
|
25
|
+
disabled: Boolean as PropType<VxeSegmentedPropTypes.Disabled>,
|
|
26
|
+
options: Array as PropType<VxeSegmentedPropTypes.Options>,
|
|
27
|
+
type: {
|
|
28
|
+
type: String as PropType<VxeSegmentedPropTypes.Type>,
|
|
29
|
+
default: () => getConfig().segmented.type
|
|
30
|
+
},
|
|
31
|
+
status: String as PropType<VxeSegmentedPropTypes.Status>,
|
|
32
|
+
width: [String, Number] as PropType<VxeSegmentedPropTypes.Width>,
|
|
33
|
+
height: [String, Number] as PropType<VxeSegmentedPropTypes.Height>,
|
|
34
|
+
optionConfig: Object as PropType<VxeSegmentedPropTypes.OptionConfig>,
|
|
35
|
+
size: {
|
|
36
|
+
type: String as PropType<VxeSegmentedPropTypes.Size>,
|
|
37
|
+
default: () => getConfig().segmented.size || getConfig().size
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: [
|
|
41
|
+
'update:modelValue',
|
|
42
|
+
'change'
|
|
43
|
+
] as VxeSegmentedEmits,
|
|
44
|
+
setup (props, context) {
|
|
45
|
+
const { slots, emit } = context
|
|
46
|
+
|
|
47
|
+
const xID = XEUtils.uniqueId()
|
|
48
|
+
|
|
49
|
+
const { computeSize } = useSize(props)
|
|
50
|
+
|
|
51
|
+
const refElem = ref<HTMLDivElement>()
|
|
52
|
+
const refWrapperElem = ref<HTMLDivElement>()
|
|
53
|
+
const refSelectedElem = ref<HTMLDivElement>()
|
|
54
|
+
|
|
55
|
+
const reactData = reactive(createReactData())
|
|
56
|
+
|
|
57
|
+
const refMaps: SegmentedPrivateRef = {
|
|
58
|
+
refElem
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const computeItemType = computed(() => {
|
|
62
|
+
const { type } = props
|
|
63
|
+
if (type === 'round') {
|
|
64
|
+
return type
|
|
65
|
+
}
|
|
66
|
+
if (type === 'inside') {
|
|
67
|
+
return type
|
|
68
|
+
}
|
|
69
|
+
return 'default'
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const computeWrapperStyle = computed(() => {
|
|
73
|
+
const { width, height } = props
|
|
74
|
+
const stys: VxeComponentStyleType = {}
|
|
75
|
+
if (width) {
|
|
76
|
+
stys.width = toCssUnit(width)
|
|
77
|
+
}
|
|
78
|
+
if (height) {
|
|
79
|
+
stys.height = toCssUnit(height)
|
|
80
|
+
}
|
|
81
|
+
return stys
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const computeOptionOpts = computed(() => {
|
|
85
|
+
return Object.assign({}, getConfig().segmented.optionConfig, props.optionConfig)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const computeItemList = computed(() => {
|
|
89
|
+
return props.options || []
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const computeSelectIndex = computed(() => {
|
|
93
|
+
const { modelValue } = props
|
|
94
|
+
const itemList = computeItemList.value
|
|
95
|
+
return XEUtils.findIndexOf(itemList, item => item.value === modelValue)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const comIsFullWidth = computed(() => {
|
|
99
|
+
const wrapperStyle = computeWrapperStyle.value
|
|
100
|
+
return wrapperStyle.width === '100%'
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const computeMaps: VxeSegmentedPrivateComputed = {
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const $xeSegmented = {
|
|
107
|
+
xID,
|
|
108
|
+
props,
|
|
109
|
+
context,
|
|
110
|
+
reactData,
|
|
111
|
+
|
|
112
|
+
getRefMaps: () => refMaps,
|
|
113
|
+
getComputeMaps: () => computeMaps
|
|
114
|
+
} as unknown as VxeSegmentedConstructor & VxeSegmentedPrivateMethods
|
|
115
|
+
|
|
116
|
+
const dispatchEvent = (type: ValueOf<VxeSegmentedEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
117
|
+
emit(type, createEvent(evnt, { $segmented: $xeSegmented }, params))
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const emitModel = (value: any) => {
|
|
121
|
+
emit('update:modelValue', value)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const changeEvent = (evnt: Event, item: VxeSegmentedPropTypes.Option) => {
|
|
125
|
+
const value = item.value
|
|
126
|
+
emitModel(value)
|
|
127
|
+
dispatchEvent('change', { value }, evnt)
|
|
128
|
+
updateStyle()
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const updateStyle = () => {
|
|
132
|
+
nextTick(() => {
|
|
133
|
+
const selectIndex = computeSelectIndex.value
|
|
134
|
+
const wrapperElem = refWrapperElem.value
|
|
135
|
+
const atStyle = {
|
|
136
|
+
display: '',
|
|
137
|
+
left: '',
|
|
138
|
+
width: ''
|
|
139
|
+
}
|
|
140
|
+
if (wrapperElem) {
|
|
141
|
+
const itemEl = wrapperElem.children[selectIndex] as HTMLDivElement
|
|
142
|
+
if (itemEl) {
|
|
143
|
+
atStyle.display = 'block'
|
|
144
|
+
atStyle.left = toCssUnit(itemEl.offsetLeft)
|
|
145
|
+
atStyle.width = toCssUnit(itemEl.clientWidth)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
reactData.selectStyle = atStyle
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const tagMethods: SegmentedMethods = {
|
|
153
|
+
dispatchEvent
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const tagPrivateMethods: SegmentedPrivateMethods = {
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
Object.assign($xeSegmented, tagMethods, tagPrivateMethods)
|
|
160
|
+
|
|
161
|
+
const renderItems = () => {
|
|
162
|
+
const { modelValue, name } = props
|
|
163
|
+
const { groupName } = reactData
|
|
164
|
+
const optionOpts = computeOptionOpts.value
|
|
165
|
+
const itemList = computeItemList.value
|
|
166
|
+
const isFullWidth = comIsFullWidth.value
|
|
167
|
+
const fullItemWidth = isFullWidth ? Math.max(0, 100 / itemList.length) : 0
|
|
168
|
+
const defaultSlot = slots.default
|
|
169
|
+
const itemVNs: VNode[] = []
|
|
170
|
+
itemList.forEach((item, i) => {
|
|
171
|
+
const itemWidth = item.width || optionOpts.width
|
|
172
|
+
itemVNs.push(
|
|
173
|
+
h('label', {
|
|
174
|
+
key: i,
|
|
175
|
+
class: ['vxe-segmented--item', {
|
|
176
|
+
'is--checked': modelValue === item.value
|
|
177
|
+
}],
|
|
178
|
+
style: isFullWidth || itemWidth
|
|
179
|
+
? {
|
|
180
|
+
width: itemWidth ? toCssUnit(itemWidth) : (fullItemWidth ? `${fullItemWidth}%` : '')
|
|
181
|
+
}
|
|
182
|
+
: undefined
|
|
183
|
+
}, [
|
|
184
|
+
h('input', {
|
|
185
|
+
class: 'vxe-segmented--input',
|
|
186
|
+
type: 'radio',
|
|
187
|
+
name: name || groupName,
|
|
188
|
+
onChange (evnt) {
|
|
189
|
+
changeEvent(evnt, item)
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
192
|
+
h('div', {
|
|
193
|
+
class: 'vxe-segmented--content'
|
|
194
|
+
}, [
|
|
195
|
+
h('div', {
|
|
196
|
+
class: 'vxe-segmented--label'
|
|
197
|
+
}, defaultSlot ? defaultSlot({ option: item }) : XEUtils.eqNull(item.label) ? '' : `${item.label}`)
|
|
198
|
+
])
|
|
199
|
+
])
|
|
200
|
+
)
|
|
201
|
+
})
|
|
202
|
+
return itemVNs
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const renderVN = () => {
|
|
206
|
+
const { status } = props
|
|
207
|
+
const { selectStyle } = reactData
|
|
208
|
+
const itemType = computeItemType.value
|
|
209
|
+
const wrapperStyle = computeWrapperStyle.value
|
|
210
|
+
const vSize = computeSize.value
|
|
211
|
+
return h('div', {
|
|
212
|
+
ref: refElem,
|
|
213
|
+
class: ['vxe-segmented', `type--${itemType}`, {
|
|
214
|
+
[`size--${vSize}`]: vSize,
|
|
215
|
+
[`theme--${status}`]: status
|
|
216
|
+
}]
|
|
217
|
+
}, [
|
|
218
|
+
h('div', {
|
|
219
|
+
class: 'vxe-segmented--group',
|
|
220
|
+
style: wrapperStyle
|
|
221
|
+
}, [
|
|
222
|
+
h('div', {
|
|
223
|
+
ref: refSelectedElem,
|
|
224
|
+
class: 'vxe-segmented--selected',
|
|
225
|
+
style: selectStyle
|
|
226
|
+
}),
|
|
227
|
+
h('div', {
|
|
228
|
+
ref: refWrapperElem,
|
|
229
|
+
class: 'vxe-segmented--inner'
|
|
230
|
+
}, renderItems())
|
|
231
|
+
])
|
|
232
|
+
])
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
watch(computeSelectIndex, () => {
|
|
236
|
+
updateStyle()
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
onMounted(() => {
|
|
240
|
+
updateStyle()
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
onBeforeUnmount(() => {
|
|
244
|
+
XEUtils.assign(reactData, createReactData())
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
$xeSegmented.renderVN = renderVN
|
|
248
|
+
|
|
249
|
+
return $xeSegmented
|
|
250
|
+
},
|
|
251
|
+
render () {
|
|
252
|
+
return this.renderVN()
|
|
253
|
+
}
|
|
254
|
+
})
|
|
@@ -130,14 +130,11 @@ export default defineVxeComponent({
|
|
|
130
130
|
})
|
|
131
131
|
|
|
132
132
|
const computeWrapperStyle = computed(() => {
|
|
133
|
-
const { width
|
|
133
|
+
const { width } = props
|
|
134
134
|
const stys: VxeComponentStyleType = {}
|
|
135
135
|
if (width) {
|
|
136
136
|
stys.width = toCssUnit(width)
|
|
137
137
|
}
|
|
138
|
-
if (height) {
|
|
139
|
-
stys.height = toCssUnit(height)
|
|
140
|
-
}
|
|
141
138
|
return stys
|
|
142
139
|
})
|
|
143
140
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import { VxeUI } from '@vxe-ui/core'
|
|
3
|
+
import VxeTimelineComponent from './src/timeline'
|
|
4
|
+
import { dynamicApp } from '../dynamics'
|
|
5
|
+
|
|
6
|
+
export const VxeTimeline = Object.assign({}, VxeTimelineComponent, {
|
|
7
|
+
install (app: App) {
|
|
8
|
+
app.component(VxeTimelineComponent.name as string, VxeTimelineComponent)
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
dynamicApp.use(VxeTimeline)
|
|
13
|
+
VxeUI.component(VxeTimelineComponent)
|
|
14
|
+
|
|
15
|
+
export const Timeline = VxeTimeline
|
|
16
|
+
export default VxeTimeline
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ref, h, reactive } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { createEvent } from '../../ui'
|
|
5
|
+
|
|
6
|
+
import type { TimelineItemReactData, TimelineItemPrivateRef, VxeTimelineItemEmits, VxeTimelineItemPrivateComputed, TimelineItemMethods, TimelineItemPrivateMethods, VxeTimelineItemConstructor, VxeTimelineItemPrivateMethods, ValueOf } from '../../../types'
|
|
7
|
+
|
|
8
|
+
export default defineVxeComponent({
|
|
9
|
+
name: 'VxeTimelineItem',
|
|
10
|
+
props: {
|
|
11
|
+
},
|
|
12
|
+
emits: [
|
|
13
|
+
] as VxeTimelineItemEmits,
|
|
14
|
+
setup (props, context) {
|
|
15
|
+
const { emit } = context
|
|
16
|
+
|
|
17
|
+
const xID = XEUtils.uniqueId()
|
|
18
|
+
|
|
19
|
+
const refElem = ref<HTMLDivElement>()
|
|
20
|
+
|
|
21
|
+
const reactData = reactive<TimelineItemReactData>({})
|
|
22
|
+
|
|
23
|
+
const refMaps: TimelineItemPrivateRef = {
|
|
24
|
+
refElem
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const computeMaps: VxeTimelineItemPrivateComputed = {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const $xeTimelineItem = {
|
|
31
|
+
xID,
|
|
32
|
+
props,
|
|
33
|
+
context,
|
|
34
|
+
reactData,
|
|
35
|
+
|
|
36
|
+
getRefMaps: () => refMaps,
|
|
37
|
+
getComputeMaps: () => computeMaps
|
|
38
|
+
} as unknown as VxeTimelineItemConstructor & VxeTimelineItemPrivateMethods
|
|
39
|
+
|
|
40
|
+
const dispatchEvent = (type: ValueOf<VxeTimelineItemEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
41
|
+
emit(type, createEvent(evnt, { $timelineItem: $xeTimelineItem }, params))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const tagMethods: TimelineItemMethods = {
|
|
45
|
+
dispatchEvent
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tagPrivateMethods: TimelineItemPrivateMethods = {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Object.assign($xeTimelineItem, tagMethods, tagPrivateMethods)
|
|
52
|
+
|
|
53
|
+
const renderVN = () => {
|
|
54
|
+
return h('div', {
|
|
55
|
+
ref: refElem,
|
|
56
|
+
class: 'vxe-timeline-item'
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
$xeTimelineItem.renderVN = renderVN
|
|
61
|
+
|
|
62
|
+
return $xeTimelineItem
|
|
63
|
+
},
|
|
64
|
+
render () {
|
|
65
|
+
return this.renderVN()
|
|
66
|
+
}
|
|
67
|
+
})
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ref, h, reactive, PropType } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { getConfig, createEvent } from '../../ui'
|
|
5
|
+
|
|
6
|
+
import type { TimelineReactData, VxeTimelinePropTypes, TimelinePrivateRef, VxeTimelineEmits, VxeTimelinePrivateComputed, TimelineMethods, TimelinePrivateMethods, VxeTimelineConstructor, VxeTimelinePrivateMethods, ValueOf } from '../../../types'
|
|
7
|
+
|
|
8
|
+
export default defineVxeComponent({
|
|
9
|
+
name: 'VxeTimeline',
|
|
10
|
+
props: {
|
|
11
|
+
size: {
|
|
12
|
+
type: String as PropType<VxeTimelinePropTypes.Size>,
|
|
13
|
+
default: () => getConfig().timeline.size || getConfig().size
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
emits: [
|
|
17
|
+
] as VxeTimelineEmits,
|
|
18
|
+
setup (props, context) {
|
|
19
|
+
const { emit } = context
|
|
20
|
+
|
|
21
|
+
const xID = XEUtils.uniqueId()
|
|
22
|
+
|
|
23
|
+
const refElem = ref<HTMLDivElement>()
|
|
24
|
+
|
|
25
|
+
const reactData = reactive<TimelineReactData>({})
|
|
26
|
+
|
|
27
|
+
const refMaps: TimelinePrivateRef = {
|
|
28
|
+
refElem
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const computeMaps: VxeTimelinePrivateComputed = {
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const $xeTimeline = {
|
|
35
|
+
xID,
|
|
36
|
+
props,
|
|
37
|
+
context,
|
|
38
|
+
reactData,
|
|
39
|
+
|
|
40
|
+
getRefMaps: () => refMaps,
|
|
41
|
+
getComputeMaps: () => computeMaps
|
|
42
|
+
} as unknown as VxeTimelineConstructor & VxeTimelinePrivateMethods
|
|
43
|
+
|
|
44
|
+
const dispatchEvent = (type: ValueOf<VxeTimelineEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
45
|
+
emit(type, createEvent(evnt, { $timeline: $xeTimeline }, params))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tagMethods: TimelineMethods = {
|
|
49
|
+
dispatchEvent
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const tagPrivateMethods: TimelinePrivateMethods = {
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
Object.assign($xeTimeline, tagMethods, tagPrivateMethods)
|
|
56
|
+
|
|
57
|
+
const renderVN = () => {
|
|
58
|
+
return h('div', {
|
|
59
|
+
ref: refElem,
|
|
60
|
+
class: 'vxe-timeline'
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$xeTimeline.renderVN = renderVN
|
|
65
|
+
|
|
66
|
+
return $xeTimeline
|
|
67
|
+
},
|
|
68
|
+
render () {
|
|
69
|
+
return this.renderVN()
|
|
70
|
+
}
|
|
71
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import { VxeUI } from '@vxe-ui/core'
|
|
3
|
+
import VxeTimelineItemComponent from '../timeline/src/timeline-item'
|
|
4
|
+
import { dynamicApp } from '../dynamics'
|
|
5
|
+
|
|
6
|
+
export const VxeTimelineItem = Object.assign({}, VxeTimelineItemComponent, {
|
|
7
|
+
install (app: App) {
|
|
8
|
+
app.component(VxeTimelineItemComponent.name as string, VxeTimelineItemComponent)
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
dynamicApp.use(VxeTimelineItem)
|
|
13
|
+
VxeUI.component(VxeTimelineItemComponent)
|
|
14
|
+
|
|
15
|
+
export const TimelineItem = VxeTimelineItem
|
|
16
|
+
export default VxeTimelineItem
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import { VxeUI } from '@vxe-ui/core'
|
|
3
|
+
import VxeTourComponent from './src/tour'
|
|
4
|
+
import { dynamicApp } from '../dynamics'
|
|
5
|
+
|
|
6
|
+
export const VxeTour = Object.assign({}, VxeTourComponent, {
|
|
7
|
+
install (app: App) {
|
|
8
|
+
app.component(VxeTourComponent.name as string, VxeTourComponent)
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
dynamicApp.use(VxeTour)
|
|
13
|
+
VxeUI.component(VxeTourComponent)
|
|
14
|
+
|
|
15
|
+
export const Tour = VxeTour
|
|
16
|
+
export default VxeTour
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ref, h, reactive, PropType } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { getConfig, createEvent } from '../../ui'
|
|
5
|
+
|
|
6
|
+
import type { TourReactData, VxeTourPropTypes, TourPrivateRef, VxeTourEmits, VxeTourPrivateComputed, TourMethods, TourPrivateMethods, VxeTourConstructor, VxeTourPrivateMethods, ValueOf } from '../../../types'
|
|
7
|
+
|
|
8
|
+
export default defineVxeComponent({
|
|
9
|
+
name: 'VxeTour',
|
|
10
|
+
props: {
|
|
11
|
+
size: {
|
|
12
|
+
type: String as PropType<VxeTourPropTypes.Size>,
|
|
13
|
+
default: () => getConfig().tour.size || getConfig().size
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
emits: [
|
|
17
|
+
] as VxeTourEmits,
|
|
18
|
+
setup (props, context) {
|
|
19
|
+
const { emit } = context
|
|
20
|
+
|
|
21
|
+
const xID = XEUtils.uniqueId()
|
|
22
|
+
|
|
23
|
+
const refElem = ref<HTMLDivElement>()
|
|
24
|
+
|
|
25
|
+
const reactData = reactive<TourReactData>({})
|
|
26
|
+
|
|
27
|
+
const refMaps: TourPrivateRef = {
|
|
28
|
+
refElem
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const computeMaps: VxeTourPrivateComputed = {
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const $xeTour = {
|
|
35
|
+
xID,
|
|
36
|
+
props,
|
|
37
|
+
context,
|
|
38
|
+
reactData,
|
|
39
|
+
|
|
40
|
+
getRefMaps: () => refMaps,
|
|
41
|
+
getComputeMaps: () => computeMaps
|
|
42
|
+
} as unknown as VxeTourConstructor & VxeTourPrivateMethods
|
|
43
|
+
|
|
44
|
+
const dispatchEvent = (type: ValueOf<VxeTourEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
45
|
+
emit(type, createEvent(evnt, { $tour: $xeTour }, params))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tagMethods: TourMethods = {
|
|
49
|
+
dispatchEvent
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const tagPrivateMethods: TourPrivateMethods = {
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
Object.assign($xeTour, tagMethods, tagPrivateMethods)
|
|
56
|
+
|
|
57
|
+
const renderVN = () => {
|
|
58
|
+
return h('div', {
|
|
59
|
+
ref: refElem,
|
|
60
|
+
class: 'vxe-tour'
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$xeTour.renderVN = renderVN
|
|
65
|
+
|
|
66
|
+
return $xeTour
|
|
67
|
+
},
|
|
68
|
+
render () {
|
|
69
|
+
return this.renderVN()
|
|
70
|
+
}
|
|
71
|
+
})
|
package/packages/ui/index.ts
CHANGED
|
@@ -28,6 +28,11 @@ setConfig({
|
|
|
28
28
|
anchor: {},
|
|
29
29
|
anchorLink: {},
|
|
30
30
|
avatar: {},
|
|
31
|
+
backtop: {
|
|
32
|
+
showIcon: true,
|
|
33
|
+
showContent: true,
|
|
34
|
+
threshold: 20
|
|
35
|
+
},
|
|
31
36
|
badge: {},
|
|
32
37
|
breadcrumb: {
|
|
33
38
|
separator: '/'
|
|
@@ -60,6 +65,9 @@ setConfig({
|
|
|
60
65
|
interval: 5000
|
|
61
66
|
},
|
|
62
67
|
carouselItem: {},
|
|
68
|
+
cascader: {
|
|
69
|
+
autoClose: true
|
|
70
|
+
},
|
|
63
71
|
checkbox: {},
|
|
64
72
|
checkboxButton: {},
|
|
65
73
|
checkboxGroup: {},
|
|
@@ -297,6 +305,7 @@ setConfig({
|
|
|
297
305
|
rate: {},
|
|
298
306
|
result: {},
|
|
299
307
|
row: {},
|
|
308
|
+
segmented: {},
|
|
300
309
|
select: {
|
|
301
310
|
multiCharOverflow: 8,
|
|
302
311
|
remoteConfig: {
|
|
@@ -361,6 +370,8 @@ setConfig({
|
|
|
361
370
|
textarea: {
|
|
362
371
|
resize: 'none'
|
|
363
372
|
},
|
|
373
|
+
timeline: {},
|
|
374
|
+
timelineItem: {},
|
|
364
375
|
tip: {},
|
|
365
376
|
tooltip: {
|
|
366
377
|
// size: null,
|
|
@@ -658,7 +669,10 @@ setIcon({
|
|
|
658
669
|
SPLIT_TOP_ACTION: iconPrefix + 'arrow-up',
|
|
659
670
|
SPLIT_BOTTOM_ACTION: iconPrefix + 'arrow-down',
|
|
660
671
|
SPLIT_LEFT_ACTION: iconPrefix + 'arrow-left',
|
|
661
|
-
SPLIT_RIGHT_ACTION: iconPrefix + 'arrow-right'
|
|
672
|
+
SPLIT_RIGHT_ACTION: iconPrefix + 'arrow-right',
|
|
673
|
+
|
|
674
|
+
// backtop
|
|
675
|
+
BACKTOP_TOP: iconPrefix + 'top'
|
|
662
676
|
})
|
|
663
677
|
|
|
664
678
|
export * from '@vxe-ui/core'
|
package/styles/all.scss
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@use './components/anchor.scss';
|
|
5
5
|
@use './components/anchor-link.scss';
|
|
6
6
|
@use './components/avatar.scss';
|
|
7
|
+
@use './components/backtop.scss';
|
|
7
8
|
@use './components/badge.scss';
|
|
8
9
|
@use './components/breadcrumb.scss';
|
|
9
10
|
@use './components/breadcrumb-item.scss';
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
@use './components/card.scss';
|
|
14
15
|
@use './components/carousel.scss';
|
|
15
16
|
@use './components/carousel-item.scss';
|
|
17
|
+
@use './components/cascader.scss';
|
|
16
18
|
@use './components/checkbox.scss';
|
|
17
19
|
@use './components/checkbox-button.scss';
|
|
18
20
|
@use './components/checkbox-group.scss';
|
|
@@ -44,6 +46,7 @@
|
|
|
44
46
|
@use './components/link.scss';
|
|
45
47
|
@use './components/list.scss';
|
|
46
48
|
@use './components/loading.scss';
|
|
49
|
+
@use './components/mention.scss';
|
|
47
50
|
@use './components/menu.scss';
|
|
48
51
|
@use './components/modal.scss';
|
|
49
52
|
@use './components/notice-bar.scss';
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
@use './components/rate.scss';
|
|
62
65
|
@use './components/result.scss';
|
|
63
66
|
@use './components/row.scss';
|
|
67
|
+
@use './components/segmented.scss';
|
|
64
68
|
@use './components/select.scss';
|
|
65
69
|
@use './components/split.scss';
|
|
66
70
|
@use './components/split-pane.scss';
|
|
@@ -74,8 +78,11 @@
|
|
|
74
78
|
@use './components/text-ellipsis.scss';
|
|
75
79
|
@use './components/text.scss';
|
|
76
80
|
@use './components/textarea.scss';
|
|
81
|
+
@use './components/timeline.scss';
|
|
82
|
+
@use './components/timeline-item.scss';
|
|
77
83
|
@use './components/tip.scss';
|
|
78
84
|
@use './components/tooltip.scss';
|
|
85
|
+
@use './components/tour.scss';
|
|
79
86
|
@use './components/tree.scss';
|
|
80
87
|
@use './components/tree-select.scss';
|
|
81
88
|
@use './components/upload.scss';
|