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