vxe-pc-ui 4.11.28 → 4.11.30

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 (233) 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/icon/{iconfont.1767178201934.ttf → iconfont.1767491587367.ttf} +0 -0
  12. package/es/icon/iconfont.1767491587367.woff +0 -0
  13. package/es/icon/iconfont.1767491587367.woff2 +0 -0
  14. package/es/icon/style.css +9 -1
  15. package/es/icon/style.min.css +1 -1
  16. package/{lib/icon/style/iconfont.1767178201934.ttf → es/iconfont.1767491587367.ttf} +0 -0
  17. package/es/iconfont.1767491587367.woff +0 -0
  18. package/es/iconfont.1767491587367.woff2 +0 -0
  19. package/es/layout-body/src/layout-body.js +39 -6
  20. package/es/mention/index.js +12 -0
  21. package/es/mention/src/mention.js +51 -0
  22. package/es/mention/style.css +0 -0
  23. package/es/mention/style.min.css +0 -0
  24. package/es/segmented/index.js +12 -0
  25. package/es/segmented/src/segmented.js +228 -0
  26. package/es/segmented/style.css +197 -0
  27. package/es/segmented/style.min.css +1 -0
  28. package/es/style.css +1 -1
  29. package/es/style.min.css +1 -1
  30. package/es/tabs/src/tabs.js +1 -4
  31. package/es/timeline/index.js +12 -0
  32. package/es/timeline/src/timeline-item.js +46 -0
  33. package/es/timeline/src/timeline.js +51 -0
  34. package/es/timeline/style.css +0 -0
  35. package/es/timeline/style.min.css +0 -0
  36. package/es/timeline-item/index.js +12 -0
  37. package/es/timeline-item/style.css +0 -0
  38. package/es/timeline-item/style.min.css +0 -0
  39. package/es/tour/index.js +12 -0
  40. package/es/tour/src/tour.js +51 -0
  41. package/es/tour/style.css +0 -0
  42. package/es/tour/style.min.css +0 -0
  43. package/es/ui/index.js +15 -2
  44. package/es/ui/src/log.js +1 -1
  45. package/es/vxe-backtop/index.js +3 -0
  46. package/es/vxe-backtop/style.css +90 -0
  47. package/es/vxe-backtop/style.min.css +1 -0
  48. package/es/vxe-cascader/index.js +3 -0
  49. package/es/vxe-cascader/style.css +168 -0
  50. package/es/vxe-cascader/style.min.css +1 -0
  51. package/es/vxe-icon/style.css +9 -1
  52. package/es/vxe-icon/style.min.css +1 -1
  53. package/es/vxe-mention/index.js +3 -0
  54. package/es/vxe-mention/style.css +0 -0
  55. package/es/vxe-mention/style.min.css +0 -0
  56. package/es/vxe-segmented/index.js +3 -0
  57. package/es/vxe-segmented/style.css +197 -0
  58. package/es/vxe-segmented/style.min.css +1 -0
  59. package/es/vxe-timeline/index.js +3 -0
  60. package/es/vxe-timeline/style.css +0 -0
  61. package/es/vxe-timeline/style.min.css +0 -0
  62. package/es/vxe-timeline-item/index.js +3 -0
  63. package/es/vxe-timeline-item/style.css +0 -0
  64. package/es/vxe-timeline-item/style.min.css +0 -0
  65. package/es/vxe-tour/index.js +3 -0
  66. package/es/vxe-tour/style.css +0 -0
  67. package/es/vxe-tour/style.min.css +0 -0
  68. package/lib/backtop/index.js +19 -0
  69. package/lib/backtop/index.min.js +1 -0
  70. package/lib/backtop/src/backtop.js +256 -0
  71. package/lib/backtop/src/backtop.min.js +1 -0
  72. package/lib/backtop/style/index.js +1 -0
  73. package/lib/backtop/style/style.css +90 -0
  74. package/lib/backtop/style/style.min.css +1 -0
  75. package/lib/cascader/index.js +19 -0
  76. package/lib/cascader/index.min.js +1 -0
  77. package/lib/cascader/src/cascader.js +723 -0
  78. package/lib/cascader/src/cascader.min.js +1 -0
  79. package/lib/cascader/style/index.js +1 -0
  80. package/lib/cascader/style/style.css +168 -0
  81. package/lib/cascader/style/style.min.css +1 -0
  82. package/lib/components.js +73 -1
  83. package/lib/components.min.js +1 -1
  84. package/lib/{iconfont.1767178201934.ttf → icon/style/iconfont.1767491587367.ttf} +0 -0
  85. package/lib/icon/style/iconfont.1767491587367.woff +0 -0
  86. package/lib/icon/style/iconfont.1767491587367.woff2 +0 -0
  87. package/lib/icon/style/style.css +9 -1
  88. package/lib/icon/style/style.min.css +9 -1
  89. package/{es/iconfont.1767178201934.ttf → lib/iconfont.1767491587367.ttf} +0 -0
  90. package/lib/iconfont.1767491587367.woff +0 -0
  91. package/lib/iconfont.1767491587367.woff2 +0 -0
  92. package/lib/index.umd.js +5263 -3740
  93. package/lib/index.umd.min.js +1 -1
  94. package/lib/layout-body/src/layout-body.js +34 -4
  95. package/lib/layout-body/src/layout-body.min.js +1 -1
  96. package/lib/mention/index.js +19 -0
  97. package/lib/mention/index.min.js +1 -0
  98. package/lib/mention/src/mention.js +62 -0
  99. package/lib/mention/src/mention.min.js +1 -0
  100. package/lib/mention/style/index.js +1 -0
  101. package/lib/mention/style/style.css +0 -0
  102. package/lib/mention/style/style.min.css +0 -0
  103. package/lib/segmented/index.js +19 -0
  104. package/lib/segmented/index.min.js +1 -0
  105. package/lib/segmented/src/segmented.js +245 -0
  106. package/lib/segmented/src/segmented.min.js +1 -0
  107. package/lib/segmented/style/index.js +1 -0
  108. package/lib/segmented/style/style.css +197 -0
  109. package/lib/segmented/style/style.min.css +1 -0
  110. package/lib/style.css +1 -1
  111. package/lib/style.min.css +1 -1
  112. package/lib/tabs/src/tabs.js +1 -5
  113. package/lib/tabs/src/tabs.min.js +1 -1
  114. package/lib/timeline/index.js +19 -0
  115. package/lib/timeline/index.min.js +1 -0
  116. package/lib/timeline/src/timeline-item.js +57 -0
  117. package/lib/timeline/src/timeline-item.min.js +1 -0
  118. package/lib/timeline/src/timeline.js +62 -0
  119. package/lib/timeline/src/timeline.min.js +1 -0
  120. package/lib/timeline/style/index.js +1 -0
  121. package/lib/timeline/style/style.css +0 -0
  122. package/lib/timeline/style/style.min.css +0 -0
  123. package/lib/timeline-item/index.js +19 -0
  124. package/lib/timeline-item/index.min.js +1 -0
  125. package/lib/timeline-item/style/index.js +1 -0
  126. package/lib/timeline-item/style/style.css +0 -0
  127. package/lib/timeline-item/style/style.min.css +0 -0
  128. package/lib/tour/index.js +19 -0
  129. package/lib/tour/index.min.js +1 -0
  130. package/lib/tour/src/tour.js +62 -0
  131. package/lib/tour/src/tour.min.js +1 -0
  132. package/lib/tour/style/index.js +1 -0
  133. package/lib/tour/style/style.css +0 -0
  134. package/lib/tour/style/style.min.css +0 -0
  135. package/lib/ui/index.js +15 -2
  136. package/lib/ui/index.min.js +1 -1
  137. package/lib/ui/src/log.js +1 -1
  138. package/lib/ui/src/log.min.js +1 -1
  139. package/lib/vxe-backtop/index.js +22 -0
  140. package/lib/vxe-backtop/index.min.js +1 -0
  141. package/lib/vxe-backtop/style/index.js +1 -0
  142. package/lib/vxe-backtop/style/style.css +90 -0
  143. package/lib/vxe-backtop/style/style.min.css +1 -0
  144. package/lib/vxe-cascader/index.js +22 -0
  145. package/lib/vxe-cascader/index.min.js +1 -0
  146. package/lib/vxe-cascader/style/index.js +1 -0
  147. package/lib/vxe-cascader/style/style.css +168 -0
  148. package/lib/vxe-cascader/style/style.min.css +1 -0
  149. package/lib/vxe-icon/style/style.css +9 -1
  150. package/lib/vxe-icon/style/style.min.css +1 -1
  151. package/lib/vxe-mention/index.js +22 -0
  152. package/lib/vxe-mention/index.min.js +1 -0
  153. package/lib/vxe-mention/style/index.js +1 -0
  154. package/lib/vxe-mention/style/style.css +0 -0
  155. package/lib/vxe-mention/style/style.min.css +0 -0
  156. package/lib/vxe-segmented/index.js +22 -0
  157. package/lib/vxe-segmented/index.min.js +1 -0
  158. package/lib/vxe-segmented/style/index.js +1 -0
  159. package/lib/vxe-segmented/style/style.css +197 -0
  160. package/lib/vxe-segmented/style/style.min.css +1 -0
  161. package/lib/vxe-timeline/index.js +22 -0
  162. package/lib/vxe-timeline/index.min.js +1 -0
  163. package/lib/vxe-timeline/style/index.js +1 -0
  164. package/lib/vxe-timeline/style/style.css +0 -0
  165. package/lib/vxe-timeline/style/style.min.css +0 -0
  166. package/lib/vxe-timeline-item/index.js +22 -0
  167. package/lib/vxe-timeline-item/index.min.js +1 -0
  168. package/lib/vxe-timeline-item/style/index.js +1 -0
  169. package/lib/vxe-timeline-item/style/style.css +0 -0
  170. package/lib/vxe-timeline-item/style/style.min.css +0 -0
  171. package/lib/vxe-tour/index.js +22 -0
  172. package/lib/vxe-tour/index.min.js +1 -0
  173. package/lib/vxe-tour/style/index.js +1 -0
  174. package/lib/vxe-tour/style/style.css +0 -0
  175. package/lib/vxe-tour/style/style.min.css +0 -0
  176. package/package.json +1 -1
  177. package/packages/backtop/index.ts +16 -0
  178. package/packages/backtop/src/backtop.ts +264 -0
  179. package/packages/cascader/index.ts +16 -0
  180. package/packages/cascader/src/cascader.ts +739 -0
  181. package/packages/components.ts +18 -0
  182. package/packages/layout-body/src/layout-body.ts +43 -9
  183. package/packages/mention/index.ts +16 -0
  184. package/packages/mention/src/mention.ts +71 -0
  185. package/packages/segmented/index.ts +16 -0
  186. package/packages/segmented/src/segmented.ts +264 -0
  187. package/packages/tabs/src/tabs.ts +1 -4
  188. package/packages/timeline/index.ts +16 -0
  189. package/packages/timeline/src/timeline-item.ts +67 -0
  190. package/packages/timeline/src/timeline.ts +71 -0
  191. package/packages/timeline-item/index.ts +16 -0
  192. package/packages/tour/index.ts +16 -0
  193. package/packages/tour/src/tour.ts +71 -0
  194. package/packages/ui/index.ts +15 -1
  195. package/styles/all.scss +7 -0
  196. package/styles/components/backtop.scss +111 -0
  197. package/styles/components/cascader.scss +140 -0
  198. package/styles/components/icon.scss +9 -2
  199. package/styles/components/mention.scss +0 -0
  200. package/styles/components/segmented.scss +216 -0
  201. package/styles/components/timeline-item.scss +0 -0
  202. package/styles/components/timeline.scss +0 -0
  203. package/styles/components/tour.scss +0 -0
  204. package/styles/icon/iconfont.ttf +0 -0
  205. package/styles/icon/iconfont.woff +0 -0
  206. package/styles/icon/iconfont.woff2 +0 -0
  207. package/styles/theme/base.scss +4 -0
  208. package/types/all.d.ts +21 -0
  209. package/types/components/backtop.d.ts +111 -0
  210. package/types/components/cascader.d.ts +255 -0
  211. package/types/components/icon.d.ts +2 -2
  212. package/types/components/layout-body.d.ts +9 -0
  213. package/types/components/list.d.ts +2 -2
  214. package/types/components/mention.d.ts +77 -0
  215. package/types/components/rate.d.ts +1 -1
  216. package/types/components/segmented.d.ts +123 -0
  217. package/types/components/select.d.ts +1 -1
  218. package/types/components/table.d.ts +4 -4
  219. package/types/components/timeline-item.d.ts +75 -0
  220. package/types/components/timeline.d.ts +77 -0
  221. package/types/components/tour.d.ts +77 -0
  222. package/types/components/tree-select.d.ts +1 -1
  223. package/types/components/tree.d.ts +1 -1
  224. package/types/ui/global-config.d.ts +14 -0
  225. package/types/ui/global-icon.d.ts +3 -0
  226. package/es/icon/iconfont.1767178201934.woff +0 -0
  227. package/es/icon/iconfont.1767178201934.woff2 +0 -0
  228. package/es/iconfont.1767178201934.woff +0 -0
  229. package/es/iconfont.1767178201934.woff2 +0 -0
  230. package/lib/icon/style/iconfont.1767178201934.woff +0 -0
  231. package/lib/icon/style/iconfont.1767178201934.woff2 +0 -0
  232. package/lib/iconfont.1767178201934.woff +0 -0
  233. package/lib/iconfont.1767178201934.woff2 +0 -0
@@ -7,6 +7,7 @@ import VxeAlert from './alert'
7
7
  import VxeAnchor from './anchor'
8
8
  import VxeAnchorLink from './anchor-link'
9
9
  import VxeAvatar from './avatar'
10
+ import VxeBacktop from './backtop'
10
11
  import VxeBadge from './badge'
11
12
  import VxeBreadcrumb from './breadcrumb'
12
13
  import VxeBreadcrumbItem from './breadcrumb-item'
@@ -16,6 +17,7 @@ import VxeCalendar from './calendar'
16
17
  import VxeCard from './card'
17
18
  import VxeCarousel from './carousel'
18
19
  import VxeCarouselItem from './carousel-item'
20
+ import VxeCascader from './cascader'
19
21
  import VxeCheckbox from './checkbox'
20
22
  import VxeCheckboxButton from './checkbox-button'
21
23
  import VxeCheckboxGroup from './checkbox-group'
@@ -64,6 +66,7 @@ import VxeRadioGroup from './radio-group'
64
66
  import VxeRate from './rate'
65
67
  import VxeResult from './result'
66
68
  import VxeRow from './row'
69
+ import VxeSegmented from './segmented'
67
70
  import VxeSelect from './select'
68
71
  import VxeSplitter from './splitter'
69
72
  import VxeSplitterPanel from './splitter-panel'
@@ -79,8 +82,11 @@ import VxeTag from './tag'
79
82
  import VxeTextEllipsis from './text-ellipsis'
80
83
  import VxeText from './text'
81
84
  import VxeTextarea from './textarea'
85
+ import VxeTimeline from './timeline'
86
+ import VxeTimelineItem from './timeline-item'
82
87
  import VxeTip from './tip'
83
88
  import VxeTooltip from './tooltip'
89
+ import VxeTour from './tour'
84
90
  import VxeTree from './tree'
85
91
  import VxeTreeSelect from './tree-select'
86
92
  import VxeUpload from './upload'
@@ -98,6 +104,7 @@ const components = [
98
104
  VxeAnchor,
99
105
  VxeAnchorLink,
100
106
  VxeAvatar,
107
+ VxeBacktop,
101
108
  VxeBadge,
102
109
  VxeBreadcrumb,
103
110
  VxeBreadcrumbItem,
@@ -107,6 +114,7 @@ const components = [
107
114
  VxeCard,
108
115
  VxeCarousel,
109
116
  VxeCarouselItem,
117
+ VxeCascader,
110
118
  VxeCheckbox,
111
119
  VxeCheckboxButton,
112
120
  VxeCheckboxGroup,
@@ -155,6 +163,7 @@ const components = [
155
163
  VxeRate,
156
164
  VxeResult,
157
165
  VxeRow,
166
+ VxeSegmented,
158
167
  VxeSelect,
159
168
  VxeSplitter,
160
169
  VxeSplitterPanel,
@@ -170,8 +179,11 @@ const components = [
170
179
  VxeTextEllipsis,
171
180
  VxeText,
172
181
  VxeTextarea,
182
+ VxeTimeline,
183
+ VxeTimelineItem,
173
184
  VxeTip,
174
185
  VxeTooltip,
186
+ VxeTour,
175
187
  VxeTree,
176
188
  VxeTreeSelect,
177
189
  VxeUpload,
@@ -206,6 +218,7 @@ export * from './alert'
206
218
  export * from './anchor'
207
219
  export * from './anchor-link'
208
220
  export * from './avatar'
221
+ export * from './backtop'
209
222
  export * from './badge'
210
223
  export * from './breadcrumb'
211
224
  export * from './breadcrumb-item'
@@ -215,6 +228,7 @@ export * from './calendar'
215
228
  export * from './card'
216
229
  export * from './carousel'
217
230
  export * from './carousel-item'
231
+ export * from './cascader'
218
232
  export * from './checkbox'
219
233
  export * from './checkbox-button'
220
234
  export * from './checkbox-group'
@@ -263,6 +277,7 @@ export * from './radio-group'
263
277
  export * from './rate'
264
278
  export * from './result'
265
279
  export * from './row'
280
+ export * from './segmented'
266
281
  export * from './select'
267
282
  export * from './splitter'
268
283
  export * from './splitter-panel'
@@ -278,8 +293,11 @@ export * from './tag'
278
293
  export * from './text-ellipsis'
279
294
  export * from './text'
280
295
  export * from './textarea'
296
+ export * from './timeline'
297
+ export * from './timeline-item'
281
298
  export * from './tip'
282
299
  export * from './tooltip'
300
+ export * from './tour'
283
301
  export * from './tree'
284
302
  export * from './tree-select'
285
303
  export * from './upload'
@@ -1,16 +1,30 @@
1
- import { ref, h, reactive, PropType } from 'vue'
1
+ import { ref, h, reactive, PropType, computed } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
- import { getConfig, useSize, createEvent } from '../../ui'
4
- import VxeLoadingComponent from '../../loading/src/loading'
3
+ import { getConfig, useSize, createEvent, renderEmptyElement } from '../../ui'
4
+ import VxeLoadingComponent from '../../loading'
5
+ import VxeUIBacktopComponent from '../../backtop'
5
6
  import XEUtils from 'xe-utils'
6
7
 
7
- import type { VxeLayoutBodyPropTypes, LayoutBodyReactData, LayoutBodyPrivateRef, VxeLayoutBodyEmits, LayoutBodyMethods, LayoutBodyPrivateMethods, VxeLayoutBodyPrivateComputed, VxeLayoutBodyConstructor, VxeLayoutBodyPrivateMethods, ValueOf } from '../../../types'
8
+ import type { LayoutBodyInternalData, VxeLayoutBodyPropTypes, LayoutBodyReactData, LayoutBodyPrivateRef, VxeLayoutBodyEmits, LayoutBodyMethods, LayoutBodyPrivateMethods, VxeLayoutBodyPrivateComputed, VxeLayoutBodyConstructor, VxeLayoutBodyPrivateMethods, ValueOf } from '../../../types'
9
+
10
+ function createInternalData (): LayoutBodyInternalData {
11
+ return {}
12
+ }
13
+
14
+ function createReactData (): LayoutBodyReactData {
15
+ return {}
16
+ }
8
17
 
9
18
  export default defineVxeComponent({
10
19
  name: 'VxeLayoutBody',
11
20
  props: {
12
21
  loading: Boolean as PropType<VxeLayoutBodyPropTypes.Loading>,
13
22
  padding: Boolean as PropType<VxeLayoutBodyPropTypes.Padding>,
23
+ showBacktop: {
24
+ type: Boolean as PropType<VxeLayoutBodyPropTypes.ShowBacktop>,
25
+ default: () => getConfig().layoutBody.showBacktop
26
+ },
27
+ backtopConfig: Object as PropType<VxeLayoutBodyPropTypes.BacktopConfig>,
14
28
  size: {
15
29
  type: String as PropType<VxeLayoutBodyPropTypes.Size>,
16
30
  default: () => getConfig().layoutBody.size || getConfig().size
@@ -21,18 +35,25 @@ export default defineVxeComponent({
21
35
  const { slots, emit } = context
22
36
 
23
37
  const xID = XEUtils.uniqueId()
38
+ const backtopId = `vxe_layout_body_backtop_${xID}`
24
39
 
25
40
  const refElem = ref<HTMLDivElement>()
26
41
 
27
42
  const { computeSize } = useSize(props)
28
43
 
29
- const reactData = reactive<LayoutBodyReactData>({
30
- })
44
+ const internalData = createInternalData()
45
+ const reactData = reactive(createReactData())
31
46
 
32
47
  const refMaps: LayoutBodyPrivateRef = {
33
48
  refElem
34
49
  }
35
50
 
51
+ const computeBacktopOpts = computed(() => {
52
+ return Object.assign({}, getConfig().layoutBody.backtopConfig, props.backtopConfig, {
53
+ target: '#' + backtopId
54
+ })
55
+ })
56
+
36
57
  const computeMaps: VxeLayoutBodyPrivateComputed = {
37
58
  computeSize
38
59
  }
@@ -41,6 +62,7 @@ export default defineVxeComponent({
41
62
  xID,
42
63
  props,
43
64
  context,
65
+ internalData,
44
66
  reactData,
45
67
 
46
68
  getRefMaps: () => refMaps,
@@ -61,10 +83,11 @@ export default defineVxeComponent({
61
83
  Object.assign($xeLayoutBody, layoutBodyMethods, layoutBodyPrivateMethods)
62
84
 
63
85
  const renderVN = () => {
64
- const { loading, padding } = props
86
+ const { loading, padding, showBacktop } = props
87
+ const backtopOpts = computeBacktopOpts.value
65
88
  const vSize = computeSize.value
66
89
  const defaultSlot = slots.default
67
-
90
+ const backtopSlot = slots.backtop
68
91
  return h('div', {
69
92
  ref: refElem,
70
93
  class: ['vxe-layout-body', {
@@ -74,6 +97,7 @@ export default defineVxeComponent({
74
97
  }]
75
98
  }, [
76
99
  h('div', {
100
+ id: showBacktop ? backtopId : '',
77
101
  class: 'vxe-layout-body--inner'
78
102
  }, defaultSlot ? defaultSlot({}) : []),
79
103
  /**
@@ -82,7 +106,17 @@ export default defineVxeComponent({
82
106
  h(VxeLoadingComponent, {
83
107
  class: 'vxe-list-view--loading',
84
108
  modelValue: loading
85
- })
109
+ }),
110
+ /**
111
+ * 回到顶部
112
+ */
113
+ showBacktop
114
+ ? h(VxeUIBacktopComponent, backtopOpts, backtopSlot
115
+ ? {
116
+ default: backtopSlot
117
+ }
118
+ : undefined)
119
+ : renderEmptyElement($xeLayoutBody)
86
120
  ])
87
121
  }
88
122
 
@@ -0,0 +1,16 @@
1
+ import { App } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import VxeMentionComponent from './src/mention'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxeMention = Object.assign({}, VxeMentionComponent, {
7
+ install (app: App) {
8
+ app.component(VxeMentionComponent.name as string, VxeMentionComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxeMention)
13
+ VxeUI.component(VxeMentionComponent)
14
+
15
+ export const Mention = VxeMention
16
+ export default VxeMention
@@ -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 { MentionReactData, VxeMentionPropTypes, MentionPrivateRef, VxeMentionEmits, VxeMentionPrivateComputed, MentionMethods, MentionPrivateMethods, VxeMentionConstructor, VxeMentionPrivateMethods, ValueOf } from '../../../types'
7
+
8
+ export default defineVxeComponent({
9
+ name: 'VxeMention',
10
+ props: {
11
+ size: {
12
+ type: String as PropType<VxeMentionPropTypes.Size>,
13
+ default: () => getConfig().mention.size || getConfig().size
14
+ }
15
+ },
16
+ emits: [
17
+ ] as VxeMentionEmits,
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<MentionReactData>({})
26
+
27
+ const refMaps: MentionPrivateRef = {
28
+ refElem
29
+ }
30
+
31
+ const computeMaps: VxeMentionPrivateComputed = {
32
+ }
33
+
34
+ const $xeMention = {
35
+ xID,
36
+ props,
37
+ context,
38
+ reactData,
39
+
40
+ getRefMaps: () => refMaps,
41
+ getComputeMaps: () => computeMaps
42
+ } as unknown as VxeMentionConstructor & VxeMentionPrivateMethods
43
+
44
+ const dispatchEvent = (type: ValueOf<VxeMentionEmits>, params: Record<string, any>, evnt: Event | null) => {
45
+ emit(type, createEvent(evnt, { $mention: $xeMention }, params))
46
+ }
47
+
48
+ const tagMethods: MentionMethods = {
49
+ dispatchEvent
50
+ }
51
+
52
+ const tagPrivateMethods: MentionPrivateMethods = {
53
+ }
54
+
55
+ Object.assign($xeMention, tagMethods, tagPrivateMethods)
56
+
57
+ const renderVN = () => {
58
+ return h('div', {
59
+ ref: refElem,
60
+ class: 'vxe-mention'
61
+ })
62
+ }
63
+
64
+ $xeMention.renderVN = renderVN
65
+
66
+ return $xeMention
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 VxeSegmentedComponent from './src/segmented'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxeSegmented = Object.assign({}, VxeSegmentedComponent, {
7
+ install (app: App) {
8
+ app.component(VxeSegmentedComponent.name as string, VxeSegmentedComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxeSegmented)
13
+ VxeUI.component(VxeSegmentedComponent)
14
+
15
+ export const Segmented = VxeSegmented
16
+ export default VxeSegmented
@@ -0,0 +1,264 @@
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, renderEmptyElement } 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 { icon, width } = item
172
+ const itemWidth = width || optionOpts.width
173
+ itemVNs.push(
174
+ h('label', {
175
+ key: i,
176
+ class: ['vxe-segmented--item', {
177
+ 'is--checked': modelValue === item.value
178
+ }],
179
+ style: isFullWidth || itemWidth
180
+ ? {
181
+ width: itemWidth ? toCssUnit(itemWidth) : (fullItemWidth ? `${fullItemWidth}%` : '')
182
+ }
183
+ : undefined
184
+ }, [
185
+ h('input', {
186
+ class: 'vxe-segmented--input',
187
+ type: 'radio',
188
+ name: name || groupName,
189
+ onChange (evnt) {
190
+ changeEvent(evnt, item)
191
+ }
192
+ }),
193
+ h('div', {
194
+ class: 'vxe-segmented--content'
195
+ }, [
196
+ icon
197
+ ? h('div', {
198
+ class: 'vxe-segmented--icon'
199
+ }, [
200
+ h('i', {
201
+ class: icon
202
+ })
203
+ ])
204
+ : renderEmptyElement($xeSegmented),
205
+ h('div', {
206
+ class: 'vxe-segmented--label'
207
+ }, defaultSlot ? defaultSlot({ option: item }) : XEUtils.eqNull(item.label) ? '' : `${item.label}`)
208
+ ])
209
+ ])
210
+ )
211
+ })
212
+ return itemVNs
213
+ }
214
+
215
+ const renderVN = () => {
216
+ const { status } = props
217
+ const { selectStyle } = reactData
218
+ const itemType = computeItemType.value
219
+ const wrapperStyle = computeWrapperStyle.value
220
+ const vSize = computeSize.value
221
+ return h('div', {
222
+ ref: refElem,
223
+ class: ['vxe-segmented', `type--${itemType}`, {
224
+ [`size--${vSize}`]: vSize,
225
+ [`theme--${status}`]: status
226
+ }]
227
+ }, [
228
+ h('div', {
229
+ class: 'vxe-segmented--group',
230
+ style: wrapperStyle
231
+ }, [
232
+ h('div', {
233
+ ref: refSelectedElem,
234
+ class: 'vxe-segmented--selected',
235
+ style: selectStyle
236
+ }),
237
+ h('div', {
238
+ ref: refWrapperElem,
239
+ class: 'vxe-segmented--inner'
240
+ }, renderItems())
241
+ ])
242
+ ])
243
+ }
244
+
245
+ watch(computeSelectIndex, () => {
246
+ updateStyle()
247
+ })
248
+
249
+ onMounted(() => {
250
+ updateStyle()
251
+ })
252
+
253
+ onBeforeUnmount(() => {
254
+ XEUtils.assign(reactData, createReactData())
255
+ })
256
+
257
+ $xeSegmented.renderVN = renderVN
258
+
259
+ return $xeSegmented
260
+ },
261
+ render () {
262
+ return this.renderVN()
263
+ }
264
+ })
@@ -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
+ })