@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,130 @@
|
|
|
1
|
+
import { usePickerContext } from "../PickerInput/context.js";
|
|
2
|
+
import { getRealPlacement } from "../utils/uiUtil.js";
|
|
3
|
+
import { computed, createVNode, defineComponent } from "vue";
|
|
4
|
+
import { clsx } from "@v-c/util";
|
|
5
|
+
import Trigger from "@v-c/trigger";
|
|
6
|
+
var BUILT_IN_PLACEMENTS = {
|
|
7
|
+
bottomLeft: {
|
|
8
|
+
points: ["tl", "bl"],
|
|
9
|
+
offset: [0, 4],
|
|
10
|
+
overflow: {
|
|
11
|
+
adjustX: 1,
|
|
12
|
+
adjustY: 1
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
bottomRight: {
|
|
16
|
+
points: ["tr", "br"],
|
|
17
|
+
offset: [0, 4],
|
|
18
|
+
overflow: {
|
|
19
|
+
adjustX: 1,
|
|
20
|
+
adjustY: 1
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
topLeft: {
|
|
24
|
+
points: ["bl", "tl"],
|
|
25
|
+
offset: [0, -4],
|
|
26
|
+
overflow: {
|
|
27
|
+
adjustX: 0,
|
|
28
|
+
adjustY: 1
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
topRight: {
|
|
32
|
+
points: ["br", "tr"],
|
|
33
|
+
offset: [0, -4],
|
|
34
|
+
overflow: {
|
|
35
|
+
adjustX: 0,
|
|
36
|
+
adjustY: 1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var PickerTrigger_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
41
|
+
const ctx = usePickerContext();
|
|
42
|
+
const dropdownPrefixCls = computed(() => `${ctx.value.prefixCls}-dropdown`);
|
|
43
|
+
const realPlacement = computed(() => getRealPlacement(props.placement, props.direction === "rtl"));
|
|
44
|
+
return () => createVNode(Trigger, {
|
|
45
|
+
"showAction": [],
|
|
46
|
+
"hideAction": ["click"],
|
|
47
|
+
"popupPlacement": realPlacement.value,
|
|
48
|
+
"builtinPlacements": props.builtinPlacements || BUILT_IN_PLACEMENTS,
|
|
49
|
+
"prefixCls": dropdownPrefixCls.value,
|
|
50
|
+
"popupMotion": props.transitionName ? { motionName: props.transitionName } : void 0,
|
|
51
|
+
"popup": props.popupElement,
|
|
52
|
+
"popupAlign": props.popupAlign,
|
|
53
|
+
"popupVisible": props.visible,
|
|
54
|
+
"popupClassName": clsx(props.popupClassName, {
|
|
55
|
+
[`${dropdownPrefixCls.value}-range`]: props.range,
|
|
56
|
+
[`${dropdownPrefixCls.value}-rtl`]: props.direction === "rtl"
|
|
57
|
+
}),
|
|
58
|
+
"popupStyle": props.popupStyle,
|
|
59
|
+
"stretch": "minWidth",
|
|
60
|
+
"getPopupContainer": props.getPopupContainer,
|
|
61
|
+
"onPopupVisibleChange": (nextVisible) => {
|
|
62
|
+
if (!nextVisible) props.onClose?.();
|
|
63
|
+
}
|
|
64
|
+
}, { default: () => [slots.default?.()] });
|
|
65
|
+
}, {
|
|
66
|
+
props: {
|
|
67
|
+
popupElement: {
|
|
68
|
+
required: false,
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
popupStyle: {
|
|
72
|
+
type: Object,
|
|
73
|
+
required: false,
|
|
74
|
+
default: void 0
|
|
75
|
+
},
|
|
76
|
+
transitionName: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: false,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
81
|
+
getPopupContainer: {
|
|
82
|
+
type: Function,
|
|
83
|
+
required: false,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
popupAlign: {
|
|
87
|
+
type: Object,
|
|
88
|
+
required: false,
|
|
89
|
+
default: void 0
|
|
90
|
+
},
|
|
91
|
+
range: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
required: false,
|
|
94
|
+
default: void 0
|
|
95
|
+
},
|
|
96
|
+
popupClassName: {
|
|
97
|
+
type: String,
|
|
98
|
+
required: false,
|
|
99
|
+
default: void 0
|
|
100
|
+
},
|
|
101
|
+
placement: {
|
|
102
|
+
type: String,
|
|
103
|
+
required: false,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
builtinPlacements: {
|
|
107
|
+
type: Object,
|
|
108
|
+
required: false,
|
|
109
|
+
default: void 0
|
|
110
|
+
},
|
|
111
|
+
direction: {
|
|
112
|
+
type: String,
|
|
113
|
+
required: false,
|
|
114
|
+
default: void 0
|
|
115
|
+
},
|
|
116
|
+
visible: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
required: false,
|
|
119
|
+
default: void 0
|
|
120
|
+
},
|
|
121
|
+
onClose: {
|
|
122
|
+
type: Function,
|
|
123
|
+
required: false,
|
|
124
|
+
default: void 0
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
name: "PickerTrigger",
|
|
128
|
+
inheritAttrs: false
|
|
129
|
+
});
|
|
130
|
+
export { PickerTrigger_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_miscUtil = require("../utils/miscUtil.cjs");
|
|
3
|
+
function pickTriggerProps(props) {
|
|
4
|
+
return require_miscUtil.pickProps(props, [
|
|
5
|
+
"placement",
|
|
6
|
+
"builtinPlacements",
|
|
7
|
+
"popupAlign",
|
|
8
|
+
"getPopupContainer",
|
|
9
|
+
"transitionName",
|
|
10
|
+
"direction"
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
exports.pickTriggerProps = pickTriggerProps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { pickProps } from "../utils/miscUtil.js";
|
|
2
|
+
function pickTriggerProps(props) {
|
|
3
|
+
return pickProps(props, [
|
|
4
|
+
"placement",
|
|
5
|
+
"builtinPlacements",
|
|
6
|
+
"popupAlign",
|
|
7
|
+
"getPopupContainer",
|
|
8
|
+
"transitionName",
|
|
9
|
+
"direction"
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
12
|
+
export { pickTriggerProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
9
|
+
key = keys[i];
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: ((k) => from[k]).bind(null, key),
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
value: mod,
|
|
19
|
+
enumerable: true
|
|
20
|
+
}) : target, mod));
|
|
21
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
6
|
+
let date_fns = require("date-fns");
|
|
7
|
+
let date_fns_locale = require("date-fns/locale");
|
|
8
|
+
date_fns_locale = require_rolldown_runtime.__toESM(date_fns_locale);
|
|
9
|
+
function getLocale(locale) {
|
|
10
|
+
const tmpLocales = date_fns_locale;
|
|
11
|
+
return tmpLocales[locale] || tmpLocales[locale.replace(/_/g, "")] || tmpLocales[locale.replace(/_.*$/g, "")];
|
|
12
|
+
}
|
|
13
|
+
function localeParse(format) {
|
|
14
|
+
return format.replace(/Y/g, "y").replace(/D/g, "d").replace(/gggg/, "yyyy").replace(/g/g, "G").replace(/([Ww])o/g, "wo");
|
|
15
|
+
}
|
|
16
|
+
function parse(text, format, locale) {
|
|
17
|
+
return (0, date_fns.parse)(text, localeParse(format), /* @__PURE__ */ new Date(), { locale: getLocale(locale) });
|
|
18
|
+
}
|
|
19
|
+
function isStrictValidDate(text, format, locale) {
|
|
20
|
+
const date = parse(text, format, locale);
|
|
21
|
+
if (!(0, date_fns.isValid)(date)) return false;
|
|
22
|
+
return text === (0, date_fns.format)(date, format, { locale: getLocale(locale) });
|
|
23
|
+
}
|
|
24
|
+
var generateConfig = {
|
|
25
|
+
getNow: () => /* @__PURE__ */ new Date(),
|
|
26
|
+
getFixedDate: (string) => new Date(string),
|
|
27
|
+
getEndDate: (date) => (0, date_fns.endOfMonth)(date),
|
|
28
|
+
getWeekDay: (date) => (0, date_fns.getDay)(date),
|
|
29
|
+
getYear: (date) => (0, date_fns.getYear)(date),
|
|
30
|
+
getMonth: (date) => (0, date_fns.getMonth)(date),
|
|
31
|
+
getDate: (date) => (0, date_fns.getDate)(date),
|
|
32
|
+
getHour: (date) => (0, date_fns.getHours)(date),
|
|
33
|
+
getMinute: (date) => (0, date_fns.getMinutes)(date),
|
|
34
|
+
getSecond: (date) => (0, date_fns.getSeconds)(date),
|
|
35
|
+
getMillisecond: (date) => (0, date_fns.getMilliseconds)(date),
|
|
36
|
+
addYear: (date, diff) => (0, date_fns.addYears)(date, diff),
|
|
37
|
+
addMonth: (date, diff) => (0, date_fns.addMonths)(date, diff),
|
|
38
|
+
addDate: (date, diff) => (0, date_fns.addDays)(date, diff),
|
|
39
|
+
setYear: (date, year) => (0, date_fns.setYear)(date, year),
|
|
40
|
+
setMonth: (date, month) => (0, date_fns.setMonth)(date, month),
|
|
41
|
+
setDate: (date, num) => (0, date_fns.setDate)(date, num),
|
|
42
|
+
setHour: (date, hour) => (0, date_fns.setHours)(date, hour),
|
|
43
|
+
setMinute: (date, minute) => (0, date_fns.setMinutes)(date, minute),
|
|
44
|
+
setSecond: (date, second) => (0, date_fns.setSeconds)(date, second),
|
|
45
|
+
setMillisecond: (date, millisecond) => (0, date_fns.setMilliseconds)(date, millisecond),
|
|
46
|
+
isAfter: (date1, date2) => (0, date_fns.isAfter)(date1, date2),
|
|
47
|
+
isValidate: (date) => (0, date_fns.isValid)(date),
|
|
48
|
+
locale: {
|
|
49
|
+
getWeekFirstDay: (locale) => {
|
|
50
|
+
return getLocale(locale).options?.weekStartsOn;
|
|
51
|
+
},
|
|
52
|
+
getWeekFirstDate: (locale, date) => {
|
|
53
|
+
return (0, date_fns.startOfWeek)(date, { locale: getLocale(locale) });
|
|
54
|
+
},
|
|
55
|
+
getWeek: (locale, date) => {
|
|
56
|
+
return (0, date_fns.getWeek)(date, { locale: getLocale(locale) });
|
|
57
|
+
},
|
|
58
|
+
getShortWeekDays: (locale) => {
|
|
59
|
+
const clone = getLocale(locale);
|
|
60
|
+
return Array.from({ length: 7 }).map((_, i) => clone.localize.day(i, { width: "short" }));
|
|
61
|
+
},
|
|
62
|
+
getShortMonths: (locale) => {
|
|
63
|
+
const clone = getLocale(locale);
|
|
64
|
+
return Array.from({ length: 12 }).map((_, i) => clone.localize.month(i, { width: "abbreviated" }));
|
|
65
|
+
},
|
|
66
|
+
format: (locale, date, format) => {
|
|
67
|
+
if (!(0, date_fns.isValid)(date)) return null;
|
|
68
|
+
return (0, date_fns.format)(date, localeParse(format), { locale: getLocale(locale) });
|
|
69
|
+
},
|
|
70
|
+
parse: (locale, text, formats) => {
|
|
71
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
72
|
+
const format = localeParse(formats[i]);
|
|
73
|
+
if (isStrictValidDate(text, format, locale)) return parse(text, format, locale);
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var dateFns_default = generateConfig;
|
|
80
|
+
exports.default = dateFns_default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { addDays, addMonths, addYears, endOfMonth, format, getDate, getDay, getHours, getMilliseconds, getMinutes, getMonth, getSeconds, getWeek, getYear, isAfter, isValid, parse, setDate, setHours, setMilliseconds, setMinutes, setMonth, setSeconds, setYear, startOfWeek } from "date-fns";
|
|
2
|
+
import * as locales from "date-fns/locale";
|
|
3
|
+
function getLocale(locale) {
|
|
4
|
+
const tmpLocales = locales;
|
|
5
|
+
return tmpLocales[locale] || tmpLocales[locale.replace(/_/g, "")] || tmpLocales[locale.replace(/_.*$/g, "")];
|
|
6
|
+
}
|
|
7
|
+
function localeParse(format$1) {
|
|
8
|
+
return format$1.replace(/Y/g, "y").replace(/D/g, "d").replace(/gggg/, "yyyy").replace(/g/g, "G").replace(/([Ww])o/g, "wo");
|
|
9
|
+
}
|
|
10
|
+
function parse$1(text, format$1, locale) {
|
|
11
|
+
return parse(text, localeParse(format$1), /* @__PURE__ */ new Date(), { locale: getLocale(locale) });
|
|
12
|
+
}
|
|
13
|
+
function isStrictValidDate(text, format$1, locale) {
|
|
14
|
+
const date = parse$1(text, format$1, locale);
|
|
15
|
+
if (!isValid(date)) return false;
|
|
16
|
+
return text === format(date, format$1, { locale: getLocale(locale) });
|
|
17
|
+
}
|
|
18
|
+
var dateFns_default = {
|
|
19
|
+
getNow: () => /* @__PURE__ */ new Date(),
|
|
20
|
+
getFixedDate: (string) => new Date(string),
|
|
21
|
+
getEndDate: (date) => endOfMonth(date),
|
|
22
|
+
getWeekDay: (date) => getDay(date),
|
|
23
|
+
getYear: (date) => getYear(date),
|
|
24
|
+
getMonth: (date) => getMonth(date),
|
|
25
|
+
getDate: (date) => getDate(date),
|
|
26
|
+
getHour: (date) => getHours(date),
|
|
27
|
+
getMinute: (date) => getMinutes(date),
|
|
28
|
+
getSecond: (date) => getSeconds(date),
|
|
29
|
+
getMillisecond: (date) => getMilliseconds(date),
|
|
30
|
+
addYear: (date, diff) => addYears(date, diff),
|
|
31
|
+
addMonth: (date, diff) => addMonths(date, diff),
|
|
32
|
+
addDate: (date, diff) => addDays(date, diff),
|
|
33
|
+
setYear: (date, year) => setYear(date, year),
|
|
34
|
+
setMonth: (date, month) => setMonth(date, month),
|
|
35
|
+
setDate: (date, num) => setDate(date, num),
|
|
36
|
+
setHour: (date, hour) => setHours(date, hour),
|
|
37
|
+
setMinute: (date, minute) => setMinutes(date, minute),
|
|
38
|
+
setSecond: (date, second) => setSeconds(date, second),
|
|
39
|
+
setMillisecond: (date, millisecond) => setMilliseconds(date, millisecond),
|
|
40
|
+
isAfter: (date1, date2) => isAfter(date1, date2),
|
|
41
|
+
isValidate: (date) => isValid(date),
|
|
42
|
+
locale: {
|
|
43
|
+
getWeekFirstDay: (locale) => {
|
|
44
|
+
return getLocale(locale).options?.weekStartsOn;
|
|
45
|
+
},
|
|
46
|
+
getWeekFirstDate: (locale, date) => {
|
|
47
|
+
return startOfWeek(date, { locale: getLocale(locale) });
|
|
48
|
+
},
|
|
49
|
+
getWeek: (locale, date) => {
|
|
50
|
+
return getWeek(date, { locale: getLocale(locale) });
|
|
51
|
+
},
|
|
52
|
+
getShortWeekDays: (locale) => {
|
|
53
|
+
const clone = getLocale(locale);
|
|
54
|
+
return Array.from({ length: 7 }).map((_, i) => clone.localize.day(i, { width: "short" }));
|
|
55
|
+
},
|
|
56
|
+
getShortMonths: (locale) => {
|
|
57
|
+
const clone = getLocale(locale);
|
|
58
|
+
return Array.from({ length: 12 }).map((_, i) => clone.localize.month(i, { width: "abbreviated" }));
|
|
59
|
+
},
|
|
60
|
+
format: (locale, date, format$1) => {
|
|
61
|
+
if (!isValid(date)) return null;
|
|
62
|
+
return format(date, localeParse(format$1), { locale: getLocale(locale) });
|
|
63
|
+
},
|
|
64
|
+
parse: (locale, text, formats) => {
|
|
65
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
66
|
+
const format$1 = localeParse(formats[i]);
|
|
67
|
+
if (isStrictValidDate(text, format$1, locale)) return parse$1(text, format$1, locale);
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export { dateFns_default as default };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
6
|
+
let dayjs_esm = require("dayjs/esm");
|
|
7
|
+
dayjs_esm = require_rolldown_runtime.__toESM(dayjs_esm);
|
|
8
|
+
let dayjs_esm_plugin_advancedFormat_index = require("dayjs/esm/plugin/advancedFormat/index");
|
|
9
|
+
dayjs_esm_plugin_advancedFormat_index = require_rolldown_runtime.__toESM(dayjs_esm_plugin_advancedFormat_index);
|
|
10
|
+
let dayjs_esm_plugin_customParseFormat_index = require("dayjs/esm/plugin/customParseFormat/index");
|
|
11
|
+
dayjs_esm_plugin_customParseFormat_index = require_rolldown_runtime.__toESM(dayjs_esm_plugin_customParseFormat_index);
|
|
12
|
+
let dayjs_esm_plugin_localeData_index = require("dayjs/esm/plugin/localeData/index");
|
|
13
|
+
dayjs_esm_plugin_localeData_index = require_rolldown_runtime.__toESM(dayjs_esm_plugin_localeData_index);
|
|
14
|
+
let dayjs_esm_plugin_weekday_index = require("dayjs/esm/plugin/weekday/index");
|
|
15
|
+
dayjs_esm_plugin_weekday_index = require_rolldown_runtime.__toESM(dayjs_esm_plugin_weekday_index);
|
|
16
|
+
let dayjs_esm_plugin_weekOfYear_index = require("dayjs/esm/plugin/weekOfYear/index");
|
|
17
|
+
dayjs_esm_plugin_weekOfYear_index = require_rolldown_runtime.__toESM(dayjs_esm_plugin_weekOfYear_index);
|
|
18
|
+
let dayjs_esm_plugin_weekYear_index = require("dayjs/esm/plugin/weekYear/index");
|
|
19
|
+
dayjs_esm_plugin_weekYear_index = require_rolldown_runtime.__toESM(dayjs_esm_plugin_weekYear_index);
|
|
20
|
+
dayjs_esm.default.extend(dayjs_esm_plugin_customParseFormat_index.default);
|
|
21
|
+
dayjs_esm.default.extend(dayjs_esm_plugin_advancedFormat_index.default);
|
|
22
|
+
dayjs_esm.default.extend(dayjs_esm_plugin_weekday_index.default);
|
|
23
|
+
dayjs_esm.default.extend(dayjs_esm_plugin_localeData_index.default);
|
|
24
|
+
dayjs_esm.default.extend(dayjs_esm_plugin_weekOfYear_index.default);
|
|
25
|
+
dayjs_esm.default.extend(dayjs_esm_plugin_weekYear_index.default);
|
|
26
|
+
dayjs_esm.default.extend((_, c) => {
|
|
27
|
+
const proto = c.prototype;
|
|
28
|
+
const oldFormat = proto.format;
|
|
29
|
+
proto.format = function f(formatStr) {
|
|
30
|
+
const str = (formatStr || "").replace("Wo", "wo");
|
|
31
|
+
return oldFormat.bind(this)(str);
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
var localeMap = {
|
|
35
|
+
bn_BD: "bn-bd",
|
|
36
|
+
by_BY: "be",
|
|
37
|
+
en_GB: "en-gb",
|
|
38
|
+
en_US: "en",
|
|
39
|
+
fr_BE: "fr",
|
|
40
|
+
fr_CA: "fr-ca",
|
|
41
|
+
hy_AM: "hy-am",
|
|
42
|
+
kmr_IQ: "ku",
|
|
43
|
+
nl_BE: "nl-be",
|
|
44
|
+
pt_BR: "pt-br",
|
|
45
|
+
zh_CN: "zh-cn",
|
|
46
|
+
zh_HK: "zh-hk",
|
|
47
|
+
zh_TW: "zh-tw"
|
|
48
|
+
};
|
|
49
|
+
function parseLocale(locale) {
|
|
50
|
+
return localeMap[locale] || locale.split("_")[0];
|
|
51
|
+
}
|
|
52
|
+
/* istanbul ignore next */
|
|
53
|
+
function parseNoMatchNotice() {}
|
|
54
|
+
var generateConfig = {
|
|
55
|
+
getNow: () => {
|
|
56
|
+
const now = (0, dayjs_esm.default)();
|
|
57
|
+
if ("tz" in now && typeof now.tz === "function") return now.tz();
|
|
58
|
+
return now;
|
|
59
|
+
},
|
|
60
|
+
getFixedDate: (string) => (0, dayjs_esm.default)(string, ["YYYY-M-DD", "YYYY-MM-DD"]),
|
|
61
|
+
getEndDate: (date) => date.endOf("month"),
|
|
62
|
+
getWeekDay: (date) => {
|
|
63
|
+
const clone = date.locale("en");
|
|
64
|
+
return clone.weekday() + clone.localeData().firstDayOfWeek();
|
|
65
|
+
},
|
|
66
|
+
getYear: (date) => date.year(),
|
|
67
|
+
getMonth: (date) => date.month(),
|
|
68
|
+
getDate: (date) => date.date(),
|
|
69
|
+
getHour: (date) => date.hour(),
|
|
70
|
+
getMinute: (date) => date.minute(),
|
|
71
|
+
getSecond: (date) => date.second(),
|
|
72
|
+
getMillisecond: (date) => date.millisecond(),
|
|
73
|
+
addYear: (date, diff) => date.add(diff, "year"),
|
|
74
|
+
addMonth: (date, diff) => date.add(diff, "month"),
|
|
75
|
+
addDate: (date, diff) => date.add(diff, "day"),
|
|
76
|
+
setYear: (date, year) => date.year(year),
|
|
77
|
+
setMonth: (date, month) => date.month(month),
|
|
78
|
+
setDate: (date, num) => date.date(num),
|
|
79
|
+
setHour: (date, hour) => date.hour(hour),
|
|
80
|
+
setMinute: (date, minute) => date.minute(minute),
|
|
81
|
+
setSecond: (date, second) => date.second(second),
|
|
82
|
+
setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),
|
|
83
|
+
isAfter: (date1, date2) => date1.isAfter(date2),
|
|
84
|
+
isValidate: (date) => date.isValid(),
|
|
85
|
+
locale: {
|
|
86
|
+
getWeekFirstDay: (locale) => (0, dayjs_esm.default)().locale(parseLocale(locale)).localeData().firstDayOfWeek(),
|
|
87
|
+
getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),
|
|
88
|
+
getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),
|
|
89
|
+
getShortWeekDays: (locale) => (0, dayjs_esm.default)().locale(parseLocale(locale)).localeData().weekdaysMin(),
|
|
90
|
+
getShortMonths: (locale) => (0, dayjs_esm.default)().locale(parseLocale(locale)).localeData().monthsShort(),
|
|
91
|
+
format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),
|
|
92
|
+
parse: (locale, text, formats) => {
|
|
93
|
+
const localeStr = parseLocale(locale);
|
|
94
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
95
|
+
const format = formats[i];
|
|
96
|
+
const formatText = text;
|
|
97
|
+
if (format.includes("wo") || format.includes("Wo")) {
|
|
98
|
+
const year = formatText.split("-")[0];
|
|
99
|
+
const weekStr = formatText.split("-")[1];
|
|
100
|
+
const firstWeek = (0, dayjs_esm.default)(year, "YYYY").startOf("year").locale(localeStr);
|
|
101
|
+
for (let j = 0; j <= 52; j += 1) {
|
|
102
|
+
const nextWeek = firstWeek.add(j, "week");
|
|
103
|
+
if (nextWeek.format("Wo") === weekStr) return nextWeek;
|
|
104
|
+
}
|
|
105
|
+
parseNoMatchNotice();
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const date = (0, dayjs_esm.default)(formatText, format, true).locale(localeStr);
|
|
109
|
+
if (date.isValid()) return date;
|
|
110
|
+
}
|
|
111
|
+
if (text) parseNoMatchNotice();
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var dayjs_default = generateConfig;
|
|
117
|
+
exports.default = dayjs_default;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import dayjs from "dayjs/esm";
|
|
2
|
+
import advancedFormat from "dayjs/esm/plugin/advancedFormat/index";
|
|
3
|
+
import customParseFormat from "dayjs/esm/plugin/customParseFormat/index";
|
|
4
|
+
import localeData from "dayjs/esm/plugin/localeData/index";
|
|
5
|
+
import weekday from "dayjs/esm/plugin/weekday/index";
|
|
6
|
+
import weekOfYear from "dayjs/esm/plugin/weekOfYear/index";
|
|
7
|
+
import weekYear from "dayjs/esm/plugin/weekYear/index";
|
|
8
|
+
dayjs.extend(customParseFormat);
|
|
9
|
+
dayjs.extend(advancedFormat);
|
|
10
|
+
dayjs.extend(weekday);
|
|
11
|
+
dayjs.extend(localeData);
|
|
12
|
+
dayjs.extend(weekOfYear);
|
|
13
|
+
dayjs.extend(weekYear);
|
|
14
|
+
dayjs.extend((_, c) => {
|
|
15
|
+
const proto = c.prototype;
|
|
16
|
+
const oldFormat = proto.format;
|
|
17
|
+
proto.format = function f(formatStr) {
|
|
18
|
+
const str = (formatStr || "").replace("Wo", "wo");
|
|
19
|
+
return oldFormat.bind(this)(str);
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
var localeMap = {
|
|
23
|
+
bn_BD: "bn-bd",
|
|
24
|
+
by_BY: "be",
|
|
25
|
+
en_GB: "en-gb",
|
|
26
|
+
en_US: "en",
|
|
27
|
+
fr_BE: "fr",
|
|
28
|
+
fr_CA: "fr-ca",
|
|
29
|
+
hy_AM: "hy-am",
|
|
30
|
+
kmr_IQ: "ku",
|
|
31
|
+
nl_BE: "nl-be",
|
|
32
|
+
pt_BR: "pt-br",
|
|
33
|
+
zh_CN: "zh-cn",
|
|
34
|
+
zh_HK: "zh-hk",
|
|
35
|
+
zh_TW: "zh-tw"
|
|
36
|
+
};
|
|
37
|
+
function parseLocale(locale) {
|
|
38
|
+
return localeMap[locale] || locale.split("_")[0];
|
|
39
|
+
}
|
|
40
|
+
/* istanbul ignore next */
|
|
41
|
+
function parseNoMatchNotice() {}
|
|
42
|
+
var dayjs_default = {
|
|
43
|
+
getNow: () => {
|
|
44
|
+
const now = dayjs();
|
|
45
|
+
if ("tz" in now && typeof now.tz === "function") return now.tz();
|
|
46
|
+
return now;
|
|
47
|
+
},
|
|
48
|
+
getFixedDate: (string) => dayjs(string, ["YYYY-M-DD", "YYYY-MM-DD"]),
|
|
49
|
+
getEndDate: (date) => date.endOf("month"),
|
|
50
|
+
getWeekDay: (date) => {
|
|
51
|
+
const clone = date.locale("en");
|
|
52
|
+
return clone.weekday() + clone.localeData().firstDayOfWeek();
|
|
53
|
+
},
|
|
54
|
+
getYear: (date) => date.year(),
|
|
55
|
+
getMonth: (date) => date.month(),
|
|
56
|
+
getDate: (date) => date.date(),
|
|
57
|
+
getHour: (date) => date.hour(),
|
|
58
|
+
getMinute: (date) => date.minute(),
|
|
59
|
+
getSecond: (date) => date.second(),
|
|
60
|
+
getMillisecond: (date) => date.millisecond(),
|
|
61
|
+
addYear: (date, diff) => date.add(diff, "year"),
|
|
62
|
+
addMonth: (date, diff) => date.add(diff, "month"),
|
|
63
|
+
addDate: (date, diff) => date.add(diff, "day"),
|
|
64
|
+
setYear: (date, year) => date.year(year),
|
|
65
|
+
setMonth: (date, month) => date.month(month),
|
|
66
|
+
setDate: (date, num) => date.date(num),
|
|
67
|
+
setHour: (date, hour) => date.hour(hour),
|
|
68
|
+
setMinute: (date, minute) => date.minute(minute),
|
|
69
|
+
setSecond: (date, second) => date.second(second),
|
|
70
|
+
setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),
|
|
71
|
+
isAfter: (date1, date2) => date1.isAfter(date2),
|
|
72
|
+
isValidate: (date) => date.isValid(),
|
|
73
|
+
locale: {
|
|
74
|
+
getWeekFirstDay: (locale) => dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek(),
|
|
75
|
+
getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),
|
|
76
|
+
getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),
|
|
77
|
+
getShortWeekDays: (locale) => dayjs().locale(parseLocale(locale)).localeData().weekdaysMin(),
|
|
78
|
+
getShortMonths: (locale) => dayjs().locale(parseLocale(locale)).localeData().monthsShort(),
|
|
79
|
+
format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),
|
|
80
|
+
parse: (locale, text, formats) => {
|
|
81
|
+
const localeStr = parseLocale(locale);
|
|
82
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
83
|
+
const format = formats[i];
|
|
84
|
+
const formatText = text;
|
|
85
|
+
if (format.includes("wo") || format.includes("Wo")) {
|
|
86
|
+
const year = formatText.split("-")[0];
|
|
87
|
+
const weekStr = formatText.split("-")[1];
|
|
88
|
+
const firstWeek = dayjs(year, "YYYY").startOf("year").locale(localeStr);
|
|
89
|
+
for (let j = 0; j <= 52; j += 1) {
|
|
90
|
+
const nextWeek = firstWeek.add(j, "week");
|
|
91
|
+
if (nextWeek.format("Wo") === weekStr) return nextWeek;
|
|
92
|
+
}
|
|
93
|
+
parseNoMatchNotice();
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const date = dayjs(formatText, format, true).locale(localeStr);
|
|
97
|
+
if (date.isValid()) return date;
|
|
98
|
+
}
|
|
99
|
+
if (text) parseNoMatchNotice();
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export { dayjs_default as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface GenerateConfig<DateType> {
|
|
2
|
+
getWeekDay: (value: DateType) => number;
|
|
3
|
+
getMillisecond: (value: DateType) => number;
|
|
4
|
+
getSecond: (value: DateType) => number;
|
|
5
|
+
getMinute: (value: DateType) => number;
|
|
6
|
+
getHour: (value: DateType) => number;
|
|
7
|
+
getDate: (value: DateType) => number;
|
|
8
|
+
getMonth: (value: DateType) => number;
|
|
9
|
+
getYear: (value: DateType) => number;
|
|
10
|
+
getNow: () => DateType;
|
|
11
|
+
getFixedDate: (fixed: string) => DateType;
|
|
12
|
+
getEndDate: (value: DateType) => DateType;
|
|
13
|
+
addYear: (value: DateType, diff: number) => DateType;
|
|
14
|
+
addMonth: (value: DateType, diff: number) => DateType;
|
|
15
|
+
addDate: (value: DateType, diff: number) => DateType;
|
|
16
|
+
setYear: (value: DateType, year: number) => DateType;
|
|
17
|
+
setMonth: (value: DateType, month: number) => DateType;
|
|
18
|
+
setDate: (value: DateType, date: number) => DateType;
|
|
19
|
+
setHour: (value: DateType, hour: number) => DateType;
|
|
20
|
+
setMinute: (value: DateType, minute: number) => DateType;
|
|
21
|
+
setSecond: (value: DateType, second: number) => DateType;
|
|
22
|
+
setMillisecond: (value: DateType, millisecond: number) => DateType;
|
|
23
|
+
isAfter: (date1: DateType, date2: DateType) => boolean;
|
|
24
|
+
isValidate: (date: DateType) => boolean;
|
|
25
|
+
locale: {
|
|
26
|
+
getWeekFirstDay: (locale: string) => number | undefined;
|
|
27
|
+
getWeekFirstDate: (locale: string, value: DateType) => DateType;
|
|
28
|
+
getWeek: (locale: string, value: DateType) => number;
|
|
29
|
+
format: (locale: string, date: DateType, format: string) => string | null;
|
|
30
|
+
/** Should only return validate date instance */
|
|
31
|
+
parse: (locale: string, text: string, formats: string[]) => DateType | null;
|
|
32
|
+
/** A proxy for getting locale with moment or other locale library */
|
|
33
|
+
getShortWeekDays?: (locale: string) => string[];
|
|
34
|
+
/** A proxy for getting locale with moment or other locale library */
|
|
35
|
+
getShortMonths?: (locale: string) => string[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
File without changes
|