"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),ue=require("@ant-design/icons-vue/CalendarOutlined"),ce=require("@ant-design/icons-vue/ClockCircleOutlined"),se=require("@ant-design/icons-vue/CloseCircleFilled"),ie=require("@ant-design/icons-vue/SwapRightOutlined"),I=require("./index.js"),F=require("../../_util/classNames.js"),de=require("../../_util/omit.js"),N=require("../../_util/statusUtils.js"),pe=require("../../config-provider/hooks/useConfigInject.js"),b=require("../../form/FormItemContext.js"),ve=require("../../locale/LocaleReceiver.js"),me=require("../../space/Compact.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 fe=require("../../vc-picker/RangePicker.js"),Ce=require("../locale/en_US.js"),ge=require("../style/index.js"),R=require("../util.js"),S=require("./props.js");function Pe(s,$){return a.defineComponent({compatConfig:{MODE:3},name:"ARangePicker",inheritAttrs:!1,props:{...S.commonProps(),...S.rangePickerProps(),...$},slots:Object,setup(O,{expose:w,slots:t,attrs:v,emit:o}){const e=O,m=b.useInjectFormItemContext(),i=b.FormItemInputContext.useInject(),{prefixCls:f,direction:C,getPopupContainer:D,size:T,rootPrefixCls:j,disabled:z}=pe.default("picker",e),{compactSize:A,compactItemClassnames:E}=me.useCompactItemContext(f,C),x=a.computed(()=>A.value||T.value),[M,k]=ge.default(f),g=a.ref();w({focus:()=>{g.value?.focus()},blur:()=>{g.value?.blur()}});const d=r=>e.valueFormat?s.toString(r,e.valueFormat):r,U=(r,n)=>{const u=d(r);o("update:value",u),o("change",u,n),m.onFieldChange()},B=r=>{o("update:open",r),o("openChange",r)},L=r=>{o("focus",r)},_=r=>{o("blur",r),m.onFieldBlur()},y=(r,n)=>{const u=d(r);o("panelChange",u,n)},G=r=>{const n=d(r);o("ok",n)},H=(r,n,u)=>{const P=d(r);o("calendarChange",P,n,u)},[J]=ve.useLocaleReceiver("DatePicker",Ce.default),K=a.computed(()=>e.value&&e.valueFormat?s.toDate(e.value,e.valueFormat):e.value),Q=a.computed(()=>e.defaultValue&&e.valueFormat?s.toDate(e.defaultValue,e.valueFormat):e.defaultValue),W=a.computed(()=>e.defaultPickerValue&&e.valueFormat?s.toDate(e.defaultPickerValue,e.valueFormat):e.defaultPickerValue);return()=>{const r={...J.value,...e.locale},n={...e,...v},{prefixCls:u,bordered:P=!0,placeholder:X,suffixIcon:Y=t.suffixIcon?.(),picker:c="date",transitionName:Z,allowClear:ee=!0,dateRender:re=t.dateRender,renderExtraFooter:ae=t.renderExtraFooter,separator:ne=t.separator?.(),clearIcon:te=t.clearIcon?.(),id:oe=m.id.value,...p}=n;delete p["onUpdate:value"],delete p["onUpdate:open"];const{format:h,showTime:V}=n;let q={};q={...q,...V?I.getTimeProps({format:h,picker:c,...V}):{},...c==="time"?I.getTimeProps({format:h,...de.default(p,["disabledTime"]),picker:c}):{}};const l=f.value,le=a.createVNode(a.Fragment,null,[Y||(c==="time"?a.createVNode(ce,null,null):a.createVNode(ue,null,null)),i.hasFeedback&&i.feedbackIcon]);return M(a.createVNode(fe.default,{dateRender:re,renderExtraFooter:ae,separator:ne||a.createVNode("span",{"aria-label":"to",class:`${l}-separator`},[a.createVNode(ie,null,null)]),ref:g,dropdownAlign:R.transPlacement2DropdownAlign(C.value,e.placement),placeholder:R.getRangePlaceholder(r,c,X),suffixIcon:le,clearIcon:te||a.createVNode(se,null,null),allowClear:ee,transitionName:Z||`${j.value}-slide-up`,...p,...q,disabled:z.value,id:oe,value:K.value,defaultValue:Q.value,defaultPickerValue:W.value,picker:c,class:F.default({[`${l}-${x.value}`]:x.value,[`${l}-borderless`]:!P},N.getStatusClassNames(l,N.getMergedStatus(i.status,e.status),i.hasFeedback),v.class,k.value,E.value),locale:r.lang,prefixCls:l,getPopupContainer:v.getCalendarContainer||D.value,generateConfig:s,prevIcon:t.prevIcon?.()||a.createVNode("span",{class:`${l}-prev-icon`},null),nextIcon:t.nextIcon?.()||a.createVNode("span",{class:`${l}-next-icon`},null),superPrevIcon:t.superPrevIcon?.()||a.createVNode("span",{class:`${l}-super-prev-icon`},null),superNextIcon:t.superNextIcon?.()||a.createVNode("span",{class:`${l}-super-next-icon`},null),components:I.Components,direction:C.value,dropdownClassName:F.default(k.value,e.popupClassName,e.dropdownClassName),onChange:U,onOpenChange:B,onFocus:L,onBlur:_,onPanelChange:y,onOk:G,onCalendarChange:H},null))}}})}exports.default=Pe;
