@rc-component/picker 1.0.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 (569) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +154 -0
  3. package/assets/index.css +407 -0
  4. package/assets/index.less +570 -0
  5. package/es/PickerInput/Popup/Footer.d.ts +19 -0
  6. package/es/PickerInput/Popup/Footer.js +78 -0
  7. package/es/PickerInput/Popup/PopupPanel.d.ts +10 -0
  8. package/es/PickerInput/Popup/PopupPanel.js +84 -0
  9. package/es/PickerInput/Popup/PresetPanel.d.ts +9 -0
  10. package/es/PickerInput/Popup/PresetPanel.js +31 -0
  11. package/es/PickerInput/Popup/index.d.ts +20 -0
  12. package/es/PickerInput/Popup/index.js +198 -0
  13. package/es/PickerInput/RangePicker.d.ts +54 -0
  14. package/es/PickerInput/RangePicker.js +641 -0
  15. package/es/PickerInput/Selector/Icon.d.ts +10 -0
  16. package/es/PickerInput/Selector/Icon.js +32 -0
  17. package/es/PickerInput/Selector/Input.d.ts +28 -0
  18. package/es/PickerInput/Selector/Input.js +377 -0
  19. package/es/PickerInput/Selector/MaskFormat.d.ts +22 -0
  20. package/es/PickerInput/Selector/MaskFormat.js +107 -0
  21. package/es/PickerInput/Selector/RangeSelector.d.ts +26 -0
  22. package/es/PickerInput/Selector/RangeSelector.js +218 -0
  23. package/es/PickerInput/Selector/SingleSelector/MultipleDates.d.ts +12 -0
  24. package/es/PickerInput/Selector/SingleSelector/MultipleDates.js +66 -0
  25. package/es/PickerInput/Selector/SingleSelector/index.d.ts +18 -0
  26. package/es/PickerInput/Selector/SingleSelector/index.js +187 -0
  27. package/es/PickerInput/Selector/hooks/useClearIcon.d.ts +8 -0
  28. package/es/PickerInput/Selector/hooks/useClearIcon.js +19 -0
  29. package/es/PickerInput/Selector/hooks/useInputProps.d.ts +16 -0
  30. package/es/PickerInput/Selector/hooks/useInputProps.js +178 -0
  31. package/es/PickerInput/Selector/hooks/useRootProps.d.ts +2 -0
  32. package/es/PickerInput/Selector/hooks/useRootProps.js +8 -0
  33. package/es/PickerInput/Selector/util.d.ts +1 -0
  34. package/es/PickerInput/Selector/util.js +12 -0
  35. package/es/PickerInput/SinglePicker.d.ts +51 -0
  36. package/es/PickerInput/SinglePicker.js +545 -0
  37. package/es/PickerInput/context.d.ts +13 -0
  38. package/es/PickerInput/context.js +3 -0
  39. package/es/PickerInput/hooks/useCellRender.d.ts +2 -0
  40. package/es/PickerInput/hooks/useCellRender.js +41 -0
  41. package/es/PickerInput/hooks/useDelayState.d.ts +5 -0
  42. package/es/PickerInput/hooks/useDelayState.js +48 -0
  43. package/es/PickerInput/hooks/useDisabledBoundary.d.ts +7 -0
  44. package/es/PickerInput/hooks/useDisabledBoundary.js +20 -0
  45. package/es/PickerInput/hooks/useFieldFormat.d.ts +2 -0
  46. package/es/PickerInput/hooks/useFieldFormat.js +18 -0
  47. package/es/PickerInput/hooks/useFieldsInvalidate.d.ts +5 -0
  48. package/es/PickerInput/hooks/useFieldsInvalidate.js +55 -0
  49. package/es/PickerInput/hooks/useFilledProps.d.ts +37 -0
  50. package/es/PickerInput/hooks/useFilledProps.js +155 -0
  51. package/es/PickerInput/hooks/useInputReadOnly.d.ts +2 -0
  52. package/es/PickerInput/hooks/useInputReadOnly.js +6 -0
  53. package/es/PickerInput/hooks/useInvalidate.d.ts +9 -0
  54. package/es/PickerInput/hooks/useInvalidate.js +61 -0
  55. package/es/PickerInput/hooks/useLockEffect.d.ts +5 -0
  56. package/es/PickerInput/hooks/useLockEffect.js +25 -0
  57. package/es/PickerInput/hooks/useOpen.d.ts +6 -0
  58. package/es/PickerInput/hooks/useOpen.js +33 -0
  59. package/es/PickerInput/hooks/usePickerRef.d.ts +7 -0
  60. package/es/PickerInput/hooks/usePickerRef.js +19 -0
  61. package/es/PickerInput/hooks/usePresets.d.ts +2 -0
  62. package/es/PickerInput/hooks/usePresets.js +28 -0
  63. package/es/PickerInput/hooks/useRangeActive.d.ts +19 -0
  64. package/es/PickerInput/hooks/useRangeActive.js +74 -0
  65. package/es/PickerInput/hooks/useRangeDisabledDate.d.ts +8 -0
  66. package/es/PickerInput/hooks/useRangeDisabledDate.js +53 -0
  67. package/es/PickerInput/hooks/useRangePickerValue.d.ts +5 -0
  68. package/es/PickerInput/hooks/useRangePickerValue.js +192 -0
  69. package/es/PickerInput/hooks/useRangeValue.d.ts +28 -0
  70. package/es/PickerInput/hooks/useRangeValue.js +297 -0
  71. package/es/PickerInput/hooks/useShowNow.d.ts +2 -0
  72. package/es/PickerInput/hooks/useShowNow.js +14 -0
  73. package/es/PickerPanel/DatePanel/index.d.ts +10 -0
  74. package/es/PickerPanel/DatePanel/index.js +190 -0
  75. package/es/PickerPanel/DateTimePanel/index.d.ts +3 -0
  76. package/es/PickerPanel/DateTimePanel/index.js +55 -0
  77. package/es/PickerPanel/DecadePanel/index.d.ts +3 -0
  78. package/es/PickerPanel/DecadePanel/index.js +113 -0
  79. package/es/PickerPanel/MonthPanel/index.d.ts +3 -0
  80. package/es/PickerPanel/MonthPanel/index.js +106 -0
  81. package/es/PickerPanel/PanelBody.d.ts +17 -0
  82. package/es/PickerPanel/PanelBody.js +153 -0
  83. package/es/PickerPanel/PanelHeader.d.ts +11 -0
  84. package/es/PickerPanel/PanelHeader.js +133 -0
  85. package/es/PickerPanel/QuarterPanel/index.d.ts +3 -0
  86. package/es/PickerPanel/QuarterPanel/index.js +92 -0
  87. package/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.d.ts +17 -0
  88. package/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +149 -0
  89. package/es/PickerPanel/TimePanel/TimePanelBody/index.d.ts +4 -0
  90. package/es/PickerPanel/TimePanel/TimePanelBody/index.js +283 -0
  91. package/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.d.ts +2 -0
  92. package/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js +72 -0
  93. package/es/PickerPanel/TimePanel/TimePanelBody/util.d.ts +3 -0
  94. package/es/PickerPanel/TimePanel/TimePanelBody/util.js +43 -0
  95. package/es/PickerPanel/TimePanel/index.d.ts +4 -0
  96. package/es/PickerPanel/TimePanel/index.js +38 -0
  97. package/es/PickerPanel/WeekPanel/index.d.ts +3 -0
  98. package/es/PickerPanel/WeekPanel/index.js +55 -0
  99. package/es/PickerPanel/YearPanel/index.d.ts +3 -0
  100. package/es/PickerPanel/YearPanel/index.js +116 -0
  101. package/es/PickerPanel/context.d.ts +24 -0
  102. package/es/PickerPanel/context.js +67 -0
  103. package/es/PickerPanel/index.d.ts +60 -0
  104. package/es/PickerPanel/index.js +315 -0
  105. package/es/PickerTrigger/index.d.ts +19 -0
  106. package/es/PickerTrigger/index.js +86 -0
  107. package/es/PickerTrigger/util.d.ts +2 -0
  108. package/es/PickerTrigger/util.js +4 -0
  109. package/es/generate/dateFns.d.ts +3 -0
  110. package/es/generate/dateFns.js +163 -0
  111. package/es/generate/dayjs.d.ts +4 -0
  112. package/es/generate/dayjs.js +233 -0
  113. package/es/generate/index.d.ts +37 -0
  114. package/es/generate/index.js +1 -0
  115. package/es/generate/luxon.d.ts +4 -0
  116. package/es/generate/luxon.js +197 -0
  117. package/es/generate/moment.d.ts +4 -0
  118. package/es/generate/moment.js +152 -0
  119. package/es/hooks/useLocale.d.ts +6 -0
  120. package/es/hooks/useLocale.js +82 -0
  121. package/es/hooks/useSyncState.d.ts +6 -0
  122. package/es/hooks/useSyncState.js +27 -0
  123. package/es/hooks/useTimeConfig.d.ts +18 -0
  124. package/es/hooks/useTimeConfig.js +166 -0
  125. package/es/hooks/useTimeInfo.d.ts +12 -0
  126. package/es/hooks/useTimeInfo.js +164 -0
  127. package/es/hooks/useToggleDates.d.ts +8 -0
  128. package/es/hooks/useToggleDates.js +26 -0
  129. package/es/index.d.ts +35 -0
  130. package/es/index.js +34 -0
  131. package/es/interface.d.ts +365 -0
  132. package/es/interface.js +1 -0
  133. package/es/locale/am_ET.d.ts +3 -0
  134. package/es/locale/am_ET.js +31 -0
  135. package/es/locale/ar_EG.d.ts +3 -0
  136. package/es/locale/ar_EG.js +34 -0
  137. package/es/locale/az_AZ.d.ts +3 -0
  138. package/es/locale/az_AZ.js +35 -0
  139. package/es/locale/bg_BG.d.ts +3 -0
  140. package/es/locale/bg_BG.js +34 -0
  141. package/es/locale/bn_BD.d.ts +3 -0
  142. package/es/locale/bn_BD.js +35 -0
  143. package/es/locale/by_BY.d.ts +3 -0
  144. package/es/locale/by_BY.js +35 -0
  145. package/es/locale/ca_ES.d.ts +3 -0
  146. package/es/locale/ca_ES.js +34 -0
  147. package/es/locale/common.d.ts +2 -0
  148. package/es/locale/common.js +6 -0
  149. package/es/locale/cs_CZ.d.ts +3 -0
  150. package/es/locale/cs_CZ.js +34 -0
  151. package/es/locale/da_DK.d.ts +3 -0
  152. package/es/locale/da_DK.js +34 -0
  153. package/es/locale/de_DE.d.ts +3 -0
  154. package/es/locale/de_DE.js +34 -0
  155. package/es/locale/el_GR.d.ts +3 -0
  156. package/es/locale/el_GR.js +34 -0
  157. package/es/locale/en_GB.d.ts +3 -0
  158. package/es/locale/en_GB.js +34 -0
  159. package/es/locale/en_US.d.ts +3 -0
  160. package/es/locale/en_US.js +35 -0
  161. package/es/locale/es_ES.d.ts +3 -0
  162. package/es/locale/es_ES.js +34 -0
  163. package/es/locale/es_MX.d.ts +3 -0
  164. package/es/locale/es_MX.js +35 -0
  165. package/es/locale/et_EE.d.ts +3 -0
  166. package/es/locale/et_EE.js +34 -0
  167. package/es/locale/eu_ES.d.ts +3 -0
  168. package/es/locale/eu_ES.js +36 -0
  169. package/es/locale/fa_IR.d.ts +3 -0
  170. package/es/locale/fa_IR.js +34 -0
  171. package/es/locale/fi_FI.d.ts +3 -0
  172. package/es/locale/fi_FI.js +34 -0
  173. package/es/locale/fr_BE.d.ts +3 -0
  174. package/es/locale/fr_BE.js +34 -0
  175. package/es/locale/fr_CA.d.ts +3 -0
  176. package/es/locale/fr_CA.js +35 -0
  177. package/es/locale/fr_FR.d.ts +3 -0
  178. package/es/locale/fr_FR.js +35 -0
  179. package/es/locale/ga_IE.d.ts +3 -0
  180. package/es/locale/ga_IE.js +35 -0
  181. package/es/locale/gl_ES.d.ts +3 -0
  182. package/es/locale/gl_ES.js +34 -0
  183. package/es/locale/he_IL.d.ts +3 -0
  184. package/es/locale/he_IL.js +35 -0
  185. package/es/locale/hi_IN.d.ts +3 -0
  186. package/es/locale/hi_IN.js +35 -0
  187. package/es/locale/hr_HR.d.ts +3 -0
  188. package/es/locale/hr_HR.js +35 -0
  189. package/es/locale/hu_HU.d.ts +3 -0
  190. package/es/locale/hu_HU.js +58 -0
  191. package/es/locale/id_ID.d.ts +3 -0
  192. package/es/locale/id_ID.js +35 -0
  193. package/es/locale/is_IS.d.ts +3 -0
  194. package/es/locale/is_IS.js +34 -0
  195. package/es/locale/it_IT.d.ts +3 -0
  196. package/es/locale/it_IT.js +34 -0
  197. package/es/locale/ja_JP.d.ts +3 -0
  198. package/es/locale/ja_JP.js +37 -0
  199. package/es/locale/ka_GE.d.ts +3 -0
  200. package/es/locale/ka_GE.js +35 -0
  201. package/es/locale/kk_KZ.d.ts +3 -0
  202. package/es/locale/kk_KZ.js +34 -0
  203. package/es/locale/km_KH.d.ts +3 -0
  204. package/es/locale/km_KH.js +36 -0
  205. package/es/locale/kmr_IQ.d.ts +3 -0
  206. package/es/locale/kmr_IQ.js +34 -0
  207. package/es/locale/kn_IN.d.ts +3 -0
  208. package/es/locale/kn_IN.js +35 -0
  209. package/es/locale/ko_KR.d.ts +3 -0
  210. package/es/locale/ko_KR.js +36 -0
  211. package/es/locale/lt_LT.d.ts +3 -0
  212. package/es/locale/lt_LT.js +36 -0
  213. package/es/locale/lv_LV.d.ts +3 -0
  214. package/es/locale/lv_LV.js +34 -0
  215. package/es/locale/mk_MK.d.ts +3 -0
  216. package/es/locale/mk_MK.js +34 -0
  217. package/es/locale/ml_IN.d.ts +3 -0
  218. package/es/locale/ml_IN.js +35 -0
  219. package/es/locale/mn_MN.d.ts +3 -0
  220. package/es/locale/mn_MN.js +36 -0
  221. package/es/locale/ms_MY.d.ts +3 -0
  222. package/es/locale/ms_MY.js +36 -0
  223. package/es/locale/my_MM.d.ts +3 -0
  224. package/es/locale/my_MM.js +35 -0
  225. package/es/locale/nb_NO.d.ts +3 -0
  226. package/es/locale/nb_NO.js +36 -0
  227. package/es/locale/ne_NP.d.ts +3 -0
  228. package/es/locale/ne_NP.js +35 -0
  229. package/es/locale/nl_BE.d.ts +3 -0
  230. package/es/locale/nl_BE.js +34 -0
  231. package/es/locale/nl_NL.d.ts +3 -0
  232. package/es/locale/nl_NL.js +34 -0
  233. package/es/locale/pl_PL.d.ts +3 -0
  234. package/es/locale/pl_PL.js +34 -0
  235. package/es/locale/pt_BR.d.ts +3 -0
  236. package/es/locale/pt_BR.js +37 -0
  237. package/es/locale/pt_PT.d.ts +3 -0
  238. package/es/locale/pt_PT.js +36 -0
  239. package/es/locale/ro_RO.d.ts +3 -0
  240. package/es/locale/ro_RO.js +35 -0
  241. package/es/locale/ru_RU.d.ts +3 -0
  242. package/es/locale/ru_RU.js +34 -0
  243. package/es/locale/si_LK.d.ts +3 -0
  244. package/es/locale/si_LK.js +36 -0
  245. package/es/locale/sk_SK.d.ts +3 -0
  246. package/es/locale/sk_SK.js +34 -0
  247. package/es/locale/sl_SI.d.ts +3 -0
  248. package/es/locale/sl_SI.js +34 -0
  249. package/es/locale/sr_Cyrl_RS.d.ts +3 -0
  250. package/es/locale/sr_Cyrl_RS.js +34 -0
  251. package/es/locale/sr_RS.d.ts +3 -0
  252. package/es/locale/sr_RS.js +34 -0
  253. package/es/locale/sv_SE.d.ts +3 -0
  254. package/es/locale/sv_SE.js +34 -0
  255. package/es/locale/ta_IN.d.ts +3 -0
  256. package/es/locale/ta_IN.js +35 -0
  257. package/es/locale/th_TH.d.ts +3 -0
  258. package/es/locale/th_TH.js +34 -0
  259. package/es/locale/tk_TK.d.ts +3 -0
  260. package/es/locale/tk_TK.js +34 -0
  261. package/es/locale/tr_TR.d.ts +3 -0
  262. package/es/locale/tr_TR.js +36 -0
  263. package/es/locale/ug_CN.d.ts +3 -0
  264. package/es/locale/ug_CN.js +37 -0
  265. package/es/locale/uk_UA.d.ts +3 -0
  266. package/es/locale/uk_UA.js +34 -0
  267. package/es/locale/ur_PK.d.ts +3 -0
  268. package/es/locale/ur_PK.js +35 -0
  269. package/es/locale/uz_UZ.d.ts +3 -0
  270. package/es/locale/uz_UZ.js +35 -0
  271. package/es/locale/vi_VN.d.ts +3 -0
  272. package/es/locale/vi_VN.js +35 -0
  273. package/es/locale/zh_CN.d.ts +3 -0
  274. package/es/locale/zh_CN.js +36 -0
  275. package/es/locale/zh_TW.d.ts +3 -0
  276. package/es/locale/zh_TW.js +38 -0
  277. package/es/utils/dateUtil.d.ts +29 -0
  278. package/es/utils/dateUtil.js +140 -0
  279. package/es/utils/getClearIcon.d.ts +5 -0
  280. package/es/utils/getClearIcon.js +8 -0
  281. package/es/utils/miscUtil.d.ts +14 -0
  282. package/es/utils/miscUtil.js +70 -0
  283. package/es/utils/uiUtil.d.ts +1 -0
  284. package/es/utils/uiUtil.js +7 -0
  285. package/es/utils/warnUtil.d.ts +5 -0
  286. package/es/utils/warnUtil.js +10 -0
  287. package/lib/PickerInput/Popup/Footer.d.ts +19 -0
  288. package/lib/PickerInput/Popup/Footer.js +88 -0
  289. package/lib/PickerInput/Popup/PopupPanel.d.ts +10 -0
  290. package/lib/PickerInput/Popup/PopupPanel.js +93 -0
  291. package/lib/PickerInput/Popup/PresetPanel.d.ts +9 -0
  292. package/lib/PickerInput/Popup/PresetPanel.js +40 -0
  293. package/lib/PickerInput/Popup/index.d.ts +20 -0
  294. package/lib/PickerInput/Popup/index.js +207 -0
  295. package/lib/PickerInput/RangePicker.d.ts +54 -0
  296. package/lib/PickerInput/RangePicker.js +650 -0
  297. package/lib/PickerInput/Selector/Icon.d.ts +10 -0
  298. package/lib/PickerInput/Selector/Icon.js +43 -0
  299. package/lib/PickerInput/Selector/Input.d.ts +28 -0
  300. package/lib/PickerInput/Selector/Input.js +385 -0
  301. package/lib/PickerInput/Selector/MaskFormat.d.ts +22 -0
  302. package/lib/PickerInput/Selector/MaskFormat.js +112 -0
  303. package/lib/PickerInput/Selector/RangeSelector.d.ts +26 -0
  304. package/lib/PickerInput/Selector/RangeSelector.js +227 -0
  305. package/lib/PickerInput/Selector/SingleSelector/MultipleDates.d.ts +12 -0
  306. package/lib/PickerInput/Selector/SingleSelector/MultipleDates.js +76 -0
  307. package/lib/PickerInput/Selector/SingleSelector/index.d.ts +18 -0
  308. package/lib/PickerInput/Selector/SingleSelector/index.js +196 -0
  309. package/lib/PickerInput/Selector/hooks/useClearIcon.d.ts +8 -0
  310. package/lib/PickerInput/Selector/hooks/useClearIcon.js +27 -0
  311. package/lib/PickerInput/Selector/hooks/useInputProps.d.ts +16 -0
  312. package/lib/PickerInput/Selector/hooks/useInputProps.js +187 -0
  313. package/lib/PickerInput/Selector/hooks/useRootProps.d.ts +2 -0
  314. package/lib/PickerInput/Selector/hooks/useRootProps.js +17 -0
  315. package/lib/PickerInput/Selector/util.d.ts +1 -0
  316. package/lib/PickerInput/Selector/util.js +18 -0
  317. package/lib/PickerInput/SinglePicker.d.ts +51 -0
  318. package/lib/PickerInput/SinglePicker.js +553 -0
  319. package/lib/PickerInput/context.d.ts +13 -0
  320. package/lib/PickerInput/context.js +12 -0
  321. package/lib/PickerInput/hooks/useCellRender.d.ts +2 -0
  322. package/lib/PickerInput/hooks/useCellRender.js +49 -0
  323. package/lib/PickerInput/hooks/useDelayState.d.ts +5 -0
  324. package/lib/PickerInput/hooks/useDelayState.js +54 -0
  325. package/lib/PickerInput/hooks/useDisabledBoundary.d.ts +7 -0
  326. package/lib/PickerInput/hooks/useDisabledBoundary.js +26 -0
  327. package/lib/PickerInput/hooks/useFieldFormat.d.ts +2 -0
  328. package/lib/PickerInput/hooks/useFieldFormat.js +26 -0
  329. package/lib/PickerInput/hooks/useFieldsInvalidate.d.ts +5 -0
  330. package/lib/PickerInput/hooks/useFieldsInvalidate.js +64 -0
  331. package/lib/PickerInput/hooks/useFilledProps.d.ts +37 -0
  332. package/lib/PickerInput/hooks/useFilledProps.js +164 -0
  333. package/lib/PickerInput/hooks/useInputReadOnly.d.ts +2 -0
  334. package/lib/PickerInput/hooks/useInputReadOnly.js +12 -0
  335. package/lib/PickerInput/hooks/useInvalidate.d.ts +9 -0
  336. package/lib/PickerInput/hooks/useInvalidate.js +67 -0
  337. package/lib/PickerInput/hooks/useLockEffect.d.ts +5 -0
  338. package/lib/PickerInput/hooks/useLockEffect.js +34 -0
  339. package/lib/PickerInput/hooks/useOpen.d.ts +6 -0
  340. package/lib/PickerInput/hooks/useOpen.js +39 -0
  341. package/lib/PickerInput/hooks/usePickerRef.d.ts +7 -0
  342. package/lib/PickerInput/hooks/usePickerRef.js +28 -0
  343. package/lib/PickerInput/hooks/usePresets.d.ts +2 -0
  344. package/lib/PickerInput/hooks/usePresets.js +38 -0
  345. package/lib/PickerInput/hooks/useRangeActive.d.ts +19 -0
  346. package/lib/PickerInput/hooks/useRangeActive.js +84 -0
  347. package/lib/PickerInput/hooks/useRangeDisabledDate.d.ts +8 -0
  348. package/lib/PickerInput/hooks/useRangeDisabledDate.js +58 -0
  349. package/lib/PickerInput/hooks/useRangePickerValue.d.ts +5 -0
  350. package/lib/PickerInput/hooks/useRangePickerValue.js +203 -0
  351. package/lib/PickerInput/hooks/useRangeValue.d.ts +28 -0
  352. package/lib/PickerInput/hooks/useRangeValue.js +308 -0
  353. package/lib/PickerInput/hooks/useShowNow.d.ts +2 -0
  354. package/lib/PickerInput/hooks/useShowNow.js +20 -0
  355. package/lib/PickerPanel/DatePanel/index.d.ts +10 -0
  356. package/lib/PickerPanel/DatePanel/index.js +199 -0
  357. package/lib/PickerPanel/DateTimePanel/index.d.ts +3 -0
  358. package/lib/PickerPanel/DateTimePanel/index.js +65 -0
  359. package/lib/PickerPanel/DecadePanel/index.d.ts +3 -0
  360. package/lib/PickerPanel/DecadePanel/index.js +122 -0
  361. package/lib/PickerPanel/MonthPanel/index.d.ts +3 -0
  362. package/lib/PickerPanel/MonthPanel/index.js +115 -0
  363. package/lib/PickerPanel/PanelBody.d.ts +17 -0
  364. package/lib/PickerPanel/PanelBody.js +162 -0
  365. package/lib/PickerPanel/PanelHeader.d.ts +11 -0
  366. package/lib/PickerPanel/PanelHeader.js +143 -0
  367. package/lib/PickerPanel/QuarterPanel/index.d.ts +3 -0
  368. package/lib/PickerPanel/QuarterPanel/index.js +101 -0
  369. package/lib/PickerPanel/TimePanel/TimePanelBody/TimeColumn.d.ts +17 -0
  370. package/lib/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +158 -0
  371. package/lib/PickerPanel/TimePanel/TimePanelBody/index.d.ts +4 -0
  372. package/lib/PickerPanel/TimePanel/TimePanelBody/index.js +293 -0
  373. package/lib/PickerPanel/TimePanel/TimePanelBody/useScrollTo.d.ts +2 -0
  374. package/lib/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js +82 -0
  375. package/lib/PickerPanel/TimePanel/TimePanelBody/util.d.ts +3 -0
  376. package/lib/PickerPanel/TimePanel/TimePanelBody/util.js +49 -0
  377. package/lib/PickerPanel/TimePanel/index.d.ts +4 -0
  378. package/lib/PickerPanel/TimePanel/index.js +48 -0
  379. package/lib/PickerPanel/WeekPanel/index.d.ts +3 -0
  380. package/lib/PickerPanel/WeekPanel/index.js +64 -0
  381. package/lib/PickerPanel/YearPanel/index.d.ts +3 -0
  382. package/lib/PickerPanel/YearPanel/index.js +125 -0
  383. package/lib/PickerPanel/context.d.ts +24 -0
  384. package/lib/PickerPanel/context.js +78 -0
  385. package/lib/PickerPanel/index.d.ts +60 -0
  386. package/lib/PickerPanel/index.js +324 -0
  387. package/lib/PickerTrigger/index.d.ts +19 -0
  388. package/lib/PickerTrigger/index.js +95 -0
  389. package/lib/PickerTrigger/util.d.ts +2 -0
  390. package/lib/PickerTrigger/util.js +10 -0
  391. package/lib/generate/dateFns.d.ts +3 -0
  392. package/lib/generate/dateFns.js +172 -0
  393. package/lib/generate/dayjs.d.ts +4 -0
  394. package/lib/generate/dayjs.js +240 -0
  395. package/lib/generate/index.d.ts +37 -0
  396. package/lib/generate/index.js +5 -0
  397. package/lib/generate/luxon.d.ts +4 -0
  398. package/lib/generate/luxon.js +203 -0
  399. package/lib/generate/moment.d.ts +4 -0
  400. package/lib/generate/moment.js +159 -0
  401. package/lib/hooks/useLocale.d.ts +6 -0
  402. package/lib/hooks/useLocale.js +90 -0
  403. package/lib/hooks/useSyncState.d.ts +6 -0
  404. package/lib/hooks/useSyncState.js +35 -0
  405. package/lib/hooks/useTimeConfig.d.ts +18 -0
  406. package/lib/hooks/useTimeConfig.js +173 -0
  407. package/lib/hooks/useTimeInfo.d.ts +12 -0
  408. package/lib/hooks/useTimeInfo.js +172 -0
  409. package/lib/hooks/useToggleDates.d.ts +8 -0
  410. package/lib/hooks/useToggleDates.js +32 -0
  411. package/lib/index.d.ts +35 -0
  412. package/lib/index.js +57 -0
  413. package/lib/interface.d.ts +365 -0
  414. package/lib/interface.js +5 -0
  415. package/lib/locale/am_ET.d.ts +3 -0
  416. package/lib/locale/am_ET.js +37 -0
  417. package/lib/locale/ar_EG.d.ts +3 -0
  418. package/lib/locale/ar_EG.js +40 -0
  419. package/lib/locale/az_AZ.d.ts +3 -0
  420. package/lib/locale/az_AZ.js +41 -0
  421. package/lib/locale/bg_BG.d.ts +3 -0
  422. package/lib/locale/bg_BG.js +40 -0
  423. package/lib/locale/bn_BD.d.ts +3 -0
  424. package/lib/locale/bn_BD.js +41 -0
  425. package/lib/locale/by_BY.d.ts +3 -0
  426. package/lib/locale/by_BY.js +41 -0
  427. package/lib/locale/ca_ES.d.ts +3 -0
  428. package/lib/locale/ca_ES.js +40 -0
  429. package/lib/locale/common.d.ts +2 -0
  430. package/lib/locale/common.js +12 -0
  431. package/lib/locale/cs_CZ.d.ts +3 -0
  432. package/lib/locale/cs_CZ.js +40 -0
  433. package/lib/locale/da_DK.d.ts +3 -0
  434. package/lib/locale/da_DK.js +40 -0
  435. package/lib/locale/de_DE.d.ts +3 -0
  436. package/lib/locale/de_DE.js +40 -0
  437. package/lib/locale/el_GR.d.ts +3 -0
  438. package/lib/locale/el_GR.js +40 -0
  439. package/lib/locale/en_GB.d.ts +3 -0
  440. package/lib/locale/en_GB.js +40 -0
  441. package/lib/locale/en_US.d.ts +3 -0
  442. package/lib/locale/en_US.js +41 -0
  443. package/lib/locale/es_ES.d.ts +3 -0
  444. package/lib/locale/es_ES.js +40 -0
  445. package/lib/locale/es_MX.d.ts +3 -0
  446. package/lib/locale/es_MX.js +41 -0
  447. package/lib/locale/et_EE.d.ts +3 -0
  448. package/lib/locale/et_EE.js +40 -0
  449. package/lib/locale/eu_ES.d.ts +3 -0
  450. package/lib/locale/eu_ES.js +42 -0
  451. package/lib/locale/fa_IR.d.ts +3 -0
  452. package/lib/locale/fa_IR.js +40 -0
  453. package/lib/locale/fi_FI.d.ts +3 -0
  454. package/lib/locale/fi_FI.js +40 -0
  455. package/lib/locale/fr_BE.d.ts +3 -0
  456. package/lib/locale/fr_BE.js +40 -0
  457. package/lib/locale/fr_CA.d.ts +3 -0
  458. package/lib/locale/fr_CA.js +41 -0
  459. package/lib/locale/fr_FR.d.ts +3 -0
  460. package/lib/locale/fr_FR.js +41 -0
  461. package/lib/locale/ga_IE.d.ts +3 -0
  462. package/lib/locale/ga_IE.js +41 -0
  463. package/lib/locale/gl_ES.d.ts +3 -0
  464. package/lib/locale/gl_ES.js +40 -0
  465. package/lib/locale/he_IL.d.ts +3 -0
  466. package/lib/locale/he_IL.js +41 -0
  467. package/lib/locale/hi_IN.d.ts +3 -0
  468. package/lib/locale/hi_IN.js +41 -0
  469. package/lib/locale/hr_HR.d.ts +3 -0
  470. package/lib/locale/hr_HR.js +41 -0
  471. package/lib/locale/hu_HU.d.ts +3 -0
  472. package/lib/locale/hu_HU.js +64 -0
  473. package/lib/locale/id_ID.d.ts +3 -0
  474. package/lib/locale/id_ID.js +41 -0
  475. package/lib/locale/is_IS.d.ts +3 -0
  476. package/lib/locale/is_IS.js +40 -0
  477. package/lib/locale/it_IT.d.ts +3 -0
  478. package/lib/locale/it_IT.js +40 -0
  479. package/lib/locale/ja_JP.d.ts +3 -0
  480. package/lib/locale/ja_JP.js +43 -0
  481. package/lib/locale/ka_GE.d.ts +3 -0
  482. package/lib/locale/ka_GE.js +41 -0
  483. package/lib/locale/kk_KZ.d.ts +3 -0
  484. package/lib/locale/kk_KZ.js +40 -0
  485. package/lib/locale/km_KH.d.ts +3 -0
  486. package/lib/locale/km_KH.js +42 -0
  487. package/lib/locale/kmr_IQ.d.ts +3 -0
  488. package/lib/locale/kmr_IQ.js +40 -0
  489. package/lib/locale/kn_IN.d.ts +3 -0
  490. package/lib/locale/kn_IN.js +41 -0
  491. package/lib/locale/ko_KR.d.ts +3 -0
  492. package/lib/locale/ko_KR.js +42 -0
  493. package/lib/locale/lt_LT.d.ts +3 -0
  494. package/lib/locale/lt_LT.js +42 -0
  495. package/lib/locale/lv_LV.d.ts +3 -0
  496. package/lib/locale/lv_LV.js +40 -0
  497. package/lib/locale/mk_MK.d.ts +3 -0
  498. package/lib/locale/mk_MK.js +40 -0
  499. package/lib/locale/ml_IN.d.ts +3 -0
  500. package/lib/locale/ml_IN.js +41 -0
  501. package/lib/locale/mn_MN.d.ts +3 -0
  502. package/lib/locale/mn_MN.js +42 -0
  503. package/lib/locale/ms_MY.d.ts +3 -0
  504. package/lib/locale/ms_MY.js +42 -0
  505. package/lib/locale/my_MM.d.ts +3 -0
  506. package/lib/locale/my_MM.js +41 -0
  507. package/lib/locale/nb_NO.d.ts +3 -0
  508. package/lib/locale/nb_NO.js +42 -0
  509. package/lib/locale/ne_NP.d.ts +3 -0
  510. package/lib/locale/ne_NP.js +41 -0
  511. package/lib/locale/nl_BE.d.ts +3 -0
  512. package/lib/locale/nl_BE.js +40 -0
  513. package/lib/locale/nl_NL.d.ts +3 -0
  514. package/lib/locale/nl_NL.js +40 -0
  515. package/lib/locale/pl_PL.d.ts +3 -0
  516. package/lib/locale/pl_PL.js +40 -0
  517. package/lib/locale/pt_BR.d.ts +3 -0
  518. package/lib/locale/pt_BR.js +43 -0
  519. package/lib/locale/pt_PT.d.ts +3 -0
  520. package/lib/locale/pt_PT.js +42 -0
  521. package/lib/locale/ro_RO.d.ts +3 -0
  522. package/lib/locale/ro_RO.js +41 -0
  523. package/lib/locale/ru_RU.d.ts +3 -0
  524. package/lib/locale/ru_RU.js +40 -0
  525. package/lib/locale/si_LK.d.ts +3 -0
  526. package/lib/locale/si_LK.js +42 -0
  527. package/lib/locale/sk_SK.d.ts +3 -0
  528. package/lib/locale/sk_SK.js +40 -0
  529. package/lib/locale/sl_SI.d.ts +3 -0
  530. package/lib/locale/sl_SI.js +40 -0
  531. package/lib/locale/sr_Cyrl_RS.d.ts +3 -0
  532. package/lib/locale/sr_Cyrl_RS.js +40 -0
  533. package/lib/locale/sr_RS.d.ts +3 -0
  534. package/lib/locale/sr_RS.js +40 -0
  535. package/lib/locale/sv_SE.d.ts +3 -0
  536. package/lib/locale/sv_SE.js +40 -0
  537. package/lib/locale/ta_IN.d.ts +3 -0
  538. package/lib/locale/ta_IN.js +41 -0
  539. package/lib/locale/th_TH.d.ts +3 -0
  540. package/lib/locale/th_TH.js +40 -0
  541. package/lib/locale/tk_TK.d.ts +3 -0
  542. package/lib/locale/tk_TK.js +40 -0
  543. package/lib/locale/tr_TR.d.ts +3 -0
  544. package/lib/locale/tr_TR.js +42 -0
  545. package/lib/locale/ug_CN.d.ts +3 -0
  546. package/lib/locale/ug_CN.js +43 -0
  547. package/lib/locale/uk_UA.d.ts +3 -0
  548. package/lib/locale/uk_UA.js +40 -0
  549. package/lib/locale/ur_PK.d.ts +3 -0
  550. package/lib/locale/ur_PK.js +41 -0
  551. package/lib/locale/uz_UZ.d.ts +3 -0
  552. package/lib/locale/uz_UZ.js +41 -0
  553. package/lib/locale/vi_VN.d.ts +3 -0
  554. package/lib/locale/vi_VN.js +41 -0
  555. package/lib/locale/zh_CN.d.ts +3 -0
  556. package/lib/locale/zh_CN.js +42 -0
  557. package/lib/locale/zh_TW.d.ts +3 -0
  558. package/lib/locale/zh_TW.js +44 -0
  559. package/lib/utils/dateUtil.d.ts +29 -0
  560. package/lib/utils/dateUtil.js +161 -0
  561. package/lib/utils/getClearIcon.d.ts +5 -0
  562. package/lib/utils/getClearIcon.js +15 -0
  563. package/lib/utils/miscUtil.d.ts +14 -0
  564. package/lib/utils/miscUtil.js +81 -0
  565. package/lib/utils/uiUtil.d.ts +1 -0
  566. package/lib/utils/uiUtil.js +13 -0
  567. package/lib/utils/warnUtil.d.ts +5 -0
  568. package/lib/utils/warnUtil.js +17 -0
  569. package/package.json +107 -0
@@ -0,0 +1,140 @@
1
+ export var WEEK_DAY_COUNT = 7;
2
+
3
+ /**
4
+ * Wrap the compare logic.
5
+ * This will compare the each of value is empty first.
6
+ * 1. All is empty, return true.
7
+ * 2. One is empty, return false.
8
+ * 3. return customize compare logic.
9
+ */
10
+ function nullableCompare(value1, value2, oriCompareFn) {
11
+ if (!value1 && !value2 || value1 === value2) {
12
+ return true;
13
+ }
14
+ if (!value1 || !value2) {
15
+ return false;
16
+ }
17
+ return oriCompareFn();
18
+ }
19
+ export function isSameDecade(generateConfig, decade1, decade2) {
20
+ return nullableCompare(decade1, decade2, function () {
21
+ var num1 = Math.floor(generateConfig.getYear(decade1) / 10);
22
+ var num2 = Math.floor(generateConfig.getYear(decade2) / 10);
23
+ return num1 === num2;
24
+ });
25
+ }
26
+ export function isSameYear(generateConfig, year1, year2) {
27
+ return nullableCompare(year1, year2, function () {
28
+ return generateConfig.getYear(year1) === generateConfig.getYear(year2);
29
+ });
30
+ }
31
+ export function getQuarter(generateConfig, date) {
32
+ var quota = Math.floor(generateConfig.getMonth(date) / 3);
33
+ return quota + 1;
34
+ }
35
+ export function isSameQuarter(generateConfig, quarter1, quarter2) {
36
+ return nullableCompare(quarter1, quarter2, function () {
37
+ return isSameYear(generateConfig, quarter1, quarter2) && getQuarter(generateConfig, quarter1) === getQuarter(generateConfig, quarter2);
38
+ });
39
+ }
40
+ export function isSameMonth(generateConfig, month1, month2) {
41
+ return nullableCompare(month1, month2, function () {
42
+ return isSameYear(generateConfig, month1, month2) && generateConfig.getMonth(month1) === generateConfig.getMonth(month2);
43
+ });
44
+ }
45
+ export function isSameDate(generateConfig, date1, date2) {
46
+ return nullableCompare(date1, date2, function () {
47
+ return isSameYear(generateConfig, date1, date2) && isSameMonth(generateConfig, date1, date2) && generateConfig.getDate(date1) === generateConfig.getDate(date2);
48
+ });
49
+ }
50
+ export function isSameTime(generateConfig, time1, time2) {
51
+ return nullableCompare(time1, time2, function () {
52
+ return generateConfig.getHour(time1) === generateConfig.getHour(time2) && generateConfig.getMinute(time1) === generateConfig.getMinute(time2) && generateConfig.getSecond(time1) === generateConfig.getSecond(time2);
53
+ });
54
+ }
55
+
56
+ /**
57
+ * Check if the Date is all the same of timestamp
58
+ */
59
+ export function isSameTimestamp(generateConfig, time1, time2) {
60
+ return nullableCompare(time1, time2, function () {
61
+ return isSameDate(generateConfig, time1, time2) && isSameTime(generateConfig, time1, time2) && generateConfig.getMillisecond(time1) === generateConfig.getMillisecond(time2);
62
+ });
63
+ }
64
+ export function isSameWeek(generateConfig, locale, date1, date2) {
65
+ return nullableCompare(date1, date2, function () {
66
+ var weekStartDate1 = generateConfig.locale.getWeekFirstDate(locale, date1);
67
+ var weekStartDate2 = generateConfig.locale.getWeekFirstDate(locale, date2);
68
+ return isSameYear(generateConfig, weekStartDate1, weekStartDate2) && generateConfig.locale.getWeek(locale, date1) === generateConfig.locale.getWeek(locale, date2);
69
+ });
70
+ }
71
+ export function isSame(generateConfig, locale, source, target, type) {
72
+ switch (type) {
73
+ case 'date':
74
+ return isSameDate(generateConfig, source, target);
75
+ case 'week':
76
+ return isSameWeek(generateConfig, locale.locale, source, target);
77
+ case 'month':
78
+ return isSameMonth(generateConfig, source, target);
79
+ case 'quarter':
80
+ return isSameQuarter(generateConfig, source, target);
81
+ case 'year':
82
+ return isSameYear(generateConfig, source, target);
83
+ case 'decade':
84
+ return isSameDecade(generateConfig, source, target);
85
+ case 'time':
86
+ return isSameTime(generateConfig, source, target);
87
+ default:
88
+ return isSameTimestamp(generateConfig, source, target);
89
+ }
90
+ }
91
+
92
+ /** Between in date but not equal of date */
93
+ export function isInRange(generateConfig, startDate, endDate, current) {
94
+ if (!startDate || !endDate || !current) {
95
+ return false;
96
+ }
97
+ return generateConfig.isAfter(current, startDate) && generateConfig.isAfter(endDate, current);
98
+ }
99
+ export function isSameOrAfter(generateConfig, locale, date1, date2, type) {
100
+ if (isSame(generateConfig, locale, date1, date2, type)) {
101
+ return true;
102
+ }
103
+ return generateConfig.isAfter(date1, date2);
104
+ }
105
+ export function getWeekStartDate(locale, generateConfig, value) {
106
+ var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale);
107
+ var monthStartDate = generateConfig.setDate(value, 1);
108
+ var startDateWeekDay = generateConfig.getWeekDay(monthStartDate);
109
+ var alignStartDate = generateConfig.addDate(monthStartDate, weekFirstDay - startDateWeekDay);
110
+ if (generateConfig.getMonth(alignStartDate) === generateConfig.getMonth(value) && generateConfig.getDate(alignStartDate) > 1) {
111
+ alignStartDate = generateConfig.addDate(alignStartDate, -7);
112
+ }
113
+ return alignStartDate;
114
+ }
115
+ export function formatValue(value, _ref) {
116
+ var generateConfig = _ref.generateConfig,
117
+ locale = _ref.locale,
118
+ format = _ref.format;
119
+ if (!value) {
120
+ return '';
121
+ }
122
+ return typeof format === 'function' ? format(value) : generateConfig.locale.format(locale.locale, value, format);
123
+ }
124
+
125
+ /**
126
+ * Fill the time info into Date if provided.
127
+ */
128
+ export function fillTime(generateConfig, date, time) {
129
+ var tmpDate = date;
130
+ var getFn = ['getHour', 'getMinute', 'getSecond', 'getMillisecond'];
131
+ var setFn = ['setHour', 'setMinute', 'setSecond', 'setMillisecond'];
132
+ setFn.forEach(function (fn, index) {
133
+ if (time) {
134
+ tmpDate = generateConfig[fn](tmpDate, generateConfig[getFn[index]](time));
135
+ } else {
136
+ tmpDate = generateConfig[fn](tmpDate, 0);
137
+ }
138
+ });
139
+ return tmpDate;
140
+ }
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from "react";
2
+ import React from "react";
3
+ export declare function getClearIcon(prefixCls: string, allowClear?: boolean | {
4
+ clearIcon?: ReactNode;
5
+ }, clearIcon?: ReactNode): string | number | true | Iterable<ReactNode> | React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ import React from "react";
3
+ export function getClearIcon(prefixCls, allowClear, clearIcon) {
4
+ var mergedClearIcon = _typeof(allowClear) === "object" ? allowClear.clearIcon : clearIcon;
5
+ return mergedClearIcon || /*#__PURE__*/React.createElement("span", {
6
+ className: "".concat(prefixCls, "-clear-btn")
7
+ });
8
+ }
@@ -0,0 +1,14 @@
1
+ import type { InternalMode, Locale, SharedPickerProps } from '../interface';
2
+ export declare function leftPad(str: string | number, length: number, fill?: string): string;
3
+ /**
4
+ * Convert `value` to array. Will provide `[]` if is null or undefined.
5
+ */
6
+ export declare function toArray<T>(val: T | T[]): T[];
7
+ export declare function fillIndex<T extends any[]>(ori: T, index: number, value: T[number]): T;
8
+ /** Pick props from the key list. Will filter empty value */
9
+ export declare function pickProps<T extends object>(props: T, keys?: (keyof T)[] | readonly (keyof T)[]): T;
10
+ export declare function getRowFormat(picker: InternalMode, locale: Locale, format?: SharedPickerProps['format']): {
11
+ format: string;
12
+ type?: "mask";
13
+ } | import("../interface").FormatType<any> | import("../interface").FormatType<any>[];
14
+ export declare function getFromDate<DateType>(calendarValues: DateType[], activeIndexList: number[], activeIndex?: number): DateType;
@@ -0,0 +1,70 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ export function leftPad(str, length) {
8
+ var fill = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';
9
+ var current = String(str);
10
+ while (current.length < length) {
11
+ current = "".concat(fill).concat(current);
12
+ }
13
+ return current;
14
+ }
15
+
16
+ /**
17
+ * Convert `value` to array. Will provide `[]` if is null or undefined.
18
+ */
19
+ export function toArray(val) {
20
+ if (val === null || val === undefined) {
21
+ return [];
22
+ }
23
+ return Array.isArray(val) ? val : [val];
24
+ }
25
+ export function fillIndex(ori, index, value) {
26
+ var clone = _toConsumableArray(ori);
27
+ clone[index] = value;
28
+ return clone;
29
+ }
30
+
31
+ /** Pick props from the key list. Will filter empty value */
32
+ export function pickProps(props, keys) {
33
+ var clone = {};
34
+ var mergedKeys = keys || Object.keys(props);
35
+ mergedKeys.forEach(function (key) {
36
+ if (props[key] !== undefined) {
37
+ clone[key] = props[key];
38
+ }
39
+ });
40
+ return clone;
41
+ }
42
+ export function getRowFormat(picker, locale, format) {
43
+ if (format) {
44
+ return format;
45
+ }
46
+ switch (picker) {
47
+ // All from the `locale.fieldXXXFormat` first
48
+ case 'time':
49
+ return locale.fieldTimeFormat;
50
+ case 'datetime':
51
+ return locale.fieldDateTimeFormat;
52
+ case 'month':
53
+ return locale.fieldMonthFormat;
54
+ case 'year':
55
+ return locale.fieldYearFormat;
56
+ case 'quarter':
57
+ return locale.fieldQuarterFormat;
58
+ case 'week':
59
+ return locale.fieldWeekFormat;
60
+ default:
61
+ return locale.fieldDateFormat;
62
+ }
63
+ }
64
+ export function getFromDate(calendarValues, activeIndexList, activeIndex) {
65
+ var mergedActiveIndex = activeIndex !== undefined ? activeIndex : activeIndexList[activeIndexList.length - 1];
66
+ var firstValuedIndex = activeIndexList.find(function (index) {
67
+ return calendarValues[index];
68
+ });
69
+ return mergedActiveIndex !== firstValuedIndex ? calendarValues[firstValuedIndex] : undefined;
70
+ }
@@ -0,0 +1 @@
1
+ export declare function getRealPlacement(placement: string, rtl: boolean): string;
@@ -0,0 +1,7 @@
1
+ // ====================== Mode ======================
2
+ export function getRealPlacement(placement, rtl) {
3
+ if (placement !== undefined) {
4
+ return placement;
5
+ }
6
+ return rtl ? 'bottomRight' : 'bottomLeft';
7
+ }
@@ -0,0 +1,5 @@
1
+ import type { DisabledTimes, PickerMode } from '../interface';
2
+ export interface WarningProps extends DisabledTimes {
3
+ picker?: PickerMode;
4
+ }
5
+ export declare function legacyPropsWarning(props: WarningProps): void;
@@ -0,0 +1,10 @@
1
+ import warning from "@rc-component/util/es/warning";
2
+ export function legacyPropsWarning(props) {
3
+ var picker = props.picker,
4
+ disabledHours = props.disabledHours,
5
+ disabledMinutes = props.disabledMinutes,
6
+ disabledSeconds = props.disabledSeconds;
7
+ if (picker === 'time' && (disabledHours || disabledMinutes || disabledSeconds)) {
8
+ warning(false, "'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.");
9
+ }
10
+ }
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import type { GenerateConfig } from '../../generate';
3
+ import type { DisabledDate, InternalMode, PanelMode, SharedPickerProps } from '../../interface';
4
+ import type { PopupShowTimeConfig } from '.';
5
+ export interface FooterProps<DateType extends object = any> {
6
+ mode: PanelMode;
7
+ internalMode: InternalMode;
8
+ renderExtraFooter?: SharedPickerProps['renderExtraFooter'];
9
+ showNow: boolean;
10
+ generateConfig: GenerateConfig<DateType>;
11
+ disabledDate: DisabledDate<DateType>;
12
+ showTime?: PopupShowTimeConfig<DateType>;
13
+ /** From Footer component used only. Check if can OK button click */
14
+ invalid?: boolean;
15
+ onSubmit: (date?: DateType) => void;
16
+ needConfirm: boolean;
17
+ onNow: (now: DateType) => void;
18
+ }
19
+ export default function Footer(props: FooterProps): React.JSX.Element;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = Footer;
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _useTimeInfo3 = _interopRequireDefault(require("../../hooks/useTimeInfo"));
11
+ var _context = _interopRequireDefault(require("../context"));
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+ function Footer(props) {
22
+ var mode = props.mode,
23
+ internalMode = props.internalMode,
24
+ renderExtraFooter = props.renderExtraFooter,
25
+ showNow = props.showNow,
26
+ showTime = props.showTime,
27
+ onSubmit = props.onSubmit,
28
+ onNow = props.onNow,
29
+ invalid = props.invalid,
30
+ needConfirm = props.needConfirm,
31
+ generateConfig = props.generateConfig,
32
+ disabledDate = props.disabledDate;
33
+ var _React$useContext = React.useContext(_context.default),
34
+ prefixCls = _React$useContext.prefixCls,
35
+ locale = _React$useContext.locale,
36
+ _React$useContext$but = _React$useContext.button,
37
+ Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but;
38
+
39
+ // >>> Now
40
+ var now = generateConfig.getNow();
41
+ var _useTimeInfo = (0, _useTimeInfo3.default)(generateConfig, showTime, now),
42
+ _useTimeInfo2 = _slicedToArray(_useTimeInfo, 1),
43
+ getValidTime = _useTimeInfo2[0];
44
+
45
+ // ======================== Extra =========================
46
+ var extraNode = renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter(mode);
47
+
48
+ // ======================== Ranges ========================
49
+ var nowDisabled = disabledDate(now, {
50
+ type: mode
51
+ });
52
+ var onInternalNow = function onInternalNow() {
53
+ if (!nowDisabled) {
54
+ var validateNow = getValidTime(now);
55
+ onNow(validateNow);
56
+ }
57
+ };
58
+ var nowPrefixCls = "".concat(prefixCls, "-now");
59
+ var nowBtnPrefixCls = "".concat(nowPrefixCls, "-btn");
60
+ var presetNode = showNow && /*#__PURE__*/React.createElement("li", {
61
+ className: nowPrefixCls
62
+ }, /*#__PURE__*/React.createElement("a", {
63
+ className: (0, _classnames.default)(nowBtnPrefixCls, nowDisabled && "".concat(nowBtnPrefixCls, "-disabled")),
64
+ "aria-disabled": nowDisabled,
65
+ onClick: onInternalNow
66
+ }, internalMode === 'date' ? locale.today : locale.now));
67
+
68
+ // >>> OK
69
+ var okNode = needConfirm && /*#__PURE__*/React.createElement("li", {
70
+ className: "".concat(prefixCls, "-ok")
71
+ }, /*#__PURE__*/React.createElement(Button, {
72
+ disabled: invalid,
73
+ onClick: onSubmit
74
+ }, locale.ok));
75
+ var rangeNode = (presetNode || okNode) && /*#__PURE__*/React.createElement("ul", {
76
+ className: "".concat(prefixCls, "-ranges")
77
+ }, presetNode, okNode);
78
+
79
+ // ======================== Render ========================
80
+ if (!extraNode && !rangeNode) {
81
+ return null;
82
+ }
83
+ return /*#__PURE__*/React.createElement("div", {
84
+ className: "".concat(prefixCls, "-footer")
85
+ }, extraNode && /*#__PURE__*/React.createElement("div", {
86
+ className: "".concat(prefixCls, "-footer-extra")
87
+ }, extraNode), rangeNode);
88
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { type PickerPanelProps } from '../../PickerPanel';
3
+ import { type FooterProps } from './Footer';
4
+ export type MustProp<DateType extends object> = Required<Pick<PickerPanelProps<DateType>, 'mode' | 'onPanelChange'>>;
5
+ export type PopupPanelProps<DateType extends object = any> = MustProp<DateType> & Omit<PickerPanelProps<DateType>, 'onPickerValueChange' | 'showTime'> & FooterProps<DateType> & {
6
+ multiplePanel?: boolean;
7
+ range?: boolean;
8
+ onPickerValueChange: (date: DateType) => void;
9
+ };
10
+ export default function PopupPanel<DateType extends object = any>(props: PopupPanelProps<DateType>): React.JSX.Element;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = PopupPanel;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _PickerPanel = _interopRequireDefault(require("../../PickerPanel"));
9
+ var _context = require("../../PickerPanel/context");
10
+ var _context2 = _interopRequireDefault(require("../context"));
11
+ var _useRangePickerValue = require("../hooks/useRangePickerValue");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
21
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
+ function PopupPanel(props) {
23
+ var picker = props.picker,
24
+ multiplePanel = props.multiplePanel,
25
+ pickerValue = props.pickerValue,
26
+ onPickerValueChange = props.onPickerValueChange,
27
+ needConfirm = props.needConfirm,
28
+ onSubmit = props.onSubmit,
29
+ range = props.range,
30
+ hoverValue = props.hoverValue;
31
+ var _React$useContext = React.useContext(_context2.default),
32
+ prefixCls = _React$useContext.prefixCls,
33
+ generateConfig = _React$useContext.generateConfig;
34
+
35
+ // ======================== Offset ========================
36
+ var internalOffsetDate = React.useCallback(function (date, offset) {
37
+ return (0, _useRangePickerValue.offsetPanelDate)(generateConfig, picker, date, offset);
38
+ }, [generateConfig, picker]);
39
+ var nextPickerValue = React.useMemo(function () {
40
+ return internalOffsetDate(pickerValue, 1);
41
+ }, [pickerValue, internalOffsetDate]);
42
+
43
+ // Outside
44
+ var onSecondPickerValueChange = function onSecondPickerValueChange(nextDate) {
45
+ onPickerValueChange(internalOffsetDate(nextDate, -1));
46
+ };
47
+
48
+ // ======================= Context ========================
49
+ var sharedContext = {
50
+ onCellDblClick: function onCellDblClick() {
51
+ if (needConfirm) {
52
+ onSubmit();
53
+ }
54
+ }
55
+ };
56
+ var hideHeader = picker === 'time';
57
+
58
+ // ======================== Props =========================
59
+ var pickerProps = _objectSpread(_objectSpread({}, props), {}, {
60
+ hoverValue: null,
61
+ hoverRangeValue: null,
62
+ hideHeader: hideHeader
63
+ });
64
+ if (range) {
65
+ pickerProps.hoverRangeValue = hoverValue;
66
+ } else {
67
+ pickerProps.hoverValue = hoverValue;
68
+ }
69
+
70
+ // ======================== Render ========================
71
+ // Multiple
72
+ if (multiplePanel) {
73
+ return /*#__PURE__*/React.createElement("div", {
74
+ className: "".concat(prefixCls, "-panels")
75
+ }, /*#__PURE__*/React.createElement(_context.PickerHackContext.Provider, {
76
+ value: _objectSpread(_objectSpread({}, sharedContext), {}, {
77
+ hideNext: true
78
+ })
79
+ }, /*#__PURE__*/React.createElement(_PickerPanel.default, pickerProps)), /*#__PURE__*/React.createElement(_context.PickerHackContext.Provider, {
80
+ value: _objectSpread(_objectSpread({}, sharedContext), {}, {
81
+ hidePrev: true
82
+ })
83
+ }, /*#__PURE__*/React.createElement(_PickerPanel.default, _extends({}, pickerProps, {
84
+ pickerValue: nextPickerValue,
85
+ onPickerValueChange: onSecondPickerValueChange
86
+ }))));
87
+ }
88
+
89
+ // Single
90
+ return /*#__PURE__*/React.createElement(_context.PickerHackContext.Provider, {
91
+ value: _objectSpread({}, sharedContext)
92
+ }, /*#__PURE__*/React.createElement(_PickerPanel.default, pickerProps));
93
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import type { ValueDate } from '../../interface';
3
+ export interface PresetPanelProps<ValueType = any> {
4
+ prefixCls: string;
5
+ presets: ValueDate<ValueType>[];
6
+ onClick: (value: ValueType) => void;
7
+ onHover: (value: ValueType) => void;
8
+ }
9
+ export default function PresetPanel<DateType extends object = any>(props: PresetPanelProps<DateType>): React.JSX.Element;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = PresetPanel;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ function executeValue(value) {
12
+ return typeof value === 'function' ? value() : value;
13
+ }
14
+ function PresetPanel(props) {
15
+ var prefixCls = props.prefixCls,
16
+ presets = props.presets,
17
+ _onClick = props.onClick,
18
+ onHover = props.onHover;
19
+ if (!presets.length) {
20
+ return null;
21
+ }
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: "".concat(prefixCls, "-presets")
24
+ }, /*#__PURE__*/React.createElement("ul", null, presets.map(function (_ref, index) {
25
+ var label = _ref.label,
26
+ value = _ref.value;
27
+ return /*#__PURE__*/React.createElement("li", {
28
+ key: index,
29
+ onClick: function onClick() {
30
+ _onClick(executeValue(value));
31
+ },
32
+ onMouseEnter: function onMouseEnter() {
33
+ onHover(executeValue(value));
34
+ },
35
+ onMouseLeave: function onMouseLeave() {
36
+ onHover(null);
37
+ }
38
+ }, label);
39
+ })));
40
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import type { RangeTimeProps, SharedPickerProps, SharedTimeProps, ValueDate } from '../../interface';
3
+ import { type FooterProps } from './Footer';
4
+ import { type PopupPanelProps } from './PopupPanel';
5
+ export type PopupShowTimeConfig<DateType extends object = any> = Omit<RangeTimeProps<DateType>, 'defaultValue' | 'defaultOpenValue' | 'disabledTime'> & Pick<SharedTimeProps<DateType>, 'disabledTime'>;
6
+ export interface PopupProps<DateType extends object = any, PresetValue = DateType> extends Pick<React.InputHTMLAttributes<HTMLDivElement>, 'onFocus' | 'onBlur'>, FooterProps<DateType>, PopupPanelProps<DateType> {
7
+ panelRender?: SharedPickerProps['panelRender'];
8
+ presets: ValueDate<DateType>[];
9
+ onPresetHover: (presetValue: PresetValue) => void;
10
+ onPresetSubmit: (presetValue: PresetValue) => void;
11
+ activeInfo?: [activeInputLeft: number, activeInputRight: number, selectorWidth: number];
12
+ direction?: 'ltr' | 'rtl';
13
+ /** TimePicker or showTime only */
14
+ defaultOpenValue: DateType;
15
+ needConfirm: boolean;
16
+ isInvalid: (date: DateType | DateType[]) => boolean;
17
+ onOk: VoidFunction;
18
+ onPanelMouseDown?: React.MouseEventHandler<HTMLDivElement>;
19
+ }
20
+ export default function Popup<DateType extends object = any>(props: PopupProps<DateType>): React.JSX.Element;