naive-ui 2.21.2 → 2.22.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 (348) hide show
  1. package/es/_internal/close/src/styles/index.cssr.js +6 -5
  2. package/es/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
  3. package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
  4. package/es/_internal/selection/src/Selection.js +11 -9
  5. package/es/_internal/selection/src/styles/index.cssr.js +6 -2
  6. package/es/alert/src/Alert.d.ts +20 -20
  7. package/es/alert/src/Alert.js +22 -22
  8. package/es/alert/src/styles/index.cssr.js +45 -45
  9. package/es/anchor/src/AnchorAdapter.js +12 -12
  10. package/es/anchor/src/styles/index.cssr.js +41 -41
  11. package/es/avatar/src/Avatar.d.ts +5 -3
  12. package/es/avatar/src/Avatar.js +7 -5
  13. package/es/avatar/src/styles/index.cssr.js +3 -5
  14. package/es/button/src/Button.d.ts +60 -60
  15. package/es/button/src/Button.js +107 -106
  16. package/es/button/src/styles/button.cssr.js +83 -80
  17. package/es/button/styles/dark.js +3 -3
  18. package/es/button/styles/light.d.ts +3 -3
  19. package/es/button/styles/light.js +1 -1
  20. package/es/calendar/src/Calendar.d.ts +37 -30
  21. package/es/calendar/styles/light.d.ts +3 -3
  22. package/es/cascader/src/Cascader.d.ts +135 -0
  23. package/es/cascader/src/Cascader.js +2 -4
  24. package/es/cascader/src/CascaderMenu.d.ts +345 -0
  25. package/es/cascader/src/CascaderMenu.js +6 -5
  26. package/es/cascader/src/CascaderOption.d.ts +18 -0
  27. package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
  28. package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
  29. package/es/cascader/styles/dark.js +3 -1
  30. package/es/cascader/styles/light.d.ts +13 -0
  31. package/es/cascader/styles/light.js +3 -1
  32. package/es/color-picker/src/ColorInputUnit.d.ts +3 -3
  33. package/es/color-picker/src/ColorPicker.d.ts +27 -27
  34. package/es/color-picker/styles/light.d.ts +3 -3
  35. package/es/config-provider/src/ConfigProvider.d.ts +21 -0
  36. package/es/data-table/src/DataTable.d.ts +30 -30
  37. package/es/data-table/src/DataTable.js +7 -14
  38. package/es/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
  39. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
  40. package/es/data-table/src/MainTable.js +2 -3
  41. package/es/data-table/src/TableParts/Body.d.ts +18 -7
  42. package/es/data-table/src/TableParts/Body.js +80 -28
  43. package/es/data-table/src/TableParts/Cell.d.ts +6 -6
  44. package/es/data-table/src/TableParts/Header.d.ts +3 -3
  45. package/es/data-table/src/TableParts/Header.js +1 -1
  46. package/es/data-table/src/interface.d.ts +4 -1
  47. package/es/data-table/src/styles/index.cssr.js +9 -12
  48. package/es/data-table/src/use-check.js +6 -2
  49. package/es/data-table/src/use-scroll.d.ts +2 -0
  50. package/es/data-table/src/use-scroll.js +34 -4
  51. package/es/data-table/src/use-table-data.js +4 -1
  52. package/es/data-table/styles/_common.js +1 -1
  53. package/es/data-table/styles/light.d.ts +3 -3
  54. package/es/date-picker/src/DatePicker.d.ts +94 -69
  55. package/es/date-picker/src/DatePicker.js +47 -20
  56. package/es/date-picker/src/config.d.ts +1 -9
  57. package/es/date-picker/src/config.js +0 -8
  58. package/es/date-picker/src/interface.d.ts +2 -1
  59. package/es/date-picker/src/panel/date.d.ts +23 -10
  60. package/es/date-picker/src/panel/date.js +2 -2
  61. package/es/date-picker/src/panel/daterange.d.ts +21 -9
  62. package/es/date-picker/src/panel/daterange.js +2 -2
  63. package/es/date-picker/src/panel/datetime.d.ts +23 -16
  64. package/es/date-picker/src/panel/datetime.js +2 -2
  65. package/es/date-picker/src/panel/datetimerange.d.ts +21 -9
  66. package/es/date-picker/src/panel/datetimerange.js +2 -2
  67. package/es/date-picker/src/panel/month.d.ts +27 -20
  68. package/es/date-picker/src/panel/month.js +23 -12
  69. package/es/date-picker/src/panel/use-calendar.d.ts +25 -43
  70. package/es/date-picker/src/panel/use-calendar.js +35 -18
  71. package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
  72. package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
  73. package/es/date-picker/src/panel/use-panel-common.d.ts +21 -36
  74. package/es/date-picker/src/panel/use-panel-common.js +2 -2
  75. package/es/date-picker/src/utils.d.ts +19 -3
  76. package/es/date-picker/src/utils.js +40 -5
  77. package/es/date-picker/styles/_common.d.ts +2 -0
  78. package/es/date-picker/styles/_common.js +3 -1
  79. package/es/date-picker/styles/light.d.ts +10 -6
  80. package/es/dialog/src/Dialog.d.ts +21 -21
  81. package/es/dialog/src/styles/index.cssr.js +1 -0
  82. package/es/dialog/styles/light.d.ts +3 -3
  83. package/es/dynamic-input/src/DynamicInput.d.ts +30 -30
  84. package/es/dynamic-input/src/InputPreset.d.ts +3 -3
  85. package/es/dynamic-input/src/PairPreset.d.ts +3 -3
  86. package/es/dynamic-input/styles/light.d.ts +3 -3
  87. package/es/dynamic-tags/src/DynamicTags.d.ts +30 -30
  88. package/es/dynamic-tags/styles/light.d.ts +3 -3
  89. package/es/element/index.d.ts +1 -0
  90. package/es/element/index.js +1 -0
  91. package/es/form/src/interface.d.ts +5 -4
  92. package/es/image/src/Image.d.ts +25 -16
  93. package/es/image/src/Image.js +35 -11
  94. package/es/image/src/ImageGroup.js +2 -2
  95. package/es/image/src/styles/index.cssr.js +4 -3
  96. package/es/input/src/Input.js +2 -0
  97. package/es/input/src/styles/input.cssr.js +2 -1
  98. package/es/input-number/src/InputNumber.d.ts +30 -30
  99. package/es/input-number/src/InputNumber.js +10 -5
  100. package/es/input-number/src/utils.d.ts +1 -0
  101. package/es/input-number/src/utils.js +4 -0
  102. package/es/input-number/styles/light.d.ts +3 -3
  103. package/es/locales/common/deDE.js +8 -0
  104. package/es/locales/common/enUS.d.ts +7 -0
  105. package/es/locales/common/enUS.js +8 -1
  106. package/es/locales/common/frFR.d.ts +3 -0
  107. package/es/locales/common/frFR.js +101 -0
  108. package/es/locales/common/idID.d.ts +2 -93
  109. package/es/locales/common/idID.js +8 -0
  110. package/es/locales/common/jaJP.js +8 -0
  111. package/es/locales/common/nbNO.js +8 -0
  112. package/es/locales/common/ruRU.js +8 -0
  113. package/es/locales/common/ukUA.js +8 -0
  114. package/es/locales/common/zhCN.js +7 -0
  115. package/es/locales/common/zhTW.d.ts +3 -0
  116. package/es/locales/common/zhTW.js +100 -0
  117. package/es/locales/date/frFR.d.ts +3 -0
  118. package/es/locales/date/frFR.js +6 -0
  119. package/es/locales/date/idID.d.ts +1 -6
  120. package/es/locales/date/zhTW.d.ts +3 -0
  121. package/es/locales/date/zhTW.js +6 -0
  122. package/es/locales/index.d.ts +4 -0
  123. package/es/locales/index.js +4 -0
  124. package/es/modal/src/BodyWrapper.d.ts +6 -6
  125. package/es/modal/src/Modal.d.ts +36 -36
  126. package/es/modal/styles/light.d.ts +3 -3
  127. package/es/page-header/src/PageHeader.js +3 -3
  128. package/es/page-header/src/styles/index.cssr.js +2 -4
  129. package/es/popconfirm/src/Popconfirm.d.ts +30 -30
  130. package/es/popconfirm/styles/light.d.ts +3 -3
  131. package/es/popover/src/Popover.js +4 -1
  132. package/es/popover/src/PopoverBody.js +3 -3
  133. package/es/popselect/src/Popselect.d.ts +2 -11
  134. package/es/popselect/src/Popselect.js +2 -2
  135. package/es/popselect/src/PopselectPanel.d.ts +3 -11
  136. package/es/popselect/src/PopselectPanel.js +17 -11
  137. package/es/radio/src/Radio.js +3 -3
  138. package/es/radio/src/RadioButton.js +4 -5
  139. package/es/radio/src/styles/radio-group.cssr.js +8 -4
  140. package/es/radio/src/styles/radio.cssr.js +8 -4
  141. package/es/radio/src/use-radio.d.ts +0 -3
  142. package/es/radio/src/use-radio.js +1 -26
  143. package/es/switch/src/Switch.d.ts +16 -1
  144. package/es/switch/src/Switch.js +17 -4
  145. package/es/switch/src/styles/index.cssr.js +1 -1
  146. package/es/tabs/src/styles/index.cssr.js +1 -0
  147. package/es/tag/src/styles/index.cssr.js +1 -1
  148. package/es/theme-editor/src/ThemeEditor.js +9 -2
  149. package/es/time-picker/src/Panel.d.ts +3 -3
  150. package/es/time-picker/src/TimePicker.d.ts +30 -30
  151. package/es/time-picker/styles/light.d.ts +3 -3
  152. package/es/transfer/src/Transfer.d.ts +30 -30
  153. package/es/transfer/src/TransferFilter.d.ts +3 -3
  154. package/es/transfer/src/TransferList.d.ts +3 -3
  155. package/es/transfer/src/TransferListItem.d.ts +3 -3
  156. package/es/transfer/styles/light.d.ts +3 -3
  157. package/es/tree/src/Tree.d.ts +8 -4
  158. package/es/tree/src/Tree.js +32 -6
  159. package/es/tree-select/src/TreeSelect.d.ts +38 -1
  160. package/es/tree-select/src/TreeSelect.js +25 -10
  161. package/es/tree-select/src/styles/index.cssr.js +11 -2
  162. package/es/tree-select/styles/light.d.ts +6 -0
  163. package/es/tree-select/styles/light.js +5 -2
  164. package/es/upload/src/Upload.d.ts +41 -30
  165. package/es/upload/src/Upload.js +33 -23
  166. package/es/upload/src/UploadFile.d.ts +4 -4
  167. package/es/upload/src/UploadFileList.js +4 -2
  168. package/es/upload/src/UploadProgress.d.ts +3 -3
  169. package/es/upload/src/interface.d.ts +1 -0
  170. package/es/upload/src/styles/index.cssr.js +2 -3
  171. package/es/upload/styles/light.d.ts +3 -3
  172. package/es/version.d.ts +1 -1
  173. package/es/version.js +1 -1
  174. package/lib/_internal/close/src/styles/index.cssr.js +6 -5
  175. package/lib/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
  176. package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
  177. package/lib/_internal/selection/src/Selection.js +11 -9
  178. package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
  179. package/lib/alert/src/Alert.d.ts +20 -20
  180. package/lib/alert/src/Alert.js +22 -22
  181. package/lib/alert/src/styles/index.cssr.js +45 -45
  182. package/lib/anchor/src/AnchorAdapter.js +12 -12
  183. package/lib/anchor/src/styles/index.cssr.js +41 -41
  184. package/lib/avatar/src/Avatar.d.ts +5 -3
  185. package/lib/avatar/src/Avatar.js +7 -5
  186. package/lib/avatar/src/styles/index.cssr.js +3 -5
  187. package/lib/button/src/Button.d.ts +60 -60
  188. package/lib/button/src/Button.js +107 -106
  189. package/lib/button/src/styles/button.cssr.js +83 -80
  190. package/lib/button/styles/dark.js +3 -3
  191. package/lib/button/styles/light.d.ts +3 -3
  192. package/lib/button/styles/light.js +1 -1
  193. package/lib/calendar/src/Calendar.d.ts +37 -30
  194. package/lib/calendar/styles/light.d.ts +3 -3
  195. package/lib/cascader/src/Cascader.d.ts +135 -0
  196. package/lib/cascader/src/Cascader.js +2 -4
  197. package/lib/cascader/src/CascaderMenu.d.ts +345 -0
  198. package/lib/cascader/src/CascaderMenu.js +6 -5
  199. package/lib/cascader/src/CascaderOption.d.ts +18 -0
  200. package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
  201. package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
  202. package/lib/cascader/styles/dark.js +3 -1
  203. package/lib/cascader/styles/light.d.ts +13 -0
  204. package/lib/cascader/styles/light.js +3 -1
  205. package/lib/color-picker/src/ColorInputUnit.d.ts +3 -3
  206. package/lib/color-picker/src/ColorPicker.d.ts +27 -27
  207. package/lib/color-picker/styles/light.d.ts +3 -3
  208. package/lib/config-provider/src/ConfigProvider.d.ts +21 -0
  209. package/lib/data-table/src/DataTable.d.ts +30 -30
  210. package/lib/data-table/src/DataTable.js +6 -13
  211. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
  212. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
  213. package/lib/data-table/src/MainTable.js +1 -2
  214. package/lib/data-table/src/TableParts/Body.d.ts +18 -7
  215. package/lib/data-table/src/TableParts/Body.js +78 -26
  216. package/lib/data-table/src/TableParts/Cell.d.ts +6 -6
  217. package/lib/data-table/src/TableParts/Header.d.ts +3 -3
  218. package/lib/data-table/src/TableParts/Header.js +1 -1
  219. package/lib/data-table/src/interface.d.ts +4 -1
  220. package/lib/data-table/src/styles/index.cssr.js +9 -12
  221. package/lib/data-table/src/use-check.js +6 -2
  222. package/lib/data-table/src/use-scroll.d.ts +2 -0
  223. package/lib/data-table/src/use-scroll.js +34 -4
  224. package/lib/data-table/src/use-table-data.js +4 -1
  225. package/lib/data-table/styles/_common.js +1 -1
  226. package/lib/data-table/styles/light.d.ts +3 -3
  227. package/lib/date-picker/src/DatePicker.d.ts +94 -69
  228. package/lib/date-picker/src/DatePicker.js +46 -19
  229. package/lib/date-picker/src/config.d.ts +1 -9
  230. package/lib/date-picker/src/config.js +1 -9
  231. package/lib/date-picker/src/interface.d.ts +2 -1
  232. package/lib/date-picker/src/panel/date.d.ts +23 -10
  233. package/lib/date-picker/src/panel/date.js +1 -1
  234. package/lib/date-picker/src/panel/daterange.d.ts +21 -9
  235. package/lib/date-picker/src/panel/daterange.js +1 -1
  236. package/lib/date-picker/src/panel/datetime.d.ts +23 -16
  237. package/lib/date-picker/src/panel/datetime.js +1 -1
  238. package/lib/date-picker/src/panel/datetimerange.d.ts +21 -9
  239. package/lib/date-picker/src/panel/datetimerange.js +2 -2
  240. package/lib/date-picker/src/panel/month.d.ts +27 -20
  241. package/lib/date-picker/src/panel/month.js +23 -12
  242. package/lib/date-picker/src/panel/use-calendar.d.ts +25 -43
  243. package/lib/date-picker/src/panel/use-calendar.js +34 -16
  244. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
  245. package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
  246. package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -36
  247. package/lib/date-picker/src/panel/use-panel-common.js +3 -2
  248. package/lib/date-picker/src/utils.d.ts +19 -3
  249. package/lib/date-picker/src/utils.js +41 -4
  250. package/lib/date-picker/styles/_common.d.ts +2 -0
  251. package/lib/date-picker/styles/_common.js +3 -1
  252. package/lib/date-picker/styles/light.d.ts +10 -6
  253. package/lib/dialog/src/Dialog.d.ts +21 -21
  254. package/lib/dialog/src/styles/index.cssr.js +1 -0
  255. package/lib/dialog/styles/light.d.ts +3 -3
  256. package/lib/dynamic-input/src/DynamicInput.d.ts +30 -30
  257. package/lib/dynamic-input/src/InputPreset.d.ts +3 -3
  258. package/lib/dynamic-input/src/PairPreset.d.ts +3 -3
  259. package/lib/dynamic-input/styles/light.d.ts +3 -3
  260. package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -30
  261. package/lib/dynamic-tags/styles/light.d.ts +3 -3
  262. package/lib/element/index.d.ts +1 -0
  263. package/lib/element/index.js +3 -1
  264. package/lib/form/src/interface.d.ts +5 -4
  265. package/lib/image/src/Image.d.ts +25 -16
  266. package/lib/image/src/Image.js +34 -10
  267. package/lib/image/src/ImageGroup.js +2 -2
  268. package/lib/image/src/styles/index.cssr.js +3 -2
  269. package/lib/input/src/Input.js +2 -0
  270. package/lib/input/src/styles/input.cssr.js +2 -1
  271. package/lib/input-number/src/InputNumber.d.ts +30 -30
  272. package/lib/input-number/src/InputNumber.js +9 -4
  273. package/lib/input-number/src/utils.d.ts +1 -0
  274. package/lib/input-number/src/utils.js +6 -1
  275. package/lib/input-number/styles/light.d.ts +3 -3
  276. package/lib/locales/common/deDE.js +8 -0
  277. package/lib/locales/common/enUS.d.ts +7 -0
  278. package/lib/locales/common/enUS.js +8 -1
  279. package/lib/locales/common/frFR.d.ts +3 -0
  280. package/lib/locales/common/frFR.js +103 -0
  281. package/lib/locales/common/idID.d.ts +2 -93
  282. package/lib/locales/common/idID.js +8 -0
  283. package/lib/locales/common/jaJP.js +8 -0
  284. package/lib/locales/common/nbNO.js +8 -0
  285. package/lib/locales/common/ruRU.js +8 -0
  286. package/lib/locales/common/ukUA.js +8 -0
  287. package/lib/locales/common/zhCN.js +7 -0
  288. package/lib/locales/common/zhTW.d.ts +3 -0
  289. package/lib/locales/common/zhTW.js +102 -0
  290. package/lib/locales/date/frFR.d.ts +3 -0
  291. package/lib/locales/date/frFR.js +11 -0
  292. package/lib/locales/date/idID.d.ts +1 -6
  293. package/lib/locales/date/zhTW.d.ts +3 -0
  294. package/lib/locales/date/zhTW.js +11 -0
  295. package/lib/locales/index.d.ts +4 -0
  296. package/lib/locales/index.js +9 -1
  297. package/lib/modal/src/BodyWrapper.d.ts +6 -6
  298. package/lib/modal/src/Modal.d.ts +36 -36
  299. package/lib/modal/styles/light.d.ts +3 -3
  300. package/lib/page-header/src/PageHeader.js +3 -3
  301. package/lib/page-header/src/styles/index.cssr.js +2 -4
  302. package/lib/popconfirm/src/Popconfirm.d.ts +30 -30
  303. package/lib/popconfirm/styles/light.d.ts +3 -3
  304. package/lib/popover/src/Popover.js +4 -1
  305. package/lib/popover/src/PopoverBody.js +3 -3
  306. package/lib/popselect/src/Popselect.d.ts +2 -11
  307. package/lib/popselect/src/Popselect.js +2 -2
  308. package/lib/popselect/src/PopselectPanel.d.ts +3 -11
  309. package/lib/popselect/src/PopselectPanel.js +16 -10
  310. package/lib/radio/src/Radio.js +3 -3
  311. package/lib/radio/src/RadioButton.js +4 -5
  312. package/lib/radio/src/styles/radio-group.cssr.js +8 -4
  313. package/lib/radio/src/styles/radio.cssr.js +8 -4
  314. package/lib/radio/src/use-radio.d.ts +0 -3
  315. package/lib/radio/src/use-radio.js +1 -26
  316. package/lib/switch/src/Switch.d.ts +16 -1
  317. package/lib/switch/src/Switch.js +17 -4
  318. package/lib/switch/src/styles/index.cssr.js +1 -1
  319. package/lib/tabs/src/styles/index.cssr.js +1 -0
  320. package/lib/tag/src/styles/index.cssr.js +1 -1
  321. package/lib/theme-editor/src/ThemeEditor.js +9 -2
  322. package/lib/time-picker/src/Panel.d.ts +3 -3
  323. package/lib/time-picker/src/TimePicker.d.ts +30 -30
  324. package/lib/time-picker/styles/light.d.ts +3 -3
  325. package/lib/transfer/src/Transfer.d.ts +30 -30
  326. package/lib/transfer/src/TransferFilter.d.ts +3 -3
  327. package/lib/transfer/src/TransferList.d.ts +3 -3
  328. package/lib/transfer/src/TransferListItem.d.ts +3 -3
  329. package/lib/transfer/styles/light.d.ts +3 -3
  330. package/lib/tree/src/Tree.d.ts +8 -4
  331. package/lib/tree/src/Tree.js +32 -6
  332. package/lib/tree-select/src/TreeSelect.d.ts +38 -1
  333. package/lib/tree-select/src/TreeSelect.js +24 -9
  334. package/lib/tree-select/src/styles/index.cssr.js +11 -2
  335. package/lib/tree-select/styles/light.d.ts +6 -0
  336. package/lib/tree-select/styles/light.js +5 -2
  337. package/lib/upload/src/Upload.d.ts +41 -30
  338. package/lib/upload/src/Upload.js +33 -23
  339. package/lib/upload/src/UploadFile.d.ts +4 -4
  340. package/lib/upload/src/UploadFileList.js +4 -2
  341. package/lib/upload/src/UploadProgress.d.ts +3 -3
  342. package/lib/upload/src/interface.d.ts +1 -0
  343. package/lib/upload/src/styles/index.cssr.js +2 -3
  344. package/lib/upload/styles/light.d.ts +3 -3
  345. package/lib/version.d.ts +1 -1
  346. package/lib/version.js +1 -1
  347. package/package.json +5 -4
  348. package/web-types.json +99 -7
@@ -8,6 +8,7 @@ export declare type FormItemRuleValidatorParams = Parameters<NonNullable<RuleIte
8
8
  export declare type FormItemRuleValidator = (...args: FormItemRuleValidatorParams) => boolean | Error | Error[] | Promise<void> | undefined;
9
9
  export declare type FormItemRuleAsyncValidator = (...args: FormItemRuleValidatorParams) => Promise<void> | undefined;
10
10
  export declare type FormItemRule = Omit<RuleItem, 'validator' | 'asyncValidator'> & {
11
+ key?: string;
11
12
  trigger?: ValidationTrigger | string | Array<ValidationTrigger | string>;
12
13
  validator?: FormItemRuleValidator;
13
14
  asyncValidator?: FormItemRuleAsyncValidator;
@@ -15,10 +16,10 @@ export declare type FormItemRule = Omit<RuleItem, 'validator' | 'asyncValidator'
15
16
  export interface FormItemValidateOptions {
16
17
  trigger?: ValidationTrigger | string;
17
18
  callback?: ValidateCallback;
18
- shouldRuleBeApplied?: ApplyRule;
19
+ shouldRuleBeApplied?: ShouldRuleBeApplied;
19
20
  options?: ValidateOption;
20
21
  }
21
- export declare type FormItemInternalValidate = (trigger: ValidationTrigger | string | null | undefined, shouldRuleBeApplied?: ApplyRule, options?: ValidateOption) => Promise<{
22
+ export declare type FormItemInternalValidate = (trigger: ValidationTrigger | string | null | undefined, shouldRuleBeApplied?: ShouldRuleBeApplied, options?: ValidateOption) => Promise<{
22
23
  valid: boolean;
23
24
  errors?: ValidateError[];
24
25
  }>;
@@ -38,10 +39,10 @@ export declare type LabelAlign = 'left' | 'center' | 'right';
38
39
  export declare type LabelPlacement = 'left' | 'top';
39
40
  export declare type Size = 'small' | 'medium' | 'large';
40
41
  export declare type ValidationTrigger = 'input' | 'change' | 'blur' | 'focus';
41
- export declare type ApplyRule = (rule: FormItemRule) => boolean;
42
+ export declare type ShouldRuleBeApplied = (rule: FormItemRule) => boolean;
42
43
  export declare type ValidateCallback = (errors?: ValidateError[]) => void;
43
44
  export declare type FormValidateCallback = (errors?: ValidateError[][]) => void;
44
- export declare type FormValidate = ((callback?: FormValidateCallback) => void) & (() => Promise<void>);
45
+ export declare type FormValidate = (callback?: FormValidateCallback, shouldRuleBeApplied?: ShouldRuleBeApplied) => Promise<void>;
45
46
  export declare type FormValidationError = ValidateError[];
46
47
  export interface FormInst {
47
48
  validate: FormValidate;
@@ -1,53 +1,50 @@
1
- import { PropType } from 'vue';
1
+ import { PropType, ImgHTMLAttributes } from 'vue';
2
2
  import { ExtractPublicPropTypes } from '../../_utils';
3
- interface imgProps {
4
- alt?: string;
5
- crossorigin?: 'anonymous' | 'use-credentials' | '';
6
- decoding?: 'async' | 'auto' | 'sync';
7
- height?: number;
8
- sizes?: string;
9
- src?: string;
10
- srcset?: string;
11
- usemap?: string;
12
- width?: number;
13
- }
14
3
  export interface ImageInst {
15
4
  click: () => void;
16
5
  }
17
6
  declare const imageProps: {
18
7
  alt: StringConstructor;
19
8
  height: PropType<string | number>;
20
- imgProps: PropType<imgProps>;
9
+ imgProps: PropType<ImgHTMLAttributes>;
21
10
  objectFit: {
22
11
  type: PropType<"fill" | "none" | "contain" | "cover" | "scale-down">;
23
12
  default: string;
24
13
  };
25
14
  previewSrc: StringConstructor;
15
+ fallbackSrc: StringConstructor;
26
16
  width: PropType<string | number>;
27
17
  src: StringConstructor;
28
18
  showToolbar: {
29
19
  type: BooleanConstructor;
30
20
  default: boolean;
31
21
  };
22
+ previewDisabled: BooleanConstructor;
23
+ loadDescription: StringConstructor;
32
24
  onError: PropType<(e: Event) => void>;
25
+ onLoad: PropType<(e: Event) => void>;
33
26
  };
34
27
  export declare type ImageProps = ExtractPublicPropTypes<typeof imageProps>;
35
28
  declare const _default: import("vue").DefineComponent<{
36
29
  alt: StringConstructor;
37
30
  height: PropType<string | number>;
38
- imgProps: PropType<imgProps>;
31
+ imgProps: PropType<ImgHTMLAttributes>;
39
32
  objectFit: {
40
33
  type: PropType<"fill" | "none" | "contain" | "cover" | "scale-down">;
41
34
  default: string;
42
35
  };
43
36
  previewSrc: StringConstructor;
37
+ fallbackSrc: StringConstructor;
44
38
  width: PropType<string | number>;
45
39
  src: StringConstructor;
46
40
  showToolbar: {
47
41
  type: BooleanConstructor;
48
42
  default: boolean;
49
43
  };
44
+ previewDisabled: BooleanConstructor;
45
+ loadDescription: StringConstructor;
50
46
  onError: PropType<(e: Event) => void>;
47
+ onLoad: PropType<(e: Event) => void>;
51
48
  }, {
52
49
  click: () => void;
53
50
  mergedClsPrefix: import("vue").Ref<string> | import("vue").ComputedRef<string>;
@@ -58,30 +55,42 @@ declare const _default: import("vue").DefineComponent<{
58
55
  toggleShow: () => void;
59
56
  } | null>;
60
57
  imageRef: import("vue").Ref<HTMLImageElement | null>;
61
- imgProps: import("vue").Ref<imgProps | undefined>;
58
+ imgProps: import("vue").Ref<ImgHTMLAttributes | undefined>;
59
+ showError: import("vue").Ref<boolean>;
60
+ mergedOnError: (e: Event) => void;
61
+ mergedOnLoad: (e: Event) => void;
62
62
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
63
63
  alt?: unknown;
64
64
  height?: unknown;
65
65
  imgProps?: unknown;
66
66
  objectFit?: unknown;
67
67
  previewSrc?: unknown;
68
+ fallbackSrc?: unknown;
68
69
  width?: unknown;
69
70
  src?: unknown;
70
71
  showToolbar?: unknown;
72
+ previewDisabled?: unknown;
73
+ loadDescription?: unknown;
71
74
  onError?: unknown;
75
+ onLoad?: unknown;
72
76
  } & {
73
77
  objectFit: "fill" | "none" | "contain" | "cover" | "scale-down";
74
78
  showToolbar: boolean;
79
+ previewDisabled: boolean;
75
80
  } & {
76
81
  onError?: ((e: Event) => void) | undefined;
77
82
  height?: string | number | undefined;
78
83
  width?: string | number | undefined;
84
+ onLoad?: ((e: Event) => void) | undefined;
79
85
  alt?: string | undefined;
80
86
  src?: string | undefined;
87
+ fallbackSrc?: string | undefined;
81
88
  previewSrc?: string | undefined;
82
- imgProps?: imgProps | undefined;
89
+ imgProps?: ImgHTMLAttributes | undefined;
90
+ loadDescription?: string | undefined;
83
91
  }>, {
84
92
  objectFit: "fill" | "none" | "contain" | "cover" | "scale-down";
85
93
  showToolbar: boolean;
94
+ previewDisabled: boolean;
86
95
  }>;
87
96
  export default _default;
@@ -1,4 +1,4 @@
1
- import { defineComponent, h, inject, ref, toRef, mergeProps } from 'vue';
1
+ import { defineComponent, h, inject, ref, toRef, watchEffect } from 'vue';
2
2
  import NImagePreview from './ImagePreview';
3
3
  import { imageGroupInjectionKey } from './ImageGroup';
4
4
  import { useConfig } from '../../_mixins';
@@ -11,10 +11,14 @@ const imageProps = {
11
11
  default: 'fill'
12
12
  },
13
13
  previewSrc: String,
14
+ fallbackSrc: String,
14
15
  width: [String, Number],
15
16
  src: String,
16
17
  showToolbar: { type: Boolean, default: true },
17
- onError: Function
18
+ previewDisabled: Boolean,
19
+ loadDescription: String,
20
+ onError: Function,
21
+ onLoad: Function
18
22
  };
19
23
  export default defineComponent({
20
24
  name: 'Image',
@@ -22,12 +26,15 @@ export default defineComponent({
22
26
  inheritAttrs: false,
23
27
  setup(props) {
24
28
  const imageRef = ref(null);
29
+ const showErrorRef = ref(false);
25
30
  const imgPropsRef = toRef(props, 'imgProps');
26
31
  const previewInstRef = ref(null);
27
32
  const imageGroupHandle = inject(imageGroupInjectionKey, null);
28
33
  const { mergedClsPrefixRef } = imageGroupHandle || useConfig(props);
29
34
  const exposedMethods = {
30
35
  click: () => {
36
+ if (props.previewDisabled || showErrorRef.value)
37
+ return;
31
38
  const mergedPreviewSrc = props.previewSrc || props.src;
32
39
  if (imageGroupHandle) {
33
40
  imageGroupHandle.setPreviewSrc(mergedPreviewSrc);
@@ -43,17 +50,34 @@ export default defineComponent({
43
50
  previewInst.toggleShow();
44
51
  }
45
52
  };
53
+ watchEffect(() => {
54
+ var _a;
55
+ void props.src;
56
+ void ((_a = props.imgProps) === null || _a === void 0 ? void 0 : _a.src);
57
+ showErrorRef.value = false;
58
+ });
46
59
  return Object.assign({ mergedClsPrefix: mergedClsPrefixRef, groupId: imageGroupHandle === null || imageGroupHandle === void 0 ? void 0 : imageGroupHandle.groupId, previewInstRef,
47
- imageRef, imgProps: imgPropsRef }, exposedMethods);
60
+ imageRef, imgProps: imgPropsRef, showError: showErrorRef, mergedOnError: (e) => {
61
+ showErrorRef.value = true;
62
+ const { onError, imgProps: { onError: imgPropsOnError } = {} } = props;
63
+ onError === null || onError === void 0 ? void 0 : onError(e);
64
+ imgPropsOnError === null || imgPropsOnError === void 0 ? void 0 : imgPropsOnError(e);
65
+ }, mergedOnLoad: (e) => {
66
+ const { onLoad, imgProps: { onLoad: imgPropsOnLoad } = {} } = props;
67
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e);
68
+ imgPropsOnLoad === null || imgPropsOnLoad === void 0 ? void 0 : imgPropsOnLoad(e);
69
+ } }, exposedMethods);
48
70
  },
49
71
  render() {
50
- const { mergedClsPrefix, imgProps = {} } = this;
51
- const imgWrapperNode = h('div', mergeProps(this.$attrs, {
52
- role: 'none',
53
- class: `${mergedClsPrefix}-image`
54
- }), h("img", Object.assign({}, imgProps, { class: this.groupId, ref: "imageRef", width: this.width || imgProps.width, height: this.height || imgProps.height, src: this.src || imgProps.src, alt: this.alt || imgProps.alt, "aria-label": this.alt || imgProps.alt, onClick: this.click, onError: this.onError, style: { objectFit: this.objectFit }, "data-preview-src": this.previewSrc || this.src })));
55
- return this.groupId ? (imgWrapperNode) : (h(NImagePreview, { clsPrefix: mergedClsPrefix, ref: "previewInstRef", showToolbar: this.showToolbar }, {
56
- default: () => imgWrapperNode
57
- }));
72
+ const { mergedClsPrefix, imgProps = {}, $attrs } = this;
73
+ const imgNode = (h("img", Object.assign({}, imgProps, { class: [this.groupId, imgProps.class], ref: "imageRef", width: this.width || imgProps.width, height: this.height || imgProps.height, src: this.showError ? this.fallbackSrc : this.src || imgProps.src, alt: this.alt || imgProps.alt, "aria-label": this.alt || imgProps.alt, onClick: this.click, onError: this.mergedOnError, onLoad: this.mergedOnLoad, style: [imgProps.style || '', { objectFit: this.objectFit }], "data-error": this.showError, "data-preview-src": this.previewSrc || this.src })));
74
+ return (h("div", Object.assign({}, $attrs, { role: "none", class: [
75
+ $attrs.class,
76
+ `${mergedClsPrefix}-image`,
77
+ (this.previewDisabled || this.showError) &&
78
+ `${mergedClsPrefix}-image--preview-disabled`
79
+ ] }), this.groupId ? (imgNode) : (h(NImagePreview, { clsPrefix: mergedClsPrefix, ref: "previewInstRef", showToolbar: this.showToolbar }, {
80
+ default: () => imgNode
81
+ }))));
58
82
  }
59
83
  });
@@ -12,7 +12,7 @@ export default defineComponent({
12
12
  setup(props) {
13
13
  let currentSrc;
14
14
  const { mergedClsPrefixRef } = useConfig(props);
15
- const groupId = createId();
15
+ const groupId = `c${createId()}`;
16
16
  const vm = getCurrentInstance();
17
17
  const setPreviewSrc = (src) => {
18
18
  var _a;
@@ -24,7 +24,7 @@ export default defineComponent({
24
24
  return;
25
25
  const container = vm.proxy.$el.parentElement;
26
26
  // use dom api since we can't get the correct order before all children are rendered
27
- const imgs = container.getElementsByClassName(groupId);
27
+ const imgs = container.querySelectorAll(`.${groupId}:not([data-error=true])`);
28
28
  if (!imgs.length)
29
29
  return;
30
30
  const index = Array.from(imgs).findIndex((img) => img.dataset.previewSrc === currentSrc);
@@ -1,4 +1,4 @@
1
- import { c, cB } from '../../../_utils/cssr';
1
+ import { c, cB, cNotM } from '../../../_utils/cssr';
2
2
  import fadeInTransition from '../../../_styles/transitions/fade-in.cssr';
3
3
  import fadeInzoomInTransiton from '../../../_styles/transitions/fade-in-scale-up.cssr'; // vars:
4
4
  // --icon-color
@@ -54,9 +54,10 @@ export default c([c('body >', [cB('image-container', 'position: fixed;')]), cB('
54
54
  transition: transform .3s var(--bezier);
55
55
  `), cB('image', `
56
56
  display: inline-flex;
57
- cursor: pointer;
58
57
  max-height: 100%;
59
58
  max-width: 100%;
60
- `, [c('img', `
59
+ `, [cNotM('preview-disabled', `
60
+ cursor: pointer;
61
+ `), c('img', `
61
62
  border-radius: inherit;
62
63
  `)])]);
@@ -390,9 +390,11 @@ export default defineComponent({
390
390
  doClear(e);
391
391
  if (props.pair) {
392
392
  doUpdateValue(['', '']);
393
+ doChange(['', '']);
393
394
  }
394
395
  else {
395
396
  doUpdateValue('');
397
+ doChange('');
396
398
  }
397
399
  }
398
400
  function handleMouseDown(e) {
@@ -72,6 +72,7 @@ cE('input, textarea', `
72
72
  text-decoration-color: var(--text-decoration-color);
73
73
  color: var(--text-color);
74
74
  caret-color: var(--caret-color);
75
+ background-color: transparent;
75
76
  `, [c('&::placeholder', {
76
77
  color: '#0000'
77
78
  })]), cM('round', [cNotM('textarea', {
@@ -201,7 +202,7 @@ cM('pair', [cE('input-el, placeholder', {
201
202
  border: 'var(--border-focus)',
202
203
  boxShadow: 'var(--box-shadow-focus)'
203
204
  })]), c('&:hover', [cE('state-border', {
204
- border: 'var(--border-focus)'
205
+ border: 'var(--border-hover)'
205
206
  })])]), cE('border, state-border', `
206
207
  box-sizing: border-box;
207
208
  position: absolute;
@@ -68,9 +68,9 @@ declare const inputNumberProps: {
68
68
  fontSizeMedium: string;
69
69
  fontSizeLarge: string;
70
70
  opacityDisabled: string;
71
- colorOpacitySecondary: number;
72
- colorOpacitySecondaryHover: number;
73
- colorOpacitySecondaryPressed: number;
71
+ colorOpacitySecondary: string;
72
+ colorOpacitySecondaryHover: string;
73
+ colorOpacitySecondaryPressed: string;
74
74
  colorSecondary: string;
75
75
  colorSecondaryHover: string;
76
76
  colorSecondaryPressed: string;
@@ -336,9 +336,9 @@ declare const inputNumberProps: {
336
336
  fontSizeMedium: string;
337
337
  fontSizeLarge: string;
338
338
  opacityDisabled: string;
339
- colorOpacitySecondary: number;
340
- colorOpacitySecondaryHover: number;
341
- colorOpacitySecondaryPressed: number;
339
+ colorOpacitySecondary: string;
340
+ colorOpacitySecondaryHover: string;
341
+ colorOpacitySecondaryPressed: string;
342
342
  colorSecondary: string;
343
343
  colorSecondaryHover: string;
344
344
  colorSecondaryPressed: string;
@@ -604,9 +604,9 @@ declare const inputNumberProps: {
604
604
  fontSizeMedium: string;
605
605
  fontSizeLarge: string;
606
606
  opacityDisabled: string;
607
- colorOpacitySecondary: number;
608
- colorOpacitySecondaryHover: number;
609
- colorOpacitySecondaryPressed: number;
607
+ colorOpacitySecondary: string;
608
+ colorOpacitySecondaryHover: string;
609
+ colorOpacitySecondaryPressed: string;
610
610
  colorSecondary: string;
611
611
  colorSecondaryHover: string;
612
612
  colorSecondaryPressed: string;
@@ -924,9 +924,9 @@ declare const _default: import("vue").DefineComponent<{
924
924
  fontSizeMedium: string;
925
925
  fontSizeLarge: string;
926
926
  opacityDisabled: string;
927
- colorOpacitySecondary: number;
928
- colorOpacitySecondaryHover: number;
929
- colorOpacitySecondaryPressed: number;
927
+ colorOpacitySecondary: string;
928
+ colorOpacitySecondaryHover: string;
929
+ colorOpacitySecondaryPressed: string;
930
930
  colorSecondary: string;
931
931
  colorSecondaryHover: string;
932
932
  colorSecondaryPressed: string;
@@ -1192,9 +1192,9 @@ declare const _default: import("vue").DefineComponent<{
1192
1192
  fontSizeMedium: string;
1193
1193
  fontSizeLarge: string;
1194
1194
  opacityDisabled: string;
1195
- colorOpacitySecondary: number;
1196
- colorOpacitySecondaryHover: number;
1197
- colorOpacitySecondaryPressed: number;
1195
+ colorOpacitySecondary: string;
1196
+ colorOpacitySecondaryHover: string;
1197
+ colorOpacitySecondaryPressed: string;
1198
1198
  colorSecondary: string;
1199
1199
  colorSecondaryHover: string;
1200
1200
  colorSecondaryPressed: string;
@@ -1460,9 +1460,9 @@ declare const _default: import("vue").DefineComponent<{
1460
1460
  fontSizeMedium: string;
1461
1461
  fontSizeLarge: string;
1462
1462
  opacityDisabled: string;
1463
- colorOpacitySecondary: number;
1464
- colorOpacitySecondaryHover: number;
1465
- colorOpacitySecondaryPressed: number;
1463
+ colorOpacitySecondary: string;
1464
+ colorOpacitySecondaryHover: string;
1465
+ colorOpacitySecondaryPressed: string;
1466
1466
  colorSecondary: string;
1467
1467
  colorSecondaryHover: string;
1468
1468
  colorSecondaryPressed: string;
@@ -1870,9 +1870,9 @@ declare const _default: import("vue").DefineComponent<{
1870
1870
  fontSizeMedium: string;
1871
1871
  fontSizeLarge: string;
1872
1872
  opacityDisabled: string;
1873
- colorOpacitySecondary: number;
1874
- colorOpacitySecondaryHover: number;
1875
- colorOpacitySecondaryPressed: number;
1873
+ colorOpacitySecondary: string;
1874
+ colorOpacitySecondaryHover: string;
1875
+ colorOpacitySecondaryPressed: string;
1876
1876
  colorSecondary: string;
1877
1877
  colorSecondaryHover: string;
1878
1878
  colorSecondaryPressed: string;
@@ -2208,9 +2208,9 @@ declare const _default: import("vue").DefineComponent<{
2208
2208
  fontSizeMedium: string;
2209
2209
  fontSizeLarge: string;
2210
2210
  opacityDisabled: string;
2211
- colorOpacitySecondary: number;
2212
- colorOpacitySecondaryHover: number;
2213
- colorOpacitySecondaryPressed: number;
2211
+ colorOpacitySecondary: string;
2212
+ colorOpacitySecondaryHover: string;
2213
+ colorOpacitySecondaryPressed: string;
2214
2214
  colorSecondary: string;
2215
2215
  colorSecondaryHover: string;
2216
2216
  colorSecondaryPressed: string;
@@ -2476,9 +2476,9 @@ declare const _default: import("vue").DefineComponent<{
2476
2476
  fontSizeMedium: string;
2477
2477
  fontSizeLarge: string;
2478
2478
  opacityDisabled: string;
2479
- colorOpacitySecondary: number;
2480
- colorOpacitySecondaryHover: number;
2481
- colorOpacitySecondaryPressed: number;
2479
+ colorOpacitySecondary: string;
2480
+ colorOpacitySecondaryHover: string;
2481
+ colorOpacitySecondaryPressed: string;
2482
2482
  colorSecondary: string;
2483
2483
  colorSecondaryHover: string;
2484
2484
  colorSecondaryPressed: string;
@@ -2744,9 +2744,9 @@ declare const _default: import("vue").DefineComponent<{
2744
2744
  fontSizeMedium: string;
2745
2745
  fontSizeLarge: string;
2746
2746
  opacityDisabled: string;
2747
- colorOpacitySecondary: number;
2748
- colorOpacitySecondaryHover: number;
2749
- colorOpacitySecondaryPressed: number;
2747
+ colorOpacitySecondary: string;
2748
+ colorOpacitySecondaryHover: string;
2749
+ colorOpacitySecondaryPressed: string;
2750
2750
  colorSecondary: string;
2751
2751
  colorSecondaryHover: string;
2752
2752
  colorSecondaryPressed: string;
@@ -8,7 +8,7 @@ import { NButton } from '../../button';
8
8
  import { useTheme, useFormItem, useLocale, useConfig } from '../../_mixins';
9
9
  import { warn, call } from '../../_utils';
10
10
  import { inputNumberLight } from '../styles';
11
- import { parse, validator, format, parseNumber } from './utils';
11
+ import { parse, validator, format, parseNumber, isWipValue } from './utils';
12
12
  import style from './styles/input-number.cssr';
13
13
  const inputNumberProps = Object.assign(Object.assign({}, useTheme.props), { placeholder: String, defaultValue: {
14
14
  type: Number,
@@ -113,8 +113,11 @@ export default defineComponent({
113
113
  nTriggerFormInput();
114
114
  nTriggerFormChange();
115
115
  };
116
- const deriveValueFromDisplayedValue = (offset = 0, doUpdateIfValid = true, applyMinMax = true) => {
116
+ const deriveValueFromDisplayedValue = (offset = 0, doUpdateIfValid = true, isInputing = false) => {
117
117
  const { value: displayedValue } = displayedValueRef;
118
+ if (isInputing && isWipValue(displayedValue)) {
119
+ return false;
120
+ }
118
121
  const parsedValue = parse(displayedValue);
119
122
  if (parsedValue === null) {
120
123
  if (doUpdateIfValid)
@@ -128,13 +131,13 @@ export default defineComponent({
128
131
  const { value: mergedMax } = mergedMaxRef;
129
132
  const { value: mergedMin } = mergedMinRef;
130
133
  if (mergedMax !== null && nextValue > mergedMax) {
131
- if (!doUpdateIfValid || !applyMinMax)
134
+ if (!doUpdateIfValid || isInputing)
132
135
  return false;
133
136
  // if doUpdateIfValid=true, we try to make it a valid value
134
137
  nextValue = mergedMax;
135
138
  }
136
139
  if (mergedMin !== null && nextValue < mergedMin) {
137
- if (!doUpdateIfValid || !applyMinMax)
140
+ if (!doUpdateIfValid || isInputing)
138
141
  return false;
139
142
  // if doUpdateIfValid=true, we try to make it a valid value
140
143
  nextValue = mergedMin;
@@ -306,6 +309,7 @@ export default defineComponent({
306
309
  else if (e.code === 'ArrowUp') {
307
310
  if (props.keyboard.ArrowUp === false)
308
311
  return;
312
+ e.preventDefault();
309
313
  const value = deriveValueFromDisplayedValue();
310
314
  if (value !== false) {
311
315
  doAdd();
@@ -314,6 +318,7 @@ export default defineComponent({
314
318
  else if (e.code === 'ArrowDown') {
315
319
  if (props.keyboard.ArrowDown === false)
316
320
  return;
321
+ e.preventDefault();
317
322
  const value = deriveValueFromDisplayedValue();
318
323
  if (value !== false) {
319
324
  doMinus();
@@ -323,7 +328,7 @@ export default defineComponent({
323
328
  function handleUpdateDisplayedValue(value) {
324
329
  displayedValueRef.value = value;
325
330
  if (props.updateValueOnInput) {
326
- deriveValueFromDisplayedValue(0, true, false);
331
+ deriveValueFromDisplayedValue(0, true, true);
327
332
  }
328
333
  }
329
334
  watch(mergedValueRef, () => {
@@ -1,4 +1,5 @@
1
1
  export declare function parse(value: string): number | null;
2
+ export declare function isWipValue(value: string): boolean;
2
3
  export declare function validator(value: number | undefined | null): boolean;
3
4
  export declare function format(value: number | undefined | null): string;
4
5
  export declare function parseNumber(number: number | null | undefined | string): number | null;
@@ -8,6 +8,10 @@ export function parse(value) {
8
8
  }
9
9
  return Number(value);
10
10
  }
11
+ // can be parsed to number but shouldn't be applied when inputing
12
+ export function isWipValue(value) {
13
+ return /^\d+\.$/.test(value) || /^\.\d+$/.test(value);
14
+ }
11
15
  // string => boolean (expected, not implemented)
12
16
  // number => boolean (legacy)
13
17
  export function validator(value) {
@@ -20,9 +20,9 @@ declare const inputNumberLight: import("../../_mixins").Theme<"InputNumber", {
20
20
  fontSizeMedium: string;
21
21
  fontSizeLarge: string;
22
22
  opacityDisabled: string;
23
- colorOpacitySecondary: number;
24
- colorOpacitySecondaryHover: number;
25
- colorOpacitySecondaryPressed: number;
23
+ colorOpacitySecondary: string;
24
+ colorOpacitySecondaryHover: string;
25
+ colorOpacitySecondaryPressed: string;
26
26
  colorSecondary: string;
27
27
  colorSecondaryHover: string;
28
28
  colorSecondaryPressed: string;
@@ -22,6 +22,11 @@ const deDE = {
22
22
  yearFormat: 'yyyy',
23
23
  monthFormat: 'MMM',
24
24
  dayFormat: 'eeeeee',
25
+ yearTypeFormat: 'yyyy',
26
+ monthTypeFormat: 'MM-yyyy',
27
+ dateFormat: 'dd-MM-yyyy',
28
+ dateTimeFormat: 'dd-MM-yyyy HH:mm:ss',
29
+ quarterFormat: 'yyyy-qqq',
25
30
  clear: 'Löschen',
26
31
  now: 'Jetzt',
27
32
  confirm: 'Bestätigen',
@@ -30,6 +35,9 @@ const deDE = {
30
35
  datePlaceholder: 'Datum auswählen',
31
36
  datetimePlaceholder: 'Datum und Uhrzeit auswählen',
32
37
  monthPlaceholder: 'Monat auswählen',
38
+ // FIXME: translation needed
39
+ yearPlaceholder: 'Select Year',
40
+ quarterPlaceholder: 'Select Quarter',
33
41
  startDatePlaceholder: 'Anfangsdatum',
34
42
  endDatePlaceholder: 'Enddatum',
35
43
  startDatetimePlaceholder: 'Anfangsdatum und Uhrzeit',
@@ -22,6 +22,11 @@ declare const enUS: {
22
22
  yearFormat: string;
23
23
  monthFormat: string;
24
24
  dayFormat: string;
25
+ yearTypeFormat: string;
26
+ monthTypeFormat: string;
27
+ dateFormat: string;
28
+ dateTimeFormat: string;
29
+ quarterFormat: string;
25
30
  clear: string;
26
31
  now: string;
27
32
  confirm: string;
@@ -30,6 +35,8 @@ declare const enUS: {
30
35
  datePlaceholder: string;
31
36
  datetimePlaceholder: string;
32
37
  monthPlaceholder: string;
38
+ yearPlaceholder: string;
39
+ quarterPlaceholder: string;
33
40
  startDatePlaceholder: string;
34
41
  endDatePlaceholder: string;
35
42
  startDatetimePlaceholder: string;
@@ -12,7 +12,7 @@ const enUS = {
12
12
  Cascader: {
13
13
  placeholder: 'Please Select',
14
14
  loading: 'Loading',
15
- loadingRequiredMessage: (label) => `Please load all ${label}'s descedants before checking it.`
15
+ loadingRequiredMessage: (label) => `Please load all ${label}'s descendants before checking it.`
16
16
  },
17
17
  Time: {
18
18
  dateFormat: 'yyyy-MM-dd',
@@ -22,6 +22,11 @@ const enUS = {
22
22
  yearFormat: 'yyyy',
23
23
  monthFormat: 'MMM',
24
24
  dayFormat: 'eeeeee',
25
+ yearTypeFormat: 'yyyy',
26
+ monthTypeFormat: 'yyyy-MM',
27
+ dateFormat: 'yyyy-MM-dd',
28
+ dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
29
+ quarterFormat: 'yyyy-qqq',
25
30
  clear: 'Clear',
26
31
  now: 'Now',
27
32
  confirm: 'Confirm',
@@ -30,6 +35,8 @@ const enUS = {
30
35
  datePlaceholder: 'Select Date',
31
36
  datetimePlaceholder: 'Select Date and Time',
32
37
  monthPlaceholder: 'Select Month',
38
+ yearPlaceholder: 'Select Year',
39
+ quarterPlaceholder: 'Select Quarter',
33
40
  startDatePlaceholder: 'Start Date',
34
41
  endDatePlaceholder: 'End Date',
35
42
  startDatetimePlaceholder: 'Start Date and Time',
@@ -0,0 +1,3 @@
1
+ import type { NLocale } from './enUS';
2
+ declare const frFR: NLocale;
3
+ export default frFR;