dolphin-components 2.2.8 → 2.2.9

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.
@@ -8034,7 +8034,7 @@ Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.ad
8034
8034
  ${R}
8035
8035
  </div>
8036
8036
  </div>
8037
- `}else return""},cellClick:w}),v=()=>{const I=document.getElementById(a.value);I&&(d.value=i.columns.map(z=>z.field),S(),p=new xT(I,{data:i.data,columns:u.value,placeholder:i.placeholder??"No records found!",pagination:!0,paginationSize:h.value,paginationSizeSelector:i.paginationSizeSelector,layout:"fitColumns",height:window.innerHeight-i.heightOffset}),p.on("rowClick",k))},k=(I,z)=>{const R=document.querySelector(".action-show");if(I.target.closest(`.action-btn-${a.value}`)||R==null||R.classList.remove("action-show"),i.action){I.preventDefault();const P=document.querySelector(".datarow-selected");P==null||P.classList.remove("datarow-selected"),z.getElement().classList.add("datarow-selected")}},m=c.computed(()=>i.action?i.actionMode==="frontend"&&i.actionButtons.length>0?!0:i.actionMode==="api"?i.data.some(I=>I.actions&&I.actions.length>0):!1:!1),w=(I,z)=>{const R=I.target,j=R.closest(`.action-btn-${a.value}`),P=R.closest(`.action-main-div-body-${a.value}`),Ee=document.querySelector(".tabulator-tableholder");if(Ee&&j&&P){const ee=Ee.getBoundingClientRect(),W=P.querySelector(`.action-dropdown-${a.value}`);if(!W)return;const de=W.classList.contains("action-show");document.querySelectorAll(`.action-dropdown-${a.value}`).forEach(we=>we.classList.remove("action-show")),de||(document.addEventListener("click",C),M(W,ee))}i.actionMode=="frontend"?i.actionButtons.forEach(ee=>{R.classList.contains(ee.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ee.emit,z.getData()))}):i.actionMode=="api"&&z.getData().actions.forEach(ee=>{R.classList.contains(ee.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ee.emit,z.getData()))})},M=(I,z)=>{const R=I;R.style.top="",R.style.left="",R.style.right="",R.classList.add("action-show"),R.style.right="55px";const j=R.getBoundingClientRect();j.bottom>z.bottom-10&&(R.style.top=`-${j.height}px`)},C=I=>{const z=document.querySelector(".action-show"),R=document.getElementById(a.value),j=I.target.closest(".tabulator-row"),P=I.target.closest(`.action-main-div-body-${a.value}`);(!(R!=null&&R.contains(I.target))||!j&&!P)&&(z==null||z.classList.remove("action-show"),document.removeEventListener("click",C))},S=()=>{u.value=i.columns.filter(I=>d.value.includes(I.field)),i.action&&m.value&&u.value.push(g())},L=()=>{S(),p==null||p.setColumns(u.value),p==null||p.setPageSize(h.value),r.value=!1},H=()=>{r.value=!r.value};return c.onMounted(()=>{h.value=i.paginationSize,v()}),c.onBeforeUnmount(()=>{document.removeEventListener("click",C)}),c.watch(()=>i.data,I=>{p==null||p.setData(I),S(),p==null||p.setColumns(u.value)},{deep:!0}),c.watch(()=>i.columns,()=>{S(),p==null||p.setColumns(u.value)},{deep:!0}),(I,z)=>(c.openBlock(),c.createElementBlock("div",DT,[I.showOptions?(c.openBlock(),c.createElementBlock("div",zT,[c.createElementVNode("button",{onClick:H,class:"btn-outline btn-secondary group","aria-label":"Open settings"},[c.createVNode(Nx,{name:"Settings"})])])):c.createCommentVNode("",!0),c.createElementVNode("div",null,[c.createElementVNode("div",{ref:a.value,id:a.value,class:c.normalizeClass({"tabulator-action":I.action})},null,10,RT)]),c.createVNode(kx,{show:r.value,title:y.title,actions:y.action,width:"600px",onOnClose:z[3]||(z[3]=R=>r.value=!1),onOnSave:L},{default:c.withCtx(()=>[c.createElementVNode("div",HT,[c.createElementVNode("div",AT,[z[4]||(z[4]=c.createElementVNode("span",{class:"text-base font-semibold"},"Columns Attributes",-1)),c.createElementVNode("div",null,[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":z[0]||(z[0]=R=>l.value=R),class:"input-text mb-4",placeholder:"Search for attributes","aria-label":"Search columns"},null,512),[[c.vModelText,l.value]]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(f.value,R=>(c.openBlock(),c.createElementBlock("div",{key:R.field,class:"my-2"},[R.field!=="action"?(c.openBlock(),c.createElementBlock("div",VT,[c.withDirectives(c.createElementVNode("input",{type:"checkbox",disabled:!R.isNotMandatory,"onUpdate:modelValue":z[1]||(z[1]=j=>d.value=j),value:R.field,class:"mx-1.5",id:R.title,"aria-labelledby":"column-checkbox"},null,8,PT),[[c.vModelCheckbox,d.value]]),c.createElementVNode("label",{for:R.title,class:"select-none"},c.toDisplayString(R.title),9,BT)])):c.createCommentVNode("",!0)]))),128))])]),c.createElementVNode("div",qT,[z[5]||(z[5]=c.createElementVNode("span",{class:"text-base font-semibold"},"Page Size",-1)),c.createElementVNode("div",FT,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.paginationSizeSelector,R=>(c.openBlock(),c.createElementBlock("label",{key:R,class:"flex items-center mt-2"},[c.withDirectives(c.createElementVNode("input",{type:"radio","onUpdate:modelValue":z[2]||(z[2]=j=>h.value=j),value:R,class:"mr-2.5","aria-label":"Select page size"},null,8,OT),[[c.vModelRadio,h.value]]),c.createTextVNode(" "+c.toDisplayString(R),1)]))),128))])])])]),_:1},8,["show","title","actions"])]))}}),NT=["aria-checked"],_T={class:"text-[12px]"},nC=c.defineComponent({__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},onText:{default:"On"},offText:{default:"Off"},width:{default:"60px"},disable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,a=c.ref(t.modelValue);c.watch(()=>t.modelValue,r=>{a.value=r});const n=()=>{t.disable||(a.value=!a.value,i("update:modelValue",a.value))};return(r,l)=>(c.openBlock(),c.createElementBlock("button",{onClick:n,class:c.normalizeClass(["relative select-none h-[30px] rounded-default transition-colors duration-200 border border-border-foreground overflow-hidden",[r.disable?"cursor-not-allowed":"cursor-pointer"]]),style:c.normalizeStyle({width:r.width,maxWidth:r.width,minWidth:r.width}),role:"switch","aria-checked":a.value},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center justify-center w-1/2 h-full bg-gray-200 shadow-md transform transition-transform duration-200",a.value?"translate-x-full":"translate-x-0"])},[c.createElementVNode("span",_T,c.toDisplayString(a.value?r.onText:r.offText),1)],2)],14,NT))}}),WT={key:0,class:"fixed top-0 left-0 w-[100vw] h-[100vh] bg-background z-10 overflow-hidden"},UT={class:"flex z-10 w-[100vw] top-0 fixed justify-between px-4 py-3 bg-white border-b border-b-border max-h-[50px]"},$T={class:"h-fit my-auto font-bold text-lg relative flex text-[19px]"},GT={key:0},YT={key:3,width:"22px",height:"22px",class:"mt-[4px]",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZT={key:0,class:"flex justify-end fixed bottom-0 left-0 w-[100vw] bg-white border-t border-t-border max-h-[50px] px-4 py-3"},XT={class:"right-0 flex gap-2"},KT=["onClick"],JT=c.defineComponent({__name:"Towser",props:{show:{type:Boolean,default:!1},title:{},actions:{},double:{type:Boolean,default:!1},bodyWidth:{default:50},body2Width:{default:50}},setup(o,{emit:e}){const t=o,i=e,a=c.computed(()=>t.actions?"150px":"100px"),n=c.computed(()=>t.double?`${t.bodyWidth}%`:"100%"),r=c.computed(()=>`
8037
+ `}else return""},cellClick:w}),v=()=>{const I=document.getElementById(a.value);I&&(d.value=i.columns.map(z=>z.field),S(),p=new xT(I,{data:i.data,columns:u.value,placeholder:i.placeholder??"No records found!",pagination:!0,paginationSize:h.value,paginationSizeSelector:i.paginationSizeSelector,layout:"fitColumns",height:window.innerHeight-i.heightOffset}),p.on("rowClick",k))},k=(I,z)=>{const R=document.querySelector(".action-show");if(I.target.closest(`.action-btn-${a.value}`)||R==null||R.classList.remove("action-show"),i.action){I.preventDefault();const P=document.querySelector(".datarow-selected");P==null||P.classList.remove("datarow-selected"),z.getElement().classList.add("datarow-selected")}},m=c.computed(()=>i.action?i.actionMode==="frontend"&&i.actionButtons.length>0?!0:i.actionMode==="api"?i.data.some(I=>I.actions&&I.actions.length>0):!1:!1),w=(I,z)=>{const R=I.target,j=R.closest(`.action-btn-${a.value}`),P=R.closest(`.action-main-div-body-${a.value}`),Ee=document.querySelector(".tabulator-tableholder");if(Ee&&j&&P){const ee=Ee.getBoundingClientRect(),W=P.querySelector(`.action-dropdown-${a.value}`);if(!W)return;const de=W.classList.contains("action-show");document.querySelectorAll(`.action-dropdown-${a.value}`).forEach(we=>we.classList.remove("action-show")),de||(document.addEventListener("click",C),M(W,ee))}i.actionMode=="frontend"?i.actionButtons.forEach(ee=>{R.classList.contains(ee.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ee.emit,z.getData()))}):i.actionMode=="api"&&z.getData().actions.forEach(ee=>{R.classList.contains(ee.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ee.emit,z.getData()))})},M=(I,z)=>{const R=I;R.style.top="",R.style.left="",R.style.right="",R.classList.add("action-show"),R.style.right="35px";const j=R.getBoundingClientRect();j.bottom>z.bottom-10&&(R.style.top=`-${j.height}px`)},C=I=>{const z=document.querySelector(".action-show"),R=document.getElementById(a.value),j=I.target.closest(".tabulator-row"),P=I.target.closest(`.action-main-div-body-${a.value}`);(!(R!=null&&R.contains(I.target))||!j&&!P)&&(z==null||z.classList.remove("action-show"),document.removeEventListener("click",C))},S=()=>{u.value=i.columns.filter(I=>d.value.includes(I.field)),i.action&&m.value&&u.value.push(g())},L=()=>{S(),p==null||p.setColumns(u.value),p==null||p.setPageSize(h.value),r.value=!1},H=()=>{r.value=!r.value};return c.onMounted(()=>{h.value=i.paginationSize,v()}),c.onBeforeUnmount(()=>{document.removeEventListener("click",C)}),c.watch(()=>i.data,I=>{p==null||p.setData(I),S(),p==null||p.setColumns(u.value)},{deep:!0}),c.watch(()=>i.columns,()=>{S(),p==null||p.setColumns(u.value)},{deep:!0}),(I,z)=>(c.openBlock(),c.createElementBlock("div",DT,[I.showOptions?(c.openBlock(),c.createElementBlock("div",zT,[c.createElementVNode("button",{onClick:H,class:"btn-outline btn-secondary group","aria-label":"Open settings"},[c.createVNode(Nx,{name:"Settings"})])])):c.createCommentVNode("",!0),c.createElementVNode("div",null,[c.createElementVNode("div",{ref:a.value,id:a.value,class:c.normalizeClass({"tabulator-action":I.action})},null,10,RT)]),c.createVNode(kx,{show:r.value,title:y.title,actions:y.action,width:"600px",onOnClose:z[3]||(z[3]=R=>r.value=!1),onOnSave:L},{default:c.withCtx(()=>[c.createElementVNode("div",HT,[c.createElementVNode("div",AT,[z[4]||(z[4]=c.createElementVNode("span",{class:"text-base font-semibold"},"Columns Attributes",-1)),c.createElementVNode("div",null,[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":z[0]||(z[0]=R=>l.value=R),class:"input-text mb-4",placeholder:"Search for attributes","aria-label":"Search columns"},null,512),[[c.vModelText,l.value]]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(f.value,R=>(c.openBlock(),c.createElementBlock("div",{key:R.field,class:"my-2"},[R.field!=="action"?(c.openBlock(),c.createElementBlock("div",VT,[c.withDirectives(c.createElementVNode("input",{type:"checkbox",disabled:!R.isNotMandatory,"onUpdate:modelValue":z[1]||(z[1]=j=>d.value=j),value:R.field,class:"mx-1.5",id:R.title,"aria-labelledby":"column-checkbox"},null,8,PT),[[c.vModelCheckbox,d.value]]),c.createElementVNode("label",{for:R.title,class:"select-none"},c.toDisplayString(R.title),9,BT)])):c.createCommentVNode("",!0)]))),128))])]),c.createElementVNode("div",qT,[z[5]||(z[5]=c.createElementVNode("span",{class:"text-base font-semibold"},"Page Size",-1)),c.createElementVNode("div",FT,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.paginationSizeSelector,R=>(c.openBlock(),c.createElementBlock("label",{key:R,class:"flex items-center mt-2"},[c.withDirectives(c.createElementVNode("input",{type:"radio","onUpdate:modelValue":z[2]||(z[2]=j=>h.value=j),value:R,class:"mr-2.5","aria-label":"Select page size"},null,8,OT),[[c.vModelRadio,h.value]]),c.createTextVNode(" "+c.toDisplayString(R),1)]))),128))])])])]),_:1},8,["show","title","actions"])]))}}),NT=["aria-checked"],_T={class:"text-[12px]"},nC=c.defineComponent({__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},onText:{default:"On"},offText:{default:"Off"},width:{default:"60px"},disable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,a=c.ref(t.modelValue);c.watch(()=>t.modelValue,r=>{a.value=r});const n=()=>{t.disable||(a.value=!a.value,i("update:modelValue",a.value))};return(r,l)=>(c.openBlock(),c.createElementBlock("button",{onClick:n,class:c.normalizeClass(["relative select-none h-[30px] rounded-default transition-colors duration-200 border border-border-foreground overflow-hidden",[r.disable?"cursor-not-allowed":"cursor-pointer"]]),style:c.normalizeStyle({width:r.width,maxWidth:r.width,minWidth:r.width}),role:"switch","aria-checked":a.value},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center justify-center w-1/2 h-full bg-gray-200 shadow-md transform transition-transform duration-200",a.value?"translate-x-full":"translate-x-0"])},[c.createElementVNode("span",_T,c.toDisplayString(a.value?r.onText:r.offText),1)],2)],14,NT))}}),WT={key:0,class:"fixed top-0 left-0 w-[100vw] h-[100vh] bg-background z-10 overflow-hidden"},UT={class:"flex z-10 w-[100vw] top-0 fixed justify-between px-4 py-3 bg-white border-b border-b-border max-h-[50px]"},$T={class:"h-fit my-auto font-bold text-lg relative flex text-[19px]"},GT={key:0},YT={key:3,width:"22px",height:"22px",class:"mt-[4px]",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZT={key:0,class:"flex justify-end fixed bottom-0 left-0 w-[100vw] bg-white border-t border-t-border max-h-[50px] px-4 py-3"},XT={class:"right-0 flex gap-2"},KT=["onClick"],JT=c.defineComponent({__name:"Towser",props:{show:{type:Boolean,default:!1},title:{},actions:{},double:{type:Boolean,default:!1},bodyWidth:{default:50},body2Width:{default:50}},setup(o,{emit:e}){const t=o,i=e,a=c.computed(()=>t.actions?"150px":"100px"),n=c.computed(()=>t.double?`${t.bodyWidth}%`:"100%"),r=c.computed(()=>`
8038
8038
  min-height: calc(100vh - ${a.value});
8039
8039
  max-height: calc(100vh - ${a.value});
8040
8040
  width: ${n.value}
@@ -41419,7 +41419,7 @@ const uD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41419
41419
  });
41420
41420
  }, w = (z, A) => {
41421
41421
  const P = z;
41422
- P.style.top = "", P.style.left = "", P.style.right = "", P.classList.add("action-show"), P.style.right = "55px";
41422
+ P.style.top = "", P.style.left = "", P.style.right = "", P.classList.add("action-show"), P.style.right = "35px";
41423
41423
  const G = P.getBoundingClientRect();
41424
41424
  G.bottom > A.bottom - 10 && (P.style.top = `-${G.height}px`);
41425
41425
  }, L = (z) => {
@@ -8034,7 +8034,7 @@ Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.ad
8034
8034
  ${R}
8035
8035
  </div>
8036
8036
  </div>
8037
- `}else return""},cellClick:v}),b=()=>{const I=document.getElementById(a.value);I&&(d.value=i.columns.map(z=>z.field),S(),p=new bT(I,{data:i.data,columns:u.value,placeholder:i.placeholder??"No records found!",pagination:!0,paginationSize:h.value,paginationSizeSelector:i.paginationSizeSelector,layout:"fitColumns",height:window.innerHeight-i.heightOffset}),p.on("rowClick",k))},k=(I,z)=>{const R=document.querySelector(".action-show");if(I.target.closest(`.action-btn-${a.value}`)||R==null||R.classList.remove("action-show"),i.action){I.preventDefault();const P=document.querySelector(".datarow-selected");P==null||P.classList.remove("datarow-selected"),z.getElement().classList.add("datarow-selected")}},m=c.computed(()=>i.action?i.actionMode==="frontend"&&i.actionButtons.length>0?!0:i.actionMode==="api"?i.data.some(I=>I.actions&&I.actions.length>0):!1:!1),v=(I,z)=>{const R=I.target,N=R.closest(`.action-btn-${a.value}`),P=R.closest(`.action-main-div-body-${a.value}`),Re=document.querySelector(".tabulator-tableholder");if(Re&&N&&P){const ie=Re.getBoundingClientRect(),U=P.querySelector(`.action-dropdown-${a.value}`);if(!U)return;const be=U.classList.contains("action-show");document.querySelectorAll(`.action-dropdown-${a.value}`).forEach(Le=>Le.classList.remove("action-show")),be||(document.addEventListener("click",C),M(U,ie))}i.actionMode=="frontend"?i.actionButtons.forEach(ie=>{R.classList.contains(ie.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ie.emit,z.getData()))}):i.actionMode=="api"&&z.getData().actions.forEach(ie=>{R.classList.contains(ie.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ie.emit,z.getData()))})},M=(I,z)=>{const R=I;R.style.top="",R.style.left="",R.style.right="",R.classList.add("action-show"),R.style.right="55px";const N=R.getBoundingClientRect();N.bottom>z.bottom-10&&(R.style.top=`-${N.height}px`)},C=I=>{const z=document.querySelector(".action-show"),R=document.getElementById(a.value),N=I.target.closest(".tabulator-row"),P=I.target.closest(`.action-main-div-body-${a.value}`);(!(R!=null&&R.contains(I.target))||!N&&!P)&&(z==null||z.classList.remove("action-show"),document.removeEventListener("click",C))},S=()=>{u.value=i.columns.filter(I=>d.value.includes(I.field)),i.action&&m.value&&u.value.push(g())},L=()=>{S(),p==null||p.setColumns(u.value),p==null||p.setPageSize(h.value),r.value=!1},H=()=>{r.value=!r.value};return c.onMounted(()=>{h.value=i.paginationSize,b()}),c.onBeforeUnmount(()=>{document.removeEventListener("click",C)}),c.watch(()=>i.data,I=>{p==null||p.setData(I),S(),p==null||p.setColumns(u.value)},{deep:!0}),c.watch(()=>i.columns,()=>{S(),p==null||p.setColumns(u.value)},{deep:!0}),(I,z)=>(c.openBlock(),c.createElementBlock("div",LT,[I.showOptions?(c.openBlock(),c.createElementBlock("div",ET,[c.createElementVNode("button",{onClick:H,class:"btn-outline btn-secondary group","aria-label":"Open settings"},[c.createVNode(cx,{name:"Settings"})])])):c.createCommentVNode("",!0),c.createElementVNode("div",null,[c.createElementVNode("div",{ref:a.value,id:a.value,class:c.normalizeClass({"tabulator-action":I.action})},null,10,ST)]),c.createVNode(qC,{show:r.value,title:y.title,actions:y.action,width:"600px",onOnClose:z[3]||(z[3]=R=>r.value=!1),onOnSave:L},{default:c.withCtx(()=>[c.createElementVNode("div",IT,[c.createElementVNode("div",TT,[z[4]||(z[4]=c.createElementVNode("span",{class:"text-base font-semibold"},"Columns Attributes",-1)),c.createElementVNode("div",null,[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":z[0]||(z[0]=R=>l.value=R),class:"input-text mb-4",placeholder:"Search for attributes","aria-label":"Search columns"},null,512),[[c.vModelText,l.value]]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(f.value,R=>(c.openBlock(),c.createElementBlock("div",{key:R.field,class:"my-2"},[R.field!=="action"?(c.openBlock(),c.createElementBlock("div",DT,[c.withDirectives(c.createElementVNode("input",{type:"checkbox",disabled:!R.isNotMandatory,"onUpdate:modelValue":z[1]||(z[1]=N=>d.value=N),value:R.field,class:"mx-1.5",id:R.title,"aria-labelledby":"column-checkbox"},null,8,zT),[[c.vModelCheckbox,d.value]]),c.createElementVNode("label",{for:R.title,class:"select-none"},c.toDisplayString(R.title),9,RT)])):c.createCommentVNode("",!0)]))),128))])]),c.createElementVNode("div",HT,[z[5]||(z[5]=c.createElementVNode("span",{class:"text-base font-semibold"},"Page Size",-1)),c.createElementVNode("div",AT,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.paginationSizeSelector,R=>(c.openBlock(),c.createElementBlock("label",{key:R,class:"flex items-center mt-2"},[c.withDirectives(c.createElementVNode("input",{type:"radio","onUpdate:modelValue":z[2]||(z[2]=N=>h.value=N),value:R,class:"mr-2.5","aria-label":"Select page size"},null,8,VT),[[c.vModelRadio,h.value]]),c.createTextVNode(" "+c.toDisplayString(R),1)]))),128))])])])]),_:1},8,["show","title","actions"])]))}}),BT=["aria-checked"],qT={class:"text-[12px]"},F9=c.defineComponent({__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},onText:{default:"On"},offText:{default:"Off"},width:{default:"60px"},disable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,a=c.ref(t.modelValue);c.watch(()=>t.modelValue,r=>{a.value=r});const n=()=>{t.disable||(a.value=!a.value,i("update:modelValue",a.value))};return(r,l)=>(c.openBlock(),c.createElementBlock("button",{onClick:n,class:c.normalizeClass(["relative select-none h-[30px] rounded-default transition-colors duration-200 border border-border-foreground overflow-hidden",[r.disable?"cursor-not-allowed":"cursor-pointer"]]),style:c.normalizeStyle({width:r.width,maxWidth:r.width,minWidth:r.width}),role:"switch","aria-checked":a.value},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center justify-center w-1/2 h-full bg-gray-200 shadow-md transform transition-transform duration-200",a.value?"translate-x-full":"translate-x-0"])},[c.createElementVNode("span",qT,c.toDisplayString(a.value?r.onText:r.offText),1)],2)],14,BT))}}),FT={key:0,class:"fixed top-0 left-0 w-[100vw] h-[100vh] bg-background z-10 overflow-hidden"},OT={class:"flex z-10 w-[100vw] top-0 fixed justify-between px-4 py-3 bg-white border-b border-b-border max-h-[50px]"},jT={class:"h-fit my-auto font-bold text-lg relative flex text-[19px]"},NT={key:0},_T={key:3,width:"22px",height:"22px",class:"mt-[4px]",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WT={key:0,class:"flex justify-end fixed bottom-0 left-0 w-[100vw] bg-white border-t border-t-border max-h-[50px] px-4 py-3"},UT={class:"right-0 flex gap-2"},$T=["onClick"],GT=c.defineComponent({__name:"Towser",props:{show:{type:Boolean,default:!1},title:{},actions:{},double:{type:Boolean,default:!1},bodyWidth:{default:50},body2Width:{default:50}},setup(o,{emit:e}){const t=o,i=e,a=c.computed(()=>t.actions?"150px":"100px"),n=c.computed(()=>t.double?`${t.bodyWidth}%`:"100%"),r=c.computed(()=>`
8037
+ `}else return""},cellClick:v}),b=()=>{const I=document.getElementById(a.value);I&&(d.value=i.columns.map(z=>z.field),S(),p=new bT(I,{data:i.data,columns:u.value,placeholder:i.placeholder??"No records found!",pagination:!0,paginationSize:h.value,paginationSizeSelector:i.paginationSizeSelector,layout:"fitColumns",height:window.innerHeight-i.heightOffset}),p.on("rowClick",k))},k=(I,z)=>{const R=document.querySelector(".action-show");if(I.target.closest(`.action-btn-${a.value}`)||R==null||R.classList.remove("action-show"),i.action){I.preventDefault();const P=document.querySelector(".datarow-selected");P==null||P.classList.remove("datarow-selected"),z.getElement().classList.add("datarow-selected")}},m=c.computed(()=>i.action?i.actionMode==="frontend"&&i.actionButtons.length>0?!0:i.actionMode==="api"?i.data.some(I=>I.actions&&I.actions.length>0):!1:!1),v=(I,z)=>{const R=I.target,N=R.closest(`.action-btn-${a.value}`),P=R.closest(`.action-main-div-body-${a.value}`),Re=document.querySelector(".tabulator-tableholder");if(Re&&N&&P){const ie=Re.getBoundingClientRect(),U=P.querySelector(`.action-dropdown-${a.value}`);if(!U)return;const be=U.classList.contains("action-show");document.querySelectorAll(`.action-dropdown-${a.value}`).forEach(Le=>Le.classList.remove("action-show")),be||(document.addEventListener("click",C),M(U,ie))}i.actionMode=="frontend"?i.actionButtons.forEach(ie=>{R.classList.contains(ie.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ie.emit,z.getData()))}):i.actionMode=="api"&&z.getData().actions.forEach(ie=>{R.classList.contains(ie.name.replace(" ","_").toLowerCase()+"_"+z.getData().id+"_"+a.value)&&n&&(z.getRow().getData().id,n(ie.emit,z.getData()))})},M=(I,z)=>{const R=I;R.style.top="",R.style.left="",R.style.right="",R.classList.add("action-show"),R.style.right="35px";const N=R.getBoundingClientRect();N.bottom>z.bottom-10&&(R.style.top=`-${N.height}px`)},C=I=>{const z=document.querySelector(".action-show"),R=document.getElementById(a.value),N=I.target.closest(".tabulator-row"),P=I.target.closest(`.action-main-div-body-${a.value}`);(!(R!=null&&R.contains(I.target))||!N&&!P)&&(z==null||z.classList.remove("action-show"),document.removeEventListener("click",C))},S=()=>{u.value=i.columns.filter(I=>d.value.includes(I.field)),i.action&&m.value&&u.value.push(g())},L=()=>{S(),p==null||p.setColumns(u.value),p==null||p.setPageSize(h.value),r.value=!1},H=()=>{r.value=!r.value};return c.onMounted(()=>{h.value=i.paginationSize,b()}),c.onBeforeUnmount(()=>{document.removeEventListener("click",C)}),c.watch(()=>i.data,I=>{p==null||p.setData(I),S(),p==null||p.setColumns(u.value)},{deep:!0}),c.watch(()=>i.columns,()=>{S(),p==null||p.setColumns(u.value)},{deep:!0}),(I,z)=>(c.openBlock(),c.createElementBlock("div",LT,[I.showOptions?(c.openBlock(),c.createElementBlock("div",ET,[c.createElementVNode("button",{onClick:H,class:"btn-outline btn-secondary group","aria-label":"Open settings"},[c.createVNode(cx,{name:"Settings"})])])):c.createCommentVNode("",!0),c.createElementVNode("div",null,[c.createElementVNode("div",{ref:a.value,id:a.value,class:c.normalizeClass({"tabulator-action":I.action})},null,10,ST)]),c.createVNode(qC,{show:r.value,title:y.title,actions:y.action,width:"600px",onOnClose:z[3]||(z[3]=R=>r.value=!1),onOnSave:L},{default:c.withCtx(()=>[c.createElementVNode("div",IT,[c.createElementVNode("div",TT,[z[4]||(z[4]=c.createElementVNode("span",{class:"text-base font-semibold"},"Columns Attributes",-1)),c.createElementVNode("div",null,[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":z[0]||(z[0]=R=>l.value=R),class:"input-text mb-4",placeholder:"Search for attributes","aria-label":"Search columns"},null,512),[[c.vModelText,l.value]]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(f.value,R=>(c.openBlock(),c.createElementBlock("div",{key:R.field,class:"my-2"},[R.field!=="action"?(c.openBlock(),c.createElementBlock("div",DT,[c.withDirectives(c.createElementVNode("input",{type:"checkbox",disabled:!R.isNotMandatory,"onUpdate:modelValue":z[1]||(z[1]=N=>d.value=N),value:R.field,class:"mx-1.5",id:R.title,"aria-labelledby":"column-checkbox"},null,8,zT),[[c.vModelCheckbox,d.value]]),c.createElementVNode("label",{for:R.title,class:"select-none"},c.toDisplayString(R.title),9,RT)])):c.createCommentVNode("",!0)]))),128))])]),c.createElementVNode("div",HT,[z[5]||(z[5]=c.createElementVNode("span",{class:"text-base font-semibold"},"Page Size",-1)),c.createElementVNode("div",AT,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.paginationSizeSelector,R=>(c.openBlock(),c.createElementBlock("label",{key:R,class:"flex items-center mt-2"},[c.withDirectives(c.createElementVNode("input",{type:"radio","onUpdate:modelValue":z[2]||(z[2]=N=>h.value=N),value:R,class:"mr-2.5","aria-label":"Select page size"},null,8,VT),[[c.vModelRadio,h.value]]),c.createTextVNode(" "+c.toDisplayString(R),1)]))),128))])])])]),_:1},8,["show","title","actions"])]))}}),BT=["aria-checked"],qT={class:"text-[12px]"},F9=c.defineComponent({__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},onText:{default:"On"},offText:{default:"Off"},width:{default:"60px"},disable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:e}){const t=o,i=e,a=c.ref(t.modelValue);c.watch(()=>t.modelValue,r=>{a.value=r});const n=()=>{t.disable||(a.value=!a.value,i("update:modelValue",a.value))};return(r,l)=>(c.openBlock(),c.createElementBlock("button",{onClick:n,class:c.normalizeClass(["relative select-none h-[30px] rounded-default transition-colors duration-200 border border-border-foreground overflow-hidden",[r.disable?"cursor-not-allowed":"cursor-pointer"]]),style:c.normalizeStyle({width:r.width,maxWidth:r.width,minWidth:r.width}),role:"switch","aria-checked":a.value},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center justify-center w-1/2 h-full bg-gray-200 shadow-md transform transition-transform duration-200",a.value?"translate-x-full":"translate-x-0"])},[c.createElementVNode("span",qT,c.toDisplayString(a.value?r.onText:r.offText),1)],2)],14,BT))}}),FT={key:0,class:"fixed top-0 left-0 w-[100vw] h-[100vh] bg-background z-10 overflow-hidden"},OT={class:"flex z-10 w-[100vw] top-0 fixed justify-between px-4 py-3 bg-white border-b border-b-border max-h-[50px]"},jT={class:"h-fit my-auto font-bold text-lg relative flex text-[19px]"},NT={key:0},_T={key:3,width:"22px",height:"22px",class:"mt-[4px]",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WT={key:0,class:"flex justify-end fixed bottom-0 left-0 w-[100vw] bg-white border-t border-t-border max-h-[50px] px-4 py-3"},UT={class:"right-0 flex gap-2"},$T=["onClick"],GT=c.defineComponent({__name:"Towser",props:{show:{type:Boolean,default:!1},title:{},actions:{},double:{type:Boolean,default:!1},bodyWidth:{default:50},body2Width:{default:50}},setup(o,{emit:e}){const t=o,i=e,a=c.computed(()=>t.actions?"150px":"100px"),n=c.computed(()=>t.double?`${t.bodyWidth}%`:"100%"),r=c.computed(()=>`
8038
8038
  min-height: calc(100vh - ${a.value});
8039
8039
  max-height: calc(100vh - ${a.value});
8040
8040
  width: ${n.value}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dolphin-components",
3
3
  "private": false,
4
- "version": "2.2.8",
4
+ "version": "2.2.9",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -46,7 +46,7 @@
46
46
  "vue-router": "^4.5.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "^22.15.24",
49
+ "@types/node": "^22.15.29",
50
50
  "@vitejs/plugin-vue": "^5.2.4",
51
51
  "@vue/tsconfig": "^0.7.0",
52
52
  "path": "^0.12.7",