"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),Ce=require("@ant-design/icons-vue/CalendarOutlined"),Pe=require("@ant-design/icons-vue/ClockCircleOutlined"),ke=require("@ant-design/icons-vue/CloseCircleFilled"),q=require("./index.js"),N=require("../../_util/classNames.js"),b=require("../../_util/statusUtils.js"),he=require("../../config-provider/hooks/useConfigInject.js"),w=require("../../form/FormItemContext.js"),ge=require("../../locale/LocaleReceiver.js"),qe=require("../../space/Compact.js"),Ie=require("../../vc-picker/Picker.js");require("../../vc-picker/panels/DatePanel/index.js");require("../../vc-picker/panels/DatetimePanel/index.js");require("../../vc-picker/panels/DecadePanel/index.js");require("../../vc-picker/panels/MonthPanel/index.js");require("../../vc-picker/panels/QuarterPanel/index.js");require("../../vc-picker/panels/TimePanel/index.js");require("../../vc-picker/panels/WeekPanel/index.js");require("../../vc-picker/panels/YearPanel/index.js");require("../../_util/raf.js");require("../../vc-trigger/Trigger.js");require("../../_util/vue-types/index.js");const xe=require("../locale/en_US.js"),Ve=require("../style/index.js"),R=require("../util.js"),S=require("./props.js");function Fe(s,T){function l(d,M){const E={...S.commonProps(),...S.datePickerProps(),...T};return t.defineComponent({compatConfig:{MODE:3},name:M,inheritAttrs:!1,props:E,slots:Object,setup(z,{slots:n,expose:B,attrs:v,emit:a}){const e=z,f=w.useInjectFormItemContext(),p=w.FormItemInputContext.useInject(),{prefixCls:C,direction:P,getPopupContainer:L,size:_,rootPrefixCls:Q,disabled:U}=he.default("picker",e),{compactSize:W,compactItemClassnames:Y}=qe.useCompactItemContext(C,P),I=t.computed(()=>W.value||_.value),[G,x]=Ve.default(C),k=t.ref();B({focus:()=>{k.value?.focus()},blur:()=>{k.value?.blur()}});const h=r=>e.valueFormat?s.toString(r,e.valueFormat):r,H=(r,o)=>{const c=h(r);a("update:value",c),a("change",c,o),f.onFieldChange()},J=r=>{a("update:open",r),a("openChange",r)},K=r=>{a("focus",r)},X=r=>{a("blur",r),f.onFieldBlur()},Z=(r,o)=>{const c=h(r);a("panelChange",c,o)},ee=r=>{const o=h(r);a("ok",o)},[re]=ge.useLocaleReceiver("DatePicker",xe.default),te=t.computed(()=>e.value?e.valueFormat?s.toDate(e.value,e.valueFormat):e.value:e.value===""?void 0:e.value),oe=t.computed(()=>e.defaultValue?e.valueFormat?s.toDate(e.defaultValue,e.valueFormat):e.defaultValue:e.defaultValue===""?void 0:e.defaultValue),ne=t.computed(()=>e.defaultPickerValue?e.valueFormat?s.toDate(e.defaultPickerValue,e.valueFormat):e.defaultPickerValue:e.defaultPickerValue===""?void 0:e.defaultPickerValue);return()=>{const r={...re.value,...e.locale},o={...e,...v},{bordered:c=!0,placeholder:ae,suffixIcon:ue=n.suffixIcon?.(),showToday:le=!0,transitionName:ce,allowClear:se=!0,dateRender:ie=n.dateRender,renderExtraFooter:de=n.renderExtraFooter,monthCellRender:pe=n.monthCellRender||e.monthCellContentRender||n.monthCellContentRender,clearIcon:me=n.clearIcon?.(),id:ve=f.id.value,...V}=o,g=o.showTime===""?!0:o.showTime,{format:F}=o;let m={};d&&(m.picker=d);const i=d||o.picker||"date";m={...m,...g?q.getTimeProps({format:F,picker:i,...typeof g=="object"?g:{}}):{},...i==="time"?q.getTimeProps({format:F,...V,picker:i}):{}};const u=C.value,fe=t.createVNode(t.Fragment,null,[ue||(d==="time"?t.createVNode(Pe,null,null):t.createVNode(Ce,null,null)),p.hasFeedback&&p.feedbackIcon]);return G(t.createVNode(Ie.default,{monthCellRender:pe,dateRender:ie,renderExtraFooter:de,ref:k,placeholder:R.getPlaceholder(r,i,ae),suffixIcon:fe,dropdownAlign:R.transPlacement2DropdownAlign(P.value,e.placement),clearIcon:me||t.createVNode(ke,null,null),allowClear:se,transitionName:ce||`${Q.value}-slide-up`,...V,...m,id:ve,picker:i,value:te.value,defaultValue:oe.value,defaultPickerValue:ne.value,showToday:le,locale:r.lang,class:N.default({[`${u}-${I.value}`]:I.value,[`${u}-borderless`]:!c},b.getStatusClassNames(u,b.getMergedStatus(p.status,e.status),p.hasFeedback),v.class,x.value,Y.value),disabled:U.value,prefixCls:u,getPopupContainer:v.getCalendarContainer||L.value,generateConfig:s,prevIcon:n.prevIcon?.()||t.createVNode("span",{class:`${u}-prev-icon`},null),nextIcon:n.nextIcon?.()||t.createVNode("span",{class:`${u}-next-icon`},null),superPrevIcon:n.superPrevIcon?.()||t.createVNode("span",{class:`${u}-super-prev-icon`},null),superNextIcon:n.superNextIcon?.()||t.createVNode("span",{class:`${u}-super-next-icon`},null),components:q.Components,direction:P.value,dropdownClassName:N.default(x.value,e.popupClassName,e.dropdownClassName),onChange:H,onOpenChange:J,onFocus:K,onBlur:X,onPanelChange:Z,onOk:ee},null))}}})}const O=l(void 0,"ADatePicker"),$=l("week","AWeekPicker"),A=l("month","AMonthPicker"),D=l("year","AYearPicker"),j=l("time","TimePicker"),y=l("quarter","AQuarterPicker");return{DatePicker:O,WeekPicker:$,MonthPicker:A,YearPicker:D,TimePicker:j,QuarterPicker:y}}exports.default=Fe;
