@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.
- package/LICENSE.md +9 -0
- package/README.md +154 -0
- package/assets/index.css +407 -0
- package/assets/index.less +570 -0
- package/es/PickerInput/Popup/Footer.d.ts +19 -0
- package/es/PickerInput/Popup/Footer.js +78 -0
- package/es/PickerInput/Popup/PopupPanel.d.ts +10 -0
- package/es/PickerInput/Popup/PopupPanel.js +84 -0
- package/es/PickerInput/Popup/PresetPanel.d.ts +9 -0
- package/es/PickerInput/Popup/PresetPanel.js +31 -0
- package/es/PickerInput/Popup/index.d.ts +20 -0
- package/es/PickerInput/Popup/index.js +198 -0
- package/es/PickerInput/RangePicker.d.ts +54 -0
- package/es/PickerInput/RangePicker.js +641 -0
- package/es/PickerInput/Selector/Icon.d.ts +10 -0
- package/es/PickerInput/Selector/Icon.js +32 -0
- package/es/PickerInput/Selector/Input.d.ts +28 -0
- package/es/PickerInput/Selector/Input.js +377 -0
- package/es/PickerInput/Selector/MaskFormat.d.ts +22 -0
- package/es/PickerInput/Selector/MaskFormat.js +107 -0
- package/es/PickerInput/Selector/RangeSelector.d.ts +26 -0
- package/es/PickerInput/Selector/RangeSelector.js +218 -0
- package/es/PickerInput/Selector/SingleSelector/MultipleDates.d.ts +12 -0
- package/es/PickerInput/Selector/SingleSelector/MultipleDates.js +66 -0
- package/es/PickerInput/Selector/SingleSelector/index.d.ts +18 -0
- package/es/PickerInput/Selector/SingleSelector/index.js +187 -0
- package/es/PickerInput/Selector/hooks/useClearIcon.d.ts +8 -0
- package/es/PickerInput/Selector/hooks/useClearIcon.js +19 -0
- package/es/PickerInput/Selector/hooks/useInputProps.d.ts +16 -0
- package/es/PickerInput/Selector/hooks/useInputProps.js +178 -0
- package/es/PickerInput/Selector/hooks/useRootProps.d.ts +2 -0
- package/es/PickerInput/Selector/hooks/useRootProps.js +8 -0
- package/es/PickerInput/Selector/util.d.ts +1 -0
- package/es/PickerInput/Selector/util.js +12 -0
- package/es/PickerInput/SinglePicker.d.ts +51 -0
- package/es/PickerInput/SinglePicker.js +545 -0
- package/es/PickerInput/context.d.ts +13 -0
- package/es/PickerInput/context.js +3 -0
- package/es/PickerInput/hooks/useCellRender.d.ts +2 -0
- package/es/PickerInput/hooks/useCellRender.js +41 -0
- package/es/PickerInput/hooks/useDelayState.d.ts +5 -0
- package/es/PickerInput/hooks/useDelayState.js +48 -0
- package/es/PickerInput/hooks/useDisabledBoundary.d.ts +7 -0
- package/es/PickerInput/hooks/useDisabledBoundary.js +20 -0
- package/es/PickerInput/hooks/useFieldFormat.d.ts +2 -0
- package/es/PickerInput/hooks/useFieldFormat.js +18 -0
- package/es/PickerInput/hooks/useFieldsInvalidate.d.ts +5 -0
- package/es/PickerInput/hooks/useFieldsInvalidate.js +55 -0
- package/es/PickerInput/hooks/useFilledProps.d.ts +37 -0
- package/es/PickerInput/hooks/useFilledProps.js +155 -0
- package/es/PickerInput/hooks/useInputReadOnly.d.ts +2 -0
- package/es/PickerInput/hooks/useInputReadOnly.js +6 -0
- package/es/PickerInput/hooks/useInvalidate.d.ts +9 -0
- package/es/PickerInput/hooks/useInvalidate.js +61 -0
- package/es/PickerInput/hooks/useLockEffect.d.ts +5 -0
- package/es/PickerInput/hooks/useLockEffect.js +25 -0
- package/es/PickerInput/hooks/useOpen.d.ts +6 -0
- package/es/PickerInput/hooks/useOpen.js +33 -0
- package/es/PickerInput/hooks/usePickerRef.d.ts +7 -0
- package/es/PickerInput/hooks/usePickerRef.js +19 -0
- package/es/PickerInput/hooks/usePresets.d.ts +2 -0
- package/es/PickerInput/hooks/usePresets.js +28 -0
- package/es/PickerInput/hooks/useRangeActive.d.ts +19 -0
- package/es/PickerInput/hooks/useRangeActive.js +74 -0
- package/es/PickerInput/hooks/useRangeDisabledDate.d.ts +8 -0
- package/es/PickerInput/hooks/useRangeDisabledDate.js +53 -0
- package/es/PickerInput/hooks/useRangePickerValue.d.ts +5 -0
- package/es/PickerInput/hooks/useRangePickerValue.js +192 -0
- package/es/PickerInput/hooks/useRangeValue.d.ts +28 -0
- package/es/PickerInput/hooks/useRangeValue.js +297 -0
- package/es/PickerInput/hooks/useShowNow.d.ts +2 -0
- package/es/PickerInput/hooks/useShowNow.js +14 -0
- package/es/PickerPanel/DatePanel/index.d.ts +10 -0
- package/es/PickerPanel/DatePanel/index.js +190 -0
- package/es/PickerPanel/DateTimePanel/index.d.ts +3 -0
- package/es/PickerPanel/DateTimePanel/index.js +55 -0
- package/es/PickerPanel/DecadePanel/index.d.ts +3 -0
- package/es/PickerPanel/DecadePanel/index.js +113 -0
- package/es/PickerPanel/MonthPanel/index.d.ts +3 -0
- package/es/PickerPanel/MonthPanel/index.js +106 -0
- package/es/PickerPanel/PanelBody.d.ts +17 -0
- package/es/PickerPanel/PanelBody.js +153 -0
- package/es/PickerPanel/PanelHeader.d.ts +11 -0
- package/es/PickerPanel/PanelHeader.js +133 -0
- package/es/PickerPanel/QuarterPanel/index.d.ts +3 -0
- package/es/PickerPanel/QuarterPanel/index.js +92 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.d.ts +17 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +149 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/index.d.ts +4 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/index.js +283 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.d.ts +2 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js +72 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/util.d.ts +3 -0
- package/es/PickerPanel/TimePanel/TimePanelBody/util.js +43 -0
- package/es/PickerPanel/TimePanel/index.d.ts +4 -0
- package/es/PickerPanel/TimePanel/index.js +38 -0
- package/es/PickerPanel/WeekPanel/index.d.ts +3 -0
- package/es/PickerPanel/WeekPanel/index.js +55 -0
- package/es/PickerPanel/YearPanel/index.d.ts +3 -0
- package/es/PickerPanel/YearPanel/index.js +116 -0
- package/es/PickerPanel/context.d.ts +24 -0
- package/es/PickerPanel/context.js +67 -0
- package/es/PickerPanel/index.d.ts +60 -0
- package/es/PickerPanel/index.js +315 -0
- package/es/PickerTrigger/index.d.ts +19 -0
- package/es/PickerTrigger/index.js +86 -0
- package/es/PickerTrigger/util.d.ts +2 -0
- package/es/PickerTrigger/util.js +4 -0
- package/es/generate/dateFns.d.ts +3 -0
- package/es/generate/dateFns.js +163 -0
- package/es/generate/dayjs.d.ts +4 -0
- package/es/generate/dayjs.js +233 -0
- package/es/generate/index.d.ts +37 -0
- package/es/generate/index.js +1 -0
- package/es/generate/luxon.d.ts +4 -0
- package/es/generate/luxon.js +197 -0
- package/es/generate/moment.d.ts +4 -0
- package/es/generate/moment.js +152 -0
- package/es/hooks/useLocale.d.ts +6 -0
- package/es/hooks/useLocale.js +82 -0
- package/es/hooks/useSyncState.d.ts +6 -0
- package/es/hooks/useSyncState.js +27 -0
- package/es/hooks/useTimeConfig.d.ts +18 -0
- package/es/hooks/useTimeConfig.js +166 -0
- package/es/hooks/useTimeInfo.d.ts +12 -0
- package/es/hooks/useTimeInfo.js +164 -0
- package/es/hooks/useToggleDates.d.ts +8 -0
- package/es/hooks/useToggleDates.js +26 -0
- package/es/index.d.ts +35 -0
- package/es/index.js +34 -0
- package/es/interface.d.ts +365 -0
- package/es/interface.js +1 -0
- package/es/locale/am_ET.d.ts +3 -0
- package/es/locale/am_ET.js +31 -0
- package/es/locale/ar_EG.d.ts +3 -0
- package/es/locale/ar_EG.js +34 -0
- package/es/locale/az_AZ.d.ts +3 -0
- package/es/locale/az_AZ.js +35 -0
- package/es/locale/bg_BG.d.ts +3 -0
- package/es/locale/bg_BG.js +34 -0
- package/es/locale/bn_BD.d.ts +3 -0
- package/es/locale/bn_BD.js +35 -0
- package/es/locale/by_BY.d.ts +3 -0
- package/es/locale/by_BY.js +35 -0
- package/es/locale/ca_ES.d.ts +3 -0
- package/es/locale/ca_ES.js +34 -0
- package/es/locale/common.d.ts +2 -0
- package/es/locale/common.js +6 -0
- package/es/locale/cs_CZ.d.ts +3 -0
- package/es/locale/cs_CZ.js +34 -0
- package/es/locale/da_DK.d.ts +3 -0
- package/es/locale/da_DK.js +34 -0
- package/es/locale/de_DE.d.ts +3 -0
- package/es/locale/de_DE.js +34 -0
- package/es/locale/el_GR.d.ts +3 -0
- package/es/locale/el_GR.js +34 -0
- package/es/locale/en_GB.d.ts +3 -0
- package/es/locale/en_GB.js +34 -0
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +35 -0
- package/es/locale/es_ES.d.ts +3 -0
- package/es/locale/es_ES.js +34 -0
- package/es/locale/es_MX.d.ts +3 -0
- package/es/locale/es_MX.js +35 -0
- package/es/locale/et_EE.d.ts +3 -0
- package/es/locale/et_EE.js +34 -0
- package/es/locale/eu_ES.d.ts +3 -0
- package/es/locale/eu_ES.js +36 -0
- package/es/locale/fa_IR.d.ts +3 -0
- package/es/locale/fa_IR.js +34 -0
- package/es/locale/fi_FI.d.ts +3 -0
- package/es/locale/fi_FI.js +34 -0
- package/es/locale/fr_BE.d.ts +3 -0
- package/es/locale/fr_BE.js +34 -0
- package/es/locale/fr_CA.d.ts +3 -0
- package/es/locale/fr_CA.js +35 -0
- package/es/locale/fr_FR.d.ts +3 -0
- package/es/locale/fr_FR.js +35 -0
- package/es/locale/ga_IE.d.ts +3 -0
- package/es/locale/ga_IE.js +35 -0
- package/es/locale/gl_ES.d.ts +3 -0
- package/es/locale/gl_ES.js +34 -0
- package/es/locale/he_IL.d.ts +3 -0
- package/es/locale/he_IL.js +35 -0
- package/es/locale/hi_IN.d.ts +3 -0
- package/es/locale/hi_IN.js +35 -0
- package/es/locale/hr_HR.d.ts +3 -0
- package/es/locale/hr_HR.js +35 -0
- package/es/locale/hu_HU.d.ts +3 -0
- package/es/locale/hu_HU.js +58 -0
- package/es/locale/id_ID.d.ts +3 -0
- package/es/locale/id_ID.js +35 -0
- package/es/locale/is_IS.d.ts +3 -0
- package/es/locale/is_IS.js +34 -0
- package/es/locale/it_IT.d.ts +3 -0
- package/es/locale/it_IT.js +34 -0
- package/es/locale/ja_JP.d.ts +3 -0
- package/es/locale/ja_JP.js +37 -0
- package/es/locale/ka_GE.d.ts +3 -0
- package/es/locale/ka_GE.js +35 -0
- package/es/locale/kk_KZ.d.ts +3 -0
- package/es/locale/kk_KZ.js +34 -0
- package/es/locale/km_KH.d.ts +3 -0
- package/es/locale/km_KH.js +36 -0
- package/es/locale/kmr_IQ.d.ts +3 -0
- package/es/locale/kmr_IQ.js +34 -0
- package/es/locale/kn_IN.d.ts +3 -0
- package/es/locale/kn_IN.js +35 -0
- package/es/locale/ko_KR.d.ts +3 -0
- package/es/locale/ko_KR.js +36 -0
- package/es/locale/lt_LT.d.ts +3 -0
- package/es/locale/lt_LT.js +36 -0
- package/es/locale/lv_LV.d.ts +3 -0
- package/es/locale/lv_LV.js +34 -0
- package/es/locale/mk_MK.d.ts +3 -0
- package/es/locale/mk_MK.js +34 -0
- package/es/locale/ml_IN.d.ts +3 -0
- package/es/locale/ml_IN.js +35 -0
- package/es/locale/mn_MN.d.ts +3 -0
- package/es/locale/mn_MN.js +36 -0
- package/es/locale/ms_MY.d.ts +3 -0
- package/es/locale/ms_MY.js +36 -0
- package/es/locale/my_MM.d.ts +3 -0
- package/es/locale/my_MM.js +35 -0
- package/es/locale/nb_NO.d.ts +3 -0
- package/es/locale/nb_NO.js +36 -0
- package/es/locale/ne_NP.d.ts +3 -0
- package/es/locale/ne_NP.js +35 -0
- package/es/locale/nl_BE.d.ts +3 -0
- package/es/locale/nl_BE.js +34 -0
- package/es/locale/nl_NL.d.ts +3 -0
- package/es/locale/nl_NL.js +34 -0
- package/es/locale/pl_PL.d.ts +3 -0
- package/es/locale/pl_PL.js +34 -0
- package/es/locale/pt_BR.d.ts +3 -0
- package/es/locale/pt_BR.js +37 -0
- package/es/locale/pt_PT.d.ts +3 -0
- package/es/locale/pt_PT.js +36 -0
- package/es/locale/ro_RO.d.ts +3 -0
- package/es/locale/ro_RO.js +35 -0
- package/es/locale/ru_RU.d.ts +3 -0
- package/es/locale/ru_RU.js +34 -0
- package/es/locale/si_LK.d.ts +3 -0
- package/es/locale/si_LK.js +36 -0
- package/es/locale/sk_SK.d.ts +3 -0
- package/es/locale/sk_SK.js +34 -0
- package/es/locale/sl_SI.d.ts +3 -0
- package/es/locale/sl_SI.js +34 -0
- package/es/locale/sr_Cyrl_RS.d.ts +3 -0
- package/es/locale/sr_Cyrl_RS.js +34 -0
- package/es/locale/sr_RS.d.ts +3 -0
- package/es/locale/sr_RS.js +34 -0
- package/es/locale/sv_SE.d.ts +3 -0
- package/es/locale/sv_SE.js +34 -0
- package/es/locale/ta_IN.d.ts +3 -0
- package/es/locale/ta_IN.js +35 -0
- package/es/locale/th_TH.d.ts +3 -0
- package/es/locale/th_TH.js +34 -0
- package/es/locale/tk_TK.d.ts +3 -0
- package/es/locale/tk_TK.js +34 -0
- package/es/locale/tr_TR.d.ts +3 -0
- package/es/locale/tr_TR.js +36 -0
- package/es/locale/ug_CN.d.ts +3 -0
- package/es/locale/ug_CN.js +37 -0
- package/es/locale/uk_UA.d.ts +3 -0
- package/es/locale/uk_UA.js +34 -0
- package/es/locale/ur_PK.d.ts +3 -0
- package/es/locale/ur_PK.js +35 -0
- package/es/locale/uz_UZ.d.ts +3 -0
- package/es/locale/uz_UZ.js +35 -0
- package/es/locale/vi_VN.d.ts +3 -0
- package/es/locale/vi_VN.js +35 -0
- package/es/locale/zh_CN.d.ts +3 -0
- package/es/locale/zh_CN.js +36 -0
- package/es/locale/zh_TW.d.ts +3 -0
- package/es/locale/zh_TW.js +38 -0
- package/es/utils/dateUtil.d.ts +29 -0
- package/es/utils/dateUtil.js +140 -0
- package/es/utils/getClearIcon.d.ts +5 -0
- package/es/utils/getClearIcon.js +8 -0
- package/es/utils/miscUtil.d.ts +14 -0
- package/es/utils/miscUtil.js +70 -0
- package/es/utils/uiUtil.d.ts +1 -0
- package/es/utils/uiUtil.js +7 -0
- package/es/utils/warnUtil.d.ts +5 -0
- package/es/utils/warnUtil.js +10 -0
- package/lib/PickerInput/Popup/Footer.d.ts +19 -0
- package/lib/PickerInput/Popup/Footer.js +88 -0
- package/lib/PickerInput/Popup/PopupPanel.d.ts +10 -0
- package/lib/PickerInput/Popup/PopupPanel.js +93 -0
- package/lib/PickerInput/Popup/PresetPanel.d.ts +9 -0
- package/lib/PickerInput/Popup/PresetPanel.js +40 -0
- package/lib/PickerInput/Popup/index.d.ts +20 -0
- package/lib/PickerInput/Popup/index.js +207 -0
- package/lib/PickerInput/RangePicker.d.ts +54 -0
- package/lib/PickerInput/RangePicker.js +650 -0
- package/lib/PickerInput/Selector/Icon.d.ts +10 -0
- package/lib/PickerInput/Selector/Icon.js +43 -0
- package/lib/PickerInput/Selector/Input.d.ts +28 -0
- package/lib/PickerInput/Selector/Input.js +385 -0
- package/lib/PickerInput/Selector/MaskFormat.d.ts +22 -0
- package/lib/PickerInput/Selector/MaskFormat.js +112 -0
- package/lib/PickerInput/Selector/RangeSelector.d.ts +26 -0
- package/lib/PickerInput/Selector/RangeSelector.js +227 -0
- package/lib/PickerInput/Selector/SingleSelector/MultipleDates.d.ts +12 -0
- package/lib/PickerInput/Selector/SingleSelector/MultipleDates.js +76 -0
- package/lib/PickerInput/Selector/SingleSelector/index.d.ts +18 -0
- package/lib/PickerInput/Selector/SingleSelector/index.js +196 -0
- package/lib/PickerInput/Selector/hooks/useClearIcon.d.ts +8 -0
- package/lib/PickerInput/Selector/hooks/useClearIcon.js +27 -0
- package/lib/PickerInput/Selector/hooks/useInputProps.d.ts +16 -0
- package/lib/PickerInput/Selector/hooks/useInputProps.js +187 -0
- package/lib/PickerInput/Selector/hooks/useRootProps.d.ts +2 -0
- package/lib/PickerInput/Selector/hooks/useRootProps.js +17 -0
- package/lib/PickerInput/Selector/util.d.ts +1 -0
- package/lib/PickerInput/Selector/util.js +18 -0
- package/lib/PickerInput/SinglePicker.d.ts +51 -0
- package/lib/PickerInput/SinglePicker.js +553 -0
- package/lib/PickerInput/context.d.ts +13 -0
- package/lib/PickerInput/context.js +12 -0
- package/lib/PickerInput/hooks/useCellRender.d.ts +2 -0
- package/lib/PickerInput/hooks/useCellRender.js +49 -0
- package/lib/PickerInput/hooks/useDelayState.d.ts +5 -0
- package/lib/PickerInput/hooks/useDelayState.js +54 -0
- package/lib/PickerInput/hooks/useDisabledBoundary.d.ts +7 -0
- package/lib/PickerInput/hooks/useDisabledBoundary.js +26 -0
- package/lib/PickerInput/hooks/useFieldFormat.d.ts +2 -0
- package/lib/PickerInput/hooks/useFieldFormat.js +26 -0
- package/lib/PickerInput/hooks/useFieldsInvalidate.d.ts +5 -0
- package/lib/PickerInput/hooks/useFieldsInvalidate.js +64 -0
- package/lib/PickerInput/hooks/useFilledProps.d.ts +37 -0
- package/lib/PickerInput/hooks/useFilledProps.js +164 -0
- package/lib/PickerInput/hooks/useInputReadOnly.d.ts +2 -0
- package/lib/PickerInput/hooks/useInputReadOnly.js +12 -0
- package/lib/PickerInput/hooks/useInvalidate.d.ts +9 -0
- package/lib/PickerInput/hooks/useInvalidate.js +67 -0
- package/lib/PickerInput/hooks/useLockEffect.d.ts +5 -0
- package/lib/PickerInput/hooks/useLockEffect.js +34 -0
- package/lib/PickerInput/hooks/useOpen.d.ts +6 -0
- package/lib/PickerInput/hooks/useOpen.js +39 -0
- package/lib/PickerInput/hooks/usePickerRef.d.ts +7 -0
- package/lib/PickerInput/hooks/usePickerRef.js +28 -0
- package/lib/PickerInput/hooks/usePresets.d.ts +2 -0
- package/lib/PickerInput/hooks/usePresets.js +38 -0
- package/lib/PickerInput/hooks/useRangeActive.d.ts +19 -0
- package/lib/PickerInput/hooks/useRangeActive.js +84 -0
- package/lib/PickerInput/hooks/useRangeDisabledDate.d.ts +8 -0
- package/lib/PickerInput/hooks/useRangeDisabledDate.js +58 -0
- package/lib/PickerInput/hooks/useRangePickerValue.d.ts +5 -0
- package/lib/PickerInput/hooks/useRangePickerValue.js +203 -0
- package/lib/PickerInput/hooks/useRangeValue.d.ts +28 -0
- package/lib/PickerInput/hooks/useRangeValue.js +308 -0
- package/lib/PickerInput/hooks/useShowNow.d.ts +2 -0
- package/lib/PickerInput/hooks/useShowNow.js +20 -0
- package/lib/PickerPanel/DatePanel/index.d.ts +10 -0
- package/lib/PickerPanel/DatePanel/index.js +199 -0
- package/lib/PickerPanel/DateTimePanel/index.d.ts +3 -0
- package/lib/PickerPanel/DateTimePanel/index.js +65 -0
- package/lib/PickerPanel/DecadePanel/index.d.ts +3 -0
- package/lib/PickerPanel/DecadePanel/index.js +122 -0
- package/lib/PickerPanel/MonthPanel/index.d.ts +3 -0
- package/lib/PickerPanel/MonthPanel/index.js +115 -0
- package/lib/PickerPanel/PanelBody.d.ts +17 -0
- package/lib/PickerPanel/PanelBody.js +162 -0
- package/lib/PickerPanel/PanelHeader.d.ts +11 -0
- package/lib/PickerPanel/PanelHeader.js +143 -0
- package/lib/PickerPanel/QuarterPanel/index.d.ts +3 -0
- package/lib/PickerPanel/QuarterPanel/index.js +101 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/TimeColumn.d.ts +17 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +158 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/index.d.ts +4 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/index.js +293 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/useScrollTo.d.ts +2 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js +82 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/util.d.ts +3 -0
- package/lib/PickerPanel/TimePanel/TimePanelBody/util.js +49 -0
- package/lib/PickerPanel/TimePanel/index.d.ts +4 -0
- package/lib/PickerPanel/TimePanel/index.js +48 -0
- package/lib/PickerPanel/WeekPanel/index.d.ts +3 -0
- package/lib/PickerPanel/WeekPanel/index.js +64 -0
- package/lib/PickerPanel/YearPanel/index.d.ts +3 -0
- package/lib/PickerPanel/YearPanel/index.js +125 -0
- package/lib/PickerPanel/context.d.ts +24 -0
- package/lib/PickerPanel/context.js +78 -0
- package/lib/PickerPanel/index.d.ts +60 -0
- package/lib/PickerPanel/index.js +324 -0
- package/lib/PickerTrigger/index.d.ts +19 -0
- package/lib/PickerTrigger/index.js +95 -0
- package/lib/PickerTrigger/util.d.ts +2 -0
- package/lib/PickerTrigger/util.js +10 -0
- package/lib/generate/dateFns.d.ts +3 -0
- package/lib/generate/dateFns.js +172 -0
- package/lib/generate/dayjs.d.ts +4 -0
- package/lib/generate/dayjs.js +240 -0
- package/lib/generate/index.d.ts +37 -0
- package/lib/generate/index.js +5 -0
- package/lib/generate/luxon.d.ts +4 -0
- package/lib/generate/luxon.js +203 -0
- package/lib/generate/moment.d.ts +4 -0
- package/lib/generate/moment.js +159 -0
- package/lib/hooks/useLocale.d.ts +6 -0
- package/lib/hooks/useLocale.js +90 -0
- package/lib/hooks/useSyncState.d.ts +6 -0
- package/lib/hooks/useSyncState.js +35 -0
- package/lib/hooks/useTimeConfig.d.ts +18 -0
- package/lib/hooks/useTimeConfig.js +173 -0
- package/lib/hooks/useTimeInfo.d.ts +12 -0
- package/lib/hooks/useTimeInfo.js +172 -0
- package/lib/hooks/useToggleDates.d.ts +8 -0
- package/lib/hooks/useToggleDates.js +32 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +57 -0
- package/lib/interface.d.ts +365 -0
- package/lib/interface.js +5 -0
- package/lib/locale/am_ET.d.ts +3 -0
- package/lib/locale/am_ET.js +37 -0
- package/lib/locale/ar_EG.d.ts +3 -0
- package/lib/locale/ar_EG.js +40 -0
- package/lib/locale/az_AZ.d.ts +3 -0
- package/lib/locale/az_AZ.js +41 -0
- package/lib/locale/bg_BG.d.ts +3 -0
- package/lib/locale/bg_BG.js +40 -0
- package/lib/locale/bn_BD.d.ts +3 -0
- package/lib/locale/bn_BD.js +41 -0
- package/lib/locale/by_BY.d.ts +3 -0
- package/lib/locale/by_BY.js +41 -0
- package/lib/locale/ca_ES.d.ts +3 -0
- package/lib/locale/ca_ES.js +40 -0
- package/lib/locale/common.d.ts +2 -0
- package/lib/locale/common.js +12 -0
- package/lib/locale/cs_CZ.d.ts +3 -0
- package/lib/locale/cs_CZ.js +40 -0
- package/lib/locale/da_DK.d.ts +3 -0
- package/lib/locale/da_DK.js +40 -0
- package/lib/locale/de_DE.d.ts +3 -0
- package/lib/locale/de_DE.js +40 -0
- package/lib/locale/el_GR.d.ts +3 -0
- package/lib/locale/el_GR.js +40 -0
- package/lib/locale/en_GB.d.ts +3 -0
- package/lib/locale/en_GB.js +40 -0
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.js +41 -0
- package/lib/locale/es_ES.d.ts +3 -0
- package/lib/locale/es_ES.js +40 -0
- package/lib/locale/es_MX.d.ts +3 -0
- package/lib/locale/es_MX.js +41 -0
- package/lib/locale/et_EE.d.ts +3 -0
- package/lib/locale/et_EE.js +40 -0
- package/lib/locale/eu_ES.d.ts +3 -0
- package/lib/locale/eu_ES.js +42 -0
- package/lib/locale/fa_IR.d.ts +3 -0
- package/lib/locale/fa_IR.js +40 -0
- package/lib/locale/fi_FI.d.ts +3 -0
- package/lib/locale/fi_FI.js +40 -0
- package/lib/locale/fr_BE.d.ts +3 -0
- package/lib/locale/fr_BE.js +40 -0
- package/lib/locale/fr_CA.d.ts +3 -0
- package/lib/locale/fr_CA.js +41 -0
- package/lib/locale/fr_FR.d.ts +3 -0
- package/lib/locale/fr_FR.js +41 -0
- package/lib/locale/ga_IE.d.ts +3 -0
- package/lib/locale/ga_IE.js +41 -0
- package/lib/locale/gl_ES.d.ts +3 -0
- package/lib/locale/gl_ES.js +40 -0
- package/lib/locale/he_IL.d.ts +3 -0
- package/lib/locale/he_IL.js +41 -0
- package/lib/locale/hi_IN.d.ts +3 -0
- package/lib/locale/hi_IN.js +41 -0
- package/lib/locale/hr_HR.d.ts +3 -0
- package/lib/locale/hr_HR.js +41 -0
- package/lib/locale/hu_HU.d.ts +3 -0
- package/lib/locale/hu_HU.js +64 -0
- package/lib/locale/id_ID.d.ts +3 -0
- package/lib/locale/id_ID.js +41 -0
- package/lib/locale/is_IS.d.ts +3 -0
- package/lib/locale/is_IS.js +40 -0
- package/lib/locale/it_IT.d.ts +3 -0
- package/lib/locale/it_IT.js +40 -0
- package/lib/locale/ja_JP.d.ts +3 -0
- package/lib/locale/ja_JP.js +43 -0
- package/lib/locale/ka_GE.d.ts +3 -0
- package/lib/locale/ka_GE.js +41 -0
- package/lib/locale/kk_KZ.d.ts +3 -0
- package/lib/locale/kk_KZ.js +40 -0
- package/lib/locale/km_KH.d.ts +3 -0
- package/lib/locale/km_KH.js +42 -0
- package/lib/locale/kmr_IQ.d.ts +3 -0
- package/lib/locale/kmr_IQ.js +40 -0
- package/lib/locale/kn_IN.d.ts +3 -0
- package/lib/locale/kn_IN.js +41 -0
- package/lib/locale/ko_KR.d.ts +3 -0
- package/lib/locale/ko_KR.js +42 -0
- package/lib/locale/lt_LT.d.ts +3 -0
- package/lib/locale/lt_LT.js +42 -0
- package/lib/locale/lv_LV.d.ts +3 -0
- package/lib/locale/lv_LV.js +40 -0
- package/lib/locale/mk_MK.d.ts +3 -0
- package/lib/locale/mk_MK.js +40 -0
- package/lib/locale/ml_IN.d.ts +3 -0
- package/lib/locale/ml_IN.js +41 -0
- package/lib/locale/mn_MN.d.ts +3 -0
- package/lib/locale/mn_MN.js +42 -0
- package/lib/locale/ms_MY.d.ts +3 -0
- package/lib/locale/ms_MY.js +42 -0
- package/lib/locale/my_MM.d.ts +3 -0
- package/lib/locale/my_MM.js +41 -0
- package/lib/locale/nb_NO.d.ts +3 -0
- package/lib/locale/nb_NO.js +42 -0
- package/lib/locale/ne_NP.d.ts +3 -0
- package/lib/locale/ne_NP.js +41 -0
- package/lib/locale/nl_BE.d.ts +3 -0
- package/lib/locale/nl_BE.js +40 -0
- package/lib/locale/nl_NL.d.ts +3 -0
- package/lib/locale/nl_NL.js +40 -0
- package/lib/locale/pl_PL.d.ts +3 -0
- package/lib/locale/pl_PL.js +40 -0
- package/lib/locale/pt_BR.d.ts +3 -0
- package/lib/locale/pt_BR.js +43 -0
- package/lib/locale/pt_PT.d.ts +3 -0
- package/lib/locale/pt_PT.js +42 -0
- package/lib/locale/ro_RO.d.ts +3 -0
- package/lib/locale/ro_RO.js +41 -0
- package/lib/locale/ru_RU.d.ts +3 -0
- package/lib/locale/ru_RU.js +40 -0
- package/lib/locale/si_LK.d.ts +3 -0
- package/lib/locale/si_LK.js +42 -0
- package/lib/locale/sk_SK.d.ts +3 -0
- package/lib/locale/sk_SK.js +40 -0
- package/lib/locale/sl_SI.d.ts +3 -0
- package/lib/locale/sl_SI.js +40 -0
- package/lib/locale/sr_Cyrl_RS.d.ts +3 -0
- package/lib/locale/sr_Cyrl_RS.js +40 -0
- package/lib/locale/sr_RS.d.ts +3 -0
- package/lib/locale/sr_RS.js +40 -0
- package/lib/locale/sv_SE.d.ts +3 -0
- package/lib/locale/sv_SE.js +40 -0
- package/lib/locale/ta_IN.d.ts +3 -0
- package/lib/locale/ta_IN.js +41 -0
- package/lib/locale/th_TH.d.ts +3 -0
- package/lib/locale/th_TH.js +40 -0
- package/lib/locale/tk_TK.d.ts +3 -0
- package/lib/locale/tk_TK.js +40 -0
- package/lib/locale/tr_TR.d.ts +3 -0
- package/lib/locale/tr_TR.js +42 -0
- package/lib/locale/ug_CN.d.ts +3 -0
- package/lib/locale/ug_CN.js +43 -0
- package/lib/locale/uk_UA.d.ts +3 -0
- package/lib/locale/uk_UA.js +40 -0
- package/lib/locale/ur_PK.d.ts +3 -0
- package/lib/locale/ur_PK.js +41 -0
- package/lib/locale/uz_UZ.d.ts +3 -0
- package/lib/locale/uz_UZ.js +41 -0
- package/lib/locale/vi_VN.d.ts +3 -0
- package/lib/locale/vi_VN.js +41 -0
- package/lib/locale/zh_CN.d.ts +3 -0
- package/lib/locale/zh_CN.js +42 -0
- package/lib/locale/zh_TW.d.ts +3 -0
- package/lib/locale/zh_TW.js +44 -0
- package/lib/utils/dateUtil.d.ts +29 -0
- package/lib/utils/dateUtil.js +161 -0
- package/lib/utils/getClearIcon.d.ts +5 -0
- package/lib/utils/getClearIcon.js +15 -0
- package/lib/utils/miscUtil.d.ts +14 -0
- package/lib/utils/miscUtil.js +81 -0
- package/lib/utils/uiUtil.d.ts +1 -0
- package/lib/utils/uiUtil.js +13 -0
- package/lib/utils/warnUtil.d.ts +5 -0
- package/lib/utils/warnUtil.js +17 -0
- package/package.json +107 -0
|
@@ -0,0 +1,650 @@
|
|
|
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 = void 0;
|
|
8
|
+
var _util = require("@rc-component/util");
|
|
9
|
+
var _useLayoutEffect = _interopRequireDefault(require("@rc-component/util/lib/hooks/useLayoutEffect"));
|
|
10
|
+
var _omit = _interopRequireDefault(require("@rc-component/util/lib/omit"));
|
|
11
|
+
var _pickAttrs = _interopRequireDefault(require("@rc-component/util/lib/pickAttrs"));
|
|
12
|
+
var _warning = _interopRequireDefault(require("@rc-component/util/lib/warning"));
|
|
13
|
+
var React = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _PickerTrigger = _interopRequireDefault(require("../PickerTrigger"));
|
|
15
|
+
var _util2 = require("../PickerTrigger/util");
|
|
16
|
+
var _miscUtil = require("../utils/miscUtil");
|
|
17
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
18
|
+
var _useCellRender = _interopRequireDefault(require("./hooks/useCellRender"));
|
|
19
|
+
var _useFieldsInvalidate3 = _interopRequireDefault(require("./hooks/useFieldsInvalidate"));
|
|
20
|
+
var _useFilledProps3 = _interopRequireDefault(require("./hooks/useFilledProps"));
|
|
21
|
+
var _useOpen3 = _interopRequireDefault(require("./hooks/useOpen"));
|
|
22
|
+
var _usePickerRef = _interopRequireDefault(require("./hooks/usePickerRef"));
|
|
23
|
+
var _usePresets = _interopRequireDefault(require("./hooks/usePresets"));
|
|
24
|
+
var _useRangeActive3 = _interopRequireDefault(require("./hooks/useRangeActive"));
|
|
25
|
+
var _useRangeDisabledDate = _interopRequireDefault(require("./hooks/useRangeDisabledDate"));
|
|
26
|
+
var _useRangePickerValue3 = _interopRequireDefault(require("./hooks/useRangePickerValue"));
|
|
27
|
+
var _useRangeValue3 = _interopRequireWildcard(require("./hooks/useRangeValue"));
|
|
28
|
+
var _useShowNow = _interopRequireDefault(require("./hooks/useShowNow"));
|
|
29
|
+
var _Popup = _interopRequireDefault(require("./Popup"));
|
|
30
|
+
var _RangeSelector = _interopRequireDefault(require("./Selector/RangeSelector"));
|
|
31
|
+
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); }
|
|
32
|
+
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; }
|
|
33
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
|
+
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); }
|
|
35
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
36
|
+
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."); }
|
|
37
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
38
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
39
|
+
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; }
|
|
40
|
+
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; }
|
|
41
|
+
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; }
|
|
42
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
43
|
+
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); }
|
|
44
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
|
+
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."); }
|
|
46
|
+
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); }
|
|
47
|
+
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; }
|
|
48
|
+
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; } }
|
|
49
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
50
|
+
function separateConfig(config, defaultConfig) {
|
|
51
|
+
var singleConfig = config !== null && config !== void 0 ? config : defaultConfig;
|
|
52
|
+
if (Array.isArray(singleConfig)) {
|
|
53
|
+
return singleConfig;
|
|
54
|
+
}
|
|
55
|
+
return [singleConfig, singleConfig];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Used for change event, it should always be not undefined */
|
|
59
|
+
|
|
60
|
+
function getActiveRange(activeIndex) {
|
|
61
|
+
return activeIndex === 1 ? 'end' : 'start';
|
|
62
|
+
}
|
|
63
|
+
function RangePicker(props, ref) {
|
|
64
|
+
// ========================= Prop =========================
|
|
65
|
+
var _useFilledProps = (0, _useFilledProps3.default)(props, function () {
|
|
66
|
+
var disabled = props.disabled,
|
|
67
|
+
allowEmpty = props.allowEmpty;
|
|
68
|
+
var mergedDisabled = separateConfig(disabled, false);
|
|
69
|
+
var mergedAllowEmpty = separateConfig(allowEmpty, false);
|
|
70
|
+
return {
|
|
71
|
+
disabled: mergedDisabled,
|
|
72
|
+
allowEmpty: mergedAllowEmpty
|
|
73
|
+
};
|
|
74
|
+
}),
|
|
75
|
+
_useFilledProps2 = _slicedToArray(_useFilledProps, 6),
|
|
76
|
+
filledProps = _useFilledProps2[0],
|
|
77
|
+
internalPicker = _useFilledProps2[1],
|
|
78
|
+
complexPicker = _useFilledProps2[2],
|
|
79
|
+
formatList = _useFilledProps2[3],
|
|
80
|
+
maskFormat = _useFilledProps2[4],
|
|
81
|
+
isInvalidateDate = _useFilledProps2[5];
|
|
82
|
+
var prefixCls = filledProps.prefixCls,
|
|
83
|
+
styles = filledProps.styles,
|
|
84
|
+
classNames = filledProps.classNames,
|
|
85
|
+
defaultValue = filledProps.defaultValue,
|
|
86
|
+
value = filledProps.value,
|
|
87
|
+
needConfirm = filledProps.needConfirm,
|
|
88
|
+
onKeyDown = filledProps.onKeyDown,
|
|
89
|
+
disabled = filledProps.disabled,
|
|
90
|
+
allowEmpty = filledProps.allowEmpty,
|
|
91
|
+
disabledDate = filledProps.disabledDate,
|
|
92
|
+
minDate = filledProps.minDate,
|
|
93
|
+
maxDate = filledProps.maxDate,
|
|
94
|
+
defaultOpen = filledProps.defaultOpen,
|
|
95
|
+
open = filledProps.open,
|
|
96
|
+
onOpenChange = filledProps.onOpenChange,
|
|
97
|
+
locale = filledProps.locale,
|
|
98
|
+
generateConfig = filledProps.generateConfig,
|
|
99
|
+
picker = filledProps.picker,
|
|
100
|
+
showNow = filledProps.showNow,
|
|
101
|
+
showToday = filledProps.showToday,
|
|
102
|
+
showTime = filledProps.showTime,
|
|
103
|
+
mode = filledProps.mode,
|
|
104
|
+
onPanelChange = filledProps.onPanelChange,
|
|
105
|
+
onCalendarChange = filledProps.onCalendarChange,
|
|
106
|
+
onOk = filledProps.onOk,
|
|
107
|
+
defaultPickerValue = filledProps.defaultPickerValue,
|
|
108
|
+
pickerValue = filledProps.pickerValue,
|
|
109
|
+
onPickerValueChange = filledProps.onPickerValueChange,
|
|
110
|
+
inputReadOnly = filledProps.inputReadOnly,
|
|
111
|
+
suffixIcon = filledProps.suffixIcon,
|
|
112
|
+
onFocus = filledProps.onFocus,
|
|
113
|
+
onBlur = filledProps.onBlur,
|
|
114
|
+
presets = filledProps.presets,
|
|
115
|
+
ranges = filledProps.ranges,
|
|
116
|
+
components = filledProps.components,
|
|
117
|
+
cellRender = filledProps.cellRender,
|
|
118
|
+
dateRender = filledProps.dateRender,
|
|
119
|
+
monthCellRender = filledProps.monthCellRender,
|
|
120
|
+
onClick = filledProps.onClick;
|
|
121
|
+
|
|
122
|
+
// ========================= Refs =========================
|
|
123
|
+
var selectorRef = (0, _usePickerRef.default)(ref);
|
|
124
|
+
|
|
125
|
+
// ========================= Open =========================
|
|
126
|
+
var _useOpen = (0, _useOpen3.default)(open, defaultOpen, disabled, onOpenChange),
|
|
127
|
+
_useOpen2 = _slicedToArray(_useOpen, 2),
|
|
128
|
+
mergedOpen = _useOpen2[0],
|
|
129
|
+
setMergeOpen = _useOpen2[1];
|
|
130
|
+
var triggerOpen = function triggerOpen(nextOpen, config) {
|
|
131
|
+
// No need to open if all disabled
|
|
132
|
+
if (disabled.some(function (fieldDisabled) {
|
|
133
|
+
return !fieldDisabled;
|
|
134
|
+
}) || !nextOpen) {
|
|
135
|
+
setMergeOpen(nextOpen, config);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// ======================== Values ========================
|
|
140
|
+
var _useInnerValue = (0, _useRangeValue3.useInnerValue)(generateConfig, locale, formatList, true, false, defaultValue, value, onCalendarChange, onOk),
|
|
141
|
+
_useInnerValue2 = _slicedToArray(_useInnerValue, 5),
|
|
142
|
+
mergedValue = _useInnerValue2[0],
|
|
143
|
+
setInnerValue = _useInnerValue2[1],
|
|
144
|
+
getCalendarValue = _useInnerValue2[2],
|
|
145
|
+
triggerCalendarChange = _useInnerValue2[3],
|
|
146
|
+
triggerOk = _useInnerValue2[4];
|
|
147
|
+
var calendarValue = getCalendarValue();
|
|
148
|
+
|
|
149
|
+
// ======================== Active ========================
|
|
150
|
+
var _useRangeActive = (0, _useRangeActive3.default)(disabled, allowEmpty, mergedOpen),
|
|
151
|
+
_useRangeActive2 = _slicedToArray(_useRangeActive, 9),
|
|
152
|
+
focused = _useRangeActive2[0],
|
|
153
|
+
triggerFocus = _useRangeActive2[1],
|
|
154
|
+
lastOperation = _useRangeActive2[2],
|
|
155
|
+
activeIndex = _useRangeActive2[3],
|
|
156
|
+
setActiveIndex = _useRangeActive2[4],
|
|
157
|
+
nextActiveIndex = _useRangeActive2[5],
|
|
158
|
+
activeIndexList = _useRangeActive2[6],
|
|
159
|
+
updateSubmitIndex = _useRangeActive2[7],
|
|
160
|
+
hasActiveSubmitValue = _useRangeActive2[8];
|
|
161
|
+
var onSharedFocus = function onSharedFocus(event, index) {
|
|
162
|
+
triggerFocus(true);
|
|
163
|
+
onFocus === null || onFocus === void 0 || onFocus(event, {
|
|
164
|
+
range: getActiveRange(index !== null && index !== void 0 ? index : activeIndex)
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
var onSharedBlur = function onSharedBlur(event, index) {
|
|
168
|
+
triggerFocus(false);
|
|
169
|
+
onBlur === null || onBlur === void 0 || onBlur(event, {
|
|
170
|
+
range: getActiveRange(index !== null && index !== void 0 ? index : activeIndex)
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// ======================= ShowTime =======================
|
|
175
|
+
/** Used for Popup panel */
|
|
176
|
+
var mergedShowTime = React.useMemo(function () {
|
|
177
|
+
if (!showTime) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
var disabledTime = showTime.disabledTime;
|
|
181
|
+
var proxyDisabledTime = disabledTime ? function (date) {
|
|
182
|
+
var range = getActiveRange(activeIndex);
|
|
183
|
+
var fromDate = (0, _miscUtil.getFromDate)(calendarValue, activeIndexList, activeIndex);
|
|
184
|
+
return disabledTime(date, range, {
|
|
185
|
+
from: fromDate
|
|
186
|
+
});
|
|
187
|
+
} : undefined;
|
|
188
|
+
return _objectSpread(_objectSpread({}, showTime), {}, {
|
|
189
|
+
disabledTime: proxyDisabledTime
|
|
190
|
+
});
|
|
191
|
+
}, [showTime, activeIndex, calendarValue, activeIndexList]);
|
|
192
|
+
|
|
193
|
+
// ========================= Mode =========================
|
|
194
|
+
var _useMergedState = (0, _util.useMergedState)([picker, picker], {
|
|
195
|
+
value: mode
|
|
196
|
+
}),
|
|
197
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
198
|
+
modes = _useMergedState2[0],
|
|
199
|
+
setModes = _useMergedState2[1];
|
|
200
|
+
var mergedMode = modes[activeIndex] || picker;
|
|
201
|
+
|
|
202
|
+
/** Extends from `mergedMode` to patch `datetime` mode */
|
|
203
|
+
var internalMode = mergedMode === 'date' && mergedShowTime ? 'datetime' : mergedMode;
|
|
204
|
+
|
|
205
|
+
// ====================== PanelCount ======================
|
|
206
|
+
var multiplePanel = internalMode === picker && internalMode !== 'time';
|
|
207
|
+
|
|
208
|
+
// ======================= Show Now =======================
|
|
209
|
+
var mergedShowNow = (0, _useShowNow.default)(picker, mergedMode, showNow, showToday, true);
|
|
210
|
+
|
|
211
|
+
// ======================== Value =========================
|
|
212
|
+
var _useRangeValue = (0, _useRangeValue3.default)(filledProps, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, mergedOpen, isInvalidateDate),
|
|
213
|
+
_useRangeValue2 = _slicedToArray(_useRangeValue, 2),
|
|
214
|
+
/** Trigger `onChange` by check `disabledDate` */
|
|
215
|
+
flushSubmit = _useRangeValue2[0],
|
|
216
|
+
/** Trigger `onChange` directly without check `disabledDate` */
|
|
217
|
+
triggerSubmitChange = _useRangeValue2[1];
|
|
218
|
+
|
|
219
|
+
// ===================== DisabledDate =====================
|
|
220
|
+
var mergedDisabledDate = (0, _useRangeDisabledDate.default)(calendarValue, disabled, activeIndexList, generateConfig, locale, disabledDate);
|
|
221
|
+
|
|
222
|
+
// ======================= Validate =======================
|
|
223
|
+
var _useFieldsInvalidate = (0, _useFieldsInvalidate3.default)(calendarValue, isInvalidateDate, allowEmpty),
|
|
224
|
+
_useFieldsInvalidate2 = _slicedToArray(_useFieldsInvalidate, 2),
|
|
225
|
+
submitInvalidates = _useFieldsInvalidate2[0],
|
|
226
|
+
onSelectorInvalid = _useFieldsInvalidate2[1];
|
|
227
|
+
|
|
228
|
+
// ===================== Picker Value =====================
|
|
229
|
+
var _useRangePickerValue = (0, _useRangePickerValue3.default)(generateConfig, locale, calendarValue, modes, mergedOpen, activeIndex, internalPicker, multiplePanel, defaultPickerValue, pickerValue, mergedShowTime === null || mergedShowTime === void 0 ? void 0 : mergedShowTime.defaultOpenValue, onPickerValueChange, minDate, maxDate),
|
|
230
|
+
_useRangePickerValue2 = _slicedToArray(_useRangePickerValue, 2),
|
|
231
|
+
currentPickerValue = _useRangePickerValue2[0],
|
|
232
|
+
setCurrentPickerValue = _useRangePickerValue2[1];
|
|
233
|
+
|
|
234
|
+
// >>> Mode need wait for `pickerValue`
|
|
235
|
+
var triggerModeChange = (0, _util.useEvent)(function (nextPickerValue, nextMode, triggerEvent) {
|
|
236
|
+
var clone = (0, _miscUtil.fillIndex)(modes, activeIndex, nextMode);
|
|
237
|
+
if (clone[0] !== modes[0] || clone[1] !== modes[1]) {
|
|
238
|
+
setModes(clone);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Compatible with `onPanelChange`
|
|
242
|
+
if (onPanelChange && triggerEvent !== false) {
|
|
243
|
+
var clonePickerValue = _toConsumableArray(calendarValue);
|
|
244
|
+
if (nextPickerValue) {
|
|
245
|
+
clonePickerValue[activeIndex] = nextPickerValue;
|
|
246
|
+
}
|
|
247
|
+
onPanelChange(clonePickerValue, clone);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// ======================== Change ========================
|
|
252
|
+
var fillCalendarValue = function fillCalendarValue(date, index) {
|
|
253
|
+
return (
|
|
254
|
+
// Trigger change only when date changed
|
|
255
|
+
(0, _miscUtil.fillIndex)(calendarValue, index, date)
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// ======================== Submit ========================
|
|
260
|
+
/**
|
|
261
|
+
* Trigger by confirm operation.
|
|
262
|
+
* This function has already handle the `needConfirm` check logic.
|
|
263
|
+
* - Selector: enter key
|
|
264
|
+
* - Panel: OK button
|
|
265
|
+
*/
|
|
266
|
+
var triggerPartConfirm = function triggerPartConfirm(date, skipFocus) {
|
|
267
|
+
var nextValue = calendarValue;
|
|
268
|
+
if (date) {
|
|
269
|
+
nextValue = fillCalendarValue(date, activeIndex);
|
|
270
|
+
}
|
|
271
|
+
updateSubmitIndex(activeIndex);
|
|
272
|
+
// Get next focus index
|
|
273
|
+
var nextIndex = nextActiveIndex(nextValue);
|
|
274
|
+
|
|
275
|
+
// Change calendar value and tell flush it
|
|
276
|
+
triggerCalendarChange(nextValue);
|
|
277
|
+
flushSubmit(activeIndex, nextIndex === null);
|
|
278
|
+
if (nextIndex === null) {
|
|
279
|
+
triggerOpen(false, {
|
|
280
|
+
force: true
|
|
281
|
+
});
|
|
282
|
+
} else if (!skipFocus) {
|
|
283
|
+
selectorRef.current.focus({
|
|
284
|
+
index: nextIndex
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// ======================== Click =========================
|
|
290
|
+
var onSelectorClick = function onSelectorClick(event) {
|
|
291
|
+
var _activeElement;
|
|
292
|
+
var rootNode = event.target.getRootNode();
|
|
293
|
+
if (!selectorRef.current.nativeElement.contains((_activeElement = rootNode.activeElement) !== null && _activeElement !== void 0 ? _activeElement : document.activeElement)) {
|
|
294
|
+
// Click to focus the enabled input
|
|
295
|
+
var enabledIndex = disabled.findIndex(function (d) {
|
|
296
|
+
return !d;
|
|
297
|
+
});
|
|
298
|
+
if (enabledIndex >= 0) {
|
|
299
|
+
selectorRef.current.focus({
|
|
300
|
+
index: enabledIndex
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
triggerOpen(true);
|
|
305
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
306
|
+
};
|
|
307
|
+
var onSelectorClear = function onSelectorClear() {
|
|
308
|
+
triggerSubmitChange(null);
|
|
309
|
+
triggerOpen(false, {
|
|
310
|
+
force: true
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// ======================== Hover =========================
|
|
315
|
+
var _React$useState = React.useState(null),
|
|
316
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
317
|
+
hoverSource = _React$useState2[0],
|
|
318
|
+
setHoverSource = _React$useState2[1];
|
|
319
|
+
var _React$useState3 = React.useState(null),
|
|
320
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
321
|
+
internalHoverValues = _React$useState4[0],
|
|
322
|
+
setInternalHoverValues = _React$useState4[1];
|
|
323
|
+
var hoverValues = React.useMemo(function () {
|
|
324
|
+
return internalHoverValues || calendarValue;
|
|
325
|
+
}, [calendarValue, internalHoverValues]);
|
|
326
|
+
|
|
327
|
+
// Clean up `internalHoverValues` when closed
|
|
328
|
+
React.useEffect(function () {
|
|
329
|
+
if (!mergedOpen) {
|
|
330
|
+
setInternalHoverValues(null);
|
|
331
|
+
}
|
|
332
|
+
}, [mergedOpen]);
|
|
333
|
+
|
|
334
|
+
// ========================================================
|
|
335
|
+
// == Panels ==
|
|
336
|
+
// ========================================================
|
|
337
|
+
// Save the offset with active bar position
|
|
338
|
+
// const [activeOffset, setActiveOffset] = React.useState(0);
|
|
339
|
+
var _React$useState5 = React.useState([0, 0, 0]),
|
|
340
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
341
|
+
activeInfo = _React$useState6[0],
|
|
342
|
+
setActiveInfo = _React$useState6[1];
|
|
343
|
+
|
|
344
|
+
// ======================= Presets ========================
|
|
345
|
+
var presetList = (0, _usePresets.default)(presets, ranges);
|
|
346
|
+
var onPresetHover = function onPresetHover(nextValues) {
|
|
347
|
+
setInternalHoverValues(nextValues);
|
|
348
|
+
setHoverSource('preset');
|
|
349
|
+
};
|
|
350
|
+
var onPresetSubmit = function onPresetSubmit(nextValues) {
|
|
351
|
+
var passed = triggerSubmitChange(nextValues);
|
|
352
|
+
if (passed) {
|
|
353
|
+
triggerOpen(false, {
|
|
354
|
+
force: true
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
var onNow = function onNow(now) {
|
|
359
|
+
triggerPartConfirm(now);
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
// ======================== Panel =========================
|
|
363
|
+
var onPanelHover = function onPanelHover(date) {
|
|
364
|
+
setInternalHoverValues(date ? fillCalendarValue(date, activeIndex) : null);
|
|
365
|
+
setHoverSource('cell');
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
// >>> Focus
|
|
369
|
+
var onPanelFocus = function onPanelFocus(event) {
|
|
370
|
+
triggerOpen(true);
|
|
371
|
+
onSharedFocus(event);
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// >>> MouseDown
|
|
375
|
+
var onPanelMouseDown = function onPanelMouseDown() {
|
|
376
|
+
lastOperation('panel');
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
// >>> Calendar
|
|
380
|
+
var onPanelSelect = function onPanelSelect(date) {
|
|
381
|
+
var clone = (0, _miscUtil.fillIndex)(calendarValue, activeIndex, date);
|
|
382
|
+
|
|
383
|
+
// Only trigger calendar event but not update internal `calendarValue` state
|
|
384
|
+
triggerCalendarChange(clone);
|
|
385
|
+
|
|
386
|
+
// >>> Trigger next active if !needConfirm
|
|
387
|
+
// Fully logic check `useRangeValue` hook
|
|
388
|
+
if (!needConfirm && !complexPicker && internalPicker === internalMode) {
|
|
389
|
+
triggerPartConfirm(date);
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// >>> Close
|
|
394
|
+
var onPopupClose = function onPopupClose() {
|
|
395
|
+
// Close popup
|
|
396
|
+
triggerOpen(false);
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
// >>> cellRender
|
|
400
|
+
var onInternalCellRender = (0, _useCellRender.default)(cellRender, dateRender, monthCellRender, getActiveRange(activeIndex));
|
|
401
|
+
|
|
402
|
+
// >>> Value
|
|
403
|
+
var panelValue = calendarValue[activeIndex] || null;
|
|
404
|
+
|
|
405
|
+
// >>> invalid
|
|
406
|
+
var isPopupInvalidateDate = (0, _util.useEvent)(function (date) {
|
|
407
|
+
return isInvalidateDate(date, {
|
|
408
|
+
activeIndex: activeIndex
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
var panelProps = React.useMemo(function () {
|
|
412
|
+
var domProps = (0, _pickAttrs.default)(filledProps, false);
|
|
413
|
+
var restProps = (0, _omit.default)(filledProps, [].concat(_toConsumableArray(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange', 'disabledTime']));
|
|
414
|
+
return restProps;
|
|
415
|
+
}, [filledProps]);
|
|
416
|
+
|
|
417
|
+
// >>> Render
|
|
418
|
+
var panel = /*#__PURE__*/React.createElement(_Popup.default, _extends({}, panelProps, {
|
|
419
|
+
showNow: mergedShowNow,
|
|
420
|
+
showTime: mergedShowTime
|
|
421
|
+
// Range
|
|
422
|
+
,
|
|
423
|
+
range: true,
|
|
424
|
+
multiplePanel: multiplePanel,
|
|
425
|
+
activeInfo: activeInfo
|
|
426
|
+
// Disabled
|
|
427
|
+
,
|
|
428
|
+
disabledDate: mergedDisabledDate
|
|
429
|
+
// Focus
|
|
430
|
+
,
|
|
431
|
+
onFocus: onPanelFocus,
|
|
432
|
+
onBlur: onSharedBlur,
|
|
433
|
+
onPanelMouseDown: onPanelMouseDown
|
|
434
|
+
// Mode
|
|
435
|
+
,
|
|
436
|
+
picker: picker,
|
|
437
|
+
mode: mergedMode,
|
|
438
|
+
internalMode: internalMode,
|
|
439
|
+
onPanelChange: triggerModeChange
|
|
440
|
+
// Value
|
|
441
|
+
,
|
|
442
|
+
format: maskFormat,
|
|
443
|
+
value: panelValue,
|
|
444
|
+
isInvalid: isPopupInvalidateDate,
|
|
445
|
+
onChange: null,
|
|
446
|
+
onSelect: onPanelSelect
|
|
447
|
+
// PickerValue
|
|
448
|
+
,
|
|
449
|
+
pickerValue: currentPickerValue,
|
|
450
|
+
defaultOpenValue: (0, _miscUtil.toArray)(showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue)[activeIndex],
|
|
451
|
+
onPickerValueChange: setCurrentPickerValue
|
|
452
|
+
// Hover
|
|
453
|
+
,
|
|
454
|
+
hoverValue: hoverValues,
|
|
455
|
+
onHover: onPanelHover
|
|
456
|
+
// Submit
|
|
457
|
+
,
|
|
458
|
+
needConfirm: needConfirm,
|
|
459
|
+
onSubmit: triggerPartConfirm,
|
|
460
|
+
onOk: triggerOk
|
|
461
|
+
// Preset
|
|
462
|
+
,
|
|
463
|
+
presets: presetList,
|
|
464
|
+
onPresetHover: onPresetHover,
|
|
465
|
+
onPresetSubmit: onPresetSubmit
|
|
466
|
+
// Now
|
|
467
|
+
,
|
|
468
|
+
onNow: onNow
|
|
469
|
+
// Render
|
|
470
|
+
,
|
|
471
|
+
cellRender: onInternalCellRender
|
|
472
|
+
}));
|
|
473
|
+
|
|
474
|
+
// ========================================================
|
|
475
|
+
// == Selector ==
|
|
476
|
+
// ========================================================
|
|
477
|
+
|
|
478
|
+
// ======================== Change ========================
|
|
479
|
+
var onSelectorChange = function onSelectorChange(date, index) {
|
|
480
|
+
var clone = fillCalendarValue(date, index);
|
|
481
|
+
triggerCalendarChange(clone);
|
|
482
|
+
};
|
|
483
|
+
var onSelectorInputChange = function onSelectorInputChange() {
|
|
484
|
+
lastOperation('input');
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
// ======================= Selector =======================
|
|
488
|
+
var onSelectorFocus = function onSelectorFocus(event, index) {
|
|
489
|
+
// Check if `needConfirm` but user not submit yet
|
|
490
|
+
var activeListLen = activeIndexList.length;
|
|
491
|
+
var lastActiveIndex = activeIndexList[activeListLen - 1];
|
|
492
|
+
if (activeListLen && lastActiveIndex !== index && needConfirm &&
|
|
493
|
+
// Not change index if is not filled
|
|
494
|
+
!allowEmpty[lastActiveIndex] && !hasActiveSubmitValue(lastActiveIndex) && calendarValue[lastActiveIndex]) {
|
|
495
|
+
selectorRef.current.focus({
|
|
496
|
+
index: lastActiveIndex
|
|
497
|
+
});
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
lastOperation('input');
|
|
501
|
+
triggerOpen(true, {
|
|
502
|
+
inherit: true
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
// When click input to switch the field, it will not trigger close.
|
|
506
|
+
// Which means it will lose the part confirm and we need fill back.
|
|
507
|
+
// ref: https://github.com/ant-design/ant-design/issues/49512
|
|
508
|
+
if (activeIndex !== index && mergedOpen && !needConfirm && complexPicker) {
|
|
509
|
+
triggerPartConfirm(null, true);
|
|
510
|
+
}
|
|
511
|
+
setActiveIndex(index);
|
|
512
|
+
onSharedFocus(event, index);
|
|
513
|
+
};
|
|
514
|
+
var onSelectorBlur = function onSelectorBlur(event, index) {
|
|
515
|
+
triggerOpen(false);
|
|
516
|
+
if (!needConfirm && lastOperation() === 'input') {
|
|
517
|
+
var nextIndex = nextActiveIndex(calendarValue);
|
|
518
|
+
flushSubmit(activeIndex, nextIndex === null);
|
|
519
|
+
}
|
|
520
|
+
onSharedBlur(event, index);
|
|
521
|
+
};
|
|
522
|
+
var onSelectorKeyDown = function onSelectorKeyDown(event, preventDefault) {
|
|
523
|
+
if (event.key === 'Tab') {
|
|
524
|
+
triggerPartConfirm(null, true);
|
|
525
|
+
}
|
|
526
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, preventDefault);
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
// ======================= Context ========================
|
|
530
|
+
var context = React.useMemo(function () {
|
|
531
|
+
return {
|
|
532
|
+
prefixCls: prefixCls,
|
|
533
|
+
locale: locale,
|
|
534
|
+
generateConfig: generateConfig,
|
|
535
|
+
button: components.button,
|
|
536
|
+
input: components.input
|
|
537
|
+
};
|
|
538
|
+
}, [prefixCls, locale, generateConfig, components.button, components.input]);
|
|
539
|
+
|
|
540
|
+
// ======================== Effect ========================
|
|
541
|
+
// >>> Mode
|
|
542
|
+
// Reset for every active
|
|
543
|
+
(0, _useLayoutEffect.default)(function () {
|
|
544
|
+
if (mergedOpen && activeIndex !== undefined) {
|
|
545
|
+
// Legacy compatible. This effect update should not trigger `onPanelChange`
|
|
546
|
+
triggerModeChange(null, picker, false);
|
|
547
|
+
}
|
|
548
|
+
}, [mergedOpen, activeIndex, picker]);
|
|
549
|
+
|
|
550
|
+
// >>> For complex picker, we need check if need to focus next one
|
|
551
|
+
(0, _useLayoutEffect.default)(function () {
|
|
552
|
+
var lastOp = lastOperation();
|
|
553
|
+
|
|
554
|
+
// Trade as confirm on field leave
|
|
555
|
+
if (!mergedOpen && lastOp === 'input') {
|
|
556
|
+
triggerOpen(false);
|
|
557
|
+
triggerPartConfirm(null, true);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Submit with complex picker
|
|
561
|
+
if (!mergedOpen && complexPicker && !needConfirm && lastOp === 'panel') {
|
|
562
|
+
triggerOpen(true);
|
|
563
|
+
triggerPartConfirm();
|
|
564
|
+
}
|
|
565
|
+
}, [mergedOpen]);
|
|
566
|
+
|
|
567
|
+
// ====================== DevWarning ======================
|
|
568
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
569
|
+
var isIndexEmpty = function isIndexEmpty(index) {
|
|
570
|
+
return (
|
|
571
|
+
// Value is empty
|
|
572
|
+
!(value !== null && value !== void 0 && value[index]) &&
|
|
573
|
+
// DefaultValue is empty
|
|
574
|
+
!(defaultValue !== null && defaultValue !== void 0 && defaultValue[index])
|
|
575
|
+
);
|
|
576
|
+
};
|
|
577
|
+
if (disabled.some(function (fieldDisabled, index) {
|
|
578
|
+
return fieldDisabled && isIndexEmpty(index) && !allowEmpty[index];
|
|
579
|
+
})) {
|
|
580
|
+
(0, _warning.default)(false, '`disabled` should not set with empty `value`. You should set `allowEmpty` or `value` instead.');
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// ======================== Render ========================
|
|
585
|
+
return /*#__PURE__*/React.createElement(_context.default.Provider, {
|
|
586
|
+
value: context
|
|
587
|
+
}, /*#__PURE__*/React.createElement(_PickerTrigger.default, _extends({}, (0, _util2.pickTriggerProps)(filledProps), {
|
|
588
|
+
popupElement: panel,
|
|
589
|
+
popupStyle: styles.popup,
|
|
590
|
+
popupClassName: classNames.popup
|
|
591
|
+
// Visible
|
|
592
|
+
,
|
|
593
|
+
visible: mergedOpen,
|
|
594
|
+
onClose: onPopupClose
|
|
595
|
+
// Range
|
|
596
|
+
,
|
|
597
|
+
range: true
|
|
598
|
+
}), /*#__PURE__*/React.createElement(_RangeSelector.default
|
|
599
|
+
// Shared
|
|
600
|
+
, _extends({}, filledProps, {
|
|
601
|
+
// Ref
|
|
602
|
+
ref: selectorRef
|
|
603
|
+
// Icon
|
|
604
|
+
,
|
|
605
|
+
suffixIcon: suffixIcon
|
|
606
|
+
// Active
|
|
607
|
+
,
|
|
608
|
+
activeIndex: focused || mergedOpen ? activeIndex : null,
|
|
609
|
+
activeHelp: !!internalHoverValues,
|
|
610
|
+
allHelp: !!internalHoverValues && hoverSource === 'preset',
|
|
611
|
+
focused: focused,
|
|
612
|
+
onFocus: onSelectorFocus,
|
|
613
|
+
onBlur: onSelectorBlur,
|
|
614
|
+
onKeyDown: onSelectorKeyDown,
|
|
615
|
+
onSubmit: triggerPartConfirm
|
|
616
|
+
// Change
|
|
617
|
+
,
|
|
618
|
+
value: hoverValues,
|
|
619
|
+
maskFormat: maskFormat,
|
|
620
|
+
onChange: onSelectorChange,
|
|
621
|
+
onInputChange: onSelectorInputChange
|
|
622
|
+
// Format
|
|
623
|
+
,
|
|
624
|
+
format: formatList,
|
|
625
|
+
inputReadOnly: inputReadOnly
|
|
626
|
+
// Disabled
|
|
627
|
+
,
|
|
628
|
+
disabled: disabled
|
|
629
|
+
// Open
|
|
630
|
+
,
|
|
631
|
+
open: mergedOpen,
|
|
632
|
+
onOpenChange: triggerOpen
|
|
633
|
+
// Click
|
|
634
|
+
,
|
|
635
|
+
onClick: onSelectorClick,
|
|
636
|
+
onClear: onSelectorClear
|
|
637
|
+
// Invalid
|
|
638
|
+
,
|
|
639
|
+
invalid: submitInvalidates,
|
|
640
|
+
onInvalid: onSelectorInvalid
|
|
641
|
+
// Offset
|
|
642
|
+
,
|
|
643
|
+
onActiveInfo: setActiveInfo
|
|
644
|
+
}))));
|
|
645
|
+
}
|
|
646
|
+
var RefRangePicker = /*#__PURE__*/React.forwardRef(RangePicker);
|
|
647
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
648
|
+
RefRangePicker.displayName = 'RefRangePicker';
|
|
649
|
+
}
|
|
650
|
+
var _default = exports.default = RefRangePicker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface IconProps extends React.HtmlHTMLAttributes<HTMLElement> {
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
type: 'suffix' | 'clear';
|
|
5
|
+
}
|
|
6
|
+
export default function Icon(props: IconProps): React.JSX.Element;
|
|
7
|
+
export interface ClearIconProps extends Omit<IconProps, 'type'> {
|
|
8
|
+
onClear: VoidFunction;
|
|
9
|
+
}
|
|
10
|
+
export declare function ClearIcon({ onClear, ...restProps }: ClearIconProps): React.JSX.Element;
|