naive-ui 2.20.0 → 2.21.0

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 (440) hide show
  1. package/es/_internal/select-menu/src/SelectMenu.d.ts +4 -1
  2. package/es/_internal/selection/src/Selection.d.ts +4 -1
  3. package/es/_internal/suffix/src/Suffix.d.ts +5 -2
  4. package/es/_internal/suffix/src/Suffix.js +4 -1
  5. package/es/_styles/common/dark.js +1 -1
  6. package/es/_styles/common/light.d.ts +3 -0
  7. package/es/_styles/common/light.js +5 -2
  8. package/es/_styles/global/index.cssr.js +9 -4
  9. package/es/_styles/transitions/icon-switch.cssr.js +6 -2
  10. package/es/_utils/naive/extract-public-props.d.ts +1 -1
  11. package/es/alert/src/Alert.d.ts +3 -0
  12. package/es/alert/src/Alert.js +3 -3
  13. package/es/auto-complete/src/AutoComplete.d.ts +8 -1
  14. package/es/auto-complete/src/AutoComplete.js +2 -2
  15. package/es/avatar/src/Avatar.d.ts +8 -1
  16. package/es/avatar/src/Avatar.js +41 -9
  17. package/es/avatar/src/styles/index.cssr.js +2 -2
  18. package/es/button/src/Button.d.ts +149 -52
  19. package/es/button/src/Button.js +131 -58
  20. package/es/button/src/interface.d.ts +1 -1
  21. package/es/button/src/styles/button.cssr.js +1 -0
  22. package/es/button/styles/dark.js +3 -0
  23. package/es/button/styles/light.d.ts +14 -5
  24. package/es/button/styles/light.js +10 -3
  25. package/es/calendar/src/Calendar.d.ts +143 -50
  26. package/es/calendar/styles/light.d.ts +14 -5
  27. package/es/card/src/Card.d.ts +3 -0
  28. package/es/cascader/src/Cascader.d.ts +3 -0
  29. package/es/cascader/src/Cascader.js +2 -2
  30. package/es/cascader/src/CascaderOption.d.ts +3 -0
  31. package/es/cascader/src/CascaderSelectMenu.d.ts +3 -0
  32. package/es/cascader/src/CascaderSubmenu.d.ts +3 -0
  33. package/es/checkbox/src/Checkbox.d.ts +8 -5
  34. package/es/checkbox/src/Checkbox.js +8 -9
  35. package/es/collapse/src/Collapse.d.ts +3 -0
  36. package/es/color-picker/src/ColorInputUnit.d.ts +17 -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 +183 -51
  40. package/es/data-table/src/DataTable.js +11 -6
  41. package/es/data-table/src/HeaderButton/FilterButton.d.ts +20 -5
  42. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +20 -5
  43. package/es/data-table/src/TableParts/Body.d.ts +25 -6
  44. package/es/data-table/src/TableParts/Body.js +60 -22
  45. package/es/data-table/src/TableParts/BodyCheckbox.js +1 -1
  46. package/es/data-table/src/TableParts/Cell.d.ts +40 -10
  47. package/es/data-table/src/TableParts/Header.d.ts +20 -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 +8 -9
  51. package/es/data-table/styles/light.d.ts +20 -5
  52. package/es/data-table/styles/light.js +3 -3
  53. package/es/date-picker/src/DatePicker.d.ts +328 -127
  54. package/es/date-picker/src/DatePicker.js +7 -17
  55. package/es/date-picker/src/config.d.ts +9 -0
  56. package/es/date-picker/src/config.js +8 -0
  57. package/es/date-picker/src/panel/date.d.ts +51 -19
  58. package/es/date-picker/src/panel/daterange.d.ts +49 -17
  59. package/es/date-picker/src/panel/datetime.d.ts +51 -19
  60. package/es/date-picker/src/panel/datetimerange.d.ts +49 -17
  61. package/es/date-picker/src/panel/month.d.ts +86 -60
  62. package/es/date-picker/src/panel/month.js +9 -6
  63. package/es/date-picker/src/panel/use-calendar.d.ts +59 -27
  64. package/es/date-picker/src/panel/use-calendar.js +7 -2
  65. package/es/date-picker/src/panel/use-dual-calendar.d.ts +47 -15
  66. package/es/date-picker/src/panel/use-panel-common.d.ts +47 -15
  67. package/es/date-picker/styles/_common.d.ts +2 -0
  68. package/es/date-picker/styles/_common.js +3 -1
  69. package/es/date-picker/styles/light.d.ts +32 -10
  70. package/es/dialog/src/Dialog.d.ts +104 -38
  71. package/es/dialog/src/DialogEnvironment.d.ts +2 -2
  72. package/es/dialog/src/DialogProvider.d.ts +2 -2
  73. package/es/dialog/styles/light.d.ts +14 -5
  74. package/es/drawer/src/Drawer.d.ts +3 -0
  75. package/es/drawer/src/DrawerBodyWrapper.d.ts +3 -0
  76. package/es/drawer/src/DrawerContent.d.ts +3 -0
  77. package/es/dropdown/index.d.ts +1 -1
  78. package/es/dropdown/src/Dropdown.d.ts +5 -2
  79. package/es/dropdown/src/DropdownGroup.d.ts +2 -3
  80. package/es/dropdown/src/DropdownMenu.d.ts +3 -4
  81. package/es/dropdown/src/DropdownMenu.js +5 -4
  82. package/es/dropdown/src/DropdownOption.d.ts +3 -4
  83. package/es/dropdown/src/DropdownOption.js +2 -2
  84. package/es/dropdown/src/DropdownRenderOption.d.ts +2 -3
  85. package/es/dropdown/src/interface.d.ts +9 -30
  86. package/es/dropdown/src/utils.d.ts +1 -0
  87. package/es/dropdown/src/utils.js +10 -0
  88. package/es/dynamic-input/src/DynamicInput.d.ts +143 -50
  89. package/es/dynamic-input/src/InputPreset.d.ts +17 -5
  90. package/es/dynamic-input/src/PairPreset.d.ts +17 -5
  91. package/es/dynamic-input/styles/light.d.ts +14 -5
  92. package/es/dynamic-tags/src/DynamicTags.d.ts +144 -50
  93. package/es/dynamic-tags/styles/light.d.ts +14 -5
  94. package/es/ellipsis/src/Ellipsis.d.ts +3 -0
  95. package/es/form/src/FormItemGridItem.d.ts +2 -2
  96. package/es/global-style/src/GlobalStyle.js +2 -0
  97. package/es/grid/src/Grid.js +1 -0
  98. package/es/grid/src/GridItem.d.ts +2 -2
  99. package/es/image/src/ImagePreview.js +3 -2
  100. package/es/image/src/icons.d.ts +1 -0
  101. package/es/image/src/icons.js +2 -0
  102. package/es/input/src/Input.d.ts +4 -0
  103. package/es/input/src/Input.js +9 -3
  104. package/es/input/src/interface.d.ts +1 -0
  105. package/es/input-number/src/InputNumber.d.ts +144 -50
  106. package/es/input-number/styles/light.d.ts +14 -5
  107. package/es/layout/src/Layout.d.ts +6 -0
  108. package/es/layout/src/LayoutContent.d.ts +3 -0
  109. package/es/layout/src/LayoutSider.d.ts +3 -0
  110. package/es/locales/common/deDE.d.ts +3 -0
  111. package/es/locales/common/deDE.js +93 -0
  112. package/es/locales/common/nbNO.d.ts +3 -0
  113. package/es/locales/common/nbNO.js +93 -0
  114. package/es/locales/date/deDE.d.ts +3 -0
  115. package/es/locales/date/deDE.js +6 -0
  116. package/es/locales/date/nbNO.d.ts +3 -0
  117. package/es/locales/date/nbNO.js +6 -0
  118. package/es/locales/index.d.ts +6 -0
  119. package/es/locales/index.js +5 -0
  120. package/es/locales/utils/index.d.ts +8 -0
  121. package/es/locales/utils/index.js +4 -0
  122. package/es/log/src/Log.d.ts +3 -0
  123. package/es/mention/src/Mention.d.ts +4 -0
  124. package/es/menu/index.d.ts +1 -1
  125. package/es/menu/src/Menu.d.ts +32 -8
  126. package/es/menu/src/Menu.js +32 -10
  127. package/es/menu/src/MenuDivider.d.ts +2 -0
  128. package/es/menu/src/MenuDivider.js +11 -0
  129. package/es/menu/src/MenuOption.d.ts +11 -2
  130. package/es/menu/src/MenuOptionContent.d.ts +7 -2
  131. package/es/menu/src/Submenu.d.ts +21 -17
  132. package/es/menu/src/interface.d.ts +23 -4
  133. package/es/menu/src/styles/index.cssr.js +6 -1
  134. package/es/menu/src/utils.d.ts +4 -2
  135. package/es/menu/src/utils.js +16 -2
  136. package/es/menu/styles/light.d.ts +2 -0
  137. package/es/menu/styles/light.js +3 -2
  138. package/es/modal/src/BodyWrapper.d.ts +33 -12
  139. package/es/modal/src/BodyWrapper.js +6 -0
  140. package/es/modal/src/Modal.d.ts +185 -65
  141. package/es/modal/src/Modal.js +5 -1
  142. package/es/modal/src/interface.d.ts +1 -0
  143. package/es/modal/src/presetProps.d.ts +1 -1
  144. package/es/modal/styles/light.d.ts +14 -5
  145. package/es/notification/src/NotificationContainer.d.ts +3 -0
  146. package/es/pagination/index.d.ts +1 -1
  147. package/es/pagination/src/Pagination.d.ts +20 -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 +145 -52
  151. package/es/popconfirm/src/PopconfirmPanel.d.ts +2 -2
  152. package/es/popconfirm/styles/light.d.ts +14 -5
  153. package/es/popselect/src/Popselect.d.ts +3 -0
  154. package/es/popselect/src/PopselectPanel.d.ts +3 -0
  155. package/es/radio/src/Radio.d.ts +3 -0
  156. package/es/radio/src/RadioButton.d.ts +3 -0
  157. package/es/radio/src/use-radio.d.ts +2 -0
  158. package/es/radio/src/use-radio.js +6 -3
  159. package/es/select/src/Select.d.ts +9 -2
  160. package/es/select/src/Select.js +20 -14
  161. package/es/slider/src/Slider.d.ts +70 -91
  162. package/es/slider/src/Slider.js +326 -583
  163. package/es/slider/src/interface.d.ts +1 -1
  164. package/es/slider/src/styles/index.cssr.js +86 -16
  165. package/es/slider/src/utils.d.ts +10 -1
  166. package/es/slider/src/utils.js +9 -0
  167. package/es/slider/styles/_common.d.ts +1 -0
  168. package/es/slider/styles/_common.js +1 -0
  169. package/es/slider/styles/light.d.ts +1 -0
  170. package/es/space/src/Space.js +2 -0
  171. package/es/steps/src/Step.js +1 -1
  172. package/es/table/src/Table.d.ts +35 -0
  173. package/es/table/src/Table.js +8 -4
  174. package/es/table/src/styles/index.cssr.js +1 -1
  175. package/es/table/styles/light.d.ts +3 -0
  176. package/es/table/styles/light.js +2 -2
  177. package/es/tabs/index.d.ts +2 -0
  178. package/es/tabs/index.js +1 -0
  179. package/es/tabs/src/Tab.d.ts +35 -18
  180. package/es/tabs/src/Tab.js +14 -17
  181. package/es/tabs/src/TabPane.d.ts +1 -0
  182. package/es/tabs/src/TabPane.js +2 -1
  183. package/es/tabs/src/Tabs.d.ts +4 -0
  184. package/es/tabs/src/Tabs.js +65 -21
  185. package/es/tabs/src/interface.d.ts +3 -2
  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 +3 -0
  191. package/es/time-picker/src/Panel.d.ts +17 -5
  192. package/es/time-picker/src/TimePicker.d.ts +144 -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 +3 -0
  196. package/es/transfer/src/Transfer.d.ts +145 -52
  197. package/es/transfer/src/TransferFilter.d.ts +17 -5
  198. package/es/transfer/src/TransferList.d.ts +17 -5
  199. package/es/transfer/src/TransferListItem.d.ts +17 -5
  200. package/es/transfer/styles/light.d.ts +14 -5
  201. package/es/tree/src/Tree.d.ts +13 -9
  202. package/es/tree/src/Tree.js +59 -23
  203. package/es/tree/src/TreeNode.js +4 -4
  204. package/es/tree/src/TreeNodeCheckbox.d.ts +3 -0
  205. package/es/tree/src/TreeNodeSwitcher.d.ts +1 -1
  206. package/es/tree/src/interface.d.ts +1 -1
  207. package/es/tree/src/utils.d.ts +1 -1
  208. package/es/tree/src/utils.js +4 -4
  209. package/es/tree-select/src/TreeSelect.d.ts +5 -2
  210. package/es/upload/src/Upload.d.ts +146 -52
  211. package/es/upload/src/Upload.js +6 -10
  212. package/es/upload/src/UploadFile.d.ts +18 -6
  213. package/es/upload/src/UploadFile.js +1 -1
  214. package/es/upload/src/UploadProgress.d.ts +17 -5
  215. package/es/upload/src/UploadTrigger.js +2 -2
  216. package/es/upload/src/interface.d.ts +2 -1
  217. package/es/upload/styles/light.d.ts +14 -5
  218. package/es/version.d.ts +1 -1
  219. package/es/version.js +1 -1
  220. package/lib/_internal/select-menu/src/SelectMenu.d.ts +4 -1
  221. package/lib/_internal/selection/src/Selection.d.ts +4 -1
  222. package/lib/_internal/suffix/src/Suffix.d.ts +5 -2
  223. package/lib/_internal/suffix/src/Suffix.js +4 -1
  224. package/lib/_styles/common/dark.js +1 -1
  225. package/lib/_styles/common/light.d.ts +3 -0
  226. package/lib/_styles/common/light.js +5 -2
  227. package/lib/_styles/global/index.cssr.js +10 -5
  228. package/lib/_styles/transitions/icon-switch.cssr.js +7 -2
  229. package/lib/_utils/naive/extract-public-props.d.ts +1 -1
  230. package/lib/alert/src/Alert.d.ts +3 -0
  231. package/lib/alert/src/Alert.js +3 -3
  232. package/lib/auto-complete/src/AutoComplete.d.ts +8 -1
  233. package/lib/auto-complete/src/AutoComplete.js +2 -2
  234. package/lib/avatar/src/Avatar.d.ts +8 -1
  235. package/lib/avatar/src/Avatar.js +40 -8
  236. package/lib/avatar/src/styles/index.cssr.js +2 -2
  237. package/lib/button/src/Button.d.ts +149 -52
  238. package/lib/button/src/Button.js +129 -56
  239. package/lib/button/src/interface.d.ts +1 -1
  240. package/lib/button/src/styles/button.cssr.js +1 -0
  241. package/lib/button/styles/dark.js +3 -0
  242. package/lib/button/styles/light.d.ts +14 -5
  243. package/lib/button/styles/light.js +10 -3
  244. package/lib/calendar/src/Calendar.d.ts +143 -50
  245. package/lib/calendar/styles/light.d.ts +14 -5
  246. package/lib/card/src/Card.d.ts +3 -0
  247. package/lib/cascader/src/Cascader.d.ts +3 -0
  248. package/lib/cascader/src/Cascader.js +2 -2
  249. package/lib/cascader/src/CascaderOption.d.ts +3 -0
  250. package/lib/cascader/src/CascaderSelectMenu.d.ts +3 -0
  251. package/lib/cascader/src/CascaderSubmenu.d.ts +3 -0
  252. package/lib/checkbox/src/Checkbox.d.ts +8 -5
  253. package/lib/checkbox/src/Checkbox.js +8 -9
  254. package/lib/collapse/src/Collapse.d.ts +3 -0
  255. package/lib/color-picker/src/ColorInputUnit.d.ts +17 -5
  256. package/lib/color-picker/src/ColorPicker.d.ts +126 -45
  257. package/lib/color-picker/styles/light.d.ts +14 -5
  258. package/lib/data-table/src/DataTable.d.ts +183 -51
  259. package/lib/data-table/src/DataTable.js +11 -6
  260. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +20 -5
  261. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +20 -5
  262. package/lib/data-table/src/TableParts/Body.d.ts +25 -6
  263. package/lib/data-table/src/TableParts/Body.js +60 -22
  264. package/lib/data-table/src/TableParts/BodyCheckbox.js +1 -1
  265. package/lib/data-table/src/TableParts/Cell.d.ts +40 -10
  266. package/lib/data-table/src/TableParts/Header.d.ts +20 -5
  267. package/lib/data-table/src/TableParts/Header.js +1 -1
  268. package/lib/data-table/src/interface.d.ts +4 -1
  269. package/lib/data-table/src/styles/index.cssr.js +8 -9
  270. package/lib/data-table/styles/light.d.ts +20 -5
  271. package/lib/data-table/styles/light.js +3 -3
  272. package/lib/date-picker/src/DatePicker.d.ts +328 -127
  273. package/lib/date-picker/src/DatePicker.js +7 -17
  274. package/lib/date-picker/src/config.d.ts +9 -0
  275. package/lib/date-picker/src/config.js +9 -1
  276. package/lib/date-picker/src/panel/date.d.ts +51 -19
  277. package/lib/date-picker/src/panel/daterange.d.ts +49 -17
  278. package/lib/date-picker/src/panel/datetime.d.ts +51 -19
  279. package/lib/date-picker/src/panel/datetimerange.d.ts +49 -17
  280. package/lib/date-picker/src/panel/month.d.ts +86 -60
  281. package/lib/date-picker/src/panel/month.js +9 -6
  282. package/lib/date-picker/src/panel/use-calendar.d.ts +59 -27
  283. package/lib/date-picker/src/panel/use-calendar.js +6 -1
  284. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +47 -15
  285. package/lib/date-picker/src/panel/use-panel-common.d.ts +47 -15
  286. package/lib/date-picker/styles/_common.d.ts +2 -0
  287. package/lib/date-picker/styles/_common.js +3 -1
  288. package/lib/date-picker/styles/light.d.ts +32 -10
  289. package/lib/dialog/src/Dialog.d.ts +104 -38
  290. package/lib/dialog/src/DialogEnvironment.d.ts +2 -2
  291. package/lib/dialog/src/DialogProvider.d.ts +2 -2
  292. package/lib/dialog/styles/light.d.ts +14 -5
  293. package/lib/drawer/src/Drawer.d.ts +3 -0
  294. package/lib/drawer/src/DrawerBodyWrapper.d.ts +3 -0
  295. package/lib/drawer/src/DrawerContent.d.ts +3 -0
  296. package/lib/dropdown/index.d.ts +1 -1
  297. package/lib/dropdown/src/Dropdown.d.ts +5 -2
  298. package/lib/dropdown/src/DropdownGroup.d.ts +2 -3
  299. package/lib/dropdown/src/DropdownMenu.d.ts +3 -4
  300. package/lib/dropdown/src/DropdownMenu.js +5 -4
  301. package/lib/dropdown/src/DropdownOption.d.ts +3 -4
  302. package/lib/dropdown/src/DropdownOption.js +1 -1
  303. package/lib/dropdown/src/DropdownRenderOption.d.ts +2 -3
  304. package/lib/dropdown/src/interface.d.ts +9 -30
  305. package/lib/dropdown/src/utils.d.ts +1 -0
  306. package/lib/dropdown/src/utils.js +12 -1
  307. package/lib/dynamic-input/src/DynamicInput.d.ts +143 -50
  308. package/lib/dynamic-input/src/InputPreset.d.ts +17 -5
  309. package/lib/dynamic-input/src/PairPreset.d.ts +17 -5
  310. package/lib/dynamic-input/styles/light.d.ts +14 -5
  311. package/lib/dynamic-tags/src/DynamicTags.d.ts +144 -50
  312. package/lib/dynamic-tags/styles/light.d.ts +14 -5
  313. package/lib/ellipsis/src/Ellipsis.d.ts +3 -0
  314. package/lib/form/src/FormItemGridItem.d.ts +2 -2
  315. package/lib/global-style/src/GlobalStyle.js +2 -0
  316. package/lib/grid/src/Grid.js +1 -0
  317. package/lib/grid/src/GridItem.d.ts +2 -2
  318. package/lib/image/src/ImagePreview.js +2 -1
  319. package/lib/image/src/icons.d.ts +1 -0
  320. package/lib/image/src/icons.js +3 -1
  321. package/lib/input/src/Input.d.ts +4 -0
  322. package/lib/input/src/Input.js +9 -3
  323. package/lib/input/src/interface.d.ts +1 -0
  324. package/lib/input-number/src/InputNumber.d.ts +144 -50
  325. package/lib/input-number/styles/light.d.ts +14 -5
  326. package/lib/layout/src/Layout.d.ts +6 -0
  327. package/lib/layout/src/LayoutContent.d.ts +3 -0
  328. package/lib/layout/src/LayoutSider.d.ts +3 -0
  329. package/lib/locales/common/deDE.d.ts +3 -0
  330. package/lib/locales/common/deDE.js +95 -0
  331. package/lib/locales/common/nbNO.d.ts +3 -0
  332. package/lib/locales/common/nbNO.js +95 -0
  333. package/lib/locales/date/deDE.d.ts +3 -0
  334. package/lib/locales/date/deDE.js +11 -0
  335. package/lib/locales/date/nbNO.d.ts +3 -0
  336. package/lib/locales/date/nbNO.js +11 -0
  337. package/lib/locales/index.d.ts +6 -0
  338. package/lib/locales/index.js +11 -1
  339. package/lib/locales/utils/index.d.ts +8 -0
  340. package/lib/locales/utils/index.js +8 -0
  341. package/lib/log/src/Log.d.ts +3 -0
  342. package/lib/mention/src/Mention.d.ts +4 -0
  343. package/lib/menu/index.d.ts +1 -1
  344. package/lib/menu/src/Menu.d.ts +32 -8
  345. package/lib/menu/src/Menu.js +31 -9
  346. package/lib/menu/src/MenuDivider.d.ts +2 -0
  347. package/lib/menu/src/MenuDivider.js +13 -0
  348. package/lib/menu/src/MenuOption.d.ts +11 -2
  349. package/lib/menu/src/MenuOptionContent.d.ts +7 -2
  350. package/lib/menu/src/Submenu.d.ts +21 -17
  351. package/lib/menu/src/interface.d.ts +23 -4
  352. package/lib/menu/src/styles/index.cssr.js +6 -1
  353. package/lib/menu/src/utils.d.ts +4 -2
  354. package/lib/menu/src/utils.js +22 -3
  355. package/lib/menu/styles/light.d.ts +2 -0
  356. package/lib/menu/styles/light.js +3 -2
  357. package/lib/modal/src/BodyWrapper.d.ts +33 -12
  358. package/lib/modal/src/BodyWrapper.js +6 -0
  359. package/lib/modal/src/Modal.d.ts +185 -65
  360. package/lib/modal/src/Modal.js +5 -1
  361. package/lib/modal/src/interface.d.ts +1 -0
  362. package/lib/modal/src/presetProps.d.ts +1 -1
  363. package/lib/modal/styles/light.d.ts +14 -5
  364. package/lib/notification/src/NotificationContainer.d.ts +3 -0
  365. package/lib/pagination/index.d.ts +1 -1
  366. package/lib/pagination/src/Pagination.d.ts +20 -12
  367. package/lib/pagination/src/Pagination.js +16 -6
  368. package/lib/pagination/src/interface.d.ts +2 -0
  369. package/lib/popconfirm/src/Popconfirm.d.ts +145 -52
  370. package/lib/popconfirm/src/PopconfirmPanel.d.ts +2 -2
  371. package/lib/popconfirm/styles/light.d.ts +14 -5
  372. package/lib/popselect/src/Popselect.d.ts +3 -0
  373. package/lib/popselect/src/PopselectPanel.d.ts +3 -0
  374. package/lib/radio/src/Radio.d.ts +3 -0
  375. package/lib/radio/src/RadioButton.d.ts +3 -0
  376. package/lib/radio/src/use-radio.d.ts +2 -0
  377. package/lib/radio/src/use-radio.js +6 -3
  378. package/lib/select/src/Select.d.ts +9 -2
  379. package/lib/select/src/Select.js +20 -14
  380. package/lib/slider/src/Slider.d.ts +70 -91
  381. package/lib/slider/src/Slider.js +324 -581
  382. package/lib/slider/src/interface.d.ts +1 -1
  383. package/lib/slider/src/styles/index.cssr.js +86 -16
  384. package/lib/slider/src/utils.d.ts +10 -1
  385. package/lib/slider/src/utils.js +11 -1
  386. package/lib/slider/styles/_common.d.ts +1 -0
  387. package/lib/slider/styles/_common.js +1 -0
  388. package/lib/slider/styles/light.d.ts +1 -0
  389. package/lib/space/src/Space.js +2 -0
  390. package/lib/steps/src/Step.js +1 -1
  391. package/lib/table/src/Table.d.ts +35 -0
  392. package/lib/table/src/Table.js +8 -4
  393. package/lib/table/src/styles/index.cssr.js +1 -1
  394. package/lib/table/styles/light.d.ts +3 -0
  395. package/lib/table/styles/light.js +2 -2
  396. package/lib/tabs/index.d.ts +2 -0
  397. package/lib/tabs/index.js +3 -1
  398. package/lib/tabs/src/Tab.d.ts +35 -18
  399. package/lib/tabs/src/Tab.js +13 -16
  400. package/lib/tabs/src/TabPane.d.ts +1 -0
  401. package/lib/tabs/src/TabPane.js +2 -1
  402. package/lib/tabs/src/Tabs.d.ts +4 -0
  403. package/lib/tabs/src/Tabs.js +64 -20
  404. package/lib/tabs/src/interface.d.ts +3 -2
  405. package/lib/tag/src/Tag.d.ts +8 -3
  406. package/lib/tag/src/Tag.js +10 -1
  407. package/lib/tag/src/styles/index.cssr.js +10 -5
  408. package/lib/tag/src/styles/rtl.cssr.js +7 -1
  409. package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
  410. package/lib/time-picker/src/Panel.d.ts +17 -5
  411. package/lib/time-picker/src/TimePicker.d.ts +144 -50
  412. package/lib/time-picker/src/TimePicker.js +3 -0
  413. package/lib/time-picker/styles/light.d.ts +14 -5
  414. package/lib/tooltip/src/Tooltip.d.ts +3 -0
  415. package/lib/transfer/src/Transfer.d.ts +145 -52
  416. package/lib/transfer/src/TransferFilter.d.ts +17 -5
  417. package/lib/transfer/src/TransferList.d.ts +17 -5
  418. package/lib/transfer/src/TransferListItem.d.ts +17 -5
  419. package/lib/transfer/styles/light.d.ts +14 -5
  420. package/lib/tree/src/Tree.d.ts +13 -9
  421. package/lib/tree/src/Tree.js +58 -22
  422. package/lib/tree/src/TreeNode.js +4 -4
  423. package/lib/tree/src/TreeNodeCheckbox.d.ts +3 -0
  424. package/lib/tree/src/TreeNodeSwitcher.d.ts +1 -1
  425. package/lib/tree/src/interface.d.ts +1 -1
  426. package/lib/tree/src/utils.d.ts +1 -1
  427. package/lib/tree/src/utils.js +4 -4
  428. package/lib/tree-select/src/TreeSelect.d.ts +5 -2
  429. package/lib/upload/src/Upload.d.ts +146 -52
  430. package/lib/upload/src/Upload.js +6 -10
  431. package/lib/upload/src/UploadFile.d.ts +18 -6
  432. package/lib/upload/src/UploadFile.js +1 -1
  433. package/lib/upload/src/UploadProgress.d.ts +17 -5
  434. package/lib/upload/src/UploadTrigger.js +2 -2
  435. package/lib/upload/src/interface.d.ts +2 -1
  436. package/lib/upload/styles/light.d.ts +14 -5
  437. package/lib/version.d.ts +1 -1
  438. package/lib/version.js +1 -1
  439. package/package.json +5 -5
  440. package/web-types.json +182 -9
@@ -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,29 +22,15 @@ 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,
@@ -51,119 +39,127 @@ export default defineComponent({
51
39
  const themeRef = useTheme('Slider', 'Slider', style, sliderLight, props, mergedClsPrefixRef);
52
40
  const formItem = useFormItem(props);
53
41
  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);
42
+ const handleRailRef = ref(null);
59
43
  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);
44
+ const { step } = props;
45
+ if (step <= 0 || step === 'mark')
46
+ return 0;
47
+ const stepString = step.toString();
48
+ let precision = 0;
49
+ if (stepString.includes('.')) {
50
+ precision = stepString.length - stepString.indexOf('.') - 1;
51
+ }
52
+ return precision;
65
53
  });
54
+ const [handleRefs, setHandleRefs] = useRefs();
55
+ const [followerRefs, setFollowerRefs] = useRefs();
66
56
  const uncontrolledValueRef = ref(props.defaultValue);
67
57
  const controlledValueRef = toRef(props, 'value');
68
58
  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);
78
- const dotTransitionDisabledRef = ref(false);
79
- const activeRef = computed(() => {
80
- return handleActive1Ref.value || handleActive2Ref.value;
59
+ const arrifiedValueRef = computed(() => {
60
+ const { value: mergedValue } = mergedValueRef;
61
+ return (props.range ? mergedValue : [mergedValue]).map(clampValue);
62
+ });
63
+ const handleCountExceeds2Ref = computed(() => arrifiedValueRef.value.length > 2);
64
+ const mergedPlacementRef = computed(() => {
65
+ return props.placement === undefined
66
+ ? props.vertical
67
+ ? 'right'
68
+ : 'top'
69
+ : props.placement;
81
70
  });
82
- const prevActiveRef = ref(activeRef.value);
83
- const clickedRef = computed(() => {
84
- return handleClicked1Ref.value || handleClicked2Ref.value;
71
+ const markValuesRef = computed(() => {
72
+ const { marks } = props;
73
+ return marks ? Object.keys(marks).map(parseFloat) : null;
74
+ });
75
+ const activeIndexRef = ref(-1);
76
+ const previousIndexRef = ref(-1);
77
+ const hoverIndexRef = ref(-1);
78
+ const draggingRef = ref(false);
79
+ const styleDirectionRef = computed(() => {
80
+ const { vertical, reverse } = props;
81
+ const left = reverse ? 'right' : 'left';
82
+ const bottom = reverse ? 'top' : 'bottom';
83
+ return vertical ? bottom : left;
84
+ });
85
+ const fillStyleRef = computed(() => {
86
+ if (handleCountExceeds2Ref.value)
87
+ return;
88
+ const values = arrifiedValueRef.value;
89
+ const start = props.range ? Math.min.apply(null, values) : props.min;
90
+ const end = props.range ? Math.max.apply(null, values) : values[0];
91
+ const { value: styleDirection } = styleDirectionRef;
92
+ return props.vertical
93
+ ? {
94
+ [styleDirection]: `${valueToPercentage(start)}%`,
95
+ height: `${valueToPercentage(end - start)}%`
96
+ }
97
+ : {
98
+ [styleDirection]: `${valueToPercentage(start)}%`,
99
+ width: `${valueToPercentage(end - start)}%`
100
+ };
85
101
  });
102
+ const dotTransitionDisabledRef = ref(false);
86
103
  const markInfosRef = computed(() => {
87
104
  const mergedMarks = [];
88
- const { marks, max, min } = props;
105
+ const { marks } = props;
89
106
  if (marks) {
90
- const { value: mergedValue } = mergedValueRef;
107
+ const orderValues = arrifiedValueRef.value.slice();
108
+ orderValues.sort((a, b) => a - b);
109
+ const { value: styleDirection } = styleDirectionRef;
110
+ const { value: handleCountExceeds2 } = handleCountExceeds2Ref;
111
+ const { range } = props;
112
+ const isActive = handleCountExceeds2
113
+ ? () => false
114
+ : (num) => range
115
+ ? num >= orderValues[0] &&
116
+ num <= orderValues[orderValues.length - 1]
117
+ : num <= orderValues[0];
91
118
  for (const key of Object.keys(marks)) {
92
119
  const num = Number(key);
93
120
  mergedMarks.push({
94
- active: Array.isArray(mergedValue)
95
- ? mergedValue[0] <= num && mergedValue[1] >= num
96
- : mergedValue !== null
97
- ? mergedValue >= num
98
- : false,
121
+ active: isActive(num),
99
122
  label: marks[key],
100
123
  style: {
101
- left: `${((num - min) / (max - min)) * 100}%`
124
+ [styleDirection]: `${valueToPercentage(num)}%`
102
125
  }
103
126
  });
104
127
  }
105
128
  }
106
129
  return mergedMarks;
107
130
  });
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]);
131
+ function isShowTooltip(index) {
132
+ return (props.showTooltip ||
133
+ hoverIndexRef.value === index ||
134
+ (activeIndexRef.value === index && draggingRef.value));
135
+ }
136
+ function isSkipCSSDetection(index) {
137
+ return !(activeIndexRef.value === index && previousIndexRef.value === index);
138
+ }
139
+ function focusActiveHandle(index) {
140
+ var _a;
141
+ if (~index) {
142
+ activeIndexRef.value = index;
143
+ (_a = handleRefs.value.get(index)) === null || _a === void 0 ? void 0 : _a.focus();
137
144
  }
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;
145
- return {
146
- left: `${percentage}%`,
147
- transform: `translateX(${-percentage}%)`,
148
- zIndex: handleClicked1 ? 1 : 0
149
- };
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;
145
+ }
146
+ function syncPosition() {
147
+ followerRefs.value.forEach((inst, index) => {
148
+ if (isShowTooltip(index))
149
+ inst.syncPosition();
150
+ });
151
+ }
152
+ function getHandleStyle(value, index) {
153
+ const percentage = valueToPercentage(value);
154
+ const { value: styleDirection } = styleDirectionRef;
156
155
  return {
157
- left: `${percentage}%`,
158
- transform: `translateX(${-percentage}%)`,
159
- zIndex: handleClicked2 ? 1 : 0
156
+ [styleDirection]: `${percentage}%`,
157
+ zIndex: index === activeIndexRef.value ? 1 : 0
160
158
  };
161
- });
159
+ }
162
160
  function doUpdateValue(value) {
163
- const { onChange, 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
161
+ const { 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
164
162
  const { nTriggerFormInput, nTriggerFormChange } = formItem;
165
- if (onChange)
166
- call(onChange, value);
167
163
  if (onUpdateValue)
168
164
  call(onUpdateValue, value);
169
165
  if (_onUpdateValue)
@@ -172,411 +168,230 @@ export default defineComponent({
172
168
  nTriggerFormInput();
173
169
  nTriggerFormChange();
174
170
  }
175
- function doUpdateShow(show1, show2) {
176
- if (show1 !== undefined) {
177
- handleActive1Ref.value = show1;
171
+ function dispatchValueUpdate(value) {
172
+ const { range } = props;
173
+ if (range) {
174
+ if (Array.isArray(value)) {
175
+ const { value: oldValues } = arrifiedValueRef;
176
+ if (value.join() !== oldValues.join()) {
177
+ doUpdateValue(value);
178
+ }
179
+ }
180
+ }
181
+ else if (!Array.isArray(value)) {
182
+ const oldValue = arrifiedValueRef.value[0];
183
+ if (oldValue !== value) {
184
+ doUpdateValue(value);
185
+ }
186
+ }
187
+ }
188
+ function doDispatchValue(value, index) {
189
+ if (props.range) {
190
+ const values = arrifiedValueRef.value.slice();
191
+ values.splice(index, 1, value);
192
+ dispatchValueUpdate(values);
178
193
  }
179
- if (show2 !== undefined) {
180
- handleActive2Ref.value = show2;
194
+ else {
195
+ dispatchValueUpdate(value);
181
196
  }
182
197
  }
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();
198
+ function getClosestMark(currentValue, markValues = markValuesRef.value, buffer) {
199
+ if (markValues) {
200
+ let closestMark = null;
201
+ let index = -1;
202
+ while (++index < markValues.length) {
203
+ const diff = markValues[index] - currentValue;
204
+ const distance = Math.abs(diff);
205
+ if (
206
+ // find marks in the same direction
207
+ (buffer === undefined || diff * buffer > 0) &&
208
+ (closestMark === null || distance < closestMark.distance)) {
209
+ closestMark = {
210
+ value: markValues[index],
211
+ distance,
212
+ index
213
+ };
214
+ }
215
+ }
216
+ return closestMark;
217
+ }
218
+ return null;
187
219
  }
188
- function handleHandleFocus1() {
189
- if (clickedRef.value)
190
- return;
191
- doUpdateShow(true, false);
220
+ function sanitizeValue(value, currentValue, stepBuffer) {
221
+ const stepping = stepBuffer !== undefined;
222
+ if (!stepBuffer) {
223
+ stepBuffer = value - currentValue > 0 ? 1 : -1;
224
+ }
225
+ const markValues = markValuesRef.value || [];
226
+ const { min, max, step } = props;
227
+ if (step === 'mark') {
228
+ const closestMark = getClosestMark(value, markValues.concat(currentValue), stepping ? stepBuffer : undefined);
229
+ return closestMark ? closestMark.value : currentValue;
230
+ }
231
+ if (step <= 0)
232
+ return currentValue;
233
+ const roundValue = getRoundValue(value);
234
+ // ensure accurate step
235
+ const stepValue = new Array(Math.floor((max - min) / step) + 1)
236
+ .fill('')
237
+ .map((_, index) => step * index + min);
238
+ // If it is a stepping, priority will be given to the marks
239
+ // on the rail,otherwise take the nearest one
240
+ const closestMark = stepping
241
+ ? getClosestMark(currentValue, stepValue.concat(markValues), stepBuffer)
242
+ : getClosestMark(value, markValues.concat(roundValue));
243
+ return closestMark ? clampValue(closestMark.value) : currentValue;
192
244
  }
193
- function handleHandleFocus2() {
194
- if (clickedRef.value)
195
- return;
196
- doUpdateShow(false, true);
245
+ function clampValue(value) {
246
+ return Math.min(props.max, Math.max(props.min, value));
197
247
  }
198
- function handleHandleBlur1() {
199
- if (clickedRef.value)
200
- return;
201
- doUpdateShow(false, false);
248
+ function valueToPercentage(value) {
249
+ const { max, min } = props;
250
+ return ((value - min) / (max - min)) * 100;
202
251
  }
203
- function handleHandleBlur2() {
204
- if (clickedRef.value)
205
- return;
206
- doUpdateShow(false, false);
252
+ function percentageToValue(percentage) {
253
+ const { max, min } = props;
254
+ return min + (max - min) * percentage;
207
255
  }
208
- function handleRailClick(e) {
209
- var _a, _b, _c, _d;
210
- if (mergedDisabledRef.value)
211
- return;
212
- const { value: railEl } = railRef;
256
+ function getRoundValue(value) {
257
+ const { step, min } = props;
258
+ if (step <= 0 || step === 'mark')
259
+ return value;
260
+ const newValue = Math.round((value - min) / step) * step + min;
261
+ return Number(newValue.toFixed(precisionRef.value));
262
+ }
263
+ function getPointValue(event) {
264
+ const railEl = handleRailRef.value;
213
265
  if (!railEl)
214
266
  return;
267
+ const touchEvent = isTouchEvent(event) ? event.touches[0] : event;
215
268
  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();
269
+ let percentage;
270
+ if (props.vertical) {
271
+ percentage = (railRect.bottom - touchEvent.clientY) / railRect.height;
221
272
  }
222
273
  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();
241
- }
274
+ percentage = (touchEvent.clientX - railRect.left) / railRect.width;
242
275
  }
243
- }
244
- function handleHandleMouseMove(e, handleIndex) {
245
- if (!handleRef1.value || !railRef.value)
246
- 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
- }
260
- }
261
- else {
262
- dispatchValueUpdate(newValue);
276
+ if (props.reverse) {
277
+ percentage = 1 - percentage;
263
278
  }
279
+ return percentageToValue(percentage);
264
280
  }
265
- function handleKeyDown(e) {
281
+ function handleRailKeyDown(e) {
266
282
  if (mergedDisabledRef.value)
267
283
  return;
284
+ const { vertical, reverse } = props;
268
285
  switch (e.code) {
286
+ case 'ArrowUp':
287
+ e.preventDefault();
288
+ handleStepValue(vertical && reverse ? -1 : 1);
289
+ break;
269
290
  case 'ArrowRight':
270
- handleKeyDownRight();
291
+ e.preventDefault();
292
+ handleStepValue(!vertical && reverse ? -1 : 1);
293
+ break;
294
+ case 'ArrowDown':
295
+ e.preventDefault();
296
+ handleStepValue(vertical && reverse ? 1 : -1);
271
297
  break;
272
298
  case 'ArrowLeft':
273
- handleKeyDownLeft();
299
+ e.preventDefault();
300
+ handleStepValue(!vertical && reverse ? 1 : -1);
274
301
  break;
275
302
  }
276
303
  }
277
- function handleKeyDownRight() {
278
- if (clickedRef.value)
304
+ function handleStepValue(ratio) {
305
+ const activeIndex = activeIndexRef.value;
306
+ if (activeIndex === -1)
279
307
  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
- }
308
+ const { step } = props;
309
+ const currentValue = arrifiedValueRef.value[activeIndex];
310
+ const nextValue = step <= 0 || step === 'mark'
311
+ ? currentValue
312
+ : currentValue + step * ratio;
313
+ doDispatchValue(
314
+ // Avoid the number of value does not change when `step` is null
315
+ sanitizeValue(nextValue, currentValue, ratio > 0 ? 1 : -1), activeIndex);
314
316
  }
315
- function handleKeyDownLeft() {
316
- if (clickedRef.value)
317
+ function handleRailMouseDown(event) {
318
+ var _a, _b;
319
+ if (mergedDisabledRef.value)
317
320
  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 {
321
+ if (!isTouchEvent(event) && event.button !== eventButtonLeft) {
328
322
  return;
329
323
  }
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)
324
+ const pointValue = getPointValue(event);
325
+ if (pointValue === undefined)
423
326
  return;
424
- if (isTouchEvent(e))
425
- e.preventDefault();
426
- if (props.range) {
427
- memoziedOtherValueRef.value = handleValue2Ref.value;
327
+ const values = arrifiedValueRef.value.slice();
328
+ const activeIndex = props.range
329
+ ? (_b = (_a = getClosestMark(pointValue, values)) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : -1
330
+ : 0;
331
+ if (activeIndex !== -1) {
332
+ // avoid triggering scrolling on touch
333
+ event.preventDefault();
334
+ focusActiveHandle(activeIndex);
335
+ startDragging();
336
+ doDispatchValue(sanitizeValue(pointValue, arrifiedValueRef.value[activeIndex]), activeIndex);
428
337
  }
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
338
  }
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;
339
+ function startDragging() {
340
+ if (!draggingRef.value) {
341
+ draggingRef.value = true;
342
+ on('touchend', document, handleMouseUp);
343
+ on('mouseup', document, handleMouseUp);
344
+ on('touchmove', document, handleMouseMove);
345
+ on('mousemove', document, handleMouseMove);
443
346
  }
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
347
  }
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);
348
+ function stopDragging() {
349
+ if (draggingRef.value) {
350
+ draggingRef.value = false;
351
+ off('touchend', document, handleMouseUp);
352
+ off('mouseup', document, handleMouseUp);
353
+ off('touchmove', document, handleMouseMove);
354
+ off('mousemove', document, handleMouseMove);
457
355
  }
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
356
  }
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
- }
357
+ function handleMouseMove(event) {
358
+ const { value: activeIndex } = activeIndexRef;
359
+ if (!draggingRef.value || activeIndex === -1) {
360
+ stopDragging();
361
+ return;
511
362
  }
363
+ const pointValue = getPointValue(event);
364
+ doDispatchValue(sanitizeValue(pointValue, arrifiedValueRef.value[activeIndex]), activeIndex);
512
365
  }
513
- function handleFirstHandleMouseMove(e) {
514
- handleHandleMouseMove(e, 0);
366
+ function handleMouseUp() {
367
+ stopDragging();
515
368
  }
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
- });
369
+ function handleHandleFocus(index) {
370
+ activeIndexRef.value = index;
371
+ // Wake focus style
372
+ if (!mergedDisabledRef.value) {
373
+ hoverIndexRef.value = index;
525
374
  }
526
375
  }
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);
376
+ function handleHandleBlur(index) {
377
+ if (activeIndexRef.value === index) {
378
+ activeIndexRef.value = -1;
379
+ stopDragging();
535
380
  }
536
- }
537
- function handleSecondHandleMouseEnter() {
538
- if (!activeRef.value) {
539
- doUpdateShow(undefined, true);
540
- void nextTick(() => {
541
- syncPosition();
542
- });
381
+ if (hoverIndexRef.value === index) {
382
+ hoverIndexRef.value = -1;
543
383
  }
544
384
  }
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
- }
385
+ function handleHandleMouseEnter(index) {
386
+ hoverIndexRef.value = index;
554
387
  }
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
- });
388
+ function handleHandleMouseLeave(index) {
389
+ if (hoverIndexRef.value === index) {
390
+ hoverIndexRef.value = -1;
571
391
  }
572
392
  }
573
- watch(activeRef, (value) => {
574
- void nextTick(() => {
575
- prevActiveRef.value = value;
576
- });
577
- });
578
- watch(mergedValueRef, (newValue, oldValue) => {
579
- const { value: changeSource } = changeSourceRef;
393
+ watch(activeIndexRef, (_, previous) => (previousIndexRef.value = previous));
394
+ watch(mergedValueRef, () => {
580
395
  if (props.marks) {
581
396
  if (dotTransitionDisabledRef.value)
582
397
  return;
@@ -585,57 +400,7 @@ export default defineComponent({
585
400
  dotTransitionDisabledRef.value = false;
586
401
  });
587
402
  }
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);
403
+ void nextTick(syncPosition);
639
404
  });
640
405
  return {
641
406
  mergedClsPrefix: mergedClsPrefixRef,
@@ -643,43 +408,26 @@ export default defineComponent({
643
408
  uncontrolledValue: uncontrolledValueRef,
644
409
  mergedValue: mergedValueRef,
645
410
  mergedDisabled: mergedDisabledRef,
411
+ mergedPlacement: mergedPlacementRef,
646
412
  isMounted: useIsMounted(),
647
413
  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
414
  dotTransitionDisabled: dotTransitionDisabledRef,
661
415
  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,
416
+ isShowTooltip,
417
+ isSkipCSSDetection,
418
+ handleRailRef,
419
+ setHandleRefs,
420
+ setFollowerRefs,
670
421
  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,
422
+ getHandleStyle,
423
+ activeIndex: activeIndexRef,
424
+ arrifiedValues: arrifiedValueRef,
425
+ handleRailMouseDown,
426
+ handleHandleFocus,
427
+ handleHandleBlur,
428
+ handleHandleMouseEnter,
429
+ handleHandleMouseLeave,
430
+ handleRailKeyDown,
683
431
  indicatorCssVars: computed(() => {
684
432
  const { self: { fontSize, indicatorColor, indicatorBoxShadow, indicatorTextColor, indicatorBorderRadius } } = themeRef.value;
685
433
  return {
@@ -691,7 +439,7 @@ export default defineComponent({
691
439
  };
692
440
  }),
693
441
  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;
442
+ 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
443
  return {
696
444
  '--bezier': cubicBezierEaseInOut,
697
445
  '--dot-border': dotBorder,
@@ -715,7 +463,8 @@ export default defineComponent({
715
463
  '--opacity-disabled': opacityDisabled,
716
464
  '--rail-color': railColor,
717
465
  '--rail-color-hover': railColorHover,
718
- '--rail-height': railHeight
466
+ '--rail-height': railHeight,
467
+ '--rail-width-vertical': railWidthVertical
719
468
  };
720
469
  })
721
470
  };
@@ -726,11 +475,13 @@ export default defineComponent({
726
475
  `${mergedClsPrefix}-slider`,
727
476
  {
728
477
  [`${mergedClsPrefix}-slider--disabled`]: this.mergedDisabled,
729
- [`${mergedClsPrefix}-slider--active`]: this.active,
730
- [`${mergedClsPrefix}-slider--with-mark`]: this.marks
478
+ [`${mergedClsPrefix}-slider--active`]: this.activeIndex !== -1,
479
+ [`${mergedClsPrefix}-slider--with-mark`]: this.marks,
480
+ [`${mergedClsPrefix}-slider--vertical`]: this.vertical,
481
+ [`${mergedClsPrefix}-slider--reverse`]: this.reverse
731
482
  }
732
- ], style: this.cssVars, onKeydown: this.handleKeyDown, onClick: this.handleRailClick },
733
- h("div", { ref: "railRef", class: `${mergedClsPrefix}-slider-rail` },
483
+ ], style: this.cssVars, onKeydown: this.handleRailKeyDown, onMousedown: this.handleRailMouseDown, onTouchstart: this.handleRailMouseDown },
484
+ h("div", { class: `${mergedClsPrefix}-slider-rail` },
734
485
  h("div", { class: `${mergedClsPrefix}-slider-rail__fill`, style: this.fillStyle }),
735
486
  this.marks ? (h("div", { class: [
736
487
  `${mergedClsPrefix}-slider-dots`,
@@ -742,35 +493,27 @@ export default defineComponent({
742
493
  {
743
494
  [`${mergedClsPrefix}-slider-dot--active`]: mark.active
744
495
  }
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));
496
+ ], style: mark.style }))))) : null,
497
+ h("div", { ref: "handleRailRef", class: `${mergedClsPrefix}-slider-handles` }, this.arrifiedValues.map((value, index) => {
498
+ const showTooltip = this.isShowTooltip(index);
499
+ return (h(VBinder, null, {
500
+ default: () => [
501
+ h(VTarget, null, {
502
+ 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) }))
503
+ }),
504
+ this.tooltip && (h(VFollower, { ref: this.setFollowerRefs(index), show: showTooltip, to: this.adjustedTo, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: this.mergedPlacement, containerClass: this.namespace }, {
505
+ default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, css: this.isSkipCSSDetection(index) }, {
506
+ default: () => showTooltip ? (h("div", { class: [
507
+ `${mergedClsPrefix}-slider-handle-indicator`,
508
+ `${mergedClsPrefix}-slider-handle-indicator--${this.mergedPlacement}`
509
+ ], style: this.indicatorCssVars }, typeof formatTooltip === 'function'
510
+ ? formatTooltip(value)
511
+ : value)) : null
512
+ }))
513
+ }))
514
+ ]
515
+ }));
516
+ })),
517
+ 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
518
  }
776
519
  });