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
@@ -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'
@@ -461,11 +461,12 @@ export default defineVxeComponent({
461
461
  reactData.startValue = sValue
462
462
  reactData.endValue = eValue
463
463
  const value = getRangeValue(sValue, eValue)
464
+ const isFinish = (sValue && eValue) || (!sValue && !eValue)
464
465
  emit('update:modelValue', value)
465
466
  emit('update:startValue', sValue || '')
466
467
  emit('update:endValue', eValue || '')
467
468
  if (XEUtils.toValueString(modelValue) !== value) {
468
- dispatchEvent('change', { value }, evnt as any)
469
+ dispatchEvent('change', { value, startValue: sValue, endValue: eValue, isFinish }, evnt as any)
469
470
  // 自动更新校验状态
470
471
  if ($xeForm && formItemInfo) {
471
472
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
@@ -404,11 +404,11 @@ renderer.mixin({
404
404
  // 处理 model 值双向绑定
405
405
  XEUtils.set(data, field, value)
406
406
  },
407
- change () {
407
+ change ({ $event, isFinish }) {
408
408
  // 处理 change 事件相关逻辑
409
409
  $form.updateStatus(params)
410
- if (renderOpts.changeToSubmit) {
411
- ($form as VxeFormConstructor & VxeFormPrivateMethods).handleSubmitEvent(new Event('change'))
410
+ if (renderOpts.changeToSubmit && isFinish) {
411
+ ($form as VxeFormConstructor & VxeFormPrivateMethods).handleSubmitEvent($event)
412
412
  }
413
413
  }
414
414
  }, seOs)
@@ -43,7 +43,7 @@ export function getItemClass ($xeForm: VxeFormConstructor & VxeFormPrivateMethod
43
43
  const { folding, field, itemRender, showError, className, vertical, padding, children, showContent } = item
44
44
  const vSize = computeSize.value
45
45
  const validOpts = computeValidOpts.value
46
- const { showErrorMessage, showMessage, showErrorIcon } = validOpts
46
+ const { showErrorMessage, showMessage, showErrorBackground, showErrorIcon } = validOpts
47
47
  const compConf = isEnableConf(itemRender) ? renderer.get(itemRender.name) : null
48
48
  const itemClassName = compConf ? (compConf.formItemClassName || compConf.itemClassName) : ''
49
49
  const span = item.span || allSpan
@@ -64,12 +64,13 @@ export function getItemClass ($xeForm: VxeFormConstructor & VxeFormPrivateMethod
64
64
  isRequired = itemRules.some((rule) => rule.required)
65
65
  }
66
66
  }
67
+ const showErrMsg = XEUtils.isBoolean(showErrorMessage) ? showErrorMessage : showMessage
67
68
  return [
68
69
  isGroup || hasGroup ? 'vxe-form--group' : '',
69
70
  'vxe-form--item',
70
71
  item.id,
71
72
  span ? `vxe-form--item-col_${span} is--span` : '',
72
- `${(XEUtils.isBoolean(showErrorMessage) ? showErrorMessage : showMessage) ? 'show' : 'hide'}--err-msg`,
73
+ `${showErrMsg ? 'show' : 'hide'}--err-msg`,
73
74
  className ? (XEUtils.isFunction(className) ? className(params) : className) : '',
74
75
  itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) : itemClassName) : '',
75
76
  {
@@ -86,6 +87,7 @@ export function getItemClass ($xeForm: VxeFormConstructor & VxeFormPrivateMethod
86
87
  'is--hidden': folding && collapseAll,
87
88
  'is--active': isActiveItem($xeForm, item),
88
89
  'err--icon': showErrorIcon,
90
+ 'err--bg': showErrorBackground,
89
91
  'is--error': showError
90
92
  }
91
93
  ]
@@ -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
+ })
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils'
4
4
  import { getFuncText } from '../../ui/src/utils'
5
5
  import { getConfig, createEvent, useSize } from '../../ui'
6
6
 
7
- import type { VxeRadioButtonPropTypes, VxeRadioGroupConstructor, RadioButtonReactData, RadioButtonPrivateMethods, VxeRadioButtonConstructor, VxeRadioButtonEmits, VxeRadioGroupPrivateMethods, RadioButtonMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
7
+ import type { VxeRadioButtonPropTypes, VxeRadioGroupConstructor, RadioButtonReactData, RadioButtonPrivateMethods, VxeRadioButtonConstructor, VxeRadioButtonEmits, VxeRadioGroupPrivateMethods, RadioButtonMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf } from '../../../types'
8
8
 
9
9
  export default defineVxeComponent({
10
10
  name: 'VxeRadioButton',
@@ -87,10 +87,12 @@ export default defineVxeComponent({
87
87
  return $xeRadioGroup ? $xeRadioGroup.props.modelValue === radioValue : props.modelValue === radioValue
88
88
  })
89
89
 
90
+ const dispatchEvent = (type: ValueOf<VxeRadioButtonEmits>, params: Record<string, any>, evnt: Event | null) => {
91
+ emit(type, createEvent(evnt, { $radioGroup: $xeRadioGroup }, params))
92
+ }
93
+
90
94
  const radioButtonMethods: RadioButtonMethods = {
91
- dispatchEvent (type, params, evnt) {
92
- emit(type, createEvent(evnt, { $radioButton: $xeRadioButton }, params))
93
- }
95
+ dispatchEvent
94
96
  }
95
97
 
96
98
  const radioButtonPrivateMethods: RadioButtonPrivateMethods = {
@@ -99,11 +101,12 @@ export default defineVxeComponent({
99
101
  Object.assign($xeRadioButton, radioButtonMethods, radioButtonPrivateMethods)
100
102
 
101
103
  const handleValue = (checkedValue: VxeRadioButtonPropTypes.CheckedValue, evnt: Event) => {
104
+ const { content } = props
102
105
  if ($xeRadioGroup) {
103
- $xeRadioGroup.handleChecked({ label: checkedValue, checkedValue }, evnt)
106
+ $xeRadioGroup.handleChecked({ label: checkedValue, checkedValue, checkedLabel: content }, evnt)
104
107
  } else {
105
108
  emit('update:modelValue', checkedValue)
106
- radioButtonMethods.dispatchEvent('change', { value: checkedValue, label: checkedValue }, evnt)
109
+ dispatchEvent('change', { value: checkedValue, label: checkedValue, checkedValue, checkedLabel: content }, evnt)
107
110
  // 自动更新校验状态
108
111
  if ($xeForm && formItemInfo) {
109
112
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, checkedValue)
@@ -121,9 +121,10 @@ export default defineVxeComponent({
121
121
 
122
122
  const radioGroupPrivateMethods: RadioGroupPrivateMethods = {
123
123
  handleChecked (params, evnt) {
124
- const value = params.checkedValue
124
+ const { checkedValue, checkedLabel } = params
125
+ const value = checkedValue
125
126
  emitModel(value)
126
- dispatchEvent('change', { value, label: value, checkedValue: value }, evnt)
127
+ dispatchEvent('change', { value, label: value, checkedValue, checkedLabel }, evnt)
127
128
  // 自动更新校验状态
128
129
  if ($xeForm && formItemInfo) {
129
130
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
@@ -89,11 +89,12 @@ export default defineVxeComponent({
89
89
  })
90
90
 
91
91
  const handleValue = (checkedValue: VxeRadioPropTypes.CheckedValue, evnt: Event) => {
92
+ const { content } = props
92
93
  if ($xeRadioGroup) {
93
- $xeRadioGroup.handleChecked({ label: checkedValue, checkedValue }, evnt)
94
+ $xeRadioGroup.handleChecked({ label: checkedValue, checkedValue, checkedLabel: content }, evnt)
94
95
  } else {
95
96
  emit('update:modelValue', checkedValue)
96
- dispatchEvent('change', { value: checkedValue, label: checkedValue, checkedValue }, evnt)
97
+ dispatchEvent('change', { value: checkedValue, label: checkedValue, checkedValue, checkedLabel: content }, evnt)
97
98
  // 自动更新校验状态
98
99
  if ($xeForm && formItemInfo) {
99
100
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, checkedValue)
@@ -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