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
@@ -2,8 +2,8 @@ import { h, defineComponent } from 'vue';
2
2
  import { VirtualList } from 'vueuc';
3
3
  import { NButton, NxButton } from '../../../button';
4
4
  import { NBaseFocusDetector, NScrollbar } from '../../../_internal';
5
- import { useCalendar } from './use-calendar';
6
5
  import { MONTH_ITEM_HEIGHT } from '../config';
6
+ import { useCalendar, useCalendarProps } from './use-calendar';
7
7
  /**
8
8
  * Month Panel
9
9
  * Update picker value on:
@@ -12,32 +12,41 @@ import { MONTH_ITEM_HEIGHT } from '../config';
12
12
  */
13
13
  export default defineComponent({
14
14
  name: 'MonthPanel',
15
- props: Object.assign(Object.assign({}, useCalendar.props), { type: {
15
+ props: Object.assign(Object.assign({}, useCalendarProps), { type: {
16
16
  type: String,
17
17
  required: true
18
18
  } }),
19
19
  setup(props) {
20
20
  const useCalendarRef = useCalendar(props, props.type);
21
+ const getRenderContent = (item) => {
22
+ switch (item.type) {
23
+ case 'year':
24
+ return item.dateObject.year;
25
+ case 'month':
26
+ return item.dateObject.month + 1;
27
+ case 'quarter':
28
+ return `Q ${item.dateObject.quarter}`;
29
+ }
30
+ };
21
31
  const renderItem = (item, i, mergedClsPrefix) => {
22
32
  const { mergedIsDateDisabled, handleDateClick } = useCalendarRef;
23
33
  return (h("div", { "data-n-date": true, key: i, class: [
24
34
  `${mergedClsPrefix}-date-panel-month-calendar__picker-col-item`,
25
35
  {
26
- [`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--current`]: item.type === 'month'
27
- ? item.isCurrentMonth
28
- : item.isCurrentYear,
36
+ [`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--current`]: item.isCurrent,
29
37
  [`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--selected`]: item.selected,
30
38
  [`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--disabled`]: mergedIsDateDisabled(item.ts)
31
39
  }
32
- ], onClick: () => handleDateClick(item) }, item.type === 'month'
33
- ? item.dateObject.month + 1
34
- : item.dateObject.year));
40
+ ], onClick: () => handleDateClick(item) }, getRenderContent(item)));
35
41
  };
36
42
  return Object.assign(Object.assign({}, useCalendarRef), { renderItem });
37
43
  },
38
44
  render() {
39
45
  const { mergedClsPrefix, mergedTheme, shortcuts, actions, renderItem, type } = this;
40
- return (h("div", { ref: "selfRef", tabindex: 0, class: `${mergedClsPrefix}-date-panel ${mergedClsPrefix}-date-panel--month`, onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
46
+ return (h("div", { ref: "selfRef", tabindex: 0, class: [
47
+ `${mergedClsPrefix}-date-panel`,
48
+ `${mergedClsPrefix}-date-panel--month`
49
+ ], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
41
50
  h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar` },
42
51
  h(NScrollbar, { ref: "scrollbarInstRef", class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col`, theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, container: this.virtualListContainer, content: this.virtualListContent, horizontalRailStyle: { zIndex: 1 }, verticalRailStyle: { zIndex: 1 } }, {
43
52
  default: () => (h(VirtualList, { ref: "yearScrollRef", items: this.yearArray, itemSize: MONTH_ITEM_HEIGHT, showScrollbar: false, keyField: "ts", onScroll: this.handleVirtualListScroll, paddingBottom: 4 }, {
@@ -46,11 +55,13 @@ export default defineComponent({
46
55
  }
47
56
  }))
48
57
  }),
49
- type === 'month' ? (h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col` },
58
+ type === 'month' || type === 'quarter' ? (h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col` },
50
59
  h(NScrollbar, { ref: "monthScrollRef", theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar }, {
51
60
  default: () => [
52
- this.monthArray.map((monthItem, i) => renderItem(monthItem, i, mergedClsPrefix)),
53
- h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__padding` })
61
+ (type === 'month'
62
+ ? this.monthArray
63
+ : this.quarterArray).map((item, i) => renderItem(item, i, mergedClsPrefix)),
64
+ h("div", { class: `${mergedClsPrefix}-date-panel-${type}-calendar__padding` })
54
65
  ]
55
66
  }))) : null),
56
67
  this.datePickerSlots.footer ? (h("div", { class: `${mergedClsPrefix}-date-panel-footer` }, {
@@ -1,6 +1,6 @@
1
1
  import { ExtractPropTypes, PropType } from 'vue';
2
- import { Shortcuts } from '../interface';
3
- import type { DateItem, MonthItem, YearItem } from '../utils';
2
+ import type { Shortcuts } from '../interface';
3
+ import type { DateItem, MonthItem, YearItem, QuarterItem } from '../utils';
4
4
  declare const useCalendarProps: {
5
5
  readonly actions: {
6
6
  readonly type: PropType<string[]>;
@@ -20,6 +20,7 @@ declare const useCalendarProps: {
20
20
  readonly default: null;
21
21
  };
22
22
  readonly shortcuts: PropType<Shortcuts>;
23
+ readonly defaultTime: PropType<import("../interface").DefaultTime>;
23
24
  readonly onConfirm: FunctionConstructor;
24
25
  readonly onClose: PropType<import("../interface").OnClose>;
25
26
  readonly onTabOut: FunctionConstructor;
@@ -28,8 +29,8 @@ declare const useCalendarProps: {
28
29
  readonly required: true;
29
30
  };
30
31
  };
31
- declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year'): {
32
- handleDateClick: (dateItem: DateItem | MonthItem | YearItem) => void;
32
+ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year' | 'quarter'): {
33
+ handleDateClick: (dateItem: DateItem | MonthItem | YearItem | QuarterItem) => void;
33
34
  handleDateInputBlur: () => void;
34
35
  handleDateInput: (value: string) => void;
35
36
  handleTimePickerChange: (value: number | null) => void;
@@ -212,12 +213,14 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
212
213
  calendarLeftPaddingDatetimerange: string;
213
214
  calendarLeftPaddingMonth: string;
214
215
  calendarLeftPaddingYear: string;
216
+ calendarLeftPaddingQuarter: string;
215
217
  calendarRightPaddingDate: string;
216
218
  calendarRightPaddingDatetime: string;
217
219
  calendarRightPaddingDaterange: string;
218
220
  calendarRightPaddingDatetimerange: string;
219
221
  calendarRightPaddingMonth: string;
220
222
  calendarRightPaddingYear: string;
223
+ calendarRightPaddingQuarter: string;
221
224
  };
222
225
  peers: {
223
226
  Input: import("../../../_mixins").Theme<"Input", {
@@ -294,9 +297,9 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
294
297
  fontSizeMedium: string;
295
298
  fontSizeLarge: string;
296
299
  opacityDisabled: string;
297
- colorOpacitySecondary: number;
298
- colorOpacitySecondaryHover: number;
299
- colorOpacitySecondaryPressed: number;
300
+ colorOpacitySecondary: string;
301
+ colorOpacitySecondaryHover: string;
302
+ colorOpacitySecondaryPressed: string;
300
303
  colorSecondary: string;
301
304
  colorSecondaryHover: string;
302
305
  colorSecondaryPressed: string;
@@ -519,9 +522,9 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
519
522
  fontSizeMedium: string;
520
523
  fontSizeLarge: string;
521
524
  opacityDisabled: string;
522
- colorOpacitySecondary: number;
523
- colorOpacitySecondaryHover: number;
524
- colorOpacitySecondaryPressed: number;
525
+ colorOpacitySecondary: string;
526
+ colorOpacitySecondaryHover: string;
527
+ colorOpacitySecondaryPressed: string;
525
528
  colorSecondary: string;
526
529
  colorSecondaryHover: string;
527
530
  colorSecondaryPressed: string;
@@ -806,9 +809,9 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
806
809
  fontSizeMedium: string;
807
810
  fontSizeLarge: string;
808
811
  opacityDisabled: string;
809
- colorOpacitySecondary: number;
810
- colorOpacitySecondaryHover: number;
811
- colorOpacitySecondaryPressed: number;
812
+ colorOpacitySecondary: string;
813
+ colorOpacitySecondaryHover: string;
814
+ colorOpacitySecondaryPressed: string;
812
815
  colorSecondary: string;
813
816
  colorSecondaryHover: string;
814
817
  colorSecondaryPressed: string;
@@ -1074,6 +1077,11 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
1074
1077
  yearFormat: string;
1075
1078
  monthFormat: string;
1076
1079
  dayFormat: string;
1080
+ yearTypeFormat: string;
1081
+ monthTypeFormat: string;
1082
+ dateFormat: string;
1083
+ dateTimeFormat: string;
1084
+ quarterFormat: string;
1077
1085
  clear: string;
1078
1086
  now: string;
1079
1087
  confirm: string;
@@ -1082,6 +1090,8 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
1082
1090
  datePlaceholder: string;
1083
1091
  datetimePlaceholder: string;
1084
1092
  monthPlaceholder: string;
1093
+ yearPlaceholder: string;
1094
+ quarterPlaceholder: string;
1085
1095
  startDatePlaceholder: string;
1086
1096
  endDatePlaceholder: string;
1087
1097
  startDatetimePlaceholder: string;
@@ -1115,6 +1125,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
1115
1125
  dateArray: import("vue").ComputedRef<DateItem[]>;
1116
1126
  monthArray: import("vue").ComputedRef<MonthItem[]>;
1117
1127
  yearArray: import("vue").ComputedRef<YearItem[]>;
1128
+ quarterArray: import("vue").ComputedRef<QuarterItem[]>;
1118
1129
  calendarYear: import("vue").ComputedRef<string>;
1119
1130
  calendarMonth: import("vue").ComputedRef<string>;
1120
1131
  weekdays: import("vue").ComputedRef<string[]>;
@@ -1128,33 +1139,4 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
1128
1139
  handleSingleShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
1129
1140
  handleSingleShortcutClick: (shortcut: Shortcuts[string]) => void;
1130
1141
  };
1131
- declare namespace useCalendar {
1132
- var props: {
1133
- readonly actions: {
1134
- readonly type: PropType<string[]>;
1135
- readonly default: () => string[];
1136
- };
1137
- readonly active: BooleanConstructor;
1138
- readonly dateFormat: {
1139
- readonly type: StringConstructor;
1140
- readonly default: "yyyy-MM-dd";
1141
- };
1142
- readonly timeFormat: {
1143
- readonly type: StringConstructor;
1144
- readonly default: "HH:mm:ss";
1145
- };
1146
- readonly value: {
1147
- readonly type: PropType<import("../interface").Value | null>;
1148
- readonly default: null;
1149
- };
1150
- readonly shortcuts: PropType<Shortcuts>;
1151
- readonly onConfirm: FunctionConstructor;
1152
- readonly onClose: PropType<import("../interface").OnClose>;
1153
- readonly onTabOut: FunctionConstructor;
1154
- readonly onUpdateValue: {
1155
- readonly type: PropType<import("../interface").OnPanelUpdateValue>;
1156
- readonly required: true;
1157
- };
1158
- };
1159
- }
1160
- export { useCalendar };
1142
+ export { useCalendar, useCalendarProps };
@@ -1,16 +1,16 @@
1
1
  import { ref, computed, inject, watch } from 'vue';
2
- import { addMonths, addYears, isSameMonth, getTime, format, set, getYear, getMonth, getDate, isValid, startOfDay, startOfSecond, startOfMonth, startOfYear } from 'date-fns';
3
- import { dateArray, monthArray, strictParse, yearArray } from '../utils';
4
- import { usePanelCommon } from './use-panel-common';
2
+ import { addMonths, addYears, isSameMonth, getTime, format, set, getYear, getMonth, getDate, isValid, startOfDay, startOfSecond, startOfMonth, startOfYear, startOfQuarter, setQuarter, setYear } from 'date-fns';
3
+ import { getDefaultTime, dateArray, monthArray, strictParse, yearArray, quarterArray } from '../utils';
5
4
  import { datePickerInjectionKey } from '../interface';
6
- const useCalendarProps = Object.assign(Object.assign({}, usePanelCommon.props), { actions: {
5
+ import { usePanelCommon, usePanelCommonProps } from './use-panel-common';
6
+ const useCalendarProps = Object.assign(Object.assign({}, usePanelCommonProps), { actions: {
7
7
  type: Array,
8
8
  default: () => ['now', 'clear', 'confirm']
9
9
  } });
10
10
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
11
11
  function useCalendar(props, type) {
12
12
  const panelCommon = usePanelCommon(props);
13
- const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots, scrollYearMonth
13
+ const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots, scrollPickerColumns
14
14
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15
15
  } = inject(datePickerInjectionKey);
16
16
  const validation = {
@@ -43,6 +43,9 @@ function useCalendar(props, type) {
43
43
  const yearArrayRef = computed(() => {
44
44
  return yearArray(calendarValueRef.value, props.value, nowRef.value);
45
45
  });
46
+ const querterArrayRef = computed(() => {
47
+ return quarterArray(calendarValueRef.value, props.value, nowRef.value);
48
+ });
46
49
  const weekdaysRef = computed(() => {
47
50
  return dateArrayRef.value.slice(0, 7).map((dateItem) => {
48
51
  const { ts } = dateItem;
@@ -76,6 +79,8 @@ function useCalendar(props, type) {
76
79
  return getTime(startOfMonth(value));
77
80
  if (type === 'year')
78
81
  return getTime(startOfYear(value));
82
+ if (type === 'quarter')
83
+ return getTime(startOfQuarter(value));
79
84
  return getTime(startOfDay(value));
80
85
  }
81
86
  function mergedIsDateDisabled(ts) {
@@ -143,17 +148,30 @@ function useCalendar(props, type) {
143
148
  else {
144
149
  newValue = Date.now();
145
150
  }
146
- newValue = getTime(set(newValue, dateItem.dateObject));
147
- panelCommon.doUpdateValue(sanitizeValue(newValue), type === 'date' || type === 'year');
148
- if (type === 'date') {
149
- panelCommon.doClose();
150
- }
151
- else if (type === 'month') {
152
- panelCommon.disableTransitionOneTick();
153
- scrollYearMonth(newValue);
151
+ if (type === 'datetime' &&
152
+ props.defaultTime !== null &&
153
+ !Array.isArray(props.defaultTime)) {
154
+ const time = getDefaultTime(props.defaultTime);
155
+ if (time) {
156
+ newValue = getTime(set(newValue, time)); // setDate getTime(addMilliseconds(startOfDay(newValue), time))
157
+ }
154
158
  }
155
- else if (type === 'year') {
156
- panelCommon.doClose();
159
+ newValue = getTime(dateItem.type === 'quarter' && dateItem.dateObject.quarter
160
+ ? setQuarter(setYear(newValue, dateItem.dateObject.year), dateItem.dateObject.quarter)
161
+ : set(newValue, dateItem.dateObject));
162
+ panelCommon.doUpdateValue(sanitizeValue(newValue), type === 'date' || type === 'year');
163
+ switch (type) {
164
+ case 'date':
165
+ case 'year':
166
+ panelCommon.doClose();
167
+ break;
168
+ case 'month':
169
+ panelCommon.disableTransitionOneTick();
170
+ scrollPickerColumns(newValue);
171
+ break;
172
+ case 'quarter':
173
+ scrollPickerColumns(newValue);
174
+ break;
157
175
  }
158
176
  }
159
177
  function deriveDateInputValue(time) {
@@ -227,7 +245,7 @@ function useCalendar(props, type) {
227
245
  panelCommon.clearPendingValue();
228
246
  handleConfirmClick();
229
247
  }
230
- return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
248
+ return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, quarterArray: querterArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
231
249
  nextYear,
232
250
  prevYear,
233
251
  nextMonth,
@@ -249,5 +267,4 @@ function useCalendar(props, type) {
249
267
  yearScrollRef,
250
268
  scrollbarInstRef });
251
269
  }
252
- useCalendar.props = useCalendarProps;
253
- export { useCalendar };
270
+ export { useCalendar, useCalendarProps };
@@ -1,6 +1,6 @@
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;
@@ -20,6 +20,7 @@ declare const useDualCalendarProps: {
20
20
  readonly default: null;
21
21
  };
22
22
  readonly shortcuts: import("vue").PropType<Shortcuts>;
23
+ readonly defaultTime: import("vue").PropType<import("../interface").DefaultTime>;
23
24
  readonly onConfirm: FunctionConstructor;
24
25
  readonly onClose: import("vue").PropType<import("../interface").OnClose>;
25
26
  readonly onTabOut: FunctionConstructor;
@@ -210,12 +211,14 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
210
211
  calendarLeftPaddingDatetimerange: string;
211
212
  calendarLeftPaddingMonth: string;
212
213
  calendarLeftPaddingYear: string;
214
+ calendarLeftPaddingQuarter: string;
213
215
  calendarRightPaddingDate: string;
214
216
  calendarRightPaddingDatetime: string;
215
217
  calendarRightPaddingDaterange: string;
216
218
  calendarRightPaddingDatetimerange: string;
217
219
  calendarRightPaddingMonth: string;
218
220
  calendarRightPaddingYear: string;
221
+ calendarRightPaddingQuarter: string;
219
222
  };
220
223
  peers: {
221
224
  Input: import("../../../_mixins").Theme<"Input", {
@@ -292,9 +295,9 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
292
295
  fontSizeMedium: string;
293
296
  fontSizeLarge: string;
294
297
  opacityDisabled: string;
295
- colorOpacitySecondary: number;
296
- colorOpacitySecondaryHover: number;
297
- colorOpacitySecondaryPressed: number;
298
+ colorOpacitySecondary: string;
299
+ colorOpacitySecondaryHover: string;
300
+ colorOpacitySecondaryPressed: string;
298
301
  colorSecondary: string;
299
302
  colorSecondaryHover: string;
300
303
  colorSecondaryPressed: string;
@@ -517,9 +520,9 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
517
520
  fontSizeMedium: string;
518
521
  fontSizeLarge: string;
519
522
  opacityDisabled: string;
520
- colorOpacitySecondary: number;
521
- colorOpacitySecondaryHover: number;
522
- colorOpacitySecondaryPressed: number;
523
+ colorOpacitySecondary: string;
524
+ colorOpacitySecondaryHover: string;
525
+ colorOpacitySecondaryPressed: string;
523
526
  colorSecondary: string;
524
527
  colorSecondaryHover: string;
525
528
  colorSecondaryPressed: string;
@@ -804,9 +807,9 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
804
807
  fontSizeMedium: string;
805
808
  fontSizeLarge: string;
806
809
  opacityDisabled: string;
807
- colorOpacitySecondary: number;
808
- colorOpacitySecondaryHover: number;
809
- colorOpacitySecondaryPressed: number;
810
+ colorOpacitySecondary: string;
811
+ colorOpacitySecondaryHover: string;
812
+ colorOpacitySecondaryPressed: string;
810
813
  colorSecondary: string;
811
814
  colorSecondaryHover: string;
812
815
  colorSecondaryPressed: string;
@@ -1072,6 +1075,11 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
1072
1075
  yearFormat: string;
1073
1076
  monthFormat: string;
1074
1077
  dayFormat: string;
1078
+ yearTypeFormat: string;
1079
+ monthTypeFormat: string;
1080
+ dateFormat: string;
1081
+ dateTimeFormat: string;
1082
+ quarterFormat: string;
1075
1083
  clear: string;
1076
1084
  now: string;
1077
1085
  confirm: string;
@@ -1080,6 +1088,8 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
1080
1088
  datePlaceholder: string;
1081
1089
  datetimePlaceholder: string;
1082
1090
  monthPlaceholder: string;
1091
+ yearPlaceholder: string;
1092
+ quarterPlaceholder: string;
1083
1093
  startDatePlaceholder: string;
1084
1094
  endDatePlaceholder: string;
1085
1095
  startDatetimePlaceholder: string;
@@ -1128,33 +1138,4 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
1128
1138
  handleRangeShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
1129
1139
  handleRangeShortcutClick: (shortcut: Shortcuts[string]) => void;
1130
1140
  };
1131
- declare namespace useDualCalendar {
1132
- var props: {
1133
- readonly actions: {
1134
- readonly type: ArrayConstructor;
1135
- readonly default: () => string[];
1136
- };
1137
- readonly active: BooleanConstructor;
1138
- readonly dateFormat: {
1139
- readonly type: StringConstructor;
1140
- readonly default: "yyyy-MM-dd";
1141
- };
1142
- readonly timeFormat: {
1143
- readonly type: StringConstructor;
1144
- readonly default: "HH:mm:ss";
1145
- };
1146
- readonly value: {
1147
- readonly type: import("vue").PropType<import("../interface").Value | null>;
1148
- readonly default: null;
1149
- };
1150
- readonly shortcuts: import("vue").PropType<Shortcuts>;
1151
- readonly onConfirm: FunctionConstructor;
1152
- readonly onClose: import("vue").PropType<import("../interface").OnClose>;
1153
- readonly onTabOut: FunctionConstructor;
1154
- readonly onUpdateValue: {
1155
- readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
1156
- readonly required: true;
1157
- };
1158
- };
1159
- }
1160
- export { useDualCalendar };
1141
+ export { useDualCalendar, useDualCalendarProps };
@@ -1,9 +1,9 @@
1
1
  import { inject, computed, watch, ref } from 'vue';
2
- import { addMonths, format, getTime, getYear, getMonth, startOfMonth, isValid, startOfSecond, startOfDay, set, getDate } from 'date-fns';
3
- import { dateArray, strictParse } from '../utils';
4
- import { usePanelCommon } from './use-panel-common';
2
+ import { addMonths, format, getYear, getMonth, startOfMonth, isValid, startOfSecond, startOfDay, set, getDate, getTime } from 'date-fns';
3
+ import { getDefaultTime, dateArray, strictParse } from '../utils';
5
4
  import { datePickerInjectionKey } from '../interface';
6
- const useDualCalendarProps = Object.assign(Object.assign({}, usePanelCommon.props), { actions: {
5
+ import { usePanelCommon, usePanelCommonProps } from './use-panel-common';
6
+ const useDualCalendarProps = Object.assign(Object.assign({}, usePanelCommonProps), { actions: {
7
7
  type: Array,
8
8
  default: () => ['clear', 'confirm']
9
9
  } });
@@ -287,8 +287,24 @@ function useDualCalendar(props, type = 'datetime') {
287
287
  if (typeof startTime !== 'number') {
288
288
  startTime = getTime(startTime);
289
289
  }
290
- if (typeof endTime !== 'number') {
291
- endTime = getTime(endTime);
290
+ let startDefaultTime;
291
+ let endDefaultTime;
292
+ if (type === 'datetimerange') {
293
+ const { defaultTime } = props;
294
+ if (Array.isArray(defaultTime)) {
295
+ startDefaultTime = getDefaultTime(defaultTime[0]);
296
+ endDefaultTime = getDefaultTime(defaultTime[1]);
297
+ }
298
+ else {
299
+ startDefaultTime = getDefaultTime(defaultTime);
300
+ endDefaultTime = startDefaultTime;
301
+ }
302
+ }
303
+ if (startDefaultTime) {
304
+ startTime = getTime(set(startTime, startDefaultTime));
305
+ }
306
+ if (endDefaultTime) {
307
+ endTime = getTime(set(endTime, endDefaultTime));
292
308
  }
293
309
  panelCommon.doUpdateValue([startTime, endTime], false);
294
310
  }
@@ -467,5 +483,4 @@ function useDualCalendar(props, type = 'datetime') {
467
483
  handleEndDateInputBlur,
468
484
  datePickerSlots, shortcuts: shortcutsRef });
469
485
  }
470
- useDualCalendar.props = useDualCalendarProps;
471
- export { useDualCalendar };
486
+ export { useDualCalendar, useDualCalendarProps };
@@ -1,5 +1,5 @@
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
5
  readonly dateFormat: {
@@ -15,6 +15,7 @@ declare const usePanelCommonProps: {
15
15
  readonly default: null;
16
16
  };
17
17
  readonly shortcuts: PropType<Shortcuts>;
18
+ readonly defaultTime: PropType<DefaultTime>;
18
19
  readonly onConfirm: FunctionConstructor;
19
20
  readonly onClose: PropType<OnClose>;
20
21
  readonly onTabOut: FunctionConstructor;
@@ -176,12 +177,14 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
176
177
  calendarLeftPaddingDatetimerange: string;
177
178
  calendarLeftPaddingMonth: string;
178
179
  calendarLeftPaddingYear: string;
180
+ calendarLeftPaddingQuarter: string;
179
181
  calendarRightPaddingDate: string;
180
182
  calendarRightPaddingDatetime: string;
181
183
  calendarRightPaddingDaterange: string;
182
184
  calendarRightPaddingDatetimerange: string;
183
185
  calendarRightPaddingMonth: string;
184
186
  calendarRightPaddingYear: string;
187
+ calendarRightPaddingQuarter: string;
185
188
  };
186
189
  peers: {
187
190
  Input: import("../../../_mixins").Theme<"Input", {
@@ -258,9 +261,9 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
258
261
  fontSizeMedium: string;
259
262
  fontSizeLarge: string;
260
263
  opacityDisabled: string;
261
- colorOpacitySecondary: number;
262
- colorOpacitySecondaryHover: number;
263
- colorOpacitySecondaryPressed: number;
264
+ colorOpacitySecondary: string;
265
+ colorOpacitySecondaryHover: string;
266
+ colorOpacitySecondaryPressed: string;
264
267
  colorSecondary: string;
265
268
  colorSecondaryHover: string;
266
269
  colorSecondaryPressed: string;
@@ -483,9 +486,9 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
483
486
  fontSizeMedium: string;
484
487
  fontSizeLarge: string;
485
488
  opacityDisabled: string;
486
- colorOpacitySecondary: number;
487
- colorOpacitySecondaryHover: number;
488
- colorOpacitySecondaryPressed: number;
489
+ colorOpacitySecondary: string;
490
+ colorOpacitySecondaryHover: string;
491
+ colorOpacitySecondaryPressed: string;
489
492
  colorSecondary: string;
490
493
  colorSecondaryHover: string;
491
494
  colorSecondaryPressed: string;
@@ -770,9 +773,9 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
770
773
  fontSizeMedium: string;
771
774
  fontSizeLarge: string;
772
775
  opacityDisabled: string;
773
- colorOpacitySecondary: number;
774
- colorOpacitySecondaryHover: number;
775
- colorOpacitySecondaryPressed: number;
776
+ colorOpacitySecondary: string;
777
+ colorOpacitySecondaryHover: string;
778
+ colorOpacitySecondaryPressed: string;
776
779
  colorSecondary: string;
777
780
  colorSecondaryHover: string;
778
781
  colorSecondaryPressed: string;
@@ -1039,6 +1042,11 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
1039
1042
  yearFormat: string;
1040
1043
  monthFormat: string;
1041
1044
  dayFormat: string;
1045
+ yearTypeFormat: string;
1046
+ monthTypeFormat: string;
1047
+ dateFormat: string;
1048
+ dateTimeFormat: string;
1049
+ quarterFormat: string;
1042
1050
  clear: string;
1043
1051
  now: string;
1044
1052
  confirm: string;
@@ -1047,6 +1055,8 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
1047
1055
  datePlaceholder: string;
1048
1056
  datetimePlaceholder: string;
1049
1057
  monthPlaceholder: string;
1058
+ yearPlaceholder: string;
1059
+ quarterPlaceholder: string;
1050
1060
  startDatePlaceholder: string;
1051
1061
  endDatePlaceholder: string;
1052
1062
  startDatetimePlaceholder: string;
@@ -1070,29 +1080,4 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
1070
1080
  getShortcutValue: (shortcut: Shortcuts[string]) => number | [number, number];
1071
1081
  handleShortcutMouseleave: () => void;
1072
1082
  };
1073
- declare namespace usePanelCommon {
1074
- var props: {
1075
- readonly active: BooleanConstructor;
1076
- readonly dateFormat: {
1077
- readonly type: StringConstructor;
1078
- readonly default: "yyyy-MM-dd";
1079
- };
1080
- readonly timeFormat: {
1081
- readonly type: StringConstructor;
1082
- readonly default: "HH:mm:ss";
1083
- };
1084
- readonly value: {
1085
- readonly type: PropType<Value | null>;
1086
- readonly default: null;
1087
- };
1088
- readonly shortcuts: PropType<Shortcuts>;
1089
- readonly onConfirm: FunctionConstructor;
1090
- readonly onClose: PropType<OnClose>;
1091
- readonly onTabOut: FunctionConstructor;
1092
- readonly onUpdateValue: {
1093
- readonly type: PropType<OnPanelUpdateValue>;
1094
- readonly required: true;
1095
- };
1096
- };
1097
- }
1098
- export { usePanelCommon };
1083
+ export { usePanelCommon, usePanelCommonProps };
@@ -18,6 +18,7 @@ const usePanelCommonProps = {
18
18
  default: null
19
19
  },
20
20
  shortcuts: Object,
21
+ defaultTime: [Number, String, Array],
21
22
  onConfirm: Function,
22
23
  onClose: Function,
23
24
  onTabOut: Function,
@@ -139,5 +140,4 @@ function usePanelCommon(props) {
139
140
  handleShortcutMouseleave: restorePendingValue
140
141
  };
141
142
  }
142
- usePanelCommon.props = usePanelCommonProps;
143
- export { usePanelCommon };
143
+ export { usePanelCommon, usePanelCommonProps };