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.
Files changed (269) hide show
  1. package/README.md +6 -0
  2. package/es/backtop/index.js +12 -0
  3. package/es/backtop/src/backtop.js +231 -0
  4. package/es/backtop/style.css +90 -0
  5. package/es/backtop/style.min.css +1 -0
  6. package/es/cascader/index.js +12 -0
  7. package/es/cascader/src/cascader.js +669 -0
  8. package/es/cascader/style.css +168 -0
  9. package/es/cascader/style.min.css +1 -0
  10. package/es/components.js +18 -0
  11. package/es/date-range-picker/src/date-range-picker.js +2 -1
  12. package/es/form/render/index.js +3 -3
  13. package/es/form/src/render.js +4 -2
  14. package/es/form/style.css +5 -2
  15. package/es/form/style.min.css +1 -1
  16. package/es/icon/{iconfont.1767168857404.ttf → iconfont.1767441272505.ttf} +0 -0
  17. package/es/icon/iconfont.1767441272505.woff +0 -0
  18. package/es/icon/iconfont.1767441272505.woff2 +0 -0
  19. package/es/icon/style.css +9 -1
  20. package/es/icon/style.min.css +1 -1
  21. package/{lib/icon/style/iconfont.1767168857404.ttf → es/iconfont.1767441272505.ttf} +0 -0
  22. package/es/iconfont.1767441272505.woff +0 -0
  23. package/es/iconfont.1767441272505.woff2 +0 -0
  24. package/es/layout-body/src/layout-body.js +39 -6
  25. package/es/mention/index.js +12 -0
  26. package/es/mention/src/mention.js +51 -0
  27. package/es/mention/style.css +0 -0
  28. package/es/mention/style.min.css +0 -0
  29. package/es/radio/src/button.js +7 -5
  30. package/es/radio/src/group.js +3 -2
  31. package/es/radio/src/radio.js +3 -2
  32. package/es/segmented/index.js +12 -0
  33. package/es/segmented/src/segmented.js +218 -0
  34. package/es/segmented/style.css +195 -0
  35. package/es/segmented/style.min.css +1 -0
  36. package/es/style.css +1 -1
  37. package/es/style.min.css +1 -1
  38. package/es/tabs/src/tabs.js +1 -4
  39. package/es/timeline/index.js +12 -0
  40. package/es/timeline/src/timeline-item.js +46 -0
  41. package/es/timeline/src/timeline.js +51 -0
  42. package/es/timeline/style.css +0 -0
  43. package/es/timeline/style.min.css +0 -0
  44. package/es/timeline-item/index.js +12 -0
  45. package/es/timeline-item/style.css +0 -0
  46. package/es/timeline-item/style.min.css +0 -0
  47. package/es/tour/index.js +12 -0
  48. package/es/tour/src/tour.js +51 -0
  49. package/es/tour/style.css +0 -0
  50. package/es/tour/style.min.css +0 -0
  51. package/es/ui/index.js +15 -2
  52. package/es/ui/src/log.js +1 -1
  53. package/es/vxe-backtop/index.js +3 -0
  54. package/es/vxe-backtop/style.css +90 -0
  55. package/es/vxe-backtop/style.min.css +1 -0
  56. package/es/vxe-cascader/index.js +3 -0
  57. package/es/vxe-cascader/style.css +168 -0
  58. package/es/vxe-cascader/style.min.css +1 -0
  59. package/es/vxe-form/style.css +5 -2
  60. package/es/vxe-form/style.min.css +1 -1
  61. package/es/vxe-icon/style.css +9 -1
  62. package/es/vxe-icon/style.min.css +1 -1
  63. package/es/vxe-mention/index.js +3 -0
  64. package/es/vxe-mention/style.css +0 -0
  65. package/es/vxe-mention/style.min.css +0 -0
  66. package/es/vxe-segmented/index.js +3 -0
  67. package/es/vxe-segmented/style.css +195 -0
  68. package/es/vxe-segmented/style.min.css +1 -0
  69. package/es/vxe-timeline/index.js +3 -0
  70. package/es/vxe-timeline/style.css +0 -0
  71. package/es/vxe-timeline/style.min.css +0 -0
  72. package/es/vxe-timeline-item/index.js +3 -0
  73. package/es/vxe-timeline-item/style.css +0 -0
  74. package/es/vxe-timeline-item/style.min.css +0 -0
  75. package/es/vxe-tour/index.js +3 -0
  76. package/es/vxe-tour/style.css +0 -0
  77. package/es/vxe-tour/style.min.css +0 -0
  78. package/lib/backtop/index.js +19 -0
  79. package/lib/backtop/index.min.js +1 -0
  80. package/lib/backtop/src/backtop.js +256 -0
  81. package/lib/backtop/src/backtop.min.js +1 -0
  82. package/lib/backtop/style/index.js +1 -0
  83. package/lib/backtop/style/style.css +90 -0
  84. package/lib/backtop/style/style.min.css +1 -0
  85. package/lib/cascader/index.js +19 -0
  86. package/lib/cascader/index.min.js +1 -0
  87. package/lib/cascader/src/cascader.js +723 -0
  88. package/lib/cascader/src/cascader.min.js +1 -0
  89. package/lib/cascader/style/index.js +1 -0
  90. package/lib/cascader/style/style.css +168 -0
  91. package/lib/cascader/style/style.min.css +1 -0
  92. package/lib/components.js +73 -1
  93. package/lib/components.min.js +1 -1
  94. package/lib/date-range-picker/src/date-range-picker.js +5 -1
  95. package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
  96. package/lib/form/render/index.js +6 -3
  97. package/lib/form/render/index.min.js +1 -1
  98. package/lib/form/src/render.js +4 -1
  99. package/lib/form/src/render.min.js +1 -1
  100. package/lib/form/style/style.css +5 -2
  101. package/lib/form/style/style.min.css +1 -1
  102. package/lib/{iconfont.1767168857404.ttf → icon/style/iconfont.1767441272505.ttf} +0 -0
  103. package/lib/icon/style/iconfont.1767441272505.woff +0 -0
  104. package/lib/icon/style/iconfont.1767441272505.woff2 +0 -0
  105. package/lib/icon/style/style.css +9 -1
  106. package/lib/icon/style/style.min.css +9 -1
  107. package/{es/iconfont.1767168857404.ttf → lib/iconfont.1767441272505.ttf} +0 -0
  108. package/lib/iconfont.1767441272505.woff +0 -0
  109. package/lib/iconfont.1767441272505.woff2 +0 -0
  110. package/lib/index.umd.js +5250 -3708
  111. package/lib/index.umd.min.js +1 -1
  112. package/lib/layout-body/src/layout-body.js +34 -4
  113. package/lib/layout-body/src/layout-body.min.js +1 -1
  114. package/lib/mention/index.js +19 -0
  115. package/lib/mention/index.min.js +1 -0
  116. package/lib/mention/src/mention.js +62 -0
  117. package/lib/mention/src/mention.min.js +1 -0
  118. package/lib/mention/style/index.js +1 -0
  119. package/lib/mention/style/style.css +0 -0
  120. package/lib/mention/style/style.min.css +0 -0
  121. package/lib/radio/src/button.js +15 -8
  122. package/lib/radio/src/button.min.js +1 -1
  123. package/lib/radio/src/group.js +7 -2
  124. package/lib/radio/src/group.min.js +1 -1
  125. package/lib/radio/src/radio.js +7 -2
  126. package/lib/radio/src/radio.min.js +1 -1
  127. package/lib/segmented/index.js +19 -0
  128. package/lib/segmented/index.min.js +1 -0
  129. package/lib/segmented/src/segmented.js +237 -0
  130. package/lib/segmented/src/segmented.min.js +1 -0
  131. package/lib/segmented/style/index.js +1 -0
  132. package/lib/segmented/style/style.css +195 -0
  133. package/lib/segmented/style/style.min.css +1 -0
  134. package/lib/style.css +1 -1
  135. package/lib/style.min.css +1 -1
  136. package/lib/tabs/src/tabs.js +1 -5
  137. package/lib/tabs/src/tabs.min.js +1 -1
  138. package/lib/timeline/index.js +19 -0
  139. package/lib/timeline/index.min.js +1 -0
  140. package/lib/timeline/src/timeline-item.js +57 -0
  141. package/lib/timeline/src/timeline-item.min.js +1 -0
  142. package/lib/timeline/src/timeline.js +62 -0
  143. package/lib/timeline/src/timeline.min.js +1 -0
  144. package/lib/timeline/style/index.js +1 -0
  145. package/lib/timeline/style/style.css +0 -0
  146. package/lib/timeline/style/style.min.css +0 -0
  147. package/lib/timeline-item/index.js +19 -0
  148. package/lib/timeline-item/index.min.js +1 -0
  149. package/lib/timeline-item/style/index.js +1 -0
  150. package/lib/timeline-item/style/style.css +0 -0
  151. package/lib/timeline-item/style/style.min.css +0 -0
  152. package/lib/tour/index.js +19 -0
  153. package/lib/tour/index.min.js +1 -0
  154. package/lib/tour/src/tour.js +62 -0
  155. package/lib/tour/src/tour.min.js +1 -0
  156. package/lib/tour/style/index.js +1 -0
  157. package/lib/tour/style/style.css +0 -0
  158. package/lib/tour/style/style.min.css +0 -0
  159. package/lib/ui/index.js +15 -2
  160. package/lib/ui/index.min.js +1 -1
  161. package/lib/ui/src/log.js +1 -1
  162. package/lib/ui/src/log.min.js +1 -1
  163. package/lib/vxe-backtop/index.js +22 -0
  164. package/lib/vxe-backtop/index.min.js +1 -0
  165. package/lib/vxe-backtop/style/index.js +1 -0
  166. package/lib/vxe-backtop/style/style.css +90 -0
  167. package/lib/vxe-backtop/style/style.min.css +1 -0
  168. package/lib/vxe-cascader/index.js +22 -0
  169. package/lib/vxe-cascader/index.min.js +1 -0
  170. package/lib/vxe-cascader/style/index.js +1 -0
  171. package/lib/vxe-cascader/style/style.css +168 -0
  172. package/lib/vxe-cascader/style/style.min.css +1 -0
  173. package/lib/vxe-form/style/style.css +5 -2
  174. package/lib/vxe-form/style/style.min.css +1 -1
  175. package/lib/vxe-icon/style/style.css +9 -1
  176. package/lib/vxe-icon/style/style.min.css +1 -1
  177. package/lib/vxe-mention/index.js +22 -0
  178. package/lib/vxe-mention/index.min.js +1 -0
  179. package/lib/vxe-mention/style/index.js +1 -0
  180. package/lib/vxe-mention/style/style.css +0 -0
  181. package/lib/vxe-mention/style/style.min.css +0 -0
  182. package/lib/vxe-segmented/index.js +22 -0
  183. package/lib/vxe-segmented/index.min.js +1 -0
  184. package/lib/vxe-segmented/style/index.js +1 -0
  185. package/lib/vxe-segmented/style/style.css +195 -0
  186. package/lib/vxe-segmented/style/style.min.css +1 -0
  187. package/lib/vxe-timeline/index.js +22 -0
  188. package/lib/vxe-timeline/index.min.js +1 -0
  189. package/lib/vxe-timeline/style/index.js +1 -0
  190. package/lib/vxe-timeline/style/style.css +0 -0
  191. package/lib/vxe-timeline/style/style.min.css +0 -0
  192. package/lib/vxe-timeline-item/index.js +22 -0
  193. package/lib/vxe-timeline-item/index.min.js +1 -0
  194. package/lib/vxe-timeline-item/style/index.js +1 -0
  195. package/lib/vxe-timeline-item/style/style.css +0 -0
  196. package/lib/vxe-timeline-item/style/style.min.css +0 -0
  197. package/lib/vxe-tour/index.js +22 -0
  198. package/lib/vxe-tour/index.min.js +1 -0
  199. package/lib/vxe-tour/style/index.js +1 -0
  200. package/lib/vxe-tour/style/style.css +0 -0
  201. package/lib/vxe-tour/style/style.min.css +0 -0
  202. package/package.json +1 -1
  203. package/packages/backtop/index.ts +16 -0
  204. package/packages/backtop/src/backtop.ts +264 -0
  205. package/packages/cascader/index.ts +16 -0
  206. package/packages/cascader/src/cascader.ts +739 -0
  207. package/packages/components.ts +18 -0
  208. package/packages/date-range-picker/src/date-range-picker.ts +2 -1
  209. package/packages/form/render/index.ts +3 -3
  210. package/packages/form/src/render.ts +4 -2
  211. package/packages/layout-body/src/layout-body.ts +43 -9
  212. package/packages/mention/index.ts +16 -0
  213. package/packages/mention/src/mention.ts +71 -0
  214. package/packages/radio/src/button.ts +9 -6
  215. package/packages/radio/src/group.ts +3 -2
  216. package/packages/radio/src/radio.ts +3 -2
  217. package/packages/segmented/index.ts +16 -0
  218. package/packages/segmented/src/segmented.ts +254 -0
  219. package/packages/tabs/src/tabs.ts +1 -4
  220. package/packages/timeline/index.ts +16 -0
  221. package/packages/timeline/src/timeline-item.ts +67 -0
  222. package/packages/timeline/src/timeline.ts +71 -0
  223. package/packages/timeline-item/index.ts +16 -0
  224. package/packages/tour/index.ts +16 -0
  225. package/packages/tour/src/tour.ts +71 -0
  226. package/packages/ui/index.ts +15 -1
  227. package/styles/all.scss +7 -0
  228. package/styles/components/backtop.scss +111 -0
  229. package/styles/components/cascader.scss +140 -0
  230. package/styles/components/form.scss +7 -2
  231. package/styles/components/icon.scss +9 -2
  232. package/styles/components/mention.scss +0 -0
  233. package/styles/components/segmented.scss +214 -0
  234. package/styles/components/timeline-item.scss +0 -0
  235. package/styles/components/timeline.scss +0 -0
  236. package/styles/components/tour.scss +0 -0
  237. package/styles/icon/iconfont.ttf +0 -0
  238. package/styles/icon/iconfont.woff +0 -0
  239. package/styles/icon/iconfont.woff2 +0 -0
  240. package/styles/theme/base.scss +6 -0
  241. package/types/all.d.ts +21 -0
  242. package/types/components/backtop.d.ts +111 -0
  243. package/types/components/cascader.d.ts +255 -0
  244. package/types/components/date-range-picker.d.ts +3 -1
  245. package/types/components/form.d.ts +4 -0
  246. package/types/components/icon.d.ts +2 -2
  247. package/types/components/layout-body.d.ts +9 -0
  248. package/types/components/list.d.ts +2 -2
  249. package/types/components/mention.d.ts +77 -0
  250. package/types/components/radio-group.d.ts +2 -1
  251. package/types/components/rate.d.ts +1 -1
  252. package/types/components/segmented.d.ts +123 -0
  253. package/types/components/select.d.ts +1 -1
  254. package/types/components/table.d.ts +15 -6
  255. package/types/components/timeline-item.d.ts +75 -0
  256. package/types/components/timeline.d.ts +77 -0
  257. package/types/components/tour.d.ts +77 -0
  258. package/types/components/tree-select.d.ts +1 -1
  259. package/types/components/tree.d.ts +1 -1
  260. package/types/ui/global-config.d.ts +14 -0
  261. package/types/ui/global-icon.d.ts +3 -0
  262. package/es/icon/iconfont.1767168857404.woff +0 -0
  263. package/es/icon/iconfont.1767168857404.woff2 +0 -0
  264. package/es/iconfont.1767168857404.woff +0 -0
  265. package/es/iconfont.1767168857404.woff2 +0 -0
  266. package/lib/icon/style/iconfont.1767168857404.woff +0 -0
  267. package/lib/icon/style/iconfont.1767168857404.woff2 +0 -0
  268. package/lib/iconfont.1767168857404.woff +0 -0
  269. 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, height } = props
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
+ })
@@ -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';