voiptime-components 0.0.18 → 0.0.20

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"),j=(t,o)=>{const l=t.__vccOpts||t;for(const[n,r]of o)l[n]=r;return l},We={},De={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function He(t,o){return e.openBlock(),e.createElementBlock("svg",De,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 Pe=j(We,[["render",He]]),Ae={},Oe={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",Oe,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 Fe=j(Ae,[["render",je]]),Ze={},Ue={width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qe(t,o){return e.openBlock(),e.createElementBlock("svg",Ue,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 Xe=j(Ze,[["render",qe]]),Ge={},Ke={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ye(t,o){return e.openBlock(),e.createElementBlock("svg",Ke,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 Je=j(Ge,[["render",Ye]]),Qe={},et={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tt(t,o){return e.openBlock(),e.createElementBlock("svg",et,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 ot=j(Qe,[["render",tt]]),nt={},lt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function st(t,o){return e.openBlock(),e.createElementBlock("svg",lt,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 rt=j(nt,[["render",st]]),at={},it={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ct(t,o){return e.openBlock(),e.createElementBlock("svg",it,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 dt=j(at,[["render",ct]]),ut={},mt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pt(t,o){return e.openBlock(),e.createElementBlock("svg",mt,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 ht=j(ut,[["render",pt]]),vt={},ft={xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",viewBox:"0 0 60 60",fill:"none"};function _t(t,o){return e.openBlock(),e.createElementBlock("svg",ft,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.195 7H18.625C17.1332 7 15.7024 7.59263 14.6475 8.64752C13.5926 9.70242 13 11.1332 13 12.625V46.375C13 47.8668 13.5926 49.2976 14.6475 50.3525C15.7024 51.4074 17.1332 52 18.625 52H41.125C42.6168 52 44.0476 51.4074 45.1025 50.3525C46.1574 49.2976 46.75 47.8668 46.75 46.375V29.5M24.195 7C27.3025 7 29.875 9.5175 29.875 12.625V18.25C29.875 19.7418 30.4676 21.1726 31.5225 22.2275C32.5774 23.2824 34.0082 23.875 35.5 23.875H41.125C42.6168 23.875 44.0476 24.4676 45.1025 25.5225C46.1574 26.5774 46.75 28.0082 46.75 29.5M24.195 7C33.42 7 46.75 20.4 46.75 29.5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const gt=j(vt,[["render",_t]]),Ct={},kt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bt(t,o){return e.openBlock(),e.createElementBlock("svg",kt,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 wt=j(Ct,[["render",bt]]),yt={},Bt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xt(t,o){return e.openBlock(),e.createElementBlock("svg",Bt,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 Et=j(yt,[["render",xt]]),St={},Vt={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Mt(t,o){return e.openBlock(),e.createElementBlock("svg",Vt,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 $t=j(St,[["render",Mt]]),Lt={},Nt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zt(t,o){return e.openBlock(),e.createElementBlock("svg",Nt,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 It=j(Lt,[["render",zt]]),Tt={arrowDown:Pe,arrowTop:Fe,arrowRight:Je,arrowLeft:ot,arrowReload:Xe,columnInsert:rt,freeze:dt,unfreeze:ht,columnsMove:wt,empty:gt,listBullet:Et,listBulletHorizontal:$t,close:It},O=e.defineComponent({__name:"VIcon",props:{name:{}},setup(t){const o=t,l=e.computed(()=>Tt[o.name]);return(n,r)=>l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{key:0})):e.createCommentVNode("",!0)}}),Rt={},Wt={class:"vt-loader"};function Dt(t,o){return e.openBlock(),e.createElementBlock("span",Wt)}const se=j(Rt,[["render",Dt]]),Ht=["disabled","type","data-placement"],Pt={key:2,class:"vt-button__content"},J=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 l=t,n=o,r=e.useSlots(),s=e.computed(()=>!!(l.icon&&l.shape)),c=e.computed(()=>{var k,w;const d=r.default?r.default({}):null;return((w=(k=d==null?void 0:d[0])==null?void 0:k.children)==null?void 0:w.toString())??""}),a=e.computed(()=>["vt-button",`vt-button--${l.type}`,{[`vt-button--${l.shape}`]:l.shape,"vt-button--icon-only":s.value,"vt-button--disabled":l.disabled||l.loading,"vt-button--loading":l.loading}]),i=e.computed(()=>s.value&&l.tooltip?c.value:null),u=d=>{!l.disabled&&!l.loading&&n("click",d)};return(d,k)=>{const w=e.resolveDirective("tooltip");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(a.value),disabled:l.disabled||l.loading,type:l.htmlType,"data-placement":l.tooltipPlacement,onClick:u},[l.loading?(e.openBlock(),e.createBlock(se,{key:0,class:"vt-button__icon"})):l.icon?(e.openBlock(),e.createBlock(O,{key:1,name:l.icon,class:"vt-button__icon"},null,8,["name"])):e.createCommentVNode("",!0),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Pt,[e.renderSlot(d.$slots,"default")]))],10,Ht)),[[w,i.value]])}}}),At={key:0,class:"vt-modal__header"},Ot={key:0,class:"vt-modal__title"},jt={class:"vt-modal__content"},re=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 l=t,n=o,r=e.computed(()=>["vt-modal__container",`vt-modal__container--${l.size}`]),s=e.computed(()=>({zIndex:l.zIndex})),c=()=>{n("update:modelValue",!1),n("close")},a=()=>{l.closeOnBackdropClick&&c()};return(i,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-modal__backdrop",style:e.normalizeStyle(s.value),onClick:a},[e.createElementVNode("div",{class:e.normalizeClass(r.value),onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[i.title||i.showCloseButton?(e.openBlock(),e.createElementBlock("div",At,[i.title?(e.openBlock(),e.createElementBlock("h2",Ot,e.toDisplayString(i.title),1)):e.createCommentVNode("",!0),i.showCloseButton?(e.openBlock(),e.createBlock(O,{key:1,name:"close",class:"vt-modal__close",onClick:c})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jt,[e.renderSlot(i.$slots,"default")])],2)],4)):e.createCommentVNode("",!0)]))}}),Ft={class:"vt-pagination"},Zt={class:"vt-pagination__info"},Ut={class:"vt-pagination__rows-per-page"},qt=["value"],Xt={class:"vt-pagination__navigation"},Gt=["disabled"],Kt=["onClick"],Yt=["disabled"],ge=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 l=t,n=o,r=e.computed({get:()=>l.currentPage,set:y=>n("update:currentPage",y)}),s=e.computed({get:()=>l.pageSize,set:y=>n("update:pageSize",y)}),c=e.computed(()=>Math.ceil(l.totalItems/s.value)),a=e.computed(()=>l.totalItems===0?0:(r.value-1)*s.value+1),i=e.computed(()=>Math.min(r.value*s.value,l.totalItems)),u=e.computed(()=>r.value<=1),d=e.computed(()=>r.value>=c.value),k=e.computed(()=>{const y=[],N=c.value,V=r.value,P=l.maxVisiblePages;if(N<=P)for(let b=1;b<=N;b++)y.push(b);else{y.push(1);const b=Math.max(2,V-Math.floor(P/2)),L=Math.min(N-1,V+Math.floor(P/2));b>2&&y.push("...");for(let B=b;B<=L;B++)y.push(B);L<N-1&&y.push("..."),N>1&&y.push(N)}return y}),w=()=>{n("pageChange",{page:r.value,pageSize:s.value})},H=y=>{typeof y=="number"&&y!==r.value&&(r.value=y,w())},R=()=>{u.value||(r.value--,w())},Z=()=>{d.value||(r.value++,w())},D=()=>{r.value=1,w()},W=()=>{n("reloadData",r.value)};return e.watch(()=>l.totalItems,()=>{r.value>c.value&&c.value>0&&(r.value=c.value,w())}),(y,N)=>(e.openBlock(),e.createElementBlock("div",Ft,[e.createElementVNode("div",Zt,[e.createElementVNode("div",Ut,[N[1]||(N[1]=e.createElementVNode("label",{for:"rowsSelect",class:"vt-pagination__label"},"Рядків на сторінку:",-1)),e.withDirectives(e.createElementVNode("select",{id:"rowsSelect","onUpdate:modelValue":N[0]||(N[0]=V=>s.value=V),onChange:D,class:"vt-pagination__select"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.pageSizeOptions,V=>(e.openBlock(),e.createElementBlock("option",{key:V,value:V},e.toDisplayString(V),9,qt))),128))],544),[[e.vModelSelect,s.value]])]),e.createElementVNode("span",null,e.toDisplayString(a.value)+" - "+e.toDisplayString(i.value)+" з "+e.toDisplayString(y.totalItems),1)]),e.createElementVNode("div",Xt,[e.createElementVNode("button",{onClick:R,disabled:u.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!u.value})},[e.createVNode(O,{name:"arrowLeft"})],10,Gt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,V=>(e.openBlock(),e.createElementBlock("button",{key:V,onClick:P=>H(V),class:e.normalizeClass(["vt-pagination__nav-button",{"vt-pagination__nav-button--active":V===r.value}])},e.toDisplayString(V),11,Kt))),128)),e.createElementVNode("button",{onClick:Z,disabled:d.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!d.value})},[e.createVNode(O,{name:"arrowRight"})],10,Yt)]),e.createElementVNode("div",null,[e.createVNode(J,{icon:"arrowReload",shape:"circle",tooltip:"",tooltipPlacement:"left",onClick:W},{default:e.withCtx(()=>N[2]||(N[2]=[e.createTextVNode("Оновити дані ",-1)])),_:1,__:[2]})])]))}}),Jt=["for"],Qt=["id","name","value","checked","disabled","required",".indeterminate"],K=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 l=t,n=o,r=()=>`vt-checkbox-${Math.random().toString(36).substr(2,9)}`,s=e.computed(()=>l.id||r()),c=e.computed(()=>l.modelValue??l.checked),a=d=>{if(l.disabled)return;const w=d.target.checked;n("update:modelValue",w),n("change",w,d)},i=d=>{n("focus",d)},u=d=>{n("blur",d)};return(d,k)=>(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:c.value,disabled:d.disabled,required:d.required,".indeterminate":d.indeterminate,type:"checkbox",class:"vt-checkbox__input",onChange:a,onFocus:i,onBlur:u},null,40,Qt),e.createElementVNode("div",{class:e.normalizeClass(["vt-checkbox__box",{"vt-checkbox__box--checked":c.value&&!d.indeterminate&&!d.isDouble,"vt-checkbox__box--indeterminate":d.indeterminate,"vt-checkbox__box--double":d.isDouble&&c.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":c.value}]),width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k[0]||(k[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&&c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,class:e.normalizeClass(["vt-checkbox__checkmark",{"vt-checkbox__checkmark--checked":c.value}]),width:"13",height:"6",viewBox:"0 0 13 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k[1]||(k[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,Jt))}});function eo(t){const o=e.computed(()=>[...t].sort((r,s)=>r.pinnedLeft&&!s.pinnedLeft?-1:!r.pinnedLeft&&s.pinnedLeft||r.pinnedRight&&!s.pinnedRight?1:!r.pinnedRight&&s.pinnedRight?-1:0)),l=()=>{const r=o.value.length,s=o.value.filter(d=>d.width||d.minWidth),c=s.reduce((d,k)=>d+(k.width||k.minWidth||0),0),a=r-s.length;if(a===0)return 150;const u=Math.max(800-c,a*80);return Math.max(Math.floor(u/a),120)};return{sortedColumns:o,getDefaultColumnWidth:l,getStickyOffset:(r,s,c=!1)=>{const a=o.value;let i=0;if(r==="left"){c&&(i+=50);for(let u=0;u<s;u++){const d=a[u];d.pinnedLeft&&(i+=d.width||d.minWidth||l())}}else for(let u=a.length-1;u>s;u--){const d=a[u];d.pinnedRight&&(i+=d.width||d.minWidth||l())}return i}}}function to(t){const o=()=>{const s={};return t.maxHeight&&(s.maxHeight=`${t.maxHeight}px`),s},l=(s,c,a,i)=>{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=i();u.width=`${d}px`,u.minWidth="80px",u.maxWidth="none"}return s.pinnedLeft?(u.position="sticky",u.left=`${a("left",c,t.selectable)}px`,u.zIndex="10"):s.pinnedRight&&(u.position="sticky",u.right=`${a("right",c,!1)}px`,u.zIndex="10"),u};return{getTableWrapperStyle:o,getColumnStyle:l,getHeaderStyle:(s,c,a,i)=>{const u=l(s,c,a,i);return t.maxHeight&&(u.position="sticky",u.top="0",s.pinnedLeft||s.pinnedRight?u.zIndex="12":u.zIndex="11"),u},getFooterStyle:(s,c,a,i)=>{const u=l(s,c,a,i);return t.maxHeight&&(u.position="sticky",u.bottom="0",s.pinnedLeft||s.pinnedRight?u.zIndex="12":u.zIndex="11"),u}}}function oo(){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:(n,r,s,c)=>{n.preventDefault(),n.stopPropagation(),t.value.resizingCol=r,t.value.startX=n.clientX,t.value.startWidth=r.width||r.minWidth||s(r.prop);const a=u=>{const{resizingCol:d,startX:k,startWidth:w}=t.value;if(!d)return;document.querySelectorAll(`[data-resizer="${d.prop}"]`).forEach(W=>{W.classList.add("vt-table__resizer--active")});const H=u.clientX-k,R=d.minWidth||50,Z=d.maxWidth||1e3,D=Math.max(Math.min(w+H,Z),R);d.width=D},i=()=>{const{resizingCol:u}=t.value;document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i),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")}),c&&u.width&&c(u.width)),t.value.resizingCol=null};document.addEventListener("mousemove",a),document.addEventListener("mouseup",i),document.body.style.cursor=o,document.body.style.userSelect="none",document.body.classList.add("vt-table-resizing")},resizeState:t}}function no(t,o,l,n){var F;const r=t.selectionKey||"id",s=e.ref([]),c=e.ref(null),a=e.ref(!1);(F=t.defaultSelection)!=null&&F.length&&(s.value=[...t.defaultSelection]);const i=p=>p[r],u=p=>a.value?!0:s.value.some(I=>i(I)===i(p)),d=e.computed(()=>o.value.filter(p=>u(p)).length),k=e.computed(()=>o.value.length>0&&d.value===o.value.length),w=e.computed(()=>{if(a.value)return!1;const p=d.value;return p>0&&p<o.value.length}),H=e.computed(()=>a.value?!0:k.value&&!w.value),R=e.computed(()=>a.value),Z=(p,I)=>{const M=i(p),A=s.value.some(v=>i(v)===i(p)),m=I!==void 0?I:!A;if(a.value&&!m){a.value=!1,n!=null&&n.value&&(s.value=n.value.filter(v=>i(v)!==M)),B(p,!1);return}a.value&&m||(m&&!A?s.value.push(p):!m&&A&&(s.value=s.value.filter(v=>i(v)!==M)),t.selectOnClickRow&&I===void 0&&P(m?p:null),B(p,m))},D=()=>{switch(W()){case"none":case"partial":y();break;case"allVisible":N();break;case"absoluteAll":V();break}},W=()=>a.value?"absoluteAll":k.value?"allVisible":d.value>0?"partial":"none",y=()=>{const p=[],I=new Set(s.value.map(M=>i(M)));s.value.forEach(M=>{p.push(M)}),o.value.forEach(M=>{I.has(i(M))||p.push(M)}),s.value=p,a.value=!1,B()},N=()=>{a.value=!0,n!=null&&n.value?s.value=[...n.value]:s.value=[...o.value],B(void 0,void 0,!0)},V=()=>{s.value=[],a.value=!1,c.value=null,B()},P=p=>{const I=c.value;c.value=p,l("current-change",{currentRow:c.value,oldCurrentRow:I})},b=()=>[...s.value],L=p=>{s.value=[...p],a.value=!1,B()},B=(p,I,M=!1)=>{const A={selection:[...s.value],row:p,selected:I,isAllSelected:M||a.value};l("selection-change",A)};return e.watch(()=>t.defaultSelection,p=>{p!=null&&p.length&&(s.value=[...p])}),{selectedRows:s,currentRow:c,isRowSelected:u,isAllSelected:H,isIndeterminate:w,isDoubleCheck:R,isFullSelection:a,toggleRowSelection:Z,toggleAllSelection:D,clearSelection:V,setCurrentRow:P,getSelectionRows:b,setSelectionRows:L,selectAbsolutelyAll:N}}function lo(t,o){if(!t)return String(o.value??"");try{const l=t(o);return l}catch(l){return console.error("Error rendering table slot:",l),String(o.value??"")}}const so=(t,o,l="asc")=>{if(t==null&&o==null)return 0;if(t==null)return l==="asc"?1:-1;if(o==null)return l==="asc"?-1:1;if(t===o)return 0;let n=0;const r=Number(t),s=Number(o);return!isNaN(r)&&!isNaN(s)?n=r-s:ue(t)&&ue(o)?n=new Date(t).getTime()-new Date(o).getTime():typeof t=="boolean"&&typeof o=="boolean"?n=t===o?0:t?-1:1:n=String(t).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"}),l==="desc"?-n:n},ue=t=>t instanceof Date?!isNaN(t.getTime()):typeof t=="string"&&/\d{4}-\d{2}-\d{2}|\//.test(t)?!isNaN(new Date(t).getTime()):!1,ro=(t,o,l)=>{t.sortable&&l({prop:t.prop,direction:o})},me=(t,o)=>{const l=(o==null?void 0:o.prop)===t.prop,n=o==null?void 0:o.direction;return{asc:["vt-th__sort-icon",l&&n==="asc"&&"vt-th__sortable-active"].filter(Boolean).join(" "),desc:["vt-th__sort-icon",l&&n==="desc"&&"vt-th__sortable-active"].filter(Boolean).join(" ")}},ao=(t,o,l)=>{if(!o)return[...t];const n=l.find(s=>s.prop===o.prop);if(!(n!=null&&n.sortable))return[...t];const r=n.sortMethod||so;return[...t].sort((s,c)=>{const a=s[n.prop],i=c[n.prop];return r(a,i,o.direction)})};class io{constructor(){this.modalStack=[],this.baseZIndex=1e3}open(o={}){const l=`modal-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,n=document.createElement("div");n.setAttribute("data-vt-modal",l),document.body.appendChild(n);const r=e.ref(!0),s=this.baseZIndex+this.modalStack.length*10,c=e.createApp({setup(){const i=()=>{r.value=!1,setTimeout(()=>{q.closeById(l)},100)};return()=>e.h(re,{modelValue:r.value,"onUpdate:modelValue":i,title:o.title,size:o.size||"medium",showCloseButton:o.showCloseButton!==!1,closeOnBackdropClick:o.closeOnBackdropClick!==!1,onClose:i,zIndex:s},{default:()=>o.component?e.h(o.component,o.props||{}):o.content?e.h("div",{innerHTML:o.content}):null})}});c.mount(n);const a={id:l,app:c,container:n,isOpen:r};return this.modalStack.push(a),l}close(){if(this.modalStack.length>0){const o=this.modalStack[this.modalStack.length-1];this.closeById(o.id)}}closeById(o){const l=this.modalStack.findIndex(n=>n.id===o);if(l!==-1){const n=this.modalStack[l];this.cleanupModal(n),this.modalStack.splice(l,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 q=new io,Ce={install(t){t.config.globalProperties.$modal=q,t.config.globalProperties.$modalStack={closeAll:()=>q.closeAll(),getCount:()=>q.getOpenModalsCount(),closeById:o=>q.closeById(o)}}},co={class:"vt-columns-selector-body"},uo={class:"vt-columns-selector"},mo={class:"vt-columns-selector__panel"},po=["draggable","onDragstart","onDragover","onDrop"],ho={key:0,class:"vt-columns-selector__panel-item-pinned"},vo={class:"vt-columns-selector__available"},fo=["onClick"],_o={key:0,class:"vt-columns-selector__group-columns"},go={key:0,class:"vt-columns-selector__pinned-note"},Co={class:"vt-modal__content-button"},ko=e.defineComponent({__name:"VTableColumnSelector",props:{columns:{},columnsSelector:{default:()=>[]}},emits:["update-columns"],setup(t,{emit:o}){const l=t,n=o,r=e.ref([]),s=e.ref(new Set),c=e.ref(-1),a=e.ref(-1),i=e.ref("before"),u=e.computed(()=>{const m={};return l.columnsSelector.forEach(v=>{if(v.name==="removed")return;const f=v.columns.map(S=>S.prop),C=r.value.filter(S=>f.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(()=>l.columnsSelector.filter(m=>m.name!=="removed")),k=m=>m.pinnedLeft||m.pinnedRight,w=m=>!k(m),H=()=>{const m=r.value;let v=-1;for(let C=0;C<m.length;C++)m[C].pinnedLeft&&(v=C);let f=m.length;for(let C=0;C<m.length;C++)if(m[C].pinnedRight){f=C;break}return{minIndex:v+1,maxIndex:f-1}},R=m=>{const v=H();return!(m<v.minIndex||m>v.maxIndex+1)},Z=(m,v)=>{const f=r.value[v];if(!w(f)){m.preventDefault();return}c.value=v,m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",f.prop)),document.body.style.cursor="grabbing"},D=(m,v)=>{if(c.value===-1)return;m.preventDefault();const f=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=f.top+f.height/2;let x=v,U="before";C<S?(x=v,U="before"):(x=v+1,U="after"),c.value<x&&x--,R(x)?(a.value=v,i.value=U,m.dataTransfer.dropEffect="move"):(a.value=-1,m.dataTransfer.dropEffect="none")},W=()=>{setTimeout(()=>{c.value===-1&&(a.value=-1)},50)},y=(m,v)=>{if(m.preventDefault(),c.value===-1||a.value===-1){V();return}const f=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=f.top+f.height/2;let x=v;if(C>=S&&(x=v+1),c.value<x&&x--,!R(x)||x===c.value){V();return}const U=[...r.value],[ee]=U.splice(c.value,1);U.splice(x,0,ee),r.value=U,V()},N=()=>{V()},V=()=>{c.value=-1,a.value=-1,i.value="before",document.body.style.cursor=""},P=m=>{const v=["vt-columns-selector__panel-item"];return c.value===m&&v.push("vt-columns-selector__panel-item--dragging"),a.value===m&&i.value==="before"&&v.push("vt-columns-selector__panel-item--drop-before"),a.value===m&&i.value==="after"&&v.push("vt-columns-selector__panel-item--drop-after"),v},b=()=>{r.value=[...l.columns.map(m=>({...m}))],l.columnsSelector.forEach(m=>{m.name!=="removed"&&s.value.add(m.name)})},L=(m,v)=>{if(v)r.value.some(f=>f.prop===m.prop)||r.value.push({...m});else{if(k(m))return;r.value=r.value.filter(f=>f.prop!==m.prop)}},B=(m,v)=>{if(v)m.columns.forEach(f=>{r.value.some(C=>C.prop===f.prop)||r.value.push({...f})});else{const f=[];m.columns.forEach(C=>{const S=r.value.find(x=>x.prop===C.prop);S&&!k(S)&&f.push(S)}),r.value=r.value.filter(C=>!f.some(S=>S.prop===C.prop))}},F=m=>r.value.some(v=>v.prop===m.prop),p=m=>{const v=r.value.find(f=>f.prop===m.prop);return!v||!k(v)},I=m=>{s.value.has(m)?s.value.delete(m):s.value.add(m)},M=()=>{n("update-columns",[...r.value]),q.close()},A=()=>{q.close()};return e.onMounted(()=>{b()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",uo,[e.createElementVNode("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,C)=>(e.openBlock(),e.createElementBlock("div",{key:f.prop,class:e.normalizeClass(P(C)),draggable:w(f),onDragstart:S=>Z(S,C),onDragover:S=>D(S,C),onDragleave:W,onDrop:S=>y(S,C),onDragend:N},[e.createVNode(O,{name:w(f)?"columnsMove":"freeze",class:e.normalizeClass(["vt-columns-selector__panel-item-icon",{"vt-columns-selector__panel-item-icon--draggable":w(f)}])},null,8,["name","class"]),e.createVNode(K,{label:f.label,checked:!0,disabled:k(f),onChange:S=>L(f,S),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},null,8,["label","disabled","onChange"]),k(f)?(e.openBlock(),e.createElementBlock("span",ho,"pinned")):e.createCommentVNode("",!0)],42,po))),128))]),e.createElementVNode("div",vo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,f=>{var C,S;return e.openBlock(),e.createElementBlock("div",{key:f.name,class:"vt-columns-selector__group"},[e.createElementVNode("div",{class:"vt-columns-selector__group-header",onClick:x=>I(f.name)},[e.createVNode(K,{label:f.label,checked:((C=u.value[f.name])==null?void 0:C.checked)||!1,indeterminate:((S=u.value[f.name])==null?void 0:S.indeterminate)||!1,onChange:x=>B(f,x),onClick:v[1]||(v[1]=e.withModifiers(()=>{},["stop"]))},null,8,["label","checked","indeterminate","onChange"]),f.icon?(e.openBlock(),e.createBlock(O,{key:0,name:f.icon,class:"vt-columns-selector__group-icon"},null,8,["name"])):e.createCommentVNode("",!0)],8,fo),s.value.has(f.name)?(e.openBlock(),e.createElementBlock("div",_o,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.columns,x=>(e.openBlock(),e.createElementBlock("div",{key:x.prop,class:"vt-columns-selector__group-column"},[e.createVNode(K,{label:x.label,checked:F(x),disabled:!p(x),onChange:U=>L(x,U)},null,8,["label","checked","disabled","onChange"]),p(x)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",go," (закріплена) "))]))),128))])):e.createCommentVNode("",!0)])}),128))])]),e.createElementVNode("div",Co,[e.createVNode(J,{onClick:A},{default:e.withCtx(()=>v[2]||(v[2]=[e.createTextVNode("Скасувати",-1)])),_:1,__:[2]}),e.createVNode(J,{type:"primary",onClick:M},{default:e.withCtx(()=>v[3]||(v[3]=[e.createTextVNode("Зберегти",-1)])),_:1,__:[3]})])]))}}),bo=e.defineComponent({__name:"ColumnActions",props:{column:{},allColumns:{},columnsSelector:{}},emits:["pin","update-columns"],setup(t,{emit:o}){const l=t,n=o,r=e.ref(),s=e.ref(),c=e.ref(),a=e.ref(!1),i=e.ref(!1),u=e.ref([]),d=async()=>{if(await e.nextTick(),!r.value||!s.value)return;const b=s.value.getBoundingClientRect(),L=r.value,B=L.offsetWidth,F=b.left+b.width/2;L.style.top=`${b.bottom-20}px`,L.style.left=`${F-B/2}px`;const p=L.getBoundingClientRect();p.right>window.innerWidth&&(L.style.left=`${window.innerWidth-B-8}px`),p.left<0&&(L.style.left="8px")},k=b=>{b.stopPropagation(),!i.value&&(a.value?H():w())},w=()=>{i.value||(a.value=!0,d(),c.value&&(c.value.style.zIndex="22"))},H=()=>{i.value=!0,a.value=!1,c.value&&c.value.style.removeProperty("z-index"),setTimeout(()=>{i.value=!1},100)},R=b=>{var L,B;!((L=s.value)!=null&&L.contains(b.target))&&!((B=r.value)!=null&&B.contains(b.target))&&H()},Z=()=>{P()?(n("pin",l.column,"none"),console.log(`Колонка "${l.column.label}" відкріплена`)):(n("pin",l.column,"left"),console.log(`Колонка "${l.column.label}" прикріплена зліва`)),H()},D=b=>({name:"removed",label:"Видалені колонки",order:999,columns:b}),W=b=>{var I;const L=new Set(b.map(M=>M.prop)),B=new Set;(I=l.columnsSelector)==null||I.forEach(M=>{M.columns.forEach(A=>B.add(A.prop))}),l.allColumns.forEach(M=>B.add(M.prop));const F=[];B.forEach(M=>{var A;if(!L.has(M)){let m;(A=l.columnsSelector)==null||A.forEach(v=>{const f=v.columns.find(C=>C.prop===M);f&&(m=f)}),m||(m=l.allColumns.find(v=>v.prop===M)),m&&F.push(m)}});const p=[...l.columnsSelector||[]];F.length>0&&p.push(D(F)),u.value=p},y=()=>{W(l.allColumns),q.open({component:ko,title:"Управління колонками таблиці",props:{columns:l.allColumns,columnsSelector:u.value,"onUpdate-columns":b=>{console.log("ColumnActions отримав оновлені колонки:",b),n("update-columns",b),W(b)}},size:"large",closeOnBackdropClick:!1}),H()},N=()=>l.column.pinnedLeft,V=()=>l.column.pinnedRight,P=()=>N()||V();return e.onMounted(()=>{document.addEventListener("click",R),s.value&&(c.value=s.value.closest("th")),W(l.allColumns)}),e.onUnmounted(()=>{document.removeEventListener("click",R)}),(b,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"triggerRef",ref:s,class:"vt-table-header-actions",onClick:k},[e.createVNode(O,{name:"listBullet"}),a.value?(e.openBlock(),e.createElementBlock("ul",{key:0,ref_key:"menuRef",ref:r,class:e.normalizeClass(["dropdown-menu","vt-table-dropdown",{visible:a.value}])},[e.createElementVNode("li",{onClick:Z},[e.createVNode(O,{name:P()?"unfreeze":"freeze"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(P()?"Розморозити":"Заморозити"),1)]),e.createElementVNode("li",{onClick:y},[e.createVNode(O,{name:"columnInsert"}),L[0]||(L[0]=e.createElementVNode("span",null,"Колонки",-1))])],2)):e.createCommentVNode("",!0)],512))}}),wo={class:"vt-table"},yo={class:"vt-th__content"},Bo={class:"vt-th__content"},xo={class:"vt-th__label"},Eo={key:0,class:"vt-th__sortable"},So=["data-resizer","onMousedown"],Vo={key:0,class:"vt-table__empty-row"},Mo=["colspan"],$o={class:"vt-table__empty-content"},Lo=["onClick"],No={class:"vt-table__cell-content"},zo={class:"vt-table__cell-content vt-table__cell-content--ellipsis"},Io={key:1},To=["data-resizer","onMousedown"],Ro={key:0,class:"vt-table__summary"},Wo={class:"vt-table__cell-content vt-table__cell-content--summary"},ne=50,ke=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","infinity-scroll"],["update:columns"]),setup(t,{expose:o,emit:l}){const n=t,r=e.useModel(t,"columns"),s=l,c=e.ref({}),a=e.ref(),i=e.reactive([]),u=e.ref(n.defaultSort||null),d=e.computed(()=>r.value!==void 0),k=e.computed(()=>n.data&&n.data.length>0),w=e.ref(!1),H=e.ref(0);let R=null;const Z=()=>{d.value&&r.value?i.splice(0,i.length,...r.value):n.columns&&i.splice(0,i.length,...n.columns)};e.watch(()=>r.value,h=>{h&&d.value&&i.splice(0,i.length,...h)},{deep:!0}),e.watch(()=>n.columns,h=>{h&&!d.value&&i.splice(0,i.length,...h)},{deep:!0}),e.provide("vt-table-columns",i);const{sortedColumns:D,getDefaultColumnWidth:W,getStickyOffset:y}=eo(i),{getTableWrapperStyle:N,getColumnStyle:V,getHeaderStyle:P,getFooterStyle:b}=to(n),{onMouseDown:L}=oo(),B=e.computed(()=>ao(n.data,u.value,i)),F=e.computed(()=>n.allData||n.data),p=n.selectable?no(n,B,s,F):null,I=()=>({width:`${ne}px`,minWidth:`${ne}px`,maxWidth:`${ne}px`,left:"0px",position:"sticky",zIndex:10}),M=()=>{const h=I();return n.maxHeight?{...h,top:"0px",zIndex:11}:h},A=()=>{const h=I();return n.maxHeight?{...h,bottom:"0px",zIndex:11}:h},m=()=>{if(!a.value||w.value)return;const h=a.value,_=h.scrollTop,E=h.scrollHeight,$=h.clientHeight,z=30;R&&clearTimeout(R),R=setTimeout(()=>{const Q=_-H.value>1,g=E-_-$<=z,G=E-_-$<=5;H.value=_,Q&&(g||G)&&(w.value=!0,s("infinity-scroll"),setTimeout(()=>{w.value=!1},1e3))},50)},v=()=>{w.value=!1};e.onMounted(()=>{a.value&&a.value.addEventListener("scroll",m)}),e.onUnmounted(()=>{R&&clearTimeout(R),a.value&&a.value.removeEventListener("scroll",m)});const f=(h,_)=>{ro(h,_,E=>{var $,z;(($=u.value)==null?void 0:$.prop)===h.prop&&u.value.direction===_?u.value=null:u.value=E,s("sort-change",{column:h,direction:((z=u.value)==null?void 0:z.direction)||null,prop:h.prop,sortedData:B.value})})},C=(h,_)=>{const E={pinnedLeft:_==="left",pinnedRight:_==="right"};x(h.prop,E),s("column-pin",{column:{...h,...E},position:_})},S=h=>{i.splice(0,i.length,...h),d.value&&(r.value=[...h]),s("columns-change",[...h])},x=(h,_)=>{const E=i.findIndex($=>$.prop===h);if(E!==-1){if(Object.assign(i[E],_),d.value&&r.value){const $=r.value.findIndex(z=>z.prop===h);if($!==-1){const z=[...r.value];z[$]={...z[$],..._},r.value=z}}s("columns-change",[...i])}else console.error("Колонку не знайдено:",h,"Доступні колонки:",i.map($=>$.prop))},U=(h,_,E)=>{s("row-click",{row:h,column:_,event:E}),n.highlightCurrentRow&&p&&p.setCurrentRow(h)},ee=(h,_,E)=>{E.stopPropagation(),p&&p.toggleRowSelection(_,h)},Be=(h,_)=>{_.stopPropagation(),p&&p.toggleAllSelection()},ae=(h,_)=>{h&&(c.value[_]=h)},ie=(h,_)=>{const E=_.width||W();L(h,_,W,$=>{x(_.prop,{width:$}),s("column-resize",{column:{..._,width:$},width:$,oldWidth:E})})},xe=(h,_)=>V(h,_,y,W),Ee=(h,_)=>P(h,_,y,W),Se=(h,_)=>b(h,_,y,W),Ve=(h,_)=>{if(!_||!_.prop)return"";const E=h[_.prop];return E==null?"":String(E)},Me=e.computed(()=>{if(!n.showSummary||!k.value)return{};const h=i;if(typeof n.summaryMethod=="function"){const _=n.summaryMethod({columns:h,data:B.value});return h.reduce((E,$,z)=>(E[$.prop]=_[z],E),{})}return h.reduce((_,E)=>{const $=B.value.map(z=>z[E.prop]);return _[E.prop]=$.every(z=>typeof z=="number")?$.reduce((z,Y)=>z+Y,0):"",_},{})}),$e=e.computed(()=>n.showSummary&&k.value),Le=(h,_)=>{p&&p.toggleRowSelection(h,_)},Ne=()=>{p&&p.toggleAllSelection()},ze=()=>{p&&p.selectAbsolutelyAll()},Ie=()=>{p&&p.clearSelection()},Te=()=>p?p.getSelectionRows():[],Re=h=>{p&&p.setSelectionRows(h)};return e.onMounted(()=>{Z()}),o({toggleRowSelection:Le,toggleAllSelection:Ne,selectAbsolutelyAll:ze,clearSelection:Ie,getSelectionRows:Te,setSelectionRows:Re,resetInfinityScroll:v}),(h,_)=>{var $,z,Y,Q;const E=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{ref_key:"tableWrapperRef",ref:a,class:"vt-table-wrapper",style:e.normalizeStyle(e.unref(N)()),onScroll:m},[e.createElementVNode("table",wo,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[n.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["vt-table__th vt-table__th--selection",{"vt-table__th--sticky":n.maxHeight,"vt-table__th--pinned-left":!0}]),style:e.normalizeStyle(M())},[e.createElementVNode("div",yo,[e.createVNode(K,{checked:($=e.unref(p))==null?void 0:$.isAllSelected.value,indeterminate:(z=e.unref(p))==null?void 0:z.isIndeterminate.value,"is-double":(Q=(Y=e.unref(p))==null?void 0:Y.isDoubleCheck)==null?void 0:Q.value,onChange:Be},null,8,["checked","indeterminate","is-double"])])],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),(g,G)=>(e.openBlock(),e.createElementBlock("th",{key:g.prop,ref_for:!0,ref:X=>ae(X,g.prop),style:e.normalizeStyle(Ee(g,G)),class:e.normalizeClass(["vt-table__th",{"vt-table__th--sticky":n.maxHeight,"vt-table__th--pinned-left":g.pinnedLeft,"vt-table__th--pinned-right":g.pinnedRight,"vt-table__th--sortable":g.sortable}])},[e.createElementVNode("div",Bo,[e.createElementVNode("div",xo,e.toDisplayString(g.label),1),g.sortable?(e.openBlock(),e.createElementBlock("div",Eo,[e.createVNode(O,{name:"arrowTop",class:e.normalizeClass(e.unref(me)(g,u.value).asc),onClick:e.withModifiers(X=>f(g,"asc"),["stop"])},null,8,["class","onClick"]),e.createVNode(O,{name:"arrowDown",class:e.normalizeClass(e.unref(me)(g,u.value).desc),onClick:e.withModifiers(X=>f(g,"desc"),["stop"])},null,8,["class","onClick"])])):e.createCommentVNode("",!0),g.actionColumn?(e.openBlock(),e.createBlock(bo,{key:1,column:g,"all-columns":e.unref(D),columnsSelector:n.columnsSelector,onPin:C,onUpdateColumns:S},null,8,["column","all-columns","columnsSelector"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":g.prop,onMousedown:X=>ie(X,g)},null,40,So)],6))),128))])]),e.createElementVNode("tbody",null,[k.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,(g,G)=>{var X,ce,de;return e.openBlock(),e.createElementBlock("tr",{key:g.id,class:e.normalizeClass(["vt-table__row",{"vt-table__row--selected":(X=e.unref(p))==null?void 0:X.isRowSelected(g),"vt-table__row--current":((ce=e.unref(p))==null?void 0:ce.currentRow.value)===g,"vt-table__row--clickable":n.selectOnClickRow||n.highlightCurrentRow}]),onClick:T=>U(g,e.unref(D)[0],T)},[n.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(I())},[e.createElementVNode("div",No,[e.createVNode(K,{checked:(de=e.unref(p))==null?void 0:de.isRowSelected(g),onChange:(T,te)=>ee(T,g,te)},null,8,["checked","onChange"])])],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),(T,te)=>(e.openBlock(),e.createElementBlock("td",{key:T.prop,ref_for:!0,ref:oe=>ae(oe,T.prop),style:e.normalizeStyle(xe(T,te)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":T.pinnedLeft,"vt-table__td--pinned-right":T.pinnedRight}])},[e.withDirectives((e.openBlock(),e.createElementBlock("div",zo,[T.renderSlot?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(()=>e.unref(lo)(T.renderSlot,{row:g,column:T,value:g[T.prop],index:G})),{key:0})):(e.openBlock(),e.createElementBlock("span",Io,e.toDisplayString(g[T.prop]),1))])),[[E,T.showOverflowTooltip?Ve(g,T):null]]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":T.prop,onMousedown:oe=>ie(oe,T)},null,40,To)],6))),128))],10,Lo)}),128)):(e.openBlock(),e.createElementBlock("tr",Vo,[e.createElementVNode("td",{colspan:e.unref(D).length+(n.selectable?1:0),class:"vt-table__empty-cell"},[e.createElementVNode("div",$o,[e.createVNode(O,{name:"empty",class:"vt-table__empty-icon"}),_[0]||(_[0]=e.createElementVNode("span",{class:"vt-table__empty-text"},"Немає даних!",-1))])],8,Mo)]))]),$e.value?(e.openBlock(),e.createElementBlock("tfoot",Ro,[e.createElementVNode("tr",null,[n.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":!0}]),style:e.normalizeStyle(A())},_[1]||(_[1]=[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(D),(g,G)=>(e.openBlock(),e.createElementBlock("td",{key:g.prop,style:e.normalizeStyle(Se(g,G)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":g.pinnedLeft,"vt-table__td--pinned-right":g.pinnedRight}])},[e.createElementVNode("div",Wo,e.toDisplayString(Me.value[g.prop]),1)],6))),128))])])):e.createCommentVNode("",!0)])],36)}}}),be=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,l=e.useSlots(),n=e.inject("vt-table-columns");n||console.error("VTableColumn: не знайдено контекст таблиці. Переконайтеся, що компонент використовується всередині VTable.");const r=()=>({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:l[o.prop]??l.default??l.slot});let s=-1;return e.onMounted(()=>{if(n){const c=r();n.push(c),s=n.length-1}}),e.watch(()=>[o.width,o.minWidth,o.maxWidth,o.sortable,o.pinnedLeft,o.pinnedRight,o.actionColumn,o.showOverflowTooltip,o.selectable,o.label],()=>{if(n&&s!==-1){const c=n.findIndex(a=>a.prop===o.prop);if(c!==-1){const a=n[c],i={...r(),renderSlot:a.renderSlot};n[c]=i}}},{deep:!0}),e.onUnmounted(()=>{if(n){const c=n.findIndex(a=>a.prop===o.prop);c>-1&&n.splice(c,1)}}),(c,a)=>null}}),pe=(t,o)=>{const l=document.createElement("div");l.className=`vt-tooltip vt-tooltip--${o}`,l.innerText=t,Object.assign(l.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&&(l.style.whiteSpace="nowrap");const n=document.createElement("div");switch(n.className="vt-tooltip__arrow",Object.assign(n.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),o){case"top":Object.assign(n.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(n.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(n.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(n.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return l.appendChild(n),l},le=(t,o,l)=>{const n=o.getBoundingClientRect(),r=t.getBoundingClientRect(),s=window.pageXOffset||document.documentElement.scrollLeft,c=window.pageYOffset||document.documentElement.scrollTop;let a=0,i=0;switch(l){case"top":a=n.top+c-r.height-8,i=n.left+s+(n.width-r.width)/2;break;case"bottom":a=n.bottom+c+8,i=n.left+s+(n.width-r.width)/2;break;case"left":a=n.top+c+(n.height-r.height)/2,i=n.left+s-r.width-8;break;case"right":a=n.top+c+(n.height-r.height)/2,i=n.right+s+8;break}const u=window.innerWidth,d=window.innerHeight;i<8?i=8:i+r.width>u-8&&(i=u-r.width-8),a<c+8?l==="top"?a=n.bottom+c+8:a=c+8:a+r.height>c+d-8&&(l==="bottom"?a=n.top+c-r.height-8:a=c+d-r.height-8),t.style.top=`${a}px`,t.style.left=`${i}px`},he=(t,o,l)=>{t.parentElement||document.body.appendChild(t),t.style.visibility="visible",le(t,o,l),requestAnimationFrame(()=>{t.style.opacity="1"})},ve=t=>{t.style.opacity="0",t.style.visibility="hidden"},fe=t=>t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight,_e=t=>!!t.closest(".vt-table, table"),we={mounted(t,o){var i;const l=(i=o.value)==null?void 0:i.trim();if(!l)return;const n=t.dataset.placement||"top",r=pe(l,n);t.__tooltipEl=r;const s=()=>{(_e(t)?fe(t):!0)&&he(r,t,n)},c=()=>{ve(r)},a=()=>{r.style.opacity==="1"&&le(r,t,n)};t.__mouseenterHandler=s,t.__mouseleaveHandler=c,t.__scrollHandler=a,t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",c),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a)},updated(t,o){var n;const l=(n=o.value)==null?void 0:n.trim();if(t.__tooltipEl)l?t.__tooltipEl.firstChild.textContent=l:(t.__tooltipEl.parentElement&&t.__tooltipEl.parentElement.removeChild(t.__tooltipEl),delete t.__tooltipEl);else if(l){const r=t.dataset.placement||"top",s=pe(l,r);t.__tooltipEl=s;const c=()=>{(_e(t)?fe(t):!0)&&he(s,t,r)},a=()=>{ve(s)},i=()=>{s.style.opacity==="1"&&le(s,t,r)};t.__mouseenterHandler=c,t.__mouseleaveHandler=a,t.__scrollHandler=i,t.addEventListener("mouseenter",c),t.addEventListener("mouseleave",a),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)}},ye={install(t,o={}){const{prefix:l="V",modal:n=!0}=o;t.component(`${l}Button`,J),t.component(`${l}Icon`,O),t.component(`${l}Loader`,se),t.component(`${l}Modal`,re),t.component(`${l}Pagination`,ge),t.component(`${l}Checkbox`,K),t.component(`${l}Table`,ke),t.component(`${l}TableColumn`,be),t.directive("tooltip",we),n&&t.use(Ce)}},Do=ye.install;exports.VButton=J;exports.VCheckbox=K;exports.VIcon=O;exports.VLoader=se;exports.VModal=re;exports.VModalPlugin=Ce;exports.VPagination=ge;exports.VTable=ke;exports.VTableColumn=be;exports.default=ye;exports.install=Do;exports.modalManager=q;exports.tooltipDirective=we;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),j=(t,o)=>{const l=t.__vccOpts||t;for(const[n,r]of o)l[n]=r;return l},We={},De={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function He(t,o){return e.openBlock(),e.createElementBlock("svg",De,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 Pe=j(We,[["render",He]]),Ae={},Oe={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",Oe,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 Fe=j(Ae,[["render",je]]),Ze={},Ue={width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qe(t,o){return e.openBlock(),e.createElementBlock("svg",Ue,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 Xe=j(Ze,[["render",qe]]),Ge={},Ke={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ye(t,o){return e.openBlock(),e.createElementBlock("svg",Ke,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 Je=j(Ge,[["render",Ye]]),Qe={},et={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tt(t,o){return e.openBlock(),e.createElementBlock("svg",et,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 ot=j(Qe,[["render",tt]]),nt={},lt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function st(t,o){return e.openBlock(),e.createElementBlock("svg",lt,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 rt=j(nt,[["render",st]]),at={},it={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ct(t,o){return e.openBlock(),e.createElementBlock("svg",it,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 dt=j(at,[["render",ct]]),ut={},mt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pt(t,o){return e.openBlock(),e.createElementBlock("svg",mt,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 ht=j(ut,[["render",pt]]),vt={},ft={xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",viewBox:"0 0 60 60",fill:"none"};function _t(t,o){return e.openBlock(),e.createElementBlock("svg",ft,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.195 7H18.625C17.1332 7 15.7024 7.59263 14.6475 8.64752C13.5926 9.70242 13 11.1332 13 12.625V46.375C13 47.8668 13.5926 49.2976 14.6475 50.3525C15.7024 51.4074 17.1332 52 18.625 52H41.125C42.6168 52 44.0476 51.4074 45.1025 50.3525C46.1574 49.2976 46.75 47.8668 46.75 46.375V29.5M24.195 7C27.3025 7 29.875 9.5175 29.875 12.625V18.25C29.875 19.7418 30.4676 21.1726 31.5225 22.2275C32.5774 23.2824 34.0082 23.875 35.5 23.875H41.125C42.6168 23.875 44.0476 24.4676 45.1025 25.5225C46.1574 26.5774 46.75 28.0082 46.75 29.5M24.195 7C33.42 7 46.75 20.4 46.75 29.5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const gt=j(vt,[["render",_t]]),Ct={},kt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bt(t,o){return e.openBlock(),e.createElementBlock("svg",kt,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 wt=j(Ct,[["render",bt]]),yt={},Bt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xt(t,o){return e.openBlock(),e.createElementBlock("svg",Bt,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 Et=j(yt,[["render",xt]]),St={},Vt={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Mt(t,o){return e.openBlock(),e.createElementBlock("svg",Vt,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 $t=j(St,[["render",Mt]]),Lt={},Nt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zt(t,o){return e.openBlock(),e.createElementBlock("svg",Nt,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 It=j(Lt,[["render",zt]]),Tt={arrowDown:Pe,arrowTop:Fe,arrowRight:Je,arrowLeft:ot,arrowReload:Xe,columnInsert:rt,freeze:dt,unfreeze:ht,columnsMove:wt,empty:gt,listBullet:Et,listBulletHorizontal:$t,close:It},O=e.defineComponent({__name:"VIcon",props:{name:{}},setup(t){const o=t,l=e.computed(()=>Tt[o.name]);return(n,r)=>l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{key:0})):e.createCommentVNode("",!0)}}),Rt={},Wt={class:"vt-loader"};function Dt(t,o){return e.openBlock(),e.createElementBlock("span",Wt)}const se=j(Rt,[["render",Dt]]),Ht=["disabled","type","data-placement"],Pt={key:2,class:"vt-button__content"},J=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 l=t,n=o,r=e.useSlots(),s=e.computed(()=>!!(l.icon&&l.shape)),c=e.computed(()=>{var k,w;const d=r.default?r.default({}):null;return((w=(k=d==null?void 0:d[0])==null?void 0:k.children)==null?void 0:w.toString())??""}),a=e.computed(()=>["vt-button",`vt-button--${l.type}`,{[`vt-button--${l.shape}`]:l.shape,"vt-button--icon-only":s.value,"vt-button--disabled":l.disabled||l.loading,"vt-button--loading":l.loading}]),i=e.computed(()=>s.value&&l.tooltip?c.value:null),u=d=>{!l.disabled&&!l.loading&&n("click",d)};return(d,k)=>{const w=e.resolveDirective("tooltip");return e.withDirectives((e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(a.value),disabled:l.disabled||l.loading,type:l.htmlType,"data-placement":l.tooltipPlacement,onClick:u},[l.loading?(e.openBlock(),e.createBlock(se,{key:0,class:"vt-button__icon"})):l.icon?(e.openBlock(),e.createBlock(O,{key:1,name:l.icon,class:"vt-button__icon"},null,8,["name"])):e.createCommentVNode("",!0),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Pt,[e.renderSlot(d.$slots,"default")]))],10,Ht)),[[w,i.value]])}}}),At={key:0,class:"vt-modal__header"},Ot={key:0,class:"vt-modal__title"},jt={class:"vt-modal__content"},re=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 l=t,n=o,r=e.computed(()=>["vt-modal__container",`vt-modal__container--${l.size}`]),s=e.computed(()=>({zIndex:l.zIndex})),c=()=>{n("update:modelValue",!1),n("close")},a=()=>{l.closeOnBackdropClick&&c()};return(i,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-modal__backdrop",style:e.normalizeStyle(s.value),onClick:a},[e.createElementVNode("div",{class:e.normalizeClass(r.value),onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[i.title||i.showCloseButton?(e.openBlock(),e.createElementBlock("div",At,[i.title?(e.openBlock(),e.createElementBlock("h2",Ot,e.toDisplayString(i.title),1)):e.createCommentVNode("",!0),i.showCloseButton?(e.openBlock(),e.createBlock(O,{key:1,name:"close",class:"vt-modal__close",onClick:c})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jt,[e.renderSlot(i.$slots,"default")])],2)],4)):e.createCommentVNode("",!0)]))}}),Ft={class:"vt-pagination"},Zt={class:"vt-pagination__info"},Ut={class:"vt-pagination__rows-per-page"},qt=["value"],Xt={class:"vt-pagination__navigation"},Gt=["disabled"],Kt=["onClick"],Yt=["disabled"],ge=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 l=t,n=o,r=e.computed({get:()=>l.currentPage,set:y=>n("update:currentPage",y)}),s=e.computed({get:()=>l.pageSize,set:y=>n("update:pageSize",y)}),c=e.computed(()=>Math.ceil(l.totalItems/s.value)),a=e.computed(()=>l.totalItems===0?0:(r.value-1)*s.value+1),i=e.computed(()=>Math.min(r.value*s.value,l.totalItems)),u=e.computed(()=>r.value<=1),d=e.computed(()=>r.value>=c.value),k=e.computed(()=>{const y=[],N=c.value,V=r.value,P=l.maxVisiblePages;if(N<=P)for(let b=1;b<=N;b++)y.push(b);else{y.push(1);const b=Math.max(2,V-Math.floor(P/2)),L=Math.min(N-1,V+Math.floor(P/2));b>2&&y.push("...");for(let B=b;B<=L;B++)y.push(B);L<N-1&&y.push("..."),N>1&&y.push(N)}return y}),w=()=>{n("pageChange",{page:r.value,pageSize:s.value})},H=y=>{typeof y=="number"&&y!==r.value&&(r.value=y,w())},R=()=>{u.value||(r.value--,w())},Z=()=>{d.value||(r.value++,w())},D=()=>{r.value=1,w()},W=()=>{n("reloadData",r.value)};return e.watch(()=>l.totalItems,()=>{r.value>c.value&&c.value>0&&(r.value=c.value,w())}),(y,N)=>(e.openBlock(),e.createElementBlock("div",Ft,[e.createElementVNode("div",Zt,[e.createElementVNode("div",Ut,[N[1]||(N[1]=e.createElementVNode("label",{for:"rowsSelect",class:"vt-pagination__label"},"Рядків на сторінку:",-1)),e.withDirectives(e.createElementVNode("select",{id:"rowsSelect","onUpdate:modelValue":N[0]||(N[0]=V=>s.value=V),onChange:D,class:"vt-pagination__select"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.pageSizeOptions,V=>(e.openBlock(),e.createElementBlock("option",{key:V,value:V},e.toDisplayString(V),9,qt))),128))],544),[[e.vModelSelect,s.value]])]),e.createElementVNode("span",null,e.toDisplayString(a.value)+" - "+e.toDisplayString(i.value)+" з "+e.toDisplayString(y.totalItems),1)]),e.createElementVNode("div",Xt,[e.createElementVNode("button",{onClick:R,disabled:u.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!u.value})},[e.createVNode(O,{name:"arrowLeft"})],10,Gt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,V=>(e.openBlock(),e.createElementBlock("button",{key:V,onClick:P=>H(V),class:e.normalizeClass(["vt-pagination__nav-button",{"vt-pagination__nav-button--active":V===r.value}])},e.toDisplayString(V),11,Kt))),128)),e.createElementVNode("button",{onClick:Z,disabled:d.value,class:e.normalizeClass({"vt-pagination__nav-button":!0,"has-items":!d.value})},[e.createVNode(O,{name:"arrowRight"})],10,Yt)]),e.createElementVNode("div",null,[e.createVNode(J,{icon:"arrowReload",shape:"circle",tooltip:"",tooltipPlacement:"left",onClick:W},{default:e.withCtx(()=>N[2]||(N[2]=[e.createTextVNode("Оновити дані ",-1)])),_:1,__:[2]})])]))}}),Jt=["for"],Qt=["id","name","value","checked","disabled","required",".indeterminate"],K=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 l=t,n=o,r=()=>`vt-checkbox-${Math.random().toString(36).substr(2,9)}`,s=e.computed(()=>l.id||r()),c=e.computed(()=>l.modelValue??l.checked),a=d=>{if(l.disabled)return;const w=d.target.checked;n("update:modelValue",w),n("change",w,d)},i=d=>{n("focus",d)},u=d=>{n("blur",d)};return(d,k)=>(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:c.value,disabled:d.disabled,required:d.required,".indeterminate":d.indeterminate,type:"checkbox",class:"vt-checkbox__input",onChange:a,onFocus:i,onBlur:u},null,40,Qt),e.createElementVNode("div",{class:e.normalizeClass(["vt-checkbox__box",{"vt-checkbox__box--checked":c.value&&!d.indeterminate&&!d.isDouble,"vt-checkbox__box--indeterminate":d.indeterminate,"vt-checkbox__box--double":d.isDouble&&c.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":c.value}]),width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k[0]||(k[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&&c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,class:e.normalizeClass(["vt-checkbox__checkmark",{"vt-checkbox__checkmark--checked":c.value}]),width:"13",height:"6",viewBox:"0 0 13 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k[1]||(k[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,Jt))}});function eo(t){const o=e.computed(()=>[...t].sort((r,s)=>r.pinnedLeft&&!s.pinnedLeft?-1:!r.pinnedLeft&&s.pinnedLeft||r.pinnedRight&&!s.pinnedRight?1:!r.pinnedRight&&s.pinnedRight?-1:0)),l=()=>{const r=o.value.length,s=o.value.filter(d=>d.width||d.minWidth),c=s.reduce((d,k)=>d+(k.width||k.minWidth||0),0),a=r-s.length;if(a===0)return 150;const u=Math.max(800-c,a*80);return Math.max(Math.floor(u/a),120)};return{sortedColumns:o,getDefaultColumnWidth:l,getStickyOffset:(r,s,c=!1)=>{const a=o.value;let i=0;if(r==="left"){c&&(i+=50);for(let u=0;u<s;u++){const d=a[u];d.pinnedLeft&&(i+=d.width||d.minWidth||l())}}else for(let u=a.length-1;u>s;u--){const d=a[u];d.pinnedRight&&(i+=d.width||d.minWidth||l())}return i}}}function to(t){const o=()=>{const s={};return t.maxHeight&&(s.maxHeight=`${t.maxHeight}px`),s},l=(s,c,a,i)=>{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=i();u.width=`${d}px`,u.minWidth="80px",u.maxWidth="none"}return s.pinnedLeft?(u.position="sticky",u.left=`${a("left",c,t.selectable)}px`,u.zIndex="10"):s.pinnedRight&&(u.position="sticky",u.right=`${a("right",c,!1)}px`,u.zIndex="10"),u};return{getTableWrapperStyle:o,getColumnStyle:l,getHeaderStyle:(s,c,a,i)=>{const u=l(s,c,a,i);return t.maxHeight&&(u.position="sticky",u.top="0",s.pinnedLeft||s.pinnedRight?u.zIndex="12":u.zIndex="11"),u},getFooterStyle:(s,c,a,i)=>{const u=l(s,c,a,i);return t.maxHeight&&(u.position="sticky",u.bottom="0",s.pinnedLeft||s.pinnedRight?u.zIndex="12":u.zIndex="11"),u}}}function oo(){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:(n,r,s,c)=>{n.preventDefault(),n.stopPropagation(),t.value.resizingCol=r,t.value.startX=n.clientX,t.value.startWidth=r.width||r.minWidth||s(r.prop);const a=u=>{const{resizingCol:d,startX:k,startWidth:w}=t.value;if(!d)return;document.querySelectorAll(`[data-resizer="${d.prop}"]`).forEach(W=>{W.classList.add("vt-table__resizer--active")});const H=u.clientX-k,R=d.minWidth||50,Z=d.maxWidth||1e3,D=Math.max(Math.min(w+H,Z),R);d.width=D},i=()=>{const{resizingCol:u}=t.value;document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i),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")}),c&&u.width&&c(u.width)),t.value.resizingCol=null};document.addEventListener("mousemove",a),document.addEventListener("mouseup",i),document.body.style.cursor=o,document.body.style.userSelect="none",document.body.classList.add("vt-table-resizing")},resizeState:t}}function no(t,o,l,n){var F;const r=t.selectionKey||"id",s=e.ref([]),c=e.ref(null),a=e.ref(!1);(F=t.defaultSelection)!=null&&F.length&&(s.value=[...t.defaultSelection]);const i=p=>p[r],u=p=>a.value?!0:s.value.some(I=>i(I)===i(p)),d=e.computed(()=>o.value.filter(p=>u(p)).length),k=e.computed(()=>o.value.length>0&&d.value===o.value.length),w=e.computed(()=>{if(a.value)return!1;const p=d.value;return p>0&&p<o.value.length}),H=e.computed(()=>a.value?!0:k.value&&!w.value),R=e.computed(()=>a.value),Z=(p,I)=>{const M=i(p),A=s.value.some(v=>i(v)===i(p)),m=I!==void 0?I:!A;if(a.value&&!m){a.value=!1,n!=null&&n.value&&(s.value=n.value.filter(v=>i(v)!==M)),B(p,!1);return}a.value&&m||(m&&!A?s.value.push(p):!m&&A&&(s.value=s.value.filter(v=>i(v)!==M)),t.selectOnClickRow&&I===void 0&&P(m?p:null),B(p,m))},D=()=>{switch(W()){case"none":case"partial":y();break;case"allVisible":N();break;case"absoluteAll":V();break}},W=()=>a.value?"absoluteAll":k.value?"allVisible":d.value>0?"partial":"none",y=()=>{const p=[],I=new Set(s.value.map(M=>i(M)));s.value.forEach(M=>{p.push(M)}),o.value.forEach(M=>{I.has(i(M))||p.push(M)}),s.value=p,a.value=!1,B()},N=()=>{a.value=!0,n!=null&&n.value?s.value=[...n.value]:s.value=[...o.value],B(void 0,void 0,!0)},V=()=>{s.value=[],a.value=!1,c.value=null,B()},P=p=>{const I=c.value;c.value=p,l("current-change",{currentRow:c.value,oldCurrentRow:I})},b=()=>[...s.value],L=p=>{s.value=[...p],a.value=!1,B()},B=(p,I,M=!1)=>{const A={selection:[...s.value],row:p,selected:I,isAllSelected:M||a.value};l("selection-change",A)};return e.watch(()=>t.defaultSelection,p=>{p!=null&&p.length&&(s.value=[...p])}),{selectedRows:s,currentRow:c,isRowSelected:u,isAllSelected:H,isIndeterminate:w,isDoubleCheck:R,isFullSelection:a,toggleRowSelection:Z,toggleAllSelection:D,clearSelection:V,setCurrentRow:P,getSelectionRows:b,setSelectionRows:L,selectAbsolutelyAll:N}}function lo(t,o){if(!t)return String(o.value??"");try{const l=t(o);return l}catch(l){return console.error("Error rendering table slot:",l),String(o.value??"")}}const so=(t,o,l="asc")=>{if(t==null&&o==null)return 0;if(t==null)return l==="asc"?1:-1;if(o==null)return l==="asc"?-1:1;if(t===o)return 0;let n=0;const r=Number(t),s=Number(o);return!isNaN(r)&&!isNaN(s)?n=r-s:ue(t)&&ue(o)?n=new Date(t).getTime()-new Date(o).getTime():typeof t=="boolean"&&typeof o=="boolean"?n=t===o?0:t?-1:1:n=String(t).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"}),l==="desc"?-n:n},ue=t=>t instanceof Date?!isNaN(t.getTime()):typeof t=="string"&&/\d{4}-\d{2}-\d{2}|\//.test(t)?!isNaN(new Date(t).getTime()):!1,ro=(t,o,l)=>{t.sortable&&l({prop:t.prop,direction:o})},me=(t,o)=>{const l=(o==null?void 0:o.prop)===t.prop,n=o==null?void 0:o.direction;return{asc:["vt-th__sort-icon",l&&n==="asc"&&"vt-th__sortable-active"].filter(Boolean).join(" "),desc:["vt-th__sort-icon",l&&n==="desc"&&"vt-th__sortable-active"].filter(Boolean).join(" ")}},ao=(t,o,l)=>{if(!o)return[...t];const n=l.find(s=>s.prop===o.prop);if(!(n!=null&&n.sortable))return[...t];const r=n.sortMethod||so;return[...t].sort((s,c)=>{const a=s[n.prop],i=c[n.prop];return r(a,i,o.direction)})};class io{constructor(){this.modalStack=[],this.baseZIndex=1e3}open(o={}){const l=`modal-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,n=document.createElement("div");n.setAttribute("data-vt-modal",l),document.body.appendChild(n);const r=e.ref(!0),s=this.baseZIndex+this.modalStack.length*10,c=e.createApp({setup(){const i=()=>{r.value=!1,setTimeout(()=>{q.closeById(l)},100)};return()=>e.h(re,{modelValue:r.value,"onUpdate:modelValue":i,title:o.title,size:o.size||"medium",showCloseButton:o.showCloseButton!==!1,closeOnBackdropClick:o.closeOnBackdropClick!==!1,onClose:i,zIndex:s},{default:()=>o.component?e.h(o.component,o.props||{}):o.content?e.h("div",{innerHTML:o.content}):null})}});c.mount(n);const a={id:l,app:c,container:n,isOpen:r};return this.modalStack.push(a),l}close(){if(this.modalStack.length>0){const o=this.modalStack[this.modalStack.length-1];this.closeById(o.id)}}closeById(o){const l=this.modalStack.findIndex(n=>n.id===o);if(l!==-1){const n=this.modalStack[l];this.cleanupModal(n),this.modalStack.splice(l,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 q=new io,Ce={install(t){t.config.globalProperties.$modal=q,t.config.globalProperties.$modalStack={closeAll:()=>q.closeAll(),getCount:()=>q.getOpenModalsCount(),closeById:o=>q.closeById(o)}}},co={class:"vt-columns-selector-body"},uo={class:"vt-columns-selector"},mo={class:"vt-columns-selector__panel"},po=["draggable","onDragstart","onDragover","onDrop"],ho={key:0,class:"vt-columns-selector__panel-item-pinned"},vo={class:"vt-columns-selector__available"},fo=["onClick"],_o={key:0,class:"vt-columns-selector__group-columns"},go={key:0,class:"vt-columns-selector__pinned-note"},Co={class:"vt-modal__content-button"},ko=e.defineComponent({__name:"VTableColumnSelector",props:{columns:{},columnsSelector:{default:()=>[]}},emits:["update-columns"],setup(t,{emit:o}){const l=t,n=o,r=e.ref([]),s=e.ref(new Set),c=e.ref(-1),a=e.ref(-1),i=e.ref("before"),u=e.computed(()=>{const m={};return l.columnsSelector.forEach(v=>{if(v.name==="removed")return;const f=v.columns.map(S=>S.prop),C=r.value.filter(S=>f.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(()=>l.columnsSelector.filter(m=>m.name!=="removed")),k=m=>m.pinnedLeft||m.pinnedRight,w=m=>!k(m),H=()=>{const m=r.value;let v=-1;for(let C=0;C<m.length;C++)m[C].pinnedLeft&&(v=C);let f=m.length;for(let C=0;C<m.length;C++)if(m[C].pinnedRight){f=C;break}return{minIndex:v+1,maxIndex:f-1}},R=m=>{const v=H();return!(m<v.minIndex||m>v.maxIndex+1)},Z=(m,v)=>{const f=r.value[v];if(!w(f)){m.preventDefault();return}c.value=v,m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",f.prop)),document.body.style.cursor="grabbing"},D=(m,v)=>{if(c.value===-1)return;m.preventDefault();const f=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=f.top+f.height/2;let x=v,U="before";C<S?(x=v,U="before"):(x=v+1,U="after"),c.value<x&&x--,R(x)?(a.value=v,i.value=U,m.dataTransfer.dropEffect="move"):(a.value=-1,m.dataTransfer.dropEffect="none")},W=()=>{setTimeout(()=>{c.value===-1&&(a.value=-1)},50)},y=(m,v)=>{if(m.preventDefault(),c.value===-1||a.value===-1){V();return}const f=m.currentTarget.getBoundingClientRect(),C=m.clientY,S=f.top+f.height/2;let x=v;if(C>=S&&(x=v+1),c.value<x&&x--,!R(x)||x===c.value){V();return}const U=[...r.value],[ee]=U.splice(c.value,1);U.splice(x,0,ee),r.value=U,V()},N=()=>{V()},V=()=>{c.value=-1,a.value=-1,i.value="before",document.body.style.cursor=""},P=m=>{const v=["vt-columns-selector__panel-item"];return c.value===m&&v.push("vt-columns-selector__panel-item--dragging"),a.value===m&&i.value==="before"&&v.push("vt-columns-selector__panel-item--drop-before"),a.value===m&&i.value==="after"&&v.push("vt-columns-selector__panel-item--drop-after"),v},b=()=>{r.value=[...l.columns.map(m=>({...m}))],l.columnsSelector.forEach(m=>{m.name!=="removed"&&s.value.add(m.name)})},L=(m,v)=>{if(v)r.value.some(f=>f.prop===m.prop)||r.value.push({...m});else{if(k(m))return;r.value=r.value.filter(f=>f.prop!==m.prop)}},B=(m,v)=>{if(v)m.columns.forEach(f=>{r.value.some(C=>C.prop===f.prop)||r.value.push({...f})});else{const f=[];m.columns.forEach(C=>{const S=r.value.find(x=>x.prop===C.prop);S&&!k(S)&&f.push(S)}),r.value=r.value.filter(C=>!f.some(S=>S.prop===C.prop))}},F=m=>r.value.some(v=>v.prop===m.prop),p=m=>{const v=r.value.find(f=>f.prop===m.prop);return!v||!k(v)},I=m=>{s.value.has(m)?s.value.delete(m):s.value.add(m)},M=()=>{n("update-columns",[...r.value]),q.close()},A=()=>{q.close()};return e.onMounted(()=>{b()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",uo,[e.createElementVNode("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,C)=>(e.openBlock(),e.createElementBlock("div",{key:f.prop,class:e.normalizeClass(P(C)),draggable:w(f),onDragstart:S=>Z(S,C),onDragover:S=>D(S,C),onDragleave:W,onDrop:S=>y(S,C),onDragend:N},[e.createVNode(O,{name:w(f)?"columnsMove":"freeze",class:e.normalizeClass(["vt-columns-selector__panel-item-icon",{"vt-columns-selector__panel-item-icon--draggable":w(f)}])},null,8,["name","class"]),e.createVNode(K,{label:f.label,checked:!0,disabled:k(f),onChange:S=>L(f,S),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},null,8,["label","disabled","onChange"]),k(f)?(e.openBlock(),e.createElementBlock("span",ho,"pinned")):e.createCommentVNode("",!0)],42,po))),128))]),e.createElementVNode("div",vo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,f=>{var C,S;return e.openBlock(),e.createElementBlock("div",{key:f.name,class:"vt-columns-selector__group"},[e.createElementVNode("div",{class:"vt-columns-selector__group-header",onClick:x=>I(f.name)},[e.createVNode(K,{label:f.label,checked:((C=u.value[f.name])==null?void 0:C.checked)||!1,indeterminate:((S=u.value[f.name])==null?void 0:S.indeterminate)||!1,onChange:x=>B(f,x),onClick:v[1]||(v[1]=e.withModifiers(()=>{},["stop"]))},null,8,["label","checked","indeterminate","onChange"]),f.icon?(e.openBlock(),e.createBlock(O,{key:0,name:f.icon,class:"vt-columns-selector__group-icon"},null,8,["name"])):e.createCommentVNode("",!0)],8,fo),s.value.has(f.name)?(e.openBlock(),e.createElementBlock("div",_o,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.columns,x=>(e.openBlock(),e.createElementBlock("div",{key:x.prop,class:"vt-columns-selector__group-column"},[e.createVNode(K,{label:x.label,checked:F(x),disabled:!p(x),onChange:U=>L(x,U)},null,8,["label","checked","disabled","onChange"]),p(x)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",go," (закріплена) "))]))),128))])):e.createCommentVNode("",!0)])}),128))])]),e.createElementVNode("div",Co,[e.createVNode(J,{onClick:A},{default:e.withCtx(()=>v[2]||(v[2]=[e.createTextVNode("Скасувати",-1)])),_:1,__:[2]}),e.createVNode(J,{type:"primary",onClick:M},{default:e.withCtx(()=>v[3]||(v[3]=[e.createTextVNode("Зберегти",-1)])),_:1,__:[3]})])]))}}),bo=e.defineComponent({__name:"ColumnActions",props:{column:{},allColumns:{},columnsSelector:{}},emits:["pin","update-columns"],setup(t,{emit:o}){const l=t,n=o,r=e.ref(),s=e.ref(),c=e.ref(),a=e.ref(!1),i=e.ref(!1),u=e.ref([]),d=async()=>{if(await e.nextTick(),!r.value||!s.value)return;const b=s.value.getBoundingClientRect(),L=r.value,B=L.offsetWidth,F=b.left+b.width/2;L.style.top=`${b.bottom-20}px`,L.style.left=`${F-B/2}px`;const p=L.getBoundingClientRect();p.right>window.innerWidth&&(L.style.left=`${window.innerWidth-B-8}px`),p.left<0&&(L.style.left="8px")},k=b=>{b.stopPropagation(),!i.value&&(a.value?H():w())},w=()=>{i.value||(a.value=!0,d(),c.value&&(c.value.style.zIndex="22"))},H=()=>{i.value=!0,a.value=!1,c.value&&c.value.style.removeProperty("z-index"),setTimeout(()=>{i.value=!1},100)},R=b=>{var L,B;!((L=s.value)!=null&&L.contains(b.target))&&!((B=r.value)!=null&&B.contains(b.target))&&H()},Z=()=>{P()?(n("pin",l.column,"none"),console.log(`Колонка "${l.column.label}" відкріплена`)):(n("pin",l.column,"left"),console.log(`Колонка "${l.column.label}" прикріплена зліва`)),H()},D=b=>({name:"removed",label:"Видалені колонки",order:999,columns:b}),W=b=>{var I;const L=new Set(b.map(M=>M.prop)),B=new Set;(I=l.columnsSelector)==null||I.forEach(M=>{M.columns.forEach(A=>B.add(A.prop))}),l.allColumns.forEach(M=>B.add(M.prop));const F=[];B.forEach(M=>{var A;if(!L.has(M)){let m;(A=l.columnsSelector)==null||A.forEach(v=>{const f=v.columns.find(C=>C.prop===M);f&&(m=f)}),m||(m=l.allColumns.find(v=>v.prop===M)),m&&F.push(m)}});const p=[...l.columnsSelector||[]];F.length>0&&p.push(D(F)),u.value=p},y=()=>{W(l.allColumns),q.open({component:ko,title:"Управління колонками таблиці",props:{columns:l.allColumns,columnsSelector:u.value,"onUpdate-columns":b=>{console.log("ColumnActions отримав оновлені колонки:",b),n("update-columns",b),W(b)}},size:"large",closeOnBackdropClick:!1}),H()},N=()=>l.column.pinnedLeft,V=()=>l.column.pinnedRight,P=()=>N()||V();return e.onMounted(()=>{document.addEventListener("click",R),s.value&&(c.value=s.value.closest("th")),W(l.allColumns)}),e.onUnmounted(()=>{document.removeEventListener("click",R)}),(b,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"triggerRef",ref:s,class:"vt-table-header-actions",onClick:k},[e.createVNode(O,{name:"listBullet"}),a.value?(e.openBlock(),e.createElementBlock("ul",{key:0,ref_key:"menuRef",ref:r,class:e.normalizeClass(["dropdown-menu","vt-table-dropdown",{visible:a.value}])},[e.createElementVNode("li",{onClick:Z},[e.createVNode(O,{name:P()?"unfreeze":"freeze"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(P()?"Розморозити":"Заморозити"),1)]),e.createElementVNode("li",{onClick:y},[e.createVNode(O,{name:"columnInsert"}),L[0]||(L[0]=e.createElementVNode("span",null,"Колонки",-1))])],2)):e.createCommentVNode("",!0)],512))}}),wo={class:"vt-table"},yo={class:"vt-th__content"},Bo={class:"vt-th__content"},xo={class:"vt-th__label"},Eo={key:0,class:"vt-th__sortable"},So=["data-resizer","onMousedown"],Vo={key:0,class:"vt-table__empty-row"},Mo=["colspan"],$o={class:"vt-table__empty-content"},Lo=["onClick"],No={class:"vt-table__cell-content"},zo={class:"vt-table__cell-content vt-table__cell-content--ellipsis"},Io={key:1},To=["data-resizer","onMousedown"],Ro={key:0,class:"vt-table__summary"},Wo={class:"vt-table__cell-content vt-table__cell-content--summary"},ne=50,ke=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","infinity-scroll"],["update:columns"]),setup(t,{expose:o,emit:l}){const n=t,r=e.useModel(t,"columns"),s=l,c=e.ref({}),a=e.ref(),i=e.reactive([]),u=e.ref(n.defaultSort||null),d=e.computed(()=>r.value!==void 0),k=e.computed(()=>n.data&&n.data.length>0),w=e.ref(!1),H=e.ref(0);let R=null;const Z=()=>{d.value&&r.value?i.splice(0,i.length,...r.value):n.columns&&i.splice(0,i.length,...n.columns)};e.watch(()=>r.value,h=>{h&&d.value&&i.splice(0,i.length,...h)},{deep:!0}),e.watch(()=>n.columns,h=>{h&&!d.value&&i.splice(0,i.length,...h)},{deep:!0}),e.provide("vt-table-columns",i);const{sortedColumns:D,getDefaultColumnWidth:W,getStickyOffset:y}=eo(i),{getTableWrapperStyle:N,getColumnStyle:V,getHeaderStyle:P,getFooterStyle:b}=to(n),{onMouseDown:L}=oo(),B=e.computed(()=>ao(n.data,u.value,i)),F=e.computed(()=>n.allData||n.data),p=n.selectable?no(n,B,s,F):null,I=()=>({width:`${ne}px`,minWidth:`${ne}px`,maxWidth:`${ne}px`,left:"0px",position:"sticky",zIndex:10}),M=()=>{const h=I();return n.maxHeight?{...h,top:"0px",zIndex:11}:h},A=()=>{const h=I();return n.maxHeight?{...h,bottom:"0px",zIndex:11}:h},m=()=>{if(!a.value||w.value)return;const h=a.value,_=h.scrollTop,E=h.scrollHeight,$=h.clientHeight,z=30;R&&clearTimeout(R),R=setTimeout(()=>{const Q=_-H.value>1,g=E-_-$<=z,G=E-_-$<=5;H.value=_,Q&&(g||G)&&(w.value=!0,s("infinity-scroll"),setTimeout(()=>{w.value=!1},1e3))},50)},v=()=>{w.value=!1};e.onMounted(()=>{a.value&&a.value.addEventListener("scroll",m)}),e.onUnmounted(()=>{R&&clearTimeout(R),a.value&&a.value.removeEventListener("scroll",m)});const f=(h,_)=>{ro(h,_,E=>{var $,z;(($=u.value)==null?void 0:$.prop)===h.prop&&u.value.direction===_?u.value=null:u.value=E,s("sort-change",{column:h,direction:((z=u.value)==null?void 0:z.direction)||null,prop:h.prop,sortedData:B.value})})},C=(h,_)=>{const E={pinnedLeft:_==="left",pinnedRight:_==="right"};x(h.prop,E),s("column-pin",{column:{...h,...E},position:_})},S=h=>{i.splice(0,i.length,...h),d.value&&(r.value=[...h]),s("columns-change",[...h])},x=(h,_)=>{const E=i.findIndex($=>$.prop===h);if(E!==-1){if(Object.assign(i[E],_),d.value&&r.value){const $=r.value.findIndex(z=>z.prop===h);if($!==-1){const z=[...r.value];z[$]={...z[$],..._},r.value=z}}s("columns-change",[...i])}else console.error("Колонку не знайдено:",h,"Доступні колонки:",i.map($=>$.prop))},U=(h,_,E)=>{s("row-click",{row:h,column:_,event:E}),n.highlightCurrentRow&&p&&p.setCurrentRow(h)},ee=(h,_,E)=>{E.stopPropagation(),p&&p.toggleRowSelection(_,h)},Be=(h,_)=>{_.stopPropagation(),p&&p.toggleAllSelection()},ae=(h,_)=>{h&&(c.value[_]=h)},ie=(h,_)=>{const E=_.width||W();L(h,_,W,$=>{x(_.prop,{width:$}),s("column-resize",{column:{..._,width:$},width:$,oldWidth:E})})},xe=(h,_)=>V(h,_,y,W),Ee=(h,_)=>P(h,_,y,W),Se=(h,_)=>b(h,_,y,W),Ve=(h,_)=>{if(!_||!_.prop)return"";const E=h[_.prop];return E==null?"":String(E)},Me=e.computed(()=>{if(!n.showSummary||!k.value)return{};const h=i;if(typeof n.summaryMethod=="function"){const _=n.summaryMethod({columns:h,data:B.value});return h.reduce((E,$,z)=>(E[$.prop]=_[z],E),{})}return h.reduce((_,E)=>{const $=B.value.map(z=>z[E.prop]);return _[E.prop]=$.every(z=>typeof z=="number")?$.reduce((z,Y)=>z+Y,0):"",_},{})}),$e=e.computed(()=>n.showSummary&&k.value),Le=(h,_)=>{p&&p.toggleRowSelection(h,_)},Ne=()=>{p&&p.toggleAllSelection()},ze=()=>{p&&p.selectAbsolutelyAll()},Ie=()=>{p&&p.clearSelection()},Te=()=>p?p.getSelectionRows():[],Re=h=>{p&&p.setSelectionRows(h)};return e.onMounted(()=>{Z()}),o({toggleRowSelection:Le,toggleAllSelection:Ne,selectAbsolutelyAll:ze,clearSelection:Ie,getSelectionRows:Te,setSelectionRows:Re,resetInfinityScroll:v}),(h,_)=>{var $,z,Y,Q;const E=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{ref_key:"tableWrapperRef",ref:a,class:"vt-table-wrapper",style:e.normalizeStyle(e.unref(N)()),onScroll:m},[e.renderSlot(h.$slots,"default"),e.createElementVNode("table",wo,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[n.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["vt-table__th vt-table__th--selection",{"vt-table__th--sticky":n.maxHeight,"vt-table__th--pinned-left":!0}]),style:e.normalizeStyle(M())},[e.createElementVNode("div",yo,[e.createVNode(K,{checked:($=e.unref(p))==null?void 0:$.isAllSelected.value,indeterminate:(z=e.unref(p))==null?void 0:z.isIndeterminate.value,"is-double":(Q=(Y=e.unref(p))==null?void 0:Y.isDoubleCheck)==null?void 0:Q.value,onChange:Be},null,8,["checked","indeterminate","is-double"])])],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),(g,G)=>(e.openBlock(),e.createElementBlock("th",{key:g.prop,ref_for:!0,ref:X=>ae(X,g.prop),style:e.normalizeStyle(Ee(g,G)),class:e.normalizeClass(["vt-table__th",{"vt-table__th--sticky":n.maxHeight,"vt-table__th--pinned-left":g.pinnedLeft,"vt-table__th--pinned-right":g.pinnedRight,"vt-table__th--sortable":g.sortable}])},[e.createElementVNode("div",Bo,[e.createElementVNode("div",xo,e.toDisplayString(g.label),1),g.sortable?(e.openBlock(),e.createElementBlock("div",Eo,[e.createVNode(O,{name:"arrowTop",class:e.normalizeClass(e.unref(me)(g,u.value).asc),onClick:e.withModifiers(X=>f(g,"asc"),["stop"])},null,8,["class","onClick"]),e.createVNode(O,{name:"arrowDown",class:e.normalizeClass(e.unref(me)(g,u.value).desc),onClick:e.withModifiers(X=>f(g,"desc"),["stop"])},null,8,["class","onClick"])])):e.createCommentVNode("",!0),g.actionColumn?(e.openBlock(),e.createBlock(bo,{key:1,column:g,"all-columns":e.unref(D),columnsSelector:n.columnsSelector,onPin:C,onUpdateColumns:S},null,8,["column","all-columns","columnsSelector"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":g.prop,onMousedown:X=>ie(X,g)},null,40,So)],6))),128))])]),e.createElementVNode("tbody",null,[k.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,(g,G)=>{var X,ce,de;return e.openBlock(),e.createElementBlock("tr",{key:g.id,class:e.normalizeClass(["vt-table__row",{"vt-table__row--selected":(X=e.unref(p))==null?void 0:X.isRowSelected(g),"vt-table__row--current":((ce=e.unref(p))==null?void 0:ce.currentRow.value)===g,"vt-table__row--clickable":n.selectOnClickRow||n.highlightCurrentRow}]),onClick:T=>U(g,e.unref(D)[0],T)},[n.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(I())},[e.createElementVNode("div",No,[e.createVNode(K,{checked:(de=e.unref(p))==null?void 0:de.isRowSelected(g),onChange:(T,te)=>ee(T,g,te)},null,8,["checked","onChange"])])],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),(T,te)=>(e.openBlock(),e.createElementBlock("td",{key:T.prop,ref_for:!0,ref:oe=>ae(oe,T.prop),style:e.normalizeStyle(xe(T,te)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":T.pinnedLeft,"vt-table__td--pinned-right":T.pinnedRight}])},[e.withDirectives((e.openBlock(),e.createElementBlock("div",zo,[T.renderSlot?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(()=>e.unref(lo)(T.renderSlot,{row:g,column:T,value:g[T.prop],index:G})),{key:0})):(e.openBlock(),e.createElementBlock("span",Io,e.toDisplayString(g[T.prop]),1))])),[[E,T.showOverflowTooltip?Ve(g,T):null]]),e.createElementVNode("div",{class:"vt-table__resizer","data-resizer":T.prop,onMousedown:oe=>ie(oe,T)},null,40,To)],6))),128))],10,Lo)}),128)):(e.openBlock(),e.createElementBlock("tr",Vo,[e.createElementVNode("td",{colspan:e.unref(D).length+(n.selectable?1:0),class:"vt-table__empty-cell"},[e.createElementVNode("div",$o,[e.createVNode(O,{name:"empty",class:"vt-table__empty-icon"}),_[0]||(_[0]=e.createElementVNode("span",{class:"vt-table__empty-text"},"Немає даних!",-1))])],8,Mo)]))]),$e.value?(e.openBlock(),e.createElementBlock("tfoot",Ro,[e.createElementVNode("tr",null,[n.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":!0}]),style:e.normalizeStyle(A())},_[1]||(_[1]=[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(D),(g,G)=>(e.openBlock(),e.createElementBlock("td",{key:g.prop,style:e.normalizeStyle(Se(g,G)),class:e.normalizeClass(["vt-table__td",{"vt-table__td--pinned-left":g.pinnedLeft,"vt-table__td--pinned-right":g.pinnedRight}])},[e.createElementVNode("div",Wo,e.toDisplayString(Me.value[g.prop]),1)],6))),128))])])):e.createCommentVNode("",!0)])],36)}}}),be=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,l=e.useSlots(),n=e.inject("vt-table-columns");n||console.error("VTableColumn: не знайдено контекст таблиці. Переконайтеся, що компонент використовується всередині VTable.");const r=()=>({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:l[o.prop]??l.default??l.slot});let s=-1;return e.onMounted(()=>{if(n){const c=r();n.push(c),s=n.length-1}}),e.watch(()=>[o.width,o.minWidth,o.maxWidth,o.sortable,o.pinnedLeft,o.pinnedRight,o.actionColumn,o.showOverflowTooltip,o.selectable,o.label],()=>{if(n&&s!==-1){const c=n.findIndex(a=>a.prop===o.prop);if(c!==-1){const a=n[c],i={...r(),renderSlot:a.renderSlot};n[c]=i}}},{deep:!0}),e.onUnmounted(()=>{if(n){const c=n.findIndex(a=>a.prop===o.prop);c>-1&&n.splice(c,1)}}),(c,a)=>null}}),pe=(t,o)=>{const l=document.createElement("div");l.className=`vt-tooltip vt-tooltip--${o}`,l.innerText=t,Object.assign(l.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&&(l.style.whiteSpace="nowrap");const n=document.createElement("div");switch(n.className="vt-tooltip__arrow",Object.assign(n.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),o){case"top":Object.assign(n.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(n.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(n.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(n.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return l.appendChild(n),l},le=(t,o,l)=>{const n=o.getBoundingClientRect(),r=t.getBoundingClientRect(),s=window.pageXOffset||document.documentElement.scrollLeft,c=window.pageYOffset||document.documentElement.scrollTop;let a=0,i=0;switch(l){case"top":a=n.top+c-r.height-8,i=n.left+s+(n.width-r.width)/2;break;case"bottom":a=n.bottom+c+8,i=n.left+s+(n.width-r.width)/2;break;case"left":a=n.top+c+(n.height-r.height)/2,i=n.left+s-r.width-8;break;case"right":a=n.top+c+(n.height-r.height)/2,i=n.right+s+8;break}const u=window.innerWidth,d=window.innerHeight;i<8?i=8:i+r.width>u-8&&(i=u-r.width-8),a<c+8?l==="top"?a=n.bottom+c+8:a=c+8:a+r.height>c+d-8&&(l==="bottom"?a=n.top+c-r.height-8:a=c+d-r.height-8),t.style.top=`${a}px`,t.style.left=`${i}px`},he=(t,o,l)=>{t.parentElement||document.body.appendChild(t),t.style.visibility="visible",le(t,o,l),requestAnimationFrame(()=>{t.style.opacity="1"})},ve=t=>{t.style.opacity="0",t.style.visibility="hidden"},fe=t=>t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight,_e=t=>!!t.closest(".vt-table, table"),we={mounted(t,o){var i;const l=(i=o.value)==null?void 0:i.trim();if(!l)return;const n=t.dataset.placement||"top",r=pe(l,n);t.__tooltipEl=r;const s=()=>{(_e(t)?fe(t):!0)&&he(r,t,n)},c=()=>{ve(r)},a=()=>{r.style.opacity==="1"&&le(r,t,n)};t.__mouseenterHandler=s,t.__mouseleaveHandler=c,t.__scrollHandler=a,t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",c),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a)},updated(t,o){var n;const l=(n=o.value)==null?void 0:n.trim();if(t.__tooltipEl)l?t.__tooltipEl.firstChild.textContent=l:(t.__tooltipEl.parentElement&&t.__tooltipEl.parentElement.removeChild(t.__tooltipEl),delete t.__tooltipEl);else if(l){const r=t.dataset.placement||"top",s=pe(l,r);t.__tooltipEl=s;const c=()=>{(_e(t)?fe(t):!0)&&he(s,t,r)},a=()=>{ve(s)},i=()=>{s.style.opacity==="1"&&le(s,t,r)};t.__mouseenterHandler=c,t.__mouseleaveHandler=a,t.__scrollHandler=i,t.addEventListener("mouseenter",c),t.addEventListener("mouseleave",a),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)}},ye={install(t,o={}){const{prefix:l="V",modal:n=!0}=o;t.component(`${l}Button`,J),t.component(`${l}Icon`,O),t.component(`${l}Loader`,se),t.component(`${l}Modal`,re),t.component(`${l}Pagination`,ge),t.component(`${l}Checkbox`,K),t.component(`${l}Table`,ke),t.component(`${l}TableColumn`,be),t.directive("tooltip",we),n&&t.use(Ce)}},Do=ye.install;exports.VButton=J;exports.VCheckbox=K;exports.VIcon=O;exports.VLoader=se;exports.VModal=re;exports.VModalPlugin=Ce;exports.VPagination=ge;exports.VTable=ke;exports.VTableColumn=be;exports.default=ye;exports.install=Do;exports.modalManager=q;exports.tooltipDirective=we;
package/dist/index.d.ts CHANGED
@@ -54,6 +54,24 @@ declare const __VLS_component_3: DefineComponent<VCheckboxProps, {}, {}, {}, {},
54
54
  isDouble: boolean;
55
55
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLLabelElement>;
56
56
 
57
+ declare const __VLS_component_4: DefineComponent<__VLS_PublicProps, {
58
+ toggleRowSelection: (row: Record<string, any>, selected?: boolean) => void;
59
+ toggleAllSelection: () => void;
60
+ selectAbsolutelyAll: () => void;
61
+ clearSelection: () => void;
62
+ getSelectionRows: () => Record<string, any>[];
63
+ setSelectionRows: (rows: Record<string, any>[]) => void;
64
+ resetInfinityScroll: () => void;
65
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
66
+ [x: string]: any;
67
+ } & {
68
+ [x: string]: any;
69
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
70
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
71
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
72
+ tableWrapperRef: HTMLDivElement;
73
+ }, HTMLDivElement>;
74
+
57
75
  declare type __VLS_Props = {
58
76
  name: IconName;
59
77
  };
@@ -92,12 +110,25 @@ declare function __VLS_template_3(): {
92
110
  rootEl: HTMLLabelElement;
93
111
  };
94
112
 
113
+ declare function __VLS_template_4(): {
114
+ attrs: Partial<{}>;
115
+ slots: {
116
+ default?(_: {}): any;
117
+ };
118
+ refs: {
119
+ tableWrapperRef: HTMLDivElement;
120
+ };
121
+ rootEl: HTMLDivElement;
122
+ };
123
+
95
124
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
96
125
 
97
126
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
98
127
 
99
128
  declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
100
129
 
130
+ declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
131
+
101
132
  declare type __VLS_WithTemplateSlots<T, S> = T & {
102
133
  new (): {
103
134
  $slots: S;
@@ -116,6 +147,12 @@ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
116
147
  };
117
148
  };
118
149
 
150
+ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
151
+ new (): {
152
+ $slots: S;
153
+ };
154
+ };
155
+
119
156
  export declare const DEFAULT_COLUMN_CONFIG: {
120
157
  sortable: boolean;
121
158
  actionColumn: boolean;
@@ -369,23 +406,7 @@ export declare const VPagination: DefineComponent<PaginationProps, {}, {}, {}, {
369
406
  maxVisiblePages: number;
370
407
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
371
408
 
372
- export declare const VTable: DefineComponent<__VLS_PublicProps, {
373
- toggleRowSelection: (row: Record<string, any>, selected?: boolean) => void;
374
- toggleAllSelection: () => void;
375
- selectAbsolutelyAll: () => void;
376
- clearSelection: () => void;
377
- getSelectionRows: () => Record<string, any>[];
378
- setSelectionRows: (rows: Record<string, any>[]) => void;
379
- resetInfinityScroll: () => void;
380
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
381
- [x: string]: any;
382
- } & {
383
- [x: string]: any;
384
- }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
385
- [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
386
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
387
- tableWrapperRef: HTMLDivElement;
388
- }, HTMLDivElement>;
409
+ export declare const VTable: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
389
410
 
390
411
  export declare const VTableColumn: DefineComponent<VTableColumnProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VTableColumnProps> & Readonly<{}>, {
391
412
  sortable: boolean;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createElementBlock as f, openBlock as p, createElementVNode as _, defineComponent as le, computed as x, createBlock as re, createCommentVNode as H, resolveDynamicComponent as Ae, useSlots as Oe, resolveDirective as je, withDirectives as Me, normalizeClass as W, renderSlot as fe, Teleport as lt, normalizeStyle as ie, withModifiers as pe, toDisplayString as te, watch as me, Fragment as ne, renderList as oe, vModelSelect as st, createVNode as Z, withCtx as xe, createTextVNode as _e, ref as D, createApp as it, h as ke, onMounted as he, onUnmounted as $e, nextTick as at, mergeModels as Te, useModel as rt, reactive as ct, provide as ut, unref as U, inject as dt } from "vue";
1
+ import { createElementBlock as f, openBlock as p, createElementVNode as _, defineComponent as le, computed as x, createBlock as re, createCommentVNode as H, resolveDynamicComponent as Ae, useSlots as Oe, resolveDirective as je, withDirectives as Me, normalizeClass as W, renderSlot as pe, Teleport as lt, normalizeStyle as ie, withModifiers as me, toDisplayString as te, watch as he, Fragment as ne, renderList as oe, vModelSelect as st, createVNode as Z, withCtx as xe, createTextVNode as _e, ref as D, createApp as it, h as ke, onMounted as ve, onUnmounted as $e, nextTick as at, mergeModels as Te, useModel as rt, reactive as ct, provide as ut, unref as U, inject as dt } from "vue";
2
2
  const K = (e, t) => {
3
3
  const o = e.__vccOpts || e;
4
4
  for (const [n, s] of t)
@@ -338,7 +338,7 @@ const Ne = /* @__PURE__ */ K(pn, [["render", hn]]), vn = ["disabled", "type", "d
338
338
  class: "vt-button__icon"
339
339
  }, null, 8, ["name"])) : H("", !0),
340
340
  l.value ? H("", !0) : (p(), f("span", fn, [
341
- fe(c.$slots, "default")
341
+ pe(c.$slots, "default")
342
342
  ]))
343
343
  ], 10, vn)), [
344
344
  [S, a.value]
@@ -379,7 +379,7 @@ const Ne = /* @__PURE__ */ K(pn, [["render", hn]]), vn = ["disabled", "type", "d
379
379
  }, [
380
380
  _("div", {
381
381
  class: W(s.value),
382
- onClick: u[0] || (u[0] = pe(() => {
382
+ onClick: u[0] || (u[0] = me(() => {
383
383
  }, ["stop"]))
384
384
  }, [
385
385
  a.title || a.showCloseButton ? (p(), f("div", _n, [
@@ -392,7 +392,7 @@ const Ne = /* @__PURE__ */ K(pn, [["render", hn]]), vn = ["disabled", "type", "d
392
392
  })) : H("", !0)
393
393
  ])) : H("", !0),
394
394
  _("div", Cn, [
395
- fe(a.$slots, "default")
395
+ pe(a.$slots, "default")
396
396
  ])
397
397
  ], 2)
398
398
  ], 4)) : H("", !0)
@@ -445,7 +445,7 @@ const Ne = /* @__PURE__ */ K(pn, [["render", hn]]), vn = ["disabled", "type", "d
445
445
  }, N = () => {
446
446
  n("reloadData", s.value);
447
447
  };
448
- return me(
448
+ return he(
449
449
  () => o.totalItems,
450
450
  () => {
451
451
  s.value > r.value && r.value > 0 && (s.value = r.value, S());
@@ -646,8 +646,8 @@ const Ne = /* @__PURE__ */ K(pn, [["render", hn]]), vn = ["disabled", "type", "d
646
646
  }
647
647
  ])
648
648
  }, [
649
- fe(c.$slots, "label", {}, () => [
650
- fe(c.$slots, "default", {}, () => [
649
+ pe(c.$slots, "label", {}, () => [
650
+ pe(c.$slots, "default", {}, () => [
651
651
  _e(te(c.label), 1)
652
652
  ])
653
653
  ])
@@ -796,7 +796,7 @@ function En(e, t, o, n) {
796
796
  };
797
797
  o("selection-change", G);
798
798
  };
799
- return me(
799
+ return he(
800
800
  () => e.defaultSelection,
801
801
  (m) => {
802
802
  m != null && m.length && (l.value = [...m]);
@@ -1053,7 +1053,7 @@ const ae = new Dn(), An = {
1053
1053
  }, G = () => {
1054
1054
  ae.close();
1055
1055
  };
1056
- return he(() => {
1056
+ return ve(() => {
1057
1057
  y();
1058
1058
  }), (d, v) => (p(), f("div", On, [
1059
1059
  _("div", jn, [
@@ -1077,7 +1077,7 @@ const ae = new Dn(), An = {
1077
1077
  checked: !0,
1078
1078
  disabled: k(g),
1079
1079
  onChange: (B) => E(g, B),
1080
- onClick: v[0] || (v[0] = pe(() => {
1080
+ onClick: v[0] || (v[0] = me(() => {
1081
1081
  }, ["stop"]))
1082
1082
  }, null, 8, ["label", "disabled", "onChange"]),
1083
1083
  k(g) ? (p(), f("span", Fn, "pinned")) : H("", !0)
@@ -1099,7 +1099,7 @@ const ae = new Dn(), An = {
1099
1099
  checked: ((w = u.value[g.name]) == null ? void 0 : w.checked) || !1,
1100
1100
  indeterminate: ((B = u.value[g.name]) == null ? void 0 : B.indeterminate) || !1,
1101
1101
  onChange: (L) => $(g, L),
1102
- onClick: v[1] || (v[1] = pe(() => {
1102
+ onClick: v[1] || (v[1] = me(() => {
1103
1103
  }, ["stop"]))
1104
1104
  }, null, 8, ["label", "checked", "indeterminate", "onChange"]),
1105
1105
  g.icon ? (p(), re(Y, {
@@ -1217,7 +1217,7 @@ const ae = new Dn(), An = {
1217
1217
  closeOnBackdropClick: !1
1218
1218
  }), q();
1219
1219
  }, V = () => o.column.pinnedLeft, R = () => o.column.pinnedRight, X = () => V() || R();
1220
- return he(() => {
1220
+ return ve(() => {
1221
1221
  document.addEventListener("click", j), l.value && (r.value = l.value.closest("th")), N(o.allColumns);
1222
1222
  }), $e(() => {
1223
1223
  document.removeEventListener("click", j);
@@ -1283,13 +1283,13 @@ const ae = new Dn(), An = {
1283
1283
  const Q = () => {
1284
1284
  c.value && s.value ? a.splice(0, a.length, ...s.value) : n.columns && a.splice(0, a.length, ...n.columns);
1285
1285
  };
1286
- me(
1286
+ he(
1287
1287
  () => s.value,
1288
1288
  (h) => {
1289
1289
  h && c.value && a.splice(0, a.length, ...h);
1290
1290
  },
1291
1291
  { deep: !0 }
1292
- ), me(
1292
+ ), he(
1293
1293
  () => n.columns,
1294
1294
  (h) => {
1295
1295
  h && !c.value && a.splice(0, a.length, ...h);
@@ -1323,15 +1323,15 @@ const ae = new Dn(), An = {
1323
1323
  if (!i.value || S.value) return;
1324
1324
  const h = i.value, C = h.scrollTop, I = h.scrollHeight, z = h.clientHeight, P = 30;
1325
1325
  j && clearTimeout(j), j = setTimeout(() => {
1326
- const ve = C - q.value > 1, b = I - C - z <= P, ce = I - C - z <= 5;
1327
- q.value = C, ve && (b || ce) && (S.value = !0, l("infinity-scroll"), setTimeout(() => {
1326
+ const fe = C - q.value > 1, b = I - C - z <= P, ce = I - C - z <= 5;
1327
+ q.value = C, fe && (b || ce) && (S.value = !0, l("infinity-scroll"), setTimeout(() => {
1328
1328
  S.value = !1;
1329
1329
  }, 1e3));
1330
1330
  }, 50);
1331
1331
  }, v = () => {
1332
1332
  S.value = !1;
1333
1333
  };
1334
- he(() => {
1334
+ ve(() => {
1335
1335
  i.value && i.value.addEventListener("scroll", d);
1336
1336
  }), $e(() => {
1337
1337
  j && clearTimeout(j), i.value && i.value.removeEventListener("scroll", d);
@@ -1421,7 +1421,7 @@ const ae = new Dn(), An = {
1421
1421
  }, nt = () => m ? m.getSelectionRows() : [], ot = (h) => {
1422
1422
  m && m.setSelectionRows(h);
1423
1423
  };
1424
- return he(() => {
1424
+ return ve(() => {
1425
1425
  Q();
1426
1426
  }), t({
1427
1427
  toggleRowSelection: Je,
@@ -1433,7 +1433,7 @@ const ae = new Dn(), An = {
1433
1433
  resetInfinityScroll: v
1434
1434
  // Додаємо метод для скидання infinity scroll
1435
1435
  }), (h, C) => {
1436
- var z, P, de, ve;
1436
+ var z, P, de, fe;
1437
1437
  const I = je("tooltip");
1438
1438
  return p(), f("div", {
1439
1439
  ref_key: "tableWrapperRef",
@@ -1442,6 +1442,7 @@ const ae = new Dn(), An = {
1442
1442
  style: ie(U(V)()),
1443
1443
  onScroll: d
1444
1444
  }, [
1445
+ pe(h.$slots, "default"),
1445
1446
  _("table", Qn, [
1446
1447
  _("thead", null, [
1447
1448
  _("tr", null, [
@@ -1457,7 +1458,7 @@ const ae = new Dn(), An = {
1457
1458
  Z(ue, {
1458
1459
  checked: (z = U(m)) == null ? void 0 : z.isAllSelected.value,
1459
1460
  indeterminate: (P = U(m)) == null ? void 0 : P.isIndeterminate.value,
1460
- "is-double": (ve = (de = U(m)) == null ? void 0 : de.isDoubleCheck) == null ? void 0 : ve.value,
1461
+ "is-double": (fe = (de = U(m)) == null ? void 0 : de.isDoubleCheck) == null ? void 0 : fe.value,
1461
1462
  onChange: Fe
1462
1463
  }, null, 8, ["checked", "indeterminate", "is-double"])
1463
1464
  ])
@@ -1483,12 +1484,12 @@ const ae = new Dn(), An = {
1483
1484
  Z(Y, {
1484
1485
  name: "arrowTop",
1485
1486
  class: W(U(Ee)(b, u.value).asc),
1486
- onClick: pe((se) => g(b, "asc"), ["stop"])
1487
+ onClick: me((se) => g(b, "asc"), ["stop"])
1487
1488
  }, null, 8, ["class", "onClick"]),
1488
1489
  Z(Y, {
1489
1490
  name: "arrowDown",
1490
1491
  class: W(U(Ee)(b, u.value).desc),
1491
- onClick: pe((se) => g(b, "desc"), ["stop"])
1492
+ onClick: me((se) => g(b, "desc"), ["stop"])
1492
1493
  }, null, 8, ["class", "onClick"])
1493
1494
  ])) : H("", !0),
1494
1495
  b.actionColumn ? (p(), re(Jn, {
@@ -1645,12 +1646,12 @@ const ae = new Dn(), An = {
1645
1646
  renderSlot: o[t.prop] ?? o.default ?? o.slot
1646
1647
  });
1647
1648
  let l = -1;
1648
- return he(() => {
1649
+ return ve(() => {
1649
1650
  if (n) {
1650
1651
  const r = s();
1651
1652
  n.push(r), l = n.length - 1;
1652
1653
  }
1653
- }), me(
1654
+ }), he(
1654
1655
  () => [
1655
1656
  t.width,
1656
1657
  t.minWidth,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "voiptime-components",
3
3
  "private": false,
4
- "version": "0.0.18",
4
+ "version": "0.0.20",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",