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