@element-plus/nightly 0.0.20260719 → 0.0.20260721

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 (592) hide show
  1. package/es/components/affix/src/affix.vue.d.ts +3 -3
  2. package/es/components/alert/src/alert.d.ts +1 -1
  3. package/es/components/alert/src/alert.vue.d.ts +1 -1
  4. package/es/components/anchor/src/anchor.vue.d.ts +1 -1
  5. package/es/components/autocomplete/src/autocomplete.d.ts +5 -106
  6. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  7. package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
  8. package/es/components/autocomplete/src/autocomplete.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  9. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  10. package/es/components/avatar/src/avatar-group-props.d.ts +8 -105
  11. package/es/components/avatar/src/avatar-group-props.mjs +9 -1
  12. package/es/components/avatar/src/avatar-group-props.mjs.map +1 -1
  13. package/es/components/avatar/src/avatar-group.d.ts +17 -210
  14. package/es/components/avatar/src/avatar.d.ts +2 -2
  15. package/es/components/badge/src/badge.d.ts +4 -8
  16. package/es/components/badge/src/badge.mjs +9 -1
  17. package/es/components/badge/src/badge.mjs.map +1 -1
  18. package/es/components/badge/src/badge.vue.d.ts +3 -1
  19. package/es/components/badge/src/badge.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  20. package/es/components/badge/src/badge2.mjs.map +1 -1
  21. package/es/components/button/src/button-group.d.ts +2 -2
  22. package/es/components/button/src/button-group.vue.d.ts +1 -1
  23. package/es/components/button/src/button.d.ts +2 -2
  24. package/es/components/button/src/button.vue.d.ts +4 -4
  25. package/es/components/button/src/use-button.d.ts +2 -2
  26. package/es/components/calendar/src/calendar.mjs.map +1 -1
  27. package/es/components/card/src/card.d.ts +7 -6
  28. package/es/components/card/src/card.mjs +27 -3
  29. package/es/components/card/src/card.mjs.map +1 -1
  30. package/es/components/card/src/card.vue.d.ts +4 -0
  31. package/es/components/card/src/card.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  32. package/es/components/card/src/card2.mjs.map +1 -1
  33. package/es/components/carousel/src/carousel-item.vue.d.ts +1 -1
  34. package/es/components/carousel/src/carousel.vue.d.ts +1 -1
  35. package/es/components/cascader/src/cascader.d.ts +5 -106
  36. package/es/components/cascader/src/cascader.mjs.map +1 -1
  37. package/es/components/cascader/src/cascader.vue.d.ts +18 -16
  38. package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  39. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  40. package/es/components/cascader-panel/src/index.vue.d.ts +5 -5
  41. package/es/components/cascader-panel/src/menu.vue.d.ts +1 -1
  42. package/es/components/check-tag/src/check-tag.d.ts +1 -1
  43. package/es/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
  44. package/es/components/checkbox/src/checkbox-group.d.ts +1 -1
  45. package/es/components/checkbox/src/checkbox-group.vue.d.ts +5 -5
  46. package/es/components/checkbox/src/checkbox.d.ts +3 -3
  47. package/es/components/checkbox/src/checkbox.vue.d.ts +5 -5
  48. package/es/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
  49. package/es/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
  50. package/es/components/col/src/col.vue.d.ts +2 -2
  51. package/es/components/collapse/src/collapse.vue.d.ts +2 -2
  52. package/es/components/color-picker/src/color-picker.d.ts +5 -104
  53. package/es/components/color-picker/src/color-picker.mjs +1 -0
  54. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  55. package/es/components/color-picker/src/color-picker.vue.d.ts +12 -10
  56. package/es/components/color-picker-panel/src/color-picker-panel.d.ts +4 -10
  57. package/es/components/color-picker-panel/src/color-picker-panel.mjs +9 -5
  58. package/es/components/color-picker-panel/src/color-picker-panel.mjs.map +1 -1
  59. package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +5 -2
  60. package/es/components/color-picker-panel/src/color-picker-panel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  61. package/es/components/color-picker-panel/src/color-picker-panel2.mjs.map +1 -1
  62. package/es/components/config-provider/src/config-provider-props.d.ts +1 -1
  63. package/es/components/config-provider/src/config-provider.d.ts +3 -3
  64. package/es/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
  65. package/es/components/countdown/src/countdown.vue.d.ts +1 -1
  66. package/es/components/date-picker/src/date-picker.d.ts +12 -212
  67. package/es/components/date-picker/src/props.d.ts +4 -104
  68. package/es/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
  69. package/es/components/date-picker-panel/src/date-picker-com/basic-month-table.vue.d.ts +2 -2
  70. package/es/components/date-picker-panel/src/date-picker-com/basic-year-table.vue.d.ts +2 -2
  71. package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +5 -5
  72. package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +6 -6
  73. package/es/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +2 -2
  74. package/es/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +2 -2
  75. package/es/components/date-picker-panel/src/date-picker-panel.d.ts +7 -7
  76. package/es/components/date-picker-panel/src/panel-utils.d.ts +36 -36
  77. package/es/components/date-picker-panel/src/props/basic-date-table.mjs.map +1 -1
  78. package/es/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
  79. package/es/components/descriptions/src/description-item.d.ts +2 -2
  80. package/es/components/descriptions/src/description.d.ts +1 -1
  81. package/es/components/descriptions/src/description.vue.d.ts +1 -1
  82. package/es/components/dialog/src/dialog-content.d.ts +10 -6
  83. package/es/components/dialog/src/dialog-content.mjs +32 -5
  84. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  85. package/es/components/dialog/src/dialog-content.vue.d.ts +5 -1
  86. package/es/components/dialog/src/dialog.d.ts +10 -5
  87. package/es/components/dialog/src/dialog.mjs +11 -14
  88. package/es/components/dialog/src/dialog.mjs.map +1 -1
  89. package/es/components/dialog/src/dialog.vue.d.ts +11 -6
  90. package/es/components/divider/src/divider.vue.d.ts +1 -1
  91. package/es/components/drawer/src/drawer.d.ts +5 -4
  92. package/es/components/drawer/src/drawer.vue.d.ts +12 -7
  93. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -2
  94. package/es/components/dropdown/src/dropdown-item.vue.d.ts +5 -5
  95. package/es/components/dropdown/src/dropdown.d.ts +4 -105
  96. package/es/components/dropdown/src/dropdown.vue.d.ts +67 -265
  97. package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
  98. package/es/components/form/src/form-item.d.ts +2 -2
  99. package/es/components/form/src/form-item.vue.d.ts +2 -2
  100. package/es/components/form/src/form.d.ts +2 -2
  101. package/es/components/form/src/hooks/use-form-common-props.d.ts +2 -2
  102. package/es/components/image/src/image.d.ts +1 -1
  103. package/es/components/image/src/image.mjs.map +1 -1
  104. package/es/components/image/src/image.vue.d.ts +4 -4
  105. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  106. package/es/components/image-viewer/src/image-viewer.vue.d.ts +3 -3
  107. package/es/components/input/src/input.d.ts +3 -3
  108. package/es/components/input/src/input.vue.d.ts +16 -16
  109. package/es/components/input-number/src/input-number.d.ts +3 -3
  110. package/es/components/input-number/src/input-number.vue.d.ts +9 -9
  111. package/es/components/input-otp/src/input-otp.vue.d.ts +7 -7
  112. package/es/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
  113. package/es/components/input-tag/src/input-tag.d.ts +2 -2
  114. package/es/components/input-tag/src/input-tag.vue.d.ts +10 -10
  115. package/es/components/link/src/link.d.ts +1 -1
  116. package/es/components/link/src/link.mjs.map +1 -1
  117. package/es/components/mention/src/mention.d.ts +5 -106
  118. package/es/components/mention/src/mention.vue.d.ts +4 -4
  119. package/es/components/mention/src/mention.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  120. package/es/components/mention/src/mention2.mjs.map +1 -1
  121. package/es/components/menu/src/menu.d.ts +11 -23
  122. package/es/components/menu/src/menu.mjs +18 -2
  123. package/es/components/menu/src/menu.mjs.map +1 -1
  124. package/es/components/menu/src/sub-menu.d.ts +10 -22
  125. package/es/components/menu/src/sub-menu.mjs +18 -2
  126. package/es/components/menu/src/sub-menu.mjs.map +1 -1
  127. package/es/components/message/src/message.d.ts +4 -4
  128. package/es/components/message/src/message.mjs +6 -1
  129. package/es/components/message/src/message.mjs.map +1 -1
  130. package/es/components/message/src/message.vue.d.ts +6 -5
  131. package/es/components/message/src/method.mjs.map +1 -1
  132. package/es/components/message-box/src/index.vue.d.ts +66 -74
  133. package/es/components/notification/src/notification.d.ts +4 -3
  134. package/es/components/notification/src/notification.mjs +6 -1
  135. package/es/components/notification/src/notification.mjs.map +1 -1
  136. package/es/components/notification/src/notification.vue.d.ts +6 -5
  137. package/es/components/overlay/index.d.ts +4 -12
  138. package/es/components/overlay/src/overlay.d.ts +5 -18
  139. package/es/components/overlay/src/overlay.mjs +9 -5
  140. package/es/components/overlay/src/overlay.mjs.map +1 -1
  141. package/es/components/pagination/src/components/jumper.d.ts +1 -1
  142. package/es/components/pagination/src/components/jumper.vue.d.ts +2 -2
  143. package/es/components/pagination/src/components/sizes.d.ts +5 -14
  144. package/es/components/pagination/src/components/sizes.mjs +18 -2
  145. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  146. package/es/components/pagination/src/components/sizes.vue.d.ts +9 -26
  147. package/es/components/pagination/src/pagination.d.ts +15 -28
  148. package/es/components/pagination/src/pagination.mjs +15 -2
  149. package/es/components/pagination/src/pagination.mjs.map +1 -1
  150. package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
  151. package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
  152. package/es/components/popover/src/popover.d.ts +4 -104
  153. package/es/components/popover/src/popover.mjs +1 -0
  154. package/es/components/popover/src/popover.mjs.map +1 -1
  155. package/es/components/popover/src/popover.vue.d.ts +8 -7
  156. package/es/components/popper/src/composables/use-content-dom.d.ts +2 -25
  157. package/es/components/popper/src/composables/use-focus-trap.d.ts +1 -1
  158. package/es/components/popper/src/content.d.ts +12 -22
  159. package/es/components/popper/src/content.mjs +13 -7
  160. package/es/components/popper/src/content.mjs.map +1 -1
  161. package/es/components/popper/src/content.vue.d.ts +11 -9
  162. package/es/components/popper/src/popper.mjs.map +1 -1
  163. package/es/components/progress/src/progress.d.ts +1 -1
  164. package/es/components/progress/src/progress.vue.d.ts +1 -1
  165. package/es/components/radio/src/radio-button.d.ts +1 -1
  166. package/es/components/radio/src/radio-button.vue.d.ts +2 -2
  167. package/es/components/radio/src/radio-group.d.ts +1 -1
  168. package/es/components/radio/src/radio-group.vue.d.ts +7 -7
  169. package/es/components/radio/src/radio.d.ts +2 -2
  170. package/es/components/radio/src/radio.vue.d.ts +5 -5
  171. package/es/components/radio/src/use-radio.d.ts +1 -1
  172. package/es/components/rate/src/rate.d.ts +1 -1
  173. package/es/components/rate/src/rate.vue.d.ts +4 -4
  174. package/es/components/rate/src/rate.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  175. package/es/components/rate/src/rate2.mjs.map +1 -1
  176. package/es/components/result/src/result.d.ts +1 -1
  177. package/es/components/scrollbar/src/scrollbar.d.ts +5 -4
  178. package/es/components/scrollbar/src/scrollbar.mjs +12 -2
  179. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  180. package/es/components/scrollbar/src/scrollbar.vue.d.ts +5 -4
  181. package/es/components/scrollbar/src/thumb.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  182. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  183. package/es/components/segmented/index.d.ts +4 -4
  184. package/es/components/segmented/src/segmented.d.ts +1 -1
  185. package/es/components/segmented/src/segmented.vue.d.ts +2 -2
  186. package/es/components/select/src/option.d.ts +1 -1
  187. package/es/components/select/src/option.vue.d.ts +2 -2
  188. package/es/components/select/src/select-dropdown.vue.d.ts +2 -1
  189. package/es/components/select/src/select.d.ts +9 -13
  190. package/es/components/select/src/select.mjs +15 -2
  191. package/es/components/select/src/select.mjs.map +1 -1
  192. package/es/components/select/src/select.vue.d.ts +77 -83
  193. package/es/components/select/src/select.vue_vue_type_script_lang.mjs.map +1 -1
  194. package/es/components/select/src/select2.mjs.map +1 -1
  195. package/es/components/select/src/useSelect.d.ts +7 -7
  196. package/es/components/select/src/useSelect.mjs.map +1 -1
  197. package/es/components/select-v2/src/defaults.d.ts +4 -104
  198. package/es/components/select-v2/src/select.vue.d.ts +54 -252
  199. package/es/components/select-v2/src/useSelect.d.ts +2 -2
  200. package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
  201. package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
  202. package/es/components/slider/src/button.d.ts +2 -1
  203. package/es/components/slider/src/button.mjs +10 -2
  204. package/es/components/slider/src/button.mjs.map +1 -1
  205. package/es/components/slider/src/button.vue.d.ts +5 -3
  206. package/es/components/slider/src/composables/use-marks.mjs.map +1 -1
  207. package/es/components/slider/src/slider.d.ts +4 -4
  208. package/es/components/slider/src/slider.mjs +6 -1
  209. package/es/components/slider/src/slider.mjs.map +1 -1
  210. package/es/components/slider/src/slider.vue.d.ts +16 -16
  211. package/es/components/space/src/space.d.ts +9 -9
  212. package/es/components/space/src/space.mjs +2 -1
  213. package/es/components/space/src/space.mjs.map +1 -1
  214. package/es/components/space/src/use-space.d.ts +2 -3
  215. package/es/components/splitter/src/split-bar.vue.d.ts +1 -1
  216. package/es/components/splitter/src/splitter.vue.d.ts +2 -2
  217. package/es/components/statistic/src/statistic.vue.d.ts +2 -2
  218. package/es/components/steps/src/item.d.ts +1 -1
  219. package/es/components/steps/src/steps.d.ts +2 -2
  220. package/es/components/steps/src/steps.vue.d.ts +1 -1
  221. package/es/components/switch/src/switch.d.ts +1 -1
  222. package/es/components/switch/src/switch.vue.d.ts +5 -5
  223. package/es/components/table/src/filter-panel.vue.d.ts +63 -60
  224. package/es/components/table/src/table/defaults.d.ts +1 -1
  225. package/es/components/table/src/table/defaults.mjs.map +1 -1
  226. package/es/components/table/src/table/style-helper.d.ts +2 -2
  227. package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
  228. package/es/components/table/src/table-footer/index.d.ts +1 -1
  229. package/es/components/table/src/table-header/index.d.ts +16 -16
  230. package/es/components/table/src/table.vue.d.ts +4 -4
  231. package/es/components/table-v2/src/components/row.d.ts +1 -1
  232. package/es/components/table-v2/src/table-grid.d.ts +2 -2
  233. package/es/components/table-v2/src/table-v2.d.ts +4 -4
  234. package/es/components/tabs/src/tab-nav.d.ts +1 -1
  235. package/es/components/tabs/src/tabs.d.ts +2 -2
  236. package/es/components/tag/src/tag.d.ts +2 -2
  237. package/es/components/tag/src/tag.vue.d.ts +2 -2
  238. package/es/components/text/src/text.d.ts +2 -2
  239. package/es/components/text/src/text.vue.d.ts +1 -1
  240. package/es/components/time-picker/src/common/picker-range-trigger.vue.d.ts +6 -6
  241. package/es/components/time-picker/src/common/picker.vue.d.ts +18 -218
  242. package/es/components/time-picker/src/common/props.d.ts +4 -104
  243. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
  244. package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
  245. package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
  246. package/es/components/time-picker/src/time-picker.d.ts +12 -212
  247. package/es/components/time-picker/src/utils.d.ts +1 -1
  248. package/es/components/time-select/src/time-select.d.ts +7 -11
  249. package/es/components/time-select/src/time-select.mjs +15 -2
  250. package/es/components/time-select/src/time-select.mjs.map +1 -1
  251. package/es/components/time-select/src/time-select.vue.d.ts +13 -12
  252. package/es/components/timeline/src/timeline-item.d.ts +2 -2
  253. package/es/components/timeline/src/timeline-item.vue.d.ts +2 -2
  254. package/es/components/tooltip/src/content.d.ts +5 -200
  255. package/es/components/tooltip/src/content.vue.d.ts +6 -4
  256. package/es/components/tooltip/src/tooltip.d.ts +5 -202
  257. package/es/components/tooltip/src/tooltip.vue.d.ts +8 -7
  258. package/es/components/tooltip/src/trigger.d.ts +1 -1
  259. package/es/components/tour/src/content.d.ts +1 -1
  260. package/es/components/tour/src/step.vue.d.ts +1 -1
  261. package/es/components/tour/src/tour.vue.d.ts +6 -6
  262. package/es/components/transfer/src/transfer.vue.d.ts +2 -2
  263. package/es/components/tree/src/tree-node.vue.d.ts +16 -16
  264. package/es/components/tree/src/tree.vue.d.ts +22 -22
  265. package/es/components/tree-select/src/select.mjs +1 -5
  266. package/es/components/tree-select/src/select.mjs.map +1 -1
  267. package/es/components/tree-select/src/tree-select-option.d.ts +2 -2
  268. package/es/components/tree-select/src/tree-select.vue.d.ts +32 -40
  269. package/es/components/tree-v2/src/composables/useTree.d.ts +15 -14
  270. package/es/components/tree-v2/src/tree-node.vue.d.ts +2 -2
  271. package/es/components/tree-v2/src/tree.vue.d.ts +5 -5
  272. package/es/components/upload/src/upload-content.vue.d.ts +2 -2
  273. package/es/components/upload/src/upload.mjs.map +1 -1
  274. package/es/components/upload/src/upload.vue.d.ts +3 -3
  275. package/es/components/virtual-list/src/builders/build-grid.d.ts +9 -8
  276. package/es/components/virtual-list/src/builders/build-list.d.ts +8 -7
  277. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +9 -8
  278. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +8 -7
  279. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +9 -8
  280. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +8 -7
  281. package/es/components/virtual-list/src/components/scrollbar.d.ts +5 -3
  282. package/es/components/virtual-list/src/props.d.ts +5 -4
  283. package/es/components/virtual-list/src/props.mjs +15 -2
  284. package/es/components/virtual-list/src/props.mjs.map +1 -1
  285. package/es/components/watermark/src/watermark.mjs.map +1 -1
  286. package/es/hooks/use-size/index.d.ts +3 -3
  287. package/es/hooks/use-throttle-render/index.mjs.map +1 -1
  288. package/es/utils/index.d.ts +2 -2
  289. package/es/utils/typescript.d.ts +2 -1
  290. package/es/utils/typescript.mjs.map +1 -1
  291. package/es/utils/vue/size.d.ts +1 -1
  292. package/es/utils/vue/vnode.d.ts +4 -4
  293. package/es/version.d.ts +1 -1
  294. package/es/version.mjs +1 -1
  295. package/es/version.mjs.map +1 -1
  296. package/lib/components/affix/src/affix.vue.d.ts +3 -3
  297. package/lib/components/alert/src/alert.d.ts +1 -1
  298. package/lib/components/alert/src/alert.vue.d.ts +1 -1
  299. package/lib/components/anchor/src/anchor.vue.d.ts +1 -1
  300. package/lib/components/autocomplete/src/autocomplete.d.ts +5 -106
  301. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  302. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
  303. package/lib/components/autocomplete/src/autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  304. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  305. package/lib/components/avatar/src/avatar-group-props.d.ts +8 -105
  306. package/lib/components/avatar/src/avatar-group-props.js +9 -1
  307. package/lib/components/avatar/src/avatar-group-props.js.map +1 -1
  308. package/lib/components/avatar/src/avatar-group.d.ts +17 -210
  309. package/lib/components/avatar/src/avatar.d.ts +2 -2
  310. package/lib/components/badge/src/badge.d.ts +4 -8
  311. package/lib/components/badge/src/badge.js +9 -1
  312. package/lib/components/badge/src/badge.js.map +1 -1
  313. package/lib/components/badge/src/badge.vue.d.ts +3 -1
  314. package/lib/components/badge/src/badge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/lib/components/badge/src/badge2.js.map +1 -1
  316. package/lib/components/button/src/button-group.d.ts +2 -2
  317. package/lib/components/button/src/button-group.vue.d.ts +1 -1
  318. package/lib/components/button/src/button.d.ts +2 -2
  319. package/lib/components/button/src/button.vue.d.ts +4 -4
  320. package/lib/components/button/src/use-button.d.ts +2 -2
  321. package/lib/components/calendar/src/calendar.js.map +1 -1
  322. package/lib/components/card/src/card.d.ts +7 -6
  323. package/lib/components/card/src/card.js +27 -3
  324. package/lib/components/card/src/card.js.map +1 -1
  325. package/lib/components/card/src/card.vue.d.ts +4 -0
  326. package/lib/components/card/src/card.vue_vue_type_script_setup_true_lang.js.map +1 -1
  327. package/lib/components/card/src/card2.js.map +1 -1
  328. package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -1
  329. package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
  330. package/lib/components/cascader/src/cascader.d.ts +5 -106
  331. package/lib/components/cascader/src/cascader.js.map +1 -1
  332. package/lib/components/cascader/src/cascader.vue.d.ts +18 -16
  333. package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  334. package/lib/components/cascader/src/cascader2.js.map +1 -1
  335. package/lib/components/cascader-panel/src/index.vue.d.ts +5 -5
  336. package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -1
  337. package/lib/components/check-tag/src/check-tag.d.ts +1 -1
  338. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
  339. package/lib/components/checkbox/src/checkbox-group.d.ts +1 -1
  340. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +5 -5
  341. package/lib/components/checkbox/src/checkbox.d.ts +3 -3
  342. package/lib/components/checkbox/src/checkbox.vue.d.ts +5 -5
  343. package/lib/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
  344. package/lib/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
  345. package/lib/components/col/src/col.vue.d.ts +2 -2
  346. package/lib/components/collapse/src/collapse.vue.d.ts +2 -2
  347. package/lib/components/color-picker/src/color-picker.d.ts +5 -104
  348. package/lib/components/color-picker/src/color-picker.js +1 -0
  349. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  350. package/lib/components/color-picker/src/color-picker.vue.d.ts +12 -10
  351. package/lib/components/color-picker-panel/src/color-picker-panel.d.ts +4 -10
  352. package/lib/components/color-picker-panel/src/color-picker-panel.js +9 -5
  353. package/lib/components/color-picker-panel/src/color-picker-panel.js.map +1 -1
  354. package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +5 -2
  355. package/lib/components/color-picker-panel/src/color-picker-panel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  356. package/lib/components/color-picker-panel/src/color-picker-panel2.js.map +1 -1
  357. package/lib/components/config-provider/src/config-provider-props.d.ts +1 -1
  358. package/lib/components/config-provider/src/config-provider.d.ts +3 -3
  359. package/lib/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
  360. package/lib/components/countdown/src/countdown.vue.d.ts +1 -1
  361. package/lib/components/date-picker/src/date-picker.d.ts +12 -212
  362. package/lib/components/date-picker/src/props.d.ts +4 -104
  363. package/lib/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
  364. package/lib/components/date-picker-panel/src/date-picker-com/basic-month-table.vue.d.ts +2 -2
  365. package/lib/components/date-picker-panel/src/date-picker-com/basic-year-table.vue.d.ts +2 -2
  366. package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +5 -5
  367. package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +6 -6
  368. package/lib/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +2 -2
  369. package/lib/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +2 -2
  370. package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +7 -7
  371. package/lib/components/date-picker-panel/src/panel-utils.d.ts +36 -36
  372. package/lib/components/date-picker-panel/src/props/basic-date-table.js.map +1 -1
  373. package/lib/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
  374. package/lib/components/descriptions/src/description-item.d.ts +2 -2
  375. package/lib/components/descriptions/src/description.d.ts +1 -1
  376. package/lib/components/descriptions/src/description.vue.d.ts +1 -1
  377. package/lib/components/dialog/src/dialog-content.d.ts +10 -6
  378. package/lib/components/dialog/src/dialog-content.js +31 -4
  379. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  380. package/lib/components/dialog/src/dialog-content.vue.d.ts +5 -1
  381. package/lib/components/dialog/src/dialog.d.ts +10 -5
  382. package/lib/components/dialog/src/dialog.js +11 -14
  383. package/lib/components/dialog/src/dialog.js.map +1 -1
  384. package/lib/components/dialog/src/dialog.vue.d.ts +11 -6
  385. package/lib/components/divider/src/divider.vue.d.ts +1 -1
  386. package/lib/components/drawer/src/drawer.d.ts +5 -4
  387. package/lib/components/drawer/src/drawer.vue.d.ts +12 -7
  388. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -2
  389. package/lib/components/dropdown/src/dropdown-item.vue.d.ts +5 -5
  390. package/lib/components/dropdown/src/dropdown.d.ts +4 -105
  391. package/lib/components/dropdown/src/dropdown.vue.d.ts +67 -265
  392. package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
  393. package/lib/components/form/src/form-item.d.ts +2 -2
  394. package/lib/components/form/src/form-item.vue.d.ts +2 -2
  395. package/lib/components/form/src/form.d.ts +2 -2
  396. package/lib/components/form/src/hooks/use-form-common-props.d.ts +2 -2
  397. package/lib/components/image/src/image.d.ts +1 -1
  398. package/lib/components/image/src/image.js.map +1 -1
  399. package/lib/components/image/src/image.vue.d.ts +4 -4
  400. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  401. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +3 -3
  402. package/lib/components/input/src/input.d.ts +3 -3
  403. package/lib/components/input/src/input.vue.d.ts +16 -16
  404. package/lib/components/input-number/src/input-number.d.ts +3 -3
  405. package/lib/components/input-number/src/input-number.vue.d.ts +9 -9
  406. package/lib/components/input-otp/src/input-otp.vue.d.ts +7 -7
  407. package/lib/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
  408. package/lib/components/input-tag/src/input-tag.d.ts +2 -2
  409. package/lib/components/input-tag/src/input-tag.vue.d.ts +10 -10
  410. package/lib/components/link/src/link.d.ts +1 -1
  411. package/lib/components/link/src/link.js.map +1 -1
  412. package/lib/components/mention/src/mention.d.ts +5 -106
  413. package/lib/components/mention/src/mention.vue.d.ts +4 -4
  414. package/lib/components/mention/src/mention.vue_vue_type_script_setup_true_lang.js.map +1 -1
  415. package/lib/components/mention/src/mention2.js.map +1 -1
  416. package/lib/components/menu/src/menu.d.ts +11 -23
  417. package/lib/components/menu/src/menu.js +18 -2
  418. package/lib/components/menu/src/menu.js.map +1 -1
  419. package/lib/components/menu/src/sub-menu.d.ts +10 -22
  420. package/lib/components/menu/src/sub-menu.js +18 -2
  421. package/lib/components/menu/src/sub-menu.js.map +1 -1
  422. package/lib/components/message/src/message.d.ts +4 -4
  423. package/lib/components/message/src/message.js +6 -1
  424. package/lib/components/message/src/message.js.map +1 -1
  425. package/lib/components/message/src/message.vue.d.ts +6 -5
  426. package/lib/components/message/src/method.js.map +1 -1
  427. package/lib/components/message-box/src/index.vue.d.ts +66 -74
  428. package/lib/components/notification/src/notification.d.ts +4 -3
  429. package/lib/components/notification/src/notification.js +6 -1
  430. package/lib/components/notification/src/notification.js.map +1 -1
  431. package/lib/components/notification/src/notification.vue.d.ts +6 -5
  432. package/lib/components/overlay/index.d.ts +4 -12
  433. package/lib/components/overlay/src/overlay.d.ts +5 -18
  434. package/lib/components/overlay/src/overlay.js +9 -5
  435. package/lib/components/overlay/src/overlay.js.map +1 -1
  436. package/lib/components/pagination/src/components/jumper.d.ts +1 -1
  437. package/lib/components/pagination/src/components/jumper.vue.d.ts +2 -2
  438. package/lib/components/pagination/src/components/sizes.d.ts +5 -14
  439. package/lib/components/pagination/src/components/sizes.js +18 -2
  440. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  441. package/lib/components/pagination/src/components/sizes.vue.d.ts +9 -26
  442. package/lib/components/pagination/src/pagination.d.ts +15 -28
  443. package/lib/components/pagination/src/pagination.js +15 -2
  444. package/lib/components/pagination/src/pagination.js.map +1 -1
  445. package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
  446. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
  447. package/lib/components/popover/src/popover.d.ts +4 -104
  448. package/lib/components/popover/src/popover.js +1 -0
  449. package/lib/components/popover/src/popover.js.map +1 -1
  450. package/lib/components/popover/src/popover.vue.d.ts +8 -7
  451. package/lib/components/popper/src/composables/use-content-dom.d.ts +2 -25
  452. package/lib/components/popper/src/composables/use-focus-trap.d.ts +1 -1
  453. package/lib/components/popper/src/content.d.ts +12 -22
  454. package/lib/components/popper/src/content.js +13 -7
  455. package/lib/components/popper/src/content.js.map +1 -1
  456. package/lib/components/popper/src/content.vue.d.ts +11 -9
  457. package/lib/components/popper/src/popper.js.map +1 -1
  458. package/lib/components/progress/src/progress.d.ts +1 -1
  459. package/lib/components/progress/src/progress.vue.d.ts +1 -1
  460. package/lib/components/radio/src/radio-button.d.ts +1 -1
  461. package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
  462. package/lib/components/radio/src/radio-group.d.ts +1 -1
  463. package/lib/components/radio/src/radio-group.vue.d.ts +7 -7
  464. package/lib/components/radio/src/radio.d.ts +2 -2
  465. package/lib/components/radio/src/radio.vue.d.ts +5 -5
  466. package/lib/components/radio/src/use-radio.d.ts +1 -1
  467. package/lib/components/rate/src/rate.d.ts +1 -1
  468. package/lib/components/rate/src/rate.vue.d.ts +4 -4
  469. package/lib/components/rate/src/rate.vue_vue_type_script_setup_true_lang.js.map +1 -1
  470. package/lib/components/rate/src/rate2.js.map +1 -1
  471. package/lib/components/result/src/result.d.ts +1 -1
  472. package/lib/components/scrollbar/src/scrollbar.d.ts +5 -4
  473. package/lib/components/scrollbar/src/scrollbar.js +12 -2
  474. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  475. package/lib/components/scrollbar/src/scrollbar.vue.d.ts +5 -4
  476. package/lib/components/scrollbar/src/thumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  477. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  478. package/lib/components/segmented/index.d.ts +4 -4
  479. package/lib/components/segmented/src/segmented.d.ts +1 -1
  480. package/lib/components/segmented/src/segmented.vue.d.ts +2 -2
  481. package/lib/components/select/src/option.d.ts +1 -1
  482. package/lib/components/select/src/option.vue.d.ts +2 -2
  483. package/lib/components/select/src/select-dropdown.vue.d.ts +2 -1
  484. package/lib/components/select/src/select.d.ts +9 -13
  485. package/lib/components/select/src/select.js +15 -2
  486. package/lib/components/select/src/select.js.map +1 -1
  487. package/lib/components/select/src/select.vue.d.ts +77 -83
  488. package/lib/components/select/src/select.vue_vue_type_script_lang.js.map +1 -1
  489. package/lib/components/select/src/select2.js.map +1 -1
  490. package/lib/components/select/src/useSelect.d.ts +7 -7
  491. package/lib/components/select/src/useSelect.js.map +1 -1
  492. package/lib/components/select-v2/src/defaults.d.ts +4 -104
  493. package/lib/components/select-v2/src/select.vue.d.ts +54 -252
  494. package/lib/components/select-v2/src/useSelect.d.ts +2 -2
  495. package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
  496. package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
  497. package/lib/components/slider/src/button.d.ts +2 -1
  498. package/lib/components/slider/src/button.js +9 -1
  499. package/lib/components/slider/src/button.js.map +1 -1
  500. package/lib/components/slider/src/button.vue.d.ts +5 -3
  501. package/lib/components/slider/src/composables/use-marks.js.map +1 -1
  502. package/lib/components/slider/src/slider.d.ts +4 -4
  503. package/lib/components/slider/src/slider.js +6 -1
  504. package/lib/components/slider/src/slider.js.map +1 -1
  505. package/lib/components/slider/src/slider.vue.d.ts +16 -16
  506. package/lib/components/space/src/space.d.ts +9 -9
  507. package/lib/components/space/src/space.js +2 -1
  508. package/lib/components/space/src/space.js.map +1 -1
  509. package/lib/components/space/src/use-space.d.ts +2 -3
  510. package/lib/components/splitter/src/split-bar.vue.d.ts +1 -1
  511. package/lib/components/splitter/src/splitter.vue.d.ts +2 -2
  512. package/lib/components/statistic/src/statistic.vue.d.ts +2 -2
  513. package/lib/components/steps/src/item.d.ts +1 -1
  514. package/lib/components/steps/src/steps.d.ts +2 -2
  515. package/lib/components/steps/src/steps.vue.d.ts +1 -1
  516. package/lib/components/switch/src/switch.d.ts +1 -1
  517. package/lib/components/switch/src/switch.vue.d.ts +5 -5
  518. package/lib/components/table/src/filter-panel.vue.d.ts +63 -60
  519. package/lib/components/table/src/table/defaults.d.ts +1 -1
  520. package/lib/components/table/src/table/defaults.js.map +1 -1
  521. package/lib/components/table/src/table/style-helper.d.ts +2 -2
  522. package/lib/components/table/src/table-body/events-helper.js.map +1 -1
  523. package/lib/components/table/src/table-footer/index.d.ts +1 -1
  524. package/lib/components/table/src/table-header/index.d.ts +16 -16
  525. package/lib/components/table/src/table.vue.d.ts +4 -4
  526. package/lib/components/table-v2/src/components/row.d.ts +1 -1
  527. package/lib/components/table-v2/src/table-grid.d.ts +2 -2
  528. package/lib/components/table-v2/src/table-v2.d.ts +4 -4
  529. package/lib/components/tabs/src/tab-nav.d.ts +1 -1
  530. package/lib/components/tabs/src/tabs.d.ts +2 -2
  531. package/lib/components/tag/src/tag.d.ts +2 -2
  532. package/lib/components/tag/src/tag.vue.d.ts +2 -2
  533. package/lib/components/text/src/text.d.ts +2 -2
  534. package/lib/components/text/src/text.vue.d.ts +1 -1
  535. package/lib/components/time-picker/src/common/picker-range-trigger.vue.d.ts +6 -6
  536. package/lib/components/time-picker/src/common/picker.vue.d.ts +18 -218
  537. package/lib/components/time-picker/src/common/props.d.ts +4 -104
  538. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
  539. package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
  540. package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
  541. package/lib/components/time-picker/src/time-picker.d.ts +12 -212
  542. package/lib/components/time-picker/src/utils.d.ts +1 -1
  543. package/lib/components/time-select/src/time-select.d.ts +7 -11
  544. package/lib/components/time-select/src/time-select.js +15 -2
  545. package/lib/components/time-select/src/time-select.js.map +1 -1
  546. package/lib/components/time-select/src/time-select.vue.d.ts +13 -12
  547. package/lib/components/timeline/src/timeline-item.d.ts +2 -2
  548. package/lib/components/timeline/src/timeline-item.vue.d.ts +2 -2
  549. package/lib/components/tooltip/src/content.d.ts +5 -200
  550. package/lib/components/tooltip/src/content.vue.d.ts +6 -4
  551. package/lib/components/tooltip/src/tooltip.d.ts +5 -202
  552. package/lib/components/tooltip/src/tooltip.vue.d.ts +8 -7
  553. package/lib/components/tooltip/src/trigger.d.ts +1 -1
  554. package/lib/components/tour/src/content.d.ts +1 -1
  555. package/lib/components/tour/src/step.vue.d.ts +1 -1
  556. package/lib/components/tour/src/tour.vue.d.ts +6 -6
  557. package/lib/components/transfer/src/transfer.vue.d.ts +2 -2
  558. package/lib/components/tree/src/tree-node.vue.d.ts +16 -16
  559. package/lib/components/tree/src/tree.vue.d.ts +22 -22
  560. package/lib/components/tree-select/src/select.js +1 -5
  561. package/lib/components/tree-select/src/select.js.map +1 -1
  562. package/lib/components/tree-select/src/tree-select-option.d.ts +2 -2
  563. package/lib/components/tree-select/src/tree-select.vue.d.ts +32 -40
  564. package/lib/components/tree-v2/src/composables/useTree.d.ts +15 -14
  565. package/lib/components/tree-v2/src/tree-node.vue.d.ts +2 -2
  566. package/lib/components/tree-v2/src/tree.vue.d.ts +5 -5
  567. package/lib/components/upload/src/upload-content.vue.d.ts +2 -2
  568. package/lib/components/upload/src/upload.js.map +1 -1
  569. package/lib/components/upload/src/upload.vue.d.ts +3 -3
  570. package/lib/components/virtual-list/src/builders/build-grid.d.ts +9 -8
  571. package/lib/components/virtual-list/src/builders/build-list.d.ts +8 -7
  572. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +9 -8
  573. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +8 -7
  574. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +9 -8
  575. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +8 -7
  576. package/lib/components/virtual-list/src/components/scrollbar.d.ts +5 -3
  577. package/lib/components/virtual-list/src/props.d.ts +5 -4
  578. package/lib/components/virtual-list/src/props.js +15 -2
  579. package/lib/components/virtual-list/src/props.js.map +1 -1
  580. package/lib/components/watermark/src/watermark.js.map +1 -1
  581. package/lib/hooks/use-size/index.d.ts +3 -3
  582. package/lib/hooks/use-throttle-render/index.js.map +1 -1
  583. package/lib/utils/index.d.ts +2 -2
  584. package/lib/utils/typescript.d.ts +2 -1
  585. package/lib/utils/typescript.js.map +1 -1
  586. package/lib/utils/vue/size.d.ts +1 -1
  587. package/lib/utils/vue/vnode.d.ts +4 -4
  588. package/lib/version.d.ts +1 -1
  589. package/lib/version.js +1 -1
  590. package/lib/version.js.map +1 -1
  591. package/package.json +2 -2
  592. package/web-types.json +1 -1
@@ -7,21 +7,21 @@ type __VLS_Slots = {} & {
7
7
  default?: (props: typeof __VLS_1) => any;
8
8
  };
9
9
  declare const __VLS_base: _$vue.DefineComponent<RadioGroupProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
10
- change: (val: string | number | boolean | undefined) => void;
11
10
  "update:modelValue": (val: string | number | boolean | undefined) => void;
11
+ change: (val: string | number | boolean | undefined) => void;
12
12
  }, string, _$vue.PublicProps, Readonly<RadioGroupProps> & Readonly<{
13
- onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
14
13
  "onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
14
+ onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
15
15
  }>, {
16
+ modelValue: string | number | boolean;
17
+ disabled: boolean;
18
+ validateEvent: boolean;
19
+ name: string;
20
+ id: string;
16
21
  type: "radio" | "button";
17
22
  fill: string;
18
23
  props: radioOptionProp;
19
- disabled: boolean;
20
- name: string;
21
- modelValue: string | number | boolean;
22
24
  textColor: string;
23
- validateEvent: boolean;
24
- id: string;
25
25
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
26
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
27
  declare const _default: typeof __VLS_export;
@@ -43,7 +43,7 @@ interface RadioProps extends RadioPropsBase {
43
43
  declare const radioPropsBase: {
44
44
  modelValue: EpPropFinalized<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown, undefined, boolean>;
45
45
  size: {
46
- readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
46
+ readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
47
47
  readonly required: false;
48
48
  readonly validator: ((val: unknown) => boolean) | undefined;
49
49
  __epPropKey: true;
@@ -60,7 +60,7 @@ declare const radioProps: {
60
60
  readonly border: BooleanConstructor;
61
61
  readonly modelValue: EpPropFinalized<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown, undefined, boolean>;
62
62
  readonly size: {
63
- readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
63
+ readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
64
64
  readonly required: false;
65
65
  readonly validator: ((val: unknown) => boolean) | undefined;
66
66
  __epPropKey: true;
@@ -7,18 +7,18 @@ type __VLS_Slots = {} & {
7
7
  default?: (props: typeof __VLS_1) => any;
8
8
  };
9
9
  declare const __VLS_base: _$vue.DefineComponent<RadioProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
10
- change: (val: string | number | boolean | undefined) => void;
11
10
  "update:modelValue": (val: string | number | boolean | undefined) => void;
11
+ change: (val: string | number | boolean | undefined) => void;
12
12
  }, string, _$vue.PublicProps, Readonly<RadioProps> & Readonly<{
13
- onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
14
13
  "onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
14
+ onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
15
15
  }>, {
16
- label: string | number | boolean;
16
+ modelValue: string | number | boolean;
17
+ border: boolean;
17
18
  disabled: boolean;
18
19
  name: string;
19
- border: boolean;
20
- modelValue: string | number | boolean;
21
20
  value: string | number | boolean;
21
+ label: string | number | boolean;
22
22
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
23
23
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
24
24
  declare const _default: typeof __VLS_export;
@@ -10,7 +10,7 @@ declare const useRadio: (props: RadioProps | RadioButtonProps, emit?: SetupConte
10
10
  isGroup: _$vue.ComputedRef<boolean>;
11
11
  radioGroup: RadioGroupContext | undefined;
12
12
  focus: _$vue.Ref<boolean, boolean>;
13
- size: _$vue.ComputedRef<"" | "default" | "large" | "small">;
13
+ size: _$vue.ComputedRef<"" | "small" | "default" | "large">;
14
14
  disabled: _$vue.ComputedRef<boolean>;
15
15
  tabIndex: _$vue.ComputedRef<0 | -1>;
16
16
  modelValue: _$vue.WritableComputedRef<string | number | boolean | undefined, string | number | boolean | undefined>;
@@ -116,7 +116,7 @@ declare const rateProps: {
116
116
  readonly texts: EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => ["Extremely bad", "Disappointed", "Fair", "Satisfied", "Surprise"], boolean>;
117
117
  readonly scoreTemplate: EpPropFinalized<StringConstructor, unknown, unknown, "{value}", boolean>;
118
118
  readonly size: {
119
- readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
119
+ readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
120
120
  readonly required: false;
121
121
  readonly validator: ((val: unknown) => boolean) | undefined;
122
122
  __epPropKey: true;
@@ -9,17 +9,17 @@ declare const __VLS_export: _$vue.DefineComponent<RateProps, {
9
9
  /** @description set current value */setCurrentValue: typeof setCurrentValue; /** @description reset current value */
10
10
  resetCurrentValue: typeof resetCurrentValue;
11
11
  }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
12
- change: (value: number) => void;
13
12
  "update:modelValue": (value: number) => void;
13
+ change: (value: number) => void;
14
14
  }, string, _$vue.PublicProps, Readonly<RateProps> & Readonly<{
15
- onChange?: ((value: number) => any) | undefined;
16
15
  "onUpdate:modelValue"?: ((value: number) => any) | undefined;
16
+ onChange?: ((value: number) => any) | undefined;
17
17
  }>, {
18
- disabled: boolean;
19
18
  modelValue: number;
19
+ disabled: boolean;
20
+ id: string;
20
21
  max: number;
21
22
  textColor: string;
22
- id: string;
23
23
  lowThreshold: number;
24
24
  highThreshold: number;
25
25
  colors: string[] | Record<number, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"rate.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :id=\"inputId\"\n :class=\"[rateClasses, ns.is('disabled', rateDisabled)]\"\n role=\"slider\"\n :aria-label=\"!isLabeledByFormItem ? ariaLabel || 'rating' : undefined\"\n :aria-labelledby=\"\n isLabeledByFormItem ? formItemContext?.labelId : undefined\n \"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text || undefined\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :style=\"rateStyles\"\n :tabindex=\"rateDisabled ? undefined : 0\"\n :aria-disabled=\"rateDisabled\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n ref=\"iconRefs\"\n :class=\"[\n ns.e('icon'),\n { hover: hoverIndex === item },\n ns.is('active', item <= currentValue),\n ns.is('focus-visible', item === Math.ceil(currentValue || 1)),\n ]\"\n >\n <component\n :is=\"activeComponent\"\n v-show=\"!showDecimalIcon(item) && item <= currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"!showDecimalIcon(item) && item > currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"showDecimalIcon(item)\"\n :class=\"[ns.em('decimal', 'box')]\"\n />\n <el-icon\n v-show=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, markRaw, ref, watch } from 'vue'\nimport { clamp } from 'lodash-unified'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { getEventCode, isArray, isObject, isString } from '@element-plus/utils'\nimport {\n formItemContextKey,\n useFormDisabled,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Star, StarFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rateEmits } from './rate'\n\nimport type { CSSProperties, Component } from 'vue'\nimport type { IconInstance } from '@element-plus/components/icon'\nimport type { RateProps } from './rate'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\ndefineOptions({\n name: 'ElRate',\n})\n\nconst props = withDefaults(defineProps<RateProps>(), {\n modelValue: 0,\n id: undefined,\n lowThreshold: 2,\n highThreshold: 4,\n max: 5,\n colors: () => ['', '', ''],\n voidColor: '',\n disabledVoidColor: '',\n icons: () => [StarFilled, StarFilled, StarFilled],\n voidIcon: () => Star,\n disabledVoidIcon: () => StarFilled,\n disabled: undefined,\n textColor: '',\n texts: () => [\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ],\n scoreTemplate: '{value}',\n})\nconst emit = defineEmits(rateEmits)\n\nconst formItemContext = inject(formItemContextKey, undefined)\nconst rateSize = useFormSize()\nconst ns = useNamespace('rate')\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext,\n})\n\nconst currentValue = ref(clamp(props.modelValue, 0, props.max))\nconst hoverIndex = ref(-1)\nconst pointerAtLeftHalf = ref(true)\n\nconst iconRefs = ref<IconInstance[]>([])\nconst iconClientWidths = computed<number[]>(() =>\n iconRefs.value.map((icon) => icon.$el.clientWidth)\n)\nconst rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)])\nconst rateDisabled = useFormDisabled()\nconst rateStyles = computed(() => {\n return ns.cssVarBlock({\n 'void-color': props.voidColor,\n 'disabled-void-color': props.disabledVoidColor,\n 'fill-color': activeColor.value,\n }) as CSSProperties\n})\n\nconst text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n})\nconst valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n)\nconst colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n)\nconst activeColor = computed(() => {\n const color = getValueFromMap(currentValue.value, colorMap.value)\n // {value: '', excluded: true} returned\n return isObject(color) ? '' : color\n})\nconst decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n})\nconst componentMap = computed(() => {\n let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons }\n icons = markRaw(icons) as\n | Array<string | Component>\n | Record<number, string | Component>\n return isArray(icons)\n ? {\n [props.lowThreshold]: icons[0],\n [props.highThreshold]: {\n value: icons[1],\n excluded: true,\n },\n [props.max]: icons[2],\n }\n : icons\n})\nconst decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n)\nconst voidComponent = computed(() =>\n rateDisabled.value\n ? isString(props.disabledVoidIcon)\n ? props.disabledVoidIcon\n : (markRaw(props.disabledVoidIcon) as Component)\n : isString(props.voidIcon)\n ? props.voidIcon\n : (markRaw(props.voidIcon) as Component)\n)\nconst activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n)\n\nfunction showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n}\n\nfunction emitValue(value: number) {\n // if allow clear, and selected value is same as modelValue, reset value to 0\n if (props.clearable && value === props.modelValue) {\n value = 0\n }\n\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit(CHANGE_EVENT, value)\n }\n}\n\nfunction selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emitValue(currentValue.value)\n } else {\n emitValue(value)\n }\n}\n\nfunction handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n const code = getEventCode(e)\n const step = props.allowHalf ? 0.5 : 1\n let _currentValue = currentValue.value\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.right:\n _currentValue += step\n break\n case EVENT_CODE.left:\n case EVENT_CODE.down:\n _currentValue -= step\n break\n }\n\n _currentValue = clamp(_currentValue, 0, props.max)\n\n if (_currentValue === currentValue.value) {\n return\n }\n\n e.stopPropagation()\n e.preventDefault()\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit(CHANGE_EVENT, _currentValue)\n return _currentValue\n}\n\nfunction setCurrentValue(value: number, event?: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && event) {\n pointerAtLeftHalf.value =\n event.offsetX * 2 <= iconClientWidths.value[value - 1]\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n}\n\nfunction resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = clamp(props.modelValue, 0, props.max)\n hoverIndex.value = -1\n}\n\nwatch(\n () => props.modelValue,\n (val) => {\n currentValue.value = clamp(val, 0, props.max)\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n)\n\nif (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n}\n\ndefineExpose({\n /** @description set current value */\n setCurrentValue,\n /** @description reset current value */\n resetCurrentValue,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,SAAS,gBACP,OACA,KACA;GACA,MAAM,oBACJ,SAAA,GAAA,YAAA,UACkE,IAAG;GAUvE,MAAM,eAAe,IARD,OAAO,KAAK,IAAG,CAChC,KAAK,QAAQ,CAAC,IAAG,CACjB,QAAQ,QAAQ;IACf,MAAM,MAAM,IAAI;IAEhB,QADiB,iBAAiB,IAAI,GAAG,IAAI,WAAW,SACtC,QAAQ,MAAM,SAAS;KAC1C,CACA,MAAM,GAAG,MAAM,IAAI,EACc,CAAC;GACrC,OAAQ,iBAAiB,aAAa,IAAI,aAAa,SAAU;;EAOnE,MAAM,QAAQ;EAuBd,MAAM,OAAO;EAEb,MAAM,mBAAA,GAAA,IAAA,QAAyB,kBAAA,oBAAoB,KAAA,EAAS;EAC5D,MAAM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,CAAC,EAAC,OAAA,CAAA;IACX,QAAA,GAAA,IAAA,gBAAK,EAAA,OAAW,QAAA,WAAS,CAAA;+BAEvB,KAAA,MAAI,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,QAAA,KAAA,CAAA,EAAA,IAAA,WAAA"}
1
+ {"version":3,"file":"rate.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :id=\"inputId\"\n :class=\"[rateClasses, ns.is('disabled', rateDisabled)]\"\n role=\"slider\"\n :aria-label=\"!isLabeledByFormItem ? ariaLabel || 'rating' : undefined\"\n :aria-labelledby=\"\n isLabeledByFormItem ? formItemContext?.labelId : undefined\n \"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text || undefined\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :style=\"rateStyles\"\n :tabindex=\"rateDisabled ? undefined : 0\"\n :aria-disabled=\"rateDisabled\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n ref=\"iconRefs\"\n :class=\"[\n ns.e('icon'),\n { hover: hoverIndex === item },\n ns.is('active', item <= currentValue),\n ns.is('focus-visible', item === Math.ceil(currentValue || 1)),\n ]\"\n >\n <component\n :is=\"activeComponent\"\n v-show=\"!showDecimalIcon(item) && item <= currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"!showDecimalIcon(item) && item > currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"showDecimalIcon(item)\"\n :class=\"[ns.em('decimal', 'box')]\"\n />\n <el-icon\n v-show=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, markRaw, ref, watch } from 'vue'\nimport { clamp } from 'lodash-unified'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { getEventCode, isArray, isObject, isString } from '@element-plus/utils'\nimport {\n formItemContextKey,\n useFormDisabled,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Star, StarFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rateEmits } from './rate'\n\nimport type { CSSProperties, Component } from 'vue'\nimport type { IconInstance } from '@element-plus/components/icon'\nimport type { RateProps } from './rate'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\ndefineOptions({\n name: 'ElRate',\n})\n\nconst props = withDefaults(defineProps<RateProps>(), {\n modelValue: 0,\n id: undefined,\n lowThreshold: 2,\n highThreshold: 4,\n max: 5,\n colors: () => ['', '', ''],\n voidColor: '',\n disabledVoidColor: '',\n icons: () => [StarFilled, StarFilled, StarFilled],\n voidIcon: () => Star,\n disabledVoidIcon: () => StarFilled,\n disabled: undefined,\n textColor: '',\n texts: () => [\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ],\n scoreTemplate: '{value}',\n})\nconst emit = defineEmits(rateEmits)\n\nconst formItemContext = inject(formItemContextKey, undefined)\nconst rateSize = useFormSize()\nconst ns = useNamespace('rate')\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext,\n})\n\nconst currentValue = ref(clamp(props.modelValue, 0, props.max))\nconst hoverIndex = ref(-1)\nconst pointerAtLeftHalf = ref(true)\n\nconst iconRefs = ref<IconInstance[]>([])\nconst iconClientWidths = computed<number[]>(() =>\n iconRefs.value.map((icon) => icon.$el.clientWidth)\n)\nconst rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)])\nconst rateDisabled = useFormDisabled()\nconst rateStyles = computed(() => {\n return ns.cssVarBlock({\n 'void-color': props.voidColor,\n 'disabled-void-color': props.disabledVoidColor,\n 'fill-color': activeColor.value,\n }) as CSSProperties\n})\n\nconst text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n})\nconst valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n)\nconst colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n)\nconst activeColor = computed(() => {\n const color = getValueFromMap(currentValue.value, colorMap.value)\n // {value: '', excluded: true} returned\n return isObject(color) ? '' : color\n})\nconst decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n})\nconst componentMap = computed(() => {\n let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons }\n icons = markRaw(icons) as\n Array<string | Component> | Record<number, string | Component>\n return isArray(icons)\n ? {\n [props.lowThreshold]: icons[0],\n [props.highThreshold]: {\n value: icons[1],\n excluded: true,\n },\n [props.max]: icons[2],\n }\n : icons\n})\nconst decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n)\nconst voidComponent = computed(() =>\n rateDisabled.value\n ? isString(props.disabledVoidIcon)\n ? props.disabledVoidIcon\n : (markRaw(props.disabledVoidIcon) as Component)\n : isString(props.voidIcon)\n ? props.voidIcon\n : (markRaw(props.voidIcon) as Component)\n)\nconst activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n)\n\nfunction showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n}\n\nfunction emitValue(value: number) {\n // if allow clear, and selected value is same as modelValue, reset value to 0\n if (props.clearable && value === props.modelValue) {\n value = 0\n }\n\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit(CHANGE_EVENT, value)\n }\n}\n\nfunction selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emitValue(currentValue.value)\n } else {\n emitValue(value)\n }\n}\n\nfunction handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n const code = getEventCode(e)\n const step = props.allowHalf ? 0.5 : 1\n let _currentValue = currentValue.value\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.right:\n _currentValue += step\n break\n case EVENT_CODE.left:\n case EVENT_CODE.down:\n _currentValue -= step\n break\n }\n\n _currentValue = clamp(_currentValue, 0, props.max)\n\n if (_currentValue === currentValue.value) {\n return\n }\n\n e.stopPropagation()\n e.preventDefault()\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit(CHANGE_EVENT, _currentValue)\n return _currentValue\n}\n\nfunction setCurrentValue(value: number, event?: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && event) {\n pointerAtLeftHalf.value =\n event.offsetX * 2 <= iconClientWidths.value[value - 1]\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n}\n\nfunction resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = clamp(props.modelValue, 0, props.max)\n hoverIndex.value = -1\n}\n\nwatch(\n () => props.modelValue,\n (val) => {\n currentValue.value = clamp(val, 0, props.max)\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n)\n\nif (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n}\n\ndefineExpose({\n /** @description set current value */\n setCurrentValue,\n /** @description reset current value */\n resetCurrentValue,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,SAAS,gBACP,OACA,KACA;GACA,MAAM,oBACJ,SAAA,GAAA,YAAA,UACkE,IAAG;GAUvE,MAAM,eAAe,IARD,OAAO,KAAK,IAAG,CAChC,KAAK,QAAQ,CAAC,IAAG,CACjB,QAAQ,QAAQ;IACf,MAAM,MAAM,IAAI;IAEhB,QADiB,iBAAiB,IAAI,GAAG,IAAI,WAAW,SACtC,QAAQ,MAAM,SAAS;KAC1C,CACA,MAAM,GAAG,MAAM,IAAI,EACc,CAAC;GACrC,OAAQ,iBAAiB,aAAa,IAAI,aAAa,SAAU;;EAOnE,MAAM,QAAQ;EAuBd,MAAM,OAAO;EAEb,MAAM,mBAAA,GAAA,IAAA,QAAyB,kBAAA,oBAAoB,KAAA,EAAS;EAC5D,MAAM,WAAW,8BAAA,aAAY;EAC7B,MAAM,KAAK,cAAA,aAAa,OAAM;EAC9B,MAAM,EAAE,SAAS,wBAAwB,sBAA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AA,MAAI,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,QAAA,KAAA,CAAA,EAAA,IAAA,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"rate2.js","names":[],"sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :id=\"inputId\"\n :class=\"[rateClasses, ns.is('disabled', rateDisabled)]\"\n role=\"slider\"\n :aria-label=\"!isLabeledByFormItem ? ariaLabel || 'rating' : undefined\"\n :aria-labelledby=\"\n isLabeledByFormItem ? formItemContext?.labelId : undefined\n \"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text || undefined\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :style=\"rateStyles\"\n :tabindex=\"rateDisabled ? undefined : 0\"\n :aria-disabled=\"rateDisabled\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n ref=\"iconRefs\"\n :class=\"[\n ns.e('icon'),\n { hover: hoverIndex === item },\n ns.is('active', item <= currentValue),\n ns.is('focus-visible', item === Math.ceil(currentValue || 1)),\n ]\"\n >\n <component\n :is=\"activeComponent\"\n v-show=\"!showDecimalIcon(item) && item <= currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"!showDecimalIcon(item) && item > currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"showDecimalIcon(item)\"\n :class=\"[ns.em('decimal', 'box')]\"\n />\n <el-icon\n v-show=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, markRaw, ref, watch } from 'vue'\nimport { clamp } from 'lodash-unified'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { getEventCode, isArray, isObject, isString } from '@element-plus/utils'\nimport {\n formItemContextKey,\n useFormDisabled,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Star, StarFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rateEmits } from './rate'\n\nimport type { CSSProperties, Component } from 'vue'\nimport type { IconInstance } from '@element-plus/components/icon'\nimport type { RateProps } from './rate'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\ndefineOptions({\n name: 'ElRate',\n})\n\nconst props = withDefaults(defineProps<RateProps>(), {\n modelValue: 0,\n id: undefined,\n lowThreshold: 2,\n highThreshold: 4,\n max: 5,\n colors: () => ['', '', ''],\n voidColor: '',\n disabledVoidColor: '',\n icons: () => [StarFilled, StarFilled, StarFilled],\n voidIcon: () => Star,\n disabledVoidIcon: () => StarFilled,\n disabled: undefined,\n textColor: '',\n texts: () => [\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ],\n scoreTemplate: '{value}',\n})\nconst emit = defineEmits(rateEmits)\n\nconst formItemContext = inject(formItemContextKey, undefined)\nconst rateSize = useFormSize()\nconst ns = useNamespace('rate')\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext,\n})\n\nconst currentValue = ref(clamp(props.modelValue, 0, props.max))\nconst hoverIndex = ref(-1)\nconst pointerAtLeftHalf = ref(true)\n\nconst iconRefs = ref<IconInstance[]>([])\nconst iconClientWidths = computed<number[]>(() =>\n iconRefs.value.map((icon) => icon.$el.clientWidth)\n)\nconst rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)])\nconst rateDisabled = useFormDisabled()\nconst rateStyles = computed(() => {\n return ns.cssVarBlock({\n 'void-color': props.voidColor,\n 'disabled-void-color': props.disabledVoidColor,\n 'fill-color': activeColor.value,\n }) as CSSProperties\n})\n\nconst text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n})\nconst valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n)\nconst colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n)\nconst activeColor = computed(() => {\n const color = getValueFromMap(currentValue.value, colorMap.value)\n // {value: '', excluded: true} returned\n return isObject(color) ? '' : color\n})\nconst decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n})\nconst componentMap = computed(() => {\n let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons }\n icons = markRaw(icons) as\n | Array<string | Component>\n | Record<number, string | Component>\n return isArray(icons)\n ? {\n [props.lowThreshold]: icons[0],\n [props.highThreshold]: {\n value: icons[1],\n excluded: true,\n },\n [props.max]: icons[2],\n }\n : icons\n})\nconst decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n)\nconst voidComponent = computed(() =>\n rateDisabled.value\n ? isString(props.disabledVoidIcon)\n ? props.disabledVoidIcon\n : (markRaw(props.disabledVoidIcon) as Component)\n : isString(props.voidIcon)\n ? props.voidIcon\n : (markRaw(props.voidIcon) as Component)\n)\nconst activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n)\n\nfunction showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n}\n\nfunction emitValue(value: number) {\n // if allow clear, and selected value is same as modelValue, reset value to 0\n if (props.clearable && value === props.modelValue) {\n value = 0\n }\n\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit(CHANGE_EVENT, value)\n }\n}\n\nfunction selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emitValue(currentValue.value)\n } else {\n emitValue(value)\n }\n}\n\nfunction handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n const code = getEventCode(e)\n const step = props.allowHalf ? 0.5 : 1\n let _currentValue = currentValue.value\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.right:\n _currentValue += step\n break\n case EVENT_CODE.left:\n case EVENT_CODE.down:\n _currentValue -= step\n break\n }\n\n _currentValue = clamp(_currentValue, 0, props.max)\n\n if (_currentValue === currentValue.value) {\n return\n }\n\n e.stopPropagation()\n e.preventDefault()\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit(CHANGE_EVENT, _currentValue)\n return _currentValue\n}\n\nfunction setCurrentValue(value: number, event?: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && event) {\n pointerAtLeftHalf.value =\n event.offsetX * 2 <= iconClientWidths.value[value - 1]\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n}\n\nfunction resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = clamp(props.modelValue, 0, props.max)\n hoverIndex.value = -1\n}\n\nwatch(\n () => props.modelValue,\n (val) => {\n currentValue.value = clamp(val, 0, props.max)\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n)\n\nif (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n}\n\ndefineExpose({\n /** @description set current value */\n setCurrentValue,\n /** @description reset current value */\n resetCurrentValue,\n})\n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"rate2.js","names":[],"sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :id=\"inputId\"\n :class=\"[rateClasses, ns.is('disabled', rateDisabled)]\"\n role=\"slider\"\n :aria-label=\"!isLabeledByFormItem ? ariaLabel || 'rating' : undefined\"\n :aria-labelledby=\"\n isLabeledByFormItem ? formItemContext?.labelId : undefined\n \"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text || undefined\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :style=\"rateStyles\"\n :tabindex=\"rateDisabled ? undefined : 0\"\n :aria-disabled=\"rateDisabled\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n ref=\"iconRefs\"\n :class=\"[\n ns.e('icon'),\n { hover: hoverIndex === item },\n ns.is('active', item <= currentValue),\n ns.is('focus-visible', item === Math.ceil(currentValue || 1)),\n ]\"\n >\n <component\n :is=\"activeComponent\"\n v-show=\"!showDecimalIcon(item) && item <= currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"!showDecimalIcon(item) && item > currentValue\"\n />\n <component\n :is=\"voidComponent\"\n v-show=\"showDecimalIcon(item)\"\n :class=\"[ns.em('decimal', 'box')]\"\n />\n <el-icon\n v-show=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, markRaw, ref, watch } from 'vue'\nimport { clamp } from 'lodash-unified'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { getEventCode, isArray, isObject, isString } from '@element-plus/utils'\nimport {\n formItemContextKey,\n useFormDisabled,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Star, StarFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rateEmits } from './rate'\n\nimport type { CSSProperties, Component } from 'vue'\nimport type { IconInstance } from '@element-plus/components/icon'\nimport type { RateProps } from './rate'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\ndefineOptions({\n name: 'ElRate',\n})\n\nconst props = withDefaults(defineProps<RateProps>(), {\n modelValue: 0,\n id: undefined,\n lowThreshold: 2,\n highThreshold: 4,\n max: 5,\n colors: () => ['', '', ''],\n voidColor: '',\n disabledVoidColor: '',\n icons: () => [StarFilled, StarFilled, StarFilled],\n voidIcon: () => Star,\n disabledVoidIcon: () => StarFilled,\n disabled: undefined,\n textColor: '',\n texts: () => [\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ],\n scoreTemplate: '{value}',\n})\nconst emit = defineEmits(rateEmits)\n\nconst formItemContext = inject(formItemContextKey, undefined)\nconst rateSize = useFormSize()\nconst ns = useNamespace('rate')\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext,\n})\n\nconst currentValue = ref(clamp(props.modelValue, 0, props.max))\nconst hoverIndex = ref(-1)\nconst pointerAtLeftHalf = ref(true)\n\nconst iconRefs = ref<IconInstance[]>([])\nconst iconClientWidths = computed<number[]>(() =>\n iconRefs.value.map((icon) => icon.$el.clientWidth)\n)\nconst rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)])\nconst rateDisabled = useFormDisabled()\nconst rateStyles = computed(() => {\n return ns.cssVarBlock({\n 'void-color': props.voidColor,\n 'disabled-void-color': props.disabledVoidColor,\n 'fill-color': activeColor.value,\n }) as CSSProperties\n})\n\nconst text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n})\nconst valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n)\nconst colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n)\nconst activeColor = computed(() => {\n const color = getValueFromMap(currentValue.value, colorMap.value)\n // {value: '', excluded: true} returned\n return isObject(color) ? '' : color\n})\nconst decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n})\nconst componentMap = computed(() => {\n let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons }\n icons = markRaw(icons) as\n Array<string | Component> | Record<number, string | Component>\n return isArray(icons)\n ? {\n [props.lowThreshold]: icons[0],\n [props.highThreshold]: {\n value: icons[1],\n excluded: true,\n },\n [props.max]: icons[2],\n }\n : icons\n})\nconst decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n)\nconst voidComponent = computed(() =>\n rateDisabled.value\n ? isString(props.disabledVoidIcon)\n ? props.disabledVoidIcon\n : (markRaw(props.disabledVoidIcon) as Component)\n : isString(props.voidIcon)\n ? props.voidIcon\n : (markRaw(props.voidIcon) as Component)\n)\nconst activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n)\n\nfunction showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n}\n\nfunction emitValue(value: number) {\n // if allow clear, and selected value is same as modelValue, reset value to 0\n if (props.clearable && value === props.modelValue) {\n value = 0\n }\n\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit(CHANGE_EVENT, value)\n }\n}\n\nfunction selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emitValue(currentValue.value)\n } else {\n emitValue(value)\n }\n}\n\nfunction handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n const code = getEventCode(e)\n const step = props.allowHalf ? 0.5 : 1\n let _currentValue = currentValue.value\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.right:\n _currentValue += step\n break\n case EVENT_CODE.left:\n case EVENT_CODE.down:\n _currentValue -= step\n break\n }\n\n _currentValue = clamp(_currentValue, 0, props.max)\n\n if (_currentValue === currentValue.value) {\n return\n }\n\n e.stopPropagation()\n e.preventDefault()\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit(CHANGE_EVENT, _currentValue)\n return _currentValue\n}\n\nfunction setCurrentValue(value: number, event?: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && event) {\n pointerAtLeftHalf.value =\n event.offsetX * 2 <= iconClientWidths.value[value - 1]\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n}\n\nfunction resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = clamp(props.modelValue, 0, props.max)\n hoverIndex.value = -1\n}\n\nwatch(\n () => props.modelValue,\n (val) => {\n currentValue.value = clamp(val, 0, props.max)\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n)\n\nif (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n}\n\ndefineExpose({\n /** @description set current value */\n setCurrentValue,\n /** @description reset current value */\n resetCurrentValue,\n})\n</script>\n"],"mappings":""}
@@ -31,7 +31,7 @@ interface ResultProps {
31
31
  declare const resultProps: {
32
32
  readonly title: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
33
33
  readonly subTitle: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
34
- readonly icon: EpPropFinalized<StringConstructor, "error" | "info" | "primary" | "success" | "warning", unknown, "info", boolean>;
34
+ readonly icon: EpPropFinalized<StringConstructor, "primary" | "success" | "warning" | "info" | "error", unknown, "info", boolean>;
35
35
  };
36
36
  /**
37
37
  * @deprecated Removed after 3.0.0, Use `ResultProps` instead.
@@ -1,4 +1,5 @@
1
1
  import { EpPropFinalized } from "../../../utils/vue/props/types.js";
2
+ import { ClassValue } from "../../../utils/typescript.js";
2
3
  import _default from "./scrollbar.vue.js";
3
4
  import * as _$vue from "vue";
4
5
  import { ExtractPublicPropTypes, StyleValue } from "vue";
@@ -33,12 +34,12 @@ interface ScrollbarProps {
33
34
  * @description class of wrap
34
35
  * @default ''
35
36
  */
36
- wrapClass?: string | string[];
37
+ wrapClass?: ClassValue;
37
38
  /**
38
39
  * @description class of view
39
40
  * @default ''
40
41
  */
41
- viewClass?: string | string[];
42
+ viewClass?: ClassValue;
42
43
  /**
43
44
  * @description style of view
44
45
  * @default ''
@@ -100,8 +101,8 @@ declare const scrollbarProps: {
100
101
  readonly maxHeight: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
101
102
  readonly native: BooleanConstructor;
102
103
  readonly wrapStyle: EpPropFinalized<(new (...args: any[]) => string | false | _$vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | _$vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
103
- readonly wrapClass: EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
104
- readonly viewClass: EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
104
+ readonly wrapClass: EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | ClassValue[]) | (() => ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | ClassValue[]) | (() => ClassValue)) | null)[], unknown, unknown, "", boolean>;
105
+ readonly viewClass: EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | ClassValue[]) | (() => ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | ClassValue[]) | (() => ClassValue)) | null)[], unknown, unknown, "", boolean>;
105
106
  readonly viewStyle: EpPropFinalized<(new (...args: any[]) => string | false | _$vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | _$vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
106
107
  readonly noresize: BooleanConstructor;
107
108
  readonly tag: EpPropFinalized<StringConstructor, unknown, unknown, "div", boolean>;
@@ -48,14 +48,24 @@ const scrollbarProps = require_runtime.buildProps({
48
48
  * @description class of wrap
49
49
  */
50
50
  wrapClass: {
51
- type: [String, Array],
51
+ type: require_runtime.definePropType([
52
+ String,
53
+ Array,
54
+ Object,
55
+ Boolean
56
+ ]),
52
57
  default: ""
53
58
  },
54
59
  /**
55
60
  * @description class of view
56
61
  */
57
62
  viewClass: {
58
- type: [String, Array],
63
+ type: require_runtime.definePropType([
64
+ String,
65
+ Array,
66
+ Object,
67
+ Boolean
68
+ ]),
59
69
  default: ""
60
70
  },
61
71
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.js","names":["buildProps","definePropType","useAriaProps","isNumber"],"sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport { useAriaProps } from '@element-plus/hooks'\n\nimport type { ExtractPublicPropTypes, StyleValue } from 'vue'\nimport type Scrollbar from './scrollbar.vue'\n\nexport interface ScrollbarProps {\n /**\n * @description trigger distance(px)\n * @default 0\n */\n distance?: number\n /**\n * @description height of scrollbar\n * @default ''\n */\n height?: number | string\n /**\n * @description max height of scrollbar\n * @default ''\n */\n maxHeight?: number | string\n /**\n * @description whether to use the native scrollbar\n */\n native?: boolean\n /**\n * @description style of wrap\n * @default ''\n */\n wrapStyle?: StyleValue\n /**\n * @description class of wrap\n * @default ''\n */\n wrapClass?: string | string[]\n /**\n * @description class of view\n * @default ''\n */\n viewClass?: string | string[]\n /**\n * @description style of view\n * @default ''\n */\n viewStyle?: StyleValue\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize?: boolean\n /**\n * @description element tag of the view\n * @default 'div'\n */\n tag?: keyof HTMLElementTagNameMap | (string & {})\n /**\n * @description always show\n */\n always?: boolean\n /**\n * @description minimum size of scrollbar\n * @default 20\n */\n minSize?: number\n /**\n * @description Wrap tabindex\n * @default undefined\n */\n tabindex?: number | string\n /**\n * @description id of view\n */\n id?: string\n /**\n * @description role of view\n */\n role?: string\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel?: string\n /**\n * @description native `aria-orientation` attribute\n */\n ariaOrientation?: 'horizontal' | 'vertical' | 'undefined'\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.\n */\nexport const scrollbarProps = buildProps({\n /**\n * @description trigger distance(px)\n */\n distance: {\n type: Number,\n default: 0,\n },\n /**\n * @description height of scrollbar\n */\n height: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description max height of scrollbar\n */\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether to use the native scrollbar\n */\n native: Boolean,\n /**\n * @description style of wrap\n */\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array, Boolean]),\n default: '',\n },\n /**\n * @description class of wrap\n */\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description class of view\n */\n viewClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description style of view\n */\n viewStyle: {\n type: definePropType<StyleValue>([String, Object, Array, Boolean]),\n default: '',\n },\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n /**\n * @description element tag of the view\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description always show\n */\n always: Boolean,\n /**\n * @description minimum size of scrollbar\n */\n minSize: {\n type: Number,\n default: 20,\n },\n /**\n * @description Wrap tabindex\n */\n tabindex: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description id of view\n */\n id: String,\n /**\n * @description role of view\n */\n role: String,\n ...useAriaProps(['ariaLabel', 'ariaOrientation']),\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.\n */\nexport type ScrollbarPropsPublic = ExtractPublicPropTypes<typeof scrollbarProps>\n\nexport const scrollbarEmits = {\n 'end-reached': (direction: ScrollbarDirection) =>\n ['left', 'right', 'top', 'bottom'].includes(direction),\n scroll: ({\n scrollTop,\n scrollLeft,\n }: {\n scrollTop: number\n scrollLeft: number\n }) => [scrollTop, scrollLeft].every(isNumber),\n}\nexport type ScrollbarEmits = typeof scrollbarEmits\nexport type ScrollbarDirection = 'top' | 'bottom' | 'left' | 'right'\n\nexport type ScrollbarInstance = InstanceType<typeof Scrollbar> & unknown\n"],"mappings":";;;;;;;;AA0FA,MAAa,iBAAiBA,gBAAAA,WAAW;;;;CAIvC,UAAU;EACR,MAAM;EACN,SAAS;EACV;;;;CAID,QAAQ;EACN,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;;;;CAID,QAAQ;;;;CAIR,WAAW;EACT,MAAMC,gBAAAA,eAA2B;GAAC;GAAQ;GAAQ;GAAO;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;EACV;;;;CAID,WAAW;EACT,MAAMA,gBAAAA,eAA2B;GAAC;GAAQ;GAAQ;GAAO;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,UAAU;;;;CAIV,KAAK;EACH,MAAM;EACN,SAAS;EACV;;;;CAID,QAAQ;;;;CAIR,SAAS;EACP,MAAM;EACN,SAAS;EACV;;;;CAID,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS,KAAA;EACV;;;;CAID,IAAI;;;;CAIJ,MAAM;CACN,GAAGC,cAAAA,aAAa,CAAC,aAAa,kBAAkB,CAAC;CAClD,CAAU;AAOX,MAAa,iBAAiB;CAC5B,gBAAgB,cACd;EAAC;EAAQ;EAAS;EAAO;EAAS,CAAC,SAAS,UAAU;CACxD,SAAS,EACP,WACA,iBAII,CAAC,WAAW,WAAW,CAAC,MAAMC,cAAAA,SAAS;CAC9C"}
1
+ {"version":3,"file":"scrollbar.js","names":["buildProps","definePropType","useAriaProps","isNumber"],"sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport { useAriaProps } from '@element-plus/hooks'\n\nimport type { ClassValue } from '@element-plus/utils'\nimport type { ExtractPublicPropTypes, StyleValue } from 'vue'\nimport type Scrollbar from './scrollbar.vue'\n\nexport interface ScrollbarProps {\n /**\n * @description trigger distance(px)\n * @default 0\n */\n distance?: number\n /**\n * @description height of scrollbar\n * @default ''\n */\n height?: number | string\n /**\n * @description max height of scrollbar\n * @default ''\n */\n maxHeight?: number | string\n /**\n * @description whether to use the native scrollbar\n */\n native?: boolean\n /**\n * @description style of wrap\n * @default ''\n */\n wrapStyle?: StyleValue\n /**\n * @description class of wrap\n * @default ''\n */\n wrapClass?: ClassValue\n /**\n * @description class of view\n * @default ''\n */\n viewClass?: ClassValue\n /**\n * @description style of view\n * @default ''\n */\n viewStyle?: StyleValue\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize?: boolean\n /**\n * @description element tag of the view\n * @default 'div'\n */\n tag?: keyof HTMLElementTagNameMap | (string & {})\n /**\n * @description always show\n */\n always?: boolean\n /**\n * @description minimum size of scrollbar\n * @default 20\n */\n minSize?: number\n /**\n * @description Wrap tabindex\n * @default undefined\n */\n tabindex?: number | string\n /**\n * @description id of view\n */\n id?: string\n /**\n * @description role of view\n */\n role?: string\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel?: string\n /**\n * @description native `aria-orientation` attribute\n */\n ariaOrientation?: 'horizontal' | 'vertical' | 'undefined'\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.\n */\nexport const scrollbarProps = buildProps({\n /**\n * @description trigger distance(px)\n */\n distance: {\n type: Number,\n default: 0,\n },\n /**\n * @description height of scrollbar\n */\n height: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description max height of scrollbar\n */\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether to use the native scrollbar\n */\n native: Boolean,\n /**\n * @description style of wrap\n */\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array, Boolean]),\n default: '',\n },\n /**\n * @description class of wrap\n */\n wrapClass: {\n type: definePropType<ClassValue>([String, Array, Object, Boolean]),\n default: '',\n },\n /**\n * @description class of view\n */\n viewClass: {\n type: definePropType<ClassValue>([String, Array, Object, Boolean]),\n default: '',\n },\n /**\n * @description style of view\n */\n viewStyle: {\n type: definePropType<StyleValue>([String, Object, Array, Boolean]),\n default: '',\n },\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n /**\n * @description element tag of the view\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description always show\n */\n always: Boolean,\n /**\n * @description minimum size of scrollbar\n */\n minSize: {\n type: Number,\n default: 20,\n },\n /**\n * @description Wrap tabindex\n */\n tabindex: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description id of view\n */\n id: String,\n /**\n * @description role of view\n */\n role: String,\n ...useAriaProps(['ariaLabel', 'ariaOrientation']),\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.\n */\nexport type ScrollbarPropsPublic = ExtractPublicPropTypes<typeof scrollbarProps>\n\nexport const scrollbarEmits = {\n 'end-reached': (direction: ScrollbarDirection) =>\n ['left', 'right', 'top', 'bottom'].includes(direction),\n scroll: ({\n scrollTop,\n scrollLeft,\n }: {\n scrollTop: number\n scrollLeft: number\n }) => [scrollTop, scrollLeft].every(isNumber),\n}\nexport type ScrollbarEmits = typeof scrollbarEmits\nexport type ScrollbarDirection = 'top' | 'bottom' | 'left' | 'right'\n\nexport type ScrollbarInstance = InstanceType<typeof Scrollbar> & unknown\n"],"mappings":";;;;;;;;AA2FA,MAAa,iBAAiBA,gBAAAA,WAAW;;;;CAIvC,UAAU;EACR,MAAM;EACN,SAAS;EACV;;;;CAID,QAAQ;EACN,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;;;;CAID,QAAQ;;;;CAIR,WAAW;EACT,MAAMC,gBAAAA,eAA2B;GAAC;GAAQ;GAAQ;GAAO;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,WAAW;EACT,MAAMA,gBAAAA,eAA2B;GAAC;GAAQ;GAAO;GAAQ;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,WAAW;EACT,MAAMA,gBAAAA,eAA2B;GAAC;GAAQ;GAAO;GAAQ;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,WAAW;EACT,MAAMA,gBAAAA,eAA2B;GAAC;GAAQ;GAAQ;GAAO;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,UAAU;;;;CAIV,KAAK;EACH,MAAM;EACN,SAAS;EACV;;;;CAID,QAAQ;;;;CAIR,SAAS;EACP,MAAM;EACN,SAAS;EACV;;;;CAID,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS,KAAA;EACV;;;;CAID,IAAI;;;;CAIJ,MAAM;CACN,GAAGC,cAAAA,aAAa,CAAC,aAAa,kBAAkB,CAAC;CAClD,CAAU;AAOX,MAAa,iBAAiB;CAC5B,gBAAgB,cACd;EAAC;EAAQ;EAAS;EAAO;EAAS,CAAC,SAAS,UAAU;CACxD,SAAS,EACP,WACA,iBAII,CAAC,WAAW,WAAW,CAAC,MAAMC,cAAAA,SAAS;CAC9C"}
@@ -1,3 +1,4 @@
1
+ import { ClassValue } from "../../../utils/typescript.js";
1
2
  import { ScrollbarDirection, ScrollbarProps } from "./scrollbar.js";
2
3
  import * as _$vue from "vue";
3
4
  import { CSSProperties, StyleValue } from "vue";
@@ -29,14 +30,14 @@ declare const __VLS_base: _$vue.DefineComponent<ScrollbarProps, {
29
30
  }) => any) | undefined;
30
31
  "onEnd-reached"?: ((direction: ScrollbarDirection) => any) | undefined;
31
32
  }>, {
33
+ tabindex: number | string;
32
34
  height: number | string;
33
35
  tag: keyof HTMLElementTagNameMap | (string & {});
34
- tabindex: number | string;
35
- maxHeight: number | string;
36
36
  distance: number;
37
+ maxHeight: number | string;
37
38
  wrapStyle: string | false | CSSProperties | StyleValue[] | null;
38
- wrapClass: string | string[];
39
- viewClass: string | string[];
39
+ wrapClass: string | false | Record<string, any> | ClassValue[] | null;
40
+ viewClass: string | false | Record<string, any> | ClassValue[] | null;
40
41
  viewStyle: string | false | CSSProperties | StyleValue[] | null;
41
42
  minSize: number;
42
43
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"thumb.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n @click.stop\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n />\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, ref, toRef } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { isClient, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { scrollbarContextKey } from './constants'\nimport { BAR_MAP, renderThumbStyle } from './util'\n\nimport type { ThumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nconst props = defineProps<ThumbProps>()\n\nconst scrollbar = inject(scrollbarContextKey)\nconst ns = useNamespace('scrollbar')\n\nif (!scrollbar) throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\nconst instance = ref<HTMLDivElement>()\nconst thumb = ref<HTMLDivElement>()\n\nconst thumbState = ref<Partial<Record<'X' | 'Y', number>>>({})\nconst visible = ref(false)\n\nlet cursorDown = false\nlet cursorLeave = false\nlet baseScrollHeight = 0\nlet baseScrollWidth = 0\nlet originalOnSelectStart:\n | ((this: GlobalEventHandlers, ev: Event) => any)\n | null = isClient ? document.onselectstart : null\n\nconst bar = computed(() => BAR_MAP[props.vertical ? 'vertical' : 'horizontal'])\n\nconst thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n)\n\nconst offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n)\n\nconst clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n}\n\nconst clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n baseScrollHeight = scrollbar.wrapElement!.scrollHeight\n baseScrollWidth = scrollbar.wrapElement!.scrollWidth\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n}\n\nconst mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n if (bar.value.scroll === 'scrollLeft') {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollWidth) / 100\n } else {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollHeight) / 100\n }\n}\n\nconst mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n}\n\nconst mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n}\n\nconst mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n}\n\nonBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n})\n\nconst restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n}\n\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n)\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n)\n</script>\n"],"mappings":";;;;;;;;;AA6BA,MAAM,iBAAiB;;;;;EACvB,MAAM,QAAQ;EAEd,MAAM,aAAA,GAAA,IAAA,QAAmB,kBAAA,oBAAmB;EAC5C,MAAM,KAAK,cAAA,aAAa,YAAW;EAEnC,IAAI,CAAC,WAAW,cAAA,WAAW,gBAAgB,mCAAkC;EAE7E,MAAM,YAAA,GAAA,IAAA,MAA+B;EACrC,MAAM,SAAA,GAAA,IAAA,MAA4B;EAElC,MAAM,cAAA,GAAA,IAAA,KAAqD,EAAE,CAAA;EAC7D,MAAM,WAAA,GAAA,IAAA,KAAc,MAAK;EAEzB,IAAI,aAAa;EACjB,IAAI,cAAc;EAClB,IAAI,mBAAmB;EACvB,IAAI,kBAAkB;EACtB,IAAI,wBAEO,aAAA,WAAW,SAAS,gBAAgB;EAE/C,MAAM,OAAA,GAAA,IAAA,gBAAqB,aAAA,QAAQ,MAAM,WAAW,aAAa,cAAa;EAE9E,MAAM,cAAA,GAAA,IAAA,gBACJ,aAAA,iBAAiB;GACf,MAAM,MAAM;GACZ,MAAM,MAAM;GACZ,KAAK,IAAI;GACV,CAAA,CACH;EAEA,MAAM,eAAA,GAAA,IAAA,gBAKF,SAAS,MAAO,IAAI,MAAM,WAAW,IACrC,UAAU,YAAa,IAAI,MAAM,cACjC,MAAM,QACN,MAAM,MAAO,IAAI,MAAM,QAC3B;EAEA,MAAM,qBAAqB,MAAkB;GAE3C,EAAE,iBAAgB;GAClB,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE;GAE5C,OAAO,cAAc,EAAE,iBAAgB;GACvC,UAAU,EAAC;GAEX,MAA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MAAO,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"thumb.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n @click.stop\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n />\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, ref, toRef } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { isClient, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { scrollbarContextKey } from './constants'\nimport { BAR_MAP, renderThumbStyle } from './util'\n\nimport type { ThumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nconst props = defineProps<ThumbProps>()\n\nconst scrollbar = inject(scrollbarContextKey)\nconst ns = useNamespace('scrollbar')\n\nif (!scrollbar) throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\nconst instance = ref<HTMLDivElement>()\nconst thumb = ref<HTMLDivElement>()\n\nconst thumbState = ref<Partial<Record<'X' | 'Y', number>>>({})\nconst visible = ref(false)\n\nlet cursorDown = false\nlet cursorLeave = false\nlet baseScrollHeight = 0\nlet baseScrollWidth = 0\nlet originalOnSelectStart:\n ((this: GlobalEventHandlers, ev: Event) => any) | null = isClient\n ? document.onselectstart\n : null\n\nconst bar = computed(() => BAR_MAP[props.vertical ? 'vertical' : 'horizontal'])\n\nconst thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n)\n\nconst offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n)\n\nconst clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n}\n\nconst clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n baseScrollHeight = scrollbar.wrapElement!.scrollHeight\n baseScrollWidth = scrollbar.wrapElement!.scrollWidth\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n}\n\nconst mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n if (bar.value.scroll === 'scrollLeft') {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollWidth) / 100\n } else {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollHeight) / 100\n }\n}\n\nconst mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n}\n\nconst mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n}\n\nconst mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n}\n\nonBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n})\n\nconst restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n}\n\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n)\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n)\n</script>\n"],"mappings":";;;;;;;;;AA6BA,MAAM,iBAAiB;;;;;EACvB,MAAM,QAAQ;EAEd,MAAM,aAAA,GAAA,IAAA,QAAmB,kBAAA,oBAAmB;EAC5C,MAAM,KAAK,cAAA,aAAa,YAAW;EAEnC,IAAI,CAAC,WAAW,cAAA,WAAW,gBAAgB,mCAAkC;EAE7E,MAAM,YAAA,GAAA,IAAA,MAA+B;EACrC,MAAM,SAAA,GAAA,IAAA,MAA4B;EAElC,MAAM,cAAA,GAAA,IAAA,KAAqD,EAAE,CAAA;EAC7D,MAAM,WAAA,GAAA,IAAA,KAAc,MAAK;EAEzB,IAAI,aAAa;EACjB,IAAI,cAAc;EAClB,IAAI,mBAAmB;EACvB,IAAI,kBAAkB;EACtB,IAAI,wBACuD,aAAA,WACvD,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AC,EAAC,OAAA;IAAvB,WAAA;;oCAcQ,EAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,oBAAA,OAAA;cAXA;KAAJ,KAAI;KACH,QAAA,GAAA,IAAA,gBAAK,EAAA,GAAA,IAAA,OAAG,GAAE,CAAC,EAAC,MAAA,GAAA,GAAA,IAAA,OAAS,GAAE,CAAC,GAAG,IAAA,MAAI,IAAG,CAAA,CAAA;KAClC,aAAW;KACX,SAAK,OAAA,OAAA,OAAA,MAAA,GAAA,IAAA,qBAAN,IAAW,CAAA,OAAA,CAAA;oCAOT,OAAA;cAJI;KAAJ,KAAI;KACH,QAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,OAAO,GAAE,CAAC,EAAC,QAAA,CAAA;KACX,QAAA,GAAA,IAAA,gBAAO,WAAA,MAAU;KACjB,aAAW;qCAVN,QAAA,UAAU,QAAA,MAAO,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"thumb2.js","names":[],"sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n @click.stop\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n />\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, ref, toRef } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { isClient, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { scrollbarContextKey } from './constants'\nimport { BAR_MAP, renderThumbStyle } from './util'\n\nimport type { ThumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nconst props = defineProps<ThumbProps>()\n\nconst scrollbar = inject(scrollbarContextKey)\nconst ns = useNamespace('scrollbar')\n\nif (!scrollbar) throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\nconst instance = ref<HTMLDivElement>()\nconst thumb = ref<HTMLDivElement>()\n\nconst thumbState = ref<Partial<Record<'X' | 'Y', number>>>({})\nconst visible = ref(false)\n\nlet cursorDown = false\nlet cursorLeave = false\nlet baseScrollHeight = 0\nlet baseScrollWidth = 0\nlet originalOnSelectStart:\n | ((this: GlobalEventHandlers, ev: Event) => any)\n | null = isClient ? document.onselectstart : null\n\nconst bar = computed(() => BAR_MAP[props.vertical ? 'vertical' : 'horizontal'])\n\nconst thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n)\n\nconst offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n)\n\nconst clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n}\n\nconst clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n baseScrollHeight = scrollbar.wrapElement!.scrollHeight\n baseScrollWidth = scrollbar.wrapElement!.scrollWidth\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n}\n\nconst mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n if (bar.value.scroll === 'scrollLeft') {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollWidth) / 100\n } else {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollHeight) / 100\n }\n}\n\nconst mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n}\n\nconst mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n}\n\nconst mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n}\n\nonBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n})\n\nconst restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n}\n\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n)\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n)\n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"thumb2.js","names":[],"sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n @click.stop\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n />\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, ref, toRef } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { isClient, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { scrollbarContextKey } from './constants'\nimport { BAR_MAP, renderThumbStyle } from './util'\n\nimport type { ThumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nconst props = defineProps<ThumbProps>()\n\nconst scrollbar = inject(scrollbarContextKey)\nconst ns = useNamespace('scrollbar')\n\nif (!scrollbar) throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\nconst instance = ref<HTMLDivElement>()\nconst thumb = ref<HTMLDivElement>()\n\nconst thumbState = ref<Partial<Record<'X' | 'Y', number>>>({})\nconst visible = ref(false)\n\nlet cursorDown = false\nlet cursorLeave = false\nlet baseScrollHeight = 0\nlet baseScrollWidth = 0\nlet originalOnSelectStart:\n ((this: GlobalEventHandlers, ev: Event) => any) | null = isClient\n ? document.onselectstart\n : null\n\nconst bar = computed(() => BAR_MAP[props.vertical ? 'vertical' : 'horizontal'])\n\nconst thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n)\n\nconst offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n)\n\nconst clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n}\n\nconst clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n baseScrollHeight = scrollbar.wrapElement!.scrollHeight\n baseScrollWidth = scrollbar.wrapElement!.scrollWidth\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n}\n\nconst mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n if (bar.value.scroll === 'scrollLeft') {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollWidth) / 100\n } else {\n scrollbar.wrapElement![bar.value.scroll] =\n (thumbPositionPercentage * baseScrollHeight) / 100\n }\n}\n\nconst mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n}\n\nconst mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n}\n\nconst mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n}\n\nonBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n})\n\nconst restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n}\n\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n)\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n)\n</script>\n"],"mappings":""}
@@ -5,12 +5,12 @@ import * as _$vue from "vue";
5
5
 
6
6
  //#region ../../packages/components/segmented/index.d.ts
7
7
  declare const ElSegmented: (<T extends Option = Option>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
8
- emit: ((event: "change", val: any) => void) & ((event: "update:modelValue", val: any) => void);
9
8
  slots: {
10
9
  default?: (props: {
11
10
  item: T;
12
11
  }) => any;
13
12
  };
13
+ emit: ((event: "update:modelValue", val: any) => void) & ((event: "change", val: any) => void);
14
14
  attrs: any;
15
15
  }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
16
16
  props: _$vue.PublicProps & {
@@ -25,8 +25,8 @@ declare const ElSegmented: (<T extends Option = Option>(__VLS_props: NonNullable
25
25
  id?: string | undefined;
26
26
  name?: string | undefined;
27
27
  ariaLabel?: string | undefined;
28
- onChange?: ((val: any) => any) | undefined;
29
28
  "onUpdate:modelValue"?: ((val: any) => any) | undefined;
29
+ onChange?: ((val: any) => any) | undefined;
30
30
  } & (typeof globalThis extends {
31
31
  __VLS_PROPS_FALLBACK: infer P;
32
32
  } ? P : {});
@@ -37,7 +37,7 @@ declare const ElSegmented: (<T extends Option = Option>(__VLS_props: NonNullable
37
37
  item: T;
38
38
  }) => any;
39
39
  };
40
- emit: ((event: "change", val: any) => void) & ((event: "update:modelValue", val: any) => void);
40
+ emit: ((event: "update:modelValue", val: any) => void) & ((event: "change", val: any) => void);
41
41
  }>) => _$vue.VNode & {
42
42
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
43
43
  }) & _$vue.ObjectPlugin & {
@@ -47,7 +47,7 @@ declare const ElSegmented: (<T extends Option = Option>(__VLS_props: NonNullable
47
47
  modelValue?: string | number | boolean | (() => string | number | boolean) | undefined;
48
48
  props?: (() => Props) | undefined;
49
49
  block?: boolean | (() => boolean) | undefined;
50
- size?: "" | "default" | "large" | "small" | (() => "" | "default" | "large" | "small") | undefined;
50
+ size?: "" | "small" | "default" | "large" | (() => "" | "small" | "default" | "large") | undefined;
51
51
  disabled?: boolean | (() => boolean) | undefined;
52
52
  validateEvent?: boolean | (() => boolean) | undefined;
53
53
  id?: string | (() => string) | undefined;
@@ -67,7 +67,7 @@ declare const segmentedProps: {
67
67
  props: EpPropFinalized<(new (...args: any[]) => Props) | (() => Props) | (((new (...args: any[]) => Props) | (() => Props)) | null)[], unknown, unknown, () => Required<Props>, boolean>;
68
68
  block: BooleanConstructor;
69
69
  size: {
70
- readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
70
+ readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
71
71
  readonly required: false;
72
72
  readonly validator: ((val: unknown) => boolean) | undefined;
73
73
  __epPropKey: true;
@@ -5,8 +5,8 @@ import * as _$vue from "vue";
5
5
  //#region ../../packages/components/segmented/src/segmented.vue.d.ts
6
6
  declare const __VLS_export: <T extends Option = Option>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
7
  props: _$vue.PublicProps & __VLS_PrettifyLocal<SegmentedProps<T> & {
8
- onChange?: ((val: any) => any) | undefined;
9
8
  "onUpdate:modelValue"?: ((val: any) => any) | undefined;
9
+ onChange?: ((val: any) => any) | undefined;
10
10
  }> & (typeof globalThis extends {
11
11
  __VLS_PROPS_FALLBACK: infer P;
12
12
  } ? P : {});
@@ -17,7 +17,7 @@ declare const __VLS_export: <T extends Option = Option>(__VLS_props: NonNullable
17
17
  item: T;
18
18
  }) => any;
19
19
  };
20
- emit: ((event: "change", val: any) => void) & ((event: "update:modelValue", val: any) => void);
20
+ emit: ((event: "update:modelValue", val: any) => void) & ((event: "change", val: any) => void);
21
21
  }>) => _$vue.VNode & {
22
22
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
23
23
  };
@@ -5,7 +5,7 @@ import * as _$vue from "vue";
5
5
  declare const COMPONENT_NAME = "ElOption";
6
6
  declare const optionProps: {
7
7
  value: {
8
- readonly type: _$vue.PropType<EpPropMergeType<(BooleanConstructor | StringConstructor | ObjectConstructor | NumberConstructor)[], unknown, unknown>>;
8
+ readonly type: _$vue.PropType<EpPropMergeType<(BooleanConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>>;
9
9
  readonly required: true;
10
10
  readonly validator: ((val: unknown) => boolean) | undefined;
11
11
  __epPropKey: true;
@@ -6,7 +6,7 @@ import * as _$vue from "vue";
6
6
  declare const _default: typeof __VLS_export;
7
7
  declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
8
8
  value: {
9
- readonly type: _$vue.PropType<EpPropMergeType<(BooleanConstructor | StringConstructor | ObjectConstructor | NumberConstructor)[], unknown, unknown>>;
9
+ readonly type: _$vue.PropType<EpPropMergeType<(BooleanConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>>;
10
10
  readonly required: true;
11
11
  readonly validator: ((val: unknown) => boolean) | undefined;
12
12
  __epPropKey: true;
@@ -59,7 +59,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
59
59
  selectOptionClick: () => void;
60
60
  }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
61
61
  value: {
62
- readonly type: _$vue.PropType<EpPropMergeType<(BooleanConstructor | StringConstructor | ObjectConstructor | NumberConstructor)[], unknown, unknown>>;
62
+ readonly type: _$vue.PropType<EpPropMergeType<(BooleanConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>>;
63
63
  readonly required: true;
64
64
  readonly validator: ((val: unknown) => boolean) | undefined;
65
65
  __epPropKey: true;
@@ -1,3 +1,4 @@
1
+ import { ClassValue } from "../../../utils/typescript.js";
1
2
  import * as _$vue from "vue";
2
3
 
3
4
  //#region ../../packages/components/select/src/select-dropdown.vue.d.ts
@@ -22,7 +23,7 @@ declare const __VLS_export: _$vue.DefineComponent<{}, {
22
23
  cssVarBlockName: (name: string) => string;
23
24
  };
24
25
  minWidth: _$vue.Ref<string, string>;
25
- popperClass: _$vue.ComputedRef<string>;
26
+ popperClass: _$vue.ComputedRef<string | false | Record<string, any> | ClassValue[] | null>;
26
27
  isMultiple: _$vue.ComputedRef<boolean>;
27
28
  isFitInputWidth: _$vue.ComputedRef<boolean>;
28
29
  }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;