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