naive-ui 2.33.4 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (492) hide show
  1. package/dist/index.js +3517 -6061
  2. package/dist/index.prod.js +2 -2
  3. package/es/_internal/clear/src/styles/index.cssr.js +2 -2
  4. package/es/_internal/close/src/styles/index.cssr.js +2 -2
  5. package/es/_internal/index.d.ts +1 -0
  6. package/es/_internal/loading/index.d.ts +1 -0
  7. package/es/_internal/loading/src/Loading.d.ts +26 -14
  8. package/es/_internal/loading/src/Loading.js +17 -20
  9. package/es/_internal/scrollbar/src/styles/index.cssr.js +2 -2
  10. package/es/_internal/select-menu/src/styles/index.cssr.js +2 -2
  11. package/es/_internal/selection/src/Selection.js +5 -5
  12. package/es/_internal/selection/src/styles/index.cssr.js +2 -2
  13. package/es/_internal/slot-machine/src/styles/index.cssr.js +4 -3
  14. package/es/_styles/global/index.cssr.js +2 -2
  15. package/es/alert/src/styles/index.cssr.js +2 -2
  16. package/es/anchor/src/styles/index.cssr.js +2 -2
  17. package/es/auto-complete/src/styles/index.cssr.js +2 -2
  18. package/es/avatar/src/Avatar.d.ts +4 -1
  19. package/es/avatar/src/Avatar.js +12 -13
  20. package/es/avatar/src/styles/index.cssr.js +2 -2
  21. package/es/avatar-group/index.d.ts +1 -1
  22. package/es/avatar-group/src/AvatarGroup.d.ts +7 -7
  23. package/es/avatar-group/src/styles/avatar-group-rtl.cssr.js +2 -2
  24. package/es/avatar-group/src/styles/avatar-group.cssr.js +2 -2
  25. package/es/back-top/src/styles/index.cssr.js +2 -2
  26. package/es/badge/src/styles/index.cssr.js +2 -2
  27. package/es/breadcrumb/src/styles/index.cssr.js +2 -2
  28. package/es/button/src/Button.d.ts +4 -1
  29. package/es/button/src/Button.js +3 -3
  30. package/es/button/src/styles/index.cssr.js +2 -2
  31. package/es/button-group/src/styles/index.cssr.js +0 -3
  32. package/es/button-group/src/styles/rtl.cssr.js +0 -2
  33. package/es/calendar/src/styles/index.cssr.js +2 -2
  34. package/es/card/src/styles/index.cssr.js +4 -3
  35. package/es/carousel/src/styles/index.cssr.js +2 -2
  36. package/es/cascader/src/Cascader.d.ts +8 -0
  37. package/es/cascader/src/Cascader.js +41 -2
  38. package/es/cascader/src/CascaderOption.d.ts +1 -1
  39. package/es/cascader/src/CascaderOption.js +1 -7
  40. package/es/cascader/src/CascaderSelectMenu.d.ts +3 -0
  41. package/es/cascader/src/CascaderSelectMenu.js +8 -4
  42. package/es/cascader/src/interface.d.ts +11 -1
  43. package/es/cascader/src/styles/index.cssr.js +2 -2
  44. package/es/checkbox/src/styles/index.cssr.js +8 -5
  45. package/es/code/src/Code.d.ts +1 -1
  46. package/es/code/src/styles/index.cssr.js +2 -2
  47. package/es/collapse/src/styles/index.cssr.js +2 -2
  48. package/es/color-picker/src/ColorPicker.d.ts +5 -5
  49. package/es/color-picker/src/ColorPicker.js +7 -1
  50. package/es/color-picker/src/styles/index.cssr.js +2 -2
  51. package/es/color-picker/src/utils.d.ts +1 -1
  52. package/es/components.d.ts +1 -0
  53. package/es/components.js +1 -0
  54. package/es/config-provider/src/ConfigProvider.d.ts +6 -0
  55. package/es/config-provider/src/ConfigProvider.js +7 -0
  56. package/es/config-provider/src/internal-interface.d.ts +4 -0
  57. package/es/data-table/src/DataTable.d.ts +11 -0
  58. package/es/data-table/src/DataTable.js +7 -3
  59. package/es/data-table/src/TableParts/Body.d.ts +1 -0
  60. package/es/data-table/src/TableParts/Body.js +14 -6
  61. package/es/data-table/src/TableParts/Header.js +7 -5
  62. package/es/data-table/src/interface.d.ts +10 -2
  63. package/es/data-table/src/interface.js +1 -1
  64. package/es/data-table/src/styles/index.cssr.js +21 -9
  65. package/es/date-picker/src/DatePicker.js +5 -0
  66. package/es/date-picker/src/panel/panelHeader.d.ts +6 -6
  67. package/es/date-picker/src/styles/index.cssr.js +2 -2
  68. package/es/descriptions/src/styles/index.cssr.js +2 -2
  69. package/es/dialog/src/DialogEnvironment.d.ts +3 -0
  70. package/es/dialog/src/DialogEnvironment.js +2 -2
  71. package/es/dialog/src/DialogProvider.d.ts +3 -0
  72. package/es/dialog/src/styles/index.cssr.js +2 -2
  73. package/es/divider/src/styles/index.cssr.js +2 -2
  74. package/es/drawer/src/styles/index.cssr.js +2 -2
  75. package/es/dropdown/src/styles/index.cssr.js +2 -2
  76. package/es/dynamic-input/src/styles/index.cssr.js +2 -2
  77. package/es/dynamic-tags/src/styles/index.cssr.js +2 -2
  78. package/es/empty/src/styles/index.cssr.js +2 -2
  79. package/es/equation/index.d.ts +1 -0
  80. package/es/equation/index.js +1 -0
  81. package/es/equation/src/Equation.d.ts +18 -0
  82. package/es/equation/src/Equation.js +29 -0
  83. package/es/equation/styles/dark.d.ts +3 -0
  84. package/es/equation/styles/dark.js +8 -0
  85. package/es/equation/styles/index.d.ts +3 -0
  86. package/es/equation/styles/index.js +2 -0
  87. package/es/equation/styles/light.d.ts +6 -0
  88. package/es/equation/styles/light.js +8 -0
  89. package/es/form/src/FormItem.d.ts +3 -2
  90. package/es/form/src/FormItem.js +24 -7
  91. package/es/form/src/styles/form-item.cssr.js +5 -3
  92. package/es/gradient-text/src/styles/index.cssr.js +2 -2
  93. package/es/icon/src/styles/index.cssr.js +2 -2
  94. package/es/icon-wrapper/src/styles/index.cssr.js +2 -2
  95. package/es/image/src/Image.d.ts +4 -1
  96. package/es/image/src/Image.js +13 -7
  97. package/es/image/src/ImagePreview.d.ts +3 -2
  98. package/es/image/src/ImagePreview.js +41 -8
  99. package/es/image/src/interface.d.ts +5 -0
  100. package/es/image/src/interface.js +2 -0
  101. package/es/image/src/styles/index.cssr.js +2 -2
  102. package/es/input/src/Input.d.ts +3 -0
  103. package/es/input/src/Input.js +25 -6
  104. package/es/input/src/WordCount.js +2 -2
  105. package/es/input/src/interface.d.ts +1 -0
  106. package/es/input/src/styles/input-group-label.cssr.js +2 -2
  107. package/es/input/src/styles/input.cssr.js +11 -7
  108. package/es/layout/src/styles/layout-footer.cssr.js +2 -2
  109. package/es/layout/src/styles/layout-header.cssr.js +2 -2
  110. package/es/layout/src/styles/layout-sider.cssr.js +2 -2
  111. package/es/layout/src/styles/layout.cssr.js +2 -2
  112. package/es/list/src/styles/index.cssr.js +2 -2
  113. package/es/loading-bar/src/styles/index.cssr.js +2 -2
  114. package/es/locales/common/arDZ.d.ts +3 -0
  115. package/es/locales/common/arDZ.js +120 -0
  116. package/es/locales/common/deDE.js +2 -1
  117. package/es/locales/common/enGB.js +2 -1
  118. package/es/locales/common/enUS.d.ts +1 -0
  119. package/es/locales/common/enUS.js +2 -1
  120. package/es/locales/common/eo.js +2 -1
  121. package/es/locales/common/esAR.js +2 -1
  122. package/es/locales/common/frFR.js +2 -1
  123. package/es/locales/common/idID.js +2 -1
  124. package/es/locales/common/itIT.js +2 -1
  125. package/es/locales/common/jaJP.js +2 -1
  126. package/es/locales/common/koKR.js +2 -1
  127. package/es/locales/common/nbNO.js +2 -1
  128. package/es/locales/common/nlNL.js +2 -1
  129. package/es/locales/common/plPL.js +2 -1
  130. package/es/locales/common/ptBR.js +2 -1
  131. package/es/locales/common/ruRU.js +2 -1
  132. package/es/locales/common/skSK.js +2 -1
  133. package/es/locales/common/thTH.js +2 -1
  134. package/es/locales/common/trTR.d.ts +3 -0
  135. package/es/locales/common/trTR.js +121 -0
  136. package/es/locales/common/ukUA.js +2 -1
  137. package/es/locales/common/viVN.js +2 -1
  138. package/es/locales/common/zhCN.js +2 -1
  139. package/es/locales/common/zhTW.js +2 -1
  140. package/es/locales/date/arDZ.d.ts +3 -0
  141. package/es/locales/date/arDZ.js +6 -0
  142. package/es/locales/date/trTR.d.ts +3 -0
  143. package/es/locales/date/trTR.js +6 -0
  144. package/es/locales/index.d.ts +4 -0
  145. package/es/locales/index.js +4 -0
  146. package/es/log/src/styles/index.cssr.js +2 -2
  147. package/es/mention/src/Mention.d.ts +6 -0
  148. package/es/mention/src/Mention.js +6 -1
  149. package/es/mention/src/styles/index.cssr.js +2 -2
  150. package/es/menu/src/styles/index.cssr.js +2 -3
  151. package/es/message/src/styles/index.cssr.js +2 -2
  152. package/es/modal/src/BodyWrapper.d.ts +1 -1
  153. package/es/modal/src/styles/index.cssr.js +2 -2
  154. package/es/notification/src/styles/index.cssr.js +2 -3
  155. package/es/page-header/src/styles/index.cssr.js +2 -2
  156. package/es/pagination/src/Pagination.js +1 -1
  157. package/es/pagination/src/styles/index.cssr.js +2 -2
  158. package/es/popconfirm/src/styles/index.cssr.js +2 -2
  159. package/es/popover/src/styles/index.cssr.js +5 -5
  160. package/es/popselect/src/styles/index.cssr.js +2 -2
  161. package/es/progress/src/styles/index.cssr.js +2 -2
  162. package/es/radio/src/styles/radio-group.cssr.js +2 -2
  163. package/es/radio/src/styles/radio.cssr.js +2 -2
  164. package/es/rate/src/styles/index.cssr.js +2 -2
  165. package/es/result/src/styles/index.cssr.js +2 -2
  166. package/es/select/src/Select.js +1 -0
  167. package/es/select/src/styles/index.cssr.js +2 -2
  168. package/es/skeleton/src/styles/index.cssr.js +2 -2
  169. package/es/slider/src/styles/index.cssr.js +2 -2
  170. package/es/spin/src/styles/index.cssr.js +2 -2
  171. package/es/statistic/src/styles/index.cssr.js +2 -2
  172. package/es/steps/src/styles/index.cssr.js +2 -2
  173. package/es/switch/src/styles/index.cssr.js +2 -2
  174. package/es/table/src/styles/index.cssr.js +2 -2
  175. package/es/tabs/src/Tabs.d.ts +7 -7
  176. package/es/tabs/src/styles/index.cssr.js +2 -2
  177. package/es/tag/src/styles/index.cssr.js +2 -2
  178. package/es/themes/dark.js +2 -0
  179. package/es/themes/light.js +2 -0
  180. package/es/thing/src/styles/index.cssr.js +2 -2
  181. package/es/time-picker/src/styles/index.cssr.js +2 -2
  182. package/es/timeline/src/styles/index.cssr.js +6 -3
  183. package/es/transfer/src/Transfer.d.ts +13 -0
  184. package/es/transfer/src/Transfer.js +6 -2
  185. package/es/transfer/src/TransferListItem.d.ts +2 -1
  186. package/es/transfer/src/TransferListItem.js +5 -4
  187. package/es/transfer/src/interface.d.ts +1 -0
  188. package/es/transfer/src/styles/index.cssr.js +2 -2
  189. package/es/transfer/src/use-transfer-data.d.ts +1 -0
  190. package/es/transfer/src/use-transfer-data.js +13 -4
  191. package/es/tree/src/Tree.d.ts +60 -30
  192. package/es/tree/src/Tree.js +70 -24
  193. package/es/tree/src/TreeNode.d.ts +1 -1
  194. package/es/tree/src/TreeNode.js +1 -1
  195. package/es/tree/src/TreeNodeSwitcher.d.ts +3 -0
  196. package/es/tree/src/TreeNodeSwitcher.js +7 -5
  197. package/es/tree/src/interface.d.ts +12 -1
  198. package/es/tree/src/styles/index.cssr.js +3 -2
  199. package/es/tree/src/utils.d.ts +6 -0
  200. package/es/tree/src/utils.js +4 -0
  201. package/es/tree-select/index.d.ts +1 -1
  202. package/es/tree-select/src/TreeSelect.d.ts +38 -19
  203. package/es/tree-select/src/TreeSelect.js +75 -48
  204. package/es/tree-select/src/interface.d.ts +33 -2
  205. package/es/tree-select/src/styles/index.cssr.js +2 -2
  206. package/es/typography/src/styles/a.cssr.js +2 -2
  207. package/es/typography/src/styles/blockquote.cssr.js +2 -2
  208. package/es/typography/src/styles/header.cssr.js +2 -2
  209. package/es/typography/src/styles/hr.cssr.js +2 -2
  210. package/es/typography/src/styles/list.cssr.js +2 -2
  211. package/es/typography/src/styles/p.cssr.js +2 -2
  212. package/es/typography/src/styles/text.cssr.js +2 -2
  213. package/es/upload/index.d.ts +1 -1
  214. package/es/upload/src/Upload.d.ts +77 -1
  215. package/es/upload/src/Upload.js +28 -11
  216. package/es/upload/src/UploadFile.d.ts +2 -0
  217. package/es/upload/src/UploadFile.js +9 -10
  218. package/es/upload/src/interface.d.ts +7 -3
  219. package/es/upload/src/utils.d.ts +2 -2
  220. package/es/upload/src/utils.js +2 -1
  221. package/es/version.d.ts +1 -1
  222. package/es/version.js +1 -1
  223. package/lib/_internal/clear/src/styles/index.cssr.js +2 -5
  224. package/lib/_internal/close/src/styles/index.cssr.js +2 -4
  225. package/lib/_internal/icon/src/styles/index.cssr.js +0 -2
  226. package/lib/_internal/index.d.ts +1 -0
  227. package/lib/_internal/loading/index.d.ts +1 -0
  228. package/lib/_internal/loading/src/Loading.d.ts +26 -14
  229. package/lib/_internal/loading/src/Loading.js +17 -20
  230. package/lib/_internal/loading/src/styles/index.cssr.js +0 -3
  231. package/lib/_internal/menu-mask/src/styles/index.cssr.js +0 -3
  232. package/lib/_internal/scrollbar/src/styles/index.cssr.js +2 -5
  233. package/lib/_internal/scrollbar/src/styles/rtl.cssr.js +0 -2
  234. package/lib/_internal/select-menu/src/styles/index.cssr.js +2 -5
  235. package/lib/_internal/selection/src/Selection.js +5 -5
  236. package/lib/_internal/selection/src/styles/index.cssr.js +2 -4
  237. package/lib/_internal/slot-machine/src/styles/index.cssr.js +4 -7
  238. package/lib/_internal/wave/src/styles/index.cssr.js +0 -2
  239. package/lib/_styles/global/index.cssr.js +2 -6
  240. package/lib/_styles/transitions/fade-down.cssr.js +0 -6
  241. package/lib/_styles/transitions/fade-in-height-expand.cssr.js +0 -6
  242. package/lib/_styles/transitions/fade-in-scale-up.cssr.js +0 -6
  243. package/lib/_styles/transitions/fade-in-width-expand.cssr.js +0 -6
  244. package/lib/_styles/transitions/fade-in.cssr.js +0 -6
  245. package/lib/_styles/transitions/fade-up-width-expand.cssr.js +0 -6
  246. package/lib/_styles/transitions/icon-switch.cssr.js +0 -6
  247. package/lib/affix/src/styles/index.cssr.js +0 -2
  248. package/lib/alert/src/styles/index.cssr.js +2 -5
  249. package/lib/alert/src/styles/rtl.cssr.js +0 -2
  250. package/lib/anchor/src/styles/index.cssr.js +2 -4
  251. package/lib/auto-complete/src/styles/index.cssr.js +2 -5
  252. package/lib/avatar/src/Avatar.d.ts +4 -1
  253. package/lib/avatar/src/Avatar.js +12 -13
  254. package/lib/avatar/src/styles/index.cssr.js +2 -4
  255. package/lib/avatar-group/index.d.ts +1 -1
  256. package/lib/avatar-group/src/AvatarGroup.d.ts +7 -7
  257. package/lib/avatar-group/src/styles/avatar-group-rtl.cssr.js +2 -4
  258. package/lib/avatar-group/src/styles/avatar-group.cssr.js +2 -4
  259. package/lib/back-top/src/styles/index.cssr.js +2 -5
  260. package/lib/badge/src/styles/index.cssr.js +2 -5
  261. package/lib/badge/src/styles/rtl.cssr.js +0 -2
  262. package/lib/breadcrumb/src/styles/index.cssr.js +2 -4
  263. package/lib/button/src/Button.d.ts +4 -1
  264. package/lib/button/src/Button.js +3 -3
  265. package/lib/button/src/styles/index.cssr.js +2 -7
  266. package/lib/button/src/styles/rtl.cssr.js +0 -2
  267. package/lib/button-group/src/styles/index.cssr.js +0 -5
  268. package/lib/button-group/src/styles/rtl.cssr.js +0 -4
  269. package/lib/calendar/src/styles/index.cssr.js +2 -4
  270. package/lib/card/src/styles/index.cssr.js +4 -5
  271. package/lib/card/src/styles/rtl.cssr.js +0 -2
  272. package/lib/carousel/src/styles/index.cssr.js +2 -4
  273. package/lib/cascader/src/Cascader.d.ts +8 -0
  274. package/lib/cascader/src/Cascader.js +41 -2
  275. package/lib/cascader/src/CascaderOption.d.ts +1 -1
  276. package/lib/cascader/src/CascaderOption.js +1 -7
  277. package/lib/cascader/src/CascaderSelectMenu.d.ts +3 -0
  278. package/lib/cascader/src/CascaderSelectMenu.js +8 -4
  279. package/lib/cascader/src/interface.d.ts +11 -1
  280. package/lib/cascader/src/styles/index.cssr.js +2 -5
  281. package/lib/checkbox/src/styles/index.cssr.js +8 -8
  282. package/lib/checkbox/src/styles/rtl.cssr.js +0 -2
  283. package/lib/code/src/Code.d.ts +1 -1
  284. package/lib/code/src/styles/index.cssr.js +2 -4
  285. package/lib/collapse/src/styles/index.cssr.js +2 -5
  286. package/lib/collapse/src/styles/rtl.cssr.js +0 -2
  287. package/lib/collapse-transition/src/styles/index.cssr.js +0 -3
  288. package/lib/collapse-transition/src/styles/rtl.cssr.js +0 -2
  289. package/lib/color-picker/src/ColorPicker.d.ts +5 -5
  290. package/lib/color-picker/src/ColorPicker.js +7 -1
  291. package/lib/color-picker/src/styles/index.cssr.js +2 -5
  292. package/lib/color-picker/src/utils.d.ts +1 -1
  293. package/lib/components.d.ts +1 -0
  294. package/lib/components.js +1 -0
  295. package/lib/config-provider/src/ConfigProvider.d.ts +6 -0
  296. package/lib/config-provider/src/ConfigProvider.js +7 -0
  297. package/lib/config-provider/src/internal-interface.d.ts +4 -0
  298. package/lib/data-table/src/DataTable.d.ts +11 -0
  299. package/lib/data-table/src/DataTable.js +6 -2
  300. package/lib/data-table/src/TableParts/Body.d.ts +1 -0
  301. package/lib/data-table/src/TableParts/Body.js +13 -5
  302. package/lib/data-table/src/TableParts/Header.js +7 -5
  303. package/lib/data-table/src/interface.d.ts +10 -2
  304. package/lib/data-table/src/interface.js +1 -1
  305. package/lib/data-table/src/styles/index.cssr.js +21 -13
  306. package/lib/date-picker/src/DatePicker.js +5 -0
  307. package/lib/date-picker/src/panel/panelHeader.d.ts +6 -6
  308. package/lib/date-picker/src/styles/index.cssr.js +2 -5
  309. package/lib/descriptions/src/styles/index.cssr.js +2 -4
  310. package/lib/dialog/src/DialogEnvironment.d.ts +3 -0
  311. package/lib/dialog/src/DialogEnvironment.js +2 -2
  312. package/lib/dialog/src/DialogProvider.d.ts +3 -0
  313. package/lib/dialog/src/styles/index.cssr.js +2 -4
  314. package/lib/divider/src/styles/index.cssr.js +2 -4
  315. package/lib/drawer/src/styles/index.cssr.js +2 -9
  316. package/lib/drawer/src/styles/rtl.cssr.js +0 -2
  317. package/lib/dropdown/src/styles/index.cssr.js +2 -5
  318. package/lib/dynamic-input/src/styles/index.cssr.js +2 -4
  319. package/lib/dynamic-input/src/styles/rtl.cssr.js +0 -2
  320. package/lib/dynamic-tags/src/styles/index.cssr.js +2 -4
  321. package/lib/ellipsis/src/styles/index.cssr.js +0 -2
  322. package/lib/empty/src/styles/index.cssr.js +2 -4
  323. package/lib/equation/index.d.ts +1 -0
  324. package/lib/equation/index.js +6 -0
  325. package/lib/equation/src/Equation.d.ts +18 -0
  326. package/lib/equation/src/Equation.js +32 -0
  327. package/lib/equation/styles/dark.d.ts +3 -0
  328. package/lib/equation/styles/dark.js +10 -0
  329. package/lib/equation/styles/index.d.ts +3 -0
  330. package/lib/equation/styles/index.js +10 -0
  331. package/lib/equation/styles/light.d.ts +6 -0
  332. package/lib/equation/styles/light.js +12 -0
  333. package/lib/form/src/FormItem.d.ts +3 -2
  334. package/lib/form/src/FormItem.js +24 -7
  335. package/lib/form/src/styles/form-item.cssr.js +5 -6
  336. package/lib/form/src/styles/form.cssr.js +0 -2
  337. package/lib/gradient-text/src/styles/index.cssr.js +2 -4
  338. package/lib/icon/src/styles/index.cssr.js +2 -4
  339. package/lib/icon-wrapper/src/styles/index.cssr.js +2 -4
  340. package/lib/image/src/Image.d.ts +4 -1
  341. package/lib/image/src/Image.js +11 -5
  342. package/lib/image/src/ImagePreview.d.ts +3 -2
  343. package/lib/image/src/ImagePreview.js +39 -6
  344. package/lib/image/src/interface.d.ts +5 -0
  345. package/lib/image/src/interface.js +3 -1
  346. package/lib/image/src/styles/index.cssr.js +2 -6
  347. package/lib/input/src/Input.d.ts +3 -0
  348. package/lib/input/src/Input.js +25 -6
  349. package/lib/input/src/WordCount.js +2 -2
  350. package/lib/input/src/interface.d.ts +1 -0
  351. package/lib/input/src/styles/input-group-label.cssr.js +2 -4
  352. package/lib/input/src/styles/input-group.cssr.js +0 -2
  353. package/lib/input/src/styles/input.cssr.js +11 -9
  354. package/lib/input/src/styles/rtl.cssr.js +0 -2
  355. package/lib/input-number/src/styles/input-number.cssr.js +0 -2
  356. package/lib/input-number/src/styles/rtl.cssr.js +0 -2
  357. package/lib/layout/src/styles/layout-footer.cssr.js +2 -4
  358. package/lib/layout/src/styles/layout-header.cssr.js +2 -4
  359. package/lib/layout/src/styles/layout-sider.cssr.js +2 -4
  360. package/lib/layout/src/styles/layout.cssr.js +2 -4
  361. package/lib/legacy-grid/src/styles/index.cssr.js +0 -2
  362. package/lib/legacy-grid/src/styles/rtl.cssr.js +0 -2
  363. package/lib/legacy-transfer/src/styles/index.cssr.js +0 -3
  364. package/lib/list/src/styles/index.cssr.js +2 -4
  365. package/lib/list/src/styles/rtl.cssr.js +0 -2
  366. package/lib/loading-bar/src/styles/index.cssr.js +2 -5
  367. package/lib/locales/common/arDZ.d.ts +3 -0
  368. package/lib/locales/common/arDZ.js +122 -0
  369. package/lib/locales/common/deDE.js +2 -1
  370. package/lib/locales/common/enGB.js +2 -1
  371. package/lib/locales/common/enUS.d.ts +1 -0
  372. package/lib/locales/common/enUS.js +2 -1
  373. package/lib/locales/common/eo.js +2 -1
  374. package/lib/locales/common/esAR.js +2 -1
  375. package/lib/locales/common/frFR.js +2 -1
  376. package/lib/locales/common/idID.js +2 -1
  377. package/lib/locales/common/itIT.js +2 -1
  378. package/lib/locales/common/jaJP.js +2 -1
  379. package/lib/locales/common/koKR.js +2 -1
  380. package/lib/locales/common/nbNO.js +2 -1
  381. package/lib/locales/common/nlNL.js +2 -1
  382. package/lib/locales/common/plPL.js +2 -1
  383. package/lib/locales/common/ptBR.js +2 -1
  384. package/lib/locales/common/ruRU.js +2 -1
  385. package/lib/locales/common/skSK.js +2 -1
  386. package/lib/locales/common/thTH.js +2 -1
  387. package/lib/locales/common/trTR.d.ts +3 -0
  388. package/lib/locales/common/trTR.js +123 -0
  389. package/lib/locales/common/ukUA.js +2 -1
  390. package/lib/locales/common/viVN.js +2 -1
  391. package/lib/locales/common/zhCN.js +2 -1
  392. package/lib/locales/common/zhTW.js +2 -1
  393. package/lib/locales/date/arDZ.d.ts +3 -0
  394. package/lib/locales/date/arDZ.js +11 -0
  395. package/lib/locales/date/trTR.d.ts +3 -0
  396. package/lib/locales/date/trTR.js +11 -0
  397. package/lib/locales/index.d.ts +4 -0
  398. package/lib/locales/index.js +9 -1
  399. package/lib/log/src/styles/index.cssr.js +2 -5
  400. package/lib/mention/src/Mention.d.ts +6 -0
  401. package/lib/mention/src/Mention.js +6 -1
  402. package/lib/mention/src/styles/index.cssr.js +2 -5
  403. package/lib/menu/src/styles/index.cssr.js +2 -6
  404. package/lib/message/src/styles/index.cssr.js +2 -6
  405. package/lib/message/src/styles/rtl.cssr.js +0 -2
  406. package/lib/modal/src/BodyWrapper.d.ts +1 -1
  407. package/lib/modal/src/styles/index.cssr.js +2 -6
  408. package/lib/notification/src/styles/index.cssr.js +2 -5
  409. package/lib/notification/src/styles/rtl.cssr.js +0 -2
  410. package/lib/page-header/src/styles/index.cssr.js +2 -4
  411. package/lib/page-header/src/styles/rtl.cssr.js +0 -2
  412. package/lib/pagination/src/Pagination.js +1 -1
  413. package/lib/pagination/src/styles/index.cssr.js +2 -4
  414. package/lib/pagination/src/styles/rtl.cssr.js +0 -2
  415. package/lib/popconfirm/src/styles/index.cssr.js +2 -4
  416. package/lib/popover/src/styles/index.cssr.js +5 -8
  417. package/lib/popselect/src/styles/index.cssr.js +2 -4
  418. package/lib/progress/src/styles/index.cssr.js +2 -4
  419. package/lib/radio/src/styles/radio-group.cssr.js +2 -4
  420. package/lib/radio/src/styles/radio.cssr.js +2 -4
  421. package/lib/radio/src/styles/rtl.cssr.js +0 -2
  422. package/lib/rate/src/styles/index.cssr.js +2 -4
  423. package/lib/result/src/styles/index.cssr.js +2 -4
  424. package/lib/select/src/Select.js +1 -0
  425. package/lib/select/src/styles/index.cssr.js +2 -5
  426. package/lib/skeleton/src/styles/index.cssr.js +2 -4
  427. package/lib/slider/src/styles/index.cssr.js +2 -5
  428. package/lib/space/src/styles/rtl.cssr.js +0 -2
  429. package/lib/spin/src/styles/index.cssr.js +2 -5
  430. package/lib/statistic/src/styles/index.cssr.js +2 -4
  431. package/lib/statistic/src/styles/rtl.cssr.js +0 -2
  432. package/lib/steps/src/styles/index.cssr.js +2 -5
  433. package/lib/steps/src/styles/rtl.cssr.js +0 -2
  434. package/lib/switch/src/styles/index.cssr.js +2 -5
  435. package/lib/table/src/styles/index.cssr.js +2 -4
  436. package/lib/table/src/styles/rtl.cssr.js +0 -2
  437. package/lib/tabs/src/Tabs.d.ts +7 -7
  438. package/lib/tabs/src/styles/index.cssr.js +2 -4
  439. package/lib/tag/src/styles/index.cssr.js +2 -4
  440. package/lib/tag/src/styles/rtl.cssr.js +0 -2
  441. package/lib/themes/dark.js +100 -98
  442. package/lib/themes/light.js +100 -98
  443. package/lib/thing/src/styles/index.cssr.js +2 -4
  444. package/lib/thing/src/styles/rtl.cssr.js +0 -2
  445. package/lib/time-picker/src/styles/index.cssr.js +2 -5
  446. package/lib/timeline/src/styles/index.cssr.js +6 -5
  447. package/lib/transfer/src/Transfer.d.ts +13 -0
  448. package/lib/transfer/src/Transfer.js +6 -2
  449. package/lib/transfer/src/TransferListItem.d.ts +2 -1
  450. package/lib/transfer/src/TransferListItem.js +5 -4
  451. package/lib/transfer/src/interface.d.ts +1 -0
  452. package/lib/transfer/src/styles/index.cssr.js +2 -4
  453. package/lib/transfer/src/use-transfer-data.d.ts +1 -0
  454. package/lib/transfer/src/use-transfer-data.js +13 -4
  455. package/lib/tree/src/Tree.d.ts +60 -30
  456. package/lib/tree/src/Tree.js +69 -23
  457. package/lib/tree/src/TreeNode.d.ts +1 -1
  458. package/lib/tree/src/TreeNode.js +1 -1
  459. package/lib/tree/src/TreeNodeSwitcher.d.ts +3 -0
  460. package/lib/tree/src/TreeNodeSwitcher.js +7 -5
  461. package/lib/tree/src/interface.d.ts +12 -1
  462. package/lib/tree/src/styles/index.cssr.js +3 -6
  463. package/lib/tree/src/styles/rtl.cssr.js +0 -2
  464. package/lib/tree/src/utils.d.ts +6 -0
  465. package/lib/tree/src/utils.js +6 -1
  466. package/lib/tree-select/index.d.ts +1 -1
  467. package/lib/tree-select/src/TreeSelect.d.ts +38 -19
  468. package/lib/tree-select/src/TreeSelect.js +75 -48
  469. package/lib/tree-select/src/interface.d.ts +33 -2
  470. package/lib/tree-select/src/styles/index.cssr.js +2 -5
  471. package/lib/typography/src/styles/a.cssr.js +2 -4
  472. package/lib/typography/src/styles/blockquote.cssr.js +2 -4
  473. package/lib/typography/src/styles/header.cssr.js +2 -4
  474. package/lib/typography/src/styles/hr.cssr.js +2 -4
  475. package/lib/typography/src/styles/list.cssr.js +2 -4
  476. package/lib/typography/src/styles/p.cssr.js +2 -4
  477. package/lib/typography/src/styles/text.cssr.js +2 -4
  478. package/lib/upload/index.d.ts +1 -1
  479. package/lib/upload/src/Upload.d.ts +77 -1
  480. package/lib/upload/src/Upload.js +27 -10
  481. package/lib/upload/src/UploadFile.d.ts +2 -0
  482. package/lib/upload/src/UploadFile.js +8 -9
  483. package/lib/upload/src/interface.d.ts +7 -3
  484. package/lib/upload/src/styles/index.cssr.js +0 -4
  485. package/lib/upload/src/utils.d.ts +2 -2
  486. package/lib/upload/src/utils.js +2 -1
  487. package/lib/version.d.ts +1 -1
  488. package/lib/version.js +1 -1
  489. package/lib/watermark/src/styles/index.cssr.js +0 -2
  490. package/package.json +13 -10
  491. package/volar.d.ts +1 -0
  492. package/web-types.json +236 -57
@@ -0,0 +1,29 @@
1
+ import { h, defineComponent, computed, inject } from 'vue';
2
+ import { configProviderInjectionKey } from '../../config-provider/src/context';
3
+ export const equationProps = {
4
+ value: String,
5
+ katex: Object,
6
+ katexOptions: Object
7
+ };
8
+ export const Equation = defineComponent({
9
+ name: 'Equation',
10
+ props: equationProps,
11
+ setup(props) {
12
+ const configProviderContext = inject(configProviderInjectionKey);
13
+ const extractedHtmlInfo = computed(() => {
14
+ var _a;
15
+ const outerHtml = ((_a = (props.katex || (configProviderContext === null || configProviderContext === void 0 ? void 0 : configProviderContext.mergedKatexRef.value))) === null || _a === void 0 ? void 0 : _a.renderToString(props.value || '', Object.assign({ throwOnError: false }, props.katexOptions))) || 'no katex provided';
16
+ const matchResult = outerHtml.match(/^<([a-z]+)[^>]+class="([^"]+)"[^>]*>/);
17
+ const wrapperTag = (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) || 'span';
18
+ const wrapperClass = matchResult === null || matchResult === void 0 ? void 0 : matchResult[2];
19
+ const innerHtml = outerHtml
20
+ .replace(/^<[a-z]+[^>]*>/, '')
21
+ .replace(/<\/[a-z]+>$/, '');
22
+ return { wrapperTag, innerHtml, wrapperClass };
23
+ });
24
+ return () => {
25
+ const { innerHtml, wrapperClass, wrapperTag } = extractedHtmlInfo.value;
26
+ return h(wrapperTag, { class: wrapperClass, innerHTML: innerHtml });
27
+ };
28
+ }
29
+ });
@@ -0,0 +1,3 @@
1
+ import type { EquationTheme } from './light';
2
+ declare const equationDark: EquationTheme;
3
+ export default equationDark;
@@ -0,0 +1,8 @@
1
+ import { commonDark } from '../../_styles/common';
2
+ import { self } from './light';
3
+ const equationDark = {
4
+ name: 'Equation',
5
+ common: commonDark,
6
+ self
7
+ };
8
+ export default equationDark;
@@ -0,0 +1,3 @@
1
+ export { default as equationDark } from './dark';
2
+ export { default as equationLight } from './light';
3
+ export type { EquationThemeVars, EquationTheme } from './light';
@@ -0,0 +1,2 @@
1
+ export { default as equationDark } from './dark';
2
+ export { default as equationLight } from './light';
@@ -0,0 +1,6 @@
1
+ import type { Theme } from '../../_mixins';
2
+ export declare const self: () => {};
3
+ export declare type EquationThemeVars = ReturnType<typeof self>;
4
+ declare const equationLight: Theme<'Equation', EquationThemeVars>;
5
+ export default equationLight;
6
+ export declare type EquationTheme = typeof equationLight;
@@ -0,0 +1,8 @@
1
+ import { commonLight } from '../../_styles/common';
2
+ export const self = () => ({});
3
+ const equationLight = {
4
+ name: 'Equation',
5
+ common: commonLight,
6
+ self
7
+ };
8
+ export default equationLight;
@@ -267,8 +267,8 @@ declare const _default: import("vue").DefineComponent<{
267
267
  '--n-feedback-text-color-warning': string;
268
268
  '--n-feedback-text-color-error': string;
269
269
  }> | undefined;
270
- themeClass: import("vue").Ref<string>;
271
- onRender: () => void;
270
+ themeClass: import("vue").Ref<string> | undefined;
271
+ onRender: (() => void) | undefined;
272
272
  validate: import("./interface").FormItemValidate;
273
273
  restoreValidation: () => void;
274
274
  path?: string | undefined;
@@ -292,6 +292,7 @@ declare const _default: import("vue").DefineComponent<{
292
292
  key: string;
293
293
  render: () => VNodeChild;
294
294
  }[]>;
295
+ reverseColSpace: import("vue").ComputedRef<boolean>;
295
296
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
296
297
  readonly label: StringConstructor;
297
298
  readonly labelWidth: PropType<string | number>;
@@ -75,7 +75,7 @@ export default defineComponent({
75
75
  const { validationErrored: validationErroredRef } = formItemMiscRefs;
76
76
  const { mergedRequired: mergedRequiredRef, mergedRules: mergedRulesRef } = formItemRule(props);
77
77
  const { mergedSize: mergedSizeRef } = formItemSizeRefs;
78
- const { mergedLabelPlacement: labelPlacementRef, mergedLabelAlign: labelTextAlignRef } = formItemMiscRefs;
78
+ const { mergedLabelPlacement: labelPlacementRef, mergedLabelAlign: labelTextAlignRef, mergedRequireMarkPlacement: mergedRequireMarkPlacementRef } = formItemMiscRefs;
79
79
  const renderExplainsRef = ref([]);
80
80
  const feedbackIdRef = ref(createId());
81
81
  const mergedDisabledRef = NForm
@@ -290,11 +290,26 @@ export default defineComponent({
290
290
  };
291
291
  return cssVars;
292
292
  });
293
- const themeClassHandle = useThemeClass('form-item', computed(() => {
294
- var _a;
295
- return `${mergedSizeRef.value[0]}${labelPlacementRef.value[0]}${((_a = labelTextAlignRef.value) === null || _a === void 0 ? void 0 : _a[0]) || ''}`;
296
- }), cssVarsRef, props);
297
- return Object.assign(Object.assign(Object.assign(Object.assign({ labelElementRef, mergedClsPrefix: mergedClsPrefixRef, mergedRequired: mergedRequiredRef, feedbackId: feedbackIdRef, renderExplains: renderExplainsRef }, formItemMiscRefs), formItemSizeRefs), exposedRef), { cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender });
293
+ const themeClassHandle = inlineThemeDisabled
294
+ ? useThemeClass('form-item', computed(() => {
295
+ var _a;
296
+ return `${mergedSizeRef.value[0]}${labelPlacementRef.value[0]}${((_a = labelTextAlignRef.value) === null || _a === void 0 ? void 0 : _a[0]) || ''}`;
297
+ }), cssVarsRef, props)
298
+ : undefined;
299
+ const reverseColSpaceRef = computed(() => {
300
+ // label placement left
301
+ // require-mark-placement | label align | areas (1fr auto)
302
+ // left | left | mark text (need reverse)
303
+ // left | right | mark text (okay)
304
+ // right | left | mark text (okay)
305
+ // right | right | mark text (okay)
306
+ // right-hanging | left | text mark (okay)
307
+ // right-hanging | right | text mark (okay)
308
+ return (labelPlacementRef.value === 'left' &&
309
+ mergedRequireMarkPlacementRef.value === 'left' &&
310
+ labelTextAlignRef.value === 'left');
311
+ });
312
+ return Object.assign(Object.assign(Object.assign(Object.assign({ labelElementRef, mergedClsPrefix: mergedClsPrefixRef, mergedRequired: mergedRequiredRef, feedbackId: feedbackIdRef, renderExplains: renderExplainsRef, reverseColSpace: reverseColSpaceRef }, formItemMiscRefs), formItemSizeRefs), exposedRef), { cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender });
298
313
  },
299
314
  render() {
300
315
  const { $slots, mergedClsPrefix, mergedShowLabel, mergedShowRequireMark, mergedRequireMarkPlacement, onRender } = this;
@@ -312,7 +327,9 @@ export default defineComponent({
312
327
  return (h("label", Object.assign({}, labelProps, { class: [
313
328
  labelProps === null || labelProps === void 0 ? void 0 : labelProps.class,
314
329
  `${mergedClsPrefix}-form-item-label`,
315
- `${mergedClsPrefix}-form-item-label--${mergedRequireMarkPlacement}-mark`
330
+ `${mergedClsPrefix}-form-item-label--${mergedRequireMarkPlacement}-mark`,
331
+ this.reverseColSpace &&
332
+ `${mergedClsPrefix}-form-item-label--reverse-columns-space`
316
333
  ], style: this.mergedLabelStyle, ref: "labelElementRef" }), mergedRequireMarkPlacement === 'left'
317
334
  ? [markNode, textNode]
318
335
  : [textNode, markNode]));
@@ -1,5 +1,6 @@
1
1
  import { cB, cE, cM, c } from '../../../_utils/cssr';
2
- import { fadeDownTransition } from '../../../_styles/transitions/fade-down.cssr'; // vars:
2
+ import { fadeDownTransition } from '../../../_styles/transitions/fade-down.cssr';
3
+ // vars:
3
4
  // --n-line-height
4
5
  // --n-blank-height
5
6
  // --n-feedback-padding
@@ -16,7 +17,6 @@ import { fadeDownTransition } from '../../../_styles/transitions/fade-down.cssr'
16
17
  // --n-feedback-text-color-error
17
18
  // --n-label-text-align
18
19
  // --n-label-padding
19
-
20
20
  export default cB('form-item', `
21
21
  display: grid;
22
22
  line-height: var(--n-line-height);
@@ -60,7 +60,9 @@ export default cB('form-item', `
60
60
  box-sizing: border-box;
61
61
  flex-shrink: 0;
62
62
  flex-grow: 0;
63
- `, [cM('left-mark', `
63
+ `, [cM('reverse-columns-space', `
64
+ grid-template-columns: auto 1fr;
65
+ `), cM('left-mark', `
64
66
  grid-template-areas:
65
67
  "mark text"
66
68
  ". text";
@@ -1,10 +1,10 @@
1
- import { cB } from '../../../_utils/cssr'; // vars:
1
+ import { cB } from '../../../_utils/cssr';
2
+ // vars:
2
3
  // --n-font-weight
3
4
  // --n-rotate
4
5
  // --n-bezier
5
6
  // --n-color-start
6
7
  // --n-color-end
7
-
8
8
  export default cB('gradient-text', `
9
9
  display: inline-block;
10
10
  font-weight: var(--n-font-weight);
@@ -1,8 +1,8 @@
1
- import { c, cB, cM } from '../../../_utils/cssr'; // vars:
1
+ import { c, cB, cM } from '../../../_utils/cssr';
2
+ // vars:
2
3
  // --n-bezier
3
4
  // --n-color
4
5
  // --n-opacity
5
-
6
6
  export default cB('icon', `
7
7
  height: 1em;
8
8
  width: 1em;
@@ -1,9 +1,9 @@
1
- import { cB } from '../../../_utils/cssr'; // vars:
1
+ import { cB } from '../../../_utils/cssr';
2
+ // vars:
2
3
  // --n-bezier
3
4
  // --n-border-radius
4
5
  // --n-color
5
6
  // --n-icon-color
6
-
7
7
  export default cB('icon-wrapper', `
8
8
  transition:
9
9
  color .3s var(--n-bezier),
@@ -100,6 +100,7 @@ export declare const imageProps: {
100
100
  alt: StringConstructor;
101
101
  height: PropType<string | number>;
102
102
  imgProps: PropType<ImgHTMLAttributes>;
103
+ previewedImgProps: PropType<ImgHTMLAttributes>;
103
104
  lazy: BooleanConstructor;
104
105
  intersectionObserverOptions: PropType<IntersectionObserverOptions>;
105
106
  objectFit: {
@@ -212,6 +213,7 @@ declare const _default: import("vue").DefineComponent<{
212
213
  alt: StringConstructor;
213
214
  height: PropType<string | number>;
214
215
  imgProps: PropType<ImgHTMLAttributes>;
216
+ previewedImgProps: PropType<ImgHTMLAttributes>;
215
217
  lazy: BooleanConstructor;
216
218
  intersectionObserverOptions: PropType<IntersectionObserverOptions>;
217
219
  objectFit: {
@@ -236,10 +238,10 @@ declare const _default: import("vue").DefineComponent<{
236
238
  toggleShow: () => void;
237
239
  } | null>;
238
240
  imageRef: import("vue").Ref<HTMLImageElement | null>;
239
- imgProps: import("vue").Ref<ImgHTMLAttributes | undefined>;
240
241
  showError: import("vue").Ref<boolean>;
241
242
  shouldStartLoading: import("vue").Ref<boolean>;
242
243
  loaded: import("vue").Ref<boolean>;
244
+ mergedOnClick: (e: MouseEvent) => void;
243
245
  mergedOnError: (e: Event) => void;
244
246
  mergedOnLoad: (e: Event) => void;
245
247
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -338,6 +340,7 @@ declare const _default: import("vue").DefineComponent<{
338
340
  alt: StringConstructor;
339
341
  height: PropType<string | number>;
340
342
  imgProps: PropType<ImgHTMLAttributes>;
343
+ previewedImgProps: PropType<ImgHTMLAttributes>;
341
344
  lazy: BooleanConstructor;
342
345
  intersectionObserverOptions: PropType<IntersectionObserverOptions>;
343
346
  objectFit: {
@@ -1,11 +1,11 @@
1
- import { defineComponent, h, inject, ref, toRef, watchEffect, onMounted, onBeforeUnmount } from 'vue';
1
+ import { defineComponent, h, inject, ref, watchEffect, onMounted, onBeforeUnmount, provide, toRef } from 'vue';
2
2
  import { isImageSupportNativeLazy } from '../../_utils/env/is-native-lazy-load';
3
3
  import { useConfig } from '../../_mixins';
4
- import { imagePreviewSharedProps } from './interface';
4
+ import { imageContextKey, imagePreviewSharedProps } from './interface';
5
5
  import { observeIntersection } from './utils';
6
6
  import { imageGroupInjectionKey } from './ImageGroup';
7
7
  import NImagePreview from './ImagePreview';
8
- export const imageProps = Object.assign({ alt: String, height: [String, Number], imgProps: Object, lazy: Boolean, intersectionObserverOptions: Object, objectFit: {
8
+ export const imageProps = Object.assign({ alt: String, height: [String, Number], imgProps: Object, previewedImgProps: Object, lazy: Boolean, intersectionObserverOptions: Object, objectFit: {
9
9
  type: String,
10
10
  default: 'fill'
11
11
  }, previewSrc: String, fallbackSrc: String, width: [String, Number], src: String, previewDisabled: Boolean, loadDescription: String, onError: Function, onLoad: Function }, imagePreviewSharedProps);
@@ -16,7 +16,6 @@ export default defineComponent({
16
16
  setup(props) {
17
17
  const imageRef = ref(null);
18
18
  const showErrorRef = ref(false);
19
- const imgPropsRef = toRef(props, 'imgProps');
20
19
  const previewInstRef = ref(null);
21
20
  const imageGroupHandle = inject(imageGroupInjectionKey, null);
22
21
  const { mergedClsPrefixRef } = imageGroupHandle || useConfig(props);
@@ -68,8 +67,15 @@ export default defineComponent({
68
67
  showErrorRef.value = false;
69
68
  });
70
69
  const loadedRef = ref(false);
70
+ provide(imageContextKey, {
71
+ previewedImgPropsRef: toRef(props, 'previewedImgProps')
72
+ });
71
73
  return Object.assign({ mergedClsPrefix: mergedClsPrefixRef, groupId: imageGroupHandle === null || imageGroupHandle === void 0 ? void 0 : imageGroupHandle.groupId, previewInstRef,
72
- imageRef, imgProps: imgPropsRef, showError: showErrorRef, shouldStartLoading: shouldStartLoadingRef, loaded: loadedRef, mergedOnError: (e) => {
74
+ imageRef, showError: showErrorRef, shouldStartLoading: shouldStartLoadingRef, loaded: loadedRef, mergedOnClick: (e) => {
75
+ var _a, _b;
76
+ exposedMethods.click();
77
+ (_b = (_a = props.imgProps) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
78
+ }, mergedOnError: (e) => {
73
79
  if (!shouldStartLoadingRef.value)
74
80
  return;
75
81
  showErrorRef.value = true;
@@ -88,13 +94,13 @@ export default defineComponent({
88
94
  const { mergedClsPrefix, imgProps = {}, loaded, $attrs, lazy } = this;
89
95
  const placeholderNode = (_b = (_a = this.$slots).placeholder) === null || _b === void 0 ? void 0 : _b.call(_a);
90
96
  const loadSrc = this.src || imgProps.src || '';
91
- const imgNode = h('img', Object.assign(Object.assign({}, imgProps), { class: imgProps.class, ref: 'imageRef', width: this.width || imgProps.width, height: this.height || imgProps.height, src: isImageSupportNativeLazy
97
+ const imgNode = h('img', Object.assign(Object.assign({}, imgProps), { ref: 'imageRef', width: this.width || imgProps.width, height: this.height || imgProps.height, src: isImageSupportNativeLazy
92
98
  ? loadSrc
93
99
  : this.showError
94
100
  ? this.fallbackSrc
95
101
  : this.shouldStartLoading
96
102
  ? loadSrc
97
- : undefined, alt: this.alt || imgProps.alt, 'aria-label': this.alt || imgProps.alt, onClick: this.click, onError: this.mergedOnError, onLoad: this.mergedOnLoad, loading: lazy ? 'lazy' : 'eager', style: [
103
+ : undefined, alt: this.alt || imgProps.alt, 'aria-label': this.alt || imgProps.alt, onClick: this.mergedOnClick, onError: this.mergedOnError, onLoad: this.mergedOnLoad, loading: lazy ? 'lazy' : 'eager', style: [
98
104
  imgProps.style || '',
99
105
  placeholderNode && !loaded
100
106
  ? { height: '0', width: '0', visibility: 'hidden' }
@@ -113,12 +113,13 @@ declare const _default: import("vue").DefineComponent<{
113
113
  show: import("vue").Ref<boolean>;
114
114
  appear: Readonly<import("vue").Ref<boolean>>;
115
115
  displayed: import("vue").Ref<boolean>;
116
+ previewedImgProps: import("vue").Ref<import("vue").ImgHTMLAttributes> | undefined;
116
117
  handleWheel(e: WheelEvent): void;
117
118
  handlePreviewMousedown: (e: MouseEvent) => void;
118
- handlePreviewDblclick: () => void;
119
+ handlePreviewDblclick: (e: MouseEvent) => void;
119
120
  syncTransformOrigin: () => void;
120
121
  handleAfterLeave: () => void;
121
- handleDragStart: (e: Event) => void;
122
+ handleDragStart: (e: DragEvent) => void;
122
123
  zoomIn: () => void;
123
124
  zoomOut: () => void;
124
125
  rotateCounterclockwise: () => void;
@@ -1,16 +1,17 @@
1
- import { h, defineComponent, Fragment, ref, withDirectives, Transition, vShow, watch, computed, toRef, onBeforeUnmount } from 'vue';
1
+ import { h, defineComponent, Fragment, ref, withDirectives, Transition, vShow, watch, computed, toRef, onBeforeUnmount, inject, normalizeStyle } from 'vue';
2
2
  import { zindexable } from 'vdirs';
3
3
  import { useIsMounted } from 'vooks';
4
4
  import { LazyTeleport } from 'vueuc';
5
5
  import { on, off } from 'evtd';
6
6
  import { beforeNextFrameOnce } from 'seemly';
7
+ import { kebabCase } from 'lodash-es';
7
8
  import { RotateClockwiseIcon, RotateCounterclockwiseIcon, ZoomInIcon, ZoomOutIcon, ResizeSmallIcon } from '../../_internal/icons';
8
9
  import { useConfig, useLocale, useTheme, useThemeClass } from '../../_mixins';
9
10
  import { NBaseIcon } from '../../_internal';
10
11
  import { NTooltip } from '../../tooltip';
11
12
  import { imageLight } from '../styles';
12
13
  import { prevIcon, nextIcon, closeIcon } from './icons';
13
- import { imagePreviewSharedProps } from './interface';
14
+ import { imageContextKey, imagePreviewSharedProps } from './interface';
14
15
  import style from './styles/index.cssr';
15
16
  const BLEEDING = 32;
16
17
  export default defineComponent({
@@ -41,6 +42,9 @@ export default defineComponent({
41
42
  function handleKeydown(e) {
42
43
  var _a, _b;
43
44
  switch (e.key) {
45
+ case ' ':
46
+ e.preventDefault();
47
+ break;
44
48
  case 'ArrowLeft':
45
49
  (_a = props.onPrev) === null || _a === void 0 ? void 0 : _a.call(props);
46
50
  break;
@@ -150,7 +154,12 @@ export default defineComponent({
150
154
  offsetY = offset.offsetY;
151
155
  derivePreviewStyle();
152
156
  }
157
+ const imageContext = inject(imageContextKey, null);
153
158
  function handlePreviewMousedown(e) {
159
+ var _a, _b;
160
+ (_b = imageContext === null || imageContext === void 0 ? void 0 : (_a = imageContext.previewedImgPropsRef.value).onMousedown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
161
+ if (e.button !== 0)
162
+ return;
154
163
  const { clientX, clientY } = e;
155
164
  dragging = true;
156
165
  startX = clientX - offsetX;
@@ -163,7 +172,9 @@ export default defineComponent({
163
172
  on('mousemove', document, handleMouseMove);
164
173
  on('mouseup', document, handleMouseUp);
165
174
  }
166
- function handlePreviewDblclick() {
175
+ function handlePreviewDblclick(e) {
176
+ var _a, _b;
177
+ (_b = imageContext === null || imageContext === void 0 ? void 0 : (_a = imageContext.previewedImgPropsRef.value).onDblclick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
167
178
  const originalImageSizeScale = getOrignalImageSizeScale();
168
179
  scale = scale === originalImageSizeScale ? 1 : originalImageSizeScale;
169
180
  derivePreviewStyle();
@@ -246,13 +257,27 @@ export default defineComponent({
246
257
  if (!preview)
247
258
  return;
248
259
  const { style } = preview;
260
+ const controlledStyle = normalizeStyle(imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef.value.style);
261
+ let controlledStyleString = '';
262
+ if (typeof controlledStyle === 'string') {
263
+ controlledStyleString = controlledStyle + ';';
264
+ }
265
+ else {
266
+ for (const key in controlledStyle) {
267
+ controlledStyleString += `${kebabCase(key)}: ${controlledStyle[key]};`;
268
+ }
269
+ }
249
270
  const transformStyle = `transform-origin: center; transform: translateX(${offsetX}px) translateY(${offsetY}px) rotate(${rotate}deg) scale(${scale});`;
250
271
  if (dragging) {
251
- style.cssText = 'cursor: grabbing; transition: none;' + transformStyle;
272
+ style.cssText =
273
+ controlledStyleString +
274
+ 'cursor: grabbing; transition: none;' +
275
+ transformStyle;
252
276
  }
253
277
  else {
254
278
  style.cssText =
255
- 'cursor: grab;' +
279
+ controlledStyleString +
280
+ 'cursor: grab;' +
256
281
  transformStyle +
257
282
  (transition ? '' : 'transition: none;');
258
283
  }
@@ -309,7 +334,7 @@ export default defineComponent({
309
334
  ? useThemeClass('image-preview', undefined, cssVarsRef, props)
310
335
  : undefined;
311
336
  return Object.assign({ previewRef,
312
- previewWrapperRef, previewSrc: previewSrcRef, show: showRef, appear: useIsMounted(), displayed: displayedRef, handleWheel(e) {
337
+ previewWrapperRef, previewSrc: previewSrcRef, show: showRef, appear: useIsMounted(), displayed: displayedRef, previewedImgProps: imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef, handleWheel(e) {
313
338
  e.preventDefault();
314
339
  },
315
340
  handlePreviewMousedown,
@@ -319,6 +344,8 @@ export default defineComponent({
319
344
  rotate = 0;
320
345
  displayedRef.value = false;
321
346
  }, handleDragStart: (e) => {
347
+ var _a, _b;
348
+ (_b = imageContext === null || imageContext === void 0 ? void 0 : (_a = imageContext.previewedImgPropsRef.value).onDragstart) === null || _b === void 0 ? void 0 : _b.call(_a, e);
322
349
  e.preventDefault();
323
350
  }, zoomIn,
324
351
  zoomOut,
@@ -378,8 +405,14 @@ export default defineComponent({
378
405
  // onEnter will be called twice, I don't know why
379
406
  // Maybe it is a bug of vue
380
407
  onEnter: this.syncTransformOrigin, onBeforeLeave: this.syncTransformOrigin }, {
381
- default: () => withDirectives(h("div", { class: `${clsPrefix}-image-preview-wrapper`, ref: "previewWrapperRef" },
382
- h("img", { draggable: false, onMousedown: this.handlePreviewMousedown, onDblclick: this.handlePreviewDblclick, class: `${clsPrefix}-image-preview`, key: this.previewSrc, src: this.previewSrc, ref: "previewRef", onDragstart: this.handleDragStart })), [[vShow, this.show]])
408
+ default: () => {
409
+ const { previewedImgProps = {} } = this;
410
+ return withDirectives(h("div", { class: `${clsPrefix}-image-preview-wrapper`, ref: "previewWrapperRef" },
411
+ h("img", Object.assign({}, previewedImgProps, { draggable: false, onMousedown: this.handlePreviewMousedown, onDblclick: this.handlePreviewDblclick, class: [
412
+ `${clsPrefix}-image-preview`,
413
+ previewedImgProps.class
414
+ ], key: this.previewSrc, src: this.previewSrc, ref: "previewRef", onDragstart: this.handleDragStart }))), [[vShow, this.show]]);
415
+ }
383
416
  })), [[zindexable, { enabled: this.show }]]);
384
417
  }
385
418
  })));
@@ -1,3 +1,4 @@
1
+ import { ImgHTMLAttributes, Ref } from 'vue';
1
2
  export interface MoveStrategy {
2
3
  moveVerticalDirection: 'verticalTop' | 'verticalBottom';
3
4
  moveHorizontalDirection: 'horizontalLeft' | 'horizontalRight';
@@ -98,3 +99,7 @@ export declare const imagePreviewSharedProps: {
98
99
  }>;
99
100
  }>>>;
100
101
  };
102
+ export interface ImageContext {
103
+ previewedImgPropsRef: Ref<ImgHTMLAttributes>;
104
+ }
105
+ export declare const imageContextKey: import("vue").InjectionKey<ImageContext>;
@@ -1,2 +1,4 @@
1
1
  import { useTheme } from '../../_mixins';
2
+ import { createInjectionKey } from '../../_utils';
2
3
  export const imagePreviewSharedProps = Object.assign(Object.assign({}, useTheme.props), { showToolbar: { type: Boolean, default: true }, showToolbarTooltip: Boolean });
4
+ export const imageContextKey = createInjectionKey('n-image');
@@ -1,12 +1,12 @@
1
1
  import { c, cB, cNotM } from '../../../_utils/cssr';
2
2
  import { fadeInTransition } from '../../../_styles/transitions/fade-in.cssr';
3
- import { fadeInScaleUpTransition } from '../../../_styles/transitions/fade-in-scale-up.cssr'; // vars:
3
+ import { fadeInScaleUpTransition } from '../../../_styles/transitions/fade-in-scale-up.cssr';
4
+ // vars:
4
5
  // --n-toolbar-icon-color
5
6
  // --n-toolbar-color
6
7
  // --n-toolbar-border-radius
7
8
  // --n-toolbar-box-shadow
8
9
  // --n-bezier
9
-
10
10
  export default c([c('body >', [cB('image-container', 'position: fixed;')]), cB('image-preview-container', `
11
11
  position: fixed;
12
12
  left: 0;
@@ -74,6 +74,7 @@ export declare const inputProps: {
74
74
  onClick: PropType<MaybeArray<(e: MouseEvent) => void>>;
75
75
  onChange: PropType<OnUpdateValue>;
76
76
  onClear: PropType<MaybeArray<(e: MouseEvent) => void>>;
77
+ countGraphemes: PropType<(value: string) => number>;
77
78
  status: PropType<FormValidationStatus>;
78
79
  'onUpdate:value': PropType<MaybeArray<OnUpdateValue>>;
79
80
  onUpdateValue: PropType<MaybeArray<OnUpdateValue>>;
@@ -350,6 +351,7 @@ declare const _default: import("vue").DefineComponent<{
350
351
  onClick: PropType<MaybeArray<(e: MouseEvent) => void>>;
351
352
  onChange: PropType<OnUpdateValue>;
352
353
  onClear: PropType<MaybeArray<(e: MouseEvent) => void>>;
354
+ countGraphemes: PropType<(value: string) => number>;
353
355
  status: PropType<FormValidationStatus>;
354
356
  'onUpdate:value': PropType<MaybeArray<OnUpdateValue>>;
355
357
  onUpdateValue: PropType<MaybeArray<OnUpdateValue>>;
@@ -917,6 +919,7 @@ declare const _default: import("vue").DefineComponent<{
917
919
  onClick: PropType<MaybeArray<(e: MouseEvent) => void>>;
918
920
  onChange: PropType<OnUpdateValue>;
919
921
  onClear: PropType<MaybeArray<(e: MouseEvent) => void>>;
922
+ countGraphemes: PropType<(value: string) => number>;
920
923
  status: PropType<FormValidationStatus>;
921
924
  'onUpdate:value': PropType<MaybeArray<OnUpdateValue>>;
922
925
  onUpdateValue: PropType<MaybeArray<OnUpdateValue>>;
@@ -44,7 +44,7 @@ export const inputProps = Object.assign(Object.assign({}, useTheme.props), { bor
44
44
  }, showCount: Boolean, loading: {
45
45
  type: Boolean,
46
46
  default: undefined
47
- }, allowInput: Function, renderCount: Function, onMousedown: Function, onKeydown: Function, onKeyup: Function, onInput: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array], onClick: [Function, Array], onChange: [Function, Array], onClear: [Function, Array], status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array],
47
+ }, allowInput: Function, renderCount: Function, onMousedown: Function, onKeydown: Function, onKeyup: Function, onInput: [Function, Array], onFocus: [Function, Array], onBlur: [Function, Array], onClick: [Function, Array], onChange: [Function, Array], onClear: [Function, Array], countGraphemes: Function, status: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array],
48
48
  /** private */
49
49
  textDecoration: [String, Array], attrSize: {
50
50
  type: Number,
@@ -355,6 +355,24 @@ export default defineComponent({
355
355
  }
356
356
  }
357
357
  function allowInput(value) {
358
+ const { countGraphemes, maxlength, minlength } = props;
359
+ if (countGraphemes) {
360
+ let graphemesCount;
361
+ if (maxlength !== undefined) {
362
+ if (graphemesCount === undefined) {
363
+ graphemesCount = countGraphemes(value);
364
+ }
365
+ if (graphemesCount > Number(maxlength))
366
+ return false;
367
+ }
368
+ if (minlength !== undefined) {
369
+ if (graphemesCount === undefined) {
370
+ graphemesCount = countGraphemes(value);
371
+ }
372
+ if (graphemesCount < Number(maxlength))
373
+ return false;
374
+ }
375
+ }
358
376
  const { allowInput } = props;
359
377
  if (typeof allowInput === 'function') {
360
378
  return allowInput(value);
@@ -663,7 +681,8 @@ export default defineComponent({
663
681
  provide(inputInjectionKey, {
664
682
  mergedValueRef,
665
683
  maxlengthRef,
666
- mergedClsPrefixRef
684
+ mergedClsPrefixRef,
685
+ countGraphemesRef: toRef(props, 'countGraphemes')
667
686
  });
668
687
  const exposedProps = {
669
688
  wrapperElRef,
@@ -777,7 +796,7 @@ export default defineComponent({
777
796
  },
778
797
  render() {
779
798
  var _a, _b;
780
- const { mergedClsPrefix, mergedStatus, themeClass, type, onRender } = this;
799
+ const { mergedClsPrefix, mergedStatus, themeClass, type, countGraphemes, onRender } = this;
781
800
  const $slots = this.$slots;
782
801
  onRender === null || onRender === void 0 ? void 0 : onRender();
783
802
  return (h("div", { ref: "wrapperElRef", class: [
@@ -813,7 +832,7 @@ export default defineComponent({
813
832
  h("textarea", Object.assign({}, this.inputProps, { ref: "textareaElRef", class: [
814
833
  `${mergedClsPrefix}-input__textarea-el`,
815
834
  (_a = this.inputProps) === null || _a === void 0 ? void 0 : _a.class
816
- ], autofocus: this.autofocus, rows: Number(this.rows), placeholder: this.placeholder, value: this.mergedValue, disabled: this.mergedDisabled, maxlength: this.maxlength, minlength: this.minlength, readonly: this.readonly, tabindex: this.passivelyActivated && !this.activated
835
+ ], autofocus: this.autofocus, rows: Number(this.rows), placeholder: this.placeholder, value: this.mergedValue, disabled: this.mergedDisabled, maxlength: countGraphemes ? undefined : this.maxlength, minlength: countGraphemes ? undefined : this.minlength, readonly: this.readonly, tabindex: this.passivelyActivated && !this.activated
817
836
  ? -1
818
837
  : undefined, style: [
819
838
  this.textDecorationStyle[0],
@@ -839,7 +858,7 @@ export default defineComponent({
839
858
  ], style: [
840
859
  this.textDecorationStyle[0],
841
860
  (_b = this.inputProps) === null || _b === void 0 ? void 0 : _b.style
842
- ], tabindex: this.passivelyActivated && !this.activated ? -1 : undefined, placeholder: this.mergedPlaceholder[0], disabled: this.mergedDisabled, maxlength: this.maxlength, minlength: this.minlength, value: Array.isArray(this.mergedValue)
861
+ ], tabindex: this.passivelyActivated && !this.activated ? -1 : undefined, placeholder: this.mergedPlaceholder[0], disabled: this.mergedDisabled, maxlength: countGraphemes ? undefined : this.maxlength, minlength: countGraphemes ? undefined : this.minlength, value: Array.isArray(this.mergedValue)
843
862
  ? this.mergedValue[0]
844
863
  : this.mergedValue, readonly: this.readonly, autofocus: this.autofocus, size: this.attrSize, onBlur: this.handleInputBlur, onFocus: (e) => this.handleInputFocus(e, 0), onInput: (e) => this.handleInput(e, 0), onChange: (e) => this.handleChange(e, 0) })),
845
864
  this.showPlaceholder1 ? (h("div", { class: `${mergedClsPrefix}-input__placeholder` },
@@ -876,7 +895,7 @@ export default defineComponent({
876
895
  this.pair ? (h("span", { class: `${mergedClsPrefix}-input__separator` }, resolveSlot($slots.separator, () => [this.separator]))) : null,
877
896
  this.pair ? (h("div", { class: `${mergedClsPrefix}-input-wrapper` },
878
897
  h("div", { class: `${mergedClsPrefix}-input__input` },
879
- h("input", { ref: "inputEl2Ref", type: this.type, class: `${mergedClsPrefix}-input__input-el`, tabindex: this.passivelyActivated && !this.activated ? -1 : undefined, placeholder: this.mergedPlaceholder[1], disabled: this.mergedDisabled, maxlength: this.maxlength, minlength: this.minlength, value: Array.isArray(this.mergedValue)
898
+ h("input", { ref: "inputEl2Ref", type: this.type, class: `${mergedClsPrefix}-input__input-el`, tabindex: this.passivelyActivated && !this.activated ? -1 : undefined, placeholder: this.mergedPlaceholder[1], disabled: this.mergedDisabled, maxlength: countGraphemes ? undefined : this.maxlength, minlength: countGraphemes ? undefined : this.minlength, value: Array.isArray(this.mergedValue)
880
899
  ? this.mergedValue[1]
881
900
  : undefined, readonly: this.readonly, style: this.textDecorationStyle[1], onBlur: this.handleInputBlur, onFocus: (e) => this.handleInputFocus(e, 1), onInput: (e) => this.handleInput(e, 1), onChange: (e) => this.handleChange(e, 1) }),
882
901
  this.showPlaceholder2 ? (h("div", { class: `${mergedClsPrefix}-input__placeholder` },
@@ -5,14 +5,14 @@ import { len } from './utils';
5
5
  export default defineComponent({
6
6
  name: 'InputWordCount',
7
7
  setup(_, { slots }) {
8
- const { mergedValueRef, maxlengthRef, mergedClsPrefixRef } =
8
+ const { mergedValueRef, maxlengthRef, mergedClsPrefixRef, countGraphemesRef } =
9
9
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
10
  inject(inputInjectionKey);
11
11
  const wordCountRef = computed(() => {
12
12
  const { value: mergedValue } = mergedValueRef;
13
13
  if (mergedValue === null || Array.isArray(mergedValue))
14
14
  return 0;
15
- return len(mergedValue);
15
+ return (countGraphemesRef.value || len)(mergedValue);
16
16
  });
17
17
  return () => {
18
18
  const { value: maxlength } = maxlengthRef;
@@ -16,6 +16,7 @@ export interface InputWrappedRef {
16
16
  }
17
17
  export declare type InputInst = UnwrapRef<InputWrappedRef>;
18
18
  export declare const inputInjectionKey: import("vue").InjectionKey<{
19
+ countGraphemesRef: Ref<((input: string) => number) | undefined>;
19
20
  mergedValueRef: Ref<string | [string, string] | null>;
20
21
  maxlengthRef: Ref<number | undefined>;
21
22
  mergedClsPrefixRef: Ref<string>;
@@ -1,4 +1,5 @@
1
- import { cB, cE } from '../../../_utils/cssr'; // vars:
1
+ import { cB, cE } from '../../../_utils/cssr';
2
+ // vars:
2
3
  // --n-bezier
3
4
  // --n-group-label-color
4
5
  // --n-border-radius
@@ -6,7 +7,6 @@ import { cB, cE } from '../../../_utils/cssr'; // vars:
6
7
  // --n-font-size
7
8
  // --n-height
8
9
  // --n-group-label-border
9
-
10
10
  export default cB('input-group-label', `
11
11
  position: relative;
12
12
  user-select: none;