@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,570 @@
|
|
|
1
|
+
@prefix-cls: rc-picker;
|
|
2
|
+
|
|
3
|
+
@background-color: rgb(255, 240, 255);
|
|
4
|
+
|
|
5
|
+
@input-placeholder-color: hsv(0, 0, 75%);
|
|
6
|
+
|
|
7
|
+
@time-panel-padding-total: 180px;
|
|
8
|
+
// @time-panel-padding-top: 90px;
|
|
9
|
+
@time-panel-padding-top: 0;
|
|
10
|
+
|
|
11
|
+
.placeholder(@color: @input-placeholder-color) {
|
|
12
|
+
// Firefox
|
|
13
|
+
&::-moz-placeholder {
|
|
14
|
+
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&::placeholder {
|
|
18
|
+
color: @color;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:placeholder-shown {
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.@{prefix-cls} {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
|
|
30
|
+
&-rtl {
|
|
31
|
+
direction: rtl;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-focused {
|
|
35
|
+
border: 1px solid blue;
|
|
36
|
+
}
|
|
37
|
+
&-invalid {
|
|
38
|
+
box-shadow: 0 0 2px red;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-panels {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-wrap: nowrap;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-panel {
|
|
47
|
+
display: inline-block;
|
|
48
|
+
vertical-align: top;
|
|
49
|
+
background: @background-color;
|
|
50
|
+
border: 1px solid #666;
|
|
51
|
+
|
|
52
|
+
&-focused {
|
|
53
|
+
border-color: blue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&-rtl {
|
|
57
|
+
direction: rtl;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ===================== Shared Panel =====================
|
|
62
|
+
&-decade-panel,
|
|
63
|
+
&-year-panel,
|
|
64
|
+
&-month-panel,
|
|
65
|
+
&-week-panel,
|
|
66
|
+
&-date-panel,
|
|
67
|
+
&-time-panel {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
|
|
71
|
+
table {
|
|
72
|
+
text-align: center;
|
|
73
|
+
border-collapse: collapse;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Header
|
|
78
|
+
&-header {
|
|
79
|
+
display: flex;
|
|
80
|
+
|
|
81
|
+
> * {
|
|
82
|
+
flex: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&-view {
|
|
86
|
+
flex: auto;
|
|
87
|
+
text-align: center;
|
|
88
|
+
|
|
89
|
+
> button {
|
|
90
|
+
padding: 0;
|
|
91
|
+
border: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Content
|
|
97
|
+
&-cell {
|
|
98
|
+
color: #aaa;
|
|
99
|
+
|
|
100
|
+
&-disabled {
|
|
101
|
+
opacity: 0.2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&-inner {
|
|
105
|
+
display: inline-block;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 20px;
|
|
109
|
+
margin: 0;
|
|
110
|
+
padding: 0;
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
line-height: 20px;
|
|
113
|
+
background: transparent;
|
|
114
|
+
border: 0;
|
|
115
|
+
border: none;
|
|
116
|
+
outline: none;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
transition:
|
|
119
|
+
background 0.3s,
|
|
120
|
+
border 0.3s;
|
|
121
|
+
|
|
122
|
+
&:hover {
|
|
123
|
+
background: fade(blue, 30%);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&-in-view {
|
|
128
|
+
color: #333;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&-in-range > &-inner {
|
|
132
|
+
background: fade(blue, 5%);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&-hover > &-inner {
|
|
136
|
+
background: orange;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&-range-hover-start,
|
|
140
|
+
&-range-hover-end,
|
|
141
|
+
&-range-hover {
|
|
142
|
+
position: relative;
|
|
143
|
+
&::after {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 3px;
|
|
146
|
+
right: 0;
|
|
147
|
+
bottom: 0;
|
|
148
|
+
left: 0;
|
|
149
|
+
border: 1px solid green;
|
|
150
|
+
border-right: 0;
|
|
151
|
+
border-left: 0;
|
|
152
|
+
content: '';
|
|
153
|
+
pointer-events: none;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&-range-hover-start::after {
|
|
158
|
+
border-left: 1px solid green !important;
|
|
159
|
+
}
|
|
160
|
+
&-range-hover-end::after {
|
|
161
|
+
border-right: 1px solid green !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-today > &-inner {
|
|
165
|
+
border: 1px solid blue;
|
|
166
|
+
}
|
|
167
|
+
&-range-start > &-inner,
|
|
168
|
+
&-range-end > &-inner,
|
|
169
|
+
&-selected > &-inner {
|
|
170
|
+
background: fade(blue, 20%);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Preset
|
|
175
|
+
&-presets {
|
|
176
|
+
background: #ccccff;
|
|
177
|
+
|
|
178
|
+
ul {
|
|
179
|
+
margin: 0;
|
|
180
|
+
padding: 0;
|
|
181
|
+
list-style: none;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&-footer,
|
|
186
|
+
&-picker-footer {
|
|
187
|
+
background: green;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&-ranges {
|
|
191
|
+
margin: 0;
|
|
192
|
+
padding: 0;
|
|
193
|
+
overflow: hidden;
|
|
194
|
+
list-style: none;
|
|
195
|
+
|
|
196
|
+
> li {
|
|
197
|
+
display: inline-block;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&-ok {
|
|
202
|
+
float: right;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ================== Year & Month Panel ==================
|
|
206
|
+
&-year-panel,
|
|
207
|
+
&-month-panel {
|
|
208
|
+
.@{prefix-cls}-cell-inner {
|
|
209
|
+
width: 80px;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ====================== Week Panel ======================
|
|
214
|
+
&-week-panel {
|
|
215
|
+
&-row {
|
|
216
|
+
&:hover {
|
|
217
|
+
.@{prefix-cls}-cell {
|
|
218
|
+
background: red;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&-selected {
|
|
223
|
+
.@{prefix-cls}-cell {
|
|
224
|
+
background: rgba(0, 0, 255, 0.3);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&-range {
|
|
229
|
+
&-hover {
|
|
230
|
+
.@{prefix-cls}-cell {
|
|
231
|
+
background: rgba(0, 255, 0, 0.1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&-start,
|
|
236
|
+
&-end {
|
|
237
|
+
.@{prefix-cls}-cell {
|
|
238
|
+
background: rgba(0, 255, 0, 0.3);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.@{prefix-cls}-cell,
|
|
245
|
+
.@{prefix-cls}-cell-inner {
|
|
246
|
+
width: 20px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.@{prefix-cls}-cell-week {
|
|
250
|
+
color: #999;
|
|
251
|
+
font-weight: bold;
|
|
252
|
+
font-size: 12px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.@{prefix-cls}-cell:hover > .@{prefix-cls}-cell-inner,
|
|
256
|
+
.@{prefix-cls}-cell-selected > .@{prefix-cls}-cell-inner {
|
|
257
|
+
background: transparent;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// ====================== Date Panel ======================
|
|
262
|
+
&-date-panel {
|
|
263
|
+
.@{prefix-cls}-cell-inner {
|
|
264
|
+
width: 20px;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// ====================== Time Panel ======================
|
|
269
|
+
&-time-panel {
|
|
270
|
+
width: auto;
|
|
271
|
+
|
|
272
|
+
.@{prefix-cls}-content {
|
|
273
|
+
position: relative;
|
|
274
|
+
display: flex;
|
|
275
|
+
max-height: 200px;
|
|
276
|
+
direction: ltr;
|
|
277
|
+
|
|
278
|
+
// &::after {
|
|
279
|
+
// position: absolute;
|
|
280
|
+
// top: @time-panel-padding-top;
|
|
281
|
+
// right: -5px;
|
|
282
|
+
// left: -5px;
|
|
283
|
+
// height: 20px;
|
|
284
|
+
// background: rgba(255, 0, 0, 0.05);
|
|
285
|
+
// content: '';
|
|
286
|
+
// pointer-events: none;
|
|
287
|
+
// }
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// &-column-holder {
|
|
291
|
+
// display: flex;
|
|
292
|
+
// flex-direction: column;
|
|
293
|
+
// text-align: center;
|
|
294
|
+
// }
|
|
295
|
+
|
|
296
|
+
&-column-title {
|
|
297
|
+
font-size: 14px;
|
|
298
|
+
line-height: 20px;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
&-column {
|
|
302
|
+
flex: auto;
|
|
303
|
+
width: 50px;
|
|
304
|
+
margin: 0;
|
|
305
|
+
// padding: 0 0 180px 0;
|
|
306
|
+
padding: @time-panel-padding-top 0 (@time-panel-padding-total - @time-panel-padding-top);
|
|
307
|
+
overflow-x: hidden;
|
|
308
|
+
overflow-y: hidden;
|
|
309
|
+
font-size: 12px;
|
|
310
|
+
text-align: left;
|
|
311
|
+
list-style: none;
|
|
312
|
+
transition: background 0.3s;
|
|
313
|
+
|
|
314
|
+
&-active {
|
|
315
|
+
background: rgba(0, 0, 255, 0.1);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
&:hover {
|
|
319
|
+
overflow-y: auto;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
> li {
|
|
323
|
+
width: 50px;
|
|
324
|
+
margin: 0;
|
|
325
|
+
padding: 0;
|
|
326
|
+
cursor: pointer;
|
|
327
|
+
|
|
328
|
+
&.@{prefix-cls}-time-panel-cell {
|
|
329
|
+
&-disabled {
|
|
330
|
+
opacity: 0.5;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&-selected {
|
|
334
|
+
background: rgba(0, 0, 255, 0.5);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.@{prefix-cls}-time-panel-cell-inner {
|
|
339
|
+
display: block;
|
|
340
|
+
width: 100%;
|
|
341
|
+
height: 20px;
|
|
342
|
+
margin: 0;
|
|
343
|
+
// padding: 0 0 0 12px;
|
|
344
|
+
color: #333;
|
|
345
|
+
line-height: 20px;
|
|
346
|
+
text-align: center;
|
|
347
|
+
|
|
348
|
+
.@{prefix-cls}-panel-rtl & {
|
|
349
|
+
padding: 0 12px 0 0;
|
|
350
|
+
text-align: right;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// ====================== Date Time =======================
|
|
358
|
+
&-datetime-panel {
|
|
359
|
+
display: flex;
|
|
360
|
+
|
|
361
|
+
.@{prefix-cls}-time-panel {
|
|
362
|
+
border-left: 1px solid #999;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.@{prefix-cls}-date-panel,
|
|
366
|
+
.@{prefix-cls}-time-panel {
|
|
367
|
+
transition: opacity 0.3s;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Keyboard
|
|
371
|
+
&-active {
|
|
372
|
+
.@{prefix-cls}-date-panel,
|
|
373
|
+
.@{prefix-cls}-time-panel {
|
|
374
|
+
opacity: 0.3;
|
|
375
|
+
|
|
376
|
+
&-active {
|
|
377
|
+
opacity: 1;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ======================== Input =========================
|
|
384
|
+
&-input {
|
|
385
|
+
position: relative;
|
|
386
|
+
display: inline-flex;
|
|
387
|
+
width: 100%;
|
|
388
|
+
|
|
389
|
+
.@{prefix-cls}-rtl & {
|
|
390
|
+
text-align: right;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&-active {
|
|
394
|
+
> input {
|
|
395
|
+
background: rgba(0, 0, 255, 0.05);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
> input {
|
|
400
|
+
width: 100%;
|
|
401
|
+
.placeholder();
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
&-placeholder {
|
|
405
|
+
> input {
|
|
406
|
+
color: @input-placeholder-color;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
&-clear {
|
|
412
|
+
position: absolute;
|
|
413
|
+
top: 0;
|
|
414
|
+
inset-inline-end: 4px;
|
|
415
|
+
cursor: pointer;
|
|
416
|
+
|
|
417
|
+
&-btn::after {
|
|
418
|
+
content: '×';
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// ======================= Dropdown =======================
|
|
423
|
+
&-dropdown {
|
|
424
|
+
position: absolute;
|
|
425
|
+
box-shadow: 0 0 1px red;
|
|
426
|
+
pointer-events: none;
|
|
427
|
+
|
|
428
|
+
&-range {
|
|
429
|
+
padding: 10px 0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
&-hidden {
|
|
433
|
+
display: none;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&-rtl {
|
|
437
|
+
direction: rtl;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Panel
|
|
441
|
+
@arrow-size: 10px;
|
|
442
|
+
|
|
443
|
+
&-placement-topLeft,
|
|
444
|
+
&-placement-topRight {
|
|
445
|
+
.@{prefix-cls}-range-arrow {
|
|
446
|
+
bottom: (@arrow-size / 2 + 1px);
|
|
447
|
+
transform: rotate(135deg);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
&-placement-bottomLeft,
|
|
451
|
+
&-placement-bottomRight {
|
|
452
|
+
.@{prefix-cls}-range-arrow {
|
|
453
|
+
top: (@arrow-size / 2 + 1px);
|
|
454
|
+
transform: rotate(-45deg);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.@{prefix-cls}-range-arrow {
|
|
459
|
+
position: absolute;
|
|
460
|
+
z-index: 1;
|
|
461
|
+
width: @arrow-size;
|
|
462
|
+
height: @arrow-size;
|
|
463
|
+
transition: all 0.3s;
|
|
464
|
+
|
|
465
|
+
&::before,
|
|
466
|
+
&::after {
|
|
467
|
+
position: absolute;
|
|
468
|
+
top: 50%;
|
|
469
|
+
inset-inline-start: 50%;
|
|
470
|
+
box-sizing: border-box;
|
|
471
|
+
transform: translate(-50%, -50%);
|
|
472
|
+
content: '';
|
|
473
|
+
|
|
474
|
+
.@{prefix-cls}-dropdown-rtl& {
|
|
475
|
+
transform: translate(50%, -50%);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
&::before {
|
|
480
|
+
width: @arrow-size;
|
|
481
|
+
height: @arrow-size;
|
|
482
|
+
border: (@arrow-size / 2) solid blue;
|
|
483
|
+
border-color: blue blue transparent transparent;
|
|
484
|
+
}
|
|
485
|
+
&::after {
|
|
486
|
+
width: @arrow-size - 2px;
|
|
487
|
+
height: @arrow-size - 2px;
|
|
488
|
+
border: ((@arrow-size - 2px) / 2) solid blue;
|
|
489
|
+
border-color: @background-color @background-color transparent transparent;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// ========================================================
|
|
495
|
+
// = Range Picker =
|
|
496
|
+
// ========================================================
|
|
497
|
+
&-range {
|
|
498
|
+
position: relative;
|
|
499
|
+
display: inline-flex;
|
|
500
|
+
|
|
501
|
+
&-wrapper {
|
|
502
|
+
display: flex;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.@{prefix-cls}-active-bar {
|
|
506
|
+
bottom: 0;
|
|
507
|
+
height: 3px;
|
|
508
|
+
background: green;
|
|
509
|
+
opacity: 0;
|
|
510
|
+
transition: all 0.3s;
|
|
511
|
+
pointer-events: none;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
&.@{prefix-cls}-focused {
|
|
515
|
+
.@{prefix-cls}-active-bar {
|
|
516
|
+
opacity: 1;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
&-panel-container {
|
|
522
|
+
display: inline-block;
|
|
523
|
+
vertical-align: top;
|
|
524
|
+
transition: margin 0.3s;
|
|
525
|
+
pointer-events: all;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
&-panel-layout {
|
|
529
|
+
display: flex;
|
|
530
|
+
flex-wrap: nowrap;
|
|
531
|
+
align-items: stretch;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// ========================================================
|
|
535
|
+
// = Overflow =
|
|
536
|
+
// ========================================================
|
|
537
|
+
&-selector {
|
|
538
|
+
width: 100%;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
&-selection-overflow {
|
|
542
|
+
display: flex;
|
|
543
|
+
flex-wrap: wrap;
|
|
544
|
+
box-sizing: border-box;
|
|
545
|
+
width: 100%;
|
|
546
|
+
border: 1px solid green;
|
|
547
|
+
min-height: 1em;
|
|
548
|
+
|
|
549
|
+
&-item {
|
|
550
|
+
flex: none;
|
|
551
|
+
max-width: 100%;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
&-selection-item {
|
|
556
|
+
border: 1px solid blue;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
&-selection-placeholder {
|
|
560
|
+
pointer-events: none;
|
|
561
|
+
position: absolute;
|
|
562
|
+
left: 0;
|
|
563
|
+
top: 0;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
&-multiple-input {
|
|
567
|
+
width: 10px;
|
|
568
|
+
opacity: 0.1;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
@@ -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,78 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
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 _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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import useTimeInfo from "../../hooks/useTimeInfo";
|
|
10
|
+
import PickerContext from "../context";
|
|
11
|
+
export default function Footer(props) {
|
|
12
|
+
var mode = props.mode,
|
|
13
|
+
internalMode = props.internalMode,
|
|
14
|
+
renderExtraFooter = props.renderExtraFooter,
|
|
15
|
+
showNow = props.showNow,
|
|
16
|
+
showTime = props.showTime,
|
|
17
|
+
onSubmit = props.onSubmit,
|
|
18
|
+
onNow = props.onNow,
|
|
19
|
+
invalid = props.invalid,
|
|
20
|
+
needConfirm = props.needConfirm,
|
|
21
|
+
generateConfig = props.generateConfig,
|
|
22
|
+
disabledDate = props.disabledDate;
|
|
23
|
+
var _React$useContext = React.useContext(PickerContext),
|
|
24
|
+
prefixCls = _React$useContext.prefixCls,
|
|
25
|
+
locale = _React$useContext.locale,
|
|
26
|
+
_React$useContext$but = _React$useContext.button,
|
|
27
|
+
Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but;
|
|
28
|
+
|
|
29
|
+
// >>> Now
|
|
30
|
+
var now = generateConfig.getNow();
|
|
31
|
+
var _useTimeInfo = useTimeInfo(generateConfig, showTime, now),
|
|
32
|
+
_useTimeInfo2 = _slicedToArray(_useTimeInfo, 1),
|
|
33
|
+
getValidTime = _useTimeInfo2[0];
|
|
34
|
+
|
|
35
|
+
// ======================== Extra =========================
|
|
36
|
+
var extraNode = renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter(mode);
|
|
37
|
+
|
|
38
|
+
// ======================== Ranges ========================
|
|
39
|
+
var nowDisabled = disabledDate(now, {
|
|
40
|
+
type: mode
|
|
41
|
+
});
|
|
42
|
+
var onInternalNow = function onInternalNow() {
|
|
43
|
+
if (!nowDisabled) {
|
|
44
|
+
var validateNow = getValidTime(now);
|
|
45
|
+
onNow(validateNow);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var nowPrefixCls = "".concat(prefixCls, "-now");
|
|
49
|
+
var nowBtnPrefixCls = "".concat(nowPrefixCls, "-btn");
|
|
50
|
+
var presetNode = showNow && /*#__PURE__*/React.createElement("li", {
|
|
51
|
+
className: nowPrefixCls
|
|
52
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
53
|
+
className: classNames(nowBtnPrefixCls, nowDisabled && "".concat(nowBtnPrefixCls, "-disabled")),
|
|
54
|
+
"aria-disabled": nowDisabled,
|
|
55
|
+
onClick: onInternalNow
|
|
56
|
+
}, internalMode === 'date' ? locale.today : locale.now));
|
|
57
|
+
|
|
58
|
+
// >>> OK
|
|
59
|
+
var okNode = needConfirm && /*#__PURE__*/React.createElement("li", {
|
|
60
|
+
className: "".concat(prefixCls, "-ok")
|
|
61
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
62
|
+
disabled: invalid,
|
|
63
|
+
onClick: onSubmit
|
|
64
|
+
}, locale.ok));
|
|
65
|
+
var rangeNode = (presetNode || okNode) && /*#__PURE__*/React.createElement("ul", {
|
|
66
|
+
className: "".concat(prefixCls, "-ranges")
|
|
67
|
+
}, presetNode, okNode);
|
|
68
|
+
|
|
69
|
+
// ======================== Render ========================
|
|
70
|
+
if (!extraNode && !rangeNode) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: "".concat(prefixCls, "-footer")
|
|
75
|
+
}, extraNode && /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "".concat(prefixCls, "-footer-extra")
|
|
77
|
+
}, extraNode), rangeNode);
|
|
78
|
+
}
|
|
@@ -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;
|