voiptime-components 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=(t,o)=>{const n=t.__vccOpts||t;for(const[l,a]of o)n[l]=a;return n},we={},ye={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Be(t,o){return e.openBlock(),e.createElementBlock("svg",ye,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 8L10 12L6 8",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const xe=A(we,[["render",Be]]),Se={},Ee={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ve(t,o){return e.openBlock(),e.createElementBlock("svg",Ee,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 12L10 8L14 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Me=A(Se,[["render",Ve]]),$e={},Le={width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ne(t,o){return e.openBlock(),e.createElementBlock("svg",Le,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.8789 4.90517L11.2561 4.20124C10.4045 3.33504 9.28504 2.7626 8.06789 2.5709C6.85074 2.3792 5.60245 2.57874 4.5127 3.13917C3.42296 3.69961 2.55134 4.59032 2.03031 5.67593C1.50928 6.76155 1.36732 7.98272 1.626 9.15387C1.88469 10.325 2.52987 11.3821 3.46351 12.1645C4.39716 12.9469 5.56821 13.4119 6.79871 13.4887C8.02921 13.5655 9.25189 13.25 10.2809 12.5901C11.31 11.9302 12.0891 10.962 12.5 9.83266",stroke:"currentColor","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M8.5157 6.5C8.07025 6.5 7.84716 5.96143 8.16215 5.64645L10.3086 3.5L12.455 1.35355C12.77 1.03857 13.3086 1.26165 13.3086 1.70711V6C13.3086 6.27614 13.0847 6.5 12.8086 6.5L8.5157 6.5Z",fill:"currentColor"},null,-1)]))}const ze=A($e,[["render",Ne]]),Ie={},Re={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Te(t,o){return e.openBlock(),e.createElementBlock("svg",Re,o[0]||(o[0]=[e.createElementVNode("path",{d:"M8.60352 6L12.6035 10L8.60352 14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const De=A(Ie,[["render",Te]]),We={},Pe={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function He(t,o){return e.openBlock(),e.createElementBlock("svg",Pe,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12.3984 14L8.39844 10L12.3984 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Ae=A(We,[["render",He]]),Oe={},je={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fe(t,o){return e.openBlock(),e.createElementBlock("svg",je,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12.5 1.66406L11.1783 2.94156C10.6233 3.47906 10.345 3.7474 10 3.7474C9.655 3.7474 9.37667 3.47906 8.82167 2.94156L7.5 1.66406M14.5833 5.83073C15.7533 5.83073 16.3392 5.83073 16.7592 6.11156C16.9412 6.23319 17.0975 6.3895 17.2192 6.57156C17.5 6.99156 17.5 7.5774 17.5 8.7474V15.4141C17.5 16.5841 17.5 17.1699 17.2192 17.5899C17.0975 17.772 16.9412 17.9283 16.7592 18.0499C16.3392 18.3307 15.7533 18.3307 14.5833 18.3307C13.4133 18.3307 12.8275 18.3307 12.4075 18.0499C12.2254 17.9283 12.0691 17.772 11.9475 17.5899C11.6667 17.1699 11.6667 16.5841 11.6667 15.4141V8.7474C11.6667 7.5774 11.6667 6.99156 11.9475 6.57156C12.0691 6.3895 12.2254 6.23319 12.4075 6.11156C12.8275 5.83073 13.4133 5.83073 14.5833 5.83073ZM5.41667 5.83073C6.58667 5.83073 7.1725 5.83073 7.5925 6.11156C7.77456 6.23319 7.93087 6.3895 8.0525 6.57156C8.33333 6.99156 8.33333 7.5774 8.33333 8.7474V15.4141C8.33333 16.5841 8.33333 17.1699 8.0525 17.5899C7.93087 17.772 7.77456 17.9283 7.5925 18.0499C7.1725 18.3307 6.58667 18.3307 5.41667 18.3307C4.24667 18.3307 3.66083 18.3307 3.24083 18.0499C3.05877 17.9283 2.90246 17.772 2.78083 17.5899C2.5 17.1699 2.5 16.5841 2.5 15.4141V8.7474C2.5 7.5774 2.5 6.99156 2.78083 6.57156C2.90246 6.3895 3.05877 6.23319 3.24083 6.11156C3.66083 5.83073 4.24667 5.83073 5.41667 5.83073Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Ze=A(Oe,[["render",Fe]]),Ue={},qe={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Xe(t,o){return e.openBlock(),e.createElementBlock("svg",qe,o[0]||(o[0]=[e.createElementVNode("path",{d:"M8 3V5.2225M8 5.2225V10.7775M8 5.2225L9.875 4.25M8 5.2225L6.125 4.25M8 10.7775V13M8 10.7775L6.125 11.75M8 10.7775L9.875 11.75M13 8H10.7775M10.7775 8H5.2225M10.7775 8L11.75 9.875M10.7775 8L11.75 6.125M5.2225 8H3M5.2225 8L4.25 6.125M5.2225 8L4.25 9.875",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M12 14.7143L13.1151 15.6701C13.3268 15.8515 13.646 15.8247 13.8246 15.6105L16 13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))}const Ge=A(Ue,[["render",Xe]]),Ke={},Ye={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Je(t,o){return e.openBlock(),e.createElementBlock("svg",Ye,o[0]||(o[0]=[e.createElementVNode("path",{d:"M8 3V5.2225M8 5.2225V10.7775M8 5.2225L9.875 4.25M8 5.2225L6.125 4.25M8 10.7775V13M8 10.7775L6.125 11.75M8 10.7775L9.875 11.75M13 8H10.7775M10.7775 8H5.2225M10.7775 8L11.75 9.875M10.7775 8L11.75 6.125M5.2225 8H3M5.2225 8L4.25 6.125M5.2225 8L4.25 9.875",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M13 16L14.5 14.5M16 13L14.5 14.5M14.5 14.5L13 13M14.5 14.5L16 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))}const Qe=A(Ke,[["render",Je]]),et={},tt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ot(t,o){return e.openBlock(),e.createElementBlock("svg",tt,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.99479 8.75521C6.55276 8.75521 6.12884 8.57961 5.81628 8.26705C5.50372 7.95449 5.32812 7.53057 5.32812 7.08854C5.32812 6.64651 5.50372 6.22259 5.81628 5.91003C6.12884 5.59747 6.55276 5.42187 6.99479 5.42188C7.43682 5.42187 7.86074 5.59747 8.1733 5.91003C8.48586 6.22259 8.66146 6.64651 8.66146 7.08854C8.66146 7.53057 8.48586 7.95449 8.1733 8.26705C7.86074 8.57961 7.43682 8.75521 6.99479 8.75521ZM6.99479 14.5885C6.55276 14.5885 6.12884 14.4129 5.81628 14.1004C5.50372 13.7878 5.32812 13.3639 5.32812 12.9219C5.32812 12.4798 5.50372 12.0559 5.81628 11.7434C6.12884 11.4308 6.55276 11.2552 6.99479 11.2552C7.43682 11.2552 7.86074 11.4308 8.1733 11.7434C8.48586 12.0559 8.66146 12.4798 8.66146 12.9219C8.66146 13.3639 8.48586 13.7878 8.1733 14.1004C7.86074 14.4129 7.43682 14.5885 6.99479 14.5885Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9948 8.75521C12.5528 8.75521 12.1288 8.57961 11.8163 8.26705C11.5037 7.95449 11.3281 7.53057 11.3281 7.08854C11.3281 6.64651 11.5037 6.22259 11.8163 5.91003C12.1288 5.59747 12.5528 5.42187 12.9948 5.42188C13.4368 5.42187 13.8607 5.59747 14.1733 5.91003C14.4859 6.22259 14.6615 6.64651 14.6615 7.08854C14.6615 7.53057 14.4859 7.95449 14.1733 8.26705C13.8607 8.57961 13.4368 8.75521 12.9948 8.75521ZM12.9948 14.5885C12.5528 14.5885 12.1288 14.4129 11.8163 14.1004C11.5037 13.7878 11.3281 13.3639 11.3281 12.9219C11.3281 12.4798 11.5037 12.0559 11.8163 11.7434C12.1288 11.4308 12.5528 11.2552 12.9948 11.2552C13.4368 11.2552 13.8607 11.4308 14.1733 11.7434C14.4859 12.0559 14.6615 12.4798 14.6615 12.9219C14.6615 13.3639 14.4859 13.7878 14.1733 14.1004C13.8607 14.4129 13.4368 14.5885 12.9948 14.5885Z",fill:"currentColor"},null,-1)]))}const nt=A(et,[["render",ot]]),lt={},st={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function at(t,o){return e.openBlock(),e.createElementBlock("svg",st,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.1667 5.83333C9.72464 5.83333 9.30072 5.65774 8.98816 5.34518C8.67559 5.03262 8.5 4.60869 8.5 4.16667C8.5 3.72464 8.67559 3.30072 8.98816 2.98816C9.30072 2.67559 9.72464 2.5 10.1667 2.5C10.6087 2.5 11.0326 2.67559 11.3452 2.98816C11.6577 3.30072 11.8333 3.72464 11.8333 4.16667C11.8333 4.60869 11.6577 5.03262 11.3452 5.34518C11.0326 5.65774 10.6087 5.83333 10.1667 5.83333ZM10.1667 11.6667C9.72464 11.6667 9.30072 11.4911 8.98816 11.1785C8.67559 10.8659 8.5 10.442 8.5 10C8.5 9.55797 8.67559 9.13405 8.98816 8.82149C9.30072 8.50893 9.72464 8.33333 10.1667 8.33333C10.6087 8.33333 11.0326 8.50893 11.3452 8.82149C11.6577 9.13405 11.8333 9.55797 11.8333 10C11.8333 10.442 11.6577 10.8659 11.3452 11.1785C11.0326 11.4911 10.6087 11.6667 10.1667 11.6667ZM10.1667 17.5C9.72464 17.5 9.30072 17.3244 8.98816 17.0118C8.67559 16.6993 8.5 16.2754 8.5 15.8333C8.5 15.3913 8.67559 14.9674 8.98816 14.6548C9.30072 14.3423 9.72464 14.1667 10.1667 14.1667C10.6087 14.1667 11.0326 14.3423 11.3452 14.6548C11.6577 14.9674 11.8333 15.3913 11.8333 15.8333C11.8333 16.2754 11.6577 16.6993 11.3452 17.0118C11.0326 17.3244 10.6087 17.5 10.1667 17.5Z",fill:"currentColor"},null,-1)]))}const rt=A(lt,[["render",at]]),it={},ct={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dt(t,o){return e.openBlock(),e.createElementBlock("svg",ct,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.33333 9.83333C6.33333 10.2754 6.15774 10.6993 5.84518 11.0118C5.53262 11.3244 5.10869 11.5 4.66667 11.5C4.22464 11.5 3.80072 11.3244 3.48816 11.0118C3.17559 10.6993 3 10.2754 3 9.83333C3 9.39131 3.17559 8.96738 3.48816 8.65482C3.80072 8.34226 4.22464 8.16667 4.66667 8.16667C5.10869 8.16667 5.53262 8.34226 5.84518 8.65482C6.15774 8.96738 6.33333 9.39131 6.33333 9.83333ZM12.1667 9.83333C12.1667 10.2754 11.9911 10.6993 11.6785 11.0118C11.3659 11.3244 10.942 11.5 10.5 11.5C10.058 11.5 9.63405 11.3244 9.32149 11.0118C9.00893 10.6993 8.83333 10.2754 8.83333 9.83333C8.83333 9.39131 9.00893 8.96738 9.32149 8.65482C9.63405 8.34226 10.058 8.16667 10.5 8.16667C10.942 8.16667 11.3659 8.34226 11.6785 8.65482C11.9911 8.96738 12.1667 9.39131 12.1667 9.83333ZM18 9.83333C18 10.2754 17.8244 10.6993 17.5118 11.0118C17.1993 11.3244 16.7754 11.5 16.3333 11.5C15.8913 11.5 15.4674 11.3244 15.1548 11.0118C14.8423 10.6993 14.6667 10.2754 14.6667 9.83333C14.6667 9.39131 14.8423 8.96738 15.1548 8.65482C15.4674 8.34226 15.8913 8.16667 16.3333 8.16667C16.7754 8.16667 17.1993 8.34226 17.5118 8.65482C17.8244 8.96738 18 9.39131 18 9.83333Z",fill:"currentColor"},null,-1)]))}const ut=A(it,[["render",dt]]),mt={},pt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ht(t,o){return e.openBlock(),e.createElementBlock("svg",pt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 14L10 10M10 10L14 6M10 10L6 6M10 10L14 14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const ft=A(mt,[["render",ht]]),vt={arrowDown:xe,arrowTop:Me,arrowRight:De,arrowLeft:Ae,arrowReload:ze,columnInsert:Ze,freeze:Ge,unfreeze:Qe,columnsMove:nt,listBullet:rt,listBulletHorizontal:ut,close:ft},H=e.defineComponent({__name:"VIcon",props:{name:{}},setup(t){const o=t,n=e.computed(()=>vt[o.name]);return(l,a)=>n.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{key:0})):e.createCommentVNode("",!0)}}),gt={},_t={class:"vt-loader"};function Ct(t,o){return e.openBlock(),e.createElementBlock("span",_t)}const Q=A(gt,[["render",Ct]]),kt=["disabled","type","data-placement"],bt={key:2,class:"vt-button__content"},X=e.defineComponent({__name:"VButton",props:{type:{default:"default"},shape:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{},tooltip:{type:Boolean,default:!1},tooltipPlacement:{default:"top"},htmlType:{default:"button"}},emits:["click"],setup(t,{emit:o}){const n=t,l=o,a=e.useSlots(),s=e.computed(()=>!!(n.icon&&n.shape)),r=e.computed(()=>a.default?.()?.[0]?.children?.toString()??""),i=e.computed(()=>["vt-button",`vt-button--${n.type}`,{[`vt-button--${n.shape}`]:n.shape,"vt-button--icon-only":s.value,"vt-button--disabled":n.disabled||n.loading,"vt-button--loading":n.loading}]),c=e.computed(()=>s.value&&n.tooltip?r.value:null),u=d=>{!n.disabled&&!n.loading&&l("click",d)};return(d,B)=>{const y=e.resolveDirective("tooltip");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(i.value),disabled:n.disabled||n.loading,type:n.htmlType,"data-placement":n.tooltipPlacement,onClick:u},[n.loading?(e.openBlock(),e.createBlock(Q,{key:0,class:"vt-button__icon"})):n.icon?(e.openBlock(),e.createBlock(H,{key:1,name:n.icon,class:"vt-button__icon"},null,8,["name"])):e.createCommentVNode("",!0),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",bt,[e.renderSlot(d.$slots,"default")]))],10,kt)),[[y,c.value]])}}}),wt={key:0,class:"vt-modal__header"},yt={key:0,class:"vt-modal__title"},Bt={class:"vt-modal__content"},ee=e.defineComponent({__name:"VModal",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},showCloseButton:{type:Boolean,default:!0},closeOnBackdropClick:{type:Boolean,default:!0},zIndex:{default:1e3}},emits:["update:modelValue","close"],setup(t,{emit:o}){const n=t,l=o,a=e.computed(()=>["vt-modal__container",`vt-modal__container--${n.size}`]),s=e.computed(()=>({zIndex:n.zIndex})),r=()=>{l("update:modelValue",!1),l("close")},i=()=>{n.closeOnBackdropClick&&r()};return(c,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-modal__backdrop",style:e.normalizeStyle(s.value),onClick:i},[e.createElementVNode("div",{class:e.normalizeClass(a.value),onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[c.title||c.showCloseButton?(e.openBlock(),e.createElementBlock("div",wt,[c.title?(e.openBlock(),e.createElementBlock("h2",yt,e.toDisplayString(c.title),1)):e.createCommentVNode("",!0),c.showCloseButton?(e.openBlock(),e.createBlock(H,{key:1,name:"close",class:"vt-modal__close",onClick:r})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.renderSlot(c.$slots,"default")])],2)],4)):e.createCommentVNode("",!0)]))}}),xt={class:"vt-pagination"},St={class:"vt-pagination__info"},Et={class:"vt-pagination__rows-per-page"},Vt=["value"],Mt={class:"vt-pagination__navigation"},$t=["disabled"],Lt=["onClick"],Nt=["disabled"],ie=e.defineComponent({__name:"VPagination",props:{totalItems:{},pageSize:{default:10},currentPage:{default:1},pageSizeOptions:{default:()=>[5,10,20,50]},maxVisiblePages:{default:6}},emits:["update:currentPage","update:pageSize","pageChange","reloadData"],setup(t,{emit:o}){const n=t,l=o,a=e.computed({get:()=>n.currentPage,set:x=>l("update:currentPage",x)}),s=e.computed({get:()=>n.pageSize,set:x=>l("update:pageSize",x)}),r=e.computed(()=>Math.ceil(n.totalItems/s.value)),i=e.computed(()=>n.totalItems===0?0:(a.value-1)*s.value+1),c=e.computed(()=>Math.min(a.value*s.value,n.totalItems)),u=e.computed(()=>a.value<=1),d=e.computed(()=>a.value>=r.value),B=e.computed(()=>{const x=[],L=r.value,w=a.value,D=n.maxVisiblePages;if(L<=D)for(let h=1;h<=L;h++)x.push(h);else{x.push(1);const h=Math.max(2,w-Math.floor(D/2)),M=Math.min(L-1,w+Math.floor(D/2));h>2&&x.push("...");for(let N=h;N<=M;N++)x.push(N);M<L-1&&x.push("..."),L>1&&x.push(L)}return x}),y=()=>{l("pageChange",{page:a.value,pageSize:s.value})},z=x=>{typeof x=="number"&&x!==a.value&&(a.value=x,y())},T=()=>{u.value||(a.value--,y())},O=()=>{d.value||(a.value++,y())},j=()=>{a.value=1,y()},P=()=>{l("reloadData",a.value)};return e.watch(()=>n.totalItems,()=>{a.value>r.value&&r.value>0&&(a.value=r.value,y())}),(x,L)=>(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",St,[e.createElementVNode("div",Et,[L[1]||(L[1]=e.createElementVNode("label",{for:"rowsSelect",class:"vt-pagination__label"},"Рядків на сторінку:",-1)),e.withDirectives(e.createElementVNode("select",{id:"rowsSelect","onUpdate:modelValue":L[0]||(L[0]=w=>s.value=w),onChange:j,class:"vt-pagination__select"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.pageSizeOptions,w=>(e.openBlock(),e.createElementBlock("option",{key:w,value:w},e.toDisplayString(w),9,Vt))),128))],544),[[e.vModelSelect,s.value]])]),e.createElementVNode("span",null,e.toDisplayString(i.value)+" - "+e.toDisplayString(c.value)+" з "+e.toDisplayString(x.totalItems),1)]),e.createElementVNode("div",Mt,[e.createElementVNode("button",{onClick:T,disabled:u.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!u.value})},[e.createVNode(H,{name:"arrowLeft"})],10,$t),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,w=>(e.openBlock(),e.createElementBlock("button",{key:w,onClick:D=>z(w),class:e.normalizeClass(["vt-pagination__nav-button",{"vt-pagination__nav-button--active":w===a.value}])},e.toDisplayString(w),11,Lt))),128)),e.createElementVNode("button",{onClick:O,disabled:d.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!d.value})},[e.createVNode(H,{name:"arrowRight"})],10,Nt)]),e.createElementVNode("div",null,[e.createVNode(X,{icon:"arrowReload",shape:"circle",tooltip:"",tooltipPlacement:"left",onClick:P},{default:e.withCtx(()=>L[2]||(L[2]=[e.createTextVNode("Оновити дані ",-1)])),_:1,__:[2]})])]))}}),zt=["for"],It=["id","name","value","checked","disabled","required",".indeterminate"],q=e.defineComponent({__name:"VCheckbox",props:{modelValue:{type:Boolean,default:void 0},checked:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},id:{},name:{},value:{},indeterminate:{type:Boolean,default:!1},size:{default:"medium"},variant:{default:"primary"},required:{type:Boolean,default:!1},isDouble:{type:Boolean,default:!1}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:o}){const n=t,l=o,a=()=>`vt-checkbox-${Math.random().toString(36).substr(2,9)}`,s=e.computed(()=>n.id||a()),r=e.computed(()=>n.modelValue??n.checked),i=d=>{if(n.disabled)return;const y=d.target.checked;l("update:modelValue",y),l("change",y,d)},c=d=>{l("focus",d)},u=d=>{l("blur",d)};return(d,B)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["vt-checkbox",`vt-checkbox--${d.size}`,`vt-checkbox--${d.variant}`,{"vt-checkbox--disabled":d.disabled,"vt-checkbox--double":d.isDouble}]),for:s.value},[e.createElementVNode("input",{id:s.value,name:d.name,value:d.value,checked:r.value,disabled:d.disabled,required:d.required,".indeterminate":d.indeterminate,type:"checkbox",class:"vt-checkbox__input",onChange:i,onFocus:c,onBlur:u},null,40,It),e.createElementVNode("div",{class:e.normalizeClass(["vt-checkbox__box",{"vt-checkbox__box--checked":r.value&&!d.indeterminate&&!d.isDouble,"vt-checkbox__box--indeterminate":d.indeterminate,"vt-checkbox__box--double":d.isDouble&&r.value,"vt-checkbox__box--disabled":d.disabled}])},[!d.indeterminate&&!d.isDouble?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["vt-checkbox__checkmark",{"vt-checkbox__checkmark--checked":r.value}]),width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B[0]||(B[0]=[e.createElementVNode("path",{d:"M1 5L3.58264 7.58264C3.80112 7.80112 4.16348 7.77113 4.34306 7.51971L9 1",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]),2)):e.createCommentVNode("",!0),d.isDouble&&r.value?(e.openBlock(),e.createElementBlock("svg",{key:1,class:e.normalizeClass(["vt-checkbox__checkmark",{"vt-checkbox__checkmark--checked":r.value}]),width:"13",height:"6",viewBox:"0 0 13 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B[1]||(B[1]=[e.createElementVNode("path",{d:"M6 3L8.25 5L12 1",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M1 3L3.25 5L7 1",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2)):e.createCommentVNode("",!0),d.indeterminate?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["vt-checkbox__indeterminate-mark",{"vt-checkbox__indeterminate-mark--visible":d.indeterminate}])},null,2)):e.createCommentVNode("",!0)],2),d.label||d.$slots.label||d.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vt-checkbox__label",{"vt-checkbox__label--disabled":d.disabled}])},[e.renderSlot(d.$slots,"label",{},()=>[e.renderSlot(d.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(d.label),1)])])],2)):e.createCommentVNode("",!0)],10,zt))}});function Rt(t){const o=e.computed(()=>[...t].sort((a,s)=>a.pinnedLeft&&!s.pinnedLeft?-1:!a.pinnedLeft&&s.pinnedLeft||a.pinnedRight&&!s.pinnedRight?1:!a.pinnedRight&&s.pinnedRight?-1:0)),n=()=>{const a=o.value.length,s=o.value.filter(d=>d.width||d.minWidth),r=s.reduce((d,B)=>d+(B.width||B.minWidth||0),0),i=a-s.length;if(i===0)return 150;const u=Math.max(800-r,i*80);return Math.max(Math.floor(u/i),120)};return{sortedColumns:o,getDefaultColumnWidth:n,getStickyOffset:(a,s,r=!1)=>{const i=o.value;let c=0;if(a==="left"){r&&(c+=50);for(let u=0;u<s;u++){const d=i[u];d.pinnedLeft&&(c+=d.width||d.minWidth||n())}}else for(let u=i.length-1;u>s;u--){const d=i[u];d.pinnedRight&&(c+=d.width||d.minWidth||n())}return c}}}function Tt(t){const o=()=>{const s={};return t.maxHeight&&(s.maxHeight=`${t.maxHeight}px`),s},n=(s,r,i,c)=>{const u={};if(s.width)u.width=`${s.width}px`,u.minWidth=`${s.width}px`,u.maxWidth=`${s.width}px`;else if(s.minWidth)u.minWidth=`${s.minWidth}px`,u.width=`${s.minWidth}px`,u.maxWidth="none";else{const d=c();u.width=`${d}px`,u.minWidth="80px",u.maxWidth="none"}return s.pinnedLeft?(u.position="sticky",u.left=`${i("left",r,t.selectable)}px`,u.zIndex="10"):s.pinnedRight&&(u.position="sticky",u.right=`${i("right",r,!1)}px`,u.zIndex="10"),u};return{getTableWrapperStyle:o,getColumnStyle:n,getHeaderStyle:(s,r,i,c)=>{const u=n(s,r,i,c);return t.maxHeight&&(u.position="sticky",u.top="0",s.pinnedLeft||s.pinnedRight?u.zIndex="12":u.zIndex="11"),u},getFooterStyle:(s,r,i,c)=>{const u=n(s,r,i,c);return t.maxHeight&&(u.position="sticky",u.bottom="0",s.pinnedLeft||s.pinnedRight?u.zIndex="12":u.zIndex="11"),u}}}function Dt(){const t=e.ref({resizingCol:null,startX:0,startWidth:0}),o=`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5 13L2 10L5 7' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M15 7L18 10L15 13' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M10 3L10 17' stroke='%23828282' stroke-width='3' stroke-linecap='round'/></svg>") 10 10, col-resize`;return{onMouseDown:(l,a,s,r)=>{l.preventDefault(),l.stopPropagation(),t.value.resizingCol=a,t.value.startX=l.clientX,t.value.startWidth=a.width||a.minWidth||s(a.prop);const i=u=>{const{resizingCol:d,startX:B,startWidth:y}=t.value;if(!d)return;document.querySelectorAll(`[data-resizer="${d.prop}"]`).forEach(P=>{P.classList.add("vt-table__resizer--active")});const z=u.clientX-B,T=d.minWidth||50,O=d.maxWidth||1e3,j=Math.max(Math.min(y+z,O),T);d.width=j},c=()=>{const{resizingCol:u}=t.value;document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("vt-table-resizing"),u&&(document.querySelectorAll(`[data-resizer="${u.prop}"]`).forEach(d=>{d.classList.remove("vt-table__resizer--active")}),r&&u.width&&(console.log("📏 Викликаємо callback з новою шириною:",u.width),r(u.width))),t.value.resizingCol=null};document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),document.body.style.cursor=o,document.body.style.userSelect="none",document.body.classList.add("vt-table-resizing")},resizeState:t}}function Wt(t,o,n,l){const a=t.selectionKey||"id",s=e.ref([]),r=e.ref(null),i=e.ref(!1);t.defaultSelection?.length&&(s.value=[...t.defaultSelection]);const c=k=>k[a],u=k=>i.value?!0:s.value.some($=>c($)===c(k)),d=e.computed(()=>o.value.filter(k=>u(k)).length),B=e.computed(()=>o.value.length>0&&d.value===o.value.length),y=e.computed(()=>{if(i.value)return!1;const k=d.value;return k>0&&k<o.value.length}),z=e.computed(()=>i.value?!0:B.value&&!y.value),T=e.computed(()=>i.value),O=(k,$)=>{const V=c(k),I=s.value.some(m=>c(m)===c(k)),W=$!==void 0?$:!I;if(i.value&&!W){i.value=!1,l?.value&&(s.value=l.value.filter(m=>c(m)!==V)),N(k,!1);return}i.value&&W||(W&&!I?s.value.push(k):!W&&I&&(s.value=s.value.filter(m=>c(m)!==V)),t.selectOnClickRow&&$===void 0&&D(W?k:null),N(k,W))},j=()=>{switch(P()){case"none":case"partial":x();break;case"allVisible":L();break;case"absoluteAll":w();break}},P=()=>i.value?"absoluteAll":B.value?"allVisible":d.value>0?"partial":"none",x=()=>{const k=[],$=new Set(s.value.map(V=>c(V)));s.value.forEach(V=>{k.push(V)}),o.value.forEach(V=>{$.has(c(V))||k.push(V)}),s.value=k,i.value=!1,N()},L=()=>{i.value=!0,l?.value?s.value=[...l.value]:s.value=[...o.value],N(void 0,void 0,!0)},w=()=>{s.value=[],i.value=!1,r.value=null,N()},D=k=>{const $=r.value;r.value=k,n("current-change",{currentRow:r.value,oldCurrentRow:$})},h=()=>[...s.value],M=k=>{s.value=[...k],i.value=!1,N()},N=(k,$,V=!1)=>{const I={selection:[...s.value],row:k,selected:$,isAllSelected:V||i.value};n("selection-change",I)};return e.watch(()=>t.defaultSelection,k=>{k?.length&&(s.value=[...k])}),{selectedRows:s,currentRow:r,isRowSelected:u,isAllSelected:z,isIndeterminate:y,isDoubleCheck:T,isFullSelection:i,toggleRowSelection:O,toggleAllSelection:j,clearSelection:w,setCurrentRow:D,getSelectionRows:h,setSelectionRows:M,selectAbsolutelyAll:L}}const Pt=(t,o,n="asc")=>{if(t==null&&o==null)return 0;if(t==null)return n==="asc"?1:-1;if(o==null)return n==="asc"?-1:1;if(t===o)return 0;let l=0;const a=Number(t),s=Number(o);return!isNaN(a)&&!isNaN(s)?l=a-s:te(t)&&te(o)?l=new Date(t).getTime()-new Date(o).getTime():typeof t=="boolean"&&typeof o=="boolean"?l=t===o?0:t?-1:1:l=String(t).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"}),n==="desc"?-l:l},te=t=>t instanceof Date?!isNaN(t.getTime()):typeof t=="string"&&/\d{4}-\d{2}-\d{2}|\//.test(t)?!isNaN(new Date(t).getTime()):!1,Ht=(t,o,n)=>{t.sortable&&n({prop:t.prop,direction:o})},oe=(t,o)=>{const n=o?.prop===t.prop,l=o?.direction;return{asc:["vt-th__sort-icon",n&&l==="asc"&&"vt-th__sortable-active"].filter(Boolean).join(" "),desc:["vt-th__sort-icon",n&&l==="desc"&&"vt-th__sortable-active"].filter(Boolean).join(" ")}},At=(t,o,n)=>{if(!o)return[...t];const l=n.find(s=>s.prop===o.prop);if(!l?.sortable)return[...t];const a=l.sortMethod||Pt;return[...t].sort((s,r)=>{const i=s[l.prop],c=r[l.prop];return a(i,c,o.direction)})};class Ot{modalStack=[];baseZIndex=1e3;open(o={}){const n=`modal-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,l=document.createElement("div");l.setAttribute("data-vt-modal",n),document.body.appendChild(l);const a=e.ref(!0),s=this.baseZIndex+this.modalStack.length*10,r=e.createApp({setup(){const c=()=>{a.value=!1,setTimeout(()=>{U.closeById(n)},100)};return()=>e.h(ee,{modelValue:a.value,"onUpdate:modelValue":c,title:o.title,size:o.size||"medium",showCloseButton:o.showCloseButton!==!1,closeOnBackdropClick:o.closeOnBackdropClick!==!1,onClose:c,zIndex:s},{default:()=>o.component?e.h(o.component,o.props||{}):o.content?e.h("div",{innerHTML:o.content}):null})}});r.mount(l);const i={id:n,app:r,container:l,isOpen:a};return this.modalStack.push(i),n}close(){if(this.modalStack.length>0){const o=this.modalStack[this.modalStack.length-1];this.closeById(o.id)}}closeById(o){const n=this.modalStack.findIndex(l=>l.id===o);if(n!==-1){const l=this.modalStack[n];this.cleanupModal(l),this.modalStack.splice(n,1),this.recalculateZIndices()}}closeAll(){for(;this.modalStack.length>0;){const o=this.modalStack.pop();o&&this.cleanupModal(o)}}getOpenModalsCount(){return this.modalStack.length}cleanupModal(o){o.app&&o.app.unmount(),o.container&&o.container.parentNode&&document.body.removeChild(o.container)}recalculateZIndices(){}}const U=new Ot,ce={install(t){t.config.globalProperties.$modal=U,t.config.globalProperties.$modalStack={closeAll:()=>U.closeAll(),getCount:()=>U.getOpenModalsCount(),closeById:o=>U.closeById(o)}}},jt={class:"vt-columns-selector-body"},Ft={class:"vt-columns-selector"},Zt={class:"vt-columns-selector__panel"},Ut=["draggable","onDragstart","onDragover","onDrop"],qt={key:0,class:"vt-columns-selector__panel-item-pinned"},Xt={class:"vt-columns-selector__available"},Gt=["onClick"],Kt={key:0,class:"vt-columns-selector__group-columns"},Yt={key:0,class:"vt-columns-selector__pinned-note"},Jt={class:"vt-modal__content-button"},Qt=e.defineComponent({__name:"VTableColumnSelector",props:{columns:{},columnsSelector:{default:()=>[]}},emits:["update-columns"],setup(t,{emit:o}){const n=t,l=o,a=e.ref([]),s=e.ref(new Set),r=e.ref(-1),i=e.ref(-1),c=e.ref("before"),u=e.computed(()=>{const m={};return n.columnsSelector.forEach(v=>{if(v.name==="removed")return;const g=v.columns.map(S=>S.prop),C=a.value.filter(S=>g.includes(S.prop));C.length===0?m[v.name]={checked:!1,indeterminate:!1}:C.length===v.columns.length?m[v.name]={checked:!0,indeterminate:!1}:m[v.name]={checked:!1,indeterminate:!0}}),m}),d=e.computed(()=>n.columnsSelector.filter(m=>m.name!=="removed")),B=m=>m.pinnedLeft||m.pinnedRight,y=m=>!B(m),z=()=>{const m=a.value;let v=-1;for(let C=0;C<m.length;C++)m[C].pinnedLeft&&(v=C);let g=m.length;for(let C=0;C<m.length;C++)if(m[C].pinnedRight){g=C;break}return{minIndex:v+1,maxIndex:g-1}},T=m=>{const v=z();return!(m<v.minIndex||m>v.maxIndex+1)},O=(m,v)=>{const g=a.value[v];if(!y(g)){m.preventDefault();return}r.value=v,m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",g.prop)),document.body.style.cursor="grabbing"},j=(m,v)=>{if(r.value===-1)return;m.preventDefault();const g=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=g.top+g.height/2;let R=v,Z="before";C<S?(R=v,Z="before"):(R=v+1,Z="after"),r.value<R&&R--,T(R)?(i.value=v,c.value=Z,m.dataTransfer.dropEffect="move"):(i.value=-1,m.dataTransfer.dropEffect="none")},P=()=>{setTimeout(()=>{r.value===-1&&(i.value=-1)},50)},x=(m,v)=>{if(m.preventDefault(),r.value===-1||i.value===-1){w();return}const g=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=g.top+g.height/2;let R=v;if(C>=S&&(R=v+1),r.value<R&&R--,!T(R)||R===r.value){w();return}const Z=[...a.value],[G]=Z.splice(r.value,1);Z.splice(R,0,G),a.value=Z,w()},L=()=>{w()},w=()=>{r.value=-1,i.value=-1,c.value="before",document.body.style.cursor=""},D=m=>{const v=["vt-columns-selector__panel-item"];return r.value===m&&v.push("vt-columns-selector__panel-item--dragging"),i.value===m&&c.value==="before"&&v.push("vt-columns-selector__panel-item--drop-before"),i.value===m&&c.value==="after"&&v.push("vt-columns-selector__panel-item--drop-after"),v},h=()=>{a.value=[...n.columns.map(m=>({...m}))],n.columnsSelector.forEach(m=>{m.name!=="removed"&&s.value.add(m.name)})},M=(m,v)=>{if(v)a.value.some(g=>g.prop===m.prop)||a.value.push({...m});else{if(B(m))return;a.value=a.value.filter(g=>g.prop!==m.prop)}},N=(m,v)=>{if(v)m.columns.forEach(g=>{a.value.some(C=>C.prop===g.prop)||a.value.push({...g})});else{const g=[];m.columns.forEach(C=>{const S=a.value.find(R=>R.prop===C.prop);S&&!B(S)&&g.push(S)}),a.value=a.value.filter(C=>!g.some(S=>S.prop===C.prop))}},k=m=>a.value.some(v=>v.prop===m.prop),$=m=>{const v=a.value.find(g=>g.prop===m.prop);return!v||!B(v)},V=m=>{s.value.has(m)?s.value.delete(m):s.value.add(m)},I=()=>{l("update-columns",[...a.value]),U.close()},W=()=>{U.close()};return e.onMounted(()=>{h()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",jt,[e.createElementVNode("div",Ft,[e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(g,C)=>(e.openBlock(),e.createElementBlock("div",{key:g.prop,class:e.normalizeClass(D(C)),draggable:y(g),onDragstart:S=>O(S,C),onDragover:S=>j(S,C),onDragleave:P,onDrop:S=>x(S,C),onDragend:L},[e.createVNode(H,{name:y(g)?"columnsMove":"freeze",class:e.normalizeClass(["vt-columns-selector__panel-item-icon",{"vt-columns-selector__panel-item-icon--draggable":y(g)}])},null,8,["name","class"]),e.createVNode(q,{label:g.label,checked:!0,disabled:B(g),onChange:S=>M(g,S),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},null,8,["label","disabled","onChange"]),B(g)?(e.openBlock(),e.createElementBlock("span",qt,"pinned")):e.createCommentVNode("",!0)],42,Ut))),128))]),e.createElementVNode("div",Xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("div",{key:g.name,class:"vt-columns-selector__group"},[e.createElementVNode("div",{class:"vt-columns-selector__group-header",onClick:C=>V(g.name)},[e.createVNode(q,{label:g.label,checked:u.value[g.name]?.checked||!1,indeterminate:u.value[g.name]?.indeterminate||!1,onChange:C=>N(g,C),onClick:v[1]||(v[1]=e.withModifiers(()=>{},["stop"]))},null,8,["label","checked","indeterminate","onChange"]),g.icon?(e.openBlock(),e.createBlock(H,{key:0,name:g.icon,class:"vt-columns-selector__group-icon"},null,8,["name"])):e.createCommentVNode("",!0)],8,Gt),s.value.has(g.name)?(e.openBlock(),e.createElementBlock("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.columns,C=>(e.openBlock(),e.createElementBlock("div",{key:C.prop,class:"vt-columns-selector__group-column"},[e.createVNode(q,{label:C.label,checked:k(C),disabled:!$(C),onChange:S=>M(C,S)},null,8,["label","checked","disabled","onChange"]),$(C)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Yt," (закріплена) "))]))),128))])):e.createCommentVNode("",!0)]))),128))])]),e.createElementVNode("div",Jt,[e.createVNode(X,{onClick:W},{default:e.withCtx(()=>v[2]||(v[2]=[e.createTextVNode("Скасувати",-1)])),_:1,__:[2]}),e.createVNode(X,{type:"primary",onClick:I},{default:e.withCtx(()=>v[3]||(v[3]=[e.createTextVNode("Зберегти",-1)])),_:1,__:[3]})])]))}}),eo=e.defineComponent({__name:"ColumnActions",props:{column:{},allColumns:{},columnsSelector:{}},emits:["pin","update-columns"],setup(t,{emit:o}){const n=t,l=o,a=e.ref(),s=e.ref(),r=e.ref(),i=e.ref(!1),c=e.ref(!1),u=e.ref([]),d=async()=>{if(await e.nextTick(),!a.value||!s.value)return;const h=s.value.getBoundingClientRect(),M=a.value,N=M.offsetWidth,k=h.left+h.width/2;M.style.top=`${h.bottom-20}px`,M.style.left=`${k-N/2}px`;const $=M.getBoundingClientRect();$.right>window.innerWidth&&(M.style.left=`${window.innerWidth-N-8}px`),$.left<0&&(M.style.left="8px")},B=h=>{h.stopPropagation(),!c.value&&(i.value?z():y())},y=()=>{c.value||(i.value=!0,d(),r.value&&(r.value.style.zIndex="22"))},z=()=>{c.value=!0,i.value=!1,r.value&&r.value.style.removeProperty("z-index"),setTimeout(()=>{c.value=!1},100)},T=h=>{!s.value?.contains(h.target)&&!a.value?.contains(h.target)&&z()},O=()=>{D()?(l("pin",n.column,"none"),console.log(`Колонка "${n.column.label}" відкріплена`)):(l("pin",n.column,"left"),console.log(`Колонка "${n.column.label}" прикріплена зліва`)),z()},j=h=>({name:"removed",label:"Видалені колонки",order:999,columns:h}),P=h=>{const M=new Set(h.map(V=>V.prop)),N=new Set;n.columnsSelector?.forEach(V=>{V.columns.forEach(I=>N.add(I.prop))}),n.allColumns.forEach(V=>N.add(V.prop));const k=[];N.forEach(V=>{if(!M.has(V)){let I;n.columnsSelector?.forEach(W=>{const m=W.columns.find(v=>v.prop===V);m&&(I=m)}),I||(I=n.allColumns.find(W=>W.prop===V)),I&&k.push(I)}});const $=[...n.columnsSelector||[]];k.length>0&&$.push(j(k)),u.value=$},x=()=>{P(n.allColumns),U.open({component:Qt,title:"Управління колонками таблиці",props:{columns:n.allColumns,columnsSelector:u.value,"onUpdate-columns":h=>{console.log("ColumnActions отримав оновлені колонки:",h),l("update-columns",h),P(h)}},size:"large",closeOnBackdropClick:!1}),z()},L=()=>n.column.pinnedLeft,w=()=>n.column.pinnedRight,D=()=>L()||w();return e.onMounted(()=>{document.addEventListener("click",T),s.value&&(r.value=s.value.closest("th")),P(n.allColumns)}),e.onUnmounted(()=>{document.removeEventListener("click",T)}),(h,M)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"triggerRef",ref:s,class:"vt-table-header-actions",onClick:B},[e.createVNode(H,{name:"listBullet"}),i.value?(e.openBlock(),e.createElementBlock("ul",{key:0,ref_key:"menuRef",ref:a,class:e.normalizeClass(["dropdown-menu","vt-table-dropdown",{visible:i.value}])},[e.createElementVNode("li",{onClick:O},[e.createVNode(H,{name:D()?"unfreeze":"freeze"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(D()?"Розморозити":"Заморозити"),1)]),e.createElementVNode("li",{onClick:x},[e.createVNode(H,{name:"columnInsert"}),M[0]||(M[0]=e.createElementVNode("span",null,"Колонки",-1))])],2)):e.createCommentVNode("",!0)],512))}}),to={class:"vt-table"},oo={class:"vt-th__content"},no={class:"vt-th__content"},lo={class:"vt-th__label"},so={key:0,class:"vt-th__sortable"},ao=["data-resizer","onMousedown"],ro=["onClick"],io={class:"vt-table__cell-content"},co={class:"vt-table__cell-content vt-table__cell-content--ellipsis"},uo={key:1},mo=["data-resizer","onMousedown"],po={key:0,class:"vt-table__summary"},ho={class:"vt-table__cell-content vt-table__cell-content--summary"},Y=50,de=e.defineComponent({__name:"VTable",props:e.mergeModels({data:{},maxHeight:{},defaultSort:{},showSummary:{type:Boolean},summaryMethod:{type:Function},columnsSelector:{},selectable:{type:Boolean},selectionKey:{},defaultSelection:{},selectOnClickRow:{type:Boolean},highlightCurrentRow:{type:Boolean},allData:{},columns:{}},{columns:{required:!1},columnsModifiers:{}}),emits:e.mergeModels(["sort-change","selection-change","current-change","row-click","update:columns","column-pin","column-resize","column-visibility","column-sort","columns-change"],["update:columns"]),setup(t,{expose:o,emit:n}){const l=t,a=e.useModel(t,"columns"),s=n,r=e.ref({}),i=e.ref(),c=e.reactive([]),u=e.ref(l.defaultSort||null),d=e.computed(()=>a.value!==void 0),B=()=>{d.value&&a.value?c.splice(0,c.length,...a.value):l.columns&&c.splice(0,c.length,...l.columns)};e.watch(()=>a.value,p=>{p&&d.value&&c.splice(0,c.length,...p)},{deep:!0}),e.watch(()=>l.columns,p=>{p&&!d.value&&c.splice(0,c.length,...p)},{deep:!0}),e.provide("vt-table-columns",c);const{sortedColumns:y,getDefaultColumnWidth:z,getStickyOffset:T}=Rt(c),{getTableWrapperStyle:O,getColumnStyle:j,getHeaderStyle:P,getFooterStyle:x}=Tt(l),{onMouseDown:L}=Dt(),w=e.computed(()=>At(l.data,u.value,c)),D=e.computed(()=>l.allData||l.data),h=l.selectable?Wt(l,w,s,D):null,M=()=>({width:`${Y}px`,minWidth:`${Y}px`,maxWidth:`${Y}px`,left:"0px",position:"sticky",zIndex:10}),N=()=>{const p=M();return l.maxHeight?{...p,top:"0px",zIndex:11}:p},k=()=>{const p=M();return l.maxHeight?{...p,bottom:"0px",zIndex:11}:p},$=(p,_)=>{Ht(p,_,E=>{u.value?.prop===p.prop&&u.value.direction===_?u.value=null:u.value=E,s("sort-change",{column:p,direction:u.value?.direction||null,prop:p.prop,sortedData:w.value})})},V=(p,_)=>{console.log(`Колонка "${p.label}" закріплення: ${_}`);const E={pinnedLeft:_==="left",pinnedRight:_==="right"};W(p.prop,E),s("column-pin",{column:{...p,...E},position:_})},I=p=>{console.log("handleColumnsUpdate викликано з колонками:",p),c.splice(0,c.length,...p),d.value&&(a.value=[...p]),s("columns-change",[...p])},W=(p,_)=>{console.log("updateColumn викликано:",{prop:p,updates:_,hasColumnsModel:d.value});const E=c.findIndex(f=>f.prop===p);if(E!==-1){if(console.log("Оновлюємо internalColumns:",E,_),Object.assign(c[E],_),d.value&&a.value){const f=a.value.findIndex(b=>b.prop===p);if(f!==-1){const b=[...a.value];b[f]={...b[f],..._},console.log("Оновлюємо через defineModel:",b),a.value=b}}s("columns-change",[...c])}else console.error("Колонку не знайдено:",p,"Доступні колонки:",c.map(f=>f.prop))},m=(p,_,E)=>{s("row-click",{row:p,column:_,event:E}),l.highlightCurrentRow&&h&&h.setCurrentRow(p)},v=(p,_,E)=>{E.stopPropagation(),h&&h.toggleRowSelection(_,p)},g=(p,_)=>{_.stopPropagation(),h&&h.toggleAllSelection(),p===void 0&&console.log(p)},C=(p,_)=>{p&&(r.value[_]=p)},S=(p,_)=>{const E=_.width||z();console.log(E),L(p,_,z,f=>{console.log(f),W(_.prop,{width:f}),s("column-resize",{column:{..._,width:f},width:f,oldWidth:E})})},R=(p,_)=>j(p,_,T,z),Z=(p,_)=>P(p,_,T,z),G=(p,_)=>x(p,_,T,z),he=(p,_)=>{if(!_||!_.prop)return"";const E=p[_.prop];return E==null?"":String(E)},fe=e.computed(()=>{if(!l.showSummary)return{};const p=c;if(typeof l.summaryMethod=="function"){const _=l.summaryMethod({columns:p,data:w.value});return p.reduce((E,f,b)=>(E[f.prop]=_[b],E),{})}return p.reduce((_,E)=>{const f=w.value.map(b=>b[E.prop]);return _[E.prop]=f.every(b=>typeof b=="number")?f.reduce((b,F)=>b+F,0):"",_},{})}),ve=(p,_)=>{h&&h.toggleRowSelection(p,_)},ge=()=>{h&&h.toggleAllSelection()},_e=()=>{h&&h.selectAbsolutelyAll()},Ce=()=>{h&&h.clearSelection()},ke=()=>h?h.getSelectionRows():[],be=p=>{h&&h.setSelectionRows(p)};return e.onMounted(()=>{B()}),o({toggleRowSelection:ve,toggleAllSelection:ge,selectAbsolutelyAll:_e,clearSelection:Ce,getSelectionRows:ke,setSelectionRows:be}),(p,_)=>{const E=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{ref_key:"tableWrapperRef",ref:i,class:"vt-table-wrapper",style:e.normalizeStyle(e.unref(O)())},[e.renderSlot(p.$slots,"default"),e.createElementVNode("table",to,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[l.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["vt-table__th vt-table__th--selection",{"vt-table__th--sticky":l.maxHeight,"vt-table__th--pinned-left":!0}]),style:e.normalizeStyle(N())},[e.createElementVNode("div",oo,[e.createVNode(q,{checked:e.unref(h)?.isAllSelected.value,indeterminate:e.unref(h)?.isIndeterminate.value,"is-double":e.unref(h)?.isDoubleCheck?.value,onChange:g},null,8,["checked","indeterminate","is-double"])])],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(f,b)=>(e.openBlock(),e.createElementBlock("th",{key:f.prop,ref_for:!0,ref:F=>C(F,f.prop),style:e.normalizeStyle(Z(f,b)),class:e.normalizeClass(["vt-table__th",{"vt-table__th--sticky":l.maxHeight,"vt-table__th--pinned-left":f.pinnedLeft,"vt-table__th--pinned-right":f.pinnedRight,"vt-table__th--sortable":f.sortable}])},[e.createElementVNode("div",no,[e.createElementVNode("div",lo,e.toDisplayString(f.label),1),f.sortable?(e.openBlock(),e.createElementBlock("div",so,[e.createVNode(H,{name:"arrowTop",class:e.normalizeClass(e.unref(oe)(f,u.value).asc),onClick:e.withModifiers(F=>$(f,"asc"),["stop"])},null,8,["class","onClick"]),e.createVNode(H,{name:"arrowDown",class:e.normalizeClass(e.unref(oe)(f,u.value).desc),onClick:e.withModifiers(F=>$(f,"desc"),["stop"])},null,8,["class","onClick"])])):e.createCommentVNode("",!0),f.actionColumn?(e.openBlock(),e.createBlock(eo,{key:1,column:f,"all-columns":e.unref(y),columnsSelector:l.columnsSelector,onPin:V,onUpdateColumns:I},null,8,["column","all-columns","columnsSelector"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":f.prop,onMousedown:F=>S(F,f)},null,40,ao)],6))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,f=>(e.openBlock(),e.createElementBlock("tr",{key:f.id,class:e.normalizeClass(["vt-table__row",{"vt-table__row--selected":e.unref(h)?.isRowSelected(f),"vt-table__row--current":e.unref(h)?.currentRow.value===f,"vt-table__row--clickable":l.selectOnClickRow||l.highlightCurrentRow}]),onClick:b=>m(f,e.unref(y)[0],b)},[l.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["vt-table__td vt-table__td--selection",{"vt-table__td--pinned-left":!0}]),style:e.normalizeStyle(M())},[e.createElementVNode("div",io,[e.createVNode(q,{checked:e.unref(h)?.isRowSelected(f),onChange:(b,F)=>v(b,f,F)},null,8,["checked","onChange"])])],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(b,F)=>(e.openBlock(),e.createElementBlock("td",{key:b.prop,ref_for:!0,ref:K=>C(K,b.prop),style:e.normalizeStyle(R(b,F)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":b.pinnedLeft,"vt-table__td--pinned-right":b.pinnedRight}])},[e.withDirectives((e.openBlock(),e.createElementBlock("div",co,[b.renderSlot?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b.renderSlot),{key:0,row:f,column:b,value:f[b.prop]},null,8,["row","column","value"])):(e.openBlock(),e.createElementBlock("span",uo,e.toDisplayString(f[b.prop]),1))])),[[E,b.showOverflowTooltip?he(f,b):null]]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":b.prop,onMousedown:K=>S(K,b)},null,40,mo)],6))),128))],10,ro))),128))]),l.showSummary?(e.openBlock(),e.createElementBlock("tfoot",po,[e.createElementVNode("tr",null,[l.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":!0}]),style:e.normalizeStyle(k())},_[0]||(_[0]=[e.createElementVNode("div",{class:"vt-table__cell-content vt-table__cell-content--summary"},null,-1)]),4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(f,b)=>(e.openBlock(),e.createElementBlock("td",{key:f.prop,style:e.normalizeStyle(G(f,b)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":f.pinnedLeft,"vt-table__td--pinned-right":f.pinnedRight}])},[e.createElementVNode("div",ho,e.toDisplayString(fe.value[f.prop]),1)],6))),128))])])):e.createCommentVNode("",!0)])],4)}}}),ue=e.defineComponent({__name:"VTableColumn",props:{prop:{},label:{},width:{},minWidth:{},maxWidth:{},sortable:{type:Boolean,default:!0},pinnedLeft:{type:Boolean,default:!1},pinnedRight:{type:Boolean,default:!1},actionColumn:{type:Boolean,default:!0},showOverflowTooltip:{type:Boolean,default:!0},selectable:{type:Boolean,default:!0},renderSlot:{},sortMethod:{}},setup(t){const o=t,n=e.useSlots(),l=e.inject("vt-table-columns");l||console.error("VTableColumn: не знайдено контекст таблиці. Переконайтеся, що компонент використовується всередині VTable.");const a=()=>({prop:o.prop,label:o.label,width:o.width,minWidth:o.minWidth,maxWidth:o.maxWidth,sortable:o.sortable,pinnedLeft:o.pinnedLeft,pinnedRight:o.pinnedRight,actionColumn:o.actionColumn,showOverflowTooltip:o.showOverflowTooltip,selectable:o.selectable,renderSlot:n[o.prop]||n.default||n.slot});let s=-1;return e.onMounted(()=>{if(l){const r=a();l.push(r),s=l.length-1,console.log(`VTableColumn: зареєстровано колонку "${o.label}" (${o.prop}) на позиції ${s}`)}}),e.watch(()=>[o.width,o.minWidth,o.maxWidth,o.sortable,o.pinnedLeft,o.pinnedRight,o.actionColumn,o.showOverflowTooltip,o.selectable,o.label],()=>{if(l&&s!==-1){const r=l.findIndex(i=>i.prop===o.prop);if(r!==-1){const i=l[r],c={...a(),renderSlot:i.renderSlot};l[r]=c,console.log(`VTableColumn: оновлено колонку "${o.label}" (${o.prop})`)}}},{deep:!0}),e.onUnmounted(()=>{if(l){const r=l.findIndex(i=>i.prop===o.prop);r>-1&&(l.splice(r,1),console.log(`VTableColumn: видалено колонку "${o.label}" (${o.prop})`))}}),(r,i)=>null}}),ne=(t,o)=>{const n=document.createElement("div");n.className=`vt-tooltip vt-tooltip--${o}`,n.innerText=t,Object.assign(n.style,{position:"absolute",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"4px",fontSize:"12px",lineHeight:"1.4",zIndex:"9999",pointerEvents:"none",visibility:"hidden",opacity:"0",transition:"opacity 0.2s ease, visibility 0.2s ease",maxWidth:"300px",minWidth:"max-content",wordWrap:"break-word",whiteSpace:"normal",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"}),t.length<50&&(n.style.whiteSpace="nowrap");const l=document.createElement("div");switch(l.className="vt-tooltip__arrow",Object.assign(l.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),o){case"top":Object.assign(l.style,{top:"100%",left:"50%",marginLeft:"-5px",borderWidth:"5px 5px 0 5px",borderColor:"rgba(0, 0, 0, 0.8) transparent transparent transparent"});break;case"bottom":Object.assign(l.style,{bottom:"100%",left:"50%",marginLeft:"-5px",borderWidth:"0 5px 5px 5px",borderColor:"transparent transparent rgba(0, 0, 0, 0.8) transparent"});break;case"left":Object.assign(l.style,{top:"50%",left:"100%",marginTop:"-5px",borderWidth:"5px 0 5px 5px",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.8)"});break;case"right":Object.assign(l.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return n.appendChild(l),n},J=(t,o,n)=>{const l=o.getBoundingClientRect(),a=t.getBoundingClientRect(),s=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;let i=0,c=0;switch(n){case"top":i=l.top+r-a.height-8,c=l.left+s+(l.width-a.width)/2;break;case"bottom":i=l.bottom+r+8,c=l.left+s+(l.width-a.width)/2;break;case"left":i=l.top+r+(l.height-a.height)/2,c=l.left+s-a.width-8;break;case"right":i=l.top+r+(l.height-a.height)/2,c=l.right+s+8;break}const u=window.innerWidth,d=window.innerHeight;c<8?c=8:c+a.width>u-8&&(c=u-a.width-8),i<r+8?n==="top"?i=l.bottom+r+8:i=r+8:i+a.height>r+d-8&&(n==="bottom"?i=l.top+r-a.height-8:i=r+d-a.height-8),t.style.top=`${i}px`,t.style.left=`${c}px`},le=(t,o,n)=>{t.parentElement||document.body.appendChild(t),t.style.visibility="visible",J(t,o,n),requestAnimationFrame(()=>{t.style.opacity="1"})},se=t=>{t.style.opacity="0",t.style.visibility="hidden"},ae=t=>t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight,re=t=>!!t.closest(".vt-table, table"),me={mounted(t,o){const n=o.value?.trim();if(!n)return;const l=t.dataset.placement||"top",a=ne(n,l);t.__tooltipEl=a;const s=()=>{(re(t)?ae(t):!0)&&le(a,t,l)},r=()=>{se(a)},i=()=>{a.style.opacity==="1"&&J(a,t,l)};t.__mouseenterHandler=s,t.__mouseleaveHandler=r,t.__scrollHandler=i,t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",r),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i)},updated(t,o){const n=o.value?.trim();if(t.__tooltipEl)n?t.__tooltipEl.firstChild.textContent=n:(t.__tooltipEl.parentElement&&t.__tooltipEl.parentElement.removeChild(t.__tooltipEl),delete t.__tooltipEl);else if(n){const l=t.dataset.placement||"top",a=ne(n,l);t.__tooltipEl=a;const s=()=>{(re(t)?ae(t):!0)&&le(a,t,l)},r=()=>{se(a)},i=()=>{a.style.opacity==="1"&&J(a,t,l)};t.__mouseenterHandler=s,t.__mouseleaveHandler=r,t.__scrollHandler=i,t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",r),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i)}},beforeUnmount(t){t.__tooltipEl&&t.__tooltipEl.parentElement&&(t.__tooltipEl.parentElement.removeChild(t.__tooltipEl),delete t.__tooltipEl),t.__mouseenterHandler&&(t.removeEventListener("mouseenter",t.__mouseenterHandler),delete t.__mouseenterHandler),t.__mouseleaveHandler&&(t.removeEventListener("mouseleave",t.__mouseleaveHandler),delete t.__mouseleaveHandler),t.__scrollHandler&&(window.removeEventListener("scroll",t.__scrollHandler,!0),window.removeEventListener("resize",t.__scrollHandler),delete t.__scrollHandler)}},pe={install(t,o={}){const{prefix:n="V",modal:l=!0}=o;t.component(`${n}Button`,X),t.component(`${n}Icon`,H),t.component(`${n}Loader`,Q),t.component(`${n}Modal`,ee),t.component(`${n}Pagination`,ie),t.component(`${n}Checkbox`,q),t.component(`${n}Table`,de),t.component(`${n}TableColumn`,ue),t.directive("tooltip",me),l&&t.use(ce)}},fo=pe.install;exports.VButton=X;exports.VCheckbox=q;exports.VIcon=H;exports.VLoader=Q;exports.VModal=ee;exports.VModalPlugin=ce;exports.VPagination=ie;exports.VTable=de;exports.VTableColumn=ue;exports.default=pe;exports.install=fo;exports.modalManager=U;exports.tooltipDirective=me;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=(t,o)=>{const n=t.__vccOpts||t;for(const[l,s]of o)n[l]=s;return n},we={},ye={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Be(t,o){return e.openBlock(),e.createElementBlock("svg",ye,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 8L10 12L6 8",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const xe=A(we,[["render",Be]]),Se={},Ee={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ve(t,o){return e.openBlock(),e.createElementBlock("svg",Ee,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 12L10 8L14 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Me=A(Se,[["render",Ve]]),$e={},Le={width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ne(t,o){return e.openBlock(),e.createElementBlock("svg",Le,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.8789 4.90517L11.2561 4.20124C10.4045 3.33504 9.28504 2.7626 8.06789 2.5709C6.85074 2.3792 5.60245 2.57874 4.5127 3.13917C3.42296 3.69961 2.55134 4.59032 2.03031 5.67593C1.50928 6.76155 1.36732 7.98272 1.626 9.15387C1.88469 10.325 2.52987 11.3821 3.46351 12.1645C4.39716 12.9469 5.56821 13.4119 6.79871 13.4887C8.02921 13.5655 9.25189 13.25 10.2809 12.5901C11.31 11.9302 12.0891 10.962 12.5 9.83266",stroke:"currentColor","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M8.5157 6.5C8.07025 6.5 7.84716 5.96143 8.16215 5.64645L10.3086 3.5L12.455 1.35355C12.77 1.03857 13.3086 1.26165 13.3086 1.70711V6C13.3086 6.27614 13.0847 6.5 12.8086 6.5L8.5157 6.5Z",fill:"currentColor"},null,-1)]))}const ze=A($e,[["render",Ne]]),Ie={},Re={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Te(t,o){return e.openBlock(),e.createElementBlock("svg",Re,o[0]||(o[0]=[e.createElementVNode("path",{d:"M8.60352 6L12.6035 10L8.60352 14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const De=A(Ie,[["render",Te]]),We={},Pe={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function He(t,o){return e.openBlock(),e.createElementBlock("svg",Pe,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12.3984 14L8.39844 10L12.3984 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Ae=A(We,[["render",He]]),Oe={},je={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fe(t,o){return e.openBlock(),e.createElementBlock("svg",je,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12.5 1.66406L11.1783 2.94156C10.6233 3.47906 10.345 3.7474 10 3.7474C9.655 3.7474 9.37667 3.47906 8.82167 2.94156L7.5 1.66406M14.5833 5.83073C15.7533 5.83073 16.3392 5.83073 16.7592 6.11156C16.9412 6.23319 17.0975 6.3895 17.2192 6.57156C17.5 6.99156 17.5 7.5774 17.5 8.7474V15.4141C17.5 16.5841 17.5 17.1699 17.2192 17.5899C17.0975 17.772 16.9412 17.9283 16.7592 18.0499C16.3392 18.3307 15.7533 18.3307 14.5833 18.3307C13.4133 18.3307 12.8275 18.3307 12.4075 18.0499C12.2254 17.9283 12.0691 17.772 11.9475 17.5899C11.6667 17.1699 11.6667 16.5841 11.6667 15.4141V8.7474C11.6667 7.5774 11.6667 6.99156 11.9475 6.57156C12.0691 6.3895 12.2254 6.23319 12.4075 6.11156C12.8275 5.83073 13.4133 5.83073 14.5833 5.83073ZM5.41667 5.83073C6.58667 5.83073 7.1725 5.83073 7.5925 6.11156C7.77456 6.23319 7.93087 6.3895 8.0525 6.57156C8.33333 6.99156 8.33333 7.5774 8.33333 8.7474V15.4141C8.33333 16.5841 8.33333 17.1699 8.0525 17.5899C7.93087 17.772 7.77456 17.9283 7.5925 18.0499C7.1725 18.3307 6.58667 18.3307 5.41667 18.3307C4.24667 18.3307 3.66083 18.3307 3.24083 18.0499C3.05877 17.9283 2.90246 17.772 2.78083 17.5899C2.5 17.1699 2.5 16.5841 2.5 15.4141V8.7474C2.5 7.5774 2.5 6.99156 2.78083 6.57156C2.90246 6.3895 3.05877 6.23319 3.24083 6.11156C3.66083 5.83073 4.24667 5.83073 5.41667 5.83073Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const Ze=A(Oe,[["render",Fe]]),Ue={},qe={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Xe(t,o){return e.openBlock(),e.createElementBlock("svg",qe,o[0]||(o[0]=[e.createElementVNode("path",{d:"M8 3V5.2225M8 5.2225V10.7775M8 5.2225L9.875 4.25M8 5.2225L6.125 4.25M8 10.7775V13M8 10.7775L6.125 11.75M8 10.7775L9.875 11.75M13 8H10.7775M10.7775 8H5.2225M10.7775 8L11.75 9.875M10.7775 8L11.75 6.125M5.2225 8H3M5.2225 8L4.25 6.125M5.2225 8L4.25 9.875",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M12 14.7143L13.1151 15.6701C13.3268 15.8515 13.646 15.8247 13.8246 15.6105L16 13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))}const Ge=A(Ue,[["render",Xe]]),Ke={},Ye={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Je(t,o){return e.openBlock(),e.createElementBlock("svg",Ye,o[0]||(o[0]=[e.createElementVNode("path",{d:"M8 3V5.2225M8 5.2225V10.7775M8 5.2225L9.875 4.25M8 5.2225L6.125 4.25M8 10.7775V13M8 10.7775L6.125 11.75M8 10.7775L9.875 11.75M13 8H10.7775M10.7775 8H5.2225M10.7775 8L11.75 9.875M10.7775 8L11.75 6.125M5.2225 8H3M5.2225 8L4.25 6.125M5.2225 8L4.25 9.875",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M13 16L14.5 14.5M16 13L14.5 14.5M14.5 14.5L13 13M14.5 14.5L16 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))}const Qe=A(Ke,[["render",Je]]),et={},tt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ot(t,o){return e.openBlock(),e.createElementBlock("svg",tt,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.99479 8.75521C6.55276 8.75521 6.12884 8.57961 5.81628 8.26705C5.50372 7.95449 5.32812 7.53057 5.32812 7.08854C5.32812 6.64651 5.50372 6.22259 5.81628 5.91003C6.12884 5.59747 6.55276 5.42187 6.99479 5.42188C7.43682 5.42187 7.86074 5.59747 8.1733 5.91003C8.48586 6.22259 8.66146 6.64651 8.66146 7.08854C8.66146 7.53057 8.48586 7.95449 8.1733 8.26705C7.86074 8.57961 7.43682 8.75521 6.99479 8.75521ZM6.99479 14.5885C6.55276 14.5885 6.12884 14.4129 5.81628 14.1004C5.50372 13.7878 5.32812 13.3639 5.32812 12.9219C5.32812 12.4798 5.50372 12.0559 5.81628 11.7434C6.12884 11.4308 6.55276 11.2552 6.99479 11.2552C7.43682 11.2552 7.86074 11.4308 8.1733 11.7434C8.48586 12.0559 8.66146 12.4798 8.66146 12.9219C8.66146 13.3639 8.48586 13.7878 8.1733 14.1004C7.86074 14.4129 7.43682 14.5885 6.99479 14.5885Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9948 8.75521C12.5528 8.75521 12.1288 8.57961 11.8163 8.26705C11.5037 7.95449 11.3281 7.53057 11.3281 7.08854C11.3281 6.64651 11.5037 6.22259 11.8163 5.91003C12.1288 5.59747 12.5528 5.42187 12.9948 5.42188C13.4368 5.42187 13.8607 5.59747 14.1733 5.91003C14.4859 6.22259 14.6615 6.64651 14.6615 7.08854C14.6615 7.53057 14.4859 7.95449 14.1733 8.26705C13.8607 8.57961 13.4368 8.75521 12.9948 8.75521ZM12.9948 14.5885C12.5528 14.5885 12.1288 14.4129 11.8163 14.1004C11.5037 13.7878 11.3281 13.3639 11.3281 12.9219C11.3281 12.4798 11.5037 12.0559 11.8163 11.7434C12.1288 11.4308 12.5528 11.2552 12.9948 11.2552C13.4368 11.2552 13.8607 11.4308 14.1733 11.7434C14.4859 12.0559 14.6615 12.4798 14.6615 12.9219C14.6615 13.3639 14.4859 13.7878 14.1733 14.1004C13.8607 14.4129 13.4368 14.5885 12.9948 14.5885Z",fill:"currentColor"},null,-1)]))}const nt=A(et,[["render",ot]]),lt={},st={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function at(t,o){return e.openBlock(),e.createElementBlock("svg",st,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.1667 5.83333C9.72464 5.83333 9.30072 5.65774 8.98816 5.34518C8.67559 5.03262 8.5 4.60869 8.5 4.16667C8.5 3.72464 8.67559 3.30072 8.98816 2.98816C9.30072 2.67559 9.72464 2.5 10.1667 2.5C10.6087 2.5 11.0326 2.67559 11.3452 2.98816C11.6577 3.30072 11.8333 3.72464 11.8333 4.16667C11.8333 4.60869 11.6577 5.03262 11.3452 5.34518C11.0326 5.65774 10.6087 5.83333 10.1667 5.83333ZM10.1667 11.6667C9.72464 11.6667 9.30072 11.4911 8.98816 11.1785C8.67559 10.8659 8.5 10.442 8.5 10C8.5 9.55797 8.67559 9.13405 8.98816 8.82149C9.30072 8.50893 9.72464 8.33333 10.1667 8.33333C10.6087 8.33333 11.0326 8.50893 11.3452 8.82149C11.6577 9.13405 11.8333 9.55797 11.8333 10C11.8333 10.442 11.6577 10.8659 11.3452 11.1785C11.0326 11.4911 10.6087 11.6667 10.1667 11.6667ZM10.1667 17.5C9.72464 17.5 9.30072 17.3244 8.98816 17.0118C8.67559 16.6993 8.5 16.2754 8.5 15.8333C8.5 15.3913 8.67559 14.9674 8.98816 14.6548C9.30072 14.3423 9.72464 14.1667 10.1667 14.1667C10.6087 14.1667 11.0326 14.3423 11.3452 14.6548C11.6577 14.9674 11.8333 15.3913 11.8333 15.8333C11.8333 16.2754 11.6577 16.6993 11.3452 17.0118C11.0326 17.3244 10.6087 17.5 10.1667 17.5Z",fill:"currentColor"},null,-1)]))}const rt=A(lt,[["render",at]]),it={},ct={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dt(t,o){return e.openBlock(),e.createElementBlock("svg",ct,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.33333 9.83333C6.33333 10.2754 6.15774 10.6993 5.84518 11.0118C5.53262 11.3244 5.10869 11.5 4.66667 11.5C4.22464 11.5 3.80072 11.3244 3.48816 11.0118C3.17559 10.6993 3 10.2754 3 9.83333C3 9.39131 3.17559 8.96738 3.48816 8.65482C3.80072 8.34226 4.22464 8.16667 4.66667 8.16667C5.10869 8.16667 5.53262 8.34226 5.84518 8.65482C6.15774 8.96738 6.33333 9.39131 6.33333 9.83333ZM12.1667 9.83333C12.1667 10.2754 11.9911 10.6993 11.6785 11.0118C11.3659 11.3244 10.942 11.5 10.5 11.5C10.058 11.5 9.63405 11.3244 9.32149 11.0118C9.00893 10.6993 8.83333 10.2754 8.83333 9.83333C8.83333 9.39131 9.00893 8.96738 9.32149 8.65482C9.63405 8.34226 10.058 8.16667 10.5 8.16667C10.942 8.16667 11.3659 8.34226 11.6785 8.65482C11.9911 8.96738 12.1667 9.39131 12.1667 9.83333ZM18 9.83333C18 10.2754 17.8244 10.6993 17.5118 11.0118C17.1993 11.3244 16.7754 11.5 16.3333 11.5C15.8913 11.5 15.4674 11.3244 15.1548 11.0118C14.8423 10.6993 14.6667 10.2754 14.6667 9.83333C14.6667 9.39131 14.8423 8.96738 15.1548 8.65482C15.4674 8.34226 15.8913 8.16667 16.3333 8.16667C16.7754 8.16667 17.1993 8.34226 17.5118 8.65482C17.8244 8.96738 18 9.39131 18 9.83333Z",fill:"currentColor"},null,-1)]))}const ut=A(it,[["render",dt]]),mt={},pt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ht(t,o){return e.openBlock(),e.createElementBlock("svg",pt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 14L10 10M10 10L14 6M10 10L6 6M10 10L14 14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const ft=A(mt,[["render",ht]]),vt={arrowDown:xe,arrowTop:Me,arrowRight:De,arrowLeft:Ae,arrowReload:ze,columnInsert:Ze,freeze:Ge,unfreeze:Qe,columnsMove:nt,listBullet:rt,listBulletHorizontal:ut,close:ft},H=e.defineComponent({__name:"VIcon",props:{name:{}},setup(t){const o=t,n=e.computed(()=>vt[o.name]);return(l,s)=>n.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{key:0})):e.createCommentVNode("",!0)}}),gt={},_t={class:"vt-loader"};function Ct(t,o){return e.openBlock(),e.createElementBlock("span",_t)}const Q=A(gt,[["render",Ct]]),kt=["disabled","type","data-placement"],bt={key:2,class:"vt-button__content"},X=e.defineComponent({__name:"VButton",props:{type:{default:"default"},shape:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{},tooltip:{type:Boolean,default:!1},tooltipPlacement:{default:"top"},htmlType:{default:"button"}},emits:["click"],setup(t,{emit:o}){const n=t,l=o,s=e.useSlots(),a=e.computed(()=>!!(n.icon&&n.shape)),r=e.computed(()=>(s.default?s.default({}):null)?.[0]?.children?.toString()??""),i=e.computed(()=>["vt-button",`vt-button--${n.type}`,{[`vt-button--${n.shape}`]:n.shape,"vt-button--icon-only":a.value,"vt-button--disabled":n.disabled||n.loading,"vt-button--loading":n.loading}]),c=e.computed(()=>a.value&&n.tooltip?r.value:null),u=d=>{!n.disabled&&!n.loading&&l("click",d)};return(d,B)=>{const y=e.resolveDirective("tooltip");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(i.value),disabled:n.disabled||n.loading,type:n.htmlType,"data-placement":n.tooltipPlacement,onClick:u},[n.loading?(e.openBlock(),e.createBlock(Q,{key:0,class:"vt-button__icon"})):n.icon?(e.openBlock(),e.createBlock(H,{key:1,name:n.icon,class:"vt-button__icon"},null,8,["name"])):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",bt,[e.renderSlot(d.$slots,"default")]))],10,kt)),[[y,c.value]])}}}),wt={key:0,class:"vt-modal__header"},yt={key:0,class:"vt-modal__title"},Bt={class:"vt-modal__content"},ee=e.defineComponent({__name:"VModal",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},showCloseButton:{type:Boolean,default:!0},closeOnBackdropClick:{type:Boolean,default:!0},zIndex:{default:1e3}},emits:["update:modelValue","close"],setup(t,{emit:o}){const n=t,l=o,s=e.computed(()=>["vt-modal__container",`vt-modal__container--${n.size}`]),a=e.computed(()=>({zIndex:n.zIndex})),r=()=>{l("update:modelValue",!1),l("close")},i=()=>{n.closeOnBackdropClick&&r()};return(c,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-modal__backdrop",style:e.normalizeStyle(a.value),onClick:i},[e.createElementVNode("div",{class:e.normalizeClass(s.value),onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[c.title||c.showCloseButton?(e.openBlock(),e.createElementBlock("div",wt,[c.title?(e.openBlock(),e.createElementBlock("h2",yt,e.toDisplayString(c.title),1)):e.createCommentVNode("",!0),c.showCloseButton?(e.openBlock(),e.createBlock(H,{key:1,name:"close",class:"vt-modal__close",onClick:r})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.renderSlot(c.$slots,"default")])],2)],4)):e.createCommentVNode("",!0)]))}}),xt={class:"vt-pagination"},St={class:"vt-pagination__info"},Et={class:"vt-pagination__rows-per-page"},Vt=["value"],Mt={class:"vt-pagination__navigation"},$t=["disabled"],Lt=["onClick"],Nt=["disabled"],ie=e.defineComponent({__name:"VPagination",props:{totalItems:{},pageSize:{default:10},currentPage:{default:1},pageSizeOptions:{default:()=>[5,10,20,50]},maxVisiblePages:{default:6}},emits:["update:currentPage","update:pageSize","pageChange","reloadData"],setup(t,{emit:o}){const n=t,l=o,s=e.computed({get:()=>n.currentPage,set:x=>l("update:currentPage",x)}),a=e.computed({get:()=>n.pageSize,set:x=>l("update:pageSize",x)}),r=e.computed(()=>Math.ceil(n.totalItems/a.value)),i=e.computed(()=>n.totalItems===0?0:(s.value-1)*a.value+1),c=e.computed(()=>Math.min(s.value*a.value,n.totalItems)),u=e.computed(()=>s.value<=1),d=e.computed(()=>s.value>=r.value),B=e.computed(()=>{const x=[],L=r.value,w=s.value,D=n.maxVisiblePages;if(L<=D)for(let h=1;h<=L;h++)x.push(h);else{x.push(1);const h=Math.max(2,w-Math.floor(D/2)),M=Math.min(L-1,w+Math.floor(D/2));h>2&&x.push("...");for(let N=h;N<=M;N++)x.push(N);M<L-1&&x.push("..."),L>1&&x.push(L)}return x}),y=()=>{l("pageChange",{page:s.value,pageSize:a.value})},z=x=>{typeof x=="number"&&x!==s.value&&(s.value=x,y())},T=()=>{u.value||(s.value--,y())},O=()=>{d.value||(s.value++,y())},j=()=>{s.value=1,y()},P=()=>{l("reloadData",s.value)};return e.watch(()=>n.totalItems,()=>{s.value>r.value&&r.value>0&&(s.value=r.value,y())}),(x,L)=>(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",St,[e.createElementVNode("div",Et,[L[1]||(L[1]=e.createElementVNode("label",{for:"rowsSelect",class:"vt-pagination__label"},"Рядків на сторінку:",-1)),e.withDirectives(e.createElementVNode("select",{id:"rowsSelect","onUpdate:modelValue":L[0]||(L[0]=w=>a.value=w),onChange:j,class:"vt-pagination__select"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.pageSizeOptions,w=>(e.openBlock(),e.createElementBlock("option",{key:w,value:w},e.toDisplayString(w),9,Vt))),128))],544),[[e.vModelSelect,a.value]])]),e.createElementVNode("span",null,e.toDisplayString(i.value)+" - "+e.toDisplayString(c.value)+" з "+e.toDisplayString(x.totalItems),1)]),e.createElementVNode("div",Mt,[e.createElementVNode("button",{onClick:T,disabled:u.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!u.value})},[e.createVNode(H,{name:"arrowLeft"})],10,$t),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,w=>(e.openBlock(),e.createElementBlock("button",{key:w,onClick:D=>z(w),class:e.normalizeClass(["vt-pagination__nav-button",{"vt-pagination__nav-button--active":w===s.value}])},e.toDisplayString(w),11,Lt))),128)),e.createElementVNode("button",{onClick:O,disabled:d.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!d.value})},[e.createVNode(H,{name:"arrowRight"})],10,Nt)]),e.createElementVNode("div",null,[e.createVNode(X,{icon:"arrowReload",shape:"circle",tooltip:"",tooltipPlacement:"left",onClick:P},{default:e.withCtx(()=>L[2]||(L[2]=[e.createTextVNode("Оновити дані ",-1)])),_:1,__:[2]})])]))}}),zt=["for"],It=["id","name","value","checked","disabled","required",".indeterminate"],q=e.defineComponent({__name:"VCheckbox",props:{modelValue:{type:Boolean,default:void 0},checked:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},id:{},name:{},value:{},indeterminate:{type:Boolean,default:!1},size:{default:"medium"},variant:{default:"primary"},required:{type:Boolean,default:!1},isDouble:{type:Boolean,default:!1}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:o}){const n=t,l=o,s=()=>`vt-checkbox-${Math.random().toString(36).substr(2,9)}`,a=e.computed(()=>n.id||s()),r=e.computed(()=>n.modelValue??n.checked),i=d=>{if(n.disabled)return;const y=d.target.checked;l("update:modelValue",y),l("change",y,d)},c=d=>{l("focus",d)},u=d=>{l("blur",d)};return(d,B)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["vt-checkbox",`vt-checkbox--${d.size}`,`vt-checkbox--${d.variant}`,{"vt-checkbox--disabled":d.disabled,"vt-checkbox--double":d.isDouble}]),for:a.value},[e.createElementVNode("input",{id:a.value,name:d.name,value:d.value,checked:r.value,disabled:d.disabled,required:d.required,".indeterminate":d.indeterminate,type:"checkbox",class:"vt-checkbox__input",onChange:i,onFocus:c,onBlur:u},null,40,It),e.createElementVNode("div",{class:e.normalizeClass(["vt-checkbox__box",{"vt-checkbox__box--checked":r.value&&!d.indeterminate&&!d.isDouble,"vt-checkbox__box--indeterminate":d.indeterminate,"vt-checkbox__box--double":d.isDouble&&r.value,"vt-checkbox__box--disabled":d.disabled}])},[!d.indeterminate&&!d.isDouble?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["vt-checkbox__checkmark",{"vt-checkbox__checkmark--checked":r.value}]),width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B[0]||(B[0]=[e.createElementVNode("path",{d:"M1 5L3.58264 7.58264C3.80112 7.80112 4.16348 7.77113 4.34306 7.51971L9 1",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]),2)):e.createCommentVNode("",!0),d.isDouble&&r.value?(e.openBlock(),e.createElementBlock("svg",{key:1,class:e.normalizeClass(["vt-checkbox__checkmark",{"vt-checkbox__checkmark--checked":r.value}]),width:"13",height:"6",viewBox:"0 0 13 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B[1]||(B[1]=[e.createElementVNode("path",{d:"M6 3L8.25 5L12 1",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M1 3L3.25 5L7 1",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2)):e.createCommentVNode("",!0),d.indeterminate?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["vt-checkbox__indeterminate-mark",{"vt-checkbox__indeterminate-mark--visible":d.indeterminate}])},null,2)):e.createCommentVNode("",!0)],2),d.label||d.$slots.label||d.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vt-checkbox__label",{"vt-checkbox__label--disabled":d.disabled}])},[e.renderSlot(d.$slots,"label",{},()=>[e.renderSlot(d.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(d.label),1)])])],2)):e.createCommentVNode("",!0)],10,zt))}});function Rt(t){const o=e.computed(()=>[...t].sort((s,a)=>s.pinnedLeft&&!a.pinnedLeft?-1:!s.pinnedLeft&&a.pinnedLeft||s.pinnedRight&&!a.pinnedRight?1:!s.pinnedRight&&a.pinnedRight?-1:0)),n=()=>{const s=o.value.length,a=o.value.filter(d=>d.width||d.minWidth),r=a.reduce((d,B)=>d+(B.width||B.minWidth||0),0),i=s-a.length;if(i===0)return 150;const u=Math.max(800-r,i*80);return Math.max(Math.floor(u/i),120)};return{sortedColumns:o,getDefaultColumnWidth:n,getStickyOffset:(s,a,r=!1)=>{const i=o.value;let c=0;if(s==="left"){r&&(c+=50);for(let u=0;u<a;u++){const d=i[u];d.pinnedLeft&&(c+=d.width||d.minWidth||n())}}else for(let u=i.length-1;u>a;u--){const d=i[u];d.pinnedRight&&(c+=d.width||d.minWidth||n())}return c}}}function Tt(t){const o=()=>{const a={};return t.maxHeight&&(a.maxHeight=`${t.maxHeight}px`),a},n=(a,r,i,c)=>{const u={};if(a.width)u.width=`${a.width}px`,u.minWidth=`${a.width}px`,u.maxWidth=`${a.width}px`;else if(a.minWidth)u.minWidth=`${a.minWidth}px`,u.width=`${a.minWidth}px`,u.maxWidth="none";else{const d=c();u.width=`${d}px`,u.minWidth="80px",u.maxWidth="none"}return a.pinnedLeft?(u.position="sticky",u.left=`${i("left",r,t.selectable)}px`,u.zIndex="10"):a.pinnedRight&&(u.position="sticky",u.right=`${i("right",r,!1)}px`,u.zIndex="10"),u};return{getTableWrapperStyle:o,getColumnStyle:n,getHeaderStyle:(a,r,i,c)=>{const u=n(a,r,i,c);return t.maxHeight&&(u.position="sticky",u.top="0",a.pinnedLeft||a.pinnedRight?u.zIndex="12":u.zIndex="11"),u},getFooterStyle:(a,r,i,c)=>{const u=n(a,r,i,c);return t.maxHeight&&(u.position="sticky",u.bottom="0",a.pinnedLeft||a.pinnedRight?u.zIndex="12":u.zIndex="11"),u}}}function Dt(){const t=e.ref({resizingCol:null,startX:0,startWidth:0}),o=`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5 13L2 10L5 7' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M15 7L18 10L15 13' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M10 3L10 17' stroke='%23828282' stroke-width='3' stroke-linecap='round'/></svg>") 10 10, col-resize`;return{onMouseDown:(l,s,a,r)=>{l.preventDefault(),l.stopPropagation(),t.value.resizingCol=s,t.value.startX=l.clientX,t.value.startWidth=s.width||s.minWidth||a(s.prop);const i=u=>{const{resizingCol:d,startX:B,startWidth:y}=t.value;if(!d)return;document.querySelectorAll(`[data-resizer="${d.prop}"]`).forEach(P=>{P.classList.add("vt-table__resizer--active")});const z=u.clientX-B,T=d.minWidth||50,O=d.maxWidth||1e3,j=Math.max(Math.min(y+z,O),T);d.width=j},c=()=>{const{resizingCol:u}=t.value;document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("vt-table-resizing"),u&&(document.querySelectorAll(`[data-resizer="${u.prop}"]`).forEach(d=>{d.classList.remove("vt-table__resizer--active")}),r&&u.width&&(console.log("📏 Викликаємо callback з новою шириною:",u.width),r(u.width))),t.value.resizingCol=null};document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),document.body.style.cursor=o,document.body.style.userSelect="none",document.body.classList.add("vt-table-resizing")},resizeState:t}}function Wt(t,o,n,l){const s=t.selectionKey||"id",a=e.ref([]),r=e.ref(null),i=e.ref(!1);t.defaultSelection?.length&&(a.value=[...t.defaultSelection]);const c=k=>k[s],u=k=>i.value?!0:a.value.some($=>c($)===c(k)),d=e.computed(()=>o.value.filter(k=>u(k)).length),B=e.computed(()=>o.value.length>0&&d.value===o.value.length),y=e.computed(()=>{if(i.value)return!1;const k=d.value;return k>0&&k<o.value.length}),z=e.computed(()=>i.value?!0:B.value&&!y.value),T=e.computed(()=>i.value),O=(k,$)=>{const V=c(k),I=a.value.some(m=>c(m)===c(k)),W=$!==void 0?$:!I;if(i.value&&!W){i.value=!1,l?.value&&(a.value=l.value.filter(m=>c(m)!==V)),N(k,!1);return}i.value&&W||(W&&!I?a.value.push(k):!W&&I&&(a.value=a.value.filter(m=>c(m)!==V)),t.selectOnClickRow&&$===void 0&&D(W?k:null),N(k,W))},j=()=>{switch(P()){case"none":case"partial":x();break;case"allVisible":L();break;case"absoluteAll":w();break}},P=()=>i.value?"absoluteAll":B.value?"allVisible":d.value>0?"partial":"none",x=()=>{const k=[],$=new Set(a.value.map(V=>c(V)));a.value.forEach(V=>{k.push(V)}),o.value.forEach(V=>{$.has(c(V))||k.push(V)}),a.value=k,i.value=!1,N()},L=()=>{i.value=!0,l?.value?a.value=[...l.value]:a.value=[...o.value],N(void 0,void 0,!0)},w=()=>{a.value=[],i.value=!1,r.value=null,N()},D=k=>{const $=r.value;r.value=k,n("current-change",{currentRow:r.value,oldCurrentRow:$})},h=()=>[...a.value],M=k=>{a.value=[...k],i.value=!1,N()},N=(k,$,V=!1)=>{const I={selection:[...a.value],row:k,selected:$,isAllSelected:V||i.value};n("selection-change",I)};return e.watch(()=>t.defaultSelection,k=>{k?.length&&(a.value=[...k])}),{selectedRows:a,currentRow:r,isRowSelected:u,isAllSelected:z,isIndeterminate:y,isDoubleCheck:T,isFullSelection:i,toggleRowSelection:O,toggleAllSelection:j,clearSelection:w,setCurrentRow:D,getSelectionRows:h,setSelectionRows:M,selectAbsolutelyAll:L}}const Pt=(t,o,n="asc")=>{if(t==null&&o==null)return 0;if(t==null)return n==="asc"?1:-1;if(o==null)return n==="asc"?-1:1;if(t===o)return 0;let l=0;const s=Number(t),a=Number(o);return!isNaN(s)&&!isNaN(a)?l=s-a:te(t)&&te(o)?l=new Date(t).getTime()-new Date(o).getTime():typeof t=="boolean"&&typeof o=="boolean"?l=t===o?0:t?-1:1:l=String(t).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"}),n==="desc"?-l:l},te=t=>t instanceof Date?!isNaN(t.getTime()):typeof t=="string"&&/\d{4}-\d{2}-\d{2}|\//.test(t)?!isNaN(new Date(t).getTime()):!1,Ht=(t,o,n)=>{t.sortable&&n({prop:t.prop,direction:o})},oe=(t,o)=>{const n=o?.prop===t.prop,l=o?.direction;return{asc:["vt-th__sort-icon",n&&l==="asc"&&"vt-th__sortable-active"].filter(Boolean).join(" "),desc:["vt-th__sort-icon",n&&l==="desc"&&"vt-th__sortable-active"].filter(Boolean).join(" ")}},At=(t,o,n)=>{if(!o)return[...t];const l=n.find(a=>a.prop===o.prop);if(!l?.sortable)return[...t];const s=l.sortMethod||Pt;return[...t].sort((a,r)=>{const i=a[l.prop],c=r[l.prop];return s(i,c,o.direction)})};class Ot{modalStack=[];baseZIndex=1e3;open(o={}){const n=`modal-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,l=document.createElement("div");l.setAttribute("data-vt-modal",n),document.body.appendChild(l);const s=e.ref(!0),a=this.baseZIndex+this.modalStack.length*10,r=e.createApp({setup(){const c=()=>{s.value=!1,setTimeout(()=>{U.closeById(n)},100)};return()=>e.h(ee,{modelValue:s.value,"onUpdate:modelValue":c,title:o.title,size:o.size||"medium",showCloseButton:o.showCloseButton!==!1,closeOnBackdropClick:o.closeOnBackdropClick!==!1,onClose:c,zIndex:a},{default:()=>o.component?e.h(o.component,o.props||{}):o.content?e.h("div",{innerHTML:o.content}):null})}});r.mount(l);const i={id:n,app:r,container:l,isOpen:s};return this.modalStack.push(i),n}close(){if(this.modalStack.length>0){const o=this.modalStack[this.modalStack.length-1];this.closeById(o.id)}}closeById(o){const n=this.modalStack.findIndex(l=>l.id===o);if(n!==-1){const l=this.modalStack[n];this.cleanupModal(l),this.modalStack.splice(n,1),this.recalculateZIndices()}}closeAll(){for(;this.modalStack.length>0;){const o=this.modalStack.pop();o&&this.cleanupModal(o)}}getOpenModalsCount(){return this.modalStack.length}cleanupModal(o){o.app&&o.app.unmount(),o.container&&o.container.parentNode&&document.body.removeChild(o.container)}recalculateZIndices(){}}const U=new Ot,ce={install(t){t.config.globalProperties.$modal=U,t.config.globalProperties.$modalStack={closeAll:()=>U.closeAll(),getCount:()=>U.getOpenModalsCount(),closeById:o=>U.closeById(o)}}},jt={class:"vt-columns-selector-body"},Ft={class:"vt-columns-selector"},Zt={class:"vt-columns-selector__panel"},Ut=["draggable","onDragstart","onDragover","onDrop"],qt={key:0,class:"vt-columns-selector__panel-item-pinned"},Xt={class:"vt-columns-selector__available"},Gt=["onClick"],Kt={key:0,class:"vt-columns-selector__group-columns"},Yt={key:0,class:"vt-columns-selector__pinned-note"},Jt={class:"vt-modal__content-button"},Qt=e.defineComponent({__name:"VTableColumnSelector",props:{columns:{},columnsSelector:{default:()=>[]}},emits:["update-columns"],setup(t,{emit:o}){const n=t,l=o,s=e.ref([]),a=e.ref(new Set),r=e.ref(-1),i=e.ref(-1),c=e.ref("before"),u=e.computed(()=>{const m={};return n.columnsSelector.forEach(v=>{if(v.name==="removed")return;const g=v.columns.map(S=>S.prop),C=s.value.filter(S=>g.includes(S.prop));C.length===0?m[v.name]={checked:!1,indeterminate:!1}:C.length===v.columns.length?m[v.name]={checked:!0,indeterminate:!1}:m[v.name]={checked:!1,indeterminate:!0}}),m}),d=e.computed(()=>n.columnsSelector.filter(m=>m.name!=="removed")),B=m=>m.pinnedLeft||m.pinnedRight,y=m=>!B(m),z=()=>{const m=s.value;let v=-1;for(let C=0;C<m.length;C++)m[C].pinnedLeft&&(v=C);let g=m.length;for(let C=0;C<m.length;C++)if(m[C].pinnedRight){g=C;break}return{minIndex:v+1,maxIndex:g-1}},T=m=>{const v=z();return!(m<v.minIndex||m>v.maxIndex+1)},O=(m,v)=>{const g=s.value[v];if(!y(g)){m.preventDefault();return}r.value=v,m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",g.prop)),document.body.style.cursor="grabbing"},j=(m,v)=>{if(r.value===-1)return;m.preventDefault();const g=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=g.top+g.height/2;let R=v,Z="before";C<S?(R=v,Z="before"):(R=v+1,Z="after"),r.value<R&&R--,T(R)?(i.value=v,c.value=Z,m.dataTransfer.dropEffect="move"):(i.value=-1,m.dataTransfer.dropEffect="none")},P=()=>{setTimeout(()=>{r.value===-1&&(i.value=-1)},50)},x=(m,v)=>{if(m.preventDefault(),r.value===-1||i.value===-1){w();return}const g=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=g.top+g.height/2;let R=v;if(C>=S&&(R=v+1),r.value<R&&R--,!T(R)||R===r.value){w();return}const Z=[...s.value],[G]=Z.splice(r.value,1);Z.splice(R,0,G),s.value=Z,w()},L=()=>{w()},w=()=>{r.value=-1,i.value=-1,c.value="before",document.body.style.cursor=""},D=m=>{const v=["vt-columns-selector__panel-item"];return r.value===m&&v.push("vt-columns-selector__panel-item--dragging"),i.value===m&&c.value==="before"&&v.push("vt-columns-selector__panel-item--drop-before"),i.value===m&&c.value==="after"&&v.push("vt-columns-selector__panel-item--drop-after"),v},h=()=>{s.value=[...n.columns.map(m=>({...m}))],n.columnsSelector.forEach(m=>{m.name!=="removed"&&a.value.add(m.name)})},M=(m,v)=>{if(v)s.value.some(g=>g.prop===m.prop)||s.value.push({...m});else{if(B(m))return;s.value=s.value.filter(g=>g.prop!==m.prop)}},N=(m,v)=>{if(v)m.columns.forEach(g=>{s.value.some(C=>C.prop===g.prop)||s.value.push({...g})});else{const g=[];m.columns.forEach(C=>{const S=s.value.find(R=>R.prop===C.prop);S&&!B(S)&&g.push(S)}),s.value=s.value.filter(C=>!g.some(S=>S.prop===C.prop))}},k=m=>s.value.some(v=>v.prop===m.prop),$=m=>{const v=s.value.find(g=>g.prop===m.prop);return!v||!B(v)},V=m=>{a.value.has(m)?a.value.delete(m):a.value.add(m)},I=()=>{l("update-columns",[...s.value]),U.close()},W=()=>{U.close()};return e.onMounted(()=>{h()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",jt,[e.createElementVNode("div",Ft,[e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(g,C)=>(e.openBlock(),e.createElementBlock("div",{key:g.prop,class:e.normalizeClass(D(C)),draggable:y(g),onDragstart:S=>O(S,C),onDragover:S=>j(S,C),onDragleave:P,onDrop:S=>x(S,C),onDragend:L},[e.createVNode(H,{name:y(g)?"columnsMove":"freeze",class:e.normalizeClass(["vt-columns-selector__panel-item-icon",{"vt-columns-selector__panel-item-icon--draggable":y(g)}])},null,8,["name","class"]),e.createVNode(q,{label:g.label,checked:!0,disabled:B(g),onChange:S=>M(g,S),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},null,8,["label","disabled","onChange"]),B(g)?(e.openBlock(),e.createElementBlock("span",qt,"pinned")):e.createCommentVNode("",!0)],42,Ut))),128))]),e.createElementVNode("div",Xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("div",{key:g.name,class:"vt-columns-selector__group"},[e.createElementVNode("div",{class:"vt-columns-selector__group-header",onClick:C=>V(g.name)},[e.createVNode(q,{label:g.label,checked:u.value[g.name]?.checked||!1,indeterminate:u.value[g.name]?.indeterminate||!1,onChange:C=>N(g,C),onClick:v[1]||(v[1]=e.withModifiers(()=>{},["stop"]))},null,8,["label","checked","indeterminate","onChange"]),g.icon?(e.openBlock(),e.createBlock(H,{key:0,name:g.icon,class:"vt-columns-selector__group-icon"},null,8,["name"])):e.createCommentVNode("",!0)],8,Gt),a.value.has(g.name)?(e.openBlock(),e.createElementBlock("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.columns,C=>(e.openBlock(),e.createElementBlock("div",{key:C.prop,class:"vt-columns-selector__group-column"},[e.createVNode(q,{label:C.label,checked:k(C),disabled:!$(C),onChange:S=>M(C,S)},null,8,["label","checked","disabled","onChange"]),$(C)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Yt," (закріплена) "))]))),128))])):e.createCommentVNode("",!0)]))),128))])]),e.createElementVNode("div",Jt,[e.createVNode(X,{onClick:W},{default:e.withCtx(()=>v[2]||(v[2]=[e.createTextVNode("Скасувати",-1)])),_:1,__:[2]}),e.createVNode(X,{type:"primary",onClick:I},{default:e.withCtx(()=>v[3]||(v[3]=[e.createTextVNode("Зберегти",-1)])),_:1,__:[3]})])]))}}),eo=e.defineComponent({__name:"ColumnActions",props:{column:{},allColumns:{},columnsSelector:{}},emits:["pin","update-columns"],setup(t,{emit:o}){const n=t,l=o,s=e.ref(),a=e.ref(),r=e.ref(),i=e.ref(!1),c=e.ref(!1),u=e.ref([]),d=async()=>{if(await e.nextTick(),!s.value||!a.value)return;const h=a.value.getBoundingClientRect(),M=s.value,N=M.offsetWidth,k=h.left+h.width/2;M.style.top=`${h.bottom-20}px`,M.style.left=`${k-N/2}px`;const $=M.getBoundingClientRect();$.right>window.innerWidth&&(M.style.left=`${window.innerWidth-N-8}px`),$.left<0&&(M.style.left="8px")},B=h=>{h.stopPropagation(),!c.value&&(i.value?z():y())},y=()=>{c.value||(i.value=!0,d(),r.value&&(r.value.style.zIndex="22"))},z=()=>{c.value=!0,i.value=!1,r.value&&r.value.style.removeProperty("z-index"),setTimeout(()=>{c.value=!1},100)},T=h=>{!a.value?.contains(h.target)&&!s.value?.contains(h.target)&&z()},O=()=>{D()?(l("pin",n.column,"none"),console.log(`Колонка "${n.column.label}" відкріплена`)):(l("pin",n.column,"left"),console.log(`Колонка "${n.column.label}" прикріплена зліва`)),z()},j=h=>({name:"removed",label:"Видалені колонки",order:999,columns:h}),P=h=>{const M=new Set(h.map(V=>V.prop)),N=new Set;n.columnsSelector?.forEach(V=>{V.columns.forEach(I=>N.add(I.prop))}),n.allColumns.forEach(V=>N.add(V.prop));const k=[];N.forEach(V=>{if(!M.has(V)){let I;n.columnsSelector?.forEach(W=>{const m=W.columns.find(v=>v.prop===V);m&&(I=m)}),I||(I=n.allColumns.find(W=>W.prop===V)),I&&k.push(I)}});const $=[...n.columnsSelector||[]];k.length>0&&$.push(j(k)),u.value=$},x=()=>{P(n.allColumns),U.open({component:Qt,title:"Управління колонками таблиці",props:{columns:n.allColumns,columnsSelector:u.value,"onUpdate-columns":h=>{console.log("ColumnActions отримав оновлені колонки:",h),l("update-columns",h),P(h)}},size:"large",closeOnBackdropClick:!1}),z()},L=()=>n.column.pinnedLeft,w=()=>n.column.pinnedRight,D=()=>L()||w();return e.onMounted(()=>{document.addEventListener("click",T),a.value&&(r.value=a.value.closest("th")),P(n.allColumns)}),e.onUnmounted(()=>{document.removeEventListener("click",T)}),(h,M)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"triggerRef",ref:a,class:"vt-table-header-actions",onClick:B},[e.createVNode(H,{name:"listBullet"}),i.value?(e.openBlock(),e.createElementBlock("ul",{key:0,ref_key:"menuRef",ref:s,class:e.normalizeClass(["dropdown-menu","vt-table-dropdown",{visible:i.value}])},[e.createElementVNode("li",{onClick:O},[e.createVNode(H,{name:D()?"unfreeze":"freeze"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(D()?"Розморозити":"Заморозити"),1)]),e.createElementVNode("li",{onClick:x},[e.createVNode(H,{name:"columnInsert"}),M[0]||(M[0]=e.createElementVNode("span",null,"Колонки",-1))])],2)):e.createCommentVNode("",!0)],512))}}),to={class:"vt-table"},oo={class:"vt-th__content"},no={class:"vt-th__content"},lo={class:"vt-th__label"},so={key:0,class:"vt-th__sortable"},ao=["data-resizer","onMousedown"],ro=["onClick"],io={class:"vt-table__cell-content"},co={class:"vt-table__cell-content vt-table__cell-content--ellipsis"},uo={key:1},mo=["data-resizer","onMousedown"],po={key:0,class:"vt-table__summary"},ho={class:"vt-table__cell-content vt-table__cell-content--summary"},Y=50,de=e.defineComponent({__name:"VTable",props:e.mergeModels({data:{},maxHeight:{},defaultSort:{},showSummary:{type:Boolean},summaryMethod:{type:Function},columnsSelector:{},selectable:{type:Boolean},selectionKey:{},defaultSelection:{},selectOnClickRow:{type:Boolean},highlightCurrentRow:{type:Boolean},allData:{},columns:{}},{columns:{required:!1},columnsModifiers:{}}),emits:e.mergeModels(["sort-change","selection-change","current-change","row-click","update:columns","column-pin","column-resize","column-visibility","column-sort","columns-change"],["update:columns"]),setup(t,{expose:o,emit:n}){const l=t,s=e.useModel(t,"columns"),a=n,r=e.ref({}),i=e.ref(),c=e.reactive([]),u=e.ref(l.defaultSort||null),d=e.computed(()=>s.value!==void 0),B=()=>{d.value&&s.value?c.splice(0,c.length,...s.value):l.columns&&c.splice(0,c.length,...l.columns)};e.watch(()=>s.value,p=>{p&&d.value&&c.splice(0,c.length,...p)},{deep:!0}),e.watch(()=>l.columns,p=>{p&&!d.value&&c.splice(0,c.length,...p)},{deep:!0}),e.provide("vt-table-columns",c);const{sortedColumns:y,getDefaultColumnWidth:z,getStickyOffset:T}=Rt(c),{getTableWrapperStyle:O,getColumnStyle:j,getHeaderStyle:P,getFooterStyle:x}=Tt(l),{onMouseDown:L}=Dt(),w=e.computed(()=>At(l.data,u.value,c)),D=e.computed(()=>l.allData||l.data),h=l.selectable?Wt(l,w,a,D):null,M=()=>({width:`${Y}px`,minWidth:`${Y}px`,maxWidth:`${Y}px`,left:"0px",position:"sticky",zIndex:10}),N=()=>{const p=M();return l.maxHeight?{...p,top:"0px",zIndex:11}:p},k=()=>{const p=M();return l.maxHeight?{...p,bottom:"0px",zIndex:11}:p},$=(p,_)=>{Ht(p,_,E=>{u.value?.prop===p.prop&&u.value.direction===_?u.value=null:u.value=E,a("sort-change",{column:p,direction:u.value?.direction||null,prop:p.prop,sortedData:w.value})})},V=(p,_)=>{console.log(`Колонка "${p.label}" закріплення: ${_}`);const E={pinnedLeft:_==="left",pinnedRight:_==="right"};W(p.prop,E),a("column-pin",{column:{...p,...E},position:_})},I=p=>{console.log("handleColumnsUpdate викликано з колонками:",p),c.splice(0,c.length,...p),d.value&&(s.value=[...p]),a("columns-change",[...p])},W=(p,_)=>{console.log("updateColumn викликано:",{prop:p,updates:_,hasColumnsModel:d.value});const E=c.findIndex(f=>f.prop===p);if(E!==-1){if(console.log("Оновлюємо internalColumns:",E,_),Object.assign(c[E],_),d.value&&s.value){const f=s.value.findIndex(b=>b.prop===p);if(f!==-1){const b=[...s.value];b[f]={...b[f],..._},console.log("Оновлюємо через defineModel:",b),s.value=b}}a("columns-change",[...c])}else console.error("Колонку не знайдено:",p,"Доступні колонки:",c.map(f=>f.prop))},m=(p,_,E)=>{a("row-click",{row:p,column:_,event:E}),l.highlightCurrentRow&&h&&h.setCurrentRow(p)},v=(p,_,E)=>{E.stopPropagation(),h&&h.toggleRowSelection(_,p)},g=(p,_)=>{_.stopPropagation(),h&&h.toggleAllSelection(),p===void 0&&console.log(p)},C=(p,_)=>{p&&(r.value[_]=p)},S=(p,_)=>{const E=_.width||z();console.log(E),L(p,_,z,f=>{console.log(f),W(_.prop,{width:f}),a("column-resize",{column:{..._,width:f},width:f,oldWidth:E})})},R=(p,_)=>j(p,_,T,z),Z=(p,_)=>P(p,_,T,z),G=(p,_)=>x(p,_,T,z),he=(p,_)=>{if(!_||!_.prop)return"";const E=p[_.prop];return E==null?"":String(E)},fe=e.computed(()=>{if(!l.showSummary)return{};const p=c;if(typeof l.summaryMethod=="function"){const _=l.summaryMethod({columns:p,data:w.value});return p.reduce((E,f,b)=>(E[f.prop]=_[b],E),{})}return p.reduce((_,E)=>{const f=w.value.map(b=>b[E.prop]);return _[E.prop]=f.every(b=>typeof b=="number")?f.reduce((b,F)=>b+F,0):"",_},{})}),ve=(p,_)=>{h&&h.toggleRowSelection(p,_)},ge=()=>{h&&h.toggleAllSelection()},_e=()=>{h&&h.selectAbsolutelyAll()},Ce=()=>{h&&h.clearSelection()},ke=()=>h?h.getSelectionRows():[],be=p=>{h&&h.setSelectionRows(p)};return e.onMounted(()=>{B()}),o({toggleRowSelection:ve,toggleAllSelection:ge,selectAbsolutelyAll:_e,clearSelection:Ce,getSelectionRows:ke,setSelectionRows:be}),(p,_)=>{const E=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{ref_key:"tableWrapperRef",ref:i,class:"vt-table-wrapper",style:e.normalizeStyle(e.unref(O)())},[e.renderSlot(p.$slots,"default"),e.createElementVNode("table",to,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[l.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["vt-table__th vt-table__th--selection",{"vt-table__th--sticky":l.maxHeight,"vt-table__th--pinned-left":!0}]),style:e.normalizeStyle(N())},[e.createElementVNode("div",oo,[e.createVNode(q,{checked:e.unref(h)?.isAllSelected.value,indeterminate:e.unref(h)?.isIndeterminate.value,"is-double":e.unref(h)?.isDoubleCheck?.value,onChange:g},null,8,["checked","indeterminate","is-double"])])],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(f,b)=>(e.openBlock(),e.createElementBlock("th",{key:f.prop,ref_for:!0,ref:F=>C(F,f.prop),style:e.normalizeStyle(Z(f,b)),class:e.normalizeClass(["vt-table__th",{"vt-table__th--sticky":l.maxHeight,"vt-table__th--pinned-left":f.pinnedLeft,"vt-table__th--pinned-right":f.pinnedRight,"vt-table__th--sortable":f.sortable}])},[e.createElementVNode("div",no,[e.createElementVNode("div",lo,e.toDisplayString(f.label),1),f.sortable?(e.openBlock(),e.createElementBlock("div",so,[e.createVNode(H,{name:"arrowTop",class:e.normalizeClass(e.unref(oe)(f,u.value).asc),onClick:e.withModifiers(F=>$(f,"asc"),["stop"])},null,8,["class","onClick"]),e.createVNode(H,{name:"arrowDown",class:e.normalizeClass(e.unref(oe)(f,u.value).desc),onClick:e.withModifiers(F=>$(f,"desc"),["stop"])},null,8,["class","onClick"])])):e.createCommentVNode("",!0),f.actionColumn?(e.openBlock(),e.createBlock(eo,{key:1,column:f,"all-columns":e.unref(y),columnsSelector:l.columnsSelector,onPin:V,onUpdateColumns:I},null,8,["column","all-columns","columnsSelector"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":f.prop,onMousedown:F=>S(F,f)},null,40,ao)],6))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,f=>(e.openBlock(),e.createElementBlock("tr",{key:f.id,class:e.normalizeClass(["vt-table__row",{"vt-table__row--selected":e.unref(h)?.isRowSelected(f),"vt-table__row--current":e.unref(h)?.currentRow.value===f,"vt-table__row--clickable":l.selectOnClickRow||l.highlightCurrentRow}]),onClick:b=>m(f,e.unref(y)[0],b)},[l.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["vt-table__td vt-table__td--selection",{"vt-table__td--pinned-left":!0}]),style:e.normalizeStyle(M())},[e.createElementVNode("div",io,[e.createVNode(q,{checked:e.unref(h)?.isRowSelected(f),onChange:(b,F)=>v(b,f,F)},null,8,["checked","onChange"])])],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(b,F)=>(e.openBlock(),e.createElementBlock("td",{key:b.prop,ref_for:!0,ref:K=>C(K,b.prop),style:e.normalizeStyle(R(b,F)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":b.pinnedLeft,"vt-table__td--pinned-right":b.pinnedRight}])},[e.withDirectives((e.openBlock(),e.createElementBlock("div",co,[b.renderSlot?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b.renderSlot),{key:0,row:f,column:b,value:f[b.prop]},null,8,["row","column","value"])):(e.openBlock(),e.createElementBlock("span",uo,e.toDisplayString(f[b.prop]),1))])),[[E,b.showOverflowTooltip?he(f,b):null]]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":b.prop,onMousedown:K=>S(K,b)},null,40,mo)],6))),128))],10,ro))),128))]),l.showSummary?(e.openBlock(),e.createElementBlock("tfoot",po,[e.createElementVNode("tr",null,[l.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":!0}]),style:e.normalizeStyle(k())},_[0]||(_[0]=[e.createElementVNode("div",{class:"vt-table__cell-content vt-table__cell-content--summary"},null,-1)]),4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(f,b)=>(e.openBlock(),e.createElementBlock("td",{key:f.prop,style:e.normalizeStyle(G(f,b)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":f.pinnedLeft,"vt-table__td--pinned-right":f.pinnedRight}])},[e.createElementVNode("div",ho,e.toDisplayString(fe.value[f.prop]),1)],6))),128))])])):e.createCommentVNode("",!0)])],4)}}}),ue=e.defineComponent({__name:"VTableColumn",props:{prop:{},label:{},width:{},minWidth:{},maxWidth:{},sortable:{type:Boolean,default:!0},pinnedLeft:{type:Boolean,default:!1},pinnedRight:{type:Boolean,default:!1},actionColumn:{type:Boolean,default:!0},showOverflowTooltip:{type:Boolean,default:!0},selectable:{type:Boolean,default:!0},renderSlot:{},sortMethod:{}},setup(t){const o=t,n=e.useSlots(),l=e.inject("vt-table-columns");l||console.error("VTableColumn: не знайдено контекст таблиці. Переконайтеся, що компонент використовується всередині VTable.");const s=()=>({prop:o.prop,label:o.label,width:o.width,minWidth:o.minWidth,maxWidth:o.maxWidth,sortable:o.sortable,pinnedLeft:o.pinnedLeft,pinnedRight:o.pinnedRight,actionColumn:o.actionColumn,showOverflowTooltip:o.showOverflowTooltip,selectable:o.selectable,renderSlot:n[o.prop]??n.default??n.slot});let a=-1;return e.onMounted(()=>{if(l){const r=s();l.push(r),a=l.length-1,console.log(`VTableColumn: зареєстровано колонку "${o.label}" (${o.prop}) на позиції ${a}`)}}),e.watch(()=>[o.width,o.minWidth,o.maxWidth,o.sortable,o.pinnedLeft,o.pinnedRight,o.actionColumn,o.showOverflowTooltip,o.selectable,o.label],()=>{if(l&&a!==-1){const r=l.findIndex(i=>i.prop===o.prop);if(r!==-1){const i=l[r],c={...s(),renderSlot:i.renderSlot};l[r]=c,console.log(`VTableColumn: оновлено колонку "${o.label}" (${o.prop})`)}}},{deep:!0}),e.onUnmounted(()=>{if(l){const r=l.findIndex(i=>i.prop===o.prop);r>-1&&(l.splice(r,1),console.log(`VTableColumn: видалено колонку "${o.label}" (${o.prop})`))}}),(r,i)=>null}}),ne=(t,o)=>{const n=document.createElement("div");n.className=`vt-tooltip vt-tooltip--${o}`,n.innerText=t,Object.assign(n.style,{position:"absolute",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"4px",fontSize:"12px",lineHeight:"1.4",zIndex:"9999",pointerEvents:"none",visibility:"hidden",opacity:"0",transition:"opacity 0.2s ease, visibility 0.2s ease",maxWidth:"300px",minWidth:"max-content",wordWrap:"break-word",whiteSpace:"normal",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"}),t.length<50&&(n.style.whiteSpace="nowrap");const l=document.createElement("div");switch(l.className="vt-tooltip__arrow",Object.assign(l.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),o){case"top":Object.assign(l.style,{top:"100%",left:"50%",marginLeft:"-5px",borderWidth:"5px 5px 0 5px",borderColor:"rgba(0, 0, 0, 0.8) transparent transparent transparent"});break;case"bottom":Object.assign(l.style,{bottom:"100%",left:"50%",marginLeft:"-5px",borderWidth:"0 5px 5px 5px",borderColor:"transparent transparent rgba(0, 0, 0, 0.8) transparent"});break;case"left":Object.assign(l.style,{top:"50%",left:"100%",marginTop:"-5px",borderWidth:"5px 0 5px 5px",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.8)"});break;case"right":Object.assign(l.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return n.appendChild(l),n},J=(t,o,n)=>{const l=o.getBoundingClientRect(),s=t.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;let i=0,c=0;switch(n){case"top":i=l.top+r-s.height-8,c=l.left+a+(l.width-s.width)/2;break;case"bottom":i=l.bottom+r+8,c=l.left+a+(l.width-s.width)/2;break;case"left":i=l.top+r+(l.height-s.height)/2,c=l.left+a-s.width-8;break;case"right":i=l.top+r+(l.height-s.height)/2,c=l.right+a+8;break}const u=window.innerWidth,d=window.innerHeight;c<8?c=8:c+s.width>u-8&&(c=u-s.width-8),i<r+8?n==="top"?i=l.bottom+r+8:i=r+8:i+s.height>r+d-8&&(n==="bottom"?i=l.top+r-s.height-8:i=r+d-s.height-8),t.style.top=`${i}px`,t.style.left=`${c}px`},le=(t,o,n)=>{t.parentElement||document.body.appendChild(t),t.style.visibility="visible",J(t,o,n),requestAnimationFrame(()=>{t.style.opacity="1"})},se=t=>{t.style.opacity="0",t.style.visibility="hidden"},ae=t=>t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight,re=t=>!!t.closest(".vt-table, table"),me={mounted(t,o){const n=o.value?.trim();if(!n)return;const l=t.dataset.placement||"top",s=ne(n,l);t.__tooltipEl=s;const a=()=>{(re(t)?ae(t):!0)&&le(s,t,l)},r=()=>{se(s)},i=()=>{s.style.opacity==="1"&&J(s,t,l)};t.__mouseenterHandler=a,t.__mouseleaveHandler=r,t.__scrollHandler=i,t.addEventListener("mouseenter",a),t.addEventListener("mouseleave",r),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i)},updated(t,o){const n=o.value?.trim();if(t.__tooltipEl)n?t.__tooltipEl.firstChild.textContent=n:(t.__tooltipEl.parentElement&&t.__tooltipEl.parentElement.removeChild(t.__tooltipEl),delete t.__tooltipEl);else if(n){const l=t.dataset.placement||"top",s=ne(n,l);t.__tooltipEl=s;const a=()=>{(re(t)?ae(t):!0)&&le(s,t,l)},r=()=>{se(s)},i=()=>{s.style.opacity==="1"&&J(s,t,l)};t.__mouseenterHandler=a,t.__mouseleaveHandler=r,t.__scrollHandler=i,t.addEventListener("mouseenter",a),t.addEventListener("mouseleave",r),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i)}},beforeUnmount(t){t.__tooltipEl&&t.__tooltipEl.parentElement&&(t.__tooltipEl.parentElement.removeChild(t.__tooltipEl),delete t.__tooltipEl),t.__mouseenterHandler&&(t.removeEventListener("mouseenter",t.__mouseenterHandler),delete t.__mouseenterHandler),t.__mouseleaveHandler&&(t.removeEventListener("mouseleave",t.__mouseleaveHandler),delete t.__mouseleaveHandler),t.__scrollHandler&&(window.removeEventListener("scroll",t.__scrollHandler,!0),window.removeEventListener("resize",t.__scrollHandler),delete t.__scrollHandler)}},pe={install(t,o={}){const{prefix:n="V",modal:l=!0}=o;t.component(`${n}Button`,X),t.component(`${n}Icon`,H),t.component(`${n}Loader`,Q),t.component(`${n}Modal`,ee),t.component(`${n}Pagination`,ie),t.component(`${n}Checkbox`,q),t.component(`${n}Table`,de),t.component(`${n}TableColumn`,ue),t.directive("tooltip",me),l&&t.use(ce)}},fo=pe.install;exports.VButton=X;exports.VCheckbox=q;exports.VIcon=H;exports.VLoader=Q;exports.VModal=ee;exports.VModalPlugin=ce;exports.VPagination=ie;exports.VTable=de;exports.VTableColumn=ue;exports.default=pe;exports.install=fo;exports.modalManager=U;exports.tooltipDirective=me;
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createElementBlock as h, openBlock as p, createElementVNode as f, defineComponent as oe, computed as S, createBlock as ie, createCommentVNode as V, resolveDynamicComponent as Ie, useSlots as Re, resolveDirective as Be, withDirectives as be, normalizeClass as E, renderSlot as re, Teleport as Ne, normalizeStyle as le, withModifiers as ce, toDisplayString as Q, watch as ue, Fragment as te, renderList as ne, vModelSelect as Ze, createVNode as j, withCtx as ge, createTextVNode as de, ref as P, createApp as Fe, h as fe, onMounted as me, onUnmounted as Te, nextTick as Ue, mergeModels as we, useModel as qe, reactive as Xe, provide as Ge, unref as U, inject as Ke } from "vue";
2
2
  const X = (e, t) => {
3
3
  const n = e.__vccOpts || e;
4
- for (const [o, s] of t)
5
- n[o] = s;
4
+ for (const [o, l] of t)
5
+ n[o] = l;
6
6
  return n;
7
7
  }, Ye = {}, Je = {
8
8
  width: "20",
@@ -262,7 +262,7 @@ const Zt = /* @__PURE__ */ X(Ot, [["render", Nt]]), Ft = {
262
262
  },
263
263
  setup(e) {
264
264
  const t = e, n = S(() => Ft[t.name]);
265
- return (o, s) => n.value ? (p(), ie(Ie(n.value), { key: 0 })) : V("", !0);
265
+ return (o, l) => n.value ? (p(), ie(Ie(n.value), { key: 0 })) : V("", !0);
266
266
  }
267
267
  }), Ut = {}, qt = { class: "vt-loader" };
268
268
  function Xt(e, t) {
@@ -285,16 +285,16 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
285
285
  },
286
286
  emits: ["click"],
287
287
  setup(e, { emit: t }) {
288
- const n = e, o = t, s = Re(), l = S(() => !!(n.icon && n.shape)), i = S(() => s.default?.()?.[0]?.children?.toString() ?? ""), a = S(() => [
288
+ const n = e, o = t, l = Re(), s = S(() => !!(n.icon && n.shape)), i = S(() => (l.default ? l.default({}) : null)?.[0]?.children?.toString() ?? ""), a = S(() => [
289
289
  "vt-button",
290
290
  `vt-button--${n.type}`,
291
291
  {
292
292
  [`vt-button--${n.shape}`]: n.shape,
293
- "vt-button--icon-only": l.value,
293
+ "vt-button--icon-only": s.value,
294
294
  "vt-button--disabled": n.disabled || n.loading,
295
295
  "vt-button--loading": n.loading
296
296
  }
297
- ]), r = S(() => l.value && n.tooltip ? i.value : null), u = (c) => {
297
+ ]), r = S(() => s.value && n.tooltip ? i.value : null), u = (c) => {
298
298
  !n.disabled && !n.loading && o("click", c);
299
299
  };
300
300
  return (c, M) => {
@@ -314,7 +314,7 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
314
314
  name: n.icon,
315
315
  class: "vt-button__icon"
316
316
  }, null, 8, ["name"])) : V("", !0),
317
- l.value ? V("", !0) : (p(), h("span", Kt, [
317
+ s.value ? V("", !0) : (p(), h("span", Kt, [
318
318
  re(c.$slots, "default")
319
319
  ]))
320
320
  ], 10, Gt)), [
@@ -340,7 +340,7 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
340
340
  },
341
341
  emits: ["update:modelValue", "close"],
342
342
  setup(e, { emit: t }) {
343
- const n = e, o = t, s = S(() => ["vt-modal__container", `vt-modal__container--${n.size}`]), l = S(() => ({
343
+ const n = e, o = t, l = S(() => ["vt-modal__container", `vt-modal__container--${n.size}`]), s = S(() => ({
344
344
  zIndex: n.zIndex
345
345
  })), i = () => {
346
346
  o("update:modelValue", !1), o("close");
@@ -351,11 +351,11 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
351
351
  r.modelValue ? (p(), h("div", {
352
352
  key: 0,
353
353
  class: "vt-modal__backdrop",
354
- style: le(l.value),
354
+ style: le(s.value),
355
355
  onClick: a
356
356
  }, [
357
357
  f("div", {
358
- class: E(s.value),
358
+ class: E(l.value),
359
359
  onClick: u[0] || (u[0] = ce(() => {
360
360
  }, ["stop"]))
361
361
  }, [
@@ -386,14 +386,14 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
386
386
  },
387
387
  emits: ["update:currentPage", "update:pageSize", "pageChange", "reloadData"],
388
388
  setup(e, { emit: t }) {
389
- const n = e, o = t, s = S({
389
+ const n = e, o = t, l = S({
390
390
  get: () => n.currentPage,
391
391
  set: (L) => o("update:currentPage", L)
392
- }), l = S({
392
+ }), s = S({
393
393
  get: () => n.pageSize,
394
394
  set: (L) => o("update:pageSize", L)
395
- }), i = S(() => Math.ceil(n.totalItems / l.value)), a = S(() => n.totalItems === 0 ? 0 : (s.value - 1) * l.value + 1), r = S(() => Math.min(s.value * l.value, n.totalItems)), u = S(() => s.value <= 1), c = S(() => s.value >= i.value), M = S(() => {
396
- const L = [], W = i.value, x = s.value, Z = n.maxVisiblePages;
395
+ }), i = S(() => Math.ceil(n.totalItems / s.value)), a = S(() => n.totalItems === 0 ? 0 : (l.value - 1) * s.value + 1), r = S(() => Math.min(l.value * s.value, n.totalItems)), u = S(() => l.value <= 1), c = S(() => l.value >= i.value), M = S(() => {
396
+ const L = [], W = i.value, x = l.value, Z = n.maxVisiblePages;
397
397
  if (W <= Z)
398
398
  for (let v = 1; v <= W; v++)
399
399
  L.push(v);
@@ -408,24 +408,24 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
408
408
  return L;
409
409
  }), $ = () => {
410
410
  o("pageChange", {
411
- page: s.value,
412
- pageSize: l.value
411
+ page: l.value,
412
+ pageSize: s.value
413
413
  });
414
414
  }, H = (L) => {
415
- typeof L == "number" && L !== s.value && (s.value = L, $());
415
+ typeof L == "number" && L !== l.value && (l.value = L, $());
416
416
  }, N = () => {
417
- u.value || (s.value--, $());
417
+ u.value || (l.value--, $());
418
418
  }, K = () => {
419
- c.value || (s.value++, $());
419
+ c.value || (l.value++, $());
420
420
  }, Y = () => {
421
- s.value = 1, $();
421
+ l.value = 1, $();
422
422
  }, q = () => {
423
- o("reloadData", s.value);
423
+ o("reloadData", l.value);
424
424
  };
425
425
  return ue(
426
426
  () => n.totalItems,
427
427
  () => {
428
- s.value > i.value && i.value > 0 && (s.value = i.value, $());
428
+ l.value > i.value && i.value > 0 && (l.value = i.value, $());
429
429
  }
430
430
  ), (L, W) => (p(), h("div", en, [
431
431
  f("div", tn, [
@@ -436,7 +436,7 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
436
436
  }, "Рядків на сторінку:", -1)),
437
437
  be(f("select", {
438
438
  id: "rowsSelect",
439
- "onUpdate:modelValue": W[0] || (W[0] = (x) => l.value = x),
439
+ "onUpdate:modelValue": W[0] || (W[0] = (x) => s.value = x),
440
440
  onChange: Y,
441
441
  class: "vt-pagination__select"
442
442
  }, [
@@ -445,7 +445,7 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
445
445
  value: x
446
446
  }, Q(x), 9, on))), 128))
447
447
  ], 544), [
448
- [Ze, l.value]
448
+ [Ze, s.value]
449
449
  ])
450
450
  ]),
451
451
  f("span", null, Q(a.value) + " - " + Q(r.value) + " з " + Q(L.totalItems), 1)
@@ -462,7 +462,7 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
462
462
  key: x,
463
463
  onClick: (Z) => H(x),
464
464
  class: E(["vt-pagination__nav-button", {
465
- "vt-pagination__nav-button--active": x === s.value
465
+ "vt-pagination__nav-button--active": x === l.value
466
466
  }])
467
467
  }, Q(x), 11, an))), 128)),
468
468
  f("button", {
@@ -508,7 +508,7 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
508
508
  },
509
509
  emits: ["update:modelValue", "change", "focus", "blur"],
510
510
  setup(e, { emit: t }) {
511
- const n = e, o = t, s = () => `vt-checkbox-${Math.random().toString(36).substr(2, 9)}`, l = S(() => n.id || s()), i = S(() => n.modelValue ?? n.checked), a = (c) => {
511
+ const n = e, o = t, l = () => `vt-checkbox-${Math.random().toString(36).substr(2, 9)}`, s = S(() => n.id || l()), i = S(() => n.modelValue ?? n.checked), a = (c) => {
512
512
  if (n.disabled) return;
513
513
  const $ = c.target.checked;
514
514
  o("update:modelValue", $), o("change", $, c);
@@ -527,10 +527,10 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
527
527
  "vt-checkbox--double": c.isDouble
528
528
  }
529
529
  ]),
530
- for: l.value
530
+ for: s.value
531
531
  }, [
532
532
  f("input", {
533
- id: l.value,
533
+ id: s.value,
534
534
  name: c.name,
535
535
  value: c.value,
536
536
  checked: i.value,
@@ -633,8 +633,8 @@ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "d
633
633
  }
634
634
  });
635
635
  function pn(e) {
636
- const t = S(() => [...e].sort((s, l) => s.pinnedLeft && !l.pinnedLeft ? -1 : !s.pinnedLeft && l.pinnedLeft || s.pinnedRight && !l.pinnedRight ? 1 : !s.pinnedRight && l.pinnedRight ? -1 : 0)), n = () => {
637
- const s = t.value.length, l = t.value.filter((c) => c.width || c.minWidth), i = l.reduce((c, M) => c + (M.width || M.minWidth || 0), 0), a = s - l.length;
636
+ const t = S(() => [...e].sort((l, s) => l.pinnedLeft && !s.pinnedLeft ? -1 : !l.pinnedLeft && s.pinnedLeft || l.pinnedRight && !s.pinnedRight ? 1 : !l.pinnedRight && s.pinnedRight ? -1 : 0)), n = () => {
637
+ const l = t.value.length, s = t.value.filter((c) => c.width || c.minWidth), i = s.reduce((c, M) => c + (M.width || M.minWidth || 0), 0), a = l - s.length;
638
638
  if (a === 0)
639
639
  return 150;
640
640
  const u = Math.max(800 - i, a * 80);
@@ -643,17 +643,17 @@ function pn(e) {
643
643
  return {
644
644
  sortedColumns: t,
645
645
  getDefaultColumnWidth: n,
646
- getStickyOffset: (s, l, i = !1) => {
646
+ getStickyOffset: (l, s, i = !1) => {
647
647
  const a = t.value;
648
648
  let r = 0;
649
- if (s === "left") {
649
+ if (l === "left") {
650
650
  i && (r += 50);
651
- for (let u = 0; u < l; u++) {
651
+ for (let u = 0; u < s; u++) {
652
652
  const c = a[u];
653
653
  c.pinnedLeft && (r += c.width || c.minWidth || n());
654
654
  }
655
655
  } else
656
- for (let u = a.length - 1; u > l; u--) {
656
+ for (let u = a.length - 1; u > s; u--) {
657
657
  const c = a[u];
658
658
  c.pinnedRight && (r += c.width || c.minWidth || n());
659
659
  }
@@ -663,30 +663,30 @@ function pn(e) {
663
663
  }
664
664
  function mn(e) {
665
665
  const t = () => {
666
- const l = {};
667
- return e.maxHeight && (l.maxHeight = `${e.maxHeight}px`), l;
668
- }, n = (l, i, a, r) => {
666
+ const s = {};
667
+ return e.maxHeight && (s.maxHeight = `${e.maxHeight}px`), s;
668
+ }, n = (s, i, a, r) => {
669
669
  const u = {};
670
- if (l.width)
671
- u.width = `${l.width}px`, u.minWidth = `${l.width}px`, u.maxWidth = `${l.width}px`;
672
- else if (l.minWidth)
673
- u.minWidth = `${l.minWidth}px`, u.width = `${l.minWidth}px`, u.maxWidth = "none";
670
+ if (s.width)
671
+ u.width = `${s.width}px`, u.minWidth = `${s.width}px`, u.maxWidth = `${s.width}px`;
672
+ else if (s.minWidth)
673
+ u.minWidth = `${s.minWidth}px`, u.width = `${s.minWidth}px`, u.maxWidth = "none";
674
674
  else {
675
675
  const c = r();
676
676
  u.width = `${c}px`, u.minWidth = "80px", u.maxWidth = "none";
677
677
  }
678
- return l.pinnedLeft ? (u.position = "sticky", u.left = `${a("left", i, e.selectable)}px`, u.zIndex = "10") : l.pinnedRight && (u.position = "sticky", u.right = `${a("right", i, !1)}px`, u.zIndex = "10"), u;
678
+ return s.pinnedLeft ? (u.position = "sticky", u.left = `${a("left", i, e.selectable)}px`, u.zIndex = "10") : s.pinnedRight && (u.position = "sticky", u.right = `${a("right", i, !1)}px`, u.zIndex = "10"), u;
679
679
  };
680
680
  return {
681
681
  getTableWrapperStyle: t,
682
682
  getColumnStyle: n,
683
- getHeaderStyle: (l, i, a, r) => {
684
- const u = n(l, i, a, r);
685
- return e.maxHeight && (u.position = "sticky", u.top = "0", l.pinnedLeft || l.pinnedRight ? u.zIndex = "12" : u.zIndex = "11"), u;
683
+ getHeaderStyle: (s, i, a, r) => {
684
+ const u = n(s, i, a, r);
685
+ return e.maxHeight && (u.position = "sticky", u.top = "0", s.pinnedLeft || s.pinnedRight ? u.zIndex = "12" : u.zIndex = "11"), u;
686
686
  },
687
- getFooterStyle: (l, i, a, r) => {
688
- const u = n(l, i, a, r);
689
- return e.maxHeight && (u.position = "sticky", u.bottom = "0", l.pinnedLeft || l.pinnedRight ? u.zIndex = "12" : u.zIndex = "11"), u;
687
+ getFooterStyle: (s, i, a, r) => {
688
+ const u = n(s, i, a, r);
689
+ return e.maxHeight && (u.position = "sticky", u.bottom = "0", s.pinnedLeft || s.pinnedRight ? u.zIndex = "12" : u.zIndex = "11"), u;
690
690
  }
691
691
  };
692
692
  }
@@ -697,8 +697,8 @@ function hn() {
697
697
  startWidth: 0
698
698
  }), t = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5 13L2 10L5 7' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M15 7L18 10L15 13' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M10 3L10 17' stroke='%23828282' stroke-width='3' stroke-linecap='round'/></svg>") 10 10, col-resize`;
699
699
  return {
700
- onMouseDown: (o, s, l, i) => {
701
- o.preventDefault(), o.stopPropagation(), e.value.resizingCol = s, e.value.startX = o.clientX, e.value.startWidth = s.width || s.minWidth || l(s.prop);
700
+ onMouseDown: (o, l, s, i) => {
701
+ o.preventDefault(), o.stopPropagation(), e.value.resizingCol = l, e.value.startX = o.clientX, e.value.startWidth = l.width || l.minWidth || s(l.prop);
702
702
  const a = (u) => {
703
703
  const { resizingCol: c, startX: M, startWidth: $ } = e.value;
704
704
  if (!c)
@@ -720,20 +720,20 @@ function hn() {
720
720
  };
721
721
  }
722
722
  function vn(e, t, n, o) {
723
- const s = e.selectionKey || "id", l = P([]), i = P(null), a = P(!1);
724
- e.defaultSelection?.length && (l.value = [...e.defaultSelection]);
725
- const r = (k) => k[s], u = (k) => a.value ? !0 : l.value.some((z) => r(z) === r(k)), c = S(() => t.value.filter((k) => u(k)).length), M = S(() => t.value.length > 0 && c.value === t.value.length), $ = S(() => {
723
+ const l = e.selectionKey || "id", s = P([]), i = P(null), a = P(!1);
724
+ e.defaultSelection?.length && (s.value = [...e.defaultSelection]);
725
+ const r = (k) => k[l], u = (k) => a.value ? !0 : s.value.some((z) => r(z) === r(k)), c = S(() => t.value.filter((k) => u(k)).length), M = S(() => t.value.length > 0 && c.value === t.value.length), $ = S(() => {
726
726
  if (a.value)
727
727
  return !1;
728
728
  const k = c.value;
729
729
  return k > 0 && k < t.value.length;
730
730
  }), H = S(() => a.value ? !0 : M.value && !$.value), N = S(() => a.value), K = (k, z) => {
731
- const B = r(k), A = l.value.some((d) => r(d) === r(k)), F = z !== void 0 ? z : !A;
731
+ const B = r(k), A = s.value.some((d) => r(d) === r(k)), F = z !== void 0 ? z : !A;
732
732
  if (a.value && !F) {
733
- a.value = !1, o?.value && (l.value = o.value.filter((d) => r(d) !== B)), D(k, !1);
733
+ a.value = !1, o?.value && (s.value = o.value.filter((d) => r(d) !== B)), D(k, !1);
734
734
  return;
735
735
  }
736
- a.value && F || (F && !A ? l.value.push(k) : !F && A && (l.value = l.value.filter((d) => r(d) !== B)), e.selectOnClickRow && z === void 0 && Z(F ? k : null), D(k, F));
736
+ a.value && F || (F && !A ? s.value.push(k) : !F && A && (s.value = s.value.filter((d) => r(d) !== B)), e.selectOnClickRow && z === void 0 && Z(F ? k : null), D(k, F));
737
737
  }, Y = () => {
738
738
  switch (q()) {
739
739
  case "none":
@@ -748,27 +748,27 @@ function vn(e, t, n, o) {
748
748
  break;
749
749
  }
750
750
  }, q = () => a.value ? "absoluteAll" : M.value ? "allVisible" : c.value > 0 ? "partial" : "none", L = () => {
751
- const k = [], z = new Set(l.value.map((B) => r(B)));
752
- l.value.forEach((B) => {
751
+ const k = [], z = new Set(s.value.map((B) => r(B)));
752
+ s.value.forEach((B) => {
753
753
  k.push(B);
754
754
  }), t.value.forEach((B) => {
755
755
  z.has(r(B)) || k.push(B);
756
- }), l.value = k, a.value = !1, D();
756
+ }), s.value = k, a.value = !1, D();
757
757
  }, W = () => {
758
- a.value = !0, o?.value ? l.value = [...o.value] : l.value = [...t.value], D(void 0, void 0, !0);
758
+ a.value = !0, o?.value ? s.value = [...o.value] : s.value = [...t.value], D(void 0, void 0, !0);
759
759
  }, x = () => {
760
- l.value = [], a.value = !1, i.value = null, D();
760
+ s.value = [], a.value = !1, i.value = null, D();
761
761
  }, Z = (k) => {
762
762
  const z = i.value;
763
763
  i.value = k, n("current-change", {
764
764
  currentRow: i.value,
765
765
  oldCurrentRow: z
766
766
  });
767
- }, v = () => [...l.value], T = (k) => {
768
- l.value = [...k], a.value = !1, D();
767
+ }, v = () => [...s.value], T = (k) => {
768
+ s.value = [...k], a.value = !1, D();
769
769
  }, D = (k, z, B = !1) => {
770
770
  const A = {
771
- selection: [...l.value],
771
+ selection: [...s.value],
772
772
  row: k,
773
773
  selected: z,
774
774
  isAllSelected: B || a.value
@@ -776,9 +776,9 @@ function vn(e, t, n, o) {
776
776
  n("selection-change", A);
777
777
  };
778
778
  return ue(() => e.defaultSelection, (k) => {
779
- k?.length && (l.value = [...k]);
779
+ k?.length && (s.value = [...k]);
780
780
  }), {
781
- selectedRows: l,
781
+ selectedRows: s,
782
782
  currentRow: i,
783
783
  isRowSelected: u,
784
784
  isAllSelected: H,
@@ -804,8 +804,8 @@ const fn = (e, t, n = "asc") => {
804
804
  if (e === t)
805
805
  return 0;
806
806
  let o = 0;
807
- const s = Number(e), l = Number(t);
808
- return !isNaN(s) && !isNaN(l) ? o = s - l : ke(e) && ke(t) ? o = new Date(e).getTime() - new Date(t).getTime() : typeof e == "boolean" && typeof t == "boolean" ? o = e === t ? 0 : e ? -1 : 1 : o = String(e).localeCompare(String(t), void 0, {
807
+ const l = Number(e), s = Number(t);
808
+ return !isNaN(l) && !isNaN(s) ? o = l - s : ke(e) && ke(t) ? o = new Date(e).getTime() - new Date(t).getTime() : typeof e == "boolean" && typeof t == "boolean" ? o = e === t ? 0 : e ? -1 : 1 : o = String(e).localeCompare(String(t), void 0, {
809
809
  numeric: !0,
810
810
  sensitivity: "base"
811
811
  }), n === "desc" ? -o : o;
@@ -823,13 +823,13 @@ const fn = (e, t, n = "asc") => {
823
823
  }, gn = (e, t, n) => {
824
824
  if (!t)
825
825
  return [...e];
826
- const o = n.find((l) => l.prop === t.prop);
826
+ const o = n.find((s) => s.prop === t.prop);
827
827
  if (!o?.sortable)
828
828
  return [...e];
829
- const s = o.sortMethod || fn;
830
- return [...e].sort((l, i) => {
831
- const a = l[o.prop], r = i[o.prop];
832
- return s(a, r, t.direction);
829
+ const l = o.sortMethod || fn;
830
+ return [...e].sort((s, i) => {
831
+ const a = s[o.prop], r = i[o.prop];
832
+ return l(a, r, t.direction);
833
833
  });
834
834
  };
835
835
  class Cn {
@@ -838,22 +838,22 @@ class Cn {
838
838
  open(t = {}) {
839
839
  const n = `modal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, o = document.createElement("div");
840
840
  o.setAttribute("data-vt-modal", n), document.body.appendChild(o);
841
- const s = P(!0), l = this.baseZIndex + this.modalStack.length * 10, i = Fe({
841
+ const l = P(!0), s = this.baseZIndex + this.modalStack.length * 10, i = Fe({
842
842
  setup() {
843
843
  const r = () => {
844
- s.value = !1, setTimeout(() => {
844
+ l.value = !1, setTimeout(() => {
845
845
  se.closeById(n);
846
846
  }, 100);
847
847
  };
848
848
  return () => fe(Ee, {
849
- modelValue: s.value,
849
+ modelValue: l.value,
850
850
  "onUpdate:modelValue": r,
851
851
  title: t.title,
852
852
  size: t.size || "medium",
853
853
  showCloseButton: t.showCloseButton !== !1,
854
854
  closeOnBackdropClick: t.closeOnBackdropClick !== !1,
855
855
  onClose: r,
856
- zIndex: l
856
+ zIndex: s
857
857
  }, {
858
858
  default: () => t.component ? fe(t.component, t.props || {}) : t.content ? fe("div", { innerHTML: t.content }) : null
859
859
  });
@@ -864,7 +864,7 @@ class Cn {
864
864
  id: n,
865
865
  app: i,
866
866
  container: o,
867
- isOpen: s
867
+ isOpen: l
868
868
  };
869
869
  return this.modalStack.push(a), n;
870
870
  }
@@ -921,16 +921,16 @@ const se = new Cn(), bn = {
921
921
  },
922
922
  emits: ["update-columns"],
923
923
  setup(e, { emit: t }) {
924
- const n = e, o = t, s = P([]), l = P(/* @__PURE__ */ new Set()), i = P(-1), a = P(-1), r = P("before"), u = S(() => {
924
+ const n = e, o = t, l = P([]), s = P(/* @__PURE__ */ new Set()), i = P(-1), a = P(-1), r = P("before"), u = S(() => {
925
925
  const d = {};
926
926
  return n.columnsSelector.forEach((g) => {
927
927
  if (g.name === "removed")
928
928
  return;
929
- const C = g.columns.map((I) => I.prop), w = s.value.filter((I) => C.includes(I.prop));
929
+ const C = g.columns.map((I) => I.prop), w = l.value.filter((I) => C.includes(I.prop));
930
930
  w.length === 0 ? d[g.name] = { checked: !1, indeterminate: !1 } : w.length === g.columns.length ? d[g.name] = { checked: !0, indeterminate: !1 } : d[g.name] = { checked: !1, indeterminate: !0 };
931
931
  }), d;
932
932
  }), c = S(() => n.columnsSelector.filter((d) => d.name !== "removed")), M = (d) => d.pinnedLeft || d.pinnedRight, $ = (d) => !M(d), H = () => {
933
- const d = s.value;
933
+ const d = l.value;
934
934
  let g = -1;
935
935
  for (let w = 0; w < d.length; w++)
936
936
  d[w].pinnedLeft && (g = w);
@@ -948,7 +948,7 @@ const se = new Cn(), bn = {
948
948
  const g = H();
949
949
  return !(d < g.minIndex || d > g.maxIndex + 1);
950
950
  }, K = (d, g) => {
951
- const C = s.value[g];
951
+ const C = l.value[g];
952
952
  if (!$(C)) {
953
953
  d.preventDefault();
954
954
  return;
@@ -975,8 +975,8 @@ const se = new Cn(), bn = {
975
975
  x();
976
976
  return;
977
977
  }
978
- const ee = [...s.value], [he] = ee.splice(i.value, 1);
979
- ee.splice(O, 0, he), s.value = ee, x();
978
+ const ee = [...l.value], [he] = ee.splice(i.value, 1);
979
+ ee.splice(O, 0, he), l.value = ee, x();
980
980
  }, W = () => {
981
981
  x();
982
982
  }, x = () => {
@@ -985,38 +985,38 @@ const se = new Cn(), bn = {
985
985
  const g = ["vt-columns-selector__panel-item"];
986
986
  return i.value === d && g.push("vt-columns-selector__panel-item--dragging"), a.value === d && r.value === "before" && g.push("vt-columns-selector__panel-item--drop-before"), a.value === d && r.value === "after" && g.push("vt-columns-selector__panel-item--drop-after"), g;
987
987
  }, v = () => {
988
- s.value = [...n.columns.map((d) => ({ ...d }))], n.columnsSelector.forEach((d) => {
989
- d.name !== "removed" && l.value.add(d.name);
988
+ l.value = [...n.columns.map((d) => ({ ...d }))], n.columnsSelector.forEach((d) => {
989
+ d.name !== "removed" && s.value.add(d.name);
990
990
  });
991
991
  }, T = (d, g) => {
992
992
  if (g)
993
- s.value.some((C) => C.prop === d.prop) || s.value.push({ ...d });
993
+ l.value.some((C) => C.prop === d.prop) || l.value.push({ ...d });
994
994
  else {
995
995
  if (M(d))
996
996
  return;
997
- s.value = s.value.filter((C) => C.prop !== d.prop);
997
+ l.value = l.value.filter((C) => C.prop !== d.prop);
998
998
  }
999
999
  }, D = (d, g) => {
1000
1000
  if (g)
1001
1001
  d.columns.forEach((C) => {
1002
- s.value.some((w) => w.prop === C.prop) || s.value.push({ ...C });
1002
+ l.value.some((w) => w.prop === C.prop) || l.value.push({ ...C });
1003
1003
  });
1004
1004
  else {
1005
1005
  const C = [];
1006
1006
  d.columns.forEach((w) => {
1007
- const I = s.value.find((O) => O.prop === w.prop);
1007
+ const I = l.value.find((O) => O.prop === w.prop);
1008
1008
  I && !M(I) && C.push(I);
1009
- }), s.value = s.value.filter(
1009
+ }), l.value = l.value.filter(
1010
1010
  (w) => !C.some((I) => I.prop === w.prop)
1011
1011
  );
1012
1012
  }
1013
- }, k = (d) => s.value.some((g) => g.prop === d.prop), z = (d) => {
1014
- const g = s.value.find((C) => C.prop === d.prop);
1013
+ }, k = (d) => l.value.some((g) => g.prop === d.prop), z = (d) => {
1014
+ const g = l.value.find((C) => C.prop === d.prop);
1015
1015
  return !g || !M(g);
1016
1016
  }, B = (d) => {
1017
- l.value.has(d) ? l.value.delete(d) : l.value.add(d);
1017
+ s.value.has(d) ? s.value.delete(d) : s.value.add(d);
1018
1018
  }, A = () => {
1019
- o("update-columns", [...s.value]), se.close();
1019
+ o("update-columns", [...l.value]), se.close();
1020
1020
  }, F = () => {
1021
1021
  se.close();
1022
1022
  };
@@ -1025,7 +1025,7 @@ const se = new Cn(), bn = {
1025
1025
  }), (d, g) => (p(), h("div", wn, [
1026
1026
  f("div", kn, [
1027
1027
  f("div", yn, [
1028
- (p(!0), h(te, null, ne(s.value, (C, w) => (p(), h("div", {
1028
+ (p(!0), h(te, null, ne(l.value, (C, w) => (p(), h("div", {
1029
1029
  key: C.prop,
1030
1030
  class: E(Z(w)),
1031
1031
  draggable: $(C),
@@ -1073,7 +1073,7 @@ const se = new Cn(), bn = {
1073
1073
  class: "vt-columns-selector__group-icon"
1074
1074
  }, null, 8, ["name"])) : V("", !0)
1075
1075
  ], 8, Mn),
1076
- l.value.has(C.name) ? (p(), h("div", Ln, [
1076
+ s.value.has(C.name) ? (p(), h("div", Ln, [
1077
1077
  (p(!0), h(te, null, ne(C.columns, (w) => (p(), h("div", {
1078
1078
  key: w.prop,
1079
1079
  class: "vt-columns-selector__group-column"
@@ -1120,9 +1120,9 @@ const se = new Cn(), bn = {
1120
1120
  },
1121
1121
  emits: ["pin", "update-columns"],
1122
1122
  setup(e, { emit: t }) {
1123
- const n = e, o = t, s = P(), l = P(), i = P(), a = P(!1), r = P(!1), u = P([]), c = async () => {
1124
- if (await Ue(), !s.value || !l.value) return;
1125
- const v = l.value.getBoundingClientRect(), T = s.value, D = T.offsetWidth, k = v.left + v.width / 2;
1123
+ const n = e, o = t, l = P(), s = P(), i = P(), a = P(!1), r = P(!1), u = P([]), c = async () => {
1124
+ if (await Ue(), !l.value || !s.value) return;
1125
+ const v = s.value.getBoundingClientRect(), T = l.value, D = T.offsetWidth, k = v.left + v.width / 2;
1126
1126
  T.style.top = `${v.bottom - 20}px`, T.style.left = `${k - D / 2}px`;
1127
1127
  const z = T.getBoundingClientRect();
1128
1128
  z.right > window.innerWidth && (T.style.left = `${window.innerWidth - D - 8}px`), z.left < 0 && (T.style.left = "8px");
@@ -1135,7 +1135,7 @@ const se = new Cn(), bn = {
1135
1135
  r.value = !1;
1136
1136
  }, 100);
1137
1137
  }, N = (v) => {
1138
- !l.value?.contains(v.target) && !s.value?.contains(v.target) && H();
1138
+ !s.value?.contains(v.target) && !l.value?.contains(v.target) && H();
1139
1139
  }, K = () => {
1140
1140
  Z() ? (o("pin", n.column, "none"), console.log(`Колонка "${n.column.label}" відкріплена`)) : (o("pin", n.column, "left"), console.log(`Колонка "${n.column.label}" прикріплена зліва`)), H();
1141
1141
  }, Y = (v) => ({
@@ -1179,12 +1179,12 @@ const se = new Cn(), bn = {
1179
1179
  }), H();
1180
1180
  }, W = () => n.column.pinnedLeft, x = () => n.column.pinnedRight, Z = () => W() || x();
1181
1181
  return me(() => {
1182
- document.addEventListener("click", N), l.value && (i.value = l.value.closest("th")), q(n.allColumns);
1182
+ document.addEventListener("click", N), s.value && (i.value = s.value.closest("th")), q(n.allColumns);
1183
1183
  }), Te(() => {
1184
1184
  document.removeEventListener("click", N);
1185
1185
  }), (v, T) => (p(), h("div", {
1186
1186
  ref_key: "triggerRef",
1187
- ref: l,
1187
+ ref: s,
1188
1188
  class: "vt-table-header-actions",
1189
1189
  onClick: M
1190
1190
  }, [
@@ -1192,7 +1192,7 @@ const se = new Cn(), bn = {
1192
1192
  a.value ? (p(), h("ul", {
1193
1193
  key: 0,
1194
1194
  ref_key: "menuRef",
1195
- ref: s,
1195
+ ref: l,
1196
1196
  class: E(["dropdown-menu", "vt-table-dropdown", { visible: a.value }])
1197
1197
  }, [
1198
1198
  f("li", { onClick: K }, [
@@ -1236,11 +1236,11 @@ const se = new Cn(), bn = {
1236
1236
  }),
1237
1237
  emits: /* @__PURE__ */ we(["sort-change", "selection-change", "current-change", "row-click", "update:columns", "column-pin", "column-resize", "column-visibility", "column-sort", "columns-change"], ["update:columns"]),
1238
1238
  setup(e, { expose: t, emit: n }) {
1239
- const o = e, s = qe(e, "columns"), l = n, i = P({}), a = P(), r = Xe([]), u = P(o.defaultSort || null), c = S(() => s.value !== void 0), M = () => {
1240
- c.value && s.value ? r.splice(0, r.length, ...s.value) : o.columns && r.splice(0, r.length, ...o.columns);
1239
+ const o = e, l = qe(e, "columns"), s = n, i = P({}), a = P(), r = Xe([]), u = P(o.defaultSort || null), c = S(() => l.value !== void 0), M = () => {
1240
+ c.value && l.value ? r.splice(0, r.length, ...l.value) : o.columns && r.splice(0, r.length, ...o.columns);
1241
1241
  };
1242
1242
  ue(
1243
- () => s.value,
1243
+ () => l.value,
1244
1244
  (m) => {
1245
1245
  m && c.value && r.splice(0, r.length, ...m);
1246
1246
  },
@@ -1252,7 +1252,7 @@ const se = new Cn(), bn = {
1252
1252
  },
1253
1253
  { deep: !0 }
1254
1254
  ), Ge("vt-table-columns", r);
1255
- const { sortedColumns: $, getDefaultColumnWidth: H, getStickyOffset: N } = pn(r), { getTableWrapperStyle: K, getColumnStyle: Y, getHeaderStyle: q, getFooterStyle: L } = mn(o), { onMouseDown: W } = hn(), x = S(() => gn(o.data, u.value, r)), Z = S(() => o.allData || o.data), v = o.selectable ? vn(o, x, l, Z) : null, T = () => ({
1255
+ const { sortedColumns: $, getDefaultColumnWidth: H, getStickyOffset: N } = pn(r), { getTableWrapperStyle: K, getColumnStyle: Y, getHeaderStyle: q, getFooterStyle: L } = mn(o), { onMouseDown: W } = hn(), x = S(() => gn(o.data, u.value, r)), Z = S(() => o.allData || o.data), v = o.selectable ? vn(o, x, s, Z) : null, T = () => ({
1256
1256
  width: `${_e}px`,
1257
1257
  minWidth: `${_e}px`,
1258
1258
  maxWidth: `${_e}px`,
@@ -1277,7 +1277,7 @@ const se = new Cn(), bn = {
1277
1277
  } : m;
1278
1278
  }, z = (m, b) => {
1279
1279
  _n(m, b, (R) => {
1280
- u.value?.prop === m.prop && u.value.direction === b ? u.value = null : u.value = R, l("sort-change", {
1280
+ u.value?.prop === m.prop && u.value.direction === b ? u.value = null : u.value = R, s("sort-change", {
1281
1281
  column: m,
1282
1282
  direction: u.value?.direction || null,
1283
1283
  prop: m.prop,
@@ -1290,21 +1290,21 @@ const se = new Cn(), bn = {
1290
1290
  pinnedLeft: b === "left",
1291
1291
  pinnedRight: b === "right"
1292
1292
  };
1293
- F(m.prop, R), l("column-pin", { column: { ...m, ...R }, position: b });
1293
+ F(m.prop, R), s("column-pin", { column: { ...m, ...R }, position: b });
1294
1294
  }, A = (m) => {
1295
- console.log("handleColumnsUpdate викликано з колонками:", m), r.splice(0, r.length, ...m), c.value && (s.value = [...m]), l("columns-change", [...m]);
1295
+ console.log("handleColumnsUpdate викликано з колонками:", m), r.splice(0, r.length, ...m), c.value && (l.value = [...m]), s("columns-change", [...m]);
1296
1296
  }, F = (m, b) => {
1297
1297
  console.log("updateColumn викликано:", { prop: m, updates: b, hasColumnsModel: c.value });
1298
1298
  const R = r.findIndex((_) => _.prop === m);
1299
1299
  if (R !== -1) {
1300
- if (console.log("Оновлюємо internalColumns:", R, b), Object.assign(r[R], b), c.value && s.value) {
1301
- const _ = s.value.findIndex((y) => y.prop === m);
1300
+ if (console.log("Оновлюємо internalColumns:", R, b), Object.assign(r[R], b), c.value && l.value) {
1301
+ const _ = l.value.findIndex((y) => y.prop === m);
1302
1302
  if (_ !== -1) {
1303
- const y = [...s.value];
1304
- y[_] = { ...y[_], ...b }, console.log("Оновлюємо через defineModel:", y), s.value = y;
1303
+ const y = [...l.value];
1304
+ y[_] = { ...y[_], ...b }, console.log("Оновлюємо через defineModel:", y), l.value = y;
1305
1305
  }
1306
1306
  }
1307
- l("columns-change", [...r]);
1307
+ s("columns-change", [...r]);
1308
1308
  } else
1309
1309
  console.error(
1310
1310
  "Колонку не знайдено:",
@@ -1313,7 +1313,7 @@ const se = new Cn(), bn = {
1313
1313
  r.map((_) => _.prop)
1314
1314
  );
1315
1315
  }, d = (m, b, R) => {
1316
- l("row-click", { row: m, column: b, event: R }), o.highlightCurrentRow && v && v.setCurrentRow(m);
1316
+ s("row-click", { row: m, column: b, event: R }), o.highlightCurrentRow && v && v.setCurrentRow(m);
1317
1317
  }, g = (m, b, R) => {
1318
1318
  R.stopPropagation(), v && v.toggleRowSelection(b, m);
1319
1319
  }, C = (m, b) => {
@@ -1323,7 +1323,7 @@ const se = new Cn(), bn = {
1323
1323
  }, I = (m, b) => {
1324
1324
  const R = b.width || H();
1325
1325
  console.log(R), W(m, b, H, (_) => {
1326
- console.log(_), F(b.prop, { width: _ }), l("column-resize", {
1326
+ console.log(_), F(b.prop, { width: _ }), s("column-resize", {
1327
1327
  column: { ...b, width: _ },
1328
1328
  width: _,
1329
1329
  oldWidth: R
@@ -1555,7 +1555,7 @@ const se = new Cn(), bn = {
1555
1555
  o || console.error(
1556
1556
  "VTableColumn: не знайдено контекст таблиці. Переконайтеся, що компонент використовується всередині VTable."
1557
1557
  );
1558
- const s = () => ({
1558
+ const l = () => ({
1559
1559
  prop: t.prop,
1560
1560
  label: t.label,
1561
1561
  width: t.width,
@@ -1568,13 +1568,13 @@ const se = new Cn(), bn = {
1568
1568
  showOverflowTooltip: t.showOverflowTooltip,
1569
1569
  selectable: t.selectable,
1570
1570
  // Зберігаємо слот - пріоритет: назва колонки -> default -> slot
1571
- renderSlot: n[t.prop] || n.default || n.slot
1571
+ renderSlot: n[t.prop] ?? n.default ?? n.slot
1572
1572
  });
1573
- let l = -1;
1573
+ let s = -1;
1574
1574
  return me(() => {
1575
1575
  if (o) {
1576
- const i = s();
1577
- o.push(i), l = o.length - 1, console.log(`VTableColumn: зареєстровано колонку "${t.label}" (${t.prop}) на позиції ${l}`);
1576
+ const i = l();
1577
+ o.push(i), s = o.length - 1, console.log(`VTableColumn: зареєстровано колонку "${t.label}" (${t.prop}) на позиції ${s}`);
1578
1578
  }
1579
1579
  }), ue(
1580
1580
  () => [
@@ -1590,11 +1590,11 @@ const se = new Cn(), bn = {
1590
1590
  t.label
1591
1591
  ],
1592
1592
  () => {
1593
- if (o && l !== -1) {
1593
+ if (o && s !== -1) {
1594
1594
  const i = o.findIndex((a) => a.prop === t.prop);
1595
1595
  if (i !== -1) {
1596
1596
  const a = o[i], r = {
1597
- ...s(),
1597
+ ...l(),
1598
1598
  renderSlot: a.renderSlot
1599
1599
  // Зберігаємо існуючий renderSlot
1600
1600
  };
@@ -1677,24 +1677,24 @@ const se = new Cn(), bn = {
1677
1677
  }
1678
1678
  return n.appendChild(o), n;
1679
1679
  }, Ce = (e, t, n) => {
1680
- const o = t.getBoundingClientRect(), s = e.getBoundingClientRect(), l = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
1680
+ const o = t.getBoundingClientRect(), l = e.getBoundingClientRect(), s = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
1681
1681
  let a = 0, r = 0;
1682
1682
  switch (n) {
1683
1683
  case "top":
1684
- a = o.top + i - s.height - 8, r = o.left + l + (o.width - s.width) / 2;
1684
+ a = o.top + i - l.height - 8, r = o.left + s + (o.width - l.width) / 2;
1685
1685
  break;
1686
1686
  case "bottom":
1687
- a = o.bottom + i + 8, r = o.left + l + (o.width - s.width) / 2;
1687
+ a = o.bottom + i + 8, r = o.left + s + (o.width - l.width) / 2;
1688
1688
  break;
1689
1689
  case "left":
1690
- a = o.top + i + (o.height - s.height) / 2, r = o.left + l - s.width - 8;
1690
+ a = o.top + i + (o.height - l.height) / 2, r = o.left + s - l.width - 8;
1691
1691
  break;
1692
1692
  case "right":
1693
- a = o.top + i + (o.height - s.height) / 2, r = o.right + l + 8;
1693
+ a = o.top + i + (o.height - l.height) / 2, r = o.right + s + 8;
1694
1694
  break;
1695
1695
  }
1696
1696
  const u = window.innerWidth, c = window.innerHeight;
1697
- r < 8 ? r = 8 : r + s.width > u - 8 && (r = u - s.width - 8), a < i + 8 ? n === "top" ? a = o.bottom + i + 8 : a = i + 8 : a + s.height > i + c - 8 && (n === "bottom" ? a = o.top + i - s.height - 8 : a = i + c - s.height - 8), e.style.top = `${a}px`, e.style.left = `${r}px`;
1697
+ r < 8 ? r = 8 : r + l.width > u - 8 && (r = u - l.width - 8), a < i + 8 ? n === "top" ? a = o.bottom + i + 8 : a = i + 8 : a + l.height > i + c - 8 && (n === "bottom" ? a = o.top + i - l.height - 8 : a = i + c - l.height - 8), e.style.top = `${a}px`, e.style.left = `${r}px`;
1698
1698
  }, Se = (e, t, n) => {
1699
1699
  e.parentElement || document.body.appendChild(e), e.style.visibility = "visible", Ce(e, t, n), requestAnimationFrame(() => {
1700
1700
  e.style.opacity = "1";
@@ -1705,32 +1705,32 @@ const se = new Cn(), bn = {
1705
1705
  mounted(e, t) {
1706
1706
  const n = t.value?.trim();
1707
1707
  if (!n) return;
1708
- const o = e.dataset.placement || "top", s = xe(n, o);
1709
- e.__tooltipEl = s;
1710
- const l = () => {
1711
- (Le(e) ? Me(e) : !0) && Se(s, e, o);
1708
+ const o = e.dataset.placement || "top", l = xe(n, o);
1709
+ e.__tooltipEl = l;
1710
+ const s = () => {
1711
+ (Le(e) ? Me(e) : !0) && Se(l, e, o);
1712
1712
  }, i = () => {
1713
- $e(s);
1713
+ $e(l);
1714
1714
  }, a = () => {
1715
- s.style.opacity === "1" && Ce(s, e, o);
1715
+ l.style.opacity === "1" && Ce(l, e, o);
1716
1716
  };
1717
- e.__mouseenterHandler = l, e.__mouseleaveHandler = i, e.__scrollHandler = a, e.addEventListener("mouseenter", l), e.addEventListener("mouseleave", i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a);
1717
+ e.__mouseenterHandler = s, e.__mouseleaveHandler = i, e.__scrollHandler = a, e.addEventListener("mouseenter", s), e.addEventListener("mouseleave", i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a);
1718
1718
  },
1719
1719
  updated(e, t) {
1720
1720
  const n = t.value?.trim();
1721
1721
  if (e.__tooltipEl)
1722
1722
  n ? e.__tooltipEl.firstChild.textContent = n : (e.__tooltipEl.parentElement && e.__tooltipEl.parentElement.removeChild(e.__tooltipEl), delete e.__tooltipEl);
1723
1723
  else if (n) {
1724
- const o = e.dataset.placement || "top", s = xe(n, o);
1725
- e.__tooltipEl = s;
1726
- const l = () => {
1727
- (Le(e) ? Me(e) : !0) && Se(s, e, o);
1724
+ const o = e.dataset.placement || "top", l = xe(n, o);
1725
+ e.__tooltipEl = l;
1726
+ const s = () => {
1727
+ (Le(e) ? Me(e) : !0) && Se(l, e, o);
1728
1728
  }, i = () => {
1729
- $e(s);
1729
+ $e(l);
1730
1730
  }, a = () => {
1731
- s.style.opacity === "1" && Ce(s, e, o);
1731
+ l.style.opacity === "1" && Ce(l, e, o);
1732
1732
  };
1733
- e.__mouseenterHandler = l, e.__mouseleaveHandler = i, e.__scrollHandler = a, e.addEventListener("mouseenter", l), e.addEventListener("mouseleave", i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a);
1733
+ e.__mouseenterHandler = s, e.__mouseleaveHandler = i, e.__scrollHandler = a, e.addEventListener("mouseenter", s), e.addEventListener("mouseleave", i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a);
1734
1734
  }
1735
1735
  },
1736
1736
  beforeUnmount(e) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "voiptime-components",
3
3
  "private": false,
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
@@ -12,9 +12,9 @@
12
12
  ],
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./dist/index.d.ts",
15
16
  "import": "./dist/index.es.js",
16
- "require": "./dist/index.umd.js",
17
- "types": "./dist/index.d.ts"
17
+ "require": "./dist/index.cjs"
18
18
  },
19
19
  "./index.css": "./dist/index.css"
20
20
  },