@v-c/picker 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/PickerInput/Popup/Footer.cjs +115 -0
- package/dist/PickerInput/Popup/Footer.d.ts +19 -0
- package/dist/PickerInput/Popup/Footer.js +109 -0
- package/dist/PickerInput/Popup/PopupPanel.cjs +413 -0
- package/dist/PickerInput/Popup/PopupPanel.d.ts +11 -0
- package/dist/PickerInput/Popup/PopupPanel.js +407 -0
- package/dist/PickerInput/Popup/PresetPanel.cjs +54 -0
- package/dist/PickerInput/Popup/PresetPanel.d.ts +16 -0
- package/dist/PickerInput/Popup/PresetPanel.js +48 -0
- package/dist/PickerInput/Popup/index.cjs +528 -0
- package/dist/PickerInput/Popup/index.d.ts +37 -0
- package/dist/PickerInput/Popup/index.js +522 -0
- package/dist/PickerInput/RangePicker.cjs +1910 -0
- package/dist/PickerInput/RangePicker.d.ts +57 -0
- package/dist/PickerInput/RangePicker.js +1901 -0
- package/dist/PickerInput/Selector/Icon.cjs +89 -0
- package/dist/PickerInput/Selector/Icon.d.ts +11 -0
- package/dist/PickerInput/Selector/Icon.js +83 -0
- package/dist/PickerInput/Selector/Input.cjs +376 -0
- package/dist/PickerInput/Selector/Input.d.ts +9 -0
- package/dist/PickerInput/Selector/Input.js +370 -0
- package/dist/PickerInput/Selector/MaskFormat.cjs +72 -0
- package/dist/PickerInput/Selector/MaskFormat.d.ts +22 -0
- package/dist/PickerInput/Selector/MaskFormat.js +68 -0
- package/dist/PickerInput/Selector/RangeSelector.cjs +1390 -0
- package/dist/PickerInput/Selector/RangeSelector.d.ts +28 -0
- package/dist/PickerInput/Selector/RangeSelector.js +1383 -0
- package/dist/PickerInput/Selector/SingleSelector/MultipleDates.cjs +110 -0
- package/dist/PickerInput/Selector/SingleSelector/MultipleDates.d.ts +13 -0
- package/dist/PickerInput/Selector/SingleSelector/MultipleDates.js +103 -0
- package/dist/PickerInput/Selector/SingleSelector/index.cjs +1358 -0
- package/dist/PickerInput/Selector/SingleSelector/index.d.ts +21 -0
- package/dist/PickerInput/Selector/SingleSelector/index.js +1352 -0
- package/dist/PickerInput/Selector/hooks/useClearIcon.cjs +17 -0
- package/dist/PickerInput/Selector/hooks/useClearIcon.d.ts +17 -0
- package/dist/PickerInput/Selector/hooks/useClearIcon.js +11 -0
- package/dist/PickerInput/Selector/hooks/useInputHooks.cjs +125 -0
- package/dist/PickerInput/Selector/hooks/useInputHooks.d.ts +56 -0
- package/dist/PickerInput/Selector/hooks/useInputHooks.js +120 -0
- package/dist/PickerInput/Selector/hooks/useRootProps.cjs +14 -0
- package/dist/PickerInput/Selector/hooks/useRootProps.d.ts +2 -0
- package/dist/PickerInput/Selector/hooks/useRootProps.js +9 -0
- package/dist/PickerInput/Selector/util.cjs +32 -0
- package/dist/PickerInput/Selector/util.d.ts +5 -0
- package/dist/PickerInput/Selector/util.js +30 -0
- package/dist/PickerInput/SinglePicker.cjs +1881 -0
- package/dist/PickerInput/SinglePicker.d.ts +46 -0
- package/dist/PickerInput/SinglePicker.js +1873 -0
- package/dist/PickerInput/context.cjs +12 -0
- package/dist/PickerInput/context.d.ts +16 -0
- package/dist/PickerInput/context.js +9 -0
- package/dist/PickerInput/hooks/useCellRender.cjs +25 -0
- package/dist/PickerInput/hooks/useCellRender.d.ts +3 -0
- package/dist/PickerInput/hooks/useCellRender.js +20 -0
- package/dist/PickerInput/hooks/useDelayState.cjs +34 -0
- package/dist/PickerInput/hooks/useDelayState.d.ts +2 -0
- package/dist/PickerInput/hooks/useDelayState.js +29 -0
- package/dist/PickerInput/hooks/useDisabledBoundary.cjs +15 -0
- package/dist/PickerInput/hooks/useDisabledBoundary.d.ts +8 -0
- package/dist/PickerInput/hooks/useDisabledBoundary.js +11 -0
- package/dist/PickerInput/hooks/useFieldFormat.cjs +17 -0
- package/dist/PickerInput/hooks/useFieldFormat.d.ts +3 -0
- package/dist/PickerInput/hooks/useFieldFormat.js +15 -0
- package/dist/PickerInput/hooks/useFieldsInvalidate.cjs +24 -0
- package/dist/PickerInput/hooks/useFieldsInvalidate.d.ts +6 -0
- package/dist/PickerInput/hooks/useFieldsInvalidate.js +19 -0
- package/dist/PickerInput/hooks/useFilledProps.cjs +103 -0
- package/dist/PickerInput/hooks/useFilledProps.d.ts +33 -0
- package/dist/PickerInput/hooks/useFilledProps.js +98 -0
- package/dist/PickerInput/hooks/useInputReadOnly.cjs +13 -0
- package/dist/PickerInput/hooks/useInputReadOnly.d.ts +3 -0
- package/dist/PickerInput/hooks/useInputReadOnly.js +8 -0
- package/dist/PickerInput/hooks/useInvalidate.cjs +34 -0
- package/dist/PickerInput/hooks/useInvalidate.d.ts +10 -0
- package/dist/PickerInput/hooks/useInvalidate.js +30 -0
- package/dist/PickerInput/hooks/useLockEffect.cjs +16 -0
- package/dist/PickerInput/hooks/useLockEffect.d.ts +6 -0
- package/dist/PickerInput/hooks/useLockEffect.js +11 -0
- package/dist/PickerInput/hooks/useOpen.cjs +15 -0
- package/dist/PickerInput/hooks/useOpen.d.ts +7 -0
- package/dist/PickerInput/hooks/useOpen.js +10 -0
- package/dist/PickerInput/hooks/usePresets.cjs +21 -0
- package/dist/PickerInput/hooks/usePresets.d.ts +3 -0
- package/dist/PickerInput/hooks/usePresets.js +16 -0
- package/dist/PickerInput/hooks/useRangeActive.cjs +57 -0
- package/dist/PickerInput/hooks/useRangeActive.d.ts +9 -0
- package/dist/PickerInput/hooks/useRangeActive.js +52 -0
- package/dist/PickerInput/hooks/useRangeDisabledDate.cjs +21 -0
- package/dist/PickerInput/hooks/useRangeDisabledDate.d.ts +9 -0
- package/dist/PickerInput/hooks/useRangeDisabledDate.js +17 -0
- package/dist/PickerInput/hooks/useRangePickerValue.cjs +100 -0
- package/dist/PickerInput/hooks/useRangePickerValue.d.ts +5 -0
- package/dist/PickerInput/hooks/useRangePickerValue.js +94 -0
- package/dist/PickerInput/hooks/useRangeValue.cjs +134 -0
- package/dist/PickerInput/hooks/useRangeValue.d.ts +21 -0
- package/dist/PickerInput/hooks/useRangeValue.js +128 -0
- package/dist/PickerInput/hooks/useShowNow.cjs +15 -0
- package/dist/PickerInput/hooks/useShowNow.d.ts +3 -0
- package/dist/PickerInput/hooks/useShowNow.js +10 -0
- package/dist/PickerPanel/DatePanel/index.cjs +294 -0
- package/dist/PickerPanel/DatePanel/index.d.ts +9 -0
- package/dist/PickerPanel/DatePanel/index.js +288 -0
- package/dist/PickerPanel/DateTimePanel/index.cjs +180 -0
- package/dist/PickerPanel/DateTimePanel/index.d.ts +3 -0
- package/dist/PickerPanel/DateTimePanel/index.js +174 -0
- package/dist/PickerPanel/DecadePanel/index.cjs +230 -0
- package/dist/PickerPanel/DecadePanel/index.d.ts +3 -0
- package/dist/PickerPanel/DecadePanel/index.js +224 -0
- package/dist/PickerPanel/MonthPanel/index.cjs +219 -0
- package/dist/PickerPanel/MonthPanel/index.d.ts +3 -0
- package/dist/PickerPanel/MonthPanel/index.js +213 -0
- package/dist/PickerPanel/PanelBody.cjs +157 -0
- package/dist/PickerPanel/PanelBody.d.ts +17 -0
- package/dist/PickerPanel/PanelBody.js +151 -0
- package/dist/PickerPanel/PanelHeader.cjs +132 -0
- package/dist/PickerPanel/PanelHeader.d.ts +9 -0
- package/dist/PickerPanel/PanelHeader.js +126 -0
- package/dist/PickerPanel/QuarterPanel/index.cjs +211 -0
- package/dist/PickerPanel/QuarterPanel/index.d.ts +3 -0
- package/dist/PickerPanel/QuarterPanel/index.js +205 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.cjs +145 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.d.ts +17 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +139 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/index.cjs +286 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/index.d.ts +3 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/index.js +280 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.cjs +65 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.d.ts +1 -0
- package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js +60 -0
- package/dist/PickerPanel/TimePanel/index.cjs +173 -0
- package/dist/PickerPanel/TimePanel/index.d.ts +3 -0
- package/dist/PickerPanel/TimePanel/index.js +167 -0
- package/dist/PickerPanel/WeekPanel/index.cjs +179 -0
- package/dist/PickerPanel/WeekPanel/index.d.ts +3 -0
- package/dist/PickerPanel/WeekPanel/index.js +173 -0
- package/dist/PickerPanel/YearPanel/index.cjs +239 -0
- package/dist/PickerPanel/YearPanel/index.d.ts +3 -0
- package/dist/PickerPanel/YearPanel/index.js +233 -0
- package/dist/PickerPanel/context.cjs +61 -0
- package/dist/PickerPanel/context.d.ts +26 -0
- package/dist/PickerPanel/context.js +53 -0
- package/dist/PickerPanel/index.cjs +473 -0
- package/dist/PickerPanel/index.d.ts +65 -0
- package/dist/PickerPanel/index.js +467 -0
- package/dist/PickerTrigger/index.cjs +137 -0
- package/dist/PickerTrigger/index.d.ts +18 -0
- package/dist/PickerTrigger/index.js +130 -0
- package/dist/PickerTrigger/util.cjs +13 -0
- package/dist/PickerTrigger/util.d.ts +2 -0
- package/dist/PickerTrigger/util.js +12 -0
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/generate/dateFns.cjs +80 -0
- package/dist/generate/dateFns.d.ts +3 -0
- package/dist/generate/dateFns.js +73 -0
- package/dist/generate/dayjs.cjs +117 -0
- package/dist/generate/dayjs.d.ts +4 -0
- package/dist/generate/dayjs.js +104 -0
- package/dist/generate/index.cjs +1 -0
- package/dist/generate/index.d.ts +37 -0
- package/dist/generate/index.js +0 -0
- package/dist/generate/luxon.cjs +75 -0
- package/dist/generate/luxon.d.ts +4 -0
- package/dist/generate/luxon.js +69 -0
- package/dist/generate/moment.cjs +107 -0
- package/dist/generate/moment.d.ts +4 -0
- package/dist/generate/moment.js +100 -0
- package/dist/hooks/useLocale.cjs +45 -0
- package/dist/hooks/useLocale.d.ts +9 -0
- package/dist/hooks/useLocale.js +39 -0
- package/dist/hooks/useSemantic.cjs +18 -0
- package/dist/hooks/useSemantic.d.ts +14 -0
- package/dist/hooks/useSemantic.js +13 -0
- package/dist/hooks/useSyncState.cjs +29 -0
- package/dist/hooks/useSyncState.d.ts +7 -0
- package/dist/hooks/useSyncState.js +24 -0
- package/dist/hooks/useTimeConfig.cjs +161 -0
- package/dist/hooks/useTimeConfig.d.ts +18 -0
- package/dist/hooks/useTimeConfig.js +159 -0
- package/dist/hooks/useTimeInfo.cjs +113 -0
- package/dist/hooks/useTimeInfo.d.ts +12 -0
- package/dist/hooks/useTimeInfo.js +108 -0
- package/dist/hooks/useToggleDates.cjs +16 -0
- package/dist/hooks/useToggleDates.d.ts +9 -0
- package/dist/hooks/useToggleDates.js +12 -0
- package/dist/index.cjs +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +5 -0
- package/dist/interface.cjs +1 -0
- package/dist/interface.d.ts +379 -0
- package/dist/interface.js +0 -0
- package/dist/locale/am_ET.cjs +34 -0
- package/dist/locale/am_ET.d.ts +3 -0
- package/dist/locale/am_ET.js +29 -0
- package/dist/locale/ar_EG.cjs +32 -0
- package/dist/locale/ar_EG.d.ts +3 -0
- package/dist/locale/ar_EG.js +27 -0
- package/dist/locale/az_AZ.cjs +33 -0
- package/dist/locale/az_AZ.d.ts +3 -0
- package/dist/locale/az_AZ.js +28 -0
- package/dist/locale/bg_BG.cjs +32 -0
- package/dist/locale/bg_BG.d.ts +3 -0
- package/dist/locale/bg_BG.js +27 -0
- package/dist/locale/bn_BD.cjs +33 -0
- package/dist/locale/bn_BD.d.ts +3 -0
- package/dist/locale/bn_BD.js +28 -0
- package/dist/locale/by_BY.cjs +33 -0
- package/dist/locale/by_BY.d.ts +3 -0
- package/dist/locale/by_BY.js +28 -0
- package/dist/locale/ca_ES.cjs +32 -0
- package/dist/locale/ca_ES.d.ts +3 -0
- package/dist/locale/ca_ES.js +27 -0
- package/dist/locale/common.cjs +8 -0
- package/dist/locale/common.d.ts +2 -0
- package/dist/locale/common.js +7 -0
- package/dist/locale/cs_CZ.cjs +32 -0
- package/dist/locale/cs_CZ.d.ts +3 -0
- package/dist/locale/cs_CZ.js +27 -0
- package/dist/locale/da_DK.cjs +32 -0
- package/dist/locale/da_DK.d.ts +3 -0
- package/dist/locale/da_DK.js +27 -0
- package/dist/locale/de_DE.cjs +32 -0
- package/dist/locale/de_DE.d.ts +3 -0
- package/dist/locale/de_DE.js +27 -0
- package/dist/locale/el_GR.cjs +32 -0
- package/dist/locale/el_GR.d.ts +3 -0
- package/dist/locale/el_GR.js +27 -0
- package/dist/locale/en_GB.cjs +32 -0
- package/dist/locale/en_GB.d.ts +3 -0
- package/dist/locale/en_GB.js +27 -0
- package/dist/locale/en_US.cjs +33 -0
- package/dist/locale/en_US.d.ts +3 -0
- package/dist/locale/en_US.js +28 -0
- package/dist/locale/es_ES.cjs +32 -0
- package/dist/locale/es_ES.d.ts +3 -0
- package/dist/locale/es_ES.js +27 -0
- package/dist/locale/es_MX.cjs +33 -0
- package/dist/locale/es_MX.d.ts +3 -0
- package/dist/locale/es_MX.js +28 -0
- package/dist/locale/et_EE.cjs +32 -0
- package/dist/locale/et_EE.d.ts +3 -0
- package/dist/locale/et_EE.js +27 -0
- package/dist/locale/eu_ES.cjs +34 -0
- package/dist/locale/eu_ES.d.ts +3 -0
- package/dist/locale/eu_ES.js +29 -0
- package/dist/locale/fa_IR.cjs +32 -0
- package/dist/locale/fa_IR.d.ts +3 -0
- package/dist/locale/fa_IR.js +27 -0
- package/dist/locale/fi_FI.cjs +32 -0
- package/dist/locale/fi_FI.d.ts +3 -0
- package/dist/locale/fi_FI.js +27 -0
- package/dist/locale/fr_BE.cjs +32 -0
- package/dist/locale/fr_BE.d.ts +3 -0
- package/dist/locale/fr_BE.js +27 -0
- package/dist/locale/fr_CA.cjs +33 -0
- package/dist/locale/fr_CA.d.ts +3 -0
- package/dist/locale/fr_CA.js +28 -0
- package/dist/locale/fr_FR.cjs +33 -0
- package/dist/locale/fr_FR.d.ts +3 -0
- package/dist/locale/fr_FR.js +28 -0
- package/dist/locale/ga_IE.cjs +33 -0
- package/dist/locale/ga_IE.d.ts +3 -0
- package/dist/locale/ga_IE.js +28 -0
- package/dist/locale/gl_ES.cjs +32 -0
- package/dist/locale/gl_ES.d.ts +3 -0
- package/dist/locale/gl_ES.js +27 -0
- package/dist/locale/he_IL.cjs +33 -0
- package/dist/locale/he_IL.d.ts +3 -0
- package/dist/locale/he_IL.js +28 -0
- package/dist/locale/hi_IN.cjs +33 -0
- package/dist/locale/hi_IN.d.ts +3 -0
- package/dist/locale/hi_IN.js +28 -0
- package/dist/locale/hr_HR.cjs +33 -0
- package/dist/locale/hr_HR.d.ts +3 -0
- package/dist/locale/hr_HR.js +28 -0
- package/dist/locale/hu_HU.cjs +33 -0
- package/dist/locale/hu_HU.d.ts +3 -0
- package/dist/locale/hu_HU.js +28 -0
- package/dist/locale/id_ID.cjs +33 -0
- package/dist/locale/id_ID.d.ts +3 -0
- package/dist/locale/id_ID.js +28 -0
- package/dist/locale/is_IS.cjs +32 -0
- package/dist/locale/is_IS.d.ts +3 -0
- package/dist/locale/is_IS.js +27 -0
- package/dist/locale/it_IT.cjs +55 -0
- package/dist/locale/it_IT.d.ts +3 -0
- package/dist/locale/it_IT.js +50 -0
- package/dist/locale/ja_JP.cjs +35 -0
- package/dist/locale/ja_JP.d.ts +3 -0
- package/dist/locale/ja_JP.js +30 -0
- package/dist/locale/ka_GE.cjs +33 -0
- package/dist/locale/ka_GE.d.ts +3 -0
- package/dist/locale/ka_GE.js +28 -0
- package/dist/locale/kk_KZ.cjs +32 -0
- package/dist/locale/kk_KZ.d.ts +3 -0
- package/dist/locale/kk_KZ.js +27 -0
- package/dist/locale/km_KH.cjs +34 -0
- package/dist/locale/km_KH.d.ts +3 -0
- package/dist/locale/km_KH.js +29 -0
- package/dist/locale/kmr_IQ.cjs +32 -0
- package/dist/locale/kmr_IQ.d.ts +3 -0
- package/dist/locale/kmr_IQ.js +27 -0
- package/dist/locale/kn_IN.cjs +33 -0
- package/dist/locale/kn_IN.d.ts +3 -0
- package/dist/locale/kn_IN.js +28 -0
- package/dist/locale/ko_KR.cjs +34 -0
- package/dist/locale/ko_KR.d.ts +3 -0
- package/dist/locale/ko_KR.js +29 -0
- package/dist/locale/lt_LT.cjs +34 -0
- package/dist/locale/lt_LT.d.ts +3 -0
- package/dist/locale/lt_LT.js +29 -0
- package/dist/locale/lv_LV.cjs +32 -0
- package/dist/locale/lv_LV.d.ts +3 -0
- package/dist/locale/lv_LV.js +27 -0
- package/dist/locale/mk_MK.cjs +32 -0
- package/dist/locale/mk_MK.d.ts +3 -0
- package/dist/locale/mk_MK.js +27 -0
- package/dist/locale/ml_IN.cjs +33 -0
- package/dist/locale/ml_IN.d.ts +3 -0
- package/dist/locale/ml_IN.js +28 -0
- package/dist/locale/mn_MN.cjs +34 -0
- package/dist/locale/mn_MN.d.ts +3 -0
- package/dist/locale/mn_MN.js +29 -0
- package/dist/locale/mr_IN.cjs +59 -0
- package/dist/locale/mr_IN.d.ts +3 -0
- package/dist/locale/mr_IN.js +54 -0
- package/dist/locale/ms_MY.cjs +34 -0
- package/dist/locale/ms_MY.d.ts +3 -0
- package/dist/locale/ms_MY.js +29 -0
- package/dist/locale/my_MM.cjs +33 -0
- package/dist/locale/my_MM.d.ts +3 -0
- package/dist/locale/my_MM.js +28 -0
- package/dist/locale/nb_NO.cjs +34 -0
- package/dist/locale/nb_NO.d.ts +3 -0
- package/dist/locale/nb_NO.js +29 -0
- package/dist/locale/ne_NP.cjs +33 -0
- package/dist/locale/ne_NP.d.ts +3 -0
- package/dist/locale/ne_NP.js +28 -0
- package/dist/locale/nl_BE.cjs +32 -0
- package/dist/locale/nl_BE.d.ts +3 -0
- package/dist/locale/nl_BE.js +27 -0
- package/dist/locale/nl_NL.cjs +32 -0
- package/dist/locale/nl_NL.d.ts +3 -0
- package/dist/locale/nl_NL.js +27 -0
- package/dist/locale/pl_PL.cjs +32 -0
- package/dist/locale/pl_PL.d.ts +3 -0
- package/dist/locale/pl_PL.js +27 -0
- package/dist/locale/pt_BR.cjs +56 -0
- package/dist/locale/pt_BR.d.ts +3 -0
- package/dist/locale/pt_BR.js +51 -0
- package/dist/locale/pt_PT.cjs +55 -0
- package/dist/locale/pt_PT.d.ts +3 -0
- package/dist/locale/pt_PT.js +50 -0
- package/dist/locale/ro_RO.cjs +33 -0
- package/dist/locale/ro_RO.d.ts +3 -0
- package/dist/locale/ro_RO.js +28 -0
- package/dist/locale/ru_RU.cjs +32 -0
- package/dist/locale/ru_RU.d.ts +3 -0
- package/dist/locale/ru_RU.js +27 -0
- package/dist/locale/si_LK.cjs +34 -0
- package/dist/locale/si_LK.d.ts +3 -0
- package/dist/locale/si_LK.js +29 -0
- package/dist/locale/sk_SK.cjs +32 -0
- package/dist/locale/sk_SK.d.ts +3 -0
- package/dist/locale/sk_SK.js +27 -0
- package/dist/locale/sl_SI.cjs +32 -0
- package/dist/locale/sl_SI.d.ts +3 -0
- package/dist/locale/sl_SI.js +27 -0
- package/dist/locale/sr_Cyrl_RS.cjs +32 -0
- package/dist/locale/sr_Cyrl_RS.d.ts +3 -0
- package/dist/locale/sr_Cyrl_RS.js +27 -0
- package/dist/locale/sr_RS.cjs +32 -0
- package/dist/locale/sr_RS.d.ts +3 -0
- package/dist/locale/sr_RS.js +27 -0
- package/dist/locale/sv_SE.cjs +32 -0
- package/dist/locale/sv_SE.d.ts +3 -0
- package/dist/locale/sv_SE.js +27 -0
- package/dist/locale/ta_IN.cjs +33 -0
- package/dist/locale/ta_IN.d.ts +3 -0
- package/dist/locale/ta_IN.js +28 -0
- package/dist/locale/te_IN.cjs +33 -0
- package/dist/locale/te_IN.d.ts +3 -0
- package/dist/locale/te_IN.js +28 -0
- package/dist/locale/th_TH.cjs +32 -0
- package/dist/locale/th_TH.d.ts +3 -0
- package/dist/locale/th_TH.js +27 -0
- package/dist/locale/tk_TK.cjs +32 -0
- package/dist/locale/tk_TK.d.ts +3 -0
- package/dist/locale/tk_TK.js +27 -0
- package/dist/locale/tr_TR.cjs +55 -0
- package/dist/locale/tr_TR.d.ts +3 -0
- package/dist/locale/tr_TR.js +50 -0
- package/dist/locale/ug_CN.cjs +35 -0
- package/dist/locale/ug_CN.d.ts +3 -0
- package/dist/locale/ug_CN.js +30 -0
- package/dist/locale/uk_UA.cjs +32 -0
- package/dist/locale/uk_UA.d.ts +3 -0
- package/dist/locale/uk_UA.js +27 -0
- package/dist/locale/ur_PK.cjs +33 -0
- package/dist/locale/ur_PK.d.ts +3 -0
- package/dist/locale/ur_PK.js +28 -0
- package/dist/locale/uz_UZ.cjs +33 -0
- package/dist/locale/uz_UZ.d.ts +3 -0
- package/dist/locale/uz_UZ.js +28 -0
- package/dist/locale/vi_VN.cjs +33 -0
- package/dist/locale/vi_VN.d.ts +3 -0
- package/dist/locale/vi_VN.js +28 -0
- package/dist/locale/zh_CN.cjs +36 -0
- package/dist/locale/zh_CN.d.ts +3 -0
- package/dist/locale/zh_CN.js +31 -0
- package/dist/locale/zh_TW.cjs +36 -0
- package/dist/locale/zh_TW.d.ts +3 -0
- package/dist/locale/zh_TW.js +31 -0
- package/dist/utils/dateUtil.cjs +105 -0
- package/dist/utils/dateUtil.d.ts +29 -0
- package/dist/utils/dateUtil.js +89 -0
- package/dist/utils/getClearIcon.cjs +7 -0
- package/dist/utils/getClearIcon.d.ts +6 -0
- package/dist/utils/getClearIcon.js +5 -0
- package/dist/utils/miscUtil.cjs +46 -0
- package/dist/utils/miscUtil.d.ts +14 -0
- package/dist/utils/miscUtil.js +40 -0
- package/dist/utils/uiUtil.cjs +6 -0
- package/dist/utils/uiUtil.d.ts +1 -0
- package/dist/utils/uiUtil.js +5 -0
- package/dist/utils/warnUtil.cjs +8 -0
- package/dist/utils/warnUtil.d.ts +5 -0
- package/dist/utils/warnUtil.js +6 -0
- package/package.json +82 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { usePanelContext } from "../../context.js";
|
|
2
|
+
import useScrollTo from "./useScrollTo.js";
|
|
3
|
+
import { computed, createVNode, defineComponent, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
4
|
+
import { clsx } from "@v-c/util";
|
|
5
|
+
var SCROLL_DELAY = 300;
|
|
6
|
+
function flattenUnits(units) {
|
|
7
|
+
return units.map(({ value, label, disabled }) => [
|
|
8
|
+
value,
|
|
9
|
+
label,
|
|
10
|
+
disabled
|
|
11
|
+
].join(",")).join(";");
|
|
12
|
+
}
|
|
13
|
+
var TimeColumn_default = /* @__PURE__ */ defineComponent((props) => {
|
|
14
|
+
const context = usePanelContext();
|
|
15
|
+
const ulRef = ref();
|
|
16
|
+
const checkDelayRef = ref();
|
|
17
|
+
const clearDelayCheck = () => {
|
|
18
|
+
clearTimeout(checkDelayRef.value);
|
|
19
|
+
};
|
|
20
|
+
const [syncScroll, stopScroll, isScrolling] = useScrollTo(ulRef, computed(() => props.value ?? props.optionalValue));
|
|
21
|
+
watch([
|
|
22
|
+
() => props.value,
|
|
23
|
+
() => props.optionalValue,
|
|
24
|
+
() => flattenUnits(props.units)
|
|
25
|
+
], () => {
|
|
26
|
+
syncScroll();
|
|
27
|
+
clearDelayCheck();
|
|
28
|
+
}, { flush: "post" });
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
syncScroll();
|
|
31
|
+
});
|
|
32
|
+
onBeforeUnmount(() => {
|
|
33
|
+
stopScroll();
|
|
34
|
+
clearDelayCheck();
|
|
35
|
+
});
|
|
36
|
+
const onInternalScroll = (event) => {
|
|
37
|
+
clearDelayCheck();
|
|
38
|
+
const target = event.target;
|
|
39
|
+
if (!isScrolling() && props.changeOnScroll) checkDelayRef.value = setTimeout(() => {
|
|
40
|
+
const ul = ulRef.value;
|
|
41
|
+
const firstLiTop = ul.querySelector(`li`).offsetTop;
|
|
42
|
+
const liDistList = Array.from(ul.querySelectorAll(`li`)).map((li) => li.offsetTop - firstLiTop).map((top, index) => {
|
|
43
|
+
if (props.units[index].disabled) return Number.MAX_SAFE_INTEGER;
|
|
44
|
+
return Math.abs(top - target.scrollTop);
|
|
45
|
+
});
|
|
46
|
+
const minDist = Math.min(...liDistList);
|
|
47
|
+
const minDistIndex = liDistList.findIndex((dist) => dist === minDist);
|
|
48
|
+
const targetUnit = props.units[minDistIndex];
|
|
49
|
+
if (targetUnit && !targetUnit.disabled) props.onChange(targetUnit.value);
|
|
50
|
+
}, SCROLL_DELAY);
|
|
51
|
+
};
|
|
52
|
+
return () => {
|
|
53
|
+
const { units, value, type, onChange, onHover, onDblClick } = props;
|
|
54
|
+
const { prefixCls, cellRender, now, locale, classNames: panelClassNames, styles } = context.value;
|
|
55
|
+
const panelPrefixCls = `${prefixCls}-time-panel`;
|
|
56
|
+
const cellPrefixCls = `${prefixCls}-time-panel-cell`;
|
|
57
|
+
const columnPrefixCls = `${panelPrefixCls}-column`;
|
|
58
|
+
return createVNode("ul", {
|
|
59
|
+
"class": columnPrefixCls,
|
|
60
|
+
"ref": ulRef,
|
|
61
|
+
"data-type": type,
|
|
62
|
+
"onScroll": onInternalScroll
|
|
63
|
+
}, [units.map(({ label, value: unitValue, disabled }) => {
|
|
64
|
+
const inner = createVNode("div", { "class": `${cellPrefixCls}-inner` }, [label]);
|
|
65
|
+
return createVNode("li", {
|
|
66
|
+
"key": unitValue,
|
|
67
|
+
"style": styles?.item,
|
|
68
|
+
"class": clsx(cellPrefixCls, panelClassNames?.item, {
|
|
69
|
+
[`${cellPrefixCls}-selected`]: value === unitValue,
|
|
70
|
+
[`${cellPrefixCls}-disabled`]: disabled
|
|
71
|
+
}),
|
|
72
|
+
"onClick": () => {
|
|
73
|
+
if (!disabled) onChange(unitValue);
|
|
74
|
+
},
|
|
75
|
+
"onDblclick": () => {
|
|
76
|
+
if (!disabled && onDblClick) onDblClick();
|
|
77
|
+
},
|
|
78
|
+
"onMouseenter": () => {
|
|
79
|
+
onHover(unitValue);
|
|
80
|
+
},
|
|
81
|
+
"onMouseleave": () => {
|
|
82
|
+
onHover(null);
|
|
83
|
+
},
|
|
84
|
+
"data-value": unitValue
|
|
85
|
+
}, [cellRender ? cellRender(unitValue, {
|
|
86
|
+
prefixCls,
|
|
87
|
+
originNode: inner,
|
|
88
|
+
today: now,
|
|
89
|
+
type: "time",
|
|
90
|
+
subType: type,
|
|
91
|
+
locale
|
|
92
|
+
}) : inner]);
|
|
93
|
+
})]);
|
|
94
|
+
};
|
|
95
|
+
}, {
|
|
96
|
+
props: {
|
|
97
|
+
units: {
|
|
98
|
+
type: Array,
|
|
99
|
+
required: true,
|
|
100
|
+
default: void 0
|
|
101
|
+
},
|
|
102
|
+
value: {
|
|
103
|
+
type: [Number, String],
|
|
104
|
+
required: false,
|
|
105
|
+
default: void 0
|
|
106
|
+
},
|
|
107
|
+
optionalValue: {
|
|
108
|
+
type: [Number, String],
|
|
109
|
+
required: false,
|
|
110
|
+
default: void 0
|
|
111
|
+
},
|
|
112
|
+
type: {
|
|
113
|
+
type: String,
|
|
114
|
+
required: true,
|
|
115
|
+
default: void 0
|
|
116
|
+
},
|
|
117
|
+
onChange: {
|
|
118
|
+
type: Function,
|
|
119
|
+
required: true,
|
|
120
|
+
default: void 0
|
|
121
|
+
},
|
|
122
|
+
onHover: {
|
|
123
|
+
type: Function,
|
|
124
|
+
required: true,
|
|
125
|
+
default: void 0
|
|
126
|
+
},
|
|
127
|
+
onDblClick: {
|
|
128
|
+
required: false,
|
|
129
|
+
default: void 0
|
|
130
|
+
},
|
|
131
|
+
changeOnScroll: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
required: false,
|
|
134
|
+
default: void 0
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
name: "TimeColumn"
|
|
138
|
+
});
|
|
139
|
+
export { TimeColumn_default as default };
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_rolldown_runtime = require("../../../_virtual/rolldown_runtime.cjs");
|
|
6
|
+
const require_dateUtil = require("../../../utils/dateUtil.cjs");
|
|
7
|
+
const require_useTimeInfo = require("../../../hooks/useTimeInfo.cjs");
|
|
8
|
+
const require_context = require("../../context.cjs");
|
|
9
|
+
const require_TimeColumn = require("./TimeColumn.cjs");
|
|
10
|
+
let vue = require("vue");
|
|
11
|
+
let _v_c_util = require("@v-c/util");
|
|
12
|
+
function isAM(hour) {
|
|
13
|
+
return hour < 12;
|
|
14
|
+
}
|
|
15
|
+
var TimePanelBody = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
|
|
16
|
+
const context = require_context.usePanelContext();
|
|
17
|
+
const pickerHackContext = require_context.usePickerHackContext();
|
|
18
|
+
const value = (0, vue.computed)(() => context.value.values?.[0] || null);
|
|
19
|
+
const generateConfig = (0, vue.computed)(() => context.value.generateConfig);
|
|
20
|
+
const [getValidTime, rowHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits] = require_useTimeInfo.default(generateConfig, (0, vue.computed)(() => props), value);
|
|
21
|
+
const getUnitValue = (func) => {
|
|
22
|
+
const val = value.value;
|
|
23
|
+
const pickerVal = context.value.pickerValue;
|
|
24
|
+
return [val && generateConfig.value[func](val), pickerVal && generateConfig.value[func](pickerVal)];
|
|
25
|
+
};
|
|
26
|
+
return () => {
|
|
27
|
+
const { prefixCls, classNames: panelClassNames, styles, locale, onSelect, onHover } = context.value;
|
|
28
|
+
const { showHour, showMinute, showSecond, showMillisecond, use12Hours: showMeridiem, changeOnScroll } = props;
|
|
29
|
+
const { onCellDblClick } = pickerHackContext?.value || {};
|
|
30
|
+
const [hour, pickerHour] = getUnitValue("getHour");
|
|
31
|
+
const [minute, pickerMinute] = getUnitValue("getMinute");
|
|
32
|
+
const [second, pickerSecond] = getUnitValue("getSecond");
|
|
33
|
+
const [millisecond, pickerMillisecond] = getUnitValue("getMillisecond");
|
|
34
|
+
const meridiem = hour === null ? null : isAM(hour) ? "am" : "pm";
|
|
35
|
+
const hourUnits = (() => {
|
|
36
|
+
if (!showMeridiem) return rowHourUnits.value;
|
|
37
|
+
return isAM(hour) ? rowHourUnits.value.filter((h) => isAM(h.value)) : rowHourUnits.value.filter((h) => !isAM(h.value));
|
|
38
|
+
})();
|
|
39
|
+
const getEnabled = (units, val) => {
|
|
40
|
+
const enabledUnits = units.filter((unit) => !unit.disabled);
|
|
41
|
+
return val ?? enabledUnits?.[0]?.value;
|
|
42
|
+
};
|
|
43
|
+
const validHour = getEnabled(rowHourUnits.value, hour);
|
|
44
|
+
const minuteUnits = getMinuteUnits(validHour);
|
|
45
|
+
const validMinute = getEnabled(minuteUnits, minute);
|
|
46
|
+
const secondUnits = getSecondUnits(validHour, validMinute);
|
|
47
|
+
const validSecond = getEnabled(secondUnits, second);
|
|
48
|
+
const millisecondUnits = getMillisecondUnits(validHour, validMinute, validSecond);
|
|
49
|
+
const validMillisecond = getEnabled(millisecondUnits, millisecond);
|
|
50
|
+
const meridiemUnits = (() => {
|
|
51
|
+
if (!showMeridiem) return [];
|
|
52
|
+
const base = generateConfig.value.getNow();
|
|
53
|
+
const amDate = generateConfig.value.setHour(base, 6);
|
|
54
|
+
const pmDate = generateConfig.value.setHour(base, 18);
|
|
55
|
+
const formatMeridiem = (date, defaultLabel) => {
|
|
56
|
+
const { cellMeridiemFormat } = locale ?? {};
|
|
57
|
+
return cellMeridiemFormat ? require_dateUtil.formatValue(date, {
|
|
58
|
+
generateConfig: generateConfig.value,
|
|
59
|
+
locale,
|
|
60
|
+
format: cellMeridiemFormat
|
|
61
|
+
}) : defaultLabel;
|
|
62
|
+
};
|
|
63
|
+
return [{
|
|
64
|
+
label: formatMeridiem(amDate, "AM"),
|
|
65
|
+
value: "am",
|
|
66
|
+
disabled: rowHourUnits.value.every((h) => h.disabled || !isAM(h.value))
|
|
67
|
+
}, {
|
|
68
|
+
label: formatMeridiem(pmDate, "PM"),
|
|
69
|
+
value: "pm",
|
|
70
|
+
disabled: rowHourUnits.value.every((h) => h.disabled || isAM(h.value))
|
|
71
|
+
}];
|
|
72
|
+
})();
|
|
73
|
+
const triggerChange = (nextDate) => {
|
|
74
|
+
onSelect(getValidTime(nextDate));
|
|
75
|
+
};
|
|
76
|
+
const triggerDateTmpl = (() => {
|
|
77
|
+
let tmpl = value.value || context.value.pickerValue || generateConfig.value.getNow();
|
|
78
|
+
const isNotNull = (num) => num !== null && num !== void 0;
|
|
79
|
+
if (isNotNull(hour)) {
|
|
80
|
+
tmpl = generateConfig.value.setHour(tmpl, hour);
|
|
81
|
+
tmpl = generateConfig.value.setMinute(tmpl, minute);
|
|
82
|
+
tmpl = generateConfig.value.setSecond(tmpl, second);
|
|
83
|
+
tmpl = generateConfig.value.setMillisecond(tmpl, millisecond);
|
|
84
|
+
} else if (isNotNull(pickerHour)) {
|
|
85
|
+
tmpl = generateConfig.value.setHour(tmpl, pickerHour);
|
|
86
|
+
tmpl = generateConfig.value.setMinute(tmpl, pickerMinute);
|
|
87
|
+
tmpl = generateConfig.value.setSecond(tmpl, pickerSecond);
|
|
88
|
+
tmpl = generateConfig.value.setMillisecond(tmpl, pickerMillisecond);
|
|
89
|
+
} else if (isNotNull(validHour)) {
|
|
90
|
+
tmpl = generateConfig.value.setHour(tmpl, validHour);
|
|
91
|
+
tmpl = generateConfig.value.setMinute(tmpl, validMinute);
|
|
92
|
+
tmpl = generateConfig.value.setSecond(tmpl, validSecond);
|
|
93
|
+
tmpl = generateConfig.value.setMillisecond(tmpl, validMillisecond);
|
|
94
|
+
}
|
|
95
|
+
return tmpl;
|
|
96
|
+
})();
|
|
97
|
+
const fillColumnValue = (val, func) => {
|
|
98
|
+
if (val === null) return null;
|
|
99
|
+
return generateConfig.value[func](triggerDateTmpl, val);
|
|
100
|
+
};
|
|
101
|
+
const getNextHourTime = (val) => fillColumnValue(val, "setHour");
|
|
102
|
+
const getNextMinuteTime = (val) => fillColumnValue(val, "setMinute");
|
|
103
|
+
const getNextSecondTime = (val) => fillColumnValue(val, "setSecond");
|
|
104
|
+
const getNextMillisecondTime = (val) => fillColumnValue(val, "setMillisecond");
|
|
105
|
+
const getMeridiemTime = (val) => {
|
|
106
|
+
if (val === null) return null;
|
|
107
|
+
if (val === "am" && !isAM(hour)) return generateConfig.value.setHour(triggerDateTmpl, hour - 12);
|
|
108
|
+
else if (val === "pm" && isAM(hour)) return generateConfig.value.setHour(triggerDateTmpl, hour + 12);
|
|
109
|
+
return triggerDateTmpl;
|
|
110
|
+
};
|
|
111
|
+
const onHourChange = (val) => {
|
|
112
|
+
triggerChange(getNextHourTime(val));
|
|
113
|
+
};
|
|
114
|
+
const onMinuteChange = (val) => {
|
|
115
|
+
triggerChange(getNextMinuteTime(val));
|
|
116
|
+
};
|
|
117
|
+
const onSecondChange = (val) => {
|
|
118
|
+
triggerChange(getNextSecondTime(val));
|
|
119
|
+
};
|
|
120
|
+
const onMillisecondChange = (val) => {
|
|
121
|
+
triggerChange(getNextMillisecondTime(val));
|
|
122
|
+
};
|
|
123
|
+
const onMeridiemChange = (val) => {
|
|
124
|
+
triggerChange(getMeridiemTime(val));
|
|
125
|
+
};
|
|
126
|
+
const onHourHover = (val) => {
|
|
127
|
+
onHover?.(getNextHourTime(val));
|
|
128
|
+
};
|
|
129
|
+
const onMinuteHover = (val) => {
|
|
130
|
+
onHover?.(getNextMinuteTime(val));
|
|
131
|
+
};
|
|
132
|
+
const onSecondHover = (val) => {
|
|
133
|
+
onHover?.(getNextSecondTime(val));
|
|
134
|
+
};
|
|
135
|
+
const onMillisecondHover = (val) => {
|
|
136
|
+
onHover?.(getNextMillisecondTime(val));
|
|
137
|
+
};
|
|
138
|
+
const onMeridiemHover = (val) => {
|
|
139
|
+
onHover?.(getMeridiemTime(val));
|
|
140
|
+
};
|
|
141
|
+
const sharedColumnProps = {
|
|
142
|
+
onDblClick: onCellDblClick,
|
|
143
|
+
changeOnScroll
|
|
144
|
+
};
|
|
145
|
+
return (0, vue.createVNode)("div", {
|
|
146
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-content`, panelClassNames?.content),
|
|
147
|
+
"style": styles?.content
|
|
148
|
+
}, [
|
|
149
|
+
showHour && (0, vue.createVNode)(require_TimeColumn.default, (0, vue.mergeProps)({
|
|
150
|
+
"units": hourUnits,
|
|
151
|
+
"value": hour,
|
|
152
|
+
"optionalValue": pickerHour,
|
|
153
|
+
"type": "hour",
|
|
154
|
+
"onChange": onHourChange,
|
|
155
|
+
"onHover": onHourHover
|
|
156
|
+
}, sharedColumnProps), null),
|
|
157
|
+
showMinute && (0, vue.createVNode)(require_TimeColumn.default, (0, vue.mergeProps)({
|
|
158
|
+
"units": minuteUnits,
|
|
159
|
+
"value": minute,
|
|
160
|
+
"optionalValue": pickerMinute,
|
|
161
|
+
"type": "minute",
|
|
162
|
+
"onChange": onMinuteChange,
|
|
163
|
+
"onHover": onMinuteHover
|
|
164
|
+
}, sharedColumnProps), null),
|
|
165
|
+
showSecond && (0, vue.createVNode)(require_TimeColumn.default, (0, vue.mergeProps)({
|
|
166
|
+
"units": secondUnits,
|
|
167
|
+
"value": second,
|
|
168
|
+
"optionalValue": pickerSecond,
|
|
169
|
+
"type": "second",
|
|
170
|
+
"onChange": onSecondChange,
|
|
171
|
+
"onHover": onSecondHover
|
|
172
|
+
}, sharedColumnProps), null),
|
|
173
|
+
showMillisecond && (0, vue.createVNode)(require_TimeColumn.default, (0, vue.mergeProps)({
|
|
174
|
+
"units": millisecondUnits,
|
|
175
|
+
"value": millisecond,
|
|
176
|
+
"optionalValue": pickerMillisecond,
|
|
177
|
+
"type": "millisecond",
|
|
178
|
+
"onChange": onMillisecondChange,
|
|
179
|
+
"onHover": onMillisecondHover
|
|
180
|
+
}, sharedColumnProps), null),
|
|
181
|
+
showMeridiem && (0, vue.createVNode)(require_TimeColumn.default, (0, vue.mergeProps)({
|
|
182
|
+
"units": meridiemUnits,
|
|
183
|
+
"value": meridiem,
|
|
184
|
+
"type": "meridiem",
|
|
185
|
+
"onChange": onMeridiemChange,
|
|
186
|
+
"onHover": onMeridiemHover
|
|
187
|
+
}, sharedColumnProps), null)
|
|
188
|
+
]);
|
|
189
|
+
};
|
|
190
|
+
}, {
|
|
191
|
+
props: {
|
|
192
|
+
format: {
|
|
193
|
+
type: String,
|
|
194
|
+
required: false,
|
|
195
|
+
default: void 0
|
|
196
|
+
},
|
|
197
|
+
showNow: {
|
|
198
|
+
type: Boolean,
|
|
199
|
+
required: false,
|
|
200
|
+
default: void 0
|
|
201
|
+
},
|
|
202
|
+
showHour: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
required: false,
|
|
205
|
+
default: void 0
|
|
206
|
+
},
|
|
207
|
+
showMinute: {
|
|
208
|
+
type: Boolean,
|
|
209
|
+
required: false,
|
|
210
|
+
default: void 0
|
|
211
|
+
},
|
|
212
|
+
showSecond: {
|
|
213
|
+
type: Boolean,
|
|
214
|
+
required: false,
|
|
215
|
+
default: void 0
|
|
216
|
+
},
|
|
217
|
+
showMillisecond: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
required: false,
|
|
220
|
+
default: void 0
|
|
221
|
+
},
|
|
222
|
+
use12Hours: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
required: false,
|
|
225
|
+
default: void 0
|
|
226
|
+
},
|
|
227
|
+
hourStep: {
|
|
228
|
+
required: false,
|
|
229
|
+
default: void 0
|
|
230
|
+
},
|
|
231
|
+
minuteStep: {
|
|
232
|
+
required: false,
|
|
233
|
+
default: void 0
|
|
234
|
+
},
|
|
235
|
+
secondStep: {
|
|
236
|
+
required: false,
|
|
237
|
+
default: void 0
|
|
238
|
+
},
|
|
239
|
+
millisecondStep: {
|
|
240
|
+
required: false,
|
|
241
|
+
default: void 0
|
|
242
|
+
},
|
|
243
|
+
hideDisabledOptions: {
|
|
244
|
+
type: Boolean,
|
|
245
|
+
required: false,
|
|
246
|
+
default: void 0
|
|
247
|
+
},
|
|
248
|
+
defaultValue: {
|
|
249
|
+
required: false,
|
|
250
|
+
default: void 0
|
|
251
|
+
},
|
|
252
|
+
defaultOpenValue: {
|
|
253
|
+
required: false,
|
|
254
|
+
default: void 0
|
|
255
|
+
},
|
|
256
|
+
disabledHours: {
|
|
257
|
+
type: Function,
|
|
258
|
+
required: false,
|
|
259
|
+
default: void 0
|
|
260
|
+
},
|
|
261
|
+
disabledMinutes: {
|
|
262
|
+
type: Function,
|
|
263
|
+
required: false,
|
|
264
|
+
default: void 0
|
|
265
|
+
},
|
|
266
|
+
disabledSeconds: {
|
|
267
|
+
type: Function,
|
|
268
|
+
required: false,
|
|
269
|
+
default: void 0
|
|
270
|
+
},
|
|
271
|
+
disabledTime: {
|
|
272
|
+
type: Function,
|
|
273
|
+
required: false,
|
|
274
|
+
default: void 0
|
|
275
|
+
},
|
|
276
|
+
changeOnScroll: {
|
|
277
|
+
type: Boolean,
|
|
278
|
+
required: false,
|
|
279
|
+
default: void 0
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
name: "TimePanelBody",
|
|
283
|
+
inheritAttrs: false
|
|
284
|
+
});
|
|
285
|
+
var TimePanelBody_default = TimePanelBody;
|
|
286
|
+
exports.default = TimePanelBody_default;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { formatValue } from "../../../utils/dateUtil.js";
|
|
2
|
+
import useTimeInfo from "../../../hooks/useTimeInfo.js";
|
|
3
|
+
import { usePanelContext, usePickerHackContext } from "../../context.js";
|
|
4
|
+
import TimeColumn_default from "./TimeColumn.js";
|
|
5
|
+
import { computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
6
|
+
import { clsx } from "@v-c/util";
|
|
7
|
+
function isAM(hour) {
|
|
8
|
+
return hour < 12;
|
|
9
|
+
}
|
|
10
|
+
var TimePanelBody_default = /* @__PURE__ */ defineComponent((props) => {
|
|
11
|
+
const context = usePanelContext();
|
|
12
|
+
const pickerHackContext = usePickerHackContext();
|
|
13
|
+
const value = computed(() => context.value.values?.[0] || null);
|
|
14
|
+
const generateConfig = computed(() => context.value.generateConfig);
|
|
15
|
+
const [getValidTime, rowHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits] = useTimeInfo(generateConfig, computed(() => props), value);
|
|
16
|
+
const getUnitValue = (func) => {
|
|
17
|
+
const val = value.value;
|
|
18
|
+
const pickerVal = context.value.pickerValue;
|
|
19
|
+
return [val && generateConfig.value[func](val), pickerVal && generateConfig.value[func](pickerVal)];
|
|
20
|
+
};
|
|
21
|
+
return () => {
|
|
22
|
+
const { prefixCls, classNames: panelClassNames, styles, locale, onSelect, onHover } = context.value;
|
|
23
|
+
const { showHour, showMinute, showSecond, showMillisecond, use12Hours: showMeridiem, changeOnScroll } = props;
|
|
24
|
+
const { onCellDblClick } = pickerHackContext?.value || {};
|
|
25
|
+
const [hour, pickerHour] = getUnitValue("getHour");
|
|
26
|
+
const [minute, pickerMinute] = getUnitValue("getMinute");
|
|
27
|
+
const [second, pickerSecond] = getUnitValue("getSecond");
|
|
28
|
+
const [millisecond, pickerMillisecond] = getUnitValue("getMillisecond");
|
|
29
|
+
const meridiem = hour === null ? null : isAM(hour) ? "am" : "pm";
|
|
30
|
+
const hourUnits = (() => {
|
|
31
|
+
if (!showMeridiem) return rowHourUnits.value;
|
|
32
|
+
return isAM(hour) ? rowHourUnits.value.filter((h) => isAM(h.value)) : rowHourUnits.value.filter((h) => !isAM(h.value));
|
|
33
|
+
})();
|
|
34
|
+
const getEnabled = (units, val) => {
|
|
35
|
+
const enabledUnits = units.filter((unit) => !unit.disabled);
|
|
36
|
+
return val ?? enabledUnits?.[0]?.value;
|
|
37
|
+
};
|
|
38
|
+
const validHour = getEnabled(rowHourUnits.value, hour);
|
|
39
|
+
const minuteUnits = getMinuteUnits(validHour);
|
|
40
|
+
const validMinute = getEnabled(minuteUnits, minute);
|
|
41
|
+
const secondUnits = getSecondUnits(validHour, validMinute);
|
|
42
|
+
const validSecond = getEnabled(secondUnits, second);
|
|
43
|
+
const millisecondUnits = getMillisecondUnits(validHour, validMinute, validSecond);
|
|
44
|
+
const validMillisecond = getEnabled(millisecondUnits, millisecond);
|
|
45
|
+
const meridiemUnits = (() => {
|
|
46
|
+
if (!showMeridiem) return [];
|
|
47
|
+
const base = generateConfig.value.getNow();
|
|
48
|
+
const amDate = generateConfig.value.setHour(base, 6);
|
|
49
|
+
const pmDate = generateConfig.value.setHour(base, 18);
|
|
50
|
+
const formatMeridiem = (date, defaultLabel) => {
|
|
51
|
+
const { cellMeridiemFormat } = locale ?? {};
|
|
52
|
+
return cellMeridiemFormat ? formatValue(date, {
|
|
53
|
+
generateConfig: generateConfig.value,
|
|
54
|
+
locale,
|
|
55
|
+
format: cellMeridiemFormat
|
|
56
|
+
}) : defaultLabel;
|
|
57
|
+
};
|
|
58
|
+
return [{
|
|
59
|
+
label: formatMeridiem(amDate, "AM"),
|
|
60
|
+
value: "am",
|
|
61
|
+
disabled: rowHourUnits.value.every((h) => h.disabled || !isAM(h.value))
|
|
62
|
+
}, {
|
|
63
|
+
label: formatMeridiem(pmDate, "PM"),
|
|
64
|
+
value: "pm",
|
|
65
|
+
disabled: rowHourUnits.value.every((h) => h.disabled || isAM(h.value))
|
|
66
|
+
}];
|
|
67
|
+
})();
|
|
68
|
+
const triggerChange = (nextDate) => {
|
|
69
|
+
onSelect(getValidTime(nextDate));
|
|
70
|
+
};
|
|
71
|
+
const triggerDateTmpl = (() => {
|
|
72
|
+
let tmpl = value.value || context.value.pickerValue || generateConfig.value.getNow();
|
|
73
|
+
const isNotNull = (num) => num !== null && num !== void 0;
|
|
74
|
+
if (isNotNull(hour)) {
|
|
75
|
+
tmpl = generateConfig.value.setHour(tmpl, hour);
|
|
76
|
+
tmpl = generateConfig.value.setMinute(tmpl, minute);
|
|
77
|
+
tmpl = generateConfig.value.setSecond(tmpl, second);
|
|
78
|
+
tmpl = generateConfig.value.setMillisecond(tmpl, millisecond);
|
|
79
|
+
} else if (isNotNull(pickerHour)) {
|
|
80
|
+
tmpl = generateConfig.value.setHour(tmpl, pickerHour);
|
|
81
|
+
tmpl = generateConfig.value.setMinute(tmpl, pickerMinute);
|
|
82
|
+
tmpl = generateConfig.value.setSecond(tmpl, pickerSecond);
|
|
83
|
+
tmpl = generateConfig.value.setMillisecond(tmpl, pickerMillisecond);
|
|
84
|
+
} else if (isNotNull(validHour)) {
|
|
85
|
+
tmpl = generateConfig.value.setHour(tmpl, validHour);
|
|
86
|
+
tmpl = generateConfig.value.setMinute(tmpl, validMinute);
|
|
87
|
+
tmpl = generateConfig.value.setSecond(tmpl, validSecond);
|
|
88
|
+
tmpl = generateConfig.value.setMillisecond(tmpl, validMillisecond);
|
|
89
|
+
}
|
|
90
|
+
return tmpl;
|
|
91
|
+
})();
|
|
92
|
+
const fillColumnValue = (val, func) => {
|
|
93
|
+
if (val === null) return null;
|
|
94
|
+
return generateConfig.value[func](triggerDateTmpl, val);
|
|
95
|
+
};
|
|
96
|
+
const getNextHourTime = (val) => fillColumnValue(val, "setHour");
|
|
97
|
+
const getNextMinuteTime = (val) => fillColumnValue(val, "setMinute");
|
|
98
|
+
const getNextSecondTime = (val) => fillColumnValue(val, "setSecond");
|
|
99
|
+
const getNextMillisecondTime = (val) => fillColumnValue(val, "setMillisecond");
|
|
100
|
+
const getMeridiemTime = (val) => {
|
|
101
|
+
if (val === null) return null;
|
|
102
|
+
if (val === "am" && !isAM(hour)) return generateConfig.value.setHour(triggerDateTmpl, hour - 12);
|
|
103
|
+
else if (val === "pm" && isAM(hour)) return generateConfig.value.setHour(triggerDateTmpl, hour + 12);
|
|
104
|
+
return triggerDateTmpl;
|
|
105
|
+
};
|
|
106
|
+
const onHourChange = (val) => {
|
|
107
|
+
triggerChange(getNextHourTime(val));
|
|
108
|
+
};
|
|
109
|
+
const onMinuteChange = (val) => {
|
|
110
|
+
triggerChange(getNextMinuteTime(val));
|
|
111
|
+
};
|
|
112
|
+
const onSecondChange = (val) => {
|
|
113
|
+
triggerChange(getNextSecondTime(val));
|
|
114
|
+
};
|
|
115
|
+
const onMillisecondChange = (val) => {
|
|
116
|
+
triggerChange(getNextMillisecondTime(val));
|
|
117
|
+
};
|
|
118
|
+
const onMeridiemChange = (val) => {
|
|
119
|
+
triggerChange(getMeridiemTime(val));
|
|
120
|
+
};
|
|
121
|
+
const onHourHover = (val) => {
|
|
122
|
+
onHover?.(getNextHourTime(val));
|
|
123
|
+
};
|
|
124
|
+
const onMinuteHover = (val) => {
|
|
125
|
+
onHover?.(getNextMinuteTime(val));
|
|
126
|
+
};
|
|
127
|
+
const onSecondHover = (val) => {
|
|
128
|
+
onHover?.(getNextSecondTime(val));
|
|
129
|
+
};
|
|
130
|
+
const onMillisecondHover = (val) => {
|
|
131
|
+
onHover?.(getNextMillisecondTime(val));
|
|
132
|
+
};
|
|
133
|
+
const onMeridiemHover = (val) => {
|
|
134
|
+
onHover?.(getMeridiemTime(val));
|
|
135
|
+
};
|
|
136
|
+
const sharedColumnProps = {
|
|
137
|
+
onDblClick: onCellDblClick,
|
|
138
|
+
changeOnScroll
|
|
139
|
+
};
|
|
140
|
+
return createVNode("div", {
|
|
141
|
+
"class": clsx(`${prefixCls}-content`, panelClassNames?.content),
|
|
142
|
+
"style": styles?.content
|
|
143
|
+
}, [
|
|
144
|
+
showHour && createVNode(TimeColumn_default, mergeProps({
|
|
145
|
+
"units": hourUnits,
|
|
146
|
+
"value": hour,
|
|
147
|
+
"optionalValue": pickerHour,
|
|
148
|
+
"type": "hour",
|
|
149
|
+
"onChange": onHourChange,
|
|
150
|
+
"onHover": onHourHover
|
|
151
|
+
}, sharedColumnProps), null),
|
|
152
|
+
showMinute && createVNode(TimeColumn_default, mergeProps({
|
|
153
|
+
"units": minuteUnits,
|
|
154
|
+
"value": minute,
|
|
155
|
+
"optionalValue": pickerMinute,
|
|
156
|
+
"type": "minute",
|
|
157
|
+
"onChange": onMinuteChange,
|
|
158
|
+
"onHover": onMinuteHover
|
|
159
|
+
}, sharedColumnProps), null),
|
|
160
|
+
showSecond && createVNode(TimeColumn_default, mergeProps({
|
|
161
|
+
"units": secondUnits,
|
|
162
|
+
"value": second,
|
|
163
|
+
"optionalValue": pickerSecond,
|
|
164
|
+
"type": "second",
|
|
165
|
+
"onChange": onSecondChange,
|
|
166
|
+
"onHover": onSecondHover
|
|
167
|
+
}, sharedColumnProps), null),
|
|
168
|
+
showMillisecond && createVNode(TimeColumn_default, mergeProps({
|
|
169
|
+
"units": millisecondUnits,
|
|
170
|
+
"value": millisecond,
|
|
171
|
+
"optionalValue": pickerMillisecond,
|
|
172
|
+
"type": "millisecond",
|
|
173
|
+
"onChange": onMillisecondChange,
|
|
174
|
+
"onHover": onMillisecondHover
|
|
175
|
+
}, sharedColumnProps), null),
|
|
176
|
+
showMeridiem && createVNode(TimeColumn_default, mergeProps({
|
|
177
|
+
"units": meridiemUnits,
|
|
178
|
+
"value": meridiem,
|
|
179
|
+
"type": "meridiem",
|
|
180
|
+
"onChange": onMeridiemChange,
|
|
181
|
+
"onHover": onMeridiemHover
|
|
182
|
+
}, sharedColumnProps), null)
|
|
183
|
+
]);
|
|
184
|
+
};
|
|
185
|
+
}, {
|
|
186
|
+
props: {
|
|
187
|
+
format: {
|
|
188
|
+
type: String,
|
|
189
|
+
required: false,
|
|
190
|
+
default: void 0
|
|
191
|
+
},
|
|
192
|
+
showNow: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
required: false,
|
|
195
|
+
default: void 0
|
|
196
|
+
},
|
|
197
|
+
showHour: {
|
|
198
|
+
type: Boolean,
|
|
199
|
+
required: false,
|
|
200
|
+
default: void 0
|
|
201
|
+
},
|
|
202
|
+
showMinute: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
required: false,
|
|
205
|
+
default: void 0
|
|
206
|
+
},
|
|
207
|
+
showSecond: {
|
|
208
|
+
type: Boolean,
|
|
209
|
+
required: false,
|
|
210
|
+
default: void 0
|
|
211
|
+
},
|
|
212
|
+
showMillisecond: {
|
|
213
|
+
type: Boolean,
|
|
214
|
+
required: false,
|
|
215
|
+
default: void 0
|
|
216
|
+
},
|
|
217
|
+
use12Hours: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
required: false,
|
|
220
|
+
default: void 0
|
|
221
|
+
},
|
|
222
|
+
hourStep: {
|
|
223
|
+
required: false,
|
|
224
|
+
default: void 0
|
|
225
|
+
},
|
|
226
|
+
minuteStep: {
|
|
227
|
+
required: false,
|
|
228
|
+
default: void 0
|
|
229
|
+
},
|
|
230
|
+
secondStep: {
|
|
231
|
+
required: false,
|
|
232
|
+
default: void 0
|
|
233
|
+
},
|
|
234
|
+
millisecondStep: {
|
|
235
|
+
required: false,
|
|
236
|
+
default: void 0
|
|
237
|
+
},
|
|
238
|
+
hideDisabledOptions: {
|
|
239
|
+
type: Boolean,
|
|
240
|
+
required: false,
|
|
241
|
+
default: void 0
|
|
242
|
+
},
|
|
243
|
+
defaultValue: {
|
|
244
|
+
required: false,
|
|
245
|
+
default: void 0
|
|
246
|
+
},
|
|
247
|
+
defaultOpenValue: {
|
|
248
|
+
required: false,
|
|
249
|
+
default: void 0
|
|
250
|
+
},
|
|
251
|
+
disabledHours: {
|
|
252
|
+
type: Function,
|
|
253
|
+
required: false,
|
|
254
|
+
default: void 0
|
|
255
|
+
},
|
|
256
|
+
disabledMinutes: {
|
|
257
|
+
type: Function,
|
|
258
|
+
required: false,
|
|
259
|
+
default: void 0
|
|
260
|
+
},
|
|
261
|
+
disabledSeconds: {
|
|
262
|
+
type: Function,
|
|
263
|
+
required: false,
|
|
264
|
+
default: void 0
|
|
265
|
+
},
|
|
266
|
+
disabledTime: {
|
|
267
|
+
type: Function,
|
|
268
|
+
required: false,
|
|
269
|
+
default: void 0
|
|
270
|
+
},
|
|
271
|
+
changeOnScroll: {
|
|
272
|
+
type: Boolean,
|
|
273
|
+
required: false,
|
|
274
|
+
default: void 0
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
name: "TimePanelBody",
|
|
278
|
+
inheritAttrs: false
|
|
279
|
+
});
|
|
280
|
+
export { TimePanelBody_default as default };
|