naive-ui 2.20.2 → 2.21.2

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 (428) hide show
  1. package/es/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
  2. package/es/_internal/scrollbar/src/ScrollBar.js +9 -4
  3. package/es/_internal/select-menu/src/SelectMenu.d.ts +5 -1
  4. package/es/_internal/selection/src/Selection.d.ts +5 -1
  5. package/es/_internal/suffix/src/Suffix.d.ts +5 -2
  6. package/es/_internal/suffix/src/Suffix.js +4 -1
  7. package/es/_styles/common/dark.js +2 -1
  8. package/es/_styles/common/light.d.ts +4 -0
  9. package/es/_styles/common/light.js +5 -2
  10. package/es/_styles/global/index.cssr.js +9 -4
  11. package/es/_styles/transitions/icon-switch.cssr.js +6 -2
  12. package/es/_utils/naive/extract-public-props.d.ts +1 -1
  13. package/es/alert/src/Alert.d.ts +4 -0
  14. package/es/auto-complete/src/AutoComplete.d.ts +9 -1
  15. package/es/auto-complete/src/AutoComplete.js +5 -2
  16. package/es/avatar/src/Avatar.d.ts +8 -1
  17. package/es/avatar/src/Avatar.js +41 -9
  18. package/es/avatar/src/styles/index.cssr.js +2 -2
  19. package/es/button/src/Button.d.ts +149 -52
  20. package/es/button/src/Button.js +128 -56
  21. package/es/button/src/interface.d.ts +1 -1
  22. package/es/button/src/styles/button.cssr.js +1 -0
  23. package/es/button/styles/dark.js +3 -0
  24. package/es/button/styles/light.d.ts +14 -5
  25. package/es/button/styles/light.js +10 -3
  26. package/es/calendar/src/Calendar.d.ts +144 -50
  27. package/es/calendar/styles/light.d.ts +14 -5
  28. package/es/card/src/Card.d.ts +4 -0
  29. package/es/cascader/src/Cascader.d.ts +4 -0
  30. package/es/cascader/src/CascaderOption.d.ts +4 -0
  31. package/es/cascader/src/CascaderSelectMenu.d.ts +4 -0
  32. package/es/cascader/src/CascaderSubmenu.d.ts +4 -0
  33. package/es/checkbox/src/Checkbox.d.ts +9 -5
  34. package/es/checkbox/src/Checkbox.js +8 -9
  35. package/es/collapse/src/Collapse.d.ts +4 -0
  36. package/es/color-picker/src/ColorInputUnit.d.ts +18 -5
  37. package/es/color-picker/src/ColorPicker.d.ts +126 -45
  38. package/es/color-picker/styles/light.d.ts +14 -5
  39. package/es/data-table/src/DataTable.d.ts +184 -51
  40. package/es/data-table/src/DataTable.js +11 -6
  41. package/es/data-table/src/HeaderButton/FilterButton.d.ts +21 -5
  42. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +22 -6
  43. package/es/data-table/src/TableParts/Body.d.ts +26 -6
  44. package/es/data-table/src/TableParts/Body.js +77 -39
  45. package/es/data-table/src/TableParts/BodyCheckbox.js +1 -1
  46. package/es/data-table/src/TableParts/Cell.d.ts +42 -10
  47. package/es/data-table/src/TableParts/Header.d.ts +21 -5
  48. package/es/data-table/src/TableParts/Header.js +1 -1
  49. package/es/data-table/src/interface.d.ts +4 -1
  50. package/es/data-table/src/styles/index.cssr.js +9 -10
  51. package/es/data-table/src/use-table-data.js +3 -3
  52. package/es/data-table/styles/light.d.ts +20 -5
  53. package/es/data-table/styles/light.js +4 -4
  54. package/es/date-picker/src/DatePicker.d.ts +329 -127
  55. package/es/date-picker/src/DatePicker.js +7 -17
  56. package/es/date-picker/src/config.d.ts +9 -0
  57. package/es/date-picker/src/config.js +8 -0
  58. package/es/date-picker/src/panel/date.d.ts +53 -20
  59. package/es/date-picker/src/panel/daterange.d.ts +52 -19
  60. package/es/date-picker/src/panel/datetime.d.ts +53 -20
  61. package/es/date-picker/src/panel/datetimerange.d.ts +52 -19
  62. package/es/date-picker/src/panel/month.d.ts +88 -61
  63. package/es/date-picker/src/panel/month.js +9 -6
  64. package/es/date-picker/src/panel/use-calendar.d.ts +61 -28
  65. package/es/date-picker/src/panel/use-calendar.js +9 -2
  66. package/es/date-picker/src/panel/use-dual-calendar.d.ts +50 -17
  67. package/es/date-picker/src/panel/use-dual-calendar.js +4 -0
  68. package/es/date-picker/src/panel/use-panel-common.d.ts +48 -15
  69. package/es/date-picker/styles/_common.d.ts +2 -0
  70. package/es/date-picker/styles/_common.js +3 -1
  71. package/es/date-picker/styles/light.d.ts +32 -10
  72. package/es/dialog/src/Dialog.d.ts +105 -38
  73. package/es/dialog/src/DialogEnvironment.d.ts +2 -2
  74. package/es/dialog/src/DialogProvider.d.ts +2 -2
  75. package/es/dialog/styles/light.d.ts +14 -5
  76. package/es/drawer/src/Drawer.d.ts +4 -0
  77. package/es/drawer/src/DrawerBodyWrapper.d.ts +4 -0
  78. package/es/drawer/src/DrawerContent.d.ts +4 -0
  79. package/es/dropdown/index.d.ts +1 -1
  80. package/es/dropdown/src/Dropdown.d.ts +11 -7
  81. package/es/dropdown/src/DropdownGroup.d.ts +2 -3
  82. package/es/dropdown/src/DropdownGroupHeader.js +3 -3
  83. package/es/dropdown/src/DropdownMenu.d.ts +3 -4
  84. package/es/dropdown/src/DropdownMenu.js +5 -4
  85. package/es/dropdown/src/DropdownOption.d.ts +3 -4
  86. package/es/dropdown/src/DropdownOption.js +5 -4
  87. package/es/dropdown/src/DropdownRenderOption.d.ts +2 -3
  88. package/es/dropdown/src/interface.d.ts +9 -30
  89. package/es/dynamic-input/src/DynamicInput.d.ts +144 -50
  90. package/es/dynamic-input/src/InputPreset.d.ts +18 -5
  91. package/es/dynamic-input/src/PairPreset.d.ts +18 -5
  92. package/es/dynamic-input/styles/light.d.ts +14 -5
  93. package/es/dynamic-tags/src/DynamicTags.d.ts +145 -50
  94. package/es/dynamic-tags/styles/light.d.ts +14 -5
  95. package/es/ellipsis/src/Ellipsis.d.ts +4 -0
  96. package/es/form/src/FormItemGridItem.d.ts +2 -2
  97. package/es/global-style/src/GlobalStyle.js +2 -0
  98. package/es/grid/src/Grid.js +1 -0
  99. package/es/grid/src/GridItem.d.ts +2 -2
  100. package/es/image/src/ImagePreview.d.ts +1 -0
  101. package/es/image/src/ImagePreview.js +51 -4
  102. package/es/image/src/interface.d.ts +6 -0
  103. package/es/image/src/interface.js +1 -0
  104. package/es/input/src/Input.d.ts +5 -0
  105. package/es/input/src/Input.js +9 -3
  106. package/es/input/src/interface.d.ts +1 -0
  107. package/es/input-number/src/InputNumber.d.ts +179 -50
  108. package/es/input-number/src/InputNumber.js +22 -6
  109. package/es/input-number/styles/light.d.ts +14 -5
  110. package/es/layout/src/Layout.d.ts +8 -0
  111. package/es/layout/src/LayoutContent.d.ts +4 -0
  112. package/es/layout/src/LayoutSider.d.ts +4 -0
  113. package/es/locales/index.d.ts +2 -0
  114. package/es/locales/index.js +1 -0
  115. package/es/locales/utils/index.d.ts +8 -0
  116. package/es/locales/utils/index.js +4 -0
  117. package/es/log/src/Log.d.ts +10 -25
  118. package/es/log/src/Log.js +2 -11
  119. package/es/log/src/LogLine.d.ts +1 -0
  120. package/es/log/src/LogLine.js +12 -10
  121. package/es/mention/src/Mention.d.ts +5 -0
  122. package/es/menu/index.d.ts +1 -1
  123. package/es/menu/src/Menu.d.ts +33 -8
  124. package/es/menu/src/Menu.js +32 -10
  125. package/es/menu/src/MenuDivider.d.ts +2 -0
  126. package/es/menu/src/MenuDivider.js +11 -0
  127. package/es/menu/src/MenuOption.d.ts +12 -2
  128. package/es/menu/src/MenuOptionContent.d.ts +7 -2
  129. package/es/menu/src/Submenu.d.ts +21 -17
  130. package/es/menu/src/interface.d.ts +23 -4
  131. package/es/menu/src/styles/index.cssr.js +6 -1
  132. package/es/menu/src/utils.d.ts +4 -2
  133. package/es/menu/src/utils.js +16 -2
  134. package/es/menu/styles/light.d.ts +2 -0
  135. package/es/menu/styles/light.js +3 -2
  136. package/es/modal/src/BodyWrapper.d.ts +34 -12
  137. package/es/modal/src/Modal.d.ts +174 -66
  138. package/es/modal/src/presetProps.d.ts +1 -1
  139. package/es/modal/styles/light.d.ts +14 -5
  140. package/es/notification/src/NotificationContainer.d.ts +11 -0
  141. package/es/notification/src/NotificationContainer.js +7 -2
  142. package/es/notification/src/NotificationProvider.d.ts +17 -0
  143. package/es/notification/src/NotificationProvider.js +38 -3
  144. package/es/notification/src/styles/index.cssr.d.ts +2 -1
  145. package/es/notification/src/styles/index.cssr.js +41 -12
  146. package/es/pagination/index.d.ts +1 -1
  147. package/es/pagination/src/Pagination.d.ts +21 -12
  148. package/es/pagination/src/Pagination.js +16 -6
  149. package/es/pagination/src/interface.d.ts +2 -0
  150. package/es/popconfirm/src/Popconfirm.d.ts +151 -57
  151. package/es/popconfirm/src/PopconfirmPanel.d.ts +2 -2
  152. package/es/popconfirm/styles/light.d.ts +14 -5
  153. package/es/popover/src/Popover.d.ts +6 -6
  154. package/es/popover/src/Popover.js +2 -5
  155. package/es/popover/src/PopoverBody.d.ts +5 -5
  156. package/es/popover/src/PopoverBody.js +2 -1
  157. package/es/popover/src/styles/index.cssr.js +0 -1
  158. package/es/popselect/src/Popselect.d.ts +9 -5
  159. package/es/popselect/src/PopselectPanel.d.ts +4 -0
  160. package/es/radio/src/Radio.d.ts +3 -0
  161. package/es/radio/src/RadioButton.d.ts +3 -0
  162. package/es/radio/src/use-radio.d.ts +2 -0
  163. package/es/radio/src/use-radio.js +6 -3
  164. package/es/select/src/Select.d.ts +4 -0
  165. package/es/slider/src/Slider.d.ts +71 -91
  166. package/es/slider/src/Slider.js +342 -583
  167. package/es/slider/src/interface.d.ts +1 -1
  168. package/es/slider/src/styles/index.cssr.js +86 -16
  169. package/es/slider/src/utils.d.ts +10 -1
  170. package/es/slider/src/utils.js +9 -0
  171. package/es/slider/styles/_common.d.ts +1 -0
  172. package/es/slider/styles/_common.js +1 -0
  173. package/es/slider/styles/light.d.ts +1 -0
  174. package/es/space/src/Space.js +2 -0
  175. package/es/steps/src/Step.js +1 -1
  176. package/es/table/src/Table.d.ts +35 -0
  177. package/es/table/src/Table.js +8 -4
  178. package/es/table/src/styles/index.cssr.js +1 -1
  179. package/es/table/styles/light.d.ts +3 -0
  180. package/es/table/styles/light.js +2 -2
  181. package/es/tabs/index.d.ts +2 -0
  182. package/es/tabs/index.js +1 -0
  183. package/es/tabs/src/Tab.d.ts +35 -18
  184. package/es/tabs/src/Tab.js +11 -12
  185. package/es/tabs/src/Tabs.js +58 -18
  186. package/es/tag/src/Tag.d.ts +8 -3
  187. package/es/tag/src/Tag.js +10 -2
  188. package/es/tag/src/styles/index.cssr.js +10 -5
  189. package/es/tag/src/styles/rtl.cssr.js +7 -1
  190. package/es/theme-editor/src/ThemeEditor.d.ts +4 -0
  191. package/es/time-picker/src/Panel.d.ts +18 -5
  192. package/es/time-picker/src/TimePicker.d.ts +145 -50
  193. package/es/time-picker/src/TimePicker.js +3 -0
  194. package/es/time-picker/styles/light.d.ts +14 -5
  195. package/es/tooltip/src/Tooltip.d.ts +9 -5
  196. package/es/transfer/src/Transfer.d.ts +146 -52
  197. package/es/transfer/src/TransferFilter.d.ts +18 -5
  198. package/es/transfer/src/TransferList.d.ts +18 -5
  199. package/es/transfer/src/TransferListItem.d.ts +18 -5
  200. package/es/transfer/styles/light.d.ts +14 -5
  201. package/es/tree/src/Tree.d.ts +10 -6
  202. package/es/tree/src/TreeNodeCheckbox.d.ts +4 -0
  203. package/es/tree/src/TreeNodeSwitcher.d.ts +1 -1
  204. package/es/tree-select/src/TreeSelect.d.ts +6 -2
  205. package/es/upload/index.d.ts +1 -2
  206. package/es/upload/src/Upload.d.ts +151 -59
  207. package/es/upload/src/Upload.js +69 -16
  208. package/es/upload/src/UploadFile.d.ts +19 -6
  209. package/es/upload/src/UploadProgress.d.ts +18 -5
  210. package/es/upload/src/interface.d.ts +14 -1
  211. package/es/upload/styles/light.d.ts +14 -5
  212. package/es/version.d.ts +1 -1
  213. package/es/version.js +1 -1
  214. package/lib/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
  215. package/lib/_internal/scrollbar/src/ScrollBar.js +9 -4
  216. package/lib/_internal/select-menu/src/SelectMenu.d.ts +5 -1
  217. package/lib/_internal/selection/src/Selection.d.ts +5 -1
  218. package/lib/_internal/suffix/src/Suffix.d.ts +5 -2
  219. package/lib/_internal/suffix/src/Suffix.js +4 -1
  220. package/lib/_styles/common/dark.js +2 -1
  221. package/lib/_styles/common/light.d.ts +4 -0
  222. package/lib/_styles/common/light.js +5 -2
  223. package/lib/_styles/global/index.cssr.js +10 -5
  224. package/lib/_styles/transitions/icon-switch.cssr.js +7 -2
  225. package/lib/_utils/naive/extract-public-props.d.ts +1 -1
  226. package/lib/alert/src/Alert.d.ts +4 -0
  227. package/lib/auto-complete/src/AutoComplete.d.ts +9 -1
  228. package/lib/auto-complete/src/AutoComplete.js +5 -2
  229. package/lib/avatar/src/Avatar.d.ts +8 -1
  230. package/lib/avatar/src/Avatar.js +40 -8
  231. package/lib/avatar/src/styles/index.cssr.js +2 -2
  232. package/lib/button/src/Button.d.ts +149 -52
  233. package/lib/button/src/Button.js +126 -54
  234. package/lib/button/src/interface.d.ts +1 -1
  235. package/lib/button/src/styles/button.cssr.js +1 -0
  236. package/lib/button/styles/dark.js +3 -0
  237. package/lib/button/styles/light.d.ts +14 -5
  238. package/lib/button/styles/light.js +10 -3
  239. package/lib/calendar/src/Calendar.d.ts +144 -50
  240. package/lib/calendar/styles/light.d.ts +14 -5
  241. package/lib/card/src/Card.d.ts +4 -0
  242. package/lib/cascader/src/Cascader.d.ts +4 -0
  243. package/lib/cascader/src/CascaderOption.d.ts +4 -0
  244. package/lib/cascader/src/CascaderSelectMenu.d.ts +4 -0
  245. package/lib/cascader/src/CascaderSubmenu.d.ts +4 -0
  246. package/lib/checkbox/src/Checkbox.d.ts +9 -5
  247. package/lib/checkbox/src/Checkbox.js +8 -9
  248. package/lib/collapse/src/Collapse.d.ts +4 -0
  249. package/lib/color-picker/src/ColorInputUnit.d.ts +18 -5
  250. package/lib/color-picker/src/ColorPicker.d.ts +126 -45
  251. package/lib/color-picker/styles/light.d.ts +14 -5
  252. package/lib/data-table/src/DataTable.d.ts +184 -51
  253. package/lib/data-table/src/DataTable.js +11 -6
  254. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +21 -5
  255. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +22 -6
  256. package/lib/data-table/src/TableParts/Body.d.ts +26 -6
  257. package/lib/data-table/src/TableParts/Body.js +77 -39
  258. package/lib/data-table/src/TableParts/BodyCheckbox.js +1 -1
  259. package/lib/data-table/src/TableParts/Cell.d.ts +42 -10
  260. package/lib/data-table/src/TableParts/Header.d.ts +21 -5
  261. package/lib/data-table/src/TableParts/Header.js +1 -1
  262. package/lib/data-table/src/interface.d.ts +4 -1
  263. package/lib/data-table/src/styles/index.cssr.js +9 -10
  264. package/lib/data-table/src/use-table-data.js +3 -3
  265. package/lib/data-table/styles/light.d.ts +20 -5
  266. package/lib/data-table/styles/light.js +4 -4
  267. package/lib/date-picker/src/DatePicker.d.ts +329 -127
  268. package/lib/date-picker/src/DatePicker.js +7 -17
  269. package/lib/date-picker/src/config.d.ts +9 -0
  270. package/lib/date-picker/src/config.js +9 -1
  271. package/lib/date-picker/src/panel/date.d.ts +53 -20
  272. package/lib/date-picker/src/panel/daterange.d.ts +52 -19
  273. package/lib/date-picker/src/panel/datetime.d.ts +53 -20
  274. package/lib/date-picker/src/panel/datetimerange.d.ts +52 -19
  275. package/lib/date-picker/src/panel/month.d.ts +88 -61
  276. package/lib/date-picker/src/panel/month.js +9 -6
  277. package/lib/date-picker/src/panel/use-calendar.d.ts +61 -28
  278. package/lib/date-picker/src/panel/use-calendar.js +8 -1
  279. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +50 -17
  280. package/lib/date-picker/src/panel/use-dual-calendar.js +4 -0
  281. package/lib/date-picker/src/panel/use-panel-common.d.ts +48 -15
  282. package/lib/date-picker/styles/_common.d.ts +2 -0
  283. package/lib/date-picker/styles/_common.js +3 -1
  284. package/lib/date-picker/styles/light.d.ts +32 -10
  285. package/lib/dialog/src/Dialog.d.ts +105 -38
  286. package/lib/dialog/src/DialogEnvironment.d.ts +2 -2
  287. package/lib/dialog/src/DialogProvider.d.ts +2 -2
  288. package/lib/dialog/styles/light.d.ts +14 -5
  289. package/lib/drawer/src/Drawer.d.ts +4 -0
  290. package/lib/drawer/src/DrawerBodyWrapper.d.ts +4 -0
  291. package/lib/drawer/src/DrawerContent.d.ts +4 -0
  292. package/lib/dropdown/index.d.ts +1 -1
  293. package/lib/dropdown/src/Dropdown.d.ts +11 -7
  294. package/lib/dropdown/src/DropdownGroup.d.ts +2 -3
  295. package/lib/dropdown/src/DropdownGroupHeader.js +3 -3
  296. package/lib/dropdown/src/DropdownMenu.d.ts +3 -4
  297. package/lib/dropdown/src/DropdownMenu.js +5 -4
  298. package/lib/dropdown/src/DropdownOption.d.ts +3 -4
  299. package/lib/dropdown/src/DropdownOption.js +5 -4
  300. package/lib/dropdown/src/DropdownRenderOption.d.ts +2 -3
  301. package/lib/dropdown/src/interface.d.ts +9 -30
  302. package/lib/dynamic-input/src/DynamicInput.d.ts +144 -50
  303. package/lib/dynamic-input/src/InputPreset.d.ts +18 -5
  304. package/lib/dynamic-input/src/PairPreset.d.ts +18 -5
  305. package/lib/dynamic-input/styles/light.d.ts +14 -5
  306. package/lib/dynamic-tags/src/DynamicTags.d.ts +145 -50
  307. package/lib/dynamic-tags/styles/light.d.ts +14 -5
  308. package/lib/ellipsis/src/Ellipsis.d.ts +4 -0
  309. package/lib/form/src/FormItemGridItem.d.ts +2 -2
  310. package/lib/global-style/src/GlobalStyle.js +2 -0
  311. package/lib/grid/src/Grid.js +1 -0
  312. package/lib/grid/src/GridItem.d.ts +2 -2
  313. package/lib/image/src/ImagePreview.d.ts +1 -0
  314. package/lib/image/src/ImagePreview.js +51 -4
  315. package/lib/image/src/interface.d.ts +6 -0
  316. package/lib/image/src/interface.js +2 -0
  317. package/lib/input/src/Input.d.ts +5 -0
  318. package/lib/input/src/Input.js +9 -3
  319. package/lib/input/src/interface.d.ts +1 -0
  320. package/lib/input-number/src/InputNumber.d.ts +179 -50
  321. package/lib/input-number/src/InputNumber.js +22 -6
  322. package/lib/input-number/styles/light.d.ts +14 -5
  323. package/lib/layout/src/Layout.d.ts +8 -0
  324. package/lib/layout/src/LayoutContent.d.ts +4 -0
  325. package/lib/layout/src/LayoutSider.d.ts +4 -0
  326. package/lib/locales/index.d.ts +2 -0
  327. package/lib/locales/index.js +3 -1
  328. package/lib/locales/utils/index.d.ts +8 -0
  329. package/lib/locales/utils/index.js +8 -0
  330. package/lib/log/src/Log.d.ts +10 -25
  331. package/lib/log/src/Log.js +2 -11
  332. package/lib/log/src/LogLine.d.ts +1 -0
  333. package/lib/log/src/LogLine.js +11 -9
  334. package/lib/mention/src/Mention.d.ts +5 -0
  335. package/lib/menu/index.d.ts +1 -1
  336. package/lib/menu/src/Menu.d.ts +33 -8
  337. package/lib/menu/src/Menu.js +31 -9
  338. package/lib/menu/src/MenuDivider.d.ts +2 -0
  339. package/lib/menu/src/MenuDivider.js +13 -0
  340. package/lib/menu/src/MenuOption.d.ts +12 -2
  341. package/lib/menu/src/MenuOptionContent.d.ts +7 -2
  342. package/lib/menu/src/Submenu.d.ts +21 -17
  343. package/lib/menu/src/interface.d.ts +23 -4
  344. package/lib/menu/src/styles/index.cssr.js +6 -1
  345. package/lib/menu/src/utils.d.ts +4 -2
  346. package/lib/menu/src/utils.js +22 -3
  347. package/lib/menu/styles/light.d.ts +2 -0
  348. package/lib/menu/styles/light.js +3 -2
  349. package/lib/modal/src/BodyWrapper.d.ts +34 -12
  350. package/lib/modal/src/Modal.d.ts +174 -66
  351. package/lib/modal/src/presetProps.d.ts +1 -1
  352. package/lib/modal/styles/light.d.ts +14 -5
  353. package/lib/notification/src/NotificationContainer.d.ts +11 -0
  354. package/lib/notification/src/NotificationContainer.js +7 -2
  355. package/lib/notification/src/NotificationProvider.d.ts +17 -0
  356. package/lib/notification/src/NotificationProvider.js +38 -3
  357. package/lib/notification/src/styles/index.cssr.d.ts +2 -1
  358. package/lib/notification/src/styles/index.cssr.js +41 -12
  359. package/lib/pagination/index.d.ts +1 -1
  360. package/lib/pagination/src/Pagination.d.ts +21 -12
  361. package/lib/pagination/src/Pagination.js +16 -6
  362. package/lib/pagination/src/interface.d.ts +2 -0
  363. package/lib/popconfirm/src/Popconfirm.d.ts +151 -57
  364. package/lib/popconfirm/src/PopconfirmPanel.d.ts +2 -2
  365. package/lib/popconfirm/styles/light.d.ts +14 -5
  366. package/lib/popover/src/Popover.d.ts +6 -6
  367. package/lib/popover/src/Popover.js +2 -5
  368. package/lib/popover/src/PopoverBody.d.ts +5 -5
  369. package/lib/popover/src/PopoverBody.js +2 -1
  370. package/lib/popover/src/styles/index.cssr.js +0 -1
  371. package/lib/popselect/src/Popselect.d.ts +9 -5
  372. package/lib/popselect/src/PopselectPanel.d.ts +4 -0
  373. package/lib/radio/src/Radio.d.ts +3 -0
  374. package/lib/radio/src/RadioButton.d.ts +3 -0
  375. package/lib/radio/src/use-radio.d.ts +2 -0
  376. package/lib/radio/src/use-radio.js +6 -3
  377. package/lib/select/src/Select.d.ts +4 -0
  378. package/lib/slider/src/Slider.d.ts +71 -91
  379. package/lib/slider/src/Slider.js +340 -581
  380. package/lib/slider/src/interface.d.ts +1 -1
  381. package/lib/slider/src/styles/index.cssr.js +86 -16
  382. package/lib/slider/src/utils.d.ts +10 -1
  383. package/lib/slider/src/utils.js +11 -1
  384. package/lib/slider/styles/_common.d.ts +1 -0
  385. package/lib/slider/styles/_common.js +1 -0
  386. package/lib/slider/styles/light.d.ts +1 -0
  387. package/lib/space/src/Space.js +2 -0
  388. package/lib/steps/src/Step.js +1 -1
  389. package/lib/table/src/Table.d.ts +35 -0
  390. package/lib/table/src/Table.js +8 -4
  391. package/lib/table/src/styles/index.cssr.js +1 -1
  392. package/lib/table/styles/light.d.ts +3 -0
  393. package/lib/table/styles/light.js +2 -2
  394. package/lib/tabs/index.d.ts +2 -0
  395. package/lib/tabs/index.js +3 -1
  396. package/lib/tabs/src/Tab.d.ts +35 -18
  397. package/lib/tabs/src/Tab.js +10 -11
  398. package/lib/tabs/src/Tabs.js +57 -17
  399. package/lib/tag/src/Tag.d.ts +8 -3
  400. package/lib/tag/src/Tag.js +10 -1
  401. package/lib/tag/src/styles/index.cssr.js +10 -5
  402. package/lib/tag/src/styles/rtl.cssr.js +7 -1
  403. package/lib/theme-editor/src/ThemeEditor.d.ts +4 -0
  404. package/lib/time-picker/src/Panel.d.ts +18 -5
  405. package/lib/time-picker/src/TimePicker.d.ts +145 -50
  406. package/lib/time-picker/src/TimePicker.js +3 -0
  407. package/lib/time-picker/styles/light.d.ts +14 -5
  408. package/lib/tooltip/src/Tooltip.d.ts +9 -5
  409. package/lib/transfer/src/Transfer.d.ts +146 -52
  410. package/lib/transfer/src/TransferFilter.d.ts +18 -5
  411. package/lib/transfer/src/TransferList.d.ts +18 -5
  412. package/lib/transfer/src/TransferListItem.d.ts +18 -5
  413. package/lib/transfer/styles/light.d.ts +14 -5
  414. package/lib/tree/src/Tree.d.ts +10 -6
  415. package/lib/tree/src/TreeNodeCheckbox.d.ts +4 -0
  416. package/lib/tree/src/TreeNodeSwitcher.d.ts +1 -1
  417. package/lib/tree-select/src/TreeSelect.d.ts +6 -2
  418. package/lib/upload/index.d.ts +1 -2
  419. package/lib/upload/src/Upload.d.ts +151 -59
  420. package/lib/upload/src/Upload.js +69 -16
  421. package/lib/upload/src/UploadFile.d.ts +19 -6
  422. package/lib/upload/src/UploadProgress.d.ts +18 -5
  423. package/lib/upload/src/interface.d.ts +14 -1
  424. package/lib/upload/styles/light.d.ts +14 -5
  425. package/lib/version.d.ts +1 -1
  426. package/lib/version.js +1 -1
  427. package/package.json +10 -9
  428. package/web-types.json +205 -14
@@ -1,12 +1,14 @@
1
- import { h, ref, toRef, computed, watch, nextTick, defineComponent, Transition, onBeforeUnmount } from 'vue';
1
+ import { h, ref, toRef, computed, watch, nextTick, defineComponent, Transition } from 'vue';
2
2
  import { VBinder, VTarget, VFollower } from 'vueuc';
3
3
  import { useIsMounted, useMergedState } from 'vooks';
4
4
  import { on, off } from 'evtd';
5
5
  import { useTheme, useFormItem, useConfig } from '../../_mixins';
6
- import { warn, call, useAdjustedTo } from '../../_utils';
6
+ import { call, useAdjustedTo } from '../../_utils';
7
7
  import { sliderLight } from '../styles';
8
+ import { isTouchEvent, useRefs } from './utils';
8
9
  import style from './styles/index.cssr';
9
- import { isTouchEvent } from './utils';
10
+ // ref: https://developer.mozilla.org/zh-CN/docs/Web/API/MouseEvent/button
11
+ const eventButtonLeft = 0;
10
12
  const sliderProps = Object.assign(Object.assign({}, useTheme.props), { to: useAdjustedTo.propTo, defaultValue: {
11
13
  type: [Number, Array],
12
14
  default: 0
@@ -20,150 +22,149 @@ const sliderProps = Object.assign(Object.assign({}, useTheme.props), { to: useAd
20
22
  type: Number,
21
23
  default: 100
22
24
  }, step: {
23
- type: Number,
25
+ type: [Number, String],
24
26
  default: 1
25
- }, range: Boolean, value: [Number, Array], placement: {
26
- type: String,
27
- default: 'top'
28
- }, showTooltip: {
27
+ }, range: Boolean, value: [Number, Array], placement: String, showTooltip: {
29
28
  type: Boolean,
30
29
  default: undefined
31
30
  }, tooltip: {
32
31
  type: Boolean,
33
32
  default: true
34
- }, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array],
35
- // deprecated
36
- onChange: {
37
- type: [Function, Array],
38
- validator: () => {
39
- if (process.env.NODE_ENV !== 'production') {
40
- warn('slider', '`on-change` is deprecated, please use `on-update:value` instead.');
41
- }
42
- return true;
43
- },
44
- default: undefined
45
- } });
33
+ }, vertical: Boolean, reverse: Boolean, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array] });
46
34
  export default defineComponent({
47
35
  name: 'Slider',
48
36
  props: sliderProps,
49
37
  setup(props) {
50
38
  const { mergedClsPrefixRef, namespaceRef } = useConfig(props);
51
39
  const themeRef = useTheme('Slider', 'Slider', style, sliderLight, props, mergedClsPrefixRef);
40
+ // dom ref
41
+ const handleRailRef = ref(null);
42
+ const [handleRefs, setHandleRefs] = useRefs();
43
+ const [followerRefs, setFollowerRefs] = useRefs();
44
+ const followerEnabledIndexSetRef = ref(new Set());
45
+ // data ref
52
46
  const formItem = useFormItem(props);
53
47
  const { mergedDisabledRef } = formItem;
54
- const handleRef1 = ref(null);
55
- const handleRef2 = ref(null);
56
- const railRef = ref(null);
57
- const followerRef1 = ref(null);
58
- const followerRef2 = ref(null);
59
48
  const precisionRef = computed(() => {
60
- const precisions = [props.min, props.max, props.step].map((item) => {
61
- const fraction = String(item).split('.')[1];
62
- return fraction ? fraction.length : 0;
63
- });
64
- return Math.max(...precisions);
49
+ const { step } = props;
50
+ if (step <= 0 || step === 'mark')
51
+ return 0;
52
+ const stepString = step.toString();
53
+ let precision = 0;
54
+ if (stepString.includes('.')) {
55
+ precision = stepString.length - stepString.indexOf('.') - 1;
56
+ }
57
+ return precision;
65
58
  });
66
59
  const uncontrolledValueRef = ref(props.defaultValue);
67
60
  const controlledValueRef = toRef(props, 'value');
68
61
  const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
69
- const memoziedOtherValueRef = ref(0);
70
- const changeSourceRef = ref(null);
71
- const handleActive1Ref = ref(false);
72
- const handleActive2Ref = ref(false);
73
- const handleClicked1Ref = ref(false);
74
- const handleClicked2Ref = ref(false);
75
- const controlledShowTooltipRef = toRef(props, 'showTooltip');
76
- const mergedShowTooltip1Ref = useMergedState(controlledShowTooltipRef, handleActive1Ref);
77
- const mergedShowTooltip2Ref = useMergedState(controlledShowTooltipRef, handleActive2Ref);
62
+ const arrifiedValueRef = computed(() => {
63
+ const { value: mergedValue } = mergedValueRef;
64
+ return (props.range ? mergedValue : [mergedValue]).map(clampValue);
65
+ });
66
+ const handleCountExceeds2Ref = computed(() => arrifiedValueRef.value.length > 2);
67
+ const mergedPlacementRef = computed(() => {
68
+ return props.placement === undefined
69
+ ? props.vertical
70
+ ? 'right'
71
+ : 'top'
72
+ : props.placement;
73
+ });
74
+ const markValuesRef = computed(() => {
75
+ const { marks } = props;
76
+ return marks ? Object.keys(marks).map(parseFloat) : null;
77
+ });
78
+ // status ref
79
+ const activeIndexRef = ref(-1);
80
+ const previousIndexRef = ref(-1);
81
+ const hoverIndexRef = ref(-1);
82
+ const draggingRef = ref(false);
83
+ // style ref
78
84
  const dotTransitionDisabledRef = ref(false);
79
- const activeRef = computed(() => {
80
- return handleActive1Ref.value || handleActive2Ref.value;
85
+ const styleDirectionRef = computed(() => {
86
+ const { vertical, reverse } = props;
87
+ const left = reverse ? 'right' : 'left';
88
+ const bottom = reverse ? 'top' : 'bottom';
89
+ return vertical ? bottom : left;
81
90
  });
82
- const prevActiveRef = ref(activeRef.value);
83
- const clickedRef = computed(() => {
84
- return handleClicked1Ref.value || handleClicked2Ref.value;
91
+ const fillStyleRef = computed(() => {
92
+ if (handleCountExceeds2Ref.value)
93
+ return;
94
+ const values = arrifiedValueRef.value;
95
+ const start = valueToPercentage(props.range ? Math.min(...values) : props.min);
96
+ const end = valueToPercentage(props.range ? Math.max(...values) : values[0]);
97
+ const { value: styleDirection } = styleDirectionRef;
98
+ return props.vertical
99
+ ? {
100
+ [styleDirection]: `${start}%`,
101
+ height: `${end - start}%`
102
+ }
103
+ : {
104
+ [styleDirection]: `${start}%`,
105
+ width: `${end - start}%`
106
+ };
85
107
  });
86
108
  const markInfosRef = computed(() => {
87
109
  const mergedMarks = [];
88
- const { marks, max, min } = props;
110
+ const { marks } = props;
89
111
  if (marks) {
90
- const { value: mergedValue } = mergedValueRef;
112
+ const orderValues = arrifiedValueRef.value.slice();
113
+ orderValues.sort((a, b) => a - b);
114
+ const { value: styleDirection } = styleDirectionRef;
115
+ const { value: handleCountExceeds2 } = handleCountExceeds2Ref;
116
+ const { range } = props;
117
+ const isActive = handleCountExceeds2
118
+ ? () => false
119
+ : (num) => range
120
+ ? num >= orderValues[0] &&
121
+ num <= orderValues[orderValues.length - 1]
122
+ : num <= orderValues[0];
91
123
  for (const key of Object.keys(marks)) {
92
124
  const num = Number(key);
93
125
  mergedMarks.push({
94
- active: Array.isArray(mergedValue)
95
- ? mergedValue[0] <= num && mergedValue[1] >= num
96
- : mergedValue !== null
97
- ? mergedValue >= num
98
- : false,
126
+ active: isActive(num),
99
127
  label: marks[key],
100
128
  style: {
101
- left: `${((num - min) / (max - min)) * 100}%`
129
+ [styleDirection]: `${valueToPercentage(num)}%`
102
130
  }
103
131
  });
104
132
  }
105
133
  }
106
134
  return mergedMarks;
107
135
  });
108
- const fillStyleRef = computed(() => {
109
- const { max, min, range } = props;
110
- if (range) {
111
- return {
112
- left: `${((handleValue1Ref.value - min) / (max - min)) * 100}%`,
113
- width: `${((handleValue2Ref.value - handleValue1Ref.value) / (max - min)) *
114
- 100}%`
115
- };
116
- }
117
- else {
118
- return {
119
- left: 0,
120
- width: `${((handleValue1Ref.value - min) / (max - min)) * 100}%`
121
- };
122
- }
123
- });
124
- const handleValue1Ref = computed(() => {
125
- const { value: mergedValue } = mergedValueRef;
126
- if (Array.isArray(mergedValue)) {
127
- return sanitizeValue(mergedValue[0]);
128
- }
129
- else {
130
- return sanitizeValue(mergedValue);
131
- }
132
- });
133
- const handleValue2Ref = computed(() => {
134
- const { value: mergedValue } = mergedValueRef;
135
- if (Array.isArray(mergedValue)) {
136
- return sanitizeValue(mergedValue[1]);
137
- }
138
- return 0;
139
- });
140
- const firstHandleStyleRef = computed(() => {
141
- const { value: handleValue1 } = handleValue1Ref;
142
- const { value: handleClicked1 } = handleClicked1Ref;
143
- const { max, min } = props;
144
- const percentage = ((handleValue1 - min) / (max - min)) * 100;
136
+ function getHandleStyle(value, index) {
137
+ const percentage = valueToPercentage(value);
138
+ const { value: styleDirection } = styleDirectionRef;
145
139
  return {
146
- left: `${percentage}%`,
147
- transform: `translateX(${-percentage}%)`,
148
- zIndex: handleClicked1 ? 1 : 0
140
+ [styleDirection]: `${percentage}%`,
141
+ zIndex: index === activeIndexRef.value ? 1 : 0
149
142
  };
150
- });
151
- const secondHandleStyleRef = computed(() => {
152
- const { value: handleValue2 } = handleValue2Ref;
153
- const { value: handleClicked2 } = handleClicked2Ref;
154
- const { max, min } = props;
155
- const percentage = ((handleValue2 - min) / (max - min)) * 100;
156
- return {
157
- left: `${percentage}%`,
158
- transform: `translateX(${-percentage}%)`,
159
- zIndex: handleClicked2 ? 1 : 0
160
- };
161
- });
143
+ }
144
+ function isShowTooltip(index) {
145
+ return (props.showTooltip ||
146
+ hoverIndexRef.value === index ||
147
+ (activeIndexRef.value === index && draggingRef.value));
148
+ }
149
+ function isSkipCSSDetection(index) {
150
+ return !(activeIndexRef.value === index && previousIndexRef.value === index);
151
+ }
152
+ function focusActiveHandle(index) {
153
+ var _a;
154
+ if (~index) {
155
+ activeIndexRef.value = index;
156
+ (_a = handleRefs.value.get(index)) === null || _a === void 0 ? void 0 : _a.focus();
157
+ }
158
+ }
159
+ function syncPosition() {
160
+ followerRefs.value.forEach((inst, index) => {
161
+ if (isShowTooltip(index))
162
+ inst.syncPosition();
163
+ });
164
+ }
162
165
  function doUpdateValue(value) {
163
- const { onChange, 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
166
+ const { 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
164
167
  const { nTriggerFormInput, nTriggerFormChange } = formItem;
165
- if (onChange)
166
- call(onChange, value);
167
168
  if (onUpdateValue)
168
169
  call(onUpdateValue, value);
169
170
  if (_onUpdateValue)
@@ -172,411 +173,240 @@ export default defineComponent({
172
173
  nTriggerFormInput();
173
174
  nTriggerFormChange();
174
175
  }
175
- function doUpdateShow(show1, show2) {
176
- if (show1 !== undefined) {
177
- handleActive1Ref.value = show1;
176
+ function dispatchValueUpdate(value) {
177
+ const { range } = props;
178
+ if (range) {
179
+ if (Array.isArray(value)) {
180
+ const { value: oldValues } = arrifiedValueRef;
181
+ if (value.join() !== oldValues.join()) {
182
+ doUpdateValue(value);
183
+ }
184
+ }
185
+ }
186
+ else if (!Array.isArray(value)) {
187
+ const oldValue = arrifiedValueRef.value[0];
188
+ if (oldValue !== value) {
189
+ doUpdateValue(value);
190
+ }
191
+ }
192
+ }
193
+ function doDispatchValue(value, index) {
194
+ if (props.range) {
195
+ const values = arrifiedValueRef.value.slice();
196
+ values.splice(index, 1, value);
197
+ dispatchValueUpdate(values);
178
198
  }
179
- if (show2 !== undefined) {
180
- handleActive2Ref.value = show2;
199
+ else {
200
+ dispatchValueUpdate(value);
181
201
  }
182
202
  }
183
- function syncPosition() {
184
- var _a, _b;
185
- (_a = followerRef1.value) === null || _a === void 0 ? void 0 : _a.syncPosition();
186
- (_b = followerRef2.value) === null || _b === void 0 ? void 0 : _b.syncPosition();
203
+ // value conversion
204
+ function sanitizeValue(value, currentValue, stepBuffer) {
205
+ const stepping = stepBuffer !== undefined;
206
+ if (!stepBuffer) {
207
+ stepBuffer = value - currentValue > 0 ? 1 : -1;
208
+ }
209
+ const markValues = markValuesRef.value || [];
210
+ const { step } = props;
211
+ if (step === 'mark') {
212
+ const closestMark = getClosestMark(value, markValues.concat(currentValue), stepping ? stepBuffer : undefined);
213
+ return closestMark ? closestMark.value : currentValue;
214
+ }
215
+ if (step <= 0)
216
+ return currentValue;
217
+ const { value: precision } = precisionRef;
218
+ let closestMark;
219
+ // if it is a stepping, priority will be given to the marks
220
+ // on the rail, otherwise take the nearest one
221
+ if (stepping) {
222
+ const currentStep = Number((currentValue / step).toFixed(precision));
223
+ const actualStep = Math.floor(currentStep);
224
+ const leftStep = currentStep > actualStep ? actualStep : actualStep - 1;
225
+ const rightStep = currentStep < actualStep ? actualStep : actualStep + 1;
226
+ closestMark = getClosestMark(currentValue, [
227
+ Number((leftStep * step).toFixed(precision)),
228
+ Number((rightStep * step).toFixed(precision)),
229
+ ...markValues
230
+ ], stepBuffer);
231
+ }
232
+ else {
233
+ const roundValue = getRoundValue(value);
234
+ closestMark = getClosestMark(value, [...markValues, roundValue]);
235
+ }
236
+ return closestMark ? clampValue(closestMark.value) : currentValue;
187
237
  }
188
- function handleHandleFocus1() {
189
- if (clickedRef.value)
190
- return;
191
- doUpdateShow(true, false);
238
+ function clampValue(value) {
239
+ return Math.min(props.max, Math.max(props.min, value));
192
240
  }
193
- function handleHandleFocus2() {
194
- if (clickedRef.value)
195
- return;
196
- doUpdateShow(false, true);
241
+ function valueToPercentage(value) {
242
+ const { max, min } = props;
243
+ return ((value - min) / (max - min)) * 100;
197
244
  }
198
- function handleHandleBlur1() {
199
- if (clickedRef.value)
200
- return;
201
- doUpdateShow(false, false);
245
+ function percentageToValue(percentage) {
246
+ const { max, min } = props;
247
+ return min + (max - min) * percentage;
202
248
  }
203
- function handleHandleBlur2() {
204
- if (clickedRef.value)
205
- return;
206
- doUpdateShow(false, false);
249
+ function getRoundValue(value) {
250
+ const { step, min } = props;
251
+ if (step <= 0 || step === 'mark')
252
+ return value;
253
+ const newValue = Math.round((value - min) / step) * step + min;
254
+ return Number(newValue.toFixed(precisionRef.value));
207
255
  }
208
- function handleRailClick(e) {
209
- var _a, _b, _c, _d;
210
- if (mergedDisabledRef.value)
211
- return;
212
- const { value: railEl } = railRef;
213
- if (!railEl)
214
- return;
215
- const railRect = railEl.getBoundingClientRect();
216
- const offsetRatio = (e.clientX - railRect.left) / railRect.width;
217
- const newValue = props.min + (props.max - props.min) * offsetRatio;
218
- if (!props.range) {
219
- dispatchValueUpdate(newValue, { source: 'click' });
220
- (_a = handleRef1.value) === null || _a === void 0 ? void 0 : _a.focus();
221
- }
222
- else {
223
- if (Array.isArray(mergedValueRef.value)) {
224
- if (Math.abs(handleValue1Ref.value - newValue) <
225
- Math.abs(handleValue2Ref.value - newValue)) {
226
- dispatchValueUpdate([newValue, handleValue2Ref.value], {
227
- source: 'click'
228
- });
229
- (_b = handleRef1.value) === null || _b === void 0 ? void 0 : _b.focus();
230
- }
231
- else {
232
- dispatchValueUpdate([handleValue1Ref.value, newValue], {
233
- source: 'click'
234
- });
235
- (_c = handleRef2.value) === null || _c === void 0 ? void 0 : _c.focus();
236
- }
237
- }
238
- else {
239
- dispatchValueUpdate([newValue, newValue], { source: 'click' });
240
- (_d = handleRef1.value) === null || _d === void 0 ? void 0 : _d.focus();
256
+ function getClosestMark(currentValue, markValues = markValuesRef.value, buffer) {
257
+ if (!markValues || !markValues.length)
258
+ return null;
259
+ let closestMark = null;
260
+ let index = -1;
261
+ while (++index < markValues.length) {
262
+ const diff = markValues[index] - currentValue;
263
+ const distance = Math.abs(diff);
264
+ if (
265
+ // find marks in the same direction
266
+ (buffer === undefined || diff * buffer > 0) &&
267
+ (closestMark === null || distance < closestMark.distance)) {
268
+ closestMark = {
269
+ index,
270
+ distance,
271
+ value: markValues[index]
272
+ };
241
273
  }
242
274
  }
275
+ return closestMark;
243
276
  }
244
- function handleHandleMouseMove(e, handleIndex) {
245
- if (!handleRef1.value || !railRef.value)
277
+ function getPointValue(event) {
278
+ const railEl = handleRailRef.value;
279
+ if (!railEl)
246
280
  return;
247
- const x = 'touches' in e ? e.touches[0].clientX : e.clientX;
248
- const { width: handleWidth } = handleRef1.value.getBoundingClientRect();
249
- const { width: railWidth, left: railLeft } = railRef.value.getBoundingClientRect();
250
- const { min, max, range } = props;
251
- const offsetRatio = (x - railLeft - handleWidth / 2) / (railWidth - handleWidth);
252
- const newValue = min + (max - min) * offsetRatio;
253
- if (range) {
254
- if (handleIndex === 0) {
255
- dispatchValueUpdate([memoziedOtherValueRef.value, newValue]);
256
- }
257
- else {
258
- dispatchValueUpdate([newValue, memoziedOtherValueRef.value]);
259
- }
281
+ const touchEvent = isTouchEvent(event) ? event.touches[0] : event;
282
+ const railRect = railEl.getBoundingClientRect();
283
+ let percentage;
284
+ if (props.vertical) {
285
+ percentage = (railRect.bottom - touchEvent.clientY) / railRect.height;
260
286
  }
261
287
  else {
262
- dispatchValueUpdate(newValue);
288
+ percentage = (touchEvent.clientX - railRect.left) / railRect.width;
263
289
  }
290
+ if (props.reverse) {
291
+ percentage = 1 - percentage;
292
+ }
293
+ return percentageToValue(percentage);
264
294
  }
265
- function handleKeyDown(e) {
295
+ // dom event handle
296
+ function handleRailKeyDown(e) {
266
297
  if (mergedDisabledRef.value)
267
298
  return;
299
+ const { vertical, reverse } = props;
268
300
  switch (e.code) {
301
+ case 'ArrowUp':
302
+ e.preventDefault();
303
+ handleStepValue(vertical && reverse ? -1 : 1);
304
+ break;
269
305
  case 'ArrowRight':
270
- handleKeyDownRight();
306
+ e.preventDefault();
307
+ handleStepValue(!vertical && reverse ? -1 : 1);
308
+ break;
309
+ case 'ArrowDown':
310
+ e.preventDefault();
311
+ handleStepValue(vertical && reverse ? 1 : -1);
271
312
  break;
272
313
  case 'ArrowLeft':
273
- handleKeyDownLeft();
314
+ e.preventDefault();
315
+ handleStepValue(!vertical && reverse ? 1 : -1);
274
316
  break;
275
317
  }
276
318
  }
277
- function handleKeyDownRight() {
278
- if (clickedRef.value)
319
+ function handleStepValue(ratio) {
320
+ const activeIndex = activeIndexRef.value;
321
+ if (activeIndex === -1)
279
322
  return;
280
- let firstHandleFocused = false;
281
- let handleValue = null;
282
- if (document.activeElement === handleRef1.value) {
283
- firstHandleFocused = true;
284
- handleValue = handleValue1Ref.value;
285
- }
286
- else {
287
- handleValue = handleValue2Ref.value;
288
- }
289
- const { step, marks } = props;
290
- let nextValue = Math.floor(handleValue / step) * step + step;
291
- if (marks) {
292
- for (const key of Object.keys(marks)) {
293
- const numberKey = Number(key);
294
- if (numberKey > handleValue && numberKey < nextValue) {
295
- nextValue = numberKey;
296
- }
297
- }
298
- }
299
- if (props.range) {
300
- if (firstHandleFocused) {
301
- dispatchValueUpdate([nextValue, handleValue2Ref.value], {
302
- source: 'keyboard'
303
- });
304
- }
305
- else {
306
- dispatchValueUpdate([handleValue1Ref.value, nextValue], {
307
- source: 'keyboard'
308
- });
309
- }
310
- }
311
- else {
312
- dispatchValueUpdate(nextValue, { source: 'keyboard' });
313
- }
323
+ const { step } = props;
324
+ const currentValue = arrifiedValueRef.value[activeIndex];
325
+ const nextValue = step <= 0 || step === 'mark'
326
+ ? currentValue
327
+ : currentValue + step * ratio;
328
+ doDispatchValue(
329
+ // Avoid the number of value does not change when `step` is null
330
+ sanitizeValue(nextValue, currentValue, ratio > 0 ? 1 : -1), activeIndex);
314
331
  }
315
- function handleKeyDownLeft() {
316
- if (clickedRef.value)
332
+ function handleRailMouseDown(event) {
333
+ var _a, _b;
334
+ if (mergedDisabledRef.value)
317
335
  return;
318
- let firstHandleFocused = false;
319
- let handleValue = null;
320
- if (document.activeElement === handleRef1.value) {
321
- firstHandleFocused = true;
322
- handleValue = handleValue1Ref.value;
323
- }
324
- else if (document.activeElement === handleRef2.value) {
325
- handleValue = handleValue2Ref.value;
326
- }
327
- else {
336
+ if (!isTouchEvent(event) && event.button !== eventButtonLeft) {
328
337
  return;
329
338
  }
330
- const { step, marks } = props;
331
- let nextValue = Math.ceil(handleValue / step) * step - step;
332
- if (marks) {
333
- for (const key of Object.keys(marks)) {
334
- const numberKey = Number(key);
335
- if (numberKey < handleValue && numberKey > nextValue) {
336
- nextValue = numberKey;
337
- }
338
- }
339
- }
340
- if (props.range) {
341
- if (firstHandleFocused) {
342
- dispatchValueUpdate([nextValue, handleValue2Ref.value], {
343
- source: 'keyboard'
344
- });
345
- }
346
- else {
347
- dispatchValueUpdate([handleValue1Ref.value, nextValue], {
348
- source: 'keyboard'
349
- });
350
- }
351
- }
352
- else {
353
- dispatchValueUpdate(nextValue, { source: 'keyboard' });
354
- }
355
- }
356
- function switchFocus() {
357
- if (props.range) {
358
- const firstHandle = handleRef1.value;
359
- const secondHandle = handleRef2.value;
360
- if (firstHandle && secondHandle) {
361
- if (handleActive1Ref.value &&
362
- document.activeElement === secondHandle) {
363
- disableTransitionOneTick();
364
- firstHandle.focus();
365
- if (handleClicked2Ref.value) {
366
- handleClicked2Ref.value = false;
367
- handleClicked1Ref.value = true;
368
- }
369
- }
370
- else if (handleActive2Ref.value &&
371
- document.activeElement === firstHandle) {
372
- disableTransitionOneTick();
373
- secondHandle.focus();
374
- if (handleClicked1Ref.value) {
375
- handleClicked1Ref.value = false;
376
- handleClicked2Ref.value = true;
377
- }
378
- }
379
- }
380
- }
381
- }
382
- function getClosestMarkValue(currentValue) {
383
- const { marks } = props;
384
- if (marks) {
385
- const markValues = Object.keys(marks).map((key) => Number(key));
386
- let diff = null;
387
- let closestValue = null;
388
- for (const value of markValues) {
389
- if (closestValue === null) {
390
- closestValue = value;
391
- diff = Math.abs(value - currentValue);
392
- }
393
- else {
394
- const newDiff = Math.abs(value - currentValue);
395
- if (newDiff < diff) {
396
- closestValue = value;
397
- diff = newDiff;
398
- }
399
- }
400
- }
401
- return closestValue;
402
- }
403
- return null;
404
- }
405
- function sanitizeValue(value) {
406
- let justifiedValue = value;
407
- const { min, max, marks, step } = props;
408
- justifiedValue = Math.max(min, justifiedValue);
409
- justifiedValue = Math.min(max, justifiedValue);
410
- justifiedValue = Math.round((justifiedValue - min) / step) * step + min;
411
- justifiedValue = parseFloat(justifiedValue.toFixed(precisionRef.value));
412
- if (marks) {
413
- const closestMarkValue = getClosestMarkValue(value);
414
- if (closestMarkValue !== null &&
415
- Math.abs(justifiedValue - value) > Math.abs(closestMarkValue - value)) {
416
- justifiedValue = closestMarkValue;
417
- }
418
- }
419
- return justifiedValue;
420
- }
421
- function handleFirstHandleMouseDown(e) {
422
- if (mergedDisabledRef.value)
339
+ const pointValue = getPointValue(event);
340
+ if (pointValue === undefined)
423
341
  return;
424
- if (isTouchEvent(e))
425
- e.preventDefault();
426
- if (props.range) {
427
- memoziedOtherValueRef.value = handleValue2Ref.value;
342
+ const values = arrifiedValueRef.value.slice();
343
+ const activeIndex = props.range
344
+ ? (_b = (_a = getClosestMark(pointValue, values)) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : -1
345
+ : 0;
346
+ if (activeIndex !== -1) {
347
+ // avoid triggering scrolling on touch
348
+ event.preventDefault();
349
+ focusActiveHandle(activeIndex);
350
+ startDragging();
351
+ doDispatchValue(sanitizeValue(pointValue, arrifiedValueRef.value[activeIndex]), activeIndex);
428
352
  }
429
- doUpdateShow(true, false);
430
- handleClicked1Ref.value = true;
431
- on('touchend', document, handleHandleMouseUp);
432
- on('mouseup', document, handleHandleMouseUp);
433
- on('touchmove', document, handleFirstHandleMouseMove);
434
- on('mousemove', document, handleFirstHandleMouseMove);
435
353
  }
436
- function handleSecondHandleMouseDown(e) {
437
- if (mergedDisabledRef.value)
438
- return;
439
- if (isTouchEvent(e))
440
- e.preventDefault();
441
- if (props.range) {
442
- memoziedOtherValueRef.value = handleValue1Ref.value;
354
+ function startDragging() {
355
+ if (!draggingRef.value) {
356
+ draggingRef.value = true;
357
+ on('touchend', document, handleMouseUp);
358
+ on('mouseup', document, handleMouseUp);
359
+ on('touchmove', document, handleMouseMove);
360
+ on('mousemove', document, handleMouseMove);
443
361
  }
444
- doUpdateShow(false, true);
445
- handleClicked2Ref.value = true;
446
- on('touchend', document, handleHandleMouseUp);
447
- on('mouseup', document, handleHandleMouseUp);
448
- on('touchmove', document, handleSecondHandleMouseMove);
449
- on('mousemove', document, handleSecondHandleMouseMove);
450
362
  }
451
- function handleHandleMouseUp(e) {
452
- var _a, _b;
453
- if (isTouchEvent(e) ||
454
- (!((_a = handleRef1.value) === null || _a === void 0 ? void 0 : _a.contains(e.target)) &&
455
- (props.range ? !((_b = handleRef2.value) === null || _b === void 0 ? void 0 : _b.contains(e.target)) : true))) {
456
- doUpdateShow(false, false);
363
+ function stopDragging() {
364
+ if (draggingRef.value) {
365
+ draggingRef.value = false;
366
+ off('touchend', document, handleMouseUp);
367
+ off('mouseup', document, handleMouseUp);
368
+ off('touchmove', document, handleMouseMove);
369
+ off('mousemove', document, handleMouseMove);
457
370
  }
458
- handleClicked2Ref.value = false;
459
- handleClicked1Ref.value = false;
460
- off('touchend', document, handleHandleMouseUp);
461
- off('mouseup', document, handleHandleMouseUp);
462
- off('touchmove', document, handleFirstHandleMouseMove);
463
- off('touchmove', document, handleSecondHandleMouseMove);
464
- off('mousemove', document, handleFirstHandleMouseMove);
465
- off('mousemove', document, handleSecondHandleMouseMove);
466
371
  }
467
- function dispatchValueUpdate(value, options = { source: null }) {
468
- const { source } = options;
469
- const { range } = props;
470
- if (range) {
471
- if (Array.isArray(value)) {
472
- if (value[0] > value[1]) {
473
- value = [sanitizeValue(value[1]), sanitizeValue(value[0])];
474
- }
475
- else {
476
- value = [sanitizeValue(value[0]), sanitizeValue(value[1])];
477
- }
478
- const { value: oldValue } = mergedValueRef;
479
- if (!Array.isArray(oldValue) ||
480
- oldValue[0] !== value[0] ||
481
- oldValue[1] !== value[1]) {
482
- changeSourceRef.value = source;
483
- doUpdateValue(value);
484
- }
485
- }
486
- }
487
- else {
488
- if (!Array.isArray(value)) {
489
- const { max, min } = props;
490
- const { value: oldValue } = mergedValueRef;
491
- if (value > max) {
492
- if (oldValue !== max) {
493
- changeSourceRef.value = source;
494
- doUpdateValue(max);
495
- }
496
- }
497
- else if (value < min) {
498
- if (oldValue !== min) {
499
- changeSourceRef.value = source;
500
- doUpdateValue(min);
501
- }
502
- }
503
- else {
504
- const newValue = sanitizeValue(value);
505
- if (oldValue !== newValue) {
506
- changeSourceRef.value = source;
507
- doUpdateValue(newValue);
508
- }
509
- }
510
- }
372
+ function handleMouseMove(event) {
373
+ const { value: activeIndex } = activeIndexRef;
374
+ if (!draggingRef.value || activeIndex === -1) {
375
+ stopDragging();
376
+ return;
511
377
  }
378
+ const pointValue = getPointValue(event);
379
+ doDispatchValue(sanitizeValue(pointValue, arrifiedValueRef.value[activeIndex]), activeIndex);
512
380
  }
513
- function handleFirstHandleMouseMove(e) {
514
- handleHandleMouseMove(e, 0);
381
+ function handleMouseUp() {
382
+ stopDragging();
515
383
  }
516
- function handleSecondHandleMouseMove(e) {
517
- handleHandleMouseMove(e, 1);
518
- }
519
- function handleFirstHandleMouseEnter() {
520
- if (!activeRef.value) {
521
- doUpdateShow(true, undefined);
522
- void nextTick(() => {
523
- syncPosition();
524
- });
384
+ function handleHandleFocus(index) {
385
+ activeIndexRef.value = index;
386
+ // Wake focus style
387
+ if (!mergedDisabledRef.value) {
388
+ hoverIndexRef.value = index;
525
389
  }
526
390
  }
527
- function handleFirstHandleMouseLeave() {
528
- if (changeSourceRef.value === 'keyboard')
529
- return;
530
- if (!activeRef.value) {
531
- doUpdateShow(false, false);
532
- }
533
- else if (!clickedRef.value) {
534
- doUpdateShow(false, false);
391
+ function handleHandleBlur(index) {
392
+ if (activeIndexRef.value === index) {
393
+ activeIndexRef.value = -1;
394
+ stopDragging();
535
395
  }
536
- }
537
- function handleSecondHandleMouseEnter() {
538
- if (!activeRef.value) {
539
- doUpdateShow(undefined, true);
540
- void nextTick(() => {
541
- syncPosition();
542
- });
396
+ if (hoverIndexRef.value === index) {
397
+ hoverIndexRef.value = -1;
543
398
  }
544
399
  }
545
- function handleSecondHandleMouseLeave() {
546
- if (changeSourceRef.value === 'keyboard')
547
- return;
548
- if (!activeRef.value) {
549
- doUpdateShow(false, false);
550
- }
551
- else if (!clickedRef.value) {
552
- doUpdateShow(false, false);
553
- }
400
+ function handleHandleMouseEnter(index) {
401
+ hoverIndexRef.value = index;
554
402
  }
555
- function disableTransitionOneTick() {
556
- if (handleRef1.value) {
557
- handleRef1.value.style.transition = 'none';
558
- void nextTick(() => {
559
- if (handleRef1.value) {
560
- handleRef1.value.style.transition = '';
561
- }
562
- });
563
- }
564
- if (handleRef2.value) {
565
- handleRef2.value.style.transition = 'none';
566
- void nextTick(() => {
567
- if (handleRef2.value) {
568
- handleRef2.value.style.transition = '';
569
- }
570
- });
403
+ function handleHandleMouseLeave(index) {
404
+ if (hoverIndexRef.value === index) {
405
+ hoverIndexRef.value = -1;
571
406
  }
572
407
  }
573
- watch(activeRef, (value) => {
574
- void nextTick(() => {
575
- prevActiveRef.value = value;
576
- });
577
- });
578
- watch(mergedValueRef, (newValue, oldValue) => {
579
- const { value: changeSource } = changeSourceRef;
408
+ watch(activeIndexRef, (_, previous) => void nextTick(() => (previousIndexRef.value = previous)));
409
+ watch(mergedValueRef, () => {
580
410
  if (props.marks) {
581
411
  if (dotTransitionDisabledRef.value)
582
412
  return;
@@ -585,57 +415,7 @@ export default defineComponent({
585
415
  dotTransitionDisabledRef.value = false;
586
416
  });
587
417
  }
588
- if (props.range && Array.isArray(newValue) && Array.isArray(oldValue)) {
589
- if (oldValue && oldValue[1] !== newValue[1]) {
590
- void nextTick(() => {
591
- if (!(changeSource === 'click')) {
592
- doUpdateShow(false, true);
593
- }
594
- switchFocus();
595
- });
596
- }
597
- else if (oldValue && oldValue[0] !== newValue[0]) {
598
- void nextTick(() => {
599
- if (!(changeSource === 'click')) {
600
- doUpdateShow(true, false);
601
- }
602
- switchFocus();
603
- });
604
- }
605
- else if (newValue[0] === newValue[1]) {
606
- void nextTick(() => {
607
- if (!(changeSource === 'click')) {
608
- doUpdateShow(false, true);
609
- }
610
- switchFocus();
611
- });
612
- }
613
- }
614
- void nextTick(() => {
615
- // dom has changed but event is not fired, use marco task to make sure
616
- // relevant event handler is called
617
- setTimeout(() => {
618
- changeSourceRef.value = null;
619
- }, 0);
620
- if (props.range) {
621
- if (Array.isArray(newValue) && Array.isArray(oldValue)) {
622
- if (newValue[0] !== oldValue[0] || newValue[1] !== oldValue[1]) {
623
- syncPosition();
624
- }
625
- }
626
- }
627
- else {
628
- syncPosition();
629
- }
630
- });
631
- });
632
- onBeforeUnmount(() => {
633
- off('touchmove', document, handleFirstHandleMouseMove);
634
- off('touchmove', document, handleSecondHandleMouseMove);
635
- off('mousemove', document, handleFirstHandleMouseMove);
636
- off('mousemove', document, handleSecondHandleMouseMove);
637
- off('touchend', document, handleHandleMouseUp);
638
- off('mouseup', document, handleHandleMouseUp);
418
+ void nextTick(syncPosition);
639
419
  });
640
420
  return {
641
421
  mergedClsPrefix: mergedClsPrefixRef,
@@ -643,43 +423,27 @@ export default defineComponent({
643
423
  uncontrolledValue: uncontrolledValueRef,
644
424
  mergedValue: mergedValueRef,
645
425
  mergedDisabled: mergedDisabledRef,
426
+ mergedPlacement: mergedPlacementRef,
646
427
  isMounted: useIsMounted(),
647
428
  adjustedTo: useAdjustedTo(props),
648
- handleValue1: handleValue1Ref,
649
- handleValue2: handleValue2Ref,
650
- mergedShowTooltip1: mergedShowTooltip1Ref,
651
- mergedShowTooltip2: mergedShowTooltip2Ref,
652
- handleActive1: handleActive1Ref,
653
- handleActive2: handleActive2Ref,
654
- handleClicked1: handleClicked1Ref,
655
- handleClicked2: handleClicked2Ref,
656
- memoziedOtherValue: memoziedOtherValueRef,
657
- active: activeRef,
658
- prevActive: prevActiveRef,
659
- clicked: clickedRef,
660
429
  dotTransitionDisabled: dotTransitionDisabledRef,
661
430
  markInfos: markInfosRef,
662
- // https://github.com/vuejs/vue-next/issues/2283
663
- handleRef1,
664
- handleRef2,
665
- railRef,
666
- followerRef1,
667
- followerRef2,
668
- firstHandleStyle: firstHandleStyleRef,
669
- secondHandleStyle: secondHandleStyleRef,
431
+ isShowTooltip,
432
+ isSkipCSSDetection,
433
+ handleRailRef,
434
+ setHandleRefs,
435
+ setFollowerRefs,
670
436
  fillStyle: fillStyleRef,
671
- handleKeyDown,
672
- handleRailClick,
673
- handleHandleFocus1,
674
- handleHandleBlur1,
675
- handleFirstHandleMouseDown,
676
- handleFirstHandleMouseEnter,
677
- handleFirstHandleMouseLeave,
678
- handleHandleFocus2,
679
- handleHandleBlur2,
680
- handleSecondHandleMouseDown,
681
- handleSecondHandleMouseEnter,
682
- handleSecondHandleMouseLeave,
437
+ getHandleStyle,
438
+ activeIndex: activeIndexRef,
439
+ arrifiedValues: arrifiedValueRef,
440
+ followerEnabledIndexSet: followerEnabledIndexSetRef,
441
+ handleRailMouseDown,
442
+ handleHandleFocus,
443
+ handleHandleBlur,
444
+ handleHandleMouseEnter,
445
+ handleHandleMouseLeave,
446
+ handleRailKeyDown,
683
447
  indicatorCssVars: computed(() => {
684
448
  const { self: { fontSize, indicatorColor, indicatorBoxShadow, indicatorTextColor, indicatorBorderRadius } } = themeRef.value;
685
449
  return {
@@ -691,7 +455,7 @@ export default defineComponent({
691
455
  };
692
456
  }),
693
457
  cssVars: computed(() => {
694
- const { self: { railColor, railColorHover, fillColor, fillColorHover, handleColor, opacityDisabled, dotColor, dotColorModal, handleBoxShadow, handleBoxShadowHover, handleBoxShadowActive, handleBoxShadowFocus, dotBorder, dotBoxShadow, railHeight, handleSize, dotHeight, dotWidth, dotBorderRadius, fontSize, dotBorderActive, dotColorPopover }, common: { cubicBezierEaseInOut } } = themeRef.value;
458
+ const { self: { railColor, railColorHover, fillColor, fillColorHover, handleColor, opacityDisabled, dotColor, dotColorModal, handleBoxShadow, handleBoxShadowHover, handleBoxShadowActive, handleBoxShadowFocus, dotBorder, dotBoxShadow, railHeight, railWidthVertical, handleSize, dotHeight, dotWidth, dotBorderRadius, fontSize, dotBorderActive, dotColorPopover }, common: { cubicBezierEaseInOut } } = themeRef.value;
695
459
  return {
696
460
  '--bezier': cubicBezierEaseInOut,
697
461
  '--dot-border': dotBorder,
@@ -715,7 +479,8 @@ export default defineComponent({
715
479
  '--opacity-disabled': opacityDisabled,
716
480
  '--rail-color': railColor,
717
481
  '--rail-color-hover': railColorHover,
718
- '--rail-height': railHeight
482
+ '--rail-height': railHeight,
483
+ '--rail-width-vertical': railWidthVertical
719
484
  };
720
485
  })
721
486
  };
@@ -726,11 +491,13 @@ export default defineComponent({
726
491
  `${mergedClsPrefix}-slider`,
727
492
  {
728
493
  [`${mergedClsPrefix}-slider--disabled`]: this.mergedDisabled,
729
- [`${mergedClsPrefix}-slider--active`]: this.active,
730
- [`${mergedClsPrefix}-slider--with-mark`]: this.marks
494
+ [`${mergedClsPrefix}-slider--active`]: this.activeIndex !== -1,
495
+ [`${mergedClsPrefix}-slider--with-mark`]: this.marks,
496
+ [`${mergedClsPrefix}-slider--vertical`]: this.vertical,
497
+ [`${mergedClsPrefix}-slider--reverse`]: this.reverse
731
498
  }
732
- ], style: this.cssVars, onKeydown: this.handleKeyDown, onClick: this.handleRailClick },
733
- h("div", { ref: "railRef", class: `${mergedClsPrefix}-slider-rail` },
499
+ ], style: this.cssVars, onKeydown: this.handleRailKeyDown, onMousedown: this.handleRailMouseDown, onTouchstart: this.handleRailMouseDown },
500
+ h("div", { class: `${mergedClsPrefix}-slider-rail` },
734
501
  h("div", { class: `${mergedClsPrefix}-slider-rail__fill`, style: this.fillStyle }),
735
502
  this.marks ? (h("div", { class: [
736
503
  `${mergedClsPrefix}-slider-dots`,
@@ -742,35 +509,27 @@ export default defineComponent({
742
509
  {
743
510
  [`${mergedClsPrefix}-slider-dot--active`]: mark.active
744
511
  }
745
- ], style: mark.style }))))) : null),
746
- h(VBinder, null, {
747
- default: () => [
748
- h(VTarget, null, {
749
- default: () => (h("div", { ref: "handleRef1", class: `${mergedClsPrefix}-slider-handle`, tabindex: this.mergedDisabled ? -1 : 0, style: this.firstHandleStyle, onFocus: this.handleHandleFocus1, onBlur: this.handleHandleBlur1, onTouchstart: this.handleFirstHandleMouseDown, onMousedown: this.handleFirstHandleMouseDown, onMouseenter: this.handleFirstHandleMouseEnter, onMouseleave: this.handleFirstHandleMouseLeave }))
750
- }),
751
- this.tooltip && (h(VFollower, { ref: "followerRef1", show: this.mergedShowTooltip1, to: this.adjustedTo, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: this.placement, containerClass: this.namespace }, {
752
- default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, css: !(this.active && this.prevActive) }, {
753
- default: () => this.mergedShowTooltip1 ? (h("div", { class: `${mergedClsPrefix}-slider-handle-indicator`, style: this.indicatorCssVars }, typeof formatTooltip === 'function'
754
- ? formatTooltip(this.handleValue1)
755
- : this.handleValue1)) : null
756
- }))
757
- }))
758
- ]
759
- }),
760
- this.tooltip && this.range ? (h(VBinder, null, {
761
- default: () => [
762
- h(VTarget, null, {
763
- default: () => (h("div", { ref: "handleRef2", class: `${mergedClsPrefix}-slider-handle`, tabindex: this.mergedDisabled ? -1 : 0, style: this.secondHandleStyle, onFocus: this.handleHandleFocus2, onBlur: this.handleHandleBlur2, onTouchstart: this.handleSecondHandleMouseDown, onMousedown: this.handleSecondHandleMouseDown, onMouseenter: this.handleSecondHandleMouseEnter, onMouseleave: this.handleSecondHandleMouseLeave }))
764
- }),
765
- h(VFollower, { ref: "followerRef2", show: this.mergedShowTooltip2, to: this.adjustedTo, placement: this.placement, containerClass: this.namespace, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey }, {
766
- default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, css: !(this.active && this.prevActive) }, {
767
- default: () => this.mergedShowTooltip2 ? (h("div", { class: `${mergedClsPrefix}-slider-handle-indicator`, style: this.indicatorCssVars }, typeof formatTooltip === 'function'
768
- ? formatTooltip(this.handleValue2)
769
- : this.handleValue2)) : null
770
- }))
771
- })
772
- ]
773
- })) : null,
774
- this.marks ? (h("div", { class: `${mergedClsPrefix}-slider-marks` }, this.markInfos.map((mark) => (h("div", { key: mark.label, class: `${mergedClsPrefix}-slider-mark`, style: mark.style }, mark.label))))) : null));
512
+ ], style: mark.style }))))) : null,
513
+ h("div", { ref: "handleRailRef", class: `${mergedClsPrefix}-slider-handles` }, this.arrifiedValues.map((value, index) => {
514
+ const showTooltip = this.isShowTooltip(index);
515
+ return (h(VBinder, null, {
516
+ default: () => [
517
+ h(VTarget, null, {
518
+ default: () => (h("div", { ref: this.setHandleRefs(index), class: `${mergedClsPrefix}-slider-handle`, tabindex: this.mergedDisabled ? -1 : 0, style: this.getHandleStyle(value, index), onFocus: () => this.handleHandleFocus(index), onBlur: () => this.handleHandleBlur(index), onMouseenter: () => this.handleHandleMouseEnter(index), onMouseleave: () => this.handleHandleMouseLeave(index) }))
519
+ }),
520
+ this.tooltip && (h(VFollower, { ref: this.setFollowerRefs(index), show: showTooltip, to: this.adjustedTo, enabled: this.followerEnabledIndexSet.has(index), teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: this.mergedPlacement, containerClass: this.namespace }, {
521
+ default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, css: this.isSkipCSSDetection(index), onEnter: () => this.followerEnabledIndexSet.add(index), onAfterLeave: () => this.followerEnabledIndexSet.delete(index) }, {
522
+ default: () => showTooltip ? (h("div", { class: [
523
+ `${mergedClsPrefix}-slider-handle-indicator`,
524
+ `${mergedClsPrefix}-slider-handle-indicator--${this.mergedPlacement}`
525
+ ], style: this.indicatorCssVars }, typeof formatTooltip === 'function'
526
+ ? formatTooltip(value)
527
+ : value)) : null
528
+ }))
529
+ }))
530
+ ]
531
+ }));
532
+ })),
533
+ this.marks ? (h("div", { class: `${mergedClsPrefix}-slider-marks` }, this.markInfos.map((mark) => (h("div", { key: mark.label, class: `${mergedClsPrefix}-slider-mark`, style: mark.style }, mark.label))))) : null)));
775
534
  }
776
535
  });