naive-ui 2.21.4 → 2.23.1

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 (388) hide show
  1. package/es/_internal/close/src/styles/index.cssr.js +6 -5
  2. package/es/_internal/scrollbar/src/ScrollBar.d.ts +4 -0
  3. package/es/_internal/scrollbar/src/ScrollBar.js +5 -2
  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/_utils/composable/use-houdini.js +10 -7
  7. package/es/alert/src/Alert.d.ts +20 -20
  8. package/es/alert/src/Alert.js +22 -22
  9. package/es/alert/src/styles/index.cssr.js +45 -45
  10. package/es/anchor/src/AnchorAdapter.js +12 -12
  11. package/es/anchor/src/styles/index.cssr.js +41 -41
  12. package/es/auto-complete/src/AutoComplete.d.ts +2 -2
  13. package/es/auto-complete/src/AutoComplete.js +2 -2
  14. package/es/auto-complete/src/styles/index.cssr.js +4 -4
  15. package/es/avatar/src/Avatar.d.ts +10 -8
  16. package/es/avatar/src/Avatar.js +11 -9
  17. package/es/avatar/src/styles/index.cssr.js +14 -16
  18. package/es/back-top/src/BackTop.d.ts +13 -13
  19. package/es/back-top/src/BackTop.js +13 -13
  20. package/es/back-top/src/styles/index.cssr.js +29 -29
  21. package/es/badge/src/Badge.d.ts +6 -6
  22. package/es/badge/src/Badge.js +6 -6
  23. package/es/badge/src/styles/index.cssr.js +15 -15
  24. package/es/button/src/Button.d.ts +43 -38
  25. package/es/button/src/Button.js +124 -116
  26. package/es/button/src/styles/button.cssr.js +83 -80
  27. package/es/button/styles/light.js +1 -1
  28. package/es/calendar/src/Calendar.d.ts +6 -0
  29. package/es/cascader/src/Cascader.d.ts +135 -0
  30. package/es/cascader/src/Cascader.js +2 -4
  31. package/es/cascader/src/CascaderMenu.d.ts +345 -0
  32. package/es/cascader/src/CascaderMenu.js +6 -5
  33. package/es/cascader/src/CascaderOption.d.ts +18 -0
  34. package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
  35. package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
  36. package/es/cascader/styles/dark.js +3 -1
  37. package/es/cascader/styles/light.d.ts +13 -0
  38. package/es/cascader/styles/light.js +3 -1
  39. package/es/config-provider/src/ConfigProvider.d.ts +18 -0
  40. package/es/data-table/src/DataTable.js +7 -13
  41. package/es/data-table/src/MainTable.js +2 -3
  42. package/es/data-table/src/TableParts/Body.d.ts +15 -4
  43. package/es/data-table/src/TableParts/Body.js +80 -28
  44. package/es/data-table/src/TableParts/Cell.js +2 -3
  45. package/es/data-table/src/TableParts/Header.js +2 -2
  46. package/es/data-table/src/interface.d.ts +4 -1
  47. package/es/data-table/src/styles/index.cssr.js +4 -3
  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 +3 -1
  52. package/es/data-table/styles/_common.js +1 -1
  53. package/es/date-picker/src/DatePicker.d.ts +30 -5
  54. package/es/date-picker/src/DatePicker.js +32 -9
  55. package/es/date-picker/src/config.d.ts +1 -9
  56. package/es/date-picker/src/config.js +0 -8
  57. package/es/date-picker/src/interface.d.ts +2 -1
  58. package/es/date-picker/src/panel/date.d.ts +17 -10
  59. package/es/date-picker/src/panel/date.js +2 -2
  60. package/es/date-picker/src/panel/daterange.d.ts +15 -9
  61. package/es/date-picker/src/panel/daterange.js +2 -2
  62. package/es/date-picker/src/panel/datetime.d.ts +17 -16
  63. package/es/date-picker/src/panel/datetime.js +2 -2
  64. package/es/date-picker/src/panel/datetimerange.d.ts +15 -9
  65. package/es/date-picker/src/panel/datetimerange.js +2 -2
  66. package/es/date-picker/src/panel/month.d.ts +21 -20
  67. package/es/date-picker/src/panel/month.js +23 -12
  68. package/es/date-picker/src/panel/use-calendar.d.ts +17 -39
  69. package/es/date-picker/src/panel/use-calendar.js +41 -23
  70. package/es/date-picker/src/panel/use-dual-calendar.d.ts +13 -36
  71. package/es/date-picker/src/panel/use-dual-calendar.js +35 -21
  72. package/es/date-picker/src/panel/use-panel-common.d.ts +13 -32
  73. package/es/date-picker/src/panel/use-panel-common.js +4 -8
  74. package/es/date-picker/src/utils.d.ts +19 -3
  75. package/es/date-picker/src/utils.js +40 -5
  76. package/es/date-picker/styles/_common.d.ts +2 -0
  77. package/es/date-picker/styles/_common.js +3 -1
  78. package/es/date-picker/styles/light.d.ts +4 -0
  79. package/es/dialog/src/Dialog.d.ts +21 -21
  80. package/es/dialog/src/Dialog.js +23 -23
  81. package/es/dialog/src/styles/index.cssr.js +45 -45
  82. package/es/divider/src/Divider.d.ts +4 -4
  83. package/es/divider/src/Divider.js +4 -4
  84. package/es/divider/src/styles/index.cssr.js +12 -12
  85. package/es/dynamic-tags/src/DynamicTags.d.ts +1 -1
  86. package/es/dynamic-tags/src/DynamicTags.js +1 -1
  87. package/es/dynamic-tags/src/styles/index.cssr.js +1 -1
  88. package/es/form/src/Form.d.ts +27 -27
  89. package/es/form/src/FormItem.d.ts +27 -27
  90. package/es/form/src/FormItemCol.d.ts +27 -27
  91. package/es/form/src/FormItemGridItem.d.ts +27 -27
  92. package/es/form/src/FormItemRow.d.ts +27 -27
  93. package/es/form/styles/_common.d.ts +0 -3
  94. package/es/form/styles/_common.js +0 -3
  95. package/es/form/styles/light.d.ts +3 -3
  96. package/es/form/styles/light.js +2 -2
  97. package/es/image/src/Image.js +8 -12
  98. package/es/input/src/Input.js +2 -0
  99. package/es/input-number/src/InputNumber.js +2 -0
  100. package/es/input-number/src/utils.js +1 -1
  101. package/es/locales/common/deDE.js +6 -0
  102. package/es/locales/common/enUS.d.ts +6 -0
  103. package/es/locales/common/enUS.js +7 -1
  104. package/es/locales/common/frFR.d.ts +3 -0
  105. package/es/locales/common/frFR.js +101 -0
  106. package/es/locales/common/idID.d.ts +2 -94
  107. package/es/locales/common/idID.js +6 -0
  108. package/es/locales/common/jaJP.js +6 -0
  109. package/es/locales/common/nbNO.js +6 -0
  110. package/es/locales/common/ruRU.js +6 -0
  111. package/es/locales/common/ukUA.js +6 -0
  112. package/es/locales/common/zhCN.js +6 -0
  113. package/es/locales/common/zhTW.d.ts +3 -0
  114. package/es/locales/common/zhTW.js +100 -0
  115. package/es/locales/date/frFR.d.ts +3 -0
  116. package/es/locales/date/frFR.js +6 -0
  117. package/es/locales/date/idID.d.ts +1 -6
  118. package/es/locales/date/zhTW.d.ts +3 -0
  119. package/es/locales/date/zhTW.js +6 -0
  120. package/es/locales/index.d.ts +4 -0
  121. package/es/locales/index.js +4 -0
  122. package/es/log/src/Log.d.ts +6 -6
  123. package/es/log/src/Log.js +6 -6
  124. package/es/log/src/styles/index.cssr.js +16 -18
  125. package/es/page-header/src/PageHeader.js +3 -3
  126. package/es/page-header/src/styles/index.cssr.js +2 -4
  127. package/es/popover/src/Popover.js +4 -1
  128. package/es/popover/src/PopoverBody.js +3 -3
  129. package/es/popselect/src/Popselect.d.ts +2 -11
  130. package/es/popselect/src/Popselect.js +2 -2
  131. package/es/popselect/src/PopselectPanel.d.ts +3 -11
  132. package/es/popselect/src/PopselectPanel.js +17 -11
  133. package/es/radio/src/Radio.js +3 -3
  134. package/es/radio/src/RadioButton.js +4 -5
  135. package/es/radio/src/styles/radio-group.cssr.js +8 -4
  136. package/es/radio/src/styles/radio.cssr.js +8 -4
  137. package/es/radio/src/use-radio.d.ts +0 -3
  138. package/es/radio/src/use-radio.js +1 -26
  139. package/es/steps/src/Step.d.ts +12 -12
  140. package/es/steps/src/Step.js +12 -12
  141. package/es/steps/src/styles/index.cssr.js +46 -46
  142. package/es/switch/src/Switch.d.ts +19 -19
  143. package/es/switch/src/Switch.js +26 -19
  144. package/es/switch/src/styles/index.cssr.js +59 -57
  145. package/es/tabs/src/styles/index.cssr.js +1 -0
  146. package/es/tag/src/Tag.d.ts +26 -26
  147. package/es/tag/src/Tag.js +26 -26
  148. package/es/tag/src/styles/index.cssr.js +55 -55
  149. package/es/tag/src/styles/rtl.cssr.js +1 -1
  150. package/es/time-picker/src/TimePicker.d.ts +17 -17
  151. package/es/time-picker/src/TimePicker.js +17 -17
  152. package/es/time-picker/src/styles/index.cssr.js +47 -47
  153. package/es/timeline/src/TimelineItem.d.ts +12 -12
  154. package/es/timeline/src/TimelineItem.js +12 -12
  155. package/es/timeline/src/styles/index.cssr.js +44 -44
  156. package/es/transfer/src/styles/index.cssr.js +9 -4
  157. package/es/tree/src/Tree.d.ts +11 -11
  158. package/es/tree/src/Tree.js +11 -11
  159. package/es/tree/src/dnd.js +2 -2
  160. package/es/tree/src/styles/index.cssr.js +33 -33
  161. package/es/tree-select/src/TreeSelect.d.ts +43 -6
  162. package/es/tree-select/src/TreeSelect.js +29 -14
  163. package/es/tree-select/src/styles/index.cssr.js +20 -11
  164. package/es/tree-select/styles/light.d.ts +6 -0
  165. package/es/tree-select/styles/light.js +5 -2
  166. package/es/typography/src/a.d.ts +2 -2
  167. package/es/typography/src/a.js +2 -2
  168. package/es/typography/src/blockquote.d.ts +5 -5
  169. package/es/typography/src/blockquote.js +5 -5
  170. package/es/typography/src/create-header.d.ts +8 -8
  171. package/es/typography/src/create-header.js +8 -8
  172. package/es/typography/src/headers.d.ts +48 -48
  173. package/es/typography/src/hr.d.ts +2 -1
  174. package/es/typography/src/hr.js +3 -1
  175. package/es/typography/src/ol.d.ts +7 -7
  176. package/es/typography/src/ol.js +7 -7
  177. package/es/typography/src/p.d.ts +5 -5
  178. package/es/typography/src/p.js +5 -5
  179. package/es/typography/src/styles/a.cssr.js +6 -6
  180. package/es/typography/src/styles/blockquote.cssr.js +11 -11
  181. package/es/typography/src/styles/header.cssr.js +19 -19
  182. package/es/typography/src/styles/hr.cssr.js +3 -3
  183. package/es/typography/src/styles/list.cssr.js +15 -15
  184. package/es/typography/src/styles/p.cssr.js +10 -10
  185. package/es/typography/src/styles/text.cssr.js +18 -18
  186. package/es/typography/src/text.d.ts +8 -7
  187. package/es/typography/src/text.js +9 -8
  188. package/es/typography/src/ul.d.ts +7 -7
  189. package/es/typography/src/ul.js +7 -7
  190. package/es/upload/src/Upload.js +16 -16
  191. package/es/upload/src/styles/index.cssr.js +36 -36
  192. package/es/version.d.ts +1 -1
  193. package/es/version.js +1 -1
  194. package/lib/_internal/close/src/styles/index.cssr.js +6 -5
  195. package/lib/_internal/scrollbar/src/ScrollBar.d.ts +4 -0
  196. package/lib/_internal/scrollbar/src/ScrollBar.js +5 -2
  197. package/lib/_internal/selection/src/Selection.js +11 -9
  198. package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
  199. package/lib/_utils/composable/use-houdini.js +10 -7
  200. package/lib/alert/src/Alert.d.ts +20 -20
  201. package/lib/alert/src/Alert.js +22 -22
  202. package/lib/alert/src/styles/index.cssr.js +45 -45
  203. package/lib/anchor/src/AnchorAdapter.js +12 -12
  204. package/lib/anchor/src/styles/index.cssr.js +41 -41
  205. package/lib/auto-complete/src/AutoComplete.d.ts +2 -2
  206. package/lib/auto-complete/src/AutoComplete.js +2 -2
  207. package/lib/auto-complete/src/styles/index.cssr.js +4 -4
  208. package/lib/avatar/src/Avatar.d.ts +10 -8
  209. package/lib/avatar/src/Avatar.js +11 -9
  210. package/lib/avatar/src/styles/index.cssr.js +14 -16
  211. package/lib/back-top/src/BackTop.d.ts +13 -13
  212. package/lib/back-top/src/BackTop.js +13 -13
  213. package/lib/back-top/src/styles/index.cssr.js +29 -29
  214. package/lib/badge/src/Badge.d.ts +6 -6
  215. package/lib/badge/src/Badge.js +6 -6
  216. package/lib/badge/src/styles/index.cssr.js +15 -15
  217. package/lib/button/src/Button.d.ts +43 -38
  218. package/lib/button/src/Button.js +123 -115
  219. package/lib/button/src/styles/button.cssr.js +83 -80
  220. package/lib/button/styles/light.js +1 -1
  221. package/lib/calendar/src/Calendar.d.ts +6 -0
  222. package/lib/cascader/src/Cascader.d.ts +135 -0
  223. package/lib/cascader/src/Cascader.js +2 -4
  224. package/lib/cascader/src/CascaderMenu.d.ts +345 -0
  225. package/lib/cascader/src/CascaderMenu.js +6 -5
  226. package/lib/cascader/src/CascaderOption.d.ts +18 -0
  227. package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
  228. package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
  229. package/lib/cascader/styles/dark.js +3 -1
  230. package/lib/cascader/styles/light.d.ts +13 -0
  231. package/lib/cascader/styles/light.js +3 -1
  232. package/lib/config-provider/src/ConfigProvider.d.ts +18 -0
  233. package/lib/data-table/src/DataTable.js +6 -12
  234. package/lib/data-table/src/MainTable.js +1 -2
  235. package/lib/data-table/src/TableParts/Body.d.ts +15 -4
  236. package/lib/data-table/src/TableParts/Body.js +78 -26
  237. package/lib/data-table/src/TableParts/Cell.js +2 -3
  238. package/lib/data-table/src/TableParts/Header.js +2 -2
  239. package/lib/data-table/src/interface.d.ts +4 -1
  240. package/lib/data-table/src/styles/index.cssr.js +4 -3
  241. package/lib/data-table/src/use-check.js +6 -2
  242. package/lib/data-table/src/use-scroll.d.ts +2 -0
  243. package/lib/data-table/src/use-scroll.js +34 -4
  244. package/lib/data-table/src/use-table-data.js +3 -1
  245. package/lib/data-table/styles/_common.js +1 -1
  246. package/lib/date-picker/src/DatePicker.d.ts +30 -5
  247. package/lib/date-picker/src/DatePicker.js +31 -8
  248. package/lib/date-picker/src/config.d.ts +1 -9
  249. package/lib/date-picker/src/config.js +1 -9
  250. package/lib/date-picker/src/interface.d.ts +2 -1
  251. package/lib/date-picker/src/panel/date.d.ts +17 -10
  252. package/lib/date-picker/src/panel/date.js +1 -1
  253. package/lib/date-picker/src/panel/daterange.d.ts +15 -9
  254. package/lib/date-picker/src/panel/daterange.js +1 -1
  255. package/lib/date-picker/src/panel/datetime.d.ts +17 -16
  256. package/lib/date-picker/src/panel/datetime.js +1 -1
  257. package/lib/date-picker/src/panel/datetimerange.d.ts +15 -9
  258. package/lib/date-picker/src/panel/datetimerange.js +2 -2
  259. package/lib/date-picker/src/panel/month.d.ts +21 -20
  260. package/lib/date-picker/src/panel/month.js +23 -12
  261. package/lib/date-picker/src/panel/use-calendar.d.ts +17 -39
  262. package/lib/date-picker/src/panel/use-calendar.js +40 -21
  263. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +13 -36
  264. package/lib/date-picker/src/panel/use-dual-calendar.js +34 -19
  265. package/lib/date-picker/src/panel/use-panel-common.d.ts +13 -32
  266. package/lib/date-picker/src/panel/use-panel-common.js +5 -8
  267. package/lib/date-picker/src/utils.d.ts +19 -3
  268. package/lib/date-picker/src/utils.js +41 -4
  269. package/lib/date-picker/styles/_common.d.ts +2 -0
  270. package/lib/date-picker/styles/_common.js +3 -1
  271. package/lib/date-picker/styles/light.d.ts +4 -0
  272. package/lib/dialog/src/Dialog.d.ts +21 -21
  273. package/lib/dialog/src/Dialog.js +23 -23
  274. package/lib/dialog/src/styles/index.cssr.js +45 -45
  275. package/lib/divider/src/Divider.d.ts +4 -4
  276. package/lib/divider/src/Divider.js +4 -4
  277. package/lib/divider/src/styles/index.cssr.js +12 -12
  278. package/lib/dynamic-tags/src/DynamicTags.d.ts +1 -1
  279. package/lib/dynamic-tags/src/DynamicTags.js +1 -1
  280. package/lib/dynamic-tags/src/styles/index.cssr.js +1 -1
  281. package/lib/form/src/Form.d.ts +27 -27
  282. package/lib/form/src/FormItem.d.ts +27 -27
  283. package/lib/form/src/FormItemCol.d.ts +27 -27
  284. package/lib/form/src/FormItemGridItem.d.ts +27 -27
  285. package/lib/form/src/FormItemRow.d.ts +27 -27
  286. package/lib/form/styles/_common.d.ts +0 -3
  287. package/lib/form/styles/_common.js +0 -3
  288. package/lib/form/styles/light.d.ts +3 -3
  289. package/lib/form/styles/light.js +2 -2
  290. package/lib/image/src/Image.js +7 -11
  291. package/lib/input/src/Input.js +2 -0
  292. package/lib/input-number/src/InputNumber.js +2 -0
  293. package/lib/input-number/src/utils.js +1 -1
  294. package/lib/locales/common/deDE.js +6 -0
  295. package/lib/locales/common/enUS.d.ts +6 -0
  296. package/lib/locales/common/enUS.js +7 -1
  297. package/lib/locales/common/frFR.d.ts +3 -0
  298. package/lib/locales/common/frFR.js +103 -0
  299. package/lib/locales/common/idID.d.ts +2 -94
  300. package/lib/locales/common/idID.js +6 -0
  301. package/lib/locales/common/jaJP.js +6 -0
  302. package/lib/locales/common/nbNO.js +6 -0
  303. package/lib/locales/common/ruRU.js +6 -0
  304. package/lib/locales/common/ukUA.js +6 -0
  305. package/lib/locales/common/zhCN.js +6 -0
  306. package/lib/locales/common/zhTW.d.ts +3 -0
  307. package/lib/locales/common/zhTW.js +102 -0
  308. package/lib/locales/date/frFR.d.ts +3 -0
  309. package/lib/locales/date/frFR.js +11 -0
  310. package/lib/locales/date/idID.d.ts +1 -6
  311. package/lib/locales/date/zhTW.d.ts +3 -0
  312. package/lib/locales/date/zhTW.js +11 -0
  313. package/lib/locales/index.d.ts +4 -0
  314. package/lib/locales/index.js +9 -1
  315. package/lib/log/src/Log.d.ts +6 -6
  316. package/lib/log/src/Log.js +6 -6
  317. package/lib/log/src/styles/index.cssr.js +16 -18
  318. package/lib/page-header/src/PageHeader.js +3 -3
  319. package/lib/page-header/src/styles/index.cssr.js +2 -4
  320. package/lib/popover/src/Popover.js +4 -1
  321. package/lib/popover/src/PopoverBody.js +3 -3
  322. package/lib/popselect/src/Popselect.d.ts +2 -11
  323. package/lib/popselect/src/Popselect.js +2 -2
  324. package/lib/popselect/src/PopselectPanel.d.ts +3 -11
  325. package/lib/popselect/src/PopselectPanel.js +16 -10
  326. package/lib/radio/src/Radio.js +3 -3
  327. package/lib/radio/src/RadioButton.js +4 -5
  328. package/lib/radio/src/styles/radio-group.cssr.js +8 -4
  329. package/lib/radio/src/styles/radio.cssr.js +8 -4
  330. package/lib/radio/src/use-radio.d.ts +0 -3
  331. package/lib/radio/src/use-radio.js +1 -26
  332. package/lib/steps/src/Step.d.ts +12 -12
  333. package/lib/steps/src/Step.js +12 -12
  334. package/lib/steps/src/styles/index.cssr.js +46 -46
  335. package/lib/switch/src/Switch.d.ts +19 -19
  336. package/lib/switch/src/Switch.js +26 -19
  337. package/lib/switch/src/styles/index.cssr.js +59 -57
  338. package/lib/tabs/src/styles/index.cssr.js +1 -0
  339. package/lib/tag/src/Tag.d.ts +26 -26
  340. package/lib/tag/src/Tag.js +26 -26
  341. package/lib/tag/src/styles/index.cssr.js +55 -55
  342. package/lib/tag/src/styles/rtl.cssr.js +1 -1
  343. package/lib/time-picker/src/TimePicker.d.ts +17 -17
  344. package/lib/time-picker/src/TimePicker.js +17 -17
  345. package/lib/time-picker/src/styles/index.cssr.js +47 -47
  346. package/lib/timeline/src/TimelineItem.d.ts +12 -12
  347. package/lib/timeline/src/TimelineItem.js +12 -12
  348. package/lib/timeline/src/styles/index.cssr.js +44 -44
  349. package/lib/transfer/src/styles/index.cssr.js +9 -4
  350. package/lib/tree/src/Tree.d.ts +11 -11
  351. package/lib/tree/src/Tree.js +11 -11
  352. package/lib/tree/src/dnd.js +2 -2
  353. package/lib/tree/src/styles/index.cssr.js +33 -33
  354. package/lib/tree-select/src/TreeSelect.d.ts +43 -6
  355. package/lib/tree-select/src/TreeSelect.js +28 -13
  356. package/lib/tree-select/src/styles/index.cssr.js +20 -11
  357. package/lib/tree-select/styles/light.d.ts +6 -0
  358. package/lib/tree-select/styles/light.js +5 -2
  359. package/lib/typography/src/a.d.ts +2 -2
  360. package/lib/typography/src/a.js +2 -2
  361. package/lib/typography/src/blockquote.d.ts +5 -5
  362. package/lib/typography/src/blockquote.js +5 -5
  363. package/lib/typography/src/create-header.d.ts +8 -8
  364. package/lib/typography/src/create-header.js +8 -8
  365. package/lib/typography/src/headers.d.ts +48 -48
  366. package/lib/typography/src/hr.d.ts +2 -1
  367. package/lib/typography/src/hr.js +3 -1
  368. package/lib/typography/src/ol.d.ts +7 -7
  369. package/lib/typography/src/ol.js +7 -7
  370. package/lib/typography/src/p.d.ts +5 -5
  371. package/lib/typography/src/p.js +5 -5
  372. package/lib/typography/src/styles/a.cssr.js +6 -6
  373. package/lib/typography/src/styles/blockquote.cssr.js +11 -11
  374. package/lib/typography/src/styles/header.cssr.js +19 -19
  375. package/lib/typography/src/styles/hr.cssr.js +3 -3
  376. package/lib/typography/src/styles/list.cssr.js +15 -15
  377. package/lib/typography/src/styles/p.cssr.js +10 -10
  378. package/lib/typography/src/styles/text.cssr.js +18 -18
  379. package/lib/typography/src/text.d.ts +8 -7
  380. package/lib/typography/src/text.js +9 -8
  381. package/lib/typography/src/ul.d.ts +7 -7
  382. package/lib/typography/src/ul.js +7 -7
  383. package/lib/upload/src/Upload.js +16 -16
  384. package/lib/upload/src/styles/index.cssr.js +36 -36
  385. package/lib/version.d.ts +1 -1
  386. package/lib/version.js +1 -1
  387. package/package.json +29 -28
  388. package/web-types.json +25 -7
@@ -1,19 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCalendar = void 0;
3
+ exports.useCalendarProps = exports.useCalendar = void 0;
4
4
  const vue_1 = require("vue");
5
5
  const date_fns_1 = require("date-fns");
6
6
  const utils_1 = require("../utils");
7
- const use_panel_common_1 = require("./use-panel-common");
8
7
  const interface_1 = require("../interface");
9
- const useCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommon.props), { actions: {
8
+ const use_panel_common_1 = require("./use-panel-common");
9
+ const useCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommonProps), { actions: {
10
10
  type: Array,
11
11
  default: () => ['now', 'clear', 'confirm']
12
12
  } });
13
+ exports.useCalendarProps = useCalendarProps;
13
14
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
14
15
  function useCalendar(props, type) {
15
16
  const panelCommon = (0, use_panel_common_1.usePanelCommon)(props);
16
- const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots, scrollYearMonth
17
+ const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots, scrollPickerColumns
17
18
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
18
19
  } = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
19
20
  const validation = {
@@ -26,9 +27,10 @@ function useCalendar(props, type) {
26
27
  isMinuteDisabled: isMinuteDisabledRef,
27
28
  isSecondDisabled: isSecondDisabledRef
28
29
  };
30
+ const mergedDateFormatRef = (0, vue_1.computed)(() => props.dateFormat || localeRef.value.dateFormat);
29
31
  const dateInputValueRef = (0, vue_1.ref)(props.value === null || Array.isArray(props.value)
30
32
  ? ''
31
- : (0, date_fns_1.format)(props.value, props.dateFormat));
33
+ : (0, date_fns_1.format)(props.value, mergedDateFormatRef.value));
32
34
  const calendarValueRef = (0, vue_1.ref)(props.value === null || Array.isArray(props.value)
33
35
  ? Date.now()
34
36
  : props.value);
@@ -46,6 +48,9 @@ function useCalendar(props, type) {
46
48
  const yearArrayRef = (0, vue_1.computed)(() => {
47
49
  return (0, utils_1.yearArray)(calendarValueRef.value, props.value, nowRef.value);
48
50
  });
51
+ const querterArrayRef = (0, vue_1.computed)(() => {
52
+ return (0, utils_1.quarterArray)(calendarValueRef.value, props.value, nowRef.value);
53
+ });
49
54
  const weekdaysRef = (0, vue_1.computed)(() => {
50
55
  return dateArrayRef.value.slice(0, 7).map((dateItem) => {
51
56
  const { ts } = dateItem;
@@ -65,7 +70,7 @@ function useCalendar(props, type) {
65
70
  });
66
71
  (0, vue_1.watch)((0, vue_1.computed)(() => props.value), (value) => {
67
72
  if (value !== null && !Array.isArray(value)) {
68
- dateInputValueRef.value = (0, date_fns_1.format)(value, props.dateFormat, panelCommon.dateFnsOptions.value);
73
+ dateInputValueRef.value = (0, date_fns_1.format)(value, mergedDateFormatRef.value, panelCommon.dateFnsOptions.value);
69
74
  calendarValueRef.value = value;
70
75
  }
71
76
  else {
@@ -79,6 +84,8 @@ function useCalendar(props, type) {
79
84
  return (0, date_fns_1.getTime)((0, date_fns_1.startOfMonth)(value));
80
85
  if (type === 'year')
81
86
  return (0, date_fns_1.getTime)((0, date_fns_1.startOfYear)(value));
87
+ if (type === 'quarter')
88
+ return (0, date_fns_1.getTime)((0, date_fns_1.startOfQuarter)(value));
82
89
  return (0, date_fns_1.getTime)((0, date_fns_1.startOfDay)(value));
83
90
  }
84
91
  function mergedIsDateDisabled(ts) {
@@ -88,7 +95,7 @@ function useCalendar(props, type) {
88
95
  return isDateDisabled(ts);
89
96
  }
90
97
  function handleDateInput(value) {
91
- const date = (0, utils_1.strictParse)(value, props.dateFormat, new Date(), panelCommon.dateFnsOptions.value);
98
+ const date = (0, utils_1.strictParse)(value, mergedDateFormatRef.value, new Date(), panelCommon.dateFnsOptions.value);
92
99
  if ((0, date_fns_1.isValid)(date)) {
93
100
  if (props.value === null) {
94
101
  panelCommon.doUpdateValue((0, date_fns_1.getTime)(sanitizeValue(Date.now())), false);
@@ -107,7 +114,7 @@ function useCalendar(props, type) {
107
114
  }
108
115
  }
109
116
  function handleDateInputBlur() {
110
- const date = (0, utils_1.strictParse)(dateInputValueRef.value, props.dateFormat, new Date(), panelCommon.dateFnsOptions.value);
117
+ const date = (0, utils_1.strictParse)(dateInputValueRef.value, mergedDateFormatRef.value, new Date(), panelCommon.dateFnsOptions.value);
111
118
  if ((0, date_fns_1.isValid)(date)) {
112
119
  if (props.value === null) {
113
120
  panelCommon.doUpdateValue((0, date_fns_1.getTime)(sanitizeValue(Date.now())), false);
@@ -146,17 +153,30 @@ function useCalendar(props, type) {
146
153
  else {
147
154
  newValue = Date.now();
148
155
  }
149
- newValue = (0, date_fns_1.getTime)((0, date_fns_1.set)(newValue, dateItem.dateObject));
150
- panelCommon.doUpdateValue(sanitizeValue(newValue), type === 'date' || type === 'year');
151
- if (type === 'date') {
152
- panelCommon.doClose();
153
- }
154
- else if (type === 'month') {
155
- panelCommon.disableTransitionOneTick();
156
- scrollYearMonth(newValue);
156
+ if (type === 'datetime' &&
157
+ props.defaultTime !== null &&
158
+ !Array.isArray(props.defaultTime)) {
159
+ const time = (0, utils_1.getDefaultTime)(props.defaultTime);
160
+ if (time) {
161
+ newValue = (0, date_fns_1.getTime)((0, date_fns_1.set)(newValue, time)); // setDate getTime(addMilliseconds(startOfDay(newValue), time))
162
+ }
157
163
  }
158
- else if (type === 'year') {
159
- panelCommon.doClose();
164
+ newValue = (0, date_fns_1.getTime)(dateItem.type === 'quarter' && dateItem.dateObject.quarter
165
+ ? (0, date_fns_1.setQuarter)((0, date_fns_1.setYear)(newValue, dateItem.dateObject.year), dateItem.dateObject.quarter)
166
+ : (0, date_fns_1.set)(newValue, dateItem.dateObject));
167
+ panelCommon.doUpdateValue(sanitizeValue(newValue), type === 'date' || type === 'year');
168
+ switch (type) {
169
+ case 'date':
170
+ case 'year':
171
+ panelCommon.doClose();
172
+ break;
173
+ case 'month':
174
+ panelCommon.disableTransitionOneTick();
175
+ scrollPickerColumns(newValue);
176
+ break;
177
+ case 'quarter':
178
+ scrollPickerColumns(newValue);
179
+ break;
160
180
  }
161
181
  }
162
182
  function deriveDateInputValue(time) {
@@ -169,7 +189,7 @@ function useCalendar(props, type) {
169
189
  if (time === undefined) {
170
190
  time = props.value;
171
191
  }
172
- dateInputValueRef.value = (0, date_fns_1.format)(time, props.dateFormat, panelCommon.dateFnsOptions.value);
192
+ dateInputValueRef.value = (0, date_fns_1.format)(time, mergedDateFormatRef.value, panelCommon.dateFnsOptions.value);
173
193
  }
174
194
  function handleConfirmClick() {
175
195
  if (validation.isDateInvalid.value || validation.isTimeInvalid.value) {
@@ -230,7 +250,7 @@ function useCalendar(props, type) {
230
250
  panelCommon.clearPendingValue();
231
251
  handleConfirmClick();
232
252
  }
233
- return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
253
+ return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, quarterArray: querterArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
234
254
  nextYear,
235
255
  prevYear,
236
256
  nextMonth,
@@ -253,4 +273,3 @@ function useCalendar(props, type) {
253
273
  scrollbarInstRef });
254
274
  }
255
275
  exports.useCalendar = useCalendar;
256
- useCalendar.props = useCalendarProps;
@@ -1,25 +1,23 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  import { DateItem } from '../utils';
3
- import { Shortcuts } from '../interface';
3
+ import type { Shortcuts } from '../interface';
4
4
  declare const useDualCalendarProps: {
5
5
  readonly actions: {
6
6
  readonly type: ArrayConstructor;
7
7
  readonly default: () => string[];
8
8
  };
9
9
  readonly active: BooleanConstructor;
10
- readonly dateFormat: {
11
- readonly type: StringConstructor;
12
- readonly default: "yyyy-MM-dd";
13
- };
10
+ readonly dateFormat: StringConstructor;
14
11
  readonly timeFormat: {
15
12
  readonly type: StringConstructor;
16
- readonly default: "HH:mm:ss";
13
+ readonly value: "HH:mm:ss";
17
14
  };
18
15
  readonly value: {
19
16
  readonly type: import("vue").PropType<import("../interface").Value | null>;
20
17
  readonly default: null;
21
18
  };
22
19
  readonly shortcuts: import("vue").PropType<Shortcuts>;
20
+ readonly defaultTime: import("vue").PropType<import("../interface").DefaultTime>;
23
21
  readonly onConfirm: FunctionConstructor;
24
22
  readonly onClose: import("vue").PropType<import("../interface").OnClose>;
25
23
  readonly onTabOut: FunctionConstructor;
@@ -210,12 +208,14 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
210
208
  calendarLeftPaddingDatetimerange: string;
211
209
  calendarLeftPaddingMonth: string;
212
210
  calendarLeftPaddingYear: string;
211
+ calendarLeftPaddingQuarter: string;
213
212
  calendarRightPaddingDate: string;
214
213
  calendarRightPaddingDatetime: string;
215
214
  calendarRightPaddingDaterange: string;
216
215
  calendarRightPaddingDatetimerange: string;
217
216
  calendarRightPaddingMonth: string;
218
217
  calendarRightPaddingYear: string;
218
+ calendarRightPaddingQuarter: string;
219
219
  };
220
220
  peers: {
221
221
  Input: import("../../../_mixins").Theme<"Input", {
@@ -1072,6 +1072,11 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
1072
1072
  yearFormat: string;
1073
1073
  monthFormat: string;
1074
1074
  dayFormat: string;
1075
+ yearTypeFormat: string;
1076
+ monthTypeFormat: string;
1077
+ dateFormat: string;
1078
+ dateTimeFormat: string;
1079
+ quarterFormat: string;
1075
1080
  clear: string;
1076
1081
  now: string;
1077
1082
  confirm: string;
@@ -1081,6 +1086,7 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
1081
1086
  datetimePlaceholder: string;
1082
1087
  monthPlaceholder: string;
1083
1088
  yearPlaceholder: string;
1089
+ quarterPlaceholder: string;
1084
1090
  startDatePlaceholder: string;
1085
1091
  endDatePlaceholder: string;
1086
1092
  startDatetimePlaceholder: string;
@@ -1129,33 +1135,4 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
1129
1135
  handleRangeShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
1130
1136
  handleRangeShortcutClick: (shortcut: Shortcuts[string]) => void;
1131
1137
  };
1132
- declare namespace useDualCalendar {
1133
- var props: {
1134
- readonly actions: {
1135
- readonly type: ArrayConstructor;
1136
- readonly default: () => string[];
1137
- };
1138
- readonly active: BooleanConstructor;
1139
- readonly dateFormat: {
1140
- readonly type: StringConstructor;
1141
- readonly default: "yyyy-MM-dd";
1142
- };
1143
- readonly timeFormat: {
1144
- readonly type: StringConstructor;
1145
- readonly default: "HH:mm:ss";
1146
- };
1147
- readonly value: {
1148
- readonly type: import("vue").PropType<import("../interface").Value | null>;
1149
- readonly default: null;
1150
- };
1151
- readonly shortcuts: import("vue").PropType<Shortcuts>;
1152
- readonly onConfirm: FunctionConstructor;
1153
- readonly onClose: import("vue").PropType<import("../interface").OnClose>;
1154
- readonly onTabOut: FunctionConstructor;
1155
- readonly onUpdateValue: {
1156
- readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
1157
- readonly required: true;
1158
- };
1159
- };
1160
- }
1161
- export { useDualCalendar };
1138
+ export { useDualCalendar, useDualCalendarProps };
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDualCalendar = void 0;
3
+ exports.useDualCalendarProps = exports.useDualCalendar = void 0;
4
4
  const vue_1 = require("vue");
5
5
  const date_fns_1 = require("date-fns");
6
6
  const utils_1 = require("../utils");
7
- const use_panel_common_1 = require("./use-panel-common");
8
7
  const interface_1 = require("../interface");
9
- const useDualCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommon.props), { actions: {
8
+ const use_panel_common_1 = require("./use-panel-common");
9
+ const useDualCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommonProps), { actions: {
10
10
  type: Array,
11
11
  default: () => ['clear', 'confirm']
12
12
  } });
13
+ exports.useDualCalendarProps = useDualCalendarProps;
13
14
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
14
15
  function useDualCalendar(props, type = 'datetime') {
15
16
  const { isDateDisabledRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
@@ -39,12 +40,13 @@ function useDualCalendar(props, type = 'datetime') {
39
40
  const nowRef = (0, vue_1.ref)(Date.now());
40
41
  const isSelectingRef = (0, vue_1.ref)(false);
41
42
  const memorizedStartDateTimeRef = (0, vue_1.ref)(0);
42
- const { value, dateFormat } = props;
43
+ const mergedDateFormatRef = (0, vue_1.computed)(() => props.dateFormat || localeRef.value.dateFormat);
44
+ const { value } = props;
43
45
  const startDateInput = (0, vue_1.ref)(Array.isArray(value)
44
- ? (0, date_fns_1.format)(value[0], dateFormat, panelCommon.dateFnsOptions.value)
46
+ ? (0, date_fns_1.format)(value[0], mergedDateFormatRef.value, panelCommon.dateFnsOptions.value)
45
47
  : '');
46
48
  const endDateInputRef = (0, vue_1.ref)(Array.isArray(value)
47
- ? (0, date_fns_1.format)(value[1], dateFormat, panelCommon.dateFnsOptions.value)
49
+ ? (0, date_fns_1.format)(value[1], mergedDateFormatRef.value, panelCommon.dateFnsOptions.value)
48
50
  : '');
49
51
  if (Array.isArray(value)) {
50
52
  syncCalendarTimeWithValue(value);
@@ -101,9 +103,8 @@ function useDualCalendar(props, type = 'datetime') {
101
103
  (0, vue_1.watch)((0, vue_1.computed)(() => props.value), (value) => {
102
104
  if (value !== null && Array.isArray(value)) {
103
105
  const [startMoment, endMoment] = value;
104
- const { dateFormat } = props;
105
- startDateInput.value = (0, date_fns_1.format)(startMoment, dateFormat, panelCommon.dateFnsOptions.value);
106
- endDateInputRef.value = (0, date_fns_1.format)(endMoment, dateFormat, panelCommon.dateFnsOptions.value);
106
+ startDateInput.value = (0, date_fns_1.format)(startMoment, mergedDateFormatRef.value, panelCommon.dateFnsOptions.value);
107
+ endDateInputRef.value = (0, date_fns_1.format)(endMoment, mergedDateFormatRef.value, panelCommon.dateFnsOptions.value);
107
108
  if (!isSelectingRef.value) {
108
109
  syncCalendarTimeWithValue(value);
109
110
  }
@@ -290,8 +291,24 @@ function useDualCalendar(props, type = 'datetime') {
290
291
  if (typeof startTime !== 'number') {
291
292
  startTime = (0, date_fns_1.getTime)(startTime);
292
293
  }
293
- if (typeof endTime !== 'number') {
294
- endTime = (0, date_fns_1.getTime)(endTime);
294
+ let startDefaultTime;
295
+ let endDefaultTime;
296
+ if (type === 'datetimerange') {
297
+ const { defaultTime } = props;
298
+ if (Array.isArray(defaultTime)) {
299
+ startDefaultTime = (0, utils_1.getDefaultTime)(defaultTime[0]);
300
+ endDefaultTime = (0, utils_1.getDefaultTime)(defaultTime[1]);
301
+ }
302
+ else {
303
+ startDefaultTime = (0, utils_1.getDefaultTime)(defaultTime);
304
+ endDefaultTime = startDefaultTime;
305
+ }
306
+ }
307
+ if (startDefaultTime) {
308
+ startTime = (0, date_fns_1.getTime)((0, date_fns_1.set)(startTime, startDefaultTime));
309
+ }
310
+ if (endDefaultTime) {
311
+ endTime = (0, date_fns_1.getTime)((0, date_fns_1.set)(endTime, endDefaultTime));
295
312
  }
296
313
  panelCommon.doUpdateValue([startTime, endTime], false);
297
314
  }
@@ -305,7 +322,7 @@ function useDualCalendar(props, type = 'datetime') {
305
322
  }
306
323
  }
307
324
  function handleStartDateInput(value) {
308
- const date = (0, utils_1.strictParse)(value, props.dateFormat, new Date(), panelCommon.dateFnsOptions.value);
325
+ const date = (0, utils_1.strictParse)(value, mergedDateFormatRef.value, new Date(), panelCommon.dateFnsOptions.value);
309
326
  if ((0, date_fns_1.isValid)(date)) {
310
327
  if (!props.value) {
311
328
  const newValue = (0, date_fns_1.set)(new Date(), {
@@ -330,7 +347,7 @@ function useDualCalendar(props, type = 'datetime') {
330
347
  }
331
348
  function handleEndDateInput(value) {
332
349
  /** strict check when input */
333
- const date = (0, utils_1.strictParse)(value, props.dateFormat, new Date(), panelCommon.dateFnsOptions.value);
350
+ const date = (0, utils_1.strictParse)(value, mergedDateFormatRef.value, new Date(), panelCommon.dateFnsOptions.value);
334
351
  if ((0, date_fns_1.isValid)(date)) {
335
352
  if (props.value === null) {
336
353
  const newValue = (0, date_fns_1.set)(new Date(), {
@@ -354,7 +371,7 @@ function useDualCalendar(props, type = 'datetime') {
354
371
  }
355
372
  }
356
373
  function handleStartDateInputBlur() {
357
- const date = (0, utils_1.strictParse)(startDateInput.value, props.dateFormat, new Date(), panelCommon.dateFnsOptions.value);
374
+ const date = (0, utils_1.strictParse)(startDateInput.value, mergedDateFormatRef.value, new Date(), panelCommon.dateFnsOptions.value);
358
375
  const { value } = props;
359
376
  if ((0, date_fns_1.isValid)(date)) {
360
377
  if (value === null) {
@@ -379,7 +396,7 @@ function useDualCalendar(props, type = 'datetime') {
379
396
  }
380
397
  }
381
398
  function handleEndDateInputBlur() {
382
- const date = (0, utils_1.strictParse)(endDateInputRef.value, props.dateFormat, new Date(), panelCommon.dateFnsOptions.value);
399
+ const date = (0, utils_1.strictParse)(endDateInputRef.value, mergedDateFormatRef.value, new Date(), panelCommon.dateFnsOptions.value);
383
400
  const { value } = props;
384
401
  if ((0, date_fns_1.isValid)(date)) {
385
402
  if (value === null) {
@@ -412,12 +429,11 @@ function useDualCalendar(props, type = 'datetime') {
412
429
  endDateInputRef.value = '';
413
430
  return;
414
431
  }
415
- const { dateFormat } = props;
416
432
  if (times === undefined) {
417
433
  times = value;
418
434
  }
419
- startDateInput.value = (0, date_fns_1.format)(times[0], dateFormat, panelCommon.dateFnsOptions.value);
420
- endDateInputRef.value = (0, date_fns_1.format)(times[1], dateFormat, panelCommon.dateFnsOptions.value);
435
+ startDateInput.value = (0, date_fns_1.format)(times[0], mergedDateFormatRef.value, panelCommon.dateFnsOptions.value);
436
+ endDateInputRef.value = (0, date_fns_1.format)(times[1], mergedDateFormatRef.value, panelCommon.dateFnsOptions.value);
421
437
  }
422
438
  function handleStartTimePickerChange(value) {
423
439
  if (value === null)
@@ -471,4 +487,3 @@ function useDualCalendar(props, type = 'datetime') {
471
487
  datePickerSlots, shortcuts: shortcutsRef });
472
488
  }
473
489
  exports.useDualCalendar = useDualCalendar;
474
- useDualCalendar.props = useDualCalendarProps;
@@ -1,20 +1,18 @@
1
1
  import { PropType, ExtractPropTypes } from 'vue';
2
- import { Value, OnPanelUpdateValue, OnClose, Shortcuts } from '../interface';
2
+ import { Value, OnPanelUpdateValue, OnClose, Shortcuts, DefaultTime } from '../interface';
3
3
  declare const usePanelCommonProps: {
4
4
  readonly active: BooleanConstructor;
5
- readonly dateFormat: {
6
- readonly type: StringConstructor;
7
- readonly default: "yyyy-MM-dd";
8
- };
5
+ readonly dateFormat: StringConstructor;
9
6
  readonly timeFormat: {
10
7
  readonly type: StringConstructor;
11
- readonly default: "HH:mm:ss";
8
+ readonly value: "HH:mm:ss";
12
9
  };
13
10
  readonly value: {
14
11
  readonly type: PropType<Value | null>;
15
12
  readonly default: null;
16
13
  };
17
14
  readonly shortcuts: PropType<Shortcuts>;
15
+ readonly defaultTime: PropType<DefaultTime>;
18
16
  readonly onConfirm: FunctionConstructor;
19
17
  readonly onClose: PropType<OnClose>;
20
18
  readonly onTabOut: FunctionConstructor;
@@ -176,12 +174,14 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
176
174
  calendarLeftPaddingDatetimerange: string;
177
175
  calendarLeftPaddingMonth: string;
178
176
  calendarLeftPaddingYear: string;
177
+ calendarLeftPaddingQuarter: string;
179
178
  calendarRightPaddingDate: string;
180
179
  calendarRightPaddingDatetime: string;
181
180
  calendarRightPaddingDaterange: string;
182
181
  calendarRightPaddingDatetimerange: string;
183
182
  calendarRightPaddingMonth: string;
184
183
  calendarRightPaddingYear: string;
184
+ calendarRightPaddingQuarter: string;
185
185
  };
186
186
  peers: {
187
187
  Input: import("../../../_mixins").Theme<"Input", {
@@ -1039,6 +1039,11 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
1039
1039
  yearFormat: string;
1040
1040
  monthFormat: string;
1041
1041
  dayFormat: string;
1042
+ yearTypeFormat: string;
1043
+ monthTypeFormat: string;
1044
+ dateFormat: string;
1045
+ dateTimeFormat: string;
1046
+ quarterFormat: string;
1042
1047
  clear: string;
1043
1048
  now: string;
1044
1049
  confirm: string;
@@ -1048,6 +1053,7 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
1048
1053
  datetimePlaceholder: string;
1049
1054
  monthPlaceholder: string;
1050
1055
  yearPlaceholder: string;
1056
+ quarterPlaceholder: string;
1051
1057
  startDatePlaceholder: string;
1052
1058
  endDatePlaceholder: string;
1053
1059
  startDatetimePlaceholder: string;
@@ -1071,29 +1077,4 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
1071
1077
  getShortcutValue: (shortcut: Shortcuts[string]) => number | [number, number];
1072
1078
  handleShortcutMouseleave: () => void;
1073
1079
  };
1074
- declare namespace usePanelCommon {
1075
- var props: {
1076
- readonly active: BooleanConstructor;
1077
- readonly dateFormat: {
1078
- readonly type: StringConstructor;
1079
- readonly default: "yyyy-MM-dd";
1080
- };
1081
- readonly timeFormat: {
1082
- readonly type: StringConstructor;
1083
- readonly default: "HH:mm:ss";
1084
- };
1085
- readonly value: {
1086
- readonly type: PropType<Value | null>;
1087
- readonly default: null;
1088
- };
1089
- readonly shortcuts: PropType<Shortcuts>;
1090
- readonly onConfirm: FunctionConstructor;
1091
- readonly onClose: PropType<OnClose>;
1092
- readonly onTabOut: FunctionConstructor;
1093
- readonly onUpdateValue: {
1094
- readonly type: PropType<OnPanelUpdateValue>;
1095
- readonly required: true;
1096
- };
1097
- };
1098
- }
1099
- export { usePanelCommon };
1080
+ export { usePanelCommon, usePanelCommonProps };
@@ -1,26 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usePanelCommon = void 0;
3
+ exports.usePanelCommonProps = exports.usePanelCommon = void 0;
4
4
  const vue_1 = require("vue");
5
5
  const vooks_1 = require("vooks");
6
6
  const interface_1 = require("../interface");
7
- const DATE_FORMAT = 'yyyy-MM-dd';
8
7
  const TIME_FORMAT = 'HH:mm:ss';
9
8
  const usePanelCommonProps = {
10
9
  active: Boolean,
11
- dateFormat: {
12
- type: String,
13
- default: DATE_FORMAT
14
- },
10
+ dateFormat: String,
15
11
  timeFormat: {
16
12
  type: String,
17
- default: TIME_FORMAT
13
+ value: TIME_FORMAT
18
14
  },
19
15
  value: {
20
16
  type: [Array, Number],
21
17
  default: null
22
18
  },
23
19
  shortcuts: Object,
20
+ defaultTime: [Number, String, Array],
24
21
  onConfirm: Function,
25
22
  onClose: Function,
26
23
  onTabOut: Function,
@@ -29,6 +26,7 @@ const usePanelCommonProps = {
29
26
  required: true
30
27
  }
31
28
  };
29
+ exports.usePanelCommonProps = usePanelCommonProps;
32
30
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
33
31
  function usePanelCommon(props) {
34
32
  const { dateLocaleRef, timePickerSizeRef, localeRef, mergedClsPrefixRef, mergedThemeRef
@@ -143,4 +141,3 @@ function usePanelCommon(props) {
143
141
  };
144
142
  }
145
143
  exports.usePanelCommon = usePanelCommon;
146
- usePanelCommon.props = usePanelCommonProps;
@@ -21,7 +21,7 @@ export interface MonthItem {
21
21
  month: number;
22
22
  year: number;
23
23
  };
24
- isCurrentMonth: boolean;
24
+ isCurrent: boolean;
25
25
  selected: boolean;
26
26
  ts: number;
27
27
  }
@@ -30,7 +30,17 @@ export interface YearItem {
30
30
  dateObject: {
31
31
  year: number;
32
32
  };
33
- isCurrentYear: boolean;
33
+ isCurrent: boolean;
34
+ selected: boolean;
35
+ ts: number;
36
+ }
37
+ export interface QuarterItem {
38
+ type: 'quarter';
39
+ dateObject: {
40
+ quarter: number;
41
+ year: number;
42
+ };
43
+ isCurrent: boolean;
34
44
  selected: boolean;
35
45
  ts: number;
36
46
  }
@@ -40,8 +50,14 @@ export interface YearItem {
40
50
  */
41
51
  declare function dateArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number, startDay: 0 | 1 | 2 | 3 | 4 | 5 | 6, strip?: boolean): DateItem[];
42
52
  declare function monthArray(monthTs: number, valueTs: number | [number, number] | null, currentTs: number): MonthItem[];
53
+ declare function quarterArray(quarterTs: number, valueTs: number | [number, number] | null, currentTs: number): QuarterItem[];
43
54
  declare function yearArray(yearTs: number, valueTs: number | [number, number] | null, currentTs: number): YearItem[];
44
55
  declare function strictParse(string: string, pattern: string, backup: Date, option: {
45
56
  locale: Locale;
46
57
  }): Date;
47
- export { dateArray, monthArray, yearArray, strictParse, getDerivedTimeFromKeyboardEvent };
58
+ declare function getDefaultTime(timeValue: string | undefined): {
59
+ hours: number;
60
+ minutes: number;
61
+ seconds: number;
62
+ } | undefined;
63
+ export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDerivedTimeFromKeyboardEvent = exports.strictParse = exports.yearArray = exports.monthArray = exports.dateArray = void 0;
3
+ exports.getDefaultTime = exports.getDerivedTimeFromKeyboardEvent = exports.strictParse = exports.quarterArray = exports.yearArray = exports.monthArray = exports.dateArray = void 0;
4
4
  const date_fns_1 = require("date-fns");
5
5
  const config_1 = require("./config");
6
6
  function getDerivedTimeFromKeyboardEvent(prevValue, event) {
@@ -23,7 +23,8 @@ exports.getDerivedTimeFromKeyboardEvent = getDerivedTimeFromKeyboardEvent;
23
23
  const matcherMap = {
24
24
  date: date_fns_1.isSameDay,
25
25
  month: date_fns_1.isSameMonth,
26
- year: date_fns_1.isSameYear
26
+ year: date_fns_1.isSameYear,
27
+ quarter: date_fns_1.isSameQuarter
27
28
  };
28
29
  function matchDate(sourceTime, patternTime, type = 'date') {
29
30
  const matcher = matcherMap[type];
@@ -70,7 +71,7 @@ function monthItem(monthTs, valueTs, currentTs) {
70
71
  month: (0, date_fns_1.getMonth)(monthTs),
71
72
  year: (0, date_fns_1.getYear)(monthTs)
72
73
  },
73
- isCurrentMonth: (0, date_fns_1.isSameMonth)(currentTs, monthTs),
74
+ isCurrent: (0, date_fns_1.isSameMonth)(currentTs, monthTs),
74
75
  selected: valueTs !== null && matchDate(valueTs, monthTs, 'month'),
75
76
  ts: (0, date_fns_1.getTime)(monthTs)
76
77
  };
@@ -81,11 +82,23 @@ function yearItem(yearTs, valueTs, currentTs) {
81
82
  dateObject: {
82
83
  year: (0, date_fns_1.getYear)(yearTs)
83
84
  },
84
- isCurrentYear: (0, date_fns_1.isSameYear)(currentTs, yearTs),
85
+ isCurrent: (0, date_fns_1.isSameYear)(currentTs, yearTs),
85
86
  selected: valueTs !== null && matchDate(valueTs, yearTs, 'year'),
86
87
  ts: (0, date_fns_1.getTime)(yearTs)
87
88
  };
88
89
  }
90
+ function quarterItem(quarterTs, valueTs, currentTs) {
91
+ return {
92
+ type: 'quarter',
93
+ dateObject: {
94
+ quarter: (0, date_fns_1.getQuarter)(quarterTs),
95
+ year: (0, date_fns_1.getYear)(quarterTs)
96
+ },
97
+ isCurrent: (0, date_fns_1.isSameQuarter)(currentTs, quarterTs),
98
+ selected: valueTs !== null && matchDate(valueTs, quarterTs, 'quarter'),
99
+ ts: (0, date_fns_1.getTime)(quarterTs)
100
+ };
101
+ }
89
102
  /**
90
103
  * Given time to display calendar, given the selected time, given current time,
91
104
  * return the date array of display time's month.
@@ -131,6 +144,15 @@ function monthArray(monthTs, valueTs, currentTs) {
131
144
  return calendarMonths;
132
145
  }
133
146
  exports.monthArray = monthArray;
147
+ function quarterArray(quarterTs, valueTs, currentTs) {
148
+ const calendarQuarters = [];
149
+ const yearStart = (0, date_fns_1.startOfYear)(quarterTs);
150
+ for (let i = 0; i < 4; i++) {
151
+ calendarQuarters.push(quarterItem((0, date_fns_1.getTime)((0, date_fns_1.addQuarters)(yearStart, i)), valueTs, currentTs));
152
+ }
153
+ return calendarQuarters;
154
+ }
155
+ exports.quarterArray = quarterArray;
134
156
  function yearArray(yearTs, valueTs, currentTs) {
135
157
  const calendarYears = [];
136
158
  const time1900 = new Date(config_1.START_YEAR, 0, 1);
@@ -153,3 +175,18 @@ function strictParse(string, pattern, backup, option) {
153
175
  return new Date(NaN);
154
176
  }
155
177
  exports.strictParse = strictParse;
178
+ function getDefaultTime(timeValue) {
179
+ if (timeValue === undefined) {
180
+ return undefined;
181
+ }
182
+ if (typeof timeValue === 'number') {
183
+ return timeValue;
184
+ }
185
+ const [hour, minute, second] = timeValue.split(':');
186
+ return {
187
+ hours: Number(hour),
188
+ minutes: Number(minute),
189
+ seconds: Number(second)
190
+ };
191
+ }
192
+ exports.getDefaultTime = getDefaultTime;
@@ -18,11 +18,13 @@ declare const _default: {
18
18
  calendarLeftPaddingDatetimerange: string;
19
19
  calendarLeftPaddingMonth: string;
20
20
  calendarLeftPaddingYear: string;
21
+ calendarLeftPaddingQuarter: string;
21
22
  calendarRightPaddingDate: string;
22
23
  calendarRightPaddingDatetime: string;
23
24
  calendarRightPaddingDaterange: string;
24
25
  calendarRightPaddingDatetimerange: string;
25
26
  calendarRightPaddingMonth: string;
26
27
  calendarRightPaddingYear: string;
28
+ calendarRightPaddingQuarter: string;
27
29
  };
28
30
  export default _default;
@@ -21,10 +21,12 @@ exports.default = {
21
21
  calendarLeftPaddingDatetimerange: '4px 12px',
22
22
  calendarLeftPaddingMonth: '0',
23
23
  calendarLeftPaddingYear: '0',
24
+ calendarLeftPaddingQuarter: '0',
24
25
  calendarRightPaddingDate: '6px 12px 4px 12px',
25
26
  calendarRightPaddingDatetime: '4px 12px',
26
27
  calendarRightPaddingDaterange: '6px 12px 4px 12px',
27
28
  calendarRightPaddingDatetimerange: '4px 12px',
28
29
  calendarRightPaddingMonth: '0',
29
- calendarRightPaddingYear: '0'
30
+ calendarRightPaddingYear: '0',
31
+ calendarRightPaddingQuarter: '0'
30
32
  };