naive-ui 2.32.0 → 2.32.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 (432) hide show
  1. package/README.zh-CN.md +1 -1
  2. package/dist/index.js +46388 -42920
  3. package/dist/index.prod.js +2 -2
  4. package/es/_internal/scrollbar/src/Scrollbar.js +2 -1
  5. package/es/_internal/select-menu/styles/light.js +1 -1
  6. package/es/_internal/selection/src/Selection.js +1 -1
  7. package/es/_utils/cssr/index.js +4 -4
  8. package/es/alert/src/Alert.d.ts +14 -0
  9. package/es/alert/src/Alert.js +11 -2
  10. package/es/alert/src/styles/index.cssr.js +11 -2
  11. package/es/alert/styles/dark.js +5 -1
  12. package/es/anchor/styles/light.js +2 -1
  13. package/es/auto-complete/src/AutoComplete.d.ts +14 -1
  14. package/es/auto-complete/src/AutoComplete.js +22 -16
  15. package/es/auto-complete/styles/light.d.ts +1 -0
  16. package/es/breadcrumb/styles/light.js +1 -1
  17. package/es/button/styles/light.js +5 -1
  18. package/es/card/styles/light.js +1 -1
  19. package/es/carousel/src/Carousel.js +7 -5
  20. package/es/cascader/src/Cascader.d.ts +13 -0
  21. package/es/cascader/src/Cascader.js +12 -4
  22. package/es/checkbox/src/CheckboxGroup.js +2 -2
  23. package/es/checkbox/styles/light.js +1 -1
  24. package/es/collapse/src/Collapse.d.ts +22 -0
  25. package/es/collapse/src/Collapse.js +4 -2
  26. package/es/collapse/src/CollapseItem.d.ts +6 -1
  27. package/es/collapse/src/CollapseItem.js +4 -2
  28. package/es/collapse/src/styles/index.cssr.js +10 -21
  29. package/es/collapse/styles/light.d.ts +2 -0
  30. package/es/collapse/styles/light.js +5 -3
  31. package/es/color-picker/src/ColorInputUnit.d.ts +1 -0
  32. package/es/color-picker/src/ColorPicker.d.ts +9 -0
  33. package/es/color-picker/src/ColorPicker.js +3 -2
  34. package/es/color-picker/styles/light.d.ts +1 -0
  35. package/es/countdown/src/Countdown.js +1 -1
  36. package/es/data-table/src/DataTable.d.ts +18 -0
  37. package/es/data-table/src/DataTable.js +6 -3
  38. package/es/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
  39. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +4 -2
  40. package/es/data-table/src/TableParts/Body.d.ts +6 -0
  41. package/es/data-table/src/TableParts/Body.js +22 -14
  42. package/es/data-table/src/TableParts/Cell.d.ts +4 -0
  43. package/es/data-table/src/TableParts/ExpandTrigger.d.ts +7 -1
  44. package/es/data-table/src/TableParts/ExpandTrigger.js +15 -9
  45. package/es/data-table/src/TableParts/Header.d.ts +3 -1
  46. package/es/data-table/src/interface.d.ts +6 -3
  47. package/es/data-table/src/styles/index.cssr.js +25 -7
  48. package/es/data-table/src/use-expand.d.ts +3 -1
  49. package/es/data-table/src/use-expand.js +15 -8
  50. package/es/data-table/src/use-group-header.js +1 -1
  51. package/es/data-table/src/use-sorter.js +1 -1
  52. package/es/data-table/src/use-table-data.js +1 -1
  53. package/es/data-table/styles/light.d.ts +1 -0
  54. package/es/date-picker/src/DatePicker.d.ts +23 -2
  55. package/es/date-picker/src/DatePicker.js +4 -4
  56. package/es/date-picker/src/panel/date.d.ts +6 -3
  57. package/es/date-picker/src/panel/daterange.d.ts +3 -0
  58. package/es/date-picker/src/panel/datetime.d.ts +3 -0
  59. package/es/date-picker/src/panel/datetimerange.d.ts +3 -0
  60. package/es/date-picker/src/panel/month.d.ts +3 -0
  61. package/es/date-picker/src/panel/monthrange.d.ts +3 -0
  62. package/es/date-picker/src/panel/panelHeader.d.ts +6 -0
  63. package/es/date-picker/src/panel/panelHeader.js +3 -1
  64. package/es/date-picker/src/panel/use-calendar.d.ts +3 -0
  65. package/es/date-picker/src/panel/use-dual-calendar.d.ts +3 -0
  66. package/es/date-picker/src/panel/use-panel-common.d.ts +3 -0
  67. package/es/date-picker/src/styles/index.cssr.js +6 -6
  68. package/es/date-picker/styles/light.d.ts +2 -0
  69. package/es/descriptions/styles/light.js +1 -1
  70. package/es/drawer/src/Drawer.d.ts +8 -8
  71. package/es/drawer/src/Drawer.js +3 -3
  72. package/es/drawer/src/DrawerBodyWrapper.d.ts +1 -0
  73. package/es/drawer/src/DrawerBodyWrapper.js +6 -0
  74. package/es/drawer/src/styles/rtl.cssr.d.ts +2 -0
  75. package/es/drawer/src/styles/rtl.cssr.js +8 -0
  76. package/es/drawer/styles/index.d.ts +1 -0
  77. package/es/drawer/styles/index.js +1 -0
  78. package/es/drawer/styles/rtl.d.ts +3 -0
  79. package/es/drawer/styles/rtl.js +8 -0
  80. package/es/dropdown/src/Dropdown.js +6 -6
  81. package/es/dropdown/src/styles/index.cssr.js +35 -33
  82. package/es/dynamic-input/src/DynamicInput.d.ts +10 -0
  83. package/es/dynamic-input/src/InputPreset.d.ts +1 -0
  84. package/es/dynamic-input/src/PairPreset.d.ts +1 -0
  85. package/es/dynamic-input/styles/light.d.ts +1 -0
  86. package/es/dynamic-tags/src/DynamicTags.d.ts +10 -0
  87. package/es/dynamic-tags/styles/light.d.ts +1 -0
  88. package/es/empty/styles/light.js +1 -1
  89. package/es/grid/src/Grid.d.ts +5 -0
  90. package/es/grid/src/Grid.js +18 -0
  91. package/es/grid/src/GridItem.d.ts +2 -0
  92. package/es/grid/src/GridItem.js +15 -2
  93. package/es/input/src/Input.d.ts +21 -1
  94. package/es/input/src/Input.js +23 -6
  95. package/es/input/src/InputGroupLabel.d.ts +9 -0
  96. package/es/input/src/styles/input.cssr.d.ts +1 -0
  97. package/es/input/src/styles/input.cssr.js +12 -4
  98. package/es/input/styles/dark.js +1 -1
  99. package/es/input/styles/light.d.ts +1 -0
  100. package/es/input/styles/light.js +1 -1
  101. package/es/input-number/src/InputNumber.d.ts +15 -5
  102. package/es/input-number/src/InputNumber.js +6 -8
  103. package/es/input-number/src/interface.d.ts +1 -0
  104. package/es/input-number/styles/light.d.ts +1 -0
  105. package/es/layout/src/Layout.js +3 -1
  106. package/es/legacy-grid/src/Row.js +2 -2
  107. package/es/legacy-transfer/src/Transfer.d.ts +10 -0
  108. package/es/legacy-transfer/src/TransferFilter.d.ts +1 -0
  109. package/es/legacy-transfer/src/TransferList.d.ts +1 -0
  110. package/es/legacy-transfer/src/TransferListItem.d.ts +1 -0
  111. package/es/legacy-transfer/styles/light.d.ts +1 -0
  112. package/es/list/src/List.d.ts +47 -3
  113. package/es/list/src/List.js +17 -7
  114. package/es/list/src/ListItem.d.ts +1 -0
  115. package/es/list/src/ListItem.js +3 -1
  116. package/es/list/src/styles/index.cssr.js +35 -12
  117. package/es/list/src/styles/rtl.cssr.d.ts +2 -0
  118. package/es/list/src/styles/rtl.cssr.js +11 -0
  119. package/es/list/styles/index.d.ts +1 -0
  120. package/es/list/styles/index.js +1 -0
  121. package/es/list/styles/light.d.ts +3 -0
  122. package/es/list/styles/light.js +4 -1
  123. package/es/list/styles/rtl.d.ts +2 -0
  124. package/es/list/styles/rtl.js +5 -0
  125. package/es/locales/common/viVN.js +7 -9
  126. package/es/mention/src/Mention.d.ts +10 -0
  127. package/es/mention/styles/light.d.ts +1 -0
  128. package/es/menu/src/Menu.d.ts +13 -0
  129. package/es/menu/src/Menu.js +4 -1
  130. package/es/menu/src/Submenu.js +1 -1
  131. package/es/menu/src/utils.d.ts +1 -1
  132. package/es/menu/src/utils.js +5 -1
  133. package/es/message/src/Message.d.ts +1 -0
  134. package/es/message/src/Message.js +8 -3
  135. package/es/message/src/styles/rtl.cssr.d.ts +2 -0
  136. package/es/message/src/styles/rtl.cssr.js +8 -0
  137. package/es/message/styles/index.d.ts +1 -0
  138. package/es/message/styles/index.js +1 -0
  139. package/es/message/styles/light.js +4 -1
  140. package/es/message/styles/rtl.d.ts +2 -0
  141. package/es/message/styles/rtl.js +5 -0
  142. package/es/modal/src/Modal.js +2 -1
  143. package/es/notification/styles/light.js +3 -1
  144. package/es/number-animation/src/NumberAnimation.js +1 -1
  145. package/es/pagination/src/Pagination.d.ts +31 -26
  146. package/es/pagination/src/Pagination.js +207 -164
  147. package/es/pagination/src/styles/index.cssr.js +7 -1
  148. package/es/pagination/styles/light.d.ts +1 -0
  149. package/es/popover/src/Popover.js +2 -2
  150. package/es/popover/src/PopoverBody.js +3 -2
  151. package/es/popselect/src/Popselect.d.ts +3 -3
  152. package/es/radio/styles/dark.js +1 -1
  153. package/es/radio/styles/light.js +1 -1
  154. package/es/select/index.d.ts +1 -1
  155. package/es/select/src/Select.d.ts +4 -1
  156. package/es/select/src/Select.js +4 -4
  157. package/es/skeleton/src/Skeleton.js +1 -1
  158. package/es/slider/styles/dark.js +2 -1
  159. package/es/slider/styles/light.js +2 -1
  160. package/es/statistic/src/Statistic.d.ts +10 -0
  161. package/es/statistic/src/Statistic.js +2 -1
  162. package/es/statistic/src/styles/index.cssr.js +4 -3
  163. package/es/statistic/styles/light.d.ts +1 -0
  164. package/es/statistic/styles/light.js +1 -0
  165. package/es/steps/src/Steps.d.ts +1 -0
  166. package/es/steps/src/Steps.js +6 -3
  167. package/es/steps/src/styles/rtl.cssr.d.ts +2 -0
  168. package/es/steps/src/styles/rtl.cssr.js +14 -0
  169. package/es/steps/styles/index.d.ts +1 -0
  170. package/es/steps/styles/index.js +1 -0
  171. package/es/steps/styles/rtl.d.ts +2 -0
  172. package/es/steps/styles/rtl.js +5 -0
  173. package/es/styles.d.ts +4 -3
  174. package/es/styles.js +4 -3
  175. package/es/switch/src/Switch.js +32 -5
  176. package/es/switch/src/styles/index.cssr.js +2 -2
  177. package/es/tag/src/Tag.d.ts +4 -4
  178. package/es/tag/src/Tag.js +3 -3
  179. package/es/tag/src/styles/index.cssr.js +0 -1
  180. package/es/tag/styles/light.js +4 -1
  181. package/es/thing/src/Thing.d.ts +19 -21
  182. package/es/thing/src/Thing.js +4 -7
  183. package/es/time-picker/src/Panel.d.ts +1 -0
  184. package/es/time-picker/src/TimePicker.d.ts +12 -2
  185. package/es/time-picker/src/TimePicker.js +4 -4
  186. package/es/time-picker/src/styles/index.cssr.js +12 -12
  187. package/es/time-picker/styles/light.d.ts +1 -0
  188. package/es/timeline/src/TimelineItem.js +1 -1
  189. package/es/tooltip/styles/dark.js +1 -1
  190. package/es/tooltip/styles/light.js +1 -1
  191. package/es/transfer/src/Transfer.d.ts +37 -6
  192. package/es/transfer/src/Transfer.js +32 -23
  193. package/es/transfer/src/TransferFilter.d.ts +1 -0
  194. package/es/transfer/src/TransferList.d.ts +1 -0
  195. package/es/transfer/src/TransferList.js +1 -1
  196. package/es/transfer/src/TransferListItem.d.ts +1 -0
  197. package/es/transfer/src/interface.d.ts +1 -1
  198. package/es/transfer/src/use-transfer-data.d.ts +11 -4
  199. package/es/transfer/src/use-transfer-data.js +59 -16
  200. package/es/transfer/styles/light.d.ts +1 -0
  201. package/es/tree/index.d.ts +1 -1
  202. package/es/tree/src/Tree.d.ts +34 -1
  203. package/es/tree/src/Tree.js +25 -11
  204. package/es/tree/src/interface.d.ts +5 -0
  205. package/es/tree/src/keyboard.d.ts +4 -1
  206. package/es/tree/src/keyboard.js +3 -1
  207. package/es/tree-select/src/TreeSelect.d.ts +13 -0
  208. package/es/tree-select/src/TreeSelect.js +4 -4
  209. package/es/typography/styles/light.js +1 -1
  210. package/es/upload/src/Upload.d.ts +10 -0
  211. package/es/upload/src/Upload.js +1 -1
  212. package/es/upload/src/UploadFile.js +4 -2
  213. package/es/upload/src/utils.d.ts +1 -0
  214. package/es/upload/src/utils.js +12 -0
  215. package/es/version.d.ts +1 -1
  216. package/es/version.js +1 -1
  217. package/lib/_internal/scrollbar/src/Scrollbar.js +2 -1
  218. package/lib/_internal/select-menu/styles/light.js +1 -1
  219. package/lib/_internal/selection/src/Selection.js +1 -1
  220. package/lib/_utils/cssr/index.js +2 -2
  221. package/lib/alert/src/Alert.d.ts +14 -0
  222. package/lib/alert/src/Alert.js +11 -2
  223. package/lib/alert/src/styles/index.cssr.js +11 -2
  224. package/lib/alert/styles/dark.js +5 -1
  225. package/lib/anchor/styles/light.js +2 -1
  226. package/lib/auto-complete/src/AutoComplete.d.ts +14 -1
  227. package/lib/auto-complete/src/AutoComplete.js +22 -16
  228. package/lib/auto-complete/styles/light.d.ts +1 -0
  229. package/lib/breadcrumb/styles/light.js +1 -1
  230. package/lib/button/styles/light.js +5 -1
  231. package/lib/card/styles/light.js +1 -1
  232. package/lib/carousel/src/Carousel.js +7 -5
  233. package/lib/cascader/src/Cascader.d.ts +13 -0
  234. package/lib/cascader/src/Cascader.js +11 -3
  235. package/lib/checkbox/src/CheckboxGroup.js +2 -2
  236. package/lib/checkbox/styles/light.js +1 -1
  237. package/lib/collapse/src/Collapse.d.ts +22 -0
  238. package/lib/collapse/src/Collapse.js +4 -2
  239. package/lib/collapse/src/CollapseItem.d.ts +6 -1
  240. package/lib/collapse/src/CollapseItem.js +4 -2
  241. package/lib/collapse/src/styles/index.cssr.js +10 -21
  242. package/lib/collapse/styles/light.d.ts +2 -0
  243. package/lib/collapse/styles/light.js +5 -3
  244. package/lib/color-picker/src/ColorInputUnit.d.ts +1 -0
  245. package/lib/color-picker/src/ColorPicker.d.ts +9 -0
  246. package/lib/color-picker/src/ColorPicker.js +2 -1
  247. package/lib/color-picker/styles/light.d.ts +1 -0
  248. package/lib/countdown/src/Countdown.js +1 -1
  249. package/lib/data-table/src/DataTable.d.ts +18 -0
  250. package/lib/data-table/src/DataTable.js +6 -3
  251. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +2 -0
  252. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +4 -2
  253. package/lib/data-table/src/TableParts/Body.d.ts +6 -0
  254. package/lib/data-table/src/TableParts/Body.js +22 -14
  255. package/lib/data-table/src/TableParts/Cell.d.ts +4 -0
  256. package/lib/data-table/src/TableParts/ExpandTrigger.d.ts +7 -1
  257. package/lib/data-table/src/TableParts/ExpandTrigger.js +15 -9
  258. package/lib/data-table/src/TableParts/Header.d.ts +3 -1
  259. package/lib/data-table/src/interface.d.ts +6 -3
  260. package/lib/data-table/src/styles/index.cssr.js +25 -7
  261. package/lib/data-table/src/use-expand.d.ts +3 -1
  262. package/lib/data-table/src/use-expand.js +15 -8
  263. package/lib/data-table/src/use-group-header.js +1 -1
  264. package/lib/data-table/src/use-sorter.js +1 -1
  265. package/lib/data-table/src/use-table-data.js +1 -1
  266. package/lib/data-table/styles/light.d.ts +1 -0
  267. package/lib/date-picker/src/DatePicker.d.ts +23 -2
  268. package/lib/date-picker/src/DatePicker.js +3 -3
  269. package/lib/date-picker/src/panel/date.d.ts +6 -3
  270. package/lib/date-picker/src/panel/daterange.d.ts +3 -0
  271. package/lib/date-picker/src/panel/datetime.d.ts +3 -0
  272. package/lib/date-picker/src/panel/datetimerange.d.ts +3 -0
  273. package/lib/date-picker/src/panel/month.d.ts +3 -0
  274. package/lib/date-picker/src/panel/monthrange.d.ts +3 -0
  275. package/lib/date-picker/src/panel/panelHeader.d.ts +6 -0
  276. package/lib/date-picker/src/panel/panelHeader.js +3 -1
  277. package/lib/date-picker/src/panel/use-calendar.d.ts +3 -0
  278. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +3 -0
  279. package/lib/date-picker/src/panel/use-panel-common.d.ts +3 -0
  280. package/lib/date-picker/src/styles/index.cssr.js +6 -6
  281. package/lib/date-picker/styles/light.d.ts +2 -0
  282. package/lib/descriptions/styles/light.js +1 -1
  283. package/lib/drawer/src/Drawer.d.ts +8 -8
  284. package/lib/drawer/src/Drawer.js +3 -3
  285. package/lib/drawer/src/DrawerBodyWrapper.d.ts +1 -0
  286. package/lib/drawer/src/DrawerBodyWrapper.js +6 -0
  287. package/lib/drawer/src/styles/rtl.cssr.d.ts +2 -0
  288. package/lib/drawer/src/styles/rtl.cssr.js +15 -0
  289. package/lib/drawer/styles/index.d.ts +1 -0
  290. package/lib/drawer/styles/index.js +3 -1
  291. package/lib/drawer/styles/rtl.d.ts +3 -0
  292. package/lib/drawer/styles/rtl.js +14 -0
  293. package/lib/dropdown/src/Dropdown.js +6 -6
  294. package/lib/dropdown/src/styles/index.cssr.js +35 -33
  295. package/lib/dynamic-input/src/DynamicInput.d.ts +10 -0
  296. package/lib/dynamic-input/src/InputPreset.d.ts +1 -0
  297. package/lib/dynamic-input/src/PairPreset.d.ts +1 -0
  298. package/lib/dynamic-input/styles/light.d.ts +1 -0
  299. package/lib/dynamic-tags/src/DynamicTags.d.ts +10 -0
  300. package/lib/dynamic-tags/styles/light.d.ts +1 -0
  301. package/lib/empty/styles/light.js +1 -1
  302. package/lib/grid/src/Grid.d.ts +5 -0
  303. package/lib/grid/src/Grid.js +18 -0
  304. package/lib/grid/src/GridItem.d.ts +2 -0
  305. package/lib/grid/src/GridItem.js +14 -1
  306. package/lib/input/src/Input.d.ts +21 -1
  307. package/lib/input/src/Input.js +45 -5
  308. package/lib/input/src/InputGroupLabel.d.ts +9 -0
  309. package/lib/input/src/styles/input.cssr.d.ts +1 -0
  310. package/lib/input/src/styles/input.cssr.js +13 -4
  311. package/lib/input/styles/dark.js +1 -1
  312. package/lib/input/styles/light.d.ts +1 -0
  313. package/lib/input/styles/light.js +1 -1
  314. package/lib/input-number/src/InputNumber.d.ts +15 -5
  315. package/lib/input-number/src/InputNumber.js +6 -8
  316. package/lib/input-number/src/interface.d.ts +1 -0
  317. package/lib/input-number/styles/light.d.ts +1 -0
  318. package/lib/layout/src/Layout.js +3 -1
  319. package/lib/legacy-grid/src/Row.js +2 -2
  320. package/lib/legacy-transfer/src/Transfer.d.ts +10 -0
  321. package/lib/legacy-transfer/src/TransferFilter.d.ts +1 -0
  322. package/lib/legacy-transfer/src/TransferList.d.ts +1 -0
  323. package/lib/legacy-transfer/src/TransferListItem.d.ts +1 -0
  324. package/lib/legacy-transfer/styles/light.d.ts +1 -0
  325. package/lib/list/src/List.d.ts +47 -3
  326. package/lib/list/src/List.js +15 -5
  327. package/lib/list/src/ListItem.d.ts +1 -0
  328. package/lib/list/src/ListItem.js +3 -1
  329. package/lib/list/src/styles/index.cssr.js +35 -12
  330. package/lib/list/src/styles/rtl.cssr.d.ts +2 -0
  331. package/lib/list/src/styles/rtl.cssr.js +18 -0
  332. package/lib/list/styles/index.d.ts +1 -0
  333. package/lib/list/styles/index.js +3 -1
  334. package/lib/list/styles/light.d.ts +3 -0
  335. package/lib/list/styles/light.js +4 -1
  336. package/lib/list/styles/rtl.d.ts +2 -0
  337. package/lib/list/styles/rtl.js +11 -0
  338. package/lib/locales/common/viVN.js +7 -9
  339. package/lib/mention/src/Mention.d.ts +10 -0
  340. package/lib/mention/styles/light.d.ts +1 -0
  341. package/lib/menu/src/Menu.d.ts +13 -0
  342. package/lib/menu/src/Menu.js +4 -1
  343. package/lib/menu/src/Submenu.js +1 -1
  344. package/lib/menu/src/utils.d.ts +1 -1
  345. package/lib/menu/src/utils.js +5 -1
  346. package/lib/message/src/Message.d.ts +1 -0
  347. package/lib/message/src/Message.js +7 -2
  348. package/lib/message/src/styles/rtl.cssr.d.ts +2 -0
  349. package/lib/message/src/styles/rtl.cssr.js +15 -0
  350. package/lib/message/styles/index.d.ts +1 -0
  351. package/lib/message/styles/index.js +3 -1
  352. package/lib/message/styles/light.js +4 -1
  353. package/lib/message/styles/rtl.d.ts +2 -0
  354. package/lib/message/styles/rtl.js +11 -0
  355. package/lib/modal/src/Modal.js +2 -1
  356. package/lib/notification/styles/light.js +3 -1
  357. package/lib/number-animation/src/NumberAnimation.js +1 -1
  358. package/lib/pagination/src/Pagination.d.ts +31 -26
  359. package/lib/pagination/src/Pagination.js +206 -163
  360. package/lib/pagination/src/styles/index.cssr.js +7 -1
  361. package/lib/pagination/styles/light.d.ts +1 -0
  362. package/lib/popover/src/Popover.js +2 -2
  363. package/lib/popover/src/PopoverBody.js +3 -2
  364. package/lib/popselect/src/Popselect.d.ts +3 -3
  365. package/lib/radio/styles/dark.js +1 -1
  366. package/lib/radio/styles/light.js +1 -1
  367. package/lib/select/index.d.ts +1 -1
  368. package/lib/select/src/Select.d.ts +4 -1
  369. package/lib/select/src/Select.js +3 -3
  370. package/lib/skeleton/src/Skeleton.js +1 -1
  371. package/lib/slider/styles/dark.js +2 -1
  372. package/lib/slider/styles/light.js +2 -1
  373. package/lib/statistic/src/Statistic.d.ts +10 -0
  374. package/lib/statistic/src/Statistic.js +2 -1
  375. package/lib/statistic/src/styles/index.cssr.js +4 -3
  376. package/lib/statistic/styles/light.d.ts +1 -0
  377. package/lib/statistic/styles/light.js +1 -0
  378. package/lib/steps/src/Steps.d.ts +1 -0
  379. package/lib/steps/src/Steps.js +5 -2
  380. package/lib/steps/src/styles/rtl.cssr.d.ts +2 -0
  381. package/lib/steps/src/styles/rtl.cssr.js +21 -0
  382. package/lib/steps/styles/index.d.ts +1 -0
  383. package/lib/steps/styles/index.js +3 -1
  384. package/lib/steps/styles/rtl.d.ts +2 -0
  385. package/lib/steps/styles/rtl.js +11 -0
  386. package/lib/styles.d.ts +4 -3
  387. package/lib/styles.js +154 -149
  388. package/lib/switch/src/Switch.js +32 -5
  389. package/lib/switch/src/styles/index.cssr.js +2 -2
  390. package/lib/tag/src/Tag.d.ts +4 -4
  391. package/lib/tag/src/Tag.js +3 -3
  392. package/lib/tag/src/styles/index.cssr.js +0 -1
  393. package/lib/tag/styles/light.js +4 -1
  394. package/lib/thing/src/Thing.d.ts +19 -21
  395. package/lib/thing/src/Thing.js +4 -7
  396. package/lib/time-picker/src/Panel.d.ts +1 -0
  397. package/lib/time-picker/src/TimePicker.d.ts +12 -2
  398. package/lib/time-picker/src/TimePicker.js +3 -3
  399. package/lib/time-picker/src/styles/index.cssr.js +12 -12
  400. package/lib/time-picker/styles/light.d.ts +1 -0
  401. package/lib/timeline/src/TimelineItem.js +1 -1
  402. package/lib/tooltip/styles/dark.js +1 -1
  403. package/lib/tooltip/styles/light.js +1 -1
  404. package/lib/transfer/src/Transfer.d.ts +37 -6
  405. package/lib/transfer/src/Transfer.js +32 -23
  406. package/lib/transfer/src/TransferFilter.d.ts +1 -0
  407. package/lib/transfer/src/TransferList.d.ts +1 -0
  408. package/lib/transfer/src/TransferList.js +1 -1
  409. package/lib/transfer/src/TransferListItem.d.ts +1 -0
  410. package/lib/transfer/src/interface.d.ts +1 -1
  411. package/lib/transfer/src/use-transfer-data.d.ts +11 -4
  412. package/lib/transfer/src/use-transfer-data.js +59 -16
  413. package/lib/transfer/styles/light.d.ts +1 -0
  414. package/lib/tree/index.d.ts +1 -1
  415. package/lib/tree/src/Tree.d.ts +34 -1
  416. package/lib/tree/src/Tree.js +25 -11
  417. package/lib/tree/src/interface.d.ts +5 -0
  418. package/lib/tree/src/keyboard.d.ts +4 -1
  419. package/lib/tree/src/keyboard.js +3 -1
  420. package/lib/tree-select/src/TreeSelect.d.ts +13 -0
  421. package/lib/tree-select/src/TreeSelect.js +3 -3
  422. package/lib/typography/styles/light.js +1 -1
  423. package/lib/upload/src/Upload.d.ts +10 -0
  424. package/lib/upload/src/Upload.js +1 -1
  425. package/lib/upload/src/UploadFile.js +3 -1
  426. package/lib/upload/src/utils.d.ts +1 -0
  427. package/lib/upload/src/utils.js +14 -1
  428. package/lib/version.d.ts +1 -1
  429. package/lib/version.js +1 -1
  430. package/package.json +25 -19
  431. package/volar.d.ts +1 -1
  432. package/web-types.json +210 -3
@@ -195,6 +195,7 @@ declare const _default: import("vue").DefineComponent<{
195
195
  colorHover: string;
196
196
  }, any>;
197
197
  Input: import("../../_mixins").Theme<"Input", {
198
+ countTextColorDisabled: string;
198
199
  countTextColor: string;
199
200
  heightTiny: string;
200
201
  heightSmall: string;
@@ -7,7 +7,7 @@ export interface Option {
7
7
  value: OptionValue;
8
8
  disabled?: boolean;
9
9
  }
10
- export declare type Filter = (pattern: string, option: Option) => boolean;
10
+ export declare type Filter = (pattern: string, option: Option, from: 'source' | 'target') => boolean;
11
11
  export interface RenderLabelProps {
12
12
  option: Option;
13
13
  }
@@ -3,21 +3,28 @@ interface UseTransferDataProps {
3
3
  defaultValue: OptionValue[] | null;
4
4
  value?: OptionValue[] | null;
5
5
  options: Option[];
6
- filterable: boolean;
6
+ filterable: boolean | undefined;
7
+ sourceFilterable: Boolean;
8
+ targetFilterable: Boolean;
7
9
  filter: Filter;
8
10
  }
9
11
  export declare function useTransferData(props: UseTransferDataProps): {
10
12
  uncontrolledValueRef: import("vue").Ref<OptionValue[] | null>;
11
13
  mergedValueRef: import("vue").ComputedRef<OptionValue[] | null>;
12
14
  targetValueSetRef: import("vue").ComputedRef<Set<OptionValue>>;
13
- valueSetForSelectAllRef: import("vue").ComputedRef<Set<OptionValue>>;
14
- valueSetForUnselectAllRef: import("vue").ComputedRef<Set<OptionValue>>;
15
- targetOptionsRef: import("vue").ComputedRef<Option[]>;
15
+ valueSetForCheckAllRef: import("vue").ComputedRef<Set<string | number>>;
16
+ valueSetForUncheckAllRef: import("vue").ComputedRef<Set<string | number>>;
17
+ valueSetForClearRef: import("vue").ComputedRef<Set<string | number>>;
18
+ filteredTgtOptionsRef: import("vue").ComputedRef<Option[]>;
16
19
  filteredSrcOptionsRef: import("vue").ComputedRef<Option[]>;
20
+ targetOptionsRef: import("vue").ComputedRef<Option[]>;
17
21
  canNotSelectAnythingRef: import("vue").ComputedRef<boolean>;
18
22
  canBeClearedRef: import("vue").ComputedRef<boolean>;
19
23
  allCheckedRef: import("vue").ComputedRef<boolean>;
20
24
  srcPatternRef: import("vue").Ref<string>;
25
+ tgtPatternRef: import("vue").Ref<string>;
26
+ mergedSrcFilterableRef: import("vue").ComputedRef<Boolean>;
21
27
  handleSrcFilterUpdateValue: (value: string | null) => void;
28
+ handleTgtFilterUpdateValue: (value: string | null) => void;
22
29
  };
23
30
  export {};
@@ -15,14 +15,31 @@ function useTransferData(props) {
15
15
  const targetValueSetRef = (0, vue_1.computed)(() => new Set(mergedValueRef.value || []));
16
16
  const targetOptionsRef = (0, vue_1.computed)(() => {
17
17
  const optionMap = optionsMapRef.value;
18
- return (mergedValueRef.value || []).map((v) => optionMap.get(v));
18
+ const targetOptions = [];
19
+ (mergedValueRef.value || []).forEach((v) => {
20
+ const option = optionMap.get(v);
21
+ if (option) {
22
+ targetOptions.push(option);
23
+ }
24
+ });
25
+ return targetOptions;
19
26
  });
20
27
  const srcPatternRef = (0, vue_1.ref)('');
28
+ const tgtPatternRef = (0, vue_1.ref)('');
29
+ const mergedSrcFilterableRef = (0, vue_1.computed)(() => {
30
+ return props.sourceFilterable || !!props.filterable;
31
+ });
21
32
  const filteredSrcOptionsRef = (0, vue_1.computed)(() => {
22
- if (!props.filterable)
33
+ if (!mergedSrcFilterableRef.value)
23
34
  return props.options;
24
35
  const { filter } = props;
25
- return props.options.filter((opt) => filter(srcPatternRef.value, opt));
36
+ return props.options.filter((opt) => filter(srcPatternRef.value, opt, 'source'));
37
+ });
38
+ const filteredTgtOptionsRef = (0, vue_1.computed)(() => {
39
+ if (!props.targetFilterable)
40
+ return targetOptionsRef.value;
41
+ const { filter } = props;
42
+ return targetOptionsRef.value.filter((opt) => filter(tgtPatternRef.value, opt, 'target'));
26
43
  });
27
44
  const mergedValueSetRef = (0, vue_1.computed)(() => {
28
45
  const { value } = mergedValueRef;
@@ -30,15 +47,33 @@ function useTransferData(props) {
30
47
  return new Set();
31
48
  return new Set(value);
32
49
  });
33
- const valueSetForSelectAllRef = (0, vue_1.computed)(() => {
34
- const mergedValueSet = mergedValueSetRef.value;
35
- return new Set(filteredSrcOptionsRef.value
36
- .filter((option) => !option.disabled || mergedValueSet.has(option.value))
37
- .map((option) => option.value));
50
+ const valueSetForCheckAllRef = (0, vue_1.computed)(() => {
51
+ const values = new Set(mergedValueSetRef.value);
52
+ filteredSrcOptionsRef.value.forEach((option) => {
53
+ if (!option.disabled && !values.has(option.value)) {
54
+ values.add(option.value);
55
+ }
56
+ });
57
+ return values;
58
+ });
59
+ const valueSetForUncheckAllRef = (0, vue_1.computed)(() => {
60
+ const values = new Set(mergedValueSetRef.value);
61
+ filteredSrcOptionsRef.value.forEach((option) => {
62
+ if (!option.disabled && values.has(option.value)) {
63
+ values.delete(option.value);
64
+ }
65
+ });
66
+ return values;
67
+ });
68
+ const valueSetForClearRef = (0, vue_1.computed)(() => {
69
+ const values = new Set(mergedValueSetRef.value);
70
+ filteredTgtOptionsRef.value.forEach((option) => {
71
+ if (!option.disabled) {
72
+ values.delete(option.value);
73
+ }
74
+ });
75
+ return values;
38
76
  });
39
- const valueSetForUnselectAllRef = (0, vue_1.computed)(() => new Set(targetOptionsRef.value
40
- .filter((option) => option.disabled)
41
- .map((option) => option.value)));
42
77
  const canNotSelectAnythingRef = (0, vue_1.computed)(() => {
43
78
  return filteredSrcOptionsRef.value.every((option) => option.disabled);
44
79
  });
@@ -50,24 +85,32 @@ function useTransferData(props) {
50
85
  return filteredSrcOptionsRef.value.every((option) => option.disabled || mergedValueSet.has(option.value));
51
86
  });
52
87
  const canBeClearedRef = (0, vue_1.computed)(() => {
53
- return targetOptionsRef.value.some((option) => !option.disabled);
88
+ return filteredTgtOptionsRef.value.some((option) => !option.disabled);
54
89
  });
55
90
  function handleSrcFilterUpdateValue(value) {
56
91
  srcPatternRef.value = value !== null && value !== void 0 ? value : '';
57
92
  }
93
+ function handleTgtFilterUpdateValue(value) {
94
+ tgtPatternRef.value = value !== null && value !== void 0 ? value : '';
95
+ }
58
96
  return {
59
97
  uncontrolledValueRef,
60
98
  mergedValueRef,
61
99
  targetValueSetRef,
62
- valueSetForSelectAllRef,
63
- valueSetForUnselectAllRef,
64
- targetOptionsRef,
100
+ valueSetForCheckAllRef,
101
+ valueSetForUncheckAllRef,
102
+ valueSetForClearRef,
103
+ filteredTgtOptionsRef,
65
104
  filteredSrcOptionsRef,
105
+ targetOptionsRef,
66
106
  canNotSelectAnythingRef,
67
107
  canBeClearedRef,
68
108
  allCheckedRef,
69
109
  srcPatternRef,
70
- handleSrcFilterUpdateValue
110
+ tgtPatternRef,
111
+ mergedSrcFilterableRef,
112
+ handleSrcFilterUpdateValue,
113
+ handleTgtFilterUpdateValue
71
114
  };
72
115
  }
73
116
  exports.useTransferData = useTransferData;
@@ -108,6 +108,7 @@ declare const transferLight: import("../../_mixins").Theme<"Transfer", {
108
108
  colorHover: string;
109
109
  }, any>;
110
110
  Input: import("../../_mixins").Theme<"Input", {
111
+ countTextColorDisabled: string;
111
112
  countTextColor: string;
112
113
  heightTiny: string;
113
114
  heightSmall: string;
@@ -1,3 +1,3 @@
1
1
  export { default as NTree, treeProps } from './src/Tree';
2
2
  export type { TreeProps } from './src/Tree';
3
- export type { TreeOption, TreeDragInfo, TreeDropInfo } from './src/interface';
3
+ export type { TreeOption, TreeDragInfo, TreeDropInfo, TreeInst } from './src/interface';
@@ -3,7 +3,7 @@ import { TreeMateOptions, CheckStrategy } from 'treemate';
3
3
  import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
4
4
  import type { TreeDragInfo, TreeDropInfo, TreeOptions, Key, TreeOption, AllowDrop, RenderSwitcherIcon, TreeNodeProps, CheckOnClick } from './interface';
5
5
  import { defaultAllowDrop } from './dnd';
6
- export declare function createTreeMateOptions<T>(keyField: string, childrenField: string): TreeMateOptions<T, T, T>;
6
+ export declare function createTreeMateOptions<T>(keyField: string, childrenField: string, disabledField: string): TreeMateOptions<T, T, T>;
7
7
  export declare type OnUpdateKeys = (value: Array<string & number>, option: Array<TreeOption | null>) => void;
8
8
  export declare type OnUpdateKeysImpl = (value: Key[], option: Array<TreeOption | null>) => void;
9
9
  declare type OnLoad = (node: TreeOption) => Promise<void>;
@@ -24,6 +24,10 @@ export declare const treeSharedProps: {
24
24
  readonly type: StringConstructor;
25
25
  readonly default: "children";
26
26
  };
27
+ readonly disabledField: {
28
+ readonly type: StringConstructor;
29
+ readonly default: "disabled";
30
+ };
27
31
  readonly defaultExpandedKeys: {
28
32
  readonly type: PropType<Key[]>;
29
33
  readonly default: () => never[];
@@ -74,6 +78,10 @@ export declare const treeProps: {
74
78
  readonly type: StringConstructor;
75
79
  readonly default: "children";
76
80
  };
81
+ readonly disabledField: {
82
+ readonly type: StringConstructor;
83
+ readonly default: "disabled";
84
+ };
77
85
  readonly defaultExpandedKeys: {
78
86
  readonly type: PropType<Key[]>;
79
87
  readonly default: () => never[];
@@ -154,6 +162,10 @@ export declare const treeProps: {
154
162
  readonly renderPrefix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
155
163
  readonly renderSuffix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
156
164
  readonly nodeProps: PropType<TreeNodeProps>;
165
+ readonly keyboard: {
166
+ readonly type: BooleanConstructor;
167
+ readonly default: true;
168
+ };
157
169
  readonly onDragenter: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
158
170
  readonly onDragleave: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
159
171
  readonly onDragend: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
@@ -382,6 +394,10 @@ declare const _default: import("vue").DefineComponent<{
382
394
  readonly type: StringConstructor;
383
395
  readonly default: "children";
384
396
  };
397
+ readonly disabledField: {
398
+ readonly type: StringConstructor;
399
+ readonly default: "disabled";
400
+ };
385
401
  readonly defaultExpandedKeys: {
386
402
  readonly type: PropType<Key[]>;
387
403
  readonly default: () => never[];
@@ -462,6 +478,10 @@ declare const _default: import("vue").DefineComponent<{
462
478
  readonly renderPrefix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
463
479
  readonly renderSuffix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
464
480
  readonly nodeProps: PropType<TreeNodeProps>;
481
+ readonly keyboard: {
482
+ readonly type: BooleanConstructor;
483
+ readonly default: true;
484
+ };
465
485
  readonly onDragenter: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
466
486
  readonly onDragleave: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
467
487
  readonly onDragend: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
@@ -1109,6 +1129,9 @@ declare const _default: import("vue").DefineComponent<{
1109
1129
  handleAfterEnter: () => void;
1110
1130
  handleResize: () => void;
1111
1131
  handleKeydown: (e: KeyboardEvent) => void;
1132
+ scrollTo: (options: {
1133
+ key: Key;
1134
+ }) => void;
1112
1135
  cssVars: import("vue").ComputedRef<{
1113
1136
  '--n-arrow-color': string;
1114
1137
  '--n-loading-color': string;
@@ -1163,6 +1186,10 @@ declare const _default: import("vue").DefineComponent<{
1163
1186
  readonly type: StringConstructor;
1164
1187
  readonly default: "children";
1165
1188
  };
1189
+ readonly disabledField: {
1190
+ readonly type: StringConstructor;
1191
+ readonly default: "disabled";
1192
+ };
1166
1193
  readonly defaultExpandedKeys: {
1167
1194
  readonly type: PropType<Key[]>;
1168
1195
  readonly default: () => never[];
@@ -1243,6 +1270,10 @@ declare const _default: import("vue").DefineComponent<{
1243
1270
  readonly renderPrefix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
1244
1271
  readonly renderSuffix: PropType<({ option, checked, selected }: import("./interface").TreeRenderProps) => VNodeChild>;
1245
1272
  readonly nodeProps: PropType<TreeNodeProps>;
1273
+ readonly keyboard: {
1274
+ readonly type: BooleanConstructor;
1275
+ readonly default: true;
1276
+ };
1246
1277
  readonly onDragenter: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
1247
1278
  readonly onDragleave: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
1248
1279
  readonly onDragend: PropType<MaybeArray<(e: TreeDragInfo) => void>>;
@@ -1447,8 +1478,10 @@ declare const _default: import("vue").DefineComponent<{
1447
1478
  readonly allowCheckingNotLoaded: boolean;
1448
1479
  readonly cascade: boolean;
1449
1480
  readonly indent: number;
1481
+ readonly keyboard: boolean;
1450
1482
  readonly internalScrollable: boolean;
1451
1483
  readonly checkStrategy: CheckStrategy;
1484
+ readonly disabledField: string;
1452
1485
  readonly leafOnly: boolean;
1453
1486
  readonly accordion: boolean;
1454
1487
  readonly defaultExpandedKeys: Key[];
@@ -36,8 +36,11 @@ const empty_1 = require("../../empty");
36
36
  // During expanding, some node are mis-applied with :active style
37
37
  // Async dnd has bug
38
38
  const ITEM_SIZE = 30; // 24 + 3 + 3
39
- function createTreeMateOptions(keyField, childrenField) {
39
+ function createTreeMateOptions(keyField, childrenField, disabledField) {
40
40
  return {
41
+ getIsGroup() {
42
+ return false;
43
+ },
41
44
  getKey(node) {
42
45
  return node[keyField];
43
46
  },
@@ -45,7 +48,7 @@ function createTreeMateOptions(keyField, childrenField) {
45
48
  return node[childrenField];
46
49
  },
47
50
  getDisabled(node) {
48
- return !!(node.disabled || node.checkboxDisabled);
51
+ return !!(node[disabledField] || node.checkboxDisabled);
49
52
  }
50
53
  };
51
54
  }
@@ -67,6 +70,10 @@ exports.treeSharedProps = {
67
70
  type: String,
68
71
  default: 'children'
69
72
  },
73
+ disabledField: {
74
+ type: String,
75
+ default: 'disabled'
76
+ },
70
77
  defaultExpandedKeys: {
71
78
  type: Array,
72
79
  default: () => []
@@ -114,7 +121,10 @@ exports.treeProps = Object.assign(Object.assign(Object.assign(Object.assign({},
114
121
  }, checkboxPlacement: {
115
122
  type: String,
116
123
  default: 'left'
117
- }, virtualScroll: Boolean, watchProps: Array, renderLabel: Function, renderPrefix: Function, renderSuffix: Function, nodeProps: Function, onDragenter: [Function, Array], onDragleave: [Function, Array], onDragend: [Function, Array], onDragstart: [Function, Array], onDragover: [Function, Array], onDrop: [Function, Array], onUpdateCheckedKeys: [Function, Array], 'onUpdate:checkedKeys': [Function, Array], onUpdateSelectedKeys: [Function, Array], 'onUpdate:selectedKeys': [Function, Array] }), exports.treeSharedProps), {
124
+ }, virtualScroll: Boolean, watchProps: Array, renderLabel: Function, renderPrefix: Function, renderSuffix: Function, nodeProps: Function, keyboard: {
125
+ type: Boolean,
126
+ default: true
127
+ }, onDragenter: [Function, Array], onDragleave: [Function, Array], onDragend: [Function, Array], onDragstart: [Function, Array], onDragover: [Function, Array], onDrop: [Function, Array], onUpdateCheckedKeys: [Function, Array], 'onUpdate:checkedKeys': [Function, Array], onUpdateSelectedKeys: [Function, Array], 'onUpdate:selectedKeys': [Function, Array] }), exports.treeSharedProps), {
118
128
  // internal props for tree-select
119
129
  internalTreeSelect: Boolean, internalScrollable: Boolean, internalScrollablePadding: String,
120
130
  // use it to display
@@ -179,7 +189,7 @@ exports.default = (0, vue_1.defineComponent)({
179
189
  // We don't expect data source to change so we just determine it once
180
190
  const displayTreeMateRef = (0, vue_1.computed)(() => (0, treemate_1.createTreeMate)(props.showIrrelevantNodes
181
191
  ? props.data
182
- : filteredTreeInfoRef.value.filteredTree, createTreeMateOptions(props.keyField, props.childrenField)));
192
+ : filteredTreeInfoRef.value.filteredTree, createTreeMateOptions(props.keyField, props.childrenField, props.disabledField)));
183
193
  const treeSelectInjection = (0, vue_1.inject)(interface_1.treeSelectInjectionKey, null);
184
194
  const dataTreeMateRef = props.internalTreeSelect
185
195
  ? treeSelectInjection.dataTreeMate
@@ -244,6 +254,7 @@ exports.default = (0, vue_1.defineComponent)({
244
254
  const mergedExpandedKeysRef = (0, vooks_1.useMergedState)(controlledExpandedKeysRef, uncontrolledExpandedKeysRef);
245
255
  const fNodesRef = (0, vue_1.computed)(() => displayTreeMateRef.value.getFlattenedNodes(mergedExpandedKeysRef.value));
246
256
  const { pendingNodeKeyRef, handleKeydown } = (0, keyboard_1.useKeyboard)({
257
+ props,
247
258
  mergedSelectedKeysRef,
248
259
  fNodesRef,
249
260
  mergedExpandedKeysRef,
@@ -1079,8 +1090,13 @@ exports.default = (0, vue_1.defineComponent)({
1079
1090
  handleSelect,
1080
1091
  handleCheck
1081
1092
  });
1093
+ function scrollTo(options) {
1094
+ var _a;
1095
+ (_a = virtualListInstRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(options);
1096
+ }
1082
1097
  const exposedMethods = {
1083
- handleKeydown
1098
+ handleKeydown,
1099
+ scrollTo
1084
1100
  };
1085
1101
  const cssVarsRef = (0, vue_1.computed)(() => {
1086
1102
  const { common: { cubicBezierEaseInOut }, self: { fontSize, nodeBorderRadius, nodeColorHover, nodeColorPressed, nodeColorActive, arrowColor, loadingColor, nodeTextColor, nodeTextColorDisabled, dropMarkColor } } = themeRef.value;
@@ -1118,6 +1134,7 @@ exports.default = (0, vue_1.defineComponent)({
1118
1134
  handleAfterEnter,
1119
1135
  handleResize,
1120
1136
  handleKeydown: exposedMethods.handleKeydown,
1137
+ scrollTo: exposedMethods.scrollTo,
1121
1138
  cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
1122
1139
  themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
1123
1140
  onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
@@ -1171,12 +1188,9 @@ exports.default = (0, vue_1.defineComponent)({
1171
1188
  }
1172
1189
  else {
1173
1190
  return ((0, vue_1.h)("div", { class: treeClass, tabindex: tabindex, ref: "selfElRef", style: this.cssVars, onKeydown: mergedFocusable ? handleKeydown : undefined, onFocusout: mergedFocusable ? handleFocusout : undefined, onDragleave: draggable ? this.handleDragLeaveTree : undefined }, !fNodes.length
1174
- ? (0, _utils_1.resolveSlot)(this.$slots.empty, () => {
1175
- var _a, _b, _c, _d;
1176
- return [
1177
- (0, vue_1.h)(empty_1.NEmpty, { class: `${mergedClsPrefix}-tree__empty`, theme: (_b = (_a = this.theme) === null || _a === void 0 ? void 0 : _a.peers) === null || _b === void 0 ? void 0 : _b.Empty, themeOverrides: (_d = (_c = this.themeOverrides) === null || _c === void 0 ? void 0 : _c.peers) === null || _d === void 0 ? void 0 : _d.Empty })
1178
- ];
1179
- })
1191
+ ? (0, _utils_1.resolveSlot)(this.$slots.empty, () => [
1192
+ (0, vue_1.h)(empty_1.NEmpty, { class: `${mergedClsPrefix}-tree__empty`, theme: this.mergedTheme.peers.Empty, themeOverrides: this.mergedTheme.peerOverrides.Empty })
1193
+ ])
1180
1194
  : fNodes.map(createNode)));
1181
1195
  }
1182
1196
  }
@@ -114,4 +114,9 @@ export interface MotionData {
114
114
  export interface InternalTreeInst {
115
115
  handleKeydown: (e: KeyboardEvent) => void;
116
116
  }
117
+ export interface TreeInst {
118
+ scrollTo: (options: {
119
+ key: Key;
120
+ }) => void;
121
+ }
117
122
  export {};
@@ -1,7 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  import { TreeNode } from 'treemate';
3
3
  import { Key, TmNode, TreeOption } from './interface';
4
- export declare function useKeyboard({ fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }: {
4
+ export declare function useKeyboard({ props, fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }: {
5
+ props: {
6
+ keyboard: boolean;
7
+ };
5
8
  fNodesRef: Ref<Array<TreeNode<TreeOption>>>;
6
9
  mergedExpandedKeysRef: Ref<Key[]>;
7
10
  mergedSelectedKeysRef: Ref<Key[]>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useKeyboard = void 0;
4
4
  const vue_1 = require("vue");
5
5
  const interface_1 = require("../../tree-select/src/interface");
6
- function useKeyboard({ fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }) {
6
+ function useKeyboard({ props, fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef, handleSelect, handleSwitcherClick }) {
7
7
  const { value: mergedSelectedKeys } = mergedSelectedKeysRef;
8
8
  // If it's used in tree-select, make it take over pending state
9
9
  const treeSelectInjection = (0, vue_1.inject)(interface_1.treeSelectInjectionKey, null);
@@ -13,6 +13,8 @@ function useKeyboard({ fNodesRef, mergedExpandedKeysRef, mergedSelectedKeysRef,
13
13
  ? mergedSelectedKeys[mergedSelectedKeys.length - 1]
14
14
  : null);
15
15
  function handleKeydown(e) {
16
+ if (!props.keyboard)
17
+ return;
16
18
  const { value: pendingNodeKey } = pendingNodeKeyRef;
17
19
  if (pendingNodeKey === null) {
18
20
  if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
@@ -39,6 +39,10 @@ export declare const treeSelectProps: {
39
39
  readonly type: StringConstructor;
40
40
  readonly default: "children";
41
41
  };
42
+ readonly disabledField: {
43
+ readonly type: StringConstructor;
44
+ readonly default: "disabled";
45
+ };
42
46
  readonly defaultExpandedKeys: {
43
47
  readonly type: PropType<Key[]>;
44
48
  readonly default: () => never[];
@@ -602,6 +606,10 @@ declare const _default: import("vue").DefineComponent<{
602
606
  readonly type: StringConstructor;
603
607
  readonly default: "children";
604
608
  };
609
+ readonly disabledField: {
610
+ readonly type: StringConstructor;
611
+ readonly default: "disabled";
612
+ };
605
613
  readonly defaultExpandedKeys: {
606
614
  readonly type: PropType<Key[]>;
607
615
  readonly default: () => never[];
@@ -1567,6 +1575,10 @@ declare const _default: import("vue").DefineComponent<{
1567
1575
  readonly type: StringConstructor;
1568
1576
  readonly default: "children";
1569
1577
  };
1578
+ readonly disabledField: {
1579
+ readonly type: StringConstructor;
1580
+ readonly default: "disabled";
1581
+ };
1570
1582
  readonly defaultExpandedKeys: {
1571
1583
  readonly type: PropType<Key[]>;
1572
1584
  readonly default: () => never[];
@@ -2121,6 +2133,7 @@ declare const _default: import("vue").DefineComponent<{
2121
2133
  readonly allowCheckingNotLoaded: boolean;
2122
2134
  readonly cascade: boolean;
2123
2135
  readonly checkStrategy: CheckStrategy;
2136
+ readonly disabledField: string;
2124
2137
  readonly leafOnly: boolean;
2125
2138
  readonly showPath: boolean;
2126
2139
  readonly defaultExpandedKeys: Key[];
@@ -97,7 +97,7 @@ exports.default = (0, vue_1.defineComponent)({
97
97
  };
98
98
  });
99
99
  // used to resolve selected options
100
- const dataTreeMateRef = (0, vue_1.computed)(() => (0, treemate_1.createTreeMate)(props.options, (0, Tree_1.createTreeMateOptions)(props.keyField, props.childrenField)));
100
+ const dataTreeMateRef = (0, vue_1.computed)(() => (0, treemate_1.createTreeMate)(props.options, (0, Tree_1.createTreeMateOptions)(props.keyField, props.childrenField, props.disabledField)));
101
101
  const { value: initMergedValue } = mergedValueRef;
102
102
  const pendingNodeKeyRef = (0, vue_1.ref)(props.checkable
103
103
  ? null
@@ -264,7 +264,7 @@ exports.default = (0, vue_1.defineComponent)({
264
264
  function handleMenuClickoutside(e) {
265
265
  var _a;
266
266
  if (mergedShowRef.value) {
267
- if (!((_a = triggerInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains(e.target))) {
267
+ if (!((_a = triggerInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains((0, seemly_1.getPreciseEventTarget)(e)))) {
268
268
  // outside select, don't need to return focus
269
269
  closeMenu();
270
270
  }
@@ -556,7 +556,7 @@ exports.default = (0, vue_1.defineComponent)({
556
556
  (menuProps === null || menuProps === void 0 ? void 0 : menuProps.style) || '',
557
557
  this.cssVars
558
558
  ], tabindex: 0, onMousedown: this.handleMenuMousedown, onKeydown: this.handleKeydown, onFocusin: this.handleMenuFocusin, onFocusout: this.handleMenuFocusout }),
559
- (0, vue_1.h)(tree_1.NTree, { ref: "treeInstRef", blockLine: true, allowCheckingNotLoaded: this.allowCheckingNotLoaded, showIrrelevantNodes: false, animated: false, pattern: this.pattern, filter: this.mergedFilter, data: options, cancelable: multiple, labelField: this.labelField, keyField: this.keyField, childrenField: this.childrenField, theme: mergedTheme.peers.Tree, themeOverrides: mergedTheme.peerOverrides.Tree, defaultExpandAll: this.defaultExpandAll, defaultExpandedKeys: this.defaultExpandedKeys, expandedKeys: this.mergedExpandedKeys, checkedKeys: this.treeCheckedKeys, selectedKeys: this.treeSelectedKeys, checkable: checkable, checkStrategy: this.checkStrategy, cascade: this.mergedCascade, leafOnly: this.leafOnly, multiple: this.multiple, renderLabel: this.renderLabel, renderPrefix: this.renderPrefix, renderSuffix: this.renderSuffix, renderSwitcherIcon: this.renderSwitcherIcon, nodeProps: this.nodeProps, virtualScroll: this.consistentMenuWidth && this.virtualScroll, internalTreeSelect: true, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, internalRenderEmpty: () => ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` }, (0, _utils_1.resolveSlot)($slots.empty, () => [
559
+ (0, vue_1.h)(tree_1.NTree, { ref: "treeInstRef", blockLine: true, allowCheckingNotLoaded: this.allowCheckingNotLoaded, showIrrelevantNodes: false, animated: false, pattern: this.pattern, filter: this.mergedFilter, data: options, cancelable: multiple, labelField: this.labelField, keyField: this.keyField, disabledField: this.disabledField, childrenField: this.childrenField, theme: mergedTheme.peers.Tree, themeOverrides: mergedTheme.peerOverrides.Tree, defaultExpandAll: this.defaultExpandAll, defaultExpandedKeys: this.defaultExpandedKeys, expandedKeys: this.mergedExpandedKeys, checkedKeys: this.treeCheckedKeys, selectedKeys: this.treeSelectedKeys, checkable: checkable, checkStrategy: this.checkStrategy, cascade: this.mergedCascade, leafOnly: this.leafOnly, multiple: this.multiple, renderLabel: this.renderLabel, renderPrefix: this.renderPrefix, renderSuffix: this.renderSuffix, renderSwitcherIcon: this.renderSwitcherIcon, nodeProps: this.nodeProps, virtualScroll: this.consistentMenuWidth && this.virtualScroll, internalTreeSelect: true, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, internalRenderEmpty: () => ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` }, (0, _utils_1.resolveSlot)($slots.empty, () => [
560
560
  (0, vue_1.h)(empty_1.NEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty })
561
561
  ]))), onLoad: this.onLoad, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys }),
562
562
  (0, _utils_1.resolveWrappedSlot)($slots.action, (children) => {
@@ -8,7 +8,7 @@ const _common_1 = __importDefault(require("./_common"));
8
8
  const common_1 = require("../../_styles/common");
9
9
  const self = (vars) => {
10
10
  const { primaryColor, textColor2, borderColor, lineHeight, fontSize, borderRadiusSmall, dividerColor, fontWeightStrong, textColor1, textColor3, infoColor, warningColor, errorColor, successColor, codeColor } = vars;
11
- return Object.assign(Object.assign({}, _common_1.default), { aTextColor: primaryColor, blockquoteTextColor: textColor2, blockquotePrefixColor: borderColor, blockquoteLineHeight: lineHeight, blockquoteFontSize: fontSize, codeBorderRadius: borderRadiusSmall, liTextColor: textColor2, liLineHeight: lineHeight, liFontSize: fontSize, hrColor: dividerColor, headerFontWeight: fontWeightStrong, headerTextColor: textColor1, pTextColor: textColor2, pTextColor1Depth: textColor1, pTextColor2Depth: textColor2, pTextColor3Depth: textColor3, pLineHeight: lineHeight, pFontSize: fontSize, headerBarColor: primaryColor, headerBarColorPrimary: primaryColor, headerBarColorInfo: infoColor, headerBarColorError: errorColor, headerBarColorWarning: warningColor, headerBarColorSuccess: successColor, textColor: textColor2, textColor1Depth: textColor1, textColor2Depth: textColor2, textColor3Depth: textColor3, textColorPrimary: primaryColor, textColorInfo: infoColor, textColorSuccess: successColor, textColorWarning: warningColor, textColorError: errorColor, codeTextColor: textColor2, codeColor: codeColor, codeBorder: '1px solid #0000' });
11
+ return Object.assign(Object.assign({}, _common_1.default), { aTextColor: primaryColor, blockquoteTextColor: textColor2, blockquotePrefixColor: borderColor, blockquoteLineHeight: lineHeight, blockquoteFontSize: fontSize, codeBorderRadius: borderRadiusSmall, liTextColor: textColor2, liLineHeight: lineHeight, liFontSize: fontSize, hrColor: dividerColor, headerFontWeight: fontWeightStrong, headerTextColor: textColor1, pTextColor: textColor2, pTextColor1Depth: textColor1, pTextColor2Depth: textColor2, pTextColor3Depth: textColor3, pLineHeight: lineHeight, pFontSize: fontSize, headerBarColor: primaryColor, headerBarColorPrimary: primaryColor, headerBarColorInfo: infoColor, headerBarColorError: errorColor, headerBarColorWarning: warningColor, headerBarColorSuccess: successColor, textColor: textColor2, textColor1Depth: textColor1, textColor2Depth: textColor2, textColor3Depth: textColor3, textColorPrimary: primaryColor, textColorInfo: infoColor, textColorSuccess: successColor, textColorWarning: warningColor, textColorError: errorColor, codeTextColor: textColor2, codeColor, codeBorder: '1px solid #0000' });
12
12
  };
13
13
  exports.self = self;
14
14
  const typographyLight = {
@@ -258,6 +258,7 @@ export declare const uploadProps: {
258
258
  borderDisabledWarning: string;
259
259
  rippleColorWarning: string;
260
260
  colorError: string;
261
+ /** currently not used */
261
262
  colorHoverError: string;
262
263
  colorPressedError: string;
263
264
  colorFocusError: string;
@@ -503,6 +504,7 @@ export declare const uploadProps: {
503
504
  borderDisabledWarning: string;
504
505
  rippleColorWarning: string;
505
506
  colorError: string;
507
+ /** currently not used */
506
508
  colorHoverError: string;
507
509
  colorPressedError: string;
508
510
  colorFocusError: string;
@@ -748,6 +750,7 @@ export declare const uploadProps: {
748
750
  borderDisabledWarning: string;
749
751
  rippleColorWarning: string;
750
752
  colorError: string;
753
+ /** currently not used */
751
754
  colorHoverError: string;
752
755
  colorPressedError: string;
753
756
  colorFocusError: string;
@@ -1076,6 +1079,7 @@ declare const _default: import("vue").DefineComponent<{
1076
1079
  borderDisabledWarning: string;
1077
1080
  rippleColorWarning: string;
1078
1081
  colorError: string;
1082
+ /** currently not used */
1079
1083
  colorHoverError: string;
1080
1084
  colorPressedError: string;
1081
1085
  colorFocusError: string;
@@ -1321,6 +1325,7 @@ declare const _default: import("vue").DefineComponent<{
1321
1325
  borderDisabledWarning: string;
1322
1326
  rippleColorWarning: string;
1323
1327
  colorError: string;
1328
+ /** currently not used */
1324
1329
  colorHoverError: string;
1325
1330
  colorPressedError: string;
1326
1331
  colorFocusError: string;
@@ -1566,6 +1571,7 @@ declare const _default: import("vue").DefineComponent<{
1566
1571
  borderDisabledWarning: string;
1567
1572
  rippleColorWarning: string;
1568
1573
  colorError: string;
1574
+ /** currently not used */
1569
1575
  colorHoverError: string;
1570
1576
  colorPressedError: string;
1571
1577
  colorFocusError: string;
@@ -1927,6 +1933,7 @@ declare const _default: import("vue").DefineComponent<{
1927
1933
  borderDisabledWarning: string;
1928
1934
  rippleColorWarning: string;
1929
1935
  colorError: string;
1936
+ /** currently not used */
1930
1937
  colorHoverError: string;
1931
1938
  colorPressedError: string;
1932
1939
  colorFocusError: string;
@@ -2272,6 +2279,7 @@ declare const _default: import("vue").DefineComponent<{
2272
2279
  borderDisabledWarning: string;
2273
2280
  rippleColorWarning: string;
2274
2281
  colorError: string;
2282
+ /** currently not used */
2275
2283
  colorHoverError: string;
2276
2284
  colorPressedError: string;
2277
2285
  colorFocusError: string;
@@ -2517,6 +2525,7 @@ declare const _default: import("vue").DefineComponent<{
2517
2525
  borderDisabledWarning: string;
2518
2526
  rippleColorWarning: string;
2519
2527
  colorError: string;
2528
+ /** currently not used */
2520
2529
  colorHoverError: string;
2521
2530
  colorPressedError: string;
2522
2531
  colorFocusError: string;
@@ -2762,6 +2771,7 @@ declare const _default: import("vue").DefineComponent<{
2762
2771
  borderDisabledWarning: string;
2763
2772
  rippleColorWarning: string;
2764
2773
  colorError: string;
2774
+ /** currently not used */
2765
2775
  colorHoverError: string;
2766
2776
  colorPressedError: string;
2767
2777
  colorFocusError: string;
@@ -299,7 +299,7 @@ exports.default = (0, vue_1.defineComponent)({
299
299
  name: file.name,
300
300
  status: 'pending',
301
301
  percentage: 0,
302
- file: file,
302
+ file,
303
303
  url: null,
304
304
  type: file.type,
305
305
  thumbnailUrl: null,
@@ -144,7 +144,9 @@ exports.default = (0, vue_1.defineComponent)({
144
144
  function handleDownload(file) {
145
145
  const { onDownloadRef: { value: onDownload } } = NUpload;
146
146
  void Promise.resolve(onDownload ? onDownload(Object.assign({}, file)) : true).then((res) => {
147
- /** I haven't figure out its usage, so just leave it here */
147
+ if (res !== false) {
148
+ (0, utils_1.download)(file.url, file.name);
149
+ }
148
150
  });
149
151
  }
150
152
  function handleAbort(file) {
@@ -16,3 +16,4 @@ export declare function createSettledFileInfo(fileInfo: FileInfo): SettledFileIn
16
16
  * version, so I can't simply use it.
17
17
  */
18
18
  export declare function matchType(name: string, mimeType: string, accept: string): boolean;
19
+ export declare const download: (url: string | null, name: string | undefined) => void;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.matchType = exports.createSettledFileInfo = exports.getFilesFromEntries = exports.isFileSystemFileEntry = exports.isFileSystemDirectoryEntry = exports.environmentSupportFile = exports.createImageDataUrl = exports.isImageFile = exports.isImageFileType = void 0;
12
+ exports.download = exports.matchType = exports.createSettledFileInfo = exports.getFilesFromEntries = exports.isFileSystemFileEntry = exports.isFileSystemDirectoryEntry = exports.environmentSupportFile = exports.createImageDataUrl = exports.isImageFile = exports.isImageFileType = void 0;
13
13
  const _utils_1 = require("../../_utils");
14
14
  const isImageFileType = (type) => type.includes('image/');
15
15
  exports.isImageFileType = isImageFileType;
@@ -162,3 +162,16 @@ function matchType(name, mimeType, accept) {
162
162
  });
163
163
  }
164
164
  exports.matchType = matchType;
165
+ const download = (url, name) => {
166
+ if (!url)
167
+ return;
168
+ const a = document.createElement('a');
169
+ a.href = url;
170
+ if (name !== undefined) {
171
+ a.download = name;
172
+ }
173
+ document.body.appendChild(a);
174
+ a.click();
175
+ document.body.removeChild(a);
176
+ };
177
+ exports.download = download;