@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,75 @@
|
|
|
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 luxon = require("luxon");
|
|
7
|
+
var weekDayFormatMap = {
|
|
8
|
+
zh_CN: "narrow",
|
|
9
|
+
zh_TW: "narrow"
|
|
10
|
+
};
|
|
11
|
+
var weekDayLengthMap = {
|
|
12
|
+
en_US: 2,
|
|
13
|
+
en_GB: 2
|
|
14
|
+
};
|
|
15
|
+
function normalizeFormatPart(part) {
|
|
16
|
+
return part.replace(/Y/g, "y").replace(/D/g, "d").replace(/gg/g, "kk").replace(/Q/g, "q").replace(/([Ww])o/g, "WW").replace(/A/g, "a");
|
|
17
|
+
}
|
|
18
|
+
function normalizeFormat(format) {
|
|
19
|
+
return format.split(/[[\]]/).map((part, index) => {
|
|
20
|
+
return index % 2 > 0 ? part : normalizeFormatPart(part);
|
|
21
|
+
}).join("'");
|
|
22
|
+
}
|
|
23
|
+
var normalizeLocale = (locale) => locale.replace(/_/g, "-");
|
|
24
|
+
var generateConfig = {
|
|
25
|
+
getNow: () => {
|
|
26
|
+
return luxon.DateTime.now();
|
|
27
|
+
},
|
|
28
|
+
getFixedDate: (string) => luxon.DateTime.fromFormat(string, "yyyy-MM-dd"),
|
|
29
|
+
getEndDate: (date) => date.endOf("month"),
|
|
30
|
+
getWeekDay: (date) => date.weekday,
|
|
31
|
+
getYear: (date) => date.year,
|
|
32
|
+
getMonth: (date) => date.month - 1,
|
|
33
|
+
getDate: (date) => date.day,
|
|
34
|
+
getHour: (date) => date.hour,
|
|
35
|
+
getMinute: (date) => date.minute,
|
|
36
|
+
getSecond: (date) => date.second,
|
|
37
|
+
getMillisecond: (date) => date.millisecond,
|
|
38
|
+
addYear: (date, diff) => date.plus({ year: diff }),
|
|
39
|
+
addMonth: (date, diff) => date.plus({ month: diff }),
|
|
40
|
+
addDate: (date, diff) => date.plus({ day: diff }),
|
|
41
|
+
setYear: (date, year) => date.set({ year }),
|
|
42
|
+
setMonth: (date, month) => date.set({ month: month + 1 }),
|
|
43
|
+
setDate: (date, day) => date.set({ day }),
|
|
44
|
+
setHour: (date, hour) => date.set({ hour }),
|
|
45
|
+
setMinute: (date, minute) => date.set({ minute }),
|
|
46
|
+
setSecond: (date, second) => date.set({ second }),
|
|
47
|
+
setMillisecond: (date, milliseconds) => date.set({ millisecond: milliseconds }),
|
|
48
|
+
isAfter: (date1, date2) => date1 > date2,
|
|
49
|
+
isValidate: (date) => date.isValid,
|
|
50
|
+
locale: {
|
|
51
|
+
getWeekFirstDate: (locale, date) => date.setLocale(normalizeLocale(locale)).startOf("week"),
|
|
52
|
+
getWeekFirstDay: (locale) => luxon.DateTime.local().setLocale(normalizeLocale(locale)).startOf("week").weekday,
|
|
53
|
+
getWeek: (locale, date) => date.setLocale(normalizeLocale(locale)).weekNumber,
|
|
54
|
+
getShortWeekDays: (locale) => {
|
|
55
|
+
const shifted = luxon.Info.weekdays(weekDayFormatMap[locale] || "short", { locale: normalizeLocale(locale) }).map((weekday) => weekday.slice(0, weekDayLengthMap[locale]));
|
|
56
|
+
shifted.unshift(shifted.pop());
|
|
57
|
+
return shifted;
|
|
58
|
+
},
|
|
59
|
+
getShortMonths: (locale) => luxon.Info.months("short", { locale: normalizeLocale(locale) }),
|
|
60
|
+
format: (locale, date, format) => {
|
|
61
|
+
if (!date || !date.isValid) return null;
|
|
62
|
+
return date.setLocale(normalizeLocale(locale)).toFormat(normalizeFormat(format));
|
|
63
|
+
},
|
|
64
|
+
parse: (locale, text, formats) => {
|
|
65
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
66
|
+
const normalizedFormat = normalizeFormat(formats[i]);
|
|
67
|
+
const date = luxon.DateTime.fromFormat(text, normalizedFormat, { locale: normalizeLocale(locale) });
|
|
68
|
+
if (date.isValid) return date;
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var luxon_default = generateConfig;
|
|
75
|
+
exports.default = luxon_default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DateTime, Info } from "luxon";
|
|
2
|
+
var weekDayFormatMap = {
|
|
3
|
+
zh_CN: "narrow",
|
|
4
|
+
zh_TW: "narrow"
|
|
5
|
+
};
|
|
6
|
+
var weekDayLengthMap = {
|
|
7
|
+
en_US: 2,
|
|
8
|
+
en_GB: 2
|
|
9
|
+
};
|
|
10
|
+
function normalizeFormatPart(part) {
|
|
11
|
+
return part.replace(/Y/g, "y").replace(/D/g, "d").replace(/gg/g, "kk").replace(/Q/g, "q").replace(/([Ww])o/g, "WW").replace(/A/g, "a");
|
|
12
|
+
}
|
|
13
|
+
function normalizeFormat(format) {
|
|
14
|
+
return format.split(/[[\]]/).map((part, index) => {
|
|
15
|
+
return index % 2 > 0 ? part : normalizeFormatPart(part);
|
|
16
|
+
}).join("'");
|
|
17
|
+
}
|
|
18
|
+
var normalizeLocale = (locale) => locale.replace(/_/g, "-");
|
|
19
|
+
var luxon_default = {
|
|
20
|
+
getNow: () => {
|
|
21
|
+
return DateTime.now();
|
|
22
|
+
},
|
|
23
|
+
getFixedDate: (string) => DateTime.fromFormat(string, "yyyy-MM-dd"),
|
|
24
|
+
getEndDate: (date) => date.endOf("month"),
|
|
25
|
+
getWeekDay: (date) => date.weekday,
|
|
26
|
+
getYear: (date) => date.year,
|
|
27
|
+
getMonth: (date) => date.month - 1,
|
|
28
|
+
getDate: (date) => date.day,
|
|
29
|
+
getHour: (date) => date.hour,
|
|
30
|
+
getMinute: (date) => date.minute,
|
|
31
|
+
getSecond: (date) => date.second,
|
|
32
|
+
getMillisecond: (date) => date.millisecond,
|
|
33
|
+
addYear: (date, diff) => date.plus({ year: diff }),
|
|
34
|
+
addMonth: (date, diff) => date.plus({ month: diff }),
|
|
35
|
+
addDate: (date, diff) => date.plus({ day: diff }),
|
|
36
|
+
setYear: (date, year) => date.set({ year }),
|
|
37
|
+
setMonth: (date, month) => date.set({ month: month + 1 }),
|
|
38
|
+
setDate: (date, day) => date.set({ day }),
|
|
39
|
+
setHour: (date, hour) => date.set({ hour }),
|
|
40
|
+
setMinute: (date, minute) => date.set({ minute }),
|
|
41
|
+
setSecond: (date, second) => date.set({ second }),
|
|
42
|
+
setMillisecond: (date, milliseconds) => date.set({ millisecond: milliseconds }),
|
|
43
|
+
isAfter: (date1, date2) => date1 > date2,
|
|
44
|
+
isValidate: (date) => date.isValid,
|
|
45
|
+
locale: {
|
|
46
|
+
getWeekFirstDate: (locale, date) => date.setLocale(normalizeLocale(locale)).startOf("week"),
|
|
47
|
+
getWeekFirstDay: (locale) => DateTime.local().setLocale(normalizeLocale(locale)).startOf("week").weekday,
|
|
48
|
+
getWeek: (locale, date) => date.setLocale(normalizeLocale(locale)).weekNumber,
|
|
49
|
+
getShortWeekDays: (locale) => {
|
|
50
|
+
const shifted = Info.weekdays(weekDayFormatMap[locale] || "short", { locale: normalizeLocale(locale) }).map((weekday) => weekday.slice(0, weekDayLengthMap[locale]));
|
|
51
|
+
shifted.unshift(shifted.pop());
|
|
52
|
+
return shifted;
|
|
53
|
+
},
|
|
54
|
+
getShortMonths: (locale) => Info.months("short", { locale: normalizeLocale(locale) }),
|
|
55
|
+
format: (locale, date, format) => {
|
|
56
|
+
if (!date || !date.isValid) return null;
|
|
57
|
+
return date.setLocale(normalizeLocale(locale)).toFormat(normalizeFormat(format));
|
|
58
|
+
},
|
|
59
|
+
parse: (locale, text, formats) => {
|
|
60
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
61
|
+
const normalizedFormat = normalizeFormat(formats[i]);
|
|
62
|
+
const date = DateTime.fromFormat(text, normalizedFormat, { locale: normalizeLocale(locale) });
|
|
63
|
+
if (date.isValid) return date;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export { luxon_default as default };
|
|
@@ -0,0 +1,107 @@
|
|
|
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 _v_c_util_dist_warning = require("@v-c/util/dist/warning");
|
|
7
|
+
let moment = require("moment");
|
|
8
|
+
moment = require_rolldown_runtime.__toESM(moment);
|
|
9
|
+
var generateConfig = {
|
|
10
|
+
getNow: () => (0, moment.default)(),
|
|
11
|
+
getFixedDate: (string) => (0, moment.default)(string, "YYYY-MM-DD"),
|
|
12
|
+
getEndDate: (date) => {
|
|
13
|
+
return date.clone().endOf("month");
|
|
14
|
+
},
|
|
15
|
+
getWeekDay: (date) => {
|
|
16
|
+
const clone = date.clone().locale("en_US");
|
|
17
|
+
return clone.weekday() + clone.localeData().firstDayOfWeek();
|
|
18
|
+
},
|
|
19
|
+
getYear: (date) => date.year(),
|
|
20
|
+
getMonth: (date) => date.month(),
|
|
21
|
+
getDate: (date) => date.date(),
|
|
22
|
+
getHour: (date) => date.hour(),
|
|
23
|
+
getMinute: (date) => date.minute(),
|
|
24
|
+
getSecond: (date) => date.second(),
|
|
25
|
+
getMillisecond: (date) => date.millisecond(),
|
|
26
|
+
addYear: (date, diff) => {
|
|
27
|
+
return date.clone().add(diff, "year");
|
|
28
|
+
},
|
|
29
|
+
addMonth: (date, diff) => {
|
|
30
|
+
return date.clone().add(diff, "month");
|
|
31
|
+
},
|
|
32
|
+
addDate: (date, diff) => {
|
|
33
|
+
return date.clone().add(diff, "day");
|
|
34
|
+
},
|
|
35
|
+
setYear: (date, year) => {
|
|
36
|
+
return date.clone().year(year);
|
|
37
|
+
},
|
|
38
|
+
setMonth: (date, month) => {
|
|
39
|
+
return date.clone().month(month);
|
|
40
|
+
},
|
|
41
|
+
setDate: (date, num) => {
|
|
42
|
+
return date.clone().date(num);
|
|
43
|
+
},
|
|
44
|
+
setHour: (date, hour) => {
|
|
45
|
+
return date.clone().hour(hour);
|
|
46
|
+
},
|
|
47
|
+
setMinute: (date, minute) => {
|
|
48
|
+
return date.clone().minute(minute);
|
|
49
|
+
},
|
|
50
|
+
setSecond: (date, second) => {
|
|
51
|
+
return date.clone().second(second);
|
|
52
|
+
},
|
|
53
|
+
setMillisecond: (date, millisecond) => {
|
|
54
|
+
return date.clone().millisecond(millisecond);
|
|
55
|
+
},
|
|
56
|
+
isAfter: (date1, date2) => date1.isAfter(date2),
|
|
57
|
+
isValidate: (date) => date.isValid(),
|
|
58
|
+
locale: {
|
|
59
|
+
getWeekFirstDay: (locale) => {
|
|
60
|
+
return (0, moment.default)().locale(locale).localeData().firstDayOfWeek();
|
|
61
|
+
},
|
|
62
|
+
getWeekFirstDate: (locale, date) => {
|
|
63
|
+
return date.clone().locale(locale).weekday(0);
|
|
64
|
+
},
|
|
65
|
+
getWeek: (locale, date) => {
|
|
66
|
+
return date.clone().locale(locale).week();
|
|
67
|
+
},
|
|
68
|
+
getShortWeekDays: (locale) => {
|
|
69
|
+
return (0, moment.default)().locale(locale).localeData().weekdaysMin();
|
|
70
|
+
},
|
|
71
|
+
getShortMonths: (locale) => {
|
|
72
|
+
return (0, moment.default)().locale(locale).localeData().monthsShort();
|
|
73
|
+
},
|
|
74
|
+
format: (locale, date, format) => {
|
|
75
|
+
return date.clone().locale(locale).format(format);
|
|
76
|
+
},
|
|
77
|
+
parse: (locale, text, formats) => {
|
|
78
|
+
const fallbackFormatList = [];
|
|
79
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
80
|
+
let format = formats[i];
|
|
81
|
+
let formatText = text;
|
|
82
|
+
if (format.includes("wo") || format.includes("Wo")) {
|
|
83
|
+
format = format.replace(/wo/g, "w").replace(/Wo/g, "W");
|
|
84
|
+
const matchFormat = format.match(/[-YyMmDdHhSsWwGg]+/g);
|
|
85
|
+
const matchText = formatText.match(/[-\d]+/g);
|
|
86
|
+
if (matchFormat && matchText) {
|
|
87
|
+
format = matchFormat.join("");
|
|
88
|
+
formatText = matchText.join("");
|
|
89
|
+
} else fallbackFormatList.push(format.replace(/o/g, ""));
|
|
90
|
+
}
|
|
91
|
+
const date = (0, moment.default)(formatText, format, locale, true);
|
|
92
|
+
if (date.isValid()) return date;
|
|
93
|
+
}
|
|
94
|
+
for (let i = 0; i < fallbackFormatList.length; i += 1) {
|
|
95
|
+
const date = (0, moment.default)(text, fallbackFormatList[i], locale, false);
|
|
96
|
+
/* istanbul ignore next */
|
|
97
|
+
if (date.isValid()) {
|
|
98
|
+
(0, _v_c_util_dist_warning.noteOnce)(false, "Not match any format strictly and fallback to fuzzy match. Please help to fire a issue about this.");
|
|
99
|
+
return date;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var moment_default = generateConfig;
|
|
107
|
+
exports.default = moment_default;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { noteOnce } from "@v-c/util/dist/warning";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
var moment_default = {
|
|
4
|
+
getNow: () => moment(),
|
|
5
|
+
getFixedDate: (string) => moment(string, "YYYY-MM-DD"),
|
|
6
|
+
getEndDate: (date) => {
|
|
7
|
+
return date.clone().endOf("month");
|
|
8
|
+
},
|
|
9
|
+
getWeekDay: (date) => {
|
|
10
|
+
const clone = date.clone().locale("en_US");
|
|
11
|
+
return clone.weekday() + clone.localeData().firstDayOfWeek();
|
|
12
|
+
},
|
|
13
|
+
getYear: (date) => date.year(),
|
|
14
|
+
getMonth: (date) => date.month(),
|
|
15
|
+
getDate: (date) => date.date(),
|
|
16
|
+
getHour: (date) => date.hour(),
|
|
17
|
+
getMinute: (date) => date.minute(),
|
|
18
|
+
getSecond: (date) => date.second(),
|
|
19
|
+
getMillisecond: (date) => date.millisecond(),
|
|
20
|
+
addYear: (date, diff) => {
|
|
21
|
+
return date.clone().add(diff, "year");
|
|
22
|
+
},
|
|
23
|
+
addMonth: (date, diff) => {
|
|
24
|
+
return date.clone().add(diff, "month");
|
|
25
|
+
},
|
|
26
|
+
addDate: (date, diff) => {
|
|
27
|
+
return date.clone().add(diff, "day");
|
|
28
|
+
},
|
|
29
|
+
setYear: (date, year) => {
|
|
30
|
+
return date.clone().year(year);
|
|
31
|
+
},
|
|
32
|
+
setMonth: (date, month) => {
|
|
33
|
+
return date.clone().month(month);
|
|
34
|
+
},
|
|
35
|
+
setDate: (date, num) => {
|
|
36
|
+
return date.clone().date(num);
|
|
37
|
+
},
|
|
38
|
+
setHour: (date, hour) => {
|
|
39
|
+
return date.clone().hour(hour);
|
|
40
|
+
},
|
|
41
|
+
setMinute: (date, minute) => {
|
|
42
|
+
return date.clone().minute(minute);
|
|
43
|
+
},
|
|
44
|
+
setSecond: (date, second) => {
|
|
45
|
+
return date.clone().second(second);
|
|
46
|
+
},
|
|
47
|
+
setMillisecond: (date, millisecond) => {
|
|
48
|
+
return date.clone().millisecond(millisecond);
|
|
49
|
+
},
|
|
50
|
+
isAfter: (date1, date2) => date1.isAfter(date2),
|
|
51
|
+
isValidate: (date) => date.isValid(),
|
|
52
|
+
locale: {
|
|
53
|
+
getWeekFirstDay: (locale) => {
|
|
54
|
+
return moment().locale(locale).localeData().firstDayOfWeek();
|
|
55
|
+
},
|
|
56
|
+
getWeekFirstDate: (locale, date) => {
|
|
57
|
+
return date.clone().locale(locale).weekday(0);
|
|
58
|
+
},
|
|
59
|
+
getWeek: (locale, date) => {
|
|
60
|
+
return date.clone().locale(locale).week();
|
|
61
|
+
},
|
|
62
|
+
getShortWeekDays: (locale) => {
|
|
63
|
+
return moment().locale(locale).localeData().weekdaysMin();
|
|
64
|
+
},
|
|
65
|
+
getShortMonths: (locale) => {
|
|
66
|
+
return moment().locale(locale).localeData().monthsShort();
|
|
67
|
+
},
|
|
68
|
+
format: (locale, date, format) => {
|
|
69
|
+
return date.clone().locale(locale).format(format);
|
|
70
|
+
},
|
|
71
|
+
parse: (locale, text, formats) => {
|
|
72
|
+
const fallbackFormatList = [];
|
|
73
|
+
for (let i = 0; i < formats.length; i += 1) {
|
|
74
|
+
let format = formats[i];
|
|
75
|
+
let formatText = text;
|
|
76
|
+
if (format.includes("wo") || format.includes("Wo")) {
|
|
77
|
+
format = format.replace(/wo/g, "w").replace(/Wo/g, "W");
|
|
78
|
+
const matchFormat = format.match(/[-YyMmDdHhSsWwGg]+/g);
|
|
79
|
+
const matchText = formatText.match(/[-\d]+/g);
|
|
80
|
+
if (matchFormat && matchText) {
|
|
81
|
+
format = matchFormat.join("");
|
|
82
|
+
formatText = matchText.join("");
|
|
83
|
+
} else fallbackFormatList.push(format.replace(/o/g, ""));
|
|
84
|
+
}
|
|
85
|
+
const date = moment(formatText, format, locale, true);
|
|
86
|
+
if (date.isValid()) return date;
|
|
87
|
+
}
|
|
88
|
+
for (let i = 0; i < fallbackFormatList.length; i += 1) {
|
|
89
|
+
const date = moment(text, fallbackFormatList[i], locale, false);
|
|
90
|
+
/* istanbul ignore next */
|
|
91
|
+
if (date.isValid()) {
|
|
92
|
+
noteOnce(false, "Not match any format strictly and fallback to fuzzy match. Please help to fire a issue about this.");
|
|
93
|
+
return date;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export { moment_default as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
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_en_US = require("../locale/en_US.cjs");
|
|
7
|
+
let vue = require("vue");
|
|
8
|
+
function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {
|
|
9
|
+
let timeFormat = "";
|
|
10
|
+
const cells = [];
|
|
11
|
+
if (showHour) cells.push(showMeridiem ? "hh" : "HH");
|
|
12
|
+
if (showMinute) cells.push("mm");
|
|
13
|
+
if (showSecond) cells.push("ss");
|
|
14
|
+
timeFormat = cells.join(":");
|
|
15
|
+
if (showMillisecond) timeFormat += ".SSS";
|
|
16
|
+
if (showMeridiem) timeFormat += " A";
|
|
17
|
+
return timeFormat;
|
|
18
|
+
}
|
|
19
|
+
function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
|
|
20
|
+
const mergedLocale = locale || require_en_US.default || {};
|
|
21
|
+
const { fieldDateTimeFormat, fieldDateFormat, fieldTimeFormat, fieldMonthFormat, fieldYearFormat, fieldWeekFormat, fieldQuarterFormat, yearFormat, cellYearFormat, cellQuarterFormat, dayFormat, cellDateFormat } = mergedLocale;
|
|
22
|
+
const timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);
|
|
23
|
+
return {
|
|
24
|
+
...mergedLocale,
|
|
25
|
+
fieldDateTimeFormat: fieldDateTimeFormat || `YYYY-MM-DD ${timeFormat}`,
|
|
26
|
+
fieldDateFormat: fieldDateFormat || "YYYY-MM-DD",
|
|
27
|
+
fieldTimeFormat: fieldTimeFormat || timeFormat,
|
|
28
|
+
fieldMonthFormat: fieldMonthFormat || "YYYY-MM",
|
|
29
|
+
fieldYearFormat: fieldYearFormat || "YYYY",
|
|
30
|
+
fieldWeekFormat: fieldWeekFormat || "gggg-wo",
|
|
31
|
+
fieldQuarterFormat: fieldQuarterFormat || "YYYY-[Q]Q",
|
|
32
|
+
yearFormat: yearFormat || "YYYY",
|
|
33
|
+
cellYearFormat: cellYearFormat || "YYYY",
|
|
34
|
+
cellQuarterFormat: cellQuarterFormat || "[Q]Q",
|
|
35
|
+
cellDateFormat: cellDateFormat || dayFormat || "D"
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function useLocale(locale, showProps) {
|
|
39
|
+
return (0, vue.computed)(() => {
|
|
40
|
+
const { showHour, showMinute, showSecond, showMillisecond, use12Hours } = showProps.value || {};
|
|
41
|
+
return fillLocale(locale.value, showHour, showMinute, showSecond, showMillisecond, use12Hours);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.default = useLocale;
|
|
45
|
+
exports.fillTimeFormat = fillTimeFormat;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { Locale, SharedTimeProps } from '../interface';
|
|
3
|
+
export declare function fillTimeFormat(showHour: boolean | undefined, showMinute: boolean | undefined, showSecond: boolean | undefined, showMillisecond: boolean | undefined, showMeridiem: boolean | undefined): string;
|
|
4
|
+
/**
|
|
5
|
+
* Fill locale format as start up
|
|
6
|
+
*/
|
|
7
|
+
type ShowProps<DateType extends object> = Pick<SharedTimeProps<DateType>, 'showHour' | 'showMinute' | 'showSecond' | 'showMillisecond' | 'use12Hours'>;
|
|
8
|
+
export default function useLocale<DateType extends object>(locale: ComputedRef<Locale | undefined>, showProps: ComputedRef<ShowProps<DateType>> | Ref<ShowProps<DateType>>): ComputedRef<Locale>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import en_US_default from "../locale/en_US.js";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {
|
|
4
|
+
let timeFormat = "";
|
|
5
|
+
const cells = [];
|
|
6
|
+
if (showHour) cells.push(showMeridiem ? "hh" : "HH");
|
|
7
|
+
if (showMinute) cells.push("mm");
|
|
8
|
+
if (showSecond) cells.push("ss");
|
|
9
|
+
timeFormat = cells.join(":");
|
|
10
|
+
if (showMillisecond) timeFormat += ".SSS";
|
|
11
|
+
if (showMeridiem) timeFormat += " A";
|
|
12
|
+
return timeFormat;
|
|
13
|
+
}
|
|
14
|
+
function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
|
|
15
|
+
const mergedLocale = locale || en_US_default || {};
|
|
16
|
+
const { fieldDateTimeFormat, fieldDateFormat, fieldTimeFormat, fieldMonthFormat, fieldYearFormat, fieldWeekFormat, fieldQuarterFormat, yearFormat, cellYearFormat, cellQuarterFormat, dayFormat, cellDateFormat } = mergedLocale;
|
|
17
|
+
const timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);
|
|
18
|
+
return {
|
|
19
|
+
...mergedLocale,
|
|
20
|
+
fieldDateTimeFormat: fieldDateTimeFormat || `YYYY-MM-DD ${timeFormat}`,
|
|
21
|
+
fieldDateFormat: fieldDateFormat || "YYYY-MM-DD",
|
|
22
|
+
fieldTimeFormat: fieldTimeFormat || timeFormat,
|
|
23
|
+
fieldMonthFormat: fieldMonthFormat || "YYYY-MM",
|
|
24
|
+
fieldYearFormat: fieldYearFormat || "YYYY",
|
|
25
|
+
fieldWeekFormat: fieldWeekFormat || "gggg-wo",
|
|
26
|
+
fieldQuarterFormat: fieldQuarterFormat || "YYYY-[Q]Q",
|
|
27
|
+
yearFormat: yearFormat || "YYYY",
|
|
28
|
+
cellYearFormat: cellYearFormat || "YYYY",
|
|
29
|
+
cellQuarterFormat: cellQuarterFormat || "[Q]Q",
|
|
30
|
+
cellDateFormat: cellDateFormat || dayFormat || "D"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function useLocale(locale, showProps) {
|
|
34
|
+
return computed(() => {
|
|
35
|
+
const { showHour, showMinute, showSecond, showMillisecond, use12Hours } = showProps.value || {};
|
|
36
|
+
return fillLocale(locale.value, showHour, showMinute, showSecond, showMillisecond, use12Hours);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { useLocale as default, fillTimeFormat };
|
|
@@ -0,0 +1,18 @@
|
|
|
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 vue = require("vue");
|
|
7
|
+
function useSemantic(classNames, styles) {
|
|
8
|
+
return (0, vue.computed)(() => {
|
|
9
|
+
return [{
|
|
10
|
+
...classNames?.value || {},
|
|
11
|
+
popup: classNames?.value?.popup || {}
|
|
12
|
+
}, {
|
|
13
|
+
...styles?.value || {},
|
|
14
|
+
popup: styles?.value?.popup || {}
|
|
15
|
+
}];
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.default = useSemantic;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SharedPickerProps } from '../interface';
|
|
3
|
+
export type FilledPanelClassNames = NonNullable<SharedPickerProps['classNames']>['popup'];
|
|
4
|
+
export type FilledPanelStyles = NonNullable<SharedPickerProps['styles']>['popup'];
|
|
5
|
+
export type FilledClassNames = NonNullable<SharedPickerProps['classNames']> & {
|
|
6
|
+
popup: FilledPanelClassNames;
|
|
7
|
+
};
|
|
8
|
+
export type FilledStyles = NonNullable<SharedPickerProps['styles']> & {
|
|
9
|
+
popup: FilledPanelStyles;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Convert `classNames` & `styles` to a fully filled object
|
|
13
|
+
*/
|
|
14
|
+
export default function useSemantic(classNames?: Ref<SharedPickerProps['classNames']>, styles?: Ref<SharedPickerProps['styles']>): import('vue').ComputedRef<readonly [FilledClassNames, FilledStyles]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
function useSemantic(classNames, styles) {
|
|
3
|
+
return computed(() => {
|
|
4
|
+
return [{
|
|
5
|
+
...classNames?.value || {},
|
|
6
|
+
popup: classNames?.value?.popup || {}
|
|
7
|
+
}, {
|
|
8
|
+
...styles?.value || {},
|
|
9
|
+
popup: styles?.value?.popup || {}
|
|
10
|
+
}];
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { useSemantic as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
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 vue = require("vue");
|
|
7
|
+
function useSyncState(defaultValue, controlledValue) {
|
|
8
|
+
const valueRef = (0, vue.ref)(defaultValue);
|
|
9
|
+
const getControlledValue = () => {
|
|
10
|
+
if (typeof controlledValue === "function") return controlledValue();
|
|
11
|
+
return controlledValue?.value;
|
|
12
|
+
};
|
|
13
|
+
const getter = (useControlledValueFirst) => {
|
|
14
|
+
const controlled = getControlledValue();
|
|
15
|
+
return useControlledValueFirst && controlled !== void 0 ? controlled : valueRef.value;
|
|
16
|
+
};
|
|
17
|
+
const setter = (nextValue) => {
|
|
18
|
+
valueRef.value = nextValue;
|
|
19
|
+
};
|
|
20
|
+
(0, vue.watch)(() => getControlledValue(), (val) => {
|
|
21
|
+
if (val !== void 0) valueRef.value = val;
|
|
22
|
+
});
|
|
23
|
+
return [
|
|
24
|
+
getter,
|
|
25
|
+
setter,
|
|
26
|
+
valueRef
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
exports.default = useSyncState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Sync value with state.
|
|
4
|
+
* This should only used for internal which not affect outside calculation.
|
|
5
|
+
* Since it's not safe for suspense.
|
|
6
|
+
*/
|
|
7
|
+
export default function useSyncState<T>(defaultValue: T, controlledValue?: Ref<T | undefined> | (() => T | undefined)): [getter: (useControlledValueFirst?: boolean) => T, setter: (nextValue: T) => void, value: Ref<T>];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
function useSyncState(defaultValue, controlledValue) {
|
|
3
|
+
const valueRef = ref(defaultValue);
|
|
4
|
+
const getControlledValue = () => {
|
|
5
|
+
if (typeof controlledValue === "function") return controlledValue();
|
|
6
|
+
return controlledValue?.value;
|
|
7
|
+
};
|
|
8
|
+
const getter = (useControlledValueFirst) => {
|
|
9
|
+
const controlled = getControlledValue();
|
|
10
|
+
return useControlledValueFirst && controlled !== void 0 ? controlled : valueRef.value;
|
|
11
|
+
};
|
|
12
|
+
const setter = (nextValue) => {
|
|
13
|
+
valueRef.value = nextValue;
|
|
14
|
+
};
|
|
15
|
+
watch(() => getControlledValue(), (val) => {
|
|
16
|
+
if (val !== void 0) valueRef.value = val;
|
|
17
|
+
});
|
|
18
|
+
return [
|
|
19
|
+
getter,
|
|
20
|
+
setter,
|
|
21
|
+
valueRef
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
export { useSyncState as default };
|