@v-c/picker 0.0.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 (429) hide show
  1. package/LICENSE +21 -0
  2. package/dist/PickerInput/Popup/Footer.cjs +115 -0
  3. package/dist/PickerInput/Popup/Footer.d.ts +19 -0
  4. package/dist/PickerInput/Popup/Footer.js +109 -0
  5. package/dist/PickerInput/Popup/PopupPanel.cjs +413 -0
  6. package/dist/PickerInput/Popup/PopupPanel.d.ts +11 -0
  7. package/dist/PickerInput/Popup/PopupPanel.js +407 -0
  8. package/dist/PickerInput/Popup/PresetPanel.cjs +54 -0
  9. package/dist/PickerInput/Popup/PresetPanel.d.ts +16 -0
  10. package/dist/PickerInput/Popup/PresetPanel.js +48 -0
  11. package/dist/PickerInput/Popup/index.cjs +528 -0
  12. package/dist/PickerInput/Popup/index.d.ts +37 -0
  13. package/dist/PickerInput/Popup/index.js +522 -0
  14. package/dist/PickerInput/RangePicker.cjs +1910 -0
  15. package/dist/PickerInput/RangePicker.d.ts +57 -0
  16. package/dist/PickerInput/RangePicker.js +1901 -0
  17. package/dist/PickerInput/Selector/Icon.cjs +89 -0
  18. package/dist/PickerInput/Selector/Icon.d.ts +11 -0
  19. package/dist/PickerInput/Selector/Icon.js +83 -0
  20. package/dist/PickerInput/Selector/Input.cjs +376 -0
  21. package/dist/PickerInput/Selector/Input.d.ts +9 -0
  22. package/dist/PickerInput/Selector/Input.js +370 -0
  23. package/dist/PickerInput/Selector/MaskFormat.cjs +72 -0
  24. package/dist/PickerInput/Selector/MaskFormat.d.ts +22 -0
  25. package/dist/PickerInput/Selector/MaskFormat.js +68 -0
  26. package/dist/PickerInput/Selector/RangeSelector.cjs +1390 -0
  27. package/dist/PickerInput/Selector/RangeSelector.d.ts +28 -0
  28. package/dist/PickerInput/Selector/RangeSelector.js +1383 -0
  29. package/dist/PickerInput/Selector/SingleSelector/MultipleDates.cjs +110 -0
  30. package/dist/PickerInput/Selector/SingleSelector/MultipleDates.d.ts +13 -0
  31. package/dist/PickerInput/Selector/SingleSelector/MultipleDates.js +103 -0
  32. package/dist/PickerInput/Selector/SingleSelector/index.cjs +1358 -0
  33. package/dist/PickerInput/Selector/SingleSelector/index.d.ts +21 -0
  34. package/dist/PickerInput/Selector/SingleSelector/index.js +1352 -0
  35. package/dist/PickerInput/Selector/hooks/useClearIcon.cjs +17 -0
  36. package/dist/PickerInput/Selector/hooks/useClearIcon.d.ts +17 -0
  37. package/dist/PickerInput/Selector/hooks/useClearIcon.js +11 -0
  38. package/dist/PickerInput/Selector/hooks/useInputHooks.cjs +125 -0
  39. package/dist/PickerInput/Selector/hooks/useInputHooks.d.ts +56 -0
  40. package/dist/PickerInput/Selector/hooks/useInputHooks.js +120 -0
  41. package/dist/PickerInput/Selector/hooks/useRootProps.cjs +14 -0
  42. package/dist/PickerInput/Selector/hooks/useRootProps.d.ts +2 -0
  43. package/dist/PickerInput/Selector/hooks/useRootProps.js +9 -0
  44. package/dist/PickerInput/Selector/util.cjs +32 -0
  45. package/dist/PickerInput/Selector/util.d.ts +5 -0
  46. package/dist/PickerInput/Selector/util.js +30 -0
  47. package/dist/PickerInput/SinglePicker.cjs +1881 -0
  48. package/dist/PickerInput/SinglePicker.d.ts +46 -0
  49. package/dist/PickerInput/SinglePicker.js +1873 -0
  50. package/dist/PickerInput/context.cjs +12 -0
  51. package/dist/PickerInput/context.d.ts +16 -0
  52. package/dist/PickerInput/context.js +9 -0
  53. package/dist/PickerInput/hooks/useCellRender.cjs +25 -0
  54. package/dist/PickerInput/hooks/useCellRender.d.ts +3 -0
  55. package/dist/PickerInput/hooks/useCellRender.js +20 -0
  56. package/dist/PickerInput/hooks/useDelayState.cjs +34 -0
  57. package/dist/PickerInput/hooks/useDelayState.d.ts +2 -0
  58. package/dist/PickerInput/hooks/useDelayState.js +29 -0
  59. package/dist/PickerInput/hooks/useDisabledBoundary.cjs +15 -0
  60. package/dist/PickerInput/hooks/useDisabledBoundary.d.ts +8 -0
  61. package/dist/PickerInput/hooks/useDisabledBoundary.js +11 -0
  62. package/dist/PickerInput/hooks/useFieldFormat.cjs +17 -0
  63. package/dist/PickerInput/hooks/useFieldFormat.d.ts +3 -0
  64. package/dist/PickerInput/hooks/useFieldFormat.js +15 -0
  65. package/dist/PickerInput/hooks/useFieldsInvalidate.cjs +24 -0
  66. package/dist/PickerInput/hooks/useFieldsInvalidate.d.ts +6 -0
  67. package/dist/PickerInput/hooks/useFieldsInvalidate.js +19 -0
  68. package/dist/PickerInput/hooks/useFilledProps.cjs +103 -0
  69. package/dist/PickerInput/hooks/useFilledProps.d.ts +33 -0
  70. package/dist/PickerInput/hooks/useFilledProps.js +98 -0
  71. package/dist/PickerInput/hooks/useInputReadOnly.cjs +13 -0
  72. package/dist/PickerInput/hooks/useInputReadOnly.d.ts +3 -0
  73. package/dist/PickerInput/hooks/useInputReadOnly.js +8 -0
  74. package/dist/PickerInput/hooks/useInvalidate.cjs +34 -0
  75. package/dist/PickerInput/hooks/useInvalidate.d.ts +10 -0
  76. package/dist/PickerInput/hooks/useInvalidate.js +30 -0
  77. package/dist/PickerInput/hooks/useLockEffect.cjs +16 -0
  78. package/dist/PickerInput/hooks/useLockEffect.d.ts +6 -0
  79. package/dist/PickerInput/hooks/useLockEffect.js +11 -0
  80. package/dist/PickerInput/hooks/useOpen.cjs +15 -0
  81. package/dist/PickerInput/hooks/useOpen.d.ts +7 -0
  82. package/dist/PickerInput/hooks/useOpen.js +10 -0
  83. package/dist/PickerInput/hooks/usePresets.cjs +21 -0
  84. package/dist/PickerInput/hooks/usePresets.d.ts +3 -0
  85. package/dist/PickerInput/hooks/usePresets.js +16 -0
  86. package/dist/PickerInput/hooks/useRangeActive.cjs +57 -0
  87. package/dist/PickerInput/hooks/useRangeActive.d.ts +9 -0
  88. package/dist/PickerInput/hooks/useRangeActive.js +52 -0
  89. package/dist/PickerInput/hooks/useRangeDisabledDate.cjs +21 -0
  90. package/dist/PickerInput/hooks/useRangeDisabledDate.d.ts +9 -0
  91. package/dist/PickerInput/hooks/useRangeDisabledDate.js +17 -0
  92. package/dist/PickerInput/hooks/useRangePickerValue.cjs +100 -0
  93. package/dist/PickerInput/hooks/useRangePickerValue.d.ts +5 -0
  94. package/dist/PickerInput/hooks/useRangePickerValue.js +94 -0
  95. package/dist/PickerInput/hooks/useRangeValue.cjs +134 -0
  96. package/dist/PickerInput/hooks/useRangeValue.d.ts +21 -0
  97. package/dist/PickerInput/hooks/useRangeValue.js +128 -0
  98. package/dist/PickerInput/hooks/useShowNow.cjs +15 -0
  99. package/dist/PickerInput/hooks/useShowNow.d.ts +3 -0
  100. package/dist/PickerInput/hooks/useShowNow.js +10 -0
  101. package/dist/PickerPanel/DatePanel/index.cjs +294 -0
  102. package/dist/PickerPanel/DatePanel/index.d.ts +9 -0
  103. package/dist/PickerPanel/DatePanel/index.js +288 -0
  104. package/dist/PickerPanel/DateTimePanel/index.cjs +180 -0
  105. package/dist/PickerPanel/DateTimePanel/index.d.ts +3 -0
  106. package/dist/PickerPanel/DateTimePanel/index.js +174 -0
  107. package/dist/PickerPanel/DecadePanel/index.cjs +230 -0
  108. package/dist/PickerPanel/DecadePanel/index.d.ts +3 -0
  109. package/dist/PickerPanel/DecadePanel/index.js +224 -0
  110. package/dist/PickerPanel/MonthPanel/index.cjs +219 -0
  111. package/dist/PickerPanel/MonthPanel/index.d.ts +3 -0
  112. package/dist/PickerPanel/MonthPanel/index.js +213 -0
  113. package/dist/PickerPanel/PanelBody.cjs +157 -0
  114. package/dist/PickerPanel/PanelBody.d.ts +17 -0
  115. package/dist/PickerPanel/PanelBody.js +151 -0
  116. package/dist/PickerPanel/PanelHeader.cjs +132 -0
  117. package/dist/PickerPanel/PanelHeader.d.ts +9 -0
  118. package/dist/PickerPanel/PanelHeader.js +126 -0
  119. package/dist/PickerPanel/QuarterPanel/index.cjs +211 -0
  120. package/dist/PickerPanel/QuarterPanel/index.d.ts +3 -0
  121. package/dist/PickerPanel/QuarterPanel/index.js +205 -0
  122. package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.cjs +145 -0
  123. package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.d.ts +17 -0
  124. package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +139 -0
  125. package/dist/PickerPanel/TimePanel/TimePanelBody/index.cjs +286 -0
  126. package/dist/PickerPanel/TimePanel/TimePanelBody/index.d.ts +3 -0
  127. package/dist/PickerPanel/TimePanel/TimePanelBody/index.js +280 -0
  128. package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.cjs +65 -0
  129. package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.d.ts +1 -0
  130. package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js +60 -0
  131. package/dist/PickerPanel/TimePanel/index.cjs +173 -0
  132. package/dist/PickerPanel/TimePanel/index.d.ts +3 -0
  133. package/dist/PickerPanel/TimePanel/index.js +167 -0
  134. package/dist/PickerPanel/WeekPanel/index.cjs +179 -0
  135. package/dist/PickerPanel/WeekPanel/index.d.ts +3 -0
  136. package/dist/PickerPanel/WeekPanel/index.js +173 -0
  137. package/dist/PickerPanel/YearPanel/index.cjs +239 -0
  138. package/dist/PickerPanel/YearPanel/index.d.ts +3 -0
  139. package/dist/PickerPanel/YearPanel/index.js +233 -0
  140. package/dist/PickerPanel/context.cjs +61 -0
  141. package/dist/PickerPanel/context.d.ts +26 -0
  142. package/dist/PickerPanel/context.js +53 -0
  143. package/dist/PickerPanel/index.cjs +473 -0
  144. package/dist/PickerPanel/index.d.ts +65 -0
  145. package/dist/PickerPanel/index.js +467 -0
  146. package/dist/PickerTrigger/index.cjs +137 -0
  147. package/dist/PickerTrigger/index.d.ts +18 -0
  148. package/dist/PickerTrigger/index.js +130 -0
  149. package/dist/PickerTrigger/util.cjs +13 -0
  150. package/dist/PickerTrigger/util.d.ts +2 -0
  151. package/dist/PickerTrigger/util.js +12 -0
  152. package/dist/_virtual/rolldown_runtime.cjs +21 -0
  153. package/dist/generate/dateFns.cjs +80 -0
  154. package/dist/generate/dateFns.d.ts +3 -0
  155. package/dist/generate/dateFns.js +73 -0
  156. package/dist/generate/dayjs.cjs +117 -0
  157. package/dist/generate/dayjs.d.ts +4 -0
  158. package/dist/generate/dayjs.js +104 -0
  159. package/dist/generate/index.cjs +1 -0
  160. package/dist/generate/index.d.ts +37 -0
  161. package/dist/generate/index.js +0 -0
  162. package/dist/generate/luxon.cjs +75 -0
  163. package/dist/generate/luxon.d.ts +4 -0
  164. package/dist/generate/luxon.js +69 -0
  165. package/dist/generate/moment.cjs +107 -0
  166. package/dist/generate/moment.d.ts +4 -0
  167. package/dist/generate/moment.js +100 -0
  168. package/dist/hooks/useLocale.cjs +45 -0
  169. package/dist/hooks/useLocale.d.ts +9 -0
  170. package/dist/hooks/useLocale.js +39 -0
  171. package/dist/hooks/useSemantic.cjs +18 -0
  172. package/dist/hooks/useSemantic.d.ts +14 -0
  173. package/dist/hooks/useSemantic.js +13 -0
  174. package/dist/hooks/useSyncState.cjs +29 -0
  175. package/dist/hooks/useSyncState.d.ts +7 -0
  176. package/dist/hooks/useSyncState.js +24 -0
  177. package/dist/hooks/useTimeConfig.cjs +161 -0
  178. package/dist/hooks/useTimeConfig.d.ts +18 -0
  179. package/dist/hooks/useTimeConfig.js +159 -0
  180. package/dist/hooks/useTimeInfo.cjs +113 -0
  181. package/dist/hooks/useTimeInfo.d.ts +12 -0
  182. package/dist/hooks/useTimeInfo.js +108 -0
  183. package/dist/hooks/useToggleDates.cjs +16 -0
  184. package/dist/hooks/useToggleDates.d.ts +9 -0
  185. package/dist/hooks/useToggleDates.js +12 -0
  186. package/dist/index.cjs +12 -0
  187. package/dist/index.d.ts +7 -0
  188. package/dist/index.js +5 -0
  189. package/dist/interface.cjs +1 -0
  190. package/dist/interface.d.ts +379 -0
  191. package/dist/interface.js +0 -0
  192. package/dist/locale/am_ET.cjs +34 -0
  193. package/dist/locale/am_ET.d.ts +3 -0
  194. package/dist/locale/am_ET.js +29 -0
  195. package/dist/locale/ar_EG.cjs +32 -0
  196. package/dist/locale/ar_EG.d.ts +3 -0
  197. package/dist/locale/ar_EG.js +27 -0
  198. package/dist/locale/az_AZ.cjs +33 -0
  199. package/dist/locale/az_AZ.d.ts +3 -0
  200. package/dist/locale/az_AZ.js +28 -0
  201. package/dist/locale/bg_BG.cjs +32 -0
  202. package/dist/locale/bg_BG.d.ts +3 -0
  203. package/dist/locale/bg_BG.js +27 -0
  204. package/dist/locale/bn_BD.cjs +33 -0
  205. package/dist/locale/bn_BD.d.ts +3 -0
  206. package/dist/locale/bn_BD.js +28 -0
  207. package/dist/locale/by_BY.cjs +33 -0
  208. package/dist/locale/by_BY.d.ts +3 -0
  209. package/dist/locale/by_BY.js +28 -0
  210. package/dist/locale/ca_ES.cjs +32 -0
  211. package/dist/locale/ca_ES.d.ts +3 -0
  212. package/dist/locale/ca_ES.js +27 -0
  213. package/dist/locale/common.cjs +8 -0
  214. package/dist/locale/common.d.ts +2 -0
  215. package/dist/locale/common.js +7 -0
  216. package/dist/locale/cs_CZ.cjs +32 -0
  217. package/dist/locale/cs_CZ.d.ts +3 -0
  218. package/dist/locale/cs_CZ.js +27 -0
  219. package/dist/locale/da_DK.cjs +32 -0
  220. package/dist/locale/da_DK.d.ts +3 -0
  221. package/dist/locale/da_DK.js +27 -0
  222. package/dist/locale/de_DE.cjs +32 -0
  223. package/dist/locale/de_DE.d.ts +3 -0
  224. package/dist/locale/de_DE.js +27 -0
  225. package/dist/locale/el_GR.cjs +32 -0
  226. package/dist/locale/el_GR.d.ts +3 -0
  227. package/dist/locale/el_GR.js +27 -0
  228. package/dist/locale/en_GB.cjs +32 -0
  229. package/dist/locale/en_GB.d.ts +3 -0
  230. package/dist/locale/en_GB.js +27 -0
  231. package/dist/locale/en_US.cjs +33 -0
  232. package/dist/locale/en_US.d.ts +3 -0
  233. package/dist/locale/en_US.js +28 -0
  234. package/dist/locale/es_ES.cjs +32 -0
  235. package/dist/locale/es_ES.d.ts +3 -0
  236. package/dist/locale/es_ES.js +27 -0
  237. package/dist/locale/es_MX.cjs +33 -0
  238. package/dist/locale/es_MX.d.ts +3 -0
  239. package/dist/locale/es_MX.js +28 -0
  240. package/dist/locale/et_EE.cjs +32 -0
  241. package/dist/locale/et_EE.d.ts +3 -0
  242. package/dist/locale/et_EE.js +27 -0
  243. package/dist/locale/eu_ES.cjs +34 -0
  244. package/dist/locale/eu_ES.d.ts +3 -0
  245. package/dist/locale/eu_ES.js +29 -0
  246. package/dist/locale/fa_IR.cjs +32 -0
  247. package/dist/locale/fa_IR.d.ts +3 -0
  248. package/dist/locale/fa_IR.js +27 -0
  249. package/dist/locale/fi_FI.cjs +32 -0
  250. package/dist/locale/fi_FI.d.ts +3 -0
  251. package/dist/locale/fi_FI.js +27 -0
  252. package/dist/locale/fr_BE.cjs +32 -0
  253. package/dist/locale/fr_BE.d.ts +3 -0
  254. package/dist/locale/fr_BE.js +27 -0
  255. package/dist/locale/fr_CA.cjs +33 -0
  256. package/dist/locale/fr_CA.d.ts +3 -0
  257. package/dist/locale/fr_CA.js +28 -0
  258. package/dist/locale/fr_FR.cjs +33 -0
  259. package/dist/locale/fr_FR.d.ts +3 -0
  260. package/dist/locale/fr_FR.js +28 -0
  261. package/dist/locale/ga_IE.cjs +33 -0
  262. package/dist/locale/ga_IE.d.ts +3 -0
  263. package/dist/locale/ga_IE.js +28 -0
  264. package/dist/locale/gl_ES.cjs +32 -0
  265. package/dist/locale/gl_ES.d.ts +3 -0
  266. package/dist/locale/gl_ES.js +27 -0
  267. package/dist/locale/he_IL.cjs +33 -0
  268. package/dist/locale/he_IL.d.ts +3 -0
  269. package/dist/locale/he_IL.js +28 -0
  270. package/dist/locale/hi_IN.cjs +33 -0
  271. package/dist/locale/hi_IN.d.ts +3 -0
  272. package/dist/locale/hi_IN.js +28 -0
  273. package/dist/locale/hr_HR.cjs +33 -0
  274. package/dist/locale/hr_HR.d.ts +3 -0
  275. package/dist/locale/hr_HR.js +28 -0
  276. package/dist/locale/hu_HU.cjs +33 -0
  277. package/dist/locale/hu_HU.d.ts +3 -0
  278. package/dist/locale/hu_HU.js +28 -0
  279. package/dist/locale/id_ID.cjs +33 -0
  280. package/dist/locale/id_ID.d.ts +3 -0
  281. package/dist/locale/id_ID.js +28 -0
  282. package/dist/locale/is_IS.cjs +32 -0
  283. package/dist/locale/is_IS.d.ts +3 -0
  284. package/dist/locale/is_IS.js +27 -0
  285. package/dist/locale/it_IT.cjs +55 -0
  286. package/dist/locale/it_IT.d.ts +3 -0
  287. package/dist/locale/it_IT.js +50 -0
  288. package/dist/locale/ja_JP.cjs +35 -0
  289. package/dist/locale/ja_JP.d.ts +3 -0
  290. package/dist/locale/ja_JP.js +30 -0
  291. package/dist/locale/ka_GE.cjs +33 -0
  292. package/dist/locale/ka_GE.d.ts +3 -0
  293. package/dist/locale/ka_GE.js +28 -0
  294. package/dist/locale/kk_KZ.cjs +32 -0
  295. package/dist/locale/kk_KZ.d.ts +3 -0
  296. package/dist/locale/kk_KZ.js +27 -0
  297. package/dist/locale/km_KH.cjs +34 -0
  298. package/dist/locale/km_KH.d.ts +3 -0
  299. package/dist/locale/km_KH.js +29 -0
  300. package/dist/locale/kmr_IQ.cjs +32 -0
  301. package/dist/locale/kmr_IQ.d.ts +3 -0
  302. package/dist/locale/kmr_IQ.js +27 -0
  303. package/dist/locale/kn_IN.cjs +33 -0
  304. package/dist/locale/kn_IN.d.ts +3 -0
  305. package/dist/locale/kn_IN.js +28 -0
  306. package/dist/locale/ko_KR.cjs +34 -0
  307. package/dist/locale/ko_KR.d.ts +3 -0
  308. package/dist/locale/ko_KR.js +29 -0
  309. package/dist/locale/lt_LT.cjs +34 -0
  310. package/dist/locale/lt_LT.d.ts +3 -0
  311. package/dist/locale/lt_LT.js +29 -0
  312. package/dist/locale/lv_LV.cjs +32 -0
  313. package/dist/locale/lv_LV.d.ts +3 -0
  314. package/dist/locale/lv_LV.js +27 -0
  315. package/dist/locale/mk_MK.cjs +32 -0
  316. package/dist/locale/mk_MK.d.ts +3 -0
  317. package/dist/locale/mk_MK.js +27 -0
  318. package/dist/locale/ml_IN.cjs +33 -0
  319. package/dist/locale/ml_IN.d.ts +3 -0
  320. package/dist/locale/ml_IN.js +28 -0
  321. package/dist/locale/mn_MN.cjs +34 -0
  322. package/dist/locale/mn_MN.d.ts +3 -0
  323. package/dist/locale/mn_MN.js +29 -0
  324. package/dist/locale/mr_IN.cjs +59 -0
  325. package/dist/locale/mr_IN.d.ts +3 -0
  326. package/dist/locale/mr_IN.js +54 -0
  327. package/dist/locale/ms_MY.cjs +34 -0
  328. package/dist/locale/ms_MY.d.ts +3 -0
  329. package/dist/locale/ms_MY.js +29 -0
  330. package/dist/locale/my_MM.cjs +33 -0
  331. package/dist/locale/my_MM.d.ts +3 -0
  332. package/dist/locale/my_MM.js +28 -0
  333. package/dist/locale/nb_NO.cjs +34 -0
  334. package/dist/locale/nb_NO.d.ts +3 -0
  335. package/dist/locale/nb_NO.js +29 -0
  336. package/dist/locale/ne_NP.cjs +33 -0
  337. package/dist/locale/ne_NP.d.ts +3 -0
  338. package/dist/locale/ne_NP.js +28 -0
  339. package/dist/locale/nl_BE.cjs +32 -0
  340. package/dist/locale/nl_BE.d.ts +3 -0
  341. package/dist/locale/nl_BE.js +27 -0
  342. package/dist/locale/nl_NL.cjs +32 -0
  343. package/dist/locale/nl_NL.d.ts +3 -0
  344. package/dist/locale/nl_NL.js +27 -0
  345. package/dist/locale/pl_PL.cjs +32 -0
  346. package/dist/locale/pl_PL.d.ts +3 -0
  347. package/dist/locale/pl_PL.js +27 -0
  348. package/dist/locale/pt_BR.cjs +56 -0
  349. package/dist/locale/pt_BR.d.ts +3 -0
  350. package/dist/locale/pt_BR.js +51 -0
  351. package/dist/locale/pt_PT.cjs +55 -0
  352. package/dist/locale/pt_PT.d.ts +3 -0
  353. package/dist/locale/pt_PT.js +50 -0
  354. package/dist/locale/ro_RO.cjs +33 -0
  355. package/dist/locale/ro_RO.d.ts +3 -0
  356. package/dist/locale/ro_RO.js +28 -0
  357. package/dist/locale/ru_RU.cjs +32 -0
  358. package/dist/locale/ru_RU.d.ts +3 -0
  359. package/dist/locale/ru_RU.js +27 -0
  360. package/dist/locale/si_LK.cjs +34 -0
  361. package/dist/locale/si_LK.d.ts +3 -0
  362. package/dist/locale/si_LK.js +29 -0
  363. package/dist/locale/sk_SK.cjs +32 -0
  364. package/dist/locale/sk_SK.d.ts +3 -0
  365. package/dist/locale/sk_SK.js +27 -0
  366. package/dist/locale/sl_SI.cjs +32 -0
  367. package/dist/locale/sl_SI.d.ts +3 -0
  368. package/dist/locale/sl_SI.js +27 -0
  369. package/dist/locale/sr_Cyrl_RS.cjs +32 -0
  370. package/dist/locale/sr_Cyrl_RS.d.ts +3 -0
  371. package/dist/locale/sr_Cyrl_RS.js +27 -0
  372. package/dist/locale/sr_RS.cjs +32 -0
  373. package/dist/locale/sr_RS.d.ts +3 -0
  374. package/dist/locale/sr_RS.js +27 -0
  375. package/dist/locale/sv_SE.cjs +32 -0
  376. package/dist/locale/sv_SE.d.ts +3 -0
  377. package/dist/locale/sv_SE.js +27 -0
  378. package/dist/locale/ta_IN.cjs +33 -0
  379. package/dist/locale/ta_IN.d.ts +3 -0
  380. package/dist/locale/ta_IN.js +28 -0
  381. package/dist/locale/te_IN.cjs +33 -0
  382. package/dist/locale/te_IN.d.ts +3 -0
  383. package/dist/locale/te_IN.js +28 -0
  384. package/dist/locale/th_TH.cjs +32 -0
  385. package/dist/locale/th_TH.d.ts +3 -0
  386. package/dist/locale/th_TH.js +27 -0
  387. package/dist/locale/tk_TK.cjs +32 -0
  388. package/dist/locale/tk_TK.d.ts +3 -0
  389. package/dist/locale/tk_TK.js +27 -0
  390. package/dist/locale/tr_TR.cjs +55 -0
  391. package/dist/locale/tr_TR.d.ts +3 -0
  392. package/dist/locale/tr_TR.js +50 -0
  393. package/dist/locale/ug_CN.cjs +35 -0
  394. package/dist/locale/ug_CN.d.ts +3 -0
  395. package/dist/locale/ug_CN.js +30 -0
  396. package/dist/locale/uk_UA.cjs +32 -0
  397. package/dist/locale/uk_UA.d.ts +3 -0
  398. package/dist/locale/uk_UA.js +27 -0
  399. package/dist/locale/ur_PK.cjs +33 -0
  400. package/dist/locale/ur_PK.d.ts +3 -0
  401. package/dist/locale/ur_PK.js +28 -0
  402. package/dist/locale/uz_UZ.cjs +33 -0
  403. package/dist/locale/uz_UZ.d.ts +3 -0
  404. package/dist/locale/uz_UZ.js +28 -0
  405. package/dist/locale/vi_VN.cjs +33 -0
  406. package/dist/locale/vi_VN.d.ts +3 -0
  407. package/dist/locale/vi_VN.js +28 -0
  408. package/dist/locale/zh_CN.cjs +36 -0
  409. package/dist/locale/zh_CN.d.ts +3 -0
  410. package/dist/locale/zh_CN.js +31 -0
  411. package/dist/locale/zh_TW.cjs +36 -0
  412. package/dist/locale/zh_TW.d.ts +3 -0
  413. package/dist/locale/zh_TW.js +31 -0
  414. package/dist/utils/dateUtil.cjs +105 -0
  415. package/dist/utils/dateUtil.d.ts +29 -0
  416. package/dist/utils/dateUtil.js +89 -0
  417. package/dist/utils/getClearIcon.cjs +7 -0
  418. package/dist/utils/getClearIcon.d.ts +6 -0
  419. package/dist/utils/getClearIcon.js +5 -0
  420. package/dist/utils/miscUtil.cjs +46 -0
  421. package/dist/utils/miscUtil.d.ts +14 -0
  422. package/dist/utils/miscUtil.js +40 -0
  423. package/dist/utils/uiUtil.cjs +6 -0
  424. package/dist/utils/uiUtil.d.ts +1 -0
  425. package/dist/utils/uiUtil.js +5 -0
  426. package/dist/utils/warnUtil.cjs +8 -0
  427. package/dist/utils/warnUtil.d.ts +5 -0
  428. package/dist/utils/warnUtil.js +6 -0
  429. package/package.json +82 -0
@@ -0,0 +1,12 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
3
+ let vue = require("vue");
4
+ var PickerContextKey = Symbol("PickerContext");
5
+ function providePickerContext(context) {
6
+ (0, vue.provide)(PickerContextKey, context);
7
+ }
8
+ function usePickerContext() {
9
+ return (0, vue.inject)(PickerContextKey, (0, vue.ref)({}));
10
+ }
11
+ exports.providePickerContext = providePickerContext;
12
+ exports.usePickerContext = usePickerContext;
@@ -0,0 +1,16 @@
1
+ import { Ref } from 'vue';
2
+ import { GenerateConfig } from '../generate';
3
+ import { FilledClassNames, FilledStyles } from '../hooks/useSemantic';
4
+ import { Components, Locale } from '../interface';
5
+ export interface PickerContextProps<DateType = any> {
6
+ prefixCls: string | undefined;
7
+ locale: Locale;
8
+ generateConfig: GenerateConfig<DateType>;
9
+ /** Customize button component */
10
+ button?: Components['button'];
11
+ input?: Components['input'];
12
+ classNames: FilledClassNames;
13
+ styles: FilledStyles;
14
+ }
15
+ export declare function providePickerContext(context: Ref<PickerContextProps>): void;
16
+ export declare function usePickerContext(): Ref<PickerContextProps>;
@@ -0,0 +1,9 @@
1
+ import { inject, provide, ref } from "vue";
2
+ var PickerContextKey = Symbol("PickerContext");
3
+ function providePickerContext(context) {
4
+ provide(PickerContextKey, context);
5
+ }
6
+ function usePickerContext() {
7
+ return inject(PickerContextKey, ref({}));
8
+ }
9
+ export { providePickerContext, usePickerContext };
@@ -0,0 +1,25 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
6
+ let _v_c_util = require("@v-c/util");
7
+ function useCellRender(cellRender, dateRender, monthCellRender, range) {
8
+ if (process.env.NODE_ENV !== "production") {
9
+ (0, _v_c_util.warning)(!dateRender?.value, `'dateRender' is deprecated. Please use 'cellRender' instead.`);
10
+ (0, _v_c_util.warning)(!monthCellRender?.value, `'monthCellRender' is deprecated. Please use 'cellRender' instead.`);
11
+ }
12
+ const mergedCellRender = (current, info) => {
13
+ if (cellRender.value) return cellRender.value(current, info);
14
+ const date = current;
15
+ if (dateRender?.value && info.type === "date") return dateRender.value(date, info.today);
16
+ if (monthCellRender?.value && info.type === "month") return monthCellRender.value(date, info.locale);
17
+ return info.originNode;
18
+ };
19
+ const onInternalCellRender = (date, info) => mergedCellRender(date, {
20
+ ...info,
21
+ range: range?.value
22
+ });
23
+ return onInternalCellRender;
24
+ }
25
+ exports.default = useCellRender;
@@ -0,0 +1,3 @@
1
+ import { Ref } from 'vue';
2
+ import { CellRender, CellRenderInfo, SharedPickerProps } from '../../interface';
3
+ export default function useCellRender<DateType extends object = any>(cellRender: Ref<SharedPickerProps<DateType>['cellRender'] | undefined>, dateRender?: Ref<SharedPickerProps<DateType>['dateRender'] | undefined>, monthCellRender?: Ref<SharedPickerProps<DateType>['monthCellRender'] | undefined>, range?: Ref<CellRenderInfo<DateType>['range'] | undefined>): CellRender<DateType>;
@@ -0,0 +1,20 @@
1
+ import { warning } from "@v-c/util";
2
+ function useCellRender(cellRender, dateRender, monthCellRender, range) {
3
+ if (process.env.NODE_ENV !== "production") {
4
+ warning(!dateRender?.value, `'dateRender' is deprecated. Please use 'cellRender' instead.`);
5
+ warning(!monthCellRender?.value, `'monthCellRender' is deprecated. Please use 'cellRender' instead.`);
6
+ }
7
+ const mergedCellRender = (current, info) => {
8
+ if (cellRender.value) return cellRender.value(current, info);
9
+ const date = current;
10
+ if (dateRender?.value && info.type === "date") return dateRender.value(date, info.today);
11
+ if (monthCellRender?.value && info.type === "month") return monthCellRender.value(date, info.locale);
12
+ return info.originNode;
13
+ };
14
+ const onInternalCellRender = (date, info) => mergedCellRender(date, {
15
+ ...info,
16
+ range: range?.value
17
+ });
18
+ return onInternalCellRender;
19
+ }
20
+ export { useCellRender as default };
@@ -0,0 +1,34 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
6
+ let vue = require("vue");
7
+ let _v_c_util = require("@v-c/util");
8
+ function useDelayState(value, defaultValue, onChange) {
9
+ const internalValue = (0, vue.ref)(defaultValue);
10
+ const state = (0, vue.computed)(() => value.value !== void 0 ? value.value : internalValue.value);
11
+ const nextValueRef = (0, vue.ref)(state.value);
12
+ const rafRef = (0, vue.ref)();
13
+ const cancelRaf = () => {
14
+ if (rafRef.value) _v_c_util.raf.cancel(rafRef.value);
15
+ };
16
+ const doUpdate = () => {
17
+ if (value.value === void 0) internalValue.value = nextValueRef.value;
18
+ if (onChange && state.value !== nextValueRef.value) onChange(nextValueRef.value);
19
+ };
20
+ const updateValue = (next, immediately) => {
21
+ cancelRaf();
22
+ nextValueRef.value = next;
23
+ if (next || immediately) doUpdate();
24
+ else rafRef.value = (0, _v_c_util.raf)(doUpdate);
25
+ };
26
+ (0, vue.watch)(value, () => {
27
+ if (value.value !== void 0) nextValueRef.value = value.value;
28
+ });
29
+ (0, vue.onBeforeUnmount)(() => {
30
+ cancelRaf();
31
+ });
32
+ return [state, updateValue];
33
+ }
34
+ exports.default = useDelayState;
@@ -0,0 +1,2 @@
1
+ import { Ref } from 'vue';
2
+ export default function useDelayState<T>(value: Ref<T | undefined>, defaultValue: T, onChange?: (next: T) => void): readonly [import('vue').ComputedRef<any>, (next: T, immediately?: boolean) => void];
@@ -0,0 +1,29 @@
1
+ import { computed, onBeforeUnmount, ref, watch } from "vue";
2
+ import { raf } from "@v-c/util";
3
+ function useDelayState(value, defaultValue, onChange) {
4
+ const internalValue = ref(defaultValue);
5
+ const state = computed(() => value.value !== void 0 ? value.value : internalValue.value);
6
+ const nextValueRef = ref(state.value);
7
+ const rafRef = ref();
8
+ const cancelRaf = () => {
9
+ if (rafRef.value) raf.cancel(rafRef.value);
10
+ };
11
+ const doUpdate = () => {
12
+ if (value.value === void 0) internalValue.value = nextValueRef.value;
13
+ if (onChange && state.value !== nextValueRef.value) onChange(nextValueRef.value);
14
+ };
15
+ const updateValue = (next, immediately) => {
16
+ cancelRaf();
17
+ nextValueRef.value = next;
18
+ if (next || immediately) doUpdate();
19
+ else rafRef.value = raf(doUpdate);
20
+ };
21
+ watch(value, () => {
22
+ if (value.value !== void 0) nextValueRef.value = value.value;
23
+ });
24
+ onBeforeUnmount(() => {
25
+ cancelRaf();
26
+ });
27
+ return [state, updateValue];
28
+ }
29
+ export { useDelayState as default };
@@ -0,0 +1,15 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_dateUtil = require("../../utils/dateUtil.cjs");
6
+ function useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate) {
7
+ const mergedDisabledDate = (date, info) => {
8
+ if (disabledDate.value && disabledDate.value(date, info)) return true;
9
+ if (minDate.value && generateConfig.value.isAfter(minDate.value, date) && !require_dateUtil.isSame(generateConfig.value, locale.value, minDate.value, date, info.type)) return true;
10
+ if (maxDate.value && generateConfig.value.isAfter(date, maxDate.value) && !require_dateUtil.isSame(generateConfig.value, locale.value, maxDate.value, date, info.type)) return true;
11
+ return false;
12
+ };
13
+ return mergedDisabledDate;
14
+ }
15
+ exports.default = useDisabledBoundary;
@@ -0,0 +1,8 @@
1
+ import { Ref } from 'vue';
2
+ import { GenerateConfig } from '../../generate';
3
+ import { DisabledDate, InternalMode, Locale } from '../../interface';
4
+ export type IsInvalidBoundary<DateType> = (currentDate: DateType, type: InternalMode, fromDate?: DateType) => boolean;
5
+ /**
6
+ * Merge `disabledDate` with `minDate` & `maxDate`.
7
+ */
8
+ export default function useDisabledBoundary<DateType extends object = any>(generateConfig: Ref<GenerateConfig<DateType>>, locale: Ref<Locale>, disabledDate: Ref<DisabledDate<DateType> | undefined>, minDate: Ref<DateType | undefined>, maxDate: Ref<DateType | undefined>): DisabledDate<DateType>;
@@ -0,0 +1,11 @@
1
+ import { isSame } from "../../utils/dateUtil.js";
2
+ function useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate) {
3
+ const mergedDisabledDate = (date, info) => {
4
+ if (disabledDate.value && disabledDate.value(date, info)) return true;
5
+ if (minDate.value && generateConfig.value.isAfter(minDate.value, date) && !isSame(generateConfig.value, locale.value, minDate.value, date, info.type)) return true;
6
+ if (maxDate.value && generateConfig.value.isAfter(date, maxDate.value) && !isSame(generateConfig.value, locale.value, maxDate.value, date, info.type)) return true;
7
+ return false;
8
+ };
9
+ return mergedDisabledDate;
10
+ }
11
+ export { useDisabledBoundary as default };
@@ -0,0 +1,17 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
3
+ const require_miscUtil = require("../../utils/miscUtil.cjs");
4
+ let vue = require("vue");
5
+ function useFieldFormat(picker, locale, format) {
6
+ const info = (0, vue.computed)(() => {
7
+ const formatList = require_miscUtil.toArray(require_miscUtil.getRowFormat(picker.value, locale.value, format?.value));
8
+ const firstFormat = formatList[0];
9
+ const maskFormat = typeof firstFormat === "object" && firstFormat.type === "mask" ? firstFormat.format : void 0;
10
+ return {
11
+ formatList: formatList.map((config) => typeof config === "string" || typeof config === "function" ? config : config.format),
12
+ maskFormat
13
+ };
14
+ });
15
+ return [(0, vue.computed)(() => info.value.formatList), (0, vue.computed)(() => info.value.maskFormat)];
16
+ }
17
+ exports.useFieldFormat = useFieldFormat;
@@ -0,0 +1,3 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { FormatType, InternalMode, Locale, SharedPickerProps } from '../../interface';
3
+ export declare function useFieldFormat<DateType = any>(picker: Ref<InternalMode>, locale: Ref<Locale>, format?: Ref<SharedPickerProps['format'] | undefined>): [formatList: ComputedRef<FormatType<DateType>[]>, maskFormat: ComputedRef<string | undefined>];
@@ -0,0 +1,15 @@
1
+ import { getRowFormat, toArray } from "../../utils/miscUtil.js";
2
+ import { computed } from "vue";
3
+ function useFieldFormat(picker, locale, format) {
4
+ const info = computed(() => {
5
+ const formatList = toArray(getRowFormat(picker.value, locale.value, format?.value));
6
+ const firstFormat = formatList[0];
7
+ const maskFormat = typeof firstFormat === "object" && firstFormat.type === "mask" ? firstFormat.format : void 0;
8
+ return {
9
+ formatList: formatList.map((config) => typeof config === "string" || typeof config === "function" ? config : config.format),
10
+ maskFormat
11
+ };
12
+ });
13
+ return [computed(() => info.value.formatList), computed(() => info.value.maskFormat)];
14
+ }
15
+ export { useFieldFormat };
@@ -0,0 +1,24 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
6
+ const require_miscUtil = require("../../utils/miscUtil.cjs");
7
+ let vue = require("vue");
8
+ function useFieldsInvalidate(calendarValue, isInvalidateDate, allowEmpty = (0, vue.ref)([])) {
9
+ const fieldsInvalidates = (0, vue.ref)([false, false]);
10
+ const onSelectorInvalid = (invalid, index) => {
11
+ fieldsInvalidates.value = require_miscUtil.fillIndex(fieldsInvalidates.value, index, invalid);
12
+ };
13
+ return [(0, vue.computed)(() => {
14
+ return fieldsInvalidates.value.map((invalid, index) => {
15
+ if (invalid) return true;
16
+ const current = calendarValue.value[index];
17
+ if (!current) return false;
18
+ if (!allowEmpty.value?.[index] && !current) return true;
19
+ if (current && isInvalidateDate(current, { activeIndex: index })) return true;
20
+ return false;
21
+ });
22
+ }), onSelectorInvalid];
23
+ }
24
+ exports.default = useFieldsInvalidate;
@@ -0,0 +1,6 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { default as useInvalidate } from './useInvalidate';
3
+ /**
4
+ * Used to control each fields invalidate status
5
+ */
6
+ export default function useFieldsInvalidate<DateType extends object, ValueType extends DateType[]>(calendarValue: Ref<ValueType>, isInvalidateDate: ReturnType<typeof useInvalidate<DateType>>, allowEmpty?: Ref<boolean[] | undefined> | ComputedRef<boolean[] | undefined>): readonly [ComputedRef<[boolean, boolean]>, (invalid: boolean, index: number) => void];
@@ -0,0 +1,19 @@
1
+ import { fillIndex } from "../../utils/miscUtil.js";
2
+ import { computed, ref } from "vue";
3
+ function useFieldsInvalidate(calendarValue, isInvalidateDate, allowEmpty = ref([])) {
4
+ const fieldsInvalidates = ref([false, false]);
5
+ const onSelectorInvalid = (invalid, index) => {
6
+ fieldsInvalidates.value = fillIndex(fieldsInvalidates.value, index, invalid);
7
+ };
8
+ return [computed(() => {
9
+ return fieldsInvalidates.value.map((invalid, index) => {
10
+ if (invalid) return true;
11
+ const current = calendarValue.value[index];
12
+ if (!current) return false;
13
+ if (!allowEmpty.value?.[index] && !current) return true;
14
+ if (current && isInvalidateDate(current, { activeIndex: index })) return true;
15
+ return false;
16
+ });
17
+ }), onSelectorInvalid];
18
+ }
19
+ export { useFieldsInvalidate as default };
@@ -0,0 +1,103 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
6
+ const require_miscUtil = require("../../utils/miscUtil.cjs");
7
+ const require_useLocale = require("../../hooks/useLocale.cjs");
8
+ const require_useTimeConfig = require("../../hooks/useTimeConfig.cjs");
9
+ const require_useClearIcon = require("../Selector/hooks/useClearIcon.cjs");
10
+ const require_useDisabledBoundary = require("./useDisabledBoundary.cjs");
11
+ const require_useFieldFormat = require("./useFieldFormat.cjs");
12
+ const require_useInputReadOnly = require("./useInputReadOnly.cjs");
13
+ const require_useInvalidate = require("./useInvalidate.cjs");
14
+ let vue = require("vue");
15
+ let _v_c_util = require("@v-c/util");
16
+ function useList(value, fillMode = false) {
17
+ return (0, vue.computed)(() => {
18
+ const val = value.value;
19
+ const list = val ? require_miscUtil.toArray(val) : val;
20
+ if (fillMode && list && Array.isArray(list)) {
21
+ const clone = [...list];
22
+ clone[1] = clone[1] || clone[0];
23
+ return clone;
24
+ }
25
+ return list;
26
+ });
27
+ }
28
+ function useFilledProps(props, updater) {
29
+ const mergedPicker = (0, vue.computed)(() => props.value.picker || "date");
30
+ const mergedPrefixCls = (0, vue.computed)(() => props.value.prefixCls || "vc-picker");
31
+ const mergedPreviewValue = (0, vue.computed)(() => props.value.previewValue ?? "hover");
32
+ const mergedStyles = (0, vue.computed)(() => props.value.styles || {});
33
+ const mergedClassNames = (0, vue.computed)(() => props.value.classNames || {});
34
+ const mergedOrder = (0, vue.computed)(() => props.value.order ?? true);
35
+ const mergedComponents = (0, vue.computed)(() => ({
36
+ input: props.value.inputRender,
37
+ ...props.value.components
38
+ }));
39
+ const values = useList((0, vue.computed)(() => props.value.value));
40
+ const defaultValues = useList((0, vue.computed)(() => props.value.defaultValue));
41
+ const pickerValues = useList((0, vue.computed)(() => props.value.pickerValue));
42
+ const defaultPickerValues = useList((0, vue.computed)(() => props.value.defaultPickerValue));
43
+ const internalPicker = (0, vue.computed)(() => mergedPicker.value === "date" && props.value.showTime ? "datetime" : mergedPicker.value);
44
+ const multipleInteractivePicker = (0, vue.computed)(() => internalPicker.value === "time" || internalPicker.value === "datetime");
45
+ const complexPicker = (0, vue.computed)(() => multipleInteractivePicker.value || props.value.multiple);
46
+ const mergedNeedConfirm = (0, vue.computed)(() => {
47
+ return props.value.needConfirm ?? multipleInteractivePicker.value;
48
+ });
49
+ const timePropsInfo = (0, vue.computed)(() => require_useTimeConfig.getTimeProps(props.value));
50
+ const timeProps = (0, vue.computed)(() => timePropsInfo.value[0]);
51
+ const localeTimeProps = (0, vue.computed)(() => timePropsInfo.value[1]);
52
+ const showTimeFormat = (0, vue.computed)(() => timePropsInfo.value[2]);
53
+ const propFormat = (0, vue.computed)(() => timePropsInfo.value[3]);
54
+ const mergedLocale = require_useLocale.default((0, vue.computed)(() => props.value.locale), localeTimeProps);
55
+ const mergedShowTime = (0, vue.computed)(() => require_useTimeConfig.fillShowTimeConfig(internalPicker.value, showTimeFormat.value, propFormat.value, timeProps.value, mergedLocale.value));
56
+ if (process.env.NODE_ENV !== "production") {
57
+ if (mergedPicker.value === "time") {
58
+ if ([
59
+ "disabledHours",
60
+ "disabledMinutes",
61
+ "disabledSeconds"
62
+ ].some((key) => props[key])) (0, _v_c_util.warning)(false, `'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.`);
63
+ }
64
+ }
65
+ const filledProps = (0, vue.computed)(() => ({
66
+ ...props.value,
67
+ previewValue: mergedPreviewValue.value,
68
+ prefixCls: mergedPrefixCls.value,
69
+ locale: mergedLocale.value,
70
+ picker: mergedPicker.value,
71
+ styles: mergedStyles.value,
72
+ classNames: mergedClassNames.value,
73
+ order: mergedOrder.value,
74
+ components: mergedComponents.value,
75
+ clearIcon: require_useClearIcon.fillClearIcon(mergedPrefixCls.value, props.value.allowClear, props.value.clearIcon),
76
+ showTime: mergedShowTime.value,
77
+ value: values.value,
78
+ defaultValue: defaultValues.value,
79
+ pickerValue: pickerValues.value,
80
+ defaultPickerValue: defaultPickerValues.value,
81
+ ...updater?.()
82
+ }));
83
+ const [formatList, maskFormat] = require_useFieldFormat.useFieldFormat(internalPicker, mergedLocale, (0, vue.computed)(() => props.value.format));
84
+ const mergedInputReadOnly = require_useInputReadOnly.default(formatList, (0, vue.computed)(() => props.value.inputReadOnly), (0, vue.computed)(() => props.value.multiple));
85
+ const disabledBoundaryDate = require_useDisabledBoundary.default((0, vue.computed)(() => props.value.generateConfig), (0, vue.computed)(() => props.value.locale), (0, vue.computed)(() => props.value.disabledDate), (0, vue.computed)(() => props.value.minDate), (0, vue.computed)(() => props.value.maxDate));
86
+ const isInvalidateDate = require_useInvalidate.default((0, vue.computed)(() => props.value.generateConfig), mergedPicker, disabledBoundaryDate, mergedShowTime);
87
+ return [
88
+ (0, vue.computed)(() => {
89
+ return {
90
+ ...filledProps.value,
91
+ needConfirm: mergedNeedConfirm.value,
92
+ inputReadOnly: mergedInputReadOnly.value,
93
+ disabledDate: disabledBoundaryDate
94
+ };
95
+ }),
96
+ internalPicker,
97
+ complexPicker,
98
+ formatList,
99
+ maskFormat,
100
+ isInvalidateDate
101
+ ];
102
+ }
103
+ exports.default = useFilledProps;
@@ -0,0 +1,33 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { FormatType, InternalMode, PickerMode } from '../../interface';
3
+ import { RangePickerProps } from '../RangePicker';
4
+ import { PickerProps } from '../SinglePicker';
5
+ import { default as useInvalidate } from './useInvalidate';
6
+ type UseInvalidate<DateType extends object = any> = typeof useInvalidate<DateType>;
7
+ type PickedProps<DateType extends object = any> = RangePickerProps<DateType> | PickerProps<DateType>;
8
+ type ExcludeBooleanType<T> = T extends boolean ? never : T;
9
+ type GetGeneric<T> = T extends PickedProps<infer U> ? U : never;
10
+ type ToArrayType<T, DateType> = T extends any[] ? T : DateType[];
11
+ type FilledProps<InProps extends PickedProps, DateType extends GetGeneric<InProps>, UpdaterProps extends object = object> = Omit<InProps, keyof UpdaterProps | 'showTime' | 'value' | 'defaultValue'> & UpdaterProps & {
12
+ picker: PickerMode;
13
+ showTime?: ExcludeBooleanType<InProps['showTime']>;
14
+ value?: ToArrayType<InProps['value'], DateType>;
15
+ defaultValue?: ToArrayType<InProps['value'], DateType>;
16
+ pickerValue?: ToArrayType<InProps['value'], DateType>;
17
+ defaultPickerValue?: ToArrayType<InProps['value'], DateType>;
18
+ };
19
+ /**
20
+ * Align the outer props with unique typed and fill undefined props.
21
+ * This is shared with both RangePicker and Picker. This will do:
22
+ * - Convert `value` & `defaultValue` to array
23
+ * - handle the legacy props fill like `clearIcon` + `allowClear` = `clearIcon`
24
+ */
25
+ export default function useFilledProps<InProps extends PickedProps, DateType extends GetGeneric<InProps>, UpdaterProps extends object>(props: ComputedRef<InProps>, updater?: () => UpdaterProps): [
26
+ filledProps: ComputedRef<FilledProps<InProps, DateType, UpdaterProps>>,
27
+ internalPicker: ComputedRef<InternalMode>,
28
+ complexPicker: ComputedRef<boolean | undefined>,
29
+ formatList: ComputedRef<FormatType<DateType>[]>,
30
+ maskFormat: ComputedRef<string | undefined>,
31
+ isInvalidateDate: ReturnType<UseInvalidate<DateType>>
32
+ ];
33
+ export {};
@@ -0,0 +1,98 @@
1
+ import { toArray } from "../../utils/miscUtil.js";
2
+ import useLocale from "../../hooks/useLocale.js";
3
+ import { fillShowTimeConfig, getTimeProps } from "../../hooks/useTimeConfig.js";
4
+ import { fillClearIcon } from "../Selector/hooks/useClearIcon.js";
5
+ import useDisabledBoundary from "./useDisabledBoundary.js";
6
+ import { useFieldFormat } from "./useFieldFormat.js";
7
+ import useInputReadOnly from "./useInputReadOnly.js";
8
+ import useInvalidate from "./useInvalidate.js";
9
+ import { computed } from "vue";
10
+ import { warning } from "@v-c/util";
11
+ function useList(value, fillMode = false) {
12
+ return computed(() => {
13
+ const val = value.value;
14
+ const list = val ? toArray(val) : val;
15
+ if (fillMode && list && Array.isArray(list)) {
16
+ const clone = [...list];
17
+ clone[1] = clone[1] || clone[0];
18
+ return clone;
19
+ }
20
+ return list;
21
+ });
22
+ }
23
+ function useFilledProps(props, updater) {
24
+ const mergedPicker = computed(() => props.value.picker || "date");
25
+ const mergedPrefixCls = computed(() => props.value.prefixCls || "vc-picker");
26
+ const mergedPreviewValue = computed(() => props.value.previewValue ?? "hover");
27
+ const mergedStyles = computed(() => props.value.styles || {});
28
+ const mergedClassNames = computed(() => props.value.classNames || {});
29
+ const mergedOrder = computed(() => props.value.order ?? true);
30
+ const mergedComponents = computed(() => ({
31
+ input: props.value.inputRender,
32
+ ...props.value.components
33
+ }));
34
+ const values = useList(computed(() => props.value.value));
35
+ const defaultValues = useList(computed(() => props.value.defaultValue));
36
+ const pickerValues = useList(computed(() => props.value.pickerValue));
37
+ const defaultPickerValues = useList(computed(() => props.value.defaultPickerValue));
38
+ const internalPicker = computed(() => mergedPicker.value === "date" && props.value.showTime ? "datetime" : mergedPicker.value);
39
+ const multipleInteractivePicker = computed(() => internalPicker.value === "time" || internalPicker.value === "datetime");
40
+ const complexPicker = computed(() => multipleInteractivePicker.value || props.value.multiple);
41
+ const mergedNeedConfirm = computed(() => {
42
+ return props.value.needConfirm ?? multipleInteractivePicker.value;
43
+ });
44
+ const timePropsInfo = computed(() => getTimeProps(props.value));
45
+ const timeProps = computed(() => timePropsInfo.value[0]);
46
+ const localeTimeProps = computed(() => timePropsInfo.value[1]);
47
+ const showTimeFormat = computed(() => timePropsInfo.value[2]);
48
+ const propFormat = computed(() => timePropsInfo.value[3]);
49
+ const mergedLocale = useLocale(computed(() => props.value.locale), localeTimeProps);
50
+ const mergedShowTime = computed(() => fillShowTimeConfig(internalPicker.value, showTimeFormat.value, propFormat.value, timeProps.value, mergedLocale.value));
51
+ if (process.env.NODE_ENV !== "production") {
52
+ if (mergedPicker.value === "time") {
53
+ if ([
54
+ "disabledHours",
55
+ "disabledMinutes",
56
+ "disabledSeconds"
57
+ ].some((key) => props[key])) warning(false, `'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.`);
58
+ }
59
+ }
60
+ const filledProps = computed(() => ({
61
+ ...props.value,
62
+ previewValue: mergedPreviewValue.value,
63
+ prefixCls: mergedPrefixCls.value,
64
+ locale: mergedLocale.value,
65
+ picker: mergedPicker.value,
66
+ styles: mergedStyles.value,
67
+ classNames: mergedClassNames.value,
68
+ order: mergedOrder.value,
69
+ components: mergedComponents.value,
70
+ clearIcon: fillClearIcon(mergedPrefixCls.value, props.value.allowClear, props.value.clearIcon),
71
+ showTime: mergedShowTime.value,
72
+ value: values.value,
73
+ defaultValue: defaultValues.value,
74
+ pickerValue: pickerValues.value,
75
+ defaultPickerValue: defaultPickerValues.value,
76
+ ...updater?.()
77
+ }));
78
+ const [formatList, maskFormat] = useFieldFormat(internalPicker, mergedLocale, computed(() => props.value.format));
79
+ const mergedInputReadOnly = useInputReadOnly(formatList, computed(() => props.value.inputReadOnly), computed(() => props.value.multiple));
80
+ const disabledBoundaryDate = useDisabledBoundary(computed(() => props.value.generateConfig), computed(() => props.value.locale), computed(() => props.value.disabledDate), computed(() => props.value.minDate), computed(() => props.value.maxDate));
81
+ const isInvalidateDate = useInvalidate(computed(() => props.value.generateConfig), mergedPicker, disabledBoundaryDate, mergedShowTime);
82
+ return [
83
+ computed(() => {
84
+ return {
85
+ ...filledProps.value,
86
+ needConfirm: mergedNeedConfirm.value,
87
+ inputReadOnly: mergedInputReadOnly.value,
88
+ disabledDate: disabledBoundaryDate
89
+ };
90
+ }),
91
+ internalPicker,
92
+ complexPicker,
93
+ formatList,
94
+ maskFormat,
95
+ isInvalidateDate
96
+ ];
97
+ }
98
+ export { useFilledProps as default };
@@ -0,0 +1,13 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
6
+ let vue = require("vue");
7
+ function useInputReadOnly(formatList, inputReadOnly, multiple) {
8
+ return (0, vue.computed)(() => {
9
+ if (typeof formatList.value[0] === "function" || multiple.value) return true;
10
+ return inputReadOnly.value;
11
+ });
12
+ }
13
+ exports.default = useInputReadOnly;
@@ -0,0 +1,3 @@
1
+ import { Ref } from 'vue';
2
+ import { FormatType } from '../../interface';
3
+ export default function useInputReadOnly<DateType = any>(formatList: Ref<FormatType<DateType>[]>, inputReadOnly: Ref<boolean | undefined>, multiple: Ref<boolean | undefined>): import('vue').ComputedRef<boolean | undefined>;
@@ -0,0 +1,8 @@
1
+ import { computed } from "vue";
2
+ function useInputReadOnly(formatList, inputReadOnly, multiple) {
3
+ return computed(() => {
4
+ if (typeof formatList.value[0] === "function" || multiple.value) return true;
5
+ return inputReadOnly.value;
6
+ });
7
+ }
8
+ export { useInputReadOnly as default };
@@ -0,0 +1,34 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ function useInvalidate(generateConfig, picker, disabledDate, showTime) {
6
+ const isInvalidate = (date, info) => {
7
+ const outsideInfo = {
8
+ type: picker.value,
9
+ ...info
10
+ };
11
+ delete outsideInfo.activeIndex;
12
+ if (!generateConfig.value.isValidate(date) || disabledDate.value && disabledDate.value(date, outsideInfo)) return true;
13
+ if ((picker.value === "date" || picker.value === "time") && showTime.value) {
14
+ const range = info && info.activeIndex === 1 ? "end" : "start";
15
+ const { disabledHours, disabledMinutes, disabledSeconds, disabledMilliseconds } = showTime.value.disabledTime?.(date, range, { from: outsideInfo.from }) || {};
16
+ const { disabledHours: legacyDisabledHours, disabledMinutes: legacyDisabledMinutes, disabledSeconds: legacyDisabledSeconds, disabledMilliseconds: legacyDisabledMilliseconds } = showTime.value;
17
+ const mergedDisabledHours = disabledHours || legacyDisabledHours;
18
+ const mergedDisabledMinutes = disabledMinutes || legacyDisabledMinutes;
19
+ const mergedDisabledSeconds = disabledSeconds || legacyDisabledSeconds;
20
+ const mergedDisabledMilliseconds = disabledMilliseconds || legacyDisabledMilliseconds;
21
+ const hour = generateConfig.value.getHour(date);
22
+ const minute = generateConfig.value.getMinute(date);
23
+ const second = generateConfig.value.getSecond(date);
24
+ const millisecond = generateConfig.value.getMillisecond(date);
25
+ if (mergedDisabledHours && mergedDisabledHours().includes(hour)) return true;
26
+ if (mergedDisabledMinutes && mergedDisabledMinutes(hour).includes(minute)) return true;
27
+ if (mergedDisabledSeconds && mergedDisabledSeconds(hour, minute).includes(second)) return true;
28
+ if (mergedDisabledMilliseconds && mergedDisabledMilliseconds(hour, minute, second).includes(millisecond)) return true;
29
+ }
30
+ return false;
31
+ };
32
+ return isInvalidate;
33
+ }
34
+ exports.default = useInvalidate;
@@ -0,0 +1,10 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { GenerateConfig } from '../../generate';
3
+ import { PanelMode, RangeTimeProps, SharedPickerProps, SharedTimeProps } from '../../interface';
4
+ /**
5
+ * Check if provided date is valid for the `disabledDate` & `showTime.disabledTime`.
6
+ */
7
+ export default function useInvalidate<DateType extends object = any>(generateConfig: Ref<GenerateConfig<DateType>>, picker: Ref<PanelMode>, disabledDate: Ref<SharedPickerProps<DateType>['disabledDate'] | undefined>, showTime: Ref<SharedTimeProps<DateType> | RangeTimeProps | null> | ComputedRef<SharedTimeProps<DateType> | RangeTimeProps | null>): (date: DateType, info?: {
8
+ from?: DateType;
9
+ activeIndex: number;
10
+ }) => boolean;
@@ -0,0 +1,30 @@
1
+ function useInvalidate(generateConfig, picker, disabledDate, showTime) {
2
+ const isInvalidate = (date, info) => {
3
+ const outsideInfo = {
4
+ type: picker.value,
5
+ ...info
6
+ };
7
+ delete outsideInfo.activeIndex;
8
+ if (!generateConfig.value.isValidate(date) || disabledDate.value && disabledDate.value(date, outsideInfo)) return true;
9
+ if ((picker.value === "date" || picker.value === "time") && showTime.value) {
10
+ const range = info && info.activeIndex === 1 ? "end" : "start";
11
+ const { disabledHours, disabledMinutes, disabledSeconds, disabledMilliseconds } = showTime.value.disabledTime?.(date, range, { from: outsideInfo.from }) || {};
12
+ const { disabledHours: legacyDisabledHours, disabledMinutes: legacyDisabledMinutes, disabledSeconds: legacyDisabledSeconds, disabledMilliseconds: legacyDisabledMilliseconds } = showTime.value;
13
+ const mergedDisabledHours = disabledHours || legacyDisabledHours;
14
+ const mergedDisabledMinutes = disabledMinutes || legacyDisabledMinutes;
15
+ const mergedDisabledSeconds = disabledSeconds || legacyDisabledSeconds;
16
+ const mergedDisabledMilliseconds = disabledMilliseconds || legacyDisabledMilliseconds;
17
+ const hour = generateConfig.value.getHour(date);
18
+ const minute = generateConfig.value.getMinute(date);
19
+ const second = generateConfig.value.getSecond(date);
20
+ const millisecond = generateConfig.value.getMillisecond(date);
21
+ if (mergedDisabledHours && mergedDisabledHours().includes(hour)) return true;
22
+ if (mergedDisabledMinutes && mergedDisabledMinutes(hour).includes(minute)) return true;
23
+ if (mergedDisabledSeconds && mergedDisabledSeconds(hour, minute).includes(second)) return true;
24
+ if (mergedDisabledMilliseconds && mergedDisabledMilliseconds(hour, minute, second).includes(millisecond)) return true;
25
+ }
26
+ return false;
27
+ };
28
+ return isInvalidate;
29
+ }
30
+ export { useInvalidate as default };