"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../_util/classNames.js"),C=require("../../PanelContext.js"),c=require("../../utils/uiUtil.js"),T=e.defineComponent({name:"TimeUnitColumn",props:["prefixCls","units","onSelect","value","active","hideDisabledOptions"],setup(a){const{open:o}=C.useInjectPanel(),u=e.shallowRef(null),n=e.ref(new Map),i=e.ref();return e.watch(()=>a.value,()=>{const l=n.value.get(a.value);l&&o.value!==!1&&c.scrollTo(u.value,l.offsetTop,120)}),e.onBeforeUnmount(()=>{i.value?.()}),e.watch(o,()=>{i.value?.(),e.nextTick(()=>{if(o.value){const l=n.value.get(a.value);l&&(i.value=c.waitElementReady(l,()=>{c.scrollTo(u.value,l.offsetTop,0)}))}})},{immediate:!0,flush:"post"}),()=>{const{prefixCls:l,units:f,onSelect:v,value:d,active:m,hideDisabledOptions:p}=a,s=`${l}-cell`;return e.createVNode("ul",{class:r.default(`${l}-column`,{[`${l}-column-active`]:m}),ref:u,style:{position:"relative"}},[f.map(t=>p&&t.disabled?null:e.createVNode("li",{key:t.value,ref:b=>{n.value.set(t.value,b)},class:r.default(s,{[`${s}-disabled`]:t.disabled,[`${s}-selected`]:d===t.value}),onClick:()=>{t.disabled||v(t.value)}},[e.createVNode("div",{class:`${s}-inner`},[t.label])]))])}}});exports.default=T;
